arkos 1.1.39-test → 1.1.40-test

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.
@@ -23,7 +23,7 @@ async function getFileUploaderRouter({ fileUpload }) {
23
23
  basePathname = "/" + basePathname;
24
24
  if (!basePathname.endsWith("/"))
25
25
  basePathname = basePathname + "/";
26
- router.use(basePathname, auth_service_1.default.handleAuthenticationControl("View", authConfigs), auth_service_1.default.handleAccessControl("View", "file-upload", authConfigs), express_2.default.static(path_1.default.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), (0, deepmerge_helper_1.default)({
26
+ router.use(basePathname, auth_service_1.default.handleAuthenticationControl("View", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("View", "file-upload", authConfigs.accessControl), express_2.default.static(path_1.default.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), (0, deepmerge_helper_1.default)({
27
27
  maxAge: "1y",
28
28
  etag: true,
29
29
  lastModified: true,
@@ -32,8 +32,8 @@ async function getFileUploaderRouter({ fileUpload }) {
32
32
  index: false,
33
33
  cacheControl: true,
34
34
  }, fileUpload?.expressStaticOptions || {})));
35
- router.post(`${basePathname}:fileType`, auth_service_1.default.handleAuthenticationControl("Create", authConfigs), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs), file_uploader_controller_1.uploadFile);
36
- router.delete(`${basePathname}:fileType/:fileName`, auth_service_1.default.handleAuthenticationControl("Delete", authConfigs), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs), file_uploader_controller_1.deleteFile);
35
+ router.post(`${basePathname}:fileType`, auth_service_1.default.handleAuthenticationControl("Create", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs.accessControl), file_uploader_controller_1.uploadFile);
36
+ router.delete(`${basePathname}:fileType/:fileName`, auth_service_1.default.handleAuthenticationControl("Delete", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs.accessControl), file_uploader_controller_1.deleteFile);
37
37
  return router;
38
38
  }
39
39
  //# sourceMappingURL=file-uploader.router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":";;;;;AAWA,sDAiDC;AA5DD,qCAAiC;AACjC,uEAA8E;AAC9E,wEAA+C;AAC/C,yEAAoE;AAEpE,gDAAwB;AACxB,sDAA8B;AAC9B,4FAA6D;AAE7D,MAAM,MAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;AAEzB,KAAK,UAAU,qBAAqB,CAAC,EAAE,UAAU,EAAe;IACrE,MAAM,YAAY,GAAG,MAAM,IAAA,yCAAwB,EAAC,aAAa,CAAC,CAAC;IACnE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QACjB,CAAC,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,GAAG,UAAU,EAAE,SAAS,IAAI,eAAe,CAAC;IAE5D,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,YAAY,GAAG,GAAG,GAAG,YAAY,CAAC;IACrE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,YAAY,GAAG,YAAY,GAAG,GAAG,CAAC;IAEnE,MAAM,CAAC,GAAG,CACR,YAAY,EACZ,sBAAW,CAAC,2BAA2B,CAAC,MAAM,EAAE,WAAW,CAAC,EAC5D,sBAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,EACnE,iBAAO,CAAC,MAAM,CACZ,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,aAAa,IAAI,SAAS,CAAC,EACnE,IAAA,0BAAS,EACP;QACE,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,IAAI;KACnB,EACD,UAAU,EAAE,oBAAoB,IAAI,EAAE,CACvC,CACF,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,GAAG,YAAY,WAAW,EAC1B,sBAAW,CAAC,2BAA2B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAC9D,sBAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EACrE,qCAAU,CACX,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,GAAG,YAAY,qBAAqB,EACpC,sBAAW,CAAC,2BAA2B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAC9D,sBAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EACrE,qCAAU,CACX,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Router } from \"express\";\nimport { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\"View\", authConfigs),\n authService.handleAccessControl(\"View\", \"file-upload\", authConfigs),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\"Create\", authConfigs),\n authService.handleAccessControl(\"Create\", \"file-upload\", authConfigs),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\"Delete\", authConfigs),\n authService.handleAccessControl(\"Create\", \"file-upload\", authConfigs),\n deleteFile\n );\n\n return router;\n}\n"]}
1
+ {"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":";;;;;AAYA,sDAsEC;AAlFD,qCAAiC;AACjC,uEAA8E;AAC9E,wEAA+C;AAC/C,yEAAoE;AAEpE,gDAAwB;AACxB,sDAA8B;AAC9B,4FAA6D;AAG7D,MAAM,MAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;AAEzB,KAAK,UAAU,qBAAqB,CAAC,EAAE,UAAU,EAAe;IACrE,MAAM,YAAY,GAAG,MAAM,IAAA,yCAAwB,EAAC,aAAa,CAAC,CAAC;IACnE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAiB,EAAE,GAAG,EAAE,CAAC;IAE/D,IAAI,YAAY,EAAE,CAAC;QACjB,CAAC,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,GAAG,UAAU,EAAE,SAAS,IAAI,eAAe,CAAC;IAE5D,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC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port { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AuthConfigs } from \"../../types/auth\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} as AuthConfigs } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\n \"View\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"View\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\n \"Create\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\n \"Delete\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n deleteFile\n );\n\n return router;\n}\n"]}
package/dist/cjs/proxy.js CHANGED
@@ -1 +1 @@
1
- "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,i,t){t===void 0&&(t=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(r,t,n)}:function(r,e,i,t){t===void 0&&(t=i),r[t]=e[i]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(i){var t=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[t.length]=n);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var t=r(e),n=0;n<t.length;n++)t[n]!=="default"&&__createBinding(i,e,t[n]);return __setModuleDefault(i,e),i}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.arkosProxy=void 0,exports.getCapturedConfig=getCapturedConfig;let capturedConfig=null;exports.arkosProxy={init:r=>(capturedConfig=r,Promise.resolve().then(()=>__importStar(require("../path/to/real/arkos"))).then(e=>e.initApp(r)))};function getCapturedConfig(){return capturedConfig}
1
+ "use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(r,e,o,t){t===void 0&&(t=o);var n=Object.getOwnPropertyDescriptor(e,o);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[o]}}),Object.defineProperty(r,t,n)}:function(r,e,o,t){t===void 0&&(t=o),r[t]=e[o]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),__importStar=this&&this.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(o){var t=[];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[t.length]=n);return t},r(e)};return function(e){if(e&&e.__esModule)return e;var o={};if(e!=null)for(var t=r(e),n=0;n<t.length;n++)t[n]!=="default"&&__createBinding(o,e,t[n]);return __setModuleDefault(o,e),o}}();Object.defineProperty(exports,"__esModule",{value:!0}),exports.arkosProxy=void 0,exports.getCapturedConfig=getCapturedConfig;let capturedConfig=null;exports.arkosProxy={init:r=>(capturedConfig=r,Promise.resolve().then(()=>__importStar(require("../path/to/real/arkos"))).then(e=>e.initApp(r)))};function getCapturedConfig(){return capturedConfig}
@@ -17,7 +17,7 @@ export async function getFileUploaderRouter({ fileUpload }) {
17
17
  basePathname = "/" + basePathname;
18
18
  if (!basePathname.endsWith("/"))
19
19
  basePathname = basePathname + "/";
20
- router.use(basePathname, authService.handleAuthenticationControl("View", authConfigs), authService.handleAccessControl("View", "file-upload", authConfigs), express.static(path.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), deepmerge({
20
+ router.use(basePathname, authService.handleAuthenticationControl("View", authConfigs.authenticationControl), authService.handleAccessControl("View", "file-upload", authConfigs.accessControl), express.static(path.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), deepmerge({
21
21
  maxAge: "1y",
22
22
  etag: true,
23
23
  lastModified: true,
@@ -26,8 +26,8 @@ export async function getFileUploaderRouter({ fileUpload }) {
26
26
  index: false,
27
27
  cacheControl: true,
28
28
  }, fileUpload?.expressStaticOptions || {})));
29
- router.post(`${basePathname}:fileType`, authService.handleAuthenticationControl("Create", authConfigs), authService.handleAccessControl("Create", "file-upload", authConfigs), uploadFile);
30
- router.delete(`${basePathname}:fileType/:fileName`, authService.handleAuthenticationControl("Delete", authConfigs), authService.handleAccessControl("Create", "file-upload", authConfigs), deleteFile);
29
+ router.post(`${basePathname}:fileType`, authService.handleAuthenticationControl("Create", authConfigs.authenticationControl), authService.handleAccessControl("Create", "file-upload", authConfigs.accessControl), uploadFile);
30
+ router.delete(`${basePathname}:fileType/:fileName`, authService.handleAuthenticationControl("Delete", authConfigs.authenticationControl), authService.handleAccessControl("Create", "file-upload", authConfigs.accessControl), deleteFile);
31
31
  return router;
32
32
  }
33
33
  //# sourceMappingURL=file-uploader.router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAE7D,MAAM,MAAM,GAAW,MAAM,EAAE,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAE,UAAU,EAAe;IACrE,MAAM,YAAY,GAAG,MAAM,wBAAwB,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC;IAEhD,IAAI,YAAY,EAAE,CAAC;QACjB,CAAC,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,GAAG,UAAU,EAAE,SAAS,IAAI,eAAe,CAAC;IAE5D,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,YAAY,GAAG,GAAG,GAAG,YAAY,CAAC;IACrE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,YAAY,GAAG,YAAY,GAAG,GAAG,CAAC;IAEnE,MAAM,CAAC,GAAG,CACR,YAAY,EACZ,WAAW,CAAC,2BAA2B,CAAC,MAAM,EAAE,WAAW,CAAC,EAC5D,WAAW,CAAC,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,CAAC,EACnE,OAAO,CAAC,MAAM,CACZ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,aAAa,IAAI,SAAS,CAAC,EACnE,SAAS,CACP;QACE,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,IAAI;KACnB,EACD,UAAU,EAAE,oBAAoB,IAAI,EAAE,CACvC,CACF,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,GAAG,YAAY,WAAW,EAC1B,WAAW,CAAC,2BAA2B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAC9D,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EACrE,UAAU,CACX,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,GAAG,YAAY,qBAAqB,EACpC,WAAW,CAAC,2BAA2B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAC9D,WAAW,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,EAAE,WAAW,CAAC,EACrE,UAAU,CACX,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Router } from \"express\";\nimport { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\"View\", authConfigs),\n authService.handleAccessControl(\"View\", \"file-upload\", authConfigs),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\"Create\", authConfigs),\n authService.handleAccessControl(\"Create\", \"file-upload\", authConfigs),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\"Delete\", authConfigs),\n authService.handleAccessControl(\"Create\", \"file-upload\", authConfigs),\n deleteFile\n );\n\n return router;\n}\n"]}
1
+ {"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,SAAS,MAAM,sCAAsC,CAAC;AAG7D,MAAM,MAAM,GAAW,MAAM,EAAE,CAAC;AAEhC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,EAAE,UAAU,EAAe;IACrE,MAAM,YAAY,GAAG,MAAM,wBAAwB,CAAC,aAAa,CAAC,CAAC;IACnE,IAAI,E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AAC;IAEF,MAAM,CAAC,MAAM,CACX,GAAG,YAAY,qBAAqB,EACpC,WAAW,CAAC,2BAA2B,CACrC,QAAQ,EACR,WAAW,CAAC,qBAAqB,CAClC,EACD,WAAW,CAAC,mBAAmB,CAC7B,QAAQ,EACR,aAAa,EACb,WAAW,CAAC,aAAa,CAC1B,EACD,UAAU,CACX,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Router } from \"express\";\nimport { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AuthConfigs } from \"../../types/auth\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} as AuthConfigs } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\n \"View\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"View\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\n \"Create\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\n \"Delete\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n deleteFile\n );\n\n return router;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkos",
3
- "version": "1.1.39-test",
3
+ "version": "1.1.40-test",
4
4
  "description": "The Express & Prisma Framework For RESTful API",
5
5
  "main": "dist/cjs/exports/index.js",
6
6
  "module": "dist/es2020/exports/index.js",