Socket
Socket
Sign inDemoInstall

datastore-api

Package Overview
Dependencies
8
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.1 to 6.0.2

4

dist/datastore-api.cjs.development.js

@@ -779,3 +779,5 @@ 'use strict';

key: key,
data: data
data: _extends({}, data, {
_keyStr: undefined
})
};

@@ -782,0 +784,0 @@ _context3.next = 5;

@@ -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"),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;i.register.removeSingleMetric("dstore_requests_seconds"),i.register.removeSingleMetric("dstore_failures_total");var 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;
"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;i.register.removeSingleMetric("dstore_requests_seconds"),i.register.removeSingleMetric("dstore_failures_total");var 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:f({},r,{_keyStr:void 0})},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

@@ -776,3 +776,5 @@ import { AsyncLocalStorage } from 'async_hooks';

key: key,
data: data
data: _extends({}, data, {
_keyStr: undefined
})
};

@@ -779,0 +781,0 @@ _context3.next = 5;

{
"name": "datastore-api",
"version": "6.0.1",
"version": "6.0.2",
"description": "Simplified, more consitent API for Google Cloud Datastore",

@@ -5,0 +5,0 @@ "keywords": [

@@ -351,3 +351,3 @@ /*

assertIsObject(data);
const saveEntity = { key, data };
const saveEntity = { key, data: { ...data, _keyStr: undefined } };
await this.save([saveEntity]);

@@ -354,0 +354,0 @@ return saveEntity.key;

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