@baadal-sdk/dapi 0.31.6 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -2
- package/dist/index.d.ts +674 -0
- package/dist/index.js +1118 -0
- package/dist/index.js.map +1 -0
- package/package.json +44 -106
- package/LICENSE.txt +0 -21
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/index.js.LICENSE.txt +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/esm/index.js +0 -3
- package/dist/esm/index.js.LICENSE.txt +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/dist/types/aws/client.d.ts +0 -13
- package/dist/types/aws/client.d.ts.map +0 -1
- package/dist/types/aws/db.d.ts +0 -291
- package/dist/types/aws/db.d.ts.map +0 -1
- package/dist/types/aws/index.d.ts +0 -12
- package/dist/types/aws/index.d.ts.map +0 -1
- package/dist/types/aws/s3.d.ts +0 -90
- package/dist/types/aws/s3.d.ts.map +0 -1
- package/dist/types/common/common.model.d.ts +0 -4
- package/dist/types/common/common.model.d.ts.map +0 -1
- package/dist/types/common/const.d.ts +0 -4
- package/dist/types/common/const.d.ts.map +0 -1
- package/dist/types/common/error.d.ts +0 -4
- package/dist/types/common/error.d.ts.map +0 -1
- package/dist/types/common/logger.d.ts +0 -29
- package/dist/types/common/logger.d.ts.map +0 -1
- package/dist/types/fs/index.d.ts +0 -102
- package/dist/types/fs/index.d.ts.map +0 -1
- package/dist/types/gh/index.d.ts +0 -22
- package/dist/types/gh/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -6
- package/dist/types/utils/index.d.ts.map +0 -1
- package/src/aws/client.ts +0 -18
- package/src/aws/db.ts +0 -764
- package/src/aws/index.ts +0 -33
- package/src/aws/s3.ts +0 -476
- package/src/common/common.model.ts +0 -3
- package/src/common/const.ts +0 -3
- package/src/common/error.ts +0 -12
- package/src/common/logger.ts +0 -18
- package/src/fs/index.ts +0 -316
- package/src/gh/index.ts +0 -60
- package/src/index.ts +0 -8
- package/src/typings/index.d.ts +0 -0
- package/src/utils/index.ts +0 -39
package/dist/esm/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,CAAE4B,OAAO,ikCCLlB3B,EAAQ,wCCARA,EAAQ,0CCARA,EAAQ,qDCARA,EAAQ,kDCARA,EAAQ,+CCARA,EAAQ,mDCARA,EAAQ,sCCARA,EAAQ,mDCARA,EAAQ,6CCARA,EAAQ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AAAA,EAAI+O,IAAAA,EAAKC,GAAAA,EAAIC,MAAAA","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 \"core-js/modules/es.array.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.to-string.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.async-iterator.for-each.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.constructor.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.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.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.async-iterator.filter.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.filter.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.concat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.async-iterator.map.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.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.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.object.define-property.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.symbol.async-iterator.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.symbol.to-string-tag.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.json.to-string-tag.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.math.to-string-tag.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.object.set-prototype-of.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.slice.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.from.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.exec.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.regexp.test.js\"","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 node-commonjs \"path\"","webpack://@baadal-sdk/dapi/external node-commonjs \"crypto\"","webpack://@baadal-sdk/dapi/external commonjs \"chalk\"","webpack://@baadal-sdk/dapi/./src/common/logger.ts","webpack://@baadal-sdk/dapi/./src/utils/index.ts","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.to-string-tag.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.emplace.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/external commonjs \"core-js/modules/es.symbol.to-primitive.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.date.to-primitive.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.number.constructor.js\"","webpack://@baadal-sdk/dapi/./src/common/error.ts","webpack://@baadal-sdk/dapi/./src/fs/index.ts","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.async-iterator.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.every.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.flat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.unscopables.flat.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.array.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.async-iterator.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/esnext.iterator.find.js\"","webpack://@baadal-sdk/dapi/external commonjs \"core-js/modules/es.object.keys.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 \"core-js/modules/es.object.define-properties.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/external commonjs \"@baadal-sdk/utils\"","webpack://@baadal-sdk/dapi/./src/aws/client.ts","webpack://@baadal-sdk/dapi/./src/common/const.ts","webpack://@baadal-sdk/dapi/./src/aws/db.ts","webpack://@baadal-sdk/dapi/external commonjs \"@aws-sdk/client-s3\"","webpack://@baadal-sdk/dapi/external commonjs \"mime-types\"","webpack://@baadal-sdk/dapi/./src/aws/s3.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(\"core-js/modules/es.array.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.to-string.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.async-iterator.for-each.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.constructor.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.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.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.async-iterator.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.filter.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.string.starts-with.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/esnext.async-iterator.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.map.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.iterator.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.object.define-property.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.symbol.async-iterator.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.to-string-tag.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.json.to-string-tag.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.math.to-string-tag.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.get-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.set-prototype-of.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.slice.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.from.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.exec.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.regexp.test.js\");","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__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"path\");","const __WEBPACK_NAMESPACE_OBJECT__ = __WEBPACK_EXTERNAL_createRequire(import.meta.url)(\"crypto\");","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 crypto from 'crypto';\nimport fsa from 'fs/promises';\n\nimport { error } from '../common/logger';\n\nexport const assertPath = (p: string) => {\n if (!p || p.startsWith('/')) return p;\n return path.resolve(process.cwd(), p);\n};\n\nexport const sha1Hash = (data: string) => {\n if (!data) return null;\n const hashSum = crypto.createHash('sha1');\n hashSum.update(data);\n return hashSum.digest('hex');\n};\n\nexport const sha256Hash = (data: string | Buffer) => {\n if (!data) return null;\n const hashSum = crypto.createHash('sha256');\n hashSum.update(data);\n return hashSum.digest('hex');\n};\n\nexport const fileHash = async (file: string) => {\n if (!file) return null;\n let contents: Buffer | null = null;\n\n try {\n // get buffer (instead of utf8 string) to support binary data\n contents = await fsa.readFile(file);\n } catch (e) {\n error(e);\n return null;\n }\n\n return sha256Hash(contents);\n};\n","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.to-string-tag.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.emplace.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\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.symbol.to-primitive.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.date.to-primitive.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.number.constructor.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","import util from 'util';\nimport fs from 'fs';\nimport fsa from 'fs/promises';\n\nimport { assertPath } from '../utils';\nimport { CustomError } from '../common/error';\nimport { warn as cwarn } from '../common/logger';\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 if it doesn't, null in case of error\n */\nexport const existsFileSync = (file: string, loud = false) => {\n if (!file) return null;\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 null;\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 if it doesn't, null in case of error\n */\nexport const existsDirSync = (dir: string, loud = false) => {\n if (!dir) return null;\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 null;\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 * @param hiddenItems whether to include items starting with dot(.) [default: false]\n * @returns an object {dirs,files} containing list of directories & files, null in case or error\n */\nexport const readDir = async (dir: string, warn = false, hiddenItems = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n\n let dirs: string[] = [];\n let files: string[] = [];\n\n try {\n const items = await fsa.readdir(dir, { withFileTypes: true });\n items.forEach(item => {\n if (item.isDirectory()) {\n dirs.push(item.name);\n } else if (item.isFile()) {\n files.push(item.name);\n }\n });\n } catch (e) {\n if (warn) cwarn(`Cannot read dir: ${dir}`);\n return null;\n }\n\n if (!hiddenItems) {\n dirs = (dirs as string[]).filter(d => !d.startsWith('.'));\n files = (files as string[]).filter(f => !f.startsWith('.'));\n }\n\n return { dirs, files };\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 * @param hiddenItems whether to include items starting with dot(.) [default: false]\n * @returns list of files, null in case of error\n */\nexport const readDirFiles = async (dir: string, warn = false, hiddenItems = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn, hiddenItems))?.files || null;\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 * @param hiddenItems whether to include items starting with dot(.) [default: false]\n * @returns list of directories, null in case of error\n */\nexport const readDirDirs = async (dir: string, warn = false, hiddenItems = false) => {\n if (!dir) return null;\n dir = assertPath(dir);\n return (await readDir(dir, warn, hiddenItems))?.dirs || null;\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 readDirObj = await readDir(dirPath);\n if (!readDirObj) return null;\n\n const { dirs, files } = readDirObj;\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;\n};\n\n/**\n * Get the (recursive) list of files in a directory\n * @param dir directory path\n * @param hiddenItems whether to include items starting with dot(.) [default: false]\n * @returns complete (recursive) list of files, null in case of error\n */\nexport const readDirFilesRec = async (dir: string, hiddenItems = false) => {\n let allFiles = await readDirFilesRecHelper(dir);\n if (!hiddenItems) {\n if (allFiles) allFiles = allFiles.filter(f => !f.startsWith('.'));\n }\n return allFiles;\n};\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, null in case of error\n */\nexport const writeFile = async (file: string, contents: string) => {\n if (!file || !contents) return null;\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 null;\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, null in case of error\n */\nexport const appendToFile = async (file: string, contents: string) => {\n if (!file || !contents) return null;\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 null;\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, null in case of error\n */\nexport const renameFile = async (oldpath: string, newpath: string) => {\n if (!oldpath || !newpath) return null;\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 null;\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, null in case of failure/error\n */\nexport const createDir = async (dir: string) => {\n if (!dir) return null;\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 null;\n }\n return true;\n};\n\n/**\n * Delete a file\n * @param file file path\n * @returns true if successful, null in case of error\n */\nexport const deleteFile = async (file: string) => {\n if (!file) return null;\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 null;\n }\n return true;\n};\n\n/**\n * Delete a directory\n * @param dir directory path\n * @returns true if successful, null in case of error\n */\nexport const deleteDir = async (dir: string) => {\n if (!dir) return null;\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 null;\n }\n return true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.async-iterator.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.every.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.flat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.unscopables.flat.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.array.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.async-iterator.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/esnext.iterator.find.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"core-js/modules/es.object.keys.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(\"core-js/modules/es.object.define-properties.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\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@baadal-sdk/utils\");","import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';\nimport { S3Client } from '@aws-sdk/client-s3';\n\nconst dbDocClient: DynamoDBDocumentClient | null = null;\nconst awsS3Client: S3Client | null = null;\n\nexport const dbClient = { client: dbDocClient, id: null } as DBClientType;\nexport const s3Client = { client: awsS3Client, id: null } as S3ClientType;\n\nexport interface DBClientType {\n client: DynamoDBDocumentClient | null;\n id: string | null;\n}\n\nexport interface S3ClientType {\n client: S3Client | null;\n id: string | null;\n}\n","export const BATCH_SIZE = 20; // (max) number of items in a batch request\nexport const CHUNK_SIZE = 10; // (max) number of parallel requests at a time\nexport const MAX_RETRY_ATTEMPTS = 3; // (max) number of retry attempts in case of key conflict\n","/**\n * Examples:\n * Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-examples.html\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 BatchGetCommand,\n BatchGetCommandInput,\n PutCommand,\n PutCommandInput,\n BatchWriteCommand,\n BatchWriteCommandInput,\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';\nimport { chunkifyArray } from '@baadal-sdk/utils';\n\nimport { dbClient } from './client';\nimport { StringIndexable } from '../common/common.model';\nimport { CustomError } from '../common/error';\nimport { warn, error } from '../common/logger';\nimport { BATCH_SIZE, CHUNK_SIZE, MAX_RETRY_ATTEMPTS } from '../common/const';\n\nconst DynamoDBError = (msg: string) => new CustomError(msg, { name: 'DynamoDBError' });\n\n/** @internal */\nexport const init = (region: string) => {\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_dynamodb.html#configuration\n if (!dbClient.client) {\n const dydbClient = new DynamoDBClient({ region }); // may also pass `credentials`\n dbClient.client = DynamoDBDocumentClient.from(dydbClient);\n dbClient.id = short.uuid();\n return true;\n }\n return false;\n};\n\n/** @internal */\nexport const status = () => dbClient.id;\n\nconst tryInit = (silent = false) => {\n if (dbClient.client) return;\n const region = process.env.AWS_REGION || '';\n if (region) {\n if (init(region)) {\n // console.log('Auto-initialization of DynamoDB successful');\n return;\n }\n }\n if (!silent) {\n // throw DynamoDBError('DynamoDB is possibly uninitialized!');\n throw DynamoDBError('Could not auto-initialize DynamoDB!');\n }\n};\n\n// auto-initialize on load\ntryInit(true);\n\nconst writeItemForceHelper = async <T = any>(\n table: string,\n item: T,\n key: string,\n i: number,\n imax?: number\n): Promise<T | null> => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!table || !item) return null;\n\n if (!(item as any)[key]) {\n (item as any)[key] = short.uuid();\n }\n const cmdParams: PutCommandInput = { TableName: table, Item: item, ConditionExpression: `attribute_not_exists(${key})` };\n const command = new PutCommand(cmdParams);\n const numberOfAttempts = imax ?? MAX_RETRY_ATTEMPTS;\n\n try {\n await dbClient.client.send(command);\n } catch (err: any) {\n if (err.name === 'ConditionalCheckFailedException') {\n if (i < numberOfAttempts - 1) {\n (item as any)[key] = short.uuid(); // new primary key\n const ret: T | null = await writeItemForceHelper(table, item, key, i + 1, imax);\n return ret;\n }\n console.error('PutCommandInput:', cmdParams);\n if (numberOfAttempts === 1) {\n error(`[ERROR] An item with the same key(${(item as any)[key]}) already exists!`);\n } else {\n error('[ERROR] Maximum attempts overflow!');\n }\n }\n return null;\n }\n\n return item;\n};\n\nexport interface WriteItemForceInput<T = any> {\n table: string;\n item: T;\n key?: string;\n}\n\nexport type WriteItemUniqueInput<T = any> = WriteItemForceInput<T>;\n\n/**\n * Write an item to a DynamoDB table, retry in case of key conflict\n * @param input input command object\n * @returns the created item, null in case of error\n *\n * ```js\n * writeItemForce({\n * table: 'lesson_list',\n * item: { title: 'My Lesson' },\n * key: 'id',\n * });\n *\n * interface WriteItemForceInput<T = any> {\n * table: string;\n * item: T;\n * key?: string; // default: `id`\n * }\n * ```\n */\nexport const writeItemForce = async <T = any>(input: WriteItemForceInput<T>): Promise<T | null> => {\n const key = input.key || 'id';\n return writeItemForceHelper<T>(input.table, input.item, key, 0);\n};\n\n/**\n * Write an item (uniquely) to a DynamoDB table.\n * Unlike `writeItemForce`, it does not retry in case of key conflict\n * Unlike `writeItem`, it does not overwrite an item with the same key (if it exists)\n * @param input input command object\n * @returns the created item, null in case of error or key conflict (i.e., if item with same key already exists)\n *\n * ```js\n * writeItemUnique({\n * table: 'lesson_list',\n * item: { id: 'id_001', title: 'My Lesson' },\n * key: 'id',\n * });\n *\n * interface WriteItemUniqueInput<T = any> {\n * table: string;\n * item: T;\n * key?: string; // default: `id`\n * }\n * ```\n */\nexport const writeItemUnique = async <T = any>(input: WriteItemUniqueInput<T>): Promise<T | null> => {\n const key = input.key || 'id';\n return writeItemForceHelper<T>(input.table, input.item, key, 0, 1);\n};\n\nexport interface WriteItemInput {\n table: string;\n item: StringIndexable;\n}\n\n/**\n * Write an item to a DynamoDB table\n * @param input input command object\n * @returns true if successful, null in case of error\n *\n * ```js\n * writeItem({\n * table: 'lesson_list',\n * item: { id: 'id_001', title: 'My Lesson' },\n * });\n *\n * interface WriteItemInput {\n * table: string;\n * item: StringIndexable;\n * }\n * ```\n */\nexport const writeItem = async (input: WriteItemInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.item) return null;\n\n const cmdParams: PutCommandInput = { TableName: input.table, Item: input.item };\n const command = new PutCommand(cmdParams);\n\n try {\n await dbClient.client.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\n// Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-table-read-write-batch.html\nconst batchWriteItems = async (table: string, items: StringIndexable[]) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!table || !items || !Array.isArray(items)) return null;\n if (!items.length) return true;\n\n const reqList = items.map(item => ({ PutRequest: { Item: item } }));\n const cmdParams: BatchWriteCommandInput = {\n RequestItems: {\n [table]: reqList,\n },\n };\n\n const command = new BatchWriteCommand(cmdParams);\n\n try {\n await dbClient.client.send(command);\n } catch (err) {\n console.error('BatchWriteCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport interface WriteItemsAllInput {\n table: string;\n items: StringIndexable[];\n}\n\n/**\n * Write a list of items to a DynamoDB table\n * @param input input command object\n * @returns true if successful, null in case of error\n *\n * ```js\n * writeItemsAll({\n * table: 'lesson_list',\n * items: [{ id: 'id_001', title: 'My Lesson' }, { id: 'id_002', title: 'My Lesson 2' }],\n * });\n *\n * interface WriteItemInput {\n * table: string;\n * items: StringIndexable[];\n * }\n * ```\n */\nexport const writeItemsAll = async (input: WriteItemsAllInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.items || !Array.isArray(input.items)) return null;\n if (!input.items.length) return true;\n\n let errFlag = false;\n\n const batchedItems = chunkifyArray(input.items, BATCH_SIZE);\n const chunkedItems = chunkifyArray(batchedItems, CHUNK_SIZE);\n\n for (let i = 0; i < chunkedItems.length; i += 1) {\n const bchunks = chunkedItems[i];\n\n const brlist = bchunks.map(iItems => batchWriteItems(input.table, iItems));\n const bslist = await Promise.all(brlist); // eslint-disable-line no-await-in-loop\n\n const isSuccess = bslist.every(e => e === true);\n if (!isSuccess) errFlag = true;\n }\n\n return errFlag ? null : true;\n};\n\nexport interface UpdateItemInput {\n table: string;\n key: StringIndexable;\n update: string;\n attr: StringIndexable;\n attrNames?: StringIndexable;\n}\n\n/**\n * Update an item in DynamoDB table\n * @param input input command object\n * @returns true if successful, null in case of error\n *\n * ```js\n * updateItem({\n * table: 'lesson_list',\n * key: { id: 'id_001' },\n * update: 'SET status = :status, #rev = 10',\n * attr: { ':status': 'completed' },\n * attrNames: { '#rev': 'revision' },\n * });\n *\n * interface UpdateItemInput {\n * table: string;\n * key: StringIndexable;\n * update: string;\n * attr: StringIndexable;\n * attrNames?: StringIndexable;\n * }\n * ```\n */\nexport const updateItem = async (input: UpdateItemInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.key || !input.update || !input.attr) return null;\n\n let cmdParams: UpdateCommandInput = {\n TableName: input.table,\n Key: input.key,\n UpdateExpression: input.update,\n ExpressionAttributeValues: input.attr,\n };\n if (input.attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: input.attrNames };\n const command = new UpdateCommand(cmdParams);\n\n try {\n await dbClient.client.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 interface ReadItemInput {\n table: string;\n key: StringIndexable;\n projection?: string;\n attrNames?: StringIndexable;\n loud?: boolean;\n}\n\n/**\n * Read an item from DynamoDB table\n * @param input input command object\n * @returns item contents, null in case of error\n *\n * ```js\n * readItem({\n * table: 'lesson_list',\n * key: { id: 'id_001' },\n * projection: 'id, lesson, status',\n * });\n *\n * interface ReadItemInput {\n * table: string;\n * key: StringIndexable;\n * projection?: string;\n * attrNames?: StringIndexable;\n * }\n * ```\n */\nexport const readItem = async <T = any>(input: ReadItemInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.key) return null;\n\n let contents: T | null = null;\n let cmdParams: GetCommandInput = { TableName: input.table, Key: input.key };\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ProjectionExpressions.html\n if (input.projection) cmdParams = { ...cmdParams, ProjectionExpression: input.projection };\n if (input.attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: input.attrNames };\n\n const command = new GetCommand(cmdParams);\n\n try {\n const results = await dbClient.client.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 if (input.loud) {\n throw err;\n } else {\n return null;\n }\n }\n\n return contents;\n};\n\n// Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-table-read-write-batch.html\nconst batchReadItems = async <T = any>(\n table: string,\n keys: StringIndexable[],\n projection?: string,\n attrNames?: StringIndexable\n) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!table || !keys || !Array.isArray(keys)) return null;\n if (!keys.length) return [];\n\n let contents: StringIndexable<T>[] = [];\n\n let reqParams: any = { Keys: keys };\n if (projection) reqParams = { ...reqParams, ProjectionExpression: projection };\n if (attrNames) reqParams = { ...reqParams, ExpressionAttributeNames: attrNames };\n\n const cmdParams: BatchGetCommandInput = {\n RequestItems: {\n [table]: reqParams,\n },\n };\n\n const command = new BatchGetCommand(cmdParams);\n\n try {\n const results = await dbClient.client.send(command);\n const items = results.Responses;\n\n if (items && items[table]) {\n contents = items[table];\n }\n } catch (err) {\n console.error('BatchGetCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return contents;\n};\n\nexport interface ReadItemsAllInput {\n table: string;\n keys: StringIndexable[];\n projection?: string;\n attrNames?: StringIndexable;\n}\n\n/**\n * Read a list of items from DynamoDB table\n * Note: ordering of items in result may not be same as that in `keys`\n * @param input input command object\n * @returns list of contents for items, null in case of error\n *\n * ```js\n * readItemsAll({\n * table: 'lesson_list',\n * keys: [{ id: 'id_001' }, { id: 'id_002' }],\n * projection: 'id, lesson, status',\n * });\n *\n * interface ReadItemsAllInput {\n * table: string;\n * keys: StringIndexable[];\n * projection?: string;\n * attrNames?: StringIndexable;\n * }\n * ```\n */\nexport const readItemsAll = async <T = any>(input: ReadItemsAllInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.keys || !Array.isArray(input.keys)) return null;\n if (!input.keys.length) return [];\n\n let contents: StringIndexable<T>[] = [];\n let errFlag = false;\n\n const batchedKeys = chunkifyArray(input.keys, BATCH_SIZE);\n const chunkedKeys = chunkifyArray(batchedKeys, CHUNK_SIZE);\n\n for (let i = 0; i < chunkedKeys.length; i += 1) {\n const bchunks = chunkedKeys[i];\n\n const brlist = bchunks.map(ikeys => batchReadItems(input.table, ikeys, input.projection, input.attrNames));\n const bslist = await Promise.all(brlist); // eslint-disable-line no-await-in-loop\n\n const icontents = bslist.flat();\n const isError = icontents.find(e => e === null) === null;\n if (isError) {\n errFlag = true;\n return null;\n }\n if (!errFlag) {\n contents = contents.concat(icontents as StringIndexable[]);\n }\n }\n\n return contents;\n};\n\nexport interface QueryItemsInput {\n table: string;\n indexName?: string;\n cond: string;\n attr: StringIndexable;\n attrNames?: StringIndexable;\n projection?: string;\n desc?: boolean;\n}\n\n/**\n * Query items from a DynamoDB table based on some condition\n * @param input input command object\n * @returns query results array, null in case of error\n *\n * ```js\n * dbQueryItems({\n * table: 'lesson_list',\n * indexName: 'status-revision-index',\n * cond: 'status = :comp AND #rev >= :rev',\n * attr: { ':comp': 'completed', ':rev': 9 },\n * attrNames: { '#rev': 'revision' },\n * projection: 'id, lesson, status, revision',\n * });\n *\n * interface QueryItemsInput {\n * table: string;\n * indexName?: string;\n * cond: string;\n * attr: StringIndexable;\n * attrNames?: StringIndexable;\n * projection?: string;\n * desc?: boolean;\n * }\n * ```\n */\nexport const queryItems = async (input: QueryItemsInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.cond || !input.attr) return null;\n\n let contents: StringIndexable[] = [];\n const desc = input.desc || false;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Query.html\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: input.table,\n KeyConditionExpression: input.cond,\n ExpressionAttributeValues: input.attr,\n // FilterExpression: \"contains (category_id, :cid)\",\n };\n\n if (input.indexName) cmdParams = { ...cmdParams, IndexName: input.indexName };\n if (input.attrNames) cmdParams = { ...cmdParams, ExpressionAttributeNames: input.attrNames };\n if (input.projection) cmdParams = { ...cmdParams, ProjectionExpression: input.projection };\n if (desc) cmdParams = { ...cmdParams, ScanIndexForward: false };\n\n const command = new QueryCommand(cmdParams);\n\n try {\n const results = await dbClient.client.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 return null;\n // throw err;\n }\n\n return contents;\n};\n\nexport interface ScanItemsInput {\n table: string;\n projection?: string;\n}\n\n/**\n * Scan all items in a DynamoDB table\n * Note: avoid using this method in favour of `queryItems` method due to performance reasons\n * @param input input command object\n * @returns results of the scan query, null in case of error\n *\n * ```js\n * scanItems({\n * table: 'lesson_list',\n * projection: 'id, status',\n * });\n *\n * interface ScanItemsInput {\n * table: string;\n * projection?: string;\n * }\n * ```\n */\nexport const scanItems = async (input: ScanItemsInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table) return null;\n\n let contents: StringIndexable[] = [];\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: input.table,\n };\n\n if (input.projection) cmdParams = { ...cmdParams, ProjectionExpression: input.projection };\n\n const command = new ScanCommand(cmdParams);\n\n try {\n const results = await dbClient.client.send(command);\n const items = results.Items;\n\n // Ref: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Scan.html#Scan.Pagination\n if (results.LastEvaluatedKey) {\n warn('[scanItems] Partial results obtained! Consider pagination.');\n }\n\n if (items) {\n contents = items;\n }\n } catch (err) {\n console.error('ScanCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return contents;\n};\n\nexport interface DeleteItemInput {\n table: string;\n key: StringIndexable;\n}\n\n/**\n * Delete an item in a DynamoDB table\n * @param input input command object\n * @returns true if successful, null in case of error\n *\n * ```js\n * deleteItem({\n * table: 'lesson_list',\n * key: { id: 'id_001' },\n * });\n *\n * interface DeleteItemInput {\n * table: string;\n * key: StringIndexable;\n * }\n * ```\n */\nexport const deleteItem = async (input: DeleteItemInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.key) return null;\n\n const cmdParams: DeleteCommandInput = { TableName: input.table, Key: input.key };\n const command = new DeleteCommand(cmdParams);\n\n try {\n await dbClient.client.send(command);\n } catch (err) {\n console.error('DeleteCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\n// Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-example-table-read-write-batch.html\n// Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-dynamodb/interfaces/batchwriteitemcommandinput.html#requestitems\nconst batchDeleteItems = async (table: string, keys: StringIndexable[]) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!table || !keys || !Array.isArray(keys)) return null;\n if (!keys.length) return true;\n\n const reqList = keys.map(key => ({ DeleteRequest: { Key: key } }));\n const cmdParams: BatchWriteCommandInput = {\n RequestItems: {\n [table]: reqList,\n },\n };\n\n const command = new BatchWriteCommand(cmdParams);\n\n try {\n await dbClient.client.send(command);\n } catch (err) {\n console.error('BatchWriteCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nexport interface DeleteItemsAllInput {\n table: string;\n keys: StringIndexable[];\n}\n\n/**\n * Delete a list of items in a DynamoDB table\n * @param input input command object\n * @returns true if successful, null in case of error\n *\n * ```js\n * deleteItemsAll({\n * table: 'lesson_list',\n * keys: [{ id: 'id_001' }, { id: 'id_002' }],\n * });\n *\n * interface DeleteItemsAllInput {\n * table: string;\n * keys: StringIndexable[];\n * }\n * ```\n */\nexport const deleteItemsAll = async (input: DeleteItemsAllInput) => {\n if (!dbClient.client) tryInit();\n if (!dbClient.client) return null;\n if (!input.table || !input.keys || !Array.isArray(input.keys)) return null;\n if (!input.keys.length) return true;\n\n let errFlag = false;\n\n const batchedItems = chunkifyArray(input.keys, BATCH_SIZE);\n const chunkedItems = chunkifyArray(batchedItems, CHUNK_SIZE);\n\n for (let i = 0; i < chunkedItems.length; i += 1) {\n const bchunks = chunkedItems[i];\n\n const brlist = bchunks.map(ikeys => batchDeleteItems(input.table, ikeys));\n const bslist = await Promise.all(brlist); // eslint-disable-line no-await-in-loop\n\n const isSuccess = bslist.every(e => e === true);\n if (!isSuccess) errFlag = true;\n }\n\n return errFlag ? null : true;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@aws-sdk/client-s3\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"mime-types\");","/**\n * Examples:\n * Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/s3-examples.html\n */\n\nimport path from 'path';\nimport { Readable } from 'stream';\nimport fs from 'fs';\nimport {\n S3Client,\n PutObjectCommand,\n PutObjectCommandInput,\n GetObjectCommand,\n GetObjectCommandInput,\n ListObjectsV2Command,\n ListObjectsV2CommandInput,\n HeadObjectCommand,\n HeadObjectCommandInput,\n DeleteObjectCommand,\n DeleteObjectCommandInput,\n DeleteObjectsCommand,\n DeleteObjectsCommandInput,\n} from '@aws-sdk/client-s3';\nimport short from 'short-uuid';\nimport mime from 'mime-types';\nimport { chunkifyArray } from '@baadal-sdk/utils';\n\nimport { StringIndexable } from 'src/common/common.model';\nimport { assertPath, fileHash } from '../utils';\nimport { s3Client } from './client';\nimport { CustomError } from '../common/error';\nimport { warn, error } from '../common/logger';\nimport { BATCH_SIZE, CHUNK_SIZE } from '../common/const';\n\n// import { Upload } from \"@aws-sdk/lib-storage\";\n// Multipart upload: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_lib_storage.html\n\nconst AWSS3Error = (msg: string) => new CustomError(msg, { name: 'AWSS3Error' });\n\n/** @internal */\nexport const init = (region: string) => {\n // Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/index.html\n if (!s3Client.client) {\n const awsS3Client = new S3Client({ region }); // may also pass `credentials`\n s3Client.client = awsS3Client;\n s3Client.id = short.uuid();\n return true;\n }\n return false;\n};\n\n/** @internal */\nexport const status = () => s3Client.id;\n\nconst tryInit = (silent = false) => {\n if (s3Client.client) return;\n const region = process.env.AWS_REGION || '';\n if (region) {\n if (init(region)) {\n // console.log('Auto-initialization of S3 successful');\n return;\n }\n }\n if (!silent) {\n // throw AWSS3Error('AWS S3 is possibly uninitialized!');\n throw AWSS3Error('Could not auto-initialize AWS S3!');\n }\n};\n\n// auto-initialize on load\ntryInit(true);\n\n/**\n * Create a new file in S3 bucket\n * @param bucket S3 bucket name\n * @param s3path S3 path to be created\n * @param contents contents of the file to be created\n * @returns true if the write is successful, null in case of error\n */\nexport const putObject = async (bucket: string, s3path: string, contents: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3path || !contents) return null;\n\n let baseParams: PutObjectCommandInput | null = null;\n\n try {\n baseParams = {\n Bucket: bucket,\n Key: s3path,\n Body: '<contents>',\n ContentType: 'text/plain; charset=utf-8',\n ACL: 'public-read',\n // CacheControl: 'max-age=86400,public',\n };\n const cmdParams: PutObjectCommandInput = { ...baseParams, Body: contents };\n const command = new PutObjectCommand(cmdParams);\n\n await s3Client.client.send(command);\n } catch (err) {\n console.error('PutObjectCommandInput:', baseParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\n/**\n * Upload a file to S3 bucket\n * @param bucket S3 bucket name\n * @param file (local) path of the file to upload\n * @param s3path [optional] S3 path to be created, if not provided then derived from `file` path\n * @returns true if the write is successful, null in case of error\n */\nexport const uploadFile = async (bucket: string, file: string, s3path?: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !file) return null;\n\n const filepath = assertPath(file);\n const basename = path.basename(filepath);\n const ext = basename.substr(basename.lastIndexOf('.'));\n const contentType = mime.lookup(ext);\n if (!contentType) {\n error(`Could not detect file type for: ${basename} [${filepath}]`);\n return null;\n }\n\n if (!s3path) {\n if (file !== filepath) {\n s3path = file;\n } else {\n s3path = basename;\n }\n }\n\n let baseParams: PutObjectCommandInput | null = null;\n\n try {\n const hash = (await fileHash(filepath)) || '';\n const fileStream = fs.createReadStream(filepath);\n\n baseParams = {\n Bucket: bucket,\n Key: s3path,\n Body: '<fileStream>',\n ContentType: contentType,\n ACL: 'public-read',\n // CacheControl: 'max-age=86400,public',\n Metadata: { hash },\n };\n const cmdParams: PutObjectCommandInput = { ...baseParams, Body: fileStream };\n const command = new PutObjectCommand(cmdParams);\n\n await s3Client.client.send(command);\n } catch (err) {\n console.error('PutObjectCommandInput:', baseParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\n/**\n * Upload a list of files to S3 bucket\n * @param bucket S3 bucket name\n * @param files (local) list of file paths to upload\n * @param s3paths [optional] S3 path to be created, if not provided then derived from `file` path\n * @returns true if all uploads are successful, null in case of error\n */\nexport const uploadFilesAll = async (bucket: string, files: string[], s3paths?: string[]) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !files || !Array.isArray(files)) return null;\n if (!files.length) return true;\n if (s3paths && (!Array.isArray(s3paths) || !s3paths.length || files.length !== s3paths.length)) return null;\n\n let errFlag = false;\n\n const chunkedFiles = chunkifyArray(files, CHUNK_SIZE);\n const chunkedPaths = s3paths ? chunkifyArray(s3paths, CHUNK_SIZE) : chunkedFiles;\n\n for (let i = 0; i < chunkedFiles.length; i += 1) {\n const filesChunk = chunkedFiles[i];\n const pathsChunk = chunkedPaths[i];\n const pList = filesChunk.map((item, j) => uploadFile(bucket, item, pathsChunk[j]));\n const rList = await Promise.all(pList); // eslint-disable-line no-await-in-loop\n\n const isSuccess = rList.every(e => e === true);\n if (!isSuccess) errFlag = true;\n }\n\n return errFlag ? null : true;\n};\n\n/**\n * Get the contents of a file in S3 bucket\n * @param bucket S3 bucket name\n * @param s3path S3 path of the file to be read\n * @returns contents of the file, null in case of error\n */\nexport const getObject = async (bucket: string, s3path: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3path) return null;\n\n let contents: string | null = null;\n const cmdParams: GetObjectCommandInput = { Bucket: bucket, Key: s3path };\n const command = new GetObjectCommand(cmdParams);\n\n try {\n // helper function to convert a ReadableStream to a string\n const streamToString = (stream: Readable): Promise<string> =>\n new Promise((resolve, reject) => {\n const chunks: Uint8Array[] = [];\n stream.on('data', chunk => chunks.push(chunk));\n stream.on('error', reject);\n stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));\n });\n\n const data = await s3Client.client.send(command);\n const bodyContents = await streamToString(data.Body as Readable);\n // const metaData = data.Metadata;\n\n if (bodyContents) {\n contents = bodyContents as string;\n }\n } catch (err) {\n console.error('GetObjectCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return contents;\n};\n\n/**\n * Download a file from S3 bucket\n * @param bucket S3 bucket name\n * @param s3path S3 path of the file to be downloaded\n * @param outPath [optional] path where the downloaded file is written, if not provided then derived from `s3path`\n * @returns true if download is successful, null in case of error\n */\nexport const downloadFile = async (bucket: string, s3path: string, outPath?: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3path) return null;\n\n if (!outPath) outPath = s3path;\n outPath = assertPath(outPath);\n const cmdParams: GetObjectCommandInput = { Bucket: bucket, Key: s3path };\n const command = new GetObjectCommand(cmdParams);\n\n try {\n // helper function to write a ReadableStream to a file\n const writeStreamToFile = (stream: Readable): Promise<void> =>\n new Promise((resolve, reject) => {\n // Ref: https://stackabuse.com/writing-to-files-in-node-js/\n const writeStream = fs.createWriteStream(outPath as string);\n stream.on('data', chunk => writeStream.write(chunk));\n stream.on('error', reject);\n stream.on('end', () => resolve(writeStream.close()));\n });\n\n const data = await s3Client.client.send(command);\n await writeStreamToFile(data.Body as Readable);\n // const metaData = data.Metadata;\n } catch (err: any) {\n if (err.name !== 'NoSuchKey') {\n console.error('GetObjectCommandInput:', cmdParams);\n console.error(err);\n }\n return null;\n // throw err;\n }\n\n return true;\n};\n\n/**\n * List objects in a S3 bucket\n * @param bucket S3 bucket name\n * @param prefix [optional] prefix for object names in the bucket\n * @returns list of objects in the S3 bucket (optionally starting with the given prefix), null in case of error\n */\nexport const listObjects = async (bucket: string, prefix?: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket) return null;\n\n let filesList: string[] = [];\n\n let cmdParams: ListObjectsV2CommandInput = { Bucket: bucket };\n if (prefix) cmdParams = { ...cmdParams, Prefix: prefix };\n const command = new ListObjectsV2Command(cmdParams);\n\n try {\n const results = await s3Client.client.send(command);\n const items = results.Contents;\n\n // Ref: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html\n if (results.IsTruncated) {\n warn('[listObjects] Partial results obtained! Consider pagination.');\n }\n\n if (items) {\n filesList = items.map(t => t.Key).filter(e => !!e) as string[];\n }\n } catch (err) {\n console.error('ListObjectsV2CommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return filesList;\n};\n\n/**\n * Get head content for a file in S3 bucket\n * @param bucket S3 bucket name\n * @param s3path S3 path of the file\n * @returns head content for the given file, null in case of error\n */\nexport const getObjectHead = async (bucket: string, s3path: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3path) return null;\n\n let contents: HeadObject | null = null;\n\n const cmdParams: HeadObjectCommandInput = { Bucket: bucket, Key: s3path };\n const command = new HeadObjectCommand(cmdParams);\n\n try {\n const data = await s3Client.client.send(command);\n if (data) {\n const { ContentLength, ContentType, ETag, CacheControl, Expires, LastModified, Metadata } = data;\n contents = { Key: s3path, ContentLength, ContentType, ETag, CacheControl, Expires, LastModified, Metadata };\n }\n } catch (err: any) {\n if (err.name !== 'NotFound') {\n console.error('HeadObjectCommandInput:', cmdParams);\n console.error(err);\n }\n return null;\n // throw err;\n }\n\n return contents;\n};\n\n/**\n * Get head contents for a list of files in S3 bucket\n * @param bucket S3 bucket name\n * @param s3paths list of S3 paths of the files\n * @returns head contents for the given files, null in case of error\n */\nexport const getObjectHeadsAll = async (bucket: string, s3paths: string[]) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3paths || !Array.isArray(s3paths)) return null;\n if (!s3paths.length) return [];\n\n let contents: (HeadObject | null)[] = [];\n\n const chunkedItems = chunkifyArray(s3paths, CHUNK_SIZE);\n\n for (let i = 0; i < chunkedItems.length; i += 1) {\n const chunk = chunkedItems[i];\n const pList = chunk.map(item => getObjectHead(bucket, item));\n const rList = await Promise.all(pList); // eslint-disable-line no-await-in-loop\n\n contents = contents.concat(rList);\n }\n\n if (contents.length) {\n contents = contents.filter(e => !!e);\n }\n\n return contents as HeadObject[];\n};\n\n/**\n * Delete a file in S3 bucket\n * @param bucket S3 bucket name\n * @param s3path S3 file path to be deleted\n * @returns true if delete is successful, null in case of error\n */\nexport const deleteObject = async (bucket: string, s3path: string) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3path) return null;\n\n const cmdParams: DeleteObjectCommandInput = { Bucket: bucket, Key: s3path };\n const command = new DeleteObjectCommand(cmdParams);\n\n try {\n await s3Client.client.send(command);\n } catch (err) {\n console.error('DeleteObjectCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\nconst batchDeleteObjects = async (bucket: string, s3paths: string[]) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3paths || !Array.isArray(s3paths)) return null;\n if (!s3paths.length) return true;\n\n const keys = s3paths.map(key => ({ Key: key }));\n const cmdParams: DeleteObjectsCommandInput = { Bucket: bucket, Delete: { Objects: keys } };\n const command = new DeleteObjectsCommand(cmdParams);\n\n try {\n await s3Client.client.send(command);\n } catch (err) {\n console.error('DeleteObjectsCommandInput:', cmdParams);\n console.error(err);\n return null;\n // throw err;\n }\n\n return true;\n};\n\n/**\n * Delete a list of files in S3 bucket\n * @param bucket S3 bucket name\n * @param s3paths list of S3 file paths to be deleted\n * @returns true if all deletes are successful, null in case of error\n */\nexport const deleteObjectsAll = async (bucket: string, s3paths: string[]) => {\n if (!s3Client.client) tryInit();\n if (!s3Client.client) return null;\n if (!bucket || !s3paths || !Array.isArray(s3paths)) return null;\n if (!s3paths.length) return true;\n\n let errFlag = false;\n\n const batchedFiles = chunkifyArray(s3paths, BATCH_SIZE);\n const chunkedFiles = chunkifyArray(batchedFiles, CHUNK_SIZE);\n\n for (let i = 0; i < chunkedFiles.length; i += 1) {\n const batchFiles = chunkedFiles[i];\n\n const brlist = batchFiles.map(paths => batchDeleteObjects(bucket, paths));\n const bslist = await Promise.all(brlist); // eslint-disable-line no-await-in-loop\n\n const isSuccess = bslist.every(e => e === true);\n if (!isSuccess) errFlag = true;\n }\n\n return errFlag ? null : true;\n};\n\nexport interface HeadObject {\n Key: string;\n ContentLength?: number;\n ContentType?: string;\n ETag?: string;\n CacheControl?: string;\n Expires?: Date;\n LastModified?: Date;\n Metadata?: StringIndexable;\n}\n","import * as db from './db';\nimport * as s3 from './s3';\nimport { warn, error } from '../common/logger';\n\n// Ref: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html\n// Types: https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_types.html\n\nconst { init: dbInit, status: dbStatus } = db;\nconst { init: s3Init, status: s3Status } = s3;\n\n/**\n * @deprecated explicit init deprecated!\n */\nexport const init = (region: string) => {\n warn('[@baadal-sdk/dapi] aws explicit init deprecated!');\n if (!region) {\n error(`AWS initialization error! Missing region: ${region}`);\n return false;\n }\n\n const cond1 = dbInit(region);\n const cond2 = s3Init(region);\n return cond1 && cond2;\n};\n\nexport const status = () => {\n return {\n db: dbStatus(),\n s3: s3Status(),\n };\n};\n\nexport { db, s3 }; // 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';\nimport * as utils from './utils';\n\n// Ref: https://stackoverflow.com/a/41283945\nexport { fs, aws, gh, utils }; // named exports\nexport default { fs, aws, gh, utils }; // 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","console","log","cwarn","warn","cerror","error","window","chalk","i","assertPath","p","startsWith","path","process","cwd","sha1Hash","data","hashSum","crypto","update","digest","sha256Hash","fileHash","file","contents","fsa","CustomError","message","options","Error","captureStackTrace","name","existsFileSync","loud","fs","e","existsDirSync","dir","readFile","readFileSync","readDir","hiddenItems","dirs","files","withFileTypes","forEach","item","isDirectory","push","isFile","filter","f","readDirFiles","readDirDirs","readDirFilesRecHelper","basePath","dirPath","readDirObj","allFiles","map","absDirs","pList","dirx","Promise","all","filesx","readDirFilesRec","writeFile","substring","lastIndexOf","recursive","appendToFile","renameFile","oldpath","newpath","createDir","deleteFile","deleteDir","rimraf","rimrafPr","util","dbClient","client","id","s3Client","CHUNK_SIZE","DynamoDBError","msg","init","region","dydbClient","DynamoDBClient","DynamoDBDocumentClient","short","status","tryInit","silent","env","AWS_REGION","writeItemForceHelper","table","imax","cmdParams","TableName","Item","ConditionExpression","command","PutCommand","numberOfAttempts","send","ret","writeItemForce","input","writeItemUnique","writeItem","batchWriteItems","items","Array","isArray","length","reqList","PutRequest","RequestItems","BatchWriteCommand","writeItemsAll","errFlag","batchedItems","chunkifyArray","chunkedItems","bchunks","brlist","iItems","every","updateItem","attr","Key","UpdateExpression","ExpressionAttributeValues","attrNames","ExpressionAttributeNames","UpdateCommand","readItem","projection","ProjectionExpression","GetCommand","results","batchReadItems","keys","reqParams","Keys","BatchGetCommand","Responses","readItemsAll","batchedKeys","chunkedKeys","ikeys","bslist","icontents","flat","find","concat","queryItems","cond","desc","KeyConditionExpression","indexName","IndexName","ScanIndexForward","QueryCommand","Items","scanItems","ScanCommand","LastEvaluatedKey","deleteItem","DeleteCommand","batchDeleteItems","DeleteRequest","deleteItemsAll","AWSS3Error","awsS3Client","S3Client","putObject","bucket","s3path","baseParams","Bucket","Body","ContentType","ACL","PutObjectCommand","uploadFile","filepath","basename","ext","substr","contentType","mime","hash","fileStream","Metadata","uploadFilesAll","s3paths","chunkedFiles","chunkedPaths","filesChunk","pathsChunk","j","getObject","GetObjectCommand","streamToString","stream","resolve","reject","chunks","on","chunk","Buffer","toString","bodyContents","downloadFile","outPath","writeStreamToFile","writeStream","write","close","listObjects","prefix","filesList","Prefix","ListObjectsV2Command","Contents","IsTruncated","t","getObjectHead","HeadObjectCommand","ContentLength","ETag","CacheControl","Expires","LastModified","getObjectHeadsAll","rList","deleteObject","DeleteObjectCommand","batchDeleteObjects","Delete","Objects","DeleteObjectsCommand","deleteObjectsAll","batchedFiles","batchFiles","paths","dbInit","db","dbStatus","s3Init","s3","s3Status","cond1","cond2","github","owner","initializationError","authToken","account","Octokit","auth","getContent","repo","request","ghResp","response","headers","aws","gh","utils"],"sourceRoot":""}
|
package/dist/esm/package.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
|
|
2
|
-
import { S3Client } from '@aws-sdk/client-s3';
|
|
3
|
-
export declare const dbClient: DBClientType;
|
|
4
|
-
export declare const s3Client: S3ClientType;
|
|
5
|
-
export interface DBClientType {
|
|
6
|
-
client: DynamoDBDocumentClient | null;
|
|
7
|
-
id: string | null;
|
|
8
|
-
}
|
|
9
|
-
export interface S3ClientType {
|
|
10
|
-
client: S3Client | null;
|
|
11
|
-
id: string | null;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/aws/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAK9C,eAAO,MAAM,QAAQ,cAAoD,CAAC;AAC1E,eAAO,MAAM,QAAQ,cAAoD,CAAC;AAE1E,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB"}
|
package/dist/types/aws/db.d.ts
DELETED
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Examples:
|
|
3
|
-
* Ref: https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/dynamodb-examples.html
|
|
4
|
-
*
|
|
5
|
-
* Partition key vs Composite primary key:
|
|
6
|
-
* Ref: https://aws.amazon.com/premiumsupport/knowledge-center/primary-key-dynamodb-table/
|
|
7
|
-
*/
|
|
8
|
-
import { StringIndexable } from '../common/common.model';
|
|
9
|
-
export interface WriteItemForceInput<T = any> {
|
|
10
|
-
table: string;
|
|
11
|
-
item: T;
|
|
12
|
-
key?: string;
|
|
13
|
-
}
|
|
14
|
-
export type WriteItemUniqueInput<T = any> = WriteItemForceInput<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Write an item to a DynamoDB table, retry in case of key conflict
|
|
17
|
-
* @param input input command object
|
|
18
|
-
* @returns the created item, null in case of error
|
|
19
|
-
*
|
|
20
|
-
* ```js
|
|
21
|
-
* writeItemForce({
|
|
22
|
-
* table: 'lesson_list',
|
|
23
|
-
* item: { title: 'My Lesson' },
|
|
24
|
-
* key: 'id',
|
|
25
|
-
* });
|
|
26
|
-
*
|
|
27
|
-
* interface WriteItemForceInput<T = any> {
|
|
28
|
-
* table: string;
|
|
29
|
-
* item: T;
|
|
30
|
-
* key?: string; // default: `id`
|
|
31
|
-
* }
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare const writeItemForce: <T = any>(input: WriteItemForceInput<T>) => Promise<T | null>;
|
|
35
|
-
/**
|
|
36
|
-
* Write an item (uniquely) to a DynamoDB table.
|
|
37
|
-
* Unlike `writeItemForce`, it does not retry in case of key conflict
|
|
38
|
-
* Unlike `writeItem`, it does not overwrite an item with the same key (if it exists)
|
|
39
|
-
* @param input input command object
|
|
40
|
-
* @returns the created item, null in case of error or key conflict (i.e., if item with same key already exists)
|
|
41
|
-
*
|
|
42
|
-
* ```js
|
|
43
|
-
* writeItemUnique({
|
|
44
|
-
* table: 'lesson_list',
|
|
45
|
-
* item: { id: 'id_001', title: 'My Lesson' },
|
|
46
|
-
* key: 'id',
|
|
47
|
-
* });
|
|
48
|
-
*
|
|
49
|
-
* interface WriteItemUniqueInput<T = any> {
|
|
50
|
-
* table: string;
|
|
51
|
-
* item: T;
|
|
52
|
-
* key?: string; // default: `id`
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
export declare const writeItemUnique: <T = any>(input: WriteItemUniqueInput<T>) => Promise<T | null>;
|
|
57
|
-
export interface WriteItemInput {
|
|
58
|
-
table: string;
|
|
59
|
-
item: StringIndexable;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Write an item to a DynamoDB table
|
|
63
|
-
* @param input input command object
|
|
64
|
-
* @returns true if successful, null in case of error
|
|
65
|
-
*
|
|
66
|
-
* ```js
|
|
67
|
-
* writeItem({
|
|
68
|
-
* table: 'lesson_list',
|
|
69
|
-
* item: { id: 'id_001', title: 'My Lesson' },
|
|
70
|
-
* });
|
|
71
|
-
*
|
|
72
|
-
* interface WriteItemInput {
|
|
73
|
-
* table: string;
|
|
74
|
-
* item: StringIndexable;
|
|
75
|
-
* }
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare const writeItem: (input: WriteItemInput) => Promise<true | null>;
|
|
79
|
-
export interface WriteItemsAllInput {
|
|
80
|
-
table: string;
|
|
81
|
-
items: StringIndexable[];
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Write a list of items to a DynamoDB table
|
|
85
|
-
* @param input input command object
|
|
86
|
-
* @returns true if successful, null in case of error
|
|
87
|
-
*
|
|
88
|
-
* ```js
|
|
89
|
-
* writeItemsAll({
|
|
90
|
-
* table: 'lesson_list',
|
|
91
|
-
* items: [{ id: 'id_001', title: 'My Lesson' }, { id: 'id_002', title: 'My Lesson 2' }],
|
|
92
|
-
* });
|
|
93
|
-
*
|
|
94
|
-
* interface WriteItemInput {
|
|
95
|
-
* table: string;
|
|
96
|
-
* items: StringIndexable[];
|
|
97
|
-
* }
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
export declare const writeItemsAll: (input: WriteItemsAllInput) => Promise<true | null>;
|
|
101
|
-
export interface UpdateItemInput {
|
|
102
|
-
table: string;
|
|
103
|
-
key: StringIndexable;
|
|
104
|
-
update: string;
|
|
105
|
-
attr: StringIndexable;
|
|
106
|
-
attrNames?: StringIndexable;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Update an item in DynamoDB table
|
|
110
|
-
* @param input input command object
|
|
111
|
-
* @returns true if successful, null in case of error
|
|
112
|
-
*
|
|
113
|
-
* ```js
|
|
114
|
-
* updateItem({
|
|
115
|
-
* table: 'lesson_list',
|
|
116
|
-
* key: { id: 'id_001' },
|
|
117
|
-
* update: 'SET status = :status, #rev = 10',
|
|
118
|
-
* attr: { ':status': 'completed' },
|
|
119
|
-
* attrNames: { '#rev': 'revision' },
|
|
120
|
-
* });
|
|
121
|
-
*
|
|
122
|
-
* interface UpdateItemInput {
|
|
123
|
-
* table: string;
|
|
124
|
-
* key: StringIndexable;
|
|
125
|
-
* update: string;
|
|
126
|
-
* attr: StringIndexable;
|
|
127
|
-
* attrNames?: StringIndexable;
|
|
128
|
-
* }
|
|
129
|
-
* ```
|
|
130
|
-
*/
|
|
131
|
-
export declare const updateItem: (input: UpdateItemInput) => Promise<true | null>;
|
|
132
|
-
export interface ReadItemInput {
|
|
133
|
-
table: string;
|
|
134
|
-
key: StringIndexable;
|
|
135
|
-
projection?: string;
|
|
136
|
-
attrNames?: StringIndexable;
|
|
137
|
-
loud?: boolean;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Read an item from DynamoDB table
|
|
141
|
-
* @param input input command object
|
|
142
|
-
* @returns item contents, null in case of error
|
|
143
|
-
*
|
|
144
|
-
* ```js
|
|
145
|
-
* readItem({
|
|
146
|
-
* table: 'lesson_list',
|
|
147
|
-
* key: { id: 'id_001' },
|
|
148
|
-
* projection: 'id, lesson, status',
|
|
149
|
-
* });
|
|
150
|
-
*
|
|
151
|
-
* interface ReadItemInput {
|
|
152
|
-
* table: string;
|
|
153
|
-
* key: StringIndexable;
|
|
154
|
-
* projection?: string;
|
|
155
|
-
* attrNames?: StringIndexable;
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
export declare const readItem: <T = any>(input: ReadItemInput) => Promise<T | null>;
|
|
160
|
-
export interface ReadItemsAllInput {
|
|
161
|
-
table: string;
|
|
162
|
-
keys: StringIndexable[];
|
|
163
|
-
projection?: string;
|
|
164
|
-
attrNames?: StringIndexable;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Read a list of items from DynamoDB table
|
|
168
|
-
* Note: ordering of items in result may not be same as that in `keys`
|
|
169
|
-
* @param input input command object
|
|
170
|
-
* @returns list of contents for items, null in case of error
|
|
171
|
-
*
|
|
172
|
-
* ```js
|
|
173
|
-
* readItemsAll({
|
|
174
|
-
* table: 'lesson_list',
|
|
175
|
-
* keys: [{ id: 'id_001' }, { id: 'id_002' }],
|
|
176
|
-
* projection: 'id, lesson, status',
|
|
177
|
-
* });
|
|
178
|
-
*
|
|
179
|
-
* interface ReadItemsAllInput {
|
|
180
|
-
* table: string;
|
|
181
|
-
* keys: StringIndexable[];
|
|
182
|
-
* projection?: string;
|
|
183
|
-
* attrNames?: StringIndexable;
|
|
184
|
-
* }
|
|
185
|
-
* ```
|
|
186
|
-
*/
|
|
187
|
-
export declare const readItemsAll: <T = any>(input: ReadItemsAllInput) => Promise<StringIndexable<T>[] | null>;
|
|
188
|
-
export interface QueryItemsInput {
|
|
189
|
-
table: string;
|
|
190
|
-
indexName?: string;
|
|
191
|
-
cond: string;
|
|
192
|
-
attr: StringIndexable;
|
|
193
|
-
attrNames?: StringIndexable;
|
|
194
|
-
projection?: string;
|
|
195
|
-
desc?: boolean;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Query items from a DynamoDB table based on some condition
|
|
199
|
-
* @param input input command object
|
|
200
|
-
* @returns query results array, null in case of error
|
|
201
|
-
*
|
|
202
|
-
* ```js
|
|
203
|
-
* dbQueryItems({
|
|
204
|
-
* table: 'lesson_list',
|
|
205
|
-
* indexName: 'status-revision-index',
|
|
206
|
-
* cond: 'status = :comp AND #rev >= :rev',
|
|
207
|
-
* attr: { ':comp': 'completed', ':rev': 9 },
|
|
208
|
-
* attrNames: { '#rev': 'revision' },
|
|
209
|
-
* projection: 'id, lesson, status, revision',
|
|
210
|
-
* });
|
|
211
|
-
*
|
|
212
|
-
* interface QueryItemsInput {
|
|
213
|
-
* table: string;
|
|
214
|
-
* indexName?: string;
|
|
215
|
-
* cond: string;
|
|
216
|
-
* attr: StringIndexable;
|
|
217
|
-
* attrNames?: StringIndexable;
|
|
218
|
-
* projection?: string;
|
|
219
|
-
* desc?: boolean;
|
|
220
|
-
* }
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
export declare const queryItems: (input: QueryItemsInput) => Promise<StringIndexable<any>[] | null>;
|
|
224
|
-
export interface ScanItemsInput {
|
|
225
|
-
table: string;
|
|
226
|
-
projection?: string;
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Scan all items in a DynamoDB table
|
|
230
|
-
* Note: avoid using this method in favour of `queryItems` method due to performance reasons
|
|
231
|
-
* @param input input command object
|
|
232
|
-
* @returns results of the scan query, null in case of error
|
|
233
|
-
*
|
|
234
|
-
* ```js
|
|
235
|
-
* scanItems({
|
|
236
|
-
* table: 'lesson_list',
|
|
237
|
-
* projection: 'id, status',
|
|
238
|
-
* });
|
|
239
|
-
*
|
|
240
|
-
* interface ScanItemsInput {
|
|
241
|
-
* table: string;
|
|
242
|
-
* projection?: string;
|
|
243
|
-
* }
|
|
244
|
-
* ```
|
|
245
|
-
*/
|
|
246
|
-
export declare const scanItems: (input: ScanItemsInput) => Promise<StringIndexable<any>[] | null>;
|
|
247
|
-
export interface DeleteItemInput {
|
|
248
|
-
table: string;
|
|
249
|
-
key: StringIndexable;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Delete an item in a DynamoDB table
|
|
253
|
-
* @param input input command object
|
|
254
|
-
* @returns true if successful, null in case of error
|
|
255
|
-
*
|
|
256
|
-
* ```js
|
|
257
|
-
* deleteItem({
|
|
258
|
-
* table: 'lesson_list',
|
|
259
|
-
* key: { id: 'id_001' },
|
|
260
|
-
* });
|
|
261
|
-
*
|
|
262
|
-
* interface DeleteItemInput {
|
|
263
|
-
* table: string;
|
|
264
|
-
* key: StringIndexable;
|
|
265
|
-
* }
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
export declare const deleteItem: (input: DeleteItemInput) => Promise<true | null>;
|
|
269
|
-
export interface DeleteItemsAllInput {
|
|
270
|
-
table: string;
|
|
271
|
-
keys: StringIndexable[];
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Delete a list of items in a DynamoDB table
|
|
275
|
-
* @param input input command object
|
|
276
|
-
* @returns true if successful, null in case of error
|
|
277
|
-
*
|
|
278
|
-
* ```js
|
|
279
|
-
* deleteItemsAll({
|
|
280
|
-
* table: 'lesson_list',
|
|
281
|
-
* keys: [{ id: 'id_001' }, { id: 'id_002' }],
|
|
282
|
-
* });
|
|
283
|
-
*
|
|
284
|
-
* interface DeleteItemsAllInput {
|
|
285
|
-
* table: string;
|
|
286
|
-
* keys: StringIndexable[];
|
|
287
|
-
* }
|
|
288
|
-
* ```
|
|
289
|
-
*/
|
|
290
|
-
export declare const deleteItemsAll: (input: DeleteItemsAllInput) => Promise<true | null>;
|
|
291
|
-
//# sourceMappingURL=db.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../../../src/aws/db.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAgFzD,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,GAAG;IAC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-
import * as s3 from './s3';
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated explicit init deprecated!
|
|
5
|
-
*/
|
|
6
|
-
export declare const init: (region: string) => boolean;
|
|
7
|
-
export declare const status: () => {
|
|
8
|
-
db: string | null;
|
|
9
|
-
s3: string | null;
|
|
10
|
-
};
|
|
11
|
-
export { db, s3 };
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/aws/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,MAAM,CAAC;AAS3B;;GAEG;AACH,eAAO,MAAM,IAAI,WAAY,MAAM,YAUlC,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAKlB,CAAC;AAEF,OAAO,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC"}
|