@aws-amplify/datastore 5.0.1-console-preview.8d88eef.0 → 5.0.1-console-preview.be08038.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/authModeStrategies/multiAuthStrategy.js +6 -2
- package/lib/sync/processors/errorMaps.js +2 -3
- package/lib/sync/processors/subscription.js +9 -10
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib-esm/authModeStrategies/multiAuthStrategy.js +6 -2
- package/lib-esm/sync/processors/errorMaps.js +2 -3
- package/lib-esm/sync/processors/subscription.js +10 -11
- package/lib-esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/src/authModeStrategies/multiAuthStrategy.ts +5 -1
- package/src/sync/processors/errorMaps.ts +4 -4
- package/src/sync/processors/subscription.ts +10 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-amplify/datastore",
|
|
3
|
-
"version": "5.0.1-console-preview.
|
|
3
|
+
"version": "5.0.1-console-preview.be08038.0+be08038",
|
|
4
4
|
"description": "AppSyncLocal support for aws-amplify",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"module": "./lib-esm/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"ssr"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@aws-amplify/api": "6.0.1-console-preview.
|
|
51
|
-
"@aws-amplify/auth": "6.0.1-console-preview.
|
|
50
|
+
"@aws-amplify/api": "6.0.1-console-preview.be08038.0+be08038",
|
|
51
|
+
"@aws-amplify/auth": "6.0.1-console-preview.be08038.0+be08038",
|
|
52
52
|
"buffer": "4.9.2",
|
|
53
53
|
"idb": "5.0.6",
|
|
54
54
|
"immer": "9.0.6",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"ulid": "^2.3.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"@aws-amplify/core": "6.0.1-console-preview.
|
|
59
|
+
"@aws-amplify/core": "6.0.1-console-preview.be08038.0+be08038"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@aws-amplify/core": "6.0.1-console-preview.
|
|
63
|
-
"@aws-amplify/react-native": "1.0.1-console-preview.
|
|
62
|
+
"@aws-amplify/core": "6.0.1-console-preview.be08038.0+be08038",
|
|
63
|
+
"@aws-amplify/react-native": "1.0.1-console-preview.be08038.0+be08038",
|
|
64
64
|
"@types/uuid-validate": "^0.0.1",
|
|
65
65
|
"dexie": "3.2.2",
|
|
66
66
|
"dexie-export-import": "1.0.3",
|
|
@@ -135,5 +135,5 @@
|
|
|
135
135
|
"lib-esm"
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
|
-
"gitHead": "
|
|
138
|
+
"gitHead": "be08038c5b37a510243f077c6d3209e5383f8866"
|
|
139
139
|
}
|
|
@@ -142,7 +142,11 @@ export const multiAuthStrategy: (
|
|
|
142
142
|
async ({ schema, modelName }) => {
|
|
143
143
|
let currentUser;
|
|
144
144
|
try {
|
|
145
|
-
|
|
145
|
+
const authSession = await fetchAuthSession();
|
|
146
|
+
if (authSession.tokens.accessToken) {
|
|
147
|
+
// the user is authenticated
|
|
148
|
+
currentUser = authSession;
|
|
149
|
+
}
|
|
146
150
|
} catch (e) {
|
|
147
151
|
// No current user
|
|
148
152
|
}
|
|
@@ -58,10 +58,10 @@ export const syncErrorMap: ErrorMap = {
|
|
|
58
58
|
*/
|
|
59
59
|
function unwrapObservableError(observableError: any) {
|
|
60
60
|
const {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} = observableError;
|
|
61
|
+
errors: [error],
|
|
62
|
+
} = ({
|
|
63
|
+
errors: [],
|
|
64
|
+
} = observableError);
|
|
65
65
|
|
|
66
66
|
return error;
|
|
67
67
|
}
|
|
@@ -2,7 +2,12 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import { GraphQLResult } from '@aws-amplify/api';
|
|
4
4
|
import { InternalAPI } from '@aws-amplify/api/internals';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Hub,
|
|
7
|
+
HubCapsule,
|
|
8
|
+
fetchAuthSession,
|
|
9
|
+
ConsoleLogger,
|
|
10
|
+
} from '@aws-amplify/core';
|
|
6
11
|
import {
|
|
7
12
|
Category,
|
|
8
13
|
CustomUserAgentDetails,
|
|
@@ -454,10 +459,10 @@ class SubscriptionProcessor {
|
|
|
454
459
|
},
|
|
455
460
|
error: async subscriptionError => {
|
|
456
461
|
const {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
} = subscriptionError;
|
|
462
|
+
errors: [{ message = '' } = {}],
|
|
463
|
+
} = ({
|
|
464
|
+
errors: [],
|
|
465
|
+
} = subscriptionError);
|
|
461
466
|
|
|
462
467
|
const isRTFError =
|
|
463
468
|
// only attempt catch if a filter variable was added to the subscription query
|