amplifyjs

AWS Amplify MissingRequiredParameter userId error

半城伤御伤魂 提交于 2020-12-10 20:47:50
问题 I'm following the guide for starting with Interactions. When I call the send method on Interactions, I get the following error: (node:27796) UnhandledPromiseRejectionWarning: MissingRequiredParameter: Missing required key 'userId' in params It looks like Interactions is expecting a userId param, which in @aws-amplify/interactions/lib/Providers/AWSLexProvider.js , is supposed to be pulled from credentials.identityId . However, when I log credentials , it is type SharedIniFileCredentials ,

AWS Amplify MissingRequiredParameter userId error

余生长醉 提交于 2020-12-10 20:46:12
问题 I'm following the guide for starting with Interactions. When I call the send method on Interactions, I get the following error: (node:27796) UnhandledPromiseRejectionWarning: MissingRequiredParameter: Missing required key 'userId' in params It looks like Interactions is expecting a userId param, which in @aws-amplify/interactions/lib/Providers/AWSLexProvider.js , is supposed to be pulled from credentials.identityId . However, when I log credentials , it is type SharedIniFileCredentials ,

AWS Amplify MissingRequiredParameter userId error

自古美人都是妖i 提交于 2020-12-10 20:44:33
问题 I'm following the guide for starting with Interactions. When I call the send method on Interactions, I get the following error: (node:27796) UnhandledPromiseRejectionWarning: MissingRequiredParameter: Missing required key 'userId' in params It looks like Interactions is expecting a userId param, which in @aws-amplify/interactions/lib/Providers/AWSLexProvider.js , is supposed to be pulled from credentials.identityId . However, when I log credentials , it is type SharedIniFileCredentials ,

ElasticSearch not failing but returning incorrect results

删除回忆录丶 提交于 2020-01-06 12:32:50
问题 I switched to POST searches using ajax in my application so I can start using the date range. However it seems no matter what I post it keeps returning the first 10 results in my index. The true results are in the 30k range. amplify.request.define("searchPostRequest", "ajax", { url: "http://leServer:9200/people/person/_search", type: "POST", dataType: 'jsonp', contentType: 'application/json' }); self.advancedSearchPostQuery = { query: { term: { locationNumber:479 } } }; console.log(self

ElasticSearch not failing but returning incorrect results

删除回忆录丶 提交于 2020-01-06 12:31:06
问题 I switched to POST searches using ajax in my application so I can start using the date range. However it seems no matter what I post it keeps returning the first 10 results in my index. The true results are in the 30k range. amplify.request.define("searchPostRequest", "ajax", { url: "http://leServer:9200/people/person/_search", type: "POST", dataType: 'jsonp', contentType: 'application/json' }); self.advancedSearchPostQuery = { query: { term: { locationNumber:479 } } }; console.log(self

Storing KnockoutJS modeled data with AmplifyJS

流过昼夜 提交于 2019-12-24 12:34:11
问题 I'm trying to figure out a way to cache my knockoutJS SPA data and I've been experimenting with amplifyJS. Here's one of my GET functions: UserController.prototype.getUsers = function() { var self = this; return $.ajax({ type: 'GET', url: self.Config.api + 'users' }).done(function(data) { self.usersArr(ko.utils.arrayMap(data.users, function(item) { // run each item through model return new self.Model.User(item); })); }).fail(function(data) { // failed }); }; Here's the same function,

How to get unseen, nearby documents from a Amplify - AppSync - ElasticSearch - DynamoDB Stack?

我怕爱的太早我们不能终老 提交于 2019-12-23 04:52:14
问题 Problem: Use Amplify.js from AWS. A Tinder similar app. Here you can find jobs close by. These may only be seen once. We should save what the user likes and dislikes. What I've already managed: I have the scheme: type Query { nearbyJobs(location: LocationInput!, km: Int): ModelJobConnection } type User @model { id: ID! name: String interacts: [Jobinteract] @connection(name: "interactsuser") createdAt: String updatedAt: String } type Job @model @searchable { id: ID! name: String location:

Does amplify.store return error or catch exception when local storage limit exceeded?

和自甴很熟 提交于 2019-12-04 03:24:58
问题 Is there e way to check if local storage limit is exceeded after a call like this: amplify.store("key", object); What happens if i try to store something bigger than the local storage limit ? 回答1: yes , it throws "amplify.store quota exceeded" , as you can see here store.error = function() { return "amplify.store quota exceeded"; }; ... try { storage.setItem( key, parsed ); // quota exceeded } catch( error ) { // expire old data and try again store[ storageType ](); try { storage.setItem( key