From 6e28eaf37525ce231d7793bf82a960046fc7f8f4 Mon Sep 17 00:00:00 2001 From: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com> Date: Mon, 30 Nov 2020 15:48:59 -0500 Subject: [PATCH 01/12] feat(@aws-amplify/datastore): handle sessionId (#7304) --- packages/datastore/src/datastore/datastore.ts | 62 +++++++++++++------ .../src/storage/adapter/IndexedDBAdapter.ts | 12 ++-- packages/datastore/src/storage/storage.ts | 12 ++-- packages/datastore/src/types.ts | 23 +++++-- 4 files changed, 77 insertions(+), 32 deletions(-) diff --git a/packages/datastore/src/datastore/datastore.ts b/packages/datastore/src/datastore/datastore.ts index 3679e375439..7d4c392dfae 100644 --- a/packages/datastore/src/datastore/datastore.ts +++ b/packages/datastore/src/datastore/datastore.ts @@ -271,32 +271,29 @@ const validateModelFields = (modelDefinition: SchemaModel | SchemaNonModel) => ( if ( !isNullOrUndefined(v) && - (<[]>v).some( - e => isNullOrUndefined(e) ? isRequired : typeof e !== jsType + (<[]>v).some(e => + isNullOrUndefined(e) ? isRequired : typeof e !== jsType ) ) { - const elemTypes = (<[]>v).map(e => e === null ? 'null' : typeof e).join(','); + const elemTypes = (<[]>v) + .map(e => (e === null ? 'null' : typeof e)) + .join(','); throw new Error( `All elements in the ${name} array should be of type ${errorTypeText}, [${elemTypes}] received. ${v}` ); } - if ( - validateScalar && - !isNullOrUndefined(v) - ) { - const validationStatus = (<[]>v).map( - e => { - if (!isNullOrUndefined(e)) { - return validateScalar(e); - } else if (isNullOrUndefined(e) && !isRequired) { - return true; - } else { - return false; - } + if (validateScalar && !isNullOrUndefined(v)) { + const validationStatus = (<[]>v).map(e => { + if (!isNullOrUndefined(e)) { + return validateScalar(e); + } else if (isNullOrUndefined(e) && !isRequired) { + return true; + } else { + return false; } - ); + }); if (!validationStatus.every(s => s)) { throw new Error( @@ -310,7 +307,11 @@ const validateModelFields = (modelDefinition: SchemaModel | SchemaNonModel) => ( throw new Error( `Field ${name} should be of type ${jsType}, ${typeof v} received. ${v}` ); - } else if (!isNullOrUndefined(v) && validateScalar && !validateScalar(v)) { + } else if ( + !isNullOrUndefined(v) && + validateScalar && + !validateScalar(v) + ) { throw new Error( `Field ${name} should be of type ${type}, validation failed. ${v}` ); @@ -579,6 +580,7 @@ class DataStore { SchemaModel, ModelPredicate > = new WeakMap>(); + private sessionId: string; getModuleName() { return 'DataStore'; @@ -601,7 +603,9 @@ class DataStore { schema, namespaceResolver, getModelConstructorByModelName, - modelInstanceCreator + modelInstanceCreator, + undefined, + this.sessionId ); await this.storage.init(); @@ -1046,6 +1050,8 @@ class DataStore { this.fullSyncInterval || configFullSyncInterval || 24 * 60; // 1 day + + this.sessionId = this.retrieveSessionId(); }; clear = async function clear() { @@ -1207,6 +1213,24 @@ class DataStore { return map; }, new WeakMap>()); } + + // database separation for Amplify Console. Not a public API + private retrieveSessionId(): string | undefined { + try { + const sessionId = sessionStorage.getItem('datastoreSessionId'); + + if (sessionId) { + const { aws_appsync_graphqlEndpoint } = this.amplifyConfig; + + const appSyncUrl = aws_appsync_graphqlEndpoint.split('/')[2]; + const [appSyncId] = appSyncUrl.split('.'); + + return `${sessionId}-${appSyncId}`; + } + } catch { + return undefined; + } + } } const instance = new DataStore(); diff --git a/packages/datastore/src/storage/adapter/IndexedDBAdapter.ts b/packages/datastore/src/storage/adapter/IndexedDBAdapter.ts index 2eb2c6c4766..372c0c4762e 100644 --- a/packages/datastore/src/storage/adapter/IndexedDBAdapter.ts +++ b/packages/datastore/src/storage/adapter/IndexedDBAdapter.ts @@ -47,6 +47,7 @@ class IndexedDBAdapter implements Adapter { private initPromise: Promise; private resolve: (value?: any) => void; private reject: (value?: any) => void; + private dbName: string = DB_NAME; private async checkPrivate() { const isPrivate = await isPrivateMode().then(isPrivate => { @@ -84,7 +85,8 @@ class IndexedDBAdapter implements Adapter { getModelConstructorByModelName: ( namsespaceName: string, modelName: string - ) => PersistentModelConstructor + ) => PersistentModelConstructor, + sessionId?: string ) { await this.checkPrivate(); if (!this.initPromise) { @@ -95,7 +97,9 @@ class IndexedDBAdapter implements Adapter { } else { await this.initPromise; } - + if (sessionId) { + this.dbName = `${DB_NAME}-${sessionId}`; + } this.schema = theSchema; this.namespaceResolver = namespaceResolver; this.modelInstanceCreator = modelInstanceCreator; @@ -104,7 +108,7 @@ class IndexedDBAdapter implements Adapter { try { if (!this.db) { const VERSION = 2; - this.db = await idb.openDB(DB_NAME, VERSION, { + this.db = await idb.openDB(this.dbName, VERSION, { upgrade: async (db, oldVersion, newVersion, txn) => { if (oldVersion === 0) { Object.keys(theSchema.namespaces).forEach(namespaceName => { @@ -758,7 +762,7 @@ class IndexedDBAdapter implements Adapter { this.db.close(); - await idb.deleteDB(DB_NAME); + await idb.deleteDB(this.dbName); this.db = undefined; this.initPromise = undefined; diff --git a/packages/datastore/src/storage/storage.ts b/packages/datastore/src/storage/storage.ts index c58a06fa320..347423efa85 100644 --- a/packages/datastore/src/storage/storage.ts +++ b/packages/datastore/src/storage/storage.ts @@ -48,7 +48,8 @@ class StorageClass implements StorageFacade { modelName: string ) => PersistentModelConstructor, private readonly modelInstanceCreator: ModelInstanceCreator, - private readonly adapter?: Adapter + private readonly adapter?: Adapter, + private readonly sessionId?: string ) { this.adapter = getDefaultAdapter(); this.pushStream = new PushStream(); @@ -86,7 +87,8 @@ class StorageClass implements StorageFacade { this.schema, this.namespaceResolver, this.modelInstanceCreator, - this.getModelConstructorByModelName + this.getModelConstructorByModelName, + this.sessionId ) .then(resolve, reject); @@ -277,14 +279,16 @@ class ExclusiveStorage implements StorageFacade { modelName: string ) => PersistentModelConstructor, modelInstanceCreator: ModelInstanceCreator, - adapter?: Adapter + adapter?: Adapter, + sessionId?: string ) { this.storage = new StorageClass( schema, namespaceResolver, getModelConstructorByModelName, modelInstanceCreator, - adapter + adapter, + sessionId ); } diff --git a/packages/datastore/src/types.ts b/packages/datastore/src/types.ts index e52062792e1..a3a62569e90 100644 --- a/packages/datastore/src/types.ts +++ b/packages/datastore/src/types.ts @@ -96,7 +96,10 @@ export enum GraphQLScalarType { export namespace GraphQLScalarType { export function getJSType( - scalar: keyof Omit + scalar: keyof Omit< + typeof GraphQLScalarType, + 'getJSType' | 'getValidationFunction' + > ): 'string' | 'number' | 'boolean' { switch (scalar) { case 'Boolean': @@ -122,7 +125,10 @@ export namespace GraphQLScalarType { } export function getValidationFunction( - scalar: keyof Omit + scalar: keyof Omit< + typeof GraphQLScalarType, + 'getJSType' | 'getValidationFunction' + > ): ((val: string | number) => boolean) | undefined { switch (scalar) { case 'AWSDate': @@ -161,7 +167,10 @@ export type AuthorizationRule = { export function isGraphQLScalarType( obj: any -): obj is keyof Omit { +): obj is keyof Omit< + typeof GraphQLScalarType, + 'getJSType' | 'getValidationFunction' +> { return obj && GraphQLScalarType[obj] !== undefined; } @@ -192,7 +201,10 @@ export function isEnumFieldType(obj: any): obj is EnumFieldType { type ModelField = { name: string; type: - | keyof Omit + | keyof Omit< + typeof GraphQLScalarType, + 'getJSType' | 'getValidationFunction' + > | ModelFieldType | NonModelFieldType | EnumFieldType; @@ -449,7 +461,8 @@ export type SystemComponent = { getModelConstructorByModelName: ( namsespaceName: string, modelName: string - ) => PersistentModelConstructor + ) => PersistentModelConstructor, + appId: string ): Promise; }; From 039aa95f9a3e791f09d7566bd7baecf68c7c8cb6 Mon Sep 17 00:00:00 2001 From: Alex Hinson Date: Mon, 30 Nov 2020 13:25:12 -0800 Subject: [PATCH 02/12] fix(@aws-amplify/analytics): send events when autoSessionRecord is disabled (#7308) --- packages/analytics/src/Analytics.ts | 11 ++++++----- .../analytics/src/Providers/AWSPinpointProvider.ts | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/analytics/src/Analytics.ts b/packages/analytics/src/Analytics.ts index 0b1fe4ffd51..e4f12eb2eb1 100644 --- a/packages/analytics/src/Analytics.ts +++ b/packages/analytics/src/Analytics.ts @@ -99,6 +99,11 @@ export class AnalyticsClass { this._disabled = true; } + // turn on the autoSessionRecord if not specified + if (this._config['autoSessionRecord'] === undefined) { + this._config['autoSessionRecord'] = true; + } + this._pluggables.forEach(pluggable => { // for backward compatibility const providerConfig = @@ -109,6 +114,7 @@ export class AnalyticsClass { pluggable.configure({ disabled: this._config['disabled'], + autoSessionRecord: this._config['autoSessionRecord'], ...providerConfig, }); }); @@ -117,11 +123,6 @@ export class AnalyticsClass { this.addPluggable(new AWSPinpointProvider()); } - // turn on the autoSessionRecord if not specified - if (this._config['autoSessionRecord'] === undefined) { - this._config['autoSessionRecord'] = true; - } - dispatchAnalyticsEvent( 'configured', null, diff --git a/packages/analytics/src/Providers/AWSPinpointProvider.ts b/packages/analytics/src/Providers/AWSPinpointProvider.ts index 7dbf26c6e80..cd4a2682049 100644 --- a/packages/analytics/src/Providers/AWSPinpointProvider.ts +++ b/packages/analytics/src/Providers/AWSPinpointProvider.ts @@ -119,6 +119,10 @@ export class AWSPinpointProvider implements AnalyticsProvider { const conf = config || {}; this._config = Object.assign({}, this._config, conf); + // If autoSessionRecord is enabled, we need to wait for the endpoint to be + // updated before sending any events. See `sendEvents` in `Analytics.ts` + this._endpointGenerating = !!config['autoSessionRecord']; + if (this._config.appId && !this._config.disabled) { if (!this._config.endpointId) { const cacheKey = this.getProviderName() + '_' + this._config.appId; From 4aee84b735e86e0b008d09fd396c0f631892c532 Mon Sep 17 00:00:00 2001 From: Alex Hinson Date: Mon, 30 Nov 2020 13:53:36 -0800 Subject: [PATCH 03/12] chore: preparing release From 548eb4ca1193f2363e4c48195eb2d71c93d9ecb1 Mon Sep 17 00:00:00 2001 From: aws-amplify-bot Date: Mon, 30 Nov 2020 22:26:48 +0000 Subject: [PATCH 04/12] chore(release): Publish [ci skip] - @aws-amplify/ui-angular@0.4.14 - @aws-amplify/ui-components@0.9.6 - @aws-amplify/ui-react@0.2.31 - @aws-amplify/ui-storybook@0.2.31 - @aws-amplify/ui-vue@0.2.30 - @aws-amplify/analytics@4.0.2 - @aws-amplify/api-graphql@1.2.14 - @aws-amplify/api-rest@1.2.14 - @aws-amplify/api@3.2.14 - @aws-amplify/auth@3.4.14 - aws-amplify-angular@5.0.40 - aws-amplify-react@4.2.15 - aws-amplify@3.3.11 - @aws-amplify/cache@3.1.39 - @aws-amplify/core@3.8.6 - @aws-amplify/datastore@2.9.0 - @aws-amplify/interactions@3.3.14 - @aws-amplify/predictions@3.2.14 - @aws-amplify/pubsub@3.2.12 - @aws-amplify/pushnotification@3.2.14 - @aws-amplify/storage@3.3.14 - @aws-amplify/xr@2.2.14 --- packages/amplify-ui-angular/CHANGELOG.md | 8 +++++++ packages/amplify-ui-angular/package.json | 4 ++-- packages/amplify-ui-components/CHANGELOG.md | 8 +++++++ packages/amplify-ui-components/package.json | 12 +++++------ packages/amplify-ui-react/CHANGELOG.md | 8 +++++++ packages/amplify-ui-react/package.json | 4 ++-- packages/amplify-ui-storybook/CHANGELOG.md | 8 +++++++ packages/amplify-ui-storybook/package.json | 6 +++--- packages/amplify-ui-vue/CHANGELOG.md | 8 +++++++ packages/amplify-ui-vue/package.json | 4 ++-- packages/analytics/CHANGELOG.md | 11 ++++++++++ packages/analytics/package.json | 6 +++--- packages/api-graphql/CHANGELOG.md | 8 +++++++ packages/api-graphql/package.json | 12 +++++------ packages/api-rest/CHANGELOG.md | 8 +++++++ packages/api-rest/package.json | 4 ++-- packages/api/CHANGELOG.md | 8 +++++++ packages/api/package.json | 6 +++--- packages/auth/CHANGELOG.md | 8 +++++++ packages/auth/package.json | 6 +++--- packages/aws-amplify-angular/CHANGELOG.md | 8 +++++++ packages/aws-amplify-angular/package.json | 4 ++-- packages/aws-amplify-react/CHANGELOG.md | 8 +++++++ packages/aws-amplify-react/package.json | 4 ++-- packages/aws-amplify/CHANGELOG.md | 8 +++++++ packages/aws-amplify/package.json | 24 ++++++++++----------- packages/cache/CHANGELOG.md | 8 +++++++ packages/cache/package.json | 4 ++-- packages/core/CHANGELOG.md | 8 +++++++ packages/core/package.json | 2 +- packages/datastore/CHANGELOG.md | 16 ++++++++++++++ packages/datastore/package.json | 8 +++---- packages/interactions/CHANGELOG.md | 8 +++++++ packages/interactions/package.json | 4 ++-- packages/predictions/CHANGELOG.md | 8 +++++++ packages/predictions/package.json | 6 +++--- packages/pubsub/CHANGELOG.md | 11 ++++++++++ packages/pubsub/package.json | 8 +++---- packages/pushnotification/CHANGELOG.md | 8 +++++++ packages/pushnotification/package.json | 4 ++-- packages/storage/CHANGELOG.md | 8 +++++++ packages/storage/package.json | 4 ++-- packages/xr/CHANGELOG.md | 8 +++++++ packages/xr/package.json | 4 ++-- 44 files changed, 260 insertions(+), 70 deletions(-) diff --git a/packages/amplify-ui-angular/CHANGELOG.md b/packages/amplify-ui-angular/CHANGELOG.md index ce639eb7b1b..b8dfb855a11 100644 --- a/packages/amplify-ui-angular/CHANGELOG.md +++ b/packages/amplify-ui-angular/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.4.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.13...@aws-amplify/ui-angular@0.4.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/ui-angular + + + + + ## [0.4.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-angular@0.4.12...@aws-amplify/ui-angular@0.4.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/ui-angular diff --git a/packages/amplify-ui-angular/package.json b/packages/amplify-ui-angular/package.json index f8671d2a33d..1f912e57ec1 100644 --- a/packages/amplify-ui-angular/package.json +++ b/packages/amplify-ui-angular/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-angular", - "version": "0.4.13", + "version": "0.4.14", "description": "Angular specific wrapper for @aws-amplify/ui-components", "publishConfig": { "access": "public" @@ -31,7 +31,7 @@ "dist/" ], "dependencies": { - "@aws-amplify/ui-components": "0.9.5" + "@aws-amplify/ui-components": "0.9.6" }, "devDependencies": { "@angular/compiler-cli": "^7.2.1", diff --git a/packages/amplify-ui-components/CHANGELOG.md b/packages/amplify-ui-components/CHANGELOG.md index 3eeb92cdb02..8354cdb6405 100644 --- a/packages/amplify-ui-components/CHANGELOG.md +++ b/packages/amplify-ui-components/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.9.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.5...@aws-amplify/ui-components@0.9.6) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/ui-components + + + + + ## [0.9.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-components@0.9.4...@aws-amplify/ui-components@0.9.5) (2020-11-23) **Note:** Version bump only for package @aws-amplify/ui-components diff --git a/packages/amplify-ui-components/package.json b/packages/amplify-ui-components/package.json index a3d31f1187d..82add262d07 100644 --- a/packages/amplify-ui-components/package.json +++ b/packages/amplify-ui-components/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/ui-components", - "version": "0.9.5", + "version": "0.9.6", "description": "Core Amplify UI Component Library", "module": "dist/index.mjs", "main": "dist/index.js", @@ -35,11 +35,11 @@ "clean": "rimraf dist .stencil" }, "dependencies": { - "@aws-amplify/auth": "3.4.13", - "@aws-amplify/core": "3.8.5", - "@aws-amplify/interactions": "3.3.13", - "@aws-amplify/storage": "3.3.13", - "@aws-amplify/xr": "2.2.13", + "@aws-amplify/auth": "3.4.14", + "@aws-amplify/core": "3.8.6", + "@aws-amplify/interactions": "3.3.14", + "@aws-amplify/storage": "3.3.14", + "@aws-amplify/xr": "2.2.14", "qrcode": "^1.4.4", "uuid": "^8.2.0" }, diff --git a/packages/amplify-ui-react/CHANGELOG.md b/packages/amplify-ui-react/CHANGELOG.md index 2f410240b80..ea294da0fc2 100644 --- a/packages/amplify-ui-react/CHANGELOG.md +++ b/packages/amplify-ui-react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.30...@aws-amplify/ui-react@0.2.31) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/ui-react + + + + + ## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-react@0.2.29...@aws-amplify/ui-react@0.2.30) (2020-11-23) **Note:** Version bump only for package @aws-amplify/ui-react diff --git a/packages/amplify-ui-react/package.json b/packages/amplify-ui-react/package.json index 26cc2197a49..b467de24b76 100755 --- a/packages/amplify-ui-react/package.json +++ b/packages/amplify-ui-react/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-react", "sideEffects": false, - "version": "0.2.30", + "version": "0.2.31", "description": "React specific wrapper for @aws-amplify/ui-components", "publishConfig": { "access": "public" @@ -32,7 +32,7 @@ "typescript": "^3.3.4000" }, "dependencies": { - "@aws-amplify/ui-components": "0.9.5" + "@aws-amplify/ui-components": "0.9.6" }, "peerDependencies": { "react": "^16.7.0", diff --git a/packages/amplify-ui-storybook/CHANGELOG.md b/packages/amplify-ui-storybook/CHANGELOG.md index 328ba084c89..1278efc66f9 100644 --- a/packages/amplify-ui-storybook/CHANGELOG.md +++ b/packages/amplify-ui-storybook/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.31](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.30...@aws-amplify/ui-storybook@0.2.31) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/ui-storybook + + + + + ## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-storybook@0.2.29...@aws-amplify/ui-storybook@0.2.30) (2020-11-23) **Note:** Version bump only for package @aws-amplify/ui-storybook diff --git a/packages/amplify-ui-storybook/package.json b/packages/amplify-ui-storybook/package.json index facb9e3e6c9..e82c22f7504 100644 --- a/packages/amplify-ui-storybook/package.json +++ b/packages/amplify-ui-storybook/package.json @@ -1,16 +1,16 @@ { "name": "@aws-amplify/ui-storybook", - "version": "0.2.30", + "version": "0.2.31", "private": true, "dependencies": { - "@aws-amplify/ui-react": "0.2.30", + "@aws-amplify/ui-react": "0.2.31", "@storybook/addon-knobs": "^5.3.13", "@storybook/theming": "^5.3.14", "@types/jest": "^24.0.0", "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", - "aws-amplify": "3.3.10", + "aws-amplify": "3.3.11", "react": "^16.12.0", "react-app-polyfill": "^1.0.6", "react-dom": "^16.12.0", diff --git a/packages/amplify-ui-vue/CHANGELOG.md b/packages/amplify-ui-vue/CHANGELOG.md index 81957754cd2..15148e00666 100644 --- a/packages/amplify-ui-vue/CHANGELOG.md +++ b/packages/amplify-ui-vue/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [0.2.30](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.29...@aws-amplify/ui-vue@0.2.30) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/ui-vue + + + + + ## [0.2.29](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/ui-vue@0.2.28...@aws-amplify/ui-vue@0.2.29) (2020-11-23) **Note:** Version bump only for package @aws-amplify/ui-vue diff --git a/packages/amplify-ui-vue/package.json b/packages/amplify-ui-vue/package.json index 548c1ae2f01..396f671634a 100644 --- a/packages/amplify-ui-vue/package.json +++ b/packages/amplify-ui-vue/package.json @@ -1,7 +1,7 @@ { "name": "@aws-amplify/ui-vue", "sideEffects": true, - "version": "0.2.29", + "version": "0.2.30", "description": "Vue specific wrapper for @aws-amplify/ui-components", "publishConfig": { "access": "public" @@ -17,7 +17,7 @@ "url": "https://github.com/aws-amplify/amplify-js.git" }, "dependencies": { - "@aws-amplify/ui-components": "0.9.5" + "@aws-amplify/ui-components": "0.9.6" }, "scripts": { "build": "npm run clean && npm run compile", diff --git a/packages/analytics/CHANGELOG.md b/packages/analytics/CHANGELOG.md index fc762502a61..f92f39c65b5 100644 --- a/packages/analytics/CHANGELOG.md +++ b/packages/analytics/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.0.2](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@4.0.1...@aws-amplify/analytics@4.0.2) (2020-11-30) + + +### Bug Fixes + +* **@aws-amplify/analytics:** send events when autoSessionRecord is disabled ([#7308](https://github.com/aws-amplify/amplify-js/issues/7308)) ([039aa95](https://github.com/aws-amplify/amplify-js/commit/039aa95f9a3e791f09d7566bd7baecf68c7c8cb6)) + + + + + ## [4.0.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/analytics@4.0.0...@aws-amplify/analytics@4.0.1) (2020-11-23) **Note:** Version bump only for package @aws-amplify/analytics diff --git a/packages/analytics/package.json b/packages/analytics/package.json index 2e12889b63f..16d1beca9a6 100644 --- a/packages/analytics/package.json +++ b/packages/analytics/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/analytics", - "version": "4.0.1", + "version": "4.0.2", "description": "Analytics category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -43,8 +43,8 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/cache": "3.1.38", - "@aws-amplify/core": "3.8.5", + "@aws-amplify/cache": "3.1.39", + "@aws-amplify/core": "3.8.6", "@aws-sdk/client-firehose": "1.0.0-rc.4", "@aws-sdk/client-kinesis": "1.0.0-rc.4", "@aws-sdk/client-personalize-events": "1.0.0-rc.4", diff --git a/packages/api-graphql/CHANGELOG.md b/packages/api-graphql/CHANGELOG.md index ddf9cc3d2d4..1d307fbbf70 100644 --- a/packages/api-graphql/CHANGELOG.md +++ b/packages/api-graphql/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@1.2.13...@aws-amplify/api-graphql@1.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/api-graphql + + + + + ## [1.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-graphql@1.2.12...@aws-amplify/api-graphql@1.2.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/api-graphql diff --git a/packages/api-graphql/package.json b/packages/api-graphql/package.json index 587238d0bf5..2f66cadec1d 100644 --- a/packages/api-graphql/package.json +++ b/packages/api-graphql/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api-graphql", - "version": "1.2.13", + "version": "1.2.14", "description": "Api-graphql category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -44,11 +44,11 @@ "@types/zen-observable": "^0.8.0" }, "dependencies": { - "@aws-amplify/api-rest": "1.2.13", - "@aws-amplify/auth": "3.4.13", - "@aws-amplify/cache": "3.1.38", - "@aws-amplify/core": "3.8.5", - "@aws-amplify/pubsub": "3.2.11", + "@aws-amplify/api-rest": "1.2.14", + "@aws-amplify/auth": "3.4.14", + "@aws-amplify/cache": "3.1.39", + "@aws-amplify/core": "3.8.6", + "@aws-amplify/pubsub": "3.2.12", "graphql": "14.0.0", "uuid": "^3.2.1", "zen-observable-ts": "0.8.19" diff --git a/packages/api-rest/CHANGELOG.md b/packages/api-rest/CHANGELOG.md index 4906470ca31..586043633a2 100644 --- a/packages/api-rest/CHANGELOG.md +++ b/packages/api-rest/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@1.2.13...@aws-amplify/api-rest@1.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/api-rest + + + + + ## [1.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api-rest@1.2.12...@aws-amplify/api-rest@1.2.13) (2020-11-23) diff --git a/packages/api-rest/package.json b/packages/api-rest/package.json index 9d774f05cb5..3a5a5732ac0 100644 --- a/packages/api-rest/package.json +++ b/packages/api-rest/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api-rest", - "version": "1.2.13", + "version": "1.2.14", "description": "Api-rest category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -41,7 +41,7 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5", + "@aws-amplify/core": "3.8.6", "axios": "0.19.0" }, "jest": { diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index 10802666caa..9950832b49c 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@3.2.13...@aws-amplify/api@3.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/api + + + + + ## [3.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/api@3.2.12...@aws-amplify/api@3.2.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/api diff --git a/packages/api/package.json b/packages/api/package.json index 64f32dc17b1..e4dba956f40 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/api", - "version": "3.2.13", + "version": "3.2.14", "description": "Api category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -44,8 +44,8 @@ "@types/zen-observable": "^0.8.0" }, "dependencies": { - "@aws-amplify/api-graphql": "1.2.13", - "@aws-amplify/api-rest": "1.2.13" + "@aws-amplify/api-graphql": "1.2.14", + "@aws-amplify/api-rest": "1.2.14" }, "jest": { "globals": { diff --git a/packages/auth/CHANGELOG.md b/packages/auth/CHANGELOG.md index bafc158886a..d56a7ad6cdb 100644 --- a/packages/auth/CHANGELOG.md +++ b/packages/auth/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.4.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@3.4.13...@aws-amplify/auth@3.4.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/auth + + + + + ## [3.4.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/auth@3.4.12...@aws-amplify/auth@3.4.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/auth diff --git a/packages/auth/package.json b/packages/auth/package.json index 233194aafd7..f398d506dba 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/auth", - "version": "3.4.13", + "version": "3.4.14", "description": "Auth category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -41,8 +41,8 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/cache": "3.1.38", - "@aws-amplify/core": "3.8.5", + "@aws-amplify/cache": "3.1.39", + "@aws-amplify/core": "3.8.6", "amazon-cognito-identity-js": "4.5.5", "crypto-js": "^3.3.0" }, diff --git a/packages/aws-amplify-angular/CHANGELOG.md b/packages/aws-amplify-angular/CHANGELOG.md index 1de28e1d7d8..bc4aa604fa6 100644 --- a/packages/aws-amplify-angular/CHANGELOG.md +++ b/packages/aws-amplify-angular/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.0.40](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.39...aws-amplify-angular@5.0.40) (2020-11-30) + +**Note:** Version bump only for package aws-amplify-angular + + + + + ## [5.0.39](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-angular@5.0.38...aws-amplify-angular@5.0.39) (2020-11-23) **Note:** Version bump only for package aws-amplify-angular diff --git a/packages/aws-amplify-angular/package.json b/packages/aws-amplify-angular/package.json index 4effdf20ed1..82a4663ed4f 100644 --- a/packages/aws-amplify-angular/package.json +++ b/packages/aws-amplify-angular/package.json @@ -1,6 +1,6 @@ { "name": "aws-amplify-angular", - "version": "5.0.39", + "version": "5.0.40", "description": "AWS Amplify Angular Components", "main": "bundles/aws-amplify-angular.umd.js", "module": "dist/index.js", @@ -39,7 +39,7 @@ "@types/zen-observable": "^0.5.3", "angular2-template-loader": "^0.6.2", "awesome-typescript-loader": "^4.0.1", - "aws-amplify": "3.3.10", + "aws-amplify": "3.3.11", "babel-core": "^6.26.3", "babel-plugin-lodash": "^3.3.4", "babel-preset-env": "^1.7.0", diff --git a/packages/aws-amplify-react/CHANGELOG.md b/packages/aws-amplify-react/CHANGELOG.md index c8f502463c9..93fbfb22223 100644 --- a/packages/aws-amplify-react/CHANGELOG.md +++ b/packages/aws-amplify-react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.2.15](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.14...aws-amplify-react@4.2.15) (2020-11-30) + +**Note:** Version bump only for package aws-amplify-react + + + + + ## [4.2.14](https://github.com/aws-amplify/amplify-js/compare/aws-amplify-react@4.2.13...aws-amplify-react@4.2.14) (2020-11-23) **Note:** Version bump only for package aws-amplify-react diff --git a/packages/aws-amplify-react/package.json b/packages/aws-amplify-react/package.json index eb8a9dd27d8..da9502eb606 100644 --- a/packages/aws-amplify-react/package.json +++ b/packages/aws-amplify-react/package.json @@ -1,6 +1,6 @@ { "name": "aws-amplify-react", - "version": "4.2.14", + "version": "4.2.15", "description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -38,7 +38,7 @@ "@types/enzyme-adapter-react-16": "^1.0.3", "@types/react": "^16.0.41", "@types/react-dom": "^16.0.11", - "aws-amplify": "3.3.10", + "aws-amplify": "3.3.11", "enzyme": "^3.1.0", "enzyme-adapter-react-16": "^1.0.3", "enzyme-to-json": "^3.2.1", diff --git a/packages/aws-amplify/CHANGELOG.md b/packages/aws-amplify/CHANGELOG.md index f54f2a0492d..500a1b03bdd 100644 --- a/packages/aws-amplify/CHANGELOG.md +++ b/packages/aws-amplify/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.3.11](https://github.com/aws-amplify/amplify-js/compare/aws-amplify@3.3.10...aws-amplify@3.3.11) (2020-11-30) + +**Note:** Version bump only for package aws-amplify + + + + + ## [3.3.10](https://github.com/aws-amplify/amplify-js/compare/aws-amplify@3.3.9...aws-amplify@3.3.10) (2020-11-23) **Note:** Version bump only for package aws-amplify diff --git a/packages/aws-amplify/package.json b/packages/aws-amplify/package.json index d83a4a55865..543c35c4dd2 100644 --- a/packages/aws-amplify/package.json +++ b/packages/aws-amplify/package.json @@ -1,6 +1,6 @@ { "name": "aws-amplify", - "version": "3.3.10", + "version": "3.3.11", "description": "AWS Amplify is a JavaScript library for Frontend and mobile developers building cloud-enabled applications.", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -34,18 +34,18 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/analytics": "4.0.1", - "@aws-amplify/api": "3.2.13", - "@aws-amplify/auth": "3.4.13", - "@aws-amplify/cache": "3.1.38", - "@aws-amplify/core": "3.8.5", - "@aws-amplify/datastore": "2.8.1", - "@aws-amplify/interactions": "3.3.13", - "@aws-amplify/predictions": "3.2.13", - "@aws-amplify/pubsub": "3.2.11", - "@aws-amplify/storage": "3.3.13", + "@aws-amplify/analytics": "4.0.2", + "@aws-amplify/api": "3.2.14", + "@aws-amplify/auth": "3.4.14", + "@aws-amplify/cache": "3.1.39", + "@aws-amplify/core": "3.8.6", + "@aws-amplify/datastore": "2.9.0", + "@aws-amplify/interactions": "3.3.14", + "@aws-amplify/predictions": "3.2.14", + "@aws-amplify/pubsub": "3.2.12", + "@aws-amplify/storage": "3.3.14", "@aws-amplify/ui": "2.0.2", - "@aws-amplify/xr": "2.2.13" + "@aws-amplify/xr": "2.2.14" }, "jest": { "globals": { diff --git a/packages/cache/CHANGELOG.md b/packages/cache/CHANGELOG.md index abd926cc250..cd61a3b7cef 100644 --- a/packages/cache/CHANGELOG.md +++ b/packages/cache/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.1.39](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@3.1.38...@aws-amplify/cache@3.1.39) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/cache + + + + + ## [3.1.38](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/cache@3.1.37...@aws-amplify/cache@3.1.38) (2020-11-23) **Note:** Version bump only for package @aws-amplify/cache diff --git a/packages/cache/package.json b/packages/cache/package.json index 653409add53..de3ab49ef68 100644 --- a/packages/cache/package.json +++ b/packages/cache/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/cache", - "version": "3.1.38", + "version": "3.1.39", "description": "Cache category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -44,7 +44,7 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5" + "@aws-amplify/core": "3.8.6" }, "jest": { "globals": { diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9a21d9eb75f..ee20962606a 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.8.6](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/core@3.8.5...@aws-amplify/core@3.8.6) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/core + + + + + ## [3.8.5](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/core@3.8.4...@aws-amplify/core@3.8.5) (2020-11-23) **Note:** Version bump only for package @aws-amplify/core diff --git a/packages/core/package.json b/packages/core/package.json index 09e5ef88253..9a72a01ee95 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/core", - "version": "3.8.5", + "version": "3.8.6", "description": "Core category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", diff --git a/packages/datastore/CHANGELOG.md b/packages/datastore/CHANGELOG.md index 0bc9b861a7c..3a428f54979 100644 --- a/packages/datastore/CHANGELOG.md +++ b/packages/datastore/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.9.0](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@2.8.1...@aws-amplify/datastore@2.9.0) (2020-11-30) + + +### Bug Fixes + +* **@aws-amplify/datastore:** handle groupClaim as plain string ([#7261](https://github.com/aws-amplify/amplify-js/issues/7261)) ([63e5baa](https://github.com/aws-amplify/amplify-js/commit/63e5baa4293bf6688962007137377d19c5ef8904)) + + +### Features + +* **@aws-amplify/datastore:** handle sessionId ([#7304](https://github.com/aws-amplify/amplify-js/issues/7304)) ([6e28eaf](https://github.com/aws-amplify/amplify-js/commit/6e28eaf37525ce231d7793bf82a960046fc7f8f4)) + + + + + ## [2.8.1](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/datastore@2.8.0...@aws-amplify/datastore@2.8.1) (2020-11-23) diff --git a/packages/datastore/package.json b/packages/datastore/package.json index 0439cb0b7a4..8fbbbce711d 100644 --- a/packages/datastore/package.json +++ b/packages/datastore/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/datastore", - "version": "2.8.1", + "version": "2.9.0", "description": "AppSyncLocal support for aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -48,9 +48,9 @@ "fake-indexeddb": "3.0.0" }, "dependencies": { - "@aws-amplify/api": "3.2.13", - "@aws-amplify/core": "3.8.5", - "@aws-amplify/pubsub": "3.2.11", + "@aws-amplify/api": "3.2.14", + "@aws-amplify/core": "3.8.6", + "@aws-amplify/pubsub": "3.2.12", "idb": "5.0.6", "immer": "6.0.1", "ulid": "2.3.0", diff --git a/packages/interactions/CHANGELOG.md b/packages/interactions/CHANGELOG.md index 31b8ceeeb0c..9ca269527d4 100644 --- a/packages/interactions/CHANGELOG.md +++ b/packages/interactions/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.3.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/interactions@3.3.13...@aws-amplify/interactions@3.3.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/interactions + + + + + ## [3.3.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/interactions@3.3.12...@aws-amplify/interactions@3.3.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/interactions diff --git a/packages/interactions/package.json b/packages/interactions/package.json index 125ab45f0e3..7f282b2b2fe 100644 --- a/packages/interactions/package.json +++ b/packages/interactions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/interactions", - "version": "3.3.13", + "version": "3.3.14", "description": "Interactions category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -41,7 +41,7 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5", + "@aws-amplify/core": "3.8.6", "@aws-sdk/client-lex-runtime-service": "1.0.0-rc.4" }, "jest": { diff --git a/packages/predictions/CHANGELOG.md b/packages/predictions/CHANGELOG.md index c1842519df1..1871479a488 100644 --- a/packages/predictions/CHANGELOG.md +++ b/packages/predictions/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@3.2.13...@aws-amplify/predictions@3.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/predictions + + + + + ## [3.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/predictions@3.2.12...@aws-amplify/predictions@3.2.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/predictions diff --git a/packages/predictions/package.json b/packages/predictions/package.json index 1153ac15588..1a40ef04c66 100644 --- a/packages/predictions/package.json +++ b/packages/predictions/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/predictions", - "version": "3.2.13", + "version": "3.2.14", "description": "Machine learning category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -40,8 +40,8 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5", - "@aws-amplify/storage": "3.3.13", + "@aws-amplify/core": "3.8.6", + "@aws-amplify/storage": "3.3.14", "@aws-sdk/client-comprehend": "1.0.0-rc.4", "@aws-sdk/client-polly": "1.0.0-rc.4", "@aws-sdk/client-rekognition": "1.0.0-rc.4", diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index d5063c47da3..5724dd47629 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.12](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/pubsub@3.2.11...@aws-amplify/pubsub@3.2.12) (2020-11-30) + + +### Bug Fixes + +* **@aws-amplify/pubsub:** AppSyncRealTimeProvider - fix unhandled promise rejection ([#7225](https://github.com/aws-amplify/amplify-js/issues/7225)) ([ba8a73f](https://github.com/aws-amplify/amplify-js/commit/ba8a73f41db6411b91b208fea3202408c55f029b)) + + + + + ## [3.2.11](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/pubsub@3.2.10...@aws-amplify/pubsub@3.2.11) (2020-11-23) diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 3f384106419..a273120744d 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/pubsub", - "version": "3.2.11", + "version": "3.2.12", "description": "Pubsub category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -45,9 +45,9 @@ "cpx": "^1.5.0" }, "dependencies": { - "@aws-amplify/auth": "3.4.13", - "@aws-amplify/cache": "3.1.38", - "@aws-amplify/core": "3.8.5", + "@aws-amplify/auth": "3.4.14", + "@aws-amplify/cache": "3.1.39", + "@aws-amplify/core": "3.8.6", "graphql": "14.0.0", "paho-mqtt": "^1.1.0", "uuid": "^3.2.1", diff --git a/packages/pushnotification/CHANGELOG.md b/packages/pushnotification/CHANGELOG.md index 12d08a26207..2e4d02663d7 100644 --- a/packages/pushnotification/CHANGELOG.md +++ b/packages/pushnotification/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/pushnotification@3.2.13...@aws-amplify/pushnotification@3.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/pushnotification + + + + + ## [3.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/pushnotification@3.2.12...@aws-amplify/pushnotification@3.2.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/pushnotification diff --git a/packages/pushnotification/package.json b/packages/pushnotification/package.json index c9558eff579..8dd560e0188 100644 --- a/packages/pushnotification/package.json +++ b/packages/pushnotification/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/pushnotification", - "version": "3.2.13", + "version": "3.2.14", "description": "Push notifications category of aws-amplify", "main": "./lib/index.js", "module": "./lib/index.js", @@ -44,7 +44,7 @@ "webpack": "^3.5.5" }, "dependencies": { - "@aws-amplify/core": "3.8.5", + "@aws-amplify/core": "3.8.6", "@react-native-community/push-notification-ios": "1.0.3" }, "peerdependencies": { diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 3f96d1fd2d6..bab602af6c4 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.3.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/storage@3.3.13...@aws-amplify/storage@3.3.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/storage + + + + + ## [3.3.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/storage@3.3.12...@aws-amplify/storage@3.3.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/storage diff --git a/packages/storage/package.json b/packages/storage/package.json index 54101e9d3c3..9872f0f3a19 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/storage", - "version": "3.3.13", + "version": "3.3.14", "description": "Storage category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -41,7 +41,7 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5", + "@aws-amplify/core": "3.8.6", "@aws-sdk/client-s3": "1.0.0-rc.4", "@aws-sdk/s3-request-presigner": "1.0.0-rc.4", "@aws-sdk/util-create-request": "1.0.0-rc.4", diff --git a/packages/xr/CHANGELOG.md b/packages/xr/CHANGELOG.md index 1fcaa7d607f..3e3215c759f 100644 --- a/packages/xr/CHANGELOG.md +++ b/packages/xr/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.2.14](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/xr@2.2.13...@aws-amplify/xr@2.2.14) (2020-11-30) + +**Note:** Version bump only for package @aws-amplify/xr + + + + + ## [2.2.13](https://github.com/aws-amplify/amplify-js/compare/@aws-amplify/xr@2.2.12...@aws-amplify/xr@2.2.13) (2020-11-23) **Note:** Version bump only for package @aws-amplify/xr diff --git a/packages/xr/package.json b/packages/xr/package.json index 18ec5a58480..38b4fc3bb73 100644 --- a/packages/xr/package.json +++ b/packages/xr/package.json @@ -1,6 +1,6 @@ { "name": "@aws-amplify/xr", - "version": "2.2.13", + "version": "2.2.14", "description": "XR category of aws-amplify", "main": "./lib/index.js", "module": "./lib-esm/index.js", @@ -41,7 +41,7 @@ }, "homepage": "https://aws-amplify.github.io/", "dependencies": { - "@aws-amplify/core": "3.8.5" + "@aws-amplify/core": "3.8.6" }, "jest": { "globals": { From a32f7b45eec221fe3f3bd010d09d2cb8059caad9 Mon Sep 17 00:00:00 2001 From: aws-amplify-bot Date: Mon, 30 Nov 2020 22:29:55 +0000 Subject: [PATCH 05/12] chore(release): update version.ts [ci skip] --- packages/core/src/Platform/version.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/Platform/version.ts b/packages/core/src/Platform/version.ts index 9f71bd55841..4d658521fbd 100644 --- a/packages/core/src/Platform/version.ts +++ b/packages/core/src/Platform/version.ts @@ -1,2 +1,2 @@ // generated by genversion -export const version = '3.8.5'; +export const version = '3.8.6'; From ccd7c2e5c8320fac0e01d59a509c7c9a08f65b9f Mon Sep 17 00:00:00 2001 From: William Lee <43682783+wlee221@users.noreply.github.com> Date: Mon, 30 Nov 2020 15:59:37 -0800 Subject: [PATCH 06/12] fix(@aws-amplify/ui-components): flatten `injectGlobalPaths` array --- packages/amplify-ui-components/stencil.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-ui-components/stencil.config.ts b/packages/amplify-ui-components/stencil.config.ts index 0a2a9ccf2bb..6e17326c604 100644 --- a/packages/amplify-ui-components/stencil.config.ts +++ b/packages/amplify-ui-components/stencil.config.ts @@ -24,7 +24,7 @@ export const config: Config = { }), nodePolyfills(), sass({ - injectGlobalPaths: [['src/global/breakpoint.scss', '*']], + injectGlobalPaths: ['src/global/breakpoint.scss'], }), ], nodeResolve: { From b88ca973add2fbf45c5f493d1891730b2db2f1f9 Mon Sep 17 00:00:00 2001 From: Nick <32820112+uncodable@users.noreply.github.com> Date: Tue, 1 Dec 2020 00:19:11 +0000 Subject: [PATCH 07/12] Added DataStore to README.md (#7232) Added the `DataStore` feature to the `README.md` --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a997a457bee..69d47a27870 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ If you can't migrate to [aws-sdk-js-v3](https://github.com/aws/aws-sdk-js-v3) or - [**Analytics**](https://docs.amplify.aws/lib/analytics/getting-started/q/platform/js): Easily collect analytics data for your app. Analytics data includes user sessions and other custom events that you want to track in your app. - [**REST API**](https://docs.amplify.aws/lib/restapi/getting-started/q/platform/js): Provides a simple solution when making HTTP requests. It provides an automatic, lightweight signing process which complies with AWS Signature Version 4. - [**GraphQL API**](https://docs.amplify.aws/lib/graphqlapi/getting-started/q/platform/js): Interact with your GraphQL server or AWS AppSync API with an easy-to-use & configured GraphQL client. +- [**DataStore**](https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js): A programming model for leveraging shared and distributed data without writing additional code for offline and online scenarios, which makes working with distributed, cross-user data just as simple as working with local-only data. - [**Storage**](https://docs.amplify.aws/lib/storage/getting-started/q/platform/js): Provides a simple mechanism for managing user content for your app in public, protected or private storage buckets. - [**Push Notifications**](https://docs.amplify.aws/lib/push-notifications/getting-started/q/platform/js): Allows you to integrate push notifications in your app with Amazon Pinpoint targeting and campaign management support. - [**Interactions**](https://docs.amplify.aws/lib/interactions/getting-started/q/platform/js#interactions-with-aws): Create conversational bots powered by deep learning technologies. From d9dfff3eef7e5909f76fdea6054f8c02eb7ac8a2 Mon Sep 17 00:00:00 2001 From: William Lee <43682783+wlee221@users.noreply.github.com> Date: Mon, 30 Nov 2020 16:51:33 -0800 Subject: [PATCH 08/12] style: remove double space typos (#7296) Co-authored-by: Alex Hinson --- packages/analytics/src/types/Provider.ts | 2 +- packages/api-rest/src/RestAPI.ts | 12 ++++++------ packages/api/src/API.ts | 12 ++++++------ packages/api/src/types/index.ts | 2 +- .../confirm-sign-up.component.ionic.ts | 2 +- .../sign-up-component/sign-up.component.core.ts | 2 +- packages/storage/src/types/Provider.ts | 2 +- vscode/src/extension.ts | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/analytics/src/types/Provider.ts b/packages/analytics/src/types/Provider.ts index a4ea9473ae0..c829b653a0e 100644 --- a/packages/analytics/src/types/Provider.ts +++ b/packages/analytics/src/types/Provider.ts @@ -17,7 +17,7 @@ export interface PromiseHandlers { } export interface AnalyticsProvider { - // you need to implement those methods + // you need to implement those methods // configure your provider configure(config: object): object; diff --git a/packages/api-rest/src/RestAPI.ts b/packages/api-rest/src/RestAPI.ts index 0dfa1e84003..6828e37653d 100644 --- a/packages/api-rest/src/RestAPI.ts +++ b/packages/api-rest/src/RestAPI.ts @@ -109,7 +109,7 @@ export class RestAPIClass { /** * Make a GET request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -135,7 +135,7 @@ export class RestAPIClass { /** * Make a POST request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -161,7 +161,7 @@ export class RestAPIClass { /** * Make a PUT request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -187,7 +187,7 @@ export class RestAPIClass { /** * Make a PATCH request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -213,7 +213,7 @@ export class RestAPIClass { /** * Make a DEL request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -239,7 +239,7 @@ export class RestAPIClass { /** * Make a HEAD request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. diff --git a/packages/api/src/API.ts b/packages/api/src/API.ts index 668eb9bcebe..97e0034e4ee 100644 --- a/packages/api/src/API.ts +++ b/packages/api/src/API.ts @@ -82,7 +82,7 @@ export class APIClass { /** * Make a GET request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -93,7 +93,7 @@ export class APIClass { /** * Make a POST request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -104,7 +104,7 @@ export class APIClass { /** * Make a PUT request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -115,7 +115,7 @@ export class APIClass { /** * Make a PATCH request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -126,7 +126,7 @@ export class APIClass { /** * Make a DEL request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. @@ -137,7 +137,7 @@ export class APIClass { /** * Make a HEAD request - * @param {string} apiName - The api name of the request + * @param {string} apiName - The api name of the request * @param {string} path - The path of the request * @param {json} [init] - Request extra params * @return {Promise} - A promise that resolves to an object with response status and JSON data, if successful. diff --git a/packages/api/src/types/index.ts b/packages/api/src/types/index.ts index d52073e8dc1..b9b1a944a43 100644 --- a/packages/api/src/types/index.ts +++ b/packages/api/src/types/index.ts @@ -12,7 +12,7 @@ */ /** - * This exports from the types directory is a temporary workaround, since Amplify CLI currently + * This exports from the types directory is a temporary workaround, since Amplify CLI currently * generates code that relies on this import path https://github.com/aws-amplify/amplify-cli/issues/3863 * This will be removed in future release when CLI and customers moves to recommeneded import styles. */ diff --git a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts index 955988585f8..7f3f43935ef 100644 --- a/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts +++ b/packages/aws-amplify-angular/src/components/authenticator/confirm-sign-up-component/confirm-sign-up.component.ionic.ts @@ -46,7 +46,7 @@ const template = ` - + {{ this.amplifyService.i18n().get('Code *') }} 0) { return this._setError( diff --git a/packages/storage/src/types/Provider.ts b/packages/storage/src/types/Provider.ts index 47a50a713ec..a94def53cfc 100644 --- a/packages/storage/src/types/Provider.ts +++ b/packages/storage/src/types/Provider.ts @@ -11,7 +11,7 @@ * and limitations under the License. */ export interface StorageProvider { - // you need to implement those methods + // you need to implement those methods // configure your provider configure(config: object): object; diff --git a/vscode/src/extension.ts b/vscode/src/extension.ts index 3ee0d83af74..4a1db98bffa 100644 --- a/vscode/src/extension.ts +++ b/vscode/src/extension.ts @@ -13,7 +13,7 @@ export function activate(context: vscode.ExtensionContext) { console.log('Congratulations, your extension "vs-code-snippets" is now active!'); // The command has been defined in the package.json file - // Now provide the implementation of the command with registerCommand + // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json let disposable = vscode.commands.registerCommand('extension.sayHello', () => { // The code you place here will be executed every time your command is executed From 0b82781e946e6bef15f7b162d0ea538fc8ac5100 Mon Sep 17 00:00:00 2001 From: Alex Hinson Date: Tue, 1 Dec 2020 14:32:55 -0800 Subject: [PATCH 09/12] fix(@aws-amplify/datastore): fix custom ownerField selection set (#7317) * fix(@aws-amplify/datastore): handle custom owner in selection set --- .../datastore/__tests__/subscription.test.ts | 82 ++++ packages/datastore/__tests__/utils.test.ts | 359 ++++++++++++++++++ packages/datastore/src/sync/utils.ts | 30 +- 3 files changed, 459 insertions(+), 12 deletions(-) create mode 100644 packages/datastore/__tests__/utils.test.ts diff --git a/packages/datastore/__tests__/subscription.test.ts b/packages/datastore/__tests__/subscription.test.ts index 9ebb700481f..158523f3cd3 100644 --- a/packages/datastore/__tests__/subscription.test.ts +++ b/packages/datastore/__tests__/subscription.test.ts @@ -329,6 +329,88 @@ describe('sync engine subscription module', () => { ) ).toEqual(authInfo); }); + test('owner authorization with custom owner (explicit)', () => { + const model: SchemaModel = { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + customOwner: { + name: 'customOwner', + isArray: false, + type: 'String', + isRequired: false, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'customOwner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }; + const tokenPayload = { + sub: 'xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx', + 'cognito:groups': ['mygroup'], + email_verified: true, + iss: 'https://cognito-idp.us-west-2.amazonaws.com/us-west-2_XXXXXXXX', + phone_number_verified: false, + 'cognito:username': 'user1', + aud: '6l99pm4b729dn8c7bj7d3t1lnc', + event_id: 'b4c25daa-0c03-4617-aab8-e5c74403536b', + token_use: 'id', + auth_time: 1578541322, + phone_number: '+12068220398', + exp: 1578544922, + iat: 1578541322, + email: 'user1@user.com', + }; + const authInfo = { + authMode: 'AMAZON_COGNITO_USER_POOLS', + isOwner: true, + ownerField: 'customOwner', + ownerValue: 'user1', + }; + + expect( + // @ts-ignore + SubscriptionProcessor.prototype.getAuthorizationInfo( + model, + USER_CREDENTIALS.auth, + GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS, + tokenPayload + ) + ).toEqual(authInfo); + }); test('groups authorization', () => { const model: SchemaModel = { syncable: true, diff --git a/packages/datastore/__tests__/utils.test.ts b/packages/datastore/__tests__/utils.test.ts new file mode 100644 index 00000000000..15b8ade2983 --- /dev/null +++ b/packages/datastore/__tests__/utils.test.ts @@ -0,0 +1,359 @@ +import { SchemaModel, SchemaNamespace } from '../src/types'; +import { generateSelectionSet } from '../src/sync/utils'; + +describe('DataStore - utils', () => { + describe('generateSelectionSet', () => { + test('implicit owner', () => { + const namespace: SchemaNamespace = { + name: 'user', + models: { + Post: { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'owner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }, + }, + enums: {}, + nonModels: {}, + relationships: { + Post: { + indexes: [], + relationTypes: [], + }, + }, + }; + const modelDefinition: SchemaModel = { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'owner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }; + + const selectionSet = `id +title +owner +_version +_lastChangedAt +_deleted`; + + expect(generateSelectionSet(namespace, modelDefinition)).toEqual( + selectionSet + ); + }); + test('explicit owner', () => { + const namespace: SchemaNamespace = { + name: 'user', + models: { + Post: { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + owner: { + name: 'owner', + isArray: false, + type: 'String', + isRequired: false, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'owner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }, + }, + enums: {}, + nonModels: {}, + relationships: { + Post: { + indexes: [], + relationTypes: [], + }, + }, + }; + const modelDefinition: SchemaModel = { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + owner: { + name: 'owner', + isArray: false, + type: 'String', + isRequired: false, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'owner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }; + + const selectionSet = `id +title +owner +_version +_lastChangedAt +_deleted`; + + expect(generateSelectionSet(namespace, modelDefinition)).toEqual( + selectionSet + ); + }); + test('explicit custom owner', () => { + const namespace: SchemaNamespace = { + name: 'user', + models: { + Post: { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + customOwner: { + name: 'customOwner', + isArray: false, + type: 'String', + isRequired: false, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'customOwner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }, + }, + enums: {}, + nonModels: {}, + relationships: { + Post: { + indexes: [], + relationTypes: [], + }, + }, + }; + const modelDefinition: SchemaModel = { + name: 'Post', + fields: { + id: { + name: 'id', + isArray: false, + type: 'ID', + isRequired: true, + attributes: [], + }, + title: { + name: 'title', + isArray: false, + type: 'String', + isRequired: true, + attributes: [], + }, + customOwner: { + name: 'customOwner', + isArray: false, + type: 'String', + isRequired: false, + attributes: [], + }, + }, + syncable: true, + pluralName: 'Posts', + attributes: [ + { + type: 'model', + properties: {}, + }, + { + type: 'auth', + properties: { + rules: [ + { + provider: 'userPools', + ownerField: 'customOwner', + allow: 'owner', + identityClaim: 'cognito:username', + operations: ['create', 'update', 'delete', 'read'], + }, + ], + }, + }, + ], + }; + + const selectionSet = `id +title +customOwner +_version +_lastChangedAt +_deleted`; + + expect(generateSelectionSet(namespace, modelDefinition)).toEqual( + selectionSet + ); + }); + }); +}); diff --git a/packages/datastore/src/sync/utils.ts b/packages/datastore/src/sync/utils.ts index fcd334b0a05..8f9b1639a84 100644 --- a/packages/datastore/src/sync/utils.ts +++ b/packages/datastore/src/sync/utils.ts @@ -83,23 +83,29 @@ function getImplicitOwnerField( modelDefinition: SchemaModel | SchemaNonModel, scalarFields: ModelFields ) { - if (!scalarFields.owner && isOwnerBasedModel(modelDefinition)) { + const ownerFields = getOwnerFields(modelDefinition); + + if (!scalarFields.owner && ownerFields.includes('owner')) { return ['owner']; } return []; } -function isOwnerBasedModel(modelDefinition: SchemaModel | SchemaNonModel) { - return ( - isSchemaModel(modelDefinition) && - modelDefinition.attributes && - modelDefinition.attributes.some( - attr => - attr.properties && - attr.properties.rules && - attr.properties.rules.some(rule => rule.allow === 'owner') - ) - ); +function getOwnerFields( + modelDefinition: SchemaModel | SchemaNonModel +): string[] { + const ownerFields: string[] = []; + if (isSchemaModel(modelDefinition) && modelDefinition.attributes) { + modelDefinition.attributes.forEach(attr => { + if (attr.properties && attr.properties.rules) { + const rule = attr.properties.rules.find(rule => rule.allow === 'owner'); + if (rule && rule.ownerField) { + ownerFields.push(rule.ownerField); + } + } + }); + } + return ownerFields; } function getScalarFields( From 84b4a8832305a34c0a84484dcc623f4cdf036b10 Mon Sep 17 00:00:00 2001 From: Alex Hinson Date: Tue, 1 Dec 2020 15:30:51 -0800 Subject: [PATCH 10/12] chore: add DataStore owner-custom-field-default integ (#7319) --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3945442eaf8..4996372e97f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -677,6 +677,7 @@ datastore_auth_scenarios: &datastore_auth_scenarios public-auth-default, public-auth-iam, owner-custom-claim-default, + owner-custom-field-default, ] workflows: From a3f572ef0f6a8d30a08c859fe3d2107ccbf8e5ff Mon Sep 17 00:00:00 2001 From: nubpro Date: Thu, 3 Dec 2020 02:11:20 +0800 Subject: [PATCH 11/12] fix(@aws-amplify/ui-react): fix cant resolve 'fs' when bundling with webpack on windows (#7222) --- packages/amplify-ui-react/webpack.config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/amplify-ui-react/webpack.config.js b/packages/amplify-ui-react/webpack.config.js index bd17ff64504..38c6b956dd9 100644 --- a/packages/amplify-ui-react/webpack.config.js +++ b/packages/amplify-ui-react/webpack.config.js @@ -50,4 +50,7 @@ module.exports = { }, ], }, + node: { + fs: 'empty', + }, }; From 4d0a2e34a21eb96b9085efcdd8f7846734bf33f7 Mon Sep 17 00:00:00 2001 From: nubpro Date: Thu, 3 Dec 2020 03:21:17 +0800 Subject: [PATCH 12/12] fix(@aws-amplify/datastore): Fix ctlSubsSubscription not getting unsubscribed when device goes offline (#7250) --- packages/datastore/src/sync/index.ts | 46 +++++++++++----------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/packages/datastore/src/sync/index.ts b/packages/datastore/src/sync/index.ts index bafbeb68ba4..353673eb60d 100644 --- a/packages/datastore/src/sync/index.ts +++ b/packages/datastore/src/sync/index.ts @@ -196,12 +196,24 @@ export class SyncEngine { ] = this.subscriptionsProcessor.start(); try { - subscriptions.push( - await this.waitForSubscriptionsReady( - ctlSubsObservable, - datastoreConnectivity - ) - ); + await new Promise((resolve, reject) => { + const ctlSubsSubscription = ctlSubsObservable.subscribe({ + next: msg => { + if (msg === CONTROL_MSG.CONNECTED) { + resolve(); + } + }, + error: err => { + reject(err); + const handleDisconnect = this.disconnectionHandler( + datastoreConnectivity + ); + handleDisconnect(err); + }, + }); + + subscriptions.push(ctlSubsSubscription); + }); } catch (err) { observer.error(err); return; @@ -676,28 +688,6 @@ export class SyncEngine { }; } - private async waitForSubscriptionsReady( - ctlSubsObservable: Observable, - datastoreConnectivity: DataStoreConnectivity - ): Promise { - return new Promise((resolve, reject) => { - const subscription = ctlSubsObservable.subscribe({ - next: msg => { - if (msg === CONTROL_MSG.CONNECTED) { - resolve(subscription); - } - }, - error: err => { - reject(err); - const handleDisconnect = this.disconnectionHandler( - datastoreConnectivity - ); - handleDisconnect(err); - }, - }); - }); - } - private async setupModels(params: StartParams) { const { fullSyncInterval } = params; const ModelMetadata = this.modelClasses