@prisma/orm-framework 8.0.0-rc.19 → 8.0.0-rc.19-dev.3

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 (120) hide show
  1. package/dist/{authoring-BxyfEUyh.mjs → authoring-BMkyimEq.mjs} +3 -3
  2. package/dist/authoring-BMkyimEq.mjs.map +1 -0
  3. package/dist/{authoring-DWhPMprN.d.mts → authoring-CUZxY2RV.d.mts} +4 -4
  4. package/dist/{authoring-DWhPMprN.d.mts.map → authoring-CUZxY2RV.d.mts.map} +1 -1
  5. package/dist/{binder-63ozT0D8-D7n-9Uv4.d.mts → binder-D_4RBHbt-HJoM87MJ.d.mts} +16 -15
  6. package/dist/binder-D_4RBHbt-HJoM87MJ.d.mts.map +1 -0
  7. package/dist/{codec-DkiEF2cQ.d.mts → codec-B_KV-HpC.d.mts} +2 -3
  8. package/dist/codec-B_KV-HpC.d.mts.map +1 -0
  9. package/dist/{codec-types-DjozIOvT-BIcpyFea.d.mts → codec-types-CPgEZoIq-BL9hisr8.d.mts} +3 -3
  10. package/dist/{codec-types-DjozIOvT-BIcpyFea.d.mts.map → codec-types-CPgEZoIq-BL9hisr8.d.mts.map} +1 -1
  11. package/dist/{components-B3SnaxMU.d.mts → components-CJ5VhJT8.d.mts} +5 -4
  12. package/dist/components-CJ5VhJT8.d.mts.map +1 -0
  13. package/dist/components.d.mts +16 -17
  14. package/dist/components.mjs +4 -4
  15. package/dist/components__authoring.d.mts +4 -4
  16. package/dist/components__authoring.mjs +3 -3
  17. package/dist/components__codec.d.mts +2 -2
  18. package/dist/components__components.d.mts +4 -4
  19. package/dist/components__control.d.mts +4 -4
  20. package/dist/components__control.mjs +3 -3
  21. package/dist/components__emission.d.mts +3 -3
  22. package/dist/components__execution.d.mts +1 -1
  23. package/dist/components__psl-ast.d.mts +3 -3
  24. package/dist/components__runtime.d.mts +1 -1
  25. package/dist/{config-types-Bs7GpaPJ.d.mts → config-types-B7pDUyu2.d.mts} +7 -9
  26. package/dist/config-types-B7pDUyu2.d.mts.map +1 -0
  27. package/dist/config.d.mts +1 -1
  28. package/dist/config__config-types.d.mts +1 -1
  29. package/dist/contract-authoring.d.mts +4 -4
  30. package/dist/contract-authoring.mjs +4 -4
  31. package/dist/contract-authoring.mjs.map +1 -1
  32. package/dist/{control-B5ezUWD2-DTWXJUHt.d.mts → control-B5ezUWD2-CWp9npSb.d.mts} +2 -2
  33. package/dist/{control-B5ezUWD2-DTWXJUHt.d.mts.map → control-B5ezUWD2-CWp9npSb.d.mts.map} +1 -1
  34. package/dist/{control-DnNh47Wd.d.mts → control-BC7a9D7N.d.mts} +219 -186
  35. package/dist/control-BC7a9D7N.d.mts.map +1 -0
  36. package/dist/control-BLmwnbM0.d.mts +1 -0
  37. package/dist/{control-xg2R0dXx.mjs → control-Bq9kKKJS.mjs} +57 -8
  38. package/dist/control-Bq9kKKJS.mjs.map +1 -0
  39. package/dist/{control-KsXr4fYD-DLPY47Il.mjs → control-KsXr4fYD-O9tIteNn.mjs} +2 -2
  40. package/dist/{control-KsXr4fYD-DLPY47Il.mjs.map → control-KsXr4fYD-O9tIteNn.mjs.map} +1 -1
  41. package/dist/{declarations-BgUAq1RG-CEN8W7dJ.mjs → declarations-BgUAq1RG-BOxzxoTR.mjs} +2 -2
  42. package/dist/{declarations-BgUAq1RG-CEN8W7dJ.mjs.map → declarations-BgUAq1RG-BOxzxoTR.mjs.map} +1 -1
  43. package/dist/emission-BtJvV97M.d.mts +2 -0
  44. package/dist/{emission-types-sz0-pyyS-D3-ssRUu.d.mts → emission-types-B-jKEbjI-D7BW8Gk1.d.mts} +4 -4
  45. package/dist/{emission-types-sz0-pyyS-D3-ssRUu.d.mts.map → emission-types-B-jKEbjI-D7BW8Gk1.d.mts.map} +1 -1
  46. package/dist/errors.d.mts +5 -5
  47. package/dist/errors.mjs +4 -4
  48. package/dist/errors__control.d.mts +2 -2
  49. package/dist/errors__control.mjs +1 -1
  50. package/dist/errors__execution.d.mts +2 -2
  51. package/dist/errors__execution.mjs +2 -2
  52. package/dist/errors__migration.d.mts +1 -1
  53. package/dist/errors__migration.mjs +1 -1
  54. package/dist/{execution-CktUHYP0.d.mts → execution-0Irooze3.d.mts} +2 -2
  55. package/dist/{execution-CktUHYP0.d.mts.map → execution-0Irooze3.d.mts.map} +1 -1
  56. package/dist/{execution-yrBEIzBV.d.mts → execution-CL5odLfv.d.mts} +3 -13
  57. package/dist/execution-CL5odLfv.d.mts.map +1 -0
  58. package/dist/{execution-BbpdDFYd.mjs → execution-D5ISN2Rt.mjs} +3 -25
  59. package/dist/{execution-BbpdDFYd.mjs.map → execution-D5ISN2Rt.mjs.map} +1 -1
  60. package/dist/{expressions-CMQzbnHk-D2oE4DzM.mjs → expressions-CMQzbnHk-CrNw_vqf.mjs} +2 -2
  61. package/dist/{expressions-CMQzbnHk-D2oE4DzM.mjs.map → expressions-CMQzbnHk-CrNw_vqf.mjs.map} +1 -1
  62. package/dist/{framework-authoring-Du7xSUmg-D85Toszi.d.mts → framework-authoring-C78etPdT-CeiBIBJ-.d.mts} +227 -10
  63. package/dist/framework-authoring-C78etPdT-CeiBIBJ-.d.mts.map +1 -0
  64. package/dist/{framework-components-DQFte83L-CIIcH8Bj.d.mts → framework-components-BmRQfvNS-KSEiBXXc.d.mts} +6 -103
  65. package/dist/framework-components-BmRQfvNS-KSEiBXXc.d.mts.map +1 -0
  66. package/dist/ids.d.mts +1 -1
  67. package/dist/{migration-DH3rxAoO.d.mts → migration-Db3N-7JB.d.mts} +2 -2
  68. package/dist/{migration-DH3rxAoO.d.mts.map → migration-Db3N-7JB.d.mts.map} +1 -1
  69. package/dist/{migration-BHhDtq__.mjs → migration-DkzPlgX1.mjs} +2 -2
  70. package/dist/{migration-BHhDtq__.mjs.map → migration-DkzPlgX1.mjs.map} +1 -1
  71. package/dist/{parse-bZgfjovA-D0MdY-kP.mjs → parse-bZgfjovA-sINnImkq.mjs} +3 -3
  72. package/dist/{parse-bZgfjovA-D0MdY-kP.mjs.map → parse-bZgfjovA-sINnImkq.mjs.map} +1 -1
  73. package/dist/{parse-djL5wker-BQzi1u4O.d.mts → parse-djL5wker-D6uXzzA7.d.mts} +6 -6
  74. package/dist/{parse-djL5wker-BQzi1u4O.d.mts.map → parse-djL5wker-D6uXzzA7.d.mts.map} +1 -1
  75. package/dist/{psl-ast-B6X_rlhZ-DCrq7Zie.d.mts → psl-ast-54cA0pl_-DrzGrcMF.d.mts} +3 -4
  76. package/dist/psl-ast-54cA0pl_-DrzGrcMF.d.mts.map +1 -0
  77. package/dist/psl-ast-BubQebay.d.mts +2 -0
  78. package/dist/psl-parser.d.mts +111 -16
  79. package/dist/psl-parser.d.mts.map +1 -1
  80. package/dist/psl-parser.mjs +278 -32
  81. package/dist/psl-parser.mjs.map +1 -1
  82. package/dist/psl-parser__format.d.mts +1 -1
  83. package/dist/psl-parser__format.mjs +3 -3
  84. package/dist/psl-parser__interpret.d.mts +6 -6
  85. package/dist/psl-parser__interpret.mjs +2 -24
  86. package/dist/psl-parser__interpret.mjs.map +1 -1
  87. package/dist/psl-parser__syntax.d.mts +1 -1
  88. package/dist/psl-parser__syntax.mjs +3 -3
  89. package/dist/psl-printer.d.mts +4 -4
  90. package/dist/psl-printer.mjs +1 -1
  91. package/dist/{runtime-BXPhK_oW.d.mts → runtime-8WddX9H_.d.mts} +2 -2
  92. package/dist/{runtime-BXPhK_oW.d.mts.map → runtime-8WddX9H_.d.mts.map} +1 -1
  93. package/dist/{temporal-presets-DF8wiIwk-CZI3cLQZ.mjs → temporal-presets-CIFczljn-BrjropV6.mjs} +123 -27
  94. package/dist/temporal-presets-CIFczljn-BrjropV6.mjs.map +1 -0
  95. package/dist/{temporal-presets-9VgC1-FN-MoyINRBU.d.mts → temporal-presets-suGfXweJ-Cv2uijGj.d.mts} +36 -6
  96. package/dist/temporal-presets-suGfXweJ-Cv2uijGj.d.mts.map +1 -0
  97. package/dist/{read-expression-as-Dhyvx51C-BbNqJHAR.mjs → type-constructor-calls-BLf-HsFy-Z9ApP-kL.mjs} +28 -6
  98. package/dist/type-constructor-calls-BLf-HsFy-Z9ApP-kL.mjs.map +1 -0
  99. package/dist/{types-import-spec-hkPsnreE-C-fa8812.d.mts → types-import-spec-DQjfX-gM-zVncuzs0.d.mts} +3 -3
  100. package/dist/{types-import-spec-hkPsnreE-C-fa8812.d.mts.map → types-import-spec-DQjfX-gM-zVncuzs0.d.mts.map} +1 -1
  101. package/package.json +15 -15
  102. package/dist/authoring-BxyfEUyh.mjs.map +0 -1
  103. package/dist/binder-63ozT0D8-D7n-9Uv4.d.mts.map +0 -1
  104. package/dist/codec-DkiEF2cQ.d.mts.map +0 -1
  105. package/dist/components-B3SnaxMU.d.mts.map +0 -1
  106. package/dist/config-types-Bs7GpaPJ.d.mts.map +0 -1
  107. package/dist/control-Dhq4un61.d.mts +0 -1
  108. package/dist/control-DnNh47Wd.d.mts.map +0 -1
  109. package/dist/control-xg2R0dXx.mjs.map +0 -1
  110. package/dist/emission-XBYOUuHN.d.mts +0 -2
  111. package/dist/execution-yrBEIzBV.d.mts.map +0 -1
  112. package/dist/framework-authoring-Du7xSUmg-D85Toszi.d.mts.map +0 -1
  113. package/dist/framework-components-DQFte83L-CIIcH8Bj.d.mts.map +0 -1
  114. package/dist/mutation-default-types-js6llINX-WGmpaAAL.d.mts +0 -66
  115. package/dist/mutation-default-types-js6llINX-WGmpaAAL.d.mts.map +0 -1
  116. package/dist/psl-ast-B6X_rlhZ-DCrq7Zie.d.mts.map +0 -1
  117. package/dist/psl-ast-DlmFfwfZ.d.mts +0 -2
  118. package/dist/read-expression-as-Dhyvx51C-BbNqJHAR.mjs.map +0 -1
  119. package/dist/temporal-presets-9VgC1-FN-MoyINRBU.d.mts.map +0 -1
  120. package/dist/temporal-presets-DF8wiIwk-CZI3cLQZ.mjs.map +0 -1
