@prisma-next/sql-contract-psl 0.13.0-dev.28 → 0.13.0-dev.29
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.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{interpreter-BT6dEGeD.mjs → interpreter-B0BsCLKT.mjs} +33 -144
- package/dist/interpreter-B0BsCLKT.mjs.map +1 -0
- package/dist/provider.d.mts +1 -1
- package/dist/provider.mjs +1 -1
- package/package.json +12 -12
- package/src/interpreter.ts +36 -204
- package/src/psl-field-resolution.ts +10 -10
- package/dist/interpreter-BT6dEGeD.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Contract } from "@prisma-next/contract/types";
|
|
2
2
|
import { AuthoringContributions } from "@prisma-next/framework-components/authoring";
|
|
3
|
-
import { SqlNamespaceTablesInput } from "@prisma-next/sql-contract/types";
|
|
4
3
|
import { Result } from "@prisma-next/utils/result";
|
|
5
4
|
import { ParsePslDocumentResult } from "@prisma-next/psl-parser";
|
|
6
5
|
import { ControlMutationDefaults, ControlMutationDefaults as ControlMutationDefaults$1, DefaultFunctionLoweringContext, DefaultFunctionLoweringHandler, DefaultFunctionRegistry, DefaultFunctionRegistryEntry, MutationDefaultGeneratorDescriptor } from "@prisma-next/framework-components/control";
|
|
@@ -8,6 +7,7 @@ import { ContractSourceDiagnostics } from "@prisma-next/config/config-types";
|
|
|
8
7
|
import { CodecLookup } from "@prisma-next/framework-components/codec";
|
|
9
8
|
import { ExtensionPackRef, TargetPackRef } from "@prisma-next/framework-components/components";
|
|
10
9
|
import { Namespace } from "@prisma-next/framework-components/ir";
|
|
10
|
+
import { SqlNamespaceTablesInput } from "@prisma-next/sql-contract/types";
|
|
11
11
|
|
|
12
12
|
//#region src/psl-column-resolution.d.ts
|
|
13
13
|
type ColumnDescriptor = {
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/psl-column-resolution.ts","../src/interpreter.ts"],"mappings":";;;;;;;;;;;;KA0CY,gBAAA;EAAA,SACD,OAAA;EAAA,SACA,UAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA,GAAa,MAAM;AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/psl-column-resolution.ts","../src/interpreter.ts"],"mappings":";;;;;;;;;;;;KA0CY,gBAAA;EAAA,SACD,OAAA;EAAA,SACA,UAAA;EAAA,SACA,OAAA;EAAA,SACA,UAAA,GAAa,MAAM;AAAA;;;UCmDb,sCAAA;EAAA,SACN,QAAA,EAAU,sBAAA;EAAA,SACV,MAAA,EAAQ,aAAA;EAAA,SACR,qBAAA,EAAuB,WAAA,SAAoB,gBAAA;EAAA,SAC3C,sBAAA;EAAA,SACA,yBAAA,YAAqC,gBAAA;EAAA,SACrC,uBAAA,GAA0B,yBAAA;EAAA,SAC1B,sBAAA,GAAyB,sBAAA;ED1DzB;;;AAAmB;;;;ACmD9B;;EDnDW,SCoEA,0BAAA,EAA4B,WAAA,SAAoB,QAAA;EAhBtC;;;;;;;;;EAAA,SA0BV,eAAA,IAAmB,KAAA,EAAO,uBAAA,KAA4B,SAAA;EAAA,SACtD,WAAA,GAAc,WAAA;AAAA;AAAA,iBA+rDT,iCAAA,CACd,KAAA,EAAO,sCAAA,GACN,MAAA,CAAO,QAAA,EAAU,yBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as interpretPslDocumentToSqlContract } from "./interpreter-
|
|
1
|
+
import { t as interpretPslDocumentToSqlContract } from "./interpreter-B0BsCLKT.mjs";
|
|
2
2
|
export { interpretPslDocumentToSqlContract };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { crossRef } from "@prisma-next/contract/types";
|
|
2
2
|
import { hasRegisteredFieldNamespace, instantiateAuthoringEntityType, instantiateAuthoringFieldPreset, instantiateAuthoringTypeConstructor, isAuthoringEntityTypeDescriptor, isAuthoringFieldPresetDescriptor, isAuthoringTypeConstructorDescriptor, validateAuthoringHelperArguments } from "@prisma-next/framework-components/authoring";
|
|
3
3
|
import { namespacePslExtensionBlocks } from "@prisma-next/framework-components/psl-ast";
|
|
4
|
-
import { isPostgresEnumStorageEntry } from "@prisma-next/sql-contract/types";
|
|
5
4
|
import { buildSqlContractFromDefinition } from "@prisma-next/sql-contract-ts/contract-builder";
|
|
6
5
|
import { blindCast } from "@prisma-next/utils/casts";
|
|
7
6
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
@@ -1309,7 +1308,7 @@ function resolveColumnDescriptor(field, enumTypeDescriptors, namedTypeDescriptor
|
|
|
1309
1308
|
}
|
|
1310
1309
|
//#endregion
|
|
1311
1310
|
//#region src/psl-field-resolution.ts
|
|
1312
|
-
function
|
|
1311
|
+
function lowerEnumDefaultForField(input) {
|
|
1313
1312
|
const expressionEntry = getPositionalArgumentEntry(input.defaultAttribute);
|
|
1314
1313
|
if (!expressionEntry) return {};
|
|
1315
1314
|
const raw = expressionEntry.value.trim();
|
|
@@ -1317,8 +1316,8 @@ function lowerEnum2DefaultForField(input) {
|
|
|
1317
1316
|
const isFunctionCall = raw.includes("(") && raw.endsWith(")");
|
|
1318
1317
|
if (isQuotedString || isFunctionCall) {
|
|
1319
1318
|
input.diagnostics.push({
|
|
1320
|
-
code: "
|
|
1321
|
-
message: `Field "${input.modelName}.${input.fieldName}" @default on an
|
|
1319
|
+
code: "PSL_ENUM_DEFAULT_MUST_BE_MEMBER_NAME",
|
|
1320
|
+
message: `Field "${input.modelName}.${input.fieldName}" @default on an enum field must name a member (e.g. @default(Low)), not a raw value or function.`,
|
|
1322
1321
|
sourceId: input.sourceId,
|
|
1323
1322
|
span: input.defaultAttribute.span
|
|
1324
1323
|
});
|
|
@@ -1328,7 +1327,7 @@ function lowerEnum2DefaultForField(input) {
|
|
|
1328
1327
|
if (!match) {
|
|
1329
1328
|
const validNames = input.enumHandle.enumMembers.map((m) => m.name).join(", ");
|
|
1330
1329
|
input.diagnostics.push({
|
|
1331
|
-
code: "
|
|
1330
|
+
code: "PSL_ENUM_UNKNOWN_DEFAULT_MEMBER",
|
|
1332
1331
|
message: `Field "${input.modelName}.${input.fieldName}" @default(${raw}) does not name a member of ${input.enumHandle.enumName}. Valid members: ${validNames}.`,
|
|
1333
1332
|
sourceId: input.sourceId,
|
|
1334
1333
|
span: input.defaultAttribute.span
|
|
@@ -1413,7 +1412,7 @@ function extractFieldConstraintNames(input) {
|
|
|
1413
1412
|
};
|
|
1414
1413
|
}
|
|
1415
1414
|
function collectResolvedFields(input) {
|
|
1416
|
-
const { model, mapping, enumTypeDescriptors, namedTypeDescriptors, modelNames, compositeTypeNames, composedExtensions, authoringContributions, familyId, targetId, defaultFunctionRegistry, generatorDescriptorById, diagnostics, sourceId, scalarTypeDescriptors,
|
|
1415
|
+
const { model, mapping, enumTypeDescriptors, namedTypeDescriptors, modelNames, compositeTypeNames, composedExtensions, authoringContributions, familyId, targetId, defaultFunctionRegistry, generatorDescriptorById, diagnostics, sourceId, scalarTypeDescriptors, enumHandles } = input;
|
|
1417
1416
|
const resolvedFields = [];
|
|
1418
1417
|
for (const field of model.fields) {
|
|
1419
1418
|
const isModelField = modelNames.has(field.typeName);
|
|
@@ -1506,12 +1505,12 @@ function collectResolvedFields(input) {
|
|
|
1506
1505
|
});
|
|
1507
1506
|
continue;
|
|
1508
1507
|
}
|
|
1509
|
-
const
|
|
1510
|
-
const loweredDefault = defaultAttribute ?
|
|
1508
|
+
const enumHandle = enumHandles?.get(field.typeName);
|
|
1509
|
+
const loweredDefault = defaultAttribute ? enumHandle ? lowerEnumDefaultForField({
|
|
1511
1510
|
modelName: model.name,
|
|
1512
1511
|
fieldName: field.name,
|
|
1513
1512
|
defaultAttribute,
|
|
1514
|
-
enumHandle
|
|
1513
|
+
enumHandle,
|
|
1515
1514
|
sourceId,
|
|
1516
1515
|
diagnostics
|
|
1517
1516
|
}) : lowerDefaultForField({
|
|
@@ -1984,73 +1983,17 @@ function validateNamespaceBlocksForSqlTarget(input) {
|
|
|
1984
1983
|
}
|
|
1985
1984
|
}
|
|
1986
1985
|
function processEnumDeclarations(input) {
|
|
1987
|
-
const storageTypes = {};
|
|
1988
|
-
const enumTypeDescriptors = /* @__PURE__ */ new Map();
|
|
1989
|
-
if (input.enums.length === 0) return {
|
|
1990
|
-
storageTypes,
|
|
1991
|
-
enumTypeDescriptors
|
|
1992
|
-
};
|
|
1993
|
-
if (!input.enumEntityDescriptor) {
|
|
1994
|
-
for (const enumDeclaration of input.enums) input.diagnostics.push({
|
|
1995
|
-
code: "PSL_UNSUPPORTED_NAMED_TYPE_BASE",
|
|
1996
|
-
message: `Enum "${enumDeclaration.name}" requires the active target pack to contribute an enum entity-type helper`,
|
|
1997
|
-
sourceId: input.sourceId,
|
|
1998
|
-
span: enumDeclaration.span
|
|
1999
|
-
});
|
|
2000
|
-
return {
|
|
2001
|
-
storageTypes,
|
|
2002
|
-
enumTypeDescriptors
|
|
2003
|
-
};
|
|
2004
|
-
}
|
|
2005
|
-
for (const enumDeclaration of input.enums) {
|
|
2006
|
-
const nativeType = parseMapName({
|
|
2007
|
-
attribute: getAttribute(enumDeclaration.attributes, "map"),
|
|
2008
|
-
defaultValue: enumDeclaration.name,
|
|
2009
|
-
sourceId: input.sourceId,
|
|
2010
|
-
diagnostics: input.diagnostics,
|
|
2011
|
-
entityLabel: `Enum "${enumDeclaration.name}"`,
|
|
2012
|
-
span: enumDeclaration.span
|
|
2013
|
-
});
|
|
2014
|
-
const values = enumDeclaration.values.map((value) => value.name);
|
|
2015
|
-
const constructed = instantiateAuthoringEntityType("enum", input.enumEntityDescriptor, [{
|
|
2016
|
-
name: enumDeclaration.name,
|
|
2017
|
-
nativeType,
|
|
2018
|
-
values
|
|
2019
|
-
}], input.entityContext);
|
|
2020
|
-
if (!isPostgresEnumStorageEntry(constructed)) {
|
|
2021
|
-
input.diagnostics.push({
|
|
2022
|
-
code: "PSL_UNSUPPORTED_NAMED_TYPE_BASE",
|
|
2023
|
-
message: `Enum "${enumDeclaration.name}": enum entity-type factory must return a PostgresEnumStorageEntry-shaped value (kind: 'postgres-enum')`,
|
|
2024
|
-
sourceId: input.sourceId,
|
|
2025
|
-
span: enumDeclaration.span
|
|
2026
|
-
});
|
|
2027
|
-
continue;
|
|
2028
|
-
}
|
|
2029
|
-
const descriptor = {
|
|
2030
|
-
codecId: constructed.codecId,
|
|
2031
|
-
nativeType: constructed.nativeType,
|
|
2032
|
-
typeRef: enumDeclaration.name
|
|
2033
|
-
};
|
|
2034
|
-
enumTypeDescriptors.set(enumDeclaration.name, descriptor);
|
|
2035
|
-
storageTypes[enumDeclaration.name] = constructed;
|
|
2036
|
-
}
|
|
2037
|
-
return {
|
|
2038
|
-
storageTypes,
|
|
2039
|
-
enumTypeDescriptors
|
|
2040
|
-
};
|
|
2041
|
-
}
|
|
2042
|
-
function processEnum2Declarations(input) {
|
|
2043
1986
|
const enumHandles = {};
|
|
2044
1987
|
const enumTypeDescriptors = /* @__PURE__ */ new Map();
|
|
2045
|
-
if (input.
|
|
1988
|
+
if (input.enumBlocks.length === 0) return {
|
|
2046
1989
|
enumHandles,
|
|
2047
1990
|
enumTypeDescriptors
|
|
2048
1991
|
};
|
|
2049
|
-
const
|
|
2050
|
-
if (!
|
|
2051
|
-
for (const decl of input.
|
|
2052
|
-
code: "
|
|
2053
|
-
message: `
|
|
1992
|
+
const enumDescriptor = getAuthoringEntity(input.authoringContributions, ["enum"]);
|
|
1993
|
+
if (!enumDescriptor) {
|
|
1994
|
+
for (const decl of input.enumBlocks) input.diagnostics.push({
|
|
1995
|
+
code: "PSL_ENUM_MISSING_FACTORY",
|
|
1996
|
+
message: `enum "${decl.name}" requires an "enum" entityType factory in the active authoring contributions`,
|
|
2054
1997
|
sourceId: input.sourceId,
|
|
2055
1998
|
span: decl.span
|
|
2056
1999
|
});
|
|
@@ -2059,8 +2002,8 @@ function processEnum2Declarations(input) {
|
|
|
2059
2002
|
enumTypeDescriptors
|
|
2060
2003
|
};
|
|
2061
2004
|
}
|
|
2062
|
-
for (const decl of input.
|
|
2063
|
-
const handle = instantiateAuthoringEntityType("
|
|
2005
|
+
for (const decl of input.enumBlocks) {
|
|
2006
|
+
const handle = instantiateAuthoringEntityType("enum", enumDescriptor, [decl], input.entityContext);
|
|
2064
2007
|
if (handle === void 0 || handle === null) continue;
|
|
2065
2008
|
const enumHandle = blindCast(handle);
|
|
2066
2009
|
enumHandles[decl.name] = enumHandle;
|
|
@@ -2246,7 +2189,7 @@ function buildModelNodeFromPsl(input) {
|
|
|
2246
2189
|
diagnostics,
|
|
2247
2190
|
sourceId,
|
|
2248
2191
|
scalarTypeDescriptors: input.scalarTypeDescriptors,
|
|
2249
|
-
...ifDefined("
|
|
2192
|
+
...ifDefined("enumHandles", input.enumHandles)
|
|
2250
2193
|
});
|
|
2251
2194
|
const inlineIdFields = resolvedFields.filter((field) => field.isId);
|
|
2252
2195
|
if (inlineIdFields.length > 1) diagnostics.push({
|
|
@@ -2788,7 +2731,7 @@ function buildModelNodeFromPsl(input) {
|
|
|
2788
2731
|
modelName: model.name,
|
|
2789
2732
|
tableName,
|
|
2790
2733
|
fields: resolvedFields.map((resolvedField) => {
|
|
2791
|
-
const enumHandle = input.
|
|
2734
|
+
const enumHandle = input.enumHandles?.get(resolvedField.field.typeName);
|
|
2792
2735
|
return {
|
|
2793
2736
|
fieldName: resolvedField.field.name,
|
|
2794
2737
|
columnName: resolvedField.columnName,
|
|
@@ -3270,18 +3213,6 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3270
3213
|
}
|
|
3271
3214
|
}
|
|
3272
3215
|
const defaultNamespaceId = input.target.defaultNamespaceId;
|
|
3273
|
-
const topLevelEnums = input.document.ast.namespaces.filter((ns) => ns.name === UNSPECIFIED_PSL_NAMESPACE_NAME).flatMap((ns) => ns.enums);
|
|
3274
|
-
const namedNamespaceEnumsByNsId = /* @__PURE__ */ new Map();
|
|
3275
|
-
for (const ns of input.document.ast.namespaces) {
|
|
3276
|
-
if (ns.name === UNSPECIFIED_PSL_NAMESPACE_NAME || ns.enums.length === 0) continue;
|
|
3277
|
-
const resolvedId = resolveNamespaceIdForSqlTarget({
|
|
3278
|
-
bucketName: ns.name,
|
|
3279
|
-
targetId: input.target.targetId
|
|
3280
|
-
});
|
|
3281
|
-
if (resolvedId === void 0) continue;
|
|
3282
|
-
const existing = namedNamespaceEnumsByNsId.get(resolvedId) ?? [];
|
|
3283
|
-
namedNamespaceEnumsByNsId.set(resolvedId, [...existing, ...ns.enums]);
|
|
3284
|
-
}
|
|
3285
3216
|
const compositeTypes = input.document.ast.namespaces.flatMap((ns) => ns.compositeTypes);
|
|
3286
3217
|
const modelNames = new Set(models.map((model) => model.name));
|
|
3287
3218
|
const compositeTypeNames = new Set(compositeTypes.map((ct) => ct.name));
|
|
@@ -3291,47 +3222,20 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3291
3222
|
const generatorDescriptors = input.controlMutationDefaults?.generatorDescriptors ?? [];
|
|
3292
3223
|
const generatorDescriptorById = /* @__PURE__ */ new Map();
|
|
3293
3224
|
for (const descriptor of generatorDescriptors) generatorDescriptorById.set(descriptor.id, descriptor);
|
|
3294
|
-
const
|
|
3295
|
-
const enumEntityContext = {
|
|
3296
|
-
family: input.target.familyId,
|
|
3297
|
-
target: input.target.targetId
|
|
3298
|
-
};
|
|
3299
|
-
const enumResult = processEnumDeclarations({
|
|
3300
|
-
enums: topLevelEnums,
|
|
3301
|
-
sourceId,
|
|
3302
|
-
enumEntityDescriptor,
|
|
3303
|
-
entityContext: enumEntityContext,
|
|
3304
|
-
diagnostics
|
|
3305
|
-
});
|
|
3306
|
-
const allEnumTypeDescriptors = new Map(enumResult.enumTypeDescriptors);
|
|
3307
|
-
const namespaceEnumStorageTypes = {};
|
|
3308
|
-
for (const [nsId, nsEnums] of namedNamespaceEnumsByNsId) {
|
|
3309
|
-
const nsEnumResult = processEnumDeclarations({
|
|
3310
|
-
enums: nsEnums,
|
|
3311
|
-
sourceId,
|
|
3312
|
-
enumEntityDescriptor,
|
|
3313
|
-
entityContext: enumEntityContext,
|
|
3314
|
-
diagnostics
|
|
3315
|
-
});
|
|
3316
|
-
for (const [name, descriptor] of nsEnumResult.enumTypeDescriptors) allEnumTypeDescriptors.set(name, descriptor);
|
|
3317
|
-
const nsEntries = {};
|
|
3318
|
-
for (const [name, entry] of Object.entries(nsEnumResult.storageTypes)) if (isPostgresEnumStorageEntry(entry)) nsEntries[name] = entry;
|
|
3319
|
-
if (Object.keys(nsEntries).length > 0) namespaceEnumStorageTypes[nsId] = nsEntries;
|
|
3320
|
-
}
|
|
3321
|
-
const topLevelEnum2s = input.document.ast.namespaces.filter((ns) => ns.name === UNSPECIFIED_PSL_NAMESPACE_NAME).flatMap((ns) => namespacePslExtensionBlocks(ns).filter((b) => b.kind === "enum2"));
|
|
3225
|
+
const topLevelEnums = input.document.ast.namespaces.filter((ns) => ns.name === UNSPECIFIED_PSL_NAMESPACE_NAME).flatMap((ns) => namespacePslExtensionBlocks(ns).filter((b) => b.kind === "enum"));
|
|
3322
3226
|
for (const ns of input.document.ast.namespaces) {
|
|
3323
3227
|
if (ns.name === UNSPECIFIED_PSL_NAMESPACE_NAME) continue;
|
|
3324
|
-
const
|
|
3325
|
-
if (
|
|
3326
|
-
for (const decl of
|
|
3327
|
-
code: "
|
|
3328
|
-
message: `
|
|
3228
|
+
const nsEnums = namespacePslExtensionBlocks(ns).filter((b) => b.kind === "enum");
|
|
3229
|
+
if (nsEnums.length === 0) continue;
|
|
3230
|
+
for (const decl of nsEnums) diagnostics.push({
|
|
3231
|
+
code: "PSL_ENUM_NAMESPACE_NOT_SUPPORTED",
|
|
3232
|
+
message: `enum "${decl.name}" inside namespace "${ns.name}" is not supported; declare enum at the top level`,
|
|
3329
3233
|
sourceId,
|
|
3330
3234
|
span: decl.span
|
|
3331
3235
|
});
|
|
3332
3236
|
}
|
|
3333
|
-
const
|
|
3334
|
-
|
|
3237
|
+
const enumResult = processEnumDeclarations({
|
|
3238
|
+
enumBlocks: topLevelEnums,
|
|
3335
3239
|
sourceId,
|
|
3336
3240
|
authoringContributions: input.authoringContributions,
|
|
3337
3241
|
entityContext: {
|
|
@@ -3345,20 +3249,9 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3345
3249
|
},
|
|
3346
3250
|
diagnostics
|
|
3347
3251
|
});
|
|
3348
|
-
const
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
const collision = topLevelEnum2s.find((e) => e.name === name);
|
|
3352
|
-
diagnostics.push({
|
|
3353
|
-
code: "PSL_ENUM2_DUPLICATE_TYPE_NAME",
|
|
3354
|
-
message: `enum2 "${name}" collides with an existing type name; each type name must be unique`,
|
|
3355
|
-
sourceId,
|
|
3356
|
-
...ifDefined("span", collision?.span)
|
|
3357
|
-
});
|
|
3358
|
-
} else allEnumTypeDescriptors.set(name, descriptor);
|
|
3359
|
-
const validEnum2Handles = {};
|
|
3360
|
-
for (const [name, handle] of Object.entries(enum2Result.enumHandles)) if (!collidingEnum2Names.has(name)) validEnum2Handles[name] = handle;
|
|
3361
|
-
const enum2HandlesByName = new Map(Object.entries(validEnum2Handles));
|
|
3252
|
+
const allEnumTypeDescriptors = new Map(enumResult.enumTypeDescriptors);
|
|
3253
|
+
const validEnumHandles = { ...enumResult.enumHandles };
|
|
3254
|
+
const enumHandlesByName = new Map(Object.entries(validEnumHandles));
|
|
3362
3255
|
const namedTypeResult = resolveNamedTypeDeclarations({
|
|
3363
3256
|
declarations: input.document.ast.types?.declarations ?? [],
|
|
3364
3257
|
sourceId,
|
|
@@ -3370,10 +3263,7 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3370
3263
|
authoringContributions: input.authoringContributions,
|
|
3371
3264
|
diagnostics
|
|
3372
3265
|
});
|
|
3373
|
-
const storageTypes = {
|
|
3374
|
-
...enumResult.storageTypes,
|
|
3375
|
-
...namedTypeResult.storageTypes
|
|
3376
|
-
};
|
|
3266
|
+
const storageTypes = { ...namedTypeResult.storageTypes };
|
|
3377
3267
|
const modelMappingsByCoordinate = buildModelMappings(modelEntries, defaultNamespaceId, diagnostics, sourceId);
|
|
3378
3268
|
const modelMappings = /* @__PURE__ */ new Map();
|
|
3379
3269
|
for (const mapping of modelMappingsByCoordinate.values()) modelMappings.set(mapping.model.name, mapping);
|
|
@@ -3406,7 +3296,7 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3406
3296
|
sourceId,
|
|
3407
3297
|
diagnostics,
|
|
3408
3298
|
modelNamespaceIds,
|
|
3409
|
-
...
|
|
3299
|
+
...enumHandlesByName.size > 0 ? { enumHandles: enumHandlesByName } : {}
|
|
3410
3300
|
});
|
|
3411
3301
|
modelNodes.push(namespaceId !== void 0 ? {
|
|
3412
3302
|
...result.modelNode,
|
|
@@ -3458,8 +3348,7 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3458
3348
|
target: input.target,
|
|
3459
3349
|
...ifDefined("extensionPacks", buildComposedExtensionPackRefs(input.target, [...composedExtensions].sort(compareStrings), input.composedExtensionPackRefs)),
|
|
3460
3350
|
...Object.keys(storageTypes).length > 0 ? { storageTypes } : {},
|
|
3461
|
-
...Object.keys(
|
|
3462
|
-
...Object.keys(validEnum2Handles).length > 0 ? { enums: validEnum2Handles } : {},
|
|
3351
|
+
...Object.keys(validEnumHandles).length > 0 ? { enums: validEnumHandles } : {},
|
|
3463
3352
|
...ifDefined("createNamespace", input.createNamespace),
|
|
3464
3353
|
models: stiColumnModelNodes.map((model) => ({
|
|
3465
3354
|
...model,
|
|
@@ -3495,4 +3384,4 @@ function interpretPslDocumentToSqlContract(input) {
|
|
|
3495
3384
|
//#endregion
|
|
3496
3385
|
export { interpretPslDocumentToSqlContract as t };
|
|
3497
3386
|
|
|
3498
|
-
//# sourceMappingURL=interpreter-
|
|
3387
|
+
//# sourceMappingURL=interpreter-B0BsCLKT.mjs.map
|