@prisma-next/framework-components 0.4.0-dev.1 → 0.4.0-dev.10

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,89 @@
1
+ import type { ColumnDefault, ExecutionMutationDefaultValue } from '@prisma-next/contract/types';
2
+
3
+ interface SourcePosition {
4
+ readonly offset: number;
5
+ readonly line: number;
6
+ readonly column: number;
7
+ }
8
+
9
+ export interface SourceSpan {
10
+ readonly start: SourcePosition;
11
+ readonly end: SourcePosition;
12
+ }
13
+
14
+ export interface SourceDiagnostic {
15
+ readonly code: string;
16
+ readonly message: string;
17
+ readonly sourceId?: string;
18
+ readonly span?: SourceSpan;
19
+ readonly data?: Readonly<Record<string, unknown>>;
20
+ }
21
+
22
+ interface DefaultFunctionArgument {
23
+ readonly raw: string;
24
+ readonly span: SourceSpan;
25
+ }
26
+
27
+ export interface ParsedDefaultFunctionCall {
28
+ readonly name: string;
29
+ readonly raw: string;
30
+ readonly args: readonly DefaultFunctionArgument[];
31
+ readonly span: SourceSpan;
32
+ }
33
+
34
+ export interface DefaultFunctionLoweringContext {
35
+ readonly sourceId: string;
36
+ readonly modelName: string;
37
+ readonly fieldName: string;
38
+ readonly columnCodecId?: string;
39
+ }
40
+
41
+ export type LoweredDefaultValue =
42
+ | { readonly kind: 'storage'; readonly defaultValue: ColumnDefault }
43
+ | { readonly kind: 'execution'; readonly generated: ExecutionMutationDefaultValue };
44
+
45
+ export type LoweredDefaultResult =
46
+ | { readonly ok: true; readonly value: LoweredDefaultValue }
47
+ | { readonly ok: false; readonly diagnostic: SourceDiagnostic };
48
+
49
+ export type DefaultFunctionLoweringHandler = (input: {
50
+ readonly call: ParsedDefaultFunctionCall;
51
+ readonly context: DefaultFunctionLoweringContext;
52
+ }) => LoweredDefaultResult;
53
+
54
+ export interface DefaultFunctionRegistryEntry {
55
+ readonly lower: DefaultFunctionLoweringHandler;
56
+ readonly usageSignatures?: readonly string[];
57
+ }
58
+
59
+ export type DefaultFunctionRegistry = ReadonlyMap<string, DefaultFunctionRegistryEntry>;
60
+
61
+ export interface MutationDefaultGeneratorDescriptor {
62
+ readonly id: string;
63
+ readonly applicableCodecIds: readonly string[];
64
+ readonly resolveGeneratedColumnDescriptor?: (input: {
65
+ readonly generated: ExecutionMutationDefaultValue;
66
+ }) =>
67
+ | {
68
+ readonly codecId: string;
69
+ readonly nativeType: string;
70
+ readonly typeRef?: string;
71
+ readonly typeParams?: Record<string, unknown>;
72
+ }
73
+ | undefined;
74
+ }
75
+
76
+ export interface ControlMutationDefaultEntry {
77
+ readonly lower: (input: {
78
+ readonly call: ParsedDefaultFunctionCall;
79
+ readonly context: DefaultFunctionLoweringContext;
80
+ }) => LoweredDefaultResult;
81
+ readonly usageSignatures?: readonly string[];
82
+ }
83
+
84
+ export type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>;
85
+
86
+ export interface ControlMutationDefaults {
87
+ readonly defaultFunctionRegistry: ControlMutationDefaultRegistry;
88
+ readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
89
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"framework-components-DoWmh6GH.d.mts","names":[],"sources":["../src/framework-components.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAOA;AAY0B,UAZT,iBAAA,CAYS;EASF;EASmB,SAAA,OAAA,EAAA,MAAA;EAAd;;;;;;;;EA6BgB,SAAA,YAAA,CAAA,EA/CnB,MA+CmB,CAAA,MAAA,EAAA,OAAA,CAAA;EAsB5B;EAQA,SAAA,KAAA,CAAA,EAAA;IAWA,SAAA,UAAA,CAAA,EAAA;MAMD;AA+DhB;AAgCA;;MAMqB,SAAA,MAAA,CAAA,EA1LG,eA0LH;MALX;;AAYV;;;;;;MASY,SAAa,WAAA,CAAA,EAjMI,aAiMwD,CAjM1C,eAiM+B,CAAA;MAE9D;;;;MAIkB,SAAA,iBAAA,CAAA,EAlMK,MAkML,CAAA,MAAA,EAAA,OA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