rads-db 3.0.63 → 3.0.66
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 +2 -2
- package/integrations/node.mjs +2 -2
- package/package.json +1 -1
package/integrations/node.cjs
CHANGED
|
@@ -139,7 +139,7 @@ ${whereFields.join("\n")}
|
|
|
139
139
|
}
|
|
140
140
|
`.trim()).join("\n");
|
|
141
141
|
return `
|
|
142
|
-
import type { EntityMethods, FileUploadArgs, RadsRequestContext, WhereJsonContains } from 'rads-db'
|
|
142
|
+
import type { EntityMethods, FileUploadArgs, RadsRequestContext, WhereJsonContains, Relation, Change } from 'rads-db'
|
|
143
143
|
${imports.join("\n")}
|
|
144
144
|
${schemaTypesStr}
|
|
145
145
|
|
|
@@ -175,7 +175,7 @@ function getEntityTypesStrFromSchema(schema) {
|
|
|
175
175
|
if (f.isChange) fieldTypeStr = `Change<${fieldTypeStr}>`;
|
|
176
176
|
if (f.isRelation) fieldTypeStr = `Relation<${fieldTypeStr}>`;
|
|
177
177
|
if (f.isArray) fieldTypeStr = `${fieldTypeStr}[]`;
|
|
178
|
-
const fieldStr = ` ${f.name}${f.isRequired ? "
|
|
178
|
+
const fieldStr = ` ${f.name}${f.isRequired ? "" : "?"}: ${fieldTypeStr}`;
|
|
179
179
|
const commentStr2 = f.comment ? ` /** ${f.comment} */` : "";
|
|
180
180
|
return [fieldStr, commentStr2].filter(x => x).join("\n");
|
|
181
181
|
}).filter(x => x).join("\n");
|
package/integrations/node.mjs
CHANGED
|
@@ -139,7 +139,7 @@ ${whereFields.join("\n")}
|
|
|
139
139
|
`.trim()
|
|
140
140
|
).join("\n");
|
|
141
141
|
return `
|
|
142
|
-
import type { EntityMethods, FileUploadArgs, RadsRequestContext, WhereJsonContains } from 'rads-db'
|
|
142
|
+
import type { EntityMethods, FileUploadArgs, RadsRequestContext, WhereJsonContains, Relation, Change } from 'rads-db'
|
|
143
143
|
${imports.join("\n")}
|
|
144
144
|
${schemaTypesStr}
|
|
145
145
|
|
|
@@ -181,7 +181,7 @@ export function getEntityTypesStrFromSchema(schema) {
|
|
|
181
181
|
fieldTypeStr = `Relation<${fieldTypeStr}>`;
|
|
182
182
|
if (f.isArray)
|
|
183
183
|
fieldTypeStr = `${fieldTypeStr}[]`;
|
|
184
|
-
const fieldStr = ` ${f.name}${f.isRequired ? "
|
|
184
|
+
const fieldStr = ` ${f.name}${f.isRequired ? "" : "?"}: ${fieldTypeStr}`;
|
|
185
185
|
const commentStr2 = f.comment ? ` /** ${f.comment} */` : "";
|
|
186
186
|
return [fieldStr, commentStr2].filter((x) => x).join("\n");
|
|
187
187
|
}).filter((x) => x).join("\n");
|