@epam/uui-db 4.6.1 → 4.7.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/bundle-stats.json +1 -1
- package/index.js +308 -311
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/src/DbRef.d.ts +2 -5
- package/src/DbRef.d.ts.map +1 -1
- package/src/DbTable.d.ts +1 -1
- package/src/DbTable.d.ts.map +1 -1
- package/src/types.d.ts +1 -0
- package/src/types.d.ts.map +1 -1
package/index.js
CHANGED
|
@@ -91,7 +91,7 @@ module.exports =
|
|
|
91
91
|
/*!******************************************!*\
|
|
92
92
|
!*** ../node_modules/tslib/tslib.es6.js ***!
|
|
93
93
|
\******************************************/
|
|
94
|
-
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */
|
|
94
|
+
/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn */
|
|
95
95
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
96
96
|
|
|
97
97
|
"use strict";
|
|
@@ -120,245 +120,255 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
120
120
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; });
|
|
121
121
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; });
|
|
122
122
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; });
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return
|
|
195
|
-
|
|
196
|
-
function
|
|
197
|
-
function
|
|
198
|
-
step(
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
function step(
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
if (
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
case
|
|
214
|
-
case
|
|
215
|
-
case
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
if (
|
|
219
|
-
if (op[0] ===
|
|
220
|
-
if (
|
|
221
|
-
if (t[2]) _.ops.
|
|
222
|
-
_.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
function
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
function
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
function
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
Object.defineProperty(
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
123
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldIn", function() { return __classPrivateFieldIn; });
|
|
124
|
+
/******************************************************************************
|
|
125
|
+
Copyright (c) Microsoft Corporation.
|
|
126
|
+
|
|
127
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
128
|
+
purpose with or without fee is hereby granted.
|
|
129
|
+
|
|
130
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
131
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
132
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
133
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
134
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
135
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
136
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
137
|
+
***************************************************************************** */
|
|
138
|
+
/* global Reflect, Promise */
|
|
139
|
+
|
|
140
|
+
var extendStatics = function(d, b) {
|
|
141
|
+
extendStatics = Object.setPrototypeOf ||
|
|
142
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
143
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
144
|
+
return extendStatics(d, b);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
function __extends(d, b) {
|
|
148
|
+
if (typeof b !== "function" && b !== null)
|
|
149
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
150
|
+
extendStatics(d, b);
|
|
151
|
+
function __() { this.constructor = d; }
|
|
152
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var __assign = function() {
|
|
156
|
+
__assign = Object.assign || function __assign(t) {
|
|
157
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
158
|
+
s = arguments[i];
|
|
159
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
160
|
+
}
|
|
161
|
+
return t;
|
|
162
|
+
}
|
|
163
|
+
return __assign.apply(this, arguments);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function __rest(s, e) {
|
|
167
|
+
var t = {};
|
|
168
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
169
|
+
t[p] = s[p];
|
|
170
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
171
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
172
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
173
|
+
t[p[i]] = s[p[i]];
|
|
174
|
+
}
|
|
175
|
+
return t;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function __decorate(decorators, target, key, desc) {
|
|
179
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
180
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
181
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
182
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function __param(paramIndex, decorator) {
|
|
186
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function __metadata(metadataKey, metadataValue) {
|
|
190
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
194
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
195
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
196
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
197
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
198
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
199
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function __generator(thisArg, body) {
|
|
204
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
205
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
206
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
207
|
+
function step(op) {
|
|
208
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
209
|
+
while (_) try {
|
|
210
|
+
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;
|
|
211
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
212
|
+
switch (op[0]) {
|
|
213
|
+
case 0: case 1: t = op; break;
|
|
214
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
215
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
216
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
217
|
+
default:
|
|
218
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
219
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
220
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
221
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
222
|
+
if (t[2]) _.ops.pop();
|
|
223
|
+
_.trys.pop(); continue;
|
|
224
|
+
}
|
|
225
|
+
op = body.call(thisArg, _);
|
|
226
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
227
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
|
232
|
+
if (k2 === undefined) k2 = k;
|
|
233
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
234
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
235
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
236
|
+
}
|
|
237
|
+
Object.defineProperty(o, k2, desc);
|
|
238
|
+
}) : (function(o, m, k, k2) {
|
|
239
|
+
if (k2 === undefined) k2 = k;
|
|
240
|
+
o[k2] = m[k];
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
function __exportStar(m, o) {
|
|
244
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function __values(o) {
|
|
248
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
249
|
+
if (m) return m.call(o);
|
|
250
|
+
if (o && typeof o.length === "number") return {
|
|
251
|
+
next: function () {
|
|
252
|
+
if (o && i >= o.length) o = void 0;
|
|
253
|
+
return { value: o && o[i++], done: !o };
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function __read(o, n) {
|
|
260
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
261
|
+
if (!m) return o;
|
|
262
|
+
var i = m.call(o), r, ar = [], e;
|
|
263
|
+
try {
|
|
264
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
265
|
+
}
|
|
266
|
+
catch (error) { e = { error: error }; }
|
|
267
|
+
finally {
|
|
268
|
+
try {
|
|
269
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
270
|
+
}
|
|
271
|
+
finally { if (e) throw e.error; }
|
|
272
|
+
}
|
|
273
|
+
return ar;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/** @deprecated */
|
|
277
|
+
function __spread() {
|
|
278
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
|
279
|
+
ar = ar.concat(__read(arguments[i]));
|
|
280
|
+
return ar;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/** @deprecated */
|
|
284
|
+
function __spreadArrays() {
|
|
285
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
286
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
287
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
288
|
+
r[k] = a[j];
|
|
289
|
+
return r;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function __spreadArray(to, from, pack) {
|
|
293
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
294
|
+
if (ar || !(i in from)) {
|
|
295
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
296
|
+
ar[i] = from[i];
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function __await(v) {
|
|
303
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
|
307
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
308
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
309
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
310
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
311
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
312
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
313
|
+
function fulfill(value) { resume("next", value); }
|
|
314
|
+
function reject(value) { resume("throw", value); }
|
|
315
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function __asyncDelegator(o) {
|
|
319
|
+
var i, p;
|
|
320
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
|
321
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function __asyncValues(o) {
|
|
325
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
326
|
+
var m = o[Symbol.asyncIterator], i;
|
|
327
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
328
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
329
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
function __makeTemplateObject(cooked, raw) {
|
|
333
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
334
|
+
return cooked;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
|
338
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
339
|
+
}) : function(o, v) {
|
|
340
|
+
o["default"] = v;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
function __importStar(mod) {
|
|
344
|
+
if (mod && mod.__esModule) return mod;
|
|
345
|
+
var result = {};
|
|
346
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
347
|
+
__setModuleDefault(result, mod);
|
|
348
|
+
return result;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function __importDefault(mod) {
|
|
352
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
356
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
357
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
358
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
362
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
363
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
364
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
365
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
function __classPrivateFieldIn(state, receiver) {
|
|
369
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
|
370
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
371
|
+
}
|
|
362
372
|
|
|
363
373
|
|
|
364
374
|
/***/ }),
|
|
@@ -483,6 +493,7 @@ var tempIds_1 = __webpack_require__(/*! ./tempIds */ "./src/tempIds.tsx");
|
|
|
483
493
|
var utils_1 = __webpack_require__(/*! ./utils */ "./src/utils.ts");
|
|
484
494
|
var lodash_isempty_1 = (0, tslib_1.__importDefault)(__webpack_require__(/*! lodash.isempty */ "lodash.isempty"));
|
|
485
495
|
var Loader_1 = __webpack_require__(/*! ./Loader */ "./src/Loader.ts");
|
|
496
|
+
var uui_core_1 = __webpack_require__(/*! @epam/uui-core */ "@epam/uui-core");
|
|
486
497
|
var SimpleLoadingTracker_1 = __webpack_require__(/*! ./SimpleLoadingTracker */ "./src/SimpleLoadingTracker.ts");
|
|
487
498
|
var ListLoadingTracker_1 = __webpack_require__(/*! ./ListLoadingTracker */ "./src/ListLoadingTracker.ts");
|
|
488
499
|
var DbRef = /** @class */ (function () {
|
|
@@ -492,7 +503,6 @@ var DbRef = /** @class */ (function () {
|
|
|
492
503
|
this.log = [];
|
|
493
504
|
this.autoSave = true;
|
|
494
505
|
this.savedPoint = 0;
|
|
495
|
-
this.errors = [];
|
|
496
506
|
this.throttleSaveMs = 1000;
|
|
497
507
|
/* Update subscriptions (aka live views) */
|
|
498
508
|
this.lastSubscriptionId = 1;
|
|
@@ -501,10 +511,36 @@ var DbRef = /** @class */ (function () {
|
|
|
501
511
|
/* Error Subscriptions */
|
|
502
512
|
this.saveErrorHandlers = [];
|
|
503
513
|
/* Save scheduling */
|
|
504
|
-
this.
|
|
505
|
-
|
|
514
|
+
this.enqueueSave = (0, uui_core_1.batch)(function () { return (0, tslib_1.__awaiter)(_this, void 0, void 0, function () {
|
|
515
|
+
var cumulativePatch, lastLogEntry, response, error_1;
|
|
516
|
+
return (0, tslib_1.__generator)(this, function (_a) {
|
|
517
|
+
switch (_a.label) {
|
|
518
|
+
case 0:
|
|
519
|
+
cumulativePatch = this.makeCumulativePatch();
|
|
520
|
+
lastLogEntry = this.log.length;
|
|
521
|
+
if ((0, lodash_isempty_1.default)(cumulativePatch)) {
|
|
522
|
+
return [2 /*return*/];
|
|
523
|
+
}
|
|
524
|
+
_a.label = 1;
|
|
525
|
+
case 1:
|
|
526
|
+
_a.trys.push([1, 3, , 4]);
|
|
527
|
+
return [4 /*yield*/, this.savePatch(cumulativePatch)];
|
|
528
|
+
case 2:
|
|
529
|
+
response = _a.sent();
|
|
530
|
+
this.applyResponse(response, lastLogEntry);
|
|
531
|
+
this.update();
|
|
532
|
+
return [3 /*break*/, 4];
|
|
533
|
+
case 3:
|
|
534
|
+
error_1 = _a.sent();
|
|
535
|
+
this.saveError(cumulativePatch, error_1);
|
|
536
|
+
this.update();
|
|
537
|
+
throw error_1;
|
|
538
|
+
case 4: return [2 /*return*/];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}); });
|
|
506
542
|
this.handleBeforeUnload = function (e) {
|
|
507
|
-
if (_this.
|
|
543
|
+
if (_this.enqueueSave.isBusy) {
|
|
508
544
|
e.returnValue = false;
|
|
509
545
|
return false;
|
|
510
546
|
}
|
|
@@ -518,8 +554,7 @@ var DbRef = /** @class */ (function () {
|
|
|
518
554
|
}
|
|
519
555
|
/** Saves all committed patches. Useful only if autoSave is off. */
|
|
520
556
|
DbRef.prototype.save = function () {
|
|
521
|
-
this.enqueueSave();
|
|
522
|
-
this.update();
|
|
557
|
+
return this.enqueueSave();
|
|
523
558
|
};
|
|
524
559
|
DbRef.prototype.getAutoSave = function () {
|
|
525
560
|
return this.autoSave;
|
|
@@ -527,13 +562,12 @@ var DbRef = /** @class */ (function () {
|
|
|
527
562
|
DbRef.prototype.setAutoSave = function (val) {
|
|
528
563
|
if (this.autoSave != val) {
|
|
529
564
|
this.autoSave = val;
|
|
530
|
-
this.enqueueSave();
|
|
565
|
+
this.autoSave && this.enqueueSave();
|
|
531
566
|
this.update();
|
|
532
567
|
}
|
|
533
568
|
};
|
|
534
569
|
DbRef.prototype.revert = function () {
|
|
535
570
|
this.db = this.base;
|
|
536
|
-
this.errors = [];
|
|
537
571
|
this.log = this.log.slice(0, this.savedPoint);
|
|
538
572
|
this.update();
|
|
539
573
|
};
|
|
@@ -543,18 +577,13 @@ var DbRef = /** @class */ (function () {
|
|
|
543
577
|
};
|
|
544
578
|
/* Db Update logic */
|
|
545
579
|
DbRef.prototype.commit = function (patch) {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
this.update();
|
|
554
|
-
}
|
|
555
|
-
catch (e) {
|
|
556
|
-
this.saveError(patch, e);
|
|
557
|
-
}
|
|
580
|
+
var dbBeforeUpdate = this.db.with(patch);
|
|
581
|
+
patch = this.beforeUpdate(patch, dbBeforeUpdate.tables, this.db.tables);
|
|
582
|
+
patch = (0, patchHelpers_1.mergeEntityPatches)(this.db.tables, patch);
|
|
583
|
+
this.log.push({ patch: patch });
|
|
584
|
+
this.db = this.db.with(patch);
|
|
585
|
+
this.autoSave && this.enqueueSave(null, { throttleMs: this.throttleSaveMs });
|
|
586
|
+
this.update();
|
|
558
587
|
};
|
|
559
588
|
DbRef.prototype.beforeUpdate = function (patch, tables, prevTables) {
|
|
560
589
|
var _this = this;
|
|
@@ -600,24 +629,12 @@ var DbRef = /** @class */ (function () {
|
|
|
600
629
|
return cumulativePatch;
|
|
601
630
|
};
|
|
602
631
|
DbRef.prototype.applyResponse = function (response, newSavedPoint) {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
this.base = this.db;
|
|
610
|
-
this.commitFetch(serverPatch);
|
|
611
|
-
if (this.autoSave) {
|
|
612
|
-
this.isSaveThrottled = true;
|
|
613
|
-
setTimeout(function () {
|
|
614
|
-
_this.isSaveThrottled = false;
|
|
615
|
-
if (_this.savedPoint < _this.log.length) {
|
|
616
|
-
_this.enqueueSave();
|
|
617
|
-
}
|
|
618
|
-
}, this.throttleSaveMs);
|
|
619
|
-
}
|
|
620
|
-
}
|
|
632
|
+
this.tempIdMap.appendServerMapping(response);
|
|
633
|
+
var serverPatch = (0, patchHelpers_1.flattenResponse)(response.submit, this.db.tables);
|
|
634
|
+
serverPatch = (0, patchHelpers_1.mergeEntityPatches)(this.db.tables, serverPatch);
|
|
635
|
+
this.savedPoint = newSavedPoint;
|
|
636
|
+
this.base = this.db;
|
|
637
|
+
this.commitFetch(serverPatch);
|
|
621
638
|
};
|
|
622
639
|
DbRef.prototype.subscribe = function (view, params, onUpdate) {
|
|
623
640
|
var _this = this;
|
|
@@ -658,36 +675,6 @@ var DbRef = /** @class */ (function () {
|
|
|
658
675
|
DbRef.prototype.saveError = function (request, error) {
|
|
659
676
|
this.saveErrorHandlers.forEach(function (handler) { return handler(request, error); });
|
|
660
677
|
};
|
|
661
|
-
DbRef.prototype.enqueueSave = function () {
|
|
662
|
-
var _this = this;
|
|
663
|
-
if (!this.isSaveInProgress && !this.isSaveThrottled) {
|
|
664
|
-
try {
|
|
665
|
-
this.isSaveInProgress = true;
|
|
666
|
-
var lastLogEntry_1 = this.log.length;
|
|
667
|
-
var cumulativePatch_1 = this.makeCumulativePatch();
|
|
668
|
-
if ((0, lodash_isempty_1.default)(cumulativePatch_1)) {
|
|
669
|
-
this.isSaveInProgress = false;
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
this.savePatch(cumulativePatch_1)
|
|
673
|
-
.then(function (response) {
|
|
674
|
-
_this.applyResponse(response, lastLogEntry_1);
|
|
675
|
-
_this.isSaveInProgress = false;
|
|
676
|
-
_this.update();
|
|
677
|
-
})
|
|
678
|
-
.catch(function (reason) {
|
|
679
|
-
_this.saveError(cumulativePatch_1, reason);
|
|
680
|
-
_this.isSaveInProgress = false;
|
|
681
|
-
_this.update();
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
catch (e) {
|
|
685
|
-
this.isSaveInProgress = false;
|
|
686
|
-
this.isSaveThrottled = false;
|
|
687
|
-
throw e;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
678
|
DbRef.prototype.makeLoader = function (options) {
|
|
692
679
|
var loader = new Loader_1.Loader(this, function () { return new SimpleLoadingTracker_1.SimpleLoadingTracker(); }, options);
|
|
693
680
|
this.loaders.push(loader);
|
|
@@ -770,14 +757,22 @@ var DbTable = /** @class */ (function () {
|
|
|
770
757
|
var id = _this.getId(entityPatch);
|
|
771
758
|
var immId = _this.keyToImmutable(id);
|
|
772
759
|
var existing = _this.state.pk.get(immId);
|
|
760
|
+
var isDeleted = false;
|
|
773
761
|
var updated = entityPatch;
|
|
774
762
|
if (existing) {
|
|
775
763
|
updated = (0, tslib_1.__assign)((0, tslib_1.__assign)({}, existing), entityPatch);
|
|
764
|
+
if (_this.schema.deleteFlag) {
|
|
765
|
+
isDeleted = updated[_this.schema.deleteFlag] === true;
|
|
766
|
+
}
|
|
776
767
|
}
|
|
777
|
-
return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated,
|
|
768
|
+
return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated, isNew: !existing, isDeleted: isDeleted };
|
|
778
769
|
});
|
|
779
770
|
var idVal = immutable_1.Seq.Keyed(updates.map(function (entity) { return [entity.immId, entity.updated]; }));
|
|
780
771
|
var newPk = this.state.pk.merge(idVal);
|
|
772
|
+
// TBD: replace with deleteAll after migrating to immutable 4
|
|
773
|
+
updates.filter(function (u) { return u.isDeleted; }).forEach(function (u) {
|
|
774
|
+
newPk = newPk.delete(u.immId);
|
|
775
|
+
});
|
|
781
776
|
var newIndexes = this.state.indexes.map(function (index) {
|
|
782
777
|
var newMap = index.map;
|
|
783
778
|
var _loop_1 = function (n) {
|
|
@@ -785,11 +780,13 @@ var DbTable = /** @class */ (function () {
|
|
|
785
780
|
var newKey = update.updated[index.field];
|
|
786
781
|
if (update.existing) {
|
|
787
782
|
var oldKey = update.existing[index.field];
|
|
788
|
-
if (oldKey !== newKey) {
|
|
783
|
+
if (oldKey !== newKey || update.isDeleted) {
|
|
789
784
|
newMap = newMap.update(oldKey, function (set) { return set.remove(update.immId); });
|
|
790
785
|
}
|
|
791
786
|
}
|
|
792
|
-
|
|
787
|
+
if (!update.isDeleted) {
|
|
788
|
+
newMap = newMap.update(newKey, I.Set(), function (set) { return set.add(update.immId); });
|
|
789
|
+
}
|
|
793
790
|
};
|
|
794
791
|
for (var n = 0; n < updates.length; n++) {
|
|
795
792
|
_loop_1(n);
|