@aws-amplify/datastore 5.0.16 → 5.0.17-unstable.1fdbb12.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/package.json +73 -73
- package/src/authModeStrategies/multiAuthStrategy.ts +4 -4
- package/src/datastore/datastore.ts +115 -115
- package/src/predicates/index.ts +9 -9
- package/src/predicates/next.ts +35 -35
- package/src/predicates/sort.ts +8 -8
- package/src/storage/adapter/AsyncStorageAdapter.ts +13 -13
- package/src/storage/adapter/AsyncStorageDatabase.ts +7 -7
- package/src/storage/adapter/InMemoryStore.ts +1 -1
- package/src/storage/adapter/IndexedDBAdapter.ts +28 -28
- package/src/storage/adapter/StorageAdapterBase.ts +40 -40
- package/src/storage/adapter/index.ts +5 -5
- package/src/storage/storage.ts +34 -34
- package/src/sync/datastoreReachability/index.native.ts +1 -1
- package/src/sync/index.ts +47 -47
- package/src/sync/merger.ts +4 -4
- package/src/sync/outbox.ts +15 -15
- package/src/sync/processors/mutation.ts +27 -27
- package/src/sync/processors/subscription.ts +45 -45
- package/src/sync/processors/sync.ts +25 -25
- package/src/sync/utils.ts +30 -30
- package/src/types.ts +87 -89
- package/src/util.ts +41 -41
package/package.json
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
2
|
+
"name": "@aws-amplify/datastore",
|
|
3
|
+
"version": "5.0.17-unstable.1fdbb12.0+1fdbb12",
|
|
4
|
+
"description": "AppSyncLocal support for aws-amplify",
|
|
5
|
+
"main": "./dist/cjs/index.js",
|
|
6
|
+
"module": "./dist/esm/index.mjs",
|
|
7
|
+
"typings": "./dist/esm/index.d.ts",
|
|
8
|
+
"react-native": "./src/index.ts",
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./dist/cjs/datastore/datastore.js",
|
|
14
|
+
"./dist/esm/datastore/datastore.mjs"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "npm run lint && jest -w 1 --coverage --logHeapUsage",
|
|
18
|
+
"test:size": "size-limit",
|
|
19
|
+
"build-with-test": "npm test && npm run build",
|
|
20
|
+
"build:umd": "webpack && webpack --config ./webpack.config.dev.js",
|
|
21
|
+
"build:esm-cjs": "rollup -c rollup.config.mjs",
|
|
22
|
+
"build:watch": "npm run build:esm-cjs -- --watch",
|
|
23
|
+
"build": "npm run clean && npm run build:esm-cjs && npm run build:umd",
|
|
24
|
+
"clean": "npm run clean:size && rimraf dist lib lib-esm",
|
|
25
|
+
"clean:size": "rimraf dual-publish-tmp tmp*",
|
|
26
|
+
"format": "echo \"Not implemented\" && npm run ts-coverage",
|
|
27
|
+
"lint": "tslint '{__tests__,src}/**/*.ts' && npm run ts-coverage",
|
|
28
|
+
"ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 92.05"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/aws-amplify/amplify-js.git"
|
|
33
|
+
},
|
|
34
|
+
"author": "Amazon Web Services",
|
|
35
|
+
"license": "Apache-2.0",
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/aws/aws-amplify/issues"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://aws-amplify.github.io/",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist/cjs",
|
|
42
|
+
"dist/esm",
|
|
43
|
+
"src"
|
|
44
|
+
],
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@aws-amplify/api": "6.0.17-unstable.1fdbb12.0+1fdbb12",
|
|
47
|
+
"buffer": "4.9.2",
|
|
48
|
+
"idb": "5.0.6",
|
|
49
|
+
"immer": "9.0.6",
|
|
50
|
+
"rxjs": "^7.8.1",
|
|
51
|
+
"ulid": "^2.3.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@aws-amplify/core": "6.0.17-unstable.1fdbb12.0+1fdbb12"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@aws-amplify/core": "6.0.17-unstable.1fdbb12.0+1fdbb12",
|
|
58
|
+
"@aws-amplify/react-native": "1.0.17-unstable.1fdbb12.0+1fdbb12",
|
|
59
|
+
"@types/uuid-validate": "^0.0.1",
|
|
60
|
+
"dexie": "3.2.2",
|
|
61
|
+
"dexie-export-import": "1.0.3",
|
|
62
|
+
"fake-indexeddb": "^4.0.2",
|
|
63
|
+
"graphql": "15.8.0",
|
|
64
|
+
"typescript": "5.0.2"
|
|
65
|
+
},
|
|
66
|
+
"size-limit": [
|
|
67
|
+
{
|
|
68
|
+
"name": "DataStore (top-level class)",
|
|
69
|
+
"path": "./dist/esm/index.mjs",
|
|
70
|
+
"import": "{ Amplify, DataStore }",
|
|
71
|
+
"limit": "65.25 kB"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"gitHead": "1fdbb12f85d1a363258c4ebeb5aa7c98ee619e16"
|
|
75
75
|
}
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import { GraphQLAuthMode } from '@aws-amplify/core/internals/utils';
|
|
12
12
|
|
|
13
13
|
function getProviderFromRule(
|
|
14
|
-
rule: ModelAttributeAuthProperty
|
|
14
|
+
rule: ModelAttributeAuthProperty,
|
|
15
15
|
): ModelAttributeAuthProvider {
|
|
16
16
|
// private with no provider means userPools
|
|
17
17
|
if (rule.allow === 'private' && !rule.provider) {
|
|
@@ -51,7 +51,7 @@ function sortAuthRulesWithPriority(rules: ModelAttributeAuthProperty[]) {
|
|
|
51
51
|
return (
|
|
52
52
|
allowSortPriority.indexOf(a.allow) - allowSortPriority.indexOf(b.allow)
|
|
53
53
|
);
|
|
54
|
-
}
|
|
54
|
+
},
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -136,7 +136,7 @@ function getAuthRules({
|
|
|
136
136
|
* @returns A sorted array of auth modes to attempt.
|
|
137
137
|
*/
|
|
138
138
|
export const multiAuthStrategy: (
|
|
139
|
-
amplifyContext: AmplifyContext
|
|
139
|
+
amplifyContext: AmplifyContext,
|
|
140
140
|
) => AuthModeStrategy =
|
|
141
141
|
(amplifyContext: AmplifyContext) =>
|
|
142
142
|
async ({ schema, modelName }) => {
|
|
@@ -158,7 +158,7 @@ export const multiAuthStrategy: (
|
|
|
158
158
|
|
|
159
159
|
if (authAttribute?.properties?.rules) {
|
|
160
160
|
const sortedRules = sortAuthRulesWithPriority(
|
|
161
|
-
authAttribute.properties.rules
|
|
161
|
+
authAttribute.properties.rules,
|
|
162
162
|
);
|
|
163
163
|
|
|
164
164
|
return getAuthRules({ currentUser, rules: sortedRules });
|