@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as MutationIdempotency } from "./idempotency-types-
|
|
3
|
-
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-
|
|
1
|
+
import { b as AnyRecord, r as MutationIdentity } from "./transport-DR0fwleU.mjs";
|
|
2
|
+
import { t as MutationIdempotency } from "./idempotency-types-DuqJ7KSd.mjs";
|
|
3
|
+
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-oPTYqgQV.mjs";
|
|
4
4
|
//#region src/liveTopics.d.ts
|
|
5
5
|
declare const liveEntityTopic: (type: string, id: string | number) => string;
|
|
6
6
|
declare const liveConnectionTopic: (procedure: string, args?: Record<string, unknown>) => string;
|
package/lib/server/drizzle.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "../transport-DR0fwleU.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, t as SourceRegistry } from "../executor-oPTYqgQV.mjs";
|
|
3
3
|
import { AnyColumn, SQLWrapper, Table } from "drizzle-orm";
|
|
4
4
|
//#region src/server/drizzle.d.ts
|
|
5
5
|
type SourceTarget<Item extends AnyRecord = AnyRecord> = DataView<Item> | SourceDefinition<Item, unknown>;
|
|
@@ -18,7 +18,7 @@ type DrizzleDatabase = {
|
|
|
18
18
|
select: (fields?: Record<string, unknown>) => any;
|
|
19
19
|
};
|
|
20
20
|
type DrizzleDatabaseInput<Context> = DrizzleDatabase | ((ctx: Context) => DrizzleDatabase);
|
|
21
|
-
type DrizzleQueryExtra = {
|
|
21
|
+
export type DrizzleQueryExtra = {
|
|
22
22
|
extraFields?: Array<string>;
|
|
23
23
|
where?: SQLWrapper;
|
|
24
24
|
};
|
|
@@ -29,12 +29,12 @@ type DrizzleManyToManyColumns = {
|
|
|
29
29
|
foreignColumn?: never;
|
|
30
30
|
localColumn?: never;
|
|
31
31
|
};
|
|
32
|
-
type DrizzleManyToManyConfig = DrizzleManyToManyColumns & {
|
|
32
|
+
export type DrizzleManyToManyConfig = DrizzleManyToManyColumns & {
|
|
33
33
|
columns?: ColumnMap;
|
|
34
34
|
table: DrizzleTable;
|
|
35
35
|
};
|
|
36
|
-
type DrizzleManyToManyInput = DrizzleManyToManyConfig | DrizzleTable;
|
|
37
|
-
type DrizzleViewConfig<Item extends AnyRecord = AnyRecord, TTable extends DrizzleTable = DrizzleTable> = SourceConfig<Item, unknown> & {
|
|
36
|
+
export type DrizzleManyToManyInput = DrizzleManyToManyConfig | DrizzleTable;
|
|
37
|
+
export type DrizzleViewConfig<Item extends AnyRecord = AnyRecord, TTable extends DrizzleTable = DrizzleTable> = SourceConfig<Item, unknown> & {
|
|
38
38
|
columns?: ColumnMap;
|
|
39
39
|
manyToMany?: Record<string, DrizzleManyToManyInput>;
|
|
40
40
|
table: TTable;
|
|
@@ -46,7 +46,7 @@ type DrizzleSourceAdapterOptions<Context> = {
|
|
|
46
46
|
schema?: Record<string, unknown>;
|
|
47
47
|
views: DrizzleViewsInput;
|
|
48
48
|
};
|
|
49
|
-
type DrizzleSourceAdapter<Context> = {
|
|
49
|
+
export type DrizzleSourceAdapter<Context> = {
|
|
50
50
|
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
51
51
|
ctx?: Context;
|
|
52
52
|
extra?: DrizzleQueryExtra;
|
|
@@ -103,9 +103,9 @@ type SourceInput = {
|
|
|
103
103
|
args?: Record<string, unknown>;
|
|
104
104
|
select: Iterable<string>;
|
|
105
105
|
};
|
|
106
|
-
declare function createDrizzleSourceAdapter<Context>({ db, nestedPaginationConcurrency, schema, views }: DrizzleSourceAdapterOptions<Context>): DrizzleSourceAdapter<Context>;
|
|
107
|
-
declare const createDrizzleSourceRegistry: <Context>(options: Parameters<typeof createDrizzleSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
108
|
-
declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createDrizzleSourceAdapter<Context>>[0] & {
|
|
106
|
+
export declare function createDrizzleSourceAdapter<Context>({ db, nestedPaginationConcurrency, schema, views }: DrizzleSourceAdapterOptions<Context>): DrizzleSourceAdapter<Context>;
|
|
107
|
+
export declare const createDrizzleSourceRegistry: <Context>(options: Parameters<typeof createDrizzleSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
108
|
+
export declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createDrizzleSourceAdapter<Context>>[0] & {
|
|
109
109
|
procedure: Procedure;
|
|
110
110
|
}): {
|
|
111
111
|
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
@@ -200,7 +200,9 @@ declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({ p
|
|
|
200
200
|
args?: Record<string, unknown> | undefined;
|
|
201
201
|
select: string[];
|
|
202
202
|
} & {
|
|
203
|
-
args?: Record<string, unknown> | (Record<string, unknown> &
|
|
203
|
+
args?: (Record<string, unknown> & object) | (Record<string, unknown> & {
|
|
204
|
+
[x: string]: unknown;
|
|
205
|
+
}) | undefined;
|
|
204
206
|
};
|
|
205
207
|
meta: unknown;
|
|
206
208
|
output: ConnectionResult<unknown>;
|
|
@@ -231,5 +233,4 @@ declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({ p
|
|
|
231
233
|
view: ViewTarget<Item>;
|
|
232
234
|
}) => Promise<AnyRecord[]>;
|
|
233
235
|
};
|
|
234
|
-
//#endregion
|
|
235
|
-
export { DrizzleManyToManyConfig, DrizzleManyToManyInput, DrizzleQueryExtra, DrizzleSourceAdapter, DrizzleViewConfig, createDrizzleFate, createDrizzleSourceAdapter, createDrizzleSourceRegistry };
|
|
236
|
+
//#endregion
|
package/lib/server/prisma.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-
|
|
1
|
+
import { b as AnyRecord, lt as QueryProcedure } from "../transport-DR0fwleU.mjs";
|
|
2
|
+
import { S as ConnectionResult, c as SourceConfig, f as SourcePlan, k as DataView, l as SourceDefinition, o as DataViewModule, p as SourcePlanNode, s as OrderDirection, t as SourceRegistry } from "../executor-oPTYqgQV.mjs";
|
|
3
3
|
//#region src/server/prisma.d.ts
|
|
4
|
-
type PrismaDelegate = {
|
|
4
|
+
export type PrismaDelegate = {
|
|
5
5
|
findMany?: (args: any) => Promise<Array<AnyRecord>>;
|
|
6
6
|
findUnique?: (args: any) => Promise<AnyRecord | null>;
|
|
7
7
|
groupBy?: (args: any) => Promise<Array<AnyRecord>>;
|
|
8
8
|
};
|
|
9
|
-
type PrismaQueryExtra = AnyRecord;
|
|
10
|
-
type PrismaViewConfig<Context, Item extends AnyRecord = AnyRecord> = {
|
|
9
|
+
export type PrismaQueryExtra = AnyRecord;
|
|
10
|
+
export type PrismaViewConfig<Context, Item extends AnyRecord = AnyRecord> = {
|
|
11
11
|
delegate: (ctx: Context) => unknown;
|
|
12
12
|
} & SourceConfig<Item, unknown>;
|
|
13
13
|
type PrismaViewsInput<Context> = Array<DataView<AnyRecord> | PrismaViewConfig<Context, AnyRecord>> | DataViewModule;
|
|
@@ -25,7 +25,7 @@ type ViewProcedureInput<Item extends AnyRecord, ById extends boolean | undefined
|
|
|
25
25
|
list?: List;
|
|
26
26
|
view: ViewTarget<Item>;
|
|
27
27
|
};
|
|
28
|
-
type PrismaSourceAdapter<Context> = {
|
|
28
|
+
export type PrismaSourceAdapter<Context> = {
|
|
29
29
|
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
30
30
|
ctx: Context;
|
|
31
31
|
extra?: PrismaQueryExtra;
|
|
@@ -83,7 +83,7 @@ type SourceInput = {
|
|
|
83
83
|
args?: Record<string, unknown>;
|
|
84
84
|
select: Iterable<string>;
|
|
85
85
|
};
|
|
86
|
-
declare const prismaConnectionArgs: ({ cursor, direction, node, skip, take }: {
|
|
86
|
+
export declare const prismaConnectionArgs: ({ cursor, direction, node, skip, take }: {
|
|
87
87
|
cursor?: string;
|
|
88
88
|
direction: 'backward' | 'forward';
|
|
89
89
|
node: SourcePlanNode<any, any>;
|
|
@@ -99,9 +99,9 @@ declare const prismaConnectionArgs: ({ cursor, direction, node, skip, take }: {
|
|
|
99
99
|
}[];
|
|
100
100
|
take: number;
|
|
101
101
|
};
|
|
102
|
-
declare function createPrismaSourceAdapter<Context>({ prisma, views }: PrismaSourceAdapterOptions<Context>): PrismaSourceAdapter<Context>;
|
|
103
|
-
declare const createPrismaSourceRegistry: <Context>(options: Parameters<typeof createPrismaSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
104
|
-
declare function createPrismaFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createPrismaSourceAdapter<Context>>[0] & {
|
|
102
|
+
export declare function createPrismaSourceAdapter<Context>({ prisma, views }: PrismaSourceAdapterOptions<Context>): PrismaSourceAdapter<Context>;
|
|
103
|
+
export declare const createPrismaSourceRegistry: <Context>(options: Parameters<typeof createPrismaSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
104
|
+
export declare function createPrismaFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createPrismaSourceAdapter<Context>>[0] & {
|
|
105
105
|
procedure: Procedure;
|
|
106
106
|
}): {
|
|
107
107
|
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
@@ -197,7 +197,9 @@ declare function createPrismaFate<Context, Procedure extends ProcedureLike>({ pr
|
|
|
197
197
|
args?: Record<string, unknown> | undefined;
|
|
198
198
|
select: string[];
|
|
199
199
|
} & {
|
|
200
|
-
args?: Record<string, unknown> | (Record<string, unknown> &
|
|
200
|
+
args?: (Record<string, unknown> & object) | (Record<string, unknown> & {
|
|
201
|
+
[x: string]: unknown;
|
|
202
|
+
}) | undefined;
|
|
201
203
|
};
|
|
202
204
|
meta: unknown;
|
|
203
205
|
output: ConnectionResult<unknown>;
|
|
@@ -228,5 +230,4 @@ declare function createPrismaFate<Context, Procedure extends ProcedureLike>({ pr
|
|
|
228
230
|
view: ViewTarget<Item>;
|
|
229
231
|
}) => Promise<AnyRecord[]>;
|
|
230
232
|
};
|
|
231
|
-
//#endregion
|
|
232
|
-
export { PrismaDelegate, PrismaQueryExtra, PrismaSourceAdapter, PrismaViewConfig, createPrismaFate, createPrismaSourceAdapter, createPrismaSourceRegistry, prismaConnectionArgs };
|
|
233
|
+
//#endregion
|
package/lib/server.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-
|
|
3
|
-
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-
|
|
1
|
+
import { b as AnyRecord$1, ct as AnyProcedure } from "./transport-DR0fwleU.mjs";
|
|
2
|
+
import { C as liveGlobalConnectionTopic, S as liveEntityTopic, _ as LiveEventBus, b as createLiveEventBus, c as FateServer, d as NativeFateAPI, f as createFateFetchHandler, g as LiveConnectionSourceEvent, h as LiveConnectionEventType, l as FateServerManifest, m as createHonoFateHandler, p as createFateServer, s as FateRequestError, t as isRecord, u as InferFateAPI, v as LiveEventType, x as liveConnectionTopic, y as LiveSourceEvent } from "./record-Dxjvpsep.mjs";
|
|
3
|
+
import { A as DataViewListOptions, B as dataView, C as connectionArgs, D as CountSelection, E as ComputedSelection, F as FieldSelection, H as list$1, I as ViewPlan, L as computed, M as DataViewOrderDirection, N as DataViewResult, O as CountWhere, P as Entity, R as count, S as ConnectionResult, T as ComputedField, U as resolver, V as field, _ as createSourcePlan, a as resolveSourceConnection, b as ConnectionItem, c as SourceConfig, d as SourceOrderField, f as SourcePlan, g as createNestedSourcePlan, h as SourceRelationConfig, i as resolveSourceByIds, j as DataViewOrderBy, l as SourceDefinition, m as SourceRelation, n as refetchSourceById, p as SourcePlanNode, r as resolveSourceById, s as OrderDirection, t as SourceRegistry, u as SourceOrder, v as getNestedSelection, w as withConnection, x as ConnectionPagination, y as hasNestedSelection, z as createResolver } from "./executor-oPTYqgQV.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/server/input.d.ts
|
|
6
|
-
declare const byIdInput: z.ZodObject<{
|
|
6
|
+
export declare const byIdInput: z.ZodObject<{
|
|
7
7
|
args: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
|
|
8
8
|
ids: z.ZodArray<z.ZodString>;
|
|
9
9
|
select: z.ZodArray<z.ZodString>;
|
|
@@ -11,13 +11,13 @@ declare const byIdInput: z.ZodObject<{
|
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/server/prismaSelect.d.ts
|
|
13
13
|
type AnyRecord = Record<string, unknown>;
|
|
14
|
-
declare function toPrismaSelect<Item extends AnyRecord, Context = unknown>(plan: ViewPlan<Item, Context>): AnyRecord;
|
|
14
|
+
export declare function toPrismaSelect<Item extends AnyRecord, Context = unknown>(plan: ViewPlan<Item, Context>): AnyRecord;
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/server/queryArgs.d.ts
|
|
17
17
|
/**
|
|
18
18
|
* Narrows nested args to the slice relevant for a particular selection path.
|
|
19
19
|
*/
|
|
20
|
-
declare function getScopedArgs(args: AnyRecord$1 | undefined, path: string): AnyRecord$1 | undefined;
|
|
20
|
+
export declare function getScopedArgs(args: AnyRecord$1 | undefined, path: string): AnyRecord$1 | undefined;
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/server/sourceRouter.d.ts
|
|
23
23
|
type ProcedureLike = {
|
|
@@ -74,7 +74,7 @@ type SourceProcedureResult<ById extends boolean | undefined, List extends boolea
|
|
|
74
74
|
* Use this when a router also has custom mutations or custom queries and you
|
|
75
75
|
* want to spread the generated source procedures into that router.
|
|
76
76
|
*/
|
|
77
|
-
declare function createSourceProcedures<Context, Item extends AnyRecord$1, Procedure extends ProcedureLike, ConnectionProcedure extends ConnectionProcedureLike | undefined = ConnectionProcedureLike | undefined, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>({ byId, createConnectionProcedure, list, procedure, registry, source }: SourceProcedureOptions<Context, Item, Procedure, ConnectionProcedure> & {
|
|
77
|
+
export declare function createSourceProcedures<Context, Item extends AnyRecord$1, Procedure extends ProcedureLike, ConnectionProcedure extends ConnectionProcedureLike | undefined = ConnectionProcedureLike | undefined, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>({ byId, createConnectionProcedure, list, procedure, registry, source }: SourceProcedureOptions<Context, Item, Procedure, ConnectionProcedure> & {
|
|
78
78
|
byId?: ById;
|
|
79
79
|
list?: List;
|
|
80
80
|
}): SourceProcedureResult<ById, List, Procedure, ConnectionProcedure>;
|
|
@@ -82,6 +82,6 @@ declare function createSourceProcedures<Context, Item extends AnyRecord$1, Proce
|
|
|
82
82
|
* Binds the app-specific tRPC pieces once and returns a compact helper for
|
|
83
83
|
* source procedures.
|
|
84
84
|
*/
|
|
85
|
-
declare function bindSourceProcedures<Context, Procedure extends ProcedureLike, ConnectionProcedure extends ConnectionProcedureLike | undefined = ConnectionProcedureLike | undefined>(defaults: SourceProcedureFactoryDefaults<Context, Procedure, ConnectionProcedure>): <Item extends AnyRecord$1, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>(input: SourceProcedureFactoryInput<Item, ById, List>) => SourceProcedureResult<ById, List, Procedure, ConnectionProcedure>;
|
|
85
|
+
export declare function bindSourceProcedures<Context, Procedure extends ProcedureLike, ConnectionProcedure extends ConnectionProcedureLike | undefined = ConnectionProcedureLike | undefined>(defaults: SourceProcedureFactoryDefaults<Context, Procedure, ConnectionProcedure>): <Item extends AnyRecord$1, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>(input: SourceProcedureFactoryInput<Item, ById, List>) => SourceProcedureResult<ById, List, Procedure, ConnectionProcedure>;
|
|
86
86
|
//#endregion
|
|
87
|
-
export { type ComputedField, type ComputedSelection, type ConnectionItem, type ConnectionPagination, type ConnectionResult, type CountSelection, type CountWhere, type DataViewListOptions, type DataViewOrderBy, type DataViewOrderDirection, type DataViewResult, type Entity, FateRequestError, type FateServer, type FateServerManifest, type FieldSelection, type InferFateAPI, type LiveConnectionEventType, type LiveConnectionSourceEvent, type LiveEventBus, type LiveEventType, type LiveSourceEvent, type NativeFateAPI, type OrderDirection, type SourceConfig, type SourceDefinition, type SourceOrder, type SourceOrderField, type SourcePlan, type SourcePlanNode, type SourceRegistry, type SourceRelation, type SourceRelationConfig,
|
|
87
|
+
export { type ComputedField, type ComputedSelection, type ConnectionItem, type ConnectionPagination, type ConnectionResult, type CountSelection, type CountWhere, type DataViewListOptions, type DataViewOrderBy, type DataViewOrderDirection, type DataViewResult, type Entity, FateRequestError, type FateServer, type FateServerManifest, type FieldSelection, type InferFateAPI, type LiveConnectionEventType, type LiveConnectionSourceEvent, type LiveEventBus, type LiveEventType, type LiveSourceEvent, type NativeFateAPI, type OrderDirection, type SourceConfig, type SourceDefinition, type SourceOrder, type SourceOrderField, type SourcePlan, type SourcePlanNode, type SourceRegistry, type SourceRelation, type SourceRelationConfig, computed, connectionArgs, count, createFateFetchHandler, createFateServer, createHonoFateHandler, createLiveEventBus, createNestedSourcePlan, createResolver, createSourcePlan, dataView, field, getNestedSelection, hasNestedSelection, isRecord, list$1 as list, liveConnectionTopic, liveEntityTopic, liveGlobalConnectionTopic, refetchSourceById, resolveSourceById, resolveSourceByIds, resolveSourceConnection, resolver, withConnection };
|
|
@@ -439,7 +439,7 @@ function wrapMutation(client, identifier) {
|
|
|
439
439
|
if (client.persistence && persist !== false) try {
|
|
440
440
|
return {
|
|
441
441
|
error: void 0,
|
|
442
|
-
result: await client.withPersistenceLifecycle(() => client.
|
|
442
|
+
result: await client.withPersistenceLifecycle(() => client.persistMutation(command))
|
|
443
443
|
};
|
|
444
444
|
} catch (error) {
|
|
445
445
|
return handleMutationError(identifier.key, error);
|
|
@@ -890,11 +890,15 @@ var Store = class {
|
|
|
890
890
|
this.records = records;
|
|
891
891
|
this.rebuildIndexes();
|
|
892
892
|
const changedRecordIds = /* @__PURE__ */ new Set();
|
|
893
|
-
|
|
893
|
+
const changedRecordReferences = /* @__PURE__ */ new Set();
|
|
894
|
+
for (const id of /* @__PURE__ */ new Set([...previousRecords.keys(), ...records.keys()])) if (!areHydrationValuesEqual(previousRecords.get(id), records.get(id)) || !areMasksEqual(previousCoverage.get(id), coverage.get(id))) {
|
|
895
|
+
changedRecordIds.add(id);
|
|
896
|
+
if (this.recordReferencesChanged(previousRecords.get(id), records.get(id))) changedRecordReferences.add(id);
|
|
897
|
+
}
|
|
894
898
|
const changedListKeys = /* @__PURE__ */ new Set();
|
|
895
899
|
for (const key of /* @__PURE__ */ new Set([...previousLists.keys(), ...lists.keys()])) if (!areHydrationValuesEqual(previousLists.get(key), lists.get(key))) changedListKeys.add(key);
|
|
896
900
|
const notify = () => {
|
|
897
|
-
for (const id of changedRecordIds) this.notify(id);
|
|
901
|
+
for (const id of changedRecordIds) this.notify(id, void 0, true, changedRecordReferences.has(id));
|
|
898
902
|
for (const key of changedListKeys) this.notifyListSubscribers(key);
|
|
899
903
|
};
|
|
900
904
|
if (!options.deferNotifications) notify();
|
|
@@ -913,8 +917,8 @@ var Store = class {
|
|
|
913
917
|
}
|
|
914
918
|
merge(id, partial, paths) {
|
|
915
919
|
return this.update(() => {
|
|
916
|
-
const
|
|
917
|
-
if (
|
|
920
|
+
const change = this.mergeInternal(id, partial, paths);
|
|
921
|
+
if (change) this.notify(id, change.paths, true, change.referencesChanged);
|
|
918
922
|
});
|
|
919
923
|
}
|
|
920
924
|
mergeInternal(id, partial, paths) {
|
|
@@ -948,14 +952,22 @@ var Store = class {
|
|
|
948
952
|
...previous,
|
|
949
953
|
...partial
|
|
950
954
|
};
|
|
955
|
+
const referencesChanged = this.recordReferencesChanged(previous, nextRecord, changedPaths);
|
|
951
956
|
this.records.set(id, nextRecord);
|
|
952
957
|
this.updateRecordReferenceIndexes(id, previous, nextRecord, changedPaths);
|
|
958
|
+
return {
|
|
959
|
+
paths: changedPaths,
|
|
960
|
+
referencesChanged
|
|
961
|
+
};
|
|
953
962
|
} else {
|
|
954
963
|
const nextRecord = { ...partial };
|
|
955
964
|
this.records.set(id, nextRecord);
|
|
956
965
|
this.updateRecordReferenceIndexes(id, void 0, nextRecord, Object.keys(nextRecord));
|
|
966
|
+
return {
|
|
967
|
+
paths: changedPaths,
|
|
968
|
+
referencesChanged: this.recordReferencesChanged(void 0, nextRecord)
|
|
969
|
+
};
|
|
957
970
|
}
|
|
958
|
-
return changedPaths;
|
|
959
971
|
}
|
|
960
972
|
deleteRecord(id) {
|
|
961
973
|
return this.update(() => {
|
|
@@ -964,7 +976,11 @@ var Store = class {
|
|
|
964
976
|
if (record) this.removeRecordReferenceIndexes(id, record);
|
|
965
977
|
this.records.delete(id);
|
|
966
978
|
this.coverage.delete(id);
|
|
967
|
-
if (!this.recordingLayer) this.onChange?.(
|
|
979
|
+
if (!this.recordingLayer) this.onChange?.({
|
|
980
|
+
key: id,
|
|
981
|
+
kind: "record",
|
|
982
|
+
referencesChanged: true
|
|
983
|
+
});
|
|
968
984
|
});
|
|
969
985
|
}
|
|
970
986
|
missingForSelection(id, paths) {
|
|
@@ -999,8 +1015,13 @@ var Store = class {
|
|
|
999
1015
|
if (set.size === 0) this.subscriptions.delete(id);
|
|
1000
1016
|
};
|
|
1001
1017
|
}
|
|
1002
|
-
notify(id, paths, confirmed = true) {
|
|
1003
|
-
if (confirmed && !this.recordingLayer) this.onChange?.(
|
|
1018
|
+
notify(id, paths, confirmed = true, referencesChanged = false) {
|
|
1019
|
+
if (confirmed && !this.recordingLayer) this.onChange?.({
|
|
1020
|
+
key: id,
|
|
1021
|
+
kind: "record",
|
|
1022
|
+
paths,
|
|
1023
|
+
referencesChanged
|
|
1024
|
+
});
|
|
1004
1025
|
if (this.rebase) return;
|
|
1005
1026
|
const set = this.subscriptions.get(id);
|
|
1006
1027
|
if (!set) return;
|
|
@@ -1014,7 +1035,11 @@ var Store = class {
|
|
|
1014
1035
|
}
|
|
1015
1036
|
}
|
|
1016
1037
|
notifyListSubscribers(key, confirmed = true, previousList) {
|
|
1017
|
-
if (confirmed && !this.recordingLayer) this.onChange?.(
|
|
1038
|
+
if (confirmed && !this.recordingLayer) this.onChange?.({
|
|
1039
|
+
key,
|
|
1040
|
+
kind: "list",
|
|
1041
|
+
previousList
|
|
1042
|
+
});
|
|
1018
1043
|
if (this.rebase) return;
|
|
1019
1044
|
const set = this.listSubscriptions.get(key);
|
|
1020
1045
|
if (!set) return;
|
|
@@ -1218,7 +1243,7 @@ var Store = class {
|
|
|
1218
1243
|
this.mergeInternal(id, next, paths);
|
|
1219
1244
|
ids.set(id, paths);
|
|
1220
1245
|
}
|
|
1221
|
-
for (const [id, paths] of ids) this.notify(id, paths);
|
|
1246
|
+
for (const [id, paths] of ids) this.notify(id, paths, true, true);
|
|
1222
1247
|
});
|
|
1223
1248
|
}
|
|
1224
1249
|
restore(id, snapshot) {
|
|
@@ -1295,6 +1320,17 @@ var Store = class {
|
|
|
1295
1320
|
if (isNodeRef(value)) return /* @__PURE__ */ new Set([getNodeRefId(value)]);
|
|
1296
1321
|
return null;
|
|
1297
1322
|
}
|
|
1323
|
+
recordReferencesChanged(previous, next, fields = /* @__PURE__ */ new Set([...Object.keys(previous ?? {}), ...Object.keys(next ?? {})])) {
|
|
1324
|
+
for (const field of fields) {
|
|
1325
|
+
const before = this.getRecordFieldReferences(previous?.[field]);
|
|
1326
|
+
const after = this.getRecordFieldReferences(next?.[field]);
|
|
1327
|
+
if (before?.size !== after?.size) return true;
|
|
1328
|
+
if (before) {
|
|
1329
|
+
for (const id of before) if (!after?.has(id)) return true;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return false;
|
|
1333
|
+
}
|
|
1298
1334
|
addRecordFieldReferenceIndex(id, field, value) {
|
|
1299
1335
|
const targets = this.getRecordFieldReferences(value);
|
|
1300
1336
|
if (!targets || targets.size === 0) return;
|
|
@@ -1056,6 +1056,16 @@ type StoreHydrationState = Readonly<{
|
|
|
1056
1056
|
lists: ReadonlyArray<readonly [string, List]>;
|
|
1057
1057
|
records: ReadonlyArray<readonly [EntityId, AnyRecord]>;
|
|
1058
1058
|
}>;
|
|
1059
|
+
type StoreChange = Readonly<{
|
|
1060
|
+
key: string;
|
|
1061
|
+
kind: 'list';
|
|
1062
|
+
previousList?: List;
|
|
1063
|
+
}> | Readonly<{
|
|
1064
|
+
key: EntityId;
|
|
1065
|
+
kind: 'record';
|
|
1066
|
+
paths?: Iterable<string>;
|
|
1067
|
+
referencesChanged: boolean;
|
|
1068
|
+
}>;
|
|
1059
1069
|
declare class Store {
|
|
1060
1070
|
private readonly onRebase?;
|
|
1061
1071
|
private readonly onChange?;
|
|
@@ -1072,7 +1082,7 @@ declare class Store {
|
|
|
1072
1082
|
private readonly optimisticBase;
|
|
1073
1083
|
private recordingLayer;
|
|
1074
1084
|
private rebase;
|
|
1075
|
-
constructor(onRebase?: ((ids: ReadonlySet<EntityId>) => void) | undefined, onChange?: ((
|
|
1085
|
+
constructor(onRebase?: ((ids: ReadonlySet<EntityId>) => void) | undefined, onChange?: ((change: StoreChange) => void) | undefined);
|
|
1076
1086
|
get hasOptimisticUpdates(): boolean;
|
|
1077
1087
|
get isRebasing(): boolean;
|
|
1078
1088
|
/** Apply a synchronous cache update beneath the pending optimistic layers. */
|
|
@@ -1146,6 +1156,7 @@ declare class Store {
|
|
|
1146
1156
|
private removeListIndexes;
|
|
1147
1157
|
private getListReferencedEntityIds;
|
|
1148
1158
|
private getRecordFieldReferences;
|
|
1159
|
+
private recordReferencesChanged;
|
|
1149
1160
|
private addRecordFieldReferenceIndex;
|
|
1150
1161
|
private removeRecordFieldReferenceIndex;
|
|
1151
1162
|
private addRecordReferenceIndexes;
|
|
@@ -1214,9 +1225,7 @@ type RequestMode =
|
|
|
1214
1225
|
type RequestOptions = Readonly<{
|
|
1215
1226
|
mode?: RequestMode;
|
|
1216
1227
|
/** Override disk retention in milliseconds; only used with persistence. */
|
|
1217
|
-
persist?:
|
|
1218
|
-
maxAge: number;
|
|
1219
|
-
};
|
|
1228
|
+
persist?: RequestPersistenceOptions;
|
|
1220
1229
|
}>;
|
|
1221
1230
|
type DeferredSnapshot<T> = Readonly<{
|
|
1222
1231
|
coverage: ReadonlyArray<readonly [id: EntityId, paths: ReadonlySet<string>]>;
|
|
@@ -1273,6 +1282,7 @@ declare class FateClient<Roots extends FateRoots, Mutations extends FateMutation
|
|
|
1273
1282
|
private gcScheduled;
|
|
1274
1283
|
private pendingNetworkRequests;
|
|
1275
1284
|
private readonly persistenceDisposal?;
|
|
1285
|
+
private readonly persistenceRuntime?;
|
|
1276
1286
|
readonly store: Store;
|
|
1277
1287
|
private readonly operationLifetime;
|
|
1278
1288
|
private readonly hydrationLimits;
|
|
@@ -1330,6 +1340,8 @@ declare class FateClient<Roots extends FateRoots, Mutations extends FateMutation
|
|
|
1330
1340
|
/** @internal Validates local wiring without requiring network connectivity. */
|
|
1331
1341
|
validatePersistence(): void;
|
|
1332
1342
|
/** @internal */
|
|
1343
|
+
persistMutation(command: MutationCommand): Promise<unknown>;
|
|
1344
|
+
/** @internal */
|
|
1333
1345
|
assertPersistenceActive(): void;
|
|
1334
1346
|
/** @internal */
|
|
1335
1347
|
disposePersistence(): void;
|
|
@@ -1448,12 +1460,14 @@ declare function createClient<T extends [FateRoots, FateMutations] = [Record<nev
|
|
|
1448
1460
|
/** Identity of one logical mutation, reused across every delivery attempt. */
|
|
1449
1461
|
type MutationIdentity = Readonly<{
|
|
1450
1462
|
id: string;
|
|
1463
|
+
/** Return an existing receipt; never execute a new mutation. */
|
|
1451
1464
|
replayOnly?: true;
|
|
1452
|
-
|
|
1465
|
+
scope: string;
|
|
1453
1466
|
}>;
|
|
1454
1467
|
/** A persistence integration. Implementations are imported separately from Fate core. */
|
|
1455
1468
|
interface Persistence {
|
|
1456
|
-
|
|
1469
|
+
/** @internal */
|
|
1470
|
+
attach(client: FateClient<any, any, any>): PersistenceRuntime;
|
|
1457
1471
|
}
|
|
1458
1472
|
type PersistedMutationStatus = Readonly<{
|
|
1459
1473
|
error?: string;
|
|
@@ -1470,24 +1484,23 @@ type PersistenceSnapshot = Readonly<{
|
|
|
1470
1484
|
type RequestPersistenceOptions = Readonly<{
|
|
1471
1485
|
maxAge: number;
|
|
1472
1486
|
}>;
|
|
1473
|
-
/**
|
|
1487
|
+
/** User-facing observability and lifecycle of an attached persistence integration. */
|
|
1474
1488
|
interface PersistenceSession {
|
|
1475
|
-
/** @internal */
|
|
1476
|
-
changed(kind?: 'record' | 'list', key?: string, paths?: Iterable<string>, previousList?: List): void;
|
|
1477
1489
|
clearCache(): Promise<void>;
|
|
1478
1490
|
discard(id: string): Promise<void>;
|
|
1479
1491
|
dispose(): void;
|
|
1480
|
-
/** @internal */
|
|
1481
|
-
fetched(request: RequestDescriptor, options?: RequestPersistenceOptions): void;
|
|
1482
1492
|
flush(): Promise<void>;
|
|
1483
1493
|
getSnapshot(): PersistenceSnapshot;
|
|
1484
|
-
/** @internal */
|
|
1485
|
-
mutate(command: MutationCommand): Promise<unknown>;
|
|
1486
1494
|
readonly ready: Promise<void>;
|
|
1487
|
-
/** @internal */
|
|
1488
|
-
restoreRequest(request: RequestDescriptor): Promise<void>;
|
|
1489
1495
|
retry(): void;
|
|
1490
1496
|
subscribe(listener: () => void): () => void;
|
|
1497
|
+
}
|
|
1498
|
+
/** Contract used internally by Fate to drive an attached persistence session. @internal */
|
|
1499
|
+
interface PersistenceRuntime extends PersistenceSession {
|
|
1500
|
+
changed(change?: StoreChange): void;
|
|
1501
|
+
fetched(request: RequestDescriptor, options?: RequestPersistenceOptions): void;
|
|
1502
|
+
mutate(command: MutationCommand): Promise<unknown>;
|
|
1503
|
+
restoreRequest(request: RequestDescriptor): Promise<void>;
|
|
1491
1504
|
/** @internal */
|
|
1492
1505
|
used(request: RequestDescriptor, options?: RequestPersistenceOptions): void;
|
|
1493
1506
|
}
|
|
@@ -1599,4 +1612,4 @@ declare function createTRPCTransport<AppRouter extends AnyRouter, Mutations exte
|
|
|
1599
1612
|
queries?: TRPCQueryResolvers<AppRouter>;
|
|
1600
1613
|
}): Transport<MutationMapFromResolvers<Mutations>>;
|
|
1601
1614
|
//#endregion
|
|
1602
|
-
export {
|
|
1615
|
+
export { ViewRef as $, EntityId as A, MutationShape as B, ConnectionTag as C, DeferredSelection as D, DeferredMetadata as E, MutationDefinition as F, RootDefinition as G, Pagination as H, MutationEntity as I, TypeName as J, Selection as K, MutationIdentifier as L, FateThenable as M, ListItem as N, DeferredTag as O, Mask as P, ViewEntityName as Q, MutationInput as R, ConnectionRef as S, Deferred as T, Request$1 as U, NodesItem as V, RequestResult as W, ViewData as X, View as Y, ViewEntity as Z, encodeHydrationValue as _, Persistence as a, isViewTag as at, AnyRecord as b, RequestPersistenceOptions as c, AnyProcedure as ct, RequestMode as d, ViewSelection as et, RequestOptions as f, HydrationLimits as g, HydrateOptions as h, PersistedMutationStatus as i, __FateSelectionBrand as it, FateRoots as j, Entity as k, DeferredSnapshot as l, QueryProcedure as lt, FateDehydratedState as m, createTRPCTransport as n, ViewTag as nt, PersistenceSession as o, FateMutations as ot, createClient as p, TypeConfig as q, MutationIdentity as r, __FateEntityBrand as rt, PersistenceSnapshot as s, mutation as st, Transport as t, ViewSnapshot as tt, FateClient as u, List as v, DeferTag as w, ConnectionMetadata as x, getSelectionPlan as y, MutationResult as z };
|
package/lib/vite.d.mts
CHANGED
|
@@ -4,13 +4,13 @@ type FateViteTransport = 'cloudflare' | 'graphql' | 'native' | 'trpc' | 'void';
|
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/vite.d.ts
|
|
6
6
|
type ClientRuntime = '@nkzw/fate' | 'react-fate' | 'vue-fate';
|
|
7
|
-
type FateVitePluginOptions = {
|
|
7
|
+
export type FateVitePluginOptions = {
|
|
8
8
|
clientModule?: ClientRuntime;
|
|
9
9
|
generatedFile?: false | string;
|
|
10
10
|
module: string;
|
|
11
11
|
transport?: FateViteTransport;
|
|
12
12
|
tsconfigFile?: false | string;
|
|
13
13
|
};
|
|
14
|
-
declare const fate: (options: FateVitePluginOptions) => Plugin;
|
|
14
|
+
export declare const fate: (options: FateVitePluginOptions) => Plugin;
|
|
15
15
|
//#endregion
|
|
16
|
-
export {
|
|
16
|
+
export type { FateViteTransport };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkzw/fate",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "fate is a modern data client for React.",
|
|
5
5
|
"homepage": "https://github.com/nkzw-tech/fate",
|
|
6
6
|
"license": "MIT",
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"superjson": "^2.2.6",
|
|
79
|
-
"zod": "^4.5
|
|
79
|
+
"zod": "^4.6.5"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@trpc/client": "^11.18.0",
|
|
83
83
|
"@trpc/server": "^11.18.0",
|
|
84
84
|
"drizzle-orm": "^0.45.2",
|
|
85
|
-
"vite": "
|
|
85
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@trpc/client": "^11.6.0",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { r as MutationIdentity } from "./transport-DqjhjLfC.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: {
|
|
6
|
-
ctx: Context;
|
|
7
|
-
identity: MutationIdentity;
|
|
8
|
-
input: unknown;
|
|
9
|
-
name: string;
|
|
10
|
-
resolve(ctx: Context): Promise<Result>;
|
|
11
|
-
select: Array<string>;
|
|
12
|
-
}): Promise<Result>;
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { MutationIdempotency as t };
|