New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws-amplify/amplify-api-next-alpha

Package Overview
Dependencies
Maintainers
10
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/amplify-api-next-alpha - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

6

lib-esm/src/Authorization.js

@@ -177,2 +177,3 @@ "use strict";

provider,
groupOrOwnerField: 'owner',
}, {

@@ -205,2 +206,3 @@ to,

provider,
groupOrOwnerField: 'owner',
}, {

@@ -304,5 +306,5 @@ to,

}, {
to
to,
});
}
},
};

@@ -274,2 +274,31 @@ "use strict";

};
/**
* Determines if implicit date fields are in effect for a given model. If they are,
* returns those implicit fields.
*
* NOTE: For now, we *only* support the default implicit fields.
*
* @param _model Model to find date fields for.
*/
const implicitTimestampFields = (_model) => {
return {
createdAt: (0, ModelField_1.datetime)().required(),
updatedAt: (0, ModelField_1.datetime)().required(),
};
};
/**
* Generates default Pk fields for a model, based on identifier designation.
*
* The fields from this function are just default values. They should be overridden
* by ID field definitions that are explicit in the model.
*
* @param _model Model to find PK fields for.
*/
const idFields = (model) => {
const fields = {};
for (const fieldName of model.data.identifier) {
fields[fieldName] = (0, ModelField_1.id)().required();
}
return fields;
};
function processFieldLevelAuthRules(fields, authFields) {

@@ -287,9 +316,6 @@ const fieldLevelAuthRules = {};

}
function processFields(fields, authFields, fieldLevelAuthRules, identifier, partitionKey) {
function processFields(fields, fieldLevelAuthRules, identifier, partitionKey) {
const gqlFields = [];
const models = [];
for (const [fieldName, fieldDef] of Object.entries({
...authFields,
...fields,
})) {
for (const [fieldName, fieldDef] of Object.entries(fields)) {
const fieldAuth = fieldLevelAuthRules[fieldName]

@@ -343,3 +369,3 @@ ? ` ${fieldLevelAuthRules[fieldName]}`

const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);
const { gqlFields, models } = processFields(fields, {}, fieldLevelAuthRules);
const { gqlFields, models } = processFields(fields, fieldLevelAuthRules);
topLevelTypes.push(...models);

@@ -360,3 +386,9 @@ const joined = gqlFields.join('\n ');

const fieldLevelAuthRules = processFieldLevelAuthRules(fields, authFields);
const { gqlFields, models } = processFields(fields, authFields, fieldLevelAuthRules, identifier, partitionKey);
const { gqlFields, models } = processFields({
// idFields first, so they can be overridden by customer definitions when present.
...idFields(typeDef),
...fields,
...authFields,
...implicitTimestampFields(typeDef),
}, fieldLevelAuthRules, identifier, partitionKey);
topLevelTypes.push(...models);

@@ -363,0 +395,0 @@ const joined = gqlFields.join('\n ');

{
"name": "@aws-amplify/amplify-api-next-alpha",
"version": "0.10.0",
"version": "0.10.1",
"license": "Apache-2.0",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc