@nkzw/fate 1.3.3 → 1.5.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.
Files changed (191) hide show
  1. package/README.md +326 -0
  2. package/docs/api/classes/FateClient.md +51 -199
  3. package/docs/api/functions/clientRoot.md +1 -1
  4. package/docs/api/functions/createClient.md +1 -1
  5. package/docs/api/functions/createGraphQLTransport.md +1 -1
  6. package/docs/api/functions/createHTTPTransport.md +1 -1
  7. package/docs/api/functions/createTRPCTransport.md +5 -1
  8. package/docs/api/functions/defer.md +1 -1
  9. package/docs/api/functions/getDeferredMetadata.md +1 -1
  10. package/docs/api/functions/getListEntries.md +1 -1
  11. package/docs/api/functions/getSelectionPlan.md +1 -1
  12. package/docs/api/functions/graphqlMutation.md +1 -1
  13. package/docs/api/functions/isDeferred.md +1 -1
  14. package/docs/api/functions/isRecord.md +1 -1
  15. package/docs/api/functions/isViewTag.md +1 -1
  16. package/docs/api/functions/liveConnectionTopic.md +1 -1
  17. package/docs/api/functions/liveEntityTopic.md +1 -1
  18. package/docs/api/functions/liveGlobalConnectionTopic.md +1 -1
  19. package/docs/api/functions/mutation.md +1 -1
  20. package/docs/api/functions/toEntityId.md +1 -1
  21. package/docs/api/functions/view.md +1 -1
  22. package/docs/api/index.md +4 -1
  23. package/docs/api/interfaces/FateThenable.md +3 -3
  24. package/docs/api/interfaces/Persistence.md +23 -0
  25. package/docs/api/interfaces/PersistenceSession.md +109 -0
  26. package/docs/api/interfaces/Transport.md +46 -7
  27. package/docs/api/server/classes/FateRequestError.md +5 -5
  28. package/docs/api/server/drizzle/functions/createDrizzleFate.md +1 -1
  29. package/docs/api/server/drizzle/functions/createDrizzleSourceAdapter.md +1 -1
  30. package/docs/api/server/drizzle/functions/createDrizzleSourceRegistry.md +1 -1
  31. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyConfig.md +1 -1
  32. package/docs/api/server/drizzle/type-aliases/DrizzleManyToManyInput.md +1 -1
  33. package/docs/api/server/drizzle/type-aliases/DrizzleQueryExtra.md +3 -3
  34. package/docs/api/server/drizzle/type-aliases/DrizzleSourceAdapter.md +9 -9
  35. package/docs/api/server/drizzle/type-aliases/DrizzleViewConfig.md +1 -1
  36. package/docs/api/server/functions/bindSourceProcedures.md +1 -1
  37. package/docs/api/server/functions/computed.md +1 -1
  38. package/docs/api/server/functions/count.md +1 -1
  39. package/docs/api/server/functions/createFateFetchHandler.md +1 -1
  40. package/docs/api/server/functions/createFateServer.md +1 -1
  41. package/docs/api/server/functions/createHonoFateHandler.md +1 -1
  42. package/docs/api/server/functions/createLiveEventBus.md +1 -1
  43. package/docs/api/server/functions/createNestedSourcePlan.md +1 -1
  44. package/docs/api/server/functions/createResolver.md +1 -1
  45. package/docs/api/server/functions/createSourcePlan.md +1 -1
  46. package/docs/api/server/functions/createSourceProcedures.md +1 -1
  47. package/docs/api/server/functions/dataView.md +1 -1
  48. package/docs/api/server/functions/field.md +1 -1
  49. package/docs/api/server/functions/getNestedSelection.md +1 -1
  50. package/docs/api/server/functions/getScopedArgs.md +1 -1
  51. package/docs/api/server/functions/hasNestedSelection.md +1 -1
  52. package/docs/api/server/functions/list.md +1 -1
  53. package/docs/api/server/functions/refetchSourceById.md +1 -1
  54. package/docs/api/server/functions/resolveSourceById.md +1 -1
  55. package/docs/api/server/functions/resolveSourceByIds.md +1 -1
  56. package/docs/api/server/functions/resolveSourceConnection.md +1 -1
  57. package/docs/api/server/functions/resolver.md +1 -1
  58. package/docs/api/server/functions/toPrismaSelect.md +1 -1
  59. package/docs/api/server/functions/withConnection.md +1 -1
  60. package/docs/api/server/prisma/functions/createPrismaFate.md +1 -1
  61. package/docs/api/server/prisma/functions/createPrismaSourceAdapter.md +1 -1
  62. package/docs/api/server/prisma/functions/createPrismaSourceRegistry.md +1 -1
  63. package/docs/api/server/prisma/functions/prismaConnectionArgs.md +1 -1
  64. package/docs/api/server/prisma/type-aliases/PrismaDelegate.md +4 -4
  65. package/docs/api/server/prisma/type-aliases/PrismaQueryExtra.md +1 -1
  66. package/docs/api/server/prisma/type-aliases/PrismaSourceAdapter.md +9 -9
  67. package/docs/api/server/prisma/type-aliases/PrismaViewConfig.md +1 -1
  68. package/docs/api/server/type-aliases/ComputedField.md +5 -5
  69. package/docs/api/server/type-aliases/ComputedSelection.md +1 -1
  70. package/docs/api/server/type-aliases/ConnectionItem.md +3 -3
  71. package/docs/api/server/type-aliases/ConnectionPagination.md +5 -5
  72. package/docs/api/server/type-aliases/ConnectionResult.md +3 -3
  73. package/docs/api/server/type-aliases/CountSelection.md +4 -4
  74. package/docs/api/server/type-aliases/CountWhere.md +1 -1
  75. package/docs/api/server/type-aliases/DataViewListOptions.md +2 -2
  76. package/docs/api/server/type-aliases/DataViewOrderBy.md +1 -1
  77. package/docs/api/server/type-aliases/DataViewOrderDirection.md +1 -1
  78. package/docs/api/server/type-aliases/DataViewResult.md +1 -1
  79. package/docs/api/server/type-aliases/Entity.md +1 -1
  80. package/docs/api/server/type-aliases/FateServer.md +5 -5
  81. package/docs/api/server/type-aliases/FateServerManifest.md +1 -1
  82. package/docs/api/server/type-aliases/FieldSelection.md +3 -3
  83. package/docs/api/server/type-aliases/LiveConnectionEventType.md +1 -1
  84. package/docs/api/server/type-aliases/LiveConnectionSourceEvent.md +1 -1
  85. package/docs/api/server/type-aliases/LiveEventBus.md +1 -1
  86. package/docs/api/server/type-aliases/LiveEventType.md +1 -1
  87. package/docs/api/server/type-aliases/LiveSourceEvent.md +1 -1
  88. package/docs/api/server/type-aliases/NativeFateAPI.md +4 -4
  89. package/docs/api/server/type-aliases/OrderDirection.md +1 -1
  90. package/docs/api/server/type-aliases/SourceConfig.md +6 -6
  91. package/docs/api/server/type-aliases/SourceDefinition.md +6 -6
  92. package/docs/api/server/type-aliases/SourceOrder.md +1 -1
  93. package/docs/api/server/type-aliases/SourceOrderField.md +3 -3
  94. package/docs/api/server/type-aliases/SourcePlan.md +1 -1
  95. package/docs/api/server/type-aliases/SourcePlanNode.md +1 -1
  96. package/docs/api/server/type-aliases/SourceRegistry.md +1 -1
  97. package/docs/api/server/type-aliases/SourceRelation.md +1 -1
  98. package/docs/api/server/type-aliases/SourceRelationConfig.md +1 -1
  99. package/docs/api/server/variables/byIdInput.md +1 -1
  100. package/docs/api/server/variables/connectionArgs.md +1 -1
  101. package/docs/api/type-aliases/ConnectionMetadata.md +1 -1
  102. package/docs/api/type-aliases/ConnectionRef.md +1 -1
  103. package/docs/api/type-aliases/Deferred.md +1 -1
  104. package/docs/api/type-aliases/DeferredMetadata.md +1 -1
  105. package/docs/api/type-aliases/DeferredSelection.md +1 -1
  106. package/docs/api/type-aliases/DeferredSnapshot.md +1 -1
  107. package/docs/api/type-aliases/Entity.md +2 -2
  108. package/docs/api/type-aliases/EntityId.md +1 -1
  109. package/docs/api/type-aliases/FateDehydratedState.md +1 -1
  110. package/docs/api/type-aliases/FateLiveConnectionEvent.md +1 -1
  111. package/docs/api/type-aliases/FateLiveEvent.md +1 -1
  112. package/docs/api/type-aliases/FateMutations.md +1 -1
  113. package/docs/api/type-aliases/FateOperation.md +2 -2
  114. package/docs/api/type-aliases/FateProtocolRequest.md +1 -1
  115. package/docs/api/type-aliases/FateProtocolResponse.md +1 -1
  116. package/docs/api/type-aliases/FateRecord.md +1 -1
  117. package/docs/api/type-aliases/FateRoots.md +1 -1
  118. package/docs/api/type-aliases/GraphQLMutationDefinition.md +1 -1
  119. package/docs/api/type-aliases/GraphQLMutationInput.md +1 -1
  120. package/docs/api/type-aliases/GraphQLMutationMap.md +1 -1
  121. package/docs/api/type-aliases/GraphQLMutationOutput.md +1 -1
  122. package/docs/api/type-aliases/GraphQLTransportOptions.md +19 -11
  123. package/docs/api/type-aliases/HydrateOptions.md +1 -1
  124. package/docs/api/type-aliases/HydrationLimits.md +1 -1
  125. package/docs/api/type-aliases/InferFateAPI.md +1 -1
  126. package/docs/api/type-aliases/List.md +1 -1
  127. package/docs/api/type-aliases/ListEntry.md +1 -1
  128. package/docs/api/type-aliases/ListItem.md +1 -1
  129. package/docs/api/type-aliases/Mask.md +1 -1
  130. package/docs/api/type-aliases/MutationDefinition.md +1 -1
  131. package/docs/api/type-aliases/MutationEntity.md +1 -1
  132. package/docs/api/type-aliases/MutationIdentifier.md +1 -1
  133. package/docs/api/type-aliases/MutationIdentity.md +7 -0
  134. package/docs/api/type-aliases/MutationInput.md +1 -1
  135. package/docs/api/type-aliases/MutationResult.md +1 -1
  136. package/docs/api/type-aliases/NodesItem.md +1 -1
  137. package/docs/api/type-aliases/Pagination.md +5 -5
  138. package/docs/api/type-aliases/PersistenceSnapshot.md +5 -0
  139. package/docs/api/type-aliases/Request.md +1 -1
  140. package/docs/api/type-aliases/RequestMode.md +1 -1
  141. package/docs/api/type-aliases/RequestOptions.md +2 -2
  142. package/docs/api/type-aliases/RequestResult.md +1 -1
  143. package/docs/api/type-aliases/Selection.md +1 -1
  144. package/docs/api/type-aliases/TypeConfig.md +4 -4
  145. package/docs/api/type-aliases/View.md +1 -1
  146. package/docs/api/type-aliases/ViewData.md +1 -1
  147. package/docs/api/type-aliases/ViewEntity.md +1 -1
  148. package/docs/api/type-aliases/ViewEntityName.md +1 -1
  149. package/docs/api/type-aliases/ViewRef.md +1 -1
  150. package/docs/api/type-aliases/ViewSelection.md +1 -1
  151. package/docs/api/type-aliases/ViewSnapshot.md +1 -1
  152. package/docs/api/type-aliases/ViewTag.md +1 -1
  153. package/docs/api/variables/ConnectionTag.md +1 -1
  154. package/docs/api/variables/DeferTag.md +1 -1
  155. package/docs/api/variables/DeferredTag.md +1 -1
  156. package/docs/guide/getting-started.md +2 -0
  157. package/docs/guide/persistence.md +323 -0
  158. package/lib/{liveTopics-uVP0LG-Q.mjs → args-CRLIRl_v.mjs} +1 -59
  159. package/lib/cli.d.mts +1 -1
  160. package/lib/{executor-C8HNogYG.d.mts → executor-DoiTBiVv.d.mts} +18 -65
  161. package/lib/{graphqlTransport-DskuXeUP.d.mts → graphqlTransport-DGLYyRxL.d.mts} +4 -14
  162. package/lib/{graphqlTransport-DSBVS2Fq.mjs → graphqlTransport-DmheG3AO.mjs} +3 -2
  163. package/lib/graphqlTransport.d.mts +1 -1
  164. package/lib/graphqlTransport.mjs +1 -1
  165. package/lib/hydration-DPZRJgnu.mjs +273 -0
  166. package/lib/idempotency-types-CqA-BFpn.d.mts +15 -0
  167. package/lib/idempotency.d.mts +26 -0
  168. package/lib/idempotency.mjs +34 -0
  169. package/lib/index.d.mts +6 -15
  170. package/lib/index.mjs +560 -1774
  171. package/lib/{list-sI2UPhHc.d.mts → list-BRT1VtiT.d.mts} +1 -2
  172. package/lib/list.d.mts +1 -1
  173. package/lib/liveTopics-DuFkDZQm.mjs +17 -0
  174. package/lib/persistence.d.mts +38 -0
  175. package/lib/persistence.mjs +1529 -0
  176. package/lib/protocol-DS5sf6sd.mjs +44 -0
  177. package/lib/{record-CZyyeLa3.d.mts → record-DITM4zb_.d.mts} +14 -19
  178. package/lib/server/drizzle.d.mts +45 -114
  179. package/lib/server/drizzle.mjs +2 -2
  180. package/lib/server/prisma.d.mts +52 -127
  181. package/lib/server/prisma.mjs +9 -8
  182. package/lib/server.d.mts +4 -16
  183. package/lib/server.mjs +21 -35
  184. package/lib/sortObjectKeys-yhuitEQZ.mjs +9 -0
  185. package/lib/{sourceRouter-DSaADXSf.mjs → sourceRouter-51POBlEE.mjs} +9 -6
  186. package/lib/store-CeatPJeK.mjs +1350 -0
  187. package/lib/{transport-DhaVVq4P.d.mts → transport-DqjhjLfC.d.mts} +672 -517
  188. package/lib/vite.d.mts +0 -1
  189. package/lib/vite.mjs +19 -11
  190. package/package.json +15 -5
  191. package/docs/api/type-aliases/Snapshot.md +0 -7