@@ -1,9 +1,166 @@
1
- import { B as JsonValue, N as ExecutionMutationDefaultPhases, a as ColumnDefault } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
- import { T as DataTypeValue, b as DataTypeParams, p as CodecLookupWithDescriptors, v as DataTypeId, y as DataTypeLookup } from "./codec-types-DjozIOvT-BIcpyFea.mjs";
1
+ import { B as JsonValue, N as ExecutionMutationDefaultPhases, P as ExecutionMutationDefaultValue, a as ColumnDefault } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
+ import { T as DataTypeValue, b as DataTypeParams, p as CodecLookupWithDescriptors, v as DataTypeId, y as DataTypeLookup } from "./codec-types-CPgEZoIq-BL9hisr8.mjs";
3
3
  import { r as Result } from "./result-BYCOANWy.mjs";
4
4
  import { Type } from "arktype";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
- //#region ../../../1-framework/1-core/framework-components/dist/framework-authoring-Du7xSUmg.d.mts
6
+ //#region ../../../1-framework/1-core/framework-components/dist/framework-authoring-C78etPdT.d.mts
7
+ //#region src/shared/mutation-default-types.d.ts
8
+ interface SourcePosition {
9
+ readonly offset: number;
10
+ readonly line: number;
11
+ readonly column: number;
12
+ }
13
+ interface SourceSpan {
14
+ readonly start: SourcePosition;
15
+ readonly end: SourcePosition;
16
+ }
17
+ interface SourceDiagnostic {
18
+ readonly code: string;
19
+ readonly message: string;
20
+ readonly sourceId: string;
21
+ readonly span?: SourceSpan;
22
+ readonly data?: Readonly<Record<string, unknown>>;
23
+ }
24
+ interface DefaultFunctionLoweringContext {
25
+ readonly sourceId: string;
26
+ readonly modelName: string;
27
+ readonly fieldName: string;
28
+ readonly columnCodecId?: string;
29
+ }
30
+ /** What a default function lowers to: always a database default. A value the client generates is a generator function, which `@onCreate(fn())` and `@onUpdate(fn())` call. */
31
+ type LoweredDefaultValue = {
32
+ readonly kind: 'storage';
33
+ readonly defaultValue: ColumnDefault;
34
+ };
35
+ type LoweredDefaultResult = {
36
+ readonly ok: true;
37
+ readonly value: LoweredDefaultValue;
38
+ } | {
39
+ readonly ok: false;
40
+ readonly diagnostic: SourceDiagnostic;
41
+ };
42
+ interface MutationDefaultGeneratorDescriptor {
43
+ readonly id: string;
44
+ }
45
+ interface TypedDefaultFunctionCall {
46
+ readonly fn: string;
47
+ readonly span: SourceSpan;
48
+ readonly args: Readonly<Record<string, unknown>>;
49
+ }
50
+ interface ControlMutationDefaultEntry {
51
+ readonly signature?: unknown;
52
+ readonly lower: (input: {
53
+ readonly call: TypedDefaultFunctionCall;
54
+ readonly context: DefaultFunctionLoweringContext;
55
+ }) => LoweredDefaultResult;
56
+ readonly usageSignatures?: readonly string[];
57
+ }
58
+ type ControlMutationDefaultRegistry = ReadonlyMap<string, ControlMutationDefaultEntry>;
59
+ interface ControlMutationDefaults {
60
+ readonly defaultFunctionRegistry: ControlMutationDefaultRegistry;
61
+ readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
62
+ }
63
+ /** The mutation defaults of a composed stack. */
64
+ interface AssembledControlMutationDefaults extends ControlMutationDefaults {
65
+ /** For each registered generator id, the id of the component that registers it, or `undefined` when that component has no id. */
66
+ readonly componentIdsByGenerator: ReadonlyMap<string, string | undefined>;
67
+ }
68
+ //#endregion
69
+ //#region src/shared/generator-functions.d.ts
70
+ /** The phase a client generator runs in: when a row is created, or every time it is updated. */
71
+ type GeneratorPhase = 'onCreate' | 'onUpdate';
72
+ /** The codec and type params of the field a generator fills: a column in SQL, a document field in Mongo. */
73
+ interface GeneratorFunctionField {
74
+ readonly codecId: string;
75
+ readonly typeParams: Readonly<Record<string, unknown>> | undefined;
76
+ /** The column's length, in its data type's normal form, so a bare `Char` holds 1. `undefined` for a column with no length, or one whose database does not limit it; a binding then checks no length. */
77
+ readonly length: number | undefined;
78
+ }
79
+ /** A call of a generator function: what `@onCreate(fn(...))` and `gen.fn(...)` write, and what `contract print` writes back. */
80
+ interface GeneratorFunctionCall {
81
+ readonly name: string;
82
+ readonly args: Readonly<Record<string, unknown>>;
83
+ }
84
+ /** What one binding resolves a call to on a field: a generator, or a refusal with its reason. */
85
+ type BindingResolution = {
86
+ readonly ok: true;
87
+ readonly generator: ExecutionMutationDefaultValue;
88
+ } | {
89
+ readonly ok: false;
90
+ readonly message: string;
91
+ };
92
+ /** The arguments of a call, as values and as PSL text. */
93
+ interface PrintedArguments {
94
+ readonly args: Readonly<Record<string, unknown>>;
95
+ readonly text: string;
96
+ }
97
+ interface GeneratorFunctionBinding {
98
+ readonly codecIds: readonly string[];
99
+ /** Every generator id `resolve` can produce. */
100
+ readonly generatorIds: readonly string[];
101
+ readonly resolve: (input: {
102
+ readonly args: Readonly<Record<string, unknown>>;
103
+ readonly field: GeneratorFunctionField;
104
+ }) => BindingResolution;
105
+ /** The arguments that produce `generator` on `field`, or `undefined` when this binding never produces it. */
106
+ readonly printArguments: (generator: ExecutionMutationDefaultValue, field: GeneratorFunctionField) => PrintedArguments | undefined;
107
+ }
108
+ interface GeneratorFunctionContribution {
109
+ readonly name: string;
110
+ /** A `FuncCallSig`, typed `unknown` as `ControlMutationDefaultEntry.signature` is. Exactly one contribution per name sets it. */
111
+ readonly signature?: unknown;
112
+ readonly bindings: readonly GeneratorFunctionBinding[];
113
+ }
114
+ interface GeneratorFunctionSummary {
115
+ readonly name: string;
116
+ readonly signature: unknown;
117
+ }
118
+ type GeneratorFunctionResolution = {
119
+ readonly ok: true;
120
+ readonly generator: ExecutionMutationDefaultValue;
121
+ } | {
122
+ readonly ok: false;
123
+ readonly reason: 'refused';
124
+ readonly message: string;
125
+ } | {
126
+ readonly ok: false;
127
+ readonly reason: 'unknown-function' | 'not-bound';
128
+ readonly boundCodecIds: readonly string[];
129
+ };
130
+ /** The call that produces a stored generator, and its PSL text, such as `uuid(7)`. */
131
+ interface PrintedGeneratorCall {
132
+ readonly call: GeneratorFunctionCall;
133
+ readonly text: string;
134
+ }
135
+ interface GeneratorFunctionRegistry {
136
+ functionsFor(codecId: string): readonly GeneratorFunctionSummary[];
137
+ has(name: string): boolean;
138
+ resolve(call: GeneratorFunctionCall, field: GeneratorFunctionField): GeneratorFunctionResolution;
139
+ callFor(generator: ExecutionMutationDefaultValue, field: GeneratorFunctionField): PrintedGeneratorCall | undefined;
140
+ }
141
+ /** A component that contributes generator functions, generator descriptors, or both. */
142
+ interface GeneratorFunctionComponent {
143
+ readonly id?: string;
144
+ readonly generatorFunctions?: readonly GeneratorFunctionContribution[];
145
+ readonly controlMutationDefaults?: {
146
+ readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
147
+ };
148
+ }
149
+ /**
150
+ * Assemble the generator functions of a composed stack: the control stack's components, or the pack refs of a TypeScript contract. Every generator a binding produces must be registered by a generator descriptor of one of the components.
151
+ */
152
+ declare function assembleGeneratorFunctions(descriptors: ReadonlyArray<GeneratorFunctionComponent>): GeneratorFunctionRegistry;
153
+ /**
154
+ * A binding of a function that takes no arguments to one generator, with params read from the field's type params when `paramsFromField` gives any.
155
+ */
156
+ declare function singleGeneratorBinding(input: {
157
+ readonly codecIds: readonly string[];
158
+ readonly generatorId: string;
159
+ readonly paramsFromField?: (field: GeneratorFunctionField) => Readonly<Record<string, unknown>> | undefined;
160
+ }): GeneratorFunctionBinding;
161
+ /** The generator functions of a stack that contributes none. */
162
+ declare const EMPTY_GENERATOR_FUNCTIONS: GeneratorFunctionRegistry;
163
+ //#endregion
7
164
  //#region src/shared/option-descriptor.d.ts
8
165
  interface AuthoringOption {
9
166
  readonly kind: 'option';
@@ -408,9 +565,25 @@ interface AuthoringFieldPresetDescriptor {
408
565
  readonly args?: readonly AuthoringArgumentDescriptor[];
409
566
  readonly output: AuthoringFieldPresetOutput;
410
567
  }
568
+ /**
569
+ * A type alias a pack contributes: a type with fixed params, and the generators every field typed by it takes. It takes no arguments, and is written bare, such as `temporal.CreatedAt`.
570
+ */
571
+ interface AuthoringTypeAliasDescriptor {
572
+ readonly kind: 'typeAlias';
573
+ readonly documentation?: string;
574
+ readonly output: {
575
+ /** Assembly refuses params the codec's parameter schema refuses. */
576
+ readonly type: AuthoringStorageTypeTemplate;
577
+ /** Resolved by the field's codec, as `@onCreate(fn())` is. Assembly refuses a call that does not resolve. */
578
+ readonly onCreate?: GeneratorFunctionCall;
579
+ readonly onUpdate?: GeneratorFunctionCall;
580
+ };
581
+ }
411
582
  type AuthoringTypeNamespace = {
412
- readonly [name: string]: AuthoringTypeConstructorDescriptor | AuthoringTypeNamespace;
583
+ readonly [name: string]: AuthoringTypeConstructorDescriptor | AuthoringTypeAliasDescriptor | AuthoringTypeNamespace;
413
584
  };
585
+ /** The descriptor kinds a `type` namespace holds as leaves. */
586
+ declare const AUTHORING_TYPE_DESCRIPTOR_KINDS: readonly ["typeConstructor", "typeAlias"];
414
587
  type AuthoringFieldNamespace = {
415
588
  readonly [name: string]: AuthoringFieldPresetDescriptor | AuthoringFieldNamespace;
416
589
  };
@@ -793,7 +966,10 @@ interface AuthoringContributions {
793
966
  }
794
967
  declare function isAuthoringArgRef(value: unknown): value is AuthoringArgRef;
795
968
  declare function isAuthoringSelectRef(value: unknown): value is AuthoringSelectRef;
796
- declare function isAuthoringTypeConstructorDescriptor(value: AuthoringTypeConstructorDescriptor | AuthoringTypeNamespace): value is AuthoringTypeConstructorDescriptor;
969
+ declare function isAuthoringTypeConstructorDescriptor(value: AuthoringTypeConstructorDescriptor | AuthoringTypeAliasDescriptor | AuthoringTypeNamespace): value is AuthoringTypeConstructorDescriptor;
970
+ declare function isAuthoringTypeAliasDescriptor(value: AuthoringTypeConstructorDescriptor | AuthoringTypeAliasDescriptor | AuthoringTypeNamespace): value is AuthoringTypeAliasDescriptor;
971
+ /** Whether `value` is a leaf of a `type` namespace: a type constructor or a type alias. */
972
+ declare function isAuthoringTypeDescriptor(value: AuthoringTypeConstructorDescriptor | AuthoringTypeAliasDescriptor | AuthoringTypeNamespace): value is AuthoringTypeConstructorDescriptor | AuthoringTypeAliasDescriptor;
797
973
  /** The type constructor at `path` in the contributions' type namespace, or `undefined` when none is there. */
798
974
  declare function getAuthoringTypeConstructor(contributions: {
799
975
  readonly type?: AuthoringTypeNamespace;
@@ -802,10 +978,25 @@ declare function isAuthoringFieldPresetDescriptor(value: AuthoringFieldPresetDes
802
978
  declare function isAuthoringEntityTypeDescriptor(value: AuthoringEntityTypeDescriptor | AuthoringEntityTypeNamespace): value is AuthoringEntityTypeDescriptor;
803
979
  declare function isAuthoringPslBlockDescriptor(value: AuthoringPslBlockDescriptor | AuthoringPslBlockDescriptorNamespace): value is AuthoringPslBlockDescriptor;
804
980
  declare function isAuthoringModelAttributeDescriptor(value: AuthoringModelAttributeDescriptor | AuthoringModelAttributeDescriptorNamespace): value is AuthoringModelAttributeDescriptor;
981
+ /**
982
+ * Deep structural check run only at the composition boundary (the merge and
983
+ * collect walkers) to classify a raw namespace-tree node as a leaf descriptor.
984
+ * A node counts as a leaf iff its `kind` matches `descriptorKind` AND it
985
+ * carries that kind's required fields.
986
+ *
987
+ * This is boundary validation over `unknown`, NOT a type-predicate: the four
988
+ * exported `isAuthoring*Descriptor` predicates deliberately narrow on `kind`
989
+ * alone and trust the static types. The walkers, by contrast, also receive
990
+ * type-bypassing packs (`as unknown as never` in tests, untyped JS at runtime)
991
+ * whose descriptor-shaped-but-incomplete nodes must be rejected rather than
992
+ * silently treated as sub-namespaces — so the well-formedness check lives here.
993
+ */
994
+ /** The `kind` of the leaves of one namespace, or several kinds when the namespace holds more than one, as `type` does. */
995
+ type AuthoringDescriptorKinds = string | readonly string[];
805
996
  /**
806
997
  * Merges `source` into `target` recursively at the descriptor-namespace
807
- * level. `descriptorKind` is the `kind` value ('typeConstructor',
808
- * 'fieldPreset', 'entity', or 'pslBlock') that identifies a descriptor
998
+ * level. `descriptorKind` is the `kind` value, or values, ('typeConstructor'
999
+ * and 'typeAlias', 'fieldPreset', 'entity', or 'pslBlock') that identifies a descriptor
809
1000
  * (terminal merge point; same-path registrations across components are
810
1001
  * reported as duplicates) as opposed to a sub-namespace (recursion target).
811
1002
  *
@@ -821,7 +1012,7 @@ declare function isAuthoringModelAttributeDescriptor(value: AuthoringModelAttrib
821
1012
  * cross-registry detection runs separately via
822
1013
  * `assertNoCrossRegistryCollisions` after merging completes.
823
1014
  */
824
- declare function mergeAuthoringNamespaces(target: Record<string, unknown>, source: Record<string, unknown>, path: readonly string[], descriptorKind: string, label: string): void;
1015
+ declare function mergeAuthoringNamespaces(target: Record<string, unknown>, source: Record<string, unknown>, path: readonly string[], descriptorKind: AuthoringDescriptorKinds, label: string): void;
825
1016
  interface ScalarTypeConstructorOutput {
826
1017
  readonly codecId: string;
827
1018
  readonly typeParams?: Record<string, unknown>;
@@ -864,6 +1055,32 @@ interface AuthoringTypeParamsIssue {
864
1055
  */
865
1056
  declare function validateAuthoringTypeParams(helperPath: string, template: AuthoringStorageTypeTemplate, typeParams: Record<string, unknown> | undefined, paramsSchema: StandardSchemaV1<unknown> | undefined): void;
866
1057
  declare function instantiateAuthoringTypeConstructor(descriptor: AuthoringTypeConstructorDescriptor, args: readonly unknown[]): ScalarTypeConstructorOutput;
1058
+ /** What a field typed by a contributed type alias takes: the type, and the alias's generator calls. */
1059
+ interface AuthoringTypeAliasOutput {
1060
+ readonly type: ScalarTypeConstructorOutput;
1061
+ readonly onCreate?: GeneratorFunctionCall;
1062
+ readonly onUpdate?: GeneratorFunctionCall;
1063
+ }
1064
+ declare function instantiateAuthoringTypeAlias(descriptor: AuthoringTypeAliasDescriptor): AuthoringTypeAliasOutput;
1065
+ /**
1066
+ * The generators the calls of the type alias at `path` resolve to for its column, or `undefined` when it calls none. A call that does not resolve is the pack's mistake, so it throws `CONTRACT.PACK_CONTRIBUTION_INVALID`. `length` is the column's length, in its data type's normal form, when the caller's family knows it.
1067
+ */
1068
+ declare function resolveTypeAliasGenerators(input: {
1069
+ readonly path: string;
1070
+ readonly descriptor: AuthoringTypeAliasDescriptor;
1071
+ readonly generatorFunctions: GeneratorFunctionRegistry;
1072
+ readonly length: number | undefined;
1073
+ }): ExecutionMutationDefaultPhases | undefined;
1074
+ /** What assembly checks a contributed type alias against: the stack's generator functions, each codec's parameter schema, and the length the family gives a field of a type. */
1075
+ interface TypeAliasAssemblyLookups {
1076
+ readonly generatorFunctions: GeneratorFunctionRegistry;
1077
+ readonly paramsSchemaOf: (codecId: string) => StandardSchemaV1<unknown> | undefined;
1078
+ readonly fieldLength: (field: Omit<GeneratorFunctionField, 'length'>) => number | undefined;
1079
+ }
1080
+ /**
1081
+ * Refuses a type alias of `namespace` whose fixed type params its codec's parameter schema refuses, or whose generator call does not resolve for its codec and length. The control stack and the TypeScript builders call it on their assembled namespace, so PSL and TypeScript refuse the same packs, before any schema is read.
1082
+ */
1083
+ declare function assertTypeAliasesValid(namespace: AuthoringTypeNamespace, lookups: TypeAliasAssemblyLookups): void;
867
1084
  /**
868
1085
  * The column a type constructor makes from the stored values of its arguments, as a reader that holds values rather than written arguments has them, or why its codec's parameter schema refuses the parameters they give. The schema check is {@link validateAuthoringTypeParams}'s.
869
1086
  */
@@ -878,5 +1095,5 @@ declare function instantiateAuthoringFieldPreset(descriptor: AuthoringFieldPrese
878
1095
  readonly unique: boolean;
879
1096
  };
880
1097
  //#endregion
881
- export { WrittenScalar as $, AuthoringTypeParamsIssue as A, readWrittenValue as At, PslDiagnosticCode as B, AuthoringPslBlockDescriptorNamespace as C, isAuthoringFieldPresetDescriptor as Ct, AuthoringTypeConstructorDescriptor as D, isAuthoringTypeConstructorDescriptor as Dt, AuthoringTemplateValue as E, isAuthoringSelectRef as Et, ContributedPslDiagnosticCode as F, validateAuthoringHelperArguments as Ft, PslExtensionBlockPrintEntry as G, PslExtensionBlockAttribute as H, DataTypeAuthoringEntry as I, validateAuthoringTypeParams as It, ReadRefusal as J, PslPosition as K, DataTypeSupport as L, AuthoringWarning as M, resolveAuthoringTemplateValue as Mt, AuthoringWarningSink as N, resolveEnumCodecId as Nt, AuthoringTypeConstructorEntityRef as O, knownTags as Ot, CastRefusal as P, tagForm as Pt, WrittenForm as Q, DataTypeWrittenForm as R, AuthoringPslBlockDescriptor as S, isAuthoringEntityTypeDescriptor as St, AuthoringStorageTypeTemplate as T, isAuthoringPslBlockDescriptor as Tt, PslExtensionBlockAttributeArg as U, PslExtensionBlock as V, PslExtensionBlockParsedAttribute as W, RefusalGuidance as X, RefusalDescription as Y, ScalarTypeConstructorOutput as Z, AuthoringModelAttributeDescriptorNamespace as _, instantiateAuthoringEntityType as _t, AuthoringContributions as a, castTypedValue as at, AuthoringModelAttributeLoweringOutput as b, instantiateAuthoringTypeConstructorFromValues as bt, AuthoringEntityTypeDescriptor as c, describeAdmittedForms as ct, AuthoringEntityTypeTemplateOutput as d, describeRefusedValueType as dt, WrittenValue as et, AuthoringFieldNamespace as f, entryForPlain as ft, AuthoringModelAttributeDescriptor as g, getAuthoringTypeConstructor as gt, AuthoringModelAttributeContext as h, flushAuthoringWarnings as ht, AuthoringColumnDefaultTemplate as i, assertResolvableTypeConstructorTemplates as it, AuthoringValueArgument as j, readWrittenValueAs as jt, AuthoringTypeNamespace as k, mergeAuthoringNamespaces as kt, AuthoringEntityTypeFactoryOutput as l, describeExpected as lt, AuthoringFieldPresetOutput as m, exactRewrite as mt, AuthoringArgumentDescriptor as n, admittedTags as nt, AuthoringDiagnosticSink as o, classifyEnumMemberType as ot, AuthoringFieldPresetDescriptor as p, entryForTag as pt, PslSpan as q, AuthoringAttributeSpecContributions as r, assertNoCrossRegistryCollisions as rt, AuthoringEntityContext as s, collectScalarTypeConstructors as st, AuthoringArgRef as t, admittedForms as tt, AuthoringEntityTypeNamespace as u, describeRefusal as ut, AuthoringModelAttributeEntityOutput as v, instantiateAuthoringFieldPreset as vt, AuthoringSelectRef as w, isAuthoringModelAttributeDescriptor as wt, AuthoringOption as x, isAuthoringArgRef as xt, AuthoringModelAttributeIndexOutput as y, instantiateAuthoringTypeConstructor as yt, ParsedPslExtensionBlock as z };
882
- //# sourceMappingURL=framework-authoring-Du7xSUmg-D85Toszi.d.mts.map
1098
+ export { GeneratorFunctionContribution as $, isAuthoringEntityTypeDescriptor as $t, AuthoringTypeAliasDescriptor as A, admittedTags as At, CastRefusal as B, describeRefusal as Bt, AuthoringModelAttributeLoweringOutput as C, SourceDiagnostic as Ct, AuthoringSelectRef as D, WrittenScalar as Dt, AuthoringPslBlockDescriptorNamespace as E, WrittenForm as Et, AuthoringTypeParamsIssue as F, castTypedValue as Ft, DataTypeAuthoringEntry as G, flushAuthoringWarnings as Gt, ControlMutationDefaultEntry as H, entryForPlain as Ht, AuthoringValueArgument as I, classifyEnumMemberType as It, DefaultFunctionLoweringContext as J, instantiateAuthoringFieldPreset as Jt, DataTypeSupport as K, getAuthoringTypeConstructor as Kt, AuthoringWarning as L, collectScalarTypeConstructors as Lt, AuthoringTypeConstructorDescriptor as M, assertNoCrossRegistryCollisions as Mt, AuthoringTypeConstructorEntityRef as N, assertResolvableTypeConstructorTemplates as Nt, AuthoringStorageTypeTemplate as O, WrittenValue as Ot, AuthoringTypeNamespace as P, assertTypeAliasesValid as Pt, GeneratorFunctionComponent as Q, isAuthoringArgRef as Qt, AuthoringWarningSink as R, describeAdmittedForms as Rt, AuthoringModelAttributeIndexOutput as S, ScalarTypeConstructorOutput as St, AuthoringPslBlockDescriptor as T, TypedDefaultFunctionCall as Tt, ControlMutationDefaultRegistry as U, entryForTag as Ut, ContributedPslDiagnosticCode as V, describeRefusedValueType as Vt, ControlMutationDefaults as W, exactRewrite as Wt, GeneratorFunctionBinding as X, instantiateAuthoringTypeConstructor as Xt, EMPTY_GENERATOR_FUNCTIONS as Y, instantiateAuthoringTypeAlias as Yt, GeneratorFunctionCall as Z, instantiateAuthoringTypeConstructorFromValues as Zt, AuthoringFieldPresetOutput as _, validateAuthoringTypeParams as _n, PslPosition as _t, AuthoringAttributeSpecContributions as a, isAuthoringTypeConstructorDescriptor as an, LoweredDefaultResult as at, AuthoringModelAttributeDescriptorNamespace as b, RefusalDescription as bt, AuthoringDescriptorKinds as c, mergeAuthoringNamespaces as cn, ParsedPslExtensionBlock as ct, AuthoringEntityTypeDescriptor as d, resolveAuthoringTemplateValue as dn, PslDiagnosticCode as dt, isAuthoringFieldPresetDescriptor as en, GeneratorFunctionField as et, AuthoringEntityTypeFactoryOutput as f, resolveEnumCodecId as fn, PslExtensionBlock as ft, AuthoringFieldPresetDescriptor as g, validateAuthoringHelperArguments as gn, PslExtensionBlockPrintEntry as gt, AuthoringFieldNamespace as h, tagForm as hn, PslExtensionBlockParsedAttribute as ht, AuthoringArgumentDescriptor as i, isAuthoringTypeAliasDescriptor as in, GeneratorPhase as it, AuthoringTypeAliasOutput as j, assembleGeneratorFunctions as jt, AuthoringTemplateValue as k, admittedForms as kt, AuthoringDiagnosticSink as l, readWrittenValue as ln, PrintedArguments as lt, AuthoringEntityTypeTemplateOutput as m, singleGeneratorBinding as mn, PslExtensionBlockAttributeArg as mt, AssembledControlMutationDefaults as n, isAuthoringPslBlockDescriptor as nn, GeneratorFunctionResolution as nt, AuthoringColumnDefaultTemplate as o, isAuthoringTypeDescriptor as on, LoweredDefaultValue as ot, AuthoringEntityTypeNamespace as p, resolveTypeAliasGenerators as pn, PslExtensionBlockAttribute as pt, DataTypeWrittenForm as q, instantiateAuthoringEntityType as qt, AuthoringArgRef as r, isAuthoringSelectRef as rn, GeneratorFunctionSummary as rt, AuthoringContributions as s, knownTags as sn, MutationDefaultGeneratorDescriptor as st, AUTHORING_TYPE_DESCRIPTOR_KINDS as t, isAuthoringModelAttributeDescriptor as tn, GeneratorFunctionRegistry as tt, AuthoringEntityContext as u, readWrittenValueAs as un, PrintedGeneratorCall as ut, AuthoringModelAttributeContext as v, PslSpan as vt, AuthoringOption as w, SourceSpan as wt, AuthoringModelAttributeEntityOutput as x, RefusalGuidance as xt, AuthoringModelAttributeDescriptor as y, ReadRefusal as yt, BindingResolution as z, describeExpected as zt };
1099
+ //# sourceMappingURL=framework-authoring-C78etPdT-CeiBIBJ-.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-authoring-C78etPdT-CeiBIBJ-.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/framework-authoring-C78etPdT.d.mts"],"mappings":";;;;;;;UAMU;WACC;WACA;WACA;;UAED;WACC,OAAO;WACP,KAAK;;UAE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,iBAAiB,oBAAoB;WACrC,cAAc,OAAO,KAAK;;;;;iBAKpB,uBAAuB,WAAW,wBAAwB,SAAS;;;;iBAInE,8CAA8C,YAAY,oCAAoC,4BAA4B,cAAc,wCAAwC,OAAO,6BAA6B;iBACpN,+BAA+B,mBAAmB,oBAAoB,YAAY,+BAA+B,0BAA0B,KAAK,yBAAyB;iBACzK,gCAAgC,YAAY,gCAAgC;WAClF,YAAY;WACZ;WACA,UAAU;WACV,oBAAoB;WACpB;WACA"}
@@ -1,104 +1,7 @@
1
- import { P as ExecutionMutationDefaultValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
- import { _ as DataType, t as AnyCodecDescriptor } from "./codec-types-DjozIOvT-BIcpyFea.mjs";
3
- import { a as AuthoringContributions } from "./framework-authoring-Du7xSUmg-D85Toszi.mjs";
4
- import { c as MutationDefaultGeneratorDescriptor, i as ControlMutationDefaults } from "./mutation-default-types-js6llINX-WGmpaAAL.mjs";
5
- import { l as TypesImportSpec, t as AggregateDescriptor } from "./types-import-spec-hkPsnreE-C-fa8812.mjs";
6
- //#region ../../../1-framework/1-core/framework-components/dist/framework-components-DQFte83L.d.mts
7
- //#region src/shared/generator-functions.d.ts
8
- /** The phase a client generator runs in: when a row is created, or every time it is updated. */
9
- type GeneratorPhase = 'onCreate' | 'onUpdate';
10
- /** The codec and type params of the field a generator fills: a column in SQL, a document field in Mongo. */
11
- interface GeneratorFunctionField {
12
- readonly codecId: string;
13
- readonly typeParams: Readonly<Record<string, unknown>> | undefined;
14
- /** The column's length, in its data type's normal form, so a bare `Char` holds 1. `undefined` for a column with no length, or one whose database does not limit it; a binding then checks no length. */
15
- readonly length: number | undefined;
16
- }
17
- /** A call of a generator function: what `@onCreate(fn(...))` and `gen.fn(...)` write, and what `contract print` writes back. */
18
- interface GeneratorFunctionCall {
19
- readonly name: string;
20
- readonly args: Readonly<Record<string, unknown>>;
21
- }
22
- /** What one binding resolves a call to on a field: a generator, or a refusal with its reason. */
23
- type BindingResolution = {
24
- readonly ok: true;
25
- readonly generator: ExecutionMutationDefaultValue;
26
- } | {
27
- readonly ok: false;
28
- readonly message: string;
29
- };
30
- /** The arguments of a call, as values and as PSL text. */
31
- interface PrintedArguments {
32
- readonly args: Readonly<Record<string, unknown>>;
33
- readonly text: string;
34
- }
35
- interface GeneratorFunctionBinding {
36
- readonly codecIds: readonly string[];
37
- /** Every generator id `resolve` can produce. */
38
- readonly generatorIds: readonly string[];
39
- readonly resolve: (input: {
40
- readonly args: Readonly<Record<string, unknown>>;
41
- readonly field: GeneratorFunctionField;
42
- }) => BindingResolution;
43
- /** The arguments that produce `generator` on `field`, or `undefined` when this binding never produces it. */
44
- readonly printArguments: (generator: ExecutionMutationDefaultValue, field: GeneratorFunctionField) => PrintedArguments | undefined;
45
- }
46
- interface GeneratorFunctionContribution {
47
- readonly name: string;
48
- /** A `FuncCallSig`, typed `unknown` as `ControlMutationDefaultEntry.signature` is. Exactly one contribution per name sets it. */
49
- readonly signature?: unknown;
50
- readonly bindings: readonly GeneratorFunctionBinding[];
51
- }
52
- interface GeneratorFunctionSummary {
53
- readonly name: string;
54
- readonly signature: unknown;
55
- }
56
- type GeneratorFunctionResolution = {
57
- readonly ok: true;
58
- readonly generator: ExecutionMutationDefaultValue;
59
- } | {
60
- readonly ok: false;
61
- readonly reason: 'refused';
62
- readonly message: string;
63
- } | {
64
- readonly ok: false;
65
- readonly reason: 'unknown-function' | 'not-bound';
66
- readonly boundCodecIds: readonly string[];
67
- };
68
- /** The call that produces a stored generator, and its PSL text, such as `uuid(7)`. */
69
- interface PrintedGeneratorCall {
70
- readonly call: GeneratorFunctionCall;
71
- readonly text: string;
72
- }
73
- interface GeneratorFunctionRegistry {
74
- functionsFor(codecId: string): readonly GeneratorFunctionSummary[];
75
- has(name: string): boolean;
76
- resolve(call: GeneratorFunctionCall, field: GeneratorFunctionField): GeneratorFunctionResolution;
77
- callFor(generator: ExecutionMutationDefaultValue, field: GeneratorFunctionField): PrintedGeneratorCall | undefined;
78
- }
79
- /** A component that contributes generator functions, generator descriptors, or both. */
80
- interface GeneratorFunctionComponent {
81
- readonly id?: string;
82
- readonly generatorFunctions?: readonly GeneratorFunctionContribution[];
83
- readonly controlMutationDefaults?: {
84
- readonly generatorDescriptors: readonly MutationDefaultGeneratorDescriptor[];
85
- };
86
- }
87
- /**
88
- * Assemble the generator functions of a composed stack: the control stack's components, or the pack refs of a TypeScript contract. Every generator a binding produces must be registered by a generator descriptor of one of the components.
89
- */
90
- declare function assembleGeneratorFunctions(descriptors: ReadonlyArray<GeneratorFunctionComponent>): GeneratorFunctionRegistry;
91
- /**
92
- * A binding of a function that takes no arguments to one generator, with params read from the field's type params when `paramsFromField` gives any.
93
- */
94
- declare function singleGeneratorBinding(input: {
95
- readonly codecIds: readonly string[];
96
- readonly generatorId: string;
97
- readonly paramsFromField?: (field: GeneratorFunctionField) => Readonly<Record<string, unknown>> | undefined;
98
- }): GeneratorFunctionBinding;
99
- /** The generator functions of a stack that contributes none. */
100
- declare const EMPTY_GENERATOR_FUNCTIONS: GeneratorFunctionRegistry;
101
- //#endregion
1
+ import { _ as DataType, t as AnyCodecDescriptor } from "./codec-types-CPgEZoIq-BL9hisr8.mjs";
2
+ import { $ as GeneratorFunctionContribution, W as ControlMutationDefaults, s as AuthoringContributions } from "./framework-authoring-C78etPdT-CeiBIBJ-.mjs";
3
+ import { l as TypesImportSpec, t as AggregateDescriptor } from "./types-import-spec-DQjfX-gM-zVncuzs0.mjs";
4
+ //#region ../../../1-framework/1-core/framework-components/dist/framework-components-BmRQfvNS.d.mts
102
5
  //#region src/shared/framework-components.d.ts
103
6
  /**
104
7
  * Declarative fields that describe component metadata.
@@ -420,5 +323,5 @@ interface ExtensionInstance<TFamilyId extends string, TTargetId extends string>
420
323
  readonly targetId: TTargetId;
421
324
  }
422
325
  //#endregion
423
- export { PrintedGeneratorCall as A, GeneratorFunctionField as C, GeneratorPhase as D, GeneratorFunctionSummary as E, assembleGeneratorFunctions as F, checkContractComponentRequirements as I, singleGeneratorBinding as L, TargetDescriptor as M, TargetInstance as N, PackRefBase as O, TargetPackRef as P, GeneratorFunctionContribution as S, GeneratorFunctionResolution as T, FamilyInstance as _, ComponentDescriptor as a, GeneratorFunctionCall as b, ContractComponentRequirementsCheckResult as c, DriverPackRef as d, EMPTY_GENERATOR_FUNCTIONS as f, FamilyDescriptor as g, ExtensionPackRef as h, BindingResolution as i, TargetBoundComponentDescriptor as j, PrintedArguments as k, DriverDescriptor as l, ExtensionInstance as m, AdapterInstance as n, ComponentMetadata as o, ExtensionDescriptor as p, AdapterPackRef as r, ContractComponentRequirementsCheckInput as s, AdapterDescriptor as t, DriverInstance as u, FamilyPackRef as v, GeneratorFunctionRegistry as w, GeneratorFunctionComponent as x, GeneratorFunctionBinding as y };
424
- //# sourceMappingURL=framework-components-DQFte83L-CIIcH8Bj.d.mts.map
326
+ export { checkContractComponentRequirements as S, PackRefBase as _, ComponentMetadata as a, TargetInstance as b, DriverDescriptor as c, ExtensionDescriptor as d, ExtensionInstance as f, FamilyPackRef as g, FamilyInstance as h, ComponentDescriptor as i, DriverInstance as l, FamilyDescriptor as m, AdapterInstance as n, ContractComponentRequirementsCheckInput as o, ExtensionPackRef as p, AdapterPackRef as r, ContractComponentRequirementsCheckResult as s, AdapterDescriptor as t, DriverPackRef as u, TargetBoundComponentDescriptor as v, TargetPackRef as x, TargetDescriptor as y };
327
+ //# sourceMappingURL=framework-components-BmRQfvNS-KSEiBXXc.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"framework-components-BmRQfvNS-KSEiBXXc.d.mts","names":[],"sources":["../../../../1-framework/1-core/framework-components/dist/framework-components-BmRQfvNS.d.mts"],"mappings":";;;;;;;;UAOU;;WAEC;;;;;;WAMA,eAAe;;WAEf;aACE;;;;eAIE,SAAS;;;;;;;;eAQT,cAAc,cAAc;;;;eAI5B,2BAA2B;;;;eAI3B,oBAAoB;;;;eAIpB,mBAAmB,cAAc;;;;;aAKnC,uBAAuB,cAAc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B;WACxC,UAAU;WACV,UAAU;;UAEX,gBAAgB,0BAA0B;WACzC,UAAU;WACV,UAAU;;UAEX,eAAe,0BAA0B;WACxC,UAAU;WACV,UAAU;;UAEX,kBAAkB,0BAA0B;WAC3C,UAAU;WACV,UAAU"}
package/dist/ids.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { P as ExecutionMutationDefaultValue } from "./domain-envelope-CN721GnP-4huRt7Wc.mjs";
2
- import { s as ColumnTypeDescriptor } from "./codec-DkiEF2cQ.mjs";
2
+ import { s as ColumnTypeDescriptor } from "./codec-B_KV-HpC.mjs";
3
3
  import { cuid2 as cuid2$1 } from "uniku/cuid2";
4
4
  import { ksuid as ksuid$1 } from "uniku/ksuid";
5
5
  import { nanoid as nanoid$1 } from "uniku/nanoid";
@@ -1,4 +1,4 @@
1
- import { i as CliStructuredError } from "./control-B5ezUWD2-DTWXJUHt.mjs";
1
+ import { i as CliStructuredError } from "./control-B5ezUWD2-CWp9npSb.mjs";
2
2
  //#region ../../../1-framework/1-core/errors/dist/migration.d.mts
3
3
  //#region src/migration.d.ts
4
4
  /**
@@ -88,4 +88,4 @@ declare function errorMigrationOperationOptionRemoved(options: {
88
88
  }): CliStructuredError;
89
89
  //#endregion
90
90
  export { errorMigrationPlanNotArray as a, placeholder as c, errorMigrationOperationOptionRemoved as i, unfilledPlaceholderOperation as l, errorMigrationFileMissing as n, errorMigrationTargetMismatch as o, errorMigrationInvalidDefaultExport as r, errorUnfilledPlaceholder as s, errorDataTransformContractMismatch as t };
91
- //# sourceMappingURL=migration-DH3rxAoO.d.mts.map
91
+ //# sourceMappingURL=migration-Db3N-7JB.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-DH3rxAoO.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.d.mts"],"mappings":";;;;;;;;;;iBASiB,yBAAyB,eAAe;;;;;;;iBAOxC,6BAA6B,eAAe;;;;;;;;;;iBAU5C,YAAY;;;;;;;;;;;;;iBAaZ,mCAAmC;WACzC;WACA;WACA;IACP;;;;;;iBAMa,0BAA0B,cAAc;;;;;;;;;;iBAUxC,mCAAmC,aAAa,mCAAmC;;;;;;;;;iBASnF,6BAA6B;WACnC;WACA;IACP;;;;;iBAKa,2BAA2B,aAAa,kCAAkC;;;;iBAI1E,qCAAqC;WAC3C;WACA;WACA;WACA;WACA;IACP"}
1
+ {"version":3,"file":"migration-Db3N-7JB.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.d.mts"],"mappings":";;;;;;;;;;iBASiB,yBAAyB,eAAe;;;;;;;iBAOxC,6BAA6B,eAAe;;;;;;;;;;iBAU5C,YAAY;;;;;;;;;;;;;iBAaZ,mCAAmC;WACzC;WACA;WACA;IACP;;;;;;iBAMa,0BAA0B,cAAc;;;;;;;;;;iBAUxC,mCAAmC,aAAa,mCAAmC;;;;;;;;;iBASnF,6BAA6B;WACnC;WACA;IACP;;;;;iBAKa,2BAA2B,aAAa,kCAAkC;;;;iBAI1E,qCAAqC;WAC3C;WACA;WACA;WACA;WACA;IACP"}
@@ -1,4 +1,4 @@
1
- import { n as UPGRADE_GUIDES_URL, t as CliStructuredError } from "./control-KsXr4fYD-DLPY47Il.mjs";
1
+ import { n as UPGRADE_GUIDES_URL, t as CliStructuredError } from "./control-KsXr4fYD-O9tIteNn.mjs";
2
2
  //#region ../../../1-framework/1-core/errors/dist/migration.mjs
3
3
  /**
4
4
  * A scaffolded migration contains a placeholder slot that was never filled in.
@@ -150,4 +150,4 @@ function errorMigrationOperationOptionRemoved(options) {
150
150
  //#endregion
151
151
  export { errorMigrationPlanNotArray as a, placeholder as c, errorMigrationOperationOptionRemoved as i, unfilledPlaceholderOperation as l, errorMigrationFileMissing as n, errorMigrationTargetMismatch as o, errorMigrationInvalidDefaultExport as r, errorUnfilledPlaceholder as s, errorDataTransformContractMismatch as t };
152
152
 
153
- //# sourceMappingURL=migration-BHhDtq__.mjs.map
153
+ //# sourceMappingURL=migration-DkzPlgX1.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"migration-BHhDtq__.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError, w as UPGRADE_GUIDES_URL } from \"./control-KsXr4fYD.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* The operation of a planner-stubbed data transform: a promise that rejects with\n* `MIGRATION.UNFILLED_PLACEHOLDER`. A plan's other operations stay readable beside it. The\n* rejection is marked handled, and so is any promise a target wraps it in, so reading a plan's\n* operations without awaiting each one does not raise an unhandled rejection.\n*/\nfunction unfilledPlaceholderOperation(slot) {\n\tconst operation = Promise.reject(errorUnfilledPlaceholder(slot));\n\toperation.catch(() => void 0);\n\treturn operation;\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `{bin} migration new` or `{bin} migration plan`.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold an empty migration\",\n\t\t\tcommand: \"{bin} migration new\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold a migration from a contract diff\",\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n/**\n* A `migration.ts` passes an operation an option in the form an earlier version wrote, which this version no longer reads. `node migration.ts` strips types without checking them, so such a file runs; the operation refuses the option rather than leave out what it carries. `subject` names what the option was for, `rewrite` says how to write it now, and `upgradeEntry` is the id of the upgrade entry that shows the new form.\n*/\nfunction errorMigrationOperationOptionRemoved(options) {\n\tconst { operation, option, upgradeEntry } = options;\n\treturn new CliStructuredError(\"MIGRATION.OPERATION_OPTION_REMOVED\", `\\`${operation}\\` in migration.ts passes \\`${option}\\`, which this version no longer reads, for ${options.subject}`, {\n\t\twhy: \"An earlier version wrote this migration.ts. `node migration.ts` does not check its types, so the file runs, and this version would leave out what the option carries.\",\n\t\tfix: `${options.rewrite} Or, if the migration is not applied, delete its package and run \\`migration plan\\` again. The upgrade entry \\`${upgradeEntry}\\` shows the new shape: ${UPGRADE_GUIDES_URL}`,\n\t\tmeta: {\n\t\t\toperation,\n\t\t\toption,\n\t\t\tupgradeEntry\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationOperationOptionRemoved, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder, unfilledPlaceholderOperation };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE,KAAK;CACd,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,MAAM;CAC3C,MAAM,YAAY,QAAQ,OAAO,yBAAy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B,4BAA4B,uDAAuD;EAChH,KAAK,2BAA2B,KAAK,IAAI,6CAA6C,IAAI,QAAQ,uBAAuB,yCAAyC,6CAA6C,IAAI;EACnN,KAAK;EACL,MAAM;GACL;GACA,GAAG,2BAA2B,KAAK,IAAI,EAAE,aAAa,uBAAuB,IAAI,CAAC;EACnF;CACD,CAAC;AACF;;;;AAIA,SAAS,qCAAqC,SAAS;CACtD,MAAM,EAAE,WAAW,QAAQ,iBAAiB;CAC5C,OAAO,IAAI,mBAAmB,sCAAsC,KAAK,UAAU,8BAA8B,OAAO,8CAA8C,QAAQ,WAAW;EACxL,KAAK;EACL,KAAK,GAAG,QAAQ,QAAQ,iHAAiH,aAAa,0BAA0B;EAChL,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF"}
1
+ {"version":3,"file":"migration-DkzPlgX1.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError, w as UPGRADE_GUIDES_URL } from \"./control-KsXr4fYD.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* The operation of a planner-stubbed data transform: a promise that rejects with\n* `MIGRATION.UNFILLED_PLACEHOLDER`. A plan's other operations stay readable beside it. The\n* rejection is marked handled, and so is any promise a target wraps it in, so reading a plan's\n* operations without awaiting each one does not raise an unhandled rejection.\n*/\nfunction unfilledPlaceholderOperation(slot) {\n\tconst operation = Promise.reject(errorUnfilledPlaceholder(slot));\n\toperation.catch(() => void 0);\n\treturn operation;\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `{bin} migration new` or `{bin} migration plan`.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold an empty migration\",\n\t\t\tcommand: \"{bin} migration new\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold a migration from a contract diff\",\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n/**\n* A `migration.ts` passes an operation an option in the form an earlier version wrote, which this version no longer reads. `node migration.ts` strips types without checking them, so such a file runs; the operation refuses the option rather than leave out what it carries. `subject` names what the option was for, `rewrite` says how to write it now, and `upgradeEntry` is the id of the upgrade entry that shows the new form.\n*/\nfunction errorMigrationOperationOptionRemoved(options) {\n\tconst { operation, option, upgradeEntry } = options;\n\treturn new CliStructuredError(\"MIGRATION.OPERATION_OPTION_REMOVED\", `\\`${operation}\\` in migration.ts passes \\`${option}\\`, which this version no longer reads, for ${options.subject}`, {\n\t\twhy: \"An earlier version wrote this migration.ts. `node migration.ts` does not check its types, so the file runs, and this version would leave out what the option carries.\",\n\t\tfix: `${options.rewrite} Or, if the migration is not applied, delete its package and run \\`migration plan\\` again. The upgrade entry \\`${upgradeEntry}\\` shows the new shape: ${UPGRADE_GUIDES_URL}`,\n\t\tmeta: {\n\t\t\toperation,\n\t\t\toption,\n\t\t\tupgradeEntry\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationOperationOptionRemoved, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder, unfilledPlaceholderOperation };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE,KAAK;CACd,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,MAAM;CAC3C,MAAM,YAAY,QAAQ,OAAO,yBAAyB,IAAI,CAAC;CAC/D,UAAU,YAAY,KAAK,CAAC;CAC5B,OAAO;AACR;;;;;;;;;;AAUA,SAAS,YAAY,MAAM;CAC1B,MAAM,yBAAyB,IAAI;AACpC;;;;;;;;;;;;;AAaA,SAAS,mCAAmC,SAAS;CACpD,OAAO,IAAI,mBAAmB,8CAA8C,yDAAyD;EACpI,KAAK,mBAAmB,QAAQ,kBAAkB,8CAA8C,QAAQ,OAAO,6CAA6C,QAAQ,SAAS;EAC7K,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,UAAU,QAAQ;GAClB,QAAQ,QAAQ;EACjB;CACD,CAAC;AACF;;;;;;AAMA,SAAS,0BAA0B,KAAK;CACvC,OAAO,IAAI,mBAAmB,0BAA0B,0BAA0B;EACjF,KAAK,sCAAsC,IAAI;EAC/C,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,GAAG;GACF,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;EACD,MAAM,EAAE,IAAI;CACb,CAAC;AACF;;;;;;;;;;AAUA,SAAS,mCAAmC,KAAK,yBAAyB;CACzE,OAAO,IAAI,mBAAmB,oCAAoC,wDAAwD;EACzH,KAAK,4BAA4B,KAAK,IAAI,oBAAoB,IAAI,gHAAgH,4BAA4B,oBAAoB,IAAI;EACtO,KAAK;EACL,MAAM;GACL;GACA,GAAG,4BAA4B,KAAK,IAAI,EAAE,cAAc,wBAAwB,IAAI,CAAC;EACtF;CACD,CAAC;AACF;;;;;;;;;AASA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,6BAA6B,iDAAiD;EAC3G,KAAK,iCAAiC,QAAQ,kBAAkB,qDAAqD,QAAQ,eAAe;EAC5I,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,gBAAgB,QAAQ;EACzB;CACD,CAAC;AACF;;;;;AAKA,SAAS,2BAA2B,KAAK,wBAAwB;CAChE,OAAO,IAAI,mBAAmB,4BAA4B,uDAAuD;EAChH,KAAK,2BAA2B,KAAK,IAAI,6CAA6C,IAAI,QAAQ,uBAAuB,yCAAyC,6CAA6C,IAAI;EACnN,KAAK;EACL,MAAM;GACL;GACA,GAAG,2BAA2B,KAAK,IAAI,EAAE,aAAa,uBAAuB,IAAI,CAAC;EACnF;CACD,CAAC;AACF;;;;AAIA,SAAS,qCAAqC,SAAS;CACtD,MAAM,EAAE,WAAW,QAAQ,iBAAiB;CAC5C,OAAO,IAAI,mBAAmB,sCAAsC,KAAK,UAAU,8BAA8B,OAAO,8CAA8C,QAAQ,WAAW;EACxL,KAAK;EACL,KAAK,GAAG,QAAQ,QAAQ,iHAAiH,aAAa,0BAA0B;EAChL,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF"}
@@ -1,8 +1,8 @@
1
1
  import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
2
  import { r as UNSPECIFIED_PSL_NAMESPACE_ID } from "./psl-ast-CyvE6CR-.mjs";
3
3
  import { r as isTerminatedStringLiteral, t as Tokenizer } from "./tokenizer-C-GTKKjR-B1vOzJy0.mjs";
4
- import { v as createSyntaxTree } from "./expressions-CMQzbnHk-D2oE4DzM.mjs";
5
- import { r as DocumentAst } from "./declarations-BgUAq1RG-CEN8W7dJ.mjs";
4
+ import { v as createSyntaxTree } from "./expressions-CMQzbnHk-CrNw_vqf.mjs";
5
+ import { r as DocumentAst } from "./declarations-BgUAq1RG-BOxzxoTR.mjs";
6
6
  //#region ../../../1-framework/2-authoring/psl-parser/dist/parse-bZgfjovA.mjs
7
7
  const CARRIAGE_RETURN = 13;
8
8
  const LINE_FEED = 10;
@@ -874,4 +874,4 @@ function parseKeyValue(cursor, options = { memberAttributes: false }) {
874
874
  //#endregion
875
875
  export { greenToken as a, greenNode as i, PslSources as n, parse as o, SourceFile as r, GreenNodeBuilder as t };
876
876
 
877
- //# sourceMappingURL=parse-bZgfjovA-D0MdY-kP.mjs.map
877
+ //# sourceMappingURL=parse-bZgfjovA-sINnImkq.mjs.map