@nkzw/fate 1.5.0 → 1.5.1
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 +38 -38
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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/{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 +7 -7
- package/lib/index.d.mts +5 -5
- 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 +20 -18
- package/lib/persistence.mjs +553 -352
- package/lib/{record-DITM4zb_.d.mts → record-Dxjvpsep.d.mts} +3 -3
- package/lib/server/drizzle.d.mts +2 -2
- package/lib/server/prisma.d.mts +2 -2
- package/lib/server.d.mts +3 -3
- package/lib/{store-CeatPJeK.mjs → store-CakBBzWG.mjs} +47 -11
- package/lib/{transport-DqjhjLfC.d.mts → transport-DR0fwleU.d.mts} +29 -16
- package/package.json +1 -1
- package/lib/idempotency-types-CqA-BFpn.d.mts +0 -15
package/lib/persistence.d.mts
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as Persistence, c as RequestPersistenceOptions, i as PersistedMutationStatus, o as PersistenceSession, s as PersistenceSnapshot } from "./transport-DR0fwleU.mjs";
|
|
2
2
|
//#region src/persistence.d.ts
|
|
3
3
|
/**
|
|
4
|
-
* Backend-neutral durable storage.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Backend-neutral durable storage. Batches apply atomically and resolve only after
|
|
5
|
+
* commit. Exclusive sections must coordinate ALL instances using this key
|
|
6
|
+
* (including other tabs/processes). Use distinct lock names independently.
|
|
7
7
|
*/
|
|
8
|
+
type PersistenceStorageEntry = Readonly<{
|
|
9
|
+
key: string;
|
|
10
|
+
value: unknown;
|
|
11
|
+
}>;
|
|
12
|
+
type PersistenceStorageWrite = readonly [key: string, value: unknown];
|
|
8
13
|
interface PersistenceStorage {
|
|
9
14
|
exclusive<T>(key: string, run: () => Promise<T>): Promise<T>;
|
|
10
15
|
read(key: string): Promise<unknown>;
|
|
11
16
|
/** Ordered, bounded scan. Return keys strictly after `after`, under `prefix`. */
|
|
12
|
-
scan(prefix: string, after?: string, limit?: number): Promise<Array<
|
|
13
|
-
key: string;
|
|
14
|
-
value: unknown;
|
|
15
|
-
}>>;
|
|
17
|
+
scan(prefix: string, after?: string, limit?: number): Promise<Array<PersistenceStorageEntry>>;
|
|
16
18
|
subscribe?(key: string, listener: () => void): () => void;
|
|
17
|
-
write(key: string, value: unknown): Promise<void>;
|
|
18
19
|
/** Atomically apply a batch. Undefined deletes the key. */
|
|
19
|
-
writeBatch(entries: ReadonlyArray<
|
|
20
|
+
writeBatch(entries: ReadonlyArray<PersistenceStorageWrite>): Promise<void>;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
* Enables cache persistence and durable delivery through the existing mutation API.
|
|
23
|
-
* Import this entry point only in applications using persistence. Storage keys must
|
|
24
|
-
* isolate authenticated accounts/workspaces and match the server's identity scope.
|
|
25
|
-
*/
|
|
26
|
-
declare function createPersistence({ key, maxAge, maxBytes, online, retryDelay, storage }: {
|
|
22
|
+
type PersistenceOptions = Readonly<{
|
|
27
23
|
key: string;
|
|
28
24
|
/** Maximum disk retention since a successful fetch, in milliseconds. Defaults to one day. */
|
|
29
25
|
maxAge?: number;
|
|
@@ -33,6 +29,12 @@ declare function createPersistence({ key, maxAge, maxBytes, online, retryDelay,
|
|
|
33
29
|
online?: () => boolean;
|
|
34
30
|
retryDelay?: number;
|
|
35
31
|
storage: PersistenceStorage;
|
|
36
|
-
}
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Enables cache persistence and durable delivery through the existing mutation API.
|
|
35
|
+
* Import this entry point only in applications using persistence. Storage keys must
|
|
36
|
+
* isolate authenticated accounts/workspaces and match the server's identity scope.
|
|
37
|
+
*/
|
|
38
|
+
declare function createPersistence({ key, maxAge, maxBytes, online, retryDelay, storage }: PersistenceOptions): Persistence;
|
|
37
39
|
//#endregion
|
|
38
|
-
export { type Persistence, type PersistenceSession, type PersistenceSnapshot, PersistenceStorage, createPersistence };
|
|
40
|
+
export { type PersistedMutationStatus, type Persistence, PersistenceOptions, type PersistenceSession, type PersistenceSnapshot, PersistenceStorage, PersistenceStorageEntry, PersistenceStorageWrite, type RequestPersistenceOptions, createPersistence };
|