@aws-amplify/datastore 4.7.5 → 5.0.1-console-preview.4208d73.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.
Files changed (182) hide show
  1. package/README.md +4 -0
  2. package/lib/authModeStrategies/defaultAuthStrategy.js +3 -2
  3. package/lib/authModeStrategies/index.js +3 -3
  4. package/lib/authModeStrategies/multiAuthStrategy.js +81 -24
  5. package/lib/datastore/datastore.d.ts +3 -4
  6. package/lib/datastore/datastore.js +361 -227
  7. package/lib/index.d.ts +1 -1
  8. package/lib/index.js +25 -12
  9. package/lib/predicates/index.js +46 -12
  10. package/lib/predicates/next.d.ts +2 -2
  11. package/lib/predicates/next.js +172 -74
  12. package/lib/predicates/sort.js +3 -4
  13. package/lib/ssr/index.js +1 -1
  14. package/lib/storage/adapter/AsyncStorageAdapter.js +240 -128
  15. package/lib/storage/adapter/AsyncStorageDatabase.js +100 -39
  16. package/lib/storage/adapter/InMemoryStore.js +68 -17
  17. package/lib/storage/adapter/InMemoryStore.native.js +5 -3
  18. package/lib/storage/adapter/IndexedDBAdapter.js +355 -199
  19. package/lib/storage/adapter/StorageAdapterBase.js +154 -85
  20. package/lib/storage/adapter/getDefaultAdapter/index.js +8 -9
  21. package/lib/storage/adapter/getDefaultAdapter/index.native.js +4 -3
  22. package/lib/storage/adapter/index.js +0 -1
  23. package/lib/storage/relationship.js +31 -21
  24. package/lib/storage/storage.d.ts +3 -3
  25. package/lib/storage/storage.js +143 -61
  26. package/lib/sync/datastoreConnectivity.d.ts +1 -1
  27. package/lib/sync/datastoreConnectivity.js +57 -9
  28. package/lib/sync/datastoreReachability/index.js +3 -3
  29. package/lib/sync/datastoreReachability/index.native.js +7 -5
  30. package/lib/sync/index.d.ts +1 -1
  31. package/lib/sync/index.js +193 -125
  32. package/lib/sync/merger.js +81 -10
  33. package/lib/sync/outbox.js +101 -30
  34. package/lib/sync/processors/errorMaps.d.ts +1 -1
  35. package/lib/sync/processors/errorMaps.js +41 -6
  36. package/lib/sync/processors/mutation.d.ts +1 -1
  37. package/lib/sync/processors/mutation.js +192 -101
  38. package/lib/sync/processors/subscription.d.ts +4 -1
  39. package/lib/sync/processors/subscription.js +190 -178
  40. package/lib/sync/processors/sync.d.ts +1 -1
  41. package/lib/sync/processors/sync.js +113 -47
  42. package/lib/sync/utils.d.ts +4 -4
  43. package/lib/sync/utils.js +162 -81
  44. package/lib/tsconfig.tsbuildinfo +1 -0
  45. package/lib/types.d.ts +138 -140
  46. package/lib/types.js +40 -5
  47. package/lib/util.d.ts +9 -17
  48. package/lib/util.js +216 -100
  49. package/lib-esm/authModeStrategies/defaultAuthStrategy.js +0 -1
  50. package/lib-esm/authModeStrategies/index.js +0 -1
  51. package/lib-esm/authModeStrategies/multiAuthStrategy.js +76 -21
  52. package/lib-esm/datastore/datastore.d.ts +3 -4
  53. package/lib-esm/datastore/datastore.js +206 -77
  54. package/lib-esm/index.d.ts +1 -1
  55. package/lib-esm/index.js +0 -1
  56. package/lib-esm/predicates/index.js +40 -7
  57. package/lib-esm/predicates/next.d.ts +2 -2
  58. package/lib-esm/predicates/next.js +148 -52
  59. package/lib-esm/predicates/sort.js +2 -4
  60. package/lib-esm/ssr/index.js +0 -1
  61. package/lib-esm/storage/adapter/AsyncStorageAdapter.js +203 -95
  62. package/lib-esm/storage/adapter/AsyncStorageDatabase.js +66 -5
  63. package/lib-esm/storage/adapter/InMemoryStore.js +52 -2
  64. package/lib-esm/storage/adapter/InMemoryStore.native.js +0 -1
  65. package/lib-esm/storage/adapter/IndexedDBAdapter.js +271 -138
  66. package/lib-esm/storage/adapter/StorageAdapterBase.js +130 -62
  67. package/lib-esm/storage/adapter/getDefaultAdapter/index.js +2 -5
  68. package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js +0 -1
  69. package/lib-esm/storage/adapter/index.js +1 -1
  70. package/lib-esm/storage/relationship.js +27 -18
  71. package/lib-esm/storage/storage.d.ts +3 -3
  72. package/lib-esm/storage/storage.js +87 -9
  73. package/lib-esm/sync/datastoreConnectivity.d.ts +1 -1
  74. package/lib-esm/sync/datastoreConnectivity.js +48 -3
  75. package/lib-esm/sync/datastoreReachability/index.js +1 -2
  76. package/lib-esm/sync/datastoreReachability/index.native.js +1 -2
  77. package/lib-esm/sync/index.d.ts +1 -1
  78. package/lib-esm/sync/index.js +136 -72
  79. package/lib-esm/sync/merger.js +73 -3
  80. package/lib-esm/sync/outbox.js +75 -5
  81. package/lib-esm/sync/processors/errorMaps.d.ts +1 -1
  82. package/lib-esm/sync/processors/errorMaps.js +39 -5
  83. package/lib-esm/sync/processors/mutation.d.ts +1 -1
  84. package/lib-esm/sync/processors/mutation.js +130 -44
  85. package/lib-esm/sync/processors/subscription.d.ts +4 -1
  86. package/lib-esm/sync/processors/subscription.js +134 -126
  87. package/lib-esm/sync/processors/sync.d.ts +1 -1
  88. package/lib-esm/sync/processors/sync.js +74 -12
  89. package/lib-esm/sync/utils.d.ts +4 -4
  90. package/lib-esm/sync/utils.js +135 -55
  91. package/lib-esm/tsconfig.tsbuildinfo +1 -0
  92. package/lib-esm/types.d.ts +138 -140
  93. package/lib-esm/types.js +36 -2
  94. package/lib-esm/util.d.ts +9 -17
  95. package/lib-esm/util.js +96 -16
  96. package/package.json +139 -132
  97. package/src/authModeStrategies/multiAuthStrategy.ts +11 -12
  98. package/src/datastore/datastore.ts +32 -25
  99. package/src/predicates/sort.ts +3 -1
  100. package/src/storage/adapter/InMemoryStore.ts +1 -1
  101. package/src/storage/adapter/IndexedDBAdapter.ts +1 -1
  102. package/src/storage/adapter/StorageAdapterBase.ts +1 -1
  103. package/src/storage/adapter/getDefaultAdapter/index.ts +2 -3
  104. package/src/storage/storage.ts +1 -1
  105. package/src/sync/datastoreConnectivity.ts +2 -2
  106. package/src/sync/datastoreReachability/index.native.ts +1 -1
  107. package/src/sync/datastoreReachability/index.ts +1 -1
  108. package/src/sync/index.ts +69 -78
  109. package/src/sync/processors/mutation.ts +16 -10
  110. package/src/sync/processors/subscription.ts +55 -127
  111. package/src/sync/processors/sync.ts +8 -4
  112. package/src/sync/utils.ts +7 -8
  113. package/src/types.ts +4 -8
  114. package/src/util.ts +5 -6
  115. package/lib/.tsbuildinfo +0 -3
  116. package/lib/authModeStrategies/defaultAuthStrategy.js.map +0 -1
  117. package/lib/authModeStrategies/index.js.map +0 -1
  118. package/lib/authModeStrategies/multiAuthStrategy.js.map +0 -1
  119. package/lib/datastore/datastore.js.map +0 -1
  120. package/lib/index.js.map +0 -1
  121. package/lib/predicates/index.js.map +0 -1
  122. package/lib/predicates/next.js.map +0 -1
  123. package/lib/predicates/sort.js.map +0 -1
  124. package/lib/ssr/index.js.map +0 -1
  125. package/lib/storage/adapter/AsyncStorageAdapter.js.map +0 -1
  126. package/lib/storage/adapter/AsyncStorageDatabase.js.map +0 -1
  127. package/lib/storage/adapter/InMemoryStore.js.map +0 -1
  128. package/lib/storage/adapter/InMemoryStore.native.js.map +0 -1
  129. package/lib/storage/adapter/IndexedDBAdapter.js.map +0 -1
  130. package/lib/storage/adapter/StorageAdapterBase.js.map +0 -1
  131. package/lib/storage/adapter/getDefaultAdapter/index.js.map +0 -1
  132. package/lib/storage/adapter/getDefaultAdapter/index.native.js.map +0 -1
  133. package/lib/storage/adapter/index.js.map +0 -1
  134. package/lib/storage/relationship.js.map +0 -1
  135. package/lib/storage/storage.js.map +0 -1
  136. package/lib/sync/datastoreConnectivity.js.map +0 -1
  137. package/lib/sync/datastoreReachability/index.js.map +0 -1
  138. package/lib/sync/datastoreReachability/index.native.js.map +0 -1
  139. package/lib/sync/index.js.map +0 -1
  140. package/lib/sync/merger.js.map +0 -1
  141. package/lib/sync/outbox.js.map +0 -1
  142. package/lib/sync/processors/errorMaps.js.map +0 -1
  143. package/lib/sync/processors/mutation.js.map +0 -1
  144. package/lib/sync/processors/subscription.js.map +0 -1
  145. package/lib/sync/processors/sync.js.map +0 -1
  146. package/lib/sync/utils.js.map +0 -1
  147. package/lib/types.js.map +0 -1
  148. package/lib/util.js.map +0 -1
  149. package/lib-esm/.tsbuildinfo +0 -3
  150. package/lib-esm/authModeStrategies/defaultAuthStrategy.js.map +0 -1
  151. package/lib-esm/authModeStrategies/index.js.map +0 -1
  152. package/lib-esm/authModeStrategies/multiAuthStrategy.js.map +0 -1
  153. package/lib-esm/datastore/datastore.js.map +0 -1
  154. package/lib-esm/index.js.map +0 -1
  155. package/lib-esm/predicates/index.js.map +0 -1
  156. package/lib-esm/predicates/next.js.map +0 -1
  157. package/lib-esm/predicates/sort.js.map +0 -1
  158. package/lib-esm/ssr/index.js.map +0 -1
  159. package/lib-esm/storage/adapter/AsyncStorageAdapter.js.map +0 -1
  160. package/lib-esm/storage/adapter/AsyncStorageDatabase.js.map +0 -1
  161. package/lib-esm/storage/adapter/InMemoryStore.js.map +0 -1
  162. package/lib-esm/storage/adapter/InMemoryStore.native.js.map +0 -1
  163. package/lib-esm/storage/adapter/IndexedDBAdapter.js.map +0 -1
  164. package/lib-esm/storage/adapter/StorageAdapterBase.js.map +0 -1
  165. package/lib-esm/storage/adapter/getDefaultAdapter/index.js.map +0 -1
  166. package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js.map +0 -1
  167. package/lib-esm/storage/adapter/index.js.map +0 -1
  168. package/lib-esm/storage/relationship.js.map +0 -1
  169. package/lib-esm/storage/storage.js.map +0 -1
  170. package/lib-esm/sync/datastoreConnectivity.js.map +0 -1
  171. package/lib-esm/sync/datastoreReachability/index.js.map +0 -1
  172. package/lib-esm/sync/datastoreReachability/index.native.js.map +0 -1
  173. package/lib-esm/sync/index.js.map +0 -1
  174. package/lib-esm/sync/merger.js.map +0 -1
  175. package/lib-esm/sync/outbox.js.map +0 -1
  176. package/lib-esm/sync/processors/errorMaps.js.map +0 -1
  177. package/lib-esm/sync/processors/mutation.js.map +0 -1
  178. package/lib-esm/sync/processors/subscription.js.map +0 -1
  179. package/lib-esm/sync/processors/sync.js.map +0 -1
  180. package/lib-esm/sync/utils.js.map +0 -1
  181. package/lib-esm/types.js.map +0 -1
  182. 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
