Socket
Socket
Sign inDemoInstall

datastore-api

Package Overview
Dependencies
106
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.3 to 6.0.0

414

dist/datastore-api.cjs.development.js

@@ -15,252 +15,252 @@ 'use strict';

_regeneratorRuntime = function () {
return e;
return exports;
};
var t,
e = {},
r = Object.prototype,
n = r.hasOwnProperty,
o = Object.defineProperty || function (t, e, r) {
t[e] = r.value;
var exports = {},
Op = Object.prototype,
hasOwn = Op.hasOwnProperty,
defineProperty = Object.defineProperty || function (obj, key, desc) {
obj[key] = desc.value;
},
i = "function" == typeof Symbol ? Symbol : {},
a = i.iterator || "@@iterator",
c = i.asyncIterator || "@@asyncIterator",
u = i.toStringTag || "@@toStringTag";
function define(t, e, r) {
return Object.defineProperty(t, e, {
value: r,
$Symbol = "function" == typeof Symbol ? Symbol : {},
iteratorSymbol = $Symbol.iterator || "@@iterator",
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
return Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}), t[e];
}), obj[key];
}
try {
define({}, "");
} catch (t) {
define = function (t, e, r) {
return t[e] = r;
} catch (err) {
define = function (obj, key, value) {
return obj[key] = value;
};
}
function wrap(t, e, r, n) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype),
c = new Context(n || []);
return o(a, "_invoke", {
value: makeInvokeMethod(t, r, c)
}), a;
function wrap(innerFn, outerFn, self, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
generator = Object.create(protoGenerator.prototype),
context = new Context(tryLocsList || []);
return defineProperty(generator, "_invoke", {
value: makeInvokeMethod(innerFn, self, context)
}), generator;
}
function tryCatch(t, e, r) {
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: t.call(e, r)
arg: fn.call(obj, arg)
};
} catch (t) {
} catch (err) {
return {
type: "throw",
arg: t
arg: err
};
}
}
e.wrap = wrap;
var h = "suspendedStart",
l = "suspendedYield",
f = "executing",
s = "completed",
y = {};
exports.wrap = wrap;
var ContinueSentinel = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
define(p, a, function () {
var IteratorPrototype = {};
define(IteratorPrototype, iteratorSymbol, function () {
return this;
});
var d = Object.getPrototypeOf,
v = d && d(d(values([])));
v && v !== r && n.call(v, a) && (p = v);
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(t) {
["next", "throw", "return"].forEach(function (e) {
define(t, e, function (t) {
return this._invoke(e, t);
var getProto = Object.getPrototypeOf,
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
define(prototype, method, function (arg) {
return this._invoke(method, arg);
});
});
}
function AsyncIterator(t, e) {
function invoke(r, o, i, a) {
var c = tryCatch(t[r], t, o);
if ("throw" !== c.type) {
var u = c.arg,
h = u.value;
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
invoke("next", t, i, a);
}, function (t) {
invoke("throw", t, i, a);
}) : e.resolve(h).then(function (t) {
u.value = t, i(u);
}, function (t) {
return invoke("throw", t, i, a);
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if ("throw" !== record.type) {
var result = record.arg,
value = result.value;
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
result.value = unwrapped, resolve(result);
}, function (error) {
return invoke("throw", error, resolve, reject);
});
}
a(c.arg);
reject(record.arg);
}
var r;
o(this, "_invoke", {
value: function (t, n) {
var previousPromise;
defineProperty(this, "_invoke", {
value: function (method, arg) {
function callInvokeWithMethodAndArg() {
return new e(function (e, r) {
invoke(t, n, e, r);
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e, r, n) {
var o = h;
return function (i, a) {
if (o === f) throw new Error("Generator is already running");
if (o === s) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
function makeInvokeMethod(innerFn, self, context) {
var state = "suspendedStart";
return function (method, arg) {
if ("executing" === state) throw new Error("Generator is already running");
if ("completed" === state) {
if ("throw" === method) throw arg;
return doneResult();
}
for (n.method = i, n.arg = a;;) {
var c = n.delegate;
if (c) {
var u = maybeInvokeDelegate(c, n);
if (u) {
if (u === y) continue;
return u;
for (context.method = method, context.arg = arg;;) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (o === h) throw o = s, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = f;
var p = tryCatch(e, r, n);
if ("normal" === p.type) {
if (o = n.done ? s : l, p.arg === y) continue;
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
if ("suspendedStart" === state) throw state = "completed", context.arg;
context.dispatchException(context.arg);
} else "return" === context.method && context.abrupt("return", context.arg);
state = "executing";
var record = tryCatch(innerFn, self, context);
if ("normal" === record.type) {
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
return {
value: p.arg,
done: n.done
value: record.arg,
done: context.done
};
}
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
}
};
}
function maybeInvokeDelegate(e, r) {
var n = r.method,
o = e.iterator[n];
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;
var i = tryCatch(o, e.iterator, r.arg);
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
var a = i.arg;
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);
function maybeInvokeDelegate(delegate, context) {
var methodName = context.method,
method = delegate.iterator[methodName];
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
var record = tryCatch(method, delegate.iterator, context.arg);
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
var info = record.arg;
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
}
function pushTryEntry(t) {
var e = {
tryLoc: t[0]
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
}
function resetTryEntry(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e;
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal", delete record.arg, entry.completion = record;
}
function Context(t) {
function Context(tryLocsList) {
this.tryEntries = [{
tryLoc: "root"
}], t.forEach(pushTryEntry, this), this.reset(!0);
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
}
function values(e) {
if (e || "" === e) {
var r = e[a];
if (r) return r.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var o = -1,
i = function next() {
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
return next.value = t, next.done = !0, next;
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) return iteratorMethod.call(iterable);
if ("function" == typeof iterable.next) return iterable;
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
return next.value = undefined, next.done = !0, next;
};
return i.next = i;
return next.next = next;
}
}
throw new TypeError(typeof e + " is not iterable");
return {
next: doneResult
};
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
function doneResult() {
return {
value: undefined,
done: !0
};
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), o(GeneratorFunctionPrototype, "constructor", {
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
}, e.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
}, e.awrap = function (t) {
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
var ctor = "function" == typeof genFun && genFun.constructor;
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
}, exports.mark = function (genFun) {
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
}, exports.awrap = function (arg) {
return {
__await: t
__await: arg
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
return this;
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(wrap(t, r, n, o), i);
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
void 0 === PromiseImpl && (PromiseImpl = Promise);
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
return this;
}), define(g, "toString", function () {
}), define(Gp, "toString", function () {
return "[object Generator]";
}), e.keys = function (t) {
var e = Object(t),
r = [];
for (var n in e) r.push(n);
return r.reverse(), function next() {
for (; r.length;) {
var t = r.pop();
if (t in e) return next.value = t, next.done = !1, next;
}), exports.keys = function (val) {
var object = Object(val),
keys = [];
for (var key in object) keys.push(key);
return keys.reverse(), function next() {
for (; keys.length;) {
var key = keys.pop();
if (key in object) return next.value = key, next.done = !1, next;
}
return next.done = !0, next;
};
}, e.values = values, Context.prototype = {
}, exports.values = values, Context.prototype = {
constructor: Context,
reset: function (e) {
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);
reset: function (skipTempReset) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
},
stop: function () {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
var rootRecord = this.tryEntries[0].completion;
if ("throw" === rootRecord.type) throw rootRecord.arg;
return this.rval;
},
dispatchException: function (e) {
if (this.done) throw e;
var r = this;
function handle(n, o) {
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
dispatchException: function (exception) {
if (this.done) throw exception;
var context = this;
function handle(loc, caught) {
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i.completion;
if ("root" === i.tryLoc) return handle("end");
if (i.tryLoc <= this.prev) {
var c = n.call(i, "catchLoc"),
u = n.call(i, "finallyLoc");
if (c && u) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
} else if (c) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i],
record = entry.completion;
if ("root" === entry.tryLoc) return handle("end");
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc"),
hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
} else if (hasCatch) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
} else {
if (!u) throw new Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
if (!hasFinally) throw new Error("try statement without catch or finally");
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
}

@@ -270,34 +270,34 @@ }

},
abrupt: function (t, e) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var o = this.tryEntries[r];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
var record = finallyEntry ? finallyEntry.completion : {};
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
},
complete: function (t, e) {
if ("throw" === t.type) throw t.arg;
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;
complete: function (record, afterLoc) {
if ("throw" === record.type) throw record.arg;
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
},
finish: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
}
},
catch: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
resetTryEntry(r);
catch: function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if ("throw" === record.type) {
var thrown = record.arg;
resetTryEntry(entry);
}
return o;
return thrown;
}

@@ -307,10 +307,10 @@ }

},
delegateYield: function (e, r, n) {
delegateYield: function (iterable, resultName, nextLoc) {
return this.delegate = {
iterator: values(e),
resultName: r,
nextLoc: n
}, "next" === this.method && (this.arg = t), y;
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
}
}, e;
}, exports;
}

@@ -406,7 +406,3 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {

function _isNativeFunction(fn) {
try {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
} catch (e) {
return typeof fn === "function";
}
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}

@@ -1399,3 +1395,3 @@ function _wrapNativeSuper(Class) {

function DstoreError(message, originalError, extensions) {
var _this2$stack, _originalError$stack, _this2$stack2;
var _this2$stack, _originalError$stack, _originalError$stack$, _originalError$stack$2, _this2$stack2, _this2$stack2$split, _this2$stack2$split$s;
var _this2;

@@ -1414,3 +1410,3 @@ _this2 = _Error.call(this, message + ": " + (originalError == null ? void 0 : originalError.message)) || this;

_this2.extensions = _extends({}, extensions);
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$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' + (((_this2$stack2 = _this2.stack) == null || (_this2$stack2 = _this2$stack2.split('\n')) == null || (_this2$stack2 = _this2$stack2.slice(1)) == null ? void 0 : _this2$stack2.join('\n')) || '');
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$stack.split('\n')[0]) || '') + '\n' + ((originalError == null ? void 0 : (_originalError$stack = originalError.stack) == null ? void 0 : (_originalError$stack$ = _originalError$stack.split('\n')) == null ? void 0 : (_originalError$stack$2 = _originalError$stack$.slice(1)) == null ? void 0 : _originalError$stack$2.join('\n')) || '') + '\n' + (((_this2$stack2 = _this2.stack) == null ? void 0 : (_this2$stack2$split = _this2$stack2.split('\n')) == null ? void 0 : (_this2$stack2$split$s = _this2$stack2$split.slice(1)) == null ? void 0 : _this2$stack2$split$s.join('\n')) || '');
// These are usually present on Datastore Errors

@@ -1417,0 +1413,0 @@ // logger.error({ err: originalError, extensions }, message);

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("async_hooks"),e=require("timers/promises"),r=require("@google-cloud/datastore"),n=require("@google-cloud/datastore/build/src/entity"),a=require("assertate-debug"),o=require("debug"),i=require("prom-client");function s(){s=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var o=Object.create((e&&e.prototype instanceof m?e:m).prototype),i=new T(n||[]);return a(o,"_invoke",{value:S(t,r,i)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",y="suspendedYield",d="executing",v="completed",g={};function m(){}function b(){}function w(){}var x={};f(x,i,(function(){return this}));var k=Object.getPrototypeOf,O=k&&k(k(P([])));O&&O!==r&&n.call(O,i)&&(x=O);var E=w.prototype=m.prototype=Object.create(x);function j(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function r(a,o,i,s){var u=p(t[a],t,o);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(f).then((function(t){c.value=t,i(c)}),(function(t){return r("throw",t,i,s)}))}s(u.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=h;return function(o,i){if(a===d)throw new Error("Generator is already running");if(a===v){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var s=n.delegate;if(s){var u=_(s,n);if(u){if(u===g)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=d;var c=p(e,r,n);if("normal"===c.type){if(a=n.done?v:y,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(a=v,n.method="throw",n.arg=c.arg)}}}function _(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var o=p(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,g;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return b.prototype=w,a(E,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:b,configurable:!0}),b.displayName=f(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,c,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},j(I.prototype),f(I.prototype,u,(function(){return this})),e.AsyncIterator=I,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new I(l(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},j(E),f(E,c,"Generator"),f(E,i,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,T.prototype={constructor:T,reset:function(e){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(D),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return s.type="throw",s.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;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),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),D(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;D(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}function u(t,e,r,n,a,o,i){try{var s=t[o](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,a)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){u(o,n,a,i,s,"next",t)}function s(t){u(o,n,a,i,s,"throw",t)}i(void 0)}))}}function f(){return f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},f.apply(this,arguments)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function h(t,e,r){return h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var a=new(Function.bind.apply(t,n));return r&&p(a,r.prototype),a},h.apply(null,arguments)}function y(t){var e="function"==typeof Map?new Map:void 0;return y=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return h(t,arguments,l(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)},y(t)}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function v(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return d(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=o("ds:api"),m=new t.AsyncLocalStorage,b=new i.Histogram({name:"dstore_requests_seconds",help:"How long did Datastore operations take?",labelNames:["operation"]}),w=new i.Counter({name:"dstore_failures_total",help:"How many Datastore operations failed?",labelNames:["operation"]}),x=r.Datastore.KEY,k=function(){function t(t,e,r){this.datastore=void 0,this.projectId=void 0,this.logger=void 0,this.engine="Dstore",this.engines=[],this.urlSaveKey=new n.entity.URLSafeKey,this.datastore=t,this.projectId=e,this.logger=r,a.assertIsObject(t),this.engines.push(this.engine)}var o=t.prototype;return o.getDoT=function(){return m.getStore()||this.datastore},o.key=function(t){return this.datastore.key(t)},o.keySerialize=function(t){var e;return t?this.urlSaveKey.legacyEncode(null!=(e=this.projectId)?e:"",t):""},o.keyFromSerialized=function(t){return this.urlSaveKey.legacyDecode(t)},o.readKey=function(t){a.assertIsObject(t);var e=t[r.Datastore.KEY];return t._keyStr&&!e&&(e=this.keyFromSerialized(t._keyStr)),a.assertIsObject(e,"entity[Datastore.KEY]/entity._keyStr","Entity is missing the datastore Key: "+JSON.stringify(t)),e},o.fixKeys=function(t){var e=this;return t.forEach((function(t){null!=t&&t[r.Datastore.KEY]&&t[r.Datastore.KEY]&&(a.assertIsDefined(t[r.Datastore.KEY]),a.assertIsObject(t[r.Datastore.KEY]),t._keyStr=e.keySerialize(t[r.Datastore.KEY]))})),t},o.get=function(){var t=c(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.assertIsObject(e),a.assert(!Array.isArray(e)),a.assert(e.path.length%2==0,"key.path must be complete: "+JSON.stringify(e.path)),t.next=5,this.getMulti([e]);case 5:return t.abrupt("return",(null==(r=t.sent)?void 0:r[0])||null);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.getMulti=function(){var t=c(s().mark((function t(n){var o,i,u,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=b.startTimer(),t.prev=1,t.t0=this,!(n.length>0)){t.next=15;break}return t.next=6,this.getDoT().get(n);case 6:if(t.t2=u=t.sent,null!=t.t2){t.next=11;break}t.t3=void 0,t.next=12;break;case 11:t.t3=u[0];case 12:t.t1=t.t3,t.next=16;break;case 15:t.t1=[];case 16:t.t4=t.t1,o=t.t0.fixKeys.call(t.t0,t.t4),t.next=26;break;case 20:return t.prev=20,t.t5=t.catch(1),w.inc({operation:"get"}),t.next=25,e.setImmediate();case 25:throw new O("datastore.getMulti error",t.t5,{keys:n});case 26:return t.prev=26,i({operation:"get"}),t.finish(26);case 29:return a.assertIsArray(o),c={},o.forEach((function(t){c[JSON.stringify(t[r.Datastore.KEY])]=t})),t.abrupt("return",n.map((function(t){return c[JSON.stringify(t)]||null})));case 34:case"end":return t.stop()}}),t,this,[[1,20,26,29]])})));return function(e){return t.apply(this,arguments)}}(),o.set=function(){var t=c(s().mark((function t(e,r){var n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.assertIsObject(e),a.assertIsObject(r),n={key:e,data:r},t.next=5,this.save([n]);case 5:return t.abrupt("return",n.key);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),o.save=function(){var t=c(s().mark((function t(n){var o,i,u,c,l,p,h,y;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(a.assertIsArray(n),i=b.startTimer(),t.prev=2,u=v(n);!(c=u()).done;)a.assertIsObject((l=c.value).key),a.assertIsObject(l.data),this.fixKeys([l.data]),l.excludeLargeProperties=void 0===l.excludeLargeProperties||l.excludeLargeProperties,l.data=f({},l.data,{_keyStr:void 0});return t.next=6,this.getDoT().save(n);case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=void 0;case 9:for(o=t.t0,p=v(n);!(h=p()).done;)(y=h.value).data[r.Datastore.KEY]=y.key,this.fixKeys([y.data]);t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(2),w.inc({operation:"save"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.save error",t.t1);case 19:return t.prev=19,i({operation:"save"}),t.finish(19);case 22:return t.abrupt("return",o);case 23:case"end":return t.stop()}}),t,this,[[2,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),o.insert=function(){var t=c(s().mark((function t(r){var n,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.assertIsArray(r),o=b.startTimer(),t.prev=2,t.next=5,this.getDoT().insert(r);case 5:if(t.t0=t.sent,t.t0){t.next=8;break}t.t0=void 0;case 8:n=t.t0,t.next=17;break;case 11:return t.prev=11,t.t1=t.catch(2),w.inc({operation:"insert"}),t.next=16,e.setImmediate();case 16:throw new O("datastore.insert error",t.t1);case 17:return t.prev=17,o({operation:"insert"}),t.finish(17);case 20:return t.abrupt("return",n);case 21:case"end":return t.stop()}}),t,this,[[2,11,17,20]])})));return function(e){return t.apply(this,arguments)}}(),o.update=function(){var t=c(s().mark((function t(r){var n,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.assertIsArray(r),r.forEach((function(t){return a.assertIsObject(t.key)})),r.forEach((function(t){return a.assert(t.key.path.length%2==0,"entity.key.path must be complete: "+JSON.stringify([t.key.path,t]))})),o=b.startTimer(),t.prev=4,t.next=7,this.getDoT().update(r);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=void 0;case 10:n=t.t0,t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(4),w.inc({operation:"update"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.update error",t.t1);case 19:return t.prev=19,o({operation:"update"}),t.finish(19);case 22:return t.abrupt("return",n);case 23:case"end":return t.stop()}}),t,this,[[4,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),o.delete=function(){var t=c(s().mark((function t(r){var n,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a.assertIsArray(r),r.forEach((function(t){return a.assertIsObject(t)})),r.forEach((function(t){return a.assert(t.path.length%2==0,"key.path must be complete: "+JSON.stringify(t.path))})),o=b.startTimer(),t.prev=4,t.next=7,this.getDoT().delete(r);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=void 0;case 10:n=t.t0,t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(4),w.inc({operation:"delete"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.delete error",t.t1);case 19:return t.prev=19,o({operation:"delete"}),t.finish(19);case 22:return t.abrupt("return",n);case 23:case"end":return t.stop()}}),t,this,[[4,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),o.createQuery=function(t){try{return this.getDoT().createQuery(t)}catch(t){throw new O("datastore.createQuery error",t)}},o.runQuery=function(){var t=c(s().mark((function t(r){var n,a,o,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=b.startTimer(),t.prev=1,t.next=4,this.getDoT().runQuery(r);case 4:i=(o=t.sent)[1],n=[this.fixKeys(o[0]),i],t.next=15;break;case 10:return t.prev=10,t.t0=t.catch(1),t.next=14,e.setImmediate();case 14:throw new O("datastore.runQuery error",t.t0);case 15:return t.prev=15,a({operation:"query"}),t.finish(15);case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this,[[1,10,15,18]])})));return function(e){return t.apply(this,arguments)}}(),o.query=function(){var t=c(s().mark((function t(n,o,i,u,c,f){var l,p,y,d,g,m;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(void 0===o&&(o=[]),void 0===i&&(i=2500),void 0===u&&(u=[]),void 0===c&&(c=[]),a.assertIsString(n),a.assertIsArray(o),a.assertIsNumber(i),t.prev=7,l=this.createQuery(n),p=v(o);!(y=p()).done;)a.assertIsObject(d=y.value),l.filter(h(r.PropertyFilter,d));for(g=v(u);!(m=g()).done;)l.order(m.value);return i>0&&l.limit(i),c.length>0&&l.select(c),t.next=15,this.runQuery(l);case 15:return t.abrupt("return",t.sent);case 18:return t.prev=18,t.t0=t.catch(7),t.next=22,e.setImmediate();case 22:throw new O("datastore.query error",t.t0,{kindName:n,filters:o,limit:i,ordering:u});case 23:case"end":return t.stop()}}),t,this,[[7,18]])})));return function(e,r,n,a,o,i){return t.apply(this,arguments)}}(),o.allocateOneId=function(){var t=c(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e="Numbering"),a.assertIsString(e),t.next=4,this.datastore.allocateIds(this.key([e]),1);case 4:return a.assertIsString(r=t.sent[0][0].id),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),o.runInTransaction=function(){var t=c(s().mark((function t(r){var n,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=this.datastore.transaction(),t.next=3,m.run(a,c(s().mark((function t(){var o,i,u,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a.run();case 2:return i=(o=t.sent)[0],u=o[1],t.prev=5,t.next=8,r();case 8:n=t.sent,t.next=20;break;case 11:return t.prev=11,t.t0=t.catch(5),t.next=15,a.rollback();case 15:return g("Transaction failed, rollback initiated: %O %O %O %O",i,u,t.sent,t.t0),t.next=19,e.setImmediate();case 19:throw new O("datastore.transaction execution error",t.t0);case 20:return t.prev=20,t.next=23,a.commit();case 23:c=t.sent[0],t.next=32;break;case 26:return t.prev=26,t.t1=t.catch(20),g("Transaction commit failed: %O %O %O %O ret: %O",i,u,c,t.t1,n),t.next=31,e.setImmediate();case 31:throw new O("datastore.transaction execution error",t.t1);case 32:case"end":return t.stop()}}),t,null,[[5,11],[20,26]])}))));case 3:return t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),O=function(t){var e,r;function n(e,r,n){var a,o,i,s;return(s=t.call(this,e+": "+(null==r?void 0:r.message))||this).extensions=void 0,s.originalError=void 0,s.name||Object.defineProperty(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(s),"name",{value:"DstoreError"}),s.originalError=r,s.extensions=f({},n),s.stack=((null==(a=s.stack)?void 0:a.split("\n")[0])||"")+"\n"+((null==r||null==(o=r.stack)||null==(o=o.split("\n"))||null==(o=o.slice(1))?void 0:o.join("\n"))||"")+"\n"+((null==(i=s.stack)||null==(i=i.split("\n"))||null==(i=i.slice(1))?void 0:i.join("\n"))||""),s}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,p(e,r),n}(y(Error));Object.defineProperty(exports,"Datastore",{enumerable:!0,get:function(){return r.Datastore}}),Object.defineProperty(exports,"Key",{enumerable:!0,get:function(){return r.Key}}),Object.defineProperty(exports,"Query",{enumerable:!0,get:function(){return r.Query}}),Object.defineProperty(exports,"Transaction",{enumerable:!0,get:function(){return r.Transaction}}),exports.Dstore=k,exports.DstoreError=O,exports.KEYSYM=x;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("async_hooks"),e=require("timers/promises"),r=require("@google-cloud/datastore"),n=require("@google-cloud/datastore/build/src/entity"),o=require("assertate-debug"),a=require("debug"),i=require("prom-client");function s(){s=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,o){var a=Object.create((e&&e.prototype instanceof h?e:h).prototype),i=new I(o||[]);return n(a,"_invoke",{value:k(t,r,i)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var p={};function h(){}function d(){}function v(){}var y={};c(y,a,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(S([])));m&&m!==e&&r.call(m,a)&&(y=m);var b=v.prototype=h.prototype=Object.create(y);function w(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(n,a,i,s){var u=l(t[n],t,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==typeof f&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):e.resolve(f).then((function(t){c.value=t,i(c)}),(function(t){return o("throw",t,i,s)}))}s(u.arg)}var a;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return{value:void 0,done:!0}}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=O(i,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=l(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function O(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,p;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,p):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function S(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:_}}function _(){return{value:void 0,done:!0}}return d.prototype=v,n(b,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:d,configurable:!0}),d.displayName=c(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),c(x.prototype,i,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new x(f(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},w(b),c(b,u,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;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),p},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}function u(t,e,r,n,o,a,i){try{var s=t[a](i),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){u(a,n,o,i,s,"next",t)}function s(t){u(a,n,o,i,s,"throw",t)}i(void 0)}))}}function f(){return f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},f.apply(this,arguments)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function p(t,e){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},p(t,e)}function h(t,e,r){return h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct.bind():function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&p(o,r.prototype),o},h.apply(null,arguments)}function d(t){var e="function"==typeof Map?new Map:void 0;return d=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return h(t,arguments,l(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,t)},d(t)}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function y(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return v(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?v(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g=a("ds:api"),m=new t.AsyncLocalStorage,b=new i.Histogram({name:"dstore_requests_seconds",help:"How long did Datastore operations take?",labelNames:["operation"]}),w=new i.Counter({name:"dstore_failures_total",help:"How many Datastore operations failed?",labelNames:["operation"]}),x=r.Datastore.KEY,k=function(){function t(t,e,r){this.datastore=void 0,this.projectId=void 0,this.logger=void 0,this.engine="Dstore",this.engines=[],this.urlSaveKey=new n.entity.URLSafeKey,this.datastore=t,this.projectId=e,this.logger=r,o.assertIsObject(t),this.engines.push(this.engine)}var a=t.prototype;return a.getDoT=function(){return m.getStore()||this.datastore},a.key=function(t){return this.datastore.key(t)},a.keySerialize=function(t){var e;return t?this.urlSaveKey.legacyEncode(null!=(e=this.projectId)?e:"",t):""},a.keyFromSerialized=function(t){return this.urlSaveKey.legacyDecode(t)},a.readKey=function(t){o.assertIsObject(t);var e=t[r.Datastore.KEY];return t._keyStr&&!e&&(e=this.keyFromSerialized(t._keyStr)),o.assertIsObject(e,"entity[Datastore.KEY]/entity._keyStr","Entity is missing the datastore Key: "+JSON.stringify(t)),e},a.fixKeys=function(t){var e=this;return t.forEach((function(t){null!=t&&t[r.Datastore.KEY]&&t[r.Datastore.KEY]&&(o.assertIsDefined(t[r.Datastore.KEY]),o.assertIsObject(t[r.Datastore.KEY]),t._keyStr=e.keySerialize(t[r.Datastore.KEY]))})),t},a.get=function(){var t=c(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.assertIsObject(e),o.assert(!Array.isArray(e)),o.assert(e.path.length%2==0,"key.path must be complete: "+JSON.stringify(e.path)),t.next=5,this.getMulti([e]);case 5:return t.abrupt("return",(null==(r=t.sent)?void 0:r[0])||null);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),a.getMulti=function(){var t=c(s().mark((function t(n){var a,i,u,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=b.startTimer(),t.prev=1,t.t0=this,!(n.length>0)){t.next=15;break}return t.next=6,this.getDoT().get(n);case 6:if(t.t2=u=t.sent,null!=t.t2){t.next=11;break}t.t3=void 0,t.next=12;break;case 11:t.t3=u[0];case 12:t.t1=t.t3,t.next=16;break;case 15:t.t1=[];case 16:t.t4=t.t1,a=t.t0.fixKeys.call(t.t0,t.t4),t.next=26;break;case 20:return t.prev=20,t.t5=t.catch(1),w.inc({operation:"get"}),t.next=25,e.setImmediate();case 25:throw new O("datastore.getMulti error",t.t5,{keys:n});case 26:return t.prev=26,i({operation:"get"}),t.finish(26);case 29:return o.assertIsArray(a),c={},a.forEach((function(t){c[JSON.stringify(t[r.Datastore.KEY])]=t})),t.abrupt("return",n.map((function(t){return c[JSON.stringify(t)]||null})));case 34:case"end":return t.stop()}}),t,this,[[1,20,26,29]])})));return function(e){return t.apply(this,arguments)}}(),a.set=function(){var t=c(s().mark((function t(e,r){var n;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.assertIsObject(e),o.assertIsObject(r),n={key:e,data:r},t.next=5,this.save([n]);case 5:return t.abrupt("return",n.key);case 6:case"end":return t.stop()}}),t,this)})));return function(e,r){return t.apply(this,arguments)}}(),a.save=function(){var t=c(s().mark((function t(n){var a,i,u,c,l,p,h,d;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(o.assertIsArray(n),i=b.startTimer(),t.prev=2,u=y(n);!(c=u()).done;)o.assertIsObject((l=c.value).key),o.assertIsObject(l.data),this.fixKeys([l.data]),l.excludeLargeProperties=void 0===l.excludeLargeProperties||l.excludeLargeProperties,l.data=f({},l.data,{_keyStr:void 0});return t.next=6,this.getDoT().save(n);case 6:if(t.t0=t.sent,t.t0){t.next=9;break}t.t0=void 0;case 9:for(a=t.t0,p=y(n);!(h=p()).done;)(d=h.value).data[r.Datastore.KEY]=d.key,this.fixKeys([d.data]);t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(2),w.inc({operation:"save"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.save error",t.t1);case 19:return t.prev=19,i({operation:"save"}),t.finish(19);case 22:return t.abrupt("return",a);case 23:case"end":return t.stop()}}),t,this,[[2,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),a.insert=function(){var t=c(s().mark((function t(r){var n,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.assertIsArray(r),a=b.startTimer(),t.prev=2,t.next=5,this.getDoT().insert(r);case 5:if(t.t0=t.sent,t.t0){t.next=8;break}t.t0=void 0;case 8:n=t.t0,t.next=17;break;case 11:return t.prev=11,t.t1=t.catch(2),w.inc({operation:"insert"}),t.next=16,e.setImmediate();case 16:throw new O("datastore.insert error",t.t1);case 17:return t.prev=17,a({operation:"insert"}),t.finish(17);case 20:return t.abrupt("return",n);case 21:case"end":return t.stop()}}),t,this,[[2,11,17,20]])})));return function(e){return t.apply(this,arguments)}}(),a.update=function(){var t=c(s().mark((function t(r){var n,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.assertIsArray(r),r.forEach((function(t){return o.assertIsObject(t.key)})),r.forEach((function(t){return o.assert(t.key.path.length%2==0,"entity.key.path must be complete: "+JSON.stringify([t.key.path,t]))})),a=b.startTimer(),t.prev=4,t.next=7,this.getDoT().update(r);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=void 0;case 10:n=t.t0,t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(4),w.inc({operation:"update"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.update error",t.t1);case 19:return t.prev=19,a({operation:"update"}),t.finish(19);case 22:return t.abrupt("return",n);case 23:case"end":return t.stop()}}),t,this,[[4,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),a.delete=function(){var t=c(s().mark((function t(r){var n,a;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o.assertIsArray(r),r.forEach((function(t){return o.assertIsObject(t)})),r.forEach((function(t){return o.assert(t.path.length%2==0,"key.path must be complete: "+JSON.stringify(t.path))})),a=b.startTimer(),t.prev=4,t.next=7,this.getDoT().delete(r);case 7:if(t.t0=t.sent,t.t0){t.next=10;break}t.t0=void 0;case 10:n=t.t0,t.next=19;break;case 13:return t.prev=13,t.t1=t.catch(4),w.inc({operation:"delete"}),t.next=18,e.setImmediate();case 18:throw new O("datastore.delete error",t.t1);case 19:return t.prev=19,a({operation:"delete"}),t.finish(19);case 22:return t.abrupt("return",n);case 23:case"end":return t.stop()}}),t,this,[[4,13,19,22]])})));return function(e){return t.apply(this,arguments)}}(),a.createQuery=function(t){try{return this.getDoT().createQuery(t)}catch(t){throw new O("datastore.createQuery error",t)}},a.runQuery=function(){var t=c(s().mark((function t(r){var n,o,a,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=b.startTimer(),t.prev=1,t.next=4,this.getDoT().runQuery(r);case 4:i=(a=t.sent)[1],n=[this.fixKeys(a[0]),i],t.next=15;break;case 10:return t.prev=10,t.t0=t.catch(1),t.next=14,e.setImmediate();case 14:throw new O("datastore.runQuery error",t.t0);case 15:return t.prev=15,o({operation:"query"}),t.finish(15);case 18:return t.abrupt("return",n);case 19:case"end":return t.stop()}}),t,this,[[1,10,15,18]])})));return function(e){return t.apply(this,arguments)}}(),a.query=function(){var t=c(s().mark((function t(n,a,i,u,c,f){var l,p,d,v,g,m;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(void 0===a&&(a=[]),void 0===i&&(i=2500),void 0===u&&(u=[]),void 0===c&&(c=[]),o.assertIsString(n),o.assertIsArray(a),o.assertIsNumber(i),t.prev=7,l=this.createQuery(n),p=y(a);!(d=p()).done;)o.assertIsObject(v=d.value),l.filter(h(r.PropertyFilter,v));for(g=y(u);!(m=g()).done;)l.order(m.value);return i>0&&l.limit(i),c.length>0&&l.select(c),t.next=15,this.runQuery(l);case 15:return t.abrupt("return",t.sent);case 18:return t.prev=18,t.t0=t.catch(7),t.next=22,e.setImmediate();case 22:throw new O("datastore.query error",t.t0,{kindName:n,filters:a,limit:i,ordering:u});case 23:case"end":return t.stop()}}),t,this,[[7,18]])})));return function(e,r,n,o,a,i){return t.apply(this,arguments)}}(),a.allocateOneId=function(){var t=c(s().mark((function t(e){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===e&&(e="Numbering"),o.assertIsString(e),t.next=4,this.datastore.allocateIds(this.key([e]),1);case 4:return o.assertIsString(r=t.sent[0][0].id),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),a.runInTransaction=function(){var t=c(s().mark((function t(r){var n,o;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=this.datastore.transaction(),t.next=3,m.run(o,c(s().mark((function t(){var a,i,u,c;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.run();case 2:return i=(a=t.sent)[0],u=a[1],t.prev=5,t.next=8,r();case 8:n=t.sent,t.next=20;break;case 11:return t.prev=11,t.t0=t.catch(5),t.next=15,o.rollback();case 15:return g("Transaction failed, rollback initiated: %O %O %O %O",i,u,t.sent,t.t0),t.next=19,e.setImmediate();case 19:throw new O("datastore.transaction execution error",t.t0);case 20:return t.prev=20,t.next=23,o.commit();case 23:c=t.sent[0],t.next=32;break;case 26:return t.prev=26,t.t1=t.catch(20),g("Transaction commit failed: %O %O %O %O ret: %O",i,u,c,t.t1,n),t.next=31,e.setImmediate();case 31:throw new O("datastore.transaction execution error",t.t1);case 32:case"end":return t.stop()}}),t,null,[[5,11],[20,26]])}))));case 3:return t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t}(),O=function(t){var e,r;function n(e,r,n){var o,a,i,s,u,c,l,p;return(p=t.call(this,e+": "+(null==r?void 0:r.message))||this).extensions=void 0,p.originalError=void 0,p.name||Object.defineProperty(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(p),"name",{value:"DstoreError"}),p.originalError=r,p.extensions=f({},n),p.stack=((null==(o=p.stack)?void 0:o.split("\n")[0])||"")+"\n"+((null==r||null==(a=r.stack)||null==(i=a.split("\n"))||null==(s=i.slice(1))?void 0:s.join("\n"))||"")+"\n"+((null==(u=p.stack)||null==(c=u.split("\n"))||null==(l=c.slice(1))?void 0:l.join("\n"))||""),p}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,p(e,r),n}(d(Error));Object.defineProperty(exports,"Datastore",{enumerable:!0,get:function(){return r.Datastore}}),Object.defineProperty(exports,"Key",{enumerable:!0,get:function(){return r.Key}}),Object.defineProperty(exports,"Query",{enumerable:!0,get:function(){return r.Query}}),Object.defineProperty(exports,"Transaction",{enumerable:!0,get:function(){return r.Transaction}}),exports.Dstore=k,exports.DstoreError=O,exports.KEYSYM=x;
//# sourceMappingURL=datastore-api.cjs.production.min.js.map

@@ -12,252 +12,252 @@ import { AsyncLocalStorage } from 'async_hooks';

_regeneratorRuntime = function () {
return e;
return exports;
};
var t,
e = {},
r = Object.prototype,
n = r.hasOwnProperty,
o = Object.defineProperty || function (t, e, r) {
t[e] = r.value;
var exports = {},
Op = Object.prototype,
hasOwn = Op.hasOwnProperty,
defineProperty = Object.defineProperty || function (obj, key, desc) {
obj[key] = desc.value;
},
i = "function" == typeof Symbol ? Symbol : {},
a = i.iterator || "@@iterator",
c = i.asyncIterator || "@@asyncIterator",
u = i.toStringTag || "@@toStringTag";
function define(t, e, r) {
return Object.defineProperty(t, e, {
value: r,
$Symbol = "function" == typeof Symbol ? Symbol : {},
iteratorSymbol = $Symbol.iterator || "@@iterator",
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
return Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}), t[e];
}), obj[key];
}
try {
define({}, "");
} catch (t) {
define = function (t, e, r) {
return t[e] = r;
} catch (err) {
define = function (obj, key, value) {
return obj[key] = value;
};
}
function wrap(t, e, r, n) {
var i = e && e.prototype instanceof Generator ? e : Generator,
a = Object.create(i.prototype),
c = new Context(n || []);
return o(a, "_invoke", {
value: makeInvokeMethod(t, r, c)
}), a;
function wrap(innerFn, outerFn, self, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
generator = Object.create(protoGenerator.prototype),
context = new Context(tryLocsList || []);
return defineProperty(generator, "_invoke", {
value: makeInvokeMethod(innerFn, self, context)
}), generator;
}
function tryCatch(t, e, r) {
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: t.call(e, r)
arg: fn.call(obj, arg)
};
} catch (t) {
} catch (err) {
return {
type: "throw",
arg: t
arg: err
};
}
}
e.wrap = wrap;
var h = "suspendedStart",
l = "suspendedYield",
f = "executing",
s = "completed",
y = {};
exports.wrap = wrap;
var ContinueSentinel = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var p = {};
define(p, a, function () {
var IteratorPrototype = {};
define(IteratorPrototype, iteratorSymbol, function () {
return this;
});
var d = Object.getPrototypeOf,
v = d && d(d(values([])));
v && v !== r && n.call(v, a) && (p = v);
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
function defineIteratorMethods(t) {
["next", "throw", "return"].forEach(function (e) {
define(t, e, function (t) {
return this._invoke(e, t);
var getProto = Object.getPrototypeOf,
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
define(prototype, method, function (arg) {
return this._invoke(method, arg);
});
});
}
function AsyncIterator(t, e) {
function invoke(r, o, i, a) {
var c = tryCatch(t[r], t, o);
if ("throw" !== c.type) {
var u = c.arg,
h = u.value;
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
invoke("next", t, i, a);
}, function (t) {
invoke("throw", t, i, a);
}) : e.resolve(h).then(function (t) {
u.value = t, i(u);
}, function (t) {
return invoke("throw", t, i, a);
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if ("throw" !== record.type) {
var result = record.arg,
value = result.value;
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
result.value = unwrapped, resolve(result);
}, function (error) {
return invoke("throw", error, resolve, reject);
});
}
a(c.arg);
reject(record.arg);
}
var r;
o(this, "_invoke", {
value: function (t, n) {
var previousPromise;
defineProperty(this, "_invoke", {
value: function (method, arg) {
function callInvokeWithMethodAndArg() {
return new e(function (e, r) {
invoke(t, n, e, r);
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(e, r, n) {
var o = h;
return function (i, a) {
if (o === f) throw new Error("Generator is already running");
if (o === s) {
if ("throw" === i) throw a;
return {
value: t,
done: !0
};
function makeInvokeMethod(innerFn, self, context) {
var state = "suspendedStart";
return function (method, arg) {
if ("executing" === state) throw new Error("Generator is already running");
if ("completed" === state) {
if ("throw" === method) throw arg;
return doneResult();
}
for (n.method = i, n.arg = a;;) {
var c = n.delegate;
if (c) {
var u = maybeInvokeDelegate(c, n);
if (u) {
if (u === y) continue;
return u;
for (context.method = method, context.arg = arg;;) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
if (o === h) throw o = s, n.arg;
n.dispatchException(n.arg);
} else "return" === n.method && n.abrupt("return", n.arg);
o = f;
var p = tryCatch(e, r, n);
if ("normal" === p.type) {
if (o = n.done ? s : l, p.arg === y) continue;
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
if ("suspendedStart" === state) throw state = "completed", context.arg;
context.dispatchException(context.arg);
} else "return" === context.method && context.abrupt("return", context.arg);
state = "executing";
var record = tryCatch(innerFn, self, context);
if ("normal" === record.type) {
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
return {
value: p.arg,
done: n.done
value: record.arg,
done: context.done
};
}
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
}
};
}
function maybeInvokeDelegate(e, r) {
var n = r.method,
o = e.iterator[n];
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;
var i = tryCatch(o, e.iterator, r.arg);
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
var a = i.arg;
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);
function maybeInvokeDelegate(delegate, context) {
var methodName = context.method,
method = delegate.iterator[methodName];
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
var record = tryCatch(method, delegate.iterator, context.arg);
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
var info = record.arg;
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
}
function pushTryEntry(t) {
var e = {
tryLoc: t[0]
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
}
function resetTryEntry(t) {
var e = t.completion || {};
e.type = "normal", delete e.arg, t.completion = e;
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal", delete record.arg, entry.completion = record;
}
function Context(t) {
function Context(tryLocsList) {
this.tryEntries = [{
tryLoc: "root"
}], t.forEach(pushTryEntry, this), this.reset(!0);
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
}
function values(e) {
if (e || "" === e) {
var r = e[a];
if (r) return r.call(e);
if ("function" == typeof e.next) return e;
if (!isNaN(e.length)) {
var o = -1,
i = function next() {
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
return next.value = t, next.done = !0, next;
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) return iteratorMethod.call(iterable);
if ("function" == typeof iterable.next) return iterable;
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
return next.value = undefined, next.done = !0, next;
};
return i.next = i;
return next.next = next;
}
}
throw new TypeError(typeof e + " is not iterable");
return {
next: doneResult
};
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
function doneResult() {
return {
value: undefined,
done: !0
};
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), o(GeneratorFunctionPrototype, "constructor", {
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
var e = "function" == typeof t && t.constructor;
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
}, e.mark = function (t) {
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
}, e.awrap = function (t) {
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
var ctor = "function" == typeof genFun && genFun.constructor;
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
}, exports.mark = function (genFun) {
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
}, exports.awrap = function (arg) {
return {
__await: t
__await: arg
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
return this;
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
void 0 === i && (i = Promise);
var a = new AsyncIterator(wrap(t, r, n, o), i);
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
return t.done ? t.value : a.next();
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
void 0 === PromiseImpl && (PromiseImpl = Promise);
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
return this;
}), define(g, "toString", function () {
}), define(Gp, "toString", function () {
return "[object Generator]";
}), e.keys = function (t) {
var e = Object(t),
r = [];
for (var n in e) r.push(n);
return r.reverse(), function next() {
for (; r.length;) {
var t = r.pop();
if (t in e) return next.value = t, next.done = !1, next;
}), exports.keys = function (val) {
var object = Object(val),
keys = [];
for (var key in object) keys.push(key);
return keys.reverse(), function next() {
for (; keys.length;) {
var key = keys.pop();
if (key in object) return next.value = key, next.done = !1, next;
}
return next.done = !0, next;
};
}, e.values = values, Context.prototype = {
}, exports.values = values, Context.prototype = {
constructor: Context,
reset: function (e) {
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);
reset: function (skipTempReset) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
},
stop: function () {
this.done = !0;
var t = this.tryEntries[0].completion;
if ("throw" === t.type) throw t.arg;
var rootRecord = this.tryEntries[0].completion;
if ("throw" === rootRecord.type) throw rootRecord.arg;
return this.rval;
},
dispatchException: function (e) {
if (this.done) throw e;
var r = this;
function handle(n, o) {
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
dispatchException: function (exception) {
if (this.done) throw exception;
var context = this;
function handle(loc, caught) {
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
}
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
var i = this.tryEntries[o],
a = i.completion;
if ("root" === i.tryLoc) return handle("end");
if (i.tryLoc <= this.prev) {
var c = n.call(i, "catchLoc"),
u = n.call(i, "finallyLoc");
if (c && u) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
} else if (c) {
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i],
record = entry.completion;
if ("root" === entry.tryLoc) return handle("end");
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc"),
hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
} else if (hasCatch) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
} else {
if (!u) throw new Error("try statement without catch or finally");
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
if (!hasFinally) throw new Error("try statement without catch or finally");
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
}

@@ -267,34 +267,34 @@ }

},
abrupt: function (t, e) {
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
var o = this.tryEntries[r];
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
var i = o;
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
var a = i ? i.completion : {};
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
var record = finallyEntry ? finallyEntry.completion : {};
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
},
complete: function (t, e) {
if ("throw" === t.type) throw t.arg;
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;
complete: function (record, afterLoc) {
if ("throw" === record.type) throw record.arg;
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
},
finish: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
}
},
catch: function (t) {
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
var r = this.tryEntries[e];
if (r.tryLoc === t) {
var n = r.completion;
if ("throw" === n.type) {
var o = n.arg;
resetTryEntry(r);
catch: function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if ("throw" === record.type) {
var thrown = record.arg;
resetTryEntry(entry);
}
return o;
return thrown;
}

@@ -304,10 +304,10 @@ }

},
delegateYield: function (e, r, n) {
delegateYield: function (iterable, resultName, nextLoc) {
return this.delegate = {
iterator: values(e),
resultName: r,
nextLoc: n
}, "next" === this.method && (this.arg = t), y;
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
}
}, e;
}, exports;
}

@@ -403,7 +403,3 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {

function _isNativeFunction(fn) {
try {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
} catch (e) {
return typeof fn === "function";
}
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}

@@ -1396,3 +1392,3 @@ function _wrapNativeSuper(Class) {

function DstoreError(message, originalError, extensions) {
var _this2$stack, _originalError$stack, _this2$stack2;
var _this2$stack, _originalError$stack, _originalError$stack$, _originalError$stack$2, _this2$stack2, _this2$stack2$split, _this2$stack2$split$s;
var _this2;

@@ -1411,3 +1407,3 @@ _this2 = _Error.call(this, message + ": " + (originalError == null ? void 0 : originalError.message)) || this;

_this2.extensions = _extends({}, extensions);
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$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' + (((_this2$stack2 = _this2.stack) == null || (_this2$stack2 = _this2$stack2.split('\n')) == null || (_this2$stack2 = _this2$stack2.slice(1)) == null ? void 0 : _this2$stack2.join('\n')) || '');
_this2.stack = (((_this2$stack = _this2.stack) == null ? void 0 : _this2$stack.split('\n')[0]) || '') + '\n' + ((originalError == null ? void 0 : (_originalError$stack = originalError.stack) == null ? void 0 : (_originalError$stack$ = _originalError$stack.split('\n')) == null ? void 0 : (_originalError$stack$2 = _originalError$stack$.slice(1)) == null ? void 0 : _originalError$stack$2.join('\n')) || '') + '\n' + (((_this2$stack2 = _this2.stack) == null ? void 0 : (_this2$stack2$split = _this2$stack2.split('\n')) == null ? void 0 : (_this2$stack2$split$s = _this2$stack2$split.slice(1)) == null ? void 0 : _this2$stack2$split$s.join('\n')) || '');
// These are usually present on Datastore Errors

@@ -1414,0 +1410,0 @@ // logger.error({ err: originalError, extensions }, message);

@@ -32,4 +32,2 @@ /// <reference types="node" />

_keyStr: string;
/** All User Data stored in the Datastore */
[key: string]: DstorePropertyValues;
}

@@ -40,3 +38,3 @@ /** Represents the thing you pass to the save method. Also called "Entity" by Google */

data: Omit<IDstoreEntry, '_keyStr' | Datastore['KEY']> & Partial<{
_keyStr: string;
_keyStr: string | undefined;
[Datastore.KEY]: Key;

@@ -43,0 +41,0 @@ }>;

@@ -21,5 +21,5 @@ {

"dependencies": {
"@google-cloud/datastore": "^8.0.0",
"@google-cloud/datastore": ">=7.0.0",
"assertate-debug": "^2.4.2",
"prom-client": "^14.0.1"
"prom-client": ">=14.0.0"
},

@@ -35,4 +35,4 @@ "description": "Simplified, more consitent API for Google Cloud Datastore",

"@types/node": "^20.3.3",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
"codecov": "^3.5.0",

@@ -42,14 +42,14 @@ "cspell": "5.14.0",

"debug": "^4.3.3",
"dts-cli": "^2.0.3",
"eslint": "^7.8.0",
"eslint-config-prettier": "^6.11.0",
"dts-cli": "^2.0.4",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"gh-pages": "^5.0.0",
"google-datastore-emulator": "^7.0.0",
"google-datastore-emulator": ">=7.0.0",
"husky": "^8.0.3",

@@ -60,3 +60,3 @@ "lint-staged": "^13.2.3",

"open-cli": "7.2.0",
"prettier": "^2.1.1",
"prettier": "^3.2.2",
"size-limit": "^8.2.6",

@@ -69,3 +69,3 @@ "sort-package-json": "^2.5.0",

"typedoc": "0.24.8",
"typescript": "^4.0.2",
"typescript": "<5.1.0",
"vitest": "^0.32.2"

@@ -92,6 +92,6 @@ },

"lint-staged": {
"*{css,scss,md,markdown,json,yaml,yml,graphql,html}": "prettier -w",
"*{css,scss,md,markdown,json,yaml,yml,graphql,html}": "npx prettier -w",
"*{js,jsx,ts,tsx}": [
"prettier -w",
"yarn lint --fix"
"npx prettier -w",
"npm run lint --fix"
],

@@ -110,3 +110,3 @@ "package.json": "sort-package-json"

"peerDependencies": {
"debug": "^4.3.3"
"debug": ">=4.0.0"
},

@@ -139,4 +139,3 @@ "prettier": {

"typings": "dist/index.d.ts",
"version": "4.0.3",
"packageManager": "yarn@3.6.4+sha256.7f7d51b38db0d94adf25c512e3f3d3b47d23c97922eecc540f7440f116bdb99a"
"version": "6.0.0"
}

@@ -37,3 +37,3 @@ [![version](https://img.shields.io/npm/v/datastore-api.svg?style=flat-square)](https://npmjs.org/datastore-api)

- Googles Javascript API decided to use `[Symbol(KEY)]` to represent the Key in an entity. This results in all kinds of confusion when serializing to JSON, e.g. for caching. This library adds the property `_keyStr` which will be transparently used to regenerate `[Symbol(KEY)]` when needed.
- Many functions are somewhat polymorphic where the shape of the return value depends on the function parameters, e.g. if the API was called with a key or a list of keys. You are encouraged to alvais provide a list of parameters instead a single parameter, e.g. `get([key])` instead of `get(key)`.
- Many functions are somewhat polymorphic where the shape of the return value depends on the function parameters, e.g. if the API was called with a key or a list of keys. You are encouraged to alvais provide a list of parameters instead a single parameter, e.g. `get([key])` instead of `get(key)`.
- `insert()` and `save()` sometimes return the key being written and sometimes not. So you might or might not get some data in `insertResponse?.[0].mutationResults?.[0]?.key?.path` - urgs.

@@ -70,3 +70,3 @@ - Google avoids [BigInt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt). So `key.id` is (usually but not always) returned as a String but you have to provide a Number to the API.

- [API reference](https://cloud.google.com/datastore/docs/reference/data/rpc) helps to understand under-documented SDK.
- [grpc-js environment variables](https://github.com/grpc/grpc-node/blob/master/doc/environment_variables.md) - try [GRPC_VERBOSITY=DEBUG GRPC_TRACE=all yarn test](https://github.com/grpc/grpc-node/blob/master/TROUBLESHOOTING.md)
- [grpc-js environment variables](https://github.com/grpc/grpc-node/blob/master/doc/environment_variables.md) - try [GRPC_VERBOSITY=DEBUG GRPC_TRACE=all npm run test](https://github.com/grpc/grpc-node/blob/master/TROUBLESHOOTING.md)

@@ -84,2 +84,3 @@ - API Simplification

- For debugging
- [dsadmin](https://github.com/remko/dsadmin) - `npx dsadmin --project=projectid`

@@ -86,0 +87,0 @@ - [google-datastore-emulator for node](https://github.com/ert78gb/google-datastore-emulator)

@@ -5,2 +5,3 @@ /*

* A little bit inspired by the Python2 ndb interface.
* But without the ORM bits.
*

@@ -88,8 +89,6 @@ * In future https://github.com/graphql/dataloader might be used for batching.

export interface IDstoreEntry extends IDstoreEntryWithoutKey {
/* Datastore key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */
/* Datastore Key provided by [@google-cloud/datastore](https://github.com/googleapis/nodejs-datastore#readme) */
readonly [Datastore.KEY]?: Key;
/** [Datastore.KEY] key */
_keyStr: string;
/** All User Data stored in the Datastore */
[key: string]: DstorePropertyValues;
}

@@ -102,3 +101,3 @@

Partial<{
_keyStr: string;
_keyStr: string|undefined;
[Datastore.KEY]: Key;

@@ -105,0 +104,0 @@ }>;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc