Socket
Socket
Sign inDemoInstall

@aws-amplify/graphql-model-transformer

Package Overview
Dependencies
Maintainers
9
Versions
433
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/graphql-model-transformer - npm Package Compare versions

Comparing version 2.10.0 to 2.10.1

6

CHANGELOG.md

@@ -6,2 +6,8 @@ # Change Log

## [2.10.1](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-model-transformer@2.10.0...@aws-amplify/graphql-model-transformer@2.10.1) (2024-05-15)
### Bug Fixes
- **api:** handle attribute type change on gsi ([#2542](https://github.com/aws-amplify/amplify-category-api/issues/2542)) ([f0a4709](https://github.com/aws-amplify/amplify-category-api/commit/f0a470990dd41966f802bb6ecb7b7ffa41a5c7d5))
# [2.10.0](https://github.com/aws-amplify/amplify-category-api/compare/@aws-amplify/graphql-model-transformer@2.9.1...@aws-amplify/graphql-model-transformer@2.10.0) (2024-05-10)

@@ -8,0 +14,0 @@

@@ -373,2 +373,4 @@ "use strict";

const endStateGSINames = endStateGSIs.map((gsi) => gsi.indexName);
const modifiedAttributes = getTypeModifiedAttributes(currentState.AttributeDefinitions, endState.attributeDefinitions);
const indexesWithModifiedAttributeType = getIndexesContainingAttributes(currentState.GlobalSecondaryIndexes, modifiedAttributes);
const currentStateGSIs = currentState.GlobalSecondaryIndexes || [];

@@ -379,2 +381,4 @@ const currentStateGSINames = currentStateGSIs.map((gsi) => gsi.IndexName);

return true;
if (indexesWithModifiedAttributeType.includes(currentGSI.IndexName))
return true;
const respectiveEndStateGSI = endStateGSIs.find((endStateGSI) => endStateGSI.indexName === currentGSI.IndexName);

@@ -769,2 +773,25 @@ if (isProjectionModified(currentGSI.Projection, respectiveEndStateGSI.projection))

};
const getTypeModifiedAttributes = (currentSchema, endSchema) => {
const result = [];
if (!currentSchema || !endSchema)
return result;
for (const attribute of currentSchema) {
const endAttribute = endSchema.find((endAttr) => endAttr.attributeName === attribute.AttributeName);
if (!endAttribute)
continue;
if (attribute.AttributeType !== endAttribute.attributeType) {
result.push(attribute.AttributeName);
}
}
return result;
};
const getIndexesContainingAttributes = (currentSchema, attributes) => {
if (!currentSchema)
return [];
const result = currentSchema
.filter((index) => index.IndexStatus === 'ACTIVE')
.filter((index) => { var _a; return (_a = index.KeySchema) === null || _a === void 0 ? void 0 : _a.some((key) => attributes.includes(key.AttributeName)); })
.map((index) => index.IndexName);
return result !== null && result !== void 0 ? result : [];
};
const isTtlModified = (oldTtl, endTtl) => {

@@ -771,0 +798,0 @@ if (oldTtl === undefined && endTtl === undefined) {

4

package.json
{
"name": "@aws-amplify/graphql-model-transformer",
"version": "2.10.0",
"version": "2.10.1",
"description": "Amplify graphql @model transformer",

@@ -91,3 +91,3 @@ "repository": {

},
"gitHead": "a6bd979529c1c7686ae3e9ad928f232d181114ab"
"gitHead": "ae27c5cbeb0bce24a4fe91ea958123a897a7e72c"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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