@prisma-next/family-sql 0.5.0-dev.9 → 0.5.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.
Files changed (76) hide show
  1. package/README.md +2 -3
  2. package/dist/{authoring-type-constructors-BAR65pSK.mjs → authoring-type-constructors-F4JpCJl7.mjs} +14 -15
  3. package/dist/authoring-type-constructors-F4JpCJl7.mjs.map +1 -0
  4. package/dist/control-adapter.d.mts +26 -2
  5. package/dist/control-adapter.d.mts.map +1 -1
  6. package/dist/control-adapter.mjs +1 -1
  7. package/dist/control.d.mts +125 -45
  8. package/dist/control.d.mts.map +1 -1
  9. package/dist/control.mjs +1174 -54
  10. package/dist/control.mjs.map +1 -1
  11. package/dist/migration.d.mts +22 -24
  12. package/dist/migration.d.mts.map +1 -1
  13. package/dist/migration.mjs +25 -24
  14. package/dist/migration.mjs.map +1 -1
  15. package/dist/pack.d.mts +35 -23
  16. package/dist/pack.d.mts.map +1 -1
  17. package/dist/pack.mjs +3 -5
  18. package/dist/pack.mjs.map +1 -1
  19. package/dist/runtime.d.mts +19 -2
  20. package/dist/runtime.d.mts.map +1 -1
  21. package/dist/runtime.mjs +26 -4
  22. package/dist/runtime.mjs.map +1 -1
  23. package/dist/schema-verify.d.mts +4 -15
  24. package/dist/schema-verify.d.mts.map +1 -1
  25. package/dist/schema-verify.mjs +2 -3
  26. package/dist/test-utils.d.mts +2 -2
  27. package/dist/test-utils.mjs +2 -3
  28. package/dist/timestamp-now-generator-BWp8S2sa.mjs +86 -0
  29. package/dist/timestamp-now-generator-BWp8S2sa.mjs.map +1 -0
  30. package/dist/types-mhjAPuMn.d.mts +470 -0
  31. package/dist/types-mhjAPuMn.d.mts.map +1 -0
  32. package/dist/verify-pRYxnpiG.mjs +81 -0
  33. package/dist/verify-pRYxnpiG.mjs.map +1 -0
  34. package/dist/{verify-sql-schema-Ovz7RXR5.mjs → verify-sql-schema-1tDh3x5x.mjs} +18 -72
  35. package/dist/verify-sql-schema-1tDh3x5x.mjs.map +1 -0
  36. package/dist/{verify-sql-schema-BBhkqEDo.d.mts → verify-sql-schema-CPHiuYHR.d.mts} +2 -3
  37. package/dist/verify-sql-schema-CPHiuYHR.d.mts.map +1 -0
  38. package/dist/verify.d.mts +16 -21
  39. package/dist/verify.d.mts.map +1 -1
  40. package/dist/verify.mjs +2 -3
  41. package/package.json +23 -21
  42. package/src/core/authoring-field-presets.ts +35 -23
  43. package/src/core/control-adapter.ts +32 -0
  44. package/src/core/control-descriptor.ts +2 -1
  45. package/src/core/control-instance.ts +117 -30
  46. package/src/core/migrations/contract-to-schema-ir.ts +4 -29
  47. package/src/core/migrations/field-event-planner.ts +194 -0
  48. package/src/core/migrations/plan-helpers.ts +4 -0
  49. package/src/core/migrations/types.ts +207 -59
  50. package/src/core/operation-preview.ts +62 -0
  51. package/src/core/psl-contract-infer/default-mapping.ts +56 -0
  52. package/src/core/psl-contract-infer/name-transforms.ts +178 -0
  53. package/src/core/psl-contract-infer/postgres-default-mapping.ts +16 -0
  54. package/src/core/psl-contract-infer/postgres-type-map.ts +165 -0
  55. package/src/core/psl-contract-infer/printer-config.ts +55 -0
  56. package/src/core/psl-contract-infer/raw-default-parser.ts +91 -0
  57. package/src/core/psl-contract-infer/relation-inference.ts +196 -0
  58. package/src/core/psl-contract-infer/sql-schema-ir-to-psl-ast.ts +832 -0
  59. package/src/core/schema-verify/verify-helpers.ts +47 -70
  60. package/src/core/schema-verify/verify-sql-schema.ts +1 -6
  61. package/src/core/sql-migration.ts +25 -23
  62. package/src/core/timestamp-now-generator.ts +74 -0
  63. package/src/core/timestamp-now-runtime-generator.ts +24 -0
  64. package/src/core/verify.ts +46 -108
  65. package/src/exports/control.ts +11 -4
  66. package/src/exports/runtime.ts +2 -0
  67. package/src/exports/schema-verify.ts +0 -1
  68. package/src/exports/test-utils.ts +0 -1
  69. package/src/exports/verify.ts +1 -1
  70. package/dist/authoring-type-constructors-BAR65pSK.mjs.map +0 -1
  71. package/dist/types-C6K4mxDM.d.mts +0 -301
  72. package/dist/types-C6K4mxDM.d.mts.map +0 -1
  73. package/dist/verify-4GshvY4p.mjs +0 -122
  74. package/dist/verify-4GshvY4p.mjs.map +0 -1
  75. package/dist/verify-sql-schema-BBhkqEDo.d.mts.map +0 -1
  76. package/dist/verify-sql-schema-Ovz7RXR5.mjs.map +0 -1