@@ -1,6 +1,5 @@
1
- import { r as AnyRecord, rt as QueryProcedure } from "../transport-DhaVVq4P.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-C8HNogYG.mjs";
3
-
1
+ import { st as QueryProcedure, v as AnyRecord } from "../transport-DqjhjLfC.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-DoiTBiVv.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: "backward" | "forward";
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
- connection: <TItem, TNode = TItem, TAdditionalInput extends import("zod").ZodObject<Record<string, import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> | undefined = undefined>(options: {
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").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
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: "forward" | "backward";
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").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
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").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>, import("zod/v4/core").$strip> ? import("zod").infer<TAdditionalInput> : object)) | undefined;
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: "backward" | "forward";
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 };
@@ -1,5 +1,5 @@
1
1
  import { t as isRecord } from "../record-B07VwXd-.mjs";
2
- import { O as withConnection, S as isDataView, T as toPrismaSelect, c as resolveSourceConnection, d as createSourceDefinitions, f as createSourcePlan, g as attachComputedState, i as createSourceRegistry, l as collectDataViewConfigs, o as resolveSourceById, p as getDataViewSourceConfig, s as resolveSourceByIds, t as bindSourceProcedures } from "../sourceRouter-DSaADXSf.mjs";
2
+ import { E as stableStringify, S as isDataView, T as toPrismaSelect, c as resolveSourceConnection, d as createSourceDefinitions, f as createSourcePlan, g as attachComputedState, i as createSourceRegistry, k as withConnection, l as collectDataViewConfigs, o as resolveSourceById, p as getDataViewSourceConfig, s as resolveSourceByIds, t as bindSourceProcedures } from "../sourceRouter-51POBlEE.mjs";
3
3
  //#region src/server/prisma.ts
4
4
  /**
5
5
  * fate's Prisma integration.
@@ -50,11 +50,6 @@ const inferPrismaRelation = ({ field, kind, source, target }) => {
50
50
  localKey: source.id
51
51
  };
52
52
  };
53
- const stableStringify = (value) => {
54
- if (Array.isArray(value)) return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;
55
- if (isRecord(value)) return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(",")}}`;
56
- return JSON.stringify(value);
57
- };
58
53
  const resolveSourceReference = (source) => typeof source === "function" ? source() : source;
59
54
  const isSourceDefinition = (target) => "view" in target && "id" in target;
60
55
  const toPrismaOrderBy = (orderBy) => orderBy.map((entry) => ({ [entry.field]: entry.direction }));
@@ -187,7 +182,10 @@ function createPrismaSourceAdapter({ prisma, views }) {
187
182
  items: await delegate.findMany({
188
183
  ...extra,
189
184
  select: toPrismaSelect(plan),
190
- where: { id: { in: ids } }
185
+ where: {
186
+ ...extra?.where ? { AND: [extra.where] } : {},
187
+ id: { in: ids }
188
+ }
191
189
  }),
192
190
  plan
193
191
  });
@@ -199,7 +197,10 @@ function createPrismaSourceAdapter({ prisma, views }) {
199
197
  items: (await Promise.all([delegate.findUnique({
200
198
  ...extra,
201
199
  select: toPrismaSelect(plan),
202
- where: { id }
200
+ where: {
201
+ ...extra?.where ? { AND: [extra.where] } : {},
202
+ id
203
+ }
203
204
  })])).flatMap((item) => item ? [item] : []),
204
205
  plan
205
206
  }))[0] ?? null;
package/lib/server.d.mts CHANGED
@@ -1,8 +1,7 @@
1
- import { nt as AnyProcedure, r as AnyRecord$1 } from "./transport-DhaVVq4P.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-CZyyeLa3.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-C8HNogYG.mjs";
1
+ import { ot as AnyProcedure, v as AnyRecord$1 } from "./transport-DqjhjLfC.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-DITM4zb_.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-DoiTBiVv.mjs";
4
4
  import { z } from "zod";
5
-
6
5
  //#region src/server/input.d.ts
7
6
  declare const byIdInput: z.ZodObject<{
8
7
  args: z.ZodOptional<z.ZodType<Record<string, unknown>, unknown, z.core.$ZodTypeInternals<Record<string, unknown>, unknown>>>;
@@ -12,10 +11,6 @@ declare const byIdInput: z.ZodObject<{
12
11
  //#endregion
13
12
  //#region src/server/prismaSelect.d.ts
14
13
  type AnyRecord = Record<string, unknown>;
15
- /**
16
- * Builds a Prisma `select` object from flattened selection paths and optional
17
- * scoped args, always including the `id` field.
18
- */
19
14
  declare function toPrismaSelect<Item extends AnyRecord, Context = unknown>(plan: ViewPlan<Item, Context>): AnyRecord;
20
15
  //#endregion
21
16
  //#region src/server/queryArgs.d.ts
@@ -79,14 +74,7 @@ type SourceProcedureResult<ById extends boolean | undefined, List extends boolea
79
74
  * Use this when a router also has custom mutations or custom queries and you
80
75
  * want to spread the generated source procedures into that router.
81
76
  */
82
- 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>({
83
- byId,
84
- createConnectionProcedure,
85
- list,
86
- procedure,
87
- registry,
88
- source
89
- }: SourceProcedureOptions<Context, Item, Procedure, ConnectionProcedure> & {
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> & {
90
78
  byId?: ById;
91
79
  list?: List;
92
80
  }): SourceProcedureResult<ById, List, Procedure, ConnectionProcedure>;
package/lib/server.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  import { t as isRecord } from "./record-B07VwXd-.mjs";
2
- import { d as hashArgs, i as FateRequestError, n as liveEntityTopic, o as toProtocolError, r as liveGlobalConnectionTopic, t as liveConnectionTopic, u as filterConnectionArgs } from "./liveTopics-uVP0LG-Q.mjs";
3
- import { C as list, D as resolveConnection, E as connectionArgs, O as withConnection, S as isDataView, T as toPrismaSelect, _ as computed, a as refetchSourceById, b as dataView, c as resolveSourceConnection, f as createSourcePlan, h as hasNestedSelection, k as getScopedArgs, m as getNestedSelection, n as createSourceProcedures, o as resolveSourceById, r as byIdInput, s as resolveSourceByIds, t as bindSourceProcedures, u as createNestedSourcePlan, v as count, w as resolver, x as field, y as createResolver } from "./sourceRouter-DSaADXSf.mjs";
2
+ import { a as hashArgs, i as filterConnectionArgs } from "./args-CRLIRl_v.mjs";
3
+ import { r as toProtocolError, t as FateRequestError } from "./protocol-DS5sf6sd.mjs";
4
+ import { n as liveEntityTopic, r as liveGlobalConnectionTopic, t as liveConnectionTopic } from "./liveTopics-DuFkDZQm.mjs";
5
+ import { A as getScopedArgs, C as list, D as connectionArgs, O as resolveConnection, S as isDataView, T as toPrismaSelect, _ as computed, a as refetchSourceById, b as dataView, c as resolveSourceConnection, f as createSourcePlan, h as hasNestedSelection, k as withConnection, m as getNestedSelection, n as createSourceProcedures, o as resolveSourceById, r as byIdInput, s as resolveSourceByIds, t as bindSourceProcedures, u as createNestedSourcePlan, v as count, w as resolver, x as field, y as createResolver } from "./sourceRouter-51POBlEE.mjs";
4
6
  import { EventEmitter, on } from "node:events";
5
7
  //#region src/server/live.ts
6
8
  const eventName = (type, id) => `${type}:${String(id)}`;
@@ -288,9 +290,10 @@ const operationKinds = /* @__PURE__ */ new Set([
288
290
  "query"
289
291
  ]);
290
292
  const assertProtocolRequest = (value) => {
291
- if (!isRecord(value) || value.version !== 1 || !Array.isArray(value.operations)) throw new FateRequestError("BAD_REQUEST", "Invalid Fate protocol request.");
293
+ if (!isRecord(value) || value.version !== 1 && value.version !== 2 || !Array.isArray(value.operations)) throw new FateRequestError("BAD_REQUEST", "Invalid Fate protocol request.");
292
294
  for (const operation of value.operations) {
293
295
  if (!isRecord(operation) || typeof operation.id !== "string" || typeof operation.kind !== "string" || !operationKinds.has(operation.kind) || !isStringArray(operation.select) || "args" in operation && operation.args !== void 0 && !isRecord(operation.args)) throw new FateRequestError("BAD_REQUEST", "Invalid Fate protocol operation.");
296
+ if (operation.mutation !== void 0 && (value.version !== 2 || operation.kind !== "mutation" || !isRecord(operation.mutation) || operation.mutation.replayOnly !== void 0 && operation.mutation.replayOnly !== true || typeof operation.mutation.id !== "string" || !operation.mutation.id || operation.mutation.id.length > 256 || typeof operation.mutation.scope !== "string" || operation.mutation.scope.length > 1024)) throw new FateRequestError("BAD_REQUEST", "Invalid durable mutation metadata.");
294
297
  if (operation.kind === "byId" && (typeof operation.type !== "string" || !Array.isArray(operation.ids) || !operation.ids.every(isProtocolId))) throw new FateRequestError("BAD_REQUEST", "Invalid Fate byId operation.");
295
298
  if ((operation.kind === "list" || operation.kind === "mutation" || operation.kind === "query") && typeof operation.name !== "string") throw new FateRequestError("BAD_REQUEST", "Invalid Fate named operation.");
296
299
  }
@@ -315,8 +318,7 @@ const assertLiveControlRequest = (value) => {
315
318
  const sse = (message, eventId) => {
316
319
  const lines = [];
317
320
  if (eventId) lines.push(`id: ${eventId}`);
318
- lines.push(`event: ${message.kind}`);
319
- lines.push(`data: ${JSON.stringify(message)}`);
321
+ lines.push(`event: ${message.kind}`, `data: ${JSON.stringify(message)}`);
320
322
  return `${lines.join("\n")}\n\n`;
321
323
  };
322
324
  const sseComment = (message) => `: ${message}\n\n`;
@@ -343,28 +345,7 @@ const filterLiveSelection = (source, select, changed) => {
343
345
  }
344
346
  return [...result];
345
347
  };
346
- const hasSelectedDataPath = (value, segments) => {
347
- if (segments.length === 0) return true;
348
- if (Array.isArray(value)) return value.every((entry) => hasSelectedDataPath(entry, segments));
349
- if (!isRecord(value)) return false;
350
- const [field, ...rest] = segments;
351
- return field in value && hasSelectedDataPath(value[field], rest);
352
- };
353
- const canUseLiveEventData = (data, selectedPaths) => {
354
- if (!isRecord(data)) return false;
355
- for (const path of selectedPaths) if (!hasSelectedDataPath(data, path.split("."))) return false;
356
- return true;
357
- };
358
- const resolveLiveSourceData = async ({ ctx, data, id, input, registry, source }) => {
359
- if (data !== void 0) {
360
- if (data == null) return data;
361
- const plan = createSourcePlan({
362
- ...input,
363
- ctx,
364
- source
365
- });
366
- if (canUseLiveEventData(data, plan.selectedPaths)) return await plan.resolve(data);
367
- }
348
+ const resolveLiveSourceData = async ({ ctx, id, input, registry, source }) => {
368
349
  return id == null ? null : await resolveSourceById({
369
350
  ctx,
370
351
  id: String(id),
@@ -393,7 +374,7 @@ const liveConnectionPayload = (event, node) => {
393
374
  }
394
375
  };
395
376
  const sourceScore = (source) => Object.keys(source.view.fields).length + Object.keys(source.relations ?? {}).length;
396
- function createFateServer({ context, lists, live, mutations, queries, roots, sources }) {
377
+ function createFateServer({ context, idempotency, lists, live, mutations, queries, roots, sources }) {
397
378
  const rootLists = /* @__PURE__ */ new Map();
398
379
  const rootQueries = /* @__PURE__ */ new Map();
399
380
  const sourcesByType = /* @__PURE__ */ new Map();
@@ -497,12 +478,21 @@ function createFateServer({ context, lists, live, mutations, queries, roots, sou
497
478
  }
498
479
  const mutation = mutations?.[operation.name];
499
480
  if (!mutation) throw new FateRequestError("NOT_FOUND", `No mutation registered for '${operation.name}'.`);
481
+ const resolve = async (context) => mutation.resolve({
482
+ ctx: context,
483
+ input: await parseInput(mutation.input, operation.input),
484
+ select: operation.select
485
+ });
486
+ if (operation.mutation && !idempotency) throw new FateRequestError("BAD_REQUEST", "fate: Configure createFateServer({ idempotency: createMutationIdempotency({ scope, store }) }) to accept persisted mutations. The store must commit mutation effects and receipts in the same database transaction.");
500
487
  return {
501
- data: await mutation.resolve({
488
+ data: operation.mutation ? await idempotency.execute({
502
489
  ctx,
503
- input: await parseInput(mutation.input, operation.input),
490
+ identity: operation.mutation,
491
+ input: operation.input,
492
+ name: operation.name,
493
+ resolve,
504
494
  select: operation.select
505
- }),
495
+ }) : await resolve(ctx),
506
496
  id: operation.id,
507
497
  ok: true
508
498
  };
@@ -591,7 +581,6 @@ function createFateServer({ context, lists, live, mutations, queries, roots, sou
591
581
  };
592
582
  const data = event.type === "delete" ? null : await resolveLiveSourceData({
593
583
  ctx: connection.ctx,
594
- data: event.data,
595
584
  id: event.id,
596
585
  input,
597
586
  registry: sources.registry,
@@ -609,7 +598,6 @@ function createFateServer({ context, lists, live, mutations, queries, roots, sou
609
598
  const source = nodeType ? sourcesByType.get(nodeType) : null;
610
599
  const node = event.type === "deleteEdge" || event.type === "invalidate" ? null : source ? await resolveLiveSourceData({
611
600
  ctx: connection.ctx,
612
- data: event.node,
613
601
  id: event.id,
614
602
  input: {
615
603
  args: operation.selectionArgs,
@@ -670,7 +658,6 @@ function createFateServer({ context, lists, live, mutations, queries, roots, sou
670
658
  };
671
659
  const data = event.type === "delete" ? null : await resolveLiveSourceData({
672
660
  ctx: connection.ctx,
673
- data: event.data,
674
661
  id: event.id,
675
662
  input,
676
663
  registry: sources.registry,
@@ -747,7 +734,6 @@ function createFateServer({ context, lists, live, mutations, queries, roots, sou
747
734
  const source = nodeType ? sourcesByType.get(nodeType) : null;
748
735
  const node = event.type === "deleteEdge" || event.type === "invalidate" ? null : source ? await resolveLiveSourceData({
749
736
  ctx: connection.ctx,
750
- data: event.node,
751
737
  id: event.id,
752
738
  input: {
753
739
  args: operation.selectionArgs,
@@ -0,0 +1,9 @@
1
+ //#region src/sortObjectKeys.ts
2
+ /** Recursively sorts plain-object keys, preserving array order and non-plain values. */
3
+ const sortObjectKeys = (value) => {
4
+ if (Array.isArray(value)) return value.map(sortObjectKeys);
5
+ if (value && typeof value === "object" && (Object.getPrototypeOf(value) === Object.prototype || Object.getPrototypeOf(value) === null)) return Object.fromEntries(Object.keys(value).sort().map((key) => [key, sortObjectKeys(value[key])]));
6
+ return value;
7
+ };
8
+ //#endregion
9
+ export { sortObjectKeys as t };
@@ -217,6 +217,14 @@ function withConnection(procedure) {
217
217
  };
218
218
  }
219
219
  //#endregion
220
+ //#region src/server/stableStringify.ts
221
+ /** Serializes values with sorted object keys, including undefined properties. */
222
+ const stableStringify = (value) => {
223
+ if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`;
224
+ if (value && typeof value === "object") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(",")}}`;
225
+ return JSON.stringify(value);
226
+ };
227
+ //#endregion
220
228
  //#region src/server/prismaSelect.ts
221
229
  const toPrismaOrderBy = (orderBy) => orderBy.map((entry) => ({ [entry.field]: entry.direction }));
222
230
  const mergeObject = (target, source) => {
@@ -229,11 +237,6 @@ const mergeObject = (target, source) => {
229
237
  target[key] = value;
230
238
  }
231
239
  };
232
- const stableStringify = (value) => {
233
- if (Array.isArray(value)) return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;
234
- if (value && typeof value === "object") return `{${Object.entries(value).sort(([left], [right]) => left.localeCompare(right)).map(([key, entry]) => `${JSON.stringify(key)}:${stableStringify(entry)}`).join(",")}}`;
235
- return JSON.stringify(value);
236
- };
237
240
  const getConflictingCountRelations = (node) => {
238
241
  const signaturesByRelation = /* @__PURE__ */ new Map();
239
242
  for (const computed of node.computeds.values()) {
@@ -973,4 +976,4 @@ function bindSourceProcedures(defaults) {
973
976
  });
974
977
  }
975
978
  //#endregion
976
- export { list as C, resolveConnection as D, connectionArgs as E, withConnection as O, isDataView as S, toPrismaSelect as T, computed as _, refetchSourceById as a, dataView as b, resolveSourceConnection as c, createSourceDefinitions as d, createSourcePlan as f, attachComputedState as g, hasNestedSelection as h, createSourceRegistry as i, getScopedArgs as k, collectDataViewConfigs as l, getNestedSelection as m, createSourceProcedures as n, resolveSourceById as o, getDataViewSourceConfig as p, byIdInput as r, resolveSourceByIds as s, bindSourceProcedures as t, createNestedSourcePlan as u, count as v, resolver as w, field as x, createResolver as y };
979
+ export { getScopedArgs as A, list as C, connectionArgs as D, stableStringify as E, resolveConnection as O, isDataView as S, toPrismaSelect as T, computed as _, refetchSourceById as a, dataView as b, resolveSourceConnection as c, createSourceDefinitions as d, createSourcePlan as f, attachComputedState as g, hasNestedSelection as h, createSourceRegistry as i, withConnection as k, collectDataViewConfigs as l, getNestedSelection as m, createSourceProcedures as n, resolveSourceById as o, getDataViewSourceConfig as p, byIdInput as r, resolveSourceByIds as s, bindSourceProcedures as t, createNestedSourcePlan as u, count as v, resolver as w, field as x, createResolver as y };