@aws-amplify/datastore 4.7.6-api-v6-models.b3abc9b.0 → 5.0.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 +38 -53
- package/lib/datastore/datastore.d.ts +4 -5
- package/lib/datastore/datastore.js +929 -1284
- package/lib/index.d.ts +1 -1
- package/lib/index.js +26 -13
- package/lib/predicates/index.js +54 -69
- package/lib/predicates/next.d.ts +2 -2
- package/lib/predicates/next.js +313 -462
- package/lib/predicates/sort.js +24 -28
- package/lib/ssr/index.js +2 -2
- package/lib/storage/adapter/AsyncStorageAdapter.js +120 -342
- package/lib/storage/adapter/AsyncStorageDatabase.js +217 -421
- package/lib/storage/adapter/InMemoryStore.js +28 -51
- package/lib/storage/adapter/InMemoryStore.native.js +5 -3
- package/lib/storage/adapter/IndexedDBAdapter.js +466 -871
- package/lib/storage/adapter/StorageAdapterBase.js +180 -330
- package/lib/storage/adapter/getDefaultAdapter/index.js +8 -10
- package/lib/storage/adapter/getDefaultAdapter/index.native.js +5 -4
- package/lib/storage/adapter/index.js +0 -1
- package/lib/storage/relationship.js +177 -253
- package/lib/storage/storage.d.ts +4 -4
- package/lib/storage/storage.js +255 -433
- package/lib/sync/datastoreConnectivity.d.ts +2 -2
- package/lib/sync/datastoreConnectivity.js +29 -39
- package/lib/sync/datastoreReachability/index.d.ts +1 -3
- package/lib/sync/datastoreReachability/index.js +3 -3
- package/lib/sync/datastoreReachability/index.native.d.ts +1 -3
- package/lib/sync/datastoreReachability/index.native.js +4 -5
- package/lib/sync/index.d.ts +2 -2
- package/lib/sync/index.js +522 -827
- package/lib/sync/merger.js +31 -63
- package/lib/sync/outbox.js +148 -232
- package/lib/sync/processors/errorMaps.d.ts +1 -1
- package/lib/sync/processors/errorMaps.js +30 -47
- package/lib/sync/processors/mutation.d.ts +2 -2
- package/lib/sync/processors/mutation.js +343 -502
- package/lib/sync/processors/subscription.d.ts +5 -2
- package/lib/sync/processors/subscription.js +283 -437
- package/lib/sync/processors/sync.d.ts +2 -2
- package/lib/sync/processors/sync.js +279 -404
- package/lib/sync/utils.d.ts +5 -4
- package/lib/sync/utils.js +267 -320
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/types.d.ts +138 -140
- package/lib/types.js +17 -24
- package/lib/util.d.ts +9 -17
- package/lib/util.js +387 -511
- package/lib-esm/authModeStrategies/defaultAuthStrategy.js +1 -2
- package/lib-esm/authModeStrategies/index.js +0 -1
- package/lib-esm/authModeStrategies/multiAuthStrategy.js +35 -52
- package/lib-esm/datastore/datastore.d.ts +4 -5
- package/lib-esm/datastore/datastore.js +888 -1247
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/index.js +6 -7
- package/lib-esm/predicates/index.js +53 -70
- package/lib-esm/predicates/next.d.ts +2 -2
- package/lib-esm/predicates/next.js +306 -459
- package/lib-esm/predicates/sort.js +23 -28
- package/lib-esm/ssr/index.js +1 -2
- package/lib-esm/storage/adapter/AsyncStorageAdapter.js +111 -338
- package/lib-esm/storage/adapter/AsyncStorageDatabase.js +212 -416
- package/lib-esm/storage/adapter/InMemoryStore.js +27 -52
- package/lib-esm/storage/adapter/InMemoryStore.native.js +0 -1
- package/lib-esm/storage/adapter/IndexedDBAdapter.js +438 -866
- package/lib-esm/storage/adapter/StorageAdapterBase.js +173 -325
- package/lib-esm/storage/adapter/getDefaultAdapter/index.js +2 -6
- package/lib-esm/storage/adapter/getDefaultAdapter/index.native.js +1 -2
- package/lib-esm/storage/adapter/index.js +1 -1
- package/lib-esm/storage/relationship.js +173 -251
- package/lib-esm/storage/storage.d.ts +4 -4
- package/lib-esm/storage/storage.js +242 -424
- package/lib-esm/sync/datastoreConnectivity.d.ts +2 -2
- package/lib-esm/sync/datastoreConnectivity.js +28 -39
- package/lib-esm/sync/datastoreReachability/index.d.ts +1 -3
- package/lib-esm/sync/datastoreReachability/index.js +2 -3
- package/lib-esm/sync/datastoreReachability/index.native.d.ts +1 -3
- package/lib-esm/sync/datastoreReachability/index.native.js +3 -4
- package/lib-esm/sync/index.d.ts +2 -2
- package/lib-esm/sync/index.js +502 -812
- package/lib-esm/sync/merger.js +28 -61
- package/lib-esm/sync/outbox.js +143 -228
- package/lib-esm/sync/processors/errorMaps.d.ts +1 -1
- package/lib-esm/sync/processors/errorMaps.js +32 -50
- package/lib-esm/sync/processors/mutation.d.ts +2 -2
- package/lib-esm/sync/processors/mutation.js +329 -490
- package/lib-esm/sync/processors/subscription.d.ts +5 -2
- package/lib-esm/sync/processors/subscription.js +266 -421
- package/lib-esm/sync/processors/sync.d.ts +2 -2
- package/lib-esm/sync/processors/sync.js +271 -397
- package/lib-esm/sync/utils.d.ts +5 -4
- package/lib-esm/sync/utils.js +252 -307
- package/lib-esm/tsconfig.tsbuildinfo +1 -0
- package/lib-esm/types.d.ts +138 -140
- package/lib-esm/types.js +16 -25
- package/lib-esm/util.d.ts +9 -17
- package/lib-esm/util.js +335 -497
- package/package.json +31 -26
- package/src/authModeStrategies/multiAuthStrategy.ts +15 -12
- package/src/datastore/datastore.ts +36 -35
- package/src/predicates/sort.ts +3 -1
- package/src/storage/adapter/InMemoryStore.ts +1 -1
- package/src/storage/adapter/IndexedDBAdapter.ts +2 -2
- package/src/storage/adapter/StorageAdapterBase.ts +2 -2
- package/src/storage/adapter/getDefaultAdapter/index.ts +1 -4
- package/src/storage/storage.ts +29 -24
- package/src/sync/datastoreConnectivity.ts +6 -6
- package/src/sync/datastoreReachability/index.native.ts +5 -3
- package/src/sync/datastoreReachability/index.ts +1 -1
- package/src/sync/index.ts +79 -89
- package/src/sync/processors/errorMaps.ts +7 -7
- package/src/sync/processors/mutation.ts +19 -13
- package/src/sync/processors/subscription.ts +221 -295
- package/src/sync/processors/sync.ts +11 -8
- package/src/sync/utils.ts +30 -15
- package/src/types.ts +4 -8
- package/src/util.ts +46 -9
- 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
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator, __read, __rest, __values } from "tslib";
|
|
2
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
import {
|
|
5
|
-
import PushStream from 'zen-push';
|
|
3
|
+
import { filter, map, Subject } from 'rxjs';
|
|
6
4
|
import { ModelPredicateCreator } from '../predicates';
|
|
7
5
|
import { OpType, QueryOne, isTargetNameAssociation, } from '../types';
|
|
8
6
|
import { isModelConstructor, STORAGE, validatePredicate, valuesEqual, } from '../util';
|
|
9
7
|
import { getIdentifierValue } from '../sync/utils';
|
|
10
8
|
import getDefaultAdapter from './adapter/getDefaultAdapter';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { Mutex } from '@aws-amplify/core/internals/utils';
|
|
10
|
+
import { ConsoleLogger } from '@aws-amplify/core';
|
|
11
|
+
const logger = new ConsoleLogger('DataStore');
|
|
12
|
+
class StorageClass {
|
|
13
|
+
constructor(schema, namespaceResolver, getModelConstructorByModelName, modelInstanceCreator, adapter, sessionId) {
|
|
14
14
|
this.schema = schema;
|
|
15
15
|
this.namespaceResolver = namespaceResolver;
|
|
16
16
|
this.getModelConstructorByModelName = getModelConstructorByModelName;
|
|
@@ -18,10 +18,10 @@ var StorageClass = /** @class */ (function () {
|
|
|
18
18
|
this.adapter = adapter;
|
|
19
19
|
this.sessionId = sessionId;
|
|
20
20
|
this.adapter = this.adapter || getDefaultAdapter();
|
|
21
|
-
this.pushStream = new
|
|
21
|
+
this.pushStream = new Subject();
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
static getNamespace() {
|
|
24
|
+
const namespace = {
|
|
25
25
|
name: STORAGE,
|
|
26
26
|
relationships: {},
|
|
27
27
|
enums: {},
|
|
@@ -29,196 +29,138 @@ var StorageClass = /** @class */ (function () {
|
|
|
29
29
|
nonModels: {},
|
|
30
30
|
};
|
|
31
31
|
return namespace;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
case 2:
|
|
45
|
-
logger.debug('Starting Storage');
|
|
46
|
-
this.initialized = new Promise(function (res, rej) {
|
|
47
|
-
resolve = res;
|
|
48
|
-
reject = rej;
|
|
49
|
-
});
|
|
50
|
-
this.adapter.setUp(this.schema, this.namespaceResolver, this.modelInstanceCreator, this.getModelConstructorByModelName, this.sessionId).then(resolve, reject);
|
|
51
|
-
return [4 /*yield*/, this.initialized];
|
|
52
|
-
case 3:
|
|
53
|
-
_a.sent();
|
|
54
|
-
return [2 /*return*/];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
StorageClass.prototype.save = function (model, condition, mutator, patchesTuple) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var result;
|
|
62
|
-
var _this = this;
|
|
63
|
-
return __generator(this, function (_a) {
|
|
64
|
-
switch (_a.label) {
|
|
65
|
-
case 0: return [4 /*yield*/, this.init()];
|
|
66
|
-
case 1:
|
|
67
|
-
_a.sent();
|
|
68
|
-
if (!this.adapter) {
|
|
69
|
-
throw new Error('Storage adapter is missing');
|
|
70
|
-
}
|
|
71
|
-
return [4 /*yield*/, this.adapter.save(model, condition)];
|
|
72
|
-
case 2:
|
|
73
|
-
result = _a.sent();
|
|
74
|
-
result.forEach(function (r) {
|
|
75
|
-
var _a = __read(r, 2), savedElement = _a[0], opType = _a[1];
|
|
76
|
-
// truthy when save is called by the Merger
|
|
77
|
-
var syncResponse = !!mutator;
|
|
78
|
-
var updateMutationInput;
|
|
79
|
-
// don't attempt to calc mutation input when storage.save
|
|
80
|
-
// is called by Merger, i.e., when processing an AppSync response
|
|
81
|
-
if ((opType === OpType.UPDATE || opType === OpType.INSERT) &&
|
|
82
|
-
!syncResponse) {
|
|
83
|
-
//
|
|
84
|
-
// TODO: LOOK!!!
|
|
85
|
-
// the `model` used here is in effect regardless of what model
|
|
86
|
-
// comes back from adapter.save().
|
|
87
|
-
// Prior to fix, SQLite adapter had been returning two models
|
|
88
|
-
// of different types, resulting in invalid outbox entries.
|
|
89
|
-
//
|
|
90
|
-
// the bug is essentially fixed in SQLite adapter.
|
|
91
|
-
// leaving as-is, because it's currently unclear whether anything
|
|
92
|
-
// depends on this remaining as-is.
|
|
93
|
-
//
|
|
94
|
-
updateMutationInput = _this.getChangedFieldsInput(model, savedElement, patchesTuple);
|
|
95
|
-
// // an update without changed user fields
|
|
96
|
-
// => don't create mutationEvent
|
|
97
|
-
if (updateMutationInput === null) {
|
|
98
|
-
return result;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var element = updateMutationInput || savedElement;
|
|
102
|
-
var modelConstructor = Object.getPrototypeOf(savedElement)
|
|
103
|
-
.constructor;
|
|
104
|
-
_this.pushStream.next({
|
|
105
|
-
model: modelConstructor,
|
|
106
|
-
opType: opType,
|
|
107
|
-
element: element,
|
|
108
|
-
mutator: mutator,
|
|
109
|
-
condition: (condition &&
|
|
110
|
-
ModelPredicateCreator.getPredicates(condition, false)) ||
|
|
111
|
-
null,
|
|
112
|
-
savedElement: savedElement,
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
return [2 /*return*/, result];
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
StorageClass.prototype.delete = function (modelOrModelConstructor, condition, mutator) {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
var models, deleted, modelConstructor, namespaceName, modelDefinition, modelIds;
|
|
123
|
-
var _a;
|
|
124
|
-
var _this = this;
|
|
125
|
-
return __generator(this, function (_b) {
|
|
126
|
-
switch (_b.label) {
|
|
127
|
-
case 0: return [4 /*yield*/, this.init()];
|
|
128
|
-
case 1:
|
|
129
|
-
_b.sent();
|
|
130
|
-
if (!this.adapter) {
|
|
131
|
-
throw new Error('Storage adapter is missing');
|
|
132
|
-
}
|
|
133
|
-
return [4 /*yield*/, this.adapter.delete(modelOrModelConstructor, condition)];
|
|
134
|
-
case 2:
|
|
135
|
-
_a = __read.apply(void 0, [_b.sent(), 2]), models = _a[0], deleted = _a[1];
|
|
136
|
-
modelConstructor = isModelConstructor(modelOrModelConstructor)
|
|
137
|
-
? modelOrModelConstructor
|
|
138
|
-
: Object.getPrototypeOf(modelOrModelConstructor || {})
|
|
139
|
-
.constructor;
|
|
140
|
-
namespaceName = this.namespaceResolver(modelConstructor);
|
|
141
|
-
modelDefinition = this.schema.namespaces[namespaceName].models[modelConstructor.name];
|
|
142
|
-
modelIds = new Set(models.map(function (model) {
|
|
143
|
-
var modelId = getIdentifierValue(modelDefinition, model);
|
|
144
|
-
return modelId;
|
|
145
|
-
}));
|
|
146
|
-
if (!isModelConstructor(modelOrModelConstructor) &&
|
|
147
|
-
!Array.isArray(deleted)) {
|
|
148
|
-
deleted = [deleted];
|
|
149
|
-
}
|
|
150
|
-
deleted.forEach(function (model) {
|
|
151
|
-
var modelConstructor = Object.getPrototypeOf(model)
|
|
152
|
-
.constructor;
|
|
153
|
-
var theCondition;
|
|
154
|
-
if (!isModelConstructor(modelOrModelConstructor)) {
|
|
155
|
-
var modelId = getIdentifierValue(modelDefinition, model);
|
|
156
|
-
theCondition = modelIds.has(modelId)
|
|
157
|
-
? ModelPredicateCreator.getPredicates(condition, false)
|
|
158
|
-
: undefined;
|
|
159
|
-
}
|
|
160
|
-
_this.pushStream.next({
|
|
161
|
-
model: modelConstructor,
|
|
162
|
-
opType: OpType.DELETE,
|
|
163
|
-
element: model,
|
|
164
|
-
mutator: mutator,
|
|
165
|
-
condition: theCondition || null,
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
return [2 /*return*/, [models, deleted]];
|
|
169
|
-
}
|
|
170
|
-
});
|
|
32
|
+
}
|
|
33
|
+
async init() {
|
|
34
|
+
if (this.initialized !== undefined) {
|
|
35
|
+
await this.initialized;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
logger.debug('Starting Storage');
|
|
39
|
+
let resolve;
|
|
40
|
+
let reject;
|
|
41
|
+
this.initialized = new Promise((res, rej) => {
|
|
42
|
+
resolve = res;
|
|
43
|
+
reject = rej;
|
|
171
44
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
45
|
+
this.adapter.setUp(this.schema, this.namespaceResolver, this.modelInstanceCreator, this.getModelConstructorByModelName, this.sessionId).then(resolve, reject);
|
|
46
|
+
await this.initialized;
|
|
47
|
+
}
|
|
48
|
+
async save(model, condition, mutator, patchesTuple) {
|
|
49
|
+
await this.init();
|
|
50
|
+
if (!this.adapter) {
|
|
51
|
+
throw new Error('Storage adapter is missing');
|
|
52
|
+
}
|
|
53
|
+
const result = await this.adapter.save(model, condition);
|
|
54
|
+
result.forEach(r => {
|
|
55
|
+
const [savedElement, opType] = r;
|
|
56
|
+
// truthy when save is called by the Merger
|
|
57
|
+
const syncResponse = !!mutator;
|
|
58
|
+
let updateMutationInput;
|
|
59
|
+
// don't attempt to calc mutation input when storage.save
|
|
60
|
+
// is called by Merger, i.e., when processing an AppSync response
|
|
61
|
+
if ((opType === OpType.UPDATE || opType === OpType.INSERT) &&
|
|
62
|
+
!syncResponse) {
|
|
63
|
+
//
|
|
64
|
+
// TODO: LOOK!!!
|
|
65
|
+
// the `model` used here is in effect regardless of what model
|
|
66
|
+
// comes back from adapter.save().
|
|
67
|
+
// Prior to fix, SQLite adapter had been returning two models
|
|
68
|
+
// of different types, resulting in invalid outbox entries.
|
|
69
|
+
//
|
|
70
|
+
// the bug is essentially fixed in SQLite adapter.
|
|
71
|
+
// leaving as-is, because it's currently unclear whether anything
|
|
72
|
+
// depends on this remaining as-is.
|
|
73
|
+
//
|
|
74
|
+
updateMutationInput = this.getChangedFieldsInput(model, savedElement, patchesTuple);
|
|
75
|
+
// // an update without changed user fields
|
|
76
|
+
// => don't create mutationEvent
|
|
77
|
+
if (updateMutationInput === null) {
|
|
78
|
+
return result;
|
|
185
79
|
}
|
|
80
|
+
}
|
|
81
|
+
const element = updateMutationInput || savedElement;
|
|
82
|
+
const modelConstructor = Object.getPrototypeOf(savedElement)
|
|
83
|
+
.constructor;
|
|
84
|
+
this.pushStream.next({
|
|
85
|
+
model: modelConstructor,
|
|
86
|
+
opType,
|
|
87
|
+
element,
|
|
88
|
+
mutator,
|
|
89
|
+
condition: (condition &&
|
|
90
|
+
ModelPredicateCreator.getPredicates(condition, false)) ||
|
|
91
|
+
null,
|
|
92
|
+
savedElement,
|
|
186
93
|
});
|
|
187
94
|
});
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
95
|
+
return result;
|
|
96
|
+
}
|
|
97
|
+
async delete(modelOrModelConstructor, condition, mutator) {
|
|
98
|
+
await this.init();
|
|
99
|
+
if (!this.adapter) {
|
|
100
|
+
throw new Error('Storage adapter is missing');
|
|
101
|
+
}
|
|
102
|
+
let models;
|
|
103
|
+
let deleted;
|
|
104
|
+
[models, deleted] = await this.adapter.delete(modelOrModelConstructor, condition);
|
|
105
|
+
const modelConstructor = isModelConstructor(modelOrModelConstructor)
|
|
106
|
+
? modelOrModelConstructor
|
|
107
|
+
: Object.getPrototypeOf(modelOrModelConstructor || {})
|
|
108
|
+
.constructor;
|
|
109
|
+
const namespaceName = this.namespaceResolver(modelConstructor);
|
|
110
|
+
const modelDefinition = this.schema.namespaces[namespaceName].models[modelConstructor.name];
|
|
111
|
+
const modelIds = new Set(models.map(model => {
|
|
112
|
+
const modelId = getIdentifierValue(modelDefinition, model);
|
|
113
|
+
return modelId;
|
|
114
|
+
}));
|
|
115
|
+
if (!isModelConstructor(modelOrModelConstructor) &&
|
|
116
|
+
!Array.isArray(deleted)) {
|
|
117
|
+
deleted = [deleted];
|
|
118
|
+
}
|
|
119
|
+
deleted.forEach(model => {
|
|
120
|
+
const modelConstructor = Object.getPrototypeOf(model)
|
|
121
|
+
.constructor;
|
|
122
|
+
let theCondition;
|
|
123
|
+
if (!isModelConstructor(modelOrModelConstructor)) {
|
|
124
|
+
const modelId = getIdentifierValue(modelDefinition, model);
|
|
125
|
+
theCondition = modelIds.has(modelId)
|
|
126
|
+
? ModelPredicateCreator.getPredicates(condition, false)
|
|
127
|
+
: undefined;
|
|
128
|
+
}
|
|
129
|
+
this.pushStream.next({
|
|
130
|
+
model: modelConstructor,
|
|
131
|
+
opType: OpType.DELETE,
|
|
132
|
+
element: model,
|
|
133
|
+
mutator,
|
|
134
|
+
condition: theCondition || null,
|
|
203
135
|
});
|
|
204
136
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
137
|
+
return [models, deleted];
|
|
138
|
+
}
|
|
139
|
+
async query(modelConstructor, predicate, pagination) {
|
|
140
|
+
await this.init();
|
|
141
|
+
if (!this.adapter) {
|
|
142
|
+
throw new Error('Storage adapter is missing');
|
|
143
|
+
}
|
|
144
|
+
return await this.adapter.query(modelConstructor, predicate, pagination);
|
|
145
|
+
}
|
|
146
|
+
async queryOne(modelConstructor, firstOrLast = QueryOne.FIRST) {
|
|
147
|
+
await this.init();
|
|
148
|
+
if (!this.adapter) {
|
|
149
|
+
throw new Error('Storage adapter is missing');
|
|
150
|
+
}
|
|
151
|
+
return await this.adapter.queryOne(modelConstructor, firstOrLast);
|
|
152
|
+
}
|
|
153
|
+
observe(modelConstructor, predicate, skipOwn) {
|
|
154
|
+
const listenToAll = !modelConstructor;
|
|
155
|
+
const { predicates, type } = (predicate && ModelPredicateCreator.getPredicates(predicate, false)) ||
|
|
156
|
+
{};
|
|
157
|
+
let result = this.pushStream
|
|
158
|
+
.pipe(filter(({ mutator }) => {
|
|
213
159
|
return !skipOwn || mutator !== skipOwn;
|
|
214
|
-
})
|
|
215
|
-
.map(
|
|
216
|
-
var _mutator = _a.mutator, message = __rest(_a, ["mutator"]);
|
|
217
|
-
return message;
|
|
218
|
-
});
|
|
160
|
+
}))
|
|
161
|
+
.pipe(map(({ mutator: _mutator, ...message }) => message));
|
|
219
162
|
if (!listenToAll) {
|
|
220
|
-
result = result.filter(
|
|
221
|
-
var model = _a.model, element = _a.element;
|
|
163
|
+
result = result.pipe(filter(({ model, element }) => {
|
|
222
164
|
if (modelConstructor !== model) {
|
|
223
165
|
return false;
|
|
224
166
|
}
|
|
@@ -226,174 +168,96 @@ var StorageClass = /** @class */ (function () {
|
|
|
226
168
|
return validatePredicate(element, type, predicates);
|
|
227
169
|
}
|
|
228
170
|
return true;
|
|
229
|
-
});
|
|
171
|
+
}));
|
|
230
172
|
}
|
|
231
173
|
return result;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
var result;
|
|
257
|
-
var _this = this;
|
|
258
|
-
return __generator(this, function (_a) {
|
|
259
|
-
switch (_a.label) {
|
|
260
|
-
case 0: return [4 /*yield*/, this.init()];
|
|
261
|
-
case 1:
|
|
262
|
-
_a.sent();
|
|
263
|
-
if (!this.adapter) {
|
|
264
|
-
throw new Error('Storage adapter is missing');
|
|
265
|
-
}
|
|
266
|
-
return [4 /*yield*/, this.adapter.batchSave(modelConstructor, items)];
|
|
267
|
-
case 2:
|
|
268
|
-
result = _a.sent();
|
|
269
|
-
result.forEach(function (_a) {
|
|
270
|
-
var _b = __read(_a, 2), element = _b[0], opType = _b[1];
|
|
271
|
-
_this.pushStream.next({
|
|
272
|
-
model: modelConstructor,
|
|
273
|
-
opType: opType,
|
|
274
|
-
element: element,
|
|
275
|
-
mutator: mutator,
|
|
276
|
-
condition: null,
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
return [2 /*return*/, result];
|
|
280
|
-
}
|
|
174
|
+
}
|
|
175
|
+
async clear(completeObservable = true) {
|
|
176
|
+
this.initialized = undefined;
|
|
177
|
+
if (!this.adapter) {
|
|
178
|
+
throw new Error('Storage adapter is missing');
|
|
179
|
+
}
|
|
180
|
+
await this.adapter.clear();
|
|
181
|
+
if (completeObservable) {
|
|
182
|
+
this.pushStream.complete();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async batchSave(modelConstructor, items, mutator) {
|
|
186
|
+
await this.init();
|
|
187
|
+
if (!this.adapter) {
|
|
188
|
+
throw new Error('Storage adapter is missing');
|
|
189
|
+
}
|
|
190
|
+
const result = await this.adapter.batchSave(modelConstructor, items);
|
|
191
|
+
result.forEach(([element, opType]) => {
|
|
192
|
+
this.pushStream.next({
|
|
193
|
+
model: modelConstructor,
|
|
194
|
+
opType,
|
|
195
|
+
element,
|
|
196
|
+
mutator,
|
|
197
|
+
condition: null,
|
|
281
198
|
});
|
|
282
199
|
});
|
|
283
|
-
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
284
202
|
// returns null if no user fields were changed (determined by value comparison)
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
var _b;
|
|
288
|
-
var containsPatches = patchesTuple && patchesTuple.length;
|
|
203
|
+
getChangedFieldsInput(model, originalElement, patchesTuple) {
|
|
204
|
+
const containsPatches = patchesTuple && patchesTuple.length;
|
|
289
205
|
if (!containsPatches) {
|
|
290
206
|
return null;
|
|
291
207
|
}
|
|
292
|
-
|
|
293
|
-
|
|
208
|
+
const [patches, source] = patchesTuple;
|
|
209
|
+
const updatedElement = {};
|
|
294
210
|
// extract array of updated fields from patches
|
|
295
|
-
|
|
211
|
+
const updatedFields = (patches.map(patch => patch.path && patch.path[0]));
|
|
296
212
|
// check model def for association and replace with targetName if exists
|
|
297
|
-
|
|
213
|
+
const modelConstructor = Object.getPrototypeOf(model)
|
|
298
214
|
.constructor;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
215
|
+
const namespace = this.namespaceResolver(modelConstructor);
|
|
216
|
+
const { fields } = this.schema.namespaces[namespace].models[modelConstructor.name];
|
|
217
|
+
const { primaryKey, compositeKeys = [] } = this.schema.namespaces[namespace].keys?.[modelConstructor.name] || {};
|
|
302
218
|
// set original values for these fields
|
|
303
|
-
updatedFields.forEach(
|
|
304
|
-
|
|
305
|
-
var _f;
|
|
306
|
-
var targetNames = isTargetNameAssociation((_f = fields[field]) === null || _f === void 0 ? void 0 : _f.association);
|
|
219
|
+
updatedFields.forEach((field) => {
|
|
220
|
+
const targetNames = isTargetNameAssociation(fields[field]?.association);
|
|
307
221
|
if (Array.isArray(targetNames)) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
//
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
originalElement[targetName]
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
for (
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (fieldSet.has(targetName)) {
|
|
324
|
-
try {
|
|
325
|
-
for (var fieldSet_1 = (e_4 = void 0, __values(fieldSet)), fieldSet_1_1 = fieldSet_1.next(); !fieldSet_1_1.done; fieldSet_1_1 = fieldSet_1.next()) {
|
|
326
|
-
var compositeField = fieldSet_1_1.value;
|
|
327
|
-
updatedElement[compositeField] =
|
|
328
|
-
originalElement[compositeField];
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
332
|
-
finally {
|
|
333
|
-
try {
|
|
334
|
-
if (fieldSet_1_1 && !fieldSet_1_1.done && (_c = fieldSet_1.return)) _c.call(fieldSet_1);
|
|
335
|
-
}
|
|
336
|
-
finally { if (e_4) throw e_4.error; }
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
342
|
-
finally {
|
|
343
|
-
try {
|
|
344
|
-
if (compositeKeys_1_1 && !compositeKeys_1_1.done && (_b = compositeKeys_1.return)) _b.call(compositeKeys_1);
|
|
222
|
+
// if field refers to a belongsTo relation, use the target field instead
|
|
223
|
+
for (const targetName of targetNames) {
|
|
224
|
+
// check field values by value. Ignore unchanged fields
|
|
225
|
+
if (!valuesEqual(source[targetName], originalElement[targetName])) {
|
|
226
|
+
// if the field was updated to 'undefined', replace with 'null' for compatibility with JSON and GraphQL
|
|
227
|
+
updatedElement[targetName] =
|
|
228
|
+
originalElement[targetName] === undefined
|
|
229
|
+
? null
|
|
230
|
+
: originalElement[targetName];
|
|
231
|
+
for (const fieldSet of compositeKeys) {
|
|
232
|
+
// include all of the fields that comprise the composite key
|
|
233
|
+
if (fieldSet.has(targetName)) {
|
|
234
|
+
for (const compositeField of fieldSet) {
|
|
235
|
+
updatedElement[compositeField] =
|
|
236
|
+
originalElement[compositeField];
|
|
345
237
|
}
|
|
346
|
-
finally { if (e_3) throw e_3.error; }
|
|
347
238
|
}
|
|
348
239
|
}
|
|
349
240
|
}
|
|
350
241
|
}
|
|
351
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
352
|
-
finally {
|
|
353
|
-
try {
|
|
354
|
-
if (targetNames_1_1 && !targetNames_1_1.done && (_a = targetNames_1.return)) _a.call(targetNames_1);
|
|
355
|
-
}
|
|
356
|
-
finally { if (e_2) throw e_2.error; }
|
|
357
|
-
}
|
|
358
242
|
}
|
|
359
243
|
else {
|
|
360
244
|
// Backwards compatibility pre-CPK
|
|
361
245
|
// if field refers to a belongsTo relation, use the target field instead
|
|
362
|
-
|
|
246
|
+
const key = targetNames || field;
|
|
363
247
|
// check field values by value. Ignore unchanged fields
|
|
364
248
|
if (!valuesEqual(source[key], originalElement[key])) {
|
|
365
249
|
// if the field was updated to 'undefined', replace with 'null' for compatibility with JSON and GraphQL
|
|
366
250
|
updatedElement[key] =
|
|
367
251
|
originalElement[key] === undefined ? null : originalElement[key];
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
for (var fieldSet_2 = (e_6 = void 0, __values(fieldSet)), fieldSet_2_1 = fieldSet_2.next(); !fieldSet_2_1.done; fieldSet_2_1 = fieldSet_2.next()) {
|
|
375
|
-
var compositeField = fieldSet_2_1.value;
|
|
376
|
-
updatedElement[compositeField] =
|
|
377
|
-
originalElement[compositeField];
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
381
|
-
finally {
|
|
382
|
-
try {
|
|
383
|
-
if (fieldSet_2_1 && !fieldSet_2_1.done && (_e = fieldSet_2.return)) _e.call(fieldSet_2);
|
|
384
|
-
}
|
|
385
|
-
finally { if (e_6) throw e_6.error; }
|
|
386
|
-
}
|
|
252
|
+
for (const fieldSet of compositeKeys) {
|
|
253
|
+
// include all of the fields that comprise the composite key
|
|
254
|
+
if (fieldSet.has(key)) {
|
|
255
|
+
for (const compositeField of fieldSet) {
|
|
256
|
+
updatedElement[compositeField] =
|
|
257
|
+
originalElement[compositeField];
|
|
387
258
|
}
|
|
388
259
|
}
|
|
389
260
|
}
|
|
390
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
391
|
-
finally {
|
|
392
|
-
try {
|
|
393
|
-
if (compositeKeys_2_1 && !compositeKeys_2_1.done && (_d = compositeKeys_2.return)) _d.call(compositeKeys_2);
|
|
394
|
-
}
|
|
395
|
-
finally { if (e_5) throw e_5.error; }
|
|
396
|
-
}
|
|
397
261
|
}
|
|
398
262
|
}
|
|
399
263
|
});
|
|
@@ -403,111 +267,65 @@ var StorageClass = /** @class */ (function () {
|
|
|
403
267
|
}
|
|
404
268
|
// include field(s) from custom PK if one is specified for the model
|
|
405
269
|
if (primaryKey && primaryKey.length) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
var pkField = primaryKey_1_1.value;
|
|
409
|
-
updatedElement[pkField] = originalElement[pkField];
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
413
|
-
finally {
|
|
414
|
-
try {
|
|
415
|
-
if (primaryKey_1_1 && !primaryKey_1_1.done && (_a = primaryKey_1.return)) _a.call(primaryKey_1);
|
|
416
|
-
}
|
|
417
|
-
finally { if (e_1) throw e_1.error; }
|
|
270
|
+
for (const pkField of primaryKey) {
|
|
271
|
+
updatedElement[pkField] = originalElement[pkField];
|
|
418
272
|
}
|
|
419
273
|
}
|
|
420
|
-
|
|
274
|
+
const { id, _version, _lastChangedAt, _deleted } = originalElement;
|
|
421
275
|
// For update mutations we only want to send fields with changes
|
|
422
276
|
// and the required internal fields
|
|
423
|
-
return
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
|
|
277
|
+
return {
|
|
278
|
+
...updatedElement,
|
|
279
|
+
id,
|
|
280
|
+
_version,
|
|
281
|
+
_lastChangedAt,
|
|
282
|
+
_deleted,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
class ExclusiveStorage {
|
|
287
|
+
constructor(schema, namespaceResolver, getModelConstructorByModelName, modelInstanceCreator, adapter, sessionId) {
|
|
432
288
|
this.mutex = new Mutex();
|
|
433
289
|
this.storage = new StorageClass(schema, namespaceResolver, getModelConstructorByModelName, modelInstanceCreator, adapter, sessionId);
|
|
434
290
|
}
|
|
435
|
-
|
|
291
|
+
runExclusive(fn) {
|
|
436
292
|
return this.mutex.runExclusive(fn.bind(this, this.storage));
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
return
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (isModelConstructor(modelOrModelConstructor)) {
|
|
452
|
-
var modelConstructor = modelOrModelConstructor;
|
|
453
|
-
return storage.delete(modelConstructor, condition, mutator);
|
|
454
|
-
}
|
|
455
|
-
else {
|
|
456
|
-
var model = modelOrModelConstructor;
|
|
457
|
-
return storage.delete(model, condition, mutator);
|
|
458
|
-
}
|
|
459
|
-
})];
|
|
460
|
-
});
|
|
461
|
-
});
|
|
462
|
-
};
|
|
463
|
-
ExclusiveStorage.prototype.query = function (modelConstructor, predicate, pagination) {
|
|
464
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
465
|
-
return __generator(this, function (_a) {
|
|
466
|
-
return [2 /*return*/, this.runExclusive(function (storage) {
|
|
467
|
-
return storage.query(modelConstructor, predicate, pagination);
|
|
468
|
-
})];
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
};
|
|
472
|
-
ExclusiveStorage.prototype.queryOne = function (modelConstructor, firstOrLast) {
|
|
473
|
-
if (firstOrLast === void 0) { firstOrLast = QueryOne.FIRST; }
|
|
474
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
475
|
-
return __generator(this, function (_a) {
|
|
476
|
-
return [2 /*return*/, this.runExclusive(function (storage) {
|
|
477
|
-
return storage.queryOne(modelConstructor, firstOrLast);
|
|
478
|
-
})];
|
|
479
|
-
});
|
|
293
|
+
}
|
|
294
|
+
async save(model, condition, mutator, patchesTuple) {
|
|
295
|
+
return this.runExclusive(storage => storage.save(model, condition, mutator, patchesTuple));
|
|
296
|
+
}
|
|
297
|
+
async delete(modelOrModelConstructor, condition, mutator) {
|
|
298
|
+
return this.runExclusive(storage => {
|
|
299
|
+
if (isModelConstructor(modelOrModelConstructor)) {
|
|
300
|
+
const modelConstructor = modelOrModelConstructor;
|
|
301
|
+
return storage.delete(modelConstructor, condition, mutator);
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
const model = modelOrModelConstructor;
|
|
305
|
+
return storage.delete(model, condition, mutator);
|
|
306
|
+
}
|
|
480
307
|
});
|
|
481
|
-
}
|
|
482
|
-
|
|
308
|
+
}
|
|
309
|
+
async query(modelConstructor, predicate, pagination) {
|
|
310
|
+
return this.runExclusive(storage => storage.query(modelConstructor, predicate, pagination));
|
|
311
|
+
}
|
|
312
|
+
async queryOne(modelConstructor, firstOrLast = QueryOne.FIRST) {
|
|
313
|
+
return this.runExclusive(storage => storage.queryOne(modelConstructor, firstOrLast));
|
|
314
|
+
}
|
|
315
|
+
static getNamespace() {
|
|
483
316
|
return StorageClass.getNamespace();
|
|
484
|
-
}
|
|
485
|
-
|
|
317
|
+
}
|
|
318
|
+
observe(modelConstructor, predicate, skipOwn) {
|
|
486
319
|
return this.storage.observe(modelConstructor, predicate, skipOwn);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
case 0: return [4 /*yield*/, this.runExclusive(function (storage) { return storage.clear(); })];
|
|
493
|
-
case 1:
|
|
494
|
-
_a.sent();
|
|
495
|
-
return [2 /*return*/];
|
|
496
|
-
}
|
|
497
|
-
});
|
|
498
|
-
});
|
|
499
|
-
};
|
|
500
|
-
ExclusiveStorage.prototype.batchSave = function (modelConstructor, items) {
|
|
320
|
+
}
|
|
321
|
+
async clear() {
|
|
322
|
+
await this.runExclusive(storage => storage.clear());
|
|
323
|
+
}
|
|
324
|
+
batchSave(modelConstructor, items) {
|
|
501
325
|
return this.storage.batchSave(modelConstructor, items);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
return
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
});
|
|
508
|
-
});
|
|
509
|
-
};
|
|
510
|
-
return ExclusiveStorage;
|
|
511
|
-
}());
|
|
326
|
+
}
|
|
327
|
+
async init() {
|
|
328
|
+
return this.storage.init();
|
|
329
|
+
}
|
|
330
|
+
}
|
|
512
331
|
export { ExclusiveStorage };
|
|
513
|
-
//# sourceMappingURL=storage.js.map
|