@aws-amplify/appsync-modelgen-plugin
Advanced tools
Comparing version 1.23.2-dev.11 to 1.23.2-dev.12
@@ -65,30 +65,48 @@ "use strict"; | ||
.join(',\n')).trim()})`; | ||
structBlock.addClassMethod('init', null, initImpl, initParams.map(field => { | ||
const listType = field.connectionInfo ? swift_declaration_block_1.ListType.LIST : swift_declaration_block_1.ListType.ARRAY; | ||
return { | ||
name: this.getFieldName(field), | ||
type: this.getNativeType(field), | ||
value: field.name === 'id' ? 'UUID().uuidString' : undefined, | ||
flags: { | ||
optional: field.isNullable, | ||
isList: field.isList, | ||
isEnum: this.isEnumType(field), | ||
listType: field.isList ? listType : undefined, | ||
}, | ||
}; | ||
}), 'public', {}); | ||
structBlock.addClassMethod('init', null, this.getInitBody(obj.fields), obj.fields.map(field => { | ||
const listType = field.connectionInfo ? swift_declaration_block_1.ListType.LIST : swift_declaration_block_1.ListType.ARRAY; | ||
return { | ||
name: this.getFieldName(field), | ||
type: this.getNativeType(field), | ||
value: field.name === 'id' ? 'UUID().uuidString' : undefined, | ||
flags: { | ||
optional: field.isNullable, | ||
isList: field.isList, | ||
isEnum: this.isEnumType(field), | ||
listType: field.isList ? listType : undefined, | ||
}, | ||
}; | ||
}), 'internal', {}); | ||
if (this.config.isTimestampFieldsAdded) { | ||
structBlock.addClassMethod('init', null, initImpl, initParams.map(field => { | ||
const listType = field.connectionInfo ? swift_declaration_block_1.ListType.LIST : swift_declaration_block_1.ListType.ARRAY; | ||
return { | ||
name: this.getFieldName(field), | ||
type: this.getNativeType(field), | ||
value: field.name === 'id' ? 'UUID().uuidString' : undefined, | ||
flags: { | ||
optional: field.isNullable, | ||
isList: field.isList, | ||
isEnum: this.isEnumType(field), | ||
listType: field.isList ? listType : undefined, | ||
}, | ||
}; | ||
}), 'public', {}); | ||
structBlock.addClassMethod('init', null, this.getInitBody(obj.fields), obj.fields.map(field => { | ||
const listType = field.connectionInfo ? swift_declaration_block_1.ListType.LIST : swift_declaration_block_1.ListType.ARRAY; | ||
return { | ||
name: this.getFieldName(field), | ||
type: this.getNativeType(field), | ||
value: field.name === 'id' ? 'UUID().uuidString' : undefined, | ||
flags: { | ||
optional: field.isNullable, | ||
isList: field.isList, | ||
isEnum: this.isEnumType(field), | ||
listType: field.isList ? listType : undefined, | ||
}, | ||
}; | ||
}), 'internal', {}); | ||
} | ||
else { | ||
structBlock.addClassMethod('init', null, this.getInitBody(obj.fields), obj.fields.map(field => { | ||
const listType = field.connectionInfo ? swift_declaration_block_1.ListType.LIST : swift_declaration_block_1.ListType.ARRAY; | ||
return { | ||
name: this.getFieldName(field), | ||
type: this.getNativeType(field), | ||
value: field.name === 'id' ? 'UUID().uuidString' : undefined, | ||
flags: { | ||
optional: field.isNullable, | ||
isList: field.isList, | ||
isEnum: this.isEnumType(field), | ||
listType: field.isList ? listType : undefined, | ||
}, | ||
}; | ||
}), 'public', {}); | ||
} | ||
result.push(structBlock.string); | ||
@@ -95,0 +113,0 @@ }); |
{ | ||
"name": "@aws-amplify/appsync-modelgen-plugin", | ||
"version": "1.23.2-dev.11+a99d67c", | ||
"version": "1.23.2-dev.12+f923e14", | ||
"repository": { | ||
@@ -73,3 +73,3 @@ "type": "git", | ||
}, | ||
"gitHead": "a99d67c1053896cc62f9cfc1898fff3c992907da" | ||
"gitHead": "f923e144e9cf51f904d792a5c01ceffca685d0ea" | ||
} |
Sorry, the diff of this file is not supported yet
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
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
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
479547
4803