package/README.md CHANGED
@@ -15,7 +15,6 @@ Provides the SQL family descriptor (`ControlFamilyDescriptor`) that includes:
15
15
  - **Planner & Runner SPI**: Owns the `MigrationPlanner` / `MigrationRunner` interfaces plus the `SqlControlTargetDescriptor` helper so targets can expose planners and runners (e.g., Postgres init planner/runner)
16
16
  - **Family Hook Integration**: Integrates the SQL target family hook (`sqlEmission`) from `@prisma-next/sql-contract-emitter`
17
17
  - **Control Plane Entry Point**: Serves as the control plane entry point for the SQL family, enabling the CLI to select the family hook and create family instances
18
- - **Component Database Dependencies**: Consumes database dependencies declared by framework components (target/adapter/extension packs). Callers pass the active `frameworkComponents` list into planning/execution/verification; SQL layers structurally narrow to components that declare `databaseDependencies` and use their pure verification hooks (no fuzzy matching against `contract.extensionPacks`).
19
18
  - **Contract-to-SchemaIR Conversion**: Converts `SqlStorage` from a contract into `SqlSchemaIR` for offline migration planning, enabling `migration plan` to work without a database connection
20
19
  - **Destructive Change Detection**: Compares two `SqlStorage` values and identifies destructive changes (dropped tables/columns) for migration policy enforcement
21
20
  - **Storage Type Control Hooks**: Extracts codec-owned control hooks for planning/verification/introspection of `storage.types` without adding enum-specific fields to shared IR
@@ -111,7 +110,7 @@ The descriptor is "pure data + factory" - it only provides the hook and factory
111
110
  - **`src/core/control-descriptor.ts`**: `SqlFamilyDescriptor` class implementing `ControlFamilyDescriptor` interface (pure data + factory)
112
111
  - **`src/core/control-instance.ts`**: `createSqlFamilyInstance` function that creates `SqlFamilyInstance` with domain action methods (`validateContract`, `verify`, `schemaVerify`, `introspect`, `toSchemaView`, `emitContract`). Contains `convertOperationManifest` function used internally by instance creation and test utilities in the same package.
113
112
  - **`src/core/assembly.ts`**: Assembly helpers for extracting type imports, collecting codec-owned storage type control hooks, and composing mutation-default registries with duplicate detection.
114
- - **`src/core/verify.ts`**: Verification helpers (`readMarker`, `collectSupportedCodecTypeIds`)
113
+ - **`src/core/verify.ts`**: Verification helpers (`parseContractMarkerRow`, `collectSupportedCodecTypeIds`)
115
114
  - **`src/core/control-adapter.ts`**: SQL control adapter interface (`SqlControlAdapter`) for control-plane operations
116
115
  - **`src/core/migrations/`**: Migration IR helpers plus planner and runner SPI types (`MigrationPlanner`, `MigrationRunner`, `SqlControlTargetDescriptor`). Runners return `MigrationRunnerResult` which is a union of success/failure.
117
116
  - **`src/core/migrations/contract-to-schema-ir.ts`**: `contractToSchemaIR(contract, { annotationNamespace, ... })` converts a contract to `SqlSchemaIR` for offline migration planning (used by `migration plan` to synthesize the "from" schema without a database connection). Also exports `detectDestructiveChanges(from, to)` which compares two `SqlStorage` values and returns a list of destructive changes (dropped tables, dropped columns) for migration policy enforcement.
@@ -135,7 +134,7 @@ The runner returns structured errors with the following codes:
135
134
  - **`./control`**: Control plane entry point for CLI/config usage (exports `SqlFamilyDescriptor`)
136
135
  - **`./control-adapter`**: SQL control adapter interface (`SqlControlAdapter`, `SqlControlAdapterDescriptor`) for target-specific adapters
137
136
  - **`./runtime`**: Runtime plane identity exports only (family ID, types, descriptor identity). Does **not** export runtime creation helpers—use `instantiateExecutionStack` from `@prisma-next/framework-components/execution` and `createExecutionContext`, `createRuntime`, `createSqlExecutionStack` from `@prisma-next/sql-runtime`. See [ADR 152](../../../docs/architecture%20docs/adrs/ADR%20152%20-%20Execution%20Plane%20Descriptors%20and%20Instances.md).
138
- - **`./verify`**: Verification utilities (`readMarker`, `readMarkerSql`, `parseContractMarkerRow`) for reading contract markers from databases
137
+ - **`./verify`**: Marker row parsing helper (`parseContractMarkerRow`). Marker reads are owned by each `SqlControlAdapter` (e.g. `PostgresControlAdapter.readMarker`) so dialect-specific SQL stays target-local.
139
138
 
140
139
  ## Dependencies
141
140
 
@@ -81,10 +81,10 @@ const sqlFamilyAuthoringFieldPresets = {
81
81
  codecId: CHARACTER_CODEC_ID,
82
82
  nativeType: CHARACTER_NATIVE_TYPE,
83
83
  typeParams: { length: 36 },
84
- executionDefault: {
84
+ executionDefaults: { onCreate: {
85
85
  kind: "generator",
86
86
  id: "uuidv4"
87
- },
87
+ } },
88
88
  id: true
89
89
  }
90
90
  },
