@nkzw/fate 1.5.0 → 1.5.2
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 +5 -7
- package/docs/api/classes/FateClient.md +39 -39
- package/docs/api/functions/clientRoot.md +1 -1
- package/docs/api/functions/createClient.md +1 -1
- package/docs/api/functions/createGraphQLTransport.md +1 -1
- package/docs/api/functions/createHTTPTransport.md +1 -1
- package/docs/api/functions/createTRPCTransport.md +1 -1
- package/docs/api/functions/defer.md +1 -1
- package/docs/api/functions/getDeferredMetadata.md +1 -1
- package/docs/api/functions/getListEntries.md +1 -1
- package/docs/api/functions/getSelectionPlan.md +1 -1
- package/docs/api/functions/graphqlMutation.md +1 -1
- package/docs/api/functions/isDeferred.md +1 -1
- package/docs/api/functions/isRecord.md +1 -1
- package/docs/api/functions/isViewTag.md +1 -1
- package/docs/api/functions/liveConnectionTopic.md +1 -1
- package/docs/api/functions/liveEntityTopic.md +1 -1
- package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
- package/docs/api/functions/mutation.md +1 -1
- package/docs/api/functions/toEntityId.md +1 -1
- package/docs/api/functions/view.md +1 -1
- package/docs/api/index.md +2 -0
- package/docs/api/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Persistence.md +1 -19
- package/docs/api/interfaces/PersistenceSession.md +10 -10
- package/docs/api/interfaces/Transport.md +8 -8
- package/docs/api/server/classes/FateRequestError.md +5 -5
- package/docs/api/server/drizzle/functions/createDrizzleFate.md +3 -3
- package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
- package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
- package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
- package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
- package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
- package/docs/api/server/functions/bindSourceProcedures.md +1 -1
- package/docs/api/server/functions/computed.md +1 -1
- package/docs/api/server/functions/count.md +1 -1
- package/docs/api/server/functions/createFateFetchHandler.md +1 -1
- package/docs/api/server/functions/createFateServer.md +1 -1
- package/docs/api/server/functions/createHonoFateHandler.md +1 -1
- package/docs/api/server/functions/createLiveEventBus.md +1 -1
- package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
- package/docs/api/server/functions/createResolver.md +1 -1
- package/docs/api/server/functions/createSourcePlan.md +1 -1
- package/docs/api/server/functions/createSourceProcedures.md +1 -1
- package/docs/api/server/functions/dataView.md +1 -1
- package/docs/api/server/functions/field.md +1 -1
- package/docs/api/server/functions/getNestedSelection.md +1 -1
- package/docs/api/server/functions/getScopedArgs.md +1 -1
- package/docs/api/server/functions/hasNestedSelection.md +1 -1
- package/docs/api/server/functions/list.md +1 -1
- package/docs/api/server/functions/refetchSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceById.md +1 -1
- package/docs/api/server/functions/resolveSourceByIds.md +1 -1
- package/docs/api/server/functions/resolveSourceConnection.md +2 -2
- package/docs/api/server/functions/resolver.md +1 -1
- package/docs/api/server/functions/toPrismaSelect.md +1 -1
- package/docs/api/server/functions/withConnection.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaFate.md +3 -3
- package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
- package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
- package/docs/api/server/prisma/functions/prismaConnectionArgs.md +2 -2
- package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
- package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
- package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
- package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
- package/docs/api/server/type-aliases/ComputedField.md +5 -5
- package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
- package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
- package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
- package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
- package/docs/api/server/type-aliases/CountSelection.md +4 -4
- package/docs/api/server/type-aliases/CountWhere.md +1 -1
- package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
- package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
- package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
- package/docs/api/server/type-aliases/DataViewResult.md +1 -1
- package/docs/api/server/type-aliases/Entity.md +1 -1
- package/docs/api/server/type-aliases/FateServer.md +5 -5
- package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
- package/docs/api/server/type-aliases/FieldSelection.md +3 -3
- package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
- package/docs/api/server/type-aliases/LiveEventType.md +1 -1
- package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
- package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
- package/docs/api/server/type-aliases/OrderDirection.md +1 -1
- package/docs/api/server/type-aliases/SourceConfig.md +6 -6
- package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
- package/docs/api/server/type-aliases/SourceOrder.md +1 -1
- package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
- package/docs/api/server/type-aliases/SourcePlan.md +1 -1
- package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
- package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
- package/docs/api/server/type-aliases/SourceRelation.md +1 -1
- package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
- package/docs/api/server/variables/byIdInput.md +1 -1
- package/docs/api/server/variables/connectionArgs.md +1 -1
- package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
- package/docs/api/type-aliases/ConnectionRef.md +1 -1
- package/docs/api/type-aliases/Deferred.md +1 -1
- package/docs/api/type-aliases/DeferredMetadata.md +1 -1
- package/docs/api/type-aliases/DeferredSelection.md +1 -1
- package/docs/api/type-aliases/DeferredSnapshot.md +1 -1
- package/docs/api/type-aliases/Entity.md +2 -2
- package/docs/api/type-aliases/EntityId.md +1 -1
- package/docs/api/type-aliases/FateDehydratedState.md +1 -1
- package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
- package/docs/api/type-aliases/FateLiveEvent.md +1 -1
- package/docs/api/type-aliases/FateMutations.md +1 -1
- package/docs/api/type-aliases/FateOperation.md +1 -1
- package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
- package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
- package/docs/api/type-aliases/FateRecord.md +1 -1
- package/docs/api/type-aliases/FateRoots.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
- package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
- package/docs/api/type-aliases/GraphQLTransportOptions.md +12 -12
- package/docs/api/type-aliases/HydrateOptions.md +1 -1
- package/docs/api/type-aliases/HydrationLimits.md +1 -1
- package/docs/api/type-aliases/InferFateAPI.md +1 -1
- package/docs/api/type-aliases/List.md +1 -1
- package/docs/api/type-aliases/ListEntry.md +1 -1
- package/docs/api/type-aliases/ListItem.md +1 -1
- package/docs/api/type-aliases/Mask.md +1 -1
- package/docs/api/type-aliases/MutationDefinition.md +1 -1
- package/docs/api/type-aliases/MutationEntity.md +1 -1
- package/docs/api/type-aliases/MutationIdentifier.md +1 -1
- package/docs/api/type-aliases/MutationIdentity.md +1 -1
- package/docs/api/type-aliases/MutationInput.md +1 -1
- package/docs/api/type-aliases/MutationResult.md +1 -1
- package/docs/api/type-aliases/NodesItem.md +1 -1
- package/docs/api/type-aliases/Pagination.md +5 -5
- package/docs/api/type-aliases/PersistedMutationStatus.md +5 -0
- package/docs/api/type-aliases/PersistenceSnapshot.md +2 -2
- package/docs/api/type-aliases/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +2 -2
- package/docs/api/type-aliases/RequestPersistenceOptions.md +5 -0
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/TypeConfig.md +4 -4
- package/docs/api/type-aliases/View.md +1 -1
- package/docs/api/type-aliases/ViewData.md +1 -1
- package/docs/api/type-aliases/ViewEntity.md +1 -1
- package/docs/api/type-aliases/ViewEntityName.md +1 -1
- package/docs/api/type-aliases/ViewRef.md +1 -1
- package/docs/api/type-aliases/ViewSelection.md +1 -1
- package/docs/api/type-aliases/ViewSnapshot.md +1 -1
- package/docs/api/type-aliases/ViewTag.md +1 -1
- package/docs/api/variables/ConnectionTag.md +1 -1
- package/docs/api/variables/DeferTag.md +1 -1
- package/docs/api/variables/DeferredTag.md +1 -1
- package/docs/guide/persistence.md +5 -7
- package/lib/clientStub.d.mts +4 -5
- package/lib/{executor-DoiTBiVv.d.mts → executor-oPTYqgQV.d.mts} +1 -1
- package/lib/{graphqlTransport-DGLYyRxL.d.mts → graphqlTransport-CGYE4NdD.d.mts} +1 -1
- package/lib/graphqlTransport.d.mts +1 -1
- package/lib/idempotency-types-DuqJ7KSd.d.mts +16 -0
- package/lib/idempotency.d.mts +8 -8
- package/lib/index.d.mts +12 -12
- package/lib/index.mjs +25 -15
- package/lib/{list-BRT1VtiT.d.mts → list-5hrTVoiB.d.mts} +1 -1
- package/lib/list.d.mts +1 -1
- package/lib/persistence.d.mts +21 -19
- package/lib/persistence.mjs +553 -352
- package/lib/{record-DITM4zb_.d.mts → record-Dxjvpsep.d.mts} +3 -3
- package/lib/server/drizzle.d.mts +14 -13
- package/lib/server/prisma.d.mts +14 -13
- package/lib/server.d.mts +9 -9
- package/lib/{store-CeatPJeK.mjs → store-CakBBzWG.mjs} +47 -11
- package/lib/{transport-DqjhjLfC.d.mts → transport-DR0fwleU.d.mts} +29 -16
- package/lib/vite.d.mts +3 -3
- package/package.json +3 -3
- package/lib/idempotency-types-CqA-BFpn.d.mts +0 -15
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
> **List** = `Readonly`\<\{ `backwardPageLimit?`: `number`; `cursors?`: `ReadonlyArray`\<`string` \| `undefined`\>; `forwardPageLimit?`: `number`; `ids`: `ReadonlyArray`\<[`EntityId`](EntityId.md)\>; `liveAfterIds?`: `ReadonlyArray`\<[`EntityId`](EntityId.md)\>; `liveBeforeIds?`: `ReadonlyArray`\<[`EntityId`](EntityId.md)\>; `pagination?`: [`Pagination`](Pagination.md); `pendingAfterIds?`: `ReadonlyArray`\<[`EntityId`](EntityId.md)\>; `pendingBeforeIds?`: `ReadonlyArray`\<[`EntityId`](EntityId.md)\>; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/store.ts:16](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/store.ts#L16)
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
> **ListEntry** = `Readonly`\<\{ `cursor?`: `string`; `id`: [`EntityId`](EntityId.md); \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/list.ts:4](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/list.ts#L4)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **ListItem**\<`V`\> = `Readonly`\<\{ `args?`: `Record`\<`string`, `unknown`\>; `list`: `V`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:347](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L347)
|
|
6
6
|
|
|
7
7
|
Definition of a list request for fetching data from the backend.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Mask**\<`T`, `S`\> = `WithNullish`\<`T`, `MaskNonNullish`\<`NonNullish`\<`T`\>, `S`\>\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:331](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L331)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationDefinition**\<`T`, `I`, `R`\> = `Readonly`\<\{ `__fate__mutation`: `true`; `entity`: `T`\[`"__typename"`\]; \}\> & `__MutationEntityAnchor`\<`T`\> & `__MutationInputAnchor`\<`I`\> & `__MutationResultAnchor`\<`R`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:465](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L465)
|
|
6
6
|
|
|
7
7
|
Metadata describing a mutation for a particular entity, input, and output.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationEntity**\<`M`\> = `M` *extends* `__MutationEntityAnchor`\<infer E\> ? `E` : `never`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:483](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L483)
|
|
6
6
|
|
|
7
7
|
Extracts the entity type from a mutation definition or identifier.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationIdentifier**\<`T`, `I`, `R`\> = [`MutationDefinition`](MutationDefinition.md)\<`T`, `I`, `R`\> & `Readonly`\<\{ `key`: `string`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:473](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L473)
|
|
6
6
|
|
|
7
7
|
## Type Parameters
|
|
8
8
|
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationIdentity** = `Readonly`\<\{ `id`: `string`; `replayOnly?`: `true`; `scope`: `string`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/persistence-types.ts:7](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/persistence-types.ts#L7)
|
|
6
6
|
|
|
7
7
|
Identity of one logical mutation, reused across every delivery attempt.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationInput**\<`M`\> = `M` *extends* `__MutationInputAnchor`\<infer I\> ? `I` : `never`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:477](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L477)
|
|
6
6
|
|
|
7
7
|
Extracts the input type from a mutation definition or identifier.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **MutationResult**\<`M`\> = `M` *extends* `__MutationResultAnchor`\<infer R\> ? `R` : `never`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:480](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L480)
|
|
6
6
|
|
|
7
7
|
Extracts the result type from a mutation definition or identifier.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **NodesItem**\<`V`\> = `Readonly`\<\{ `ids`: `ReadonlyArray`\<`string` \| `number`\>; `view`: `V`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:365](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L365)
|
|
6
6
|
|
|
7
7
|
Definition of a node request with explicit IDs for fetching data from the backend.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **Pagination** = `object`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:130](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L130)
|
|
6
6
|
|
|
7
7
|
Pagination state returned alongside connection lists.
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ Pagination state returned alongside connection lists.
|
|
|
12
12
|
|
|
13
13
|
> **hasNext**: `boolean`
|
|
14
14
|
|
|
15
|
-
Defined in: [
|
|
15
|
+
Defined in: [fate/src/types.ts:131](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L131)
|
|
16
16
|
|
|
17
17
|
***
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ Defined in: [packages/fate/src/types.ts:131](https://github.com/nkzw-tech/fate/b
|
|
|
20
20
|
|
|
21
21
|
> **hasPrevious**: `boolean`
|
|
22
22
|
|
|
23
|
-
Defined in: [
|
|
23
|
+
Defined in: [fate/src/types.ts:132](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L132)
|
|
24
24
|
|
|
25
25
|
***
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ Defined in: [packages/fate/src/types.ts:132](https://github.com/nkzw-tech/fate/b
|
|
|
28
28
|
|
|
29
29
|
> `optional` **nextCursor?**: `string`
|
|
30
30
|
|
|
31
|
-
Defined in: [
|
|
31
|
+
Defined in: [fate/src/types.ts:133](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L133)
|
|
32
32
|
|
|
33
33
|
***
|
|
34
34
|
|
|
@@ -36,4 +36,4 @@ Defined in: [packages/fate/src/types.ts:133](https://github.com/nkzw-tech/fate/b
|
|
|
36
36
|
|
|
37
37
|
> `optional` **previousCursor?**: `string`
|
|
38
38
|
|
|
39
|
-
Defined in: [
|
|
39
|
+
Defined in: [fate/src/types.ts:134](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L134)
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: PersistedMutationStatus
|
|
2
|
+
|
|
3
|
+
> **PersistedMutationStatus** = `Readonly`\<\{ `error?`: `string`; `id`: `string`; `input`: `unknown`; `name`: `string`; `status`: `"queued"` \| `"sending"` \| `"failed"`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: [fate/src/persistence-types.ts:20](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/persistence-types.ts#L20)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: PersistenceSnapshot
|
|
2
2
|
|
|
3
|
-
> **PersistenceSnapshot** = `Readonly`\<\{ `error?`: `Error`; `mutations`: `ReadonlyArray
|
|
3
|
+
> **PersistenceSnapshot** = `Readonly`\<\{ `error?`: `Error`; `mutations`: `ReadonlyArray`\<[`PersistedMutationStatus`](PersistedMutationStatus.md)\>; `status`: `"restoring"` \| `"ready"` \| `"error"` \| `"disposed"`; \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/persistence-types.ts:28](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/persistence-types.ts#L28)
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **Request** = `Record`\<`string`, `RequestItem`\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:377](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L377)
|
|
6
6
|
|
|
7
7
|
Collection of node and list requests describing the data a screen needs.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> **RequestMode** = `"cache-first"` \| `"stale-while-revalidate"` \| `"network-only"`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/client.ts:96](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/client.ts#L96)
|
|
6
6
|
|
|
7
7
|
Strategy used when resolving a request.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Type Alias: RequestOptions
|
|
2
2
|
|
|
3
|
-
> **RequestOptions** = `Readonly`\<\{ `mode?`: [`RequestMode`](RequestMode.md); `persist?`:
|
|
3
|
+
> **RequestOptions** = `Readonly`\<\{ `mode?`: [`RequestMode`](RequestMode.md); `persist?`: [`RequestPersistenceOptions`](RequestPersistenceOptions.md); \}\>
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/client.ts:107](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/client.ts#L107)
|
|
6
6
|
|
|
7
7
|
Request options that affect how requests are fetched and retained.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Type Alias: RequestPersistenceOptions
|
|
2
|
+
|
|
3
|
+
> **RequestPersistenceOptions** = `Readonly`\<\{ `maxAge`: `number`; \}\>
|
|
4
|
+
|
|
5
|
+
Defined in: [fate/src/persistence-types.ts:34](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/persistence-types.ts#L34)
|
|
@@ -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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:423](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L423)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:228](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L228)
|
|
6
6
|
|
|
7
7
|
Declarative selection of the fields a view needs from an entity.
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> **TypeConfig** = `object`
|
|
4
4
|
|
|
5
|
-
Defined in: [
|
|
5
|
+
Defined in: [fate/src/types.ts:123](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L123)
|
|
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: [
|
|
15
|
+
Defined in: [fate/src/types.ts:124](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L124)
|
|
16
16
|
|
|
17
17
|
***
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ Defined in: [packages/fate/src/types.ts:124](https://github.com/nkzw-tech/fate/b
|
|
|
20
20
|
|
|
21
21
|
> **getId**: (`record`) => `string` \| `number`
|
|
22
22
|
|
|
23
|
-
Defined in: [
|
|
23
|
+
Defined in: [fate/src/types.ts:125](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L125)
|
|
24
24
|
|
|
25
25
|
#### Parameters
|
|
26
26
|
|
|
@@ -38,4 +38,4 @@ Defined in: [packages/fate/src/types.ts:125](https://github.com/nkzw-tech/fate/b
|
|
|
38
38
|
|
|
39
39
|
> **type**: `string`
|
|
40
40
|
|
|
41
|
-
Defined in: [
|
|
41
|
+
Defined in: [fate/src/types.ts:126](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L126)
|
|
@@ -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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:244](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L244)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:260](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L260)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:334](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L334)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:337](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L337)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:107](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L107)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:340](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L340)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:270](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L270)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:55](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L55)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:19](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L19)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:22](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L22)
|
|
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: [
|
|
5
|
+
Defined in: [fate/src/types.ts:25](https://github.com/nkzw-tech/fate/blob/ce96828d183f5fe6e334dff531abed295a9ec24d/packages/fate/src/types.ts#L25)
|
|
6
6
|
|
|
7
7
|
Symbol attached to deferred values returned from masked views.
|
|
@@ -16,13 +16,13 @@ Then pass `persistence` when creating the client:
|
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { createPersistence } from '@nkzw/fate/persistence';
|
|
19
|
-
import {
|
|
19
|
+
import { createIndexedDBStorage } from '@nkzw/fate-indexeddb';
|
|
20
20
|
import { createFateClient } from 'react-fate/client';
|
|
21
21
|
|
|
22
22
|
const fate = createFateClient({
|
|
23
23
|
persistence: createPersistence({
|
|
24
24
|
key: `workspace:${workspaceId}:user:${userId}`,
|
|
25
|
-
storage:
|
|
25
|
+
storage: createIndexedDBStorage(),
|
|
26
26
|
}),
|
|
27
27
|
url: '/api/fate',
|
|
28
28
|
});
|
|
@@ -35,7 +35,7 @@ persistence: createPersistence({
|
|
|
35
35
|
key: `workspace:${workspaceId}:user:${userId}`,
|
|
36
36
|
maxAge: 24 * 60 * 60 * 1000,
|
|
37
37
|
maxBytes: 25 * 1024 * 1024,
|
|
38
|
-
storage:
|
|
38
|
+
storage: createIndexedDBStorage(),
|
|
39
39
|
}),
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -207,7 +207,7 @@ const durableHTTP = createHTTPTransport<MyAPI>({
|
|
|
207
207
|
|
|
208
208
|
const fate = createFateClient({
|
|
209
209
|
// ...your generated tRPC or GraphQL client options...
|
|
210
|
-
persistence: createPersistence({ key: accountKey, storage:
|
|
210
|
+
persistence: createPersistence({ key: accountKey, storage: createIndexedDBStorage() }),
|
|
211
211
|
mutateDurably: durableHTTP.mutateDurably,
|
|
212
212
|
});
|
|
213
213
|
```
|
|
@@ -297,7 +297,6 @@ The core persistence layer has no IndexedDB dependency. You can use another back
|
|
|
297
297
|
```ts
|
|
298
298
|
interface PersistenceStorage {
|
|
299
299
|
read(key: string): Promise<unknown>;
|
|
300
|
-
write(key: string, value: unknown): Promise<void>;
|
|
301
300
|
scan(
|
|
302
301
|
prefix: string,
|
|
303
302
|
after?: string,
|
|
@@ -312,9 +311,8 @@ interface PersistenceStorage {
|
|
|
312
311
|
Values use fate's hydration codec and can be stored as JSON. The adapter handles storage and coordination:
|
|
313
312
|
|
|
314
313
|
- `read` returns the saved value for a key.
|
|
315
|
-
- `write` replaces one value atomically and resolves after it has committed.
|
|
316
314
|
- `scan` returns keys under a prefix in ascending order, strictly after the optional cursor, up to the limit (64 by default). Use your backend's ordered index to keep each scan small.
|
|
317
|
-
- `writeBatch` commits all entries atomically. An `undefined` value deletes the key.
|
|
315
|
+
- `writeBatch` commits all entries atomically and resolves after they have committed. An `undefined` value deletes the key. Use a one-entry batch for a single write.
|
|
318
316
|
- `exclusive` coordinates every tab or process sharing the backend. Different lock names are independent: fate holds a delivery lock during network work and acquires a separate write lock when updating storage. Your adapter must allow that nesting.
|
|
319
317
|
- `subscribe` notifies other clients after a change commits, including keys changed by `writeBatch`. Without notifications, clients check saved mutations during delivery attempts and explicit `retry()` calls.
|
|
320
318
|
|
package/lib/clientStub.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
//#region src/clientStub.d.ts
|
|
2
|
-
declare function createFateClient(..._args: Array<never>): never;
|
|
3
|
-
interface ClientMutations {}
|
|
4
|
-
interface ClientRoots {}
|
|
5
|
-
//#endregion
|
|
6
|
-
export { ClientMutations, ClientRoots, createFateClient };
|
|
2
|
+
export declare function createFateClient(..._args: Array<never>): never;
|
|
3
|
+
export interface ClientMutations {}
|
|
4
|
+
export interface ClientRoots {}
|
|
5
|
+
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "./transport-DR0fwleU.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/server/dataView.d.ts
|
|
4
4
|
declare const dataViewFieldsKey: unique symbol;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as MutationShape, k as Entity, q as TypeConfig, t as Transport } from "./transport-DR0fwleU.mjs";
|
|
2
2
|
//#region src/graphqlTransport.d.ts
|
|
3
3
|
type TransportMutations = Record<string, MutationShape>;
|
|
4
4
|
type EmptyTransportMutations = Record<never, MutationShape>;
|
|
@@ -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-
|
|
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-CGYE4NdD.mjs";
|
|
2
2
|
export { GraphQLMutationDefinition, GraphQLMutationInput, GraphQLMutationMap, GraphQLMutationOutput, GraphQLTransportOptions, createGraphQLTransport, graphqlMutation };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { r as MutationIdentity } from "./transport-DR0fwleU.mjs";
|
|
2
|
+
//#region src/server/idempotency-types.d.ts
|
|
3
|
+
/** Server enforcement for a durable mutation. The resolver must use the supplied context. */
|
|
4
|
+
interface MutationIdempotency<Context> {
|
|
5
|
+
execute<Result>(options: MutationIdempotencyOptions<Context, Result>): Promise<Result>;
|
|
6
|
+
}
|
|
7
|
+
type MutationIdempotencyOptions<Context, Result> = Readonly<{
|
|
8
|
+
ctx: Context;
|
|
9
|
+
identity: MutationIdentity;
|
|
10
|
+
input: unknown;
|
|
11
|
+
name: string;
|
|
12
|
+
resolve(ctx: Context): Promise<Result>;
|
|
13
|
+
select: ReadonlyArray<string>;
|
|
14
|
+
}>;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { MutationIdempotencyOptions as n, MutationIdempotency as t };
|
package/lib/idempotency.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MutationIdempotency } from "./idempotency-types-
|
|
1
|
+
import { _ as encodeHydrationValue } from "./transport-DR0fwleU.mjs";
|
|
2
|
+
import { n as MutationIdempotencyOptions, t as MutationIdempotency } from "./idempotency-types-DuqJ7KSd.mjs";
|
|
3
3
|
//#region src/idempotency.d.ts
|
|
4
|
-
type MutationReceipt = Readonly<{
|
|
4
|
+
export type MutationReceipt = Readonly<{
|
|
5
5
|
fingerprint: string;
|
|
6
6
|
result: ReturnType<typeof encodeHydrationValue>;
|
|
7
7
|
}>;
|
|
@@ -10,17 +10,17 @@ type MutationReceipt = Readonly<{
|
|
|
10
10
|
* The adapter must serialize concurrent calls for the same scope and ID,
|
|
11
11
|
* including calls from different processes. Receipts must not expire.
|
|
12
12
|
*/
|
|
13
|
-
interface IdempotencyStore<Context> {
|
|
13
|
+
export interface IdempotencyStore<Context, TransactionContext extends Context = Context> {
|
|
14
14
|
transaction<T>(context: Context, scope: string, id: string, run: (transaction: {
|
|
15
|
-
context:
|
|
15
|
+
context: TransactionContext;
|
|
16
16
|
read(): Promise<MutationReceipt | undefined>;
|
|
17
17
|
write(receipt: MutationReceipt): Promise<void>;
|
|
18
18
|
}) => Promise<T>): Promise<T>;
|
|
19
19
|
}
|
|
20
20
|
/** Enforces durable deduplication using the application's own transaction adapter. */
|
|
21
|
-
declare function createMutationIdempotency<Context>(options: {
|
|
21
|
+
export declare function createMutationIdempotency<Context, TransactionContext extends Context = Context>(options: {
|
|
22
22
|
scope(context: Context): string | Promise<string>;
|
|
23
|
-
store: IdempotencyStore<Context>;
|
|
23
|
+
store: IdempotencyStore<Context, TransactionContext>;
|
|
24
24
|
}): MutationIdempotency<Context>;
|
|
25
25
|
//#endregion
|
|
26
|
-
export {
|
|
26
|
+
export type { MutationIdempotency, MutationIdempotencyOptions };
|
package/lib/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { $ as
|
|
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-
|
|
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-
|
|
4
|
-
import { n as getListEntries, t as ListEntry } from "./list-
|
|
1
|
+
import { $ as ViewRef, A as EntityId, B as MutationShape, C as ConnectionTag, D as DeferredSelection, E as DeferredMetadata, F as MutationDefinition, G as RootDefinition, H as Pagination, I as MutationEntity, J as TypeName, K as Selection, L as MutationIdentifier, M as FateThenable, N as ListItem, O as DeferredTag, P as Mask, Q as ViewEntityName, R as MutationInput, S as ConnectionRef, T as Deferred, U as Request$1, V as NodesItem, W as RequestResult, X as ViewData, Y as View, Z as ViewEntity, a as Persistence, at as isViewTag, b as AnyRecord, c as RequestPersistenceOptions, d as RequestMode, et as ViewSelection, f as RequestOptions, g as HydrationLimits, h as HydrateOptions, i as PersistedMutationStatus, it as __FateSelectionBrand, j as FateRoots, k as Entity, l as DeferredSnapshot, m as FateDehydratedState, n as createTRPCTransport, nt as ViewTag, o as PersistenceSession, ot as FateMutations, p as createClient, q as TypeConfig, r as MutationIdentity, rt as __FateEntityBrand, s as PersistenceSnapshot, st as mutation, t as Transport, tt as ViewSnapshot, u as FateClient, v as List, w as DeferTag, x as ConnectionMetadata, y as getSelectionPlan, z as MutationResult } from "./transport-DR0fwleU.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-CGYE4NdD.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-Dxjvpsep.mjs";
|
|
4
|
+
import { n as getListEntries, t as ListEntry } from "./list-5hrTVoiB.mjs";
|
|
5
5
|
//#region src/defer.d.ts
|
|
6
|
-
declare function defer<S>(selection: S): DeferredSelection<S>;
|
|
7
|
-
declare const isDeferred: (value: unknown) => value is Deferred<unknown>;
|
|
8
|
-
declare const getDeferredMetadata: <T>(deferred: Deferred<T>) => DeferredMetadata;
|
|
6
|
+
export declare function defer<S>(selection: S): DeferredSelection<S>;
|
|
7
|
+
export declare const isDeferred: (value: unknown) => value is Deferred<unknown>;
|
|
8
|
+
export declare const getDeferredMetadata: <T>(deferred: Deferred<T>) => DeferredMetadata;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/httpTransport.d.ts
|
|
11
11
|
type TransportMutations = Record<string, MutationShape>;
|
|
@@ -49,7 +49,7 @@ type VoidLiveClientEvent<Data = unknown> = {
|
|
|
49
49
|
topic: string;
|
|
50
50
|
type?: string;
|
|
51
51
|
};
|
|
52
|
-
declare function createHTTPTransport<API extends FateAPIShape, Mutations extends TransportMutations = MutationMapFromAPI<API>>({ eventSource, fetch: fetchImpl, headers, live, liveRetryMs, liveUrl, url }: {
|
|
52
|
+
export declare function createHTTPTransport<API extends FateAPIShape, Mutations extends TransportMutations = MutationMapFromAPI<API>>({ eventSource, fetch: fetchImpl, headers, live, liveRetryMs, liveUrl, url }: {
|
|
53
53
|
eventSource?: EventSourceConstructor;
|
|
54
54
|
fetch?: FetchLike;
|
|
55
55
|
headers?: HeadersFactory;
|
|
@@ -63,13 +63,13 @@ declare function createHTTPTransport<API extends FateAPIShape, Mutations extends
|
|
|
63
63
|
/**
|
|
64
64
|
* Defines a root query for an entity type, capturing the response shape.
|
|
65
65
|
*/
|
|
66
|
-
declare function clientRoot<Result, Type extends TypeName>(type: Type): RootDefinition<Type, Result>;
|
|
66
|
+
export declare function clientRoot<Result, Type extends TypeName>(type: Type): RootDefinition<Type, Result>;
|
|
67
67
|
//#endregion
|
|
68
68
|
//#region src/ref.d.ts
|
|
69
69
|
/**
|
|
70
70
|
* Builds the canonical cache ID for an entity.
|
|
71
71
|
*/
|
|
72
|
-
declare const toEntityId: (type: TypeName, rawId: string | number) => EntityId;
|
|
72
|
+
export declare const toEntityId: (type: TypeName, rawId: string | number) => EntityId;
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region src/view.d.ts
|
|
75
75
|
type SelectionValidation<T extends Entity, S extends Selection<T>> = Exclude<keyof Omit<S, typeof __FateEntityBrand | typeof __FateSelectionBrand>, keyof Selection<T>> extends never ? unknown : never;
|
|
@@ -82,6 +82,6 @@ type SelectionValidation<T extends Entity, S extends Selection<T>> = Exclude<key
|
|
|
82
82
|
* title: true,
|
|
83
83
|
* });
|
|
84
84
|
*/
|
|
85
|
-
declare function view<T extends Entity>(): <S extends Selection<T>>(select: S & SelectionValidation<T, S>) => View<T, S>;
|
|
85
|
+
export declare function view<T extends Entity>(): <S extends Selection<T>>(select: S & SelectionValidation<T, S>) => View<T, S>;
|
|
86
86
|
//#endregion
|
|
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 MutationIdentity, type MutationInput, type MutationResult, type NodesItem, type Pagination, type Persistence, type PersistenceSession, type PersistenceSnapshot, 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,
|
|
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 MutationIdentity, type MutationInput, type MutationResult, type NodesItem, type Pagination, type PersistedMutationStatus, type Persistence, type PersistenceSession, type PersistenceSnapshot, type Request$1 as Request, type RequestMode, type RequestOptions, type RequestPersistenceOptions, type RequestResult, type Selection, type Transport, type TypeConfig, type View, type ViewData, type ViewEntity, type ViewEntityName, type ViewRef, type ViewSelection, type ViewSnapshot, type ViewTag, createClient, createGraphQLTransport, createTRPCTransport, getListEntries, getSelectionPlan, graphqlMutation, isRecord, isViewTag, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, mutation };
|