@aws-amplify/datastore 4.7.5 → 5.0.1-console-preview.4432977.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/README.md +4 -0
- package/lib/authModeStrategies/defaultAuthStrategy.js +3 -2
- package/lib/authModeStrategies/index.js +3 -3
- package/lib/authModeStrategies/multiAuthStrategy.js +81 -24
- package/lib/datastore/datastore.d.ts +3 -4
- package/lib/datastore/datastore.js +361 -227
- package/lib/index.d.ts +1 -1
- package/lib/index.js +25 -12
- package/lib/predicates/index.js +46 -12
- package/lib/predicates/next.d.ts +2 -2
- package/lib/predicates/next.js +172 -74
- package/lib/predicates/sort.js +3 -4
- package/lib/ssr/index.js +1 -1
- package/lib/storage/adapter/AsyncStorageAdapter.js +240 -128
- package/lib/storage/adapter/AsyncStorageDatabase.js +100 -39
- package/lib/storage/adapter/InMemoryStore.js +68 -17
- package/lib/storage/adapter/InMemoryStore.native.js +5 -3
- package/lib/storage/adapter/IndexedDBAdapter.js +355 -199
- package/lib/storage/adapter/StorageAdapterBase.js +154 -85
- package/lib/storage/adapter/getDefaultAdapter/index.js +8 -9
- package/lib/storage/adapter/getDefaultAdapter/index.native.js +4 -3
- package/lib/storage/adapter/index.js +0 -1
- package/lib/storage/relationship.js +31 -21
- package/lib/storage/storage.d.ts +3 -3
- package/lib/storage/storage.js +143 -61
- package/lib/sync/datastoreConnectivity.d.ts +1 -1
- package/lib/sync/datastoreConnectivity.js +57 -9
- package/lib/sync/datastoreReachability/index.js +3 -3
- package/lib/sync/datastoreReachability/index.native.js +7 -5
- package/lib/sync/index.d.ts +1 -1
- package/lib/sync/index.js +193 -125
- package/lib/sync/merger.js +81 -10
- package/lib/sync/outbox.js +101 -30
- package/lib/sync/processors/errorMaps.d.ts +1 -1
- package/lib/sync/processors/errorMaps.js +41 -6
- package/lib/sync/processors/mutation.d.ts +1 -1
- package/lib/sync/processors/mutation.js +192 -101
- package/lib/sync/processors/subscription.d.ts +4 -1
- package/lib/sync/processors/subscription.js +190 -178
- package/lib/sync/processors/sync.d.ts +1 -1
- package/lib/sync/processors/sync.js +113 -47
- package/lib/sync/utils.d.ts +4 -4
- package/lib/sync/utils.js +162 -81
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types.d.ts +138 -140
- package/lib/types.js +40 -5
- package/lib/util.d.ts +9 -17
- package/lib/util.js +216 -100
- package/lib-esm/authModeStrategies/defaultAuthStrategy.js +0 -1
- package/lib-esm/authModeStrategies/index.js +0 -1
- package/lib-esm/authModeStrategies/multiAuthStrategy.js +76 -21
- package/lib-esm/datastore/datastore.d.ts +3 -4
- package/lib-esm/datastore/datastore.js +206 -77
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/index.js +0 -1
- package/lib-esm/predicates/index.js +40 -7
- package/lib-esm/predicates/next.d.ts +2 -2
- package/lib-esm/predicates/next.js +148 -52
- package/lib-esm/predicates/sort.js +2 -4
- package/lib-esm/ssr/index.js +0 -1
- package/lib-esm/storage/adapter/AsyncStorageAdapter.js +203 -95
- package/lib-esm/storage/adapter/AsyncStorageDatabase.js +66 -5
- package/lib-esm/storage/adapter/InMemoryStore.js +52 -2
- package/lib-esm/storage/adapter/InMemoryStore.native.js +0 -1
- package/lib-esm/storage/adapter/IndexedDBAdapter.js +271 -138
- package/lib-esm/storage/adapter/StorageAdapterBase.js +130 -62
- package/lib-esm/storage/adapter/getDefaultAdapter/index.js +2 -5
- package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js +0 -1
- package/lib-esm/storage/adapter/index.js +1 -1
- package/lib-esm/storage/relationship.js +27 -18
- package/lib-esm/storage/storage.d.ts +3 -3
- package/lib-esm/storage/storage.js +87 -9
- package/lib-esm/sync/datastoreConnectivity.d.ts +1 -1
- package/lib-esm/sync/datastoreConnectivity.js +48 -3
- package/lib-esm/sync/datastoreReachability/index.js +1 -2
- package/lib-esm/sync/datastoreReachability/index.native.js +1 -2
- package/lib-esm/sync/index.d.ts +1 -1
- package/lib-esm/sync/index.js +136 -72
- package/lib-esm/sync/merger.js +73 -3
- package/lib-esm/sync/outbox.js +75 -5
- package/lib-esm/sync/processors/errorMaps.d.ts +1 -1
- package/lib-esm/sync/processors/errorMaps.js +39 -5
- package/lib-esm/sync/processors/mutation.d.ts +1 -1
- package/lib-esm/sync/processors/mutation.js +130 -44
- package/lib-esm/sync/processors/subscription.d.ts +4 -1
- package/lib-esm/sync/processors/subscription.js +134 -126
- package/lib-esm/sync/processors/sync.d.ts +1 -1
- package/lib-esm/sync/processors/sync.js +74 -12
- package/lib-esm/sync/utils.d.ts +4 -4
- package/lib-esm/sync/utils.js +135 -55
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/types.d.ts +138 -140
- package/lib-esm/types.js +36 -2
- package/lib-esm/util.d.ts +9 -17
- package/lib-esm/util.js +96 -16
- package/package.json +139 -132
- package/src/authModeStrategies/multiAuthStrategy.ts +11 -12
- package/src/datastore/datastore.ts +32 -25
- package/src/predicates/sort.ts +3 -1
- package/src/storage/adapter/InMemoryStore.ts +1 -1
- package/src/storage/adapter/IndexedDBAdapter.ts +1 -1
- package/src/storage/adapter/StorageAdapterBase.ts +1 -1
- package/src/storage/adapter/getDefaultAdapter/index.ts +2 -3
- package/src/storage/storage.ts +1 -1
- package/src/sync/datastoreConnectivity.ts +2 -2
- package/src/sync/datastoreReachability/index.native.ts +1 -1
- package/src/sync/datastoreReachability/index.ts +1 -1
- package/src/sync/index.ts +69 -78
- package/src/sync/processors/mutation.ts +16 -10
- package/src/sync/processors/subscription.ts +55 -127
- package/src/sync/processors/sync.ts +8 -4
- package/src/sync/utils.ts +7 -8
- package/src/types.ts +4 -8
- package/src/util.ts +5 -6
- package/lib/.tsbuildinfo +0 -3
- package/lib/authModeStrategies/defaultAuthStrategy.js.map +0 -1
- package/lib/authModeStrategies/index.js.map +0 -1
- package/lib/authModeStrategies/multiAuthStrategy.js.map +0 -1
- package/lib/datastore/datastore.js.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/predicates/index.js.map +0 -1
- package/lib/predicates/next.js.map +0 -1
- package/lib/predicates/sort.js.map +0 -1
- package/lib/ssr/index.js.map +0 -1
- package/lib/storage/adapter/AsyncStorageAdapter.js.map +0 -1
- package/lib/storage/adapter/AsyncStorageDatabase.js.map +0 -1
- package/lib/storage/adapter/InMemoryStore.js.map +0 -1
- package/lib/storage/adapter/InMemoryStore.native.js.map +0 -1
- package/lib/storage/adapter/IndexedDBAdapter.js.map +0 -1
- package/lib/storage/adapter/StorageAdapterBase.js.map +0 -1
- package/lib/storage/adapter/getDefaultAdapter/index.js.map +0 -1
- package/lib/storage/adapter/getDefaultAdapter/index.native.js.map +0 -1
- package/lib/storage/adapter/index.js.map +0 -1
- package/lib/storage/relationship.js.map +0 -1
- package/lib/storage/storage.js.map +0 -1
- package/lib/sync/datastoreConnectivity.js.map +0 -1
- package/lib/sync/datastoreReachability/index.js.map +0 -1
- package/lib/sync/datastoreReachability/index.native.js.map +0 -1
- package/lib/sync/index.js.map +0 -1
- package/lib/sync/merger.js.map +0 -1
- package/lib/sync/outbox.js.map +0 -1
- package/lib/sync/processors/errorMaps.js.map +0 -1
- package/lib/sync/processors/mutation.js.map +0 -1
- package/lib/sync/processors/subscription.js.map +0 -1
- package/lib/sync/processors/sync.js.map +0 -1
- package/lib/sync/utils.js.map +0 -1
- package/lib/types.js.map +0 -1
- package/lib/util.js.map +0 -1
- package/lib-esm/.tsbuildinfo +0 -3
- package/lib-esm/authModeStrategies/defaultAuthStrategy.js.map +0 -1
- package/lib-esm/authModeStrategies/index.js.map +0 -1
- package/lib-esm/authModeStrategies/multiAuthStrategy.js.map +0 -1
- package/lib-esm/datastore/datastore.js.map +0 -1
- package/lib-esm/index.js.map +0 -1
- package/lib-esm/predicates/index.js.map +0 -1
- package/lib-esm/predicates/next.js.map +0 -1
- package/lib-esm/predicates/sort.js.map +0 -1
- package/lib-esm/ssr/index.js.map +0 -1
- package/lib-esm/storage/adapter/AsyncStorageAdapter.js.map +0 -1
- package/lib-esm/storage/adapter/AsyncStorageDatabase.js.map +0 -1
- package/lib-esm/storage/adapter/InMemoryStore.js.map +0 -1
- package/lib-esm/storage/adapter/InMemoryStore.native.js.map +0 -1
- package/lib-esm/storage/adapter/IndexedDBAdapter.js.map +0 -1
- package/lib-esm/storage/adapter/StorageAdapterBase.js.map +0 -1
- package/lib-esm/storage/adapter/getDefaultAdapter/index.js.map +0 -1
- package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js.map +0 -1
- package/lib-esm/storage/adapter/index.js.map +0 -1
- package/lib-esm/storage/relationship.js.map +0 -1
- package/lib-esm/storage/storage.js.map +0 -1
- package/lib-esm/sync/datastoreConnectivity.js.map +0 -1
- package/lib-esm/sync/datastoreReachability/index.js.map +0 -1
- package/lib-esm/sync/datastoreReachability/index.native.js.map +0 -1
- package/lib-esm/sync/index.js.map +0 -1
- package/lib-esm/sync/merger.js.map +0 -1
- package/lib-esm/sync/outbox.js.map +0 -1
- package/lib-esm/sync/processors/errorMaps.js.map +0 -1
- package/lib-esm/sync/processors/mutation.js.map +0 -1
- package/lib-esm/sync/processors/subscription.js.map +0 -1
- package/lib-esm/sync/processors/sync.js.map +0 -1
- package/lib-esm/sync/utils.js.map +0 -1
- package/lib-esm/types.js.map +0 -1
- package/lib-esm/util.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
> INTERNAL USE ONLY
|
|
2
|
+
|
|
3
|
+
This package contains the AWS Amplify DataStore category and is intended for internal use only. To integrate Amplify into your app, please use [aws-amplify](https://www.npmjs.com/package/aws-amplify).
|
|
4
|
+
|
|
1
5
|
# AWS Amplify DataStore Docs
|
|
2
6
|
|
|
3
7
|
[Amplify DataStore](https://docs.amplify.aws/lib/datastore/getting-started/q/platform/js/) provides 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.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultAuthStrategy = void 0;
|
|
3
4
|
// Default behavior is to use the primary auth mode for an API,
|
|
4
5
|
// so we are returning an empty array so that DataStore will default
|
|
5
6
|
// to using the primary auth mode.
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
var defaultAuthStrategy = function () { return []; };
|
|
8
|
+
exports.defaultAuthStrategy = defaultAuthStrategy;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.multiAuthStrategy = exports.defaultAuthStrategy = void 0;
|
|
3
4
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
5
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
6
|
var defaultAuthStrategy_1 = require("./defaultAuthStrategy");
|
|
6
|
-
exports
|
|
7
|
+
Object.defineProperty(exports, "defaultAuthStrategy", { enumerable: true, get: function () { return defaultAuthStrategy_1.defaultAuthStrategy; } });
|
|
7
8
|
var multiAuthStrategy_1 = require("./multiAuthStrategy");
|
|
8
|
-
exports
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
9
|
+
Object.defineProperty(exports, "multiAuthStrategy", { enumerable: true, get: function () { return multiAuthStrategy_1.multiAuthStrategy; } });
|
|
@@ -1,10 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
2
63
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
64
|
+
exports.multiAuthStrategy = void 0;
|
|
4
65
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
66
|
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
-
var
|
|
7
|
-
var api_graphql_1 = require("@aws-amplify/api-graphql");
|
|
67
|
+
var core_1 = require("@aws-amplify/core");
|
|
8
68
|
var types_1 = require("../types");
|
|
9
69
|
function getProviderFromRule(rule) {
|
|
10
70
|
// private with no provider means userPools
|
|
@@ -32,7 +92,7 @@ function sortAuthRulesWithPriority(rules) {
|
|
|
32
92
|
types_1.ModelAttributeAuthProvider.IAM,
|
|
33
93
|
types_1.ModelAttributeAuthProvider.API_KEY,
|
|
34
94
|
];
|
|
35
|
-
return
|
|
95
|
+
return __spreadArray([], __read(rules), false).sort(function (a, b) {
|
|
36
96
|
if (a.allow === b.allow) {
|
|
37
97
|
return (providerSortPriority.indexOf(getProviderFromRule(a)) -
|
|
38
98
|
providerSortPriority.indexOf(getProviderFromRule(b)));
|
|
@@ -50,7 +110,7 @@ function getAuthRules(_a) {
|
|
|
50
110
|
// custom with no provider -> function
|
|
51
111
|
if (!rule.provider ||
|
|
52
112
|
rule.provider === types_1.ModelAttributeAuthProvider.FUNCTION) {
|
|
53
|
-
authModes.add(
|
|
113
|
+
authModes.add('lambda');
|
|
54
114
|
}
|
|
55
115
|
break;
|
|
56
116
|
case types_1.ModelAttributeAuthAllow.GROUPS:
|
|
@@ -58,10 +118,10 @@ function getAuthRules(_a) {
|
|
|
58
118
|
// We shouldn't attempt User Pool or OIDC if there isn't an authenticated user
|
|
59
119
|
if (currentUser) {
|
|
60
120
|
if (rule.provider === types_1.ModelAttributeAuthProvider.USER_POOLS) {
|
|
61
|
-
authModes.add(
|
|
121
|
+
authModes.add('jwt');
|
|
62
122
|
}
|
|
63
123
|
else if (rule.provider === types_1.ModelAttributeAuthProvider.OIDC) {
|
|
64
|
-
authModes.add(
|
|
124
|
+
authModes.add('jwt');
|
|
65
125
|
}
|
|
66
126
|
}
|
|
67
127
|
break;
|
|
@@ -72,22 +132,22 @@ function getAuthRules(_a) {
|
|
|
72
132
|
// private with no provider means userPools
|
|
73
133
|
if (!rule.provider ||
|
|
74
134
|
rule.provider === types_1.ModelAttributeAuthProvider.USER_POOLS) {
|
|
75
|
-
authModes.add(
|
|
135
|
+
authModes.add('jwt');
|
|
76
136
|
}
|
|
77
137
|
else if (rule.provider === types_1.ModelAttributeAuthProvider.IAM) {
|
|
78
|
-
authModes.add(
|
|
138
|
+
authModes.add('iam');
|
|
79
139
|
}
|
|
80
140
|
}
|
|
81
141
|
break;
|
|
82
142
|
}
|
|
83
143
|
case types_1.ModelAttributeAuthAllow.PUBLIC: {
|
|
84
144
|
if (rule.provider === types_1.ModelAttributeAuthProvider.IAM) {
|
|
85
|
-
authModes.add(
|
|
145
|
+
authModes.add('iam');
|
|
86
146
|
}
|
|
87
147
|
else if (!rule.provider ||
|
|
88
148
|
rule.provider === types_1.ModelAttributeAuthProvider.API_KEY) {
|
|
89
149
|
// public with no provider means apiKey
|
|
90
|
-
authModes.add(
|
|
150
|
+
authModes.add('apiKey');
|
|
91
151
|
}
|
|
92
152
|
break;
|
|
93
153
|
}
|
|
@@ -108,27 +168,24 @@ function getAuthRules(_a) {
|
|
|
108
168
|
* @param param0 The `{schema, modelName}` to inspect.
|
|
109
169
|
* @returns A sorted array of auth modes to attempt.
|
|
110
170
|
*/
|
|
111
|
-
|
|
171
|
+
var multiAuthStrategy = function (amplifyContext) {
|
|
112
172
|
return function (_a) {
|
|
113
173
|
var schema = _a.schema, modelName = _a.modelName;
|
|
114
|
-
return
|
|
174
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
115
175
|
var currentUser, e_1, attributes, authAttribute, sortedRules;
|
|
116
176
|
var _b;
|
|
117
|
-
return
|
|
177
|
+
return __generator(this, function (_c) {
|
|
118
178
|
switch (_c.label) {
|
|
119
179
|
case 0:
|
|
120
|
-
|
|
121
|
-
|
|
180
|
+
_c.trys.push([0, 2, , 3]);
|
|
181
|
+
return [4 /*yield*/, (0, core_1.fetchAuthSession)()];
|
|
122
182
|
case 1:
|
|
123
|
-
_c.trys.push([1, 3, , 4]);
|
|
124
|
-
return [4 /*yield*/, amplifyContext.Auth.currentAuthenticatedUser()];
|
|
125
|
-
case 2:
|
|
126
183
|
currentUser = _c.sent();
|
|
127
|
-
return [3 /*break*/,
|
|
128
|
-
case
|
|
184
|
+
return [3 /*break*/, 3];
|
|
185
|
+
case 2:
|
|
129
186
|
e_1 = _c.sent();
|
|
130
|
-
return [3 /*break*/,
|
|
131
|
-
case
|
|
187
|
+
return [3 /*break*/, 3];
|
|
188
|
+
case 3:
|
|
132
189
|
attributes = schema.namespaces.user.models[modelName].attributes;
|
|
133
190
|
if (attributes) {
|
|
134
191
|
authAttribute = attributes.find(function (attr) { return attr.type === 'auth'; });
|
|
@@ -143,4 +200,4 @@ exports.multiAuthStrategy = function (amplifyContext) {
|
|
|
143
200
|
});
|
|
144
201
|
};
|
|
145
202
|
};
|
|
146
|
-
|
|
203
|
+
exports.multiAuthStrategy = multiAuthStrategy;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Observable from 'zen-observable-ts';
|
|
2
2
|
import { PredicateAll } from '../predicates';
|
|
3
|
-
import { ConflictHandler, DataStoreConfig,
|
|
3
|
+
import { ConflictHandler, DataStoreConfig, ProducerPaginationInput, PersistentModel, PersistentModelConstructor, Schema, SubscriptionMessage, DataStoreSnapshot, TypeConstructorMap, ErrorHandler, ObserveQueryOptions, PersistentModelMetaData, IdentifierFieldOrIdentifierObject, RecursiveModelPredicateExtender, ModelPredicateExtender } from '../types';
|
|
4
4
|
export declare let syncClasses: TypeConstructorMap;
|
|
5
5
|
/**
|
|
6
6
|
* Describes whether and to what a model is attached for lazy loading purposes.
|
|
@@ -41,8 +41,8 @@ export declare function attached<T extends PersistentModel | PersistentModel[]>(
|
|
|
41
41
|
*
|
|
42
42
|
* @param instance A model instance
|
|
43
43
|
*/
|
|
44
|
-
export declare const getAttachment: (instance:
|
|
45
|
-
declare const initSchema: (userSchema: Schema) =>
|
|
44
|
+
export declare const getAttachment: (instance: PersistentModel) => ModelAttachment;
|
|
45
|
+
declare const initSchema: (userSchema: Schema) => TypeConstructorMap;
|
|
46
46
|
/**
|
|
47
47
|
* Constructs a model and records it with its metadata in a weakset. Allows for
|
|
48
48
|
* the separate storage of core model fields and Amplify/DataStore metadata
|
|
@@ -92,7 +92,6 @@ export declare class AsyncCollection<T> implements AsyncIterable<T> {
|
|
|
92
92
|
}): Promise<T[]>;
|
|
93
93
|
}
|
|
94
94
|
declare class DataStore {
|
|
95
|
-
private Auth;
|
|
96
95
|
private InternalAPI;
|
|
97
96
|
private Cache;
|
|
98
97
|
private amplifyConfig;
|