@@ -94,10 +94,10 @@ const sqlFamilyAuthoringFieldPresets = {
94
94
  codecId: CHARACTER_CODEC_ID,
95
95
  nativeType: CHARACTER_NATIVE_TYPE,
96
96
  typeParams: { length: 36 },
97
- executionDefault: {
97
+ executionDefaults: { onCreate: {
98
98
  kind: "generator",
99
99
  id: "uuidv7"
100
- },
100
+ } },
101
101
  id: true
102
102
  }
103
103
  },
@@ -107,10 +107,10 @@ const sqlFamilyAuthoringFieldPresets = {
107
107
  codecId: CHARACTER_CODEC_ID,
108
108
  nativeType: CHARACTER_NATIVE_TYPE,
109
109
  typeParams: { length: 26 },
110
- executionDefault: {
110
+ executionDefaults: { onCreate: {
111
111
  kind: "generator",
112
112
  id: "ulid"
113
- },
113
+ } },
114
114
  id: true
115
115
  }
116
116
  },
@@ -126,7 +126,7 @@ const sqlFamilyAuthoringFieldPresets = {
126
126
  path: ["size"],
127
127
  default: 21
128
128
  } },
129
- executionDefault: {
129
+ executionDefaults: { onCreate: {
130
130
  kind: "generator",
131
131
  id: "nanoid",
132
132
  params: { size: {
@@ -134,7 +134,7 @@ const sqlFamilyAuthoringFieldPresets = {
134
134
  index: 0,
135
135
  path: ["size"]
136
136
  } }
137
- },
137
+ } },
138
138
  id: true
139
139
  }
140
140
  },
@@ -144,10 +144,10 @@ const sqlFamilyAuthoringFieldPresets = {
144
144
  codecId: CHARACTER_CODEC_ID,
145
145
  nativeType: CHARACTER_NATIVE_TYPE,
146
146
  typeParams: { length: 24 },
147
- executionDefault: {
147
+ executionDefaults: { onCreate: {
148
148
  kind: "generator",
149
149
  id: "cuid2"
150
- },
150
+ } },
151
151
  id: true
152
152
  }
153
153
  },
@@ -157,16 +157,15 @@ const sqlFamilyAuthoringFieldPresets = {
157
157
  codecId: CHARACTER_CODEC_ID,
158
158
  nativeType: CHARACTER_NATIVE_TYPE,
159
159
  typeParams: { length: 27 },
160
- executionDefault: {
160
+ executionDefaults: { onCreate: {
161
161
  kind: "generator",
162
162
  id: "ksuid"
163
- },
163
+ } },
164
164
  id: true
165
165
  }
166
166
  }
167
167
  }
168
168
  };
169
-
170
169
  //#endregion
171
170
  //#region src/core/authoring-type-constructors.ts
172
171
  const sqlFamilyAuthoringTypes = { sql: { String: {
@@ -187,7 +186,7 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
187
186
  } }
188
187
  }
189
188
  } } };
190
-
191
189
  //#endregion
192
190
  export { sqlFamilyAuthoringFieldPresets as n, sqlFamilyAuthoringTypes as t };
