From fe2c89534c8e37bcdd1064b3fbdcaefaad9c9792 Mon Sep 17 00:00:00 2001 From: samepant Date: Wed, 10 Mar 2021 22:30:09 -0500 Subject: [PATCH] log error in lambda --- lambda-build/create-multisig.js | 2 +- lambda/create-multisig.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lambda-build/create-multisig.js b/lambda-build/create-multisig.js index fd30e83..adf1f15 100644 --- a/lambda-build/create-multisig.js +++ b/lambda-build/create-multisig.js @@ -3,4 +3,4 @@ object-assign (c) Sindre Sorhus @license MIT -*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c0&&this._faunaFunctions.forEach((function(e){a=e(a)})),this.client.query(a,this.options)},i.prototype._clone=function(){return Object.create(i.prototype,{client:{value:this.client},set:{value:this.set},_faunaFunctions:{value:this._faunaFunctions},before:{value:this.before},after:{value:this.after}})},e.exports=i},function(e,t,n){"use strict";var r=n(25),o=n(1),i=n(10);function a(e){var t="https"===e.scheme;null==e.port&&(e.port=t?443:80);var i=!e.fetch&&o.isNodeEnv()&&function(){try{return n(19),!0}catch(e){return!1}}();this._adapter=i?new(n(26)):new(n(27))({isHttps:t,fetch:e.fetch,keepAlive:e.keepAlive}),this._baseUrl=e.scheme+"://"+e.domain+":"+e.port,this._secret=e.secret,this._headers=Object.assign({},e.headers,function(){var e={"X-Fauna-Driver":"Javascript","X-FaunaDB-API-Version":r.apiVersion};o.isNodeEnv()&&(e["X-Fauna-Driver-Version"]=r.version,e["X-Runtime-Environment"]=(t=[{name:"Netlify",check:()=>process.env.hasOwnProperty("NETLIFY_IMAGES_CDN_DOMAIN")},{name:"Vercel",check:()=>process.env.hasOwnProperty("VERCEL")},{name:"Heroku",check:()=>process.env.hasOwnProperty("PATH")&&-1!==process.env.PATH.indexOf(".heroku")},{name:"AWS Lambda",check:()=>process.env.hasOwnProperty("AWS_LAMBDA_FUNCTION_VERSION")},{name:"GCP Cloud Functions",check:()=>process.env.hasOwnProperty("_")&&-1!==process.env._.indexOf("google")},{name:"GCP Compute Instances",check:()=>process.env.hasOwnProperty("GOOGLE_CLOUD_PROJECT")},{name:"Azure Cloud Functions",check:()=>process.env.hasOwnProperty("WEBSITE_FUNCTIONS_AZUREMONITOR_CATEGORIES")},{name:"Azure Compute",check:()=>process.env.hasOwnProperty("ORYX_ENV_TYPE")&&process.env.hasOwnProperty("WEBSITE_INSTANCE_ID")&&"AppService"===process.env.ORYX_ENV_TYPE},{name:"Worker",check:()=>{try{return global instanceof ServiceWorkerGlobalScope}catch(e){return!1}}},{name:"Mongo Stitch",check:()=>"function"==typeof global.StitchError},{name:"Render",check:()=>process.env.hasOwnProperty("RENDER_SERVICE_ID")},{name:"Begin",check:()=>process.env.hasOwnProperty("BEGIN_DATA_SCOPE_ID")}].find(e=>e.check()))?t.name:"Unknown",e["X-Runtime-Environment-OS"]=n(30).platform(),e["X-NodeJS-Version"]=process.version);var t;return e}()),this._queryTimeout=e.queryTimeout,this._lastSeen=null,this._timeout=Math.floor(1e3*e.timeout)}a.prototype.getLastTxnTime=function(){return this._lastSeen},a.prototype.syncLastTxnTime=function(e){(null==this._lastSeen||this._lastSeen0){const e=new Array(arguments.length);for(let t=0;t{const r=JSON.parse(e.body);console.log("Function `createMultisig` invoked",r);const o={data:r};try{await a.query(i.Create(i.Collection("Multisig"),o));return console.log("success",response),{statusCode:200,body:JSON.stringify(response)}}catch(e){return{statusCode:400,body:JSON.stringify(e)}}}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new Error("Could not parse function signature for injection dependencies: Object is not a function");if(!e.length)return[];var t=/^()\(?([^)=]*)\)? *=>/.exec(e+"")||/^[^(]+([^ \(]*) *\(([^\)]*)\)/.exec(e+"");if(!t)throw new Error("Could not parse function signature for injection dependencies: "+e);var n=t[2].replace(/\/\*[\S\s]*?\*\//g," ").replace(/\/\/.*/g," ");function r(e,t,n){return t+n.split(",").map((function(e){return e&&e.trim()})).filter(Boolean).join("@")}return(n=(n=n.replace(/(\{)([^}]*)\}/g,r)).replace(/(\[)([^}]*)\]/g,r)).split(",").map((function(e){return e&&e.trim()})).map((function(e){return"{"===e[0]?e.substring(1).split("@"):"["===e[0]?{items:e.substring(1).split("@")}:e})).filter(Boolean)}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,n){"use strict";var r=n(17),o=n(9),i=n(3),a=n(18),s=n(11),u=n(4),c=n(31),l=n(1),f=n(5);function p(e){e=l.applyDefaults(e,{domain:"db.fauna.com",scheme:"https",port:null,secret:null,timeout:60,observer:null,keepAlive:!0,headers:{},fetch:void 0,queryTimeout:null}),this._observer=e.observer,this._http=new a.HttpClient(e),this.stream=c.StreamAPI(this)}p.prototype.query=function(e,t){return this._execute("POST","",u.wrap(e),null,t)},p.prototype.paginate=function(e,t,n){return t=l.defaults(t,{}),n=l.defaults(n,{}),new r(this,e,t,n)},p.prototype.ping=function(e,t){return this._execute("GET","ping",null,{scope:e,timeout:t})},p.prototype.getLastTxnTime=function(){return this._http.getLastTxnTime()},p.prototype.syncLastTxnTime=function(e){this._http.syncLastTxnTime(e)},p.prototype._execute=function(e,t,n,r,i){r=l.defaults(r,null),(t instanceof f.Ref||l.checkInstanceHasProperty(t,"_isFaunaRef"))&&(t=t.value),null!==r&&(r=l.removeUndefinedValues(r));var a=Date.now(),u=this,c=["GET","HEAD"].indexOf(e)>=0?void 0:JSON.stringify(n);return this._http.execute(Object.assign({},i,{path:t,query:r,method:e,body:c})).then((function(l){var f=Date.now(),p=s.parseJSON(l.body),d=new o(e,t,r,c,n,l.body,p,l.status,l.headers,a,f);return u._handleRequestResult(l,d,i),p.resource}))},p.prototype._handleRequestResult=function(e,t,n){null!=e.headers["x-txn-time"]&&this.syncLastTxnTime(parseInt(e.headers["x-txn-time"],10)),[this._observer,n&&n.observer].forEach(e=>{"function"==typeof e&&e(t,this)}),i.FaunaHTTPError.raiseForStatusCode(t)},e.exports=p},function(e){e.exports=JSON.parse('{"_from":"faunadb","_id":"faunadb@4.1.1","_inBundle":false,"_integrity":"sha512-ekHtUgt+heYbaZXMWMB00Q7+DCiPKAubs2zbpNc4oMKamRxbL39MyzdNQNnCcSGOAJcLHPJbgOlDHK4y0Rkwrw==","_location":"/faunadb","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"faunadb","name":"faunadb","escapedName":"faunadb","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/faunadb/-/faunadb-4.1.1.tgz","_shasum":"c505aae1171abb18b7e8bf98bfe6b7bc1785e446","_spec":"faunadb","_where":"/Users/sampanter/projects/cosmos-legacy-multisig","apiVersion":"4","browser":{"http2":false,"http":false,"https":false,"os":false,"util":false},"bugs":{"url":"https://github.com/fauna/faunadb-js/issues"},"bundleDependencies":false,"dependencies":{"abort-controller":"^3.0.0","base64-js":"^1.2.0","browser-detect":"^0.2.28","btoa-lite":"^1.0.0","cross-fetch":"^3.0.6","dotenv":"^8.2.0","fn-annotate":"^1.1.3","object-assign":"^4.1.0","util-deprecate":"^1.0.2"},"deprecated":false,"description":"FaunaDB Javascript driver for Node.JS and Browsers","devDependencies":{"browserify":"^16.2.2","eslint":"^5.3.0","eslint-config-prettier":"^6.5.0","eslint-plugin-prettier":"^3.1.1","husky":">=1","ink-docstrap":"^1.2.1","jest":"^24.9.0","jsdoc":"^3.6.3","lint-staged":">=8","prettier":"1.18.2","semantic-release":"^17.1.2","terser":"^4.3.9","webpack":"^5.23.0","webpack-cli":"^4.5.0"},"files":["index.d.ts","src/","dist/"],"homepage":"https://fauna.com","husky":{"hooks":{"pre-commit":"lint-staged"}},"keywords":["database","fauna","official","driver"],"license":"MPL-2.0","lint-staged":{"*.{js,css,json,md}":["prettier --write","git add"],"*.js":["eslint --fix","git add"]},"main":"index.js","name":"faunadb","release":{"branches":["master"]},"repository":{"type":"git","url":"git+https://github.com/fauna/faunadb-js.git"},"scripts":{"browserify":"browserify index.js --standalone faunadb -o dist/faunadb.js","browserify-min":"browserify index.js --standalone faunadb | terser -c -m --keep-fnames --keep-classnames -o dist/faunadb-min.js","doc":"jsdoc -c ./jsdoc.json","prettify":"prettier --write \\"{src,test}/**/*.{js,ts}\\"","semantic-release":"semantic-release","test":"jest --env=node --verbose=false ./test","wp":"webpack"},"types":"index.d.ts","version":"4.1.1"}')},function(e,t,n){"use strict";var r=n(19),o=n(10),i=n(1);function a(){this.type="http2",this._sessionMap={}}a.prototype._resolveSessionFor=function(e,t){var n=t?"stream::"+e:e;if(!this._sessionMap[n]){var o=this,i=function(){o._cleanupSessionFor(e,t)};this._sessionMap[n]=r.connect(e).once("error",i).once("goaway",i).setTimeout(6e4,i)}return this._sessionMap[n]},a.prototype._cleanupSessionFor=function(e,t){var n=t?"stream::"+e:e;this._sessionMap[n]&&(this._sessionMap[n].close(),delete this._sessionMap[n])},a.prototype.execute=function(e){var t=this,n=null!=e.streamConsumer;return new Promise((function(a,s){var u=!1,c=!1,l=function(e){u=!0,a(e)},f=function(t){if(u&&n)return e.streamConsumer.onError(t);u=!0,s(t)},p=function(){e.signal&&e.signal.removeEventListener("abort",d)},d=function(){c=!0,p(),y.close(r.constants.NGHTTP2_CANCEL),f(new o.AbortError)};try{var h=("/"===e.path[0]?e.path:"/"+e.path)+i.querystringify(e.query,"?"),m=Object.assign({},e.headers,{[r.constants.HTTP2_HEADER_PATH]:h,[r.constants.HTTP2_HEADER_METHOD]:e.method}),y=t._resolveSessionFor(e.origin,n).request(m).setEncoding("utf8").on("error",(function(e){p(),f(e)})).on("response",(function(t){var o=t[r.constants.HTTP2_HEADER_STATUS],i=o>=200&&o<400&&n,a="";i&&l({body:"[stream]",headers:t,status:o}),y.on("data",(function(t){if(i)return e.streamConsumer.onData(t);a+=t})).on("end",(function(){if(p(),!i)return l({body:a,headers:t,status:o});c||e.streamConsumer.onError(new TypeError("network error"))}))}));!e.signal&&e.timeout&&y.setTimeout(e.timeout,(function(){c=!0,p(),y.close(r.constants.NGHTTP2_CANCEL),f(new o.TimeoutError)})),e.signal&&e.signal.addEventListener("abort",d),null!=e.body&&y.write(e.body),y.end()}catch(r){t._cleanupSessionFor(e.origin,n),f(r)}}))},e.exports=a},function(e,t,n){"use strict";n(20);var r=n(1),o=n(3),i=n(10);function a(e){e=e||{},this.type="fetch",this._fetch=function(e){if("function"==typeof e)return e;if("function"==typeof global.fetch)return global.fetch.bind(global);return n(28)}(e.fetch),r.isNodeEnv()&&e.keepAlive&&(this._keepAliveEnabledAgent=new((e.isHttps?n(12):n(6)).Agent)({keepAlive:!0}))}function s(e,t){return e&&"AbortError"===e.name?t?new i.TimeoutError:new i.AbortError:e}a.prototype.execute=function(e){var t,n=e.signal,i=!e.signal&&!!e.timeout,a=function(){t&&clearTimeout(t)};if(i){var u=new AbortController;n=u.signal,t=setTimeout(u.abort.bind(u),e.timeout)}return this._fetch(r.formatUrl(e.origin,e.path,e.query),{method:e.method,headers:e.headers,body:e.body,agent:this._keepAliveEnabledAgent,signal:n}).then((function(t){a();var n=function(e){var t={};for(var n of e.entries()){var r=n[0],o=n[1];t[r]=o}return t}(t.headers);return t.ok&&null!=e.streamConsumer?(function(e,t){var n=function(e){t.onError(s(e))};if(r.isNodeEnv())return void e.body.on("error",n).on("data",t.onData).on("end",(function(){t.onError(new TypeError("network error"))}));try{var i=e.body.getReader(),a=new TextDecoder("utf-8");(function e(){return i.read().then((function(n){if(!n.done){var r=a.decode(n.value,{stream:!0});return t.onData(r),e()}t.onError(new TypeError("network error"))}))})().catch(n)}catch(e){throw new o.StreamsNotSupported("Please, consider providing a Fetch API-compatible function with streamable response bodies. "+e)}}(t,e.streamConsumer),{body:"[stream]",headers:n,status:t.status}):t.text().then((function(e){return{body:e,headers:n,status:t.status}}))})).catch((function(e){return a(),Promise.reject(s(e,i))}))},e.exports=a},function(e,t,n){var r=n(29),o=r.default||r,i=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),o.call(this,e,t)};e.exports=t=i,t.fetch=i,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,t.default=i},function(e,t,n){"use strict";n.r(t),n.d(t,"Headers",(function(){return j})),n.d(t,"Request",(function(){return J})),n.d(t,"Response",(function(){return L})),n.d(t,"FetchError",(function(){return p}));var r=n(0),o=n(6),i=n(7),a=n(12),s=n(2);const u=r.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,o=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=n.size;let i=void 0===o?0:o;var a=n.timeout;let s=void 0===a?0:a;null==e?e=null:w(e)?e=Buffer.from(e.toString()):v(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof r||(e=Buffer.from(String(e)))),this[h]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof r&&e.on("error",(function(e){const n="AbortError"===e.name?e:new p(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[h].error=n}))}function b(){var e=this;if(this[h].disturbed)return y.Promise.reject(new TypeError("body used already for: "+this.url));if(this[h].disturbed=!0,this[h].error)return y.Promise.reject(this[h].error);let t=this.body;if(null===t)return y.Promise.resolve(Buffer.alloc(0));if(v(t)&&(t=t.stream()),Buffer.isBuffer(t))return y.Promise.resolve(t);if(!(t instanceof r))return y.Promise.resolve(Buffer.alloc(0));let n=[],o=0,i=!1;return new y.Promise((function(r,a){let s;e.timeout&&(s=setTimeout((function(){i=!0,a(new p(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,a(t)):a(new p(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&o+t.length>e.size)return i=!0,void a(new p(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,n.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(s);try{r(Buffer.concat(n,o))}catch(t){a(new p(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function w(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function v(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function g(e){let t,n,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof r&&"function"!=typeof o.getBoundary&&(t=new m,n=new m,o.pipe(t),o.pipe(n),e[h].body=t,o=n),o}function x(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":w(e)?"application/x-www-form-urlencoded;charset=UTF-8":v(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?"multipart/form-data;boundary="+e.getBoundary():e instanceof r?null:"text/plain;charset=UTF-8"}function _(e){const t=e.body;return null===t?0:v(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}y.prototype={get body(){return this[h].body},get bodyUsed(){return this[h].disturbed},arrayBuffer(){return b.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return b.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return b.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return y.Promise.reject(new p(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return b.call(this).then((function(e){return e.toString()}))},buffer(){return b.call(this)},textConverted(){var e=this;return b.call(this).then((function(t){return function(e,t){if("function"!=typeof d)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=e.slice(0,1024).toString(),!r&&o&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[C]=Object.create(null),e instanceof j){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){T(e=""+e);const t=A(this[C],e);return void 0===t?null:this[C][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=P(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(e[C]).sort();return n.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[C][t].join(", ")}:function(t){return[t.toLowerCase(),e[C][t].join(", ")]})}j.prototype.entries=j.prototype[Symbol.iterator],Object.defineProperty(j.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(j.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const k=Symbol("internal");function R(e,t){const n=Object.create(I);return n[k]={target:e,kind:t,index:0},n}const I=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==I)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[k];const t=e.target,n=e.kind,r=e.index,o=P(t,n);return r>=o.length?{value:void 0,done:!0}:(this[k].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function N(e){const t=Object.assign({__proto__:null},e[C]),n=A(e[C],"Host");return void 0!==n&&(t[n]=t[n][0]),t}Object.defineProperty(I,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const B=Symbol("Response internals"),D=o.STATUS_CODES;class L{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y.call(this,e,t);const n=t.status||200,r=new j(t.headers);if(null!=e&&!r.has("Content-Type")){const t=x(e);t&&r.append("Content-Type",t)}this[B]={url:t.url,status:n,statusText:t.statusText||D[n],headers:r,counter:t.counter}}get url(){return this[B].url||""}get status(){return this[B].status}get ok(){return this[B].status>=200&&this[B].status<300}get redirected(){return this[B].counter>0}get statusText(){return this[B].statusText}get headers(){return this[B].headers}clone(){return new L(g(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}y.mixIn(L.prototype),Object.defineProperties(L.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(L.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const q=Symbol("Request internals"),F=i.parse,U=i.format,M="destroy"in r.Readable.prototype;function H(e){return"object"==typeof e&&"object"==typeof e[q]}class J{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};H(e)?t=F(e.url):(t=e&&e.href?F(e.href):F(""+e),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||H(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:H(e)&&null!==e.body?g(e):null;y.call(this,o,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const i=new j(n.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=x(o);e&&i.append("Content-Type",e)}let a=H(e)?e.signal:null;if("signal"in n&&(a=n.signal),null!=a&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[q]={method:r,redirect:n.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:a},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[q].method}get url(){return U(this[q].parsedURL)}get headers(){return this[q].headers}get redirect(){return this[q].redirect}get signal(){return this[q].signal}clone(){return new J(this)}}function z(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}y.mixIn(J.prototype),Object.defineProperty(J.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(J.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),z.prototype=Object.create(Error.prototype),z.prototype.constructor=z,z.prototype.name="AbortError";const V=r.PassThrough,G=i.resolve;function $(e,t){if(!$.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return y.Promise=$.Promise,new $.Promise((function(n,i){const u=new J(e,t),c=function(e){const t=e[q].parsedURL,n=new j(e[q].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof r.Readable&&!M)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=_(e);"number"==typeof t&&(o=String(t))}o&&n.set("Content-Length",o),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),n.has("Connection")||i||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:N(n),agent:i})}(u),l=("https:"===c.protocol?a:o).request,f=u.signal;let d=null;const h=function(){let e=new z("The user aborted a request.");i(e),u.body&&u.body instanceof r.Readable&&u.body.destroy(e),d&&d.body&&d.body.emit("error",e)};if(f&&f.aborted)return void h();const m=function(){h(),w()},y=l(c);let b;function w(){y.abort(),f&&f.removeEventListener("abort",m),clearTimeout(b)}f&&f.addEventListener("abort",m),u.timeout&&y.once("socket",(function(e){b=setTimeout((function(){i(new p("network timeout at: "+u.url,"request-timeout")),w()}),u.timeout)})),y.on("error",(function(e){i(new p(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),w()})),y.on("response",(function(e){clearTimeout(b);const t=function(e){const t=new j;for(const n of Object.keys(e))if(!S.test(n))if(Array.isArray(e[n]))for(const r of e[n])E.test(r)||(void 0===t[C][n]?t[C][n]=[r]:t[C][n].push(r));else E.test(e[n])||(t[C][n]=[e[n]]);return t}(e.headers);if($.isRedirect(e.statusCode)){const r=t.get("Location"),o=null===r?null:G(u.url,r);switch(u.redirect){case"error":return i(new p("uri requested responds with a redirect, redirect mode is set to error: "+u.url,"no-redirect")),void w();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){i(e)}break;case"follow":if(null===o)break;if(u.counter>=u.follow)return i(new p("maximum redirect reached at: "+u.url,"max-redirect")),void w();const r={headers:new j(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};return 303!==e.statusCode&&u.body&&null===_(u)?(i(new p("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void w()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n($(new J(o,r))),void w())}}e.once("end",(function(){f&&f.removeEventListener("abort",m)}));let r=e.pipe(new V);const o={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},a=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===a||204===e.statusCode||304===e.statusCode)return d=new L(r,o),void n(d);const c={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return r=r.pipe(s.createGunzip(c)),d=new L(r,o),void n(d);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof s.createBrotliDecompress)return r=r.pipe(s.createBrotliDecompress()),d=new L(r,o),void n(d);d=new L(r,o),n(d)}else{e.pipe(new V).once("data",(function(e){r=8==(15&e[0])?r.pipe(s.createInflate()):r.pipe(s.createInflateRaw()),d=new L(r,o),n(d)}))}})),function(e,t){const n=t.body;null===n?e.end():v(n)?n.stream().pipe(e):Buffer.isBuffer(n)?(e.write(n),e.end()):n.pipe(e)}(y,u)}))}$.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},$.Promise=global.Promise,t.default=$},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";n(20);var r=n(9),o=n(3),i=n(11),a=n(18),s=n(4),u=n(1),c=["start","error","version","history_rewrite"],l=c.concat(["snapshot"]);function f(e,t,n,r){n=u.applyDefaults(n,{fields:null}),this._client=e,this._onEvent=r,this._query=s.wrap(t),this._urlParams=n.fields?{fields:n.fields.join(",")}:null,this._abort=new AbortController,this._state="idle"}function p(e){this._allowedEvents=e,this._listeners={}}function d(e,t){this._client=e,this._dispatcher=t}f.prototype.snapshot=function(){var e=this;e._client.query(s.Get(e._query)).then((function(t){e._onEvent({type:"snapshot",event:t})})).catch((function(t){e._onEvent({type:"error",event:t})}))},f.prototype.subscribe=function(){var e=this;if("idle"!==e._state)throw new Error("Subscription#start should not be called several times, consider instantiating a new stream instead.");e._state="open";var t=JSON.stringify(e._query),n=Date.now(),s="";function u(t){t instanceof a.AbortError||e._onEvent({type:"error",event:t})}e._client._http.execute({method:"POST",path:"stream",body:t,query:e._urlParams,signal:this._abort.signal,streamConsumer:{onError:u,onData:function(t){var n=i.parseJSONStreaming(s+t);s=n.buffer,n.values.forEach((function(t){void 0!==t.txn&&e._client.syncLastTxnTime(t.txn),"error"===t.event?u(new o.StreamErrorEvent(t)):e._onEvent(t)}))}}}).then((function(o){var a,s=Date.now();try{a=i.parseJSON(o.body)}catch(e){a=o.body}var u=new r("POST","stream",e._urlParams,t,e._query,o.body,a,o.status,o.headers,n,s);e._client._handleRequestResult(o,u)})).catch(u)},f.prototype.close=function(){"closed"!==this._state&&(this._state="closed",this._abort.abort())},p.prototype.on=function(e,t){if(-1===this._allowedEvents.indexOf(e))throw new Error("Unknown event type: "+e);void 0===this._listeners[e]&&(this._listeners[e]=[]),this._listeners[e].push(t)},p.prototype.dispatch=function(e){var t=this._listeners[e.type];if(t)for(var n=0;ne.event.ts&&i.dispatch(n)}o=!1,r=null}(e);break;case"error":i.dispatch(e);break;default:o?r.push(e):i.dispatch(e)}}));return new d(a,i)},t}}},function(e,t,n){"use strict";var r=n(11);function o(e){var t=e.query,n=e.method,r=e.path,o=e.requestContent,a=e.responseHeaders,s=e.responseContent,u=e.statusCode,c=e.timeTaken,l="";function f(e){l+=e}return f("Fauna "+n+" /"+r+function(e){if(null==e)return"";var t=Object.keys(e);if(0===t.length)return"";return"?"+t.map((function(t){return t+"="+e[t]})).join("&")}(t)+"\n"),null!=o&&f(" Request JSON: "+i(o)+"\n"),f(" Response headers: "+i(a)+"\n"),f(" Response JSON: "+i(s)+"\n"),f(" Response ("+u+"): Network latency "+c+"ms\n"),l}function i(e){return r.toJSON(e,!0).split("\n").join("\n ")}e.exports={logger:function(e){return function(t,n){return e(o(t),n)}},showRequestResult:o}}])); \ No newline at end of file +*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=a(e),c=1;c0&&this._faunaFunctions.forEach((function(e){a=e(a)})),this.client.query(a,this.options)},i.prototype._clone=function(){return Object.create(i.prototype,{client:{value:this.client},set:{value:this.set},_faunaFunctions:{value:this._faunaFunctions},before:{value:this.before},after:{value:this.after}})},e.exports=i},function(e,t,n){"use strict";var r=n(25),o=n(1),i=n(10);function a(e){var t="https"===e.scheme;null==e.port&&(e.port=t?443:80);var i=!e.fetch&&o.isNodeEnv()&&function(){try{return n(19),!0}catch(e){return!1}}();this._adapter=i?new(n(26)):new(n(27))({isHttps:t,fetch:e.fetch,keepAlive:e.keepAlive}),this._baseUrl=e.scheme+"://"+e.domain+":"+e.port,this._secret=e.secret,this._headers=Object.assign({},e.headers,function(){var e={"X-Fauna-Driver":"Javascript","X-FaunaDB-API-Version":r.apiVersion};o.isNodeEnv()&&(e["X-Fauna-Driver-Version"]=r.version,e["X-Runtime-Environment"]=(t=[{name:"Netlify",check:()=>process.env.hasOwnProperty("NETLIFY_IMAGES_CDN_DOMAIN")},{name:"Vercel",check:()=>process.env.hasOwnProperty("VERCEL")},{name:"Heroku",check:()=>process.env.hasOwnProperty("PATH")&&-1!==process.env.PATH.indexOf(".heroku")},{name:"AWS Lambda",check:()=>process.env.hasOwnProperty("AWS_LAMBDA_FUNCTION_VERSION")},{name:"GCP Cloud Functions",check:()=>process.env.hasOwnProperty("_")&&-1!==process.env._.indexOf("google")},{name:"GCP Compute Instances",check:()=>process.env.hasOwnProperty("GOOGLE_CLOUD_PROJECT")},{name:"Azure Cloud Functions",check:()=>process.env.hasOwnProperty("WEBSITE_FUNCTIONS_AZUREMONITOR_CATEGORIES")},{name:"Azure Compute",check:()=>process.env.hasOwnProperty("ORYX_ENV_TYPE")&&process.env.hasOwnProperty("WEBSITE_INSTANCE_ID")&&"AppService"===process.env.ORYX_ENV_TYPE},{name:"Worker",check:()=>{try{return global instanceof ServiceWorkerGlobalScope}catch(e){return!1}}},{name:"Mongo Stitch",check:()=>"function"==typeof global.StitchError},{name:"Render",check:()=>process.env.hasOwnProperty("RENDER_SERVICE_ID")},{name:"Begin",check:()=>process.env.hasOwnProperty("BEGIN_DATA_SCOPE_ID")}].find(e=>e.check()))?t.name:"Unknown",e["X-Runtime-Environment-OS"]=n(30).platform(),e["X-NodeJS-Version"]=process.version);var t;return e}()),this._queryTimeout=e.queryTimeout,this._lastSeen=null,this._timeout=Math.floor(1e3*e.timeout)}a.prototype.getLastTxnTime=function(){return this._lastSeen},a.prototype.syncLastTxnTime=function(e){(null==this._lastSeen||this._lastSeen0){const e=new Array(arguments.length);for(let t=0;t{const r=JSON.parse(e.body);console.log("Function `createMultisig` invoked",r);const o={data:r};try{await a.query(i.Create(i.Collection("Multisig"),o));return console.log("success",response),{statusCode:200,body:JSON.stringify(response)}}catch(e){return console.log("error",e),{statusCode:400,body:JSON.stringify(e)}}}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw new Error("Could not parse function signature for injection dependencies: Object is not a function");if(!e.length)return[];var t=/^()\(?([^)=]*)\)? *=>/.exec(e+"")||/^[^(]+([^ \(]*) *\(([^\)]*)\)/.exec(e+"");if(!t)throw new Error("Could not parse function signature for injection dependencies: "+e);var n=t[2].replace(/\/\*[\S\s]*?\*\//g," ").replace(/\/\/.*/g," ");function r(e,t,n){return t+n.split(",").map((function(e){return e&&e.trim()})).filter(Boolean).join("@")}return(n=(n=n.replace(/(\{)([^}]*)\}/g,r)).replace(/(\[)([^}]*)\]/g,r)).split(",").map((function(e){return e&&e.trim()})).map((function(e){return"{"===e[0]?e.substring(1).split("@"):"["===e[0]?{items:e.substring(1).split("@")}:e})).filter(Boolean)}},function(e,t,n){"use strict";t.byteLength=function(e){var t=c(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,r=c(e),a=r[0],s=r[1],u=new i(function(e,t,n){return 3*(t+n)/4-n}(0,a,s)),l=0,f=s>0?a-4:a;for(n=0;n>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===s&&(t=o[e.charCodeAt(n)]<<2|o[e.charCodeAt(n+1)]>>4,u[l++]=255&t);1===s&&(t=o[e.charCodeAt(n)]<<10|o[e.charCodeAt(n+1)]<<4|o[e.charCodeAt(n+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;as?s:a+16383));1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var o,i,a=[],s=t;s>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,n){"use strict";var r=n(17),o=n(9),i=n(3),a=n(18),s=n(11),u=n(4),c=n(31),l=n(1),f=n(5);function p(e){e=l.applyDefaults(e,{domain:"db.fauna.com",scheme:"https",port:null,secret:null,timeout:60,observer:null,keepAlive:!0,headers:{},fetch:void 0,queryTimeout:null}),this._observer=e.observer,this._http=new a.HttpClient(e),this.stream=c.StreamAPI(this)}p.prototype.query=function(e,t){return this._execute("POST","",u.wrap(e),null,t)},p.prototype.paginate=function(e,t,n){return t=l.defaults(t,{}),n=l.defaults(n,{}),new r(this,e,t,n)},p.prototype.ping=function(e,t){return this._execute("GET","ping",null,{scope:e,timeout:t})},p.prototype.getLastTxnTime=function(){return this._http.getLastTxnTime()},p.prototype.syncLastTxnTime=function(e){this._http.syncLastTxnTime(e)},p.prototype._execute=function(e,t,n,r,i){r=l.defaults(r,null),(t instanceof f.Ref||l.checkInstanceHasProperty(t,"_isFaunaRef"))&&(t=t.value),null!==r&&(r=l.removeUndefinedValues(r));var a=Date.now(),u=this,c=["GET","HEAD"].indexOf(e)>=0?void 0:JSON.stringify(n);return this._http.execute(Object.assign({},i,{path:t,query:r,method:e,body:c})).then((function(l){var f=Date.now(),p=s.parseJSON(l.body),d=new o(e,t,r,c,n,l.body,p,l.status,l.headers,a,f);return u._handleRequestResult(l,d,i),p.resource}))},p.prototype._handleRequestResult=function(e,t,n){null!=e.headers["x-txn-time"]&&this.syncLastTxnTime(parseInt(e.headers["x-txn-time"],10)),[this._observer,n&&n.observer].forEach(e=>{"function"==typeof e&&e(t,this)}),i.FaunaHTTPError.raiseForStatusCode(t)},e.exports=p},function(e){e.exports=JSON.parse('{"_from":"faunadb","_id":"faunadb@4.1.1","_inBundle":false,"_integrity":"sha512-ekHtUgt+heYbaZXMWMB00Q7+DCiPKAubs2zbpNc4oMKamRxbL39MyzdNQNnCcSGOAJcLHPJbgOlDHK4y0Rkwrw==","_location":"/faunadb","_phantomChildren":{},"_requested":{"type":"tag","registry":true,"raw":"faunadb","name":"faunadb","escapedName":"faunadb","rawSpec":"","saveSpec":null,"fetchSpec":"latest"},"_requiredBy":["#USER","/"],"_resolved":"https://registry.npmjs.org/faunadb/-/faunadb-4.1.1.tgz","_shasum":"c505aae1171abb18b7e8bf98bfe6b7bc1785e446","_spec":"faunadb","_where":"/Users/sampanter/projects/cosmos-legacy-multisig","apiVersion":"4","browser":{"http2":false,"http":false,"https":false,"os":false,"util":false},"bugs":{"url":"https://github.com/fauna/faunadb-js/issues"},"bundleDependencies":false,"dependencies":{"abort-controller":"^3.0.0","base64-js":"^1.2.0","browser-detect":"^0.2.28","btoa-lite":"^1.0.0","cross-fetch":"^3.0.6","dotenv":"^8.2.0","fn-annotate":"^1.1.3","object-assign":"^4.1.0","util-deprecate":"^1.0.2"},"deprecated":false,"description":"FaunaDB Javascript driver for Node.JS and Browsers","devDependencies":{"browserify":"^16.2.2","eslint":"^5.3.0","eslint-config-prettier":"^6.5.0","eslint-plugin-prettier":"^3.1.1","husky":">=1","ink-docstrap":"^1.2.1","jest":"^24.9.0","jsdoc":"^3.6.3","lint-staged":">=8","prettier":"1.18.2","semantic-release":"^17.1.2","terser":"^4.3.9","webpack":"^5.23.0","webpack-cli":"^4.5.0"},"files":["index.d.ts","src/","dist/"],"homepage":"https://fauna.com","husky":{"hooks":{"pre-commit":"lint-staged"}},"keywords":["database","fauna","official","driver"],"license":"MPL-2.0","lint-staged":{"*.{js,css,json,md}":["prettier --write","git add"],"*.js":["eslint --fix","git add"]},"main":"index.js","name":"faunadb","release":{"branches":["master"]},"repository":{"type":"git","url":"git+https://github.com/fauna/faunadb-js.git"},"scripts":{"browserify":"browserify index.js --standalone faunadb -o dist/faunadb.js","browserify-min":"browserify index.js --standalone faunadb | terser -c -m --keep-fnames --keep-classnames -o dist/faunadb-min.js","doc":"jsdoc -c ./jsdoc.json","prettify":"prettier --write \\"{src,test}/**/*.{js,ts}\\"","semantic-release":"semantic-release","test":"jest --env=node --verbose=false ./test","wp":"webpack"},"types":"index.d.ts","version":"4.1.1"}')},function(e,t,n){"use strict";var r=n(19),o=n(10),i=n(1);function a(){this.type="http2",this._sessionMap={}}a.prototype._resolveSessionFor=function(e,t){var n=t?"stream::"+e:e;if(!this._sessionMap[n]){var o=this,i=function(){o._cleanupSessionFor(e,t)};this._sessionMap[n]=r.connect(e).once("error",i).once("goaway",i).setTimeout(6e4,i)}return this._sessionMap[n]},a.prototype._cleanupSessionFor=function(e,t){var n=t?"stream::"+e:e;this._sessionMap[n]&&(this._sessionMap[n].close(),delete this._sessionMap[n])},a.prototype.execute=function(e){var t=this,n=null!=e.streamConsumer;return new Promise((function(a,s){var u=!1,c=!1,l=function(e){u=!0,a(e)},f=function(t){if(u&&n)return e.streamConsumer.onError(t);u=!0,s(t)},p=function(){e.signal&&e.signal.removeEventListener("abort",d)},d=function(){c=!0,p(),y.close(r.constants.NGHTTP2_CANCEL),f(new o.AbortError)};try{var h=("/"===e.path[0]?e.path:"/"+e.path)+i.querystringify(e.query,"?"),m=Object.assign({},e.headers,{[r.constants.HTTP2_HEADER_PATH]:h,[r.constants.HTTP2_HEADER_METHOD]:e.method}),y=t._resolveSessionFor(e.origin,n).request(m).setEncoding("utf8").on("error",(function(e){p(),f(e)})).on("response",(function(t){var o=t[r.constants.HTTP2_HEADER_STATUS],i=o>=200&&o<400&&n,a="";i&&l({body:"[stream]",headers:t,status:o}),y.on("data",(function(t){if(i)return e.streamConsumer.onData(t);a+=t})).on("end",(function(){if(p(),!i)return l({body:a,headers:t,status:o});c||e.streamConsumer.onError(new TypeError("network error"))}))}));!e.signal&&e.timeout&&y.setTimeout(e.timeout,(function(){c=!0,p(),y.close(r.constants.NGHTTP2_CANCEL),f(new o.TimeoutError)})),e.signal&&e.signal.addEventListener("abort",d),null!=e.body&&y.write(e.body),y.end()}catch(r){t._cleanupSessionFor(e.origin,n),f(r)}}))},e.exports=a},function(e,t,n){"use strict";n(20);var r=n(1),o=n(3),i=n(10);function a(e){e=e||{},this.type="fetch",this._fetch=function(e){if("function"==typeof e)return e;if("function"==typeof global.fetch)return global.fetch.bind(global);return n(28)}(e.fetch),r.isNodeEnv()&&e.keepAlive&&(this._keepAliveEnabledAgent=new((e.isHttps?n(12):n(6)).Agent)({keepAlive:!0}))}function s(e,t){return e&&"AbortError"===e.name?t?new i.TimeoutError:new i.AbortError:e}a.prototype.execute=function(e){var t,n=e.signal,i=!e.signal&&!!e.timeout,a=function(){t&&clearTimeout(t)};if(i){var u=new AbortController;n=u.signal,t=setTimeout(u.abort.bind(u),e.timeout)}return this._fetch(r.formatUrl(e.origin,e.path,e.query),{method:e.method,headers:e.headers,body:e.body,agent:this._keepAliveEnabledAgent,signal:n}).then((function(t){a();var n=function(e){var t={};for(var n of e.entries()){var r=n[0],o=n[1];t[r]=o}return t}(t.headers);return t.ok&&null!=e.streamConsumer?(function(e,t){var n=function(e){t.onError(s(e))};if(r.isNodeEnv())return void e.body.on("error",n).on("data",t.onData).on("end",(function(){t.onError(new TypeError("network error"))}));try{var i=e.body.getReader(),a=new TextDecoder("utf-8");(function e(){return i.read().then((function(n){if(!n.done){var r=a.decode(n.value,{stream:!0});return t.onData(r),e()}t.onError(new TypeError("network error"))}))})().catch(n)}catch(e){throw new o.StreamsNotSupported("Please, consider providing a Fetch API-compatible function with streamable response bodies. "+e)}}(t,e.streamConsumer),{body:"[stream]",headers:n,status:t.status}):t.text().then((function(e){return{body:e,headers:n,status:t.status}}))})).catch((function(e){return a(),Promise.reject(s(e,i))}))},e.exports=a},function(e,t,n){var r=n(29),o=r.default||r,i=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),o.call(this,e,t)};e.exports=t=i,t.fetch=i,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,t.default=i},function(e,t,n){"use strict";n.r(t),n.d(t,"Headers",(function(){return j})),n.d(t,"Request",(function(){return J})),n.d(t,"Response",(function(){return L})),n.d(t,"FetchError",(function(){return p}));var r=n(0),o=n(6),i=n(7),a=n(12),s=n(2);const u=r.Readable,c=Symbol("buffer"),l=Symbol("type");class f{constructor(){this[l]="";const e=arguments[0],t=arguments[1],n=[];let r=0;if(e){const t=e,o=Number(t.length);for(let e=0;e1&&void 0!==arguments[1]?arguments[1]:{},o=n.size;let i=void 0===o?0:o;var a=n.timeout;let s=void 0===a?0:a;null==e?e=null:w(e)?e=Buffer.from(e.toString()):v(e)||Buffer.isBuffer(e)||("[object ArrayBuffer]"===Object.prototype.toString.call(e)?e=Buffer.from(e):ArrayBuffer.isView(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):e instanceof r||(e=Buffer.from(String(e)))),this[h]={body:e,disturbed:!1,error:null},this.size=i,this.timeout=s,e instanceof r&&e.on("error",(function(e){const n="AbortError"===e.name?e:new p(`Invalid response body while trying to fetch ${t.url}: ${e.message}`,"system",e);t[h].error=n}))}function b(){var e=this;if(this[h].disturbed)return y.Promise.reject(new TypeError("body used already for: "+this.url));if(this[h].disturbed=!0,this[h].error)return y.Promise.reject(this[h].error);let t=this.body;if(null===t)return y.Promise.resolve(Buffer.alloc(0));if(v(t)&&(t=t.stream()),Buffer.isBuffer(t))return y.Promise.resolve(t);if(!(t instanceof r))return y.Promise.resolve(Buffer.alloc(0));let n=[],o=0,i=!1;return new y.Promise((function(r,a){let s;e.timeout&&(s=setTimeout((function(){i=!0,a(new p(`Response timeout while trying to fetch ${e.url} (over ${e.timeout}ms)`,"body-timeout"))}),e.timeout)),t.on("error",(function(t){"AbortError"===t.name?(i=!0,a(t)):a(new p(`Invalid response body while trying to fetch ${e.url}: ${t.message}`,"system",t))})),t.on("data",(function(t){if(!i&&null!==t){if(e.size&&o+t.length>e.size)return i=!0,void a(new p(`content size at ${e.url} over limit: ${e.size}`,"max-size"));o+=t.length,n.push(t)}})),t.on("end",(function(){if(!i){clearTimeout(s);try{r(Buffer.concat(n,o))}catch(t){a(new p(`Could not create Buffer from response body for ${e.url}: ${t.message}`,"system",t))}}}))}))}function w(e){return"object"==typeof e&&"function"==typeof e.append&&"function"==typeof e.delete&&"function"==typeof e.get&&"function"==typeof e.getAll&&"function"==typeof e.has&&"function"==typeof e.set&&("URLSearchParams"===e.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(e)||"function"==typeof e.sort)}function v(e){return"object"==typeof e&&"function"==typeof e.arrayBuffer&&"string"==typeof e.type&&"function"==typeof e.stream&&"function"==typeof e.constructor&&"string"==typeof e.constructor.name&&/^(Blob|File)$/.test(e.constructor.name)&&/^(Blob|File)$/.test(e[Symbol.toStringTag])}function g(e){let t,n,o=e.body;if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof r&&"function"!=typeof o.getBoundary&&(t=new m,n=new m,o.pipe(t),o.pipe(n),e[h].body=t,o=n),o}function x(e){return null===e?null:"string"==typeof e?"text/plain;charset=UTF-8":w(e)?"application/x-www-form-urlencoded;charset=UTF-8":v(e)?e.type||null:Buffer.isBuffer(e)||"[object ArrayBuffer]"===Object.prototype.toString.call(e)||ArrayBuffer.isView(e)?null:"function"==typeof e.getBoundary?"multipart/form-data;boundary="+e.getBoundary():e instanceof r?null:"text/plain;charset=UTF-8"}function _(e){const t=e.body;return null===t?0:v(t)?t.size:Buffer.isBuffer(t)?t.length:t&&"function"==typeof t.getLengthSync&&(t._lengthRetrievers&&0==t._lengthRetrievers.length||t.hasKnownLength&&t.hasKnownLength())?t.getLengthSync():null}y.prototype={get body(){return this[h].body},get bodyUsed(){return this[h].disturbed},arrayBuffer(){return b.call(this).then((function(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))},blob(){let e=this.headers&&this.headers.get("content-type")||"";return b.call(this).then((function(t){return Object.assign(new f([],{type:e.toLowerCase()}),{[c]:t})}))},json(){var e=this;return b.call(this).then((function(t){try{return JSON.parse(t.toString())}catch(t){return y.Promise.reject(new p(`invalid json response body at ${e.url} reason: ${t.message}`,"invalid-json"))}}))},text(){return b.call(this).then((function(e){return e.toString()}))},buffer(){return b.call(this)},textConverted(){var e=this;return b.call(this).then((function(t){return function(e,t){if("function"!=typeof d)throw new Error("The package `encoding` must be installed to use the textConverted() function");const n=t.get("content-type");let r,o,i="utf-8";n&&(r=/charset=([^;]*)/i.exec(n));o=e.slice(0,1024).toString(),!r&&o&&(r=/0&&void 0!==arguments[0]?arguments[0]:void 0;if(this[C]=Object.create(null),e instanceof j){const t=e.raw(),n=Object.keys(t);for(const e of n)for(const n of t[e])this.append(e,n)}else if(null==e);else{if("object"!=typeof e)throw new TypeError("Provided initializer must be an object");{const t=e[Symbol.iterator];if(null!=t){if("function"!=typeof t)throw new TypeError("Header pairs must be iterable");const n=[];for(const t of e){if("object"!=typeof t||"function"!=typeof t[Symbol.iterator])throw new TypeError("Each header pair must be iterable");n.push(Array.from(t))}for(const e of n){if(2!==e.length)throw new TypeError("Each header pair must be a name/value tuple");this.append(e[0],e[1])}}else for(const t of Object.keys(e)){const n=e[t];this.append(t,n)}}}}get(e){T(e=""+e);const t=A(this[C],e);return void 0===t?null:this[C][t].join(", ")}forEach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=P(this),r=0;for(;r1&&void 0!==arguments[1]?arguments[1]:"key+value";const n=Object.keys(e[C]).sort();return n.map("key"===t?function(e){return e.toLowerCase()}:"value"===t?function(t){return e[C][t].join(", ")}:function(t){return[t.toLowerCase(),e[C][t].join(", ")]})}j.prototype.entries=j.prototype[Symbol.iterator],Object.defineProperty(j.prototype,Symbol.toStringTag,{value:"Headers",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(j.prototype,{get:{enumerable:!0},forEach:{enumerable:!0},set:{enumerable:!0},append:{enumerable:!0},has:{enumerable:!0},delete:{enumerable:!0},keys:{enumerable:!0},values:{enumerable:!0},entries:{enumerable:!0}});const k=Symbol("internal");function R(e,t){const n=Object.create(I);return n[k]={target:e,kind:t,index:0},n}const I=Object.setPrototypeOf({next(){if(!this||Object.getPrototypeOf(this)!==I)throw new TypeError("Value of `this` is not a HeadersIterator");var e=this[k];const t=e.target,n=e.kind,r=e.index,o=P(t,n);return r>=o.length?{value:void 0,done:!0}:(this[k].index=r+1,{value:o[r],done:!1})}},Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));function N(e){const t=Object.assign({__proto__:null},e[C]),n=A(e[C],"Host");return void 0!==n&&(t[n]=t[n][0]),t}Object.defineProperty(I,Symbol.toStringTag,{value:"HeadersIterator",writable:!1,enumerable:!1,configurable:!0});const B=Symbol("Response internals"),D=o.STATUS_CODES;class L{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};y.call(this,e,t);const n=t.status||200,r=new j(t.headers);if(null!=e&&!r.has("Content-Type")){const t=x(e);t&&r.append("Content-Type",t)}this[B]={url:t.url,status:n,statusText:t.statusText||D[n],headers:r,counter:t.counter}}get url(){return this[B].url||""}get status(){return this[B].status}get ok(){return this[B].status>=200&&this[B].status<300}get redirected(){return this[B].counter>0}get statusText(){return this[B].statusText}get headers(){return this[B].headers}clone(){return new L(g(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected})}}y.mixIn(L.prototype),Object.defineProperties(L.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}}),Object.defineProperty(L.prototype,Symbol.toStringTag,{value:"Response",writable:!1,enumerable:!1,configurable:!0});const q=Symbol("Request internals"),F=i.parse,U=i.format,M="destroy"in r.Readable.prototype;function H(e){return"object"==typeof e&&"object"==typeof e[q]}class J{constructor(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};H(e)?t=F(e.url):(t=e&&e.href?F(e.href):F(""+e),e={});let r=n.method||e.method||"GET";if(r=r.toUpperCase(),(null!=n.body||H(e)&&null!==e.body)&&("GET"===r||"HEAD"===r))throw new TypeError("Request with GET/HEAD method cannot have body");let o=null!=n.body?n.body:H(e)&&null!==e.body?g(e):null;y.call(this,o,{timeout:n.timeout||e.timeout||0,size:n.size||e.size||0});const i=new j(n.headers||e.headers||{});if(null!=o&&!i.has("Content-Type")){const e=x(o);e&&i.append("Content-Type",e)}let a=H(e)?e.signal:null;if("signal"in n&&(a=n.signal),null!=a&&!function(e){const t=e&&"object"==typeof e&&Object.getPrototypeOf(e);return!(!t||"AbortSignal"!==t.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal");this[q]={method:r,redirect:n.redirect||e.redirect||"follow",headers:i,parsedURL:t,signal:a},this.follow=void 0!==n.follow?n.follow:void 0!==e.follow?e.follow:20,this.compress=void 0!==n.compress?n.compress:void 0===e.compress||e.compress,this.counter=n.counter||e.counter||0,this.agent=n.agent||e.agent}get method(){return this[q].method}get url(){return U(this[q].parsedURL)}get headers(){return this[q].headers}get redirect(){return this[q].redirect}get signal(){return this[q].signal}clone(){return new J(this)}}function z(e){Error.call(this,e),this.type="aborted",this.message=e,Error.captureStackTrace(this,this.constructor)}y.mixIn(J.prototype),Object.defineProperty(J.prototype,Symbol.toStringTag,{value:"Request",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperties(J.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}}),z.prototype=Object.create(Error.prototype),z.prototype.constructor=z,z.prototype.name="AbortError";const V=r.PassThrough,G=i.resolve;function $(e,t){if(!$.Promise)throw new Error("native promise missing, set fetch.Promise to your favorite alternative");return y.Promise=$.Promise,new $.Promise((function(n,i){const u=new J(e,t),c=function(e){const t=e[q].parsedURL,n=new j(e[q].headers);if(n.has("Accept")||n.set("Accept","*/*"),!t.protocol||!t.hostname)throw new TypeError("Only absolute URLs are supported");if(!/^https?:$/.test(t.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(e.signal&&e.body instanceof r.Readable&&!M)throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8");let o=null;if(null==e.body&&/^(POST|PUT)$/i.test(e.method)&&(o="0"),null!=e.body){const t=_(e);"number"==typeof t&&(o=String(t))}o&&n.set("Content-Length",o),n.has("User-Agent")||n.set("User-Agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip,deflate");let i=e.agent;return"function"==typeof i&&(i=i(t)),n.has("Connection")||i||n.set("Connection","close"),Object.assign({},t,{method:e.method,headers:N(n),agent:i})}(u),l=("https:"===c.protocol?a:o).request,f=u.signal;let d=null;const h=function(){let e=new z("The user aborted a request.");i(e),u.body&&u.body instanceof r.Readable&&u.body.destroy(e),d&&d.body&&d.body.emit("error",e)};if(f&&f.aborted)return void h();const m=function(){h(),w()},y=l(c);let b;function w(){y.abort(),f&&f.removeEventListener("abort",m),clearTimeout(b)}f&&f.addEventListener("abort",m),u.timeout&&y.once("socket",(function(e){b=setTimeout((function(){i(new p("network timeout at: "+u.url,"request-timeout")),w()}),u.timeout)})),y.on("error",(function(e){i(new p(`request to ${u.url} failed, reason: ${e.message}`,"system",e)),w()})),y.on("response",(function(e){clearTimeout(b);const t=function(e){const t=new j;for(const n of Object.keys(e))if(!S.test(n))if(Array.isArray(e[n]))for(const r of e[n])E.test(r)||(void 0===t[C][n]?t[C][n]=[r]:t[C][n].push(r));else E.test(e[n])||(t[C][n]=[e[n]]);return t}(e.headers);if($.isRedirect(e.statusCode)){const r=t.get("Location"),o=null===r?null:G(u.url,r);switch(u.redirect){case"error":return i(new p("uri requested responds with a redirect, redirect mode is set to error: "+u.url,"no-redirect")),void w();case"manual":if(null!==o)try{t.set("Location",o)}catch(e){i(e)}break;case"follow":if(null===o)break;if(u.counter>=u.follow)return i(new p("maximum redirect reached at: "+u.url,"max-redirect")),void w();const r={headers:new j(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:u.body,signal:u.signal,timeout:u.timeout,size:u.size};return 303!==e.statusCode&&u.body&&null===_(u)?(i(new p("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void w()):(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==u.method)||(r.method="GET",r.body=void 0,r.headers.delete("content-length")),n($(new J(o,r))),void w())}}e.once("end",(function(){f&&f.removeEventListener("abort",m)}));let r=e.pipe(new V);const o={url:u.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:u.size,timeout:u.timeout,counter:u.counter},a=t.get("Content-Encoding");if(!u.compress||"HEAD"===u.method||null===a||204===e.statusCode||304===e.statusCode)return d=new L(r,o),void n(d);const c={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if("gzip"==a||"x-gzip"==a)return r=r.pipe(s.createGunzip(c)),d=new L(r,o),void n(d);if("deflate"!=a&&"x-deflate"!=a){if("br"==a&&"function"==typeof s.createBrotliDecompress)return r=r.pipe(s.createBrotliDecompress()),d=new L(r,o),void n(d);d=new L(r,o),n(d)}else{e.pipe(new V).once("data",(function(e){r=8==(15&e[0])?r.pipe(s.createInflate()):r.pipe(s.createInflateRaw()),d=new L(r,o),n(d)}))}})),function(e,t){const n=t.body;null===n?e.end():v(n)?n.stream().pipe(e):Buffer.isBuffer(n)?(e.write(n),e.end()):n.pipe(e)}(y,u)}))}$.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},$.Promise=global.Promise,t.default=$},function(e,t){e.exports=require("os")},function(e,t,n){"use strict";n(20);var r=n(9),o=n(3),i=n(11),a=n(18),s=n(4),u=n(1),c=["start","error","version","history_rewrite"],l=c.concat(["snapshot"]);function f(e,t,n,r){n=u.applyDefaults(n,{fields:null}),this._client=e,this._onEvent=r,this._query=s.wrap(t),this._urlParams=n.fields?{fields:n.fields.join(",")}:null,this._abort=new AbortController,this._state="idle"}function p(e){this._allowedEvents=e,this._listeners={}}function d(e,t){this._client=e,this._dispatcher=t}f.prototype.snapshot=function(){var e=this;e._client.query(s.Get(e._query)).then((function(t){e._onEvent({type:"snapshot",event:t})})).catch((function(t){e._onEvent({type:"error",event:t})}))},f.prototype.subscribe=function(){var e=this;if("idle"!==e._state)throw new Error("Subscription#start should not be called several times, consider instantiating a new stream instead.");e._state="open";var t=JSON.stringify(e._query),n=Date.now(),s="";function u(t){t instanceof a.AbortError||e._onEvent({type:"error",event:t})}e._client._http.execute({method:"POST",path:"stream",body:t,query:e._urlParams,signal:this._abort.signal,streamConsumer:{onError:u,onData:function(t){var n=i.parseJSONStreaming(s+t);s=n.buffer,n.values.forEach((function(t){void 0!==t.txn&&e._client.syncLastTxnTime(t.txn),"error"===t.event?u(new o.StreamErrorEvent(t)):e._onEvent(t)}))}}}).then((function(o){var a,s=Date.now();try{a=i.parseJSON(o.body)}catch(e){a=o.body}var u=new r("POST","stream",e._urlParams,t,e._query,o.body,a,o.status,o.headers,n,s);e._client._handleRequestResult(o,u)})).catch(u)},f.prototype.close=function(){"closed"!==this._state&&(this._state="closed",this._abort.abort())},p.prototype.on=function(e,t){if(-1===this._allowedEvents.indexOf(e))throw new Error("Unknown event type: "+e);void 0===this._listeners[e]&&(this._listeners[e]=[]),this._listeners[e].push(t)},p.prototype.dispatch=function(e){var t=this._listeners[e.type];if(t)for(var n=0;ne.event.ts&&i.dispatch(n)}o=!1,r=null}(e);break;case"error":i.dispatch(e);break;default:o?r.push(e):i.dispatch(e)}}));return new d(a,i)},t}}},function(e,t,n){"use strict";var r=n(11);function o(e){var t=e.query,n=e.method,r=e.path,o=e.requestContent,a=e.responseHeaders,s=e.responseContent,u=e.statusCode,c=e.timeTaken,l="";function f(e){l+=e}return f("Fauna "+n+" /"+r+function(e){if(null==e)return"";var t=Object.keys(e);if(0===t.length)return"";return"?"+t.map((function(t){return t+"="+e[t]})).join("&")}(t)+"\n"),null!=o&&f(" Request JSON: "+i(o)+"\n"),f(" Response headers: "+i(a)+"\n"),f(" Response JSON: "+i(s)+"\n"),f(" Response ("+u+"): Network latency "+c+"ms\n"),l}function i(e){return r.toJSON(e,!0).split("\n").join("\n ")}e.exports={logger:function(e){return function(t,n){return e(o(t),n)}},showRequestResult:o}}])); \ No newline at end of file diff --git a/lambda/create-multisig.js b/lambda/create-multisig.js index 33a5808..4f6ace4 100644 --- a/lambda/create-multisig.js +++ b/lambda/create-multisig.js @@ -1,4 +1,3 @@ -/* code from functions/todos-create.js */ import faunadb from "faunadb"; /* Import faunaDB sdk */ /* configure faunaDB Client with our secret */ @@ -7,9 +6,7 @@ const client = new faunadb.Client({ secret: process.env.FAUNADB_SECRET, }); -/* export our lambda function as named "handler" export */ exports.handler = async (event, context, callback) => { - /* parse the string body into a useable JS object */ const data = JSON.parse(event.body); console.log("Function `createMultisig` invoked", data); const multisig = { @@ -25,6 +22,7 @@ exports.handler = async (event, context, callback) => { body: JSON.stringify(response), }; } catch (error) { + console.log("error", error); return { statusCode: 400, body: JSON.stringify(error),