Skip to content

Commit

Permalink
chore: revert a bad push (#9562)
Browse files Browse the repository at this point in the history
* feat(@aws-amplify/datastore): ObserveQuery performance and type enhancements (#9141)

* feat(@aws-amplify/datastore): constrain ObserveQuery options with explicit Type, add time interval/limit Promise race

* feat(@aws-amplify/datastore): address PR callouts

* feat(@aws-amplify/datastore): abstract SubscriptionBuffer to util class (TODO: add unit test)

* feat(@aws-amplify/datastore): add unit test for util class

* remove .only from test

* feat(@aws-amplify/datastore): address PR callouts

* remove .only from describe block

* feat(@aws-amplify/datastore): PR-callouts, adjust naming conventions

Co-authored-by: Sam Martinez <samlmar@amazon.com>

* fix(@aws-amplify/pushnotification): tap on notification opens the app when it is a killed state (#9055)

* feat: new script to improve local dev experience for RN

* feat: rn local dev script

* docs: adds the needed documentation for running the local rn dev script

* fix: pr review changes, formatting and code clean up

* fix: refactored the open tab function and minor code cleanup

* refactor: utility functions for lerna and wml cmd formation and added comments

* fix: attempt to fix the lgtm bot issue to sanitized the path input

* fix: attempt 2 to build cmds after sanitizing the path

* fix: attempt three at solving the bot warning, sanatizes alias,npm bin and cd commands

* refactor

* fix: attempt four at fixing the lgtm warning

* fix: clearer documentation on the usage of the script

* refactor: change get delay and open new tab names

* refactor: changed all caps wording to camel case for gotopackageroot element

* feat: all flag to indicate script should use all supported packages

* fix: adds a new UI packages list that is used to change their package name to directory name used in wml

* refactor: adds a clear note to indicate script is different from the linking method of development

* fix:handle reactContext is null by listening to changes

* refactor: rephrase comment

Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>

* refactor: emitNotificationOpened has been refactored to a new function and other nits

* fix: adds an intent parameter to emitNotificationOpenedEvent

* refactor: makes variables final

Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>
Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: Ashish Nanda <ashish.nanda.5591@gmail.com>

* feat(amplify-js): add CD support (#9171)

* fix: AWSAppSyncRealTimeProvider websocket init fix

* Revert "fix: AWSAppSyncRealTimeProvider websocket init fix"

This reverts commit 13e776e.

* fix: AWSAppSyncRealTimeProvider websocket init fix (#9200)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.33
 - @aws-amplify/ui-components@1.9.4
 - @aws-amplify/ui-react@1.2.24
 - @aws-amplify/ui-storybook@2.0.24
 - @aws-amplify/ui-vue@1.1.18
 - @aws-amplify/analytics@5.1.4
 - @aws-amplify/api-graphql@2.2.13
 - @aws-amplify/api-rest@2.0.24
 - @aws-amplify/api@4.0.24
 - @aws-amplify/auth@4.3.14
 - aws-amplify-angular@6.0.24
 - aws-amplify-react-native@6.0.1
 - aws-amplify-react@5.1.7
 - aws-amplify@4.3.6
 - @aws-amplify/cache@4.0.26
 - @aws-amplify/core@4.3.6
 - @aws-amplify/datastore-storage-adapter@1.1.12
 - @aws-amplify/datastore@3.6.0
 - @aws-amplify/geo@1.1.6
 - @aws-amplify/interactions@4.0.24
 - @aws-amplify/predictions@4.0.24
 - @aws-amplify/pubsub@4.2.0
 - @aws-amplify/pushnotification@4.3.3
 - @aws-amplify/storage@4.4.7
 - @aws-amplify/xr@3.0.24

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/pushnotification): Upgrade Firebase Android package (#9191)

* feat: new script to improve local dev experience for RN

* feat: rn local dev script

* docs: adds the needed documentation for running the local rn dev script

* fix: pr review changes, formatting and code clean up

* fix: refactored the open tab function and minor code cleanup

* refactor: utility functions for lerna and wml cmd formation and added comments

* fix: attempt to fix the lgtm bot issue to sanitized the path input

* fix: attempt 2 to build cmds after sanitizing the path

* fix: attempt three at solving the bot warning, sanatizes alias,npm bin and cd commands

* refactor

* fix: attempt four at fixing the lgtm warning

* fix: clearer documentation on the usage of the script

* refactor: change get delay and open new tab names

* refactor: changed all caps wording to camel case for gotopackageroot element

* feat: all flag to indicate script should use all supported packages

* fix: adds a new UI packages list that is used to change their package name to directory name used in wml

* refactor: adds a clear note to indicate script is different from the linking method of development

* chore: upgrade firebase package and made required changes to getToken and onNewToken

* refactor: review comments, added exception handling to get token

* Apply suggestions from code review

Co-authored-by: Sam Martinez  <sammartinez19@gmail.com>
Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>

* refactor: formatting updates

* refactor: formatting updates

* remove react event listener so no multiples are registered and adds an error callback to get token

Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: Ashish Nanda <ashish.nanda.5591@gmail.com>
Co-authored-by: Caleb Pollman <cpollman1@gmail.com>
Co-authored-by: Sam Martinez  <sammartinez19@gmail.com>
Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.34
 - @aws-amplify/ui-components@1.9.5
 - @aws-amplify/ui-react@1.2.25
 - @aws-amplify/ui-storybook@2.0.25
 - @aws-amplify/ui-vue@1.1.19
 - @aws-amplify/analytics@5.1.5
 - @aws-amplify/api-graphql@2.2.14
 - @aws-amplify/api-rest@2.0.25
 - @aws-amplify/api@4.0.25
 - @aws-amplify/auth@4.3.15
 - aws-amplify-angular@6.0.25
 - aws-amplify-react@5.1.8
 - aws-amplify@4.3.7
 - @aws-amplify/cache@4.0.27
 - @aws-amplify/core@4.3.7
 - @aws-amplify/datastore-storage-adapter@1.1.13
 - @aws-amplify/datastore@3.6.1
 - @aws-amplify/geo@1.1.7
 - @aws-amplify/interactions@4.0.25
 - @aws-amplify/predictions@4.0.25
 - @aws-amplify/pubsub@4.2.1
 - @aws-amplify/pushnotification@4.3.4
 - @aws-amplify/storage@4.4.8
 - @aws-amplify/xr@3.0.25

* chore(release): update version.ts [ci skip]

* feat(@aws-amplify/datastore): hasOne CRUD improvements (#9239)

* fix(geo): update client-location to fix tslib issue (#9247)

#8967

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.35
 - @aws-amplify/ui-components@1.9.6
 - @aws-amplify/ui-react@1.2.26
 - @aws-amplify/ui-storybook@2.0.26
 - @aws-amplify/ui-vue@1.1.20
 - @aws-amplify/analytics@5.1.6
 - @aws-amplify/api-graphql@2.2.15
 - @aws-amplify/api-rest@2.0.26
 - @aws-amplify/api@4.0.26
 - @aws-amplify/auth@4.3.16
 - aws-amplify-angular@6.0.26
 - aws-amplify-react@5.1.9
 - aws-amplify@4.3.8
 - @aws-amplify/cache@4.0.28
 - @aws-amplify/core@4.3.8
 - @aws-amplify/datastore-storage-adapter@1.2.0
 - @aws-amplify/datastore@3.7.0
 - @aws-amplify/geo@1.1.8
 - @aws-amplify/interactions@4.0.26
 - @aws-amplify/predictions@4.0.26
 - @aws-amplify/pubsub@4.2.2
 - @aws-amplify/pushnotification@4.3.5
 - @aws-amplify/storage@4.4.9
 - @aws-amplify/xr@3.0.26

* chore(release): update version.ts [ci skip]

* chore(@aws-amplify/datastore): bump dexie packages (#9262)

* chore: mark ui packages as private (#9251)

* fix(@aws-amplify/datastore): belongsTo bug (#9268)

* fix(@aws-amplify/core): Use undefined for default sequence token with CloudWatch logging (#9181)

Co-authored-by: Aaron Michael Lamb <aarolamb@amazon.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* chore(@aws-amplify/analytics): Changed a couple file in dos format to unix (#9199)

* dos->unix

Co-authored-by: Sam Martinez  <sammartinez19@gmail.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>

* fix(@aws-amplify/datastore): consecutive saves with timestamps (#9298)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.36
 - @aws-amplify/ui-components@1.9.7
 - @aws-amplify/ui-react@1.2.27
 - @aws-amplify/ui-storybook@2.0.27
 - @aws-amplify/ui-vue@1.1.21
 - @aws-amplify/ui@2.0.4
 - @aws-amplify/analytics@5.1.7
 - @aws-amplify/api-graphql@2.2.16
 - @aws-amplify/api-rest@2.0.27
 - @aws-amplify/api@4.0.27
 - @aws-amplify/auth@4.3.17
 - aws-amplify-angular@6.0.27
 - aws-amplify-react@5.1.10
 - aws-amplify-vue@2.1.6
 - aws-amplify@4.3.9
 - @aws-amplify/cache@4.0.29
 - @aws-amplify/core@4.3.9
 - @aws-amplify/datastore-storage-adapter@1.2.1
 - @aws-amplify/datastore@3.7.1
 - @aws-amplify/geo@1.1.9
 - @aws-amplify/interactions@4.0.27
 - @aws-amplify/predictions@4.0.27
 - @aws-amplify/pubsub@4.2.3
 - @aws-amplify/pushnotification@4.3.6
 - @aws-amplify/storage@4.4.10
 - @aws-amplify/xr@3.0.27

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/amplify-ui): change private property to false in package.json (#9303)

Resolving an issue with installing the library

* chore: preparing release

* fix(@aws-amplify/amplify-ui): remove private prop from package.json (#9304)

* fix(@aws-amplify/amplify-ui): change private property to false in package.json

* fix(@aws-amplify/amplify-ui): remove private property from package.json

Co-authored-by: Francisco Rodriguez <frodriguez.cs@gmail.com>

* fix(@aws-amplify/amplify-ui): remove private prop from package.json (#9304)

* fix(@aws-amplify/amplify-ui): change private property to false in package.json

* fix(@aws-amplify/amplify-ui): remove private property from package.json

Co-authored-by: Francisco Rodriguez <frodriguez.cs@gmail.com>

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.37
 - @aws-amplify/ui-components@1.9.8
 - @aws-amplify/ui-react@1.2.28
 - @aws-amplify/ui-storybook@2.0.28
 - @aws-amplify/ui-vue@1.1.22
 - @aws-amplify/ui@2.0.5
 - @aws-amplify/analytics@5.1.8
 - @aws-amplify/api-graphql@2.2.17
 - @aws-amplify/api-rest@2.0.28
 - @aws-amplify/api@4.0.28
 - @aws-amplify/auth@4.3.18
 - aws-amplify-angular@6.0.28
 - aws-amplify-react@5.1.11
 - aws-amplify@4.3.10
 - @aws-amplify/cache@4.0.30
 - @aws-amplify/core@4.3.10
 - @aws-amplify/datastore-storage-adapter@1.2.2
 - @aws-amplify/datastore@3.7.2
 - @aws-amplify/geo@1.1.10
 - @aws-amplify/interactions@4.0.28
 - @aws-amplify/predictions@4.0.28
 - @aws-amplify/pubsub@4.2.4
 - @aws-amplify/pushnotification@4.3.7
 - @aws-amplify/storage@4.4.11
 - @aws-amplify/xr@3.0.28

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/datastore): fixes observeQuery in local-only mode (#9300)

* fix(@aws-amplify/pushnotification): make eligible variables final (#9301)

Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: Caleb Pollman <cpollman1@gmail.com>

* fix(@aws-amplify/aws-amplify-react-native): fix dev build for Windows (#9341)

* fix(@aws-amplify/api-graphql): Fix webpack build (#9358)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.38
 - @aws-amplify/ui-components@1.9.9
 - @aws-amplify/ui-react@1.2.29
 - @aws-amplify/ui-storybook@2.0.29
 - @aws-amplify/ui-vue@1.1.23
 - @aws-amplify/analytics@5.1.9
 - @aws-amplify/api-graphql@2.2.18
 - @aws-amplify/api-rest@2.0.29
 - @aws-amplify/api@4.0.29
 - @aws-amplify/auth@4.3.19
 - aws-amplify-angular@6.0.29
 - aws-amplify-react-native@6.0.2
 - aws-amplify-react@5.1.12
 - aws-amplify@4.3.11
 - @aws-amplify/cache@4.0.31
 - @aws-amplify/core@4.3.11
 - @aws-amplify/datastore-storage-adapter@1.2.3
 - @aws-amplify/datastore@3.7.3
 - @aws-amplify/geo@1.1.11
 - @aws-amplify/interactions@4.0.29
 - @aws-amplify/predictions@4.0.29
 - @aws-amplify/pubsub@4.2.5
 - @aws-amplify/pushnotification@4.3.8
 - @aws-amplify/storage@4.4.12
 - @aws-amplify/xr@3.0.29

* chore(release): update version.ts [ci skip]

* Fix typo in comment (psuedo) (#9389)

* fix(amazon-cognito-identity-js): added missing method param (#9276)

added missing method param for updateAttributes(...) method

fixes: #9275

* chore: add transformer v2 DataStore integ tests to CCI pipeline (#9354)

* modify config.yml to add v2 tests to pipeline

* comment out all non-v2 jobs for quick iteration

* needs integ_setup job

* modify v2 sample app path names for CCI

* re-enable auth v1 owner-and-group-same-model-default integ test for regression validation

* re-enable auth v1 owner-and-group-same-model-default integ test for regression validation

* re-enable auth tests

* enable v1 datastore integ tests

* fix(@aws-amplify/datastore): consecutive saves with timestamps (#9298)

* chore: preparing release

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.36
 - @aws-amplify/ui-components@1.9.7
 - @aws-amplify/ui-react@1.2.27
 - @aws-amplify/ui-storybook@2.0.27
 - @aws-amplify/ui-vue@1.1.21
 - @aws-amplify/ui@2.0.4
 - @aws-amplify/analytics@5.1.7
 - @aws-amplify/api-graphql@2.2.16
 - @aws-amplify/api-rest@2.0.27
 - @aws-amplify/api@4.0.27
 - @aws-amplify/auth@4.3.17
 - aws-amplify-angular@6.0.27
 - aws-amplify-react@5.1.10
 - aws-amplify-vue@2.1.6
 - aws-amplify@4.3.9
 - @aws-amplify/cache@4.0.29
 - @aws-amplify/core@4.3.9
 - @aws-amplify/datastore-storage-adapter@1.2.1
 - @aws-amplify/datastore@3.7.1
 - @aws-amplify/geo@1.1.9
 - @aws-amplify/interactions@4.0.27
 - @aws-amplify/predictions@4.0.27
 - @aws-amplify/pubsub@4.2.3
 - @aws-amplify/pushnotification@4.3.6
 - @aws-amplify/storage@4.4.10
 - @aws-amplify/xr@3.0.27

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/amplify-ui): change private property to false in package.json (#9303)

Resolving an issue with installing the library

* chore: preparing release

* fix(@aws-amplify/amplify-ui): remove private prop from package.json (#9304)

* fix(@aws-amplify/amplify-ui): change private property to false in package.json

* fix(@aws-amplify/amplify-ui): remove private property from package.json

Co-authored-by: Francisco Rodriguez <frodriguez.cs@gmail.com>

* chore(release): Publish [ci skip]

 - @aws-amplify/ui-angular@1.0.37
 - @aws-amplify/ui-components@1.9.8
 - @aws-amplify/ui-react@1.2.28
 - @aws-amplify/ui-storybook@2.0.28
 - @aws-amplify/ui-vue@1.1.22
 - @aws-amplify/ui@2.0.5
 - @aws-amplify/analytics@5.1.8
 - @aws-amplify/api-graphql@2.2.17
 - @aws-amplify/api-rest@2.0.28
 - @aws-amplify/api@4.0.28
 - @aws-amplify/auth@4.3.18
 - aws-amplify-angular@6.0.28
 - aws-amplify-react@5.1.11
 - aws-amplify@4.3.10
 - @aws-amplify/cache@4.0.30
 - @aws-amplify/core@4.3.10
 - @aws-amplify/datastore-storage-adapter@1.2.2
 - @aws-amplify/datastore@3.7.2
 - @aws-amplify/geo@1.1.10
 - @aws-amplify/interactions@4.0.28
 - @aws-amplify/predictions@4.0.28
 - @aws-amplify/pubsub@4.2.4
 - @aws-amplify/pushnotification@4.3.7
 - @aws-amplify/storage@4.4.11
 - @aws-amplify/xr@3.0.28

* chore(release): update version.ts [ci skip]

* fix(@aws-amplify/datastore): fixes observeQuery in local-only mode (#9300)

* uncomment tests, prepare for main pipeline addition

* add v2 tests to deploy job

* add observe query integ tests to the pipeline

* add SQLite adapter e2e test to pipeline

Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>
Co-authored-by: aws-amplify-bot <aws@amazon.com>
Co-authored-by: Francisco Rodriguez <frodriguez.cs@gmail.com>

* ci: upgrade macOS executors (#9431)

* fix(@aws-amplify/core): use empty string as translation (#9403)

* fix for using empty string as translation

* Update I18n.ts

strict inequality with undefined for the dictionary values

Co-authored-by: Eddy Varela <eddvar@amazon.com>
Co-authored-by: Nick Arocho <16296496+nickarocho@users.noreply.github.com>

* Revert "fix(@aws-amplify/core): use empty string as translation (#9403)" (#9436)

This reverts commit 512fd99.

* chore: preparing release

* fix(aws-amplify-angular): removed old zone package (#9437)

* chore: preparing release (#9441)

Co-authored-by: James Au <40404256+jamesaucode@users.noreply.github.com>

* chore(release): Publish [ci skip]

 - amazon-cognito-identity-js@5.2.4
 - @aws-amplify/ui-angular@1.0.39
 - @aws-amplify/ui-components@1.9.10
 - @aws-amplify/ui-react@1.2.30
 - @aws-amplify/ui-storybook@2.0.30
 - @aws-amplify/ui-vue@1.1.24
 - @aws-amplify/analytics@5.1.10
 - @aws-amplify/api-graphql@2.2.19
 - @aws-amplify/api-rest@2.0.30
 - @aws-amplify/api@4.0.30
 - @aws-amplify/auth@4.3.20
 - aws-amplify-angular@6.0.30
 - aws-amplify-react@5.1.13
 - aws-amplify@4.3.12
 - @aws-amplify/cache@4.0.32
 - @aws-amplify/core@4.3.12
 - @aws-amplify/datastore-storage-adapter@1.2.4
 - @aws-amplify/datastore@3.7.4
 - @aws-amplify/geo@1.1.12
 - @aws-amplify/interactions@4.0.30
 - @aws-amplify/predictions@4.0.30
 - @aws-amplify/pubsub@4.2.6
 - @aws-amplify/pushnotification@4.3.9
 - @aws-amplify/storage@4.4.13
 - @aws-amplify/xr@3.0.30

* chore(release): update version.ts [ci skip]

* chore(amplify-js): consolidate react-native dependencies (#9451)

* Revert "chore(amplify-js): consolidate react-native dependencies (#9451)" (#9473)

This reverts commit d304f94.

* fix: Fix CircleCI integration tests (#9500)

* fix: pin jsdoc version (#9510)

The latest jsdoc requires node >= 14. Pinning it to an older version to avoid upgrading our docker images' node version.

* fix(geo): remove 'ensure to' from error message

* chore(geo): remove file that's no longer used

* chore(geo): fix type comment

* fix(geo): error if mutually exclusive options are given

* test(@aws-amplify/geo): fix failing tests

* chore(amplify-js): consolidate react-native dependencies (#9521)

* feat(@aws-amplify/auth): Delete user API exposed (#9428)

* fix for using empty string as translation

* feat(@aws-amplify/auth): delete user poc

* reverting internationalization commit

* adding hub event

* addressing feedback and beginning unit tests

* added unit tests within suite for deleteUser API call

* removing zone dependency to fix failing builds

* integ test commit

* fix e2e for delete user

* adding branch for deleteUser in sample staging repo

* pinning jsdoc dependency

* one more time

* adding fixes for hosted ui

* preventing signout race condition

* fixing circle ci

* hot fix

* circle ci configured for deleteUser

* fixing pr comments

* changing tests and updating circle ci

* reverting circle ci config

* adding integ tests

* staging url

* removing comments

* empty commit

* rerun integ test

* remove deploy and post release step

* run only delete user test

* correct config

* rerun integ test

* uncomment test

* fix unit test

* final auth

* revert i18N change

* addressing pr comments

* resolving promise

* remove missed signout

* ts nit

Co-authored-by: yanakatty <yu@yanakatty.com>
Co-authored-by: Ashika Kasiviswanathan Arumugakarthik <akasivis@amazon.com>

* chore: preparing release

* chore(release): Publish [ci skip]

 - amazon-cognito-identity-js@5.2.5
 - @aws-amplify/ui-angular@1.0.40
 - @aws-amplify/ui-components@1.9.11
 - @aws-amplify/ui-react@1.2.31
 - @aws-amplify/ui-storybook@2.0.31
 - @aws-amplify/ui-vue@1.1.25
 - @aws-amplify/analytics@5.1.11
 - @aws-amplify/api-graphql@2.2.20
 - @aws-amplify/api-rest@2.0.31
 - @aws-amplify/api@4.0.31
 - @aws-amplify/auth@4.4.0
 - aws-amplify-angular@6.0.31
 - aws-amplify-react@5.1.14
 - aws-amplify@4.3.13
 - @aws-amplify/cache@4.0.33
 - @aws-amplify/core@4.3.13
 - @aws-amplify/datastore-storage-adapter@1.2.5
 - @aws-amplify/datastore@3.7.5
 - @aws-amplify/geo@1.1.13
 - @aws-amplify/interactions@4.0.31
 - @aws-amplify/predictions@4.0.31
 - @aws-amplify/pubsub@4.2.7
 - @aws-amplify/pushnotification@4.3.10
 - @aws-amplify/storage@4.4.14
 - @aws-amplify/xr@3.0.31

* chore(release): update version.ts [ci skip]

* chore(react-native): upgrade React Native devDependency version to ^0.64.1 (#9525)

* upgrade next version to ^11.1.3 for security patch (#9533)

* import React Native headers from <React/*.h> (#9387)

This ensures compatibility with Expo SDK 44.

see expo/expo#15622 (comment)

Co-authored-by: Caleb Pollman <cpollman1@gmail.com>
Co-authored-by: KJ(Kaijie) Huang <kaijih@amazon.com>

* fix(datastore): correctly apply config values (#9542)

* feat(@aws-amplify/geo): searchForSuggestions API (#9516)

* feat(geo): searchForSuggestions initial implementation

* chore(@aws-amplify/geo): update dependencies

* chore(@aws-amplify/geo): update test strings

* test(@aws-amplify/geo): update searchForSuggestion tests

* added missing import

* Revert "Merge branch 'datastore-laziness' into datastore-laziness"

This reverts commit 20d803c, reversing
changes made to c50e13f.

Co-authored-by: Nick Arocho <16296496+nickarocho@users.noreply.github.com>
Co-authored-by: Sam Martinez <samlmar@amazon.com>
Co-authored-by: ManojNB <manojnb95@gmail.com>
Co-authored-by: Manoj NB <manojnb@amazon.com>
Co-authored-by: Chris F <5827964+cshfang@users.noreply.github.com>
Co-authored-by: Ashish Nanda <ashish.nanda.5591@gmail.com>
Co-authored-by: David McAfee <mcafd@amazon.com>
Co-authored-by: aws-amplify-bot <aws@amazon.com>
Co-authored-by: Caleb Pollman <cpollman1@gmail.com>
Co-authored-by: Sam Martinez  <sammartinez19@gmail.com>
Co-authored-by: Ashika Kasiviswanathan Arumugakarthik <akasivis@amazon.com>
Co-authored-by: Ivan Artemiev <29709626+iartemiev@users.noreply.github.com>
Co-authored-by: Tré Ammatuna <16496746+TreTuna@users.noreply.github.com>
Co-authored-by: William Lee <43682783+wlee221@users.noreply.github.com>
Co-authored-by: Aaron Lamb <aaronlamb93@gmail.com>
Co-authored-by: Aaron Michael Lamb <aarolamb@amazon.com>
Co-authored-by: Ashika <35131273+ashika01@users.noreply.github.com>
Co-authored-by: James Au <40404256+jamesaucode@users.noreply.github.com>
Co-authored-by: Nick Arocho <nicaroch@amazon.com>
Co-authored-by: Francisco Rodriguez <frodriguez.cs@gmail.com>
Co-authored-by: Katie Goines <katiegoi@amazon.com>
Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
Co-authored-by: Arthur Brandstetter <31988348+brandart@users.noreply.github.com>
Co-authored-by: Yusuke Yanaka <yu@yanakatty.com>
Co-authored-by: Eddy Varela <eddvar@amazon.com>
Co-authored-by: Tré Ammatuna <tretuna@amazon.com>
Co-authored-by: hkjpotato <hkjpotato@gmail.com>
Co-authored-by: KJ(Kaijie) Huang <kaijih@amazon.com>
Co-authored-by: Manuel Schiller <meisterpink@gmail.com>
  • Loading branch information
1 parent 20d803c commit 22a56a0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/datastore/src/datastore/datastore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ function modelInstanceCreator<T extends PersistentModel = PersistentModel>(
const validateModelFields =
(modelDefinition: SchemaModel | SchemaNonModel) => (k: string, v: any) => {
const fieldDefinition = modelDefinition.fields[k];

if (fieldDefinition !== undefined) {
const { type, isRequired, isArrayNullable, name, isArray } =
fieldDefinition;
Expand Down Expand Up @@ -600,6 +601,8 @@ const createModelClass = <T extends PersistentModel>(
if (targetName && instanceMemos.hasOwnProperty(targetName)) {
return instanceMemos[targetName];
}
const associatedId = this[targetName ?? ''] as string;

if (!associatedId) {
if (association.connectionType === 'HAS_MANY') {
if (instanceMemos.hasOwnProperty(field)) {
Expand Down Expand Up @@ -1150,10 +1153,6 @@ class DataStore {
};

delete: {
(
model: any,
options: { condition?: ProducerModelPredicate<any>; cascade?: boolean }
): Promise<any>;
<T extends PersistentModel>(
model: T,
condition?: ProducerModelPredicate<T>
Expand All @@ -1168,20 +1167,23 @@ class DataStore {
): Promise<T[]>;
} = async <T extends PersistentModel>(
modelOrConstructor: T | PersistentModelConstructor<T>,
idOrCriteria?:
| string
| ProducerModelPredicate<T>
| typeof PredicateAll
| any,
cascade?: boolean
idOrCriteria?: string | ProducerModelPredicate<T> | typeof PredicateAll
) => {
await this.start();

if (!this.storage) {
throw new Error('No storage to delete from');
}

let condition: ModelPredicate<T> | undefined;

if (!modelOrConstructor) {
const msg = 'Model or Model Constructor required';
logger.error(msg, { modelOrConstructor });

throw new Error(msg);
}

if (isValidModelConstructor(modelOrConstructor)) {
const modelConstructor =
modelOrConstructor as PersistentModelConstructor<T>;
Expand Down Expand Up @@ -1224,6 +1226,7 @@ class DataStore {
throw new Error(msg);
}
}

const [deleted] = await this.storage.delete(modelConstructor, condition);
return deleted;
} else {
Expand Down

0 comments on commit 22a56a0

Please sign in to comment.