@prisma-next/family-sql 0.13.0-dev.19 → 0.13.0-dev.20

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.
@@ -153,6 +153,11 @@ const sqlFamilyPslBlockDescriptors = { enum2: {
153
153
  * (`character`) regardless of target, and the PSL interpreter lets the
154
154
  * generator override the scalar descriptor.
155
155
  *
156
+ * The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID
157
+ * values as `character(36)` — portable across all SQL targets. For a native
158
+ * Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /
159
+ * `id.uuidv7Native` from `@prisma-next/target-postgres`.
160
+ *
156
161
  * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,
157
162
  * `boolean`, `dateTime`) are contributed by the target pack (see
158
163
  * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the
@@ -173,7 +178,7 @@ const nanoidOptionsArgument = {
173
178
  } }
174
179
  };
175
180
  const sqlFamilyAuthoringFieldPresets = {
176
- uuid: {
181
+ uuidString: {
177
182
  kind: "fieldPreset",
178
183
  output: {
179
184
  codecId: CHARACTER_CODEC_ID,
@@ -220,7 +225,7 @@ const sqlFamilyAuthoringFieldPresets = {
220
225
  }
221
226
  },
222
227
  id: {
223
- uuidv4: {
228
+ uuidv4String: {
224
229
  kind: "fieldPreset",
225
230
  output: {
226
231
  codecId: CHARACTER_CODEC_ID,
@@ -233,7 +238,7 @@ const sqlFamilyAuthoringFieldPresets = {
233
238
  id: true
234
239
  }
235
240
  },
236
- uuidv7: {
241
+ uuidv7String: {
237
242
  kind: "fieldPreset",
238
243
  output: {
239
244
  codecId: CHARACTER_CODEC_ID,
@@ -334,4 +339,4 @@ const sqlFamilyAuthoringTypes = { sql: { String: {
334
339
  //#endregion
335
340
  export { sqlFamilyPslBlockDescriptors as i, sqlFamilyAuthoringFieldPresets as n, sqlFamilyEntityTypes as r, sqlFamilyAuthoringTypes as t };
336
341
 
337
- //# sourceMappingURL=authoring-type-constructors-M7Ejo4Lv.mjs.map
342
+ //# sourceMappingURL=authoring-type-constructors-CN60DEWb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-type-constructors-CN60DEWb.mjs","names":[],"sources":["../src/core/authoring-entity-types.ts","../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type {\n AuthoringEntityContext,\n AuthoringEntityTypeDescriptor,\n AuthoringEntityTypeNamespace,\n AuthoringPslBlockDescriptorNamespace,\n PslExtensionBlock,\n} from '@prisma-next/framework-components/authoring';\nimport { type EnumTypeHandle, enumType } from '@prisma-next/sql-contract-ts/contract-builder';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nfunction parseQuotedString(raw: string): string | undefined {\n if (raw.startsWith('\"') && raw.endsWith('\"') && raw.length >= 2) {\n return raw.slice(1, -1);\n }\n return undefined;\n}\n\nexport const sqlFamilyEnum2EntityDescriptor = {\n kind: 'entity' as const,\n discriminator: 'enum2',\n output: {\n factory: (\n block: PslExtensionBlock,\n ctx: AuthoringEntityContext,\n ): EnumTypeHandle | undefined => {\n const sourceId = ctx.sourceId ?? 'unknown';\n const diagnostics = ctx.diagnostics;\n\n const typeAttr = block.blockAttributes.find((a) => a.name === 'type');\n if (!typeAttr) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" is missing a @@type(\"codecId\") attribute`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n const rawCodecArg = typeAttr.args[0]?.value;\n const codecId = rawCodecArg !== undefined ? parseQuotedString(rawCodecArg) : undefined;\n if (!codecId) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" @@type attribute must have a quoted codec id argument`,\n sourceId,\n span: typeAttr.span,\n });\n return undefined;\n }\n\n const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n if (nativeType === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const codec = ctx.codecLookup?.get(codecId);\n if (codec === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const seenValues = new Set<string>();\n const members: { name: string; value: unknown }[] = [];\n let memberError = false;\n\n for (const [memberName, paramValue] of Object.entries(block.parameters)) {\n let value: unknown;\n if (paramValue.kind === 'bare') {\n try {\n value = codec.decodeJson(memberName);\n } catch {\n diagnostics?.push({\n code: 'PSL_ENUM2_BARE_MEMBER_NON_STRING_CODEC',\n message: `enum2 \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else if (paramValue.kind === 'value') {\n let jsonValue: unknown;\n try {\n jsonValue = JSON.parse(paramValue.raw);\n } catch {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n try {\n value = codec.decodeJson(\n blindCast<JsonValue, 'JSON.parse returns a JsonValue-compatible value'>(jsonValue),\n );\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else {\n continue;\n }\n\n const valueKey = String(value);\n if (seenValues.has(valueKey)) {\n diagnostics?.push({\n code: 'PSL_ENUM2_DUPLICATE_MEMBER_VALUE',\n message: `enum2 \"${block.name}\": duplicate member value \"${valueKey}\"`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n seenValues.add(valueKey);\n members.push({ name: memberName, value });\n }\n\n if (memberError) return undefined;\n\n if (members.length === 0) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" must have at least one member`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n return enumType(\n block.name,\n { codecId, nativeType },\n ...members.map((m) => ({ name: m.name, value: m.value })),\n );\n },\n },\n} satisfies AuthoringEntityTypeDescriptor;\n\nexport const sqlFamilyEntityTypes: AuthoringEntityTypeNamespace = {\n enum2: sqlFamilyEnum2EntityDescriptor,\n};\n\nexport const sqlFamilyPslBlockDescriptors = {\n enum2: {\n kind: 'pslBlock',\n keyword: 'enum2',\n discriminator: 'enum2',\n name: { required: true },\n parameters: {},\n variadicParameters: true,\n },\n} as const satisfies AuthoringPslBlockDescriptorNamespace;\n","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 * The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID\n * values as `character(36)` — portable across all SQL targets. For a native\n * Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /\n * `id.uuidv7Native` from `@prisma-next/target-postgres`.\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 uuidString: {\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 uuidv4String: {\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 uuidv7String: {\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":";;;AAWA,SAAS,kBAAkB,KAAiC;CAC1D,IAAI,IAA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AS;EACT,YAAY;EACZ,YAAY,EACV,QAAQ;GAAE,MAAM;GAAO,OAAO;EAAE,EAClC;CACF;AACF,EACF,EACF"}
@@ -16,7 +16,7 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
16
16
  readonly emission: EmissionSpi;
17
17
  readonly authoring: {
18
18
  readonly field: {
19
- readonly uuid: {
19
+ readonly uuidString: {
20
20
  readonly kind: "fieldPreset";
21
21
  readonly output: {
22
22
  readonly codecId: "sql/char@1";
@@ -85,7 +85,7 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
85
85
  };
86
86
  };
87
87
  readonly id: {
88
- readonly uuidv4: {
88
+ readonly uuidv4String: {
89
89
  readonly kind: "fieldPreset";
90
90
  readonly output: {
91
91
  readonly codecId: "sql/char@1";
@@ -102,7 +102,7 @@ declare class SqlFamilyDescriptor implements ControlFamilyDescriptor<'sql', SqlC
102
102
  readonly id: true;
103
103
  };
104
104
  };
105
- readonly uuidv7: {
105
+ readonly uuidv7String: {
106
106
  readonly kind: "fieldPreset";
107
107
  readonly output: {
108
108
  readonly codecId: "sql/char@1";
package/dist/control.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-M7Ejo4Lv.mjs";
1
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-CN60DEWb.mjs";
2
2
  import { t as SqlContractSerializer } from "./sql-contract-serializer-DlmNUCRw.mjs";
3
3
  import { a as contractToSchemaIR, c as extractCodecControlHooks, o as detectDestructiveChanges, s as resolveValueSetValues, t as verifySqlSchema } from "./verify-sql-schema-Dj8GrEZ-.mjs";
4
4
  import { t as collectSupportedCodecTypeIds } from "./verify-C-G0obRm.mjs";
package/dist/pack.d.mts CHANGED
@@ -6,7 +6,7 @@ declare const sqlFamilyPack: {
6
6
  readonly version: "0.0.1";
7
7
  readonly authoring: {
8
8
  readonly field: {
9
- readonly uuid: {
9
+ readonly uuidString: {
10
10
  readonly kind: "fieldPreset";
11
11
  readonly output: {
12
12
  readonly codecId: "sql/char@1";
@@ -75,7 +75,7 @@ declare const sqlFamilyPack: {
75
75
  };
76
76
  };
77
77
  readonly id: {
78
- readonly uuidv4: {
78
+ readonly uuidv4String: {
79
79
  readonly kind: "fieldPreset";
80
80
  readonly output: {
81
81
  readonly codecId: "sql/char@1";
@@ -92,7 +92,7 @@ declare const sqlFamilyPack: {
92
92
  readonly id: true;
93
93
  };
94
94
  };
95
- readonly uuidv7: {
95
+ readonly uuidv7String: {
96
96
  readonly kind: "fieldPreset";
97
97
  readonly output: {
98
98
  readonly codecId: "sql/char@1";
package/dist/pack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-M7Ejo4Lv.mjs";
1
+ import { i as sqlFamilyPslBlockDescriptors, n as sqlFamilyAuthoringFieldPresets, r as sqlFamilyEntityTypes, t as sqlFamilyAuthoringTypes } from "./authoring-type-constructors-CN60DEWb.mjs";
2
2
  //#region src/exports/pack.ts
3
3
  const sqlFamilyPack = {
4
4
  kind: "family",
package/package.json CHANGED
@@ -1,34 +1,34 @@
1
1
  {
2
2
  "name": "@prisma-next/family-sql",
3
- "version": "0.13.0-dev.19",
3
+ "version": "0.13.0-dev.20",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "description": "SQL family descriptor for Prisma Next",
8
8
  "dependencies": {
9
- "@prisma-next/contract": "0.13.0-dev.19",
10
- "@prisma-next/emitter": "0.13.0-dev.19",
11
- "@prisma-next/framework-components": "0.13.0-dev.19",
12
- "@prisma-next/migration-tools": "0.13.0-dev.19",
13
- "@prisma-next/operations": "0.13.0-dev.19",
14
- "@prisma-next/sql-contract": "0.13.0-dev.19",
15
- "@prisma-next/sql-contract-emitter": "0.13.0-dev.19",
16
- "@prisma-next/sql-contract-ts": "0.13.0-dev.19",
17
- "@prisma-next/sql-operations": "0.13.0-dev.19",
18
- "@prisma-next/sql-relational-core": "0.13.0-dev.19",
19
- "@prisma-next/sql-runtime": "0.13.0-dev.19",
20
- "@prisma-next/sql-schema-ir": "0.13.0-dev.19",
21
- "@prisma-next/utils": "0.13.0-dev.19",
9
+ "@prisma-next/contract": "0.13.0-dev.20",
10
+ "@prisma-next/emitter": "0.13.0-dev.20",
11
+ "@prisma-next/framework-components": "0.13.0-dev.20",
12
+ "@prisma-next/migration-tools": "0.13.0-dev.20",
13
+ "@prisma-next/operations": "0.13.0-dev.20",
14
+ "@prisma-next/sql-contract": "0.13.0-dev.20",
15
+ "@prisma-next/sql-contract-emitter": "0.13.0-dev.20",
16
+ "@prisma-next/sql-contract-ts": "0.13.0-dev.20",
17
+ "@prisma-next/sql-operations": "0.13.0-dev.20",
18
+ "@prisma-next/sql-relational-core": "0.13.0-dev.20",
19
+ "@prisma-next/sql-runtime": "0.13.0-dev.20",
20
+ "@prisma-next/sql-schema-ir": "0.13.0-dev.20",
21
+ "@prisma-next/utils": "0.13.0-dev.20",
22
22
  "arktype": "^2.2.0"
23
23
  },
24
24
  "devDependencies": {
25
- "@prisma-next/driver-postgres": "0.13.0-dev.19",
26
- "@prisma-next/psl-parser": "0.13.0-dev.19",
27
- "@prisma-next/psl-printer": "0.13.0-dev.19",
28
- "@prisma-next/sql-contract-psl": "0.13.0-dev.19",
29
- "@prisma-next/test-utils": "0.13.0-dev.19",
30
- "@prisma-next/tsconfig": "0.13.0-dev.19",
31
- "@prisma-next/tsdown": "0.13.0-dev.19",
25
+ "@prisma-next/driver-postgres": "0.13.0-dev.20",
26
+ "@prisma-next/psl-parser": "0.13.0-dev.20",
27
+ "@prisma-next/psl-printer": "0.13.0-dev.20",
28
+ "@prisma-next/sql-contract-psl": "0.13.0-dev.20",
29
+ "@prisma-next/test-utils": "0.13.0-dev.20",
30
+ "@prisma-next/tsconfig": "0.13.0-dev.20",
31
+ "@prisma-next/tsdown": "0.13.0-dev.20",
32
32
  "tsdown": "0.22.1",
33
33
  "typescript": "5.9.3",
34
34
  "vitest": "4.1.8"
@@ -9,6 +9,11 @@ import type { AuthoringFieldNamespace } from '@prisma-next/framework-components/
9
9
  * (`character`) regardless of target, and the PSL interpreter lets the
10
10
  * generator override the scalar descriptor.
11
11
  *
12
+ * The `uuidString` / `id.uuidv4String` / `id.uuidv7String` presets store UUID
13
+ * values as `character(36)` — portable across all SQL targets. For a native
14
+ * Postgres `uuid` column use `uuidNative` / `id.uuidv4Native` /
15
+ * `id.uuidv7Native` from `@prisma-next/target-postgres`.
16
+ *
12
17
  * Scalar presets that map to target-specific codecs (e.g. `text`, `int`,
13
18
  * `boolean`, `dateTime`) are contributed by the target pack (see
14
19
  * `postgresAuthoringFieldPresets` in `@prisma-next/target-postgres`) so the
@@ -34,7 +39,7 @@ const nanoidOptionsArgument = {
34
39
  } as const;
35
40
 
36
41
  export const sqlFamilyAuthoringFieldPresets = {
37
- uuid: {
42
+ uuidString: {
38
43
  kind: 'fieldPreset',
39
44
  output: {
40
45
  codecId: CHARACTER_CODEC_ID,
@@ -91,7 +96,7 @@ export const sqlFamilyAuthoringFieldPresets = {
91
96
  },
92
97
  },
93
98
  id: {
94
- uuidv4: {
99
+ uuidv4String: {
95
100
  kind: 'fieldPreset',
96
101
  output: {
97
102
  codecId: CHARACTER_CODEC_ID,
@@ -108,7 +113,7 @@ export const sqlFamilyAuthoringFieldPresets = {
108
113
  id: true,
109
114
  },
110
115
  },
111
- uuidv7: {
116
+ uuidv7String: {
112
117
  kind: 'fieldPreset',
113
118
  output: {
114
119
  codecId: CHARACTER_CODEC_ID,
@@ -1 +0,0 @@
1
- {"version":3,"file":"authoring-type-constructors-M7Ejo4Lv.mjs","names":[],"sources":["../src/core/authoring-entity-types.ts","../src/core/authoring-field-presets.ts","../src/core/authoring-type-constructors.ts"],"sourcesContent":["import type { JsonValue } from '@prisma-next/contract/types';\nimport type {\n AuthoringEntityContext,\n AuthoringEntityTypeDescriptor,\n AuthoringEntityTypeNamespace,\n AuthoringPslBlockDescriptorNamespace,\n PslExtensionBlock,\n} from '@prisma-next/framework-components/authoring';\nimport { type EnumTypeHandle, enumType } from '@prisma-next/sql-contract-ts/contract-builder';\nimport { blindCast } from '@prisma-next/utils/casts';\n\nfunction parseQuotedString(raw: string): string | undefined {\n if (raw.startsWith('\"') && raw.endsWith('\"') && raw.length >= 2) {\n return raw.slice(1, -1);\n }\n return undefined;\n}\n\nexport const sqlFamilyEnum2EntityDescriptor = {\n kind: 'entity' as const,\n discriminator: 'enum2',\n output: {\n factory: (\n block: PslExtensionBlock,\n ctx: AuthoringEntityContext,\n ): EnumTypeHandle | undefined => {\n const sourceId = ctx.sourceId ?? 'unknown';\n const diagnostics = ctx.diagnostics;\n\n const typeAttr = block.blockAttributes.find((a) => a.name === 'type');\n if (!typeAttr) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" is missing a @@type(\"codecId\") attribute`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n const rawCodecArg = typeAttr.args[0]?.value;\n const codecId = rawCodecArg !== undefined ? parseQuotedString(rawCodecArg) : undefined;\n if (!codecId) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" @@type attribute must have a quoted codec id argument`,\n sourceId,\n span: typeAttr.span,\n });\n return undefined;\n }\n\n const nativeType = ctx.codecLookup?.targetTypesFor(codecId)?.[0];\n if (nativeType === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type references unknown codec \"${codecId}\"`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const codec = ctx.codecLookup?.get(codecId);\n if (codec === undefined) {\n const typeArgSpan = typeAttr.args[0]?.span ?? typeAttr.span;\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" @@type codec \"${codecId}\" resolves in targetTypesFor but is absent from codecLookup.get`,\n sourceId,\n span: typeArgSpan,\n });\n return undefined;\n }\n\n const seenValues = new Set<string>();\n const members: { name: string; value: unknown }[] = [];\n let memberError = false;\n\n for (const [memberName, paramValue] of Object.entries(block.parameters)) {\n let value: unknown;\n if (paramValue.kind === 'bare') {\n try {\n value = codec.decodeJson(memberName);\n } catch {\n diagnostics?.push({\n code: 'PSL_ENUM2_BARE_MEMBER_NON_STRING_CODEC',\n message: `enum2 \"${block.name}\" member \"${memberName}\" has no value and codec \"${codecId}\" does not accept a bare name as input`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else if (paramValue.kind === 'value') {\n let jsonValue: unknown;\n try {\n jsonValue = JSON.parse(paramValue.raw);\n } catch {\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" value \"${paramValue.raw}\" is not valid JSON`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n try {\n value = codec.decodeJson(\n blindCast<JsonValue, 'JSON.parse returns a JsonValue-compatible value'>(jsonValue),\n );\n } catch (err) {\n const reason = err instanceof Error ? err.message : String(err);\n diagnostics?.push({\n code: 'PSL_EXTENSION_INVALID_VALUE',\n message: `enum2 \"${block.name}\" member \"${memberName}\" was rejected by codec \"${codecId}\": ${reason}`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n } else {\n continue;\n }\n\n const valueKey = String(value);\n if (seenValues.has(valueKey)) {\n diagnostics?.push({\n code: 'PSL_ENUM2_DUPLICATE_MEMBER_VALUE',\n message: `enum2 \"${block.name}\": duplicate member value \"${valueKey}\"`,\n sourceId,\n span: paramValue.span,\n });\n memberError = true;\n continue;\n }\n seenValues.add(valueKey);\n members.push({ name: memberName, value });\n }\n\n if (memberError) return undefined;\n\n if (members.length === 0) {\n diagnostics?.push({\n code: 'PSL_ENUM2_MISSING_TYPE',\n message: `enum2 \"${block.name}\" must have at least one member`,\n sourceId,\n span: block.span,\n });\n return undefined;\n }\n\n return enumType(\n block.name,\n { codecId, nativeType },\n ...members.map((m) => ({ name: m.name, value: m.value })),\n );\n },\n },\n} satisfies AuthoringEntityTypeDescriptor;\n\nexport const sqlFamilyEntityTypes: AuthoringEntityTypeNamespace = {\n enum2: sqlFamilyEnum2EntityDescriptor,\n};\n\nexport const sqlFamilyPslBlockDescriptors = {\n enum2: {\n kind: 'pslBlock',\n keyword: 'enum2',\n discriminator: 'enum2',\n name: { required: true },\n parameters: {},\n variadicParameters: true,\n },\n} as const satisfies AuthoringPslBlockDescriptorNamespace;\n","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":";;;AAWA,SAAS,kBAAkB,KAAiC;CAC1D,IAAI,IAAI,WAAW,IAAG,KAAK,IAAI,SAAS,IAAG,KAAK,IAAI,UAAU,GAC5D,OAAO,IAAI,MAAM,GAAG,EAAE;AAG1B;AAoJA,MAAa,uBAAqD,EAChE,OAAO;CAlJP,MAAM;CACN,eAAe;CACf,QAAQ,EACN,UACE,OACA,QAC+B;EAC/B,MAAM,WAAW,IAAI,YAAY;EACjC,MAAM,cAAc,IAAI;EAExB,MAAM,WAAW,MAAM,gBAAgB,MAAM,MAAM,E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