193
- //# sourceMappingURL=authoring-type-constructors-BAR65pSK.mjs.map
191
+
192
+ //# sourceMappingURL=authoring-type-constructors-F4JpCJl7.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-type-constructors-F4JpCJl7.mjs","names":[],"sources":["../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/authoring';\n\n/**\n * Family-level SQL authoring field presets.\n *\n * Only presets whose codec IDs align with the ID generator metadata live here\n * (see `@prisma-next/ids`). These presets are target-agnostic because the\n * generator metadata fixes their codec/native-type to `sql/char@1`\n * (`character`) regardless of target, and the PSL interpreter lets the\n * generator override the scalar descriptor.\n *\n * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,\n * `boolean`, `dateTime`) are contributed by the target pack (see\n * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the\n * TS callback surface and the PSL scalar surface lower to byte-identical\n * contracts for the active target.\n */\n\nconst CHARACTER_CODEC_ID = 'sql/char@1';\nconst CHARACTER_NATIVE_TYPE = 'character';\n\nconst nanoidOptionsArgument = {\n kind: 'object',\n optional: true,\n properties: {\n size: {\n kind: 'number',\n optional: true,\n integer: true,\n minimum: 2,\n maximum: 255,\n },\n },\n} as const;\n\nexport const sqlFamilyAuthoringFieldPresets = {\n uuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n },\n },\n id: {\n uuidv4: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv4',\n },\n },\n id: true,\n },\n },\n uuidv7: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 36,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'uuidv7',\n },\n },\n id: true,\n },\n },\n ulid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 26,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ulid',\n },\n },\n id: true,\n },\n },\n nanoid: {\n kind: 'fieldPreset',\n args: [nanoidOptionsArgument],\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n default: 21,\n },\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'nanoid',\n params: {\n size: {\n kind: 'arg',\n index: 0,\n path: ['size'],\n },\n },\n },\n },\n id: true,\n },\n },\n cuid2: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 24,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'cuid2',\n },\n },\n id: true,\n },\n },\n ksuid: {\n kind: 'fieldPreset',\n output: {\n codecId: CHARACTER_CODEC_ID,\n nativeType: CHARACTER_NATIVE_TYPE,\n typeParams: {\n length: 27,\n },\n executionDefaults: {\n onCreate: {\n kind: 'generator',\n id: 'ksuid',\n },\n },\n id: true,\n },\n },\n },\n} as const satisfies AuthoringFieldNamespace;\n","import type { AuthoringTypeNamespace } from '@prisma-next/framework-components/authoring';\n\nexport const sqlFamilyAuthoringTypes = {\n sql: {\n String: {\n kind: 'typeConstructor',\n args: [{ kind: 'number', name: 'length', integer: true, minimum: 1, maximum: 10485760 }],\n output: {\n codecId: 'sql/varchar@1',\n nativeType: 'character varying',\n typeParams: {\n length: { kind: 'arg', index: 0 },\n },\n },\n },\n },\n} as const satisfies AuthoringTypeNamespace;\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,MAAM,qBAAqB;AAC3B,MAAM,wBAAwB;AAE9B,MAAM,wBAAwB;CAC5B,MAAM;CACN,UAAU;CACV,YAAY,EACV,MAAM;EACJ,MAAM;EACN,UAAU;EACV,SAAS;EACT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KACN,OAAO;KACP,MAAM,CAAC,OAAO;KACd,SAAS;KACV,EACF;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACJ,QAAQ,EACN,MAAM;MACJ,MAAM;MACN,OAAO;MACP,MAAM,CAAC,OAAO;MACf,EACF;KACF,EACF;IACD,IAAI;IACL;GACF;EACD,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACD,OAAO;GACL,MAAM;GACN,QAAQ;IACN,SAAS;IACT,YAAY;IACZ,YAAY,EACV,QAAQ,IACT;IACD,mBAAmB,EACjB,UAAU;KACR,MAAM;KACN,IAAI;KACL,EACF;IACD,IAAI;IACL;GACF;EACF;CACF;;;AC/MD,MAAa,0BAA0B,EACrC,KAAK,EACH,QAAQ;CACN,MAAM;CACN,MAAM,CAAC;EAAE,MAAM;EAAU,MAAM;EAAU,SAAS;EAAM,SAAS;EAAG,SAAS;EAAU,CAAC;CACxF,QAAQ;EACN,SAAS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;GAAG,EAClC;EACF;CACF,EACF,EACF"}
@@ -1,10 +1,10 @@
1
- import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-BBhkqEDo.mjs";
1
+ import { n as NativeTypeNormalizer, t as DefaultNormalizer } from "./verify-sql-schema-CPHiuYHR.mjs";
2
2
  import { ControlAdapterInstance, ControlDriverInstance, ControlStack } from "@prisma-next/framework-components/control";
3
+ import { ContractMarkerRecord } from "@prisma-next/contract/types";
3
4
  import { AnyQueryAst, LoweredStatement, LowererContext } from "@prisma-next/sql-relational-core/ast";
4
5
  import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
5
6
 
6
7
  //#region src/core/control-adapter.d.ts
7
-
8
8
  /**
9
9
  * SQL control adapter interface for control-plane operations.
10
10
  * Implemented by target-specific adapters (e.g., Postgres, MySQL).
@@ -12,6 +12,30 @@ import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
12
12
  * @template TTarget - The target ID (e.g., 'postgres', 'mysql')
13
13
  */
14
14
  interface SqlControlAdapter<TTarget extends string = string> extends ControlAdapterInstance<'sql', TTarget> {
15
+ /**
16
+ * Reads the contract marker for `space` from the database, returning
17
+ * `null` if no marker row exists for that space (or if the marker
18
+ * table itself is missing). Implementations are responsible for the
19
+ * dialect-specific existence probe (e.g. Postgres
20
+ * `information_schema.tables` vs SQLite `sqlite_master`) and parameter
21
+ * placeholders.
22
+ *
23
+ * `space` is required so callers cannot accidentally fall through to
24
+ * the app's marker row when reading per-extension markers.
25
+ *
26
+ * @param driver - ControlDriverInstance for executing queries (target-specific)
27
+ * @param space - Contract space id whose marker row to read (e.g. `'app'`)
28
+ * @returns Resolved marker record, or `null` if not yet stamped.
29
+ */
30
+ readMarker(driver: ControlDriverInstance<'sql', TTarget>, space: string): Promise<ContractMarkerRecord | null>;
31
+ /**
32
+ * Reads every marker row from `prisma_contract.marker` (one per
33
+ * contract space) and returns them keyed by `space`. Used by the
34
+ * per-space verifier to detect marker-vs-on-disk drift and orphan
35
+ * marker rows. Returns an empty map when the marker table does not
36
+ * yet exist (fresh database / never-signed project).
37
+ */
38
+ readAllMarkers(driver: ControlDriverInstance<'sql', TTarget>): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
15
39
  /**
16
40
  * Introspects a database schema and returns a raw SqlSchemaIR.
17
41
  *
@@ -1 +1 @@
1
- {"version":3,"file":"control-adapter.d.mts","names":[],"sources":["../src/core/control-adapter.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAmBA;;;;AAkBa,UAlBI,iBAkBJ,CAAA,gBAAA,MAAA,GAAA,MAAA,CAAA,SAjBH,sBAiBG,CAAA,KAAA,EAjB2B,OAiB3B,CAAA,CAAA;EAAR;;;;;;;;AAkCL;;;;EAO+C,UAAA,CAAA,MAAA,EA5CnC,qBA4CmC,CAAA,KAAA,EA5CN,OA4CM,CAAA,EAAA,QAAA,CAAA,EAAA,OAAA,EAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EAzC1C,OAyC0C,CAzClC,WAyCkC,CAAA;EAAiB;;;;;8BAlClC;;;;;;iCAOG;;;;;;;;;;aAWpB,sBAAsB,0BAA0B;;;;;;;;UAS5C;;;;;;;gBAOD,oBAAoB,WAAW,kBAAkB"}
1
+ {"version":3,"file":"control-adapter.d.mts","names":[],"sources":["../src/core/control-adapter.ts"],"mappings":";;;;;;;;;AAoBA;;;;UAAiB,iBAAA,0CACP,sBAAA,QAA8B,OAAA;EAiB5B;;;;;;;;;;;;;;;EADV,UAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,GACrC,KAAA,WACC,OAAA,CAAQ,oBAAA;EAsDgD;;;;;;;EA7C3D,cAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,IACpC,OAAA,CAAQ,WAAA,SAAoB,oBAAA;EAbrB;;;;;;;;;;;;EA2BV,UAAA,CACE,MAAA,EAAQ,qBAAA,QAA6B,OAAA,GACrC,QAAA,YACA,MAAA,YACC,OAAA,CAAQ,WAAA;EAJX;;;;;EAAA,SAWS,gBAAA,GAAmB,iBAAA;EAPzB;;;;;EAAA,SAcM,mBAAA,GAAsB,oBAAA;EAW/B;;;;;;;;AASF;EATE,KAAA,CAAM,GAAA,EAAK,WAAA,EAAa,OAAA,EAAS,cAAA,YAA0B,gBAAA;AAAA;;;;;;;UAS5C,2BAAA;EAOf;;;;;;EAAA,MAAA,CAAO,KAAA,EAAO,YAAA,QAAoB,OAAA,IAAW,iBAAA,CAAkB,OAAA;AAAA"}
@@ -1 +1 @@
1
- export { };
1
+ export {};
@@ -1,12 +1,11 @@
1
- import { A as SqlPlannerFailureResult, C as SqlMigrationRunnerFailure, D as SqlPlannerConflict, E as SqlPlanTargetDetails, F as isDatabaseDependencyProvider, I as SchemaVerifyOptions, L as SqlControlFamilyInstance, M as SqlPlannerSuccessResult, N as StorageTypePlanResult, O as SqlPlannerConflictKind, P as collectInitDependencies, S as SqlMigrationRunnerExecuteOptions, T as SqlMigrationRunnerSuccessValue, _ as SqlMigrationPlanner, a as ComponentDatabaseDependency, b as SqlMigrationRunnerErrorCode, c as ResolveIdentityValueInput, d as SqlControlTargetDescriptor, f as SqlMigrationPlan, g as SqlMigrationPlanOperationTarget, h as SqlMigrationPlanOperationStep, i as ComponentDatabaseDependencies, j as SqlPlannerResult, k as SqlPlannerConflictLocation, l as SqlControlAdapterDescriptor, m as SqlMigrationPlanOperation, n as AnySqlMigrationOperation, o as CreateSqlMigrationPlanOptions, p as SqlMigrationPlanContractInfo, r as CodecControlHooks, s as ExpandNativeTypeInput, t as AnyRecord, u as SqlControlExtensionDescriptor, v as SqlMigrationPlannerPlanOptions, w as SqlMigrationRunnerResult, x as SqlMigrationRunnerExecuteCallbacks, y as SqlMigrationRunner } from "./types-C6K4mxDM.mjs";
2
- import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
1
+ import { A as SqlPlannerConflictKind, C as SqlMigrationRunnerExecuteCallbacks, D as SqlMigrationRunnerSuccessValue, E as SqlMigrationRunnerResult, F as StorageTypePlanResult, I as SchemaVerifyOptions, L as SqlControlFamilyInstance, M as SqlPlannerFailureResult, N as SqlPlannerResult, O as SqlPlanTargetDetails, P as SqlPlannerSuccessResult, S as SqlMigrationRunnerErrorCode, T as SqlMigrationRunnerFailure, _ as SqlMigrationPlanOperationStep, a as FieldEvent, b as SqlMigrationPlannerPlanOptions, c as MultiSpaceRunnerResult, d as SqlControlAdapterDescriptor, f as SqlControlExtensionDescriptor, g as SqlMigrationPlanOperation, h as SqlMigrationPlanContractInfo, i as ExpandNativeTypeInput, j as SqlPlannerConflictLocation, k as SqlPlannerConflict, l as MultiSpaceRunnerSuccessValue, m as SqlMigrationPlan, n as CodecControlHooks, o as FieldEventContext, p as SqlControlTargetDescriptor, r as CreateSqlMigrationPlanOptions, s as MultiSpaceRunnerFailure, t as AnyRecord, u as ResolveIdentityValueInput, v as SqlMigrationPlanOperationTarget, w as SqlMigrationRunnerExecuteOptions, x as SqlMigrationRunner, y as SqlMigrationPlanner } from "./types-mhjAPuMn.mjs";
2
+ import { ControlFamilyDescriptor, ControlStack, MigrationOperationClass, MigrationOperationPolicy, MigrationOperationPolicy as MigrationOperationPolicy$1, MigrationPlan, MigrationPlanOperation, MigrationPlanner, MigrationPlannerConflict, MigrationPlannerConflict as MigrationPlannerConflict$1, MigrationPlannerResult, MutationDefaultGeneratorDescriptor, OpFactoryCall, TargetMigrationsCapability, assembleAuthoringContributions } from "@prisma-next/framework-components/control";
3
3
  import { NotOk, Ok } from "@prisma-next/utils/result";
4
- import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
5
- import * as _prisma_next_contract_types0 from "@prisma-next/contract/types";
6
4
  import { ColumnDefault, Contract } from "@prisma-next/contract/types";
5
+ import { SqlSchemaIR } from "@prisma-next/sql-schema-ir/types";
7
6
  import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
8
7
  import { SqlStorage, StorageColumn } from "@prisma-next/sql-contract/types";
9
- import * as _prisma_next_framework_components_emission0 from "@prisma-next/framework-components/emission";
8
+ import { EmissionSpi } from "@prisma-next/framework-components/emission";
10
9
 
11
10
  //#region src/core/control-descriptor.d.ts
12
11
  declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlControlFamilyInstance> {
@@ -14,17 +13,7 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
14
13
  readonly id = "sql";
15
14
  readonly familyId: "sql";
16
15
  readonly version = "0.0.1";
17
- readonly emission: {
18
- readonly id: "sql";
19
- readonly validateTypes: (contract: _prisma_next_contract_types0.Contract, _ctx: _prisma_next_framework_components_emission0.ValidationContext) => void;
20
- readonly validateStructure: (contract: _prisma_next_contract_types0.Contract) => void;
21
- readonly generateStorageType: (contract: _prisma_next_contract_types0.Contract, storageHashTypeName: string) => string;
22
- readonly generateModelStorageType: (_modelName: string, model: _prisma_next_contract_types0.ContractModel) => string;
23
- readonly getFamilyImports: () => string[];
24
- readonly getFamilyTypeAliases: (options?: _prisma_next_framework_components_emission0.GenerateContractTypesOptions) => string;
25
- readonly getTypeMapsExpression: () => string;
26
- readonly getContractWrapper: (contractBaseName: string, typeMapsName: string) => string;
27
- };
16
+ readonly emission: EmissionSpi;
28
17
  readonly authoring: {
29
18
  readonly field: {
30
19
  readonly uuid: {
@@ -104,9 +93,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
104
93
  readonly typeParams: {
105
94
  readonly length: 36;
106
95
  };
107
- readonly executionDefault: {
108
- readonly kind: "generator";
109
- readonly id: "uuidv4";
96
+ readonly executionDefaults: {
97
+ readonly onCreate: {
98
+ readonly kind: "generator";
99
+ readonly id: "uuidv4";
100
+ };
110
101
  };
111
102
  readonly id: true;
112
103
  };
@@ -119,9 +110,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
119
110
  readonly typeParams: {
120
111
  readonly length: 36;
121
112
  };
122
- readonly executionDefault: {
123
- readonly kind: "generator";
124
- readonly id: "uuidv7";
113
+ readonly executionDefaults: {
114
+ readonly onCreate: {
115
+ readonly kind: "generator";
116
+ readonly id: "uuidv7";
117
+ };
125
118
  };
126
119
  readonly id: true;
127
120
  };
@@ -134,9 +127,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
134
127
  readonly typeParams: {
135
128
  readonly length: 26;
136
129
  };
137
- readonly executionDefault: {
138
- readonly kind: "generator";
139
- readonly id: "ulid";
130
+ readonly executionDefaults: {
131
+ readonly onCreate: {
132
+ readonly kind: "generator";
133
+ readonly id: "ulid";
134
+ };
140
135
  };
141
136
  readonly id: true;
142
137
  };
@@ -167,14 +162,16 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
167
162
  readonly default: 21;
168
163
  };
169
164
  };
170
- readonly executionDefault: {
171
- readonly kind: "generator";
172
- readonly id: "nanoid";
173
- readonly params: {
174
- readonly size: {
175
- readonly kind: "arg";
176
- readonly index: 0;
177
- readonly path: readonly ["size"];
165
+ readonly executionDefaults: {
166
+ readonly onCreate: {
167
+ readonly kind: "generator";
168
+ readonly id: "nanoid";
169
+ readonly params: {
170
+ readonly size: {
171
+ readonly kind: "arg";
172
+ readonly index: 0;
173
+ readonly path: readonly ["size"];
174
+ };
178
175
  };
179
176
  };
180
177
  };
@@ -189,9 +186,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
189
186
  readonly typeParams: {
190
187
  readonly length: 24;
191
188
  };
192
- readonly executionDefault: {
193
- readonly kind: "generator";
194
- readonly id: "cuid2";
189
+ readonly executionDefaults: {
190
+ readonly onCreate: {
191
+ readonly kind: "generator";
192
+ readonly id: "cuid2";
193
+ };
195
194
  };
196
195
  readonly id: true;
197
196
  };
@@ -204,9 +203,11 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
204
203
  readonly typeParams: {
205
204
  readonly length: 27;
206
205
  };
207
- readonly executionDefault: {
208
- readonly kind: "generator";
209
- readonly id: "ksuid";
206
+ readonly executionDefaults: {
207
+ readonly onCreate: {
208
+ readonly kind: "generator";
209
+ readonly id: "ksuid";
210
+ };
210
211
  };
211
212
  readonly id: true;
212
213
  };
@@ -284,15 +285,13 @@ interface ContractToSchemaIROptions {
284
285
  readonly annotationNamespace: string;
285
286
  readonly expandNativeType?: NativeTypeExpander;
286
287
  readonly renderDefault?: DefaultRenderer;
287
- readonly frameworkComponents?: ReadonlyArray<TargetBoundComponentDescriptor<'sql', string>>;
288
288
  }
289
289
  /**
290
290
  * Converts a `Contract` to `SqlSchemaIR`.
291
291
  *
292
- * Reads `contract.storage` for tables, `contract.storage.types` for type
293
- * annotations, and derives database dependencies from `frameworkComponents`
294
- * (each component's `databaseDependencies.init[].id`).
295
- * Storage-type annotations are written under `options.annotationNamespace`.
292
+ * Reads `contract.storage` for tables and `contract.storage.types` for type
293
+ * annotations. Storage-type annotations are written under
294
+ * `options.annotationNamespace`.
296
295
  *
297
296
  * Drops codec metadata (`codecId`, `typeRef`) since the schema IR only represents
298
297
  * structural information. When `expandNativeType` is provided, parameterized types
@@ -303,6 +302,30 @@ interface ContractToSchemaIROptions {
303
302
  */
304
303
  declare function contractToSchemaIR(contract: Contract<SqlStorage> | null, options: ContractToSchemaIROptions): SqlSchemaIR;
305
304
  //#endregion
305
+ //#region src/core/migrations/field-event-planner.d.ts
306
+ interface PlanFieldEventOperationsOptions {
307
+ /**
308
+ * Prior contract the planner is diffing against. `null` for first emits
309
+ * (every field is treated as added).
310
+ */
311
+ readonly priorContract: Contract<SqlStorage> | null;
312
+ /**
313
+ * New contract the user just authored.
314
+ */
315
+ readonly newContract: Contract<SqlStorage>;
316
+ /**
317
+ * Codec-id keyed map of control hooks, as produced by
318
+ * {@link import('./assembly').extractCodecControlHooks}. Hooks carry
319
+ * `unknown` target details after extraction; the caller casts the
320
+ * helper's returned ops to its target's `SqlMigrationPlanOperation`
321
+ * specialisation at the integration boundary, mirroring how
322
+ * `storageTypePlanCallStrategy` lifts `planTypeOperations` results into
323
+ * `RawSqlCall`.
324
+ */
325
+ readonly codecHooks: ReadonlyMap<string, CodecControlHooks>;
326
+ }
327
+ declare function planFieldEventOperations(options: PlanFieldEventOperationsOptions): readonly OpFactoryCall[];
328
+ //#endregion
306
329
  //#region src/core/migrations/plan-helpers.d.ts
307
330
  declare function createMigrationPlan<TTargetDetails>(options: CreateSqlMigrationPlanOptions<TTargetDetails>): SqlMigrationPlan<TTargetDetails>;
308
331
  declare function plannerSuccess<TTargetDetails>(plan: SqlMigrationPlan<TTargetDetails>): SqlPlannerSuccessResult<TTargetDetails>;
@@ -328,8 +351,65 @@ declare function runnerFailure(code: SqlMigrationRunnerErrorCode, summary: strin
328
351
  */
329
352
  declare const INIT_ADDITIVE_POLICY: MigrationOperationPolicy$1;
330
353
  //#endregion
354
+ //#region src/core/timestamp-now-generator.d.ts
355
+ /**
356
+ * Builds the canonical control-plane descriptor for the wall-clock-now
357
+ * mutation default generator. The descriptor's `id` and `buildPhases`
358
+ * are target-agnostic so PSL `temporal.updatedAt()` and TS
359
+ * `field.temporal.updatedAt()` lower to byte-identical contracts.
360
+ *
361
+ * `applicableCodecIds` is omitted: `timestampNow` is preset-only (not
362
+ * reachable via `@default(timestampNow())` lowering), and the codec is
363
+ * co-registered by the preset descriptor itself, so the
364
+ * `@default(...)` compatibility check has no role to play here.
365
+ */
366
+ declare function timestampNowControlDescriptor(): MutationDefaultGeneratorDescriptor;
367
+ /**
368
+ * Builds the canonical `temporal.{createdAt,updatedAt}` field-preset pair
369
+ * for a SQL target. `createdAt` lowers to a `now()` storage default;
370
+ * `updatedAt` lowers to the `timestampNow` execution generator on both
371
+ * `onCreate` and `onUpdate` (RD: "last modified time", non-null). Targets
372
+ * supply the codec/native-type pair that matches their timestamp column;
373
+ * everything else is shared so PSL `temporal.updatedAt()` and TS
374
+ * `field.temporal.updatedAt()` lower to byte-identical contracts across
375
+ * targets by construction.
376
+ */
377
+ declare function temporalAuthoringPresets<const CodecId extends string, const NativeType extends string>(input: {
378
+ readonly codecId: CodecId;
379
+ readonly nativeType: NativeType;
380
+ }): {
381
+ readonly createdAt: {
382
+ readonly kind: "fieldPreset";
383
+ readonly output: {
384
+ readonly codecId: CodecId;
385
+ readonly nativeType: NativeType;
386
+ readonly default: {
387
+ readonly kind: "function";
388
+ readonly expression: "now()";
389
+ };
390
+ };
391
+ };
392
+ readonly updatedAt: {
393
+ readonly kind: "fieldPreset";
394
+ readonly output: {
395
+ readonly codecId: CodecId;
396
+ readonly nativeType: NativeType;
397
+ readonly executionDefaults: {
398
+ readonly onCreate: {
399
+ readonly kind: "generator";
400
+ readonly id: "timestampNow";
401
+ };
402
+ readonly onUpdate: {
403
+ readonly kind: "generator";
404
+ readonly id: "timestampNow";
405
+ };
406
+ };
407
+ };
408
+ };
409
+ };
410
+ //#endregion
331
411
  //#region src/exports/control.d.ts
332
412
  declare const _default: SqlFamilyDescriptor;
333
413
  //#endregion
334
- export { type AnySqlMigrationOperation, type CodecControlHooks, type ComponentDatabaseDependencies, type ComponentDatabaseDependency, type ContractToSchemaIROptions, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type ExpandNativeTypeInput, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type NativeTypeExpander, type ResolveIdentityValueInput, type SchemaVerifyOptions, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, collectInitDependencies, contractToSchemaIR, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, isDatabaseDependencyProvider, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess };
414
+ export { type CodecControlHooks, type ContractToSchemaIROptions, type CreateSqlMigrationPlanOptions, type DefaultRenderer, type ExpandNativeTypeInput, type FieldEvent, type FieldEventContext, INIT_ADDITIVE_POLICY, type MigrationOperationClass, type MigrationOperationPolicy, type MigrationPlan, type MigrationPlanOperation, type MigrationPlanner, type MigrationPlannerConflict, type MigrationPlannerResult, type MultiSpaceRunnerFailure, type MultiSpaceRunnerResult, type MultiSpaceRunnerSuccessValue, type NativeTypeExpander, type PlanFieldEventOperationsOptions, type ResolveIdentityValueInput, type SchemaVerifyOptions, type SqlControlAdapterDescriptor, type SqlControlExtensionDescriptor, type SqlControlFamilyInstance, type SqlControlTargetDescriptor, type SqlMigrationPlan, type SqlMigrationPlanContractInfo, type SqlMigrationPlanOperation, type SqlMigrationPlanOperationStep, type SqlMigrationPlanOperationTarget, type SqlMigrationPlanner, type SqlMigrationPlannerPlanOptions, type SqlMigrationRunner, type SqlMigrationRunnerErrorCode, type SqlMigrationRunnerExecuteCallbacks, type SqlMigrationRunnerExecuteOptions, type SqlMigrationRunnerFailure, type SqlMigrationRunnerResult, type SqlMigrationRunnerSuccessValue, type SqlPlanTargetDetails, type SqlPlannerConflict, type SqlPlannerConflictKind, type SqlPlannerConflictLocation, type SqlPlannerFailureResult, type SqlPlannerResult, type SqlPlannerSuccessResult, type StorageTypePlanResult, type TargetMigrationsCapability, assembleAuthoringContributions, contractToSchemaIR, createMigrationPlan, _default as default, detectDestructiveChanges, extractCodecControlHooks, planFieldEventOperations, plannerFailure, plannerSuccess, runnerFailure, runnerSuccess, temporalAuthoringPresets, timestampNowControlDescriptor };
335
415
  //# sourceMappingURL=control.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/exports/control.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cASa,mBAAA,YACA,+BAA+B;;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vJS,CAAA,EDwJjB,WCxJiB;;;iBAFJ,6CACL,8BAA8B,kBACtC,iBAAiB;iBAYJ,qCACR,iBAAiB,kBACtB,wBAAwB;iBAOX,cAAA,qBAAmC,uBAAuB;;;;iBAoB1D,aAAA;;;AH/HhB,CAAA,CAAA,EGkII,EHlIS,CGkIN,8BHjIL,CAAA;;;;iBG6Ic,aAAA,OACR;;SAE2B;IAChC,MAAM;;;;;;cCtJI,sBAAsB;;;AJInC,cK2DiG,QL3DpF,EK2DoF,mBL1D/F"}
1
+ {"version":3,"file":"control.d.mts","names":[],"sources":["../src/core/control-descriptor.ts","../src/core/assembly.ts","../src/core/migrations/contract-to-schema-ir.ts","../src/core/migrations/field-event-planner.ts","../src/core/migrations/plan-helpers.ts","../src/core/migrations/policies.ts","../src/core/timestamp-now-generator.ts","../src/exports/control.ts"],"mappings":";;;;;;;;;;cAUa,mBAAA,YACA,uBAAA,QAA+B,wBAAA;EAAA,SAEjC,IAAA;EAAA,SACA,EAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA;EAAA,SACA,QAAA,EAAU,WAAA;EAAA,SACV,SAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKT,MAAA,0BAAA,CACE,KAAA,EAAO,YAAA,QAAoB,SAAA,IAC1B,wBAAA;AAAA;;;iBCHW,wBAAA,CACd,WAAA,EAAa,aAAA,CAAc,8BAAA,mBAC1B,GAAA,SAAY,iBAAA;;;;;;;;;ADdf;;;;KEuBY,kBAAA,IAAsB,KAAA;EAAA,SACvB,UAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA,GAAa,M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