@journeyapps/cloudcode-build
Advanced tools
Comparing version 1.9.7-dev.00b908a.e8c9b44 to 1.9.7-dev.6d76ea3.06480f5
@@ -62,6 +62,6 @@ "use strict"; | ||
let attrs = []; | ||
for (let attributeName in model.attributes) { | ||
for (let attributeName of Object.keys(model.attributes)) { | ||
let attribute = model.attributes[attributeName]; | ||
attrs.push(`/** ${attribute.label} (${attribute.sourceTypeName}) */`, `${safeProperty(attributeName)}: ${mapType(attribute.type)};`); | ||
if (attribute.type.name == 'attachment') { | ||
if (attribute.type && attribute.type.name == 'attachment') { | ||
attrs.push(`/** ID of ${attribute.label}. */`, `readonly ${attributeName}_id: string;`); | ||
@@ -72,2 +72,5 @@ } | ||
let rel = model.belongsTo[relName]; | ||
if (!rel.foreignType) { | ||
continue; | ||
} | ||
attrs.push(`/** Lookup related ${rel.foreignType.label}. */`, `${safeProperty(relName)}(): Promise<${typeRef(rel.foreignType.name)}>;`, `/** Set related ${rel.foreignType.label}. */`, `${safeProperty(relName)}(value: ${typeRef(rel.foreignType.name)}): void;`, `/** ID of related ${rel.foreignType.label}. */`, `${safeProperty(relName + '_id')}: string;`); | ||
@@ -77,2 +80,5 @@ } | ||
let rel = model.hasMany[relName]; | ||
if (!rel.objectType) { | ||
continue; | ||
} | ||
attrs.push(`/** Query for related ${rel.objectType.label}. */`, `readonly ${safeProperty(relName)}: Query<${typeRef(rel.objectType.name)}>;`); | ||
@@ -79,0 +85,0 @@ } |
{ | ||
"name": "@journeyapps/cloudcode-build", | ||
"version": "1.9.7-dev.00b908a.e8c9b44", | ||
"version": "1.9.7-dev.6d76ea3.06480f5", | ||
"main": "./lib/index.js", | ||
@@ -32,3 +32,3 @@ "license": "MIT", | ||
], | ||
"gitHead": "2b895f3c167e7d944d635ef06f096eadb4ec2be8" | ||
"gitHead": "1589186828b522ac3f8781b8a80415910a6da881" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21294
372