@prisma/param-graph 7.7.0-integration-feat-prisma-bootstrap.7 → 7.7.0-integration-feat-bootstrap-ux-fixes.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Deserializes a binary-encoded ParamGraph.
3
+ */
4
+ export declare function deserializeParamGraph(serialized: SerializedParamGraph): ParamGraphData;
5
+
6
+ /**
7
+ * Bit flags for InputEdge.flags describing what the field accepts.
8
+ */
9
+ export declare const EdgeFlag: {
10
+ /**
11
+ * Field may be parameterized as a scalar value.
12
+ * Check ScalarMask to validate the value type.
13
+ */
14
+ readonly ParamScalar: 1;
15
+ /**
16
+ * Field may be parameterized as an enum.
17
+ * Check enum ID to validate the value type.
18
+ */
19
+ readonly ParamEnum: 2;
20
+ /**
21
+ * Field accepts list-of-scalar values.
22
+ * Parameterize the whole list if all elements match ScalarMask.
23
+ */
24
+ readonly ParamListScalar: 4;
25
+ /**
26
+ * Field accepts list-of-enum values.
27
+ * Parameterize the whole list if all elements match enum ID.
28
+ */
29
+ readonly ParamListEnum: 8;
30
+ /**
31
+ * Field accepts list-of-object values.
32
+ * Recurse into each element using the child node.
33
+ */
34
+ readonly ListObject: 16;
35
+ /**
36
+ * Field accepts object values.
37
+ * Recurse into child input node.
38
+ */
39
+ readonly Object: 32;
40
+ };
41
+
42
+ export declare type EdgeFlagValue = (typeof EdgeFlag)[keyof typeof EdgeFlag];
43
+
44
+ /**
45
+ * Function type for looking up enum values by name.
46
+ * This allows ParamGraph to remain decoupled from RuntimeDataModel.
47
+ */
48
+ export declare type EnumLookup = (enumName: string) => Readonly<EnumNameToValueMap> | undefined;
49
+
50
+ /**
51
+ * Map of enum names to their respective values.
52
+ */
53
+ declare type EnumNameToValueMap = Record<string, string>;
54
+
55
+ /**
56
+ * Helper function to get the scalar mask from an edge.
57
+ */
58
+ export declare function getScalarMask(edge: InputEdge): number;
59
+
60
+ /**
61
+ * Helper function to check if an edge has a specific flag.
62
+ */
63
+ export declare function hasFlag(edge: InputEdge, flag: number): boolean;
64
+
65
+ /**
66
+ * Readable view of input edge.
67
+ */
68
+ export declare interface InputEdge {
69
+ readonly flags: number;
70
+ readonly childNodeId: number | undefined;
71
+ readonly scalarMask: number;
72
+ readonly enumNameIndex: number | undefined;
73
+ }
74
+
75
+ /**
76
+ * Input edge data: describes what a field accepts.
77
+ */
78
+ export declare interface InputEdgeData {
79
+ /** Bit flags describing field capabilities (see EdgeFlag) */
80
+ flags: number;
81
+ /** Child input node id (for object values) */
82
+ childNodeId?: number;
83
+ /** Scalar type mask (see ScalarMask) */
84
+ scalarMask?: number;
85
+ /** Enum name index into string table */
86
+ enumNameIndex?: number;
87
+ }
88
+
89
+ /**
90
+ * Readable view of input node.
91
+ */
92
+ export declare interface InputNode {
93
+ readonly id: number;
94
+ }
95
+
96
+ /**
97
+ * Input node data: describes parameterizable fields in an input object.
98
+ */
99
+ export declare interface InputNodeData {
100
+ /** Map from string-table index to edge descriptor */
101
+ edges: Record<number, InputEdgeData>;
102
+ }
103
+
104
+ /**
105
+ * Readable view of output edge.
106
+ */
107
+ export declare interface OutputEdge {
108
+ readonly argsNodeId: number | undefined;
109
+ readonly outputNodeId: number | undefined;
110
+ }
111
+
112
+ /**
113
+ * Output edge data: describes a field in a selection set.
114
+ */
115
+ export declare interface OutputEdgeData {
116
+ /** Args node id for this field */
117
+ argsNodeId?: number;
118
+ /** Next output node id for nested selection */
119
+ outputNodeId?: number;
120
+ }
121
+
122
+ /**
123
+ * Readable view of output node.
124
+ */
125
+ export declare interface OutputNode {
126
+ readonly id: number;
127
+ }
128
+
129
+ /**
130
+ * Output node data: describes fields in a selection set.
131
+ */
132
+ export declare interface OutputNodeData {
133
+ /** Map from string-table index to edge descriptor */
134
+ edges: Record<number, OutputEdgeData>;
135
+ }
136
+
137
+ /**
138
+ * ParamGraph provides runtime access to the schema information
139
+ * needed for parameterization decisions.
140
+ */
141
+ export declare class ParamGraph {
142
+ #private;
143
+ private constructor();
144
+ /**
145
+ * Creates a ParamGraph from serialized format.
146
+ * This is the primary factory method for runtime use.
147
+ */
148
+ static deserialize(serialized: SerializedParamGraph, enumLookup: EnumLookup): ParamGraph;
149
+ /**
150
+ * Creates a ParamGraph from builder data.
151
+ * Used by the builder for testing and direct construction.
152
+ */
153
+ static fromData(data: ParamGraphData, enumLookup: EnumLookup): ParamGraph;
154
+ /**
155
+ * Look up a root entry by "Model.action" or "action".
156
+ */
157
+ root(key: string): RootEntry | undefined;
158
+ /**
159
+ * Get an input node by ID.
160
+ */
161
+ inputNode(id: number | undefined): InputNode | undefined;
162
+ /**
163
+ * Get an output node by ID.
164
+ */
165
+ outputNode(id: number | undefined): OutputNode | undefined;
166
+ /**
167
+ * Get an input edge for a field name within a node.
168
+ */
169
+ inputEdge(node: InputNode | undefined, fieldName: string): InputEdge | undefined;
170
+ /**
171
+ * Get an output edge for a field name within a node.
172
+ */
173
+ outputEdge(node: OutputNode | undefined, fieldName: string): OutputEdge | undefined;
174
+ /**
175
+ * Get enum values for an edge that references a user enum.
176
+ * Returns undefined if the edge doesn't reference an enum.
177
+ */
178
+ enumValues(edge: InputEdge | undefined): Readonly<EnumNameToValueMap> | undefined;
179
+ /**
180
+ * Get a string from the string table by index.
181
+ */
182
+ getString(index: number): string | undefined;
183
+ }
184
+
185
+ /**
186
+ * Internal data types for ParamGraph.
187
+ *
188
+ * These types represent the in-memory structure of the param graph,
189
+ * used both during building and after deserialization.
190
+ */
191
+ /**
192
+ * Complete param graph data structure.
193
+ * This is the internal representation, not the serialized format.
194
+ */
195
+ export declare interface ParamGraphData {
196
+ /** String table containing field names and enum names */
197
+ strings: string[];
198
+ /** Input nodes for argument objects and input types */
199
+ inputNodes: InputNodeData[];
200
+ /** Output nodes for selection traversal */
201
+ outputNodes: OutputNodeData[];
202
+ /** Root mapping: "Model.action" -> entry */
203
+ roots: Record<string, RootEntryData>;
204
+ }
205
+
206
+ /**
207
+ * Readable view of root entry.
208
+ */
209
+ export declare interface RootEntry {
210
+ readonly argsNodeId: number | undefined;
211
+ readonly outputNodeId: number | undefined;
212
+ }
213
+
214
+ /**
215
+ * Root entry data: entry point for an operation.
216
+ */
217
+ export declare interface RootEntryData {
218
+ /** Args node id */
219
+ argsNodeId?: number;
220
+ /** Output node id */
221
+ outputNodeId?: number;
222
+ }
223
+
224
+ /**
225
+ * Bit mask for scalar type categories.
226
+ * Used in InputEdge.scalarMask to validate runtime value types.
227
+ */
228
+ export declare const ScalarMask: {
229
+ readonly String: 1;
230
+ readonly Int: 2;
231
+ readonly BigInt: 4;
232
+ readonly Float: 8;
233
+ readonly Decimal: 16;
234
+ readonly Boolean: 32;
235
+ readonly DateTime: 64;
236
+ readonly Json: 128;
237
+ readonly Bytes: 256;
238
+ };
239
+
240
+ export declare type ScalarMaskValue = (typeof ScalarMask)[keyof typeof ScalarMask];
241
+
242
+ /**
243
+ * Maps DMMF scalar type names to ScalarMask values.
244
+ */
245
+ export declare function scalarTypeToMask(typeName: string): number;
246
+
247
+ /**
248
+ * Serialized format stored in the generated client.
249
+ */
250
+ export declare interface SerializedParamGraph {
251
+ /** String table (field names, enum names, root keys) */
252
+ strings: string[];
253
+ /** Base64url-encoded binary blob for structural data */
254
+ graph: string;
255
+ }
256
+
257
+ /**
258
+ * Serializes a ParamGraphData to the compact binary format.
259
+ */
260
+ export declare function serializeParamGraph(data: ParamGraphData): SerializedParamGraph;
261
+
262
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,7 +1,262 @@
1
- export type { EnumLookup, InputEdge, InputNode, OutputEdge, OutputNode, RootEntry } from './param-graph';
2
- export type { InputEdgeData, InputNodeData, OutputEdgeData, OutputNodeData, ParamGraphData, RootEntryData, } from './param-graph';
3
- export type { EdgeFlagValue, ScalarMaskValue } from './param-graph';
4
- export { ParamGraph } from './param-graph';
5
- export { EdgeFlag, getScalarMask, hasFlag, ScalarMask, scalarTypeToMask } from './param-graph';
6
- export type { SerializedParamGraph } from './serialization';
7
- export { deserializeParamGraph, serializeParamGraph } from './serialization';
1
+ /**
2
+ * Deserializes a binary-encoded ParamGraph.
3
+ */
4
+ export declare function deserializeParamGraph(serialized: SerializedParamGraph): ParamGraphData;
5
+
6
+ /**
7
+ * Bit flags for InputEdge.flags describing what the field accepts.
8
+ */
9
+ export declare const EdgeFlag: {
10
+ /**
11
+ * Field may be parameterized as a scalar value.
12
+ * Check ScalarMask to validate the value type.
13
+ */
14
+ readonly ParamScalar: 1;
15
+ /**
16
+ * Field may be parameterized as an enum.
17
+ * Check enum ID to validate the value type.
18
+ */
19
+ readonly ParamEnum: 2;
20
+ /**
21
+ * Field accepts list-of-scalar values.
22
+ * Parameterize the whole list if all elements match ScalarMask.
23
+ */
24
+ readonly ParamListScalar: 4;
25
+ /**
26
+ * Field accepts list-of-enum values.
27
+ * Parameterize the whole list if all elements match enum ID.
28
+ */
29
+ readonly ParamListEnum: 8;
30
+ /**
31
+ * Field accepts list-of-object values.
32
+ * Recurse into each element using the child node.
33
+ */
34
+ readonly ListObject: 16;
35
+ /**
36
+ * Field accepts object values.
37
+ * Recurse into child input node.
38
+ */
39
+ readonly Object: 32;
40
+ };
41
+
42
+ export declare type EdgeFlagValue = (typeof EdgeFlag)[keyof typeof EdgeFlag];
43
+
44
+ /**
45
+ * Function type for looking up enum values by name.
46
+ * This allows ParamGraph to remain decoupled from RuntimeDataModel.
47
+ */
48
+ export declare type EnumLookup = (enumName: string) => Readonly<EnumNameToValueMap> | undefined;
49
+
50
+ /**
51
+ * Map of enum names to their respective values.
52
+ */
53
+ declare type EnumNameToValueMap = Record<string, string>;
54
+
55
+ /**
56
+ * Helper function to get the scalar mask from an edge.
57
+ */
58
+ export declare function getScalarMask(edge: InputEdge): number;
59
+
60
+ /**
61
+ * Helper function to check if an edge has a specific flag.
62
+ */
63
+ export declare function hasFlag(edge: InputEdge, flag: number): boolean;
64
+
65
+ /**
66
+ * Readable view of input edge.
67
+ */
68
+ export declare interface InputEdge {
69
+ readonly flags: number;
70
+ readonly childNodeId: number | undefined;
71
+ readonly scalarMask: number;
72
+ readonly enumNameIndex: number | undefined;
73
+ }
74
+
75
+ /**
76
+ * Input edge data: describes what a field accepts.
77
+ */
78
+ export declare interface InputEdgeData {
79
+ /** Bit flags describing field capabilities (see EdgeFlag) */
80
+ flags: number;
81
+ /** Child input node id (for object values) */
82
+ childNodeId?: number;
83
+ /** Scalar type mask (see ScalarMask) */
84
+ scalarMask?: number;
85
+ /** Enum name index into string table */
86
+ enumNameIndex?: number;
87
+ }
88
+
89
+ /**
90
+ * Readable view of input node.
91
+ */
92
+ export declare interface InputNode {
93
+ readonly id: number;
94
+ }
95
+
96
+ /**
97
+ * Input node data: describes parameterizable fields in an input object.
98
+ */
99
+ export declare interface InputNodeData {
100
+ /** Map from string-table index to edge descriptor */
101
+ edges: Record<number, InputEdgeData>;
102
+ }
103
+
104
+ /**
105
+ * Readable view of output edge.
106
+ */
107
+ export declare interface OutputEdge {
108
+ readonly argsNodeId: number | undefined;
109
+ readonly outputNodeId: number | undefined;
110
+ }
111
+
112
+ /**
113
+ * Output edge data: describes a field in a selection set.
114
+ */
115
+ export declare interface OutputEdgeData {
116
+ /** Args node id for this field */
117
+ argsNodeId?: number;
118
+ /** Next output node id for nested selection */
119
+ outputNodeId?: number;
120
+ }
121
+
122
+ /**
123
+ * Readable view of output node.
124
+ */
125
+ export declare interface OutputNode {
126
+ readonly id: number;
127
+ }
128
+
129
+ /**
130
+ * Output node data: describes fields in a selection set.
131
+ */
132
+ export declare interface OutputNodeData {
133
+ /** Map from string-table index to edge descriptor */
134
+ edges: Record<number, OutputEdgeData>;
135
+ }
136
+
137
+ /**
138
+ * ParamGraph provides runtime access to the schema information
139
+ * needed for parameterization decisions.
140
+ */
141
+ export declare class ParamGraph {
142
+ #private;
143
+ private constructor();
144
+ /**
145
+ * Creates a ParamGraph from serialized format.
146
+ * This is the primary factory method for runtime use.
147
+ */
148
+ static deserialize(serialized: SerializedParamGraph, enumLookup: EnumLookup): ParamGraph;
149
+ /**
150
+ * Creates a ParamGraph from builder data.
151
+ * Used by the builder for testing and direct construction.
152
+ */
153
+ static fromData(data: ParamGraphData, enumLookup: EnumLookup): ParamGraph;
154
+ /**
155
+ * Look up a root entry by "Model.action" or "action".
156
+ */
157
+ root(key: string): RootEntry | undefined;
158
+ /**
159
+ * Get an input node by ID.
160
+ */
161
+ inputNode(id: number | undefined): InputNode | undefined;
162
+ /**
163
+ * Get an output node by ID.
164
+ */
165
+ outputNode(id: number | undefined): OutputNode | undefined;
166
+ /**
167
+ * Get an input edge for a field name within a node.
168
+ */
169
+ inputEdge(node: InputNode | undefined, fieldName: string): InputEdge | undefined;
170
+ /**
171
+ * Get an output edge for a field name within a node.
172
+ */
173
+ outputEdge(node: OutputNode | undefined, fieldName: string): OutputEdge | undefined;
174
+ /**
175
+ * Get enum values for an edge that references a user enum.
176
+ * Returns undefined if the edge doesn't reference an enum.
177
+ */
178
+ enumValues(edge: InputEdge | undefined): Readonly<EnumNameToValueMap> | undefined;
179
+ /**
180
+ * Get a string from the string table by index.
181
+ */
182
+ getString(index: number): string | undefined;
183
+ }
184
+
185
+ /**
186
+ * Internal data types for ParamGraph.
187
+ *
188
+ * These types represent the in-memory structure of the param graph,
189
+ * used both during building and after deserialization.
190
+ */
191
+ /**
192
+ * Complete param graph data structure.
193
+ * This is the internal representation, not the serialized format.
194
+ */
195
+ export declare interface ParamGraphData {
196
+ /** String table containing field names and enum names */
197
+ strings: string[];
198
+ /** Input nodes for argument objects and input types */
199
+ inputNodes: InputNodeData[];
200
+ /** Output nodes for selection traversal */
201
+ outputNodes: OutputNodeData[];
202
+ /** Root mapping: "Model.action" -> entry */
203
+ roots: Record<string, RootEntryData>;
204
+ }
205
+
206
+ /**
207
+ * Readable view of root entry.
208
+ */
209
+ export declare interface RootEntry {
210
+ readonly argsNodeId: number | undefined;
211
+ readonly outputNodeId: number | undefined;
212
+ }
213
+
214
+ /**
215
+ * Root entry data: entry point for an operation.
216
+ */
217
+ export declare interface RootEntryData {
218
+ /** Args node id */
219
+ argsNodeId?: number;
220
+ /** Output node id */
221
+ outputNodeId?: number;
222
+ }
223
+
224
+ /**
225
+ * Bit mask for scalar type categories.
226
+ * Used in InputEdge.scalarMask to validate runtime value types.
227
+ */
228
+ export declare const ScalarMask: {
229
+ readonly String: 1;
230
+ readonly Int: 2;
231
+ readonly BigInt: 4;
232
+ readonly Float: 8;
233
+ readonly Decimal: 16;
234
+ readonly Boolean: 32;
235
+ readonly DateTime: 64;
236
+ readonly Json: 128;
237
+ readonly Bytes: 256;
238
+ };
239
+
240
+ export declare type ScalarMaskValue = (typeof ScalarMask)[keyof typeof ScalarMask];
241
+
242
+ /**
243
+ * Maps DMMF scalar type names to ScalarMask values.
244
+ */
245
+ export declare function scalarTypeToMask(typeName: string): number;
246
+
247
+ /**
248
+ * Serialized format stored in the generated client.
249
+ */
250
+ export declare interface SerializedParamGraph {
251
+ /** String table (field names, enum names, root keys) */
252
+ strings: string[];
253
+ /** Base64url-encoded binary blob for structural data */
254
+ graph: string;
255
+ }
256
+
257
+ /**
258
+ * Serializes a ParamGraphData to the compact binary format.
259
+ */
260
+ export declare function serializeParamGraph(data: ParamGraphData): SerializedParamGraph;
261
+
262
+ export { }