rads-db 3.2.38 → 3.2.39
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/integrations/node.cjs +1 -1
- package/integrations/node.mjs +2 -1
- package/package.json +1 -1
package/integrations/node.cjs
CHANGED
|
@@ -174,7 +174,7 @@ function getEntityTypesStrFromSchema(schema) {
|
|
|
174
174
|
if (type.isExtending && schema[type.isExtending]?.fields?.[f.name]) return "";
|
|
175
175
|
let fieldTypeStr = f.type;
|
|
176
176
|
if (f.isChange) fieldTypeStr = `Change<${fieldTypeStr}>`;
|
|
177
|
-
if (f.isRelation) fieldTypeStr = `Relation<${fieldTypeStr}>`;
|
|
177
|
+
if (f.isRelation) fieldTypeStr = `Relation<${fieldTypeStr}${f.relationDenormFields?.length ? `, ${f.relationDenormFields.map(x => `'${x}'`).join(" | ")}` : ""}>`;
|
|
178
178
|
if (f.isArray) fieldTypeStr = `${fieldTypeStr}[]`;
|
|
179
179
|
const fieldStr = ` ${f.name}${f.isRequired ? "" : "?"}: ${fieldTypeStr}`;
|
|
180
180
|
const commentStr2 = f.comment ? ` /** ${f.comment} */` : "";
|
package/integrations/node.mjs
CHANGED
|
@@ -185,7 +185,8 @@ export function getEntityTypesStrFromSchema(schema) {
|
|
|
185
185
|
if (type.isExtending && schema[type.isExtending]?.fields?.[f.name]) return "";
|
|
186
186
|
let fieldTypeStr = f.type;
|
|
187
187
|
if (f.isChange) fieldTypeStr = `Change<${fieldTypeStr}>`;
|
|
188
|
-
if (f.isRelation)
|
|
188
|
+
if (f.isRelation)
|
|
189
|
+
fieldTypeStr = `Relation<${fieldTypeStr}${f.relationDenormFields?.length ? `, ${f.relationDenormFields.map((x) => `'${x}'`).join(" | ")}` : ""}>`;
|
|
189
190
|
if (f.isArray) fieldTypeStr = `${fieldTypeStr}[]`;
|
|
190
191
|
const fieldStr = ` ${f.name}${f.isRequired ? "" : "?"}: ${fieldTypeStr}`;
|
|
191
192
|
const commentStr2 = f.comment ? ` /** ${f.comment} */` : "";
|