@baadal-sdk/dapi 0.28.3 → 0.28.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/types/aws/db.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/aws/db.ts +27 -11
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={76:e=>{e.exports=require("rimraf")}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{t.r(n),t.d(n,{aws:()=>o,default:()=>Ee,fs:()=>e,gh:()=>u});var e={};t.r(e),t.d(e,{appendToFile:()=>V,createDir:()=>$,deleteDir:()=>L,deleteFile:()=>J,existsDirSync:()=>N,existsFileSync:()=>A,readDir:()=>G,readDirDirs:()=>z,readDirFiles:()=>K,readDirFilesRec:()=>H,readFile:()=>M,readFileSync:()=>B,renameFile:()=>W,writeFile:()=>Q});var r={};t.r(r),t.d(r,{deleteItem:()=>ye,init:()=>ie,queryItems:()=>be,readItem:()=>de,scanItems:()=>ve,status:()=>se,updateItem:()=>me,writeItem:()=>fe,writeItemForce:()=>pe});var o={};t.r(o),t.d(o,{db:()=>we,init:()=>je,status:()=>ge});var u={};t.r(u),t.d(u,{getContent:()=>Se,init:()=>De}),require("regenerator-runtime/runtime.js"),require("core-js/modules/es.string.starts-with.js"),require("core-js/modules/es.array.for-each.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.array.last-index-of.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.array.slice.js");const a=require("path");var c=t.n(a);const i=require("util");var s=t.n(i);const l=require("fs");var p=t.n(l);const f=require("fs/promises");var m=t.n(f);function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function b(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function v(e,r){if(r&&("object"===d(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var r="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return x(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),j(n,e)},h(e)}function x(e,r,t){return x=w()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&j(o,t.prototype),o},x.apply(null,arguments)}function w(){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(e){return!1}}function j(e,r){return j=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},j(e,r)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.array.index-of.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.reflect.construct.js"),require("core-js/modules/es.map.js"),require("core-js/modules/esnext.map.delete-all.js"),require("core-js/modules/esnext.map.every.js"),require("core-js/modules/esnext.map.filter.js"),require("core-js/modules/esnext.map.find.js"),require("core-js/modules/esnext.map.find-key.js"),require("core-js/modules/esnext.map.includes.js"),require("core-js/modules/esnext.map.key-of.js"),require("core-js/modules/esnext.map.map-keys.js"),require("core-js/modules/esnext.map.map-values.js"),require("core-js/modules/esnext.map.merge.js"),require("core-js/modules/esnext.map.reduce.js"),require("core-js/modules/esnext.map.some.js"),require("core-js/modules/esnext.map.update.js");var k=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&j(e,r)}(o,e);var r,t,n=(r=o,t=w(),function(){var e,n=g(r);if(t){var o=g(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return v(this,e)});function o(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,o),r=n.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(y(r),o),r.name=t.name||"CustomError",r}return o}(h(Error));const R=require("chalk");var q=t.n(R);function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}console.log;var C=console.warn,D=console.error;"undefined"===("undefined"==typeof window?"undefined":O(window))&&(C=function(){return console.warn(q().yellow.apply(q(),arguments))},D=function(){return console.error(q().red.apply(q(),arguments))});var S=C,E=D;function P(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return I(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?I(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function F(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}function T(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){F(u,n,o,a,c,"next",e)}function c(e){F(u,n,o,a,c,"throw",e)}a(void 0)}))}}var _=function(e){return!e||e.startsWith("/")?e:c().resolve(process.cwd(),e)},A=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=_(e);try{if(!p().existsSync(e)){if(!r)return!1;throw new k("File does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof k?t:new k("Error while accessing file: ".concat(e))}return!0},N=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=_(e);try{if(!p().existsSync(e)){if(!r)return!1;throw new k("Directory does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof k?t:new k("Error while accessing directory: ".concat(e))}return!0},M=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>1&&void 0!==o[1]&&o[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),n=null,e.prev=5,e.next=8,m().readFile(r,"utf8");case 8:n=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),t&&S("Cannot read file: ".concat(r));case 14:return e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(r){return e.apply(this,arguments)}}(),B=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;e=_(e);var t=null;try{t=p().readFileSync(e,"utf8")}catch(t){r&&S("Cannot read file: ".concat(e))}return t},G=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>1&&void 0!==u[1]&&u[1],r){e.next=3;break}return e.abrupt("return",{dirs:null,files:null});case 3:return r=_(r),n=null,o=null,e.prev=6,e.next=9,m().readdir(r,{withFileTypes:!0});case 9:e.sent.forEach((function(e){e.isDirectory()?o?o.push(e.name):o=[e.name]:e.isFile()&&(n?n.push(e.name):n=[e.name])})),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t&&S("Cannot read dir: ".concat(r));case 16:return e.abrupt("return",{dirs:o,files:n});case 17:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(r){return e.apply(this,arguments)}}(),K=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),e.next=6,G(r,t);case 6:return e.abrupt("return",e.sent.files);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),z=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),e.next=6,G(r,t);case 6:return e.abrupt("return",e.sent.dirs);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),U=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,i,s,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>1&&void 0!==l[1]?l[1]:"",r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),n=t?"".concat(r,"/").concat(t):r,e.next=7,G(n);case 7:return o=e.sent,u=o.dirs,a=o.files,c=(c=a||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),i=(u||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),s=i.map((function(e){return U(r,e)})),e.next=16,Promise.all(s);case 16:return e.sent.forEach((function(e){e&&(c=[].concat(P(c),P(e)))})),e.abrupt("return",c.length?c:null);case 19:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),H=function(e){return U(e)},Q=function(){var e=T(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,m().mkdir(n,{recursive:!0});case 7:return e.next=9,m().writeFile(r,t);case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while writing to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),V=function(){var e=T(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,m().mkdir(n,{recursive:!0});case 7:return e.next=9,m().appendFile(r,t+"\n");case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while appending to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),W=function(){var e=T(regeneratorRuntime.mark((function e(r,t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),t=_(t),e.prev=4,e.next=7,m().rename(r,t);case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.error("Error while renaming file ".concat(r," to ").concat(t),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(r,t){return e.apply(this,arguments)}}(),$=function(){var e=T(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:if(r=_(r),e.prev=3,N(r)){e.next=7;break}return e.next=7,m().mkdir(r,{recursive:!0});case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),console.error("Error while creating directory: ".concat(r),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(r){return e.apply(this,arguments)}}(),J=function(){var e=T(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,e.next=6,m().unlink(r);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),console.error("Error while deleting file ".concat(r),e.t0),e.abrupt("return",!1);case 12:return e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(r){return e.apply(this,arguments)}}(),L=function(){var e=T(regeneratorRuntime.mark((function e(r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=t(76),o=s().promisify(n),e.next=8,o(r);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(3),console.error("Error while deleting dir ".concat(r),e.t0),e.abrupt("return",!1);case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(r){return e.apply(this,arguments)}}();require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js");const X=require("@aws-sdk/client-dynamodb"),Y=require("@aws-sdk/lib-dynamodb"),Z=require("short-uuid");var ee=t.n(Z);const re={dbDocClient:null,id:null};function te(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function ne(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?te(Object(t),!0).forEach((function(r){oe(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function oe(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ue(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}function ae(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){ue(u,n,o,a,c,"next",e)}function c(e){ue(u,n,o,a,c,"throw",e)}a(void 0)}))}}var ce=function(){throw new k("DynamoDB is possibly uninitialized!",{name:"DynamoDBError"})},ie=function(e){var r=new X.DynamoDBClient({region:e});return!re.dbDocClient&&(re.dbDocClient=Y.DynamoDBDocumentClient.from(r),re.id=ee().uuid(),!0)},se=function(){return re.id},le=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient){e.next=2;break}return e.abrupt("return",ce());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return t[n]||(t[n]=ee().uuid()),u={TableName:r,Item:t,ConditionExpression:"attribute_not_exists(".concat(n,")")},a=new Y.PutCommand(u),c=3,e.prev=8,e.next=11,re.dbDocClient.send(a);case 11:e.next=25;break;case 13:if(e.prev=13,e.t0=e.catch(8),"ConditionalCheckFailedException"!==e.t0.name){e.next=24;break}if(!(o<c-1)){e.next=22;break}return t[n]=ee().uuid(),e.next=20,le(r,t,n,o+1);case 20:return i=e.sent,e.abrupt("return",i);case 22:console.error("PutCommandInput:",u),console.error("[ERROR] Maximum attempts overflow!");case 24:return e.abrupt("return",null);case 25:return e.abrupt("return",t);case 26:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),pe=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"id",e.abrupt("return",le(r,t,n,0));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),fe=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient){e.next=2;break}return e.abrupt("return",ce());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return n={TableName:r,Item:t},o=new Y.PutCommand(n),e.prev=6,e.next=9,re.dbDocClient.send(o);case 9:e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(6),console.error("PutCommandInput:",n),console.error(e.t0),e.abrupt("return",null);case 16:return e.abrupt("return",!0);case 17:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(r,t){return e.apply(this,arguments)}}(),me=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o,u){var a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient){e.next=2;break}return e.abrupt("return",ce());case 2:if(r&&t&&n&&o){e.next=4;break}return e.abrupt("return",null);case 4:return a={TableName:r,Key:t,UpdateExpression:n,ExpressionAttributeValues:o},u&&(a=ne(ne({},a),{},{ExpressionAttributeNames:u})),c=new Y.UpdateCommand(a),e.prev=7,e.next=10,re.dbDocClient.send(c);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("UpdateCommandInput:",a),console.error(e.t0),e.abrupt("return",null);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t,n,o,u){return e.apply(this,arguments)}}(),de=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient){e.next=2;break}return e.abrupt("return",ce());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return u=null,a={TableName:r,Key:t},n&&(a=ne(ne({},a),{},{ProjectionExpression:n})),o&&(a=ne(ne({},a),{},{ExpressionAttributeNames:o})),c=new Y.GetCommand(a),e.prev=9,e.next=12,re.dbDocClient.send(c);case 12:i=e.sent,(s=i.Item)&&(u=s),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),console.error("GetCommandInput:",a),console.error(e.t0);case 21:return e.abrupt("return",u);case 22:case"end":return e.stop()}}),e,null,[[9,17]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),be=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i,s,l,p,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=f.length>4&&void 0!==f[4]?f[4]:"",a=f.length>5&&void 0!==f[5]&&f[5],re.dbDocClient){e.next=4;break}return e.abrupt("return",ce());case 4:if(r&&n&&o){e.next=6;break}return e.abrupt("return",null);case 6:return c=null,i={TableName:r,KeyConditionExpression:n,ExpressionAttributeValues:o},t&&(i=ne(ne({},i),{},{IndexName:t})),u&&(i=ne(ne({},i),{},{ProjectionExpression:u})),a&&(i=ne(ne({},i),{},{ScanIndexForward:!1})),s=new Y.QueryCommand(i),e.prev=12,e.next=15,re.dbDocClient.send(s);case 15:l=e.sent,(p=l.Items)&&(c=p),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),console.error("QueryCommandInput:",s.input),console.error(e.t0);case 24:return e.abrupt("return",c);case 25:case"end":return e.stop()}}),e,null,[[12,20]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),ve=function(){var e=ae(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>1&&void 0!==i[1]?i[1]:"",re.dbDocClient){e.next=3;break}return e.abrupt("return",ce());case 3:if(r){e.next=5;break}return e.abrupt("return",null);case 5:return n=null,o={TableName:r},t&&(o=ne(ne({},o),{},{ProjectionExpression:t})),u=new Y.ScanCommand(o),e.prev=9,e.next=12,re.dbDocClient.send(u);case 12:a=e.sent,(c=a.Items)&&(n=c),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),console.error("ScanCommandInput:",o),console.error(e.t0);case 21:return e.abrupt("return",n);case 22:case"end":return e.stop()}}),e,null,[[9,17]])})));return function(r){return e.apply(this,arguments)}}(),ye=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient){e.next=2;break}return e.abrupt("return",ce());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return n={TableName:r,Key:t},o=new Y.DeleteCommand(n),e.prev=6,e.next=9,re.dbDocClient.send(o);case 9:e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(6),console.error("DeleteCommandInput:",n),console.error(e.t0),e.abrupt("return",!1);case 16:return e.abrupt("return",!0);case 17:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(r,t){return e.apply(this,arguments)}}(),he=ie,xe=se,we=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(r,["init","status"]),je=function(e){return e?he(e):(E("AWS initialization error! Missing region: ".concat(e)),!1)},ge=function(){return xe()};const ke=require("@octokit/core");function Re(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}var qe=null,Oe=null,Ce=function(){throw new k("GitHub SDK is possibly uninitialized!",{name:"GitHubError"})},De=function(e,r){e&&r?(qe=new ke.Octokit({auth:e}),Oe=r):E("GitHub initialization error! authToken: ".concat(!!e,", account: ").concat(!!r))},Se=function(){var e,r=(e=regeneratorRuntime.mark((function e(r,t){var n,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(qe&&Oe){e.next=2;break}return e.abrupt("return",Ce());case 2:return e.prev=2,e.next=5,qe.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:Oe,repo:r,path:t});case 5:return n=e.sent,o=n.data,u=n.headers,e.abrupt("return",{response:o,headers:u});case 11:e.prev=11,e.t0=e.catch(2),E("[ERROR:gh.getContent]",e.t0);case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){Re(u,n,o,a,c,"next",e)}function c(e){Re(u,n,o,a,c,"throw",e)}a(void 0)}))});return function(e,t){return r.apply(this,arguments)}}();const Ee={fs:e,aws:o,gh:u}})(),module.exports=n})();
|
|
1
|
+
(()=>{"use strict";var e={76:e=>{e.exports=require("rimraf")}},r={};function t(n){var o=r[n];if(void 0!==o)return o.exports;var u=r[n]={exports:{}};return e[n](u,u.exports,t),u.exports}t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{t.r(n),t.d(n,{aws:()=>o,default:()=>Ee,fs:()=>e,gh:()=>u});var e={};t.r(e),t.d(e,{appendToFile:()=>Q,createDir:()=>$,deleteDir:()=>L,deleteFile:()=>J,existsDirSync:()=>N,existsFileSync:()=>A,readDir:()=>B,readDirDirs:()=>z,readDirFiles:()=>K,readDirFilesRec:()=>H,readFile:()=>M,readFileSync:()=>G,renameFile:()=>V,writeFile:()=>W});var r={};t.r(r),t.d(r,{deleteItem:()=>ye,init:()=>ce,queryItems:()=>be,readItem:()=>me,scanItems:()=>ve,status:()=>ie,updateItem:()=>de,writeItem:()=>fe,writeItemForce:()=>pe});var o={};t.r(o),t.d(o,{db:()=>we,init:()=>je,status:()=>ge});var u={};t.r(u),t.d(u,{getContent:()=>Se,init:()=>Oe}),require("regenerator-runtime/runtime.js"),require("core-js/modules/es.string.starts-with.js"),require("core-js/modules/es.array.for-each.js"),require("core-js/modules/web.dom-collections.for-each.js"),require("core-js/modules/es.array.concat.js"),require("core-js/modules/es.array.map.js"),require("core-js/modules/es.array.iterator.js"),require("core-js/modules/es.object.to-string.js"),require("core-js/modules/es.promise.js"),require("core-js/modules/es.string.iterator.js"),require("core-js/modules/web.dom-collections.iterator.js"),require("core-js/modules/es.array.last-index-of.js"),require("core-js/modules/es.symbol.js"),require("core-js/modules/es.symbol.description.js"),require("core-js/modules/es.symbol.iterator.js"),require("core-js/modules/es.array.from.js"),require("core-js/modules/es.array.slice.js");const a=require("path");var c=t.n(a);const i=require("util");var s=t.n(i);const l=require("fs");var p=t.n(l);const f=require("fs/promises");var d=t.n(f);function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function v(e,r){if(r&&("object"===m(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return y(e)}function y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var r="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return x(e,arguments,g(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),j(n,e)},h(e)}function x(e,r,t){return x=w()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&j(o,t.prototype),o},x.apply(null,arguments)}function w(){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(e){return!1}}function j(e,r){return j=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},j(e,r)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}require("core-js/modules/es.object.set-prototype-of.js"),require("core-js/modules/es.object.get-prototype-of.js"),require("core-js/modules/es.array.index-of.js"),require("core-js/modules/es.regexp.to-string.js"),require("core-js/modules/es.reflect.construct.js"),require("core-js/modules/es.map.js"),require("core-js/modules/esnext.map.delete-all.js"),require("core-js/modules/esnext.map.every.js"),require("core-js/modules/esnext.map.filter.js"),require("core-js/modules/esnext.map.find.js"),require("core-js/modules/esnext.map.find-key.js"),require("core-js/modules/esnext.map.includes.js"),require("core-js/modules/esnext.map.key-of.js"),require("core-js/modules/esnext.map.map-keys.js"),require("core-js/modules/esnext.map.map-values.js"),require("core-js/modules/esnext.map.merge.js"),require("core-js/modules/esnext.map.reduce.js"),require("core-js/modules/esnext.map.some.js"),require("core-js/modules/esnext.map.update.js");var k=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&j(e,r)}(o,e);var r,t,n=(r=o,t=w(),function(){var e,n=g(r);if(t){var o=g(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return v(this,e)});function o(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(this,o),r=n.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(y(r),o),r.name=t.name||"CustomError",r}return o}(h(Error));const R=require("chalk");var C=t.n(R);function q(e){return q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},q(e)}console.log;var D=console.warn,O=console.error;"undefined"===("undefined"==typeof window?"undefined":q(window))&&(D=function(){return console.warn(C().yellow.apply(C(),arguments))},O=function(){return console.error(C().red.apply(C(),arguments))});var S=D,E=O;function P(e){return function(e){if(Array.isArray(e))return I(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return I(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?I(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function F(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}function T(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){F(u,n,o,a,c,"next",e)}function c(e){F(u,n,o,a,c,"throw",e)}a(void 0)}))}}var _=function(e){return!e||e.startsWith("/")?e:c().resolve(process.cwd(),e)},A=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=_(e);try{if(!p().existsSync(e)){if(!r)return!1;throw new k("File does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof k?t:new k("Error while accessing file: ".concat(e))}return!0},N=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=_(e);try{if(!p().existsSync(e)){if(!r)return!1;throw new k("Directory does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof k?t:new k("Error while accessing directory: ".concat(e))}return!0},M=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>1&&void 0!==o[1]&&o[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),n=null,e.prev=5,e.next=8,d().readFile(r,"utf8");case 8:n=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),t&&S("Cannot read file: ".concat(r));case 14:return e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(r){return e.apply(this,arguments)}}(),G=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;e=_(e);var t=null;try{t=p().readFileSync(e,"utf8")}catch(t){r&&S("Cannot read file: ".concat(e))}return t},B=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>1&&void 0!==u[1]&&u[1],r){e.next=3;break}return e.abrupt("return",{dirs:null,files:null});case 3:return r=_(r),n=null,o=null,e.prev=6,e.next=9,d().readdir(r,{withFileTypes:!0});case 9:e.sent.forEach((function(e){e.isDirectory()?o?o.push(e.name):o=[e.name]:e.isFile()&&(n?n.push(e.name):n=[e.name])})),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t&&S("Cannot read dir: ".concat(r));case 16:return e.abrupt("return",{dirs:o,files:n});case 17:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(r){return e.apply(this,arguments)}}(),K=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),e.next=6,B(r,t);case 6:return e.abrupt("return",e.sent.files);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),z=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),e.next=6,B(r,t);case 6:return e.abrupt("return",e.sent.dirs);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),U=function(){var e=T(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,i,s,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>1&&void 0!==l[1]?l[1]:"",r){e.next=3;break}return e.abrupt("return",null);case 3:return r=_(r),n=t?"".concat(r,"/").concat(t):r,e.next=7,B(n);case 7:return o=e.sent,u=o.dirs,a=o.files,c=(c=a||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),i=(u||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),s=i.map((function(e){return U(r,e)})),e.next=16,Promise.all(s);case 16:return e.sent.forEach((function(e){e&&(c=[].concat(P(c),P(e)))})),e.abrupt("return",c.length?c:null);case 19:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),H=function(e){return U(e)},W=function(){var e=T(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,d().mkdir(n,{recursive:!0});case 7:return e.next=9,d().writeFile(r,t);case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while writing to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),Q=function(){var e=T(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,d().mkdir(n,{recursive:!0});case 7:return e.next=9,d().appendFile(r,t+"\n");case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while appending to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),V=function(){var e=T(regeneratorRuntime.mark((function e(r,t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),t=_(t),e.prev=4,e.next=7,d().rename(r,t);case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.error("Error while renaming file ".concat(r," to ").concat(t),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(r,t){return e.apply(this,arguments)}}(),$=function(){var e=T(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:if(r=_(r),e.prev=3,N(r)){e.next=7;break}return e.next=7,d().mkdir(r,{recursive:!0});case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),console.error("Error while creating directory: ".concat(r),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(r){return e.apply(this,arguments)}}(),J=function(){var e=T(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,e.next=6,d().unlink(r);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),console.error("Error while deleting file ".concat(r),e.t0),e.abrupt("return",!1);case 12:return e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(r){return e.apply(this,arguments)}}(),L=function(){var e=T(regeneratorRuntime.mark((function e(r){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=_(r),e.prev=3,n=t(76),o=s().promisify(n),e.next=8,o(r);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(3),console.error("Error while deleting dir ".concat(r),e.t0),e.abrupt("return",!1);case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(r){return e.apply(this,arguments)}}();require("core-js/modules/es.object.keys.js"),require("core-js/modules/es.array.filter.js"),require("core-js/modules/es.object.get-own-property-descriptor.js"),require("core-js/modules/es.object.get-own-property-descriptors.js");const X=require("@aws-sdk/client-dynamodb"),Y=require("@aws-sdk/lib-dynamodb"),Z=require("short-uuid");var ee=t.n(Z);const re={dbDocClient:null,id:null};function te(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function ne(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?te(Object(t),!0).forEach((function(r){oe(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):te(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function oe(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ue(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}function ae(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){ue(u,n,o,a,c,"next",e)}function c(e){ue(u,n,o,a,c,"throw",e)}a(void 0)}))}}var ce=function(e){var r=new X.DynamoDBClient({region:e});return!re.dbDocClient&&(re.dbDocClient=Y.DynamoDBDocumentClient.from(r),re.id=ee().uuid(),!0)},ie=function(){return re.id},se=function(){if(!ie()){var e=process.env.AWS_REGION||"";if(!e||!ce(e))throw new k("Could not auto-initialize DynamoDB!",{name:"DynamoDBError"})}},le=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient||se(),re.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return t[n]||(t[n]=ee().uuid()),u={TableName:r,Item:t,ConditionExpression:"attribute_not_exists(".concat(n,")")},a=new Y.PutCommand(u),c=3,e.prev=9,e.next=12,re.dbDocClient.send(a);case 12:e.next=26;break;case 14:if(e.prev=14,e.t0=e.catch(9),"ConditionalCheckFailedException"!==e.t0.name){e.next=25;break}if(!(o<c-1)){e.next=23;break}return t[n]=ee().uuid(),e.next=21,le(r,t,n,o+1);case 21:return i=e.sent,e.abrupt("return",i);case 23:console.error("PutCommandInput:",u),console.error("[ERROR] Maximum attempts overflow!");case 25:return e.abrupt("return",null);case 26:return e.abrupt("return",t);case 27:case"end":return e.stop()}}),e,null,[[9,14]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),pe=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"id",e.abrupt("return",le(r,t,n,0));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),fe=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient||se(),re.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return n={TableName:r,Item:t},o=new Y.PutCommand(n),e.prev=7,e.next=10,re.dbDocClient.send(o);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("PutCommandInput:",n),console.error(e.t0),e.abrupt("return",null);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t){return e.apply(this,arguments)}}(),de=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o,u){var a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient||se(),re.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t&&n&&o){e.next=5;break}return e.abrupt("return",null);case 5:return a={TableName:r,Key:t,UpdateExpression:n,ExpressionAttributeValues:o},u&&(a=ne(ne({},a),{},{ExpressionAttributeNames:u})),c=new Y.UpdateCommand(a),e.prev=8,e.next=11,re.dbDocClient.send(c);case 11:e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(8),console.error("UpdateCommandInput:",a),console.error(e.t0),e.abrupt("return",null);case 18:return e.abrupt("return",!0);case 19:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(r,t,n,o,u){return e.apply(this,arguments)}}(),me=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient||se(),re.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return u=null,a={TableName:r,Key:t},n&&(a=ne(ne({},a),{},{ProjectionExpression:n})),o&&(a=ne(ne({},a),{},{ExpressionAttributeNames:o})),c=new Y.GetCommand(a),e.prev=10,e.next=13,re.dbDocClient.send(c);case 13:i=e.sent,(s=i.Item)&&(u=s),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(10),console.error("GetCommandInput:",a),console.error(e.t0);case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),be=function(){var e=ae(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,i,s,l,p,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=f.length>4&&void 0!==f[4]?f[4]:"",a=f.length>5&&void 0!==f[5]&&f[5],re.dbDocClient||se(),re.dbDocClient){e.next=5;break}return e.abrupt("return",null);case 5:if(r&&n&&o){e.next=7;break}return e.abrupt("return",null);case 7:return c=null,i={TableName:r,KeyConditionExpression:n,ExpressionAttributeValues:o},t&&(i=ne(ne({},i),{},{IndexName:t})),u&&(i=ne(ne({},i),{},{ProjectionExpression:u})),a&&(i=ne(ne({},i),{},{ScanIndexForward:!1})),s=new Y.QueryCommand(i),e.prev=13,e.next=16,re.dbDocClient.send(s);case 16:l=e.sent,(p=l.Items)&&(c=p),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(13),console.error("QueryCommandInput:",s.input),console.error(e.t0);case 25:return e.abrupt("return",c);case 26:case"end":return e.stop()}}),e,null,[[13,21]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),ve=function(){var e=ae(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>1&&void 0!==i[1]?i[1]:"",re.dbDocClient||se(),re.dbDocClient){e.next=4;break}return e.abrupt("return",null);case 4:if(r){e.next=6;break}return e.abrupt("return",null);case 6:return n=null,o={TableName:r},t&&(o=ne(ne({},o),{},{ProjectionExpression:t})),u=new Y.ScanCommand(o),e.prev=10,e.next=13,re.dbDocClient.send(u);case 13:a=e.sent,(c=a.Items)&&(n=c),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(10),console.error("ScanCommandInput:",o),console.error(e.t0);case 22:return e.abrupt("return",n);case 23:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(r){return e.apply(this,arguments)}}(),ye=function(){var e=ae(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(re.dbDocClient||se(),re.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return n={TableName:r,Key:t},o=new Y.DeleteCommand(n),e.prev=7,e.next=10,re.dbDocClient.send(o);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("DeleteCommandInput:",n),console.error(e.t0),e.abrupt("return",!1);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t){return e.apply(this,arguments)}}(),he=ce,xe=ie,we=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(r,["init","status"]),je=function(e){return e?he(e):(E("AWS initialization error! Missing region: ".concat(e)),!1)},ge=function(){return xe()};const ke=require("@octokit/core");function Re(e,r,t,n,o,u,a){try{var c=e[u](a),i=c.value}catch(e){return void t(e)}c.done?r(i):Promise.resolve(i).then(n,o)}var Ce=null,qe=null,De=function(){throw new k("GitHub SDK is possibly uninitialized!",{name:"GitHubError"})},Oe=function(e,r){e&&r?(Ce=new ke.Octokit({auth:e}),qe=r):E("GitHub initialization error! authToken: ".concat(!!e,", account: ").concat(!!r))},Se=function(){var e,r=(e=regeneratorRuntime.mark((function e(r,t){var n,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Ce&&qe){e.next=2;break}return e.abrupt("return",De());case 2:return e.prev=2,e.next=5,Ce.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:qe,repo:r,path:t});case 5:return n=e.sent,o=n.data,u=n.headers,e.abrupt("return",{response:o,headers:u});case 11:e.prev=11,e.t0=e.catch(2),E("[ERROR:gh.getContent]",e.t0);case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){Re(u,n,o,a,c,"next",e)}function c(e){Re(u,n,o,a,c,"throw",e)}a(void 0)}))});return function(e,t){return r.apply(this,arguments)}}();const Ee={fs:e,aws:o,gh:u}})(),module.exports=n})();
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"iCAAAA,EAAOC,QAAUC,QAAQ,YCCrBC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,QCpBfG,EAAoBK,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAACX,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAKzB,IACH,oBAAX0B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAejB,EAAS0B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAejB,EAAS,aAAc,CAAE4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AAM,6CAAD,OAA8C8D,KAC5C,IAMLM,GAAS,WACb,OAAO8C,MCfT,MAAM,GAA+BzJ,QAAQ,iB,0HCK7C,IAAI2J,GAAyB,KACzBC,GAAuB,KAIrBzD,GAAsB,WAC1B,MAHmC,IAAIvE,EAGrB,wCAHsC,CAAEK,KAAM,iBAWrDmE,GAAO,SAACyD,EAAmBC,GACjCD,GAAcC,GAInBH,GAAS,IAAII,GAAAA,QAAQ,CAAEC,KAAMH,IAC7BD,GAAQE,GAJNvH,EAAM,2CAAD,SAA8CsH,EAA9C,wBAAuEC,KAanEG,GAAU,e,EAAA,G,EAAA,yBAAG,WAAOC,EAAcrH,GAArB,6FACnB8G,IAAWC,GADQ,yCACMzD,MADN,gCAIDwD,GAAOQ,QAAQ,4CAA6C,CAC/EP,MAAAA,GACAM,KAAAA,EACArH,KAAAA,IAPoB,cAIhBuH,EAJgB,OAShBC,EAAWD,EAAOtD,KAChBwD,EAAYF,EAAZE,QAVc,kBAWf,CAAED,SAAAA,EAAUC,QAAAA,IAXG,kCAatB/H,EAAM,wBAAD,MAbiB,iCAgBjB,MAhBiB,yD,iLAAH,wDC5BvB,UAAiBY,GAAAA,EAAIoH,IAAAA,EAAKC,GAAAA,I","sources":["webpack://@baadal-sdk/dapi/external commonjs \"rimraf\"","webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/compat get default export","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/external commonjs \"regenerator-runtime/runtime.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.starts-with.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.concat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.promise.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.last-index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.description.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.from.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.slice.js\"","webpack://@baadal-sdk/dapi/external node-commonjs \"path\"","webpack://@baadal-sdk/dapi/external node-commonjs \"util\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs/promises\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.set-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.reflect.construct.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.delete-all.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find-key.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.includes.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.key-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-values.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.merge.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.reduce.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.some.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.update.js\"","webpack://@baadal-sdk/dapi/./src/common/error.ts","webpack://@baadal-sdk/dapi/external commonjs \"chalk\"","webpack://@baadal-sdk/dapi/./src/common/logger.ts","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptor.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptors.js\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/client-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/lib-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"short-uuid\"","webpack://@baadal-sdk/dapi/./src/aws/db-client.ts","webpack://@baadal-sdk/dapi/./src/aws/db.ts","webpack://@baadal-sdk/dapi/./src/aws/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"@octokit/core\"","webpack://@baadal-sdk/dapi/./src/gh/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["module.exports = require(\"rimraf\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"regenerator-runtime/runtime.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.starts-with.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.concat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.promise.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.last-index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.description.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.from.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.slice.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"util\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs/promises\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.set-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.reflect.construct.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.delete-all.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find-key.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.includes.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.key-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-values.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.merge.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.reduce.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.some.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.update.js\");","export class CustomError extends Error {\n constructor(message: string, options: any = {}) {\n super(message);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CustomError);\n }\n\n this.name = options.name || 'CustomError';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"chalk\");","import chalk from 'chalk';\n\nlet clog = console.log;\nlet cwarn = console.warn;\nlet cerror = console.error;\n\nif (typeof window === typeof undefined) {\n clog = (...args: any[]) => console.log(chalk.green(...args));\n cwarn = (...args: any[]) => console.warn(chalk.yellow(...args));\n cerror = (...args: any[]) => console.error(chalk.red(...args));\n}\n\nconst log = clog;\nconst warn = cwarn;\nconst error = cerror;\n\nexport { log, warn, error };\nexport default { log, warn, error };\n","import path from 'path';\nimport util from 'util';\nimport fs from 'fs';\nimport fsa from 'fs/promises';\n\nimport { CustomError } from '../common/error';\nimport { warn as cwarn } from '../common/logger';\n\nconst assertPath = (p: string) => {\n if (!p || p.startsWith('/')) return p;\n return path.resolve(process.cwd(), p);\n};\n\n/**\n * Check whether a file exists\n * @param file file path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsFileSync = (file: string, loud = false) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n if (!fs.existsSync(file)) {\n if (!loud) return false;\n throw new CustomError(`File does not exist: ${file}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing file: ${file}`);\n }\n }\n return true;\n};\n\n/**\n * Check whether a directory exists\n * @param dir directory path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsDirSync = (dir: string, loud = false) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!fs.existsSync(dir)) {\n if (!loud) return false;\n throw new CustomError(`Directory does not exist: ${dir}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing directory: ${dir}`);\n }\n }\n return true;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFile = async (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = await fsa.readFile(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFileSync = (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = fs.readFileSync(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Get the list of files/directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns an object {dirs,files} containing list of directories & files\n */\nexport const readDir = async (dir: string, warn = false) => {\n if (!dir) return { dirs: null, files: null };\n dir = assertPath(dir);\n\n let files: string[] | null = null;\n let dirs: string[] | null = null;\n\n try {\n const items = await fsa.readdir(dir, { withFileTypes: true });\n items.forEach(item => {\n if (item.isDirectory()) {\n if (!dirs) {\n dirs = [item.name];\n } else {\n dirs.push(item.name);\n }\n } else if (item.isFile()) {\n if (!files) {\n files = [item.name];\n } else {\n files.push(item.name);\n }\n }\n });\n } catch (e) {\n if (warn) cwarn(`Cannot read dir: ${dir}`);\n }\n\n return { dirs, files } as { dirs: string[] | null; files: string[] | null };\n};\n\n/**\n * Get the list of files in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of files, null in case of error or no items\n */\nexport const readDirFiles = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).files;\n};\n\n/**\n * Get the list of directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of directories, null in case of error or no items\n */\nexport const readDirDirs = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).dirs;\n};\n\nconst readDirFilesRecHelper = async (dir: string, basePath = ''): Promise<string[] | null> => {\n if (!dir) return null;\n dir = assertPath(dir);\n\n const dirPath = basePath ? `${dir}/${basePath}` : dir;\n const { dirs, files } = await readDir(dirPath);\n let allFiles: string[] = files || [];\n allFiles = allFiles.map(file => (basePath ? `${basePath}/${file}` : file));\n const absDirs = (dirs || []).map(d => (basePath ? `${basePath}/${d}` : d));\n\n const pList = absDirs.map(dirx => readDirFilesRecHelper(dir, dirx));\n const filesxList = await Promise.all(pList);\n filesxList.forEach(filesx => {\n if (filesx) {\n allFiles = [...allFiles, ...filesx];\n }\n });\n\n return allFiles.length ? allFiles : null;\n};\n\n/**\n * Get the (recursive) list of files in a directory\n * @param dir directory path\n * @returns complete (recursive) list of files, null in case of error or no items\n */\nexport const readDirFilesRec = (dir: string) => readDirFilesRecHelper(dir);\n\n/**\n * Write contents to a file (creates the file path if it doesn't exist)\n * @param file file path\n * @param contents contents to write\n * @returns true if successful, false on error\n */\nexport const writeFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n await fsa.writeFile(file, contents);\n } catch (e) {\n console.error(`Error while writing to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Append contents to a file\n * @param file file path\n * @param contents contents to append\n * @returns true if successful, false on error\n */\nexport const appendToFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n\n await fsa.appendFile(file, contents + '\\n');\n\n // Ref: https://stackoverflow.com/a/43370201\n // const stream = fs.createWriteStream(file, { flags: 'a' });\n // stream.write(contents + '\\n');\n // stream.end();\n } catch (e) {\n console.error(`Error while appending to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Rename a file\n * @param oldpath old file path\n * @param newpath new file path\n * @returns true if successful, false on error\n */\nexport const renameFile = async (oldpath: string, newpath: string) => {\n if (!oldpath || !newpath) return false;\n oldpath = assertPath(oldpath);\n newpath = assertPath(newpath);\n try {\n await fsa.rename(oldpath, newpath);\n } catch (e) {\n console.error(`Error while renaming file ${oldpath} to ${newpath}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Create a directory, if it doesn't exist\n * @param dir directory path\n * @returns true if successful, false in case of failure\n */\nexport const createDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!existsDirSync(dir)) {\n await fsa.mkdir(dir, { recursive: true });\n }\n } catch (e) {\n console.error(`Error while creating directory: ${dir}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a file\n * @param file file path\n * @returns true if successful, false on error\n */\nexport const deleteFile = async (file: string) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n await fsa.unlink(file);\n } catch (e) {\n console.error(`Error while deleting file ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a directory\n * @param dir directory path\n * @returns true if successful, false on error\n */\nexport const deleteDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n const rimraf = require('rimraf');\n const rimrafPr = util.promisify(rimraf);\n await rimrafPr(dir);\n\n // Added in: v14.14.0\n // await fsa.rm(dir, { recursive: true, force: true });\n } catch (e) {\n console.error(`Error while deleting dir ${dir}`, e);\n return false;\n }\n return true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptor.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptors.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/client-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/lib-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"short-uuid\");","import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';\n\nconst dbDocClient: DynamoDBDocumentClient | null = null;\nconst id: string | null = null;\n\nexport default { dbDocClient, id } as { dbDocClient: DynamoDBDocumentClient | null; id: string | null };\n","/**\n * Partition key vs Composite primary key:\n * Ref: https://aws.amazon.com/premiumsupport/knowledge-center/primary-key-dynamodb-table/\n */\n\nimport { DynamoDBClient } from '@aws-sdk/client-dynamodb';\nimport {\n DynamoDBDocumentClient,\n GetCommand,\n GetCommandInput,\n PutCommand,\n PutCommandInput,\n UpdateCommand,\n UpdateCommandInput,\n QueryCommand,\n QueryCommandInput,\n ScanCommand,\n ScanCommandInput,\n DeleteCommand,\n DeleteCommandInput,\n} from '@aws-sdk/lib-dynamodb';\nimport short from 'short-uuid';\n\nimport dbClient from './db-client';\nimport { StringIndexable } from '../common/common.model';\nimport { CustomError } from '../common/error';\n\nconst DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });\n\nconst initializationError = () => {\n throw DynamoDBError('DynamoDB is possibly uninitialized!');\n};\n\nexport const init = (region: string) => {\n const dydbClient = new DynamoDBClient({ region });\n\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#configuration\n if (!dbClient.dbDocClient) {\n dbClient.dbDocClient = DynamoDBDocumentClient.from(dydbClient);\n dbClient.id = short.uuid();\n return true;\n }\n return false;\n};\n\nexport const status = () => dbClient.id;\n\nconst writeItemForceHelper = async <T = any>(table: string, data: T, key: string, i: number): Promise<T | null> => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !data) return null;\n\n if (!(data as any)[key]) {\n (data as any)[key] = short.uuid();\n }\n const cmdParams: PutCommandInput = { TableName: table, Item: data, ConditionExpression: `attribute_not_exists(${key})` };\n const command = new PutCommand(cmdParams);\n const numberOfAttempts = 3;\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err: any) {\n // console.error('PutCommandInput:', cmdParams);\n // console.error(err);\n if (err.name === 'ConditionalCheckFailedException') {\n if (i < numberOfAttempts - 1) {\n (data as any)[key] = short.uuid(); // new primary key\n const ret: T | null = await writeItemForceHelper(table, data, key, i + 1);\n return ret;\n }\n console.error('PutCommandInput:', cmdParams);\n console.error('[ERROR] Maximum attempts overflow!');\n }\n return null;\n }\n\n return data;\n};\n\nexport const writeItemForce = async <T = any>(table: string, data: T, key = 'id'): Promise<T | null> => {\n return writeItemForceHelper<T>(table, data, key, 0);\n};\n\nexport const writeItem = async (table: string, data: StringIndexable) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !data) return null;\n\n const cmdParams: PutCommandInput = { TableName: table, Item: data };\n const command = new PutCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('PutCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const updateItem = async (\n table: string,\n key: StringIndexable,\n update: string,\n attr: StringIndexable,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key || !update || !attr) return null;\n\n let cmdParams: UpdateCommandInput = {\n TableName: table,\n Key: key,\n UpdateExpression: update,\n ExpressionAttributeValues: attr,\n };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n const command = new UpdateCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('UpdateCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const readItem = async <T = any>(\n table: string,\n key: StringIndexable,\n projection?: string,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key) return null;\n\n let contents: T | null = null;\n let cmdParams: GetCommandInput = { TableName: table, Key: key };\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ProjectionExpressions.html\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n\n const command = new GetCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const item = results.Item;\n\n if (item) {\n contents = item as T;\n }\n } catch (err) {\n console.error('GetCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const queryItems = async (\n table: string,\n indexName: string,\n cond: string,\n attr: StringIndexable,\n projection = '',\n desc = false\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !cond || !attr) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.Indexes.QueryAndScan.html#SQLtoNoSQL.Indexes.QueryAndScan.DynamoDB\n let cmdParams: QueryCommandInput = {\n TableName: table,\n KeyConditionExpression: cond,\n ExpressionAttributeValues: attr,\n // FilterExpression: \"contains (category_id, :cid)\",\n };\n\n if (indexName) cmdParams = { ...cmdParams, IndexName: indexName };\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (desc) cmdParams = { ...cmdParams, ScanIndexForward: false };\n\n const command = new QueryCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('QueryCommandInput:', command.input);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const scanItems = async (table: string, projection = '') => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n let cmdParams: ScanCommandInput = {\n TableName: table,\n };\n\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n\n const command = new ScanCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('ScanCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const deleteItem = async (table: string, key: StringIndexable) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key) return null;\n\n const cmdParams: DeleteCommandInput = { TableName: table, Key: key };\n const command = new DeleteCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('DeleteCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n return false;\n }\n\n return true;\n};\n\n// ----------------\n\n// await dbWriteItem('lesson_list', { id: 'id_001', title: 'My Lesson' });\n\n// const contents = await dbReadItem('lesson_list', { id: 'id_001' });\n// console.log(contents);\n\n// await dbUpdateItem(\n// 'lesson_list',\n// { id: 'id_001' },\n// 'set #a = :a, #b = :b',\n// { ':a': 'abhi@raj.me', ':b': 'Abhishek Raj' },\n// { '#a': 'email', '#b': 'name' }\n// );\n\n// ----------------\n","import * as dbAll from './db';\nimport { error } from '../common/logger';\n\nconst { init: dbInit, status: dbStatus, ...db } = dbAll;\n\nconst init = (region: string) => {\n if (!region) {\n error(`AWS initialization error! Missing region: ${region}`);\n return false;\n }\n\n return dbInit(region);\n};\n\nconst status = () => {\n return dbStatus();\n};\n\nexport { db, init, status }; // named exports\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@octokit/core\");","import { Octokit } from '@octokit/core';\n\nimport { CustomError } from '../common/error';\nimport { error } from '../common/logger';\n\nlet github: Octokit | null = null;\nlet owner: string | null = null;\n\nconst GitHubError = (msg: string) => new CustomError(msg, { name: 'GitHubError' });\n\nconst initializationError = () => {\n throw GitHubError('GitHub SDK is possibly uninitialized!');\n};\n\n/**\n * Initialize GitHub SDK\n * @param authToken GitHub auth token for the user account [GITHUB_TOKEN]\n * @param account account id for the GitHub user account [GITHUB_ACCOUNT]\n */\nexport const init = (authToken: string, account: string) => {\n if (!authToken || !account) {\n error(`GitHub initialization error! authToken: ${!!authToken}, account: ${!!account}`);\n return;\n }\n github = new Octokit({ auth: authToken });\n owner = account;\n};\n\n/**\n * Get contents of a particular file in a repo\n * @param repo name of the repo\n * @param path path of a file in the repo\n * @returns an object {response,headers} containing response and response headers, null in case of error\n */\nexport const getContent = async (repo: string, path: string) => {\n if (!github || !owner) return initializationError();\n\n try {\n const ghResp = await github.request('GET /repos/{owner}/{repo}/contents/{path}', {\n owner,\n repo,\n path,\n });\n const response = ghResp.data as GitHubContent;\n const { headers } = ghResp;\n return { response, headers };\n } catch (e) {\n error(`[ERROR:gh.getContent]`, e);\n }\n\n return null;\n};\n\n// --------------\n\nexport interface GitHubContent {\n path: string;\n content: string;\n sha: string;\n}\n","import * as fs from './fs';\nimport * as aws from './aws';\nimport * as gh from './gh';\n\n// Ref: https://stackoverflow.com/a/41283945\nexport { fs, aws, gh }; // named exports\nexport default { fs, aws, gh }; // default export\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","CustomError","message","options","Error","captureStackTrace","name","console","log","cwarn","warn","cerror","error","window","chalk","assertPath","p","startsWith","path","process","cwd","existsFileSync","file","loud","fs","e","existsDirSync","dir","readFile","contents","fsa","readFileSync","readDir","dirs","files","withFileTypes","forEach","item","isDirectory","push","isFile","readDirFiles","readDirDirs","readDirFilesRecHelper","basePath","dirPath","allFiles","map","absDirs","pList","dirx","Promise","all","filesx","length","readDirFilesRec","writeFile","substring","lastIndexOf","recursive","appendToFile","renameFile","oldpath","newpath","createDir","deleteFile","deleteDir","rimraf","rimrafPr","util","dbDocClient","id","initializationError","init","region","dydbClient","DynamoDBClient","dbClient","DynamoDBDocumentClient","short","status","writeItemForceHelper","table","data","i","cmdParams","TableName","Item","ConditionExpression","command","PutCommand","numberOfAttempts","ret","writeItemForce","writeItem","updateItem","update","attr","attrNames","Key","UpdateExpression","ExpressionAttributeValues","ExpressionAttributeNames","UpdateCommand","readItem","projection","ProjectionExpression","GetCommand","results","queryItems","indexName","cond","desc","KeyConditionExpression","IndexName","ScanIndexForward","QueryCommand","items","Items","input","scanItems","ScanCommand","deleteItem","DeleteCommand","dbInit","dbAll","dbStatus","db","github","owner","authToken","account","Octokit","auth","getContent","repo","request","ghResp","response","headers","aws","gh"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":"iCAAA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B,WAC1B,MAHmC,IAAInI,EAGrB,wCAHsC,CAAEK,KAAM,iBAWrDkE,GAAO,SAAC6D,EAAmBC,GACjCD,GAAcC,GAInBJ,GAAS,IAAIK,GAAAA,QAAQ,CAAEC,KAAMH,IAC7BF,GAAQG,GAJN1H,EAAM,2CAAD,SAA8CyH,EAA9C,wBAAuEC,KAanEG,GAAU,e,EAAA,G,EAAA,yBAAG,WAAOC,EAAcxH,GAArB,6FACnBgH,IAAWC,GADQ,yCACMC,MADN,gCAIDF,GAAOS,QAAQ,4CAA6C,CAC/ER,MAAAA,GACAO,KAAAA,EACAxH,KAAAA,IAPoB,cAIhB0H,EAJgB,OAShBC,EAAWD,EAAOvD,KAChByD,EAAYF,EAAZE,QAVc,kBAWf,CAAED,SAAAA,EAAUC,QAAAA,IAXG,kCAatBlI,EAAM,wBAAD,MAbiB,iCAgBjB,MAhBiB,yD,iLAAH,wDC5BvB,UAAiBY,GAAAA,EAAIuH,IAAAA,EAAKC,GAAAA,I","sources":["webpack://@baadal-sdk/dapi/external commonjs \"rimraf\"","webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/compat get default export","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/external commonjs \"regenerator-runtime/runtime.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.starts-with.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.concat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.promise.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.last-index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.description.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.from.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.slice.js\"","webpack://@baadal-sdk/dapi/external node-commonjs \"path\"","webpack://@baadal-sdk/dapi/external node-commonjs \"util\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs/promises\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.set-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.reflect.construct.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.delete-all.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find-key.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.includes.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.key-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-values.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.merge.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.reduce.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.some.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.update.js\"","webpack://@baadal-sdk/dapi/./src/common/error.ts","webpack://@baadal-sdk/dapi/external commonjs \"chalk\"","webpack://@baadal-sdk/dapi/./src/common/logger.ts","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptor.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptors.js\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/client-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/lib-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"short-uuid\"","webpack://@baadal-sdk/dapi/./src/aws/db-client.ts","webpack://@baadal-sdk/dapi/./src/aws/db.ts","webpack://@baadal-sdk/dapi/./src/aws/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"@octokit/core\"","webpack://@baadal-sdk/dapi/./src/gh/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["module.exports = require(\"rimraf\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"regenerator-runtime/runtime.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.starts-with.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.concat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.promise.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.last-index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.description.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.from.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.slice.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"util\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"fs/promises\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.set-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.reflect.construct.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.delete-all.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find-key.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.includes.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.key-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-values.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.merge.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.reduce.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.some.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.update.js\");","export class CustomError extends Error {\n constructor(message: string, options: any = {}) {\n super(message);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CustomError);\n }\n\n this.name = options.name || 'CustomError';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"chalk\");","import chalk from 'chalk';\n\nlet clog = console.log;\nlet cwarn = console.warn;\nlet cerror = console.error;\n\nif (typeof window === typeof undefined) {\n clog = (...args: any[]) => console.log(chalk.green(...args));\n cwarn = (...args: any[]) => console.warn(chalk.yellow(...args));\n cerror = (...args: any[]) => console.error(chalk.red(...args));\n}\n\nconst log = clog;\nconst warn = cwarn;\nconst error = cerror;\n\nexport { log, warn, error };\nexport default { log, warn, error };\n","import path from 'path';\nimport util from 'util';\nimport fs from 'fs';\nimport fsa from 'fs/promises';\n\nimport { CustomError } from '../common/error';\nimport { warn as cwarn } from '../common/logger';\n\nconst assertPath = (p: string) => {\n if (!p || p.startsWith('/')) return p;\n return path.resolve(process.cwd(), p);\n};\n\n/**\n * Check whether a file exists\n * @param file file path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsFileSync = (file: string, loud = false) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n if (!fs.existsSync(file)) {\n if (!loud) return false;\n throw new CustomError(`File does not exist: ${file}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing file: ${file}`);\n }\n }\n return true;\n};\n\n/**\n * Check whether a directory exists\n * @param dir directory path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsDirSync = (dir: string, loud = false) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!fs.existsSync(dir)) {\n if (!loud) return false;\n throw new CustomError(`Directory does not exist: ${dir}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing directory: ${dir}`);\n }\n }\n return true;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFile = async (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = await fsa.readFile(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFileSync = (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = fs.readFileSync(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Get the list of files/directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns an object {dirs,files} containing list of directories & files\n */\nexport const readDir = async (dir: string, warn = false) => {\n if (!dir) return { dirs: null, files: null };\n dir = assertPath(dir);\n\n let files: string[] | null = null;\n let dirs: string[] | null = null;\n\n try {\n const items = await fsa.readdir(dir, { withFileTypes: true });\n items.forEach(item => {\n if (item.isDirectory()) {\n if (!dirs) {\n dirs = [item.name];\n } else {\n dirs.push(item.name);\n }\n } else if (item.isFile()) {\n if (!files) {\n files = [item.name];\n } else {\n files.push(item.name);\n }\n }\n });\n } catch (e) {\n if (warn) cwarn(`Cannot read dir: ${dir}`);\n }\n\n return { dirs, files } as { dirs: string[] | null; files: string[] | null };\n};\n\n/**\n * Get the list of files in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of files, null in case of error or no items\n */\nexport const readDirFiles = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).files;\n};\n\n/**\n * Get the list of directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of directories, null in case of error or no items\n */\nexport const readDirDirs = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).dirs;\n};\n\nconst readDirFilesRecHelper = async (dir: string, basePath = ''): Promise<string[] | null> => {\n if (!dir) return null;\n dir = assertPath(dir);\n\n const dirPath = basePath ? `${dir}/${basePath}` : dir;\n const { dirs, files } = await readDir(dirPath);\n let allFiles: string[] = files || [];\n allFiles = allFiles.map(file => (basePath ? `${basePath}/${file}` : file));\n const absDirs = (dirs || []).map(d => (basePath ? `${basePath}/${d}` : d));\n\n const pList = absDirs.map(dirx => readDirFilesRecHelper(dir, dirx));\n const filesxList = await Promise.all(pList);\n filesxList.forEach(filesx => {\n if (filesx) {\n allFiles = [...allFiles, ...filesx];\n }\n });\n\n return allFiles.length ? allFiles : null;\n};\n\n/**\n * Get the (recursive) list of files in a directory\n * @param dir directory path\n * @returns complete (recursive) list of files, null in case of error or no items\n */\nexport const readDirFilesRec = (dir: string) => readDirFilesRecHelper(dir);\n\n/**\n * Write contents to a file (creates the file path if it doesn't exist)\n * @param file file path\n * @param contents contents to write\n * @returns true if successful, false on error\n */\nexport const writeFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n await fsa.writeFile(file, contents);\n } catch (e) {\n console.error(`Error while writing to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Append contents to a file\n * @param file file path\n * @param contents contents to append\n * @returns true if successful, false on error\n */\nexport const appendToFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n\n await fsa.appendFile(file, contents + '\\n');\n\n // Ref: https://stackoverflow.com/a/43370201\n // const stream = fs.createWriteStream(file, { flags: 'a' });\n // stream.write(contents + '\\n');\n // stream.end();\n } catch (e) {\n console.error(`Error while appending to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Rename a file\n * @param oldpath old file path\n * @param newpath new file path\n * @returns true if successful, false on error\n */\nexport const renameFile = async (oldpath: string, newpath: string) => {\n if (!oldpath || !newpath) return false;\n oldpath = assertPath(oldpath);\n newpath = assertPath(newpath);\n try {\n await fsa.rename(oldpath, newpath);\n } catch (e) {\n console.error(`Error while renaming file ${oldpath} to ${newpath}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Create a directory, if it doesn't exist\n * @param dir directory path\n * @returns true if successful, false in case of failure\n */\nexport const createDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!existsDirSync(dir)) {\n await fsa.mkdir(dir, { recursive: true });\n }\n } catch (e) {\n console.error(`Error while creating directory: ${dir}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a file\n * @param file file path\n * @returns true if successful, false on error\n */\nexport const deleteFile = async (file: string) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n await fsa.unlink(file);\n } catch (e) {\n console.error(`Error while deleting file ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a directory\n * @param dir directory path\n * @returns true if successful, false on error\n */\nexport const deleteDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n const rimraf = require('rimraf');\n const rimrafPr = util.promisify(rimraf);\n await rimrafPr(dir);\n\n // Added in: v14.14.0\n // await fsa.rm(dir, { recursive: true, force: true });\n } catch (e) {\n console.error(`Error while deleting dir ${dir}`, e);\n return false;\n }\n return true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptor.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptors.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/client-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/lib-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"short-uuid\");","import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';\n\nconst dbDocClient: DynamoDBDocumentClient | null = null;\nconst id: string | null = null;\n\nexport default { dbDocClient, id } as { dbDocClient: DynamoDBDocumentClient | null; id: string | null };\n","/**\n * Partition key vs Composite primary key:\n * Ref: https://aws.amazon.com/premiumsupport/knowledge-center/primary-key-dynamodb-table/\n */\n\nimport { DynamoDBClient } from '@aws-sdk/client-dynamodb';\nimport {\n DynamoDBDocumentClient,\n GetCommand,\n GetCommandInput,\n PutCommand,\n PutCommandInput,\n UpdateCommand,\n UpdateCommandInput,\n QueryCommand,\n QueryCommandInput,\n ScanCommand,\n ScanCommandInput,\n DeleteCommand,\n DeleteCommandInput,\n} from '@aws-sdk/lib-dynamodb';\nimport short from 'short-uuid';\n\nimport dbClient from './db-client';\nimport { StringIndexable } from '../common/common.model';\nimport { CustomError } from '../common/error';\n\nconst DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });\n\nexport const init = (region: string) => {\n const dydbClient = new DynamoDBClient({ region });\n\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#configuration\n if (!dbClient.dbDocClient) {\n dbClient.dbDocClient = DynamoDBDocumentClient.from(dydbClient);\n dbClient.id = short.uuid();\n return true;\n }\n return false;\n};\n\nexport const status = () => dbClient.id;\n\nconst tryInit = () => {\n if (status()) return;\n const region = process.env.AWS_REGION || '';\n if (region) {\n if (init(region)) return;\n }\n // throw DynamoDBError('DynamoDB is possibly uninitialized!');\n throw DynamoDBError('Could not auto-initialize DynamoDB!');\n};\n\n// auto-initialize on load\n// tryInit();\n\nconst writeItemForceHelper = async <T = any>(table: string, data: T, key: string, i: number): Promise<T | null> => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !data) return null;\n\n if (!(data as any)[key]) {\n (data as any)[key] = short.uuid();\n }\n const cmdParams: PutCommandInput = { TableName: table, Item: data, ConditionExpression: `attribute_not_exists(${key})` };\n const command = new PutCommand(cmdParams);\n const numberOfAttempts = 3;\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err: any) {\n // console.error('PutCommandInput:', cmdParams);\n // console.error(err);\n if (err.name === 'ConditionalCheckFailedException') {\n if (i < numberOfAttempts - 1) {\n (data as any)[key] = short.uuid(); // new primary key\n const ret: T | null = await writeItemForceHelper(table, data, key, i + 1);\n return ret;\n }\n console.error('PutCommandInput:', cmdParams);\n console.error('[ERROR] Maximum attempts overflow!');\n }\n return null;\n }\n\n return data;\n};\n\nexport const writeItemForce = async <T = any>(table: string, data: T, key = 'id'): Promise<T | null> => {\n return writeItemForceHelper<T>(table, data, key, 0);\n};\n\nexport const writeItem = async (table: string, data: StringIndexable) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !data) return null;\n\n const cmdParams: PutCommandInput = { TableName: table, Item: data };\n const command = new PutCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('PutCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const updateItem = async (\n table: string,\n key: StringIndexable,\n update: string,\n attr: StringIndexable,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key || !update || !attr) return null;\n\n let cmdParams: UpdateCommandInput = {\n TableName: table,\n Key: key,\n UpdateExpression: update,\n ExpressionAttributeValues: attr,\n };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n const command = new UpdateCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('UpdateCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const readItem = async <T = any>(\n table: string,\n key: StringIndexable,\n projection?: string,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key) return null;\n\n let contents: T | null = null;\n let cmdParams: GetCommandInput = { TableName: table, Key: key };\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ProjectionExpressions.html\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n\n const command = new GetCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const item = results.Item;\n\n if (item) {\n contents = item as T;\n }\n } catch (err) {\n console.error('GetCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const queryItems = async (\n table: string,\n indexName: string,\n cond: string,\n attr: StringIndexable,\n projection = '',\n desc = false\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !cond || !attr) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.Indexes.QueryAndScan.html#SQLtoNoSQL.Indexes.QueryAndScan.DynamoDB\n let cmdParams: QueryCommandInput = {\n TableName: table,\n KeyConditionExpression: cond,\n ExpressionAttributeValues: attr,\n // FilterExpression: \"contains (category_id, :cid)\",\n };\n\n if (indexName) cmdParams = { ...cmdParams, IndexName: indexName };\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (desc) cmdParams = { ...cmdParams, ScanIndexForward: false };\n\n const command = new QueryCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('QueryCommandInput:', command.input);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const scanItems = async (table: string, projection = '') => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n let cmdParams: ScanCommandInput = {\n TableName: table,\n };\n\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n\n const command = new ScanCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('ScanCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const deleteItem = async (table: string, key: StringIndexable) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key) return null;\n\n const cmdParams: DeleteCommandInput = { TableName: table, Key: key };\n const command = new DeleteCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('DeleteCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n return false;\n }\n\n return true;\n};\n\n// ----------------\n\n// await dbWriteItem('lesson_list', { id: 'id_001', title: 'My Lesson' });\n\n// const contents = await dbReadItem('lesson_list', { id: 'id_001' });\n// console.log(contents);\n\n// await dbUpdateItem(\n// 'lesson_list',\n// { id: 'id_001' },\n// 'set #a = :a, #b = :b',\n// { ':a': 'abhi@raj.me', ':b': 'Abhishek Raj' },\n// { '#a': 'email', '#b': 'name' }\n// );\n\n// ----------------\n","import * as dbAll from './db';\nimport { error } from '../common/logger';\n\nconst { init: dbInit, status: dbStatus, ...db } = dbAll;\n\nconst init = (region: string) => {\n if (!region) {\n error(`AWS initialization error! Missing region: ${region}`);\n return false;\n }\n\n return dbInit(region);\n};\n\nconst status = () => {\n return dbStatus();\n};\n\nexport { db, init, status }; // named exports\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@octokit/core\");","import { Octokit } from '@octokit/core';\n\nimport { CustomError } from '../common/error';\nimport { error } from '../common/logger';\n\nlet github: Octokit | null = null;\nlet owner: string | null = null;\n\nconst GitHubError = (msg: string) => new CustomError(msg, { name: 'GitHubError' });\n\nconst initializationError = () => {\n throw GitHubError('GitHub SDK is possibly uninitialized!');\n};\n\n/**\n * Initialize GitHub SDK\n * @param authToken GitHub auth token for the user account [GITHUB_TOKEN]\n * @param account account id for the GitHub user account [GITHUB_ACCOUNT]\n */\nexport const init = (authToken: string, account: string) => {\n if (!authToken || !account) {\n error(`GitHub initialization error! authToken: ${!!authToken}, account: ${!!account}`);\n return;\n }\n github = new Octokit({ auth: authToken });\n owner = account;\n};\n\n/**\n * Get contents of a particular file in a repo\n * @param repo name of the repo\n * @param path path of a file in the repo\n * @returns an object {response,headers} containing response and response headers, null in case of error\n */\nexport const getContent = async (repo: string, path: string) => {\n if (!github || !owner) return initializationError();\n\n try {\n const ghResp = await github.request('GET /repos/{owner}/{repo}/contents/{path}', {\n owner,\n repo,\n path,\n });\n const response = ghResp.data as GitHubContent;\n const { headers } = ghResp;\n return { response, headers };\n } catch (e) {\n error(`[ERROR:gh.getContent]`, e);\n }\n\n return null;\n};\n\n// --------------\n\nexport interface GitHubContent {\n path: string;\n content: string;\n sha: string;\n}\n","import * as fs from './fs';\nimport * as aws from './aws';\nimport * as gh from './gh';\n\n// Ref: https://stackoverflow.com/a/41283945\nexport { fs, aws, gh }; // named exports\nexport default { fs, aws, gh }; // default export\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","CustomError","message","options","Error","captureStackTrace","name","console","log","cwarn","warn","cerror","error","window","chalk","assertPath","p","startsWith","path","process","cwd","existsFileSync","file","loud","fs","e","existsDirSync","dir","readFile","contents","fsa","readFileSync","readDir","dirs","files","withFileTypes","forEach","item","isDirectory","push","isFile","readDirFiles","readDirDirs","readDirFilesRecHelper","basePath","dirPath","allFiles","map","absDirs","pList","dirx","Promise","all","filesx","length","readDirFilesRec","writeFile","substring","lastIndexOf","recursive","appendToFile","renameFile","oldpath","newpath","createDir","deleteFile","deleteDir","rimraf","rimrafPr","util","dbDocClient","id","init","region","dydbClient","DynamoDBClient","dbClient","DynamoDBDocumentClient","short","status","tryInit","env","AWS_REGION","writeItemForceHelper","table","data","i","cmdParams","TableName","Item","ConditionExpression","command","PutCommand","numberOfAttempts","ret","writeItemForce","writeItem","updateItem","update","attr","attrNames","Key","UpdateExpression","ExpressionAttributeValues","ExpressionAttributeNames","UpdateCommand","readItem","projection","ProjectionExpression","GetCommand","results","queryItems","indexName","cond","desc","KeyConditionExpression","IndexName","ScanIndexForward","QueryCommand","items","Items","input","scanItems","ScanCommand","deleteItem","DeleteCommand","dbInit","dbAll","dbStatus","db","github","owner","initializationError","authToken","account","Octokit","auth","getContent","repo","request","ghResp","response","headers","aws","gh"],"sourceRoot":""}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as e}from"module";let r=e(import.meta.url);import{createRequire as t}from"module";var n={76:e=>{e.exports=r("rimraf")}},o={};function u(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,u),t.exports}u.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return u.d(r,{a:r}),r},u.d=(e,r)=>{for(var t in r)u.o(r,t)&&!u.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},u.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{u.d(a,{r:()=>o,Z:()=>Fe,fs:()=>e,gh:()=>c});var e={};u.r(e),u.d(e,{appendToFile:()=>Z,createDir:()=>J,deleteDir:()=>X,deleteFile:()=>L,existsDirSync:()=>G,existsFileSync:()=>B,readDir:()=>U,readDirDirs:()=>H,readDirFiles:()=>q,readDirFilesRec:()=>V,readFile:()=>K,readFileSync:()=>z,renameFile:()=>$,writeFile:()=>W});var n={};u.r(n),u.d(n,{deleteItem:()=>xe,init:()=>le,queryItems:()=>ye,readItem:()=>ve,scanItems:()=>he,status:()=>pe,updateItem:()=>be,writeItem:()=>de,writeItemForce:()=>me});var o={};u.r(o),u.d(o,{db:()=>ge,init:()=>ke,status:()=>Re});var c={};u.r(c),u.d(c,{getContent:()=>Ie,init:()=>Pe}),r("regenerator-runtime/runtime.js"),r("core-js/modules/es.string.starts-with.js"),r("core-js/modules/es.array.for-each.js"),r("core-js/modules/web.dom-collections.for-each.js"),r("core-js/modules/es.array.concat.js"),r("core-js/modules/es.array.map.js"),r("core-js/modules/es.array.iterator.js"),r("core-js/modules/es.object.to-string.js"),r("core-js/modules/es.promise.js"),r("core-js/modules/es.string.iterator.js"),r("core-js/modules/web.dom-collections.iterator.js"),r("core-js/modules/es.array.last-index-of.js"),r("core-js/modules/es.symbol.js"),r("core-js/modules/es.symbol.description.js"),r("core-js/modules/es.symbol.iterator.js"),r("core-js/modules/es.array.from.js"),r("core-js/modules/es.array.slice.js");const s=t(import.meta.url)("path");var i=u.n(s);const l=t(import.meta.url)("util");var p=u.n(l);const f=t(import.meta.url)("fs");var m=u.n(f);const d=t(import.meta.url)("fs/promises");var b=u.n(d);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function h(e,r){if(r&&("object"===v(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){var r="function"==typeof Map?new Map:void 0;return w=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return j(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)},w(e)}function j(e,r,t){return j=g()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&k(o,t.prototype),o},j.apply(null,arguments)}function g(){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(e){return!1}}function k(e,r){return k=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},k(e,r)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}r("core-js/modules/es.object.set-prototype-of.js"),r("core-js/modules/es.object.get-prototype-of.js"),r("core-js/modules/es.array.index-of.js"),r("core-js/modules/es.regexp.to-string.js"),r("core-js/modules/es.reflect.construct.js"),r("core-js/modules/es.map.js"),r("core-js/modules/esnext.map.delete-all.js"),r("core-js/modules/esnext.map.every.js"),r("core-js/modules/esnext.map.filter.js"),r("core-js/modules/esnext.map.find.js"),r("core-js/modules/esnext.map.find-key.js"),r("core-js/modules/esnext.map.includes.js"),r("core-js/modules/esnext.map.key-of.js"),r("core-js/modules/esnext.map.map-keys.js"),r("core-js/modules/esnext.map.map-values.js"),r("core-js/modules/esnext.map.merge.js"),r("core-js/modules/esnext.map.reduce.js"),r("core-js/modules/esnext.map.some.js"),r("core-js/modules/esnext.map.update.js");var O=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&k(e,r)}(o,e);var r,t,n=(r=o,t=g(),function(){var e,n=R(r);if(t){var o=R(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return h(this,e)});function o(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(this,o),r=n.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(x(r),o),r.name=t.name||"CustomError",r}return o}(w(Error));const C=r("chalk");var D=u.n(C);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}console.log;var E=console.warn,P=console.error;"undefined"===("undefined"==typeof window?"undefined":S(window))&&(E=function(){return console.warn(D().yellow.apply(D(),arguments))},P=function(){return console.error(D().red.apply(D(),arguments))});var I=E,F=P;function T(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return _(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function A(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){A(u,n,o,a,c,"next",e)}function c(e){A(u,n,o,a,c,"throw",e)}a(void 0)}))}}var M=function(e){return!e||e.startsWith("/")?e:i().resolve(process.cwd(),e)},B=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=M(e);try{if(!m().existsSync(e)){if(!r)return!1;throw new O("File does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof O?t:new O("Error while accessing file: ".concat(e))}return!0},G=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=M(e);try{if(!m().existsSync(e)){if(!r)return!1;throw new O("Directory does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof O?t:new O("Error while accessing directory: ".concat(e))}return!0},K=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>1&&void 0!==o[1]&&o[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),n=null,e.prev=5,e.next=8,b().readFile(r,"utf8");case 8:n=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),t&&I("Cannot read file: ".concat(r));case 14:return e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(r){return e.apply(this,arguments)}}(),z=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;e=M(e);var t=null;try{t=m().readFileSync(e,"utf8")}catch(t){r&&I("Cannot read file: ".concat(e))}return t},U=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>1&&void 0!==u[1]&&u[1],r){e.next=3;break}return e.abrupt("return",{dirs:null,files:null});case 3:return r=M(r),n=null,o=null,e.prev=6,e.next=9,b().readdir(r,{withFileTypes:!0});case 9:e.sent.forEach((function(e){e.isDirectory()?o?o.push(e.name):o=[e.name]:e.isFile()&&(n?n.push(e.name):n=[e.name])})),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t&&I("Cannot read dir: ".concat(r));case 16:return e.abrupt("return",{dirs:o,files:n});case 17:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(r){return e.apply(this,arguments)}}(),q=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),e.next=6,U(r,t);case 6:return e.abrupt("return",e.sent.files);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),H=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),e.next=6,U(r,t);case 6:return e.abrupt("return",e.sent.dirs);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),Q=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,s,i,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>1&&void 0!==l[1]?l[1]:"",r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),n=t?"".concat(r,"/").concat(t):r,e.next=7,U(n);case 7:return o=e.sent,u=o.dirs,a=o.files,c=(c=a||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),s=(u||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),i=s.map((function(e){return Q(r,e)})),e.next=16,Promise.all(i);case 16:return e.sent.forEach((function(e){e&&(c=[].concat(T(c),T(e)))})),e.abrupt("return",c.length?c:null);case 19:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),V=function(e){return Q(e)},W=function(){var e=N(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,b().mkdir(n,{recursive:!0});case 7:return e.next=9,b().writeFile(r,t);case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while writing to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),Z=function(){var e=N(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,b().mkdir(n,{recursive:!0});case 7:return e.next=9,b().appendFile(r,t+"\n");case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while appending to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),$=function(){var e=N(regeneratorRuntime.mark((function e(r,t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),t=M(t),e.prev=4,e.next=7,b().rename(r,t);case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.error("Error while renaming file ".concat(r," to ").concat(t),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(r,t){return e.apply(this,arguments)}}(),J=function(){var e=N(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:if(r=M(r),e.prev=3,G(r)){e.next=7;break}return e.next=7,b().mkdir(r,{recursive:!0});case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),console.error("Error while creating directory: ".concat(r),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(r){return e.apply(this,arguments)}}(),L=function(){var e=N(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,e.next=6,b().unlink(r);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),console.error("Error while deleting file ".concat(r),e.t0),e.abrupt("return",!1);case 12:return e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(r){return e.apply(this,arguments)}}(),X=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,t=u(76),n=p().promisify(t),e.next=8,n(r);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(3),console.error("Error while deleting dir ".concat(r),e.t0),e.abrupt("return",!1);case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(r){return e.apply(this,arguments)}}();r("core-js/modules/es.object.keys.js"),r("core-js/modules/es.array.filter.js"),r("core-js/modules/es.object.get-own-property-descriptor.js"),r("core-js/modules/es.object.get-own-property-descriptors.js");const Y=r("@aws-sdk/client-dynamodb"),ee=r("@aws-sdk/lib-dynamodb"),re=r("short-uuid");var te=u.n(re);const ne={dbDocClient:null,id:null};function oe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function ue(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?oe(Object(t),!0).forEach((function(r){ae(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oe(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function ae(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ce(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}function se(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){ce(u,n,o,a,c,"next",e)}function c(e){ce(u,n,o,a,c,"throw",e)}a(void 0)}))}}var ie=function(){throw new O("DynamoDB is possibly uninitialized!",{name:"DynamoDBError"})},le=function(e){var r=new Y.DynamoDBClient({region:e});return!ne.dbDocClient&&(ne.dbDocClient=ee.DynamoDBDocumentClient.from(r),ne.id=te().uuid(),!0)},pe=function(){return ne.id},fe=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient){e.next=2;break}return e.abrupt("return",ie());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return t[n]||(t[n]=te().uuid()),u={TableName:r,Item:t,ConditionExpression:"attribute_not_exists(".concat(n,")")},a=new ee.PutCommand(u),c=3,e.prev=8,e.next=11,ne.dbDocClient.send(a);case 11:e.next=25;break;case 13:if(e.prev=13,e.t0=e.catch(8),"ConditionalCheckFailedException"!==e.t0.name){e.next=24;break}if(!(o<c-1)){e.next=22;break}return t[n]=te().uuid(),e.next=20,fe(r,t,n,o+1);case 20:return s=e.sent,e.abrupt("return",s);case 22:console.error("PutCommandInput:",u),console.error("[ERROR] Maximum attempts overflow!");case 24:return e.abrupt("return",null);case 25:return e.abrupt("return",t);case 26:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),me=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"id",e.abrupt("return",fe(r,t,n,0));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),de=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient){e.next=2;break}return e.abrupt("return",ie());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return n={TableName:r,Item:t},o=new ee.PutCommand(n),e.prev=6,e.next=9,ne.dbDocClient.send(o);case 9:e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(6),console.error("PutCommandInput:",n),console.error(e.t0),e.abrupt("return",null);case 16:return e.abrupt("return",!0);case 17:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(r,t){return e.apply(this,arguments)}}(),be=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o,u){var a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient){e.next=2;break}return e.abrupt("return",ie());case 2:if(r&&t&&n&&o){e.next=4;break}return e.abrupt("return",null);case 4:return a={TableName:r,Key:t,UpdateExpression:n,ExpressionAttributeValues:o},u&&(a=ue(ue({},a),{},{ExpressionAttributeNames:u})),c=new ee.UpdateCommand(a),e.prev=7,e.next=10,ne.dbDocClient.send(c);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("UpdateCommandInput:",a),console.error(e.t0),e.abrupt("return",null);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t,n,o,u){return e.apply(this,arguments)}}(),ve=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient){e.next=2;break}return e.abrupt("return",ie());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return u=null,a={TableName:r,Key:t},n&&(a=ue(ue({},a),{},{ProjectionExpression:n})),o&&(a=ue(ue({},a),{},{ExpressionAttributeNames:o})),c=new ee.GetCommand(a),e.prev=9,e.next=12,ne.dbDocClient.send(c);case 12:s=e.sent,(i=s.Item)&&(u=i),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),console.error("GetCommandInput:",a),console.error(e.t0);case 21:return e.abrupt("return",u);case 22:case"end":return e.stop()}}),e,null,[[9,17]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),ye=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s,i,l,p,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=f.length>4&&void 0!==f[4]?f[4]:"",a=f.length>5&&void 0!==f[5]&&f[5],ne.dbDocClient){e.next=4;break}return e.abrupt("return",ie());case 4:if(r&&n&&o){e.next=6;break}return e.abrupt("return",null);case 6:return c=null,s={TableName:r,KeyConditionExpression:n,ExpressionAttributeValues:o},t&&(s=ue(ue({},s),{},{IndexName:t})),u&&(s=ue(ue({},s),{},{ProjectionExpression:u})),a&&(s=ue(ue({},s),{},{ScanIndexForward:!1})),i=new ee.QueryCommand(s),e.prev=12,e.next=15,ne.dbDocClient.send(i);case 15:l=e.sent,(p=l.Items)&&(c=p),e.next=24;break;case 20:e.prev=20,e.t0=e.catch(12),console.error("QueryCommandInput:",i.input),console.error(e.t0);case 24:return e.abrupt("return",c);case 25:case"end":return e.stop()}}),e,null,[[12,20]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),he=function(){var e=se(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>1&&void 0!==s[1]?s[1]:"",ne.dbDocClient){e.next=3;break}return e.abrupt("return",ie());case 3:if(r){e.next=5;break}return e.abrupt("return",null);case 5:return n=null,o={TableName:r},t&&(o=ue(ue({},o),{},{ProjectionExpression:t})),u=new ee.ScanCommand(o),e.prev=9,e.next=12,ne.dbDocClient.send(u);case 12:a=e.sent,(c=a.Items)&&(n=c),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(9),console.error("ScanCommandInput:",o),console.error(e.t0);case 21:return e.abrupt("return",n);case 22:case"end":return e.stop()}}),e,null,[[9,17]])})));return function(r){return e.apply(this,arguments)}}(),xe=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient){e.next=2;break}return e.abrupt("return",ie());case 2:if(r&&t){e.next=4;break}return e.abrupt("return",null);case 4:return n={TableName:r,Key:t},o=new ee.DeleteCommand(n),e.prev=6,e.next=9,ne.dbDocClient.send(o);case 9:e.next=16;break;case 11:return e.prev=11,e.t0=e.catch(6),console.error("DeleteCommandInput:",n),console.error(e.t0),e.abrupt("return",!1);case 16:return e.abrupt("return",!0);case 17:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(r,t){return e.apply(this,arguments)}}(),we=le,je=pe,ge=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(n,["init","status"]),ke=function(e){return e?we(e):(F("AWS initialization error! Missing region: ".concat(e)),!1)},Re=function(){return je()};const Oe=r("@octokit/core");function Ce(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}var De=null,Se=null,Ee=function(){throw new O("GitHub SDK is possibly uninitialized!",{name:"GitHubError"})},Pe=function(e,r){e&&r?(De=new Oe.Octokit({auth:e}),Se=r):F("GitHub initialization error! authToken: ".concat(!!e,", account: ").concat(!!r))},Ie=function(){var e,r=(e=regeneratorRuntime.mark((function e(r,t){var n,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(De&&Se){e.next=2;break}return e.abrupt("return",Ee());case 2:return e.prev=2,e.next=5,De.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:Se,repo:r,path:t});case 5:return n=e.sent,o=n.data,u=n.headers,e.abrupt("return",{response:o,headers:u});case 11:e.prev=11,e.t0=e.catch(2),F("[ERROR:gh.getContent]",e.t0);case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){Ce(u,n,o,a,c,"next",e)}function c(e){Ce(u,n,o,a,c,"throw",e)}a(void 0)}))});return function(e,t){return r.apply(this,arguments)}}();const Fe={fs:e,aws:o,gh:c}})();var c=a.r,s=a.Z,i=a.fs,l=a.gh;export{c as aws,s as default,i as fs,l as gh};
|
|
1
|
+
import{createRequire as e}from"module";let r=e(import.meta.url);import{createRequire as t}from"module";var n={76:e=>{e.exports=r("rimraf")}},o={};function u(e){var r=o[e];if(void 0!==r)return r.exports;var t=o[e]={exports:{}};return n[e](t,t.exports,u),t.exports}u.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return u.d(r,{a:r}),r},u.d=(e,r)=>{for(var t in r)u.o(r,t)&&!u.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},u.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),u.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{u.d(a,{r:()=>o,Z:()=>Fe,fs:()=>e,gh:()=>c});var e={};u.r(e),u.d(e,{appendToFile:()=>Z,createDir:()=>J,deleteDir:()=>X,deleteFile:()=>L,existsDirSync:()=>B,existsFileSync:()=>G,readDir:()=>U,readDirDirs:()=>H,readDirFiles:()=>q,readDirFilesRec:()=>Q,readFile:()=>K,readFileSync:()=>z,renameFile:()=>$,writeFile:()=>V});var n={};u.r(n),u.d(n,{deleteItem:()=>xe,init:()=>ie,queryItems:()=>ye,readItem:()=>ve,scanItems:()=>he,status:()=>le,updateItem:()=>be,writeItem:()=>de,writeItemForce:()=>me});var o={};u.r(o),u.d(o,{db:()=>ge,init:()=>ke,status:()=>Re});var c={};u.r(c),u.d(c,{getContent:()=>Ie,init:()=>Pe}),r("regenerator-runtime/runtime.js"),r("core-js/modules/es.string.starts-with.js"),r("core-js/modules/es.array.for-each.js"),r("core-js/modules/web.dom-collections.for-each.js"),r("core-js/modules/es.array.concat.js"),r("core-js/modules/es.array.map.js"),r("core-js/modules/es.array.iterator.js"),r("core-js/modules/es.object.to-string.js"),r("core-js/modules/es.promise.js"),r("core-js/modules/es.string.iterator.js"),r("core-js/modules/web.dom-collections.iterator.js"),r("core-js/modules/es.array.last-index-of.js"),r("core-js/modules/es.symbol.js"),r("core-js/modules/es.symbol.description.js"),r("core-js/modules/es.symbol.iterator.js"),r("core-js/modules/es.array.from.js"),r("core-js/modules/es.array.slice.js");const s=t(import.meta.url)("path");var i=u.n(s);const l=t(import.meta.url)("util");var p=u.n(l);const f=t(import.meta.url)("fs");var m=u.n(f);const d=t(import.meta.url)("fs/promises");var b=u.n(d);function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function y(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function h(e,r){if(r&&("object"===v(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return x(e)}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e){var r="function"==typeof Map?new Map:void 0;return w=function(e){if(null===e||(t=e,-1===Function.toString.call(t).indexOf("[native code]")))return e;var t;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,n)}function n(){return j(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)},w(e)}function j(e,r,t){return j=g()?Reflect.construct:function(e,r,t){var n=[null];n.push.apply(n,r);var o=new(Function.bind.apply(e,n));return t&&k(o,t.prototype),o},j.apply(null,arguments)}function g(){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(e){return!1}}function k(e,r){return k=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e},k(e,r)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}r("core-js/modules/es.object.set-prototype-of.js"),r("core-js/modules/es.object.get-prototype-of.js"),r("core-js/modules/es.array.index-of.js"),r("core-js/modules/es.regexp.to-string.js"),r("core-js/modules/es.reflect.construct.js"),r("core-js/modules/es.map.js"),r("core-js/modules/esnext.map.delete-all.js"),r("core-js/modules/esnext.map.every.js"),r("core-js/modules/esnext.map.filter.js"),r("core-js/modules/esnext.map.find.js"),r("core-js/modules/esnext.map.find-key.js"),r("core-js/modules/esnext.map.includes.js"),r("core-js/modules/esnext.map.key-of.js"),r("core-js/modules/esnext.map.map-keys.js"),r("core-js/modules/esnext.map.map-values.js"),r("core-js/modules/esnext.map.merge.js"),r("core-js/modules/esnext.map.reduce.js"),r("core-js/modules/esnext.map.some.js"),r("core-js/modules/esnext.map.update.js");var C=function(e){!function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&k(e,r)}(o,e);var r,t,n=(r=o,t=g(),function(){var e,n=R(r);if(t){var o=R(this).constructor;e=Reflect.construct(n,arguments,o)}else e=n.apply(this,arguments);return h(this,e)});function o(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return y(this,o),r=n.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(x(r),o),r.name=t.name||"CustomError",r}return o}(w(Error));const D=r("chalk");var O=u.n(D);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}console.log;var E=console.warn,P=console.error;"undefined"===("undefined"==typeof window?"undefined":S(window))&&(E=function(){return console.warn(O().yellow.apply(O(),arguments))},P=function(){return console.error(O().red.apply(O(),arguments))});var I=E,F=P;function T(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,r){if(e){if("string"==typeof e)return _(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(e,r):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function A(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}function N(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){A(u,n,o,a,c,"next",e)}function c(e){A(u,n,o,a,c,"throw",e)}a(void 0)}))}}var M=function(e){return!e||e.startsWith("/")?e:i().resolve(process.cwd(),e)},G=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=M(e);try{if(!m().existsSync(e)){if(!r)return!1;throw new C("File does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof C?t:new C("Error while accessing file: ".concat(e))}return!0},B=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return!1;e=M(e);try{if(!m().existsSync(e)){if(!r)return!1;throw new C("Directory does not exist: ".concat(e))}}catch(t){if(!r)return!1;throw t instanceof C?t:new C("Error while accessing directory: ".concat(e))}return!0},K=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>1&&void 0!==o[1]&&o[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),n=null,e.prev=5,e.next=8,b().readFile(r,"utf8");case 8:n=e.sent,e.next=14;break;case 11:e.prev=11,e.t0=e.catch(5),t&&I("Cannot read file: ".concat(r));case 14:return e.abrupt("return",n);case 15:case"end":return e.stop()}}),e,null,[[5,11]])})));return function(r){return e.apply(this,arguments)}}(),z=function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return null;e=M(e);var t=null;try{t=m().readFileSync(e,"utf8")}catch(t){r&&I("Cannot read file: ".concat(e))}return t},U=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>1&&void 0!==u[1]&&u[1],r){e.next=3;break}return e.abrupt("return",{dirs:null,files:null});case 3:return r=M(r),n=null,o=null,e.prev=6,e.next=9,b().readdir(r,{withFileTypes:!0});case 9:e.sent.forEach((function(e){e.isDirectory()?o?o.push(e.name):o=[e.name]:e.isFile()&&(n?n.push(e.name):n=[e.name])})),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(6),t&&I("Cannot read dir: ".concat(r));case 16:return e.abrupt("return",{dirs:o,files:n});case 17:case"end":return e.stop()}}),e,null,[[6,13]])})));return function(r){return e.apply(this,arguments)}}(),q=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),e.next=6,U(r,t);case 6:return e.abrupt("return",e.sent.files);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),H=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.length>1&&void 0!==n[1]&&n[1],r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),e.next=6,U(r,t);case 6:return e.abrupt("return",e.sent.dirs);case 7:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),W=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,s,i,l=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=l.length>1&&void 0!==l[1]?l[1]:"",r){e.next=3;break}return e.abrupt("return",null);case 3:return r=M(r),n=t?"".concat(r,"/").concat(t):r,e.next=7,U(n);case 7:return o=e.sent,u=o.dirs,a=o.files,c=(c=a||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),s=(u||[]).map((function(e){return t?"".concat(t,"/").concat(e):e})),i=s.map((function(e){return W(r,e)})),e.next=16,Promise.all(i);case 16:return e.sent.forEach((function(e){e&&(c=[].concat(T(c),T(e)))})),e.abrupt("return",c.length?c:null);case 19:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}(),Q=function(e){return W(e)},V=function(){var e=N(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,b().mkdir(n,{recursive:!0});case 7:return e.next=9,b().writeFile(r,t);case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while writing to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),Z=function(){var e=N(regeneratorRuntime.mark((function e(r,t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,n=r.substring(0,r.lastIndexOf("/")),e.next=7,b().mkdir(n,{recursive:!0});case 7:return e.next=9,b().appendFile(r,t+"\n");case 9:e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),console.error("Error while appending to ".concat(r),e.t0),e.abrupt("return",!1);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})));return function(r,t){return e.apply(this,arguments)}}(),$=function(){var e=N(regeneratorRuntime.mark((function e(r,t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&t){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),t=M(t),e.prev=4,e.next=7,b().rename(r,t);case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),console.error("Error while renaming file ".concat(r," to ").concat(t),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[4,9]])})));return function(r,t){return e.apply(this,arguments)}}(),J=function(){var e=N(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:if(r=M(r),e.prev=3,B(r)){e.next=7;break}return e.next=7,b().mkdir(r,{recursive:!0});case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),console.error("Error while creating directory: ".concat(r),e.t0),e.abrupt("return",!1);case 13:return e.abrupt("return",!0);case 14:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(r){return e.apply(this,arguments)}}(),L=function(){var e=N(regeneratorRuntime.mark((function e(r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,e.next=6,b().unlink(r);case 6:e.next=12;break;case 8:return e.prev=8,e.t0=e.catch(3),console.error("Error while deleting file ".concat(r),e.t0),e.abrupt("return",!1);case 12:return e.abrupt("return",!0);case 13:case"end":return e.stop()}}),e,null,[[3,8]])})));return function(r){return e.apply(this,arguments)}}(),X=function(){var e=N(regeneratorRuntime.mark((function e(r){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return",!1);case 2:return r=M(r),e.prev=3,t=u(76),n=p().promisify(t),e.next=8,n(r);case 8:e.next=14;break;case 10:return e.prev=10,e.t0=e.catch(3),console.error("Error while deleting dir ".concat(r),e.t0),e.abrupt("return",!1);case 14:return e.abrupt("return",!0);case 15:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(r){return e.apply(this,arguments)}}();r("core-js/modules/es.object.keys.js"),r("core-js/modules/es.array.filter.js"),r("core-js/modules/es.object.get-own-property-descriptor.js"),r("core-js/modules/es.object.get-own-property-descriptors.js");const Y=r("@aws-sdk/client-dynamodb"),ee=r("@aws-sdk/lib-dynamodb"),re=r("short-uuid");var te=u.n(re);const ne={dbDocClient:null,id:null};function oe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function ue(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?oe(Object(t),!0).forEach((function(r){ae(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):oe(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function ae(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ce(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}function se(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){ce(u,n,o,a,c,"next",e)}function c(e){ce(u,n,o,a,c,"throw",e)}a(void 0)}))}}var ie=function(e){var r=new Y.DynamoDBClient({region:e});return!ne.dbDocClient&&(ne.dbDocClient=ee.DynamoDBDocumentClient.from(r),ne.id=te().uuid(),!0)},le=function(){return ne.id},pe=function(){if(!le()){var e=process.env.AWS_REGION||"";if(!e||!ie(e))throw new C("Could not auto-initialize DynamoDB!",{name:"DynamoDBError"})}},fe=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient||pe(),ne.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return t[n]||(t[n]=te().uuid()),u={TableName:r,Item:t,ConditionExpression:"attribute_not_exists(".concat(n,")")},a=new ee.PutCommand(u),c=3,e.prev=9,e.next=12,ne.dbDocClient.send(a);case 12:e.next=26;break;case 14:if(e.prev=14,e.t0=e.catch(9),"ConditionalCheckFailedException"!==e.t0.name){e.next=25;break}if(!(o<c-1)){e.next=23;break}return t[n]=te().uuid(),e.next=21,fe(r,t,n,o+1);case 21:return s=e.sent,e.abrupt("return",s);case 23:console.error("PutCommandInput:",u),console.error("[ERROR] Maximum attempts overflow!");case 25:return e.abrupt("return",null);case 26:return e.abrupt("return",t);case 27:case"end":return e.stop()}}),e,null,[[9,14]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),me=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>2&&void 0!==o[2]?o[2]:"id",e.abrupt("return",fe(r,t,n,0));case 2:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),de=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient||pe(),ne.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return n={TableName:r,Item:t},o=new ee.PutCommand(n),e.prev=7,e.next=10,ne.dbDocClient.send(o);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("PutCommandInput:",n),console.error(e.t0),e.abrupt("return",null);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t){return e.apply(this,arguments)}}(),be=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o,u){var a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient||pe(),ne.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t&&n&&o){e.next=5;break}return e.abrupt("return",null);case 5:return a={TableName:r,Key:t,UpdateExpression:n,ExpressionAttributeValues:o},u&&(a=ue(ue({},a),{},{ExpressionAttributeNames:u})),c=new ee.UpdateCommand(a),e.prev=8,e.next=11,ne.dbDocClient.send(c);case 11:e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(8),console.error("UpdateCommandInput:",a),console.error(e.t0),e.abrupt("return",null);case 18:return e.abrupt("return",!0);case 19:case"end":return e.stop()}}),e,null,[[8,13]])})));return function(r,t,n,o,u){return e.apply(this,arguments)}}(),ve=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient||pe(),ne.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return u=null,a={TableName:r,Key:t},n&&(a=ue(ue({},a),{},{ProjectionExpression:n})),o&&(a=ue(ue({},a),{},{ExpressionAttributeNames:o})),c=new ee.GetCommand(a),e.prev=10,e.next=13,ne.dbDocClient.send(c);case 13:s=e.sent,(i=s.Item)&&(u=i),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(10),console.error("GetCommandInput:",a),console.error(e.t0);case 22:return e.abrupt("return",u);case 23:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),ye=function(){var e=se(regeneratorRuntime.mark((function e(r,t,n,o){var u,a,c,s,i,l,p,f=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=f.length>4&&void 0!==f[4]?f[4]:"",a=f.length>5&&void 0!==f[5]&&f[5],ne.dbDocClient||pe(),ne.dbDocClient){e.next=5;break}return e.abrupt("return",null);case 5:if(r&&n&&o){e.next=7;break}return e.abrupt("return",null);case 7:return c=null,s={TableName:r,KeyConditionExpression:n,ExpressionAttributeValues:o},t&&(s=ue(ue({},s),{},{IndexName:t})),u&&(s=ue(ue({},s),{},{ProjectionExpression:u})),a&&(s=ue(ue({},s),{},{ScanIndexForward:!1})),i=new ee.QueryCommand(s),e.prev=13,e.next=16,ne.dbDocClient.send(i);case 16:l=e.sent,(p=l.Items)&&(c=p),e.next=25;break;case 21:e.prev=21,e.t0=e.catch(13),console.error("QueryCommandInput:",i.input),console.error(e.t0);case 25:return e.abrupt("return",c);case 26:case"end":return e.stop()}}),e,null,[[13,21]])})));return function(r,t,n,o){return e.apply(this,arguments)}}(),he=function(){var e=se(regeneratorRuntime.mark((function e(r){var t,n,o,u,a,c,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>1&&void 0!==s[1]?s[1]:"",ne.dbDocClient||pe(),ne.dbDocClient){e.next=4;break}return e.abrupt("return",null);case 4:if(r){e.next=6;break}return e.abrupt("return",null);case 6:return n=null,o={TableName:r},t&&(o=ue(ue({},o),{},{ProjectionExpression:t})),u=new ee.ScanCommand(o),e.prev=10,e.next=13,ne.dbDocClient.send(u);case 13:a=e.sent,(c=a.Items)&&(n=c),e.next=22;break;case 18:e.prev=18,e.t0=e.catch(10),console.error("ScanCommandInput:",o),console.error(e.t0);case 22:return e.abrupt("return",n);case 23:case"end":return e.stop()}}),e,null,[[10,18]])})));return function(r){return e.apply(this,arguments)}}(),xe=function(){var e=se(regeneratorRuntime.mark((function e(r,t){var n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne.dbDocClient||pe(),ne.dbDocClient){e.next=3;break}return e.abrupt("return",null);case 3:if(r&&t){e.next=5;break}return e.abrupt("return",null);case 5:return n={TableName:r,Key:t},o=new ee.DeleteCommand(n),e.prev=7,e.next=10,ne.dbDocClient.send(o);case 10:e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(7),console.error("DeleteCommandInput:",n),console.error(e.t0),e.abrupt("return",!1);case 17:return e.abrupt("return",!0);case 18:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(r,t){return e.apply(this,arguments)}}(),we=ie,je=le,ge=function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(n,["init","status"]),ke=function(e){return e?we(e):(F("AWS initialization error! Missing region: ".concat(e)),!1)},Re=function(){return je()};const Ce=r("@octokit/core");function De(e,r,t,n,o,u,a){try{var c=e[u](a),s=c.value}catch(e){return void t(e)}c.done?r(s):Promise.resolve(s).then(n,o)}var Oe=null,Se=null,Ee=function(){throw new C("GitHub SDK is possibly uninitialized!",{name:"GitHubError"})},Pe=function(e,r){e&&r?(Oe=new Ce.Octokit({auth:e}),Se=r):F("GitHub initialization error! authToken: ".concat(!!e,", account: ").concat(!!r))},Ie=function(){var e,r=(e=regeneratorRuntime.mark((function e(r,t){var n,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Oe&&Se){e.next=2;break}return e.abrupt("return",Ee());case 2:return e.prev=2,e.next=5,Oe.request("GET /repos/{owner}/{repo}/contents/{path}",{owner:Se,repo:r,path:t});case 5:return n=e.sent,o=n.data,u=n.headers,e.abrupt("return",{response:o,headers:u});case 11:e.prev=11,e.t0=e.catch(2),F("[ERROR:gh.getContent]",e.t0);case 14:return e.abrupt("return",null);case 15:case"end":return e.stop()}}),e,null,[[2,11]])})),function(){var r=this,t=arguments;return new Promise((function(n,o){var u=e.apply(r,t);function a(e){De(u,n,o,a,c,"next",e)}function c(e){De(u,n,o,a,c,"throw",e)}a(void 0)}))});return function(e,t){return r.apply(this,arguments)}}();const Fe={fs:e,aws:o,gh:c}})();var c=a.r,s=a.Z,i=a.fs,l=a.gh;export{c as aws,s as default,i as fs,l as gh};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":"qHAAAA,EAAOC,QAAUC,EAAQ,YCCrBC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,QCpBfG,EAAoBK,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAACX,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAKzB,IACH,oB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A,KAA0BY,GARV,gEAUtBlF,QAAQK,MAAM,sBAAuByE,GACrC9E,QAAQK,MAAR,MAXsB,mBAaf,GAbe,kCAgBjB,GAhBiB,0DAAH,wDC/OTgH,GAAoCC,GAApBC,GAAoBD,GAAPE,G,kXAA3C,CAAkDF,EAAlD,mBAEMpD,GAAO,SAACC,GACZ,OAAKA,EAKEkD,GAAOlD,IAJZ9D,EAAM,6CAAD,OAA8C8D,KAC5C,IAMLM,GAAS,WACb,OAAO8C,MCfT,MAAM,GAA+B7J,EAAQ,iB,0HCK7C,IAAI+J,GAAyB,KACzBC,GAAuB,KAIrBzD,GAAsB,WAC1B,MAHmC,IAAIvE,EAGrB,wCAHsC,CAAEK,KAAM,iBAWrDmE,GAAO,SAACyD,EAAmBC,GACjCD,GAAcC,GAInBH,GAAS,IAAII,GAAAA,QAAQ,CAAEC,KAAMH,IAC7BD,GAAQE,GAJNvH,EAAM,2CAAD,SAA8CsH,EAA9C,wBAAuEC,KAanEG,GAAU,e,EAAA,G,EAAA,yBAAG,WAAOC,EAAcrH,GAArB,6FACnB8G,IAAWC,GADQ,yCACMzD,MADN,gCAIDwD,GAAOQ,QAAQ,4CAA6C,CAC/EP,MAAAA,GACAM,KAAAA,EACArH,KAAAA,IAPoB,cAIhBuH,EAJgB,OAShBC,EAAWD,EAAOtD,KAChBwD,EAAYF,EAAZE,QAVc,kBAWf,CAAED,SAAAA,EAAUC,QAAAA,IAXG,kCAatB/H,EAAM,wBAAD,MAbiB,iCAgBjB,MAhBiB,yD,iLAAH,wDC5BvB,UAAiBY,GAAAA,EAAIoH,IAAAA,EAAKC,GAAAA,I","sources":["webpack://@baadal-sdk/dapi/external commonjs \"rimraf\"","webpack://@baadal-sdk/dapi/webpack/bootstrap","webpack://@baadal-sdk/dapi/webpack/runtime/compat get default export","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/external commonjs \"regenerator-runtime/runtime.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.starts-with.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.concat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.promise.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.last-index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.description.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.from.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.slice.js\"","webpack://@baadal-sdk/dapi/external node-commonjs \"path\"","webpack://@baadal-sdk/dapi/external node-commonjs \"util\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs/promises\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.set-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.reflect.construct.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.delete-all.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find-key.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.includes.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.key-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-values.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.merge.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.reduce.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.some.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.update.js\"","webpack://@baadal-sdk/dapi/./src/common/error.ts","webpack://@baadal-sdk/dapi/external commonjs \"chalk\"","webpack://@baadal-sdk/dapi/./src/common/logger.ts","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptor.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptors.js\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/client-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/lib-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"short-uuid\"","webpack://@baadal-sdk/dapi/./src/aws/db-client.ts","webpack://@baadal-sdk/dapi/./src/aws/db.ts","webpack://@baadal-sdk/dapi/./src/aws/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"@octokit/core\"","webpack://@baadal-sdk/dapi/./src/gh/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["module.exports = require(\"rimraf\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"regenerator-runtime/runtime.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.starts-with.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.concat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.promise.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.last-index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.description.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.from.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.slice.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs/promises\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.set-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.reflect.construct.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.delete-all.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find-key.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.includes.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.key-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-values.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.merge.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.reduce.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.some.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.update.js\");","export class CustomError extends Error {\n constructor(message: string, options: any = {}) {\n super(message);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CustomError);\n }\n\n this.name = options.name || 'CustomError';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"chalk\");","import chalk from 'chalk';\n\nlet clog = console.log;\nlet cwarn = console.warn;\nlet cerror = console.error;\n\nif (typeof window === typeof undefined) {\n clog = (...args: any[]) => console.log(chalk.green(...args));\n cwarn = (...args: any[]) => console.warn(chalk.yellow(...args));\n cerror = (...args: any[]) => console.error(chalk.red(...args));\n}\n\nconst log = clog;\nconst warn = cwarn;\nconst error = cerror;\n\nexport { log, warn, error };\nexport default { log, warn, error };\n","import path from 'path';\nimport util from 'util';\nimport fs from 'fs';\nimport fsa from 'fs/promises';\n\nimport { CustomError } from '../common/error';\nimport { warn as cwarn } from '../common/logger';\n\nconst assertPath = (p: string) => {\n if (!p || p.startsWith('/')) return p;\n return path.resolve(process.cwd(), p);\n};\n\n/**\n * Check whether a file exists\n * @param file file path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsFileSync = (file: string, loud = false) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n if (!fs.existsSync(file)) {\n if (!loud) return false;\n throw new CustomError(`File does not exist: ${file}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing file: ${file}`);\n }\n }\n return true;\n};\n\n/**\n * Check whether a directory exists\n * @param dir directory path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsDirSync = (dir: string, loud = false) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!fs.existsSync(dir)) {\n if (!loud) return false;\n throw new CustomError(`Directory does not exist: ${dir}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing directory: ${dir}`);\n }\n }\n return true;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFile = async (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = await fsa.readFile(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFileSync = (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = fs.readFileSync(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Get the list of files/directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns an object {dirs,files} containing list of directories & files\n */\nexport const readDir = async (dir: string, warn = false) => {\n if (!dir) return { dirs: null, files: null };\n dir = assertPath(dir);\n\n let files: string[] | null = null;\n let dirs: string[] | null = null;\n\n try {\n const items = await fsa.readdir(dir, { withFileTypes: true });\n items.forEach(item => {\n if (item.isDirectory()) {\n if (!dirs) {\n dirs = [item.name];\n } else {\n dirs.push(item.name);\n }\n } else if (item.isFile()) {\n if (!files) {\n files = [item.name];\n } else {\n files.push(item.name);\n }\n }\n });\n } catch (e) {\n if (warn) cwarn(`Cannot read dir: ${dir}`);\n }\n\n return { dirs, files } as { dirs: string[] | null; files: string[] | null };\n};\n\n/**\n * Get the list of files in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of files, null in case of error or no items\n */\nexport const readDirFiles = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).files;\n};\n\n/**\n * Get the list of directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of directories, null in case of error or no items\n */\nexport const readDirDirs = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).dirs;\n};\n\nconst readDirFilesRecHelper = async (dir: string, basePath = ''): Promise<string[] | null> => {\n if (!dir) return null;\n dir = assertPath(dir);\n\n const dirPath = basePath ? `${dir}/${basePath}` : dir;\n const { dirs, files } = await readDir(dirPath);\n let allFiles: string[] = files || [];\n allFiles = allFiles.map(file => (basePath ? `${basePath}/${file}` : file));\n const absDirs = (dirs || []).map(d => (basePath ? `${basePath}/${d}` : d));\n\n const pList = absDirs.map(dirx => readDirFilesRecHelper(dir, dirx));\n const filesxList = await Promise.all(pList);\n filesxList.forEach(filesx => {\n if (filesx) {\n allFiles = [...allFiles, ...filesx];\n }\n });\n\n return allFiles.length ? allFiles : null;\n};\n\n/**\n * Get the (recursive) list of files in a directory\n * @param dir directory path\n * @returns complete (recursive) list of files, null in case of error or no items\n */\nexport const readDirFilesRec = (dir: string) => readDirFilesRecHelper(dir);\n\n/**\n * Write contents to a file (creates the file path if it doesn't exist)\n * @param file file path\n * @param contents contents to write\n * @returns true if successful, false on error\n */\nexport const writeFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n await fsa.writeFile(file, contents);\n } catch (e) {\n console.error(`Error while writing to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Append contents to a file\n * @param file file path\n * @param contents contents to append\n * @returns true if successful, false on error\n */\nexport const appendToFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n\n await fsa.appendFile(file, contents + '\\n');\n\n // Ref: https://stackoverflow.com/a/43370201\n // const stream = fs.createWriteStream(file, { flags: 'a' });\n // stream.write(contents + '\\n');\n // stream.end();\n } catch (e) {\n console.error(`Error while appending to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Rename a file\n * @param oldpath old file path\n * @param newpath new file path\n * @returns true if successful, false on error\n */\nexport const renameFile = async (oldpath: string, newpath: string) => {\n if (!oldpath || !newpath) return false;\n oldpath = assertPath(oldpath);\n newpath = assertPath(newpath);\n try {\n await fsa.rename(oldpath, newpath);\n } catch (e) {\n console.error(`Error while renaming file ${oldpath} to ${newpath}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Create a directory, if it doesn't exist\n * @param dir directory path\n * @returns true if successful, false in case of failure\n */\nexport const createDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!existsDirSync(dir)) {\n await fsa.mkdir(dir, { recursive: true });\n }\n } catch (e) {\n console.error(`Error while creating directory: ${dir}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a file\n * @param file file path\n * @returns true if successful, false on error\n */\nexport const deleteFile = async (file: string) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n await fsa.unlink(file);\n } catch (e) {\n console.error(`Error while deleting file ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a directory\n * @param dir directory path\n * @returns true if successful, false on error\n */\nexport const deleteDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n const rimraf = require('rimraf');\n const rimrafPr = util.promisify(rimraf);\n await rimrafPr(dir);\n\n // Added in: v14.14.0\n // await fsa.rm(dir, { recursive: true, force: true });\n } catch (e) {\n console.error(`Error while deleting dir ${dir}`, e);\n return false;\n }\n return true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptor.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptors.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/client-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/lib-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"short-uuid\");","import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';\n\nconst dbDocClient: DynamoDBDocumentClient | null = null;\nconst id: string | null = null;\n\nexport default { dbDocClient, id } as { dbDocClient: DynamoDBDocumentClient | null; id: string | null };\n","/**\n * Partition key vs Composite primary key:\n * Ref: https://aws.amazon.com/premiumsupport/knowledge-center/primary-key-dynamodb-table/\n */\n\nimport { DynamoDBClient } from '@aws-sdk/client-dynamodb';\nimport {\n DynamoDBDocumentClient,\n GetCommand,\n GetCommandInput,\n PutCommand,\n PutCommandInput,\n UpdateCommand,\n UpdateCommandInput,\n QueryCommand,\n QueryCommandInput,\n ScanCommand,\n ScanCommandInput,\n DeleteCommand,\n DeleteCommandInput,\n} from '@aws-sdk/lib-dynamodb';\nimport short from 'short-uuid';\n\nimport dbClient from './db-client';\nimport { StringIndexable } from '../common/common.model';\nimport { CustomError } from '../common/error';\n\nconst DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });\n\nconst initializationError = () => {\n throw DynamoDBError('DynamoDB is possibly uninitialized!');\n};\n\nexport const init = (region: string) => {\n const dydbClient = new DynamoDBClient({ region });\n\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#configuration\n if (!dbClient.dbDocClient) {\n dbClient.dbDocClient = DynamoDBDocumentClient.from(dydbClient);\n dbClient.id = short.uuid();\n return true;\n }\n return false;\n};\n\nexport const status = () => dbClient.id;\n\nconst writeItemForceHelper = async <T = any>(table: string, data: T, key: string, i: number): Promise<T | null> => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !data) return null;\n\n if (!(data as any)[key]) {\n (data as any)[key] = short.uuid();\n }\n const cmdParams: PutCommandInput = { TableName: table, Item: data, ConditionExpression: `attribute_not_exists(${key})` };\n const command = new PutCommand(cmdParams);\n const numberOfAttempts = 3;\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err: any) {\n // console.error('PutCommandInput:', cmdParams);\n // console.error(err);\n if (err.name === 'ConditionalCheckFailedException') {\n if (i < numberOfAttempts - 1) {\n (data as any)[key] = short.uuid(); // new primary key\n const ret: T | null = await writeItemForceHelper(table, data, key, i + 1);\n return ret;\n }\n console.error('PutCommandInput:', cmdParams);\n console.error('[ERROR] Maximum attempts overflow!');\n }\n return null;\n }\n\n return data;\n};\n\nexport const writeItemForce = async <T = any>(table: string, data: T, key = 'id'): Promise<T | null> => {\n return writeItemForceHelper<T>(table, data, key, 0);\n};\n\nexport const writeItem = async (table: string, data: StringIndexable) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !data) return null;\n\n const cmdParams: PutCommandInput = { TableName: table, Item: data };\n const command = new PutCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('PutCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const updateItem = async (\n table: string,\n key: StringIndexable,\n update: string,\n attr: StringIndexable,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key || !update || !attr) return null;\n\n let cmdParams: UpdateCommandInput = {\n TableName: table,\n Key: key,\n UpdateExpression: update,\n ExpressionAttributeValues: attr,\n };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n const command = new UpdateCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('UpdateCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const readItem = async <T = any>(\n table: string,\n key: StringIndexable,\n projection?: string,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key) return null;\n\n let contents: T | null = null;\n let cmdParams: GetCommandInput = { TableName: table, Key: key };\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ProjectionExpressions.html\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n\n const command = new GetCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const item = results.Item;\n\n if (item) {\n contents = item as T;\n }\n } catch (err) {\n console.error('GetCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const queryItems = async (\n table: string,\n indexName: string,\n cond: string,\n attr: StringIndexable,\n projection = '',\n desc = false\n) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !cond || !attr) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.Indexes.QueryAndScan.html#SQLtoNoSQL.Indexes.QueryAndScan.DynamoDB\n let cmdParams: QueryCommandInput = {\n TableName: table,\n KeyConditionExpression: cond,\n ExpressionAttributeValues: attr,\n // FilterExpression: \"contains (category_id, :cid)\",\n };\n\n if (indexName) cmdParams = { ...cmdParams, IndexName: indexName };\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (desc) cmdParams = { ...cmdParams, ScanIndexForward: false };\n\n const command = new QueryCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('QueryCommandInput:', command.input);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const scanItems = async (table: string, projection = '') => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n let cmdParams: ScanCommandInput = {\n TableName: table,\n };\n\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n\n const command = new ScanCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('ScanCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const deleteItem = async (table: string, key: StringIndexable) => {\n if (!dbClient.dbDocClient) return initializationError();\n if (!table || !key) return null;\n\n const cmdParams: DeleteCommandInput = { TableName: table, Key: key };\n const command = new DeleteCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('DeleteCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n return false;\n }\n\n return true;\n};\n\n// ----------------\n\n// await dbWriteItem('lesson_list', { id: 'id_001', title: 'My Lesson' });\n\n// const contents = await dbReadItem('lesson_list', { id: 'id_001' });\n// console.log(contents);\n\n// await dbUpdateItem(\n// 'lesson_list',\n// { id: 'id_001' },\n// 'set #a = :a, #b = :b',\n// { ':a': 'abhi@raj.me', ':b': 'Abhishek Raj' },\n// { '#a': 'email', '#b': 'name' }\n// );\n\n// ----------------\n","import * as dbAll from './db';\nimport { error } from '../common/logger';\n\nconst { init: dbInit, status: dbStatus, ...db } = dbAll;\n\nconst init = (region: string) => {\n if (!region) {\n error(`AWS initialization error! Missing region: ${region}`);\n return false;\n }\n\n return dbInit(region);\n};\n\nconst status = () => {\n return dbStatus();\n};\n\nexport { db, init, status }; // named exports\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@octokit/core\");","import { Octokit } from '@octokit/core';\n\nimport { CustomError } from '../common/error';\nimport { error } from '../common/logger';\n\nlet github: Octokit | null = null;\nlet owner: string | null = null;\n\nconst GitHubError = (msg: string) => new CustomError(msg, { name: 'GitHubError' });\n\nconst initializationError = () => {\n throw GitHubError('GitHub SDK is possibly uninitialized!');\n};\n\n/**\n * Initialize GitHub SDK\n * @param authToken GitHub auth token for the user account [GITHUB_TOKEN]\n * @param account account id for the GitHub user account [GITHUB_ACCOUNT]\n */\nexport const init = (authToken: string, account: string) => {\n if (!authToken || !account) {\n error(`GitHub initialization error! authToken: ${!!authToken}, account: ${!!account}`);\n return;\n }\n github = new Octokit({ auth: authToken });\n owner = account;\n};\n\n/**\n * Get contents of a particular file in a repo\n * @param repo name of the repo\n * @param path path of a file in the repo\n * @returns an object {response,headers} containing response and response headers, null in case of error\n */\nexport const getContent = async (repo: string, path: string) => {\n if (!github || !owner) return initializationError();\n\n try {\n const ghResp = await github.request('GET /repos/{owner}/{repo}/contents/{path}', {\n owner,\n repo,\n path,\n });\n const response = ghResp.data as GitHubContent;\n const { headers } = ghResp;\n return { response, headers };\n } catch (e) {\n error(`[ERROR:gh.getContent]`, e);\n }\n\n return null;\n};\n\n// --------------\n\nexport interface GitHubContent {\n path: string;\n content: string;\n sha: string;\n}\n","import * as fs from './fs';\nimport * as aws from './aws';\nimport * as gh from './gh';\n\n// Ref: https://stackoverflow.com/a/41283945\nexport { fs, aws, gh }; // named exports\nexport default { fs, aws, gh }; // default export\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","__WEBPACK_EXTERNAL_createRequire","import","meta","url","CustomError","message","options","Error","captureStackTrace","name","console","log","cwarn","warn","cerror","error","window","chalk","assertPath","p","startsWith","path","process","cwd","existsFileSync","file","loud","fs","e","existsDirSync","dir","readFile","contents","fsa","readFileSync","readDir","dirs","files","withFileTypes","forEach","item","isDirectory","push","isFile","readDirFiles","readDirDirs","readDirFilesRecHelper","basePath","dirPath","allFiles","map","absDirs","pList","dirx","Promise","all","filesx","length","readDirFilesRec","writeFile","substring","lastIndexOf","recursive","appendToFile","renameFile","oldpath","newpath","createDir","deleteFile","deleteDir","rimraf","rimrafPr","util","dbDocClient","id","initializationError","init","region","dydbClient","DynamoDBClient","dbClient","DynamoDBDocumentClient","short","status","writeItemForceHelper","table","data","i","cmdParams","TableName","Item","ConditionExpression","command","PutCommand","numberOfAttempts","ret","writeItemForce","writeItem","updateItem","update","attr","attrNames","Key","UpdateExpression","ExpressionAttributeValues","ExpressionAttributeNames","UpdateCommand","readItem","projection","ProjectionExpression","GetCommand","results","queryItems","indexName","cond","desc","KeyConditionExpression","IndexName","ScanIndexForward","QueryCommand","items","Items","input","scanItems","ScanCommand","deleteItem","DeleteCommand","dbInit","dbAll","dbStatus","db","github","owner","authToken","account","Octokit","auth","getContent","repo","request","ghResp","response","headers","aws","gh"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":"qHAAAA,EAAOC,QAAUC,EAAQ,YCCrBC,EAA2B,GAG/B,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,IAOV,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,QCpBfG,EAAoBK,EAAKT,IACxB,IAAIU,EAASV,GAAUA,EAAOW,WAC7B,IAAOX,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRN,EAAoBQ,EAAI,CAACX,EAASa,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEf,EAASc,IAC5EE,OAAOC,eAAejB,EAASc,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3EX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFlB,EAAoBsB,EAAKzB,IACH,oBAAX0B,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAejB,EAAS0B,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAejB,EAAS,aAAc,C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@baadal-sdk/dapi/webpack/runtime/compat get default export","webpack://@baadal-sdk/dapi/webpack/runtime/define property getters","webpack://@baadal-sdk/dapi/webpack/runtime/hasOwnProperty shorthand","webpack://@baadal-sdk/dapi/webpack/runtime/make namespace object","webpack://@baadal-sdk/dapi/external commonjs \"regenerator-runtime/runtime.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.starts-with.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.concat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.promise.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.string.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/web.dom-collections.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.last-index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.description.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.from.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.slice.js\"","webpack://@baadal-sdk/dapi/external node-commonjs \"path\"","webpack://@baadal-sdk/dapi/external node-commonjs \"util\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs\"","webpack://@baadal-sdk/dapi/external node-commonjs \"fs/promises\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.set-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.index-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.reflect.construct.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.delete-all.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.find-key.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.includes.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.key-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.map-values.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.merge.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.reduce.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.some.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.map.update.js\"","webpack://@baadal-sdk/dapi/./src/common/error.ts","webpack://@baadal-sdk/dapi/external commonjs \"chalk\"","webpack://@baadal-sdk/dapi/./src/common/logger.ts","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.keys.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptor.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.get-own-property-descriptors.js\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/client-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/lib-dynamodb\"","webpack://@baadal-sdk/dapi/external commonjs \"short-uuid\"","webpack://@baadal-sdk/dapi/./src/aws/db-client.ts","webpack://@baadal-sdk/dapi/./src/aws/db.ts","webpack://@baadal-sdk/dapi/./src/aws/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"@octokit/core\"","webpack://@baadal-sdk/dapi/./src/gh/index.ts","webpack://@baadal-sdk/dapi/./src/index.ts"],"sourcesContent":["module.exports = require(\"rimraf\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"regenerator-runtime/runtime.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.starts-with.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.concat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.promise.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/web.dom-collections.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.last-index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.description.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.from.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.slice.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"util\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"fs/promises\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.set-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.index-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.reflect.construct.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.delete-all.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.find-key.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.includes.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.key-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.map-values.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.merge.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.reduce.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.some.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.map.update.js\");","export class CustomError extends Error {\n constructor(message: string, options: any = {}) {\n super(message);\n\n // Maintains proper stack trace for where our error was thrown (only available on V8)\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, CustomError);\n }\n\n this.name = options.name || 'CustomError';\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"chalk\");","import chalk from 'chalk';\n\nlet clog = console.log;\nlet cwarn = console.warn;\nlet cerror = console.error;\n\nif (typeof window === typeof undefined) {\n clog = (...args: any[]) => console.log(chalk.green(...args));\n cwarn = (...args: any[]) => console.warn(chalk.yellow(...args));\n cerror = (...args: any[]) => console.error(chalk.red(...args));\n}\n\nconst log = clog;\nconst warn = cwarn;\nconst error = cerror;\n\nexport { log, warn, error };\nexport default { log, warn, error };\n","import path from 'path';\nimport util from 'util';\nimport fs from 'fs';\nimport fsa from 'fs/promises';\n\nimport { CustomError } from '../common/error';\nimport { warn as cwarn } from '../common/logger';\n\nconst assertPath = (p: string) => {\n if (!p || p.startsWith('/')) return p;\n return path.resolve(process.cwd(), p);\n};\n\n/**\n * Check whether a file exists\n * @param file file path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsFileSync = (file: string, loud = false) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n if (!fs.existsSync(file)) {\n if (!loud) return false;\n throw new CustomError(`File does not exist: ${file}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing file: ${file}`);\n }\n }\n return true;\n};\n\n/**\n * Check whether a directory exists\n * @param dir directory path\n * @param loud whether to throw errors [default: false]\n * @returns true if it exists, false otherwise\n */\nexport const existsDirSync = (dir: string, loud = false) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!fs.existsSync(dir)) {\n if (!loud) return false;\n throw new CustomError(`Directory does not exist: ${dir}`);\n }\n } catch (e) {\n if (!loud) return false;\n if (e instanceof CustomError) {\n throw e;\n } else {\n throw new CustomError(`Error while accessing directory: ${dir}`);\n }\n }\n return true;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFile = async (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = await fsa.readFile(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Read contents of a file\n * @param file file path\n * @param warn whether to show warnings [default: false]\n * @returns contents of the file, null in case of error\n */\nexport const readFileSync = (file: string, warn = false) => {\n if (!file) return null;\n file = assertPath(file);\n let contents = null;\n try {\n contents = fs.readFileSync(file, 'utf8');\n } catch (e) {\n if (warn) cwarn(`Cannot read file: ${file}`);\n }\n return contents;\n};\n\n/**\n * Get the list of files/directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns an object {dirs,files} containing list of directories & files\n */\nexport const readDir = async (dir: string, warn = false) => {\n if (!dir) return { dirs: null, files: null };\n dir = assertPath(dir);\n\n let files: string[] | null = null;\n let dirs: string[] | null = null;\n\n try {\n const items = await fsa.readdir(dir, { withFileTypes: true });\n items.forEach(item => {\n if (item.isDirectory()) {\n if (!dirs) {\n dirs = [item.name];\n } else {\n dirs.push(item.name);\n }\n } else if (item.isFile()) {\n if (!files) {\n files = [item.name];\n } else {\n files.push(item.name);\n }\n }\n });\n } catch (e) {\n if (warn) cwarn(`Cannot read dir: ${dir}`);\n }\n\n return { dirs, files } as { dirs: string[] | null; files: string[] | null };\n};\n\n/**\n * Get the list of files in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of files, null in case of error or no items\n */\nexport const readDirFiles = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).files;\n};\n\n/**\n * Get the list of directories in a directory\n * @param dir directory path\n * @param warn whether to show warnings [default: false]\n * @returns list of directories, null in case of error or no items\n */\nexport const readDirDirs = async (dir: string, warn = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn)).dirs;\n};\n\nconst readDirFilesRecHelper = async (dir: string, basePath = ''): Promise<string[] | null> => {\n if (!dir) return null;\n dir = assertPath(dir);\n\n const dirPath = basePath ? `${dir}/${basePath}` : dir;\n const { dirs, files } = await readDir(dirPath);\n let allFiles: string[] = files || [];\n allFiles = allFiles.map(file => (basePath ? `${basePath}/${file}` : file));\n const absDirs = (dirs || []).map(d => (basePath ? `${basePath}/${d}` : d));\n\n const pList = absDirs.map(dirx => readDirFilesRecHelper(dir, dirx));\n const filesxList = await Promise.all(pList);\n filesxList.forEach(filesx => {\n if (filesx) {\n allFiles = [...allFiles, ...filesx];\n }\n });\n\n return allFiles.length ? allFiles : null;\n};\n\n/**\n * Get the (recursive) list of files in a directory\n * @param dir directory path\n * @returns complete (recursive) list of files, null in case of error or no items\n */\nexport const readDirFilesRec = (dir: string) => readDirFilesRecHelper(dir);\n\n/**\n * Write contents to a file (creates the file path if it doesn't exist)\n * @param file file path\n * @param contents contents to write\n * @returns true if successful, false on error\n */\nexport const writeFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n await fsa.writeFile(file, contents);\n } catch (e) {\n console.error(`Error while writing to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Append contents to a file\n * @param file file path\n * @param contents contents to append\n * @returns true if successful, false on error\n */\nexport const appendToFile = async (file: string, contents: string) => {\n if (!file || !contents) return false;\n file = assertPath(file);\n try {\n const dir = file.substring(0, file.lastIndexOf('/'));\n await fsa.mkdir(dir, { recursive: true });\n\n await fsa.appendFile(file, contents + '\\n');\n\n // Ref: https://stackoverflow.com/a/43370201\n // const stream = fs.createWriteStream(file, { flags: 'a' });\n // stream.write(contents + '\\n');\n // stream.end();\n } catch (e) {\n console.error(`Error while appending to ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Rename a file\n * @param oldpath old file path\n * @param newpath new file path\n * @returns true if successful, false on error\n */\nexport const renameFile = async (oldpath: string, newpath: string) => {\n if (!oldpath || !newpath) return false;\n oldpath = assertPath(oldpath);\n newpath = assertPath(newpath);\n try {\n await fsa.rename(oldpath, newpath);\n } catch (e) {\n console.error(`Error while renaming file ${oldpath} to ${newpath}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Create a directory, if it doesn't exist\n * @param dir directory path\n * @returns true if successful, false in case of failure\n */\nexport const createDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n if (!existsDirSync(dir)) {\n await fsa.mkdir(dir, { recursive: true });\n }\n } catch (e) {\n console.error(`Error while creating directory: ${dir}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a file\n * @param file file path\n * @returns true if successful, false on error\n */\nexport const deleteFile = async (file: string) => {\n if (!file) return false;\n file = assertPath(file);\n try {\n await fsa.unlink(file);\n } catch (e) {\n console.error(`Error while deleting file ${file}`, e);\n return false;\n }\n return true;\n};\n\n/**\n * Delete a directory\n * @param dir directory path\n * @returns true if successful, false on error\n */\nexport const deleteDir = async (dir: string) => {\n if (!dir) return false;\n dir = assertPath(dir);\n try {\n const rimraf = require('rimraf');\n const rimrafPr = util.promisify(rimraf);\n await rimrafPr(dir);\n\n // Added in: v14.14.0\n // await fsa.rm(dir, { recursive: true, force: true });\n } catch (e) {\n console.error(`Error while deleting dir ${dir}`, e);\n return false;\n }\n return true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.keys.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptor.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-own-property-descriptors.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/client-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/lib-dynamodb\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"short-uuid\");","import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';\n\nconst dbDocClient: DynamoDBDocumentClient | null = null;\nconst id: string | null = null;\n\nexport default { dbDocClient, id } as { dbDocClient: DynamoDBDocumentClient | null; id: string | null };\n","/**\n * Partition key vs Composite primary key:\n * Ref: https://aws.amazon.com/premiumsupport/knowledge-center/primary-key-dynamodb-table/\n */\n\nimport { DynamoDBClient } from '@aws-sdk/client-dynamodb';\nimport {\n DynamoDBDocumentClient,\n GetCommand,\n GetCommandInput,\n PutCommand,\n PutCommandInput,\n UpdateCommand,\n UpdateCommandInput,\n QueryCommand,\n QueryCommandInput,\n ScanCommand,\n ScanCommandInput,\n DeleteCommand,\n DeleteCommandInput,\n} from '@aws-sdk/lib-dynamodb';\nimport short from 'short-uuid';\n\nimport dbClient from './db-client';\nimport { StringIndexable } from '../common/common.model';\nimport { CustomError } from '../common/error';\n\nconst DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });\n\nexport const init = (region: string) => {\n const dydbClient = new DynamoDBClient({ region });\n\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#configuration\n if (!dbClient.dbDocClient) {\n dbClient.dbDocClient = DynamoDBDocumentClient.from(dydbClient);\n dbClient.id = short.uuid();\n return true;\n }\n return false;\n};\n\nexport const status = () => dbClient.id;\n\nconst tryInit = () => {\n if (status()) return;\n const region = process.env.AWS_REGION || '';\n if (region) {\n if (init(region)) return;\n }\n // throw DynamoDBError('DynamoDB is possibly uninitialized!');\n throw DynamoDBError('Could not auto-initialize DynamoDB!');\n};\n\n// auto-initialize on load\n// tryInit();\n\nconst writeItemForceHelper = async <T = any>(table: string, data: T, key: string, i: number): Promise<T | null> => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !data) return null;\n\n if (!(data as any)[key]) {\n (data as any)[key] = short.uuid();\n }\n const cmdParams: PutCommandInput = { TableName: table, Item: data, ConditionExpression: `attribute_not_exists(${key})` };\n const command = new PutCommand(cmdParams);\n const numberOfAttempts = 3;\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err: any) {\n // console.error('PutCommandInput:', cmdParams);\n // console.error(err);\n if (err.name === 'ConditionalCheckFailedException') {\n if (i < numberOfAttempts - 1) {\n (data as any)[key] = short.uuid(); // new primary key\n const ret: T | null = await writeItemForceHelper(table, data, key, i + 1);\n return ret;\n }\n console.error('PutCommandInput:', cmdParams);\n console.error('[ERROR] Maximum attempts overflow!');\n }\n return null;\n }\n\n return data;\n};\n\nexport const writeItemForce = async <T = any>(table: string, data: T, key = 'id'): Promise<T | null> => {\n return writeItemForceHelper<T>(table, data, key, 0);\n};\n\nexport const writeItem = async (table: string, data: StringIndexable) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !data) return null;\n\n const cmdParams: PutCommandInput = { TableName: table, Item: data };\n const command = new PutCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('PutCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const updateItem = async (\n table: string,\n key: StringIndexable,\n update: string,\n attr: StringIndexable,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key || !update || !attr) return null;\n\n let cmdParams: UpdateCommandInput = {\n TableName: table,\n Key: key,\n UpdateExpression: update,\n ExpressionAttributeValues: attr,\n };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n const command = new UpdateCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('UpdateCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport const readItem = async <T = any>(\n table: string,\n key: StringIndexable,\n projection?: string,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key) return null;\n\n let contents: T | null = null;\n let cmdParams: GetCommandInput = { TableName: table, Key: key };\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ProjectionExpressions.html\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: attrNames };\n\n const command = new GetCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const item = results.Item;\n\n if (item) {\n contents = item as T;\n }\n } catch (err) {\n console.error('GetCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const queryItems = async (\n table: string,\n indexName: string,\n cond: string,\n attr: StringIndexable,\n projection = '',\n desc = false\n) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !cond || !attr) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/SQLtoNoSQL.Indexes.QueryAndScan.html#SQLtoNoSQL.Indexes.QueryAndScan.DynamoDB\n let cmdParams: QueryCommandInput = {\n TableName: table,\n KeyConditionExpression: cond,\n ExpressionAttributeValues: attr,\n // FilterExpression: \"contains (category_id, :cid)\",\n };\n\n if (indexName) cmdParams = { ...cmdParams, IndexName: indexName };\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n if (desc) cmdParams = { ...cmdParams, ScanIndexForward: false };\n\n const command = new QueryCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('QueryCommandInput:', command.input);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const scanItems = async (table: string, projection = '') => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table) return null;\n\n let contents: StringIndexable[] | null = null;\n\n // Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-query-scan.html\n let cmdParams: ScanCommandInput = {\n TableName: table,\n };\n\n if (projection) cmdParams = { ...cmdParams, ProjectionExpression: projection };\n\n const command = new ScanCommand(cmdParams);\n\n try {\n const results = await dbClient.dbDocClient.send(command);\n const items = results.Items;\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('ScanCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n }\n\n return contents;\n};\n\nexport const deleteItem = async (table: string, key: StringIndexable) => {\n if (!dbClient.dbDocClient) tryInit();\n if (!dbClient.dbDocClient) return null;\n if (!table || !key) return null;\n\n const cmdParams: DeleteCommandInput = { TableName: table, Key: key };\n const command = new DeleteCommand(cmdParams);\n\n try {\n await dbClient.dbDocClient.send(command);\n } catch (err) {\n console.error('DeleteCommandInput:', cmdParams);\n console.error(err);\n // throw err;\n return false;\n }\n\n return true;\n};\n\n// ----------------\n\n// await dbWriteItem('lesson_list', { id: 'id_001', title: 'My Lesson' });\n\n// const contents = await dbReadItem('lesson_list', { id: 'id_001' });\n// console.log(contents);\n\n// await dbUpdateItem(\n// 'lesson_list',\n// { id: 'id_001' },\n// 'set #a = :a, #b = :b',\n// { ':a': 'abhi@raj.me', ':b': 'Abhishek Raj' },\n// { '#a': 'email', '#b': 'name' }\n// );\n\n// ----------------\n","import * as dbAll from './db';\nimport { error } from '../common/logger';\n\nconst { init: dbInit, status: dbStatus, ...db } = dbAll;\n\nconst init = (region: string) => {\n if (!region) {\n error(`AWS initialization error! Missing region: ${region}`);\n return false;\n }\n\n return dbInit(region);\n};\n\nconst status = () => {\n return dbStatus();\n};\n\nexport { db, init, status }; // named exports\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@octokit/core\");","import { Octokit } from '@octokit/core';\n\nimport { CustomError } from '../common/error';\nimport { error } from '../common/logger';\n\nlet github: Octokit | null = null;\nlet owner: string | null = null;\n\nconst GitHubError = (msg: string) => new CustomError(msg, { name: 'GitHubError' });\n\nconst initializationError = () => {\n throw GitHubError('GitHub SDK is possibly uninitialized!');\n};\n\n/**\n * Initialize GitHub SDK\n * @param authToken GitHub auth token for the user account [GITHUB_TOKEN]\n * @param account account id for the GitHub user account [GITHUB_ACCOUNT]\n */\nexport const init = (authToken: string, account: string) => {\n if (!authToken || !account) {\n error(`GitHub initialization error! authToken: ${!!authToken}, account: ${!!account}`);\n return;\n }\n github = new Octokit({ auth: authToken });\n owner = account;\n};\n\n/**\n * Get contents of a particular file in a repo\n * @param repo name of the repo\n * @param path path of a file in the repo\n * @returns an object {response,headers} containing response and response headers, null in case of error\n */\nexport const getContent = async (repo: string, path: string) => {\n if (!github || !owner) return initializationError();\n\n try {\n const ghResp = await github.request('GET /repos/{owner}/{repo}/contents/{path}', {\n owner,\n repo,\n path,\n });\n const response = ghResp.data as GitHubContent;\n const { headers } = ghResp;\n return { response, headers };\n } catch (e) {\n error(`[ERROR:gh.getContent]`, e);\n }\n\n return null;\n};\n\n// --------------\n\nexport interface GitHubContent {\n path: string;\n content: string;\n sha: string;\n}\n","import * as fs from './fs';\nimport * as aws from './aws';\nimport * as gh from './gh';\n\n// Ref: https://stackoverflow.com/a/41283945\nexport { fs, aws, gh }; // named exports\nexport default { fs, aws, gh }; // default export\n"],"names":["module","exports","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","__WEBPACK_EXTERNAL_createRequire","import","meta","url","CustomError","message","options","Error","captureStackTrace","name","console","log","cwarn","warn","cerror","error","window","chalk","assertPath","p","startsWith","path","process","cwd","existsFileSync","file","loud","fs","e","existsDirSync","dir","readFile","contents","fsa","readFileSync","readDir","dirs","files","withFileTypes","forEach","item","isDirectory","push","isFile","readDirFiles","readDirDirs","readDirFilesRecHelper","basePath","dirPath","allFiles","map","absDirs","pList","dirx","Promise","all","filesx","length","readDirFilesRec","writeFile","substring","lastIndexOf","recursive","appendToFile","renameFile","oldpath","newpath","createDir","deleteFile","deleteDir","rimraf","rimrafPr","util","dbDocClient","id","init","region","dydbClient","DynamoDBClient","dbClient","DynamoDBDocumentClient","short","status","tryInit","env","AWS_REGION","writeItemForceHelper","table","data","i","cmdParams","TableName","Item","ConditionExpression","command","PutCommand","numberOfAttempts","ret","writeItemForce","writeItem","updateItem","update","attr","attrNames","Key","UpdateExpression","ExpressionAttributeValues","ExpressionAttributeNames","UpdateCommand","readItem","projection","ProjectionExpression","GetCommand","results","queryItems","indexName","cond","desc","KeyConditionExpression","IndexName","ScanIndexForward","QueryCommand","items","Items","input","scanItems","ScanCommand","deleteItem","DeleteCommand","dbInit","dbAll","dbStatus","db","github","owner","initializationError","authToken","account","Octokit","auth","getContent","repo","request","ghResp","response","headers","aws","gh"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/aws/db.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/aws/db.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqBH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAKzD,eAAO,MAAM,IAAI,WAAY,MAAM,YAUlC,CAAC;AAEF,eAAO,MAAM,MAAM,qBAAoB,CAAC;AA+CxC,eAAO,MAAM,cAAc,mBAA0B,MAAM,6CAE1D,CAAC;AAEF,eAAO,MAAM,SAAS,UAAiB,MAAM,QAAQ,eAAe,yBAkBnE,CAAC;AAEF,eAAO,MAAM,UAAU,UACd,MAAM,OACR,eAAe,UACZ,MAAM,QACR,eAAe,uEA0BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,mBACZ,MAAM,OACR,eAAe,qGA+BrB,CAAC;AAEF,eAAO,MAAM,UAAU,UACd,MAAM,aACF,MAAM,QACX,MAAM,QACN,eAAe,gFAwCtB,CAAC;AAEF,eAAO,MAAM,SAAS,UAAiB,MAAM,gEA8B5C,CAAC;AAEF,eAAO,MAAM,UAAU,UAAiB,MAAM,OAAO,eAAe,4BAkBnE,CAAC"}
|
package/package.json
CHANGED
package/src/aws/db.ts
CHANGED
|
@@ -27,10 +27,6 @@ import { CustomError } from '../common/error';
|
|
|
27
27
|
|
|
28
28
|
const DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });
|
|
29
29
|
|
|
30
|
-
const initializationError = () => {
|
|
31
|
-
throw DynamoDBError('DynamoDB is possibly uninitialized!');
|
|
32
|
-
};
|
|
33
|
-
|
|
34
30
|
export const init = (region: string) => {
|
|
35
31
|
const dydbClient = new DynamoDBClient({ region });
|
|
36
32
|
|
|
@@ -45,8 +41,22 @@ export const init = (region: string) => {
|
|
|
45
41
|
|
|
46
42
|
export const status = () => dbClient.id;
|
|
47
43
|
|
|
44
|
+
const tryInit = () => {
|
|
45
|
+
if (status()) return;
|
|
46
|
+
const region = process.env.AWS_REGION || '';
|
|
47
|
+
if (region) {
|
|
48
|
+
if (init(region)) return;
|
|
49
|
+
}
|
|
50
|
+
// throw DynamoDBError('DynamoDB is possibly uninitialized!');
|
|
51
|
+
throw DynamoDBError('Could not auto-initialize DynamoDB!');
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// auto-initialize on load
|
|
55
|
+
// tryInit();
|
|
56
|
+
|
|
48
57
|
const writeItemForceHelper = async <T = any>(table: string, data: T, key: string, i: number): Promise<T | null> => {
|
|
49
|
-
if (!dbClient.dbDocClient)
|
|
58
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
59
|
+
if (!dbClient.dbDocClient) return null;
|
|
50
60
|
if (!table || !data) return null;
|
|
51
61
|
|
|
52
62
|
if (!(data as any)[key]) {
|
|
@@ -81,7 +91,8 @@ export const writeItemForce = async <T = any>(table: string, data: T, key = 'id'
|
|
|
81
91
|
};
|
|
82
92
|
|
|
83
93
|
export const writeItem = async (table: string, data: StringIndexable) => {
|
|
84
|
-
if (!dbClient.dbDocClient)
|
|
94
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
95
|
+
if (!dbClient.dbDocClient) return null;
|
|
85
96
|
if (!table || !data) return null;
|
|
86
97
|
|
|
87
98
|
const cmdParams: PutCommandInput = { TableName: table, Item: data };
|
|
@@ -106,7 +117,8 @@ export const updateItem = async (
|
|
|
106
117
|
attr: StringIndexable,
|
|
107
118
|
attrNames?: StringIndexable
|
|
108
119
|
) => {
|
|
109
|
-
if (!dbClient.dbDocClient)
|
|
120
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
121
|
+
if (!dbClient.dbDocClient) return null;
|
|
110
122
|
if (!table || !key || !update || !attr) return null;
|
|
111
123
|
|
|
112
124
|
let cmdParams: UpdateCommandInput = {
|
|
@@ -136,7 +148,8 @@ export const readItem = async <T = any>(
|
|
|
136
148
|
projection?: string,
|
|
137
149
|
attrNames?: StringIndexable
|
|
138
150
|
) => {
|
|
139
|
-
if (!dbClient.dbDocClient)
|
|
151
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
152
|
+
if (!dbClient.dbDocClient) return null;
|
|
140
153
|
if (!table || !key) return null;
|
|
141
154
|
|
|
142
155
|
let contents: T | null = null;
|
|
@@ -172,7 +185,8 @@ export const queryItems = async (
|
|
|
172
185
|
projection = '',
|
|
173
186
|
desc = false
|
|
174
187
|
) => {
|
|
175
|
-
if (!dbClient.dbDocClient)
|
|
188
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
189
|
+
if (!dbClient.dbDocClient) return null;
|
|
176
190
|
if (!table || !cond || !attr) return null;
|
|
177
191
|
|
|
178
192
|
let contents: StringIndexable[] | null = null;
|
|
@@ -210,7 +224,8 @@ export const queryItems = async (
|
|
|
210
224
|
};
|
|
211
225
|
|
|
212
226
|
export const scanItems = async (table: string, projection = '') => {
|
|
213
|
-
if (!dbClient.dbDocClient)
|
|
227
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
228
|
+
if (!dbClient.dbDocClient) return null;
|
|
214
229
|
if (!table) return null;
|
|
215
230
|
|
|
216
231
|
let contents: StringIndexable[] | null = null;
|
|
@@ -241,7 +256,8 @@ export const scanItems = async (table: string, projection = '') => {
|
|
|
241
256
|
};
|
|
242
257
|
|
|
243
258
|
export const deleteItem = async (table: string, key: StringIndexable) => {
|
|
244
|
-
if (!dbClient.dbDocClient)
|
|
259
|
+
if (!dbClient.dbDocClient) tryInit();
|
|
260
|
+
if (!dbClient.dbDocClient) return null;
|
|
245
261
|
if (!table || !key) return null;
|
|
246
262
|
|
|
247
263
|
const cmdParams: DeleteCommandInput = { TableName: table, Key: key };
|