- exports.defaultAuthStrategy = function () { return []; };
7
- //# sourceMappingURL=defaultAuthStrategy.js.map
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.defaultAuthStrategy = defaultAuthStrategy_1.defaultAuthStrategy;
7
+ Object.defineProperty(exports, "defaultAuthStrategy", { enumerable: true, get: function () { return defaultAuthStrategy_1.defaultAuthStrategy; } });
7
8
  var multiAuthStrategy_1 = require("./multiAuthStrategy");
8
- exports.multiAuthStrategy = multiAuthStrategy_1.multiAuthStrategy;
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
- var tslib_1 = require("tslib");
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 auth_1 = require("@aws-amplify/auth");
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 tslib_1.__spread(rules).sort(function (a, b) {
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(api_graphql_1.GRAPHQL_AUTH_MODE.AWS_LAMBDA);
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(api_graphql_1.GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS);
121
+ authModes.add('jwt');
62
122
  }
63
123
  else if (rule.provider === types_1.ModelAttributeAuthProvider.OIDC) {
64
- authModes.add(api_graphql_1.GRAPHQL_AUTH_MODE.OPENID_CONNECT);
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(api_graphql_1.GRAPHQL_AUTH_MODE.AMAZON_COGNITO_USER_POOLS);
135
+ authModes.add('jwt');
76
136
  }
77
137
  else if (rule.provider === types_1.ModelAttributeAuthProvider.IAM) {
78
- authModes.add(api_graphql_1.GRAPHQL_AUTH_MODE.AWS_IAM);
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(api_graphql_1.GRAPHQL_AUTH_MODE.AWS_IAM);
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(api_graphql_1.GRAPHQL_AUTH_MODE.API_KEY);
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
- exports.multiAuthStrategy = function (amplifyContext) {
171
+ var multiAuthStrategy = function (amplifyContext) {
112
172
  return function (_a) {
113
173
  var schema = _a.schema, modelName = _a.modelName;
114
- return tslib_1.__awaiter(void 0, void 0, void 0, function () {
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 tslib_1.__generator(this, function (_c) {
177
+ return __generator(this, function (_c) {
118
178
  switch (_c.label) {
119
179
  case 0:
120
- amplifyContext.Auth = amplifyContext.Auth || auth_1.Auth;
121
- _c.label = 1;
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*/, 4];
128
- case 3:
184
+ return [3 /*break*/, 3];
185
+ case 2:
129
186
  e_1 = _c.sent();
130
- return [3 /*break*/, 4];
131
- case 4:
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
- //# sourceMappingURL=multiAuthStrategy.js.map
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, NonModelTypeConstructor, ProducerPaginationInput, PersistentModel, PersistentModelConstructor, Schema, SubscriptionMessage, DataStoreSnapshot, TypeConstructorMap, ErrorHandler, ObserveQueryOptions, PersistentModelMetaData, IdentifierFieldOrIdentifierObject, RecursiveModelPredicateExtender, ModelPredicateExtender } from '../types';
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: Readonly<Record<string, any>>) => ModelAttachment.Detached | ModelAttachment;
45
- declare const initSchema: (userSchema: Schema) => Record<string, PersistentModelConstructor<any> | NonModelTypeConstructor<unknown>>;
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;