datastore-api 6.1.0 → 6.2.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/dist/datastore-api.cjs.development.js +624 -419
- package/dist/datastore-api.cjs.development.js.map +1 -1
- package/dist/datastore-api.cjs.production.min.js +1 -1
- package/dist/datastore-api.cjs.production.min.js.map +1 -1
- package/dist/datastore-api.esm.js +625 -420
- package/dist/datastore-api.esm.js.map +1 -1
- package/dist/lib/dstore-api.d.ts +25 -2
- package/package.json +100 -102
- package/src/lib/dstore-api.ts +254 -189
|
@@ -3,464 +3,547 @@ import { setImmediate } from 'timers/promises';
|
|
|
3
3
|
import { Datastore, PropertyFilter } from '@google-cloud/datastore';
|
|
4
4
|
export { Datastore, Key, Query, Transaction } from '@google-cloud/datastore';
|
|
5
5
|
import { entity } from '@google-cloud/datastore/build/src/entity';
|
|
6
|
-
import { assertIsObject, assertIsDefined,
|
|
6
|
+
import { assertIsObject, assertIsDefined, assertIsString, assertIsArray, assertIsNumber, assert, getType } from 'assertate-debug';
|
|
7
7
|
import Debug from 'debug';
|
|
8
8
|
import promClient from 'prom-client';
|
|
9
9
|
|
|
10
|
+
function _OverloadYield(e, d) {
|
|
11
|
+
this.v = e, this.k = d;
|
|
12
|
+
}
|
|
13
|
+
function _arrayLikeToArray(r, a) {
|
|
14
|
+
(null == a || a > r.length) && (a = r.length);
|
|
15
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
16
|
+
return n;
|
|
17
|
+
}
|
|
18
|
+
function _asyncIterator(r) {
|
|
19
|
+
var n,
|
|
20
|
+
t,
|
|
21
|
+
o,
|
|
22
|
+
e = 2;
|
|
23
|
+
for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {
|
|
24
|
+
if (t && null != (n = r[t])) return n.call(r);
|
|
25
|
+
if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));
|
|
26
|
+
t = "@@asyncIterator", o = "@@iterator";
|
|
27
|
+
}
|
|
28
|
+
throw new TypeError("Object is not async iterable");
|
|
29
|
+
}
|
|
30
|
+
function AsyncFromSyncIterator(r) {
|
|
31
|
+
function AsyncFromSyncIteratorContinuation(r) {
|
|
32
|
+
if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object."));
|
|
33
|
+
var n = r.done;
|
|
34
|
+
return Promise.resolve(r.value).then(function (r) {
|
|
35
|
+
return {
|
|
36
|
+
value: r,
|
|
37
|
+
done: n
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return AsyncFromSyncIterator = function (r) {
|
|
42
|
+
this.s = r, this.n = r.next;
|
|
43
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
44
|
+
s: null,
|
|
45
|
+
n: null,
|
|
46
|
+
next: function () {
|
|
47
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
48
|
+
},
|
|
49
|
+
return: function (r) {
|
|
50
|
+
var n = this.s.return;
|
|
51
|
+
return void 0 === n ? Promise.resolve({
|
|
52
|
+
value: r,
|
|
53
|
+
done: !0
|
|
54
|
+
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
55
|
+
},
|
|
56
|
+
throw: function (r) {
|
|
57
|
+
var n = this.s.return;
|
|
58
|
+
return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
59
|
+
}
|
|
60
|
+
}, new AsyncFromSyncIterator(r);
|
|
61
|
+
}
|
|
62
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
63
|
+
try {
|
|
64
|
+
var i = n[a](c),
|
|
65
|
+
u = i.value;
|
|
66
|
+
} catch (n) {
|
|
67
|
+
return void e(n);
|
|
68
|
+
}
|
|
69
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
70
|
+
}
|
|
71
|
+
function _asyncToGenerator(n) {
|
|
72
|
+
return function () {
|
|
73
|
+
var t = this,
|
|
74
|
+
e = arguments;
|
|
75
|
+
return new Promise(function (r, o) {
|
|
76
|
+
var a = n.apply(t, e);
|
|
77
|
+
function _next(n) {
|
|
78
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
79
|
+
}
|
|
80
|
+
function _throw(n) {
|
|
81
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
82
|
+
}
|
|
83
|
+
_next(void 0);
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function _awaitAsyncGenerator(e) {
|
|
88
|
+
return new _OverloadYield(e, 0);
|
|
89
|
+
}
|
|
90
|
+
function _construct(t, e, r) {
|
|
91
|
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
|
92
|
+
var o = [null];
|
|
93
|
+
o.push.apply(o, e);
|
|
94
|
+
var p = new (t.bind.apply(t, o))();
|
|
95
|
+
return r && _setPrototypeOf(p, r.prototype), p;
|
|
96
|
+
}
|
|
97
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
98
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
99
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
100
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
101
|
+
t && (r = t);
|
|
102
|
+
var o = 0;
|
|
103
|
+
return function () {
|
|
104
|
+
return o >= r.length ? {
|
|
105
|
+
done: !0
|
|
106
|
+
} : {
|
|
107
|
+
done: !1,
|
|
108
|
+
value: r[o++]
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
113
|
+
}
|
|
114
|
+
function _extends() {
|
|
115
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
116
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
117
|
+
var t = arguments[e];
|
|
118
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
119
|
+
}
|
|
120
|
+
return n;
|
|
121
|
+
}, _extends.apply(null, arguments);
|
|
122
|
+
}
|
|
123
|
+
function _getPrototypeOf(t) {
|
|
124
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
125
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
126
|
+
}, _getPrototypeOf(t);
|
|
127
|
+
}
|
|
128
|
+
function _inheritsLoose(t, o) {
|
|
129
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
|
130
|
+
}
|
|
131
|
+
function _isNativeFunction(t) {
|
|
132
|
+
try {
|
|
133
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
134
|
+
} catch (n) {
|
|
135
|
+
return "function" == typeof t;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
function _isNativeReflectConstruct() {
|
|
139
|
+
try {
|
|
140
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
141
|
+
} catch (t) {}
|
|
142
|
+
return (_isNativeReflectConstruct = function () {
|
|
143
|
+
return !!t;
|
|
144
|
+
})();
|
|
145
|
+
}
|
|
10
146
|
function _regeneratorRuntime() {
|
|
11
147
|
_regeneratorRuntime = function () {
|
|
12
|
-
return
|
|
148
|
+
return e;
|
|
13
149
|
};
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
150
|
+
var t,
|
|
151
|
+
e = {},
|
|
152
|
+
r = Object.prototype,
|
|
153
|
+
n = r.hasOwnProperty,
|
|
154
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
155
|
+
t[e] = r.value;
|
|
19
156
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
function define(
|
|
25
|
-
return Object.defineProperty(
|
|
26
|
-
value:
|
|
157
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
158
|
+
a = i.iterator || "@@iterator",
|
|
159
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
160
|
+
u = i.toStringTag || "@@toStringTag";
|
|
161
|
+
function define(t, e, r) {
|
|
162
|
+
return Object.defineProperty(t, e, {
|
|
163
|
+
value: r,
|
|
27
164
|
enumerable: !0,
|
|
28
165
|
configurable: !0,
|
|
29
166
|
writable: !0
|
|
30
|
-
}),
|
|
167
|
+
}), t[e];
|
|
31
168
|
}
|
|
32
169
|
try {
|
|
33
170
|
define({}, "");
|
|
34
|
-
} catch (
|
|
35
|
-
define = function (
|
|
36
|
-
return
|
|
171
|
+
} catch (t) {
|
|
172
|
+
define = function (t, e, r) {
|
|
173
|
+
return t[e] = r;
|
|
37
174
|
};
|
|
38
175
|
}
|
|
39
|
-
function wrap(
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
value: makeInvokeMethod(
|
|
45
|
-
}),
|
|
176
|
+
function wrap(t, e, r, n) {
|
|
177
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
178
|
+
a = Object.create(i.prototype),
|
|
179
|
+
c = new Context(n || []);
|
|
180
|
+
return o(a, "_invoke", {
|
|
181
|
+
value: makeInvokeMethod(t, r, c)
|
|
182
|
+
}), a;
|
|
46
183
|
}
|
|
47
|
-
function tryCatch(
|
|
184
|
+
function tryCatch(t, e, r) {
|
|
48
185
|
try {
|
|
49
186
|
return {
|
|
50
187
|
type: "normal",
|
|
51
|
-
arg:
|
|
188
|
+
arg: t.call(e, r)
|
|
52
189
|
};
|
|
53
|
-
} catch (
|
|
190
|
+
} catch (t) {
|
|
54
191
|
return {
|
|
55
192
|
type: "throw",
|
|
56
|
-
arg:
|
|
193
|
+
arg: t
|
|
57
194
|
};
|
|
58
195
|
}
|
|
59
196
|
}
|
|
60
|
-
|
|
61
|
-
var
|
|
197
|
+
e.wrap = wrap;
|
|
198
|
+
var h = "suspendedStart",
|
|
199
|
+
l = "suspendedYield",
|
|
200
|
+
f = "executing",
|
|
201
|
+
s = "completed",
|
|
202
|
+
y = {};
|
|
62
203
|
function Generator() {}
|
|
63
204
|
function GeneratorFunction() {}
|
|
64
205
|
function GeneratorFunctionPrototype() {}
|
|
65
|
-
var
|
|
66
|
-
define(
|
|
206
|
+
var p = {};
|
|
207
|
+
define(p, a, function () {
|
|
67
208
|
return this;
|
|
68
209
|
});
|
|
69
|
-
var
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var
|
|
73
|
-
function defineIteratorMethods(
|
|
74
|
-
["next", "throw", "return"].forEach(function (
|
|
75
|
-
define(
|
|
76
|
-
return this._invoke(
|
|
210
|
+
var d = Object.getPrototypeOf,
|
|
211
|
+
v = d && d(d(values([])));
|
|
212
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
213
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
214
|
+
function defineIteratorMethods(t) {
|
|
215
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
216
|
+
define(t, e, function (t) {
|
|
217
|
+
return this._invoke(e, t);
|
|
77
218
|
});
|
|
78
219
|
});
|
|
79
220
|
}
|
|
80
|
-
function AsyncIterator(
|
|
81
|
-
function invoke(
|
|
82
|
-
var
|
|
83
|
-
if ("throw" !==
|
|
84
|
-
var
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
invoke("next",
|
|
88
|
-
}, function (
|
|
89
|
-
invoke("throw",
|
|
90
|
-
}) :
|
|
91
|
-
|
|
92
|
-
}, function (
|
|
93
|
-
return invoke("throw",
|
|
221
|
+
function AsyncIterator(t, e) {
|
|
222
|
+
function invoke(r, o, i, a) {
|
|
223
|
+
var c = tryCatch(t[r], t, o);
|
|
224
|
+
if ("throw" !== c.type) {
|
|
225
|
+
var u = c.arg,
|
|
226
|
+
h = u.value;
|
|
227
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
228
|
+
invoke("next", t, i, a);
|
|
229
|
+
}, function (t) {
|
|
230
|
+
invoke("throw", t, i, a);
|
|
231
|
+
}) : e.resolve(h).then(function (t) {
|
|
232
|
+
u.value = t, i(u);
|
|
233
|
+
}, function (t) {
|
|
234
|
+
return invoke("throw", t, i, a);
|
|
94
235
|
});
|
|
95
236
|
}
|
|
96
|
-
|
|
237
|
+
a(c.arg);
|
|
97
238
|
}
|
|
98
|
-
var
|
|
99
|
-
|
|
100
|
-
value: function (
|
|
239
|
+
var r;
|
|
240
|
+
o(this, "_invoke", {
|
|
241
|
+
value: function (t, n) {
|
|
101
242
|
function callInvokeWithMethodAndArg() {
|
|
102
|
-
return new
|
|
103
|
-
invoke(
|
|
243
|
+
return new e(function (e, r) {
|
|
244
|
+
invoke(t, n, e, r);
|
|
104
245
|
});
|
|
105
246
|
}
|
|
106
|
-
return
|
|
247
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
107
248
|
}
|
|
108
249
|
});
|
|
109
250
|
}
|
|
110
|
-
function makeInvokeMethod(
|
|
111
|
-
var
|
|
112
|
-
return function (
|
|
113
|
-
if (
|
|
114
|
-
if (
|
|
115
|
-
if ("throw" ===
|
|
116
|
-
return
|
|
251
|
+
function makeInvokeMethod(e, r, n) {
|
|
252
|
+
var o = h;
|
|
253
|
+
return function (i, a) {
|
|
254
|
+
if (o === f) throw Error("Generator is already running");
|
|
255
|
+
if (o === s) {
|
|
256
|
+
if ("throw" === i) throw a;
|
|
257
|
+
return {
|
|
258
|
+
value: t,
|
|
259
|
+
done: !0
|
|
260
|
+
};
|
|
117
261
|
}
|
|
118
|
-
for (
|
|
119
|
-
var
|
|
120
|
-
if (
|
|
121
|
-
var
|
|
122
|
-
if (
|
|
123
|
-
if (
|
|
124
|
-
return
|
|
262
|
+
for (n.method = i, n.arg = a;;) {
|
|
263
|
+
var c = n.delegate;
|
|
264
|
+
if (c) {
|
|
265
|
+
var u = maybeInvokeDelegate(c, n);
|
|
266
|
+
if (u) {
|
|
267
|
+
if (u === y) continue;
|
|
268
|
+
return u;
|
|
125
269
|
}
|
|
126
270
|
}
|
|
127
|
-
if ("next" ===
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
} else "return" ===
|
|
131
|
-
|
|
132
|
-
var
|
|
133
|
-
if ("normal" ===
|
|
134
|
-
if (
|
|
271
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
272
|
+
if (o === h) throw o = s, n.arg;
|
|
273
|
+
n.dispatchException(n.arg);
|
|
274
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
275
|
+
o = f;
|
|
276
|
+
var p = tryCatch(e, r, n);
|
|
277
|
+
if ("normal" === p.type) {
|
|
278
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
135
279
|
return {
|
|
136
|
-
value:
|
|
137
|
-
done:
|
|
280
|
+
value: p.arg,
|
|
281
|
+
done: n.done
|
|
138
282
|
};
|
|
139
283
|
}
|
|
140
|
-
"throw" ===
|
|
284
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
141
285
|
}
|
|
142
286
|
};
|
|
143
287
|
}
|
|
144
|
-
function maybeInvokeDelegate(
|
|
145
|
-
var
|
|
146
|
-
|
|
147
|
-
if (
|
|
148
|
-
var
|
|
149
|
-
if ("throw" ===
|
|
150
|
-
var
|
|
151
|
-
return
|
|
288
|
+
function maybeInvokeDelegate(e, r) {
|
|
289
|
+
var n = r.method,
|
|
290
|
+
o = e.iterator[n];
|
|
291
|
+
if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
|
292
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
293
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
294
|
+
var a = i.arg;
|
|
295
|
+
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
152
296
|
}
|
|
153
|
-
function pushTryEntry(
|
|
154
|
-
var
|
|
155
|
-
tryLoc:
|
|
297
|
+
function pushTryEntry(t) {
|
|
298
|
+
var e = {
|
|
299
|
+
tryLoc: t[0]
|
|
156
300
|
};
|
|
157
|
-
1 in
|
|
301
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
158
302
|
}
|
|
159
|
-
function resetTryEntry(
|
|
160
|
-
var
|
|
161
|
-
|
|
303
|
+
function resetTryEntry(t) {
|
|
304
|
+
var e = t.completion || {};
|
|
305
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
162
306
|
}
|
|
163
|
-
function Context(
|
|
307
|
+
function Context(t) {
|
|
164
308
|
this.tryEntries = [{
|
|
165
309
|
tryLoc: "root"
|
|
166
|
-
}],
|
|
310
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
167
311
|
}
|
|
168
|
-
function values(
|
|
169
|
-
if (
|
|
170
|
-
var
|
|
171
|
-
if (
|
|
172
|
-
if ("function" == typeof
|
|
173
|
-
if (!isNaN(
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
for (; ++
|
|
177
|
-
return next.value =
|
|
312
|
+
function values(e) {
|
|
313
|
+
if (e || "" === e) {
|
|
314
|
+
var r = e[a];
|
|
315
|
+
if (r) return r.call(e);
|
|
316
|
+
if ("function" == typeof e.next) return e;
|
|
317
|
+
if (!isNaN(e.length)) {
|
|
318
|
+
var o = -1,
|
|
319
|
+
i = function next() {
|
|
320
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
321
|
+
return next.value = t, next.done = !0, next;
|
|
178
322
|
};
|
|
179
|
-
return
|
|
323
|
+
return i.next = i;
|
|
180
324
|
}
|
|
181
325
|
}
|
|
182
|
-
|
|
183
|
-
next: doneResult
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
function doneResult() {
|
|
187
|
-
return {
|
|
188
|
-
value: undefined,
|
|
189
|
-
done: !0
|
|
190
|
-
};
|
|
326
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
191
327
|
}
|
|
192
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype,
|
|
328
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
193
329
|
value: GeneratorFunctionPrototype,
|
|
194
330
|
configurable: !0
|
|
195
|
-
}),
|
|
331
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
196
332
|
value: GeneratorFunction,
|
|
197
333
|
configurable: !0
|
|
198
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype,
|
|
199
|
-
var
|
|
200
|
-
return !!
|
|
201
|
-
},
|
|
202
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(
|
|
203
|
-
},
|
|
334
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
335
|
+
var e = "function" == typeof t && t.constructor;
|
|
336
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
337
|
+
}, e.mark = function (t) {
|
|
338
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
339
|
+
}, e.awrap = function (t) {
|
|
204
340
|
return {
|
|
205
|
-
__await:
|
|
341
|
+
__await: t
|
|
206
342
|
};
|
|
207
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
343
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
208
344
|
return this;
|
|
209
|
-
}),
|
|
210
|
-
void 0 ===
|
|
211
|
-
var
|
|
212
|
-
return
|
|
213
|
-
return
|
|
345
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
346
|
+
void 0 === i && (i = Promise);
|
|
347
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
348
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
349
|
+
return t.done ? t.value : a.next();
|
|
214
350
|
});
|
|
215
|
-
}, defineIteratorMethods(
|
|
351
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
216
352
|
return this;
|
|
217
|
-
}), define(
|
|
353
|
+
}), define(g, "toString", function () {
|
|
218
354
|
return "[object Generator]";
|
|
219
|
-
}),
|
|
220
|
-
var
|
|
221
|
-
|
|
222
|
-
for (var
|
|
223
|
-
return
|
|
224
|
-
for (;
|
|
225
|
-
var
|
|
226
|
-
if (
|
|
355
|
+
}), e.keys = function (t) {
|
|
356
|
+
var e = Object(t),
|
|
357
|
+
r = [];
|
|
358
|
+
for (var n in e) r.push(n);
|
|
359
|
+
return r.reverse(), function next() {
|
|
360
|
+
for (; r.length;) {
|
|
361
|
+
var t = r.pop();
|
|
362
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
227
363
|
}
|
|
228
364
|
return next.done = !0, next;
|
|
229
365
|
};
|
|
230
|
-
},
|
|
366
|
+
}, e.values = values, Context.prototype = {
|
|
231
367
|
constructor: Context,
|
|
232
|
-
reset: function (
|
|
233
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
368
|
+
reset: function (e) {
|
|
369
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
|
|
234
370
|
},
|
|
235
371
|
stop: function () {
|
|
236
372
|
this.done = !0;
|
|
237
|
-
var
|
|
238
|
-
if ("throw" ===
|
|
373
|
+
var t = this.tryEntries[0].completion;
|
|
374
|
+
if ("throw" === t.type) throw t.arg;
|
|
239
375
|
return this.rval;
|
|
240
376
|
},
|
|
241
|
-
dispatchException: function (
|
|
242
|
-
if (this.done) throw
|
|
243
|
-
var
|
|
244
|
-
function handle(
|
|
245
|
-
return
|
|
377
|
+
dispatchException: function (e) {
|
|
378
|
+
if (this.done) throw e;
|
|
379
|
+
var r = this;
|
|
380
|
+
function handle(n, o) {
|
|
381
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
246
382
|
}
|
|
247
|
-
for (var
|
|
248
|
-
var
|
|
249
|
-
|
|
250
|
-
if ("root" ===
|
|
251
|
-
if (
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
if (
|
|
255
|
-
if (this.prev <
|
|
256
|
-
if (this.prev <
|
|
257
|
-
} else if (
|
|
258
|
-
if (this.prev <
|
|
383
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
384
|
+
var i = this.tryEntries[o],
|
|
385
|
+
a = i.completion;
|
|
386
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
387
|
+
if (i.tryLoc <= this.prev) {
|
|
388
|
+
var c = n.call(i, "catchLoc"),
|
|
389
|
+
u = n.call(i, "finallyLoc");
|
|
390
|
+
if (c && u) {
|
|
391
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
392
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
393
|
+
} else if (c) {
|
|
394
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
259
395
|
} else {
|
|
260
|
-
if (!
|
|
261
|
-
if (this.prev <
|
|
396
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
397
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
262
398
|
}
|
|
263
399
|
}
|
|
264
400
|
}
|
|
265
401
|
},
|
|
266
|
-
abrupt: function (
|
|
267
|
-
for (var
|
|
268
|
-
var
|
|
269
|
-
if (
|
|
270
|
-
var
|
|
402
|
+
abrupt: function (t, e) {
|
|
403
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
404
|
+
var o = this.tryEntries[r];
|
|
405
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
406
|
+
var i = o;
|
|
271
407
|
break;
|
|
272
408
|
}
|
|
273
409
|
}
|
|
274
|
-
|
|
275
|
-
var
|
|
276
|
-
return
|
|
410
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
411
|
+
var a = i ? i.completion : {};
|
|
412
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
277
413
|
},
|
|
278
|
-
complete: function (
|
|
279
|
-
if ("throw" ===
|
|
280
|
-
return "break" ===
|
|
414
|
+
complete: function (t, e) {
|
|
415
|
+
if ("throw" === t.type) throw t.arg;
|
|
416
|
+
return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
|
281
417
|
},
|
|
282
|
-
finish: function (
|
|
283
|
-
for (var
|
|
284
|
-
var
|
|
285
|
-
if (
|
|
418
|
+
finish: function (t) {
|
|
419
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
420
|
+
var r = this.tryEntries[e];
|
|
421
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
286
422
|
}
|
|
287
423
|
},
|
|
288
|
-
catch: function (
|
|
289
|
-
for (var
|
|
290
|
-
var
|
|
291
|
-
if (
|
|
292
|
-
var
|
|
293
|
-
if ("throw" ===
|
|
294
|
-
var
|
|
295
|
-
resetTryEntry(
|
|
424
|
+
catch: function (t) {
|
|
425
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
426
|
+
var r = this.tryEntries[e];
|
|
427
|
+
if (r.tryLoc === t) {
|
|
428
|
+
var n = r.completion;
|
|
429
|
+
if ("throw" === n.type) {
|
|
430
|
+
var o = n.arg;
|
|
431
|
+
resetTryEntry(r);
|
|
296
432
|
}
|
|
297
|
-
return
|
|
433
|
+
return o;
|
|
298
434
|
}
|
|
299
435
|
}
|
|
300
|
-
throw
|
|
436
|
+
throw Error("illegal catch attempt");
|
|
301
437
|
},
|
|
302
|
-
delegateYield: function (
|
|
438
|
+
delegateYield: function (e, r, n) {
|
|
303
439
|
return this.delegate = {
|
|
304
|
-
iterator: values(
|
|
305
|
-
resultName:
|
|
306
|
-
nextLoc:
|
|
307
|
-
}, "next" === this.method && (this.arg =
|
|
440
|
+
iterator: values(e),
|
|
441
|
+
resultName: r,
|
|
442
|
+
nextLoc: n
|
|
443
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
308
444
|
}
|
|
309
|
-
},
|
|
445
|
+
}, e;
|
|
310
446
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
} else {
|
|
322
|
-
Promise.resolve(value).then(_next, _throw);
|
|
447
|
+
function _setPrototypeOf(t, e) {
|
|
448
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
449
|
+
return t.__proto__ = e, t;
|
|
450
|
+
}, _setPrototypeOf(t, e);
|
|
451
|
+
}
|
|
452
|
+
function _unsupportedIterableToArray(r, a) {
|
|
453
|
+
if (r) {
|
|
454
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
455
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
456
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
323
457
|
}
|
|
324
458
|
}
|
|
325
|
-
function
|
|
459
|
+
function _wrapAsyncGenerator(e) {
|
|
326
460
|
return function () {
|
|
327
|
-
|
|
328
|
-
args = arguments;
|
|
329
|
-
return new Promise(function (resolve, reject) {
|
|
330
|
-
var gen = fn.apply(self, args);
|
|
331
|
-
function _next(value) {
|
|
332
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
333
|
-
}
|
|
334
|
-
function _throw(err) {
|
|
335
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
336
|
-
}
|
|
337
|
-
_next(undefined);
|
|
338
|
-
});
|
|
461
|
+
return new AsyncGenerator(e.apply(this, arguments));
|
|
339
462
|
};
|
|
340
463
|
}
|
|
341
|
-
function
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
464
|
+
function AsyncGenerator(e) {
|
|
465
|
+
var r, t;
|
|
466
|
+
function resume(r, t) {
|
|
467
|
+
try {
|
|
468
|
+
var n = e[r](t),
|
|
469
|
+
o = n.value,
|
|
470
|
+
u = o instanceof _OverloadYield;
|
|
471
|
+
Promise.resolve(u ? o.v : o).then(function (t) {
|
|
472
|
+
if (u) {
|
|
473
|
+
var i = "return" === r ? "return" : "next";
|
|
474
|
+
if (!o.k || t.done) return resume(i, t);
|
|
475
|
+
t = e[i](t).value;
|
|
348
476
|
}
|
|
349
|
-
|
|
477
|
+
settle(n.done ? "return" : "normal", t);
|
|
478
|
+
}, function (e) {
|
|
479
|
+
resume("throw", e);
|
|
480
|
+
});
|
|
481
|
+
} catch (e) {
|
|
482
|
+
settle("throw", e);
|
|
350
483
|
}
|
|
351
|
-
return target;
|
|
352
|
-
};
|
|
353
|
-
return _extends.apply(this, arguments);
|
|
354
|
-
}
|
|
355
|
-
function _inheritsLoose(subClass, superClass) {
|
|
356
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
357
|
-
subClass.prototype.constructor = subClass;
|
|
358
|
-
_setPrototypeOf(subClass, superClass);
|
|
359
|
-
}
|
|
360
|
-
function _getPrototypeOf(o) {
|
|
361
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
362
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
363
|
-
};
|
|
364
|
-
return _getPrototypeOf(o);
|
|
365
|
-
}
|
|
366
|
-
function _setPrototypeOf(o, p) {
|
|
367
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
368
|
-
o.__proto__ = p;
|
|
369
|
-
return o;
|
|
370
|
-
};
|
|
371
|
-
return _setPrototypeOf(o, p);
|
|
372
|
-
}
|
|
373
|
-
function _isNativeReflectConstruct() {
|
|
374
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
375
|
-
if (Reflect.construct.sham) return false;
|
|
376
|
-
if (typeof Proxy === "function") return true;
|
|
377
|
-
try {
|
|
378
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
379
|
-
return true;
|
|
380
|
-
} catch (e) {
|
|
381
|
-
return false;
|
|
382
484
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
485
|
+
function settle(e, n) {
|
|
486
|
+
switch (e) {
|
|
487
|
+
case "return":
|
|
488
|
+
r.resolve({
|
|
489
|
+
value: n,
|
|
490
|
+
done: !0
|
|
491
|
+
});
|
|
492
|
+
break;
|
|
493
|
+
case "throw":
|
|
494
|
+
r.reject(n);
|
|
495
|
+
break;
|
|
496
|
+
default:
|
|
497
|
+
r.resolve({
|
|
498
|
+
value: n,
|
|
499
|
+
done: !1
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
396
503
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
504
|
+
this._invoke = function (e, n) {
|
|
505
|
+
return new Promise(function (o, u) {
|
|
506
|
+
var i = {
|
|
507
|
+
key: e,
|
|
508
|
+
arg: n,
|
|
509
|
+
resolve: o,
|
|
510
|
+
reject: u,
|
|
511
|
+
next: null
|
|
512
|
+
};
|
|
513
|
+
t ? t = t.next = i : (r = t = i, resume(e, n));
|
|
514
|
+
});
|
|
515
|
+
}, "function" != typeof e.return && (this.return = void 0);
|
|
401
516
|
}
|
|
402
|
-
function
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
517
|
+
AsyncGenerator.prototype["function" == typeof Symbol && Symbol.asyncIterator || "@@asyncIterator"] = function () {
|
|
518
|
+
return this;
|
|
519
|
+
}, AsyncGenerator.prototype.next = function (e) {
|
|
520
|
+
return this._invoke("next", e);
|
|
521
|
+
}, AsyncGenerator.prototype.throw = function (e) {
|
|
522
|
+
return this._invoke("throw", e);
|
|
523
|
+
}, AsyncGenerator.prototype.return = function (e) {
|
|
524
|
+
return this._invoke("return", e);
|
|
525
|
+
};
|
|
526
|
+
function _wrapNativeSuper(t) {
|
|
527
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
528
|
+
return _wrapNativeSuper = function (t) {
|
|
529
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
530
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
531
|
+
if (void 0 !== r) {
|
|
532
|
+
if (r.has(t)) return r.get(t);
|
|
533
|
+
r.set(t, Wrapper);
|
|
412
534
|
}
|
|
413
535
|
function Wrapper() {
|
|
414
|
-
return _construct(
|
|
536
|
+
return _construct(t, arguments, _getPrototypeOf(this).constructor);
|
|
415
537
|
}
|
|
416
|
-
Wrapper.prototype = Object.create(
|
|
538
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
417
539
|
constructor: {
|
|
418
540
|
value: Wrapper,
|
|
419
|
-
enumerable:
|
|
420
|
-
writable:
|
|
421
|
-
configurable:
|
|
541
|
+
enumerable: !1,
|
|
542
|
+
writable: !0,
|
|
543
|
+
configurable: !0
|
|
422
544
|
}
|
|
423
|
-
});
|
|
424
|
-
|
|
425
|
-
};
|
|
426
|
-
return _wrapNativeSuper(Class);
|
|
427
|
-
}
|
|
428
|
-
function _assertThisInitialized(self) {
|
|
429
|
-
if (self === void 0) {
|
|
430
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
431
|
-
}
|
|
432
|
-
return self;
|
|
433
|
-
}
|
|
434
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
435
|
-
if (!o) return;
|
|
436
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
437
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
438
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
439
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
440
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
441
|
-
}
|
|
442
|
-
function _arrayLikeToArray(arr, len) {
|
|
443
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
444
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
445
|
-
return arr2;
|
|
446
|
-
}
|
|
447
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
448
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
449
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
450
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
451
|
-
if (it) o = it;
|
|
452
|
-
var i = 0;
|
|
453
|
-
return function () {
|
|
454
|
-
if (i >= o.length) return {
|
|
455
|
-
done: true
|
|
456
|
-
};
|
|
457
|
-
return {
|
|
458
|
-
done: false,
|
|
459
|
-
value: o[i++]
|
|
460
|
-
};
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
545
|
+
}), _setPrototypeOf(Wrapper, t);
|
|
546
|
+
}, _wrapNativeSuper(t);
|
|
464
547
|
}
|
|
465
548
|
|
|
466
549
|
/** @ignore */
|
|
@@ -587,20 +670,20 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
587
670
|
assertIsObject(ret, 'entity[Datastore.KEY]/entity._keyStr', "Entity is missing the datastore Key: " + JSON.stringify(ent));
|
|
588
671
|
return ret;
|
|
589
672
|
}
|
|
590
|
-
/** `fixKeys()` is called for all [[IDstoreEntry]]
|
|
673
|
+
/** `fixKeys()` is called for all [[IDstoreEntry]] returned from [[Dstore]].
|
|
591
674
|
*
|
|
592
675
|
* Is ensures that besides `entity[Datastore.KEY]` there is `_keyStr` to be leveraged by [[readKey]].
|
|
593
676
|
*
|
|
594
677
|
* @internal
|
|
595
678
|
*/;
|
|
596
679
|
_proto.fixKeys = function fixKeys(entities) {
|
|
597
|
-
var
|
|
680
|
+
var _this2 = this;
|
|
598
681
|
entities.forEach(function (x) {
|
|
599
682
|
if (!!(x != null && x[Datastore.KEY]) && x[Datastore.KEY]) {
|
|
600
683
|
assertIsDefined(x[Datastore.KEY]);
|
|
601
684
|
assertIsObject(x[Datastore.KEY]);
|
|
602
685
|
// Old TypesScript has problems with symbols as a property
|
|
603
|
-
x._keyStr =
|
|
686
|
+
x._keyStr = _this2.keySerialize(x[Datastore.KEY]);
|
|
604
687
|
}
|
|
605
688
|
});
|
|
606
689
|
return entities;
|
|
@@ -622,7 +705,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
622
705
|
_proto.get =
|
|
623
706
|
/*#__PURE__*/
|
|
624
707
|
function () {
|
|
625
|
-
var _get = /*#__PURE__*/_asyncToGenerator(
|
|
708
|
+
var _get = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(key) {
|
|
626
709
|
var result;
|
|
627
710
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
628
711
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -667,7 +750,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
667
750
|
_proto.getMulti =
|
|
668
751
|
/*#__PURE__*/
|
|
669
752
|
function () {
|
|
670
|
-
var _getMulti = /*#__PURE__*/_asyncToGenerator(
|
|
753
|
+
var _getMulti = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(keys) {
|
|
671
754
|
var results, metricEnd, _yield$this$getDoT$ge, entities, entitiesByKey;
|
|
672
755
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
673
756
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -764,7 +847,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
764
847
|
_proto.set =
|
|
765
848
|
/*#__PURE__*/
|
|
766
849
|
function () {
|
|
767
|
-
var _set = /*#__PURE__*/_asyncToGenerator(
|
|
850
|
+
var _set = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(key, data) {
|
|
768
851
|
var saveEntity;
|
|
769
852
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
770
853
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -829,8 +912,8 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
829
912
|
_proto.save =
|
|
830
913
|
/*#__PURE__*/
|
|
831
914
|
function () {
|
|
832
|
-
var _save = /*#__PURE__*/_asyncToGenerator(
|
|
833
|
-
var ret, metricEnd,
|
|
915
|
+
var _save = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(entities) {
|
|
916
|
+
var ret, metricEnd, _iterator2, _step2, e, _iterator3, _step3, _e;
|
|
834
917
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
835
918
|
while (1) switch (_context4.prev = _context4.next) {
|
|
836
919
|
case 0:
|
|
@@ -839,8 +922,8 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
839
922
|
_context4.prev = 2;
|
|
840
923
|
// Within Transaction we don't get any answer here!
|
|
841
924
|
// [ { mutationResults: [ [Object], [Object] ], indexUpdates: 51 } ]
|
|
842
|
-
for (
|
|
843
|
-
e =
|
|
925
|
+
for (_iterator2 = _createForOfIteratorHelperLoose(entities); !(_step2 = _iterator2()).done;) {
|
|
926
|
+
e = _step2.value;
|
|
844
927
|
assertIsObject(e.key);
|
|
845
928
|
assertIsObject(e.data);
|
|
846
929
|
this.fixKeys([e.data]);
|
|
@@ -860,8 +943,8 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
860
943
|
_context4.t0 = undefined;
|
|
861
944
|
case 9:
|
|
862
945
|
ret = _context4.t0;
|
|
863
|
-
for (
|
|
864
|
-
_e =
|
|
946
|
+
for (_iterator3 = _createForOfIteratorHelperLoose(entities); !(_step3 = _iterator3()).done;) {
|
|
947
|
+
_e = _step3.value;
|
|
865
948
|
_e.data[Datastore.KEY] = _e.key;
|
|
866
949
|
this.fixKeys([_e.data]);
|
|
867
950
|
}
|
|
@@ -918,7 +1001,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
918
1001
|
_proto.insert =
|
|
919
1002
|
/*#__PURE__*/
|
|
920
1003
|
function () {
|
|
921
|
-
var _insert = /*#__PURE__*/_asyncToGenerator(
|
|
1004
|
+
var _insert = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(entities) {
|
|
922
1005
|
var ret, metricEnd;
|
|
923
1006
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
924
1007
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -990,7 +1073,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
990
1073
|
_proto.update =
|
|
991
1074
|
/*#__PURE__*/
|
|
992
1075
|
function () {
|
|
993
|
-
var _update = /*#__PURE__*/_asyncToGenerator(
|
|
1076
|
+
var _update = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(entities) {
|
|
994
1077
|
var ret, metricEnd;
|
|
995
1078
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
996
1079
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -1064,7 +1147,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1064
1147
|
_proto["delete"] =
|
|
1065
1148
|
/*#__PURE__*/
|
|
1066
1149
|
function () {
|
|
1067
|
-
var _delete2 = /*#__PURE__*/_asyncToGenerator(
|
|
1150
|
+
var _delete2 = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(keys) {
|
|
1068
1151
|
var ret, metricEnd;
|
|
1069
1152
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1070
1153
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -1137,7 +1220,7 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1137
1220
|
}
|
|
1138
1221
|
};
|
|
1139
1222
|
_proto.runQuery = /*#__PURE__*/function () {
|
|
1140
|
-
var _runQuery = /*#__PURE__*/_asyncToGenerator(
|
|
1223
|
+
var _runQuery = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(query) {
|
|
1141
1224
|
var ret, metricEnd, _yield$this$getDoT$ru, entities, info;
|
|
1142
1225
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
1143
1226
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -1189,14 +1272,15 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1189
1272
|
* @param selection selectionList of [[Query]] select() calls.
|
|
1190
1273
|
* @param cursor unsupported so far.
|
|
1191
1274
|
*
|
|
1275
|
+
* @throws [[DstoreError]]
|
|
1192
1276
|
* @category Datastore Drop-In
|
|
1193
1277
|
*/
|
|
1194
1278
|
;
|
|
1195
1279
|
_proto.query =
|
|
1196
1280
|
/*#__PURE__*/
|
|
1197
1281
|
function () {
|
|
1198
|
-
var _query = /*#__PURE__*/_asyncToGenerator(
|
|
1199
|
-
var q,
|
|
1282
|
+
var _query = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9(kindName, filters, limit, ordering, selection, cursor) {
|
|
1283
|
+
var q, _iterator4, _step4, filterSpec, _iterator5, _step5, orderField;
|
|
1200
1284
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1201
1285
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1202
1286
|
case 0:
|
|
@@ -1217,14 +1301,14 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1217
1301
|
assertIsNumber(limit);
|
|
1218
1302
|
_context9.prev = 7;
|
|
1219
1303
|
q = this.createQuery(kindName);
|
|
1220
|
-
for (
|
|
1221
|
-
filterSpec =
|
|
1304
|
+
for (_iterator4 = _createForOfIteratorHelperLoose(filters); !(_step4 = _iterator4()).done;) {
|
|
1305
|
+
filterSpec = _step4.value;
|
|
1222
1306
|
assertIsObject(filterSpec);
|
|
1223
1307
|
// @ts-ignore
|
|
1224
1308
|
q.filter(_construct(PropertyFilter, filterSpec));
|
|
1225
1309
|
}
|
|
1226
|
-
for (
|
|
1227
|
-
orderField =
|
|
1310
|
+
for (_iterator5 = _createForOfIteratorHelperLoose(ordering); !(_step5 = _iterator5()).done;) {
|
|
1311
|
+
orderField = _step5.value;
|
|
1228
1312
|
q.order(orderField);
|
|
1229
1313
|
}
|
|
1230
1314
|
if (limit > 0) {
|
|
@@ -1260,6 +1344,128 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1260
1344
|
}
|
|
1261
1345
|
return query;
|
|
1262
1346
|
}()
|
|
1347
|
+
/** `iterate()` is a modernized version of `query()`.
|
|
1348
|
+
*
|
|
1349
|
+
* It takes a Parameter object and returns an AsyncIterable.
|
|
1350
|
+
* Entities returned have been processed by `fixKeys()`.
|
|
1351
|
+
*
|
|
1352
|
+
* @param kindName Name of the [[Datastore]][Kind](https://cloud.google.com/datastore/docs/concepts/entities#kinds_and_identifiers) ("Table") which should be searched.
|
|
1353
|
+
* @param filters List of [[Query]] filter() calls.
|
|
1354
|
+
* @param limit Maximum Number of Results to return.
|
|
1355
|
+
* @param ordering List of [[Query]] order() calls.
|
|
1356
|
+
* @param selection selectionList of [[Query]] select() calls.
|
|
1357
|
+
*
|
|
1358
|
+
* @category Additional
|
|
1359
|
+
*/
|
|
1360
|
+
;
|
|
1361
|
+
_proto.iterate = function iterate(_ref) {
|
|
1362
|
+
var _this = this;
|
|
1363
|
+
var kindName = _ref.kindName,
|
|
1364
|
+
_ref$filters = _ref.filters,
|
|
1365
|
+
filters = _ref$filters === void 0 ? [] : _ref$filters,
|
|
1366
|
+
_ref$limit = _ref.limit,
|
|
1367
|
+
limit = _ref$limit === void 0 ? 2500 : _ref$limit,
|
|
1368
|
+
_ref$ordering = _ref.ordering,
|
|
1369
|
+
ordering = _ref$ordering === void 0 ? [] : _ref$ordering,
|
|
1370
|
+
_ref$selection = _ref.selection,
|
|
1371
|
+
selection = _ref$selection === void 0 ? [] : _ref$selection;
|
|
1372
|
+
return _wrapAsyncGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
|
|
1373
|
+
var q, _iterator6, _step6, filterSpec, _iterator7, _step7, orderField, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _entity, ret;
|
|
1374
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1375
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1376
|
+
case 0:
|
|
1377
|
+
assertIsString(kindName);
|
|
1378
|
+
assertIsArray(filters);
|
|
1379
|
+
assertIsNumber(limit);
|
|
1380
|
+
_context10.prev = 3;
|
|
1381
|
+
q = _this.getDoT().createQuery(kindName);
|
|
1382
|
+
for (_iterator6 = _createForOfIteratorHelperLoose(filters); !(_step6 = _iterator6()).done;) {
|
|
1383
|
+
filterSpec = _step6.value;
|
|
1384
|
+
assertIsObject(filterSpec);
|
|
1385
|
+
// @ts-ignore
|
|
1386
|
+
q.filter(_construct(PropertyFilter, filterSpec));
|
|
1387
|
+
}
|
|
1388
|
+
for (_iterator7 = _createForOfIteratorHelperLoose(ordering); !(_step7 = _iterator7()).done;) {
|
|
1389
|
+
orderField = _step7.value;
|
|
1390
|
+
q.order(orderField);
|
|
1391
|
+
}
|
|
1392
|
+
if (limit > 0) {
|
|
1393
|
+
q.limit(limit);
|
|
1394
|
+
}
|
|
1395
|
+
if (selection.length > 0) {
|
|
1396
|
+
q.select(selection);
|
|
1397
|
+
}
|
|
1398
|
+
_iteratorAbruptCompletion = false;
|
|
1399
|
+
_didIteratorError = false;
|
|
1400
|
+
_context10.prev = 11;
|
|
1401
|
+
_iterator = _asyncIterator(_this.getDoT().runStream(q));
|
|
1402
|
+
case 13:
|
|
1403
|
+
_context10.next = 15;
|
|
1404
|
+
return _awaitAsyncGenerator(_iterator.next());
|
|
1405
|
+
case 15:
|
|
1406
|
+
if (!(_iteratorAbruptCompletion = !(_step = _context10.sent).done)) {
|
|
1407
|
+
_context10.next = 24;
|
|
1408
|
+
break;
|
|
1409
|
+
}
|
|
1410
|
+
_entity = _step.value;
|
|
1411
|
+
ret = _this.fixKeys([_entity])[0];
|
|
1412
|
+
assertIsDefined(ret, 'datastore.iterate: entity is undefined');
|
|
1413
|
+
_context10.next = 21;
|
|
1414
|
+
return ret;
|
|
1415
|
+
case 21:
|
|
1416
|
+
_iteratorAbruptCompletion = false;
|
|
1417
|
+
_context10.next = 13;
|
|
1418
|
+
break;
|
|
1419
|
+
case 24:
|
|
1420
|
+
_context10.next = 30;
|
|
1421
|
+
break;
|
|
1422
|
+
case 26:
|
|
1423
|
+
_context10.prev = 26;
|
|
1424
|
+
_context10.t0 = _context10["catch"](11);
|
|
1425
|
+
_didIteratorError = true;
|
|
1426
|
+
_iteratorError = _context10.t0;
|
|
1427
|
+
case 30:
|
|
1428
|
+
_context10.prev = 30;
|
|
1429
|
+
_context10.prev = 31;
|
|
1430
|
+
if (!(_iteratorAbruptCompletion && _iterator["return"] != null)) {
|
|
1431
|
+
_context10.next = 35;
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
1434
|
+
_context10.next = 35;
|
|
1435
|
+
return _awaitAsyncGenerator(_iterator["return"]());
|
|
1436
|
+
case 35:
|
|
1437
|
+
_context10.prev = 35;
|
|
1438
|
+
if (!_didIteratorError) {
|
|
1439
|
+
_context10.next = 38;
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
throw _iteratorError;
|
|
1443
|
+
case 38:
|
|
1444
|
+
return _context10.finish(35);
|
|
1445
|
+
case 39:
|
|
1446
|
+
return _context10.finish(30);
|
|
1447
|
+
case 40:
|
|
1448
|
+
_context10.next = 47;
|
|
1449
|
+
break;
|
|
1450
|
+
case 42:
|
|
1451
|
+
_context10.prev = 42;
|
|
1452
|
+
_context10.t1 = _context10["catch"](3);
|
|
1453
|
+
_context10.next = 46;
|
|
1454
|
+
return _awaitAsyncGenerator(setImmediate());
|
|
1455
|
+
case 46:
|
|
1456
|
+
throw new DstoreError('datastore.query error', _context10.t1, {
|
|
1457
|
+
kindName: kindName,
|
|
1458
|
+
filters: filters,
|
|
1459
|
+
limit: limit,
|
|
1460
|
+
ordering: ordering
|
|
1461
|
+
});
|
|
1462
|
+
case 47:
|
|
1463
|
+
case "end":
|
|
1464
|
+
return _context10.stop();
|
|
1465
|
+
}
|
|
1466
|
+
}, _callee10, null, [[3, 42], [11, 26, 30, 40], [31,, 35, 39]]);
|
|
1467
|
+
}))();
|
|
1468
|
+
}
|
|
1263
1469
|
/** Allocate one ID in the Datastore.
|
|
1264
1470
|
*
|
|
1265
1471
|
* Currently (late 2021) there is no documentation provided by Google for the underlying node function.
|
|
@@ -1270,31 +1476,30 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1270
1476
|
* The ID is a string encoded large number. This function will never return the same ID twice for any given Datastore.
|
|
1271
1477
|
* If you provide a kindName the ID will be namespaced to this kind.
|
|
1272
1478
|
* In fact the generated ID is namespaced via an incomplete [[Key]] of the given Kind.
|
|
1273
|
-
|
|
1274
|
-
;
|
|
1479
|
+
*/;
|
|
1275
1480
|
_proto.allocateOneId =
|
|
1276
1481
|
/*#__PURE__*/
|
|
1277
1482
|
function () {
|
|
1278
|
-
var _allocateOneId = /*#__PURE__*/_asyncToGenerator(
|
|
1483
|
+
var _allocateOneId = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(kindName) {
|
|
1279
1484
|
var ret;
|
|
1280
|
-
return _regeneratorRuntime().wrap(function
|
|
1281
|
-
while (1) switch (
|
|
1485
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1486
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1282
1487
|
case 0:
|
|
1283
1488
|
if (kindName === void 0) {
|
|
1284
1489
|
kindName = 'Numbering';
|
|
1285
1490
|
}
|
|
1286
1491
|
assertIsString(kindName);
|
|
1287
|
-
|
|
1492
|
+
_context11.next = 4;
|
|
1288
1493
|
return this.datastore.allocateIds(this.key([kindName]), 1);
|
|
1289
1494
|
case 4:
|
|
1290
|
-
ret =
|
|
1495
|
+
ret = _context11.sent[0][0].id;
|
|
1291
1496
|
assertIsString(ret);
|
|
1292
|
-
return
|
|
1497
|
+
return _context11.abrupt("return", ret);
|
|
1293
1498
|
case 7:
|
|
1294
1499
|
case "end":
|
|
1295
|
-
return
|
|
1500
|
+
return _context11.stop();
|
|
1296
1501
|
}
|
|
1297
|
-
},
|
|
1502
|
+
}, _callee11, this);
|
|
1298
1503
|
}));
|
|
1299
1504
|
function allocateOneId(_x16) {
|
|
1300
1505
|
return _allocateOneId.apply(this, arguments);
|
|
@@ -1313,72 +1518,72 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1313
1518
|
_proto.runInTransaction =
|
|
1314
1519
|
/*#__PURE__*/
|
|
1315
1520
|
function () {
|
|
1316
|
-
var _runInTransaction = /*#__PURE__*/_asyncToGenerator(
|
|
1521
|
+
var _runInTransaction = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(func) {
|
|
1317
1522
|
var ret, transaction;
|
|
1318
|
-
return _regeneratorRuntime().wrap(function
|
|
1319
|
-
while (1) switch (
|
|
1523
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1524
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1320
1525
|
case 0:
|
|
1321
1526
|
transaction = this.datastore.transaction();
|
|
1322
|
-
|
|
1323
|
-
return transactionAsyncLocalStorage.run(transaction, /*#__PURE__*/_asyncToGenerator(
|
|
1527
|
+
_context13.next = 3;
|
|
1528
|
+
return transactionAsyncLocalStorage.run(transaction, /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
1324
1529
|
var _yield$transaction$ru, transactionInfo, transactionRunApiResponse, commitApiResponse, rollbackInfo;
|
|
1325
|
-
return _regeneratorRuntime().wrap(function
|
|
1326
|
-
while (1) switch (
|
|
1530
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1531
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1327
1532
|
case 0:
|
|
1328
|
-
|
|
1533
|
+
_context12.next = 2;
|
|
1329
1534
|
return transaction.run();
|
|
1330
1535
|
case 2:
|
|
1331
|
-
_yield$transaction$ru =
|
|
1536
|
+
_yield$transaction$ru = _context12.sent;
|
|
1332
1537
|
transactionInfo = _yield$transaction$ru[0];
|
|
1333
1538
|
transactionRunApiResponse = _yield$transaction$ru[1];
|
|
1334
|
-
|
|
1335
|
-
|
|
1539
|
+
_context12.prev = 5;
|
|
1540
|
+
_context12.next = 8;
|
|
1336
1541
|
return func();
|
|
1337
1542
|
case 8:
|
|
1338
|
-
ret =
|
|
1339
|
-
|
|
1543
|
+
ret = _context12.sent;
|
|
1544
|
+
_context12.next = 20;
|
|
1340
1545
|
break;
|
|
1341
1546
|
case 11:
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1547
|
+
_context12.prev = 11;
|
|
1548
|
+
_context12.t0 = _context12["catch"](5);
|
|
1549
|
+
_context12.next = 15;
|
|
1345
1550
|
return transaction.rollback();
|
|
1346
1551
|
case 15:
|
|
1347
|
-
rollbackInfo =
|
|
1348
|
-
debug('Transaction failed, rollback initiated: %O %O %O %O', transactionInfo, transactionRunApiResponse, rollbackInfo,
|
|
1349
|
-
|
|
1552
|
+
rollbackInfo = _context12.sent;
|
|
1553
|
+
debug('Transaction failed, rollback initiated: %O %O %O %O', transactionInfo, transactionRunApiResponse, rollbackInfo, _context12.t0);
|
|
1554
|
+
_context12.next = 19;
|
|
1350
1555
|
return setImmediate();
|
|
1351
1556
|
case 19:
|
|
1352
|
-
throw new DstoreError('datastore.transaction execution error',
|
|
1557
|
+
throw new DstoreError('datastore.transaction execution error', _context12.t0);
|
|
1353
1558
|
case 20:
|
|
1354
|
-
|
|
1355
|
-
|
|
1559
|
+
_context12.prev = 20;
|
|
1560
|
+
_context12.next = 23;
|
|
1356
1561
|
return transaction.commit();
|
|
1357
1562
|
case 23:
|
|
1358
|
-
commitApiResponse =
|
|
1359
|
-
|
|
1563
|
+
commitApiResponse = _context12.sent[0];
|
|
1564
|
+
_context12.next = 32;
|
|
1360
1565
|
break;
|
|
1361
1566
|
case 26:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
debug('Transaction commit failed: %O %O %O %O ret: %O', transactionInfo, transactionRunApiResponse, commitApiResponse,
|
|
1365
|
-
|
|
1567
|
+
_context12.prev = 26;
|
|
1568
|
+
_context12.t1 = _context12["catch"](20);
|
|
1569
|
+
debug('Transaction commit failed: %O %O %O %O ret: %O', transactionInfo, transactionRunApiResponse, commitApiResponse, _context12.t1, ret);
|
|
1570
|
+
_context12.next = 31;
|
|
1366
1571
|
return setImmediate();
|
|
1367
1572
|
case 31:
|
|
1368
|
-
throw new DstoreError('datastore.transaction execution error',
|
|
1573
|
+
throw new DstoreError('datastore.transaction execution error', _context12.t1);
|
|
1369
1574
|
case 32:
|
|
1370
1575
|
case "end":
|
|
1371
|
-
return
|
|
1576
|
+
return _context12.stop();
|
|
1372
1577
|
}
|
|
1373
|
-
},
|
|
1578
|
+
}, _callee12, null, [[5, 11], [20, 26]]);
|
|
1374
1579
|
})));
|
|
1375
1580
|
case 3:
|
|
1376
|
-
return
|
|
1581
|
+
return _context13.abrupt("return", ret);
|
|
1377
1582
|
case 4:
|
|
1378
1583
|
case "end":
|
|
1379
|
-
return
|
|
1584
|
+
return _context13.stop();
|
|
1380
1585
|
}
|
|
1381
|
-
},
|
|
1586
|
+
}, _callee13, this);
|
|
1382
1587
|
}));
|
|
1383
1588
|
function runInTransaction(_x17) {
|
|
1384
1589
|
return _runInTransaction.apply(this, arguments);
|
|
@@ -1388,29 +1593,29 @@ var Dstore = /*#__PURE__*/function () {
|
|
|
1388
1593
|
return Dstore;
|
|
1389
1594
|
}();
|
|
1390
1595
|
var DstoreError = /*#__PURE__*/function (_Error) {
|
|
1391
|
-
_inheritsLoose(DstoreError, _Error);
|
|
1392
1596
|
function DstoreError(message, originalError, extensions) {
|
|
1393
|
-
var
|
|
1394
|
-
var
|
|
1395
|
-
|
|
1597
|
+
var _this3$stack, _originalError$stack, _this3$stack2;
|
|
1598
|
+
var _this3;
|
|
1599
|
+
_this3 = _Error.call(this, message + ": " + (originalError == null ? void 0 : originalError.message)) || this;
|
|
1396
1600
|
// if no name provided, use the default. defineProperty ensures that it stays non-enumerable
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
if (!
|
|
1400
|
-
Object.defineProperty(
|
|
1601
|
+
_this3.extensions = void 0;
|
|
1602
|
+
_this3.originalError = void 0;
|
|
1603
|
+
if (!_this3.name) {
|
|
1604
|
+
Object.defineProperty(_this3, 'name', {
|
|
1401
1605
|
value: 'DstoreError'
|
|
1402
1606
|
});
|
|
1403
1607
|
}
|
|
1404
1608
|
// metadata: Metadata { internalRepr: Map(0) {}, options: {} },
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1609
|
+
_this3.originalError = originalError;
|
|
1610
|
+
_this3.extensions = _extends({}, extensions);
|
|
1611
|
+
_this3.stack = (((_this3$stack = _this3.stack) == null ? void 0 : _this3$stack.split('\n')[0]) || '') + '\n' + ((originalError == null || (_originalError$stack = originalError.stack) == null || (_originalError$stack = _originalError$stack.split('\n')) == null || (_originalError$stack = _originalError$stack.slice(1)) == null ? void 0 : _originalError$stack.join('\n')) || '') + '\n' + (((_this3$stack2 = _this3.stack) == null || (_this3$stack2 = _this3$stack2.split('\n')) == null || (_this3$stack2 = _this3$stack2.slice(1)) == null ? void 0 : _this3$stack2.join('\n')) || '');
|
|
1408
1612
|
// These are usually present on Datastore Errors
|
|
1409
1613
|
// logger.error({ err: originalError, extensions }, message);
|
|
1410
|
-
return
|
|
1614
|
+
return _this3;
|
|
1411
1615
|
}
|
|
1616
|
+
_inheritsLoose(DstoreError, _Error);
|
|
1412
1617
|
return DstoreError;
|
|
1413
|
-
}(
|
|
1618
|
+
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
1414
1619
|
|
|
1415
1620
|
/*
|
|
1416
1621
|
* assert.ts
|