@nkzw/fate 1.3.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/api/classes/FateClient.md +40 -40
- 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/interfaces/FateThenable.md +3 -3
- package/docs/api/interfaces/Transport.md +7 -7
- 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 +11 -11
- 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/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/Request.md +1 -1
- package/docs/api/type-aliases/RequestMode.md +1 -1
- package/docs/api/type-aliases/RequestOptions.md +1 -1
- package/docs/api/type-aliases/RequestResult.md +1 -1
- package/docs/api/type-aliases/Selection.md +1 -1
- package/docs/api/type-aliases/Snapshot.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/lib/cli.d.mts +1 -1
- package/lib/{executor-C8HNogYG.d.mts → executor-BRudKWDY.d.mts} +18 -65
- package/lib/{graphqlTransport-DskuXeUP.d.mts → graphqlTransport-BDR1pnUQ.d.mts} +3 -14
- package/lib/graphqlTransport.d.mts +1 -1
- package/lib/index.d.mts +6 -15
- package/lib/index.mjs +711 -623
- package/lib/{list-sI2UPhHc.d.mts → list-Bb1SeABn.d.mts} +1 -2
- package/lib/list.d.mts +1 -1
- package/lib/{record-CZyyeLa3.d.mts → record-BTUXkHQU.d.mts} +9 -18
- package/lib/server/drizzle.d.mts +45 -114
- package/lib/server/drizzle.mjs +1 -1
- package/lib/server/prisma.d.mts +52 -127
- package/lib/server/prisma.mjs +8 -2
- package/lib/server.d.mts +4 -16
- package/lib/server.mjs +2 -28
- package/lib/{transport-DhaVVq4P.d.mts → transport-Bo1Jgo9R.d.mts} +76 -103
- package/lib/vite.d.mts +0 -1
- package/lib/vite.mjs +1 -1
- package/package.json +5 -5
package/lib/list.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getListEntries, t as ListEntry } from "./list-
|
|
1
|
+
import { n as getListEntries, t as ListEntry } from "./list-Bb1SeABn.mjs";
|
|
2
2
|
export { ListEntry, getListEntries };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { r as AnyRecord } from "./transport-
|
|
2
|
-
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-
|
|
3
|
-
|
|
1
|
+
import { r as AnyRecord } from "./transport-Bo1Jgo9R.mjs";
|
|
2
|
+
import { N as DataViewResult, S as ConnectionResult, k as DataView, l as SourceDefinition, t as SourceRegistry } from "./executor-BRudKWDY.mjs";
|
|
4
3
|
//#region src/liveTopics.d.ts
|
|
5
4
|
declare const liveEntityTopic: (type: string, id: string | number) => string;
|
|
6
5
|
declare const liveConnectionTopic: (procedure: string, args?: Record<string, unknown>) => string;
|
|
@@ -165,34 +164,34 @@ type RootView<Root> = Root extends DataView<AnyRecord> ? Root : Root extends {
|
|
|
165
164
|
view: infer View extends DataView<AnyRecord>;
|
|
166
165
|
} ? View : never;
|
|
167
166
|
type RootProcedure<_Root, Name extends string> = Name;
|
|
168
|
-
type RootOutput<Root> = RootView<Root> extends infer View extends DataView<AnyRecord> ? View['kind'] extends 'list' ? ConnectionResult<DataViewResult<View>> : DataViewResult<View> | null : never;
|
|
167
|
+
type RootOutput<Root> = RootView<Root> extends (infer View extends DataView<AnyRecord>) ? View['kind'] extends 'list' ? ConnectionResult<DataViewResult<View>> : DataViewResult<View> | null : never;
|
|
169
168
|
type RootLists<Roots extends RootMap> = { [K in keyof Roots as RootView<Roots[K]>['kind'] extends 'list' ? RootProcedure<Roots[K], K & string> : never]: {
|
|
170
169
|
input: OperationInput;
|
|
171
170
|
output: RootOutput<Roots[K]>;
|
|
172
|
-
} };
|
|
171
|
+
}; };
|
|
173
172
|
type RootQueries<Roots extends RootMap> = { [K in keyof Roots as RootView<Roots[K]>['kind'] extends 'list' ? never : RootProcedure<Roots[K], K & string>]: {
|
|
174
173
|
input: OperationInput;
|
|
175
174
|
output: RootOutput<Roots[K]>;
|
|
176
|
-
} };
|
|
175
|
+
}; };
|
|
177
176
|
type QueryAPI<Queries extends Record<string, QueryDefinition<any, any, any>>> = { [K in keyof Queries]: Queries[K] extends QueryDefinition<any, infer Args, infer Output> ? {
|
|
178
177
|
input: {
|
|
179
178
|
args?: Args;
|
|
180
179
|
select: Array<string>;
|
|
181
180
|
};
|
|
182
181
|
output: Awaited<Output>;
|
|
183
|
-
} : never };
|
|
182
|
+
} : never; };
|
|
184
183
|
type ListAPI<Lists extends Record<string, ListDefinition<any, any, any>>> = { [K in keyof Lists]: Lists[K] extends ListDefinition<any, infer Args, infer Output> ? {
|
|
185
184
|
input: {
|
|
186
185
|
args?: Args;
|
|
187
186
|
select: Array<string>;
|
|
188
187
|
};
|
|
189
188
|
output: ConnectionResult<Awaited<Output>>;
|
|
190
|
-
} : never };
|
|
189
|
+
} : never; };
|
|
191
190
|
type MutationAPI<Mutations extends Record<string, MutationDefinition<any, any, any>>> = { [K in keyof Mutations]: Mutations[K] extends MutationDefinition<any, infer Input, infer Output> ? {
|
|
192
191
|
entity: Mutations[K]['type'];
|
|
193
192
|
input: Input;
|
|
194
193
|
output: Awaited<Output>;
|
|
195
|
-
} : never };
|
|
194
|
+
} : never; };
|
|
196
195
|
type NativeFateAPI<Roots extends RootMap, Queries extends Record<string, QueryDefinition<any, any, any>>, Lists extends Record<string, ListDefinition<any, any, any>>, Mutations extends Record<string, MutationDefinition<any, any, any>>> = {
|
|
197
196
|
lists: RootLists<Roots> & ListAPI<Lists>;
|
|
198
197
|
mutations: MutationAPI<Mutations>;
|
|
@@ -220,15 +219,7 @@ type FateServerManifest = Readonly<{
|
|
|
220
219
|
}>;
|
|
221
220
|
types: Record<string, true>;
|
|
222
221
|
}>;
|
|
223
|
-
declare function createFateServer<Context = unknown, Roots extends RootMap = RootMap, Queries extends Record<string, QueryDefinition<Context, any, any>> = Record<never, never>, Lists extends Record<string, ListDefinition<Context, any, any>> = Record<never, never>, Mutations extends Record<string, MutationDefinition<Context, any, any>> = Record<never, never>, AdapterContext = unknown>({
|
|
224
|
-
context,
|
|
225
|
-
lists,
|
|
226
|
-
live,
|
|
227
|
-
mutations,
|
|
228
|
-
queries,
|
|
229
|
-
roots,
|
|
230
|
-
sources
|
|
231
|
-
}: FateServerOptions<Context, Roots, Queries, Lists, Mutations, AdapterContext>): FateServer<NativeFateAPI<Roots, Queries, Lists, Mutations>, AdapterContext>;
|
|
222
|
+
declare function createFateServer<Context = unknown, Roots extends RootMap = RootMap, Queries extends Record<string, QueryDefinition<Context, any, any>> = Record<never, never>, Lists extends Record<string, ListDefinition<Context, any, any>> = Record<never, never>, Mutations extends Record<string, MutationDefinition<Context, any, any>> = Record<never, never>, AdapterContext = unknown>({ context, lists, live, mutations, queries, roots, sources }: FateServerOptions<Context, Roots, Queries, Lists, Mutations, AdapterContext>): FateServer<NativeFateAPI<Roots, Queries, Lists, Mutations>, AdapterContext>;
|
|
232
223
|
declare function createFateFetchHandler<AdapterContext>(server: FateServer<unknown, AdapterContext>): (request: Request, adapterContext?: AdapterContext) => Promise<Response>;
|
|
233
224
|
declare function createHonoFateHandler<Context>(server: FateServer<unknown, Context>): (context: Context & {
|
|
234
225
|
req: {
|
package/lib/server/drizzle.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
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 { nt as QueryProcedure, r as AnyRecord } from "../transport-Bo1Jgo9R.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-BRudKWDY.mjs";
|
|
3
3
|
import { AnyColumn, SQLWrapper, Table } from "drizzle-orm";
|
|
4
|
-
|
|
5
4
|
//#region src/server/drizzle.d.ts
|
|
6
5
|
type SourceTarget<Item extends AnyRecord = AnyRecord> = DataView<Item> | SourceDefinition<Item, unknown>;
|
|
7
6
|
type ViewTarget<Item extends AnyRecord = AnyRecord> = DataView<Item>;
|
|
@@ -48,36 +47,19 @@ type DrizzleSourceAdapterOptions<Context> = {
|
|
|
48
47
|
views: DrizzleViewsInput;
|
|
49
48
|
};
|
|
50
49
|
type DrizzleSourceAdapter<Context> = {
|
|
51
|
-
fetchById: <Item extends AnyRecord = AnyRecord>({
|
|
52
|
-
ctx,
|
|
53
|
-
extra,
|
|
54
|
-
id,
|
|
55
|
-
plan
|
|
56
|
-
}: {
|
|
50
|
+
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
57
51
|
ctx?: Context;
|
|
58
52
|
extra?: DrizzleQueryExtra;
|
|
59
53
|
id: string;
|
|
60
54
|
plan: SourcePlan<Item, Context>;
|
|
61
55
|
}) => Promise<Item | null>;
|
|
62
|
-
fetchByIds: <Item extends AnyRecord = AnyRecord>({
|
|
63
|
-
ctx,
|
|
64
|
-
extra,
|
|
65
|
-
ids,
|
|
66
|
-
plan
|
|
67
|
-
}: {
|
|
56
|
+
fetchByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, plan }: {
|
|
68
57
|
ctx?: Context;
|
|
69
58
|
extra?: DrizzleQueryExtra;
|
|
70
59
|
ids: Array<string>;
|
|
71
60
|
plan: SourcePlan<Item, Context>;
|
|
72
61
|
}) => Promise<Array<Item>>;
|
|
73
|
-
fetchConnection: <Item extends AnyRecord = AnyRecord>({
|
|
74
|
-
ctx,
|
|
75
|
-
cursor,
|
|
76
|
-
direction,
|
|
77
|
-
extra,
|
|
78
|
-
plan,
|
|
79
|
-
take
|
|
80
|
-
}: {
|
|
62
|
+
fetchConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, plan, take }: {
|
|
81
63
|
ctx?: Context;
|
|
82
64
|
cursor?: string;
|
|
83
65
|
direction: 'backward' | 'forward';
|
|
@@ -121,20 +103,34 @@ type SourceInput = {
|
|
|
121
103
|
args?: Record<string, unknown>;
|
|
122
104
|
select: Iterable<string>;
|
|
123
105
|
};
|
|
124
|
-
declare function createDrizzleSourceAdapter<Context>({
|
|
125
|
-
db,
|
|
126
|
-
nestedPaginationConcurrency,
|
|
127
|
-
schema,
|
|
128
|
-
views
|
|
129
|
-
}: DrizzleSourceAdapterOptions<Context>): DrizzleSourceAdapter<Context>;
|
|
106
|
+
declare function createDrizzleSourceAdapter<Context>({ db, nestedPaginationConcurrency, schema, views }: DrizzleSourceAdapterOptions<Context>): DrizzleSourceAdapter<Context>;
|
|
130
107
|
declare const createDrizzleSourceRegistry: <Context>(options: Parameters<typeof createDrizzleSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
131
|
-
declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({
|
|
132
|
-
procedure,
|
|
133
|
-
...options
|
|
134
|
-
}: Parameters<typeof createDrizzleSourceAdapter<Context>>[0] & {
|
|
108
|
+
declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createDrizzleSourceAdapter<Context>>[0] & {
|
|
135
109
|
procedure: Procedure;
|
|
136
110
|
}): {
|
|
137
|
-
|
|
111
|
+
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
112
|
+
ctx?: Context | undefined;
|
|
113
|
+
extra?: DrizzleQueryExtra;
|
|
114
|
+
id: string;
|
|
115
|
+
plan: SourcePlan<Item, Context>;
|
|
116
|
+
}) => Promise<Item | null>;
|
|
117
|
+
fetchByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, plan }: {
|
|
118
|
+
ctx?: Context | undefined;
|
|
119
|
+
extra?: DrizzleQueryExtra;
|
|
120
|
+
ids: Array<string>;
|
|
121
|
+
plan: SourcePlan<Item, Context>;
|
|
122
|
+
}) => Promise<Item[]>;
|
|
123
|
+
fetchConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, plan, take }: {
|
|
124
|
+
ctx?: Context | undefined;
|
|
125
|
+
cursor?: string;
|
|
126
|
+
direction: 'backward' | 'forward';
|
|
127
|
+
extra?: DrizzleQueryExtra;
|
|
128
|
+
plan: SourcePlan<Item, Context>;
|
|
129
|
+
take: number;
|
|
130
|
+
}) => Promise<Item[]>;
|
|
131
|
+
getSource: <Item extends AnyRecord = AnyRecord>(target: SourceTarget<Item>) => SourceDefinition<Item, unknown>;
|
|
132
|
+
registry: SourceRegistry<Context>;
|
|
133
|
+
connection: <TItem, TNode = TItem, TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> | undefined = undefined>(options: {
|
|
138
134
|
defaultSize?: number;
|
|
139
135
|
getCursor?: ((node: TNode) => string) | undefined;
|
|
140
136
|
input?: TAdditionalInput | undefined;
|
|
@@ -147,10 +143,10 @@ declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({
|
|
|
147
143
|
};
|
|
148
144
|
} ? TContext : unknown;
|
|
149
145
|
input: {
|
|
150
|
-
select: string[];
|
|
151
146
|
args?: Record<string, unknown> | undefined;
|
|
147
|
+
select: string[];
|
|
152
148
|
} & {
|
|
153
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
149
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
154
150
|
};
|
|
155
151
|
items: TItem[];
|
|
156
152
|
}) => TNode[] | Promise<TNode[]>) | undefined;
|
|
@@ -163,51 +159,46 @@ declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({
|
|
|
163
159
|
};
|
|
164
160
|
} ? TContext : unknown;
|
|
165
161
|
cursor?: string;
|
|
166
|
-
direction:
|
|
162
|
+
direction: 'forward' | 'backward';
|
|
167
163
|
input: {
|
|
168
|
-
select: string[];
|
|
169
164
|
args?: Record<string, unknown> | undefined;
|
|
165
|
+
select: string[];
|
|
170
166
|
} & {
|
|
171
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
167
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
172
168
|
};
|
|
173
169
|
skip?: number;
|
|
174
170
|
take: number;
|
|
175
171
|
}) => Promise<TItem[]>;
|
|
176
172
|
}) => QueryProcedure<{
|
|
177
173
|
input: {
|
|
178
|
-
select: string[];
|
|
179
174
|
args?: Record<string, unknown> | undefined;
|
|
175
|
+
select: string[];
|
|
180
176
|
} & {
|
|
181
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
177
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
182
178
|
};
|
|
183
179
|
meta: unknown;
|
|
184
180
|
output: ConnectionResult<TNode>;
|
|
185
181
|
}>;
|
|
186
|
-
createPlan: <Item extends AnyRecord = AnyRecord>({
|
|
187
|
-
args,
|
|
188
|
-
ctx,
|
|
189
|
-
select,
|
|
190
|
-
view
|
|
191
|
-
}: SourceInput & {
|
|
182
|
+
createPlan: <Item extends AnyRecord = AnyRecord>({ args, ctx, select, view }: SourceInput & {
|
|
192
183
|
ctx?: Context;
|
|
193
184
|
view: ViewTarget<Item>;
|
|
194
185
|
}) => {
|
|
195
|
-
root: SourcePlanNode<unknown, unknown>;
|
|
196
|
-
source: SourceDefinition<Item, unknown>;
|
|
197
186
|
args: AnyRecord | undefined;
|
|
198
187
|
ctx: Context | undefined;
|
|
199
188
|
resolve: (item: Item) => Promise<AnyRecord>;
|
|
200
189
|
resolveMany: (items: Array<AnyRecord>) => Promise<Array<AnyRecord>>;
|
|
201
190
|
selectedPaths: Set<string>;
|
|
202
191
|
view: DataView<Item>;
|
|
192
|
+
root: SourcePlanNode<unknown, unknown>;
|
|
193
|
+
source: SourceDefinition<Item, unknown>;
|
|
203
194
|
};
|
|
204
195
|
procedures: <Item extends AnyRecord, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>(input: ViewProcedureInput<Item, ById, List>) => (ById extends false ? Record<never, never> : {
|
|
205
196
|
byId: ReturnType<ReturnType<Procedure["input"]>["query"]>;
|
|
206
197
|
}) & (List extends false ? Record<never, never> : {
|
|
207
198
|
list: QueryProcedure<{
|
|
208
199
|
input: {
|
|
209
|
-
select: string[];
|
|
210
200
|
args?: Record<string, unknown> | undefined;
|
|
201
|
+
select: string[];
|
|
211
202
|
} & {
|
|
212
203
|
args?: Record<string, unknown> | (Record<string, unknown> & object) | undefined;
|
|
213
204
|
};
|
|
@@ -215,90 +206,30 @@ declare function createDrizzleFate<Context, Procedure extends ProcedureLike>({
|
|
|
215
206
|
output: ConnectionResult<unknown>;
|
|
216
207
|
}>;
|
|
217
208
|
});
|
|
218
|
-
resolveById: <Item extends AnyRecord = AnyRecord>({
|
|
219
|
-
ctx,
|
|
220
|
-
extra,
|
|
221
|
-
id,
|
|
222
|
-
input,
|
|
223
|
-
view
|
|
224
|
-
}: {
|
|
209
|
+
resolveById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, input, view }: {
|
|
225
210
|
ctx: Context;
|
|
226
211
|
extra?: DrizzleQueryExtra;
|
|
227
212
|
id: string;
|
|
228
213
|
input: SourceInput;
|
|
229
214
|
view: ViewTarget<Item>;
|
|
230
215
|
}) => Promise<AnyRecord | null>;
|
|
231
|
-
resolveByIds: <Item extends AnyRecord = AnyRecord>({
|
|
232
|
-
ctx,
|
|
233
|
-
extra,
|
|
234
|
-
ids,
|
|
235
|
-
input,
|
|
236
|
-
view
|
|
237
|
-
}: {
|
|
216
|
+
resolveByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, input, view }: {
|
|
238
217
|
ctx: Context;
|
|
239
218
|
extra?: DrizzleQueryExtra;
|
|
240
219
|
ids: Array<string>;
|
|
241
220
|
input: SourceInput;
|
|
242
221
|
view: ViewTarget<Item>;
|
|
243
222
|
}) => Promise<AnyRecord[]>;
|
|
244
|
-
resolveConnection: <Item extends AnyRecord = AnyRecord>({
|
|
245
|
-
ctx,
|
|
246
|
-
cursor,
|
|
247
|
-
direction,
|
|
248
|
-
extra,
|
|
249
|
-
input,
|
|
250
|
-
skip,
|
|
251
|
-
take,
|
|
252
|
-
view
|
|
253
|
-
}: {
|
|
223
|
+
resolveConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, input, skip, take, view }: {
|
|
254
224
|
ctx: Context;
|
|
255
225
|
cursor?: string;
|
|
256
|
-
direction:
|
|
226
|
+
direction: 'backward' | 'forward';
|
|
257
227
|
extra?: DrizzleQueryExtra;
|
|
258
228
|
input: SourceInput;
|
|
259
229
|
skip?: number;
|
|
260
230
|
take: number;
|
|
261
231
|
view: ViewTarget<Item>;
|
|
262
232
|
}) => Promise<AnyRecord[]>;
|
|
263
|
-
fetchById: <Item extends AnyRecord = AnyRecord>({
|
|
264
|
-
ctx,
|
|
265
|
-
extra,
|
|
266
|
-
id,
|
|
267
|
-
plan
|
|
268
|
-
}: {
|
|
269
|
-
ctx?: Context | undefined;
|
|
270
|
-
extra?: DrizzleQueryExtra;
|
|
271
|
-
id: string;
|
|
272
|
-
plan: SourcePlan<Item, Context>;
|
|
273
|
-
}) => Promise<Item | null>;
|
|
274
|
-
fetchByIds: <Item extends AnyRecord = AnyRecord>({
|
|
275
|
-
ctx,
|
|
276
|
-
extra,
|
|
277
|
-
ids,
|
|
278
|
-
plan
|
|
279
|
-
}: {
|
|
280
|
-
ctx?: Context | undefined;
|
|
281
|
-
extra?: DrizzleQueryExtra;
|
|
282
|
-
ids: Array<string>;
|
|
283
|
-
plan: SourcePlan<Item, Context>;
|
|
284
|
-
}) => Promise<Item[]>;
|
|
285
|
-
fetchConnection: <Item extends AnyRecord = AnyRecord>({
|
|
286
|
-
ctx,
|
|
287
|
-
cursor,
|
|
288
|
-
direction,
|
|
289
|
-
extra,
|
|
290
|
-
plan,
|
|
291
|
-
take
|
|
292
|
-
}: {
|
|
293
|
-
ctx?: Context | undefined;
|
|
294
|
-
cursor?: string;
|
|
295
|
-
direction: "backward" | "forward";
|
|
296
|
-
extra?: DrizzleQueryExtra;
|
|
297
|
-
plan: SourcePlan<Item, Context>;
|
|
298
|
-
take: number;
|
|
299
|
-
}) => Promise<Item[]>;
|
|
300
|
-
getSource: <Item extends AnyRecord = AnyRecord>(target: SourceTarget<Item>) => SourceDefinition<Item, unknown>;
|
|
301
|
-
registry: SourceRegistry<Context>;
|
|
302
233
|
};
|
|
303
234
|
//#endregion
|
|
304
235
|
export { DrizzleManyToManyConfig, DrizzleManyToManyInput, DrizzleQueryExtra, DrizzleSourceAdapter, DrizzleViewConfig, createDrizzleFate, createDrizzleSourceAdapter, createDrizzleSourceRegistry };
|
package/lib/server/drizzle.mjs
CHANGED
|
@@ -649,7 +649,7 @@ function createDrizzleSourceAdapter({ db, nestedPaginationConcurrency, schema, v
|
|
|
649
649
|
ctx,
|
|
650
650
|
extraFields: extra?.extraFields,
|
|
651
651
|
node: plan.root,
|
|
652
|
-
where: inArray(getColumn(config.columns, plan.source.id), [...new Set(ids)])
|
|
652
|
+
where: and(inArray(getColumn(config.columns, plan.source.id), [...new Set(ids)]), extra?.where)
|
|
653
653
|
});
|
|
654
654
|
return reorderByIds(ids, await hydrateRows(rows, plan.root, ctx));
|
|
655
655
|
};
|
package/lib/server/prisma.d.mts
CHANGED
|
@@ -1,6 +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, s as OrderDirection, t as SourceRegistry } from "../executor-
|
|
3
|
-
|
|
1
|
+
import { nt as QueryProcedure, r as AnyRecord } from "../transport-Bo1Jgo9R.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-BRudKWDY.mjs";
|
|
4
3
|
//#region src/server/prisma.d.ts
|
|
5
4
|
type PrismaDelegate = {
|
|
6
5
|
findMany?: (args: any) => Promise<Array<AnyRecord>>;
|
|
@@ -27,37 +26,19 @@ type ViewProcedureInput<Item extends AnyRecord, ById extends boolean | undefined
|
|
|
27
26
|
view: ViewTarget<Item>;
|
|
28
27
|
};
|
|
29
28
|
type PrismaSourceAdapter<Context> = {
|
|
30
|
-
fetchById: <Item extends AnyRecord = AnyRecord>({
|
|
31
|
-
ctx,
|
|
32
|
-
extra,
|
|
33
|
-
id,
|
|
34
|
-
plan
|
|
35
|
-
}: {
|
|
29
|
+
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
36
30
|
ctx: Context;
|
|
37
31
|
extra?: PrismaQueryExtra;
|
|
38
32
|
id: string;
|
|
39
33
|
plan: SourcePlan<Item, Context>;
|
|
40
34
|
}) => Promise<Item | null>;
|
|
41
|
-
fetchByIds: <Item extends AnyRecord = AnyRecord>({
|
|
42
|
-
ctx,
|
|
43
|
-
extra,
|
|
44
|
-
ids,
|
|
45
|
-
plan
|
|
46
|
-
}: {
|
|
35
|
+
fetchByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, plan }: {
|
|
47
36
|
ctx: Context;
|
|
48
37
|
extra?: PrismaQueryExtra;
|
|
49
38
|
ids: Array<string>;
|
|
50
39
|
plan: SourcePlan<Item, Context>;
|
|
51
40
|
}) => Promise<Array<Item>>;
|
|
52
|
-
fetchConnection: <Item extends AnyRecord = AnyRecord>({
|
|
53
|
-
ctx,
|
|
54
|
-
cursor,
|
|
55
|
-
direction,
|
|
56
|
-
extra,
|
|
57
|
-
plan,
|
|
58
|
-
skip,
|
|
59
|
-
take
|
|
60
|
-
}: {
|
|
41
|
+
fetchConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, plan, skip, take }: {
|
|
61
42
|
ctx: Context;
|
|
62
43
|
cursor?: string;
|
|
63
44
|
direction: 'backward' | 'forward';
|
|
@@ -102,40 +83,51 @@ type SourceInput = {
|
|
|
102
83
|
args?: Record<string, unknown>;
|
|
103
84
|
select: Iterable<string>;
|
|
104
85
|
};
|
|
105
|
-
declare const prismaConnectionArgs: ({
|
|
106
|
-
cursor,
|
|
107
|
-
direction,
|
|
108
|
-
node,
|
|
109
|
-
skip,
|
|
110
|
-
take
|
|
111
|
-
}: {
|
|
86
|
+
declare const prismaConnectionArgs: ({ cursor, direction, node, skip, take }: {
|
|
112
87
|
cursor?: string;
|
|
113
|
-
direction:
|
|
88
|
+
direction: 'backward' | 'forward';
|
|
114
89
|
node: SourcePlanNode<any, any>;
|
|
115
90
|
skip?: number;
|
|
116
91
|
take: number;
|
|
117
92
|
}) => {
|
|
118
|
-
orderBy: {
|
|
119
|
-
[x: string]: OrderDirection;
|
|
120
|
-
}[];
|
|
121
|
-
take: number;
|
|
122
93
|
cursor?: {
|
|
123
94
|
id: string;
|
|
124
95
|
} | undefined;
|
|
125
96
|
skip?: number | undefined;
|
|
97
|
+
orderBy: {
|
|
98
|
+
[x: string]: OrderDirection;
|
|
99
|
+
}[];
|
|
100
|
+
take: number;
|
|
126
101
|
};
|
|
127
|
-
declare function createPrismaSourceAdapter<Context>({
|
|
128
|
-
prisma,
|
|
129
|
-
views
|
|
130
|
-
}: PrismaSourceAdapterOptions<Context>): PrismaSourceAdapter<Context>;
|
|
102
|
+
declare function createPrismaSourceAdapter<Context>({ prisma, views }: PrismaSourceAdapterOptions<Context>): PrismaSourceAdapter<Context>;
|
|
131
103
|
declare const createPrismaSourceRegistry: <Context>(options: Parameters<typeof createPrismaSourceAdapter<Context>>[0]) => SourceRegistry<Context>;
|
|
132
|
-
declare function createPrismaFate<Context, Procedure extends ProcedureLike>({
|
|
133
|
-
procedure,
|
|
134
|
-
...options
|
|
135
|
-
}: Parameters<typeof createPrismaSourceAdapter<Context>>[0] & {
|
|
104
|
+
declare function createPrismaFate<Context, Procedure extends ProcedureLike>({ procedure, ...options }: Parameters<typeof createPrismaSourceAdapter<Context>>[0] & {
|
|
136
105
|
procedure: Procedure;
|
|
137
106
|
}): {
|
|
138
|
-
|
|
107
|
+
fetchById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, plan }: {
|
|
108
|
+
ctx: Context;
|
|
109
|
+
extra?: PrismaQueryExtra;
|
|
110
|
+
id: string;
|
|
111
|
+
plan: SourcePlan<Item, Context>;
|
|
112
|
+
}) => Promise<Item | null>;
|
|
113
|
+
fetchByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, plan }: {
|
|
114
|
+
ctx: Context;
|
|
115
|
+
extra?: PrismaQueryExtra;
|
|
116
|
+
ids: Array<string>;
|
|
117
|
+
plan: SourcePlan<Item, Context>;
|
|
118
|
+
}) => Promise<Item[]>;
|
|
119
|
+
fetchConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, plan, skip, take }: {
|
|
120
|
+
ctx: Context;
|
|
121
|
+
cursor?: string;
|
|
122
|
+
direction: 'backward' | 'forward';
|
|
123
|
+
extra?: PrismaQueryExtra;
|
|
124
|
+
plan: SourcePlan<Item, Context>;
|
|
125
|
+
skip?: number;
|
|
126
|
+
take: number;
|
|
127
|
+
}) => Promise<Item[]>;
|
|
128
|
+
getSource: <Item extends AnyRecord = AnyRecord>(target: SourceTarget<Item>) => SourceDefinition<Item, unknown>;
|
|
129
|
+
registry: SourceRegistry<Context>;
|
|
130
|
+
connection: <TItem, TNode = TItem, TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> | undefined = undefined>(options: {
|
|
139
131
|
defaultSize?: number;
|
|
140
132
|
getCursor?: ((node: TNode) => string) | undefined;
|
|
141
133
|
input?: TAdditionalInput | undefined;
|
|
@@ -148,10 +140,10 @@ declare function createPrismaFate<Context, Procedure extends ProcedureLike>({
|
|
|
148
140
|
};
|
|
149
141
|
} ? TContext : unknown;
|
|
150
142
|
input: {
|
|
151
|
-
select: string[];
|
|
152
143
|
args?: Record<string, unknown> | undefined;
|
|
144
|
+
select: string[];
|
|
153
145
|
} & {
|
|
154
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
146
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
155
147
|
};
|
|
156
148
|
items: TItem[];
|
|
157
149
|
}) => TNode[] | Promise<TNode[]>) | undefined;
|
|
@@ -164,51 +156,46 @@ declare function createPrismaFate<Context, Procedure extends ProcedureLike>({
|
|
|
164
156
|
};
|
|
165
157
|
} ? TContext : unknown;
|
|
166
158
|
cursor?: string;
|
|
167
|
-
direction:
|
|
159
|
+
direction: 'forward' | 'backward';
|
|
168
160
|
input: {
|
|
169
|
-
select: string[];
|
|
170
161
|
args?: Record<string, unknown> | undefined;
|
|
162
|
+
select: string[];
|
|
171
163
|
} & {
|
|
172
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
164
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
173
165
|
};
|
|
174
166
|
skip?: number;
|
|
175
167
|
take: number;
|
|
176
168
|
}) => Promise<TItem[]>;
|
|
177
169
|
}) => QueryProcedure<{
|
|
178
170
|
input: {
|
|
179
|
-
select: string[];
|
|
180
171
|
args?: Record<string, unknown> | undefined;
|
|
172
|
+
select: string[];
|
|
181
173
|
} & {
|
|
182
|
-
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").
|
|
174
|
+
args?: ((Record<string, unknown> | undefined) & (TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodTypeAny<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
|
|
183
175
|
};
|
|
184
176
|
meta: unknown;
|
|
185
177
|
output: ConnectionResult<TNode>;
|
|
186
178
|
}>;
|
|
187
|
-
createPlan: <Item extends AnyRecord = AnyRecord>({
|
|
188
|
-
args,
|
|
189
|
-
ctx,
|
|
190
|
-
select,
|
|
191
|
-
view
|
|
192
|
-
}: SourceInput & {
|
|
179
|
+
createPlan: <Item extends AnyRecord = AnyRecord>({ args, ctx, select, view }: SourceInput & {
|
|
193
180
|
ctx?: Context;
|
|
194
181
|
view: ViewTarget<Item>;
|
|
195
182
|
}) => {
|
|
196
|
-
root: SourcePlanNode<unknown, unknown>;
|
|
197
|
-
source: SourceDefinition<Item, unknown>;
|
|
198
183
|
args: AnyRecord | undefined;
|
|
199
184
|
ctx: Context | undefined;
|
|
200
185
|
resolve: (item: Item) => Promise<AnyRecord>;
|
|
201
186
|
resolveMany: (items: Array<AnyRecord>) => Promise<Array<AnyRecord>>;
|
|
202
187
|
selectedPaths: Set<string>;
|
|
203
188
|
view: DataView<Item>;
|
|
189
|
+
root: SourcePlanNode<unknown, unknown>;
|
|
190
|
+
source: SourceDefinition<Item, unknown>;
|
|
204
191
|
};
|
|
205
192
|
procedures: <Item extends AnyRecord, ById extends boolean | undefined = undefined, List extends boolean | ListConfig | undefined = undefined>(input: ViewProcedureInput<Item, ById, List>) => (ById extends false ? Record<never, never> : {
|
|
206
193
|
byId: ReturnType<ReturnType<Procedure["input"]>["query"]>;
|
|
207
194
|
}) & (List extends false ? Record<never, never> : {
|
|
208
195
|
list: QueryProcedure<{
|
|
209
196
|
input: {
|
|
210
|
-
select: string[];
|
|
211
197
|
args?: Record<string, unknown> | undefined;
|
|
198
|
+
select: string[];
|
|
212
199
|
} & {
|
|
213
200
|
args?: Record<string, unknown> | (Record<string, unknown> & object) | undefined;
|
|
214
201
|
};
|
|
@@ -216,92 +203,30 @@ declare function createPrismaFate<Context, Procedure extends ProcedureLike>({
|
|
|
216
203
|
output: ConnectionResult<unknown>;
|
|
217
204
|
}>;
|
|
218
205
|
});
|
|
219
|
-
resolveById: <Item extends AnyRecord = AnyRecord>({
|
|
220
|
-
ctx,
|
|
221
|
-
extra,
|
|
222
|
-
id,
|
|
223
|
-
input,
|
|
224
|
-
view
|
|
225
|
-
}: {
|
|
206
|
+
resolveById: <Item extends AnyRecord = AnyRecord>({ ctx, extra, id, input, view }: {
|
|
226
207
|
ctx: Context;
|
|
227
208
|
extra?: PrismaQueryExtra;
|
|
228
209
|
id: string;
|
|
229
210
|
input: SourceInput;
|
|
230
211
|
view: ViewTarget<Item>;
|
|
231
212
|
}) => Promise<AnyRecord | null>;
|
|
232
|
-
resolveByIds: <Item extends AnyRecord = AnyRecord>({
|
|
233
|
-
ctx,
|
|
234
|
-
extra,
|
|
235
|
-
ids,
|
|
236
|
-
input,
|
|
237
|
-
view
|
|
238
|
-
}: {
|
|
213
|
+
resolveByIds: <Item extends AnyRecord = AnyRecord>({ ctx, extra, ids, input, view }: {
|
|
239
214
|
ctx: Context;
|
|
240
215
|
extra?: PrismaQueryExtra;
|
|
241
216
|
ids: Array<string>;
|
|
242
217
|
input: SourceInput;
|
|
243
218
|
view: ViewTarget<Item>;
|
|
244
219
|
}) => Promise<AnyRecord[]>;
|
|
245
|
-
resolveConnection: <Item extends AnyRecord = AnyRecord>({
|
|
246
|
-
ctx,
|
|
247
|
-
cursor,
|
|
248
|
-
direction,
|
|
249
|
-
extra,
|
|
250
|
-
input,
|
|
251
|
-
skip,
|
|
252
|
-
take,
|
|
253
|
-
view
|
|
254
|
-
}: {
|
|
220
|
+
resolveConnection: <Item extends AnyRecord = AnyRecord>({ ctx, cursor, direction, extra, input, skip, take, view }: {
|
|
255
221
|
ctx: Context;
|
|
256
222
|
cursor?: string;
|
|
257
|
-
direction:
|
|
223
|
+
direction: 'backward' | 'forward';
|
|
258
224
|
extra?: PrismaQueryExtra;
|
|
259
225
|
input: SourceInput;
|
|
260
226
|
skip?: number;
|
|
261
227
|
take: number;
|
|
262
228
|
view: ViewTarget<Item>;
|
|
263
229
|
}) => Promise<AnyRecord[]>;
|
|
264
|
-
fetchById: <Item extends AnyRecord = AnyRecord>({
|
|
265
|
-
ctx,
|
|
266
|
-
extra,
|
|
267
|
-
id,
|
|
268
|
-
plan
|
|
269
|
-
}: {
|
|
270
|
-
ctx: Context;
|
|
271
|
-
extra?: PrismaQueryExtra;
|
|
272
|
-
id: string;
|
|
273
|
-
plan: SourcePlan<Item, Context>;
|
|
274
|
-
}) => Promise<Item | null>;
|
|
275
|
-
fetchByIds: <Item extends AnyRecord = AnyRecord>({
|
|
276
|
-
ctx,
|
|
277
|
-
extra,
|
|
278
|
-
ids,
|
|
279
|
-
plan
|
|
280
|
-
}: {
|
|
281
|
-
ctx: Context;
|
|
282
|
-
extra?: PrismaQueryExtra;
|
|
283
|
-
ids: Array<string>;
|
|
284
|
-
plan: SourcePlan<Item, Context>;
|
|
285
|
-
}) => Promise<Item[]>;
|
|
286
|
-
fetchConnection: <Item extends AnyRecord = AnyRecord>({
|
|
287
|
-
ctx,
|
|
288
|
-
cursor,
|
|
289
|
-
direction,
|
|
290
|
-
extra,
|
|
291
|
-
plan,
|
|
292
|
-
skip,
|
|
293
|
-
take
|
|
294
|
-
}: {
|
|
295
|
-
ctx: Context;
|
|
296
|
-
cursor?: string;
|
|
297
|
-
direction: "backward" | "forward";
|
|
298
|
-
extra?: PrismaQueryExtra;
|
|
299
|
-
plan: SourcePlan<Item, Context>;
|
|
300
|
-
skip?: number;
|
|
301
|
-
take: number;
|
|
302
|
-
}) => Promise<Item[]>;
|
|
303
|
-
getSource: <Item extends AnyRecord = AnyRecord>(target: SourceTarget<Item>) => SourceDefinition<Item, unknown>;
|
|
304
|
-
registry: SourceRegistry<Context>;
|
|
305
230
|
};
|
|
306
231
|
//#endregion
|
|
307
232
|
export { PrismaDelegate, PrismaQueryExtra, PrismaSourceAdapter, PrismaViewConfig, createPrismaFate, createPrismaSourceAdapter, createPrismaSourceRegistry, prismaConnectionArgs };
|