From d4557709590821ceb675737c95f1e62b9033b9b3 Mon Sep 17 00:00:00 2001 From: Sudharshan TK Date: Tue, 30 Nov 2021 15:13:33 +0530 Subject: [PATCH] Build: Add Support for Obfuscation --- .gitignore | 3 + app.js | 48 +- models/blacklisted-user/index.js | 9 +- models/blacklisted-user/model.js | 9 +- models/blacklisted-user/schema.js | 40 +- models/blacklisted-user/statics.js | 26 +- models/credential/index.js | 9 +- models/credential/model.js | 9 +- models/credential/schema.js | 42 +- models/credential/statics.js | 52 +-- models/frontend/index.js | 9 +- models/frontend/model.js | 9 +- models/frontend/schema.js | 58 +-- models/frontend/statics.js | 77 +--- models/global-setting/index.js | 9 +- models/global-setting/model.js | 9 +- models/global-setting/schema.js | 31 +- models/global-setting/statics.js | 26 +- models/index.js | 35 +- models/pending-user/index.js | 9 +- models/pending-user/model.js | 9 +- models/pending-user/schema.js | 45 +- models/pending-user/statics.js | 26 +- models/policy/index.js | 9 +- models/policy/model.js | 9 +- models/policy/schema.js | 26 +- models/policy/statics.js | 76 +--- models/role/index.js | 9 +- models/role/model.js | 9 +- models/role/schema.js | 55 +-- models/role/statics.js | 76 +--- models/scope/index.js | 9 +- models/scope/model.js | 9 +- models/scope/schema.js | 40 +- models/scope/statics.js | 26 +- models/service-account/index.js | 9 +- models/service-account/model.js | 9 +- models/service-account/schema.js | 51 +-- models/service-account/statics.js | 26 +- models/session/index.js | 9 +- models/session/model.js | 9 +- models/session/schema.js | 39 +- models/session/statics.js | 26 +- models/smtp-mailer/index.js | 9 +- models/smtp-mailer/model.js | 9 +- models/smtp-mailer/schema.js | 41 +- models/smtp-mailer/statics.js | 26 +- models/smtp-provider/index.js | 9 +- models/smtp-provider/model.js | 9 +- models/smtp-provider/schema.js | 50 +-- models/smtp-provider/statics.js | 26 +- models/templates/index.js | 9 +- models/templates/model.js | 9 +- models/templates/schema.js | 33 +- models/templates/statics.js | 26 +- models/tokens/index.js | 9 +- models/tokens/model.js | 9 +- models/tokens/schema.js | 52 +-- models/tokens/statics.js | 26 +- models/user/index.js | 9 +- models/user/model.js | 9 +- models/user/schema.js | 80 +--- models/user/statics.js | 26 +- plugins/auth/index.js | 2 +- plugins/auth/user/create.js | 22 +- plugins/axios/index.js | 9 +- plugins/axios/interceptor.js | 9 +- plugins/crypto/decrypt.js | 45 +- plugins/crypto/encrypt.js | 45 +- plugins/crypto/index.js | 11 +- plugins/db/db.js | 81 +--- plugins/db/helpers/encoder.js | 55 +-- plugins/db/helpers/encryption.js | 63 +-- plugins/db/helpers/fields-picker.js | 30 +- plugins/db/helpers/hash.js | 54 +-- plugins/db/helpers/index.js | 17 +- plugins/db/index.js | 11 +- plugins/db/plugins/base-encode/index.js | 25 +- plugins/db/plugins/encrypt/index.js | 25 +- plugins/db/plugins/hash/index.js | 28 +- plugins/db/plugins/index.js | 13 +- plugins/db/statics/clear-collection.js | 27 +- plugins/db/statics/index.js | 9 +- plugins/google/api/drive/API.js | 16 +- plugins/google/api/drive/about/API.js | 14 +- plugins/google/api/drive/about/fields.js | 10 +- plugins/google/api/drive/about/index.js | 11 +- plugins/google/api/drive/about/methods/get.js | 26 +- .../google/api/drive/about/methods/index.js | 13 +- plugins/google/api/drive/drives/API.js | 40 +- plugins/google/api/drive/drives/fields.js | 11 +- plugins/google/api/drive/drives/index.js | 11 +- .../google/api/drive/drives/methods/create.js | 32 +- .../google/api/drive/drives/methods/get.js | 27 +- .../google/api/drive/drives/methods/index.js | 16 +- .../google/api/drive/drives/methods/list.js | 30 +- .../google/api/drive/drives/methods/update.js | 29 +- plugins/google/api/drive/files/API.js | 55 +-- plugins/google/api/drive/files/fields.js | 39 +- .../google/api/drive/files/handle-query.js | 99 +---- plugins/google/api/drive/files/index.js | 9 +- .../google/api/drive/files/methods/create.js | 2 +- .../google/api/drive/files/methods/delete.js | 25 +- .../api/drive/files/methods/download.js | 25 +- .../api/drive/files/methods/generate-id.js | 26 +- plugins/google/api/drive/files/methods/get.js | 29 +- .../google/api/drive/files/methods/index.js | 2 +- .../google/api/drive/files/methods/list.js | 39 +- .../google/api/drive/files/methods/search.js | 53 +-- plugins/google/api/drive/index.js | 13 +- plugins/google/api/drive/methods.js | 9 +- plugins/google/api/drive/permissions/API.js | 59 +-- .../google/api/drive/permissions/fields.js | 12 +- plugins/google/api/drive/permissions/index.js | 11 +- .../api/drive/permissions/methods/create.js | 29 +- .../api/drive/permissions/methods/delete.js | 29 +- .../api/drive/permissions/methods/get.js | 29 +- .../api/drive/permissions/methods/index.js | 18 +- .../api/drive/permissions/methods/list.js | 28 +- .../api/drive/permissions/methods/update.js | 30 +- plugins/google/api/drive/scopes.js | 11 +- plugins/google/api/iam/API.js | 13 +- plugins/google/api/iam/index.js | 13 +- plugins/google/api/iam/methods.js | 12 +- plugins/google/api/iam/projects/API.js | 22 +- plugins/google/api/iam/projects/index.js | 11 +- .../google/api/iam/projects/methods/get.js | 21 +- .../google/api/iam/projects/methods/index.js | 15 +- .../google/api/iam/projects/methods/list.js | 20 +- plugins/google/api/iam/scopes.js | 6 +- plugins/google/api/iam/service-account/API.js | 70 +-- .../google/api/iam/service-account/index.js | 11 +- .../api/iam/service-account/methods/create.js | 48 +- .../api/iam/service-account/methods/delete.js | 23 +- .../iam/service-account/methods/disable.js | 23 +- .../api/iam/service-account/methods/enable.js | 23 +- .../api/iam/service-account/methods/get.js | 22 +- .../api/iam/service-account/methods/index.js | 20 +- .../api/iam/service-account/methods/list.js | 21 +- plugins/google/api/index.js | 13 +- plugins/google/api/scopes.js | 15 +- plugins/google/handlers/nac/check-token.js | 8 +- plugins/google/handlers/nac/generate-oauth.js | 218 +--------- plugins/google/handlers/nac/generate-token.js | 89 +--- plugins/google/handlers/nac/index.js | 18 +- plugins/google/handlers/nac/revoke-token.js | 47 +- plugins/google/handlers/sac/generate-oauth.js | 74 +--- plugins/google/handlers/sac/generate-token.js | 69 +-- plugins/google/handlers/sac/index.js | 15 +- plugins/google/helpers/API.js | 14 +- plugins/google/helpers/construct-fields.js | 36 +- plugins/google/helpers/index.js | 22 +- plugins/google/helpers/mimetypes.js | 43 +- plugins/google/helpers/requester.js | 207 +-------- plugins/google/helpers/resolve-token.js | 410 +----------------- plugins/google/helpers/sign-jwt.js | 171 +------- plugins/google/helpers/stringize-scope.js | 22 +- plugins/google/index.js | 27 +- plugins/google/routes.js | 13 +- plugins/misc/index.js | 13 +- plugins/misc/isundefined.js | 30 +- plugins/misc/uid.js | 66 +-- plugins/server/generators/endpoint-server.js | 30 +- plugins/server/generators/index.js | 6 +- plugins/server/helpers/get-all-routes.js | 72 +-- plugins/server/helpers/health-check.js | 41 +- plugins/server/helpers/index.js | 13 +- plugins/server/helpers/send-response.js | 14 +- plugins/server/index.js | 9 +- plugins/server/middlewares/cors.js | 67 +-- plugins/server/middlewares/dbchecker.js | 27 +- plugins/server/middlewares/first-setup.js | 156 +------ plugins/server/middlewares/index.js | 14 +- plugins/server/responses/2XX-response.js | 22 +- plugins/server/responses/4XX-response.js | 54 +-- plugins/server/responses/5XX-response.js | 38 +- plugins/server/responses/index.js | 13 +- plugins/server/server.js | 30 +- plugins/templates/global-settings/index.js | 71 +-- .../templates/policies/credentials/index.js | 11 +- .../policies/credentials/policies.js | 30 +- plugins/templates/policies/frontends/index.js | 11 +- .../templates/policies/frontends/policies.js | 30 +- .../policies/global-settings/index.js | 9 +- .../policies/global-settings/policies.js | 18 +- plugins/templates/policies/index.js | 50 +-- plugins/templates/policies/policy/index.js | 9 +- plugins/templates/policies/policy/policies.js | 18 +- plugins/templates/policies/roles/index.js | 11 +- plugins/templates/policies/roles/policies.js | 30 +- plugins/templates/policies/scopes/index.js | 11 +- plugins/templates/policies/scopes/policies.js | 30 +- .../policies/service-accounts/index.js | 11 +- .../policies/service-accounts/policies.js | 30 +- .../templates/policies/smtp-mailer/index.js | 11 +- .../policies/smtp-mailer/policies.js | 30 +- .../policies/smtp-providers/index.js | 11 +- .../policies/smtp-providers/policies.js | 30 +- plugins/templates/policies/user/add/index.js | 28 +- .../templates/policies/user/add/policies.js | 54 +-- .../policies/user/blacklist/index.js | 12 +- .../policies/user/blacklist/policies.js | 36 +- plugins/templates/policies/user/index.js | 44 +- .../templates/policies/user/modify/index.js | 48 +- .../policies/user/modify/policies.js | 84 +--- .../templates/policies/user/remove/index.js | 12 +- .../policies/user/remove/policies.js | 36 +- plugins/templates/roles/index.js | 72 +-- .../roles/policies-map/content-manager.js | 13 +- .../templates/roles/policies-map/manager.js | 34 +- .../templates/roles/policies-map/moderator.js | 17 +- plugins/templates/roles/policies-map/owner.js | 6 +- routes/auth/credentials/index.js | 2 +- routes/auth/index.js | 29 +- routes/auth/policies/index.js | 23 +- routes/auth/roles/index.js | 23 +- routes/first-setup/credentials.js | 55 +-- routes/first-setup/index.js | 26 +- routes/first-setup/policies.js | 61 +-- routes/first-setup/roles.js | 61 +-- routes/first-setup/scope.js | 80 +--- routes/first-setup/settings.js | 23 +- routes/index.js | 31 +- routes/login/google/index.js | 54 +-- routes/login/index.js | 15 +- 225 files changed, 227 insertions(+), 7008 deletions(-) diff --git a/.gitignore b/.gitignore index 220dcab..a8eefa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# output files + # Logs logs *.log @@ -89,6 +91,7 @@ typings/ # Nuxt.js build / generate output .nuxt dist +out # Gatsby files .cache/ diff --git a/app.js b/app.js index 0b55804..bc76cee 100644 --- a/app.js +++ b/app.js @@ -1,47 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var dotenv_1 = __importDefault(require("dotenv")); -// Server -var server_1 = __importDefault(require("./plugins/server")); -var db_1 = __importDefault(require("./plugins/db")); -// Health Check Service -var helpers_1 = require("./plugins/server/helpers"); -// Load ENV Variables to the Process -dotenv_1.default.config(); -// Start the Health Checker Service -(0, helpers_1.healthCheckService)(server_1.default); -// Create Server and Listen on PORT -var PORT = process.env.PORT; -try { - server_1.default.listen(PORT || 3000, function () { - console.log('Server Started'); - console.log('Connecting to Database'); - // Connect to Datbase - db_1.default.connect() - .then(function (mongo) { - if (mongo) { - console.log('Database Connected'); - } - else { - console.log('No Database Url is Found in Environment Variables'); - server_1.default.close(); - } - }) - .catch(function (err) { - console.log("".concat(err.name, ": ").concat(err.message)); - server_1.default.close(); - }); - }); - server_1.default.once('error', function (err) { - console.log('There was an error starting the server in the error listener:', err); - server_1.default.close(); - }); -} -catch (e) { - console.log('There was an error starting the server:', e); - server_1.default.close(); -} +'use strict';var a0_0x60a301=a0_0x2ad5;(function(_0x189dd1,_0x5d6b50){var _0x3316d8=a0_0x2ad5,_0x2b0428=_0x189dd1();while(!![]){try{var _0x290f59=parseInt(_0x3316d8(0x131))/0x1*(-parseInt(_0x3316d8(0x145))/0x2)+parseInt(_0x3316d8(0x138))/0x3+parseInt(_0x3316d8(0x148))/0x4+parseInt(_0x3316d8(0x13a))/0x5*(-parseInt(_0x3316d8(0x12d))/0x6)+parseInt(_0x3316d8(0x142))/0x7*(parseInt(_0x3316d8(0x13c))/0x8)+-parseInt(_0x3316d8(0x141))/0x9*(-parseInt(_0x3316d8(0x137))/0xa)+parseInt(_0x3316d8(0x136))/0xb;if(_0x290f59===_0x5d6b50)break;else _0x2b0428['push'](_0x2b0428['shift']());}catch(_0x4915e9){_0x2b0428['push'](_0x2b0428['shift']());}}}(a0_0x10b5,0x7b53d));var __importDefault=this&&this[a0_0x60a301(0x12c)]||function(_0x2625d2){var _0x4e18f6=a0_0x60a301;return _0x2625d2&&_0x2625d2[_0x4e18f6(0x12f)]?_0x2625d2:{'default':_0x2625d2};};Object[a0_0x60a301(0x139)](exports,'__esModule',{'value':!![]});function a0_0x2ad5(_0x3b20b7,_0x720589){var _0x10b5e8=a0_0x10b5();return a0_0x2ad5=function(_0x2ad582,_0x22e5a2){_0x2ad582=_0x2ad582-0x12b;var _0xd8ae18=_0x10b5e8[_0x2ad582];return _0xd8ae18;},a0_0x2ad5(_0x3b20b7,_0x720589);}var dotenv_1=__importDefault(require(a0_0x60a301(0x12b))),server_1=__importDefault(require(a0_0x60a301(0x12e))),db_1=__importDefault(require(a0_0x60a301(0x135))),helpers_1=require(a0_0x60a301(0x146));function a0_0x10b5(){var _0x4c9c9b=['dotenv','__importDefault','852KwnVxz','./plugins/server','__esModule','error','3992uXMfDv','Database\x20Connected','default','listen','./plugins/db','1147685CaYpDR','110wVLyFg','436779gvefGn','defineProperty','4885KqyQkx','then','8TjPAjx','concat','once','healthCheckService','config','113454anWunC','3887779sVENFB','close','catch','324iaigeQ','./plugins/server/helpers','There\x20was\x20an\x20error\x20starting\x20the\x20server:','1386384kmAwfK','connect','No\x20Database\x20Url\x20is\x20Found\x20in\x20Environment\x20Variables','There\x20was\x20an\x20error\x20starting\x20the\x20server\x20in\x20the\x20error\x20listener:','name','log','Connecting\x20to\x20Database'];a0_0x10b5=function(){return _0x4c9c9b;};return a0_0x10b5();}dotenv_1['default'][a0_0x60a301(0x140)](),(0x0,helpers_1[a0_0x60a301(0x13f)])(server_1[a0_0x60a301(0x133)]);var PORT=process['env']['PORT'];try{server_1[a0_0x60a301(0x133)][a0_0x60a301(0x134)](PORT||0xbb8,function(){var _0x515ffb=a0_0x60a301;console[_0x515ffb(0x14d)]('Server\x20Started'),console[_0x515ffb(0x14d)](_0x515ffb(0x14e)),db_1[_0x515ffb(0x133)][_0x515ffb(0x149)]()[_0x515ffb(0x13b)](function(_0x16ec8e){var _0x7d29c3=_0x515ffb;_0x16ec8e?console['log'](_0x7d29c3(0x132)):(console['log'](_0x7d29c3(0x14a)),server_1[_0x7d29c3(0x133)][_0x7d29c3(0x143)]());})[_0x515ffb(0x144)](function(_0x1da03c){var _0x4762e3=_0x515ffb;console['log'](''[_0x4762e3(0x13d)](_0x1da03c[_0x4762e3(0x14c)],':\x20')[_0x4762e3(0x13d)](_0x1da03c['message'])),server_1['default'][_0x4762e3(0x143)]();});}),server_1[a0_0x60a301(0x133)][a0_0x60a301(0x13e)](a0_0x60a301(0x130),function(_0x3e32b7){var _0x3a8e55=a0_0x60a301;console[_0x3a8e55(0x14d)](_0x3a8e55(0x14b),_0x3e32b7),server_1[_0x3a8e55(0x133)]['close']();});}catch(a0_0x530047){console['log'](a0_0x60a301(0x147),a0_0x530047),server_1[a0_0x60a301(0x133)][a0_0x60a301(0x143)]();} \ No newline at end of file diff --git a/models/blacklisted-user/index.js b/models/blacklisted-user/index.js index 4f3bbe2..acbe20f 100644 --- a/models/blacklisted-user/index.js +++ b/models/blacklisted-user/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a1_0x4bc5aa=a1_0x52bf;(function(_0x40b413,_0x415561){var _0x249d8c=a1_0x52bf,_0x22c2a2=_0x40b413();while(!![]){try{var _0x27218d=-parseInt(_0x249d8c(0x71))/0x1+parseInt(_0x249d8c(0x6a))/0x2*(parseInt(_0x249d8c(0x6e))/0x3)+parseInt(_0x249d8c(0x6f))/0x4+-parseInt(_0x249d8c(0x70))/0x5+parseInt(_0x249d8c(0x68))/0x6*(parseInt(_0x249d8c(0x6b))/0x7)+parseInt(_0x249d8c(0x6d))/0x8*(parseInt(_0x249d8c(0x6c))/0x9)+parseInt(_0x249d8c(0x67))/0xa;if(_0x27218d===_0x415561)break;else _0x22c2a2['push'](_0x22c2a2['shift']());}catch(_0x3ebc37){_0x22c2a2['push'](_0x22c2a2['shift']());}}}(a1_0x4191,0x26b49));var __importDefault=this&&this['__importDefault']||function(_0x50cf81){var _0x33bbf4=a1_0x52bf;return _0x50cf81&&_0x50cf81[_0x33bbf4(0x69)]?_0x50cf81:{'default':_0x50cf81};};function a1_0x4191(){var _0x1e7e3c=['default','1217540prXKiP','186XKZeMe','__esModule','1882ntyQhO','56315MxxQFY','27QupGuf','58728dSvooK','282HVefCS','154908atuOJd','266030MuvgcA','308610rpaXwq','defineProperty'];a1_0x4191=function(){return _0x1e7e3c;};return a1_0x4191();}Object[a1_0x4bc5aa(0x65)](exports,a1_0x4bc5aa(0x69),{'value':!![]}),exports['default']=void 0x0;function a1_0x52bf(_0x374eb3,_0x2a1ea4){var _0x419123=a1_0x4191();return a1_0x52bf=function(_0x52bf20,_0x468245){_0x52bf20=_0x52bf20-0x65;var _0x49dc4d=_0x419123[_0x52bf20];return _0x49dc4d;},a1_0x52bf(_0x374eb3,_0x2a1ea4);}var model_1=require('./model');Object[a1_0x4bc5aa(0x65)](exports,a1_0x4bc5aa(0x66),{'enumerable':!![],'get':function(){var _0x5cfda0=a1_0x4bc5aa;return __importDefault(model_1)[_0x5cfda0(0x66)];}}); \ No newline at end of file diff --git a/models/blacklisted-user/model.js b/models/blacklisted-user/model.js index 6ba7603..f48739d 100644 --- a/models/blacklisted-user/model.js +++ b/models/blacklisted-user/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('BlacklistedUser', schema_1.default); +'use strict';var a2_0x5b75ac=a2_0x1eb7;function a2_0x1eb7(_0x25e432,_0x24e4a3){var _0x45f210=a2_0x45f2();return a2_0x1eb7=function(_0x1eb7ae,_0x3e948c){_0x1eb7ae=_0x1eb7ae-0x84;var _0x31c9bf=_0x45f210[_0x1eb7ae];return _0x31c9bf;},a2_0x1eb7(_0x25e432,_0x24e4a3);}(function(_0x47d7e7,_0x30194b){var _0x2a72f7=a2_0x1eb7,_0x1c0016=_0x47d7e7();while(!![]){try{var _0x218717=parseInt(_0x2a72f7(0x93))/0x1+-parseInt(_0x2a72f7(0x95))/0x2*(-parseInt(_0x2a72f7(0x88))/0x3)+-parseInt(_0x2a72f7(0x85))/0x4*(parseInt(_0x2a72f7(0x8e))/0x5)+parseInt(_0x2a72f7(0x96))/0x6*(parseInt(_0x2a72f7(0x8a))/0x7)+-parseInt(_0x2a72f7(0x8d))/0x8+parseInt(_0x2a72f7(0x8b))/0x9+-parseInt(_0x2a72f7(0x87))/0xa*(parseInt(_0x2a72f7(0x91))/0xb);if(_0x218717===_0x30194b)break;else _0x1c0016['push'](_0x1c0016['shift']());}catch(_0x2f6882){_0x1c0016['push'](_0x1c0016['shift']());}}}(a2_0x45f2,0x6c368));var __importDefault=this&&this[a2_0x5b75ac(0x84)]||function(_0x1e0a74){var _0x4e5f3c=a2_0x5b75ac;return _0x1e0a74&&_0x1e0a74[_0x4e5f3c(0x86)]?_0x1e0a74:{'default':_0x1e0a74};};Object[a2_0x5b75ac(0x8f)](exports,a2_0x5b75ac(0x86),{'value':!![]});function a2_0x45f2(){var _0xaf3a9d=['./schema','3737545IErVJl','2506239QfnxLS','mongoose','4670904uWEIqd','6465VHWMLI','defineProperty','default','475981vqdcmz','model','507958DdYJYk','BlacklistedUser','2smGKax','6HtXGlt','__importDefault','20cvpTqc','__esModule','90ouFSWu','307929MmYFlG'];a2_0x45f2=function(){return _0xaf3a9d;};return a2_0x45f2();}var mongoose_1=require(a2_0x5b75ac(0x8c)),schema_1=__importDefault(require(a2_0x5b75ac(0x89)));exports[a2_0x5b75ac(0x90)]=(0x0,mongoose_1[a2_0x5b75ac(0x92)])(a2_0x5b75ac(0x94),schema_1[a2_0x5b75ac(0x90)]); \ No newline at end of file diff --git a/models/blacklisted-user/schema.js b/models/blacklisted-user/schema.js index 4d16bda..bc27c6a 100644 --- a/models/blacklisted-user/schema.js +++ b/models/blacklisted-user/schema.js @@ -1,39 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'User', - }, - name: { - type: String, - required: true, - encrypt: true, - }, - email: { - type: String, - required: true, - }, - blacklisted_from: { - type: Date, - required: true, - }, - role: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Role', - required: true, - }, - flagged_by: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'User', - required: true, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';var a3_0x11045d=a3_0x1ad7;(function(_0x33d9ba,_0x4b286f){var _0x27b6c8=a3_0x1ad7,_0x42f039=_0x33d9ba();while(!![]){try{var _0xa92eff=parseInt(_0x27b6c8(0x9e))/0x1*(parseInt(_0x27b6c8(0x88))/0x2)+-parseInt(_0x27b6c8(0x9f))/0x3+-parseInt(_0x27b6c8(0x9b))/0x4*(parseInt(_0x27b6c8(0x9d))/0x5)+parseInt(_0x27b6c8(0x8e))/0x6*(parseInt(_0x27b6c8(0x94))/0x7)+-parseInt(_0x27b6c8(0x8a))/0x8*(parseInt(_0x27b6c8(0x9c))/0x9)+parseInt(_0x27b6c8(0x98))/0xa+-parseInt(_0x27b6c8(0x96))/0xb;if(_0xa92eff===_0x4b286f)break;else _0x42f039['push'](_0x42f039['shift']());}catch(_0x4ca3ce){_0x42f039['push'](_0x42f039['shift']());}}}(a3_0x1184,0x75d54));function a3_0x1ad7(_0x261449,_0x2fc2ef){var _0x118483=a3_0x1184();return a3_0x1ad7=function(_0x1ad783,_0x467165){_0x1ad783=_0x1ad783-0x88;var _0xc96bbd=_0x118483[_0x1ad783];return _0xc96bbd;},a3_0x1ad7(_0x261449,_0x2fc2ef);}var __importDefault=this&&this[a3_0x11045d(0x93)]||function(_0x16dfbe){return _0x16dfbe&&_0x16dfbe['__esModule']?_0x16dfbe:{'default':_0x16dfbe};};Object[a3_0x11045d(0x8c)](exports,'__esModule',{'value':!![]});var mongoose_1=require(a3_0x11045d(0x8f)),statics_1=__importDefault(require(a3_0x11045d(0x8b))),plugins_1=require(a3_0x11045d(0x91)),schema=new mongoose_1['Schema']({'_id':{'type':mongoose_1['Schema'][a3_0x11045d(0x90)]['ObjectId'],'ref':a3_0x11045d(0x8d)},'name':{'type':String,'required':!![],'encrypt':!![]},'email':{'type':String,'required':!![]},'blacklisted_from':{'type':Date,'required':!![]},'role':{'type':mongoose_1[a3_0x11045d(0x9a)][a3_0x11045d(0x90)][a3_0x11045d(0x99)],'ref':a3_0x11045d(0x95),'required':!![]},'flagged_by':{'type':mongoose_1[a3_0x11045d(0x9a)][a3_0x11045d(0x90)][a3_0x11045d(0x99)],'ref':a3_0x11045d(0x8d),'required':!![]}});schema[a3_0x11045d(0x97)]((0x0,plugins_1[a3_0x11045d(0x92)])()),exports['default']=(0x0,statics_1[a3_0x11045d(0x89)])(schema);function a3_0x1184(){var _0x2b1a7e=['20dHSngU','4032ZbOLRq','407920VtMVAz','4vCOEVp','1035195AYSWeg','336366RcOCBv','default','2048zhrPay','./statics','defineProperty','User','575778zmTQCq','mongoose','Types','../../plugins/db/plugins','cryptoPlugin','__importDefault','49eNvyLp','Role','4032743ApPdSi','plugin','3724570ATaIQJ','ObjectId','Schema'];a3_0x1184=function(){return _0x2b1a7e;};return a3_0x1184();} \ No newline at end of file diff --git a/models/blacklisted-user/statics.js b/models/blacklisted-user/statics.js index 4e1e7e9..c6b566e 100644 --- a/models/blacklisted-user/statics.js +++ b/models/blacklisted-user/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Blacklisted User Collection by Deleting all the Records - * - * @param {IBlacklistedUserModel} this - Blacklisted User Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a4_0x35cd80=a4_0x204e;(function(_0x3b5b13,_0x3a19e9){var _0x336dab=a4_0x204e,_0x1d9ac3=_0x3b5b13();while(!![]){try{var _0x39ca5f=-parseInt(_0x336dab(0x1ec))/0x1*(parseInt(_0x336dab(0x1ed))/0x2)+parseInt(_0x336dab(0x1ee))/0x3*(parseInt(_0x336dab(0x1e2))/0x4)+parseInt(_0x336dab(0x1e4))/0x5*(-parseInt(_0x336dab(0x1e0))/0x6)+parseInt(_0x336dab(0x1eb))/0x7*(parseInt(_0x336dab(0x1e7))/0x8)+parseInt(_0x336dab(0x1ea))/0x9*(parseInt(_0x336dab(0x1e3))/0xa)+parseInt(_0x336dab(0x1e1))/0xb+-parseInt(_0x336dab(0x1e9))/0xc;if(_0x39ca5f===_0x3a19e9)break;else _0x1d9ac3['push'](_0x1d9ac3['shift']());}catch(_0x2de5cd){_0x1d9ac3['push'](_0x1d9ac3['shift']());}}}(a4_0x3fc8,0x3cd5e));function a4_0x204e(_0x10345a,_0x418ea0){var _0x3fc8df=a4_0x3fc8();return a4_0x204e=function(_0x204ef1,_0x3ad9e8){_0x204ef1=_0x204ef1-0x1e0;var _0x3d45a9=_0x3fc8df[_0x204ef1];return _0x3d45a9;},a4_0x204e(_0x10345a,_0x418ea0);}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['clearAll']=void 0x0;var statics_1=require('../../plugins/db/statics');function clearAll(){var _0x21312b=a4_0x204e;return(0x0,statics_1[_0x21312b(0x1e6)])(this);}exports[a4_0x35cd80(0x1e5)]=clearAll;function default_1(_0x3143dc){var _0x5a26d2=a4_0x35cd80;return _0x3143dc[_0x5a26d2(0x1e8)][_0x5a26d2(0x1e5)]=clearAll,_0x3143dc;}function a4_0x3fc8(){var _0x2040ef=['284tpKfCj','129891CbTUQl','580902PmKfci','442288IdWYuE','28QxBZVQ','10LRoWKJ','5oaOGVY','clearAll','clearCollection','320zJUvlk','statics','1022316SrCTia','3446991UKEgbu','1960wWmoTf','2157kYWgeP'];a4_0x3fc8=function(){return _0x2040ef;};return a4_0x3fc8();}exports['default']=default_1; \ No newline at end of file diff --git a/models/credential/index.js b/models/credential/index.js index 4f3bbe2..47bff34 100644 --- a/models/credential/index.js +++ b/models/credential/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a5_0x512b7a=a5_0x50bb;(function(_0x31c09c,_0x417924){var _0x275098=a5_0x50bb,_0x120b69=_0x31c09c();while(!![]){try{var _0x2b4c97=parseInt(_0x275098(0xe6))/0x1+-parseInt(_0x275098(0xe9))/0x2*(parseInt(_0x275098(0xe2))/0x3)+parseInt(_0x275098(0xe5))/0x4*(-parseInt(_0x275098(0xe1))/0x5)+-parseInt(_0x275098(0xea))/0x6+parseInt(_0x275098(0xde))/0x7*(-parseInt(_0x275098(0xdc))/0x8)+-parseInt(_0x275098(0xe0))/0x9*(parseInt(_0x275098(0xec))/0xa)+parseInt(_0x275098(0xdd))/0xb*(parseInt(_0x275098(0xdf))/0xc);if(_0x2b4c97===_0x417924)break;else _0x120b69['push'](_0x120b69['shift']());}catch(_0x32c543){_0x120b69['push'](_0x120b69['shift']());}}}(a5_0x97f2,0xb4dcc));function a5_0x50bb(_0x1fd34d,_0x49076b){var _0x97f251=a5_0x97f2();return a5_0x50bb=function(_0x50bb89,_0x3383a4){_0x50bb89=_0x50bb89-0xdc;var _0x20ccc2=_0x97f251[_0x50bb89];return _0x20ccc2;},a5_0x50bb(_0x1fd34d,_0x49076b);}var __importDefault=this&&this[a5_0x512b7a(0xe4)]||function(_0x1f1436){var _0x132f32=a5_0x512b7a;return _0x1f1436&&_0x1f1436[_0x132f32(0xe3)]?_0x1f1436:{'default':_0x1f1436};};Object[a5_0x512b7a(0xe8)](exports,a5_0x512b7a(0xe3),{'value':!![]}),exports[a5_0x512b7a(0xe7)]=void 0x0;var model_1=require(a5_0x512b7a(0xeb));Object[a5_0x512b7a(0xe8)](exports,'default',{'enumerable':!![],'get':function(){var _0x3f0f43=a5_0x512b7a;return __importDefault(model_1)[_0x3f0f43(0xe7)];}});function a5_0x97f2(){var _0x4f86ea=['__esModule','__importDefault','37204dqqQAh','218397FLAsIT','default','defineProperty','2rDMXWf','4519842LuoVhd','./model','10990upKoeW','949456VkUYpg','40390229yjVSKP','63KHGJDc','12xHQRWO','576AGjXIi','600ruzpIM','424569secLfn'];a5_0x97f2=function(){return _0x4f86ea;};return a5_0x97f2();} \ No newline at end of file diff --git a/models/credential/model.js b/models/credential/model.js index 679beb4..8fce4ee 100644 --- a/models/credential/model.js +++ b/models/credential/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Credential', schema_1.default); +'use strict';var a6_0x495e8c=a6_0xb000;(function(_0x41faaf,_0x254477){var _0x28866d=a6_0xb000,_0x2da47c=_0x41faaf();while(!![]){try{var _0xabebca=-parseInt(_0x28866d(0xc3))/0x1+-parseInt(_0x28866d(0xc4))/0x2*(-parseInt(_0x28866d(0xca))/0x3)+parseInt(_0x28866d(0xbf))/0x4*(parseInt(_0x28866d(0xcc))/0x5)+-parseInt(_0x28866d(0xc6))/0x6*(parseInt(_0x28866d(0xcf))/0x7)+parseInt(_0x28866d(0xd0))/0x8*(-parseInt(_0x28866d(0xc1))/0x9)+parseInt(_0x28866d(0xc2))/0xa*(parseInt(_0x28866d(0xc8))/0xb)+-parseInt(_0x28866d(0xcd))/0xc;if(_0xabebca===_0x254477)break;else _0x2da47c['push'](_0x2da47c['shift']());}catch(_0x379d53){_0x2da47c['push'](_0x2da47c['shift']());}}}(a6_0x4f70,0x5ce74));function a6_0xb000(_0x5a8439,_0x19b075){var _0x4f7040=a6_0x4f70();return a6_0xb000=function(_0xb0000f,_0x48ee51){_0xb0000f=_0xb0000f-0xbe;var _0x3ea091=_0x4f7040[_0xb0000f];return _0x3ea091;},a6_0xb000(_0x5a8439,_0x19b075);}var __importDefault=this&&this[a6_0x495e8c(0xce)]||function(_0x38486f){var _0x5cf689=a6_0x495e8c;return _0x38486f&&_0x38486f[_0x5cf689(0xcb)]?_0x38486f:{'default':_0x38486f};};Object[a6_0x495e8c(0xc7)](exports,a6_0x495e8c(0xcb),{'value':!![]});var mongoose_1=require(a6_0x495e8c(0xbe)),schema_1=__importDefault(require(a6_0x495e8c(0xc5)));function a6_0x4f70(){var _0xd3bf6a=['902889tHqgpJ','10KnQtur','7304lclNWM','374QwFWKz','./schema','258954UUETMZ','defineProperty','5851516VBIUxd','default','7599AJebgs','__esModule','1272240okJSlO','9390780lobepO','__importDefault','7OYmsbh','24RyadMl','mongoose','8FzjIAE','Credential'];a6_0x4f70=function(){return _0xd3bf6a;};return a6_0x4f70();}exports[a6_0x495e8c(0xc9)]=(0x0,mongoose_1['model'])(a6_0x495e8c(0xc0),schema_1[a6_0x495e8c(0xc9)]); \ No newline at end of file diff --git a/models/credential/schema.js b/models/credential/schema.js index fcf4cd4..0ef5f69 100644 --- a/models/credential/schema.js +++ b/models/credential/schema.js @@ -1,41 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - alias: { - type: String, - required: true, - hash: true, - }, - client_id: { - type: String, - required: true, - encrypt: true, - }, - client_secret: { - type: String, - required: true, - encrypt: true, - }, - redirect_uri: { - type: String, - required: true, - encrypt: true, - }, - email: { - type: String, - required: true, - unique: true, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -schema.plugin((0, plugins_1.hashPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';var a7_0x20e14b=a7_0x50fd;(function(_0x230ea9,_0x244750){var _0x2274b1=a7_0x50fd,_0x191696=_0x230ea9();while(!![]){try{var _0x1ef244=parseInt(_0x2274b1(0x176))/0x1+parseInt(_0x2274b1(0x173))/0x2+-parseInt(_0x2274b1(0x169))/0x3+parseInt(_0x2274b1(0x178))/0x4+-parseInt(_0x2274b1(0x16a))/0x5*(-parseInt(_0x2274b1(0x171))/0x6)+-parseInt(_0x2274b1(0x16b))/0x7*(parseInt(_0x2274b1(0x168))/0x8)+-parseInt(_0x2274b1(0x170))/0x9;if(_0x1ef244===_0x244750)break;else _0x191696['push'](_0x191696['shift']());}catch(_0x527274){_0x191696['push'](_0x191696['shift']());}}}(a7_0x5867,0x43a0b));function a7_0x5867(){var _0x408b31=['349264UuJsla','Types','382044veOcmK','../../plugins/db/plugins','default','__importDefault','plugin','309000bvzTWW','1376862OOdyIA','555pFxIFz','7ZqvlYz','Schema','hashPlugin','ObjectId','__esModule','1972782WKQERk','498dDWYZA','./statics','1079584krRmVF','defineProperty','cryptoPlugin'];a7_0x5867=function(){return _0x408b31;};return a7_0x5867();}var __importDefault=this&&this[a7_0x20e14b(0x166)]||function(_0x4e94e7){var _0x22aa2d=a7_0x20e14b;return _0x4e94e7&&_0x4e94e7[_0x22aa2d(0x16f)]?_0x4e94e7:{'default':_0x4e94e7};};function a7_0x50fd(_0x280fef,_0x1cadc2){var _0x58671a=a7_0x5867();return a7_0x50fd=function(_0x50fdfb,_0x47573f){_0x50fdfb=_0x50fdfb-0x165;var _0x24faaf=_0x58671a[_0x50fdfb];return _0x24faaf;},a7_0x50fd(_0x280fef,_0x1cadc2);}Object[a7_0x20e14b(0x174)](exports,a7_0x20e14b(0x16f),{'value':!![]});var mongoose_1=require('mongoose'),statics_1=__importDefault(require(a7_0x20e14b(0x172))),plugins_1=require(a7_0x20e14b(0x179)),schema=new mongoose_1[(a7_0x20e14b(0x16c))]({'_id':{'type':mongoose_1[a7_0x20e14b(0x16c)][a7_0x20e14b(0x177)][a7_0x20e14b(0x16e)]},'alias':{'type':String,'required':!![],'hash':!![]},'client_id':{'type':String,'required':!![],'encrypt':!![]},'client_secret':{'type':String,'required':!![],'encrypt':!![]},'redirect_uri':{'type':String,'required':!![],'encrypt':!![]},'email':{'type':String,'required':!![],'unique':!![]}});schema['plugin']((0x0,plugins_1[a7_0x20e14b(0x175)])()),schema[a7_0x20e14b(0x167)]((0x0,plugins_1[a7_0x20e14b(0x16d)])()),exports[a7_0x20e14b(0x165)]=(0x0,statics_1[a7_0x20e14b(0x165)])(schema); \ No newline at end of file diff --git a/models/credential/statics.js b/models/credential/statics.js index c5e081f..0b44453 100644 --- a/models/credential/statics.js +++ b/models/credential/statics.js @@ -1,51 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkID = exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Credentials Collection by Deleting all the Records - * - * @param {ICredentialsModel} this - Credentials Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Checks the Credentials Collection for the Given ID - * - * @param {ICredentialsModel} this - Credentials Model - * @param {Types.ObjectId} id - Credential ID String - * @returns {Promise} - Response whether true or false - */ -function checkID(id) { - var _this = this; - return new Promise(function (resolve, reject) { - _this.findById(id) - .then(function (creds) { - if (creds) { - resolve(true); - } - else { - resolve(false); - } - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -exports.checkID = checkID; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - schema.statics.checkID = checkID; - return schema; -} -exports.default = default_1; +'use strict';var a8_0x311c9a=a8_0x2880;(function(_0x5a94da,_0x8adede){var _0x23ea5d=a8_0x2880,_0x15a309=_0x5a94da();while(!![]){try{var _0xd68a63=parseInt(_0x23ea5d(0xb5))/0x1+-parseInt(_0x23ea5d(0xa4))/0x2*(-parseInt(_0x23ea5d(0xa7))/0x3)+-parseInt(_0x23ea5d(0xad))/0x4+parseInt(_0x23ea5d(0xaf))/0x5+-parseInt(_0x23ea5d(0xb0))/0x6*(-parseInt(_0x23ea5d(0xab))/0x7)+-parseInt(_0x23ea5d(0xb6))/0x8+-parseInt(_0x23ea5d(0xb1))/0x9;if(_0xd68a63===_0x8adede)break;else _0x15a309['push'](_0x15a309['shift']());}catch(_0x2a2d91){_0x15a309['push'](_0x15a309['shift']());}}}(a8_0x5745,0x64e37));Object[a8_0x311c9a(0xac)](exports,a8_0x311c9a(0xb2),{'value':!![]}),exports[a8_0x311c9a(0xa8)]=exports[a8_0x311c9a(0xa6)]=void 0x0;var statics_1=require(a8_0x311c9a(0xb3));function clearAll(){var _0x3d363d=a8_0x311c9a;return(0x0,statics_1[_0x3d363d(0xaa)])(this);}exports[a8_0x311c9a(0xa6)]=clearAll;function checkID(_0x52fe1d){var _0x2b4d20=this;return new Promise(function(_0x19bbb3,_0x9aa3c0){var _0x147144=a8_0x2880;_0x2b4d20[_0x147144(0xb4)](_0x52fe1d)[_0x147144(0xa9)](function(_0x4d22fd){_0x4d22fd?_0x19bbb3(!![]):_0x19bbb3(![]);})[_0x147144(0xae)](function(_0x50b6d9){var _0x1a74a9=_0x147144;_0x9aa3c0(new Error(''[_0x1a74a9(0xb7)](_0x50b6d9[_0x1a74a9(0xa5)],':\x20')[_0x1a74a9(0xb7)](_0x50b6d9['message'])));});});}function a8_0x5745(){var _0x25338c=['3889230xZJvyL','2336970doVVNs','11213127UfVXxc','__esModule','../../plugins/db/statics','findById','216899LYIQEY','1656864KDTrOZ','concat','2BMwLdn','name','clearAll','1467459pDWUSz','checkID','then','clearCollection','7EQDTFU','defineProperty','28572GHTeYM','catch'];a8_0x5745=function(){return _0x25338c;};return a8_0x5745();}exports[a8_0x311c9a(0xa8)]=checkID;function a8_0x2880(_0x319616,_0x1eafcb){var _0x5745e3=a8_0x5745();return a8_0x2880=function(_0x28801c,_0x49bf4c){_0x28801c=_0x28801c-0xa4;var _0x24c4c9=_0x5745e3[_0x28801c];return _0x24c4c9;},a8_0x2880(_0x319616,_0x1eafcb);}function default_1(_0x2005a5){var _0x4dd4c5=a8_0x311c9a;return _0x2005a5['statics'][_0x4dd4c5(0xa6)]=clearAll,_0x2005a5['statics'][_0x4dd4c5(0xa8)]=checkID,_0x2005a5;}exports['default']=default_1; \ No newline at end of file diff --git a/models/frontend/index.js b/models/frontend/index.js index 4f3bbe2..f5d1442 100644 --- a/models/frontend/index.js +++ b/models/frontend/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a9_0x7fe6b6=a9_0x48c9;(function(_0x25176f,_0x594941){var _0x323abf=a9_0x48c9,_0xe4a9b0=_0x25176f();while(!![]){try{var _0x38bb53=-parseInt(_0x323abf(0x117))/0x1+parseInt(_0x323abf(0x11a))/0x2+parseInt(_0x323abf(0x119))/0x3*(-parseInt(_0x323abf(0x112))/0x4)+-parseInt(_0x323abf(0x116))/0x5+-parseInt(_0x323abf(0x115))/0x6*(-parseInt(_0x323abf(0x114))/0x7)+parseInt(_0x323abf(0x118))/0x8+parseInt(_0x323abf(0x10f))/0x9*(parseInt(_0x323abf(0x111))/0xa);if(_0x38bb53===_0x594941)break;else _0xe4a9b0['push'](_0xe4a9b0['shift']());}catch(_0x151f24){_0xe4a9b0['push'](_0xe4a9b0['shift']());}}}(a9_0x3651,0xd4f28));function a9_0x48c9(_0x48ff7f,_0xacc203){var _0x36510a=a9_0x3651();return a9_0x48c9=function(_0x48c93c,_0x5e287e){_0x48c93c=_0x48c93c-0x10e;var _0x66787f=_0x36510a[_0x48c93c];return _0x66787f;},a9_0x48c9(_0x48ff7f,_0xacc203);}var __importDefault=this&&this[a9_0x7fe6b6(0x10e)]||function(_0x117040){var _0x37c3fd=a9_0x7fe6b6;return _0x117040&&_0x117040[_0x37c3fd(0x110)]?_0x117040:{'default':_0x117040};};Object['defineProperty'](exports,a9_0x7fe6b6(0x110),{'value':!![]}),exports[a9_0x7fe6b6(0x11b)]=void 0x0;var model_1=require('./model');function a9_0x3651(){var _0x298b50=['81MiuBGB','__esModule','2437060CUYmJI','16CpLtvV','defineProperty','7vHvLDt','3290556CaFTHE','6905460xVtxLX','852537cIvhvV','5886384CDSqpw','612804noNQDD','890710HDAqUc','default','__importDefault'];a9_0x3651=function(){return _0x298b50;};return a9_0x3651();}Object[a9_0x7fe6b6(0x113)](exports,a9_0x7fe6b6(0x11b),{'enumerable':!![],'get':function(){return __importDefault(model_1)['default'];}}); \ No newline at end of file diff --git a/models/frontend/model.js b/models/frontend/model.js index 328d41e..aad73ed 100644 --- a/models/frontend/model.js +++ b/models/frontend/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Frontend', schema_1.default); +'use strict';var a10_0xc6d83f=a10_0x9545;(function(_0x24bc9e,_0x3a3bfe){var _0x1ddb1d=a10_0x9545,_0x5f09ab=_0x24bc9e();while(!![]){try{var _0x388af0=-parseInt(_0x1ddb1d(0x1da))/0x1+parseInt(_0x1ddb1d(0x1de))/0x2+-parseInt(_0x1ddb1d(0x1d3))/0x3*(-parseInt(_0x1ddb1d(0x1db))/0x4)+-parseInt(_0x1ddb1d(0x1d7))/0x5+-parseInt(_0x1ddb1d(0x1cf))/0x6*(-parseInt(_0x1ddb1d(0x1d5))/0x7)+-parseInt(_0x1ddb1d(0x1d0))/0x8*(parseInt(_0x1ddb1d(0x1dc))/0x9)+parseInt(_0x1ddb1d(0x1d2))/0xa;if(_0x388af0===_0x3a3bfe)break;else _0x5f09ab['push'](_0x5f09ab['shift']());}catch(_0x36a727){_0x5f09ab['push'](_0x5f09ab['shift']());}}}(a10_0x2b47,0x230b9));var __importDefault=this&&this[a10_0xc6d83f(0x1d6)]||function(_0x595bfc){var _0x30d91e=a10_0xc6d83f;return _0x595bfc&&_0x595bfc[_0x30d91e(0x1d8)]?_0x595bfc:{'default':_0x595bfc};};function a10_0x9545(_0x45dd6a,_0x2c5498){var _0x2b474f=a10_0x2b47();return a10_0x9545=function(_0x9545e6,_0x4f85f2){_0x9545e6=_0x9545e6-0x1cf;var _0x310431=_0x2b474f[_0x9545e6];return _0x310431;},a10_0x9545(_0x45dd6a,_0x2c5498);}function a10_0x2b47(){var _0x4dba28=['1234179SeDZlh','defineProperty','418040AqxLaY','Frontend','18294AejHEm','8UoUwTs','default','1398880vYEFDL','11142DODHkS','./schema','420icsAPx','__importDefault','1006910NSbGDs','__esModule','model','142640vpBVdw','100FwzdEH'];a10_0x2b47=function(){return _0x4dba28;};return a10_0x2b47();}Object[a10_0xc6d83f(0x1dd)](exports,a10_0xc6d83f(0x1d8),{'value':!![]});var mongoose_1=require('mongoose'),schema_1=__importDefault(require(a10_0xc6d83f(0x1d4)));exports[a10_0xc6d83f(0x1d1)]=(0x0,mongoose_1[a10_0xc6d83f(0x1d9)])(a10_0xc6d83f(0x1df),schema_1[a10_0xc6d83f(0x1d1)]); \ No newline at end of file diff --git a/models/frontend/schema.js b/models/frontend/schema.js index 18b4f08..7305164 100644 --- a/models/frontend/schema.js +++ b/models/frontend/schema.js @@ -1,57 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - domain: { - type: String, - required: true, - unique: true, - }, - name: { - type: String, - required: true, - }, - settings: { - specifics: [ - { - setting: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'GlobalSetting', - }, - flag: { - type: String || Boolean || Number, - required: true, - }, - }, - ], - default_mailer: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'SMTPMailer', - required: false, - }, - disallowed_roles: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Role', - }, - allowed_policies: [ - { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Policy', - }, - ], - disallowed_policies: [ - { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Policy', - }, - ], - }, -}); -exports.default = (0, statics_1.default)(schema); +'use strict';var a11_0x4be984=a11_0x3ba8;(function(_0xee8717,_0x42c647){var _0x165128=a11_0x3ba8,_0x24e5d6=_0xee8717();while(!![]){try{var _0x528666=parseInt(_0x165128(0x130))/0x1*(parseInt(_0x165128(0x12a))/0x2)+parseInt(_0x165128(0x127))/0x3+parseInt(_0x165128(0x133))/0x4*(-parseInt(_0x165128(0x137))/0x5)+parseInt(_0x165128(0x131))/0x6*(parseInt(_0x165128(0x12c))/0x7)+-parseInt(_0x165128(0x12b))/0x8+parseInt(_0x165128(0x138))/0x9+parseInt(_0x165128(0x136))/0xa*(-parseInt(_0x165128(0x12e))/0xb);if(_0x528666===_0x42c647)break;else _0x24e5d6['push'](_0x24e5d6['shift']());}catch(_0x5d366c){_0x24e5d6['push'](_0x24e5d6['shift']());}}}(a11_0x35d1,0x52541));var __importDefault=this&&this[a11_0x4be984(0x12f)]||function(_0x3fea8a){return _0x3fea8a&&_0x3fea8a['__esModule']?_0x3fea8a:{'default':_0x3fea8a};};Object[a11_0x4be984(0x13c)](exports,a11_0x4be984(0x139),{'value':!![]});function a11_0x3ba8(_0x49d708,_0x1b8c8c){var _0x35d1f9=a11_0x35d1();return a11_0x3ba8=function(_0x3ba8cc,_0xb6f25e){_0x3ba8cc=_0x3ba8cc-0x127;var _0xb64dad=_0x35d1f9[_0x3ba8cc];return _0xb64dad;},a11_0x3ba8(_0x49d708,_0x1b8c8c);}function a11_0x35d1(){var _0x2010e5=['11489357jSfQWC','__importDefault','9JJvszl','6ykxaqZ','ObjectId','4772XjGiVg','default','Role','10yhGQJj','210cQxVal','1878210AyjuAb','__esModule','SMTPMailer','Policy','defineProperty','686973KPPxGn','mongoose','Schema','113254RJWFfh','240200AUbtvK','3601577vnyTRw','Types'];a11_0x35d1=function(){return _0x2010e5;};return a11_0x35d1();}var mongoose_1=require(a11_0x4be984(0x128)),statics_1=__importDefault(require('./statics')),schema=new mongoose_1[(a11_0x4be984(0x129))]({'_id':{'type':mongoose_1[a11_0x4be984(0x129)]['Types'][a11_0x4be984(0x132)]},'domain':{'type':String,'required':!![],'unique':!![]},'name':{'type':String,'required':!![]},'settings':{'specifics':[{'setting':{'type':mongoose_1[a11_0x4be984(0x129)][a11_0x4be984(0x12d)][a11_0x4be984(0x132)],'ref':'GlobalSetting'},'flag':{'type':String||Boolean||Number,'required':!![]}}],'default_mailer':{'type':mongoose_1[a11_0x4be984(0x129)][a11_0x4be984(0x12d)]['ObjectId'],'ref':a11_0x4be984(0x13a),'required':![]},'disallowed_roles':{'type':mongoose_1[a11_0x4be984(0x129)][a11_0x4be984(0x12d)]['ObjectId'],'ref':a11_0x4be984(0x135)},'allowed_policies':[{'type':mongoose_1[a11_0x4be984(0x129)]['Types']['ObjectId'],'ref':a11_0x4be984(0x13b)}],'disallowed_policies':[{'type':mongoose_1[a11_0x4be984(0x129)][a11_0x4be984(0x12d)][a11_0x4be984(0x132)],'ref':a11_0x4be984(0x13b)}]}});exports[a11_0x4be984(0x134)]=(0x0,statics_1['default'])(schema); \ No newline at end of file diff --git a/models/frontend/statics.js b/models/frontend/statics.js index 396ebf7..e1c18b2 100644 --- a/models/frontend/statics.js +++ b/models/frontend/statics.js @@ -1,76 +1 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.getFrontendUrls = exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Frontend Collection by Deleting all the Records - * - * @param {IFrontendModel} this - Frontend Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Get all the Frontend URL's From the Collection - * - * @param {IFrontendModel} this - Frontend Model - * @returns {IFrontendDoc[]} list of frontend Data - */ -function getFrontendUrls() { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.find({}, '_id domain name')]; - }); - }); -} -exports.getFrontendUrls = getFrontendUrls; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.getFrontendUrls = getFrontendUrls; - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a12_0x2f7ecb=a12_0xd380;(function(_0x12dcae,_0x3bc2b3){var _0x1d44ac=a12_0xd380,_0xb8aa5b=_0x12dcae();while(!![]){try{var _0x376a0c=-parseInt(_0x1d44ac(0x1be))/0x1*(-parseInt(_0x1d44ac(0x1a8))/0x2)+parseInt(_0x1d44ac(0x1b6))/0x3+-parseInt(_0x1d44ac(0x1bd))/0x4*(parseInt(_0x1d44ac(0x1a7))/0x5)+parseInt(_0x1d44ac(0x1bf))/0x6+parseInt(_0x1d44ac(0x1a2))/0x7*(-parseInt(_0x1d44ac(0x1a3))/0x8)+-parseInt(_0x1d44ac(0x1b5))/0x9*(-parseInt(_0x1d44ac(0x1b2))/0xa)+-parseInt(_0x1d44ac(0x1bc))/0xb;if(_0x376a0c===_0x3bc2b3)break;else _0xb8aa5b['push'](_0xb8aa5b['shift']());}catch(_0x15f0f4){_0xb8aa5b['push'](_0xb8aa5b['shift']());}}}(a12_0x1746,0xbdc7e));function a12_0x1746(){var _0x4267ab=['../../plugins/db/statics','210UfITWt','then','next','127863UMVaGw','4272675htSUYq','getFrontendUrls','clearAll','defineProperty','__generator','call','12330384bHbCMF','92KGnRHP','8141hsPHQh','8114574EWlwtY','find','done','__esModule','return','__awaiter','7taSTLC','1612632ICaGZJ','ops','value','label','302245EtXVQc','102ROxwHz','length','trys','throw','_id\x20domain\x20name','default','apply','clearCollection','pop'];a12_0x1746=function(){return _0x4267ab;};return a12_0x1746();}var __awaiter=this&&this[a12_0x2f7ecb(0x1a1)]||function(_0x2eeba0,_0x1af595,_0x3e98f9,_0x153503){function _0x278220(_0x1a7be3){return _0x1a7be3 instanceof _0x3e98f9?_0x1a7be3:new _0x3e98f9(function(_0x1df4f0){_0x1df4f0(_0x1a7be3);});}return new(_0x3e98f9||(_0x3e98f9=Promise))(function(_0x52d413,_0xa48905){var _0x8f5d87=a12_0xd380;function _0xdec5ef(_0x46984f){var _0x2f1bd3=a12_0xd380;try{_0x2eb885(_0x153503[_0x2f1bd3(0x1b4)](_0x46984f));}catch(_0x41bcd9){_0xa48905(_0x41bcd9);}}function _0x138bc7(_0x53e4b2){var _0x174744=a12_0xd380;try{_0x2eb885(_0x153503[_0x174744(0x1ab)](_0x53e4b2));}catch(_0x8326db){_0xa48905(_0x8326db);}}function _0x2eb885(_0x4f0114){var _0xda5acf=a12_0xd380;_0x4f0114[_0xda5acf(0x19e)]?_0x52d413(_0x4f0114[_0xda5acf(0x1a5)]):_0x278220(_0x4f0114[_0xda5acf(0x1a5)])[_0xda5acf(0x1b3)](_0xdec5ef,_0x138bc7);}_0x2eb885((_0x153503=_0x153503[_0x8f5d87(0x1ae)](_0x2eeba0,_0x1af595||[]))[_0x8f5d87(0x1b4)]());});},__generator=this&&this[a12_0x2f7ecb(0x1ba)]||function(_0xa196db,_0x33200b){var _0x27b55c={'label':0x0,'sent':function(){if(_0x182f78[0x0]&0x1)throw _0x182f78[0x1];return _0x182f78[0x1];},'trys':[],'ops':[]},_0x3ab3bc,_0x19d525,_0x182f78,_0x13946a;return _0x13946a={'next':_0x298721(0x0),'throw':_0x298721(0x1),'return':_0x298721(0x2)},typeof Symbol==='function'&&(_0x13946a[Symbol['iterator']]=function(){return this;}),_0x13946a;function _0x298721(_0x316344){return function(_0x5ba3c3){return _0x75077([_0x316344,_0x5ba3c3]);};}function _0x75077(_0x20a35e){var _0x5871b7=a12_0xd380;if(_0x3ab3bc)throw new TypeError('Generator\x20is\x20already\x20executing.');while(_0x27b55c)try{if(_0x3ab3bc=0x1,_0x19d525&&(_0x182f78=_0x20a35e[0x0]&0x2?_0x19d525[_0x5871b7(0x1a0)]:_0x20a35e[0x0]?_0x19d525['throw']||((_0x182f78=_0x19d525[_0x5871b7(0x1a0)])&&_0x182f78[_0x5871b7(0x1bb)](_0x19d525),0x0):_0x19d525[_0x5871b7(0x1b4)])&&!(_0x182f78=_0x182f78[_0x5871b7(0x1bb)](_0x19d525,_0x20a35e[0x1]))['done'])return _0x182f78;if(_0x19d525=0x0,_0x182f78)_0x20a35e=[_0x20a35e[0x0]&0x2,_0x182f78[_0x5871b7(0x1a5)]];switch(_0x20a35e[0x0]){case 0x0:case 0x1:_0x182f78=_0x20a35e;break;case 0x4:_0x27b55c[_0x5871b7(0x1a6)]++;return{'value':_0x20a35e[0x1],'done':![]};case 0x5:_0x27b55c[_0x5871b7(0x1a6)]++,_0x19d525=_0x20a35e[0x1],_0x20a35e=[0x0];continue;case 0x7:_0x20a35e=_0x27b55c[_0x5871b7(0x1a4)][_0x5871b7(0x1b0)](),_0x27b55c[_0x5871b7(0x1aa)]['pop']();continue;default:if(!(_0x182f78=_0x27b55c[_0x5871b7(0x1aa)],_0x182f78=_0x182f78[_0x5871b7(0x1a9)]>0x0&&_0x182f78[_0x182f78['length']-0x1])&&(_0x20a35e[0x0]===0x6||_0x20a35e[0x0]===0x2)){_0x27b55c=0x0;continue;}if(_0x20a35e[0x0]===0x3&&(!_0x182f78||_0x20a35e[0x1]>_0x182f78[0x0]&&_0x20a35e[0x1]<_0x182f78[0x3])){_0x27b55c[_0x5871b7(0x1a6)]=_0x20a35e[0x1];break;}if(_0x20a35e[0x0]===0x6&&_0x27b55c[_0x5871b7(0x1a6)]<_0x182f78[0x1]){_0x27b55c[_0x5871b7(0x1a6)]=_0x182f78[0x1],_0x182f78=_0x20a35e;break;}if(_0x182f78&&_0x27b55c[_0x5871b7(0x1a6)]<_0x182f78[0x2]){_0x27b55c[_0x5871b7(0x1a6)]=_0x182f78[0x2],_0x27b55c[_0x5871b7(0x1a4)]['push'](_0x20a35e);break;}if(_0x182f78[0x2])_0x27b55c[_0x5871b7(0x1a4)][_0x5871b7(0x1b0)]();_0x27b55c['trys'][_0x5871b7(0x1b0)]();continue;}_0x20a35e=_0x33200b['call'](_0xa196db,_0x27b55c);}catch(_0x30df32){_0x20a35e=[0x6,_0x30df32],_0x19d525=0x0;}finally{_0x3ab3bc=_0x182f78=0x0;}if(_0x20a35e[0x0]&0x5)throw _0x20a35e[0x1];return{'value':_0x20a35e[0x0]?_0x20a35e[0x1]:void 0x0,'done':!![]};}};Object[a12_0x2f7ecb(0x1b9)](exports,a12_0x2f7ecb(0x19f),{'value':!![]}),exports[a12_0x2f7ecb(0x1b7)]=exports[a12_0x2f7ecb(0x1b8)]=void 0x0;var statics_1=require(a12_0x2f7ecb(0x1b1));function clearAll(){var _0x21b5ac=a12_0x2f7ecb;return(0x0,statics_1[_0x21b5ac(0x1af)])(this);}function a12_0xd380(_0x27aed9,_0x529d95){var _0x1746da=a12_0x1746();return a12_0xd380=function(_0xd38075,_0xb2e414){_0xd38075=_0xd38075-0x19e;var _0x41ea59=_0x1746da[_0xd38075];return _0x41ea59;},a12_0xd380(_0x27aed9,_0x529d95);}exports[a12_0x2f7ecb(0x1b8)]=clearAll;function getFrontendUrls(){return __awaiter(this,void 0x0,void 0x0,function(){return __generator(this,function(_0x462f2b){var _0x53247f=a12_0xd380;return[0x2,this[_0x53247f(0x1c0)]({},_0x53247f(0x1ac))];});});}exports['getFrontendUrls']=getFrontendUrls;function default_1(_0x276518){var _0xfec07c=a12_0x2f7ecb;return _0x276518['statics']['getFrontendUrls']=getFrontendUrls,_0x276518['statics'][_0xfec07c(0x1b8)]=clearAll,_0x276518;}exports[a12_0x2f7ecb(0x1ad)]=default_1; \ No newline at end of file diff --git a/models/global-setting/index.js b/models/global-setting/index.js index 4f3bbe2..42c3c0b 100644 --- a/models/global-setting/index.js +++ b/models/global-setting/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a13_0x39bcf9=a13_0x42d1;function a13_0x4846(){var _0x165c5b=['8wxwTPA','default','1091366OJNruJ','__esModule','./model','699TrioHu','3085350beWynm','defineProperty','4409580iNqMuu','430EriuWJ','1980385SNfiur','3iQHUFb','2817017nQFOZL','24345MEddxA','__importDefault','24508HjHXwJ'];a13_0x4846=function(){return _0x165c5b;};return a13_0x4846();}(function(_0x41ada3,_0x105eab){var _0x2afaa5=a13_0x42d1,_0x583dd0=_0x41ada3();while(!![]){try{var _0x47cc1f=-parseInt(_0x2afaa5(0xfe))/0x1*(-parseInt(_0x2afaa5(0x105))/0x2)+-parseInt(_0x2afaa5(0xf8))/0x3*(parseInt(_0x2afaa5(0x102))/0x4)+parseInt(_0x2afaa5(0xfb))/0x5+-parseInt(_0x2afaa5(0xf9))/0x6+-parseInt(_0x2afaa5(0xff))/0x7*(-parseInt(_0x2afaa5(0x103))/0x8)+-parseInt(_0x2afaa5(0x100))/0x9*(-parseInt(_0x2afaa5(0xfc))/0xa)+-parseInt(_0x2afaa5(0xfd))/0xb;if(_0x47cc1f===_0x105eab)break;else _0x583dd0['push'](_0x583dd0['shift']());}catch(_0x34712e){_0x583dd0['push'](_0x583dd0['shift']());}}}(a13_0x4846,0xdf994));var __importDefault=this&&this[a13_0x39bcf9(0x101)]||function(_0x4f087f){var _0x2a01a7=a13_0x39bcf9;return _0x4f087f&&_0x4f087f[_0x2a01a7(0x106)]?_0x4f087f:{'default':_0x4f087f};};function a13_0x42d1(_0x5604cb,_0x38d392){var _0x484687=a13_0x4846();return a13_0x42d1=function(_0x42d18f,_0x2f38cf){_0x42d18f=_0x42d18f-0xf8;var _0x5300d5=_0x484687[_0x42d18f];return _0x5300d5;},a13_0x42d1(_0x5604cb,_0x38d392);}Object[a13_0x39bcf9(0xfa)](exports,a13_0x39bcf9(0x106),{'value':!![]}),exports[a13_0x39bcf9(0x104)]=void 0x0;var model_1=require(a13_0x39bcf9(0x107));Object[a13_0x39bcf9(0xfa)](exports,a13_0x39bcf9(0x104),{'enumerable':!![],'get':function(){var _0x1a70f1=a13_0x39bcf9;return __importDefault(model_1)[_0x1a70f1(0x104)];}}); \ No newline at end of file diff --git a/models/global-setting/model.js b/models/global-setting/model.js index fea8d68..a7f1884 100644 --- a/models/global-setting/model.js +++ b/models/global-setting/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('GlobalSetting', schema_1.default); +'use strict';var a14_0x4ce5ad=a14_0x1b0e;function a14_0x1b0e(_0x2ef707,_0x375b4a){var _0x24eafb=a14_0x24ea();return a14_0x1b0e=function(_0x1b0e07,_0x170a43){_0x1b0e07=_0x1b0e07-0x13e;var _0x393235=_0x24eafb[_0x1b0e07];return _0x393235;},a14_0x1b0e(_0x2ef707,_0x375b4a);}(function(_0x2ae246,_0x224762){var _0xe4eea2=a14_0x1b0e,_0x351242=_0x2ae246();while(!![]){try{var _0x259fe4=parseInt(_0xe4eea2(0x143))/0x1*(-parseInt(_0xe4eea2(0x148))/0x2)+parseInt(_0xe4eea2(0x14b))/0x3*(-parseInt(_0xe4eea2(0x13e))/0x4)+-parseInt(_0xe4eea2(0x141))/0x5*(-parseInt(_0xe4eea2(0x140))/0x6)+-parseInt(_0xe4eea2(0x14d))/0x7*(-parseInt(_0xe4eea2(0x145))/0x8)+parseInt(_0xe4eea2(0x14e))/0x9*(parseInt(_0xe4eea2(0x14c))/0xa)+parseInt(_0xe4eea2(0x144))/0xb+-parseInt(_0xe4eea2(0x147))/0xc*(parseInt(_0xe4eea2(0x146))/0xd);if(_0x259fe4===_0x224762)break;else _0x351242['push'](_0x351242['shift']());}catch(_0x30dfe){_0x351242['push'](_0x351242['shift']());}}}(a14_0x24ea,0xc2280));var __importDefault=this&&this[a14_0x4ce5ad(0x149)]||function(_0x41c718){var _0x466361=a14_0x4ce5ad;return _0x41c718&&_0x41c718[_0x466361(0x150)]?_0x41c718:{'default':_0x41c718};};function a14_0x24ea(){var _0x3da1a6=['816616pMjWsn','model','6ROBYaQ','7821595LwPAGh','default','92423UfBPYK','8168116zPdiOK','133928PzxjjB','1862367kMiwwr','252Hzmzey','18UqkqZv','__importDefault','GlobalSetting','3EdaPOk','10ceqLmg','560ESLfAW','10741581EVlzcz','mongoose','__esModule'];a14_0x24ea=function(){return _0x3da1a6;};return a14_0x24ea();}Object['defineProperty'](exports,a14_0x4ce5ad(0x150),{'value':!![]});var mongoose_1=require(a14_0x4ce5ad(0x14f)),schema_1=__importDefault(require('./schema'));exports[a14_0x4ce5ad(0x142)]=(0x0,mongoose_1[a14_0x4ce5ad(0x13f)])(a14_0x4ce5ad(0x14a),schema_1[a14_0x4ce5ad(0x142)]); \ No newline at end of file diff --git a/models/global-setting/schema.js b/models/global-setting/schema.js index 77c961d..327e813 100644 --- a/models/global-setting/schema.js +++ b/models/global-setting/schema.js @@ -1,30 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - }, - message: { - type: String, - required: true, - }, - global_flag: { - type: Boolean || String || Number || mongoose_1.Schema.Types.ObjectId, - refPath: 'reference', - required: true, - }, - reference: { - type: String, - enum: ['SMTPMailer', 'SMTPProvider', 'MailTemplates'], - }, -}); -exports.default = (0, statics_1.default)(schema); +'use strict';function a15_0x5204(){var _0x578b20=['1504122OQIBkR','102574SyyHkP','Schema','ObjectId','4701485HApAmG','mongoose','12exTiaR','default','__esModule','371432FUAWQU','__importDefault','MailTemplates','SMTPMailer','reference','33TeYIfn','27kxCFOu','35HfebkR','SMTPProvider','3767358oWPcTh','1663984hInnrt','4943140CSpEkr'];a15_0x5204=function(){return _0x578b20;};return a15_0x5204();}var a15_0x463386=a15_0x36b5;(function(_0x18bd8e,_0x3bd2f2){var _0x4bb97d=a15_0x36b5,_0xc2822=_0x18bd8e();while(!![]){try{var _0x18ef2b=-parseInt(_0x4bb97d(0xe3))/0x1*(-parseInt(_0x4bb97d(0xde))/0x2)+parseInt(_0x4bb97d(0xda))/0x3+parseInt(_0x4bb97d(0xd1))/0x4+-parseInt(_0x4bb97d(0xe1))/0x5+-parseInt(_0x4bb97d(0xdd))/0x6*(parseInt(_0x4bb97d(0xd8))/0x7)+-parseInt(_0x4bb97d(0xdb))/0x8*(parseInt(_0x4bb97d(0xd7))/0x9)+-parseInt(_0x4bb97d(0xdc))/0xa*(-parseInt(_0x4bb97d(0xd6))/0xb);if(_0x18ef2b===_0x3bd2f2)break;else _0xc2822['push'](_0xc2822['shift']());}catch(_0x412dbc){_0xc2822['push'](_0xc2822['shift']());}}}(a15_0x5204,0x99a38));var __importDefault=this&&this[a15_0x463386(0xd2)]||function(_0x2c31f7){var _0x2f5049=a15_0x463386;return _0x2c31f7&&_0x2c31f7[_0x2f5049(0xd0)]?_0x2c31f7:{'default':_0x2c31f7};};Object['defineProperty'](exports,'__esModule',{'value':!![]});function a15_0x36b5(_0x2b241f,_0x1996ea){var _0x520450=a15_0x5204();return a15_0x36b5=function(_0x36b5ca,_0x50b4bd){_0x36b5ca=_0x36b5ca-0xd0;var _0x23a0f8=_0x520450[_0x36b5ca];return _0x23a0f8;},a15_0x36b5(_0x2b241f,_0x1996ea);}var mongoose_1=require(a15_0x463386(0xe2)),statics_1=__importDefault(require('./statics')),schema=new mongoose_1[(a15_0x463386(0xdf))]({'_id':{'type':mongoose_1[a15_0x463386(0xdf)]['Types']['ObjectId']},'name':{'type':String,'required':!![]},'message':{'type':String,'required':!![]},'global_flag':{'type':Boolean||String||Number||mongoose_1['Schema']['Types'][a15_0x463386(0xe0)],'refPath':a15_0x463386(0xd5),'required':!![]},'reference':{'type':String,'enum':[a15_0x463386(0xd4),a15_0x463386(0xd9),a15_0x463386(0xd3)]}});exports[a15_0x463386(0xe4)]=(0x0,statics_1['default'])(schema); \ No newline at end of file diff --git a/models/global-setting/statics.js b/models/global-setting/statics.js index 2a377ee..27fc617 100644 --- a/models/global-setting/statics.js +++ b/models/global-setting/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Global Settings Collection by Deleting all the Records - * - * @param {IGlobalSettingsModel} this - Global Setting's Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';function a16_0x1034(_0x116a34,_0x62fbd9){var _0x5144b4=a16_0x5144();return a16_0x1034=function(_0x103414,_0x515970){_0x103414=_0x103414-0x102;var _0x2dcc29=_0x5144b4[_0x103414];return _0x2dcc29;},a16_0x1034(_0x116a34,_0x62fbd9);}var a16_0xff2110=a16_0x1034;function a16_0x5144(){var _0x48181d=['8jZpoht','6021450udRcEa','2696795foQnIv','2530088OLPyTc','11BYlEBP','29039544tiQesE','clearCollection','__esModule','18734uimGFn','clearAll','../../plugins/db/statics','defineProperty','3543348zqPXQB','default','4773622tMSgcD'];a16_0x5144=function(){return _0x48181d;};return a16_0x5144();}(function(_0x7f106,_0x50a095){var _0x164d53=a16_0x1034,_0xfaa3df=_0x7f106();while(!![]){try{var _0x166401=parseInt(_0x164d53(0x108))/0x1*(-parseInt(_0x164d53(0x10c))/0x2)+parseInt(_0x164d53(0x110))/0x3+parseInt(_0x164d53(0x107))/0x4+parseInt(_0x164d53(0x106))/0x5+parseInt(_0x164d53(0x105))/0x6+parseInt(_0x164d53(0x103))/0x7*(parseInt(_0x164d53(0x104))/0x8)+-parseInt(_0x164d53(0x109))/0x9;if(_0x166401===_0x50a095)break;else _0xfaa3df['push'](_0xfaa3df['shift']());}catch(_0x4e8660){_0xfaa3df['push'](_0xfaa3df['shift']());}}}(a16_0x5144,0xad101));Object[a16_0xff2110(0x10f)](exports,a16_0xff2110(0x10b),{'value':!![]}),exports[a16_0xff2110(0x10d)]=void 0x0;var statics_1=require(a16_0xff2110(0x10e));function clearAll(){var _0x3e6535=a16_0xff2110;return(0x0,statics_1[_0x3e6535(0x10a)])(this);}exports['clearAll']=clearAll;function default_1(_0x34635b){var _0x5cf8b9=a16_0xff2110;return _0x34635b['statics'][_0x5cf8b9(0x10d)]=clearAll,_0x34635b;}exports[a16_0xff2110(0x102)]=default_1; \ No newline at end of file diff --git a/models/index.js b/models/index.js index 9526949..bb26a47 100644 --- a/models/index.js +++ b/models/index.js @@ -1,34 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SMTPMailers = exports.SMTPProviders = exports.GlobalSettings = exports.Frontends = exports.Policies = exports.Roles = exports.Tokens = exports.Credentials = exports.BlacklistUsers = exports.PendingUsers = exports.Scopes = exports.ServiceAccs = exports.Sessions = exports.Users = void 0; -var user_1 = require("./user"); -Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return __importDefault(user_1).default; } }); -var session_1 = require("./session"); -Object.defineProperty(exports, "Sessions", { enumerable: true, get: function () { return __importDefault(session_1).default; } }); -var service_account_1 = require("./service-account"); -Object.defineProperty(exports, "ServiceAccs", { enumerable: true, get: function () { return __importDefault(service_account_1).default; } }); -var scope_1 = require("./scope"); -Object.defineProperty(exports, "Scopes", { enumerable: true, get: function () { return __importDefault(scope_1).default; } }); -var pending_user_1 = require("./pending-user"); -Object.defineProperty(exports, "PendingUsers", { enumerable: true, get: function () { return __importDefault(pending_user_1).default; } }); -var blacklisted_user_1 = require("./blacklisted-user"); -Object.defineProperty(exports, "BlacklistUsers", { enumerable: true, get: function () { return __importDefault(blacklisted_user_1).default; } }); -var credential_1 = require("./credential"); -Object.defineProperty(exports, "Credentials", { enumerable: true, get: function () { return __importDefault(credential_1).default; } }); -var tokens_1 = require("./tokens"); -Object.defineProperty(exports, "Tokens", { enumerable: true, get: function () { return __importDefault(tokens_1).default; } }); -var role_1 = require("./role"); -Object.defineProperty(exports, "Roles", { enumerable: true, get: function () { return __importDefault(role_1).default; } }); -var policy_1 = require("./policy"); -Object.defineProperty(exports, "Policies", { enumerable: true, get: function () { return __importDefault(policy_1).default; } }); -var frontend_1 = require("./frontend"); -Object.defineProperty(exports, "Frontends", { enumerable: true, get: function () { return __importDefault(frontend_1).default; } }); -var global_setting_1 = require("./global-setting"); -Object.defineProperty(exports, "GlobalSettings", { enumerable: true, get: function () { return __importDefault(global_setting_1).default; } }); -var smtp_provider_1 = require("./smtp-provider"); -Object.defineProperty(exports, "SMTPProviders", { enumerable: true, get: function () { return __importDefault(smtp_provider_1).default; } }); -var smtp_mailer_1 = require("./smtp-mailer"); -Object.defineProperty(exports, "SMTPMailers", { enumerable: true, get: function () { return __importDefault(smtp_mailer_1).default; } }); +'use strict';var a17_0x82c500=a17_0x3644;(function(_0x34dba7,_0x278381){var _0x5836ff=a17_0x3644,_0x327120=_0x34dba7();while(!![]){try{var _0x25bf2b=parseInt(_0x5836ff(0xf6))/0x1+parseInt(_0x5836ff(0xff))/0x2*(-parseInt(_0x5836ff(0xec))/0x3)+parseInt(_0x5836ff(0xeb))/0x4*(-parseInt(_0x5836ff(0x109))/0x5)+parseInt(_0x5836ff(0xf0))/0x6+-parseInt(_0x5836ff(0xfa))/0x7*(-parseInt(_0x5836ff(0xf2))/0x8)+-parseInt(_0x5836ff(0xfb))/0x9*(parseInt(_0x5836ff(0xf4))/0xa)+parseInt(_0x5836ff(0xf7))/0xb*(parseInt(_0x5836ff(0x10d))/0xc);if(_0x25bf2b===_0x278381)break;else _0x327120['push'](_0x327120['shift']());}catch(_0x18d6f6){_0x327120['push'](_0x327120['shift']());}}}(a17_0x507e,0x83bca));var __importDefault=this&&this['__importDefault']||function(_0x35ad35){return _0x35ad35&&_0x35ad35['__esModule']?_0x35ad35:{'default':_0x35ad35};};Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0x10b),{'value':!![]}),exports[a17_0x82c500(0x103)]=exports[a17_0x82c500(0x10a)]=exports[a17_0x82c500(0xf1)]=exports[a17_0x82c500(0xef)]=exports['Policies']=exports[a17_0x82c500(0xf9)]=exports[a17_0x82c500(0xee)]=exports[a17_0x82c500(0x10c)]=exports[a17_0x82c500(0x104)]=exports[a17_0x82c500(0xf5)]=exports[a17_0x82c500(0xea)]=exports[a17_0x82c500(0x108)]=exports[a17_0x82c500(0xf3)]=exports[a17_0x82c500(0x106)]=void 0x0;var user_1=require(a17_0x82c500(0x105));Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0x106),{'enumerable':!![],'get':function(){var _0x10f806=a17_0x82c500;return __importDefault(user_1)[_0x10f806(0x100)];}});var session_1=require('./session');Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xf3),{'enumerable':!![],'get':function(){return __importDefault(session_1)['default'];}});var service_account_1=require('./service-account');Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0x108),{'enumerable':!![],'get':function(){return __importDefault(service_account_1)['default'];}});var scope_1=require(a17_0x82c500(0xfe));function a17_0x507e(){var _0x2aa8d1=['./smtp-provider','Tokens','Frontends','697230BUUgEp','GlobalSettings','801032GjNeOe','Sessions','6800meHKat','PendingUsers','954444zevomn','982443NYVcUs','./policy','Roles','63CUVgsq','8361ZxgTNl','Policies','./global-setting','./scope','749302QxaLVt','default','./frontend','./credential','SMTPMailers','BlacklistUsers','./user','Users','defineProperty','ServiceAccs','38120gLLecG','SMTPProviders','__esModule','Credentials','36DBGJAb','./tokens','Scopes','364gaecgj','3veFiug'];a17_0x507e=function(){return _0x2aa8d1;};return a17_0x507e();}Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xea),{'enumerable':!![],'get':function(){var _0x3c9ebb=a17_0x82c500;return __importDefault(scope_1)[_0x3c9ebb(0x100)];}});var pending_user_1=require('./pending-user');Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xf5),{'enumerable':!![],'get':function(){return __importDefault(pending_user_1)['default'];}});var blacklisted_user_1=require('./blacklisted-user');Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0x104),{'enumerable':!![],'get':function(){return __importDefault(blacklisted_user_1)['default'];}});var credential_1=require(a17_0x82c500(0x102));Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0x10c),{'enumerable':!![],'get':function(){var _0x1647f9=a17_0x82c500;return __importDefault(credential_1)[_0x1647f9(0x100)];}});var tokens_1=require(a17_0x82c500(0xe9));function a17_0x3644(_0x127607,_0x3ac641){var _0x507e3b=a17_0x507e();return a17_0x3644=function(_0x3644ea,_0x244fd6){_0x3644ea=_0x3644ea-0xe9;var _0x3b389f=_0x507e3b[_0x3644ea];return _0x3b389f;},a17_0x3644(_0x127607,_0x3ac641);}Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xee),{'enumerable':!![],'get':function(){var _0x3463dc=a17_0x82c500;return __importDefault(tokens_1)[_0x3463dc(0x100)];}});var role_1=require('./role');Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xf9),{'enumerable':!![],'get':function(){return __importDefault(role_1)['default'];}});var policy_1=require(a17_0x82c500(0xf8));Object[a17_0x82c500(0x107)](exports,a17_0x82c500(0xfc),{'enumerable':!![],'get':function(){var _0x2ad0a9=a17_0x82c500;return __importDefault(policy_1)[_0x2ad0a9(0x100)];}});var frontend_1=require(a17_0x82c500(0x101));Object[a17_0x82c500(0x107)](exports,'Frontends',{'enumerable':!![],'get':function(){var _0x4a0460=a17_0x82c500;return __importDefault(frontend_1)[_0x4a0460(0x100)];}});var global_setting_1=require(a17_0x82c500(0xfd));Object[a17_0x82c500(0x107)](exports,'GlobalSettings',{'enumerable':!![],'get':function(){var _0x417b35=a17_0x82c500;return __importDefault(global_setting_1)[_0x417b35(0x100)];}});var smtp_provider_1=require(a17_0x82c500(0xed));Object[a17_0x82c500(0x107)](exports,'SMTPProviders',{'enumerable':!![],'get':function(){var _0x475a5e=a17_0x82c500;return __importDefault(smtp_provider_1)[_0x475a5e(0x100)];}});var smtp_mailer_1=require('./smtp-mailer');Object['defineProperty'](exports,a17_0x82c500(0x103),{'enumerable':!![],'get':function(){var _0x434b44=a17_0x82c500;return __importDefault(smtp_mailer_1)[_0x434b44(0x100)];}}); \ No newline at end of file diff --git a/models/pending-user/index.js b/models/pending-user/index.js index 4f3bbe2..ccd0e66 100644 --- a/models/pending-user/index.js +++ b/models/pending-user/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';function a18_0x1e9a(_0x1d70c1,_0x31c359){var _0x428cf5=a18_0x428c();return a18_0x1e9a=function(_0x1e9aa4,_0x1729a7){_0x1e9aa4=_0x1e9aa4-0x128;var _0x335c39=_0x428cf5[_0x1e9aa4];return _0x335c39;},a18_0x1e9a(_0x1d70c1,_0x31c359);}var a18_0x10a395=a18_0x1e9a;(function(_0x3649ff,_0x59f718){var _0x3b3c38=a18_0x1e9a,_0x504b48=_0x3649ff();while(!![]){try{var _0x2ddb5f=-parseInt(_0x3b3c38(0x12d))/0x1*(-parseInt(_0x3b3c38(0x133))/0x2)+-parseInt(_0x3b3c38(0x131))/0x3*(-parseInt(_0x3b3c38(0x12b))/0x4)+-parseInt(_0x3b3c38(0x12e))/0x5+-parseInt(_0x3b3c38(0x137))/0x6*(parseInt(_0x3b3c38(0x136))/0x7)+-parseInt(_0x3b3c38(0x130))/0x8*(parseInt(_0x3b3c38(0x135))/0x9)+parseInt(_0x3b3c38(0x12c))/0xa+-parseInt(_0x3b3c38(0x12f))/0xb*(-parseInt(_0x3b3c38(0x132))/0xc);if(_0x2ddb5f===_0x59f718)break;else _0x504b48['push'](_0x504b48['shift']());}catch(_0x2a1dd4){_0x504b48['push'](_0x504b48['shift']());}}}(a18_0x428c,0x4dda5));function a18_0x428c(){var _0x1801b1=['12mhdLyO','545150wYCRjT','./model','657YqMwmC','14GcSZxU','556422jxaMcX','__esModule','defineProperty','default','1436052OICvYi','3462520WqlYIV','1lutGmK','569865IqmHuJ','2901426lQVyLy','68304ZQoFiB','3Abnwaw'];a18_0x428c=function(){return _0x1801b1;};return a18_0x428c();}var __importDefault=this&&this['__importDefault']||function(_0x4f63b9){var _0x1a59ce=a18_0x1e9a;return _0x4f63b9&&_0x4f63b9[_0x1a59ce(0x128)]?_0x4f63b9:{'default':_0x4f63b9};};Object[a18_0x10a395(0x129)](exports,a18_0x10a395(0x128),{'value':!![]}),exports[a18_0x10a395(0x12a)]=void 0x0;var model_1=require(a18_0x10a395(0x134));Object[a18_0x10a395(0x129)](exports,a18_0x10a395(0x12a),{'enumerable':!![],'get':function(){var _0x5ecd2b=a18_0x10a395;return __importDefault(model_1)[_0x5ecd2b(0x12a)];}}); \ No newline at end of file diff --git a/models/pending-user/model.js b/models/pending-user/model.js index e4395eb..1e3ba0c 100644 --- a/models/pending-user/model.js +++ b/models/pending-user/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('PendingUser', schema_1.default); +'use strict';var a19_0x35d3a8=a19_0x35f9;function a19_0x2deb(){var _0x13d816=['defineProperty','model','__esModule','1014556pYOFmA','mongoose','2114980yLcRxs','__importDefault','2390424WFCeHm','20949PnRTTk','PendingUser','4585294osmvDy','8546848dWXyll','687569THfIoY','./schema','default','10WYvSjw'];a19_0x2deb=function(){return _0x13d816;};return a19_0x2deb();}(function(_0x270c8a,_0x3bd242){var _0x155cb7=a19_0x35f9,_0x33aab7=_0x270c8a();while(!![]){try{var _0x624d5e=parseInt(_0x155cb7(0xe8))/0x1+parseInt(_0x155cb7(0xeb))/0x2*(-parseInt(_0x155cb7(0xe4))/0x3)+parseInt(_0x155cb7(0xdf))/0x4+-parseInt(_0x155cb7(0xe1))/0x5+-parseInt(_0x155cb7(0xe3))/0x6+-parseInt(_0x155cb7(0xe6))/0x7+parseInt(_0x155cb7(0xe7))/0x8;if(_0x624d5e===_0x3bd242)break;else _0x33aab7['push'](_0x33aab7['shift']());}catch(_0x3a660c){_0x33aab7['push'](_0x33aab7['shift']());}}}(a19_0x2deb,0x79a1f));function a19_0x35f9(_0x25a896,_0x546216){var _0x2deb29=a19_0x2deb();return a19_0x35f9=function(_0x35f954,_0x59f18e){_0x35f954=_0x35f954-0xdf;var _0x3eb726=_0x2deb29[_0x35f954];return _0x3eb726;},a19_0x35f9(_0x25a896,_0x546216);}var __importDefault=this&&this[a19_0x35d3a8(0xe2)]||function(_0x14b45f){var _0x3f2b81=a19_0x35d3a8;return _0x14b45f&&_0x14b45f[_0x3f2b81(0xee)]?_0x14b45f:{'default':_0x14b45f};};Object[a19_0x35d3a8(0xec)](exports,a19_0x35d3a8(0xee),{'value':!![]});var mongoose_1=require(a19_0x35d3a8(0xe0)),schema_1=__importDefault(require(a19_0x35d3a8(0xe9)));exports[a19_0x35d3a8(0xea)]=(0x0,mongoose_1[a19_0x35d3a8(0xed)])(a19_0x35d3a8(0xe5),schema_1[a19_0x35d3a8(0xea)]); \ No newline at end of file diff --git a/models/pending-user/schema.js b/models/pending-user/schema.js index 56f0ab2..c0108c6 100644 --- a/models/pending-user/schema.js +++ b/models/pending-user/schema.js @@ -1,44 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - encrypt: true, - }, - email: { - type: String, - required: true, - }, - message: { - type: String, - required: true, - }, - role: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Role', - required: true, - }, - scopes: [ - { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Scope', - }, - ], - requested_at: { - type: Number, - required: true, - default: Date.now, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';function a20_0x4115(_0x503531,_0x206bfb){var _0x5ee2bc=a20_0x5ee2();return a20_0x4115=function(_0x411524,_0x53c767){_0x411524=_0x411524-0xfe;var _0x4f118a=_0x5ee2bc[_0x411524];return _0x4f118a;},a20_0x4115(_0x503531,_0x206bfb);}var a20_0x41f3db=a20_0x4115;function a20_0x5ee2(){var _0x358584=['cryptoPlugin','4130qrlaGV','234lOzNOP','__importDefault','__esModule','defineProperty','634788cYGpRI','now','Schema','mongoose','45717oqqYcQ','../../plugins/db/plugins','./statics','Role','2620881egcQev','plugin','5196WxAeqT','ObjectId','Types','48917BpxMhg','8386656DCRQpH','3476jinINK','default','2230dTqUko','89GsMzJo'];a20_0x5ee2=function(){return _0x358584;};return a20_0x5ee2();}(function(_0x4840b9,_0x47affb){var _0x179aa6=a20_0x4115,_0x5c2265=_0x4840b9();while(!![]){try{var _0x107855=-parseInt(_0x179aa6(0x113))/0x1*(-parseInt(_0x179aa6(0x10b))/0x2)+parseInt(_0x179aa6(0x101))/0x3+parseInt(_0x179aa6(0x110))/0x4*(parseInt(_0x179aa6(0x112))/0x5)+-parseInt(_0x179aa6(0x116))/0x6*(-parseInt(_0x179aa6(0x105))/0x7)+parseInt(_0x179aa6(0x10f))/0x8+parseInt(_0x179aa6(0x109))/0x9+parseInt(_0x179aa6(0x115))/0xa*(-parseInt(_0x179aa6(0x10e))/0xb);if(_0x107855===_0x47affb)break;else _0x5c2265['push'](_0x5c2265['shift']());}catch(_0x1ac9d4){_0x5c2265['push'](_0x5c2265['shift']());}}}(a20_0x5ee2,0x8f8ff));var __importDefault=this&&this[a20_0x41f3db(0xfe)]||function(_0x459ad5){var _0x19dffa=a20_0x41f3db;return _0x459ad5&&_0x459ad5[_0x19dffa(0xff)]?_0x459ad5:{'default':_0x459ad5};};Object[a20_0x41f3db(0x100)](exports,a20_0x41f3db(0xff),{'value':!![]});var mongoose_1=require(a20_0x41f3db(0x104)),statics_1=__importDefault(require(a20_0x41f3db(0x107))),plugins_1=require(a20_0x41f3db(0x106)),schema=new mongoose_1[(a20_0x41f3db(0x103))]({'_id':{'type':mongoose_1['Schema'][a20_0x41f3db(0x10d)][a20_0x41f3db(0x10c)]},'name':{'type':String,'required':!![],'encrypt':!![]},'email':{'type':String,'required':!![]},'message':{'type':String,'required':!![]},'role':{'type':mongoose_1[a20_0x41f3db(0x103)][a20_0x41f3db(0x10d)][a20_0x41f3db(0x10c)],'ref':a20_0x41f3db(0x108),'required':!![]},'scopes':[{'type':mongoose_1['Schema'][a20_0x41f3db(0x10d)][a20_0x41f3db(0x10c)],'ref':'Scope'}],'requested_at':{'type':Number,'required':!![],'default':Date[a20_0x41f3db(0x102)]}});schema[a20_0x41f3db(0x10a)]((0x0,plugins_1[a20_0x41f3db(0x114)])()),exports[a20_0x41f3db(0x111)]=(0x0,statics_1['default'])(schema); \ No newline at end of file diff --git a/models/pending-user/statics.js b/models/pending-user/statics.js index 37157df..48f90f4 100644 --- a/models/pending-user/statics.js +++ b/models/pending-user/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Pending User Collection by Deleting all the Records - * - * @param {IPendingUserModel} this - Pending User Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a21_0x314f26=a21_0x377f;(function(_0x30e3ee,_0x5a181a){var _0x4c31bc=a21_0x377f,_0x392e9d=_0x30e3ee();while(!![]){try{var _0x16d8c5=-parseInt(_0x4c31bc(0xa3))/0x1*(parseInt(_0x4c31bc(0xa5))/0x2)+-parseInt(_0x4c31bc(0xa8))/0x3+-parseInt(_0x4c31bc(0xa0))/0x4*(-parseInt(_0x4c31bc(0xa7))/0x5)+-parseInt(_0x4c31bc(0xa4))/0x6*(parseInt(_0x4c31bc(0xa1))/0x7)+parseInt(_0x4c31bc(0xaa))/0x8*(parseInt(_0x4c31bc(0xa2))/0x9)+-parseInt(_0x4c31bc(0x9f))/0xa+parseInt(_0x4c31bc(0xac))/0xb;if(_0x16d8c5===_0x5a181a)break;else _0x392e9d['push'](_0x392e9d['shift']());}catch(_0x3e0031){_0x392e9d['push'](_0x392e9d['shift']());}}}(a21_0x3144,0x867b1));function a21_0x377f(_0x4e3d9f,_0x5b1ad8){var _0x314455=a21_0x3144();return a21_0x377f=function(_0x377fa5,_0x157ecb){_0x377fa5=_0x377fa5-0x9f;var _0x25d8b5=_0x314455[_0x377fa5];return _0x25d8b5;},a21_0x377f(_0x4e3d9f,_0x5b1ad8);}Object['defineProperty'](exports,a21_0x314f26(0xab),{'value':!![]}),exports[a21_0x314f26(0xa6)]=void 0x0;var statics_1=require(a21_0x314f26(0xad));function clearAll(){return(0x0,statics_1['clearCollection'])(this);}exports[a21_0x314f26(0xa6)]=clearAll;function default_1(_0x2b9038){var _0x4edce0=a21_0x314f26;return _0x2b9038['statics'][_0x4edce0(0xa6)]=clearAll,_0x2b9038;}function a21_0x3144(){var _0x454d87=['2495484LzEbnX','default','5481752IcFsyg','__esModule','25171828becwfy','../../plugins/db/statics','8357570WvueEc','4UETkNj','1414hNxdYS','9xlYaXd','149405gQbbKT','24078sijKlz','4AgpSAH','clearAll','1771435ywwKAX'];a21_0x3144=function(){return _0x454d87;};return a21_0x3144();}exports[a21_0x314f26(0xa9)]=default_1; \ No newline at end of file diff --git a/models/policy/index.js b/models/policy/index.js index 4f3bbe2..ca02e5b 100644 --- a/models/policy/index.js +++ b/models/policy/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a22_0x364fde=a22_0x3f6a;function a22_0x3f6a(_0x5d482a,_0x41d19e){var _0x5ba24f=a22_0x5ba2();return a22_0x3f6a=function(_0x3f6a40,_0x57a19c){_0x3f6a40=_0x3f6a40-0x73;var _0x4b0272=_0x5ba24f[_0x3f6a40];return _0x4b0272;},a22_0x3f6a(_0x5d482a,_0x41d19e);}(function(_0x51ee89,_0x32ce96){var _0x17fdb9=a22_0x3f6a,_0x5ab44f=_0x51ee89();while(!![]){try{var _0x2a0639=-parseInt(_0x17fdb9(0x7f))/0x1*(-parseInt(_0x17fdb9(0x81))/0x2)+parseInt(_0x17fdb9(0x82))/0x3+parseInt(_0x17fdb9(0x7a))/0x4*(parseInt(_0x17fdb9(0x80))/0x5)+parseInt(_0x17fdb9(0x74))/0x6*(parseInt(_0x17fdb9(0x7b))/0x7)+-parseInt(_0x17fdb9(0x77))/0x8*(parseInt(_0x17fdb9(0x7c))/0x9)+-parseInt(_0x17fdb9(0x7e))/0xa*(parseInt(_0x17fdb9(0x7d))/0xb)+parseInt(_0x17fdb9(0x78))/0xc*(-parseInt(_0x17fdb9(0x79))/0xd);if(_0x2a0639===_0x32ce96)break;else _0x5ab44f['push'](_0x5ab44f['shift']());}catch(_0x11240b){_0x5ab44f['push'](_0x5ab44f['shift']());}}}(a22_0x5ba2,0xd5a05));var __importDefault=this&&this[a22_0x364fde(0x83)]||function(_0x2c76f6){return _0x2c76f6&&_0x2c76f6['__esModule']?_0x2c76f6:{'default':_0x2c76f6};};Object['defineProperty'](exports,a22_0x364fde(0x75),{'value':!![]}),exports['default']=void 0x0;var model_1=require('./model');Object[a22_0x364fde(0x73)](exports,a22_0x364fde(0x76),{'enumerable':!![],'get':function(){var _0x32894e=a22_0x364fde;return __importDefault(model_1)[_0x32894e(0x76)];}});function a22_0x5ba2(){var _0x5d789c=['defineProperty','90078tuHIie','__esModule','default','1647848rpsSYc','28344ehBgsR','12454YHtKKL','2364QkKbML','658DBFERY','9yAwIQx','4945435KuFOTz','20AEnoCH','7383tmwsHP','9670yBLwVe','346RHZLSm','1234455JKeZxB','__importDefault'];a22_0x5ba2=function(){return _0x5d789c;};return a22_0x5ba2();} \ No newline at end of file diff --git a/models/policy/model.js b/models/policy/model.js index f542759..adf42c1 100644 --- a/models/policy/model.js +++ b/models/policy/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Policy', schema_1.default); +'use strict';var a23_0x2351af=a23_0x23ba;(function(_0x3419be,_0x52d1c4){var _0x156051=a23_0x23ba,_0x6c7329=_0x3419be();while(!![]){try{var _0x1df2e7=parseInt(_0x156051(0x115))/0x1*(-parseInt(_0x156051(0x118))/0x2)+parseInt(_0x156051(0x11e))/0x3+parseInt(_0x156051(0x114))/0x4+-parseInt(_0x156051(0x112))/0x5*(-parseInt(_0x156051(0x110))/0x6)+parseInt(_0x156051(0x11d))/0x7+-parseInt(_0x156051(0x11a))/0x8+-parseInt(_0x156051(0x11b))/0x9*(parseInt(_0x156051(0x113))/0xa);if(_0x1df2e7===_0x52d1c4)break;else _0x6c7329['push'](_0x6c7329['shift']());}catch(_0xfc4dda){_0x6c7329['push'](_0x6c7329['shift']());}}}(a23_0x4e31,0xf19ff));function a23_0x4e31(){var _0x45aece=['5728820PTlBWp','5SvhCdp','./schema','Policy','199790glTvse','__esModule','6929712Gccuzr','72OPVOSv','mongoose','1832565KOPAqo','974787tJCMMj','model','default','8323242zHunUz','__importDefault','5fOjjsT','1313440pwWosZ'];a23_0x4e31=function(){return _0x45aece;};return a23_0x4e31();}var __importDefault=this&&this[a23_0x2351af(0x111)]||function(_0x1a4e9f){var _0x34dda8=a23_0x2351af;return _0x1a4e9f&&_0x1a4e9f[_0x34dda8(0x119)]?_0x1a4e9f:{'default':_0x1a4e9f};};Object['defineProperty'](exports,'__esModule',{'value':!![]});function a23_0x23ba(_0x33b1de,_0x19df48){var _0x4e31fb=a23_0x4e31();return a23_0x23ba=function(_0x23ba0f,_0xd88b7){_0x23ba0f=_0x23ba0f-0x10f;var _0x46d849=_0x4e31fb[_0x23ba0f];return _0x46d849;},a23_0x23ba(_0x33b1de,_0x19df48);}var mongoose_1=require(a23_0x2351af(0x11c)),schema_1=__importDefault(require(a23_0x2351af(0x116)));exports[a23_0x2351af(0x10f)]=(0x0,mongoose_1[a23_0x2351af(0x11f)])(a23_0x2351af(0x117),schema_1['default']); \ No newline at end of file diff --git a/models/policy/schema.js b/models/policy/schema.js index a445dc1..7e14010 100644 --- a/models/policy/schema.js +++ b/models/policy/schema.js @@ -1,25 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - }, - message: { - type: String, - required: true, - }, - global_flag: { - type: Boolean, - required: true, - }, -}); -exports.default = (0, statics_1.default)(schema); +'use strict';var a24_0x1f8d43=a24_0x3773;function a24_0x3773(_0x339652,_0x1b7c1d){var _0x2cca95=a24_0x2cca();return a24_0x3773=function(_0x377368,_0x5cf04c){_0x377368=_0x377368-0x1c8;var _0x12de8a=_0x2cca95[_0x377368];return _0x12de8a;},a24_0x3773(_0x339652,_0x1b7c1d);}(function(_0x182163,_0x28ee2a){var _0x580b42=a24_0x3773,_0x4a6dc6=_0x182163();while(!![]){try{var _0x3e129a=-parseInt(_0x580b42(0x1d6))/0x1+-parseInt(_0x580b42(0x1cf))/0x2+-parseInt(_0x580b42(0x1ca))/0x3*(parseInt(_0x580b42(0x1d1))/0x4)+parseInt(_0x580b42(0x1d4))/0x5+parseInt(_0x580b42(0x1d2))/0x6+-parseInt(_0x580b42(0x1c9))/0x7*(-parseInt(_0x580b42(0x1d3))/0x8)+-parseInt(_0x580b42(0x1cd))/0x9*(-parseInt(_0x580b42(0x1d7))/0xa);if(_0x3e129a===_0x28ee2a)break;else _0x4a6dc6['push'](_0x4a6dc6['shift']());}catch(_0x17948c){_0x4a6dc6['push'](_0x4a6dc6['shift']());}}}(a24_0x2cca,0x86ef2));var __importDefault=this&&this[a24_0x1f8d43(0x1d5)]||function(_0x130204){return _0x130204&&_0x130204['__esModule']?_0x130204:{'default':_0x130204};};Object[a24_0x1f8d43(0x1cc)](exports,a24_0x1f8d43(0x1d0),{'value':!![]});function a24_0x2cca(){var _0x88aac3=['Types','default','147WOKxxd','66ujMrKa','Schema','defineProperty','45PpWWnq','./statics','1836278PXcbmq','__esModule','54608DofHKc','55950hMZKbS','157328zroPHL','4399070IMAnwk','__importDefault','583917XSwPVW','2105930rFmeII'];a24_0x2cca=function(){return _0x88aac3;};return a24_0x2cca();}var mongoose_1=require('mongoose'),statics_1=__importDefault(require(a24_0x1f8d43(0x1ce))),schema=new mongoose_1[(a24_0x1f8d43(0x1cb))]({'_id':{'type':mongoose_1[a24_0x1f8d43(0x1cb)][a24_0x1f8d43(0x1d8)]['ObjectId']},'name':{'type':String,'required':!![]},'message':{'type':String,'required':!![]},'global_flag':{'type':Boolean,'required':!![]}});exports[a24_0x1f8d43(0x1c8)]=(0x0,statics_1[a24_0x1f8d43(0x1c8)])(schema); \ No newline at end of file diff --git a/models/policy/statics.js b/models/policy/statics.js index 16ae32e..19bf6c2 100644 --- a/models/policy/statics.js +++ b/models/policy/statics.js @@ -1,75 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapCheck = exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -var policies_1 = require("../../plugins/templates/policies"); -/** - * Clears the Policy Collection by Deleting all the Records - * - * @param {IPolicyModel} this - Policy Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Checks the Predefined map of Policies with the Docs present in Database - * - * @param {IPolicyModel} this - Policy Model - * @returns {Promise>} - Response whether map is matching or not - */ -function mapCheck() { - var _this = this; - return new Promise(function (resolve, reject) { - var result = { - success: false, - data: false, - error: null, - }; - _this.find({}) - .then(function (docs) { - var policyMatches = []; - result.success = true; - var _loop_1 = function (i) { - var map = policies_1.map[i]; - var doc = docs.filter(function (doc) { return doc._id === map._id; })[0]; - if (doc && map && doc._id === map._id) { - var name_1 = doc.name === map.name; - var message = doc.message === map.message; - policyMatches.push(name_1 && message); - } - else { - policyMatches.push(false); - } - }; - for (var i = 0; i < policies_1.map.length; i++) { - _loop_1(i); - } - if (policyMatches.includes(false)) { - result.data = false; - } - else { - result.data = true; - } - resolve(result); - }) - .catch(function (err) { - result.error = err; - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -exports.mapCheck = mapCheck; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - schema.statics.mapCheck = mapCheck; - return schema; -} -exports.default = default_1; +'use strict';var a25_0xd119ac=a25_0x195b;function a25_0x195b(_0x3bb64e,_0x453256){var _0x4a8c85=a25_0x4a8c();return a25_0x195b=function(_0x195b0b,_0xaa510c){_0x195b0b=_0x195b0b-0x109;var _0x555541=_0x4a8c85[_0x195b0b];return _0x555541;},a25_0x195b(_0x3bb64e,_0x453256);}(function(_0x177ff3,_0x289006){var _0x34d54f=a25_0x195b,_0x3270bd=_0x177ff3();while(!![]){try{var _0x1ac12e=-parseInt(_0x34d54f(0x10b))/0x1*(parseInt(_0x34d54f(0x125))/0x2)+parseInt(_0x34d54f(0x11e))/0x3*(-parseInt(_0x34d54f(0x10e))/0x4)+-parseInt(_0x34d54f(0x113))/0x5+-parseInt(_0x34d54f(0x122))/0x6+-parseInt(_0x34d54f(0x114))/0x7*(parseInt(_0x34d54f(0x11a))/0x8)+-parseInt(_0x34d54f(0x116))/0x9*(-parseInt(_0x34d54f(0x11d))/0xa)+parseInt(_0x34d54f(0x123))/0xb*(parseInt(_0x34d54f(0x126))/0xc);if(_0x1ac12e===_0x289006)break;else _0x3270bd['push'](_0x3270bd['shift']());}catch(_0x5f0ffa){_0x3270bd['push'](_0x3270bd['shift']());}}}(a25_0x4a8c,0xe1aa3));Object[a25_0xd119ac(0x109)](exports,'__esModule',{'value':!![]}),exports[a25_0xd119ac(0x111)]=exports['clearAll']=void 0x0;var statics_1=require(a25_0xd119ac(0x110)),policies_1=require('../../plugins/templates/policies');function clearAll(){var _0x34e8db=a25_0xd119ac;return(0x0,statics_1[_0x34e8db(0x119)])(this);}exports[a25_0xd119ac(0x121)]=clearAll;function mapCheck(){var _0x31f0a1=this;return new Promise(function(_0x194163,_0x252fd7){var _0x6ecf2e=a25_0x195b,_0x3a24dc={'success':![],'data':![],'error':null};_0x31f0a1[_0x6ecf2e(0x10f)]({})[_0x6ecf2e(0x10a)](function(_0x5cb59f){var _0x4ed447=_0x6ecf2e,_0x488927=[];_0x3a24dc['success']=!![];var _0x53d281=function(_0x5bfbf0){var _0x2b877c=a25_0x195b,_0x5cdbc0=policies_1['map'][_0x5bfbf0],_0x249993=_0x5cb59f[_0x2b877c(0x124)](function(_0xf1b977){var _0x149da2=_0x2b877c;return _0xf1b977[_0x149da2(0x127)]===_0x5cdbc0['_id'];})[0x0];if(_0x249993&&_0x5cdbc0&&_0x249993[_0x2b877c(0x127)]===_0x5cdbc0[_0x2b877c(0x127)]){var _0x30fbd8=_0x249993['name']===_0x5cdbc0[_0x2b877c(0x10c)],_0x5b33d2=_0x249993['message']===_0x5cdbc0[_0x2b877c(0x112)];_0x488927[_0x2b877c(0x117)](_0x30fbd8&&_0x5b33d2);}else _0x488927[_0x2b877c(0x117)](![]);};for(var _0x56e18a=0x0;_0x56e18a>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Checks the Predefined map of Roles with the Docs present in Database - * - * @param {IRoleModel} this - Policy Model - * @returns {Promise>} - Response whether map is matching or not - */ -function mapCheck() { - var _this = this; - return new Promise(function (resolve, reject) { - var result = { - success: false, - data: false, - error: null, - }; - _this.find({}) - .then(function (docs) { - var roleMatches = []; - result.success = true; - var _loop_1 = function (i) { - var map = roles_1.map[i]; - var doc = docs.filter(function (doc) { return doc._id === map._id; })[0]; - if (doc && map && doc._id === map._id) { - var name_1 = doc.name === map.name; - var allowedPolicies = doc.allowed_policies.length === map.allowed_policies.length; - roleMatches.push(name_1 && allowedPolicies); - } - else { - roleMatches.push(false); - } - }; - for (var i = 0; i < roles_1.map.length; i++) { - _loop_1(i); - } - if (roleMatches.includes(false)) { - result.data = false; - } - else { - result.data = true; - } - resolve(result); - }) - .catch(function (err) { - result.error = err; - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -exports.mapCheck = mapCheck; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - schema.statics.mapCheck = mapCheck; - return schema; -} -exports.default = default_1; +'use strict';var a29_0x4dd73b=a29_0x2fe6;function a29_0x2fe6(_0x1139e5,_0x58e5a6){var _0x3a622=a29_0x3a62();return a29_0x2fe6=function(_0x2fe681,_0x411390){_0x2fe681=_0x2fe681-0x81;var _0x1b77a2=_0x3a622[_0x2fe681];return _0x1b77a2;},a29_0x2fe6(_0x1139e5,_0x58e5a6);}(function(_0x32f309,_0x2b7ac8){var _0x5960fe=a29_0x2fe6,_0x40aa7c=_0x32f309();while(!![]){try{var _0x3d079d=-parseInt(_0x5960fe(0x99))/0x1+parseInt(_0x5960fe(0x8a))/0x2*(-parseInt(_0x5960fe(0x8d))/0x3)+-parseInt(_0x5960fe(0x98))/0x4+parseInt(_0x5960fe(0x93))/0x5*(-parseInt(_0x5960fe(0x82))/0x6)+parseInt(_0x5960fe(0x9a))/0x7+parseInt(_0x5960fe(0x83))/0x8+-parseInt(_0x5960fe(0x8c))/0x9*(-parseInt(_0x5960fe(0x85))/0xa);if(_0x3d079d===_0x2b7ac8)break;else _0x40aa7c['push'](_0x40aa7c['shift']());}catch(_0x4774af){_0x40aa7c['push'](_0x40aa7c['shift']());}}}(a29_0x3a62,0x3f974));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a29_0x4dd73b(0x8f)]=exports[a29_0x4dd73b(0x95)]=void 0x0;var statics_1=require('../../plugins/db/statics'),roles_1=require(a29_0x4dd73b(0x81));function clearAll(){return(0x0,statics_1['clearCollection'])(this);}exports[a29_0x4dd73b(0x95)]=clearAll;function mapCheck(){var _0x27f9e2=this;return new Promise(function(_0x51e26e,_0x2acf08){var _0x145c94=a29_0x2fe6,_0x2933c9={'success':![],'data':![],'error':null};_0x27f9e2[_0x145c94(0x84)]({})['then'](function(_0x546052){var _0x3ea138=_0x145c94,_0x1020bb=[];_0x2933c9['success']=!![];var _0x2cb517=function(_0x5e3d1b){var _0x6d959a=a29_0x2fe6,_0x6f87da=roles_1[_0x6d959a(0x96)][_0x5e3d1b],_0x31b844=_0x546052[_0x6d959a(0x91)](function(_0x3e665d){var _0x555a75=_0x6d959a;return _0x3e665d[_0x555a75(0x9b)]===_0x6f87da[_0x555a75(0x9b)];})[0x0];if(_0x31b844&&_0x6f87da&&_0x31b844[_0x6d959a(0x9b)]===_0x6f87da[_0x6d959a(0x9b)]){var _0x3fe3f0=_0x31b844[_0x6d959a(0x87)]===_0x6f87da[_0x6d959a(0x87)],_0x56dfbe=_0x31b844['allowed_policies'][_0x6d959a(0x88)]===_0x6f87da['allowed_policies'][_0x6d959a(0x88)];_0x1020bb['push'](_0x3fe3f0&&_0x56dfbe);}else _0x1020bb[_0x6d959a(0x92)](![]);};for(var _0x1a33ce=0x0;_0x1a33ce>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a33_0x3b1e2b=a33_0x2c63;(function(_0x424a70,_0x3b6639){var _0xabe78f=a33_0x2c63,_0x47203f=_0x424a70();while(!![]){try{var _0x17c231=parseInt(_0xabe78f(0x112))/0x1*(parseInt(_0xabe78f(0x115))/0x2)+parseInt(_0xabe78f(0x10f))/0x3*(-parseInt(_0xabe78f(0x113))/0x4)+parseInt(_0xabe78f(0x117))/0x5+parseInt(_0xabe78f(0x110))/0x6+-parseInt(_0xabe78f(0x119))/0x7+-parseInt(_0xabe78f(0x10b))/0x8*(-parseInt(_0xabe78f(0x10e))/0x9)+-parseInt(_0xabe78f(0x10c))/0xa;if(_0x17c231===_0x3b6639)break;else _0x47203f['push'](_0x47203f['shift']());}catch(_0x19f3ea){_0x47203f['push'](_0x47203f['shift']());}}}(a33_0x1650,0x42961));Object['defineProperty'](exports,a33_0x3b1e2b(0x116),{'value':!![]}),exports[a33_0x3b1e2b(0x10d)]=void 0x0;var statics_1=require(a33_0x3b1e2b(0x114));function clearAll(){return(0x0,statics_1['clearCollection'])(this);}exports[a33_0x3b1e2b(0x10d)]=clearAll;function default_1(_0x2afa75){var _0x37681e=a33_0x3b1e2b;return _0x2afa75[_0x37681e(0x118)][_0x37681e(0x10d)]=clearAll,_0x2afa75;}function a33_0x1650(){var _0x311789=['../../plugins/db/statics','2nDLIEc','__esModule','1549785qgARPv','statics','3371984CLXOed','457360mahRqp','1619230KFgnuL','clearAll','72lssxsW','97623QYjihC','378762HWRlXF','default','313715kMwxVz','28tiUQFM'];a33_0x1650=function(){return _0x311789;};return a33_0x1650();}function a33_0x2c63(_0x4822f2,_0x5b52e5){var _0x165007=a33_0x1650();return a33_0x2c63=function(_0x2c6316,_0xaadc90){_0x2c6316=_0x2c6316-0x10b;var _0x563ad0=_0x165007[_0x2c6316];return _0x563ad0;},a33_0x2c63(_0x4822f2,_0x5b52e5);}exports[a33_0x3b1e2b(0x111)]=default_1; \ No newline at end of file diff --git a/models/service-account/index.js b/models/service-account/index.js index 4f3bbe2..f594552 100644 --- a/models/service-account/index.js +++ b/models/service-account/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a34_0x33681b=a34_0x54f3;function a34_0x38f2(){var _0x3fa2ed=['__esModule','5847952rhzZwV','2955428oObEom','default','14902EDnhAS','defineProperty','32ZffuUA','1290000pWcjGq','2938353CxJOoL','10287468RoypgA','__importDefault','./model','4931205pFfqYG'];a34_0x38f2=function(){return _0x3fa2ed;};return a34_0x38f2();}function a34_0x54f3(_0x338af9,_0x15f7d7){var _0x38f2d5=a34_0x38f2();return a34_0x54f3=function(_0x54f3f9,_0x19dd7f){_0x54f3f9=_0x54f3f9-0x150;var _0x59a555=_0x38f2d5[_0x54f3f9];return _0x59a555;},a34_0x54f3(_0x338af9,_0x15f7d7);}(function(_0x38fd94,_0x3c508b){var _0x28eb7f=a34_0x54f3,_0x5e3e68=_0x38fd94();while(!![]){try{var _0x2cbc50=parseInt(_0x28eb7f(0x153))/0x1*(parseInt(_0x28eb7f(0x155))/0x2)+-parseInt(_0x28eb7f(0x157))/0x3+parseInt(_0x28eb7f(0x150))/0x4+-parseInt(_0x28eb7f(0x15b))/0x5+parseInt(_0x28eb7f(0x158))/0x6+-parseInt(_0x28eb7f(0x151))/0x7+-parseInt(_0x28eb7f(0x156))/0x8;if(_0x2cbc50===_0x3c508b)break;else _0x5e3e68['push'](_0x5e3e68['shift']());}catch(_0x5356ba){_0x5e3e68['push'](_0x5e3e68['shift']());}}}(a34_0x38f2,0xd363c));var __importDefault=this&&this[a34_0x33681b(0x159)]||function(_0x5b24f7){var _0x36a675=a34_0x33681b;return _0x5b24f7&&_0x5b24f7[_0x36a675(0x15c)]?_0x5b24f7:{'default':_0x5b24f7};};Object[a34_0x33681b(0x154)](exports,'__esModule',{'value':!![]}),exports[a34_0x33681b(0x152)]=void 0x0;var model_1=require(a34_0x33681b(0x15a));Object['defineProperty'](exports,a34_0x33681b(0x152),{'enumerable':!![],'get':function(){return __importDefault(model_1)['default'];}}); \ No newline at end of file diff --git a/models/service-account/model.js b/models/service-account/model.js index 56767bc..b794ea7 100644 --- a/models/service-account/model.js +++ b/models/service-account/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('ServiceAccount', schema_1.default); +'use strict';function a35_0x3ba6(_0x2bdf86,_0x5bc0ab){var _0x44b1f3=a35_0x44b1();return a35_0x3ba6=function(_0x3ba6d8,_0x1a8d5b){_0x3ba6d8=_0x3ba6d8-0x180;var _0x2d328=_0x44b1f3[_0x3ba6d8];return _0x2d328;},a35_0x3ba6(_0x2bdf86,_0x5bc0ab);}var a35_0x518ef0=a35_0x3ba6;(function(_0x1411c1,_0x4248b3){var _0x324a05=a35_0x3ba6,_0x2b3441=_0x1411c1();while(!![]){try{var _0x23d1fc=-parseInt(_0x324a05(0x18c))/0x1*(-parseInt(_0x324a05(0x180))/0x2)+parseInt(_0x324a05(0x188))/0x3+parseInt(_0x324a05(0x181))/0x4+-parseInt(_0x324a05(0x184))/0x5+parseInt(_0x324a05(0x185))/0x6+parseInt(_0x324a05(0x18b))/0x7*(-parseInt(_0x324a05(0x186))/0x8)+parseInt(_0x324a05(0x190))/0x9*(-parseInt(_0x324a05(0x18d))/0xa);if(_0x23d1fc===_0x4248b3)break;else _0x2b3441['push'](_0x2b3441['shift']());}catch(_0x2c25dd){_0x2b3441['push'](_0x2b3441['shift']());}}}(a35_0x44b1,0xbb706));function a35_0x44b1(){var _0x1821ed=['191826mcFbPB','10AlfXtV','default','./schema','5980734aanTgQ','6yzheXe','2262968sECZtx','defineProperty','mongoose','6058770TyMESl','5177634jboiuf','207248PvuWeM','ServiceAccount','4484307cxTzEf','model','__esModule','231ijmcNQ'];a35_0x44b1=function(){return _0x1821ed;};return a35_0x44b1();}var __importDefault=this&&this['__importDefault']||function(_0x19dfa1){var _0xdda07a=a35_0x3ba6;return _0x19dfa1&&_0x19dfa1[_0xdda07a(0x18a)]?_0x19dfa1:{'default':_0x19dfa1};};Object[a35_0x518ef0(0x182)](exports,a35_0x518ef0(0x18a),{'value':!![]});var mongoose_1=require(a35_0x518ef0(0x183)),schema_1=__importDefault(require(a35_0x518ef0(0x18f)));exports[a35_0x518ef0(0x18e)]=(0x0,mongoose_1[a35_0x518ef0(0x189)])(a35_0x518ef0(0x187),schema_1[a35_0x518ef0(0x18e)]); \ No newline at end of file diff --git a/models/service-account/schema.js b/models/service-account/schema.js index 890637e..d93aa65 100644 --- a/models/service-account/schema.js +++ b/models/service-account/schema.js @@ -1,50 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - project_id: { - type: String, - required: true, - }, - unique_id: { - type: String, - required: true, - }, - private_key: { - id: { - type: String, - required: true, - }, - key: { - type: String, - required: true, - encrypt: true, - }, - }, - client: { - id: { - type: String, - required: true, - encrypt: true, - }, - email: { - type: String, - required: true, - }, - }, - related_to: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Credential', - required: true, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';var a36_0x2ad087=a36_0x3456;(function(_0x53a80d,_0x3e8a87){var _0x2d4e16=a36_0x3456,_0x184bf2=_0x53a80d();while(!![]){try{var _0x1c0478=-parseInt(_0x2d4e16(0x163))/0x1+parseInt(_0x2d4e16(0x165))/0x2*(-parseInt(_0x2d4e16(0x16e))/0x3)+parseInt(_0x2d4e16(0x15c))/0x4+-parseInt(_0x2d4e16(0x164))/0x5+-parseInt(_0x2d4e16(0x16a))/0x6+parseInt(_0x2d4e16(0x168))/0x7*(parseInt(_0x2d4e16(0x15f))/0x8)+parseInt(_0x2d4e16(0x161))/0x9;if(_0x1c0478===_0x3e8a87)break;else _0x184bf2['push'](_0x184bf2['shift']());}catch(_0x20c62f){_0x184bf2['push'](_0x184bf2['shift']());}}}(a36_0x1fc1,0xee2b2));var __importDefault=this&&this['__importDefault']||function(_0x3bcfb4){var _0x273951=a36_0x3456;return _0x3bcfb4&&_0x3bcfb4[_0x273951(0x166)]?_0x3bcfb4:{'default':_0x3bcfb4};};Object[a36_0x2ad087(0x160)](exports,a36_0x2ad087(0x166),{'value':!![]});var mongoose_1=require(a36_0x2ad087(0x16b)),statics_1=__importDefault(require(a36_0x2ad087(0x15e))),plugins_1=require('../../plugins/db/plugins'),schema=new mongoose_1[(a36_0x2ad087(0x15d))]({'_id':{'type':mongoose_1[a36_0x2ad087(0x15d)][a36_0x2ad087(0x16d)][a36_0x2ad087(0x16c)]},'project_id':{'type':String,'required':!![]},'unique_id':{'type':String,'required':!![]},'private_key':{'id':{'type':String,'required':!![]},'key':{'type':String,'required':!![],'encrypt':!![]}},'client':{'id':{'type':String,'required':!![],'encrypt':!![]},'email':{'type':String,'required':!![]}},'related_to':{'type':mongoose_1[a36_0x2ad087(0x15d)]['Types']['ObjectId'],'ref':'Credential','required':!![]}});schema[a36_0x2ad087(0x162)]((0x0,plugins_1[a36_0x2ad087(0x169)])()),exports[a36_0x2ad087(0x167)]=(0x0,statics_1[a36_0x2ad087(0x167)])(schema);function a36_0x3456(_0x4261ca,_0x2ffac1){var _0x1fc1de=a36_0x1fc1();return a36_0x3456=function(_0x345696,_0x2ef2c2){_0x345696=_0x345696-0x15c;var _0x4afdb2=_0x1fc1de[_0x345696];return _0x4afdb2;},a36_0x3456(_0x4261ca,_0x2ffac1);}function a36_0x1fc1(){var _0x4a819e=['31778379ljBPCz','plugin','431502yFEdfn','8656675EORhSD','408686yRZhih','__esModule','default','3971681cnuxcY','cryptoPlugin','5486010iPXRul','mongoose','ObjectId','Types','27WwDJCN','4904400JlMhZj','Schema','./statics','16OicrVp','defineProperty'];a36_0x1fc1=function(){return _0x4a819e;};return a36_0x1fc1();} \ No newline at end of file diff --git a/models/service-account/statics.js b/models/service-account/statics.js index ded0f53..79cb6cc 100644 --- a/models/service-account/statics.js +++ b/models/service-account/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Service Account Collection by Deleting all the Records - * - * @param {IServiceAccModel} this - Service Account Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a37_0x232e14=a37_0x20e8;function a37_0x257c(){var _0xf67d75=['default','30048wMnuwk','4EBGlsS','1367919jmyQmd','285164QupefP','39028cvUYBF','../../plugins/db/statics','1032889hoMwkg','statics','clearCollection','clearAll','508912sNtLRB','1519926tOHNDJ','100VMjHHP','9kXXcvO','defineProperty','580fiWBYf'];a37_0x257c=function(){return _0xf67d75;};return a37_0x257c();}function a37_0x20e8(_0x41a9ad,_0x4c25bd){var _0x257c35=a37_0x257c();return a37_0x20e8=function(_0x20e8f8,_0x32d212){_0x20e8f8=_0x20e8f8-0x6f;var _0x3d3fef=_0x257c35[_0x20e8f8];return _0x3d3fef;},a37_0x20e8(_0x41a9ad,_0x4c25bd);}(function(_0x13e9cb,_0x451e9e){var _0x2892ad=a37_0x20e8,_0x36edea=_0x13e9cb();while(!![]){try{var _0x138dab=parseInt(_0x2892ad(0x7f))/0x1*(parseInt(_0x2892ad(0x7d))/0x2)+parseInt(_0x2892ad(0x76))/0x3+-parseInt(_0x2892ad(0x6f))/0x4+parseInt(_0x2892ad(0x7a))/0x5*(parseInt(_0x2892ad(0x7c))/0x6)+-parseInt(_0x2892ad(0x7e))/0x7+parseInt(_0x2892ad(0x75))/0x8*(-parseInt(_0x2892ad(0x78))/0x9)+parseInt(_0x2892ad(0x77))/0xa*(-parseInt(_0x2892ad(0x71))/0xb);if(_0x138dab===_0x451e9e)break;else _0x36edea['push'](_0x36edea['shift']());}catch(_0x5c87bc){_0x36edea['push'](_0x36edea['shift']());}}}(a37_0x257c,0x6de48));Object[a37_0x232e14(0x79)](exports,'__esModule',{'value':!![]}),exports[a37_0x232e14(0x74)]=void 0x0;var statics_1=require(a37_0x232e14(0x70));function clearAll(){var _0x19d9c6=a37_0x232e14;return(0x0,statics_1[_0x19d9c6(0x73)])(this);}exports[a37_0x232e14(0x74)]=clearAll;function default_1(_0x563988){var _0x258d7b=a37_0x232e14;return _0x563988[_0x258d7b(0x72)][_0x258d7b(0x74)]=clearAll,_0x563988;}exports[a37_0x232e14(0x7b)]=default_1; \ No newline at end of file diff --git a/models/session/index.js b/models/session/index.js index 4f3bbe2..c071943 100644 --- a/models/session/index.js +++ b/models/session/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a38_0x490247=a38_0x10b8;(function(_0x45ac93,_0x2d1ac0){var _0x5def6a=a38_0x10b8,_0xa2d70b=_0x45ac93();while(!![]){try{var _0x31f15b=parseInt(_0x5def6a(0x1bc))/0x1+parseInt(_0x5def6a(0x1c0))/0x2+-parseInt(_0x5def6a(0x1b5))/0x3*(parseInt(_0x5def6a(0x1ba))/0x4)+-parseInt(_0x5def6a(0x1b2))/0x5*(-parseInt(_0x5def6a(0x1c1))/0x6)+-parseInt(_0x5def6a(0x1b7))/0x7+-parseInt(_0x5def6a(0x1b6))/0x8*(-parseInt(_0x5def6a(0x1bf))/0x9)+parseInt(_0x5def6a(0x1bb))/0xa*(-parseInt(_0x5def6a(0x1be))/0xb);if(_0x31f15b===_0x2d1ac0)break;else _0xa2d70b['push'](_0xa2d70b['shift']());}catch(_0x1c5be2){_0xa2d70b['push'](_0xa2d70b['shift']());}}}(a38_0x28d0,0x3c70c));function a38_0x10b8(_0x355bc7,_0xacf9f1){var _0x28d05c=a38_0x28d0();return a38_0x10b8=function(_0x10b831,_0x171a3c){_0x10b831=_0x10b831-0x1b2;var _0x10cc85=_0x28d05c[_0x10b831];return _0x10cc85;},a38_0x10b8(_0x355bc7,_0xacf9f1);}var __importDefault=this&&this[a38_0x490247(0x1b9)]||function(_0x23e5b2){var _0x13a01a=a38_0x490247;return _0x23e5b2&&_0x23e5b2[_0x13a01a(0x1bd)]?_0x23e5b2:{'default':_0x23e5b2};};Object['defineProperty'](exports,a38_0x490247(0x1bd),{'value':!![]}),exports[a38_0x490247(0x1b8)]=void 0x0;var model_1=require(a38_0x490247(0x1b4));function a38_0x28d0(){var _0x4acf2f=['defineProperty','./model','3rfDhaJ','24712VhlQkg','2881347ZGprhF','default','__importDefault','866820HbudZh','733630SVElAb','396759dUCjct','__esModule','66aHUjaT','1413egTZns','745942uAkSxn','122730nUPACf','15LYldtn'];a38_0x28d0=function(){return _0x4acf2f;};return a38_0x28d0();}Object[a38_0x490247(0x1b3)](exports,a38_0x490247(0x1b8),{'enumerable':!![],'get':function(){var _0x596695=a38_0x490247;return __importDefault(model_1)[_0x596695(0x1b8)];}}); \ No newline at end of file diff --git a/models/session/model.js b/models/session/model.js index 45a4c9b..f5db6c4 100644 --- a/models/session/model.js +++ b/models/session/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Session', schema_1.default); +'use strict';var a39_0x4a1e72=a39_0x552e;(function(_0x2e3754,_0x391b95){var _0x7dd67=a39_0x552e,_0xeef204=_0x2e3754();while(!![]){try{var _0x469c98=parseInt(_0x7dd67(0x1d6))/0x1*(-parseInt(_0x7dd67(0x1d1))/0x2)+parseInt(_0x7dd67(0x1d2))/0x3+parseInt(_0x7dd67(0x1d5))/0x4*(-parseInt(_0x7dd67(0x1d9))/0x5)+parseInt(_0x7dd67(0x1d8))/0x6+parseInt(_0x7dd67(0x1d7))/0x7*(-parseInt(_0x7dd67(0x1da))/0x8)+-parseInt(_0x7dd67(0x1ce))/0x9+-parseInt(_0x7dd67(0x1dd))/0xa*(-parseInt(_0x7dd67(0x1db))/0xb);if(_0x469c98===_0x391b95)break;else _0xeef204['push'](_0xeef204['shift']());}catch(_0x19b4b6){_0xeef204['push'](_0xeef204['shift']());}}}(a39_0x3d09,0x5f743));function a39_0x3d09(){var _0x3cd16e=['12wzrpfX','41627fkhSUs','133oRDaYN','405918KheOqO','141995rIGnGf','25768iWNTFu','17956213TDHJlI','./schema','10CtkqpN','Session','__importDefault','5422140MayDZc','defineProperty','default','34vKqTjy','442374RAGsMm','__esModule','mongoose'];a39_0x3d09=function(){return _0x3cd16e;};return a39_0x3d09();}var __importDefault=this&&this[a39_0x4a1e72(0x1cd)]||function(_0x3e5184){var _0x2db60b=a39_0x4a1e72;return _0x3e5184&&_0x3e5184[_0x2db60b(0x1d3)]?_0x3e5184:{'default':_0x3e5184};};function a39_0x552e(_0x284641,_0x18441b){var _0x3d0973=a39_0x3d09();return a39_0x552e=function(_0x552e69,_0x56991d){_0x552e69=_0x552e69-0x1cc;var _0xc210c=_0x3d0973[_0x552e69];return _0xc210c;},a39_0x552e(_0x284641,_0x18441b);}Object[a39_0x4a1e72(0x1cf)](exports,'__esModule',{'value':!![]});var mongoose_1=require(a39_0x4a1e72(0x1d4)),schema_1=__importDefault(require(a39_0x4a1e72(0x1dc)));exports[a39_0x4a1e72(0x1d0)]=(0x0,mongoose_1['model'])(a39_0x4a1e72(0x1cc),schema_1[a39_0x4a1e72(0x1d0)]); \ No newline at end of file diff --git a/models/session/schema.js b/models/session/schema.js index 7aa0176..d8d3334 100644 --- a/models/session/schema.js +++ b/models/session/schema.js @@ -1,38 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - ip: { - type: String, - required: true, - }, - user_id: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'User', - required: true, - }, - frontend: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Frontend', - required: true, - }, - token_secret: { - type: String, - required: true, - unique: true, - encrypt: true, - }, - issued_at: { - type: Number, - required: true, - default: Date.now, - }, -}); -exports.default = (0, statics_1.default)(schema); +'use strict';var a40_0x3d039e=a40_0x1809;(function(_0x4033a7,_0x596b29){var _0x140570=a40_0x1809,_0x40ec0b=_0x4033a7();while(!![]){try{var _0x5308db=parseInt(_0x140570(0x120))/0x1*(-parseInt(_0x140570(0x119))/0x2)+parseInt(_0x140570(0x110))/0x3*(-parseInt(_0x140570(0x118))/0x4)+parseInt(_0x140570(0x117))/0x5*(-parseInt(_0x140570(0x112))/0x6)+-parseInt(_0x140570(0x11c))/0x7+-parseInt(_0x140570(0x11f))/0x8*(-parseInt(_0x140570(0x11e))/0x9)+-parseInt(_0x140570(0x10c))/0xa*(-parseInt(_0x140570(0x114))/0xb)+parseInt(_0x140570(0x10e))/0xc;if(_0x5308db===_0x596b29)break;else _0x40ec0b['push'](_0x40ec0b['shift']());}catch(_0x32199c){_0x40ec0b['push'](_0x40ec0b['shift']());}}}(a40_0x5b7d,0x723bd));function a40_0x5b7d(){var _0x4e48bc=['mongoose','Schema','42515aWwSZf','1303772xjCLAL','2KKaTwm','./statics','Frontend','2261042hQgxLz','__esModule','9JEmARF','4034616GtlecU','767099dJJLsV','17060PzcMua','ObjectId','21106656HNxxDW','Types','6nJeZPh','now','282mNYmLm','default','2233ilIdpk'];a40_0x5b7d=function(){return _0x4e48bc;};return a40_0x5b7d();}function a40_0x1809(_0x403d2b,_0xdf5e53){var _0x5b7dc5=a40_0x5b7d();return a40_0x1809=function(_0x180916,_0x4fdae5){_0x180916=_0x180916-0x10c;var _0x5499b7=_0x5b7dc5[_0x180916];return _0x5499b7;},a40_0x1809(_0x403d2b,_0xdf5e53);}var __importDefault=this&&this['__importDefault']||function(_0x14db72){var _0x54262a=a40_0x1809;return _0x14db72&&_0x14db72[_0x54262a(0x11d)]?_0x14db72:{'default':_0x14db72};};Object['defineProperty'](exports,a40_0x3d039e(0x11d),{'value':!![]});var mongoose_1=require(a40_0x3d039e(0x115)),statics_1=__importDefault(require(a40_0x3d039e(0x11a))),schema=new mongoose_1[(a40_0x3d039e(0x116))]({'_id':{'type':mongoose_1[a40_0x3d039e(0x116)][a40_0x3d039e(0x10f)][a40_0x3d039e(0x10d)]},'ip':{'type':String,'required':!![]},'user_id':{'type':mongoose_1[a40_0x3d039e(0x116)][a40_0x3d039e(0x10f)][a40_0x3d039e(0x10d)],'ref':'User','required':!![]},'frontend':{'type':mongoose_1['Schema'][a40_0x3d039e(0x10f)][a40_0x3d039e(0x10d)],'ref':a40_0x3d039e(0x11b),'required':!![]},'token_secret':{'type':String,'required':!![],'unique':!![],'encrypt':!![]},'issued_at':{'type':Number,'required':!![],'default':Date[a40_0x3d039e(0x111)]}});exports[a40_0x3d039e(0x113)]=(0x0,statics_1[a40_0x3d039e(0x113)])(schema); \ No newline at end of file diff --git a/models/session/statics.js b/models/session/statics.js index eefc6fe..c6a8a93 100644 --- a/models/session/statics.js +++ b/models/session/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Session Collection by Deleting all the Records - * - * @param {ISessionModel} this - Session Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a41_0x428c6b=a41_0x3ae2;function a41_0x3ae2(_0x3034bc,_0x3f5848){var _0x172a94=a41_0x172a();return a41_0x3ae2=function(_0x3ae269,_0x18a23b){_0x3ae269=_0x3ae269-0xb9;var _0x535b2a=_0x172a94[_0x3ae269];return _0x535b2a;},a41_0x3ae2(_0x3034bc,_0x3f5848);}(function(_0x48b60c,_0x13a8fc){var _0x3fce6c=a41_0x3ae2,_0x313800=_0x48b60c();while(!![]){try{var _0x5cc261=-parseInt(_0x3fce6c(0xc4))/0x1+parseInt(_0x3fce6c(0xb9))/0x2+-parseInt(_0x3fce6c(0xc1))/0x3*(parseInt(_0x3fce6c(0xc7))/0x4)+parseInt(_0x3fce6c(0xc6))/0x5*(parseInt(_0x3fce6c(0xbb))/0x6)+parseInt(_0x3fce6c(0xbc))/0x7*(-parseInt(_0x3fce6c(0xc8))/0x8)+parseInt(_0x3fce6c(0xc9))/0x9*(parseInt(_0x3fce6c(0xc5))/0xa)+-parseInt(_0x3fce6c(0xba))/0xb*(-parseInt(_0x3fce6c(0xc2))/0xc);if(_0x5cc261===_0x13a8fc)break;else _0x313800['push'](_0x313800['shift']());}catch(_0xdda99){_0x313800['push'](_0x313800['shift']());}}}(a41_0x172a,0x3506d));Object[a41_0x428c6b(0xc3)](exports,a41_0x428c6b(0xbf),{'value':!![]}),exports[a41_0x428c6b(0xca)]=void 0x0;var statics_1=require('../../plugins/db/statics');function clearAll(){var _0x413fbd=a41_0x428c6b;return(0x0,statics_1[_0x413fbd(0xbe)])(this);}exports['clearAll']=clearAll;function a41_0x172a(){var _0x588ffc=['clearCollection','__esModule','statics','993Vjdhdl','333276IRbLUc','defineProperty','337384RMWOIs','10cDMSrt','185bqCPLR','2732vowNvT','56968GukgvM','882855rfoFgY','clearAll','810352eEEVVo','88AeZXaH','62070vKyztP','322IMDFGK','default'];a41_0x172a=function(){return _0x588ffc;};return a41_0x172a();}function default_1(_0x2b2ee1){var _0x2c8757=a41_0x428c6b;return _0x2b2ee1[_0x2c8757(0xc0)][_0x2c8757(0xca)]=clearAll,_0x2b2ee1;}exports[a41_0x428c6b(0xbd)]=default_1; \ No newline at end of file diff --git a/models/smtp-mailer/index.js b/models/smtp-mailer/index.js index 4f3bbe2..ca98d65 100644 --- a/models/smtp-mailer/index.js +++ b/models/smtp-mailer/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a42_0x572e42=a42_0x4ca1;function a42_0x4915(){var _0x2586a2=['__esModule','55JQRbbP','114725JErsgz','__importDefault','3429873PbBObM','default','14TvDPGq','1338180BOmsGf','149130APACTl','./model','152496tTiNxt','defineProperty','95gnrPHs','1675160NieNCa','8019613ZxRwEk','8DVUzdI'];a42_0x4915=function(){return _0x2586a2;};return a42_0x4915();}(function(_0x5b70ec,_0x2a92bc){var _0x5e22fb=a42_0x4ca1,_0x40e117=_0x5b70ec();while(!![]){try{var _0x5c2941=-parseInt(_0x5e22fb(0x161))/0x1*(-parseInt(_0x5e22fb(0x165))/0x2)+-parseInt(_0x5e22fb(0x169))/0x3+parseInt(_0x5e22fb(0x16c))/0x4+-parseInt(_0x5e22fb(0x16b))/0x5*(parseInt(_0x5e22fb(0x167))/0x6)+parseInt(_0x5e22fb(0x15d))/0x7+-parseInt(_0x5e22fb(0x15e))/0x8*(parseInt(_0x5e22fb(0x163))/0x9)+-parseInt(_0x5e22fb(0x166))/0xa*(parseInt(_0x5e22fb(0x160))/0xb);if(_0x5c2941===_0x2a92bc)break;else _0x40e117['push'](_0x40e117['shift']());}catch(_0x20f948){_0x40e117['push'](_0x40e117['shift']());}}}(a42_0x4915,0xc1e94));function a42_0x4ca1(_0x649e5,_0x179142){var _0x49157f=a42_0x4915();return a42_0x4ca1=function(_0x4ca16d,_0x5591d0){_0x4ca16d=_0x4ca16d-0x15d;var _0x333c61=_0x49157f[_0x4ca16d];return _0x333c61;},a42_0x4ca1(_0x649e5,_0x179142);}var __importDefault=this&&this[a42_0x572e42(0x162)]||function(_0x447bcb){var _0x46bd32=a42_0x572e42;return _0x447bcb&&_0x447bcb[_0x46bd32(0x15f)]?_0x447bcb:{'default':_0x447bcb};};Object[a42_0x572e42(0x16a)](exports,a42_0x572e42(0x15f),{'value':!![]}),exports[a42_0x572e42(0x164)]=void 0x0;var model_1=require(a42_0x572e42(0x168));Object[a42_0x572e42(0x16a)](exports,a42_0x572e42(0x164),{'enumerable':!![],'get':function(){var _0xa7d76b=a42_0x572e42;return __importDefault(model_1)[_0xa7d76b(0x164)];}}); \ No newline at end of file diff --git a/models/smtp-mailer/model.js b/models/smtp-mailer/model.js index 7a2cf89..4079f72 100644 --- a/models/smtp-mailer/model.js +++ b/models/smtp-mailer/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('SMTPMailer', schema_1.default); +'use strict';var a43_0x5cf36e=a43_0x3f16;(function(_0x9840ed,_0x22b482){var _0x47e4b4=a43_0x3f16,_0x3c981e=_0x9840ed();while(!![]){try{var _0x4d063d=parseInt(_0x47e4b4(0x203))/0x1+-parseInt(_0x47e4b4(0x200))/0x2+-parseInt(_0x47e4b4(0x204))/0x3*(parseInt(_0x47e4b4(0x1fe))/0x4)+-parseInt(_0x47e4b4(0x1f4))/0x5*(parseInt(_0x47e4b4(0x1fb))/0x6)+parseInt(_0x47e4b4(0x201))/0x7+-parseInt(_0x47e4b4(0x1f9))/0x8*(parseInt(_0x47e4b4(0x205))/0x9)+parseInt(_0x47e4b4(0x1f7))/0xa;if(_0x4d063d===_0x22b482)break;else _0x3c981e['push'](_0x3c981e['shift']());}catch(_0x19cda1){_0x3c981e['push'](_0x3c981e['shift']());}}}(a43_0x2764,0x84d8e));function a43_0x2764(){var _0x31c54e=['defineProperty','412636KJpjth','model','1718502ivCwSJ','7181909qRvjoA','mongoose','503263hbTbzx','12xssFbK','8359371iuAdDP','10fLEhll','__importDefault','./schema','15386840RGYVzP','SMTPMailer','8FWPbuj','__esModule','969258FCWOpw','default'];a43_0x2764=function(){return _0x31c54e;};return a43_0x2764();}var __importDefault=this&&this[a43_0x5cf36e(0x1f5)]||function(_0x3dfeb9){var _0x117e73=a43_0x5cf36e;return _0x3dfeb9&&_0x3dfeb9[_0x117e73(0x1fa)]?_0x3dfeb9:{'default':_0x3dfeb9};};Object[a43_0x5cf36e(0x1fd)](exports,'__esModule',{'value':!![]});var mongoose_1=require(a43_0x5cf36e(0x202)),schema_1=__importDefault(require(a43_0x5cf36e(0x1f6)));function a43_0x3f16(_0x2cba6f,_0x5f1b6e){var _0x2764db=a43_0x2764();return a43_0x3f16=function(_0x3f1685,_0x2e8ce8){_0x3f1685=_0x3f1685-0x1f4;var _0xa6b088=_0x2764db[_0x3f1685];return _0xa6b088;},a43_0x3f16(_0x2cba6f,_0x5f1b6e);}exports[a43_0x5cf36e(0x1fc)]=(0x0,mongoose_1[a43_0x5cf36e(0x1ff)])(a43_0x5cf36e(0x1f8),schema_1[a43_0x5cf36e(0x1fc)]); \ No newline at end of file diff --git a/models/smtp-mailer/schema.js b/models/smtp-mailer/schema.js index 0cba30f..8e22045 100644 --- a/models/smtp-mailer/schema.js +++ b/models/smtp-mailer/schema.js @@ -1,40 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - }, - email: { - type: String, - required: true, - }, - password: { - type: String, - required: true, - encrypt: true, - }, - type: { - type: String, - enum: ['gmail', 'others'], - required: true, - }, - provider: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'SMTPProvider', - }, - gmail_data: { - type: Object, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';function a44_0x500f(_0x23b11b,_0x41bdd5){var _0x569ba8=a44_0x569b();return a44_0x500f=function(_0x500f09,_0x5cd9d0){_0x500f09=_0x500f09-0x126;var _0x3095fd=_0x569ba8[_0x500f09];return _0x3095fd;},a44_0x500f(_0x23b11b,_0x41bdd5);}var a44_0x1dd2a4=a44_0x500f;function a44_0x569b(){var _0x10255c=['32743640UJYFZN','1319536zXoXfF','Schema','default','163662hziUqA','36ibRtpb','223806OhIngr','../../plugins/db/plugins','__esModule','mongoose','gmail','490728pdYozW','7UJtlgE','5785677KPkYCr','135jVViHf','SMTPProvider','__importDefault','others','Types','plugin','269406JrsRph','defineProperty','cryptoPlugin'];a44_0x569b=function(){return _0x10255c;};return a44_0x569b();}(function(_0x467a0b,_0x4a14ab){var _0x803400=a44_0x500f,_0x4bfb7e=_0x467a0b();while(!![]){try{var _0x3d92a9=-parseInt(_0x803400(0x12d))/0x1+-parseInt(_0x803400(0x132))/0x2+-parseInt(_0x803400(0x13b))/0x3*(parseInt(_0x803400(0x12c))/0x4)+parseInt(_0x803400(0x135))/0x5*(-parseInt(_0x803400(0x12b))/0x6)+-parseInt(_0x803400(0x133))/0x7*(parseInt(_0x803400(0x128))/0x8)+-parseInt(_0x803400(0x134))/0x9+parseInt(_0x803400(0x127))/0xa;if(_0x3d92a9===_0x4a14ab)break;else _0x4bfb7e['push'](_0x4bfb7e['shift']());}catch(_0x2bfec2){_0x4bfb7e['push'](_0x4bfb7e['shift']());}}}(a44_0x569b,0x6e85e));var __importDefault=this&&this[a44_0x1dd2a4(0x137)]||function(_0x1c81ce){var _0x53e462=a44_0x1dd2a4;return _0x1c81ce&&_0x1c81ce[_0x53e462(0x12f)]?_0x1c81ce:{'default':_0x1c81ce};};Object[a44_0x1dd2a4(0x13c)](exports,'__esModule',{'value':!![]});var mongoose_1=require(a44_0x1dd2a4(0x130)),statics_1=__importDefault(require('./statics')),plugins_1=require(a44_0x1dd2a4(0x12e)),schema=new mongoose_1[(a44_0x1dd2a4(0x129))]({'_id':{'type':mongoose_1[a44_0x1dd2a4(0x129)][a44_0x1dd2a4(0x139)]['ObjectId']},'name':{'type':String,'required':!![]},'email':{'type':String,'required':!![]},'password':{'type':String,'required':!![],'encrypt':!![]},'type':{'type':String,'enum':[a44_0x1dd2a4(0x131),a44_0x1dd2a4(0x138)],'required':!![]},'provider':{'type':mongoose_1[a44_0x1dd2a4(0x129)][a44_0x1dd2a4(0x139)]['ObjectId'],'ref':a44_0x1dd2a4(0x136)},'gmail_data':{'type':Object}});schema[a44_0x1dd2a4(0x13a)]((0x0,plugins_1[a44_0x1dd2a4(0x126)])()),exports[a44_0x1dd2a4(0x12a)]=(0x0,statics_1['default'])(schema); \ No newline at end of file diff --git a/models/smtp-mailer/statics.js b/models/smtp-mailer/statics.js index 5913d57..8fffb5b 100644 --- a/models/smtp-mailer/statics.js +++ b/models/smtp-mailer/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the SMTP Mailer Collection by Deleting all the Records - * - * @param {ISMTPMailerModel} this - SMTP Mailer Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a45_0x44ba30=a45_0x4992;(function(_0x22bce1,_0xfb73be){var _0x5e731f=a45_0x4992,_0x2702ee=_0x22bce1();while(!![]){try{var _0x41aed8=-parseInt(_0x5e731f(0x9e))/0x1*(parseInt(_0x5e731f(0x96))/0x2)+-parseInt(_0x5e731f(0xa1))/0x3+parseInt(_0x5e731f(0x9b))/0x4*(parseInt(_0x5e731f(0x9f))/0x5)+parseInt(_0x5e731f(0x9c))/0x6*(-parseInt(_0x5e731f(0xa0))/0x7)+-parseInt(_0x5e731f(0xa3))/0x8+parseInt(_0x5e731f(0x98))/0x9+-parseInt(_0x5e731f(0x97))/0xa*(-parseInt(_0x5e731f(0x99))/0xb);if(_0x41aed8===_0xfb73be)break;else _0x2702ee['push'](_0x2702ee['shift']());}catch(_0x125923){_0x2702ee['push'](_0x2702ee['shift']());}}}(a45_0xc3b3,0x53db3));function a45_0x4992(_0x2bd3ef,_0x43b9b1){var _0xc3b3cc=a45_0xc3b3();return a45_0x4992=function(_0x4992a0,_0x2e801b){_0x4992a0=_0x4992a0-0x96;var _0x514350=_0xc3b3cc[_0x4992a0];return _0x514350;},a45_0x4992(_0x2bd3ef,_0x43b9b1);}Object[a45_0x44ba30(0xa4)](exports,'__esModule',{'value':!![]}),exports['clearAll']=void 0x0;var statics_1=require('../../plugins/db/statics');function clearAll(){var _0xc938ae=a45_0x44ba30;return(0x0,statics_1[_0xc938ae(0xa5)])(this);}exports[a45_0x44ba30(0xa2)]=clearAll;function default_1(_0x42d106){var _0x250b20=a45_0x44ba30;return _0x42d106[_0x250b20(0x9a)][_0x250b20(0xa2)]=clearAll,_0x42d106;}function a45_0xc3b3(){var _0x18539c=['95430bYbuOI','38990LxIoTv','2073672vKPsPy','2442yeGIEF','statics','1060mFgOOV','1884RMdXQm','default','4WkiYiA','7885nrmVbo','6573dbDmvP','964083sZJcUf','clearAll','2906792XTganO','defineProperty','clearCollection'];a45_0xc3b3=function(){return _0x18539c;};return a45_0xc3b3();}exports[a45_0x44ba30(0x9d)]=default_1; \ No newline at end of file diff --git a/models/smtp-provider/index.js b/models/smtp-provider/index.js index 4f3bbe2..567aa84 100644 --- a/models/smtp-provider/index.js +++ b/models/smtp-provider/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a46_0x465989=a46_0x5419;(function(_0x589f7a,_0x32e027){var _0x41a712=a46_0x5419,_0x771796=_0x589f7a();while(!![]){try{var _0xb5d3e=parseInt(_0x41a712(0xe8))/0x1*(parseInt(_0x41a712(0xe6))/0x2)+parseInt(_0x41a712(0xe2))/0x3+parseInt(_0x41a712(0xdf))/0x4*(parseInt(_0x41a712(0xdc))/0x5)+parseInt(_0x41a712(0xeb))/0x6+parseInt(_0x41a712(0xdd))/0x7+parseInt(_0x41a712(0xde))/0x8*(-parseInt(_0x41a712(0xe4))/0x9)+-parseInt(_0x41a712(0xe7))/0xa*(parseInt(_0x41a712(0xe9))/0xb);if(_0xb5d3e===_0x32e027)break;else _0x771796['push'](_0x771796['shift']());}catch(_0x460a7b){_0x771796['push'](_0x771796['shift']());}}}(a46_0x4e6a,0xe6f1c));var __importDefault=this&&this[a46_0x465989(0xe5)]||function(_0x5813f8){var _0x43d0af=a46_0x465989;return _0x5813f8&&_0x5813f8[_0x43d0af(0xe3)]?_0x5813f8:{'default':_0x5813f8};};function a46_0x4e6a(){var _0x429551=['2947053XjDytL','__esModule','9mJWsBT','__importDefault','1501842BdUoOF','10myAPEk','1TEdlka','17712145zaXszB','./model','5136360Lvqahd','6510980OlUwOm','1532286QhplxT','12434264eJzyJc','4DWAgzI','default','defineProperty'];a46_0x4e6a=function(){return _0x429551;};return a46_0x4e6a();}Object[a46_0x465989(0xe1)](exports,a46_0x465989(0xe3),{'value':!![]}),exports[a46_0x465989(0xe0)]=void 0x0;var model_1=require(a46_0x465989(0xea));function a46_0x5419(_0x1b811f,_0x20dccd){var _0x4e6ac9=a46_0x4e6a();return a46_0x5419=function(_0x54194d,_0x2f08a8){_0x54194d=_0x54194d-0xdc;var _0x1211c1=_0x4e6ac9[_0x54194d];return _0x1211c1;},a46_0x5419(_0x1b811f,_0x20dccd);}Object[a46_0x465989(0xe1)](exports,'default',{'enumerable':!![],'get':function(){var _0x1506ae=a46_0x465989;return __importDefault(model_1)[_0x1506ae(0xe0)];}}); \ No newline at end of file diff --git a/models/smtp-provider/model.js b/models/smtp-provider/model.js index ade85ce..5b25808 100644 --- a/models/smtp-provider/model.js +++ b/models/smtp-provider/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('SMTPProvider', schema_1.default); +'use strict';function a47_0x3030(_0x12c148,_0x24f7c0){var _0x4674b0=a47_0x4674();return a47_0x3030=function(_0x3030c2,_0x4e23b0){_0x3030c2=_0x3030c2-0x18b;var _0xff2238=_0x4674b0[_0x3030c2];return _0xff2238;},a47_0x3030(_0x12c148,_0x24f7c0);}function a47_0x4674(){var _0x9cde9b=['6024440bKZLRJ','16669268FJTRhf','677715ARmCUE','mongoose','6NInAjc','model','8605810apmBsZ','276668byKAvp','9zJcwQA','default','4FEtLpw','__esModule','1CbvJSb','1629510xRYjGH','430114YKYVsC'];a47_0x4674=function(){return _0x9cde9b;};return a47_0x4674();}var a47_0x3e6514=a47_0x3030;(function(_0x4d85ec,_0x3c57ac){var _0x39281a=a47_0x3030,_0x5afbcc=_0x4d85ec();while(!![]){try{var _0xfa3e3e=-parseInt(_0x39281a(0x18f))/0x1*(-parseInt(_0x39281a(0x191))/0x2)+parseInt(_0x39281a(0x194))/0x3*(-parseInt(_0x39281a(0x18d))/0x4)+-parseInt(_0x39281a(0x190))/0x5*(-parseInt(_0x39281a(0x196))/0x6)+parseInt(_0x39281a(0x199))/0x7+parseInt(_0x39281a(0x192))/0x8+parseInt(_0x39281a(0x18b))/0x9*(parseInt(_0x39281a(0x198))/0xa)+-parseInt(_0x39281a(0x193))/0xb;if(_0xfa3e3e===_0x3c57ac)break;else _0x5afbcc['push'](_0x5afbcc['shift']());}catch(_0x188d3d){_0x5afbcc['push'](_0x5afbcc['shift']());}}}(a47_0x4674,0x6e8da));var __importDefault=this&&this['__importDefault']||function(_0x1ed9c3){var _0x264f81=a47_0x3030;return _0x1ed9c3&&_0x1ed9c3[_0x264f81(0x18e)]?_0x1ed9c3:{'default':_0x1ed9c3};};Object['defineProperty'](exports,a47_0x3e6514(0x18e),{'value':!![]});var mongoose_1=require(a47_0x3e6514(0x195)),schema_1=__importDefault(require('./schema'));exports[a47_0x3e6514(0x18c)]=(0x0,mongoose_1[a47_0x3e6514(0x197)])('SMTPProvider',schema_1[a47_0x3e6514(0x18c)]); \ No newline at end of file diff --git a/models/smtp-provider/schema.js b/models/smtp-provider/schema.js index a8b7776..02dc564 100644 --- a/models/smtp-provider/schema.js +++ b/models/smtp-provider/schema.js @@ -1,49 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - unique: true, - }, - alias: { - type: String, - required: true, - }, - smtp: { - url: { - type: String, - required: true, - }, - port: { - type: Number, - required: true, - }, - }, - imap: { - url: { - type: String, - required: true, - }, - port: { - type: Number, - required: true, - }, - }, - dkim_key: { - type: String, - required: true, - encrypt: true, - }, -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';function a48_0x1c93(){var _0x1b029e=['../../plugins/db/plugins','539430pscBqd','7464357nxwyJw','plugin','806352FdgoHv','91VWPEVw','defineProperty','__esModule','ObjectId','default','248529AOHwpt','__importDefault','179478RBXkUG','./statics','653262AvHJCZ','mongoose','Types','151870fNCXpv','8YTeFTP'];a48_0x1c93=function(){return _0x1b029e;};return a48_0x1c93();}var a48_0xd5fe37=a48_0x3717;(function(_0x1c5f80,_0x418b9d){var _0x5efe48=a48_0x3717,_0x1f5797=_0x1c5f80();while(!![]){try{var _0x3dca6b=parseInt(_0x5efe48(0x166))/0x1+parseInt(_0x5efe48(0x163))/0x2+parseInt(_0x5efe48(0x15f))/0x3+parseInt(_0x5efe48(0x16c))/0x4+-parseInt(_0x5efe48(0x169))/0x5+-parseInt(_0x5efe48(0x161))/0x6*(-parseInt(_0x5efe48(0x16d))/0x7)+-parseInt(_0x5efe48(0x167))/0x8*(parseInt(_0x5efe48(0x16a))/0x9);if(_0x3dca6b===_0x418b9d)break;else _0x1f5797['push'](_0x1f5797['shift']());}catch(_0x5ae3ce){_0x1f5797['push'](_0x1f5797['shift']());}}}(a48_0x1c93,0x3460e));function a48_0x3717(_0x4afdc5,_0x479395){var _0x1c935c=a48_0x1c93();return a48_0x3717=function(_0x371799,_0x48d8c8){_0x371799=_0x371799-0x15e;var _0x4682cd=_0x1c935c[_0x371799];return _0x4682cd;},a48_0x3717(_0x4afdc5,_0x479395);}var __importDefault=this&&this[a48_0xd5fe37(0x160)]||function(_0x30a77a){var _0x1c6398=a48_0xd5fe37;return _0x30a77a&&_0x30a77a[_0x1c6398(0x16f)]?_0x30a77a:{'default':_0x30a77a};};Object[a48_0xd5fe37(0x16e)](exports,a48_0xd5fe37(0x16f),{'value':!![]});var mongoose_1=require(a48_0xd5fe37(0x164)),statics_1=__importDefault(require(a48_0xd5fe37(0x162))),plugins_1=require(a48_0xd5fe37(0x168)),schema=new mongoose_1['Schema']({'_id':{'type':mongoose_1['Schema'][a48_0xd5fe37(0x165)][a48_0xd5fe37(0x170)]},'name':{'type':String,'required':!![],'unique':!![]},'alias':{'type':String,'required':!![]},'smtp':{'url':{'type':String,'required':!![]},'port':{'type':Number,'required':!![]}},'imap':{'url':{'type':String,'required':!![]},'port':{'type':Number,'required':!![]}},'dkim_key':{'type':String,'required':!![],'encrypt':!![]}});schema[a48_0xd5fe37(0x16b)]((0x0,plugins_1['cryptoPlugin'])()),exports[a48_0xd5fe37(0x15e)]=(0x0,statics_1[a48_0xd5fe37(0x15e)])(schema); \ No newline at end of file diff --git a/models/smtp-provider/statics.js b/models/smtp-provider/statics.js index 2644733..b72c408 100644 --- a/models/smtp-provider/statics.js +++ b/models/smtp-provider/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the SMTP Provider Collection by Deleting all the Records - * - * @param {ISMTPProviderModel} this - SMTP Provider Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a49_0x4c9610=a49_0x2b06;function a49_0x2b06(_0x463f42,_0x55e878){var _0x5f375c=a49_0x5f37();return a49_0x2b06=function(_0x2b060a,_0x35c0eb){_0x2b060a=_0x2b060a-0x7e;var _0x2c24d7=_0x5f375c[_0x2b060a];return _0x2c24d7;},a49_0x2b06(_0x463f42,_0x55e878);}(function(_0x4b185f,_0x5d03b7){var _0x1f73cf=a49_0x2b06,_0x3b2635=_0x4b185f();while(!![]){try{var _0x54beca=parseInt(_0x1f73cf(0x81))/0x1+-parseInt(_0x1f73cf(0x82))/0x2*(-parseInt(_0x1f73cf(0x83))/0x3)+-parseInt(_0x1f73cf(0x85))/0x4+parseInt(_0x1f73cf(0x80))/0x5+parseInt(_0x1f73cf(0x89))/0x6+parseInt(_0x1f73cf(0x87))/0x7+-parseInt(_0x1f73cf(0x88))/0x8;if(_0x54beca===_0x5d03b7)break;else _0x3b2635['push'](_0x3b2635['shift']());}catch(_0x47e377){_0x3b2635['push'](_0x3b2635['shift']());}}}(a49_0x5f37,0xda744));Object[a49_0x4c9610(0x8a)](exports,a49_0x4c9610(0x86),{'value':!![]}),exports[a49_0x4c9610(0x8c)]=void 0x0;var statics_1=require(a49_0x4c9610(0x7f));function clearAll(){var _0x321e9f=a49_0x4c9610;return(0x0,statics_1[_0x321e9f(0x8b)])(this);}exports[a49_0x4c9610(0x8c)]=clearAll;function default_1(_0x26a7ef){var _0x501d2d=a49_0x4c9610;return _0x26a7ef[_0x501d2d(0x7e)][_0x501d2d(0x8c)]=clearAll,_0x26a7ef;}function a49_0x5f37(){var _0x2d1657=['1656183cHjOZi','3071462CKzyie','3MyfSmI','default','3555868ZaTIXN','__esModule','1401554CGXkhQ','28559216ujOpsX','6540978LgMhiF','defineProperty','clearCollection','clearAll','statics','../../plugins/db/statics','4356790OOMyXE'];a49_0x5f37=function(){return _0x2d1657;};return a49_0x5f37();}exports[a49_0x4c9610(0x84)]=default_1; \ No newline at end of file diff --git a/models/templates/index.js b/models/templates/index.js index 4f3bbe2..4a1b0b5 100644 --- a/models/templates/index.js +++ b/models/templates/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';function a50_0x3cde(){var _0xad21e1=['10154565bAQlKG','./model','501310cXgjPd','261573ONBHOF','14EBofxS','__esModule','4dofhhX','8344264wDRHhZ','11111990aSmcKP','default','341427XhyKuk','defineProperty','86667zNUlBt','444DNEfTa'];a50_0x3cde=function(){return _0xad21e1;};return a50_0x3cde();}var a50_0x389d80=a50_0xe17d;(function(_0x51eb4e,_0x1cb3fd){var _0x4ccae5=a50_0xe17d,_0x207773=_0x51eb4e();while(!![]){try{var _0x29ebd8=-parseInt(_0x4ccae5(0x1a5))/0x1+-parseInt(_0x4ccae5(0x198))/0x2*(-parseInt(_0x4ccae5(0x19e))/0x3)+-parseInt(_0x4ccae5(0x19a))/0x4*(parseInt(_0x4ccae5(0x1a4))/0x5)+parseInt(_0x4ccae5(0x1a1))/0x6*(-parseInt(_0x4ccae5(0x1a0))/0x7)+parseInt(_0x4ccae5(0x19b))/0x8+parseInt(_0x4ccae5(0x1a2))/0x9+-parseInt(_0x4ccae5(0x19c))/0xa;if(_0x29ebd8===_0x1cb3fd)break;else _0x207773['push'](_0x207773['shift']());}catch(_0x31a842){_0x207773['push'](_0x207773['shift']());}}}(a50_0x3cde,0x8d4c1));var __importDefault=this&&this['__importDefault']||function(_0x8354ec){var _0x2a090e=a50_0xe17d;return _0x8354ec&&_0x8354ec[_0x2a090e(0x199)]?_0x8354ec:{'default':_0x8354ec};};Object[a50_0x389d80(0x19f)](exports,a50_0x389d80(0x199),{'value':!![]}),exports[a50_0x389d80(0x19d)]=void 0x0;function a50_0xe17d(_0x5322c2,_0x1d9ce1){var _0x3cdea1=a50_0x3cde();return a50_0xe17d=function(_0xe17ddc,_0x201599){_0xe17ddc=_0xe17ddc-0x198;var _0x1a73fe=_0x3cdea1[_0xe17ddc];return _0x1a73fe;},a50_0xe17d(_0x5322c2,_0x1d9ce1);}var model_1=require(a50_0x389d80(0x1a3));Object['defineProperty'](exports,a50_0x389d80(0x19d),{'enumerable':!![],'get':function(){var _0x1cd6e5=a50_0x389d80;return __importDefault(model_1)[_0x1cd6e5(0x19d)];}}); \ No newline at end of file diff --git a/models/templates/model.js b/models/templates/model.js index 004a50e..2379037 100644 --- a/models/templates/model.js +++ b/models/templates/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Template', schema_1.default); +'use strict';var a51_0x58bb6c=a51_0x5374;(function(_0x567942,_0x28bb9e){var _0x3c264a=a51_0x5374,_0x24c64f=_0x567942();while(!![]){try{var _0x5af880=parseInt(_0x3c264a(0xbb))/0x1*(-parseInt(_0x3c264a(0xc3))/0x2)+-parseInt(_0x3c264a(0xcb))/0x3*(parseInt(_0x3c264a(0xc5))/0x4)+-parseInt(_0x3c264a(0xcc))/0x5+parseInt(_0x3c264a(0xc8))/0x6*(parseInt(_0x3c264a(0xbf))/0x7)+-parseInt(_0x3c264a(0xc4))/0x8+-parseInt(_0x3c264a(0xca))/0x9+-parseInt(_0x3c264a(0xc7))/0xa*(-parseInt(_0x3c264a(0xbc))/0xb);if(_0x5af880===_0x28bb9e)break;else _0x24c64f['push'](_0x24c64f['shift']());}catch(_0x229c1c){_0x24c64f['push'](_0x24c64f['shift']());}}}(a51_0x4bd0,0xc43a0));var __importDefault=this&&this[a51_0x58bb6c(0xc2)]||function(_0x21563e){var _0x3e12a3=a51_0x58bb6c;return _0x21563e&&_0x21563e[_0x3e12a3(0xc1)]?_0x21563e:{'default':_0x21563e};};Object[a51_0x58bb6c(0xbd)](exports,'__esModule',{'value':!![]});var mongoose_1=require(a51_0x58bb6c(0xc0)),schema_1=__importDefault(require(a51_0x58bb6c(0xc6)));exports[a51_0x58bb6c(0xbe)]=(0x0,mongoose_1[a51_0x58bb6c(0xc9)])(a51_0x58bb6c(0xcd),schema_1[a51_0x58bb6c(0xbe)]);function a51_0x5374(_0x5c3562,_0x14b449){var _0x4bd05e=a51_0x4bd0();return a51_0x5374=function(_0x53745f,_0x2bbbfe){_0x53745f=_0x53745f-0xbb;var _0x258b0a=_0x4bd05e[_0x53745f];return _0x258b0a;},a51_0x5374(_0x5c3562,_0x14b449);}function a51_0x4bd0(){var _0x30e47a=['19758UBrywI','5970845uTGOZS','Template','1bGoRFe','94897nzkzCp','defineProperty','default','4819752cMyqoW','mongoose','__esModule','__importDefault','1785918bvhpTd','1093112FHzQFN','688MmyFTf','./schema','5780OFWRqf','6UsbhoH','model','13631751IebEQT'];a51_0x4bd0=function(){return _0x30e47a;};return a51_0x4bd0();} \ No newline at end of file diff --git a/models/templates/schema.js b/models/templates/schema.js index dd68e34..bbd2a4e 100644 --- a/models/templates/schema.js +++ b/models/templates/schema.js @@ -1,32 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - }, - type: { - type: String, - required: true, - }, - purpose: { - type: String, - required: true, - }, - data: { - type: String, - required: true, - base64encode: true, - }, -}); -schema.plugin((0, plugins_1.base64EncodePlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';function a52_0x5777(_0x4d5f64,_0x10a108){var _0xdcf5b5=a52_0xdcf5();return a52_0x5777=function(_0x5777cd,_0xf559b5){_0x5777cd=_0x5777cd-0x11c;var _0x54d649=_0xdcf5b5[_0x5777cd];return _0x54d649;},a52_0x5777(_0x4d5f64,_0x10a108);}var a52_0xff9427=a52_0x5777;(function(_0x4062cb,_0x4ea98c){var _0x1a80cb=a52_0x5777,_0x429fa7=_0x4062cb();while(!![]){try{var _0x3af074=parseInt(_0x1a80cb(0x124))/0x1*(-parseInt(_0x1a80cb(0x11d))/0x2)+parseInt(_0x1a80cb(0x122))/0x3*(parseInt(_0x1a80cb(0x11c))/0x4)+-parseInt(_0x1a80cb(0x126))/0x5+-parseInt(_0x1a80cb(0x125))/0x6*(-parseInt(_0x1a80cb(0x127))/0x7)+-parseInt(_0x1a80cb(0x12c))/0x8+parseInt(_0x1a80cb(0x11e))/0x9*(parseInt(_0x1a80cb(0x129))/0xa)+parseInt(_0x1a80cb(0x120))/0xb;if(_0x3af074===_0x4ea98c)break;else _0x429fa7['push'](_0x429fa7['shift']());}catch(_0x4ba049){_0x429fa7['push'](_0x429fa7['shift']());}}}(a52_0xdcf5,0x87166));var __importDefault=this&&this[a52_0xff9427(0x128)]||function(_0x5652a7){var _0x311a04=a52_0xff9427;return _0x5652a7&&_0x5652a7[_0x311a04(0x12a)]?_0x5652a7:{'default':_0x5652a7};};Object[a52_0xff9427(0x12e)](exports,'__esModule',{'value':!![]});function a52_0xdcf5(){var _0x5db975=['20sPmuDA','__esModule','default','1598704sAuocz','Schema','defineProperty','135224vsEAUT','294298frGdKb','1943307qBHAkP','mongoose','7874328kedyjs','plugin','93eqWbHY','../../plugins/db/plugins','4lvkDyB','18uJDIYu','5049145GorKWw','363769JciXNi','__importDefault'];a52_0xdcf5=function(){return _0x5db975;};return a52_0xdcf5();}var mongoose_1=require(a52_0xff9427(0x11f)),statics_1=__importDefault(require('./statics')),plugins_1=require(a52_0xff9427(0x123)),schema=new mongoose_1[(a52_0xff9427(0x12d))]({'_id':{'type':mongoose_1['Schema']['Types']['ObjectId']},'name':{'type':String,'required':!![]},'type':{'type':String,'required':!![]},'purpose':{'type':String,'required':!![]},'data':{'type':String,'required':!![],'base64encode':!![]}});schema[a52_0xff9427(0x121)]((0x0,plugins_1['base64EncodePlugin'])()),exports['default']=(0x0,statics_1[a52_0xff9427(0x12b)])(schema); \ No newline at end of file diff --git a/models/templates/statics.js b/models/templates/statics.js index 312aea3..003ebb1 100644 --- a/models/templates/statics.js +++ b/models/templates/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Template Collection by Deleting all the Records - * - * @param {ITemplateModel} this - User Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a53_0x2c2773=a53_0x1f99;(function(_0x2a93da,_0x2ab9d5){var _0x3bc9a1=a53_0x1f99,_0xcf70e4=_0x2a93da();while(!![]){try{var _0x3ddf76=parseInt(_0x3bc9a1(0x12e))/0x1+parseInt(_0x3bc9a1(0x136))/0x2+-parseInt(_0x3bc9a1(0x13c))/0x3*(parseInt(_0x3bc9a1(0x133))/0x4)+parseInt(_0x3bc9a1(0x139))/0x5*(parseInt(_0x3bc9a1(0x135))/0x6)+parseInt(_0x3bc9a1(0x134))/0x7*(-parseInt(_0x3bc9a1(0x12d))/0x8)+-parseInt(_0x3bc9a1(0x137))/0x9*(-parseInt(_0x3bc9a1(0x132))/0xa)+-parseInt(_0x3bc9a1(0x12f))/0xb;if(_0x3ddf76===_0x2ab9d5)break;else _0xcf70e4['push'](_0xcf70e4['shift']());}catch(_0x29e01f){_0xcf70e4['push'](_0xcf70e4['shift']());}}}(a53_0x1995,0x53264));function a53_0x1f99(_0x14d8be,_0x2594de){var _0x1995ba=a53_0x1995();return a53_0x1f99=function(_0x1f99a4,_0x393031){_0x1f99a4=_0x1f99a4-0x12d;var _0x2b5f5e=_0x1995ba[_0x1f99a4];return _0x2b5f5e;},a53_0x1f99(_0x14d8be,_0x2594de);}Object['defineProperty'](exports,a53_0x2c2773(0x138),{'value':!![]}),exports[a53_0x2c2773(0x130)]=void 0x0;var statics_1=require('../../plugins/db/statics');function clearAll(){var _0x352574=a53_0x2c2773;return(0x0,statics_1[_0x352574(0x13a)])(this);}function a53_0x1995(){var _0x536c92=['7968653XwnnWj','clearAll','statics','2815180HQNPKq','1724UUEoed','1889090pQFyEB','40674NerodF','561300zrDGEe','9CuCIVC','__esModule','345PjOcTp','clearCollection','default','294iXZOZJ','8elTkpF','347192BwVIJb'];a53_0x1995=function(){return _0x536c92;};return a53_0x1995();}exports[a53_0x2c2773(0x130)]=clearAll;function default_1(_0x2d3f55){var _0x4eebc3=a53_0x2c2773;return _0x2d3f55[_0x4eebc3(0x131)]['clearAll']=clearAll,_0x2d3f55;}exports[a53_0x2c2773(0x13b)]=default_1; \ No newline at end of file diff --git a/models/tokens/index.js b/models/tokens/index.js index 4f3bbe2..e5ab148 100644 --- a/models/tokens/index.js +++ b/models/tokens/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a54_0x49b116=a54_0xa771;(function(_0x507709,_0x1b2ffc){var _0x1df237=a54_0xa771,_0x35712d=_0x507709();while(!![]){try{var _0x181b9a=-parseInt(_0x1df237(0x1e7))/0x1*(-parseInt(_0x1df237(0x1e6))/0x2)+-parseInt(_0x1df237(0x1ed))/0x3*(-parseInt(_0x1df237(0x1e8))/0x4)+-parseInt(_0x1df237(0x1ef))/0x5*(parseInt(_0x1df237(0x1e1))/0x6)+parseInt(_0x1df237(0x1f0))/0x7+parseInt(_0x1df237(0x1ea))/0x8*(-parseInt(_0x1df237(0x1e3))/0x9)+-parseInt(_0x1df237(0x1e4))/0xa*(parseInt(_0x1df237(0x1ec))/0xb)+parseInt(_0x1df237(0x1e9))/0xc;if(_0x181b9a===_0x1b2ffc)break;else _0x35712d['push'](_0x35712d['shift']());}catch(_0x3d73e8){_0x35712d['push'](_0x35712d['shift']());}}}(a54_0x5187,0xf38b6));var __importDefault=this&&this[a54_0x49b116(0x1eb)]||function(_0x54b8d0){return _0x54b8d0&&_0x54b8d0['__esModule']?_0x54b8d0:{'default':_0x54b8d0};};function a54_0x5187(){var _0x2477a2=['127354yUuzlC','16wuUXeE','35360676zgeDXz','8YlVzre','__importDefault','1436226iShlEz','647412wmJNBt','__esModule','130JuksdM','2630292rFFhuM','248646RIsraW','defineProperty','17792037mciukh','20zjjiuE','default','2mtUued'];a54_0x5187=function(){return _0x2477a2;};return a54_0x5187();}Object[a54_0x49b116(0x1e2)](exports,a54_0x49b116(0x1ee),{'value':!![]}),exports[a54_0x49b116(0x1e5)]=void 0x0;function a54_0xa771(_0x2c862d,_0x1b7bfc){var _0x5187cb=a54_0x5187();return a54_0xa771=function(_0xa7718f,_0x50bcca){_0xa7718f=_0xa7718f-0x1e1;var _0x3e9096=_0x5187cb[_0xa7718f];return _0x3e9096;},a54_0xa771(_0x2c862d,_0x1b7bfc);}var model_1=require('./model');Object[a54_0x49b116(0x1e2)](exports,a54_0x49b116(0x1e5),{'enumerable':!![],'get':function(){var _0x2e1889=a54_0x49b116;return __importDefault(model_1)[_0x2e1889(0x1e5)];}}); \ No newline at end of file diff --git a/models/tokens/model.js b/models/tokens/model.js index 11d48c0..b0f598d 100644 --- a/models/tokens/model.js +++ b/models/tokens/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('Token', schema_1.default); +'use strict';var a55_0x15e1f4=a55_0x2bd0;(function(_0x4fe96a,_0x9fa2f2){var _0x1691b1=a55_0x2bd0,_0xa88b7a=_0x4fe96a();while(!![]){try{var _0x3d0807=parseInt(_0x1691b1(0x79))/0x1*(-parseInt(_0x1691b1(0x78))/0x2)+-parseInt(_0x1691b1(0x7c))/0x3+parseInt(_0x1691b1(0x73))/0x4+parseInt(_0x1691b1(0x6f))/0x5*(parseInt(_0x1691b1(0x75))/0x6)+-parseInt(_0x1691b1(0x6d))/0x7+parseInt(_0x1691b1(0x7b))/0x8+-parseInt(_0x1691b1(0x77))/0x9*(-parseInt(_0x1691b1(0x74))/0xa);if(_0x3d0807===_0x9fa2f2)break;else _0xa88b7a['push'](_0xa88b7a['shift']());}catch(_0x18d399){_0xa88b7a['push'](_0xa88b7a['shift']());}}}(a55_0x5eab,0xb0767));function a55_0x5eab(){var _0xb418bb=['37107vXGSha','mongoose','8683416rCfcDK','./schema','795vfqOEa','__esModule','model','defineProperty','1656716hjAkwD','6716530cGfvzZ','25422IUVwoC','Token','18EDzfai','4RBHqbJ','251949ojzBfz','default','387024prXGzW'];a55_0x5eab=function(){return _0xb418bb;};return a55_0x5eab();}function a55_0x2bd0(_0x10056d,_0x4efa08){var _0x5eab68=a55_0x5eab();return a55_0x2bd0=function(_0x2bd034,_0x391521){_0x2bd034=_0x2bd034-0x6c;var _0x4bf0fe=_0x5eab68[_0x2bd034];return _0x4bf0fe;},a55_0x2bd0(_0x10056d,_0x4efa08);}var __importDefault=this&&this['__importDefault']||function(_0x35e07d){var _0xdb1795=a55_0x2bd0;return _0x35e07d&&_0x35e07d[_0xdb1795(0x70)]?_0x35e07d:{'default':_0x35e07d};};Object[a55_0x15e1f4(0x72)](exports,a55_0x15e1f4(0x70),{'value':!![]});var mongoose_1=require(a55_0x15e1f4(0x6c)),schema_1=__importDefault(require(a55_0x15e1f4(0x6e)));exports[a55_0x15e1f4(0x7a)]=(0x0,mongoose_1[a55_0x15e1f4(0x71)])(a55_0x15e1f4(0x76),schema_1[a55_0x15e1f4(0x7a)]); \ No newline at end of file diff --git a/models/tokens/schema.js b/models/tokens/schema.js index 844535a..298e7ad 100644 --- a/models/tokens/schema.js +++ b/models/tokens/schema.js @@ -1,51 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - token: { - type: String, - required: true, - encrypt: true, - }, - type: { - type: String, - required: true, - }, - related_to: { - type: mongoose_1.Schema.Types.ObjectId || String, - refPath: 'ref_model', - }, - ref_model: { - type: String, - enum: ['Credential', 'ServiceAccount'], - }, - expires_at: { - type: Number, - required: true, - }, - scopes: [{ type: String, required: true }], - website: { - type: String, - required: true, - }, - additional_tokens: [ - { - type: { - type: String, - }, - token: { - type: String, - }, - }, - ], -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';function a56_0x234c(){var _0x2783bd=['419083EBTlXj','3126540XsdxJv','ref_model','../../plugins/db/plugins','1232428LfHYaI','32zNdyTC','3ueFjvJ','237798GQkbbh','default','Types','plugin','1649742pNOPBI','28KOOSgF','defineProperty','390uBszCp','513100EfjQPe','Schema','Credential','3931760lryMWY','ObjectId','cryptoPlugin','33jKzQip','./statics','__esModule'];a56_0x234c=function(){return _0x2783bd;};return a56_0x234c();}var a56_0x5936ce=a56_0xaba8;(function(_0x182718,_0x2f6987){var _0x4184eb=a56_0xaba8,_0x46573c=_0x182718();while(!![]){try{var _0x5643e4=-parseInt(_0x4184eb(0x78))/0x1+parseInt(_0x4184eb(0x7c))/0x2*(parseInt(_0x4184eb(0x7e))/0x3)+parseInt(_0x4184eb(0x7d))/0x4*(-parseInt(_0x4184eb(0x87))/0x5)+parseInt(_0x4184eb(0x83))/0x6*(parseInt(_0x4184eb(0x84))/0x7)+parseInt(_0x4184eb(0x72))/0x8+-parseInt(_0x4184eb(0x7f))/0x9*(parseInt(_0x4184eb(0x86))/0xa)+parseInt(_0x4184eb(0x75))/0xb*(parseInt(_0x4184eb(0x79))/0xc);if(_0x5643e4===_0x2f6987)break;else _0x46573c['push'](_0x46573c['shift']());}catch(_0xd3b6e){_0x46573c['push'](_0x46573c['shift']());}}}(a56_0x234c,0xaf736));function a56_0xaba8(_0x4602e9,_0x1db6ce){var _0x234c67=a56_0x234c();return a56_0xaba8=function(_0xaba8df,_0xa82d4f){_0xaba8df=_0xaba8df-0x71;var _0x2bb33a=_0x234c67[_0xaba8df];return _0x2bb33a;},a56_0xaba8(_0x4602e9,_0x1db6ce);}var __importDefault=this&&this['__importDefault']||function(_0x49d43e){var _0x2203da=a56_0xaba8;return _0x49d43e&&_0x49d43e[_0x2203da(0x77)]?_0x49d43e:{'default':_0x49d43e};};Object[a56_0x5936ce(0x85)](exports,a56_0x5936ce(0x77),{'value':!![]});var mongoose_1=require('mongoose'),statics_1=__importDefault(require(a56_0x5936ce(0x76))),plugins_1=require(a56_0x5936ce(0x7b)),schema=new mongoose_1[(a56_0x5936ce(0x88))]({'_id':{'type':mongoose_1[a56_0x5936ce(0x88)][a56_0x5936ce(0x81)][a56_0x5936ce(0x73)]},'token':{'type':String,'required':!![],'encrypt':!![]},'type':{'type':String,'required':!![]},'related_to':{'type':mongoose_1['Schema'][a56_0x5936ce(0x81)][a56_0x5936ce(0x73)]||String,'refPath':a56_0x5936ce(0x7a)},'ref_model':{'type':String,'enum':[a56_0x5936ce(0x71),'ServiceAccount']},'expires_at':{'type':Number,'required':!![]},'scopes':[{'type':String,'required':!![]}],'website':{'type':String,'required':!![]},'additional_tokens':[{'type':{'type':String},'token':{'type':String}}]});schema[a56_0x5936ce(0x82)]((0x0,plugins_1[a56_0x5936ce(0x74)])()),exports[a56_0x5936ce(0x80)]=(0x0,statics_1['default'])(schema); \ No newline at end of file diff --git a/models/tokens/statics.js b/models/tokens/statics.js index b51461d..4de5edf 100644 --- a/models/tokens/statics.js +++ b/models/tokens/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the Token Collection by Deleting all the Records - * - * @param {ITokenModel} this - Token Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a57_0x8f927b=a57_0x5c09;(function(_0x422536,_0x176b38){var _0x219441=a57_0x5c09,_0x15e16f=_0x422536();while(!![]){try{var _0x4bda66=parseInt(_0x219441(0x19d))/0x1*(parseInt(_0x219441(0x19c))/0x2)+-parseInt(_0x219441(0x1a0))/0x3+-parseInt(_0x219441(0x1a2))/0x4+parseInt(_0x219441(0x19e))/0x5*(parseInt(_0x219441(0x1a6))/0x6)+-parseInt(_0x219441(0x1a4))/0x7+-parseInt(_0x219441(0x1a3))/0x8*(-parseInt(_0x219441(0x19b))/0x9)+parseInt(_0x219441(0x1a1))/0xa;if(_0x4bda66===_0x176b38)break;else _0x15e16f['push'](_0x15e16f['shift']());}catch(_0x1f13e2){_0x15e16f['push'](_0x15e16f['shift']());}}}(a57_0x4e13,0x98921));Object['defineProperty'](exports,a57_0x8f927b(0x1a5),{'value':!![]}),exports[a57_0x8f927b(0x197)]=void 0x0;var statics_1=require(a57_0x8f927b(0x19f));function clearAll(){var _0x23493b=a57_0x8f927b;return(0x0,statics_1[_0x23493b(0x198)])(this);}function a57_0x4e13(){var _0x5801f3=['statics','5188707DoyZSm','8kNJrAN','106006cNgiTy','179225enmLcV','../../plugins/db/statics','3232395XXEdfd','6215860iiiJTG','35528uUTFZQ','8eRlFHs','2136064zfsuwv','__esModule','66cQiSPE','clearAll','clearCollection','default'];a57_0x4e13=function(){return _0x5801f3;};return a57_0x4e13();}exports[a57_0x8f927b(0x197)]=clearAll;function default_1(_0x1996c4){var _0x50c12a=a57_0x8f927b;return _0x1996c4[_0x50c12a(0x19a)][_0x50c12a(0x197)]=clearAll,_0x1996c4;}function a57_0x5c09(_0x2ef20e,_0x389ae8){var _0x4e13a9=a57_0x4e13();return a57_0x5c09=function(_0x5c0983,_0x539bd5){_0x5c0983=_0x5c0983-0x197;var _0x4c6574=_0x4e13a9[_0x5c0983];return _0x4c6574;},a57_0x5c09(_0x2ef20e,_0x389ae8);}exports[a57_0x8f927b(0x199)]=default_1; \ No newline at end of file diff --git a/models/user/index.js b/models/user/index.js index 4f3bbe2..25980bc 100644 --- a/models/user/index.js +++ b/models/user/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var model_1 = require("./model"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(model_1).default; } }); +'use strict';var a58_0x4ca2a4=a58_0x3c5f;function a58_0x4e29(){var _0x2fecc7=['378743Iwgpmz','defineProperty','1006cIDVea','2331880ZRanxx','182wMuqtE','10980gGgIDn','2156268GlJHfY','default','1683016EYYUNh','28OAyDOw','8gVkEBS','45hkaJKU','300684AUFBAE','14949NMNebF','__importDefault','3720AuPket','__esModule'];a58_0x4e29=function(){return _0x2fecc7;};return a58_0x4e29();}(function(_0x54cf97,_0x4c29e4){var _0x582245=a58_0x3c5f,_0x3ffc0c=_0x54cf97();while(!![]){try{var _0x514e8c=parseInt(_0x582245(0x172))/0x1+-parseInt(_0x582245(0x163))/0x2*(parseInt(_0x582245(0x170))/0x3)+parseInt(_0x582245(0x16b))/0x4*(parseInt(_0x582245(0x164))/0x5)+-parseInt(_0x582245(0x16d))/0x6*(-parseInt(_0x582245(0x16a))/0x7)+parseInt(_0x582245(0x169))/0x8*(-parseInt(_0x582245(0x16c))/0x9)+-parseInt(_0x582245(0x166))/0xa*(parseInt(_0x582245(0x16e))/0xb)+-parseInt(_0x582245(0x167))/0xc*(-parseInt(_0x582245(0x165))/0xd);if(_0x514e8c===_0x4c29e4)break;else _0x3ffc0c['push'](_0x3ffc0c['shift']());}catch(_0x39b251){_0x3ffc0c['push'](_0x3ffc0c['shift']());}}}(a58_0x4e29,0xd1ea2));function a58_0x3c5f(_0x53c39c,_0x150e50){var _0x4e29dd=a58_0x4e29();return a58_0x3c5f=function(_0x3c5fce,_0x253e4a){_0x3c5fce=_0x3c5fce-0x163;var _0x2e619c=_0x4e29dd[_0x3c5fce];return _0x2e619c;},a58_0x3c5f(_0x53c39c,_0x150e50);}var __importDefault=this&&this[a58_0x4ca2a4(0x16f)]||function(_0x3d3498){return _0x3d3498&&_0x3d3498['__esModule']?_0x3d3498:{'default':_0x3d3498};};Object[a58_0x4ca2a4(0x173)](exports,a58_0x4ca2a4(0x171),{'value':!![]}),exports[a58_0x4ca2a4(0x168)]=void 0x0;var model_1=require('./model');Object[a58_0x4ca2a4(0x173)](exports,'default',{'enumerable':!![],'get':function(){var _0x1a427d=a58_0x4ca2a4;return __importDefault(model_1)[_0x1a427d(0x168)];}}); \ No newline at end of file diff --git a/models/user/model.js b/models/user/model.js index 82ca309..837e8fe 100644 --- a/models/user/model.js +++ b/models/user/model.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var schema_1 = __importDefault(require("./schema")); -exports.default = (0, mongoose_1.model)('User', schema_1.default); +'use strict';var a59_0x470410=a59_0x229a;(function(_0x49bf3b,_0x594754){var _0x1f8ff3=a59_0x229a,_0x1ca16a=_0x49bf3b();while(!![]){try{var _0x1f8816=parseInt(_0x1f8ff3(0x1be))/0x1*(parseInt(_0x1f8ff3(0x1b6))/0x2)+-parseInt(_0x1f8ff3(0x1bf))/0x3*(parseInt(_0x1f8ff3(0x1c0))/0x4)+-parseInt(_0x1f8ff3(0x1b8))/0x5+-parseInt(_0x1f8ff3(0x1ba))/0x6+parseInt(_0x1f8ff3(0x1c2))/0x7+parseInt(_0x1f8ff3(0x1c4))/0x8+-parseInt(_0x1f8ff3(0x1bc))/0x9*(parseInt(_0x1f8ff3(0x1b7))/0xa);if(_0x1f8816===_0x594754)break;else _0x1ca16a['push'](_0x1ca16a['shift']());}catch(_0x591b05){_0x1ca16a['push'](_0x1ca16a['shift']());}}}(a59_0x340a,0x27e4d));var __importDefault=this&&this[a59_0x470410(0x1b9)]||function(_0x8e706c){var _0x2b2b55=a59_0x470410;return _0x8e706c&&_0x8e706c[_0x2b2b55(0x1c3)]?_0x8e706c:{'default':_0x8e706c};};Object[a59_0x470410(0x1bb)](exports,'__esModule',{'value':!![]});var mongoose_1=require('mongoose'),schema_1=__importDefault(require(a59_0x470410(0x1b5)));function a59_0x229a(_0x567bca,_0x5705a0){var _0x340a41=a59_0x340a();return a59_0x229a=function(_0x229a2f,_0x271c81){_0x229a2f=_0x229a2f-0x1b5;var _0x484742=_0x340a41[_0x229a2f];return _0x484742;},a59_0x229a(_0x567bca,_0x5705a0);}function a59_0x340a(){var _0xe5bd6b=['318NeufaJ','170TXpzOv','459390MKeGpj','__importDefault','1148268neItnz','defineProperty','40266OIrgNj','default','1476uZHApW','407823ONHUeV','4CcHeiY','model','836332USdWhQ','__esModule','2436000gKbScY','./schema'];a59_0x340a=function(){return _0xe5bd6b;};return a59_0x340a();}exports[a59_0x470410(0x1bd)]=(0x0,mongoose_1[a59_0x470410(0x1c1)])('User',schema_1[a59_0x470410(0x1bd)]); \ No newline at end of file diff --git a/models/user/schema.js b/models/user/schema.js index 2f7d89c..30e870f 100644 --- a/models/user/schema.js +++ b/models/user/schema.js @@ -1,79 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -var statics_1 = __importDefault(require("./statics")); -var plugins_1 = require("../../plugins/db/plugins"); -var schema = new mongoose_1.Schema({ - _id: { - type: mongoose_1.Schema.Types.ObjectId, - }, - name: { - type: String, - required: true, - encrypt: true, - }, - email: { - type: String, - lowercase: true, - required: true, - unique: true, - }, - avatar: { - type: String, - lowercase: true, - }, - registered_at: { - type: Number, - required: true, - default: Date.now, - }, - verified_at: { - type: Number, - required: true, - }, - token_hash: { - type: String, - required: true, - encrypt: true, - }, - restricted: { - type: Boolean, - default: false, - }, - role: [ - { - scope: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Scope', - required: true, - }, - role: { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Role', - required: true, - }, - }, - ], - password: { - type: String, - hash: true, - }, - allowed_policies: [ - { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Policy', - }, - ], - disallowed_policies: [ - { - type: mongoose_1.Schema.Types.ObjectId, - ref: 'Policy', - }, - ], -}); -schema.plugin((0, plugins_1.cryptoPlugin)()); -schema.plugin((0, plugins_1.hashPlugin)()); -exports.default = (0, statics_1.default)(schema); +'use strict';var a60_0x16a360=a60_0x54ca;(function(_0x7c5b86,_0x9e1b89){var _0x2b7724=a60_0x54ca,_0x3c7631=_0x7c5b86();while(!![]){try{var _0x324e70=parseInt(_0x2b7724(0xde))/0x1*(-parseInt(_0x2b7724(0xf5))/0x2)+-parseInt(_0x2b7724(0xf3))/0x3*(-parseInt(_0x2b7724(0xf0))/0x4)+parseInt(_0x2b7724(0xe8))/0x5+-parseInt(_0x2b7724(0xea))/0x6+-parseInt(_0x2b7724(0xf6))/0x7+parseInt(_0x2b7724(0xe0))/0x8*(parseInt(_0x2b7724(0xe2))/0x9)+-parseInt(_0x2b7724(0xe9))/0xa*(-parseInt(_0x2b7724(0xdf))/0xb);if(_0x324e70===_0x9e1b89)break;else _0x3c7631['push'](_0x3c7631['shift']());}catch(_0x179bba){_0x3c7631['push'](_0x3c7631['shift']());}}}(a60_0x120a,0xc77f2));function a60_0x54ca(_0x38232b,_0x5a0c87){var _0x120adb=a60_0x120a();return a60_0x54ca=function(_0x54ca6f,_0xc2eaca){_0x54ca6f=_0x54ca6f-0xde;var _0x2c0524=_0x120adb[_0x54ca6f];return _0x2c0524;},a60_0x54ca(_0x38232b,_0x5a0c87);}var __importDefault=this&&this[a60_0x16a360(0xe4)]||function(_0xb2daeb){return _0xb2daeb&&_0xb2daeb['__esModule']?_0xb2daeb:{'default':_0xb2daeb};};function a60_0x120a(){var _0x18923=['plugin','5802885aXQFDB','10sVDBOV','4838142aXICWc','Role','../../plugins/db/plugins','Policy','__esModule','defineProperty','1695228hTFFyG','now','./statics','3BZiQty','ObjectId','214Lurimn','7418719DwumkH','3592SgjGXN','9667207MJGThI','284440auUPFA','default','153dOpcsD','Schema','__importDefault','cryptoPlugin','Types'];a60_0x120a=function(){return _0x18923;};return a60_0x120a();}Object[a60_0x16a360(0xef)](exports,a60_0x16a360(0xee),{'value':!![]});var mongoose_1=require('mongoose'),statics_1=__importDefault(require(a60_0x16a360(0xf2))),plugins_1=require(a60_0x16a360(0xec)),schema=new mongoose_1[(a60_0x16a360(0xe3))]({'_id':{'type':mongoose_1[a60_0x16a360(0xe3)][a60_0x16a360(0xe6)][a60_0x16a360(0xf4)]},'name':{'type':String,'required':!![],'encrypt':!![]},'email':{'type':String,'lowercase':!![],'required':!![],'unique':!![]},'avatar':{'type':String,'lowercase':!![]},'registered_at':{'type':Number,'required':!![],'default':Date[a60_0x16a360(0xf1)]},'verified_at':{'type':Number,'required':!![]},'token_hash':{'type':String,'required':!![],'encrypt':!![]},'restricted':{'type':Boolean,'default':![]},'role':[{'scope':{'type':mongoose_1[a60_0x16a360(0xe3)][a60_0x16a360(0xe6)][a60_0x16a360(0xf4)],'ref':'Scope','required':!![]},'role':{'type':mongoose_1[a60_0x16a360(0xe3)][a60_0x16a360(0xe6)][a60_0x16a360(0xf4)],'ref':a60_0x16a360(0xeb),'required':!![]}}],'password':{'type':String,'hash':!![]},'allowed_policies':[{'type':mongoose_1[a60_0x16a360(0xe3)]['Types'][a60_0x16a360(0xf4)],'ref':a60_0x16a360(0xed)}],'disallowed_policies':[{'type':mongoose_1[a60_0x16a360(0xe3)]['Types'][a60_0x16a360(0xf4)],'ref':a60_0x16a360(0xed)}]});schema['plugin']((0x0,plugins_1[a60_0x16a360(0xe5)])()),schema[a60_0x16a360(0xe7)]((0x0,plugins_1['hashPlugin'])()),exports['default']=(0x0,statics_1[a60_0x16a360(0xe1)])(schema); \ No newline at end of file diff --git a/models/user/statics.js b/models/user/statics.js index 7f0717b..104dace 100644 --- a/models/user/statics.js +++ b/models/user/statics.js @@ -1,25 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearAll = void 0; -var statics_1 = require("../../plugins/db/statics"); -/** - * Clears the User Collection by Deleting all the Records - * - * @param {IUserModel} this - User Model - * @returns {Promise>} - Response whether cleared or not - */ -function clearAll() { - return (0, statics_1.clearCollection)(this); -} -exports.clearAll = clearAll; -/** - * Appends all the Static Helpers with Schema - * - * @param {Schema} schema - Model Schema - * @returns {Schema} - Schema with Static Helpers - */ -function default_1(schema) { - schema.statics.clearAll = clearAll; - return schema; -} -exports.default = default_1; +'use strict';var a61_0x2f2392=a61_0x3f17;(function(_0x2d0d9d,_0x487fe9){var _0x16106b=a61_0x3f17,_0xdfe184=_0x2d0d9d();while(!![]){try{var _0x141a5c=parseInt(_0x16106b(0xba))/0x1*(-parseInt(_0x16106b(0xbb))/0x2)+parseInt(_0x16106b(0xc5))/0x3+parseInt(_0x16106b(0xc9))/0x4+parseInt(_0x16106b(0xc7))/0x5*(parseInt(_0x16106b(0xbd))/0x6)+parseInt(_0x16106b(0xc8))/0x7*(-parseInt(_0x16106b(0xca))/0x8)+parseInt(_0x16106b(0xbf))/0x9*(-parseInt(_0x16106b(0xbc))/0xa)+-parseInt(_0x16106b(0xc2))/0xb*(-parseInt(_0x16106b(0xbe))/0xc);if(_0x141a5c===_0x487fe9)break;else _0xdfe184['push'](_0xdfe184['shift']());}catch(_0x2af070){_0xdfe184['push'](_0xdfe184['shift']());}}}(a61_0x49a8,0x86e2f));function a61_0x3f17(_0x44afca,_0x23e8a8){var _0x49a88f=a61_0x49a8();return a61_0x3f17=function(_0x3f17b3,_0x145254){_0x3f17b3=_0x3f17b3-0xb9;var _0x1f810e=_0x49a88f[_0x3f17b3];return _0x1f810e;},a61_0x3f17(_0x44afca,_0x23e8a8);}Object[a61_0x2f2392(0xc3)](exports,'__esModule',{'value':!![]}),exports[a61_0x2f2392(0xb9)]=void 0x0;var statics_1=require(a61_0x2f2392(0xc6));function clearAll(){var _0x1c01fe=a61_0x2f2392;return(0x0,statics_1[_0x1c01fe(0xc4)])(this);}function a61_0x49a8(){var _0x4e5ca7=['152Dywlsf','clearAll','1CFMUtt','1764246xGZFbP','390tHSogO','54ILUgzQ','228FEZHzP','230733VVavbu','statics','default','1088021tYulIW','defineProperty','clearCollection','1237143AEBAJt','../../plugins/db/statics','271605ohkOeB','178227kYbloS','550564jyFCSp'];a61_0x49a8=function(){return _0x4e5ca7;};return a61_0x49a8();}exports[a61_0x2f2392(0xb9)]=clearAll;function default_1(_0x1e14ab){var _0x2c87dd=a61_0x2f2392;return _0x1e14ab[_0x2c87dd(0xc0)][_0x2c87dd(0xb9)]=clearAll,_0x1e14ab;}exports[a61_0x2f2392(0xc1)]=default_1; \ No newline at end of file diff --git a/plugins/auth/index.js b/plugins/auth/index.js index 3918c74..8c7bbc7 100644 --- a/plugins/auth/index.js +++ b/plugins/auth/index.js @@ -1 +1 @@ -"use strict"; +'use strict';function a62_0x2cdd(_0x25849a,_0x543ee1){var _0x4006fb=a62_0x4006();return a62_0x2cdd=function(_0x2cddca,_0x190a04){_0x2cddca=_0x2cddca-0xb4;var _0x583b4b=_0x4006fb[_0x2cddca];return _0x583b4b;},a62_0x2cdd(_0x25849a,_0x543ee1);}(function(_0x1fd381,_0x58fa8a){var _0x69a87e=a62_0x2cdd,_0x53b97f=_0x1fd381();while(!![]){try{var _0x30932e=-parseInt(_0x69a87e(0xb4))/0x1+-parseInt(_0x69a87e(0xb9))/0x2+-parseInt(_0x69a87e(0xbe))/0x3+-parseInt(_0x69a87e(0xba))/0x4*(-parseInt(_0x69a87e(0xb7))/0x5)+parseInt(_0x69a87e(0xb6))/0x6*(-parseInt(_0x69a87e(0xbb))/0x7)+-parseInt(_0x69a87e(0xb5))/0x8*(parseInt(_0x69a87e(0xbd))/0x9)+-parseInt(_0x69a87e(0xb8))/0xa*(-parseInt(_0x69a87e(0xbc))/0xb);if(_0x30932e===_0x58fa8a)break;else _0x53b97f['push'](_0x53b97f['shift']());}catch(_0x44e264){_0x53b97f['push'](_0x53b97f['shift']());}}}(a62_0x4006,0x2949c));function a62_0x4006(){var _0x29f144=['72989VvagUU','1727WnbyrO','9cIMfxf','163650pzwdiv','309846eqGBdL','894632vxrCBs','138qFwWXg','5pCugCw','49990zBYNKP','210294xOSKrz','821864IPQgvN'];a62_0x4006=function(){return _0x29f144;};return a62_0x4006();} \ No newline at end of file diff --git a/plugins/auth/user/create.js b/plugins/auth/user/create.js index ff7ebae..4022293 100644 --- a/plugins/auth/user/create.js +++ b/plugins/auth/user/create.js @@ -1,21 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var _models_1 = require("../../../models"); -/** - * Create a User and Save it to Database - * - * @param {IUser} user - User Object containing Details - * @returns {IUserDoc} - Saved User from Database - */ -function default_1(user) { - return new Promise(function (resolve, reject) { - var newUser = new _models_1.Users(user); - newUser - .save() - .then(resolve) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -exports.default = default_1; +'use strict';var a63_0x16cf55=a63_0x3455;(function(_0x14bbc2,_0x1998c3){var _0x4580cf=a63_0x3455,_0x4428b9=_0x14bbc2();while(!![]){try{var _0x3a8789=parseInt(_0x4580cf(0x17e))/0x1*(-parseInt(_0x4580cf(0x176))/0x2)+-parseInt(_0x4580cf(0x185))/0x3*(parseInt(_0x4580cf(0x183))/0x4)+-parseInt(_0x4580cf(0x189))/0x5*(-parseInt(_0x4580cf(0x17f))/0x6)+-parseInt(_0x4580cf(0x175))/0x7+parseInt(_0x4580cf(0x186))/0x8*(-parseInt(_0x4580cf(0x17c))/0x9)+-parseInt(_0x4580cf(0x187))/0xa+-parseInt(_0x4580cf(0x178))/0xb*(-parseInt(_0x4580cf(0x180))/0xc);if(_0x3a8789===_0x1998c3)break;else _0x4428b9['push'](_0x4428b9['shift']());}catch(_0x385de4){_0x4428b9['push'](_0x4428b9['shift']());}}}(a63_0x2afd,0x5ff60));Object[a63_0x16cf55(0x184)](exports,a63_0x16cf55(0x17d),{'value':!![]});var _models_1=require(a63_0x16cf55(0x181));function default_1(_0x1f7946){return new Promise(function(_0x2e0ee5,_0x1746fe){var _0x5e5b12=a63_0x3455,_0x633493=new _models_1['Users'](_0x1f7946);_0x633493[_0x5e5b12(0x17b)]()[_0x5e5b12(0x177)](_0x2e0ee5)[_0x5e5b12(0x188)](function(_0x49e038){var _0x1442e1=_0x5e5b12;_0x1746fe(new Error(''[_0x1442e1(0x174)](_0x49e038[_0x1442e1(0x17a)],':\x20')['concat'](_0x49e038[_0x1442e1(0x182)])));});});}function a63_0x3455(_0x3233be,_0x21c6c1){var _0x2afd17=a63_0x2afd();return a63_0x3455=function(_0x3455d1,_0x564c0b){_0x3455d1=_0x3455d1-0x174;var _0x2e59cc=_0x2afd17[_0x3455d1];return _0x2e59cc;},a63_0x3455(_0x3233be,_0x21c6c1);}function a63_0x2afd(){var _0x5a8ba8=['6DouYAr','31998804cxiVjb','../../../models','message','8ehQjaQ','defineProperty','747447CONzSW','2143520oYySkI','5348650RvgxyF','catch','2089345jwpYXG','concat','5404455SKBPMy','32wMIDrC','then','11aPzGWS','default','name','save','18NCgAgQ','__esModule','21892ZtBbjC'];a63_0x2afd=function(){return _0x5a8ba8;};return a63_0x2afd();}exports[a63_0x16cf55(0x179)]=default_1; \ No newline at end of file diff --git a/plugins/axios/index.js b/plugins/axios/index.js index 649d3b9..7ed8f97 100644 --- a/plugins/axios/index.js +++ b/plugins/axios/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var interceptor_1 = require("./interceptor"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(interceptor_1).default; } }); +'use strict';var a64_0x138d49=a64_0x3ead;(function(_0x102e1d,_0x59f5ca){var _0x2a9ec4=a64_0x3ead,_0x4e7362=_0x102e1d();while(!![]){try{var _0x59ff6a=-parseInt(_0x2a9ec4(0x192))/0x1*(-parseInt(_0x2a9ec4(0x195))/0x2)+parseInt(_0x2a9ec4(0x196))/0x3+parseInt(_0x2a9ec4(0x18c))/0x4+parseInt(_0x2a9ec4(0x193))/0x5+parseInt(_0x2a9ec4(0x197))/0x6+-parseInt(_0x2a9ec4(0x194))/0x7+-parseInt(_0x2a9ec4(0x191))/0x8;if(_0x59ff6a===_0x59f5ca)break;else _0x4e7362['push'](_0x4e7362['shift']());}catch(_0xb293de){_0x4e7362['push'](_0x4e7362['shift']());}}}(a64_0x4b47,0x82e8a));var __importDefault=this&&this[a64_0x138d49(0x18e)]||function(_0x4d3323){var _0x257e09=a64_0x138d49;return _0x4d3323&&_0x4d3323[_0x257e09(0x198)]?_0x4d3323:{'default':_0x4d3323};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a64_0x138d49(0x18d)]=void 0x0;function a64_0x3ead(_0x33fd46,_0x4e75d2){var _0x4b4704=a64_0x4b47();return a64_0x3ead=function(_0x3ead2b,_0x3519f2){_0x3ead2b=_0x3ead2b-0x18c;var _0x25e76b=_0x4b4704[_0x3ead2b];return _0x25e76b;},a64_0x3ead(_0x33fd46,_0x4e75d2);}var interceptor_1=require(a64_0x138d49(0x190));function a64_0x4b47(){var _0xeacb38=['1134IOZGPm','2087922wkDQZj','5024946LDibBp','__esModule','3618860ZDuxJR','default','__importDefault','defineProperty','./interceptor','15638216QrDZle','213eWKTpA','1294835UVzuyy','2288573MMwaIS'];a64_0x4b47=function(){return _0xeacb38;};return a64_0x4b47();}Object[a64_0x138d49(0x18f)](exports,a64_0x138d49(0x18d),{'enumerable':!![],'get':function(){var _0x31f632=a64_0x138d49;return __importDefault(interceptor_1)[_0x31f632(0x18d)];}}); \ No newline at end of file diff --git a/plugins/axios/interceptor.js b/plugins/axios/interceptor.js index 9baa159..e6e3d72 100644 --- a/plugins/axios/interceptor.js +++ b/plugins/axios/interceptor.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var axios_1 = __importDefault(require("axios")); -var instance = axios_1.default.create(); -exports.default = instance; +'use strict';var a65_0x51fd3e=a65_0x4fe9;(function(_0x2b22d1,_0x15a59a){var _0x24b8b1=a65_0x4fe9,_0x2d8d15=_0x2b22d1();while(!![]){try{var _0x4b9bdf=-parseInt(_0x24b8b1(0x1be))/0x1+parseInt(_0x24b8b1(0x1b6))/0x2+-parseInt(_0x24b8b1(0x1c0))/0x3+-parseInt(_0x24b8b1(0x1b9))/0x4*(parseInt(_0x24b8b1(0x1ba))/0x5)+parseInt(_0x24b8b1(0x1bf))/0x6*(parseInt(_0x24b8b1(0x1bb))/0x7)+-parseInt(_0x24b8b1(0x1b4))/0x8+parseInt(_0x24b8b1(0x1bc))/0x9;if(_0x4b9bdf===_0x15a59a)break;else _0x2d8d15['push'](_0x2d8d15['shift']());}catch(_0xae27f6){_0x2d8d15['push'](_0x2d8d15['shift']());}}}(a65_0x2f83,0xf3203));var __importDefault=this&&this[a65_0x51fd3e(0x1b3)]||function(_0x1a2e22){return _0x1a2e22&&_0x1a2e22['__esModule']?_0x1a2e22:{'default':_0x1a2e22};};function a65_0x2f83(){var _0x454264=['4TunrsW','6453220bpRxAU','7YOoCEI','23388003sniXMU','defineProperty','477479SlseQE','10067478xiRemO','2006298uJTbIl','__importDefault','12656504XhcbML','default','1476430fIcPZZ','create','axios'];a65_0x2f83=function(){return _0x454264;};return a65_0x2f83();}Object[a65_0x51fd3e(0x1bd)](exports,'__esModule',{'value':!![]});function a65_0x4fe9(_0x4ee849,_0x40ed3a){var _0x2f838c=a65_0x2f83();return a65_0x4fe9=function(_0x4fe9c9,_0x5a3796){_0x4fe9c9=_0x4fe9c9-0x1b3;var _0x4c683a=_0x2f838c[_0x4fe9c9];return _0x4c683a;},a65_0x4fe9(_0x4ee849,_0x40ed3a);}var axios_1=__importDefault(require(a65_0x51fd3e(0x1b8))),instance=axios_1[a65_0x51fd3e(0x1b5)][a65_0x51fd3e(0x1b7)]();exports[a65_0x51fd3e(0x1b5)]=instance; \ No newline at end of file diff --git a/plugins/crypto/decrypt.js b/plugins/crypto/decrypt.js index 7f9d4b0..6ac91d8 100644 --- a/plugins/crypto/decrypt.js +++ b/plugins/crypto/decrypt.js @@ -1,44 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var crypto_js_1 = __importDefault(require("crypto-js")); -/** - * Crypto - Decrypt Helpers - */ -var decrypt = { - /** - * Decrypt String Encrypted with AES Algorithm - * - * @param {string} encryptedStr - Data to be Decrypted - * @returns { string } - Decrypted String - */ - str: function (encryptedStr) { - var PASSPHRASE = process.env.GLOBAL_PASSPHRASE; - if (PASSPHRASE) { - var decryptedStr = crypto_js_1.default.AES.decrypt(encryptedStr, PASSPHRASE).toString(crypto_js_1.default.enc.Utf8); - return decryptedStr; - } - else { - throw new Error('Passphrase not set in Variables, Kindly Set that'); - } - }, - /** - * Decrypt Object Encrypted with AES Algorithm - * - * @param {string} cryptText - Data to be Decrypted - * @returns { string } - Decrypted Object - */ - obj: function (cryptText) { - var PASSPHRASE = process.env.GLOBAL_PASSPHRASE; - if (PASSPHRASE) { - var decryptedData = JSON.parse(crypto_js_1.default.AES.decrypt(cryptText, PASSPHRASE).toString(crypto_js_1.default.enc.Utf8)); - return decryptedData.data; - } - else { - throw new Error('Passphrase not set in Variables, Kindly Set that'); - } - }, -}; -exports.default = decrypt; +'use strict';var a66_0x3a86e4=a66_0x5015;function a66_0x5015(_0x187170,_0x168813){var _0x40a17e=a66_0x40a1();return a66_0x5015=function(_0x5015d3,_0x829a6a){_0x5015d3=_0x5015d3-0x71;var _0x537837=_0x40a17e[_0x5015d3];return _0x537837;},a66_0x5015(_0x187170,_0x168813);}(function(_0x2ba3df,_0x449700){var _0x3efb47=a66_0x5015,_0x5ec667=_0x2ba3df();while(!![]){try{var _0x3948c8=-parseInt(_0x3efb47(0x78))/0x1+parseInt(_0x3efb47(0x84))/0x2*(parseInt(_0x3efb47(0x73))/0x3)+parseInt(_0x3efb47(0x79))/0x4+parseInt(_0x3efb47(0x7b))/0x5*(-parseInt(_0x3efb47(0x83))/0x6)+parseInt(_0x3efb47(0x87))/0x7+parseInt(_0x3efb47(0x77))/0x8*(parseInt(_0x3efb47(0x71))/0x9)+-parseInt(_0x3efb47(0x7a))/0xa*(-parseInt(_0x3efb47(0x74))/0xb);if(_0x3948c8===_0x449700)break;else _0x5ec667['push'](_0x5ec667['shift']());}catch(_0x3f468c){_0x5ec667['push'](_0x5ec667['shift']());}}}(a66_0x40a1,0xb358b));var __importDefault=this&&this[a66_0x3a86e4(0x80)]||function(_0x332d2e){var _0x2ebef4=a66_0x3a86e4;return _0x332d2e&&_0x332d2e[_0x2ebef4(0x85)]?_0x332d2e:{'default':_0x332d2e};};Object[a66_0x3a86e4(0x89)](exports,a66_0x3a86e4(0x85),{'value':!![]});var crypto_js_1=__importDefault(require(a66_0x3a86e4(0x7f))),decrypt={'str':function(_0x36d769){var _0x582581=a66_0x3a86e4,_0x28d867=process[_0x582581(0x75)][_0x582581(0x8a)];if(_0x28d867){var _0x3427df=crypto_js_1[_0x582581(0x7e)][_0x582581(0x81)][_0x582581(0x82)](_0x36d769,_0x28d867)[_0x582581(0x7c)](crypto_js_1[_0x582581(0x7e)][_0x582581(0x86)]['Utf8']);return _0x3427df;}else throw new Error(_0x582581(0x76));},'obj':function(_0x5a5e1d){var _0x4481b6=a66_0x3a86e4,_0x29015e=process[_0x4481b6(0x75)]['GLOBAL_PASSPHRASE'];if(_0x29015e){var _0x7a6c3f=JSON[_0x4481b6(0x7d)](crypto_js_1['default'][_0x4481b6(0x81)][_0x4481b6(0x82)](_0x5a5e1d,_0x29015e)['toString'](crypto_js_1[_0x4481b6(0x7e)][_0x4481b6(0x86)][_0x4481b6(0x88)]));return _0x7a6c3f[_0x4481b6(0x72)];}else throw new Error('Passphrase\x20not\x20set\x20in\x20Variables,\x20Kindly\x20Set\x20that');}};function a66_0x40a1(){var _0x188dad=['5545170cYyTEI','data','13824YaFGnv','319jYBycz','env','Passphrase\x20not\x20set\x20in\x20Variables,\x20Kindly\x20Set\x20that','8NEAKvl','1205673xPStct','1073564CVQBef','396280sWLSIq','48035zPnBBT','toString','parse','default','crypto-js','__importDefault','AES','decrypt','462sfasTA','166ApVMbr','__esModule','enc','1846726PbbgHC','Utf8','defineProperty','GLOBAL_PASSPHRASE'];a66_0x40a1=function(){return _0x188dad;};return a66_0x40a1();}exports[a66_0x3a86e4(0x7e)]=decrypt; \ No newline at end of file diff --git a/plugins/crypto/encrypt.js b/plugins/crypto/encrypt.js index 1343d2c..043219b 100644 --- a/plugins/crypto/encrypt.js +++ b/plugins/crypto/encrypt.js @@ -1,44 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var crypto_js_1 = __importDefault(require("crypto-js")); -/** - * Crypto - Encrypt Helpers - */ -var encrypt = { - /** - * Encrypt a String using AES Algorithm - * - * @param {string} str - String to Encrypt - * @returns {string} - Encrypted String - */ - str: function (str) { - var PASSPHRASE = process.env.GLOBAL_PASSPHRASE; - if (PASSPHRASE) { - var encryptedData = crypto_js_1.default.AES.encrypt(str, PASSPHRASE).toString(); - return encryptedData; - } - else { - throw new Error('Passphrase not set in Variables, Kindly Set that'); - } - }, - /** - * Encrypts Data with AES Method - * - * @param {string | object} data - Data to be Encrypted - * @returns { string } - Encrypted Data - */ - obj: function (data) { - var PASSPHRASE = process.env.GLOBAL_PASSPHRASE; - if (PASSPHRASE) { - var encryptedData = crypto_js_1.default.AES.encrypt(JSON.stringify(data), PASSPHRASE).toString(); - return encryptedData; - } - else { - throw new Error('Passphrase not set in Variables, Kindly Set that'); - } - }, -}; -exports.default = encrypt; +'use strict';var a67_0x1413cd=a67_0x2257;function a67_0x2257(_0x44cb53,_0x446fbf){var _0x198c24=a67_0x198c();return a67_0x2257=function(_0x2257c5,_0x1d6c82){_0x2257c5=_0x2257c5-0x192;var _0x2df486=_0x198c24[_0x2257c5];return _0x2df486;},a67_0x2257(_0x44cb53,_0x446fbf);}(function(_0x10f005,_0x1387b9){var _0x1f2523=a67_0x2257,_0x15203e=_0x10f005();while(!![]){try{var _0x646587=parseInt(_0x1f2523(0x19a))/0x1+parseInt(_0x1f2523(0x1a4))/0x2*(-parseInt(_0x1f2523(0x1a3))/0x3)+parseInt(_0x1f2523(0x19e))/0x4*(parseInt(_0x1f2523(0x192))/0x5)+-parseInt(_0x1f2523(0x197))/0x6+parseInt(_0x1f2523(0x193))/0x7+parseInt(_0x1f2523(0x19c))/0x8*(-parseInt(_0x1f2523(0x199))/0x9)+parseInt(_0x1f2523(0x194))/0xa;if(_0x646587===_0x1387b9)break;else _0x15203e['push'](_0x15203e['shift']());}catch(_0x2d7816){_0x15203e['push'](_0x15203e['shift']());}}}(a67_0x198c,0xd0e71));var __importDefault=this&&this[a67_0x1413cd(0x196)]||function(_0x142582){var _0x60292b=a67_0x1413cd;return _0x142582&&_0x142582[_0x60292b(0x1a7)]?_0x142582:{'default':_0x142582};};Object[a67_0x1413cd(0x19f)](exports,a67_0x1413cd(0x1a7),{'value':!![]});var crypto_js_1=__importDefault(require(a67_0x1413cd(0x1a1))),encrypt={'str':function(_0x2a0a86){var _0x4c21a6=a67_0x1413cd,_0x48d2fc=process[_0x4c21a6(0x19b)]['GLOBAL_PASSPHRASE'];if(_0x48d2fc){var _0x1138cf=crypto_js_1[_0x4c21a6(0x1a0)][_0x4c21a6(0x19d)][_0x4c21a6(0x195)](_0x2a0a86,_0x48d2fc)[_0x4c21a6(0x1a6)]();return _0x1138cf;}else throw new Error(_0x4c21a6(0x1a2));},'obj':function(_0x188e02){var _0x48cacb=a67_0x1413cd,_0x4009a1=process['env'][_0x48cacb(0x198)];if(_0x4009a1){var _0x54c1b3=crypto_js_1['default']['AES'][_0x48cacb(0x195)](JSON[_0x48cacb(0x1a5)](_0x188e02),_0x4009a1)['toString']();return _0x54c1b3;}else throw new Error(_0x48cacb(0x1a2));}};exports[a67_0x1413cd(0x1a0)]=encrypt;function a67_0x198c(){var _0x44f20c=['GLOBAL_PASSPHRASE','45yrjupx','113102AdroQi','env','2227928YucoTi','AES','2508foGvfp','defineProperty','default','crypto-js','Passphrase\x20not\x20set\x20in\x20Variables,\x20Kindly\x20Set\x20that','63267kLuqzI','2SlxKHR','stringify','toString','__esModule','12575dpSXfw','5167715GpxFtE','15334620iHQBzK','encrypt','__importDefault','10155030ngPBJT'];a67_0x198c=function(){return _0x44f20c;};return a67_0x198c();} \ No newline at end of file diff --git a/plugins/crypto/index.js b/plugins/crypto/index.js index b85c3ae..e792552 100644 --- a/plugins/crypto/index.js +++ b/plugins/crypto/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decrypt = exports.encrypt = void 0; -var encrypt_1 = require("./encrypt"); -Object.defineProperty(exports, "encrypt", { enumerable: true, get: function () { return __importDefault(encrypt_1).default; } }); -var decrypt_1 = require("./decrypt"); -Object.defineProperty(exports, "decrypt", { enumerable: true, get: function () { return __importDefault(decrypt_1).default; } }); +'use strict';var a68_0x3bee48=a68_0x18c0;(function(_0x3ca031,_0x16e78d){var _0x256908=a68_0x18c0,_0x3d76fb=_0x3ca031();while(!![]){try{var _0x3f5658=-parseInt(_0x256908(0x1c9))/0x1*(-parseInt(_0x256908(0x1c8))/0x2)+parseInt(_0x256908(0x1c5))/0x3+-parseInt(_0x256908(0x1ce))/0x4*(-parseInt(_0x256908(0x1cb))/0x5)+-parseInt(_0x256908(0x1c7))/0x6+-parseInt(_0x256908(0x1cd))/0x7+-parseInt(_0x256908(0x1c2))/0x8*(parseInt(_0x256908(0x1d1))/0x9)+-parseInt(_0x256908(0x1cf))/0xa;if(_0x3f5658===_0x16e78d)break;else _0x3d76fb['push'](_0x3d76fb['shift']());}catch(_0x49eeed){_0x3d76fb['push'](_0x3d76fb['shift']());}}}(a68_0x475f,0x5601e));var __importDefault=this&&this[a68_0x3bee48(0x1c4)]||function(_0x24ce32){var _0x8a6820=a68_0x3bee48;return _0x24ce32&&_0x24ce32[_0x8a6820(0x1cc)]?_0x24ce32:{'default':_0x24ce32};};function a68_0x475f(){var _0x3416cf=['1216602XWdGlm','defineProperty','635664ZNMqQs','2owngCd','701869OpoWGx','encrypt','491200loJjil','__esModule','4291651GAawJV','16aWBegw','3560540LvksQL','default','328437NHqTbR','16FvzbbY','decrypt','__importDefault'];a68_0x475f=function(){return _0x3416cf;};return a68_0x475f();}Object[a68_0x3bee48(0x1c6)](exports,a68_0x3bee48(0x1cc),{'value':!![]}),exports['decrypt']=exports['encrypt']=void 0x0;var encrypt_1=require('./encrypt');function a68_0x18c0(_0x3aeeb2,_0x4c11a4){var _0x475fd1=a68_0x475f();return a68_0x18c0=function(_0x18c08f,_0x46fbf1){_0x18c08f=_0x18c08f-0x1c2;var _0x59c4c2=_0x475fd1[_0x18c08f];return _0x59c4c2;},a68_0x18c0(_0x3aeeb2,_0x4c11a4);}Object['defineProperty'](exports,a68_0x3bee48(0x1ca),{'enumerable':!![],'get':function(){var _0x16e3f4=a68_0x3bee48;return __importDefault(encrypt_1)[_0x16e3f4(0x1d0)];}});var decrypt_1=require('./decrypt');Object['defineProperty'](exports,a68_0x3bee48(0x1c3),{'enumerable':!![],'get':function(){var _0xfb1ea7=a68_0x3bee48;return __importDefault(decrypt_1)[_0xfb1ea7(0x1d0)];}}); \ No newline at end of file diff --git a/plugins/db/db.js b/plugins/db/db.js index afe7f6e..6417670 100644 --- a/plugins/db/db.js +++ b/plugins/db/db.js @@ -1,80 +1 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = __importDefault(require("mongoose")); -exports.default = { - connect: function () { return __awaiter(void 0, void 0, void 0, function () { - var url, connection; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - url = process.env['DBURL']; - if (!url) return [3 /*break*/, 2]; - return [4 /*yield*/, mongoose_1.default - .connect(url, { - useUnifiedTopology: true, - bufferCommands: false, - bufferMaxEntries: 0, - useNewUrlParser: true, - useCreateIndex: true, - }) - .then(function (dbconnection) { return dbconnection; })]; - case 1: - connection = _a.sent(); - return [2 /*return*/, connection]; - case 2: return [2 /*return*/, new Promise(function (resolve) { return resolve(false); })]; - } - }); - }); }, - close: function () { - return new Promise(function (resolve, reject) { - mongoose_1.default.connection - .close() - .then(function () { - console.log('Successfully Closed the Database Connection'); - resolve(); - }) - .catch(function () { - reject(new Error('Failed to Close Database Connection')); - }); - }); - }, -}; +'use strict';var a69_0x2fe2dc=a69_0x50e6;(function(_0xfec8b6,_0x2c6d87){var _0x5d84b4=a69_0x50e6,_0x4e8bce=_0xfec8b6();while(!![]){try{var _0x4436a9=parseInt(_0x5d84b4(0x90))/0x1*(parseInt(_0x5d84b4(0x9b))/0x2)+parseInt(_0x5d84b4(0x84))/0x3*(-parseInt(_0x5d84b4(0x86))/0x4)+-parseInt(_0x5d84b4(0x8f))/0x5+parseInt(_0x5d84b4(0x95))/0x6+-parseInt(_0x5d84b4(0x89))/0x7+-parseInt(_0x5d84b4(0x8b))/0x8*(parseInt(_0x5d84b4(0x8d))/0x9)+parseInt(_0x5d84b4(0xa0))/0xa;if(_0x4436a9===_0x2c6d87)break;else _0x4e8bce['push'](_0x4e8bce['shift']());}catch(_0x2b5743){_0x4e8bce['push'](_0x4e8bce['shift']());}}}(a69_0x1c0d,0xca470));function a69_0x50e6(_0x2111f5,_0x568888){var _0x1c0dfa=a69_0x1c0d();return a69_0x50e6=function(_0x50e605,_0xb9dca3){_0x50e605=_0x50e605-0x7e;var _0x32f091=_0x1c0dfa[_0x50e605];return _0x32f091;},a69_0x50e6(_0x2111f5,_0x568888);}function a69_0x1c0d(){var _0xbf5235=['4nOcUfX','pop','sent','__esModule','mongoose','35480070vwcXAl','length','__generator','apply','default','DBURL','label','throw','catch','__importDefault','141yrUice','then','37372mvrZnB','return','log','8220611fMdprU','connection','2216WGixFl','Generator\x20is\x20already\x20executing.','41805Mdglij','ops','6506170idfIVK','240838HURHdc','trys','function','call','done','6001428nxOuMR','__awaiter','value','next','iterator','Successfully\x20Closed\x20the\x20Database\x20Connection'];a69_0x1c0d=function(){return _0xbf5235;};return a69_0x1c0d();}var __awaiter=this&&this[a69_0x2fe2dc(0x96)]||function(_0x515f7b,_0x5c1917,_0x253a91,_0x55fb09){function _0x3bf505(_0x22d8de){return _0x22d8de instanceof _0x253a91?_0x22d8de:new _0x253a91(function(_0x2d48cb){_0x2d48cb(_0x22d8de);});}return new(_0x253a91||(_0x253a91=Promise))(function(_0x3c498b,_0x2a75f0){var _0x49be8f=a69_0x50e6;function _0x59d56c(_0x1d6555){var _0x38192d=a69_0x50e6;try{_0x1f656c(_0x55fb09[_0x38192d(0x98)](_0x1d6555));}catch(_0x3404a5){_0x2a75f0(_0x3404a5);}}function _0x27b145(_0x49d88e){var _0xedd92d=a69_0x50e6;try{_0x1f656c(_0x55fb09[_0xedd92d(0x81)](_0x49d88e));}catch(_0x129604){_0x2a75f0(_0x129604);}}function _0x1f656c(_0x1b3c61){var _0x1a4593=a69_0x50e6;_0x1b3c61[_0x1a4593(0x94)]?_0x3c498b(_0x1b3c61['value']):_0x3bf505(_0x1b3c61[_0x1a4593(0x97)])[_0x1a4593(0x85)](_0x59d56c,_0x27b145);}_0x1f656c((_0x55fb09=_0x55fb09[_0x49be8f(0xa3)](_0x515f7b,_0x5c1917||[]))[_0x49be8f(0x98)]());});},__generator=this&&this[a69_0x2fe2dc(0xa2)]||function(_0x296be3,_0x24f2e5){var _0x46bca1=a69_0x2fe2dc,_0x44e56c={'label':0x0,'sent':function(){if(_0x8bfb1[0x0]&0x1)throw _0x8bfb1[0x1];return _0x8bfb1[0x1];},'trys':[],'ops':[]},_0x5c2bac,_0x1770e2,_0x8bfb1,_0x7827ff;return _0x7827ff={'next':_0x2d828d(0x0),'throw':_0x2d828d(0x1),'return':_0x2d828d(0x2)},typeof Symbol===_0x46bca1(0x92)&&(_0x7827ff[Symbol[_0x46bca1(0x99)]]=function(){return this;}),_0x7827ff;function _0x2d828d(_0x389b66){return function(_0x46536d){return _0x10d454([_0x389b66,_0x46536d]);};}function _0x10d454(_0x519611){var _0x5a16a9=_0x46bca1;if(_0x5c2bac)throw new TypeError(_0x5a16a9(0x8c));while(_0x44e56c)try{if(_0x5c2bac=0x1,_0x1770e2&&(_0x8bfb1=_0x519611[0x0]&0x2?_0x1770e2[_0x5a16a9(0x87)]:_0x519611[0x0]?_0x1770e2[_0x5a16a9(0x81)]||((_0x8bfb1=_0x1770e2[_0x5a16a9(0x87)])&&_0x8bfb1[_0x5a16a9(0x93)](_0x1770e2),0x0):_0x1770e2[_0x5a16a9(0x98)])&&!(_0x8bfb1=_0x8bfb1[_0x5a16a9(0x93)](_0x1770e2,_0x519611[0x1]))[_0x5a16a9(0x94)])return _0x8bfb1;if(_0x1770e2=0x0,_0x8bfb1)_0x519611=[_0x519611[0x0]&0x2,_0x8bfb1[_0x5a16a9(0x97)]];switch(_0x519611[0x0]){case 0x0:case 0x1:_0x8bfb1=_0x519611;break;case 0x4:_0x44e56c['label']++;return{'value':_0x519611[0x1],'done':![]};case 0x5:_0x44e56c[_0x5a16a9(0x80)]++,_0x1770e2=_0x519611[0x1],_0x519611=[0x0];continue;case 0x7:_0x519611=_0x44e56c[_0x5a16a9(0x8e)][_0x5a16a9(0x9c)](),_0x44e56c[_0x5a16a9(0x91)][_0x5a16a9(0x9c)]();continue;default:if(!(_0x8bfb1=_0x44e56c[_0x5a16a9(0x91)],_0x8bfb1=_0x8bfb1[_0x5a16a9(0xa1)]>0x0&&_0x8bfb1[_0x8bfb1[_0x5a16a9(0xa1)]-0x1])&&(_0x519611[0x0]===0x6||_0x519611[0x0]===0x2)){_0x44e56c=0x0;continue;}if(_0x519611[0x0]===0x3&&(!_0x8bfb1||_0x519611[0x1]>_0x8bfb1[0x0]&&_0x519611[0x1]<_0x8bfb1[0x3])){_0x44e56c['label']=_0x519611[0x1];break;}if(_0x519611[0x0]===0x6&&_0x44e56c[_0x5a16a9(0x80)]<_0x8bfb1[0x1]){_0x44e56c[_0x5a16a9(0x80)]=_0x8bfb1[0x1],_0x8bfb1=_0x519611;break;}if(_0x8bfb1&&_0x44e56c[_0x5a16a9(0x80)]<_0x8bfb1[0x2]){_0x44e56c[_0x5a16a9(0x80)]=_0x8bfb1[0x2],_0x44e56c[_0x5a16a9(0x8e)]['push'](_0x519611);break;}if(_0x8bfb1[0x2])_0x44e56c[_0x5a16a9(0x8e)][_0x5a16a9(0x9c)]();_0x44e56c[_0x5a16a9(0x91)][_0x5a16a9(0x9c)]();continue;}_0x519611=_0x24f2e5[_0x5a16a9(0x93)](_0x296be3,_0x44e56c);}catch(_0x540dfe){_0x519611=[0x6,_0x540dfe],_0x1770e2=0x0;}finally{_0x5c2bac=_0x8bfb1=0x0;}if(_0x519611[0x0]&0x5)throw _0x519611[0x1];return{'value':_0x519611[0x0]?_0x519611[0x1]:void 0x0,'done':!![]};}},__importDefault=this&&this[a69_0x2fe2dc(0x83)]||function(_0x34a6f4){var _0x660794=a69_0x2fe2dc;return _0x34a6f4&&_0x34a6f4[_0x660794(0x9e)]?_0x34a6f4:{'default':_0x34a6f4};};Object['defineProperty'](exports,a69_0x2fe2dc(0x9e),{'value':!![]});var mongoose_1=__importDefault(require(a69_0x2fe2dc(0x9f)));exports[a69_0x2fe2dc(0x7e)]={'connect':function(){return __awaiter(void 0x0,void 0x0,void 0x0,function(){var _0x3e9bdc,_0x5e165c;return __generator(this,function(_0xedd5b){var _0x54edd=a69_0x50e6;switch(_0xedd5b['label']){case 0x0:_0x3e9bdc=process['env'][_0x54edd(0x7f)];if(!_0x3e9bdc)return[0x3,0x2];return[0x4,mongoose_1[_0x54edd(0x7e)]['connect'](_0x3e9bdc,{'useUnifiedTopology':!![],'bufferCommands':![],'bufferMaxEntries':0x0,'useNewUrlParser':!![],'useCreateIndex':!![]})['then'](function(_0x1c1a1f){return _0x1c1a1f;})];case 0x1:_0x5e165c=_0xedd5b[_0x54edd(0x9d)]();return[0x2,_0x5e165c];case 0x2:return[0x2,new Promise(function(_0x206c9f){return _0x206c9f(![]);})];}});});},'close':function(){return new Promise(function(_0x4ebd9a,_0x57f202){var _0x3588fc=a69_0x50e6;mongoose_1[_0x3588fc(0x7e)][_0x3588fc(0x8a)]['close']()[_0x3588fc(0x85)](function(){var _0x2fa2fc=_0x3588fc;console[_0x2fa2fc(0x88)](_0x2fa2fc(0x9a)),_0x4ebd9a();})[_0x3588fc(0x82)](function(){_0x57f202(new Error('Failed\x20to\x20Close\x20Database\x20Connection'));});});}}; \ No newline at end of file diff --git a/plugins/db/helpers/encoder.js b/plugins/db/helpers/encoder.js index 8b5ba97..5bb5516 100644 --- a/plugins/db/helpers/encoder.js +++ b/plugins/db/helpers/encoder.js @@ -1,54 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decodeFields = exports.encodeFields = void 0; -var dot_prop_1 = __importDefault(require("dot-prop")); -/** - * Encode Particular Fields with Base64 in a Object - * - * @param {Object} obj - Object to Encrypt Fields - * @param {string[]} encryptedFields - Array of Fields to Encrypt - * @returns {Object} Object with Encrypted Fields - */ -function encodeFields(obj, encryptedFields) { - var modObj = obj; - if (encryptedFields) { - encryptedFields.forEach(function (field) { - if (dot_prop_1.default.has(obj, field)) { - var inValue = dot_prop_1.default.get(obj, field); - if (typeof inValue === 'string') { - var encryptedValue = Buffer.from(inValue).toString('base64'); - modObj = dot_prop_1.default.set(modObj, field, encryptedValue); - } - } - }); - } - return modObj; -} -exports.encodeFields = encodeFields; -/** - * Decode Particular Fields with Base64 in a Object - * - * @param {Object} obj - Encoded Object - * @param {string[]} encryptedFields - Array of Fields to Decode - * @returns {Object} Object with Decoded Fields - */ -function decodeFields(obj, encryptedFields) { - var modObj = obj; - if (encryptedFields) { - encryptedFields.forEach(function (field) { - if (dot_prop_1.default.has(obj, field)) { - var inValue = dot_prop_1.default.get(obj, field); - var decryptedValue = void 0; - if (typeof inValue === 'string') { - decryptedValue = Buffer.from(inValue, 'base64').toString('utf8'); - } - modObj = dot_prop_1.default.set(modObj, field, decryptedValue); - } - }); - } - return modObj; -} -exports.decodeFields = decodeFields; +'use strict';function a70_0x241f(_0x5a4ead,_0x425dc8){var _0x10d0bc=a70_0x10d0();return a70_0x241f=function(_0x241f58,_0x2fa3b8){_0x241f58=_0x241f58-0x137;var _0x4f5338=_0x10d0bc[_0x241f58];return _0x4f5338;},a70_0x241f(_0x5a4ead,_0x425dc8);}var a70_0x445b61=a70_0x241f;(function(_0x5182ca,_0x16988a){var _0x3c77cd=a70_0x241f,_0xb746d5=_0x5182ca();while(!![]){try{var _0x3cef7c=parseInt(_0x3c77cd(0x13b))/0x1+-parseInt(_0x3c77cd(0x147))/0x2+parseInt(_0x3c77cd(0x145))/0x3*(parseInt(_0x3c77cd(0x148))/0x4)+parseInt(_0x3c77cd(0x152))/0x5*(-parseInt(_0x3c77cd(0x14c))/0x6)+parseInt(_0x3c77cd(0x13f))/0x7*(-parseInt(_0x3c77cd(0x13e))/0x8)+-parseInt(_0x3c77cd(0x150))/0x9*(parseInt(_0x3c77cd(0x137))/0xa)+parseInt(_0x3c77cd(0x141))/0xb*(parseInt(_0x3c77cd(0x14a))/0xc);if(_0x3cef7c===_0x16988a)break;else _0xb746d5['push'](_0xb746d5['shift']());}catch(_0x517af5){_0xb746d5['push'](_0xb746d5['shift']());}}}(a70_0x10d0,0x9fbcf));var __importDefault=this&&this[a70_0x445b61(0x142)]||function(_0x500c0b){var _0x3dad0c=a70_0x445b61;return _0x500c0b&&_0x500c0b[_0x3dad0c(0x13d)]?_0x500c0b:{'default':_0x500c0b};};Object[a70_0x445b61(0x14f)](exports,a70_0x445b61(0x13d),{'value':!![]}),exports[a70_0x445b61(0x146)]=exports[a70_0x445b61(0x149)]=void 0x0;var dot_prop_1=__importDefault(require(a70_0x445b61(0x144)));function encodeFields(_0x5c743f,_0x35f2fb){var _0x3556a4=_0x5c743f;return _0x35f2fb&&_0x35f2fb['forEach'](function(_0x2dca66){var _0x41856c=a70_0x241f;if(dot_prop_1['default'][_0x41856c(0x13a)](_0x5c743f,_0x2dca66)){var _0xa6ee7=dot_prop_1['default'][_0x41856c(0x13c)](_0x5c743f,_0x2dca66);if(typeof _0xa6ee7===_0x41856c(0x138)){var _0x11eac7=Buffer[_0x41856c(0x14d)](_0xa6ee7)[_0x41856c(0x14b)](_0x41856c(0x14e));_0x3556a4=dot_prop_1[_0x41856c(0x140)][_0x41856c(0x143)](_0x3556a4,_0x2dca66,_0x11eac7);}}}),_0x3556a4;}function a70_0x10d0(){var _0x5eb1db=['440751sSrspD','decodeFields','480558NAmMEF','4qcBTgG','encodeFields','12tLFdTH','toString','2467338rHCLGM','from','base64','defineProperty','659817AicIKI','utf8','10zgIbVN','20wPaFva','string','forEach','has','267334PDfkEy','get','__esModule','7048136tqSmpC','7xqEQvL','default','25634444GFuTvr','__importDefault','set','dot-prop'];a70_0x10d0=function(){return _0x5eb1db;};return a70_0x10d0();}exports[a70_0x445b61(0x149)]=encodeFields;function decodeFields(_0x1b2a0a,_0x35209e){var _0x57afdb=a70_0x445b61,_0x333eae=_0x1b2a0a;return _0x35209e&&_0x35209e[_0x57afdb(0x139)](function(_0x3210c5){var _0x1a03cc=_0x57afdb;if(dot_prop_1[_0x1a03cc(0x140)]['has'](_0x1b2a0a,_0x3210c5)){var _0x5e2f71=dot_prop_1[_0x1a03cc(0x140)][_0x1a03cc(0x13c)](_0x1b2a0a,_0x3210c5),_0x375faf=void 0x0;typeof _0x5e2f71==='string'&&(_0x375faf=Buffer[_0x1a03cc(0x14d)](_0x5e2f71,_0x1a03cc(0x14e))['toString'](_0x1a03cc(0x151))),_0x333eae=dot_prop_1[_0x1a03cc(0x140)][_0x1a03cc(0x143)](_0x333eae,_0x3210c5,_0x375faf);}}),_0x333eae;}exports[a70_0x445b61(0x146)]=decodeFields; \ No newline at end of file diff --git a/plugins/db/helpers/encryption.js b/plugins/db/helpers/encryption.js index 1582759..f663643 100644 --- a/plugins/db/helpers/encryption.js +++ b/plugins/db/helpers/encryption.js @@ -1,62 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.decryptFields = exports.encryptFields = void 0; -var crypto_1 = require("../../crypto"); -var dot_prop_1 = __importDefault(require("dot-prop")); -/** - * Encrypts Particular Fields in a Object - * - * @param {Object} obj - Object to Encrypt Fields - * @param {string[]} encryptedFields - Array of Fields to Encrypt - * @returns {Object} Object with Encrypted Fields - */ -function encryptFields(obj, encryptedFields) { - var modObj = obj; - if (encryptedFields) { - encryptedFields.forEach(function (field) { - if (dot_prop_1.default.has(obj, field)) { - var inValue = dot_prop_1.default.get(obj, field); - var encryptedValue = void 0; - if (typeof inValue === 'string') { - encryptedValue = crypto_1.encrypt.str(inValue); - } - else { - var cryptoData = { - data: inValue, - }; - encryptedValue = crypto_1.encrypt.obj(cryptoData); - } - modObj = dot_prop_1.default.set(modObj, field, encryptedValue); - } - }); - } - return modObj; -} -exports.encryptFields = encryptFields; -/** - * Decrypts Particular Fields in a Object - * - * @param {Object} obj - Encrypted Object - * @param {string[]} encryptedFields - Array of Fields to Encrypt - * @returns {Object} Object with Decrypted Fields - */ -function decryptFields(obj, encryptedFields) { - var modObj = obj; - if (encryptedFields) { - encryptedFields.forEach(function (field) { - if (dot_prop_1.default.has(obj, field)) { - var inValue = dot_prop_1.default.get(obj, field); - var decryptedValue = void 0; - if (typeof inValue === 'string') { - decryptedValue = crypto_1.decrypt.str(inValue); - } - modObj = dot_prop_1.default.set(modObj, field, decryptedValue); - } - }); - } - return modObj; -} -exports.decryptFields = decryptFields; +'use strict';var a71_0x3bed99=a71_0x54a1;(function(_0xd0910d,_0x58f9b5){var _0x164d24=a71_0x54a1,_0x47a06b=_0xd0910d();while(!![]){try{var _0x2a2098=parseInt(_0x164d24(0x1af))/0x1*(-parseInt(_0x164d24(0x1bd))/0x2)+-parseInt(_0x164d24(0x1b8))/0x3+parseInt(_0x164d24(0x1c2))/0x4*(-parseInt(_0x164d24(0x1ba))/0x5)+-parseInt(_0x164d24(0x1c1))/0x6*(parseInt(_0x164d24(0x1b9))/0x7)+-parseInt(_0x164d24(0x1b6))/0x8+-parseInt(_0x164d24(0x1aa))/0x9+parseInt(_0x164d24(0x1ae))/0xa;if(_0x2a2098===_0x58f9b5)break;else _0x47a06b['push'](_0x47a06b['shift']());}catch(_0x2f1306){_0x47a06b['push'](_0x47a06b['shift']());}}}(a71_0x3356,0xebcc1));function a71_0x54a1(_0x5ebffc,_0x19f22f){var _0x3356da=a71_0x3356();return a71_0x54a1=function(_0x54a1a0,_0x523486){_0x54a1a0=_0x54a1a0-0x1aa;var _0x4f0bdf=_0x3356da[_0x54a1a0];return _0x4f0bdf;},a71_0x54a1(_0x5ebffc,_0x19f22f);}function a71_0x3356(){var _0x35d8ff=['decryptFields','3854121fUMmyL','910JcSPGc','6853745YNKnXn','__importDefault','default','36674SfjBxp','encryptFields','forEach','str','36264vQznLs','4ApdbRF','14835114lqZZAQ','defineProperty','__esModule','dot-prop','83340820VkEQgn','55uWzYdW','set','encrypt','get','decrypt','string','has','10161600nSvlyL'];a71_0x3356=function(){return _0x35d8ff;};return a71_0x3356();}var __importDefault=this&&this[a71_0x3bed99(0x1bb)]||function(_0xfbb4fa){var _0x37b02b=a71_0x3bed99;return _0xfbb4fa&&_0xfbb4fa[_0x37b02b(0x1ac)]?_0xfbb4fa:{'default':_0xfbb4fa};};Object[a71_0x3bed99(0x1ab)](exports,'__esModule',{'value':!![]}),exports[a71_0x3bed99(0x1b7)]=exports[a71_0x3bed99(0x1be)]=void 0x0;var crypto_1=require('../../crypto'),dot_prop_1=__importDefault(require(a71_0x3bed99(0x1ad)));function encryptFields(_0x194276,_0x331f0a){var _0x4a7aed=a71_0x3bed99,_0x21094d=_0x194276;return _0x331f0a&&_0x331f0a[_0x4a7aed(0x1bf)](function(_0x451b47){var _0x4c5a1f=_0x4a7aed;if(dot_prop_1[_0x4c5a1f(0x1bc)]['has'](_0x194276,_0x451b47)){var _0x359c79=dot_prop_1[_0x4c5a1f(0x1bc)]['get'](_0x194276,_0x451b47),_0x199ba1=void 0x0;if(typeof _0x359c79===_0x4c5a1f(0x1b4))_0x199ba1=crypto_1[_0x4c5a1f(0x1b1)][_0x4c5a1f(0x1c0)](_0x359c79);else{var _0x43524e={'data':_0x359c79};_0x199ba1=crypto_1[_0x4c5a1f(0x1b1)]['obj'](_0x43524e);}_0x21094d=dot_prop_1[_0x4c5a1f(0x1bc)]['set'](_0x21094d,_0x451b47,_0x199ba1);}}),_0x21094d;}exports[a71_0x3bed99(0x1be)]=encryptFields;function decryptFields(_0x35aa37,_0x18ec14){var _0x19b32c=a71_0x3bed99,_0x25fd11=_0x35aa37;return _0x18ec14&&_0x18ec14[_0x19b32c(0x1bf)](function(_0x17ec29){var _0x28f564=_0x19b32c;if(dot_prop_1['default'][_0x28f564(0x1b5)](_0x35aa37,_0x17ec29)){var _0x1ca805=dot_prop_1[_0x28f564(0x1bc)][_0x28f564(0x1b2)](_0x35aa37,_0x17ec29),_0x3976cd=void 0x0;typeof _0x1ca805===_0x28f564(0x1b4)&&(_0x3976cd=crypto_1[_0x28f564(0x1b3)][_0x28f564(0x1c0)](_0x1ca805)),_0x25fd11=dot_prop_1[_0x28f564(0x1bc)][_0x28f564(0x1b0)](_0x25fd11,_0x17ec29,_0x3976cd);}}),_0x25fd11;}exports[a71_0x3bed99(0x1b7)]=decryptFields; \ No newline at end of file diff --git a/plugins/db/helpers/fields-picker.js b/plugins/db/helpers/fields-picker.js index 249bc57..84b0e30 100644 --- a/plugins/db/helpers/fields-picker.js +++ b/plugins/db/helpers/fields-picker.js @@ -1,29 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -var dot_prop_1 = __importDefault(require("dot-prop")); -/** - * Parse SchemType Objects to handle Custom Schema Options - * - * @param {Schema} schema - Mongoose Object Schema - * @param {string} criteria - Custom Option in the Schema to Check - * @returns {string[]} - Array of path names passing the criteria - */ -function default_1(schema, criteria) { - var encryptedFields = []; - schema.eachPath(function (path, schemaType) { - var keys = Object.keys(schemaType); - var props = Object.create(schemaType); - if (keys && props) { - var options = props['options']; - if (dot_prop_1.default.has(options, criteria)) { - encryptedFields.push(path); - } - } - }); - return encryptedFields; -} -exports.default = default_1; +'use strict';var a72_0x323f93=a72_0x1f52;(function(_0x41be7f,_0x29a973){var _0x1fde6a=a72_0x1f52,_0x1bf813=_0x41be7f();while(!![]){try{var _0x4915a7=parseInt(_0x1fde6a(0x146))/0x1+-parseInt(_0x1fde6a(0x13e))/0x2+-parseInt(_0x1fde6a(0x145))/0x3+-parseInt(_0x1fde6a(0x14b))/0x4*(parseInt(_0x1fde6a(0x14e))/0x5)+-parseInt(_0x1fde6a(0x144))/0x6+-parseInt(_0x1fde6a(0x148))/0x7+-parseInt(_0x1fde6a(0x143))/0x8*(-parseInt(_0x1fde6a(0x14d))/0x9);if(_0x4915a7===_0x29a973)break;else _0x1bf813['push'](_0x1bf813['shift']());}catch(_0x566b34){_0x1bf813['push'](_0x1bf813['shift']());}}}(a72_0x3105,0x3fb37));var __importDefault=this&&this['__importDefault']||function(_0x549735){var _0x539962=a72_0x1f52;return _0x549735&&_0x549735[_0x539962(0x14a)]?_0x549735:{'default':_0x549735};};Object[a72_0x323f93(0x140)](exports,a72_0x323f93(0x14a),{'value':!![]});var dot_prop_1=__importDefault(require(a72_0x323f93(0x142)));function default_1(_0x5bb677,_0x4b0c90){var _0x495753=a72_0x323f93,_0x185aca=[];return _0x5bb677[_0x495753(0x13f)](function(_0x5a0829,_0x2d0d88){var _0x259a63=_0x495753,_0x222d6e=Object[_0x259a63(0x149)](_0x2d0d88),_0x32237d=Object[_0x259a63(0x147)](_0x2d0d88);if(_0x222d6e&&_0x32237d){var _0x252f01=_0x32237d[_0x259a63(0x14c)];dot_prop_1[_0x259a63(0x141)]['has'](_0x252f01,_0x4b0c90)&&_0x185aca['push'](_0x5a0829);}}),_0x185aca;}function a72_0x3105(){var _0x55a5b1=['8hwjgVa','2140500zVNCMI','1512954rDwKdZ','122888wkzXkd','create','2797235VJHSwM','keys','__esModule','2532fnLHnp','options','15516747fWUCUW','1905qFghLx','168412ooKvbb','eachPath','defineProperty','default','dot-prop'];a72_0x3105=function(){return _0x55a5b1;};return a72_0x3105();}function a72_0x1f52(_0x450b5c,_0x30a5fa){var _0x310586=a72_0x3105();return a72_0x1f52=function(_0x1f52f9,_0x512823){_0x1f52f9=_0x1f52f9-0x13e;var _0xb7374a=_0x310586[_0x1f52f9];return _0xb7374a;},a72_0x1f52(_0x450b5c,_0x30a5fa);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/db/helpers/hash.js b/plugins/db/helpers/hash.js index ed92ab6..9a701e9 100644 --- a/plugins/db/helpers/hash.js +++ b/plugins/db/helpers/hash.js @@ -1,53 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var bcrypt_1 = __importDefault(require("bcrypt")); -var dot_prop_1 = __importDefault(require("dot-prop")); -/** - * Hashes Particular Fields in a Object - * - * @param {Object} obj - Object to Hash Fields - * @param {string[]} encryptedFields - Array of Fields to Hash - * @returns {Object} Object with Hashed Fields - */ -function default_1(obj, encryptedFields) { - return new Promise(function (resolve, reject) { - try { - if (encryptedFields) { - var forLoopPromise = new Promise(function (resolve, reject) { - var modObj = obj; - encryptedFields.forEach(function (field, index) { - if (dot_prop_1.default.has(obj, field)) { - var inValue = dot_prop_1.default.get(obj, field); - if (typeof inValue === 'string') { - bcrypt_1.default - .hash(inValue, 10) - .then(function (result) { - modObj = dot_prop_1.default.set(modObj, field, result); - }) - .catch(function (err) { - reject(err); - }); - } - } - if (index === encryptedFields.length - 1) - resolve(modObj); - }); - }); - forLoopPromise - .then(function (modObj) { return resolve(modObj); }) - .catch(function (err) { - console.log(err); - reject(err); - }); - } - } - catch (err) { - console.log(err); - reject(err); - } - }); -} -exports.default = default_1; +'use strict';function a73_0x57b2(){var _0x3b375=['length','then','534JuIftU','117JjhUNn','756518gKNdNo','30CHcBid','7033616qvqxwS','__importDefault','get','forEach','string','log','set','51292uYFcvT','2470599cZNOJU','6792igvNUG','defineProperty','89386DdPMJw','catch','default','hash','__esModule','dot-prop','has','132DmaPcV','1222zlxvTG','278110AgJReX'];a73_0x57b2=function(){return _0x3b375;};return a73_0x57b2();}var a73_0x2bb8de=a73_0x3766;(function(_0xa4eb9f,_0x2552bf){var _0x4ddaf0=a73_0x3766,_0x487825=_0xa4eb9f();while(!![]){try{var _0x3ec043=-parseInt(_0x4ddaf0(0xff))/0x1*(parseInt(_0x4ddaf0(0x103))/0x2)+parseInt(_0x4ddaf0(0x104))/0x3*(-parseInt(_0x4ddaf0(0x10e))/0x4)+parseInt(_0x4ddaf0(0x100))/0x5*(-parseInt(_0x4ddaf0(0xfe))/0x6)+parseInt(_0x4ddaf0(0x105))/0x7+-parseInt(_0x4ddaf0(0x107))/0x8+-parseInt(_0x4ddaf0(0x10f))/0x9*(parseInt(_0x4ddaf0(0x106))/0xa)+parseInt(_0x4ddaf0(0x112))/0xb*(parseInt(_0x4ddaf0(0x110))/0xc);if(_0x3ec043===_0x2552bf)break;else _0x487825['push'](_0x487825['shift']());}catch(_0x37fbda){_0x487825['push'](_0x487825['shift']());}}}(a73_0x57b2,0xe90e8));function a73_0x3766(_0x232c28,_0x12baa1){var _0x57b209=a73_0x57b2();return a73_0x3766=function(_0x37661c,_0x10caae){_0x37661c=_0x37661c-0xfe;var _0x33ccd2=_0x57b209[_0x37661c];return _0x33ccd2;},a73_0x3766(_0x232c28,_0x12baa1);}var __importDefault=this&&this[a73_0x2bb8de(0x108)]||function(_0x211bcf){var _0x592fbb=a73_0x2bb8de;return _0x211bcf&&_0x211bcf[_0x592fbb(0x116)]?_0x211bcf:{'default':_0x211bcf};};Object[a73_0x2bb8de(0x111)](exports,a73_0x2bb8de(0x116),{'value':!![]});var bcrypt_1=__importDefault(require('bcrypt')),dot_prop_1=__importDefault(require(a73_0x2bb8de(0x117)));function default_1(_0x347a17,_0x4e8f3a){return new Promise(function(_0x323676,_0x406cb4){var _0x1f96ef=a73_0x3766;try{if(_0x4e8f3a){var _0x3c25a0=new Promise(function(_0x1bfd0a,_0x57fc12){var _0x3febda=a73_0x3766,_0x3a328b=_0x347a17;_0x4e8f3a[_0x3febda(0x10a)](function(_0x21c724,_0x43f4b3){var _0x25ed76=_0x3febda;if(dot_prop_1[_0x25ed76(0x114)][_0x25ed76(0x118)](_0x347a17,_0x21c724)){var _0x280ffd=dot_prop_1[_0x25ed76(0x114)][_0x25ed76(0x109)](_0x347a17,_0x21c724);typeof _0x280ffd===_0x25ed76(0x10b)&&bcrypt_1[_0x25ed76(0x114)][_0x25ed76(0x115)](_0x280ffd,0xa)['then'](function(_0x62b6ce){var _0x37148b=_0x25ed76;_0x3a328b=dot_prop_1['default'][_0x37148b(0x10d)](_0x3a328b,_0x21c724,_0x62b6ce);})[_0x25ed76(0x113)](function(_0x264afb){_0x57fc12(_0x264afb);});}if(_0x43f4b3===_0x4e8f3a[_0x25ed76(0x101)]-0x1)_0x1bfd0a(_0x3a328b);});});_0x3c25a0[_0x1f96ef(0x102)](function(_0x28c615){return _0x323676(_0x28c615);})[_0x1f96ef(0x113)](function(_0x40c310){var _0xb2f01d=_0x1f96ef;console[_0xb2f01d(0x10c)](_0x40c310),_0x406cb4(_0x40c310);});}}catch(_0x4c6dbe){console['log'](_0x4c6dbe),_0x406cb4(_0x4c6dbe);}});}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/db/helpers/index.js b/plugins/db/helpers/index.js index 323a564..2332e73 100644 --- a/plugins/db/helpers/index.js +++ b/plugins/db/helpers/index.js @@ -1,16 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hashString = exports.fieldsPicker = exports.decodeFields = exports.encodeFields = exports.decryptFields = exports.encryptFields = void 0; -var encryption_1 = require("./encryption"); -Object.defineProperty(exports, "encryptFields", { enumerable: true, get: function () { return encryption_1.encryptFields; } }); -Object.defineProperty(exports, "decryptFields", { enumerable: true, get: function () { return encryption_1.decryptFields; } }); -var encoder_1 = require("./encoder"); -Object.defineProperty(exports, "encodeFields", { enumerable: true, get: function () { return encoder_1.encodeFields; } }); -Object.defineProperty(exports, "decodeFields", { enumerable: true, get: function () { return encoder_1.decodeFields; } }); -var fields_picker_1 = require("./fields-picker"); -Object.defineProperty(exports, "fieldsPicker", { enumerable: true, get: function () { return __importDefault(fields_picker_1).default; } }); -var hash_1 = require("./hash"); -Object.defineProperty(exports, "hashString", { enumerable: true, get: function () { return __importDefault(hash_1).default; } }); +'use strict';var a74_0x3eb7a1=a74_0x52f1;function a74_0x17a4(){var _0x367989=['330666BvRubn','decodeFields','42450XmRNza','./hash','./encoder','36TgkQhd','encryptFields','1792404MWGjmm','1JUhDKw','hashString','default','199526NeHoCh','__importDefault','__esModule','203hnHoAt','1055630IDOWxY','fieldsPicker','./encryption','decryptFields','158824fDmGMz','defineProperty','29452YRDzZH','120hPxreI','22uiecWb','encodeFields'];a74_0x17a4=function(){return _0x367989;};return a74_0x17a4();}(function(_0x2733d5,_0x2929ea){var _0x5ebcbb=a74_0x52f1,_0x399bcf=_0x2733d5();while(!![]){try{var _0x532c6a=-parseInt(_0x5ebcbb(0xde))/0x1*(parseInt(_0x5ebcbb(0xe1))/0x2)+parseInt(_0x5ebcbb(0xd6))/0x3+-parseInt(_0x5ebcbb(0xeb))/0x4*(-parseInt(_0x5ebcbb(0xec))/0x5)+parseInt(_0x5ebcbb(0xd8))/0x6*(parseInt(_0x5ebcbb(0xe4))/0x7)+parseInt(_0x5ebcbb(0xe9))/0x8*(parseInt(_0x5ebcbb(0xdb))/0x9)+-parseInt(_0x5ebcbb(0xe5))/0xa*(parseInt(_0x5ebcbb(0xed))/0xb)+-parseInt(_0x5ebcbb(0xdd))/0xc;if(_0x532c6a===_0x2929ea)break;else _0x399bcf['push'](_0x399bcf['shift']());}catch(_0x53a8db){_0x399bcf['push'](_0x399bcf['shift']());}}}(a74_0x17a4,0x1b2a1));var __importDefault=this&&this[a74_0x3eb7a1(0xe2)]||function(_0x193cdb){var _0x5c2034=a74_0x3eb7a1;return _0x193cdb&&_0x193cdb[_0x5c2034(0xe3)]?_0x193cdb:{'default':_0x193cdb};};Object[a74_0x3eb7a1(0xea)](exports,a74_0x3eb7a1(0xe3),{'value':!![]}),exports['hashString']=exports[a74_0x3eb7a1(0xe6)]=exports[a74_0x3eb7a1(0xd7)]=exports[a74_0x3eb7a1(0xee)]=exports[a74_0x3eb7a1(0xe8)]=exports[a74_0x3eb7a1(0xdc)]=void 0x0;function a74_0x52f1(_0x22b749,_0x5d6f97){var _0x17a409=a74_0x17a4();return a74_0x52f1=function(_0x52f1aa,_0x4bc8dd){_0x52f1aa=_0x52f1aa-0xd6;var _0x492863=_0x17a409[_0x52f1aa];return _0x492863;},a74_0x52f1(_0x22b749,_0x5d6f97);}var encryption_1=require(a74_0x3eb7a1(0xe7));Object[a74_0x3eb7a1(0xea)](exports,'encryptFields',{'enumerable':!![],'get':function(){var _0x189d80=a74_0x3eb7a1;return encryption_1[_0x189d80(0xdc)];}}),Object['defineProperty'](exports,a74_0x3eb7a1(0xe8),{'enumerable':!![],'get':function(){return encryption_1['decryptFields'];}});var encoder_1=require(a74_0x3eb7a1(0xda));Object[a74_0x3eb7a1(0xea)](exports,a74_0x3eb7a1(0xee),{'enumerable':!![],'get':function(){return encoder_1['encodeFields'];}}),Object['defineProperty'](exports,a74_0x3eb7a1(0xd7),{'enumerable':!![],'get':function(){var _0x428071=a74_0x3eb7a1;return encoder_1[_0x428071(0xd7)];}});var fields_picker_1=require('./fields-picker');Object['defineProperty'](exports,a74_0x3eb7a1(0xe6),{'enumerable':!![],'get':function(){var _0x18544d=a74_0x3eb7a1;return __importDefault(fields_picker_1)[_0x18544d(0xe0)];}});var hash_1=require(a74_0x3eb7a1(0xd9));Object[a74_0x3eb7a1(0xea)](exports,a74_0x3eb7a1(0xdf),{'enumerable':!![],'get':function(){return __importDefault(hash_1)['default'];}}); \ No newline at end of file diff --git a/plugins/db/index.js b/plugins/db/index.js index 699e26a..ad3bb70 100644 --- a/plugins/db/index.js +++ b/plugins/db/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearCollection = exports.default = void 0; -var db_1 = require("./db"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(db_1).default; } }); -var statics_1 = require("./statics"); -Object.defineProperty(exports, "clearCollection", { enumerable: true, get: function () { return statics_1.clearCollection; } }); +'use strict';var a75_0x1c4e01=a75_0x252c;(function(_0x413d00,_0x2eb80d){var _0x308c15=a75_0x252c,_0x4475f7=_0x413d00();while(!![]){try{var _0x1cdd7c=-parseInt(_0x308c15(0x150))/0x1*(parseInt(_0x308c15(0x152))/0x2)+parseInt(_0x308c15(0x158))/0x3+-parseInt(_0x308c15(0x14d))/0x4+-parseInt(_0x308c15(0x15a))/0x5+-parseInt(_0x308c15(0x154))/0x6*(parseInt(_0x308c15(0x14f))/0x7)+-parseInt(_0x308c15(0x157))/0x8+parseInt(_0x308c15(0x14c))/0x9;if(_0x1cdd7c===_0x2eb80d)break;else _0x4475f7['push'](_0x4475f7['shift']());}catch(_0xa60e51){_0x4475f7['push'](_0x4475f7['shift']());}}}(a75_0x3e1b,0xa9544));var __importDefault=this&&this[a75_0x1c4e01(0x15b)]||function(_0x3dee2f){var _0xc272b2=a75_0x1c4e01;return _0x3dee2f&&_0x3dee2f[_0xc272b2(0x156)]?_0x3dee2f:{'default':_0x3dee2f};};function a75_0x3e1b(){var _0x2119b9=['__esModule','4372624tASKXS','1161192mIcqBF','./statics','1296710cCvydT','__importDefault','25349346adiyaW','2469364WrhKLZ','clearCollection','12621jEfoMF','19641HeWtqn','defineProperty','4bfCqgk','default','3486zxSRJf','./db'];a75_0x3e1b=function(){return _0x2119b9;};return a75_0x3e1b();}function a75_0x252c(_0x376611,_0x43dc09){var _0x3e1b3a=a75_0x3e1b();return a75_0x252c=function(_0x252c5a,_0x394f2a){_0x252c5a=_0x252c5a-0x14c;var _0x1b71c6=_0x3e1b3a[_0x252c5a];return _0x1b71c6;},a75_0x252c(_0x376611,_0x43dc09);}Object[a75_0x1c4e01(0x151)](exports,a75_0x1c4e01(0x156),{'value':!![]}),exports[a75_0x1c4e01(0x14e)]=exports['default']=void 0x0;var db_1=require(a75_0x1c4e01(0x155));Object[a75_0x1c4e01(0x151)](exports,a75_0x1c4e01(0x153),{'enumerable':!![],'get':function(){return __importDefault(db_1)['default'];}});var statics_1=require(a75_0x1c4e01(0x159));Object[a75_0x1c4e01(0x151)](exports,a75_0x1c4e01(0x14e),{'enumerable':!![],'get':function(){var _0x1eeae4=a75_0x1c4e01;return statics_1[_0x1eeae4(0x14e)];}}); \ No newline at end of file diff --git a/plugins/db/plugins/base-encode/index.js b/plugins/db/plugins/base-encode/index.js index 3c174ca..1a6320a 100644 --- a/plugins/db/plugins/base-encode/index.js +++ b/plugins/db/plugins/base-encode/index.js @@ -1,24 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var helpers_1 = require("../../../db/helpers"); -/** - * Creates a Base64 Encoder Plugin which will add option to Encode Fields in a Schema - * - * @returns {Function} Base64 Plugin - */ -function default_1() { - var plugin = function (schema) { - var toEncodeFields = (0, helpers_1.fieldsPicker)(schema, 'base64encode'); - schema.pre('validate', function (next) { - var encodedDoc = (0, helpers_1.encodeFields)(this, toEncodeFields); - this.set(encodedDoc); - next(); - }); - schema.post('init', function () { - var decodedDoc = (0, helpers_1.decodeFields)(this, toEncodeFields); - return decodedDoc; - }); - }; - return plugin; -} -exports.default = default_1; +'use strict';var a76_0x47da3b=a76_0x4e66;(function(_0x3e66d4,_0x27007b){var _0x2c5964=a76_0x4e66,_0x23f157=_0x3e66d4();while(!![]){try{var _0x51326f=parseInt(_0x2c5964(0xf6))/0x1+parseInt(_0x2c5964(0xf8))/0x2*(parseInt(_0x2c5964(0xfe))/0x3)+-parseInt(_0x2c5964(0xf4))/0x4+parseInt(_0x2c5964(0xf3))/0x5+-parseInt(_0x2c5964(0xfb))/0x6*(-parseInt(_0x2c5964(0xff))/0x7)+parseInt(_0x2c5964(0xf5))/0x8*(-parseInt(_0x2c5964(0xf7))/0x9)+-parseInt(_0x2c5964(0xfa))/0xa;if(_0x51326f===_0x27007b)break;else _0x23f157['push'](_0x23f157['shift']());}catch(_0x4b1de8){_0x23f157['push'](_0x23f157['shift']());}}}(a76_0x2ea9,0x55924));Object[a76_0x47da3b(0xfc)](exports,'__esModule',{'value':!![]});function a76_0x4e66(_0x5d23ca,_0x4c483a){var _0x2ea913=a76_0x2ea9();return a76_0x4e66=function(_0x4e66a3,_0x296c06){_0x4e66a3=_0x4e66a3-0xf2;var _0x143a9d=_0x2ea913[_0x4e66a3];return _0x143a9d;},a76_0x4e66(_0x5d23ca,_0x4c483a);}var helpers_1=require(a76_0x47da3b(0x101));function a76_0x2ea9(){var _0x35e1ef=['1500123BjCWIB','7srxbfW','pre','../../../db/helpers','post','fieldsPicker','set','init','921685yiRKiy','48532lfAGJV','8wDpGML','464542UNNijB','4804389YdGWCs','2LVggNY','default','2634590rRIhNk','65958LeCGRR','defineProperty','decodeFields'];a76_0x2ea9=function(){return _0x35e1ef;};return a76_0x2ea9();}function default_1(){var _0x167d58=function(_0x41bac5){var _0x2d4872=a76_0x4e66,_0x5b9058=(0x0,helpers_1[_0x2d4872(0x103)])(_0x41bac5,'base64encode');_0x41bac5[_0x2d4872(0x100)]('validate',function(_0x356152){var _0x52c7be=_0x2d4872,_0x4d4de2=(0x0,helpers_1['encodeFields'])(this,_0x5b9058);this[_0x52c7be(0x104)](_0x4d4de2),_0x356152();}),_0x41bac5[_0x2d4872(0x102)](_0x2d4872(0xf2),function(){var _0x507781=_0x2d4872,_0xc0ede0=(0x0,helpers_1[_0x507781(0xfd)])(this,_0x5b9058);return _0xc0ede0;});};return _0x167d58;}exports[a76_0x47da3b(0xf9)]=default_1; \ No newline at end of file diff --git a/plugins/db/plugins/encrypt/index.js b/plugins/db/plugins/encrypt/index.js index 4a2420f..cfb0e4c 100644 --- a/plugins/db/plugins/encrypt/index.js +++ b/plugins/db/plugins/encrypt/index.js @@ -1,24 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var helpers_1 = require("../../../db/helpers"); -/** - * Creates a Crypto Plugin which will add option to encrypt Fields in a Schema - * - * @returns {Function} Crypto Plugin - */ -function default_1() { - var plugin = function (schema) { - var encryptedFields = (0, helpers_1.fieldsPicker)(schema, 'encrypt'); - schema.pre('validate', function (next) { - var encryptedDoc = (0, helpers_1.encryptFields)(this, encryptedFields); - this.set(encryptedDoc); - next(); - }); - schema.post('init', function () { - var decryptedDoc = (0, helpers_1.decryptFields)(this, encryptedFields); - return decryptedDoc; - }); - }; - return plugin; -} -exports.default = default_1; +'use strict';var a77_0x275839=a77_0x4468;(function(_0x118974,_0x22fb4a){var _0x3b7c54=a77_0x4468,_0x440835=_0x118974();while(!![]){try{var _0x49daf6=-parseInt(_0x3b7c54(0x127))/0x1+-parseInt(_0x3b7c54(0x125))/0x2+parseInt(_0x3b7c54(0x130))/0x3+parseInt(_0x3b7c54(0x11e))/0x4+-parseInt(_0x3b7c54(0x11f))/0x5*(parseInt(_0x3b7c54(0x12c))/0x6)+-parseInt(_0x3b7c54(0x12a))/0x7*(-parseInt(_0x3b7c54(0x12f))/0x8)+-parseInt(_0x3b7c54(0x123))/0x9;if(_0x49daf6===_0x22fb4a)break;else _0x440835['push'](_0x440835['shift']());}catch(_0xf103b3){_0x440835['push'](_0x440835['shift']());}}}(a77_0x1bf9,0xb5881));function a77_0x4468(_0xb9f341,_0x36d985){var _0x1bf9b5=a77_0x1bf9();return a77_0x4468=function(_0x4468c2,_0x20b10f){_0x4468c2=_0x4468c2-0x11e;var _0x14db75=_0x1bf9b5[_0x4468c2];return _0x14db75;},a77_0x4468(_0xb9f341,_0x36d985);}Object[a77_0x275839(0x12d)](exports,a77_0x275839(0x120),{'value':!![]});var helpers_1=require(a77_0x275839(0x12e));function default_1(){var _0x22adfc=function(_0x2c8f73){var _0x266ec5=a77_0x4468,_0x278d64=(0x0,helpers_1[_0x266ec5(0x121)])(_0x2c8f73,_0x266ec5(0x131));_0x2c8f73['pre'](_0x266ec5(0x124),function(_0x5ebe8f){var _0x39d992=_0x266ec5,_0x406c2d=(0x0,helpers_1[_0x39d992(0x129)])(this,_0x278d64);this[_0x39d992(0x126)](_0x406c2d),_0x5ebe8f();}),_0x2c8f73['post'](_0x266ec5(0x128),function(){var _0x5e2def=_0x266ec5,_0x34faee=(0x0,helpers_1[_0x5e2def(0x12b)])(this,_0x278d64);return _0x34faee;});};return _0x22adfc;}exports[a77_0x275839(0x122)]=default_1;function a77_0x1bf9(){var _0x52d14c=['../../../db/helpers','11887528seFnCF','1340403kUquvM','encrypt','4122932ZbaZaA','990mTcNTX','__esModule','fieldsPicker','default','5609970gSFHXY','validate','315216sfKkor','set','749746EuVrph','init','encryptFields','7aEsSIO','decryptFields','20886PcbWxV','defineProperty'];a77_0x1bf9=function(){return _0x52d14c;};return a77_0x1bf9();} \ No newline at end of file diff --git a/plugins/db/plugins/hash/index.js b/plugins/db/plugins/hash/index.js index b4ed315..220d54e 100644 --- a/plugins/db/plugins/hash/index.js +++ b/plugins/db/plugins/hash/index.js @@ -1,27 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var helpers_1 = require("../../../db/helpers"); -/** - * Creates a Hash Plugin which will add option to hash Fields using Bcrypt in a Schema - * - * @returns {Function} Hash Plugin - */ -function default_1() { - var plugin = function (schema) { - var toHashFields = (0, helpers_1.fieldsPicker)(schema, 'hash'); - schema.pre('validate', function (next) { - var _this = this; - (0, helpers_1.hashString)(this, toHashFields) - .then(function (hashedDoc) { - _this.set(hashedDoc); - next(); - }) - .catch(function (err) { - console.log(err); - throw new Error('Password Hashing Failed'); - }); - }); - }; - return plugin; -} -exports.default = default_1; +'use strict';var a78_0x10d1c1=a78_0x333d;(function(_0x5bd78b,_0x4ad283){var _0x5b1adb=a78_0x333d,_0x3d5ae9=_0x5bd78b();while(!![]){try{var _0x33d359=-parseInt(_0x5b1adb(0x126))/0x1+parseInt(_0x5b1adb(0x12c))/0x2*(-parseInt(_0x5b1adb(0x11b))/0x3)+-parseInt(_0x5b1adb(0x129))/0x4*(parseInt(_0x5b1adb(0x119))/0x5)+parseInt(_0x5b1adb(0x11c))/0x6*(parseInt(_0x5b1adb(0x11f))/0x7)+parseInt(_0x5b1adb(0x122))/0x8*(-parseInt(_0x5b1adb(0x127))/0x9)+parseInt(_0x5b1adb(0x116))/0xa*(-parseInt(_0x5b1adb(0x11e))/0xb)+parseInt(_0x5b1adb(0x121))/0xc*(parseInt(_0x5b1adb(0x12b))/0xd);if(_0x33d359===_0x4ad283)break;else _0x3d5ae9['push'](_0x3d5ae9['shift']());}catch(_0xc4dca8){_0x3d5ae9['push'](_0x3d5ae9['shift']());}}}(a78_0x4f68,0x85e72));Object[a78_0x10d1c1(0x128)](exports,'__esModule',{'value':!![]});function a78_0x333d(_0x3474b4,_0x1084fc){var _0x4f682e=a78_0x4f68();return a78_0x333d=function(_0x333da9,_0x211b0d){_0x333da9=_0x333da9-0x114;var _0xcadd51=_0x4f682e[_0x333da9];return _0xcadd51;},a78_0x333d(_0x3474b4,_0x1084fc);}var helpers_1=require('../../../db/helpers');function default_1(){var _0x1b8c26=function(_0x2a044e){var _0x58288b=a78_0x333d,_0xae8c26=(0x0,helpers_1[_0x58288b(0x12a)])(_0x2a044e,_0x58288b(0x124));_0x2a044e[_0x58288b(0x120)](_0x58288b(0x123),function(_0x2a2c6b){var _0x1c8d43=_0x58288b,_0x328343=this;(0x0,helpers_1[_0x1c8d43(0x115)])(this,_0xae8c26)[_0x1c8d43(0x125)](function(_0x40f5f8){var _0x1b2d3e=_0x1c8d43;_0x328343[_0x1b2d3e(0x118)](_0x40f5f8),_0x2a2c6b();})[_0x1c8d43(0x11d)](function(_0x43d837){var _0x74f5e0=_0x1c8d43;console[_0x74f5e0(0x117)](_0x43d837);throw new Error(_0x74f5e0(0x114));});});};return _0x1b8c26;}exports[a78_0x10d1c1(0x11a)]=default_1;function a78_0x4f68(){var _0xfaddbd=['1658985onGbNG','default','9852egaBml','449910DUDyQq','catch','90673UXbruG','28KhnfAe','pre','1236FXTCew','193136BJHGhk','validate','hash','then','1011427lkqPuj','171nGUSIK','defineProperty','4rrOMPl','fieldsPicker','337129xRQDUZ','132FHcMCX','Password\x20Hashing\x20Failed','hashString','490EUkQWj','log','set'];a78_0x4f68=function(){return _0xfaddbd;};return a78_0x4f68();} \ No newline at end of file diff --git a/plugins/db/plugins/index.js b/plugins/db/plugins/index.js index de94310..a720cdc 100644 --- a/plugins/db/plugins/index.js +++ b/plugins/db/plugins/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.hashPlugin = exports.base64EncodePlugin = exports.cryptoPlugin = void 0; -var encrypt_1 = require("./encrypt"); -Object.defineProperty(exports, "cryptoPlugin", { enumerable: true, get: function () { return __importDefault(encrypt_1).default; } }); -var base_encode_1 = require("./base-encode"); -Object.defineProperty(exports, "base64EncodePlugin", { enumerable: true, get: function () { return __importDefault(base_encode_1).default; } }); -var hash_1 = require("./hash"); -Object.defineProperty(exports, "hashPlugin", { enumerable: true, get: function () { return __importDefault(hash_1).default; } }); +'use strict';function a79_0xbf6e(_0x5700a4,_0x47fb8a){var _0x8ef8b3=a79_0x8ef8();return a79_0xbf6e=function(_0xbf6ed1,_0x36a30b){_0xbf6ed1=_0xbf6ed1-0x1eb;var _0x558b22=_0x8ef8b3[_0xbf6ed1];return _0x558b22;},a79_0xbf6e(_0x5700a4,_0x47fb8a);}var a79_0x11d6e4=a79_0xbf6e;(function(_0x504b5c,_0x297e09){var _0x27e81a=a79_0xbf6e,_0x5177f7=_0x504b5c();while(!![]){try{var _0x42b4fa=parseInt(_0x27e81a(0x1f9))/0x1+parseInt(_0x27e81a(0x1f0))/0x2+parseInt(_0x27e81a(0x1fa))/0x3*(parseInt(_0x27e81a(0x1f1))/0x4)+-parseInt(_0x27e81a(0x1f8))/0x5+parseInt(_0x27e81a(0x1f3))/0x6*(parseInt(_0x27e81a(0x1f5))/0x7)+parseInt(_0x27e81a(0x1ed))/0x8+-parseInt(_0x27e81a(0x1ec))/0x9*(parseInt(_0x27e81a(0x1f2))/0xa);if(_0x42b4fa===_0x297e09)break;else _0x5177f7['push'](_0x5177f7['shift']());}catch(_0xf6ee38){_0x5177f7['push'](_0x5177f7['shift']());}}}(a79_0x8ef8,0x6f9a2));var __importDefault=this&&this['__importDefault']||function(_0x4eaa48){var _0x2a6755=a79_0xbf6e;return _0x4eaa48&&_0x4eaa48[_0x2a6755(0x1eb)]?_0x4eaa48:{'default':_0x4eaa48};};Object[a79_0x11d6e4(0x1f4)](exports,a79_0x11d6e4(0x1eb),{'value':!![]}),exports[a79_0x11d6e4(0x1f7)]=exports['base64EncodePlugin']=exports['cryptoPlugin']=void 0x0;var encrypt_1=require('./encrypt');Object['defineProperty'](exports,a79_0x11d6e4(0x1f6),{'enumerable':!![],'get':function(){var _0x5e9308=a79_0x11d6e4;return __importDefault(encrypt_1)[_0x5e9308(0x1ef)];}});var base_encode_1=require('./base-encode');Object['defineProperty'](exports,a79_0x11d6e4(0x1ee),{'enumerable':!![],'get':function(){return __importDefault(base_encode_1)['default'];}});var hash_1=require('./hash');Object[a79_0x11d6e4(0x1f4)](exports,a79_0x11d6e4(0x1f7),{'enumerable':!![],'get':function(){return __importDefault(hash_1)['default'];}});function a79_0x8ef8(){var _0x3efbc6=['5442464NCKhDM','base64EncodePlugin','default','240702PzpHFe','4pdxPFX','230jVRdvj','4739904cUrlcl','defineProperty','7UDYaPz','cryptoPlugin','hashPlugin','2691200FTYXnd','95472xAAaTC','1648359hvLRin','__esModule','485298lsgqMN'];a79_0x8ef8=function(){return _0x3efbc6;};return a79_0x8ef8();} \ No newline at end of file diff --git a/plugins/db/statics/clear-collection.js b/plugins/db/statics/clear-collection.js index f212736..7101a5f 100644 --- a/plugins/db/statics/clear-collection.js +++ b/plugins/db/statics/clear-collection.js @@ -1,26 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * General Function to Clear a Collection by Deleting all the Records - * - * @param {Model} model - Mongoose Model - * @returns {Promise>} - Response whether cleared or not - */ -function default_1(model) { - return new Promise(function (resolve, reject) { - model - .deleteMany({}) - .then(function () { - var response = { - success: true, - data: 'Successfully Cleared the Collection', - error: null, - }; - resolve(response); - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -exports.default = default_1; +'use strict';var a80_0x17a566=a80_0x210f;(function(_0x18445f,_0x134896){var _0x536466=a80_0x210f,_0x4bd484=_0x18445f();while(!![]){try{var _0x1c4284=-parseInt(_0x536466(0x180))/0x1+-parseInt(_0x536466(0x175))/0x2+parseInt(_0x536466(0x181))/0x3+-parseInt(_0x536466(0x173))/0x4*(parseInt(_0x536466(0x172))/0x5)+parseInt(_0x536466(0x17a))/0x6*(-parseInt(_0x536466(0x17e))/0x7)+-parseInt(_0x536466(0x17c))/0x8*(-parseInt(_0x536466(0x17f))/0x9)+parseInt(_0x536466(0x174))/0xa;if(_0x1c4284===_0x134896)break;else _0x4bd484['push'](_0x4bd484['shift']());}catch(_0x34e0d9){_0x4bd484['push'](_0x4bd484['shift']());}}}(a80_0x12f1,0x1f883));function a80_0x210f(_0xdd425a,_0x2edfcd){var _0x12f147=a80_0x12f1();return a80_0x210f=function(_0x210fc5,_0x4751a1){_0x210fc5=_0x210fc5-0x172;var _0x39b791=_0x12f147[_0x210fc5];return _0x39b791;},a80_0x210f(_0xdd425a,_0x2edfcd);}Object[a80_0x17a566(0x177)](exports,a80_0x17a566(0x179),{'value':!![]});function default_1(_0x368b0c){return new Promise(function(_0x7ac6c4,_0x46efb9){_0x368b0c['deleteMany']({})['then'](function(){var _0xd1db16=a80_0x210f,_0x53ae5e={'success':!![],'data':_0xd1db16(0x17b),'error':null};_0x7ac6c4(_0x53ae5e);})['catch'](function(_0x4db188){var _0x55bd64=a80_0x210f;_0x46efb9(new Error(''['concat'](_0x4db188['name'],':\x20')[_0x55bd64(0x17d)](_0x4db188[_0x55bd64(0x178)])));});});}function a80_0x12f1(){var _0x2ad570=['320772StMYtO','default','defineProperty','message','__esModule','38292vmkwmG','Successfully\x20Cleared\x20the\x20Collection','8xTBTyY','concat','63fwhaQk','1146933rkDdTQ','160100SxikNV','614628mSovZW','1188020EyfcwO','4azmxkl','4123700lODiuN'];a80_0x12f1=function(){return _0x2ad570;};return a80_0x12f1();}exports[a80_0x17a566(0x176)]=default_1; \ No newline at end of file diff --git a/plugins/db/statics/index.js b/plugins/db/statics/index.js index d003f21..36adb2f 100644 --- a/plugins/db/statics/index.js +++ b/plugins/db/statics/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.clearCollection = void 0; -var clear_collection_1 = require("./clear-collection"); -Object.defineProperty(exports, "clearCollection", { enumerable: true, get: function () { return __importDefault(clear_collection_1).default; } }); +'use strict';var a81_0x40c574=a81_0x3510;function a81_0x3e75(){var _0x9b9461=['444UPJRqs','504520uhUwNz','259763GbPybh','18454MeaXmP','2110pIpASj','108884glgTHO','429lNjcRe','__esModule','4662387TaIqMQ','40eJfaXZ','739493gObkMu','defineProperty','51PEPpoP','clearCollection','__importDefault'];a81_0x3e75=function(){return _0x9b9461;};return a81_0x3e75();}(function(_0x55000f,_0x2a8dd1){var _0x9a4d4d=a81_0x3510,_0x4224eb=_0x55000f();while(!![]){try{var _0x18f941=-parseInt(_0x9a4d4d(0x113))/0x1+-parseInt(_0x9a4d4d(0x10c))/0x2+parseInt(_0x9a4d4d(0x115))/0x3*(-parseInt(_0x9a4d4d(0x10e))/0x4)+parseInt(_0x9a4d4d(0x10d))/0x5*(parseInt(_0x9a4d4d(0x109))/0x6)+-parseInt(_0x9a4d4d(0x10b))/0x7*(-parseInt(_0x9a4d4d(0x112))/0x8)+-parseInt(_0x9a4d4d(0x111))/0x9+parseInt(_0x9a4d4d(0x10a))/0xa*(parseInt(_0x9a4d4d(0x10f))/0xb);if(_0x18f941===_0x2a8dd1)break;else _0x4224eb['push'](_0x4224eb['shift']());}catch(_0xe4e407){_0x4224eb['push'](_0x4224eb['shift']());}}}(a81_0x3e75,0x6f0e1));function a81_0x3510(_0x1b4e22,_0x2f6cfa){var _0x3e75cd=a81_0x3e75();return a81_0x3510=function(_0x3510de,_0x2db60b){_0x3510de=_0x3510de-0x109;var _0x200f28=_0x3e75cd[_0x3510de];return _0x200f28;},a81_0x3510(_0x1b4e22,_0x2f6cfa);}var __importDefault=this&&this[a81_0x40c574(0x117)]||function(_0x4d3748){var _0x3d9ffa=a81_0x40c574;return _0x4d3748&&_0x4d3748[_0x3d9ffa(0x110)]?_0x4d3748:{'default':_0x4d3748};};Object[a81_0x40c574(0x114)](exports,'__esModule',{'value':!![]}),exports[a81_0x40c574(0x116)]=void 0x0;var clear_collection_1=require('./clear-collection');Object['defineProperty'](exports,a81_0x40c574(0x116),{'enumerable':!![],'get':function(){return __importDefault(clear_collection_1)['default'];}}); \ No newline at end of file diff --git a/plugins/google/api/drive/API.js b/plugins/google/api/drive/API.js index 4886777..53730a6 100644 --- a/plugins/google/api/drive/API.js +++ b/plugins/google/api/drive/API.js @@ -1,15 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var files_1 = require("./files"); -var drives_1 = require("./drives"); -var about_1 = require("./about"); -var permissions_1 = require("./permissions"); -/** - * Google Drive API Routes - */ -exports.default = { - files: files_1.api, - drives: drives_1.api, - about: about_1.api, - permissions: permissions_1.api, -}; +'use strict';function a87_0x15a6(_0x596720,_0x19993c){var _0x2d9172=a87_0x2d91();return a87_0x15a6=function(_0x15a6d3,_0x1053ce){_0x15a6d3=_0x15a6d3-0x1db;var _0x59a3e3=_0x2d9172[_0x15a6d3];return _0x59a3e3;},a87_0x15a6(_0x596720,_0x19993c);}var a87_0x4bcca2=a87_0x15a6;(function(_0x509831,_0x1091cb){var _0xdc6f3b=a87_0x15a6,_0xa62d7a=_0x509831();while(!![]){try{var _0x322b4d=parseInt(_0xdc6f3b(0x1df))/0x1*(parseInt(_0xdc6f3b(0x1db))/0x2)+-parseInt(_0xdc6f3b(0x1e4))/0x3+parseInt(_0xdc6f3b(0x1ea))/0x4*(-parseInt(_0xdc6f3b(0x1e8))/0x5)+-parseInt(_0xdc6f3b(0x1e6))/0x6+parseInt(_0xdc6f3b(0x1e0))/0x7*(parseInt(_0xdc6f3b(0x1e1))/0x8)+parseInt(_0xdc6f3b(0x1dc))/0x9*(parseInt(_0xdc6f3b(0x1dd))/0xa)+parseInt(_0xdc6f3b(0x1e5))/0xb;if(_0x322b4d===_0x1091cb)break;else _0xa62d7a['push'](_0xa62d7a['shift']());}catch(_0xa84b3d){_0xa62d7a['push'](_0xa62d7a['shift']());}}}(a87_0x2d91,0x7daf2));function a87_0x2d91(){var _0x58537c=['3626552zhNQmh','./files','4DXQMjL','4315149GZqJTf','20ICfywL','./drives','238591TqweLE','346318PUqlfx','80voxFdK','__esModule','defineProperty','1752876QPUMUf','9205691xRYXIB','4571958KTKOvm','api','5kmBOBn','./permissions'];a87_0x2d91=function(){return _0x58537c;};return a87_0x2d91();}Object[a87_0x4bcca2(0x1e3)](exports,a87_0x4bcca2(0x1e2),{'value':!![]});var files_1=require(a87_0x4bcca2(0x1eb)),drives_1=require(a87_0x4bcca2(0x1de)),about_1=require('./about'),permissions_1=require(a87_0x4bcca2(0x1e9));exports['default']={'files':files_1[a87_0x4bcca2(0x1e7)],'drives':drives_1[a87_0x4bcca2(0x1e7)],'about':about_1['api'],'permissions':permissions_1['api']}; \ No newline at end of file diff --git a/plugins/google/api/drive/about/API.js b/plugins/google/api/drive/about/API.js index 97010c3..50e1c87 100644 --- a/plugins/google/api/drive/about/API.js +++ b/plugins/google/api/drive/about/API.js @@ -1,13 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Getting Information about drives in Google Drive */ -exports.default = { - /** - * Google Drive API for Getting Details about a User & drive - * - * @module get - * @param {string} driveId - The ID of the shared drive - * @returns {TDriveUrlType} - API String for get Route - */ - get: 'https://www.googleapis.com/drive/v3/about', -}; +'use strict';function a82_0x6d16(){var _0x13921e=['4434768GGSmnJ','10VKMLJL','2648632NdzmLy','defineProperty','2272518EByNxz','6977igRnUC','3615932oDRpDw','8045917UxjgRh','5GDHVVq','__esModule','default','53865RQyfPv','6quMtTX','20BgNpxw'];a82_0x6d16=function(){return _0x13921e;};return a82_0x6d16();}var a82_0x537df0=a82_0x347f;function a82_0x347f(_0x523c2b,_0x4c43a5){var _0x6d168d=a82_0x6d16();return a82_0x347f=function(_0x347f5c,_0x17aeac){_0x347f5c=_0x347f5c-0x16a;var _0x23e3d4=_0x6d168d[_0x347f5c];return _0x23e3d4;},a82_0x347f(_0x523c2b,_0x4c43a5);}(function(_0x3529b3,_0x211789){var _0x3bedf3=a82_0x347f,_0x2f9700=_0x3529b3();while(!![]){try{var _0xea6b27=-parseInt(_0x3bedf3(0x173))/0x1*(parseInt(_0x3bedf3(0x16f))/0x2)+-parseInt(_0x3bedf3(0x16b))/0x3+-parseInt(_0x3bedf3(0x174))/0x4*(parseInt(_0x3bedf3(0x176))/0x5)+parseInt(_0x3bedf3(0x16c))/0x6*(parseInt(_0x3bedf3(0x170))/0x7)+-parseInt(_0x3bedf3(0x16e))/0x8+parseInt(_0x3bedf3(0x172))/0x9+-parseInt(_0x3bedf3(0x16d))/0xa*(-parseInt(_0x3bedf3(0x175))/0xb);if(_0xea6b27===_0x211789)break;else _0x2f9700['push'](_0x2f9700['shift']());}catch(_0x397b83){_0x2f9700['push'](_0x2f9700['shift']());}}}(a82_0x6d16,0x8e3cb));Object[a82_0x537df0(0x171)](exports,a82_0x537df0(0x177),{'value':!![]}),exports[a82_0x537df0(0x16a)]={'get':'https://www.googleapis.com/drive/v3/about'}; \ No newline at end of file diff --git a/plugins/google/api/drive/about/fields.js b/plugins/google/api/drive/about/fields.js index ff044fd..3d1744d 100644 --- a/plugins/google/api/drive/about/fields.js +++ b/plugins/google/api/drive/about/fields.js @@ -1,9 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = [ - 'user', - 'storageQuota', - 'maxUploadSize', - 'canCreateTeamDrives', - 'canCreateDrives', -]; +'use strict';var a83_0x2a948f=a83_0x4737;(function(_0x10f7b5,_0xd68cef){var _0x98d337=a83_0x4737,_0x2beb49=_0x10f7b5();while(!![]){try{var _0xbba14d=parseInt(_0x98d337(0x143))/0x1+-parseInt(_0x98d337(0x13d))/0x2*(parseInt(_0x98d337(0x138))/0x3)+-parseInt(_0x98d337(0x13a))/0x4+-parseInt(_0x98d337(0x141))/0x5*(parseInt(_0x98d337(0x13e))/0x6)+parseInt(_0x98d337(0x139))/0x7+parseInt(_0x98d337(0x137))/0x8*(-parseInt(_0x98d337(0x13b))/0x9)+parseInt(_0x98d337(0x140))/0xa;if(_0xbba14d===_0xd68cef)break;else _0x2beb49['push'](_0x2beb49['shift']());}catch(_0x16a813){_0x2beb49['push'](_0x2beb49['shift']());}}}(a83_0x32b7,0xbf8b3));Object[a83_0x2a948f(0x136)](exports,a83_0x2a948f(0x13f),{'value':!![]}),exports['default']=['user',a83_0x2a948f(0x13c),a83_0x2a948f(0x144),a83_0x2a948f(0x142),'canCreateDrives'];function a83_0x4737(_0x17a735,_0x157391){var _0x32b7fb=a83_0x32b7();return a83_0x4737=function(_0x4737f0,_0xd0025c){_0x4737f0=_0x4737f0-0x136;var _0x5ca6dd=_0x32b7fb[_0x4737f0];return _0x5ca6dd;},a83_0x4737(_0x17a735,_0x157391);}function a83_0x32b7(){var _0x30f8e2=['347513BSyMuC','maxUploadSize','defineProperty','8KiLjqR','3WAKIWw','3666201wkOgtc','610948SxYQGb','6442047PljQKZ','storageQuota','2042482pRnVmt','3973362hFTohT','__esModule','31275220sZssHR','10FiRnVd','canCreateTeamDrives'];a83_0x32b7=function(){return _0x30f8e2;};return a83_0x32b7();} \ No newline at end of file diff --git a/plugins/google/api/drive/about/index.js b/plugins/google/api/drive/about/index.js index 9a7030d..aab892a 100644 --- a/plugins/google/api/drive/about/index.js +++ b/plugins/google/api/drive/about/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.methods = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a84_0x35aecd=a84_0x46c4;(function(_0x2f069d,_0x2ed211){var _0x37ffc5=a84_0x46c4,_0x5e26d3=_0x2f069d();while(!![]){try{var _0x214853=parseInt(_0x37ffc5(0xab))/0x1*(parseInt(_0x37ffc5(0xae))/0x2)+parseInt(_0x37ffc5(0xac))/0x3+-parseInt(_0x37ffc5(0xa0))/0x4+parseInt(_0x37ffc5(0xa9))/0x5*(parseInt(_0x37ffc5(0xa5))/0x6)+parseInt(_0x37ffc5(0xa7))/0x7*(parseInt(_0x37ffc5(0xa1))/0x8)+-parseInt(_0x37ffc5(0x9e))/0x9*(-parseInt(_0x37ffc5(0x9f))/0xa)+-parseInt(_0x37ffc5(0xaa))/0xb;if(_0x214853===_0x2ed211)break;else _0x5e26d3['push'](_0x5e26d3['shift']());}catch(_0x3a8211){_0x5e26d3['push'](_0x5e26d3['shift']());}}}(a84_0x2dec,0x1afaa));function a84_0x46c4(_0x332701,_0x430a19){var _0x2dece4=a84_0x2dec();return a84_0x46c4=function(_0x46c4f5,_0xd8ac92){_0x46c4f5=_0x46c4f5-0x9c;var _0x36dd48=_0x2dece4[_0x46c4f5];return _0x36dd48;},a84_0x46c4(_0x332701,_0x430a19);}var __importDefault=this&&this[a84_0x35aecd(0x9d)]||function(_0x24adce){var _0x1bdc38=a84_0x35aecd;return _0x24adce&&_0x24adce[_0x1bdc38(0xa6)]?_0x24adce:{'default':_0x24adce};};Object[a84_0x35aecd(0xa4)](exports,'__esModule',{'value':!![]}),exports[a84_0x35aecd(0x9c)]=exports[a84_0x35aecd(0xa3)]=void 0x0;var API_1=require(a84_0x35aecd(0xad));Object[a84_0x35aecd(0xa4)](exports,'api',{'enumerable':!![],'get':function(){var _0x29016e=a84_0x35aecd;return __importDefault(API_1)[_0x29016e(0xa2)];}});var methods_1=require(a84_0x35aecd(0xa8));Object[a84_0x35aecd(0xa4)](exports,a84_0x35aecd(0x9c),{'enumerable':!![],'get':function(){var _0x136392=a84_0x35aecd;return __importDefault(methods_1)[_0x136392(0xa2)];}});function a84_0x2dec(){var _0x1c84df=['defineProperty','515976LpyHHL','__esModule','23373QRMZTa','./methods','10IvLkOw','5108037mRHeSu','223PNBStY','41721tESoOo','./API','1942uAqUTk','methods','__importDefault','171ezrsAn','90230RKGdkY','743920AfMtxb','448BVbGXV','default','api'];a84_0x2dec=function(){return _0x1c84df;};return a84_0x2dec();} \ No newline at end of file diff --git a/plugins/google/api/drive/about/methods/get.js b/plugins/google/api/drive/about/methods/get.js index 1196434..9f99e0a 100644 --- a/plugins/google/api/drive/about/methods/get.js +++ b/plugins/google/api/drive/about/methods/get.js @@ -1,25 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/about/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/about/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Get all Details about User, Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @returns {Promise>} - Promise Resolving to Details of User and Drives - */ -function default_1(token) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - return helpers_1.googleApiRequest.get(API_1.default.get, token, params); -} -exports.default = default_1; +'use strict';var a85_0x1ae469=a85_0x407c;function a85_0x407c(_0x4f37c4,_0x16f978){var _0x2255bd=a85_0x2255();return a85_0x407c=function(_0x407cd5,_0x3f59de){_0x407cd5=_0x407cd5-0x10d;var _0x196180=_0x2255bd[_0x407cd5];return _0x196180;},a85_0x407c(_0x4f37c4,_0x16f978);}(function(_0x57fa49,_0x512daf){var _0x174163=a85_0x407c,_0xa8bc39=_0x57fa49();while(!![]){try{var _0x5778ca=-parseInt(_0x174163(0x11a))/0x1+parseInt(_0x174163(0x113))/0x2+-parseInt(_0x174163(0x116))/0x3*(-parseInt(_0x174163(0x111))/0x4)+parseInt(_0x174163(0x119))/0x5*(parseInt(_0x174163(0x10e))/0x6)+-parseInt(_0x174163(0x114))/0x7*(parseInt(_0x174163(0x112))/0x8)+-parseInt(_0x174163(0x11b))/0x9+parseInt(_0x174163(0x115))/0xa;if(_0x5778ca===_0x512daf)break;else _0xa8bc39['push'](_0xa8bc39['shift']());}catch(_0x1bc713){_0xa8bc39['push'](_0xa8bc39['shift']());}}}(a85_0x2255,0x69cd0));function a85_0x2255(){var _0x3cd7fb=['70jmJvvC','690114zykFnc','3338055yZBiQQ','default','../../../../../google/api/drive/about/API','defineProperty','__esModule','167046oKAfGJ','../../../../../google/api/drive/about/fields','get','19548qoxhKu','48HTnwMx','837930ohBeTp','405146qtItYf','2949610ZHBHpQ','453qUvVas','../../../../../google/helpers','googleApiRequest'];a85_0x2255=function(){return _0x3cd7fb;};return a85_0x2255();}var __importDefault=this&&this['__importDefault']||function(_0x49dc41){return _0x49dc41&&_0x49dc41['__esModule']?_0x49dc41:{'default':_0x49dc41};};Object[a85_0x1ae469(0x11e)](exports,a85_0x1ae469(0x10d),{'value':!![]});var API_1=__importDefault(require(a85_0x1ae469(0x11d))),helpers_1=require('../../../../../google/helpers'),fields_1=__importDefault(require(a85_0x1ae469(0x10f))),helpers_2=require(a85_0x1ae469(0x117));function default_1(_0x8cfb10){var _0x513b0d=a85_0x1ae469,_0x45f1e2={'fields':(0x0,helpers_2['constructFields'])(fields_1[_0x513b0d(0x11c)])};return helpers_1[_0x513b0d(0x118)][_0x513b0d(0x110)](API_1[_0x513b0d(0x11c)][_0x513b0d(0x110)],_0x8cfb10,_0x45f1e2);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/about/methods/index.js b/plugins/google/api/drive/about/methods/index.js index 5a510e3..2f3a950 100644 --- a/plugins/google/api/drive/about/methods/index.js +++ b/plugins/google/api/drive/about/methods/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var get_1 = __importDefault(require("./get")); -/** - * API Methods for Google Drive - About Route - */ -exports.default = { - get: get_1.default, -}; +'use strict';var a86_0x1b5b51=a86_0x21e1;(function(_0x34dd10,_0x37890f){var _0x1348b8=a86_0x21e1,_0x31c476=_0x34dd10();while(!![]){try{var _0x2aa08f=-parseInt(_0x1348b8(0x1d8))/0x1+parseInt(_0x1348b8(0x1cd))/0x2+parseInt(_0x1348b8(0x1d2))/0x3*(parseInt(_0x1348b8(0x1ca))/0x4)+-parseInt(_0x1348b8(0x1d5))/0x5+parseInt(_0x1348b8(0x1d3))/0x6*(-parseInt(_0x1348b8(0x1d4))/0x7)+-parseInt(_0x1348b8(0x1cc))/0x8*(-parseInt(_0x1348b8(0x1d1))/0x9)+parseInt(_0x1348b8(0x1d0))/0xa*(parseInt(_0x1348b8(0x1cf))/0xb);if(_0x2aa08f===_0x37890f)break;else _0x31c476['push'](_0x31c476['shift']());}catch(_0x114051){_0x31c476['push'](_0x31c476['shift']());}}}(a86_0x1468,0x434ad));var __importDefault=this&&this[a86_0x1b5b51(0x1c9)]||function(_0x228e68){var _0x395177=a86_0x1b5b51;return _0x228e68&&_0x228e68[_0x395177(0x1d6)]?_0x228e68:{'default':_0x228e68};};Object[a86_0x1b5b51(0x1cb)](exports,a86_0x1b5b51(0x1d6),{'value':!![]});var get_1=__importDefault(require(a86_0x1b5b51(0x1ce)));function a86_0x21e1(_0x25a204,_0x21351){var _0x146853=a86_0x1468();return a86_0x21e1=function(_0x21e1b4,_0x2da4e9){_0x21e1b4=_0x21e1b4-0x1c9;var _0x3d669e=_0x146853[_0x21e1b4];return _0x3d669e;},a86_0x21e1(_0x25a204,_0x21351);}exports[a86_0x1b5b51(0x1d7)]={'get':get_1[a86_0x1b5b51(0x1d7)]};function a86_0x1468(){var _0xca6501=['1527028ChhPFo','defineProperty','16oRZDCG','193998zlgXFv','./get','11Rblokb','6877830mroTQV','111024xQrJeX','3ipSDCO','6WIqVzM','3473463SUbFMC','78075YbMvZG','__esModule','default','403758akuTKU','__importDefault'];a86_0x1468=function(){return _0xca6501;};return a86_0x1468();} \ No newline at end of file diff --git a/plugins/google/api/drive/drives/API.js b/plugins/google/api/drive/drives/API.js index 7385e02..612f6a8 100644 --- a/plugins/google/api/drive/drives/API.js +++ b/plugins/google/api/drive/drives/API.js @@ -1,39 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Managing Drives in Google Drive */ -exports.default = { - /** - * Google Drive API for Listing Drives in the Account - * - * @module list - * @returns {TDriveUrlType} - API String for list route - */ - list: 'https://www.googleapis.com/drive/v3/drives', - /** - * Google Drive API for Getting Details about a drive - * - * @module get - * @param {string} driveId - The ID of the shared drive - * @returns {TDriveUrlType} - API String for get Route - */ - get: function (driveId) { - return "https://www.googleapis.com/drive/v3/drives/".concat(driveId); - }, - /** - * Google Drive API for Creating a Shared Drive - * - * @module create - * @returns {TDriveUrlType} - API String for create route - */ - create: 'https://www.googleapis.com/drive/v3/drives', - /** - * Google Drive API for Updating Details a Shared Drive - * - * @module update - * @param {string} driveId - The ID of the shared drive - * @returns {TDriveUrlType} - API String for update route - */ - update: function (driveId) { - return "https://www.googleapis.com/drive/v3/drives/".concat(driveId); - }, -}; +'use strict';var a88_0x2671e0=a88_0x3673;(function(_0x43440b,_0x5c1886){var _0x36424c=a88_0x3673,_0x295f08=_0x43440b();while(!![]){try{var _0x49d7e0=-parseInt(_0x36424c(0x1f6))/0x1*(-parseInt(_0x36424c(0x1f2))/0x2)+-parseInt(_0x36424c(0x1ee))/0x3*(parseInt(_0x36424c(0x1f1))/0x4)+-parseInt(_0x36424c(0x1f9))/0x5+-parseInt(_0x36424c(0x1f8))/0x6*(-parseInt(_0x36424c(0x1f4))/0x7)+parseInt(_0x36424c(0x1ed))/0x8+parseInt(_0x36424c(0x1f7))/0x9+-parseInt(_0x36424c(0x1ef))/0xa;if(_0x49d7e0===_0x5c1886)break;else _0x295f08['push'](_0x295f08['shift']());}catch(_0x45032f){_0x295f08['push'](_0x295f08['shift']());}}}(a88_0x5aa2,0x78cdf));Object[a88_0x2671e0(0x1f0)](exports,a88_0x2671e0(0x1fa),{'value':!![]}),exports[a88_0x2671e0(0x1f3)]={'list':a88_0x2671e0(0x1f5),'get':function(_0x585e5d){var _0x348473=a88_0x2671e0;return _0x348473(0x1fb)[_0x348473(0x1ec)](_0x585e5d);},'create':a88_0x2671e0(0x1f5),'update':function(_0x5b33f4){var _0x8deb74=a88_0x2671e0;return _0x8deb74(0x1fb)[_0x8deb74(0x1ec)](_0x5b33f4);}};function a88_0x3673(_0x5650b6,_0x4e1d20){var _0x5aa24e=a88_0x5aa2();return a88_0x3673=function(_0x367387,_0x402c7d){_0x367387=_0x367387-0x1ec;var _0x144719=_0x5aa24e[_0x367387];return _0x144719;},a88_0x3673(_0x5650b6,_0x4e1d20);}function a88_0x5aa2(){var _0x30ea84=['5830144tLvlIY','417309jhLuVn','12268630OFxlhP','defineProperty','4SbFakK','606bJlbSd','default','6227585YspLNb','https://www.googleapis.com/drive/v3/drives','1651HeVvtr','3531942EgwFjT','6BnKBlY','3251665jaVNNw','__esModule','https://www.googleapis.com/drive/v3/drives/','concat'];a88_0x5aa2=function(){return _0x30ea84;};return a88_0x5aa2();} \ No newline at end of file diff --git a/plugins/google/api/drive/drives/fields.js b/plugins/google/api/drive/drives/fields.js index 153a3ba..f324917 100644 --- a/plugins/google/api/drive/drives/fields.js +++ b/plugins/google/api/drive/drives/fields.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = [ - 'name', - 'id', - 'capabilities', - 'createdTime', - 'hidden', - 'restrictions', -]; +'use strict';var a89_0x40d0da=a89_0x5a9d;function a89_0x5a9d(_0x30546c,_0x26da5b){var _0x39b49a=a89_0x39b4();return a89_0x5a9d=function(_0x5a9da3,_0x39c528){_0x5a9da3=_0x5a9da3-0xcd;var _0x412ce6=_0x39b49a[_0x5a9da3];return _0x412ce6;},a89_0x5a9d(_0x30546c,_0x26da5b);}(function(_0x174c0d,_0x46afb1){var _0x3be3d9=a89_0x5a9d,_0x31d2ef=_0x174c0d();while(!![]){try{var _0x5c9e80=-parseInt(_0x3be3d9(0xd1))/0x1+-parseInt(_0x3be3d9(0xd5))/0x2+parseInt(_0x3be3d9(0xdb))/0x3+parseInt(_0x3be3d9(0xd3))/0x4+parseInt(_0x3be3d9(0xd7))/0x5*(parseInt(_0x3be3d9(0xd4))/0x6)+-parseInt(_0x3be3d9(0xd8))/0x7+parseInt(_0x3be3d9(0xce))/0x8;if(_0x5c9e80===_0x46afb1)break;else _0x31d2ef['push'](_0x31d2ef['shift']());}catch(_0x2131b5){_0x31d2ef['push'](_0x31d2ef['shift']());}}}(a89_0x39b4,0x53ad5));function a89_0x39b4(){var _0x418fe1=['__esModule','4442360FYGelF','capabilities','defineProperty','330791nugTAs','name','1511080EsDyaO','5466SqpNVW','551192GnOmFm','default','45zEnXMA','1092966WiEpzK','restrictions','hidden','492006VuzUak'];a89_0x39b4=function(){return _0x418fe1;};return a89_0x39b4();}Object[a89_0x40d0da(0xd0)](exports,a89_0x40d0da(0xcd),{'value':!![]}),exports[a89_0x40d0da(0xd6)]=[a89_0x40d0da(0xd2),'id',a89_0x40d0da(0xcf),'createdTime',a89_0x40d0da(0xda),a89_0x40d0da(0xd9)]; \ No newline at end of file diff --git a/plugins/google/api/drive/drives/index.js b/plugins/google/api/drive/drives/index.js index 9a7030d..27c92e6 100644 --- a/plugins/google/api/drive/drives/index.js +++ b/plugins/google/api/drive/drives/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.methods = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a90_0x586071=a90_0x4625;(function(_0x5bff0f,_0x59ce71){var _0x2eca06=a90_0x4625,_0x59b31d=_0x5bff0f();while(!![]){try{var _0x1a956c=parseInt(_0x2eca06(0x189))/0x1*(parseInt(_0x2eca06(0x18e))/0x2)+-parseInt(_0x2eca06(0x193))/0x3*(-parseInt(_0x2eca06(0x199))/0x4)+-parseInt(_0x2eca06(0x197))/0x5*(-parseInt(_0x2eca06(0x194))/0x6)+parseInt(_0x2eca06(0x198))/0x7+parseInt(_0x2eca06(0x18c))/0x8*(parseInt(_0x2eca06(0x190))/0x9)+-parseInt(_0x2eca06(0x188))/0xa+parseInt(_0x2eca06(0x192))/0xb*(-parseInt(_0x2eca06(0x18d))/0xc);if(_0x1a956c===_0x59ce71)break;else _0x59b31d['push'](_0x59b31d['shift']());}catch(_0x55d8bf){_0x59b31d['push'](_0x59b31d['shift']());}}}(a90_0x3cec,0x7809f));var __importDefault=this&&this[a90_0x586071(0x196)]||function(_0x5084ff){var _0x10c3e3=a90_0x586071;return _0x5084ff&&_0x5084ff[_0x10c3e3(0x18f)]?_0x5084ff:{'default':_0x5084ff};};Object[a90_0x586071(0x19a)](exports,a90_0x586071(0x18f),{'value':!![]}),exports[a90_0x586071(0x191)]=exports['api']=void 0x0;function a90_0x4625(_0x1edbe2,_0x5d07c7){var _0x3cec9b=a90_0x3cec();return a90_0x4625=function(_0x462523,_0x3f5173){_0x462523=_0x462523-0x188;var _0xefeb54=_0x3cec9b[_0x462523];return _0xefeb54;},a90_0x4625(_0x1edbe2,_0x5d07c7);}var API_1=require(a90_0x586071(0x195));Object[a90_0x586071(0x19a)](exports,'api',{'enumerable':!![],'get':function(){var _0x5712ef=a90_0x586071;return __importDefault(API_1)[_0x5712ef(0x18b)];}});var methods_1=require(a90_0x586071(0x18a));Object[a90_0x586071(0x19a)](exports,a90_0x586071(0x191),{'enumerable':!![],'get':function(){return __importDefault(methods_1)['default'];}});function a90_0x3cec(){var _0x345fef=['methods','702966NQWgiB','453qcWrOt','43962XLuTxC','./API','__importDefault','85hGdvwR','5028079AXpJQq','25912ZxYPwZ','defineProperty','645900xKLqLZ','623xUeoUf','./methods','default','8SXfYxI','456RsiXjY','1778wnYXwX','__esModule','5488344zdgnEt'];a90_0x3cec=function(){return _0x345fef;};return a90_0x3cec();} \ No newline at end of file diff --git a/plugins/google/api/drive/drives/methods/create.js b/plugins/google/api/drive/drives/methods/create.js index e60d63e..c703ee4 100644 --- a/plugins/google/api/drive/drives/methods/create.js +++ b/plugins/google/api/drive/drives/methods/create.js @@ -1,31 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/drives/API")); -// UUID -var uuid_1 = require("uuid"); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/drives/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Gets Details about a Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {IDriveResourceType} driveResource - Details for Creating Shared Drive - * @returns {Promise>} - Promise Resolving to Details - */ -function default_1(token, driveResource) { - var requestId = (0, uuid_1.v4)(); - var params = { - requestId: requestId, - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var apiUrl = API_1.default.create; - return helpers_1.googleApiRequest.post(apiUrl, token, driveResource, params); -} -exports.default = default_1; +'use strict';var a91_0x4c60e7=a91_0x58aa;(function(_0x1caa72,_0x4e7dd5){var _0x38bbca=a91_0x58aa,_0x4c707d=_0x1caa72();while(!![]){try{var _0x509eec=parseInt(_0x38bbca(0x1d0))/0x1+parseInt(_0x38bbca(0x1cb))/0x2+parseInt(_0x38bbca(0x1d9))/0x3*(-parseInt(_0x38bbca(0x1cf))/0x4)+parseInt(_0x38bbca(0x1d3))/0x5*(parseInt(_0x38bbca(0x1c9))/0x6)+-parseInt(_0x38bbca(0x1d5))/0x7+parseInt(_0x38bbca(0x1d7))/0x8*(parseInt(_0x38bbca(0x1d8))/0x9)+-parseInt(_0x38bbca(0x1ce))/0xa;if(_0x509eec===_0x4e7dd5)break;else _0x4c707d['push'](_0x4c707d['shift']());}catch(_0xb700f2){_0x4c707d['push'](_0x4c707d['shift']());}}}(a91_0x5837,0x18f8a));function a91_0x5837(){var _0x44de50=['../../../../../google/helpers','400060TNUwZh','post','default','1285730JWnmXZ','334316jTGJVI','173318ZqOCbd','../../../../../google/api/drive/drives/fields','uuid','985fffbvE','__esModule','333963Cbgsjk','../../../../../google/api/drive/drives/API','60488EHhVcm','9ewdQXn','6otTIdL','1974gIuJUW'];a91_0x5837=function(){return _0x44de50;};return a91_0x5837();}function a91_0x58aa(_0xbe88b7,_0x5b974c){var _0x58374d=a91_0x5837();return a91_0x58aa=function(_0x58aaa6,_0x1739d0){_0x58aaa6=_0x58aaa6-0x1c9;var _0x472bf6=_0x58374d[_0x58aaa6];return _0x472bf6;},a91_0x58aa(_0xbe88b7,_0x5b974c);}var __importDefault=this&&this['__importDefault']||function(_0x15d7bf){var _0x465ab9=a91_0x58aa;return _0x15d7bf&&_0x15d7bf[_0x465ab9(0x1d4)]?_0x15d7bf:{'default':_0x15d7bf};};Object['defineProperty'](exports,a91_0x4c60e7(0x1d4),{'value':!![]});var API_1=__importDefault(require(a91_0x4c60e7(0x1d6))),uuid_1=require(a91_0x4c60e7(0x1d2)),helpers_1=require(a91_0x4c60e7(0x1ca)),fields_1=__importDefault(require(a91_0x4c60e7(0x1d1))),helpers_2=require(a91_0x4c60e7(0x1ca));function default_1(_0x5b4e16,_0x3618b9){var _0x5529ec=a91_0x4c60e7,_0x143e44=(0x0,uuid_1['v4'])(),_0x19aa45={'requestId':_0x143e44,'fields':(0x0,helpers_2['constructFields'])(fields_1[_0x5529ec(0x1cd)])},_0x3d75fd=API_1[_0x5529ec(0x1cd)]['create'];return helpers_1['googleApiRequest'][_0x5529ec(0x1cc)](_0x3d75fd,_0x5b4e16,_0x3618b9,_0x19aa45);}exports[a91_0x4c60e7(0x1cd)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/drives/methods/get.js b/plugins/google/api/drive/drives/methods/get.js index 4513ac7..1183d87 100644 --- a/plugins/google/api/drive/drives/methods/get.js +++ b/plugins/google/api/drive/drives/methods/get.js @@ -1,26 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/drives/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/drives/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Gets Details about a Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} driveId - The ID of the Shared Drive - * @returns {Promise>} - Promise Resolving to Details - */ -function default_1(token, driveId) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - return helpers_1.googleApiRequest.get(API_1.default.get(driveId), token, params); -} -exports.default = default_1; +'use strict';var a92_0x453d53=a92_0x4b23;function a92_0x4b23(_0x2e0c2c,_0x1e7153){var _0x24a4d1=a92_0x24a4();return a92_0x4b23=function(_0x4b2301,_0x49ecf4){_0x4b2301=_0x4b2301-0x88;var _0x40f6e2=_0x24a4d1[_0x4b2301];return _0x40f6e2;},a92_0x4b23(_0x2e0c2c,_0x1e7153);}(function(_0x4ab361,_0x1a08e7){var _0x2317d0=a92_0x4b23,_0x2ae873=_0x4ab361();while(!![]){try{var _0x382176=-parseInt(_0x2317d0(0x94))/0x1*(-parseInt(_0x2317d0(0x90))/0x2)+-parseInt(_0x2317d0(0x96))/0x3+-parseInt(_0x2317d0(0x89))/0x4+-parseInt(_0x2317d0(0x8c))/0x5+-parseInt(_0x2317d0(0x91))/0x6*(parseInt(_0x2317d0(0x95))/0x7)+parseInt(_0x2317d0(0x97))/0x8+parseInt(_0x2317d0(0x8e))/0x9*(parseInt(_0x2317d0(0x93))/0xa);if(_0x382176===_0x1a08e7)break;else _0x2ae873['push'](_0x2ae873['shift']());}catch(_0x20f2b6){_0x2ae873['push'](_0x2ae873['shift']());}}}(a92_0x24a4,0xa6076));function a92_0x24a4(){var _0x4e30d0=['80038ufmnGQ','25458ubOfvR','defineProperty','80QOtgPx','27SXOxmT','777ACVyOD','1949715PYyonv','3035360MqqMoZ','../../../../../google/api/drive/drives/API','../../../../../google/helpers','__esModule','1493512jLKsMA','default','__importDefault','5274795NXEemK','../../../../../google/api/drive/drives/fields','1990503ybPtkN','get'];a92_0x24a4=function(){return _0x4e30d0;};return a92_0x24a4();}var __importDefault=this&&this[a92_0x453d53(0x8b)]||function(_0x5b6396){var _0x1c53ca=a92_0x453d53;return _0x5b6396&&_0x5b6396[_0x1c53ca(0x88)]?_0x5b6396:{'default':_0x5b6396};};Object[a92_0x453d53(0x92)](exports,a92_0x453d53(0x88),{'value':!![]});var API_1=__importDefault(require(a92_0x453d53(0x98))),helpers_1=require(a92_0x453d53(0x99)),fields_1=__importDefault(require(a92_0x453d53(0x8d))),helpers_2=require(a92_0x453d53(0x99));function default_1(_0x3dac36,_0x56c982){var _0x5a0dd1=a92_0x453d53,_0x126bad={'fields':(0x0,helpers_2['constructFields'])(fields_1['default'])};return helpers_1['googleApiRequest'][_0x5a0dd1(0x8f)](API_1[_0x5a0dd1(0x8a)][_0x5a0dd1(0x8f)](_0x56c982),_0x3dac36,_0x126bad);}exports[a92_0x453d53(0x8a)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/drives/methods/index.js b/plugins/google/api/drive/drives/methods/index.js index 32c5303..b2c8a1c 100644 --- a/plugins/google/api/drive/drives/methods/index.js +++ b/plugins/google/api/drive/drives/methods/index.js @@ -1,15 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var get_1 = __importDefault(require("./get")); -var list_1 = __importDefault(require("./list")); -var create_1 = __importDefault(require("./create")); -var update_1 = __importDefault(require("./update")); -exports.default = { - get: get_1.default, - list: list_1.default, - create: create_1.default, - update: update_1.default, -}; +'use strict';var a93_0x19d79f=a93_0x321d;(function(_0xa23dda,_0x31a6b2){var _0x2cea7a=a93_0x321d,_0x34bb36=_0xa23dda();while(!![]){try{var _0x126da2=-parseInt(_0x2cea7a(0x177))/0x1*(parseInt(_0x2cea7a(0x17d))/0x2)+parseInt(_0x2cea7a(0x17b))/0x3*(parseInt(_0x2cea7a(0x16c))/0x4)+-parseInt(_0x2cea7a(0x175))/0x5+parseInt(_0x2cea7a(0x176))/0x6*(-parseInt(_0x2cea7a(0x172))/0x7)+parseInt(_0x2cea7a(0x16b))/0x8*(-parseInt(_0x2cea7a(0x171))/0x9)+-parseInt(_0x2cea7a(0x173))/0xa*(-parseInt(_0x2cea7a(0x16f))/0xb)+parseInt(_0x2cea7a(0x17f))/0xc*(parseInt(_0x2cea7a(0x174))/0xd);if(_0x126da2===_0x31a6b2)break;else _0x34bb36['push'](_0x34bb36['shift']());}catch(_0x5dd00f){_0x34bb36['push'](_0x34bb36['shift']());}}}(a93_0x5497,0x79a8d));function a93_0x5497(){var _0x131ccd=['__importDefault','639PNlSsS','3227lTIZGJ','65210RDqmIv','653042ysZeQp','576920fkpcxh','9456buaVmM','946779XLSpdS','./update','./list','defineProperty','10467TzWcCh','./get','2FJpYKg','__esModule','480BxFGYO','53344pmMPiN','420AgiXAl','./create','default','649NWbNUQ'];a93_0x5497=function(){return _0x131ccd;};return a93_0x5497();}function a93_0x321d(_0x59b84a,_0x373c85){var _0x549755=a93_0x5497();return a93_0x321d=function(_0x321db6,_0x22606f){_0x321db6=_0x321db6-0x16b;var _0x55f0f6=_0x549755[_0x321db6];return _0x55f0f6;},a93_0x321d(_0x59b84a,_0x373c85);}var __importDefault=this&&this[a93_0x19d79f(0x170)]||function(_0x47bb2b){return _0x47bb2b&&_0x47bb2b['__esModule']?_0x47bb2b:{'default':_0x47bb2b};};Object[a93_0x19d79f(0x17a)](exports,a93_0x19d79f(0x17e),{'value':!![]});var get_1=__importDefault(require(a93_0x19d79f(0x17c))),list_1=__importDefault(require(a93_0x19d79f(0x179))),create_1=__importDefault(require(a93_0x19d79f(0x16d))),update_1=__importDefault(require(a93_0x19d79f(0x178)));exports[a93_0x19d79f(0x16e)]={'get':get_1['default'],'list':list_1['default'],'create':create_1[a93_0x19d79f(0x16e)],'update':update_1[a93_0x19d79f(0x16e)]}; \ No newline at end of file diff --git a/plugins/google/api/drive/drives/methods/list.js b/plugins/google/api/drive/drives/methods/list.js index 4ff2b77..76c08de 100644 --- a/plugins/google/api/drive/drives/methods/list.js +++ b/plugins/google/api/drive/drives/methods/list.js @@ -1,29 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/drives/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/drives/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Lists all Shared Drives in the Respective Account - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} pageToken - Drive API pagination token (optional) - * @param {string} q - Search String (optional) - * @returns {Promise} - Promise Resolving to Drives List - */ -function default_1(token, pageToken, q) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default, 'drives'), - pageToken: pageToken ? pageToken : '', - q: q ? q : '', - }; - return helpers_1.googleApiRequest.get(API_1.default.list, token, params); -} -exports.default = default_1; +'use strict';var a94_0x448427=a94_0x550b;(function(_0x481c40,_0x339878){var _0x1ac467=a94_0x550b,_0x4fc1b9=_0x481c40();while(!![]){try{var _0x1b9e08=parseInt(_0x1ac467(0x94))/0x1*(-parseInt(_0x1ac467(0x95))/0x2)+parseInt(_0x1ac467(0x91))/0x3+parseInt(_0x1ac467(0xa0))/0x4*(parseInt(_0x1ac467(0x9f))/0x5)+parseInt(_0x1ac467(0x8d))/0x6+-parseInt(_0x1ac467(0x99))/0x7*(-parseInt(_0x1ac467(0x92))/0x8)+parseInt(_0x1ac467(0x90))/0x9*(parseInt(_0x1ac467(0x8f))/0xa)+-parseInt(_0x1ac467(0x8e))/0xb;if(_0x1b9e08===_0x339878)break;else _0x4fc1b9['push'](_0x4fc1b9['shift']());}catch(_0x529566){_0x4fc1b9['push'](_0x4fc1b9['shift']());}}}(a94_0x23b6,0x50172));var __importDefault=this&&this[a94_0x448427(0x93)]||function(_0x20177e){var _0x287dc5=a94_0x448427;return _0x20177e&&_0x20177e[_0x287dc5(0x9b)]?_0x20177e:{'default':_0x20177e};};function a94_0x550b(_0x5f170f,_0x47b8b7){var _0x23b6c6=a94_0x23b6();return a94_0x550b=function(_0x550bcc,_0x24152c){_0x550bcc=_0x550bcc-0x8d;var _0x3a8189=_0x23b6c6[_0x550bcc];return _0x3a8189;},a94_0x550b(_0x5f170f,_0x47b8b7);}Object['defineProperty'](exports,a94_0x448427(0x9b),{'value':!![]});var API_1=__importDefault(require(a94_0x448427(0x9e))),helpers_1=require(a94_0x448427(0x9a)),fields_1=__importDefault(require(a94_0x448427(0x9d))),helpers_2=require(a94_0x448427(0x9a));function a94_0x23b6(){var _0xb5498e=['drives','../../../../../google/api/drive/drives/fields','../../../../../google/api/drive/drives/API','3020530nMKwoI','4Rijzbx','get','1642584RqwqKd','14471644rQVnXF','313160UANAZo','90LRqvSD','1845522vildsC','40drRPEz','__importDefault','80259ndsNPB','10uShrZx','default','list','googleApiRequest','334243XWPEZg','../../../../../google/helpers','__esModule'];a94_0x23b6=function(){return _0xb5498e;};return a94_0x23b6();}function default_1(_0x42543c,_0x5d052b,_0x5852c4){var _0x557b1d=a94_0x448427,_0x56980b={'fields':(0x0,helpers_2['constructFields'])(fields_1[_0x557b1d(0x96)],_0x557b1d(0x9c)),'pageToken':_0x5d052b?_0x5d052b:'','q':_0x5852c4?_0x5852c4:''};return helpers_1[_0x557b1d(0x98)][_0x557b1d(0xa1)](API_1[_0x557b1d(0x96)][_0x557b1d(0x97)],_0x42543c,_0x56980b);}exports[a94_0x448427(0x96)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/drives/methods/update.js b/plugins/google/api/drive/drives/methods/update.js index fe19d71..e8ec49e 100644 --- a/plugins/google/api/drive/drives/methods/update.js +++ b/plugins/google/api/drive/drives/methods/update.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/drives/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/drives/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Updates Details about a Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} driveId - The ID of the Shared Drive - * @param {Partial} drivePatchData - Drive Data to be Updated - * @returns {Promise>} - Promise Resolving to Details - */ -function default_1(token, driveId, drivePatchData) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var url = API_1.default.update(driveId); - return helpers_1.googleApiRequest.patch(url, token, drivePatchData, params); -} -exports.default = default_1; +'use strict';var a95_0x2cfd70=a95_0x34ef;function a95_0xc5e2(){var _0x1c2c02=['4394760lXMgff','3267144pwpctU','36sBquCV','9878ChIqRo','29240xlpLRJ','3841581oVycTf','284725AefApD','774876qcWgur','googleApiRequest','12421evRYtk','patch','update','default','../../../../../google/api/drive/drives/API','defineProperty','54vzqhmY','../../../../../google/api/drive/drives/fields','__esModule','../../../../../google/helpers','__importDefault','21zQoinc'];a95_0xc5e2=function(){return _0x1c2c02;};return a95_0xc5e2();}(function(_0x367b2e,_0x2874fa){var _0x26ae70=a95_0x34ef,_0x46c123=_0x367b2e();while(!![]){try{var _0x587958=parseInt(_0x26ae70(0x7b))/0x1*(-parseInt(_0x26ae70(0x81))/0x2)+-parseInt(_0x26ae70(0x77))/0x3+parseInt(_0x26ae70(0x74))/0x4*(parseInt(_0x26ae70(0x78))/0x5)+parseInt(_0x26ae70(0x79))/0x6*(-parseInt(_0x26ae70(0x86))/0x7)+-parseInt(_0x26ae70(0x72))/0x8+parseInt(_0x26ae70(0x73))/0x9+-parseInt(_0x26ae70(0x76))/0xa*(-parseInt(_0x26ae70(0x75))/0xb);if(_0x587958===_0x2874fa)break;else _0x46c123['push'](_0x46c123['shift']());}catch(_0xebcf7c){_0x46c123['push'](_0x46c123['shift']());}}}(a95_0xc5e2,0xe7974));var __importDefault=this&&this[a95_0x2cfd70(0x85)]||function(_0x3be86f){var _0x4879f3=a95_0x2cfd70;return _0x3be86f&&_0x3be86f[_0x4879f3(0x83)]?_0x3be86f:{'default':_0x3be86f};};Object[a95_0x2cfd70(0x80)](exports,a95_0x2cfd70(0x83),{'value':!![]});function a95_0x34ef(_0x3c95ed,_0xcb7b22){var _0xc5e294=a95_0xc5e2();return a95_0x34ef=function(_0x34ef52,_0x359cee){_0x34ef52=_0x34ef52-0x72;var _0x4702ba=_0xc5e294[_0x34ef52];return _0x4702ba;},a95_0x34ef(_0x3c95ed,_0xcb7b22);}var API_1=__importDefault(require(a95_0x2cfd70(0x7f))),helpers_1=require(a95_0x2cfd70(0x84)),fields_1=__importDefault(require(a95_0x2cfd70(0x82))),helpers_2=require(a95_0x2cfd70(0x84));function default_1(_0x50f60e,_0x580ff7,_0x533394){var _0x2f9092=a95_0x2cfd70,_0x4f2117={'fields':(0x0,helpers_2['constructFields'])(fields_1[_0x2f9092(0x7e)])},_0x57997c=API_1[_0x2f9092(0x7e)][_0x2f9092(0x7d)](_0x580ff7);return helpers_1[_0x2f9092(0x7a)][_0x2f9092(0x7c)](_0x57997c,_0x50f60e,_0x533394,_0x4f2117);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/files/API.js b/plugins/google/api/drive/files/API.js index 91423eb..1b67179 100644 --- a/plugins/google/api/drive/files/API.js +++ b/plugins/google/api/drive/files/API.js @@ -1,54 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Managing Files in Google Drive */ -exports.default = { - /** - * Google Drive API for Listing Files in Drive - * - * @module list - * @returns {TDriveUrlType} - API String for list route - */ - list: 'https://www.googleapis.com/drive/v3/files', - /** - * Google Drive API for Getting Details About a File - * - * @module get - * @param {string} fileId - The ID o f the file - * @returns {TDriveUrlType} - API String for get Route - */ - get: function (fileId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId); - }, - /** - * Google Drive API for Uploading File - * - * @module create - */ - create: { - /** - * Metadata Upload - */ - metadata: 'https://www.googleapis.com/drive/v3/files', - /** - * File Upload - */ - upload: 'https://www.googleapis.com/upload/drive/v3/files', - }, - /** - * Google Drive API for Generating IDs for Uploading Files - * - * @module generateid - * @returns {TDriveUrlType} - API String for generateid Route - */ - generateId: 'https://www.googleapis.com/drive/v3/files/generateIds', - /** - * Google Drive API for Deleting a File - * - * @module delete - * @param {string} fileId - The ID of the file - * @returns {TDriveUrlType} - API String for delete Route - */ - delete: function (fileId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId); - }, -}; +'use strict';var a96_0x5943bc=a96_0xe6b4;function a96_0xe6b4(_0x3c6352,_0x5d51c2){var _0x1b5f30=a96_0x1b5f();return a96_0xe6b4=function(_0xe6b426,_0x317d49){_0xe6b426=_0xe6b426-0xa1;var _0x47f644=_0x1b5f30[_0xe6b426];return _0x47f644;},a96_0xe6b4(_0x3c6352,_0x5d51c2);}(function(_0x16a1fa,_0xf6bc80){var _0x53d5a5=a96_0xe6b4,_0x2e3735=_0x16a1fa();while(!![]){try{var _0x48cc1a=-parseInt(_0x53d5a5(0xab))/0x1*(-parseInt(_0x53d5a5(0xb1))/0x2)+-parseInt(_0x53d5a5(0xaa))/0x3*(parseInt(_0x53d5a5(0xaf))/0x4)+-parseInt(_0x53d5a5(0xa2))/0x5*(parseInt(_0x53d5a5(0xae))/0x6)+-parseInt(_0x53d5a5(0xa9))/0x7*(parseInt(_0x53d5a5(0xac))/0x8)+-parseInt(_0x53d5a5(0xa1))/0x9*(parseInt(_0x53d5a5(0xb2))/0xa)+parseInt(_0x53d5a5(0xa5))/0xb+parseInt(_0x53d5a5(0xa6))/0xc*(parseInt(_0x53d5a5(0xa8))/0xd);if(_0x48cc1a===_0xf6bc80)break;else _0x2e3735['push'](_0x2e3735['shift']());}catch(_0x148e51){_0x2e3735['push'](_0x2e3735['shift']());}}}(a96_0x1b5f,0xcfacc));Object[a96_0x5943bc(0xb3)](exports,a96_0x5943bc(0xad),{'value':!![]}),exports['default']={'list':a96_0x5943bc(0xa3),'get':function(_0x23a2fb){var _0x363c97=a96_0x5943bc;return _0x363c97(0xb0)[_0x363c97(0xa7)](_0x23a2fb);},'create':{'metadata':'https://www.googleapis.com/drive/v3/files','upload':'https://www.googleapis.com/upload/drive/v3/files'},'generateId':a96_0x5943bc(0xa4),'delete':function(_0x155f53){var _0x5e2f6d=a96_0x5943bc;return _0x5e2f6d(0xb0)['concat'](_0x155f53);}};function a96_0x1b5f(){var _0x59d1d2=['__esModule','139890qHJVfy','341692vfnpCB','https://www.googleapis.com/drive/v3/files/','18fduhFf','1250hYBeoC','defineProperty','100701mtxoai','70gBRwMq','https://www.googleapis.com/drive/v3/files','https://www.googleapis.com/drive/v3/files/generateIds','9721481VOYUSy','76332VYSvAw','concat','1976gckLSD','21nFaBFb','9aLyflA','145729ksWQoL','880704OwzIbr'];a96_0x1b5f=function(){return _0x59d1d2;};return a96_0x1b5f();} \ No newline at end of file diff --git a/plugins/google/api/drive/files/fields.js b/plugins/google/api/drive/files/fields.js index 2f42d32..2608012 100644 --- a/plugins/google/api/drive/files/fields.js +++ b/plugins/google/api/drive/files/fields.js @@ -1,38 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = [ - 'id', - 'name', - 'mimeType', - 'description', - 'parents', - 'version', - 'webContentLink', - 'webViewLink', - 'iconLink', - 'hasThumbnail', - 'thumbnailLink', - 'createdTime', - 'modifiedTime', - 'modifiedByMeTime', - 'modifiedByMe', - 'sharedWithMeTime', - 'sharingUser', - 'owners', - 'driveId', - 'lastModifyingUser', - 'capabilities', - 'copyRequiresWriterPermission', - 'permissions', - 'permissionIds', - 'originalFilename', - 'fullFileExtension', - 'fileExtension', - 'md5Checksum', - 'size', - 'quotaBytesUsed', - 'headRevisionId', - 'imageMediaMetadata', - 'videoMediaMetadata', - 'contentRestrictions', -]; +'use strict';var a97_0x4221cf=a97_0x23a7;(function(_0x2a23f5,_0x12ceb6){var _0x4a6a3f=a97_0x23a7,_0x1f4baa=_0x2a23f5();while(!![]){try{var _0x3d5921=parseInt(_0x4a6a3f(0x196))/0x1*(-parseInt(_0x4a6a3f(0x1a6))/0x2)+parseInt(_0x4a6a3f(0x197))/0x3+parseInt(_0x4a6a3f(0x1a8))/0x4*(parseInt(_0x4a6a3f(0x187))/0x5)+-parseInt(_0x4a6a3f(0x18e))/0x6+parseInt(_0x4a6a3f(0x191))/0x7*(parseInt(_0x4a6a3f(0x188))/0x8)+parseInt(_0x4a6a3f(0x19d))/0x9*(-parseInt(_0x4a6a3f(0x19e))/0xa)+-parseInt(_0x4a6a3f(0x1a5))/0xb;if(_0x3d5921===_0x12ceb6)break;else _0x1f4baa['push'](_0x1f4baa['shift']());}catch(_0x46ed6c){_0x1f4baa['push'](_0x1f4baa['shift']());}}}(a97_0x580d,0xeea31));function a97_0x580d(){var _0x4cd4bb=['thumbnailLink','fileExtension','5288393FsFfdF','2042882cqbCkI','headRevisionId','12wgBpVH','webContentLink','2351195PGvzxd','8JoIPKI','sharingUser','createdTime','quotaBytesUsed','md5Checksum','lastModifyingUser','4581390GeEYOY','__esModule','permissionIds','8723932qrAsJT','videoMediaMetadata','driveId','version','size','1IwLCwZ','1996029bqKNdP','iconLink','description','name','fullFileExtension','modifiedByMeTime','54jSSsFd','131850flEeiw','modifiedTime','sharedWithMeTime','parents','mimeType'];a97_0x580d=function(){return _0x4cd4bb;};return a97_0x580d();}function a97_0x23a7(_0x2a91bf,_0x149243){var _0x580d22=a97_0x580d();return a97_0x23a7=function(_0x23a731,_0x8af3fd){_0x23a731=_0x23a731-0x187;var _0x2202c4=_0x580d22[_0x23a731];return _0x2202c4;},a97_0x23a7(_0x2a91bf,_0x149243);}Object['defineProperty'](exports,a97_0x4221cf(0x18f),{'value':!![]}),exports['default']=['id',a97_0x4221cf(0x19a),a97_0x4221cf(0x1a2),a97_0x4221cf(0x199),a97_0x4221cf(0x1a1),a97_0x4221cf(0x194),a97_0x4221cf(0x1a9),'webViewLink',a97_0x4221cf(0x198),'hasThumbnail',a97_0x4221cf(0x1a3),a97_0x4221cf(0x18a),a97_0x4221cf(0x19f),a97_0x4221cf(0x19c),'modifiedByMe',a97_0x4221cf(0x1a0),a97_0x4221cf(0x189),'owners',a97_0x4221cf(0x193),a97_0x4221cf(0x18d),'capabilities','copyRequiresWriterPermission','permissions',a97_0x4221cf(0x190),'originalFilename',a97_0x4221cf(0x19b),a97_0x4221cf(0x1a4),a97_0x4221cf(0x18c),a97_0x4221cf(0x195),a97_0x4221cf(0x18b),a97_0x4221cf(0x1a7),'imageMediaMetadata',a97_0x4221cf(0x192),'contentRestrictions']; \ No newline at end of file diff --git a/plugins/google/api/drive/files/handle-query.js b/plugins/google/api/drive/files/handle-query.js index 3153d9c..c05addf 100644 --- a/plugins/google/api/drive/files/handle-query.js +++ b/plugins/google/api/drive/files/handle-query.js @@ -1,98 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var inValue = function (value, handler) { - return "".concat(handler, " contains '").concat(value, "'"); -}; -var notinValue = function (value, handler) { - return "not ".concat(handler, " contains '").concat(value, "'"); -}; -var numberValue = function (value, handler) { return "".concat(handler, " ").concat(value); }; -var arrayHandler = function (queryArray, handler, func) { - var query = ''; - for (var i = 0; i < queryArray.length; i++) { - if (i === queryArray.length - 1) { - query += func(queryArray[i], handler); - } - else { - query += "".concat(func(queryArray[i], handler), " and "); - } - } - return query; -}; -var checknHandle = function (handler, func, prop) { - if (prop) { - if (Array.isArray(prop)) { - var query = arrayHandler(prop, handler, func); - return query; - } - else { - var query = func(prop, handler); - return query; - } - } - return false; -}; -var boolChecker = function (arrays) { - var allowedValues = []; - arrays.forEach(function (value) { - if (value) { - allowedValues.push(value); - } - }); - return allowedValues; -}; -var arrayChecker = function (arrays) { - var allowedArrays = []; - arrays.forEach(function (arr) { - if (arr.length > 0) { - allowedArrays.push(arr); - } - }); - return allowedArrays; -}; -var andHandler = function (arrays) { - var mainQuery = ''; - arrays.forEach(function (mainArr, mainIndex) { - mainArr.forEach(function (subArray, subIndex) { - if (arrays.length === 1 && mainArr.length === 1) { - mainQuery = "".concat(subArray); - } - else if (mainIndex === arrays.length - 1 && - subIndex === mainArr.length - 1) { - mainQuery += "".concat(subArray); - } - else { - mainQuery += "".concat(subArray, " and "); - } - }); - }); - return mainQuery; -}; -/** - * Constructs a Advanced Drive Search Parameter - * - * @param {IDriveFileAdvancedQuery} query - Query Options - * @returns {string} - Constructed Query String - */ -function default_1(query) { - var positiveArray = []; - var negativeArray = []; - if (query.positive) { - var positive = query.positive; - var nameQuery = checknHandle('name', inValue, positive.name); - var mimeQuery = checknHandle('mimeType', inValue, positive.mimeType); - var fileExtQuery = checknHandle('fileExtension', inValue, positive.fileExtension); - var sizeQuery = positive.size ? numberValue(positive.size, 'size') : ''; - positiveArray.push.apply(positiveArray, boolChecker([nameQuery, mimeQuery, fileExtQuery, sizeQuery])); - } - if (query.negative) { - var negative = query.negative; - var nameQuery = checknHandle('name', notinValue, negative.name); - var mimeQuery = checknHandle('mimeType', notinValue, negative.mimeType); - var fileExtQuery = checknHandle('fileExtension', notinValue, negative.fileExtension); - negativeArray.push.apply(negativeArray, boolChecker([nameQuery, mimeQuery, fileExtQuery])); - } - var mainQuery = andHandler(arrayChecker([positiveArray, negativeArray])); - return mainQuery; -} -exports.default = default_1; +'use strict';var a98_0x529027=a98_0x52bb;(function(_0x3a85ed,_0x85783b){var _0x13cd89=a98_0x52bb,_0x3a1d76=_0x3a85ed();while(!![]){try{var _0x1d73cd=parseInt(_0x13cd89(0xa6))/0x1+-parseInt(_0x13cd89(0xaa))/0x2*(-parseInt(_0x13cd89(0xb9))/0x3)+-parseInt(_0x13cd89(0x9d))/0x4*(parseInt(_0x13cd89(0xa5))/0x5)+-parseInt(_0x13cd89(0xb0))/0x6*(-parseInt(_0x13cd89(0xb6))/0x7)+-parseInt(_0x13cd89(0xb2))/0x8+parseInt(_0x13cd89(0xa9))/0x9*(-parseInt(_0x13cd89(0xb3))/0xa)+parseInt(_0x13cd89(0x9f))/0xb;if(_0x1d73cd===_0x85783b)break;else _0x3a1d76['push'](_0x3a1d76['shift']());}catch(_0x356e96){_0x3a1d76['push'](_0x3a1d76['shift']());}}}(a98_0xa3f4,0xd9fa5));Object[a98_0x529027(0xb8)](exports,a98_0x529027(0xa8),{'value':!![]});var inValue=function(_0x1fc09d,_0x3b8ac9){var _0x1b3cf0=a98_0x529027;return''[_0x1b3cf0(0xa2)](_0x3b8ac9,_0x1b3cf0(0xa4))[_0x1b3cf0(0xa2)](_0x1fc09d,'\x27');},notinValue=function(_0x19e99b,_0x55fe68){var _0x1e5006=a98_0x529027;return _0x1e5006(0xae)['concat'](_0x55fe68,_0x1e5006(0xa4))[_0x1e5006(0xa2)](_0x19e99b,'\x27');},numberValue=function(_0x2e2c87,_0x35610b){var _0x36c07d=a98_0x529027;return''['concat'](_0x35610b,'\x20')[_0x36c07d(0xa2)](_0x2e2c87);},arrayHandler=function(_0x34d7b7,_0x4cf2c2,_0x365755){var _0x4446b0=a98_0x529027,_0x4153b1='';for(var _0x24ca2b=0x0;_0x24ca2b<_0x34d7b7['length'];_0x24ca2b++){_0x24ca2b===_0x34d7b7['length']-0x1?_0x4153b1+=_0x365755(_0x34d7b7[_0x24ca2b],_0x4cf2c2):_0x4153b1+=''[_0x4446b0(0xa2)](_0x365755(_0x34d7b7[_0x24ca2b],_0x4cf2c2),'\x20and\x20');}return _0x4153b1;},checknHandle=function(_0xb6b510,_0x74118b,_0x4f534c){var _0x1abfe9=a98_0x529027;if(_0x4f534c){if(Array[_0x1abfe9(0x9e)](_0x4f534c)){var _0x40d14f=arrayHandler(_0x4f534c,_0xb6b510,_0x74118b);return _0x40d14f;}else{var _0x40d14f=_0x74118b(_0x4f534c,_0xb6b510);return _0x40d14f;}}return![];},boolChecker=function(_0x5ad155){var _0x3c7d5a=a98_0x529027,_0x42c703=[];return _0x5ad155[_0x3c7d5a(0xa7)](function(_0x100cd7){var _0x3bb4f2=_0x3c7d5a;_0x100cd7&&_0x42c703[_0x3bb4f2(0xa1)](_0x100cd7);}),_0x42c703;},arrayChecker=function(_0x320e1){var _0x50c050=a98_0x529027,_0xfe691d=[];return _0x320e1[_0x50c050(0xa7)](function(_0x59a102){var _0x5be51=_0x50c050;_0x59a102['length']>0x0&&_0xfe691d[_0x5be51(0xa1)](_0x59a102);}),_0xfe691d;},andHandler=function(_0x595b93){var _0x57b649=a98_0x529027,_0x2325c8='';return _0x595b93[_0x57b649(0xa7)](function(_0x51b839,_0x25300e){var _0x3e25f5=_0x57b649;_0x51b839[_0x3e25f5(0xa7)](function(_0x2af534,_0x11db15){var _0xfd0afc=_0x3e25f5;if(_0x595b93[_0xfd0afc(0xa0)]===0x1&&_0x51b839[_0xfd0afc(0xa0)]===0x1)_0x2325c8=''['concat'](_0x2af534);else _0x25300e===_0x595b93['length']-0x1&&_0x11db15===_0x51b839['length']-0x1?_0x2325c8+=''[_0xfd0afc(0xa2)](_0x2af534):_0x2325c8+=''[_0xfd0afc(0xa2)](_0x2af534,_0xfd0afc(0xb1));});}),_0x2325c8;};function default_1(_0x4e2e52){var _0x171bc8=a98_0x529027,_0xb45d0b=[],_0x5c900f=[];if(_0x4e2e52[_0x171bc8(0xb5)]){var _0x5784bb=_0x4e2e52['positive'],_0x1b2936=checknHandle('name',inValue,_0x5784bb[_0x171bc8(0xab)]),_0x2ef014=checknHandle(_0x171bc8(0xaf),inValue,_0x5784bb[_0x171bc8(0xaf)]),_0x5bc8eb=checknHandle(_0x171bc8(0xa3),inValue,_0x5784bb[_0x171bc8(0xa3)]),_0x2e738c=_0x5784bb[_0x171bc8(0xad)]?numberValue(_0x5784bb['size'],_0x171bc8(0xad)):'';_0xb45d0b[_0x171bc8(0xa1)][_0x171bc8(0xb7)](_0xb45d0b,boolChecker([_0x1b2936,_0x2ef014,_0x5bc8eb,_0x2e738c]));}if(_0x4e2e52[_0x171bc8(0xac)]){var _0x41f366=_0x4e2e52[_0x171bc8(0xac)],_0x1b2936=checknHandle('name',notinValue,_0x41f366[_0x171bc8(0xab)]),_0x2ef014=checknHandle('mimeType',notinValue,_0x41f366[_0x171bc8(0xaf)]),_0x5bc8eb=checknHandle('fileExtension',notinValue,_0x41f366[_0x171bc8(0xa3)]);_0x5c900f[_0x171bc8(0xa1)][_0x171bc8(0xb7)](_0x5c900f,boolChecker([_0x1b2936,_0x2ef014,_0x5bc8eb]));}var _0x5ef965=andHandler(arrayChecker([_0xb45d0b,_0x5c900f]));return _0x5ef965;}function a98_0x52bb(_0x3025f7,_0x206360){var _0xa3f48=a98_0xa3f4();return a98_0x52bb=function(_0x52bb39,_0x5ea686){_0x52bb39=_0x52bb39-0x9d;var _0x427328=_0xa3f48[_0x52bb39];return _0x427328;},a98_0x52bb(_0x3025f7,_0x206360);}exports[a98_0x529027(0xb4)]=default_1;function a98_0xa3f4(){var _0x2e3d8e=['default','positive','385MIKpZV','apply','defineProperty','3MpiRFM','12yXzRQO','isArray','48292794ezDzsa','length','push','concat','fileExtension','\x20contains\x20\x27','2460405VvDzXF','262676ZEkHIS','forEach','__esModule','6858333ZbooXY','21058HBrcJi','name','negative','size','not\x20','mimeType','72186iAPiXb','\x20and\x20','11456080QwNQpt','20qxxpFv'];a98_0xa3f4=function(){return _0x2e3d8e;};return a98_0xa3f4();} \ No newline at end of file diff --git a/plugins/google/api/drive/files/index.js b/plugins/google/api/drive/files/index.js index 1f489a8..1a3a1fa 100644 --- a/plugins/google/api/drive/files/index.js +++ b/plugins/google/api/drive/files/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); +'use strict';function a99_0x29df(){var _0x8af6ae=['829125BGyJjC','175480DmxAlc','api','default','1442dXjJmF','3880UnbUBB','681mGVwmr','339705fHlEtV','110gSAAsW','./API','__esModule','161526UQwuVn','defineProperty','70dhvEXV','__importDefault','27632kTRdlg'];a99_0x29df=function(){return _0x8af6ae;};return a99_0x29df();}var a99_0x11abf6=a99_0x1e37;(function(_0x361d24,_0x44a4f9){var _0x472960=a99_0x1e37,_0x42584c=_0x361d24();while(!![]){try{var _0xfbbe3d=-parseInt(_0x472960(0x1f7))/0x1+parseInt(_0x472960(0x200))/0x2*(parseInt(_0x472960(0x1fe))/0x3)+-parseInt(_0x472960(0x1f9))/0x4+-parseInt(_0x472960(0x1f8))/0x5+-parseInt(_0x472960(0x1f3))/0x6+-parseInt(_0x472960(0x1fc))/0x7*(-parseInt(_0x472960(0x1fd))/0x8)+-parseInt(_0x472960(0x1ff))/0x9*(-parseInt(_0x472960(0x1f5))/0xa);if(_0xfbbe3d===_0x44a4f9)break;else _0x42584c['push'](_0x42584c['shift']());}catch(_0x521ec1){_0x42584c['push'](_0x42584c['shift']());}}}(a99_0x29df,0x1b6ea));function a99_0x1e37(_0x1a1f9e,_0x1f450d){var _0x29df9f=a99_0x29df();return a99_0x1e37=function(_0x1e3712,_0x42e411){_0x1e3712=_0x1e3712-0x1f2;var _0x4ba153=_0x29df9f[_0x1e3712];return _0x4ba153;},a99_0x1e37(_0x1a1f9e,_0x1f450d);}var __importDefault=this&&this[a99_0x11abf6(0x1f6)]||function(_0x15484c){var _0x4ac399=a99_0x11abf6;return _0x15484c&&_0x15484c[_0x4ac399(0x1f2)]?_0x15484c:{'default':_0x15484c};};Object[a99_0x11abf6(0x1f4)](exports,a99_0x11abf6(0x1f2),{'value':!![]}),exports[a99_0x11abf6(0x1fa)]=void 0x0;var API_1=require(a99_0x11abf6(0x201));Object['defineProperty'](exports,a99_0x11abf6(0x1fa),{'enumerable':!![],'get':function(){var _0x18061f=a99_0x11abf6;return __importDefault(API_1)[_0x18061f(0x1fb)];}}); \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/create.js b/plugins/google/api/drive/files/methods/create.js index 3918c74..c0e54b3 100644 --- a/plugins/google/api/drive/files/methods/create.js +++ b/plugins/google/api/drive/files/methods/create.js @@ -1 +1 @@ -"use strict"; +'use strict';function a100_0x10c4(_0x514bb3,_0x1dbc7a){var _0x1e07bf=a100_0x1e07();return a100_0x10c4=function(_0x10c4f7,_0x504625){_0x10c4f7=_0x10c4f7-0xf1;var _0x25f2f8=_0x1e07bf[_0x10c4f7];return _0x25f2f8;},a100_0x10c4(_0x514bb3,_0x1dbc7a);}(function(_0x1397c8,_0x309001){var _0x305d46=a100_0x10c4,_0x14c45c=_0x1397c8();while(!![]){try{var _0x8d52ee=-parseInt(_0x305d46(0xf7))/0x1+-parseInt(_0x305d46(0xf1))/0x2*(-parseInt(_0x305d46(0xf4))/0x3)+-parseInt(_0x305d46(0xf2))/0x4*(-parseInt(_0x305d46(0xfa))/0x5)+parseInt(_0x305d46(0xf8))/0x6*(-parseInt(_0x305d46(0xf5))/0x7)+parseInt(_0x305d46(0xf9))/0x8+-parseInt(_0x305d46(0xf6))/0x9+parseInt(_0x305d46(0xf3))/0xa*(parseInt(_0x305d46(0xfb))/0xb);if(_0x8d52ee===_0x309001)break;else _0x14c45c['push'](_0x14c45c['shift']());}catch(_0x24ff01){_0x14c45c['push'](_0x14c45c['shift']());}}}(a100_0x1e07,0x57f53));function a100_0x1e07(){var _0x68b7c8=['135fpMjBC','55MZgCFm','8xmXCuM','61212urilhb','529710osowWM','365097UPhNJs','91ONjHUQ','600705VXVboV','557502UoiGgP','256374fzVUUp','3001336DVQmZJ'];a100_0x1e07=function(){return _0x68b7c8;};return a100_0x1e07();} \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/delete.js b/plugins/google/api/drive/files/methods/delete.js index 371239f..8452bbe 100644 --- a/plugins/google/api/drive/files/methods/delete.js +++ b/plugins/google/api/drive/files/methods/delete.js @@ -1,24 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Deletes a File in Google Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the Folder or File - * @returns {Promise} - Promise - */ -function default_1(token, fileId) { - var params = { - supportsAllDrives: true, - }; - var apiUrl = API_1.default.delete(fileId); - return helpers_1.googleApiRequest.delete(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a101_0x3444ac=a101_0xb9da;(function(_0x409ffc,_0x2dc164){var _0x9e1398=a101_0xb9da,_0x644b46=_0x409ffc();while(!![]){try{var _0x2778d0=-parseInt(_0x9e1398(0x7e))/0x1+parseInt(_0x9e1398(0x79))/0x2+parseInt(_0x9e1398(0x78))/0x3*(parseInt(_0x9e1398(0x7c))/0x4)+parseInt(_0x9e1398(0x7b))/0x5+-parseInt(_0x9e1398(0x80))/0x6+-parseInt(_0x9e1398(0x82))/0x7*(parseInt(_0x9e1398(0x7f))/0x8)+parseInt(_0x9e1398(0x7d))/0x9;if(_0x2778d0===_0x2dc164)break;else _0x644b46['push'](_0x644b46['shift']());}catch(_0x47e244){_0x644b46['push'](_0x644b46['shift']());}}}(a101_0x1064,0xda4e1));var __importDefault=this&&this['__importDefault']||function(_0x47426d){var _0x239fb2=a101_0xb9da;return _0x47426d&&_0x47426d[_0x239fb2(0x84)]?_0x47426d:{'default':_0x47426d};};Object[a101_0x3444ac(0x83)](exports,'__esModule',{'value':!![]});var API_1=__importDefault(require('../../../../../google/api/drive/files/API')),helpers_1=require(a101_0x3444ac(0x7a));function a101_0xb9da(_0x3f5bb2,_0x2e54e2){var _0x106480=a101_0x1064();return a101_0xb9da=function(_0xb9da4e,_0x46648d){_0xb9da4e=_0xb9da4e-0x78;var _0xe9c35d=_0x106480[_0xb9da4e];return _0xe9c35d;},a101_0xb9da(_0x3f5bb2,_0x2e54e2);}function a101_0x1064(){var _0x41bcc0=['154ilEREp','defineProperty','__esModule','3811833DcfOjU','1498032mhgcEL','../../../../../google/helpers','6141450hSrKuQ','4klFsPq','14641083CjXmbc','1505986lixEyl','284208tCjQWX','10157814MVQWJw','default'];a101_0x1064=function(){return _0x41bcc0;};return a101_0x1064();}function default_1(_0x5682fa,_0x4930e6){var _0x30de95=a101_0x3444ac,_0x334f44={'supportsAllDrives':!![]},_0x143d22=API_1[_0x30de95(0x81)]['delete'](_0x4930e6);return helpers_1['googleApiRequest']['delete'](_0x143d22,_0x5682fa,_0x334f44);}exports[a101_0x3444ac(0x81)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/download.js b/plugins/google/api/drive/files/methods/download.js index f49d969..73d1697 100644 --- a/plugins/google/api/drive/files/methods/download.js +++ b/plugins/google/api/drive/files/methods/download.js @@ -1,24 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Downloads a File from Drive using Streaming Request - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the Folder or File - * @returns {GotReturn} - Promise Resolving to File Data - */ -function default_1(token, fileId) { - var apiUrl = API_1.default.get(fileId); - var params = { - alt: 'media', - }; - return helpers_1.googleApiRequest.stream(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a102_0x2d3091=a102_0x4f1a;(function(_0x2b0599,_0x2d0dc1){var _0x883acb=a102_0x4f1a,_0x720879=_0x2b0599();while(!![]){try{var _0x63974f=parseInt(_0x883acb(0x19a))/0x1*(-parseInt(_0x883acb(0x1a1))/0x2)+parseInt(_0x883acb(0x1a7))/0x3*(-parseInt(_0x883acb(0x1a0))/0x4)+parseInt(_0x883acb(0x199))/0x5+-parseInt(_0x883acb(0x198))/0x6*(-parseInt(_0x883acb(0x1a3))/0x7)+-parseInt(_0x883acb(0x19d))/0x8+-parseInt(_0x883acb(0x1a4))/0x9+-parseInt(_0x883acb(0x1a5))/0xa*(-parseInt(_0x883acb(0x19b))/0xb);if(_0x63974f===_0x2d0dc1)break;else _0x720879['push'](_0x720879['shift']());}catch(_0xda0808){_0x720879['push'](_0x720879['shift']());}}}(a102_0x8cbf,0x5dcb0));function a102_0x4f1a(_0x2b8a81,_0x43b624){var _0x8cbfcc=a102_0x8cbf();return a102_0x4f1a=function(_0x4f1a1c,_0x5d6be2){_0x4f1a1c=_0x4f1a1c-0x197;var _0x22bda1=_0x8cbfcc[_0x4f1a1c];return _0x22bda1;},a102_0x4f1a(_0x2b8a81,_0x43b624);}function a102_0x8cbf(){var _0x8521b6=['4AHBzer','562jCDIgY','../../../../../google/api/drive/files/API','63945JWgRNP','565470llgYHu','2740810babVGK','googleApiRequest','192123DaqxCN','stream','get','258qQxPVz','2810555pmNdVF','1602bWeGhb','11jsPDuw','__importDefault','2142304RtjDbj','media','__esModule'];a102_0x8cbf=function(){return _0x8521b6;};return a102_0x8cbf();}var __importDefault=this&&this[a102_0x2d3091(0x19c)]||function(_0x5c276a){return _0x5c276a&&_0x5c276a['__esModule']?_0x5c276a:{'default':_0x5c276a};};Object['defineProperty'](exports,a102_0x2d3091(0x19f),{'value':!![]});var API_1=__importDefault(require(a102_0x2d3091(0x1a2))),helpers_1=require('../../../../../google/helpers');function default_1(_0x5dde12,_0x7dbeae){var _0x5f331a=a102_0x2d3091,_0x38b6f1=API_1['default'][_0x5f331a(0x197)](_0x7dbeae),_0xccf5d1={'alt':_0x5f331a(0x19e)};return helpers_1[_0x5f331a(0x1a6)][_0x5f331a(0x1a8)](_0x38b6f1,_0x5dde12,_0xccf5d1);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/generate-id.js b/plugins/google/api/drive/files/methods/generate-id.js index a2c7ac6..4929a12 100644 --- a/plugins/google/api/drive/files/methods/generate-id.js +++ b/plugins/google/api/drive/files/methods/generate-id.js @@ -1,25 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Generate IDs for Uploading and Copying Files - * - * @param {ITokenDoc} token - Token Document from Database - * @returns {Promise>} - Promise Resolving to IDs - */ -function default_1(token) { - var params = { - count: 5, - space: 'drive', - type: 'files', - }; - var apiUrl = API_1.default.generateId; - return helpers_1.googleApiRequest.get(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a103_0x302835=a103_0x5500;(function(_0x5974ea,_0x1eb17a){var _0x194cd8=a103_0x5500,_0xfcf715=_0x5974ea();while(!![]){try{var _0x3464c4=parseInt(_0x194cd8(0x1f8))/0x1+-parseInt(_0x194cd8(0x1f7))/0x2+parseInt(_0x194cd8(0x1f1))/0x3*(parseInt(_0x194cd8(0x1fc))/0x4)+parseInt(_0x194cd8(0x1f5))/0x5*(parseInt(_0x194cd8(0x1f3))/0x6)+-parseInt(_0x194cd8(0x1fa))/0x7+parseInt(_0x194cd8(0x1f4))/0x8+parseInt(_0x194cd8(0x1f0))/0x9;if(_0x3464c4===_0x1eb17a)break;else _0xfcf715['push'](_0xfcf715['shift']());}catch(_0x1407a3){_0xfcf715['push'](_0xfcf715['shift']());}}}(a103_0x2e41,0xe3b61));var __importDefault=this&&this['__importDefault']||function(_0x34d517){var _0x29baad=a103_0x5500;return _0x34d517&&_0x34d517[_0x29baad(0x1f6)]?_0x34d517:{'default':_0x34d517};};Object['defineProperty'](exports,a103_0x302835(0x1f6),{'value':!![]});function a103_0x5500(_0x45712b,_0x9eb6a1){var _0x2e41d8=a103_0x2e41();return a103_0x5500=function(_0x550068,_0x50b7eb){_0x550068=_0x550068-0x1f0;var _0x432832=_0x2e41d8[_0x550068];return _0x432832;},a103_0x5500(_0x45712b,_0x9eb6a1);}var API_1=__importDefault(require(a103_0x302835(0x1f2))),helpers_1=require('../../../../../google/helpers');function default_1(_0x30f40d){var _0x46d7b0=a103_0x302835,_0x1cdd14={'count':0x5,'space':'drive','type':_0x46d7b0(0x1fb)},_0xce1f1c=API_1[_0x46d7b0(0x1fd)][_0x46d7b0(0x1fe)];return helpers_1['googleApiRequest'][_0x46d7b0(0x1f9)](_0xce1f1c,_0x30f40d,_0x1cdd14);}exports[a103_0x302835(0x1fd)]=default_1;function a103_0x2e41(){var _0x3b60c3=['153956lMTgGb','get','9553607cKFCPH','files','5604OlSsif','default','generateId','4254858WxVmzd','3096xCgarA','../../../../../google/api/drive/files/API','36276wtSBqC','13773600juwSuJ','135tUqvKR','__esModule','3319972syRfYu'];a103_0x2e41=function(){return _0x3b60c3;};return a103_0x2e41();} \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/get.js b/plugins/google/api/drive/files/methods/get.js index 0355a63..ed24307 100644 --- a/plugins/google/api/drive/files/methods/get.js +++ b/plugins/google/api/drive/files/methods/get.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/files/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Gets Details about a File in Google Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the Folder or File - * @returns {Promise>} - Promise Resolving to File Resource - */ -function default_1(token, fileId) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - supportsAllDrives: true, - }; - var apiUrl = API_1.default.get(fileId); - return helpers_1.googleApiRequest.get(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a104_0x1d7500=a104_0xfd7d;(function(_0x3a0689,_0x1ade8c){var _0x1f81fd=a104_0xfd7d,_0xa7a45c=_0x3a0689();while(!![]){try{var _0x3a62b7=parseInt(_0x1f81fd(0x1de))/0x1+-parseInt(_0x1f81fd(0x1e3))/0x2*(parseInt(_0x1f81fd(0x1e9))/0x3)+parseInt(_0x1f81fd(0x1df))/0x4*(-parseInt(_0x1f81fd(0x1ed))/0x5)+parseInt(_0x1f81fd(0x1e5))/0x6*(parseInt(_0x1f81fd(0x1e4))/0x7)+parseInt(_0x1f81fd(0x1e8))/0x8*(parseInt(_0x1f81fd(0x1f1))/0x9)+parseInt(_0x1f81fd(0x1e7))/0xa*(-parseInt(_0x1f81fd(0x1ec))/0xb)+parseInt(_0x1f81fd(0x1f0))/0xc*(-parseInt(_0x1f81fd(0x1e6))/0xd);if(_0x3a62b7===_0x1ade8c)break;else _0xa7a45c['push'](_0xa7a45c['shift']());}catch(_0x5226a3){_0xa7a45c['push'](_0xa7a45c['shift']());}}}(a104_0xb0c0,0x5d46d));var __importDefault=this&&this[a104_0x1d7500(0x1ef)]||function(_0x170fb9){var _0x51f273=a104_0x1d7500;return _0x170fb9&&_0x170fb9[_0x51f273(0x1e2)]?_0x170fb9:{'default':_0x170fb9};};Object['defineProperty'](exports,'__esModule',{'value':!![]});var API_1=__importDefault(require(a104_0x1d7500(0x1ee))),helpers_1=require('../../../../../google/helpers'),fields_1=__importDefault(require('../../../../../google/api/drive/files/fields')),helpers_2=require(a104_0x1d7500(0x1e0));function a104_0xfd7d(_0x42a857,_0x219d5d){var _0xb0c046=a104_0xb0c0();return a104_0xfd7d=function(_0xfd7d86,_0x34f714){_0xfd7d86=_0xfd7d86-0x1de;var _0x50e09d=_0xb0c046[_0xfd7d86];return _0x50e09d;},a104_0xfd7d(_0x42a857,_0x219d5d);}function default_1(_0xd85e45,_0x2322e0){var _0x659ccd=a104_0x1d7500,_0x5ea0db={'fields':(0x0,helpers_2[_0x659ccd(0x1ea)])(fields_1[_0x659ccd(0x1f2)]),'supportsAllDrives':!![]},_0x4bc7c1=API_1[_0x659ccd(0x1f2)][_0x659ccd(0x1eb)](_0x2322e0);return helpers_1[_0x659ccd(0x1e1)][_0x659ccd(0x1eb)](_0x4bc7c1,_0xd85e45,_0x5ea0db);}function a104_0xb0c0(){var _0x3f190d=['googleApiRequest','__esModule','1304xwbiLy','1126279LyZICD','18cHYTye','29861SNnPLW','10CCvyOs','520UFVsEj','1269XhPgAk','constructFields','get','2746766NMUdUC','89545UVruyP','../../../../../google/api/drive/files/API','__importDefault','84WSikkr','79983HQTsRW','default','78204ZXmHrh','48TGzMyz','../../../../../google/helpers'];a104_0xb0c0=function(){return _0x3f190d;};return a104_0xb0c0();}exports[a104_0x1d7500(0x1f2)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/index.js b/plugins/google/api/drive/files/methods/index.js index 3918c74..d9719e4 100644 --- a/plugins/google/api/drive/files/methods/index.js +++ b/plugins/google/api/drive/files/methods/index.js @@ -1 +1 @@ -"use strict"; +'use strict';function a105_0x2cd5(){var _0x502d77=['174992qQDlxM','7044120XIewrY','4471002gBbcnk','429820OvetBg','687834XbbTdI','50TbhEpR','3oFGuNX','3700752BkNatu','439400AbALTX','63ggfoTo'];a105_0x2cd5=function(){return _0x502d77;};return a105_0x2cd5();}function a105_0x1f50(_0x48d995,_0xf4a3b1){var _0x2cd537=a105_0x2cd5();return a105_0x1f50=function(_0x1f5029,_0x28936c){_0x1f5029=_0x1f5029-0x16d;var _0x25d7c2=_0x2cd537[_0x1f5029];return _0x25d7c2;},a105_0x1f50(_0x48d995,_0xf4a3b1);}(function(_0x362a4e,_0x1d897b){var _0x4c1cb3=a105_0x1f50,_0xcfe8eb=_0x362a4e();while(!![]){try{var _0xee2a42=parseInt(_0x4c1cb3(0x170))/0x1*(parseInt(_0x4c1cb3(0x16e))/0x2)+parseInt(_0x4c1cb3(0x171))/0x3+parseInt(_0x4c1cb3(0x16d))/0x4+parseInt(_0x4c1cb3(0x172))/0x5+parseInt(_0x4c1cb3(0x175))/0x6+parseInt(_0x4c1cb3(0x173))/0x7*(-parseInt(_0x4c1cb3(0x174))/0x8)+parseInt(_0x4c1cb3(0x176))/0x9*(-parseInt(_0x4c1cb3(0x16f))/0xa);if(_0xee2a42===_0x1d897b)break;else _0xcfe8eb['push'](_0xcfe8eb['shift']());}catch(_0x26e896){_0xcfe8eb['push'](_0xcfe8eb['shift']());}}}(a105_0x2cd5,0xe8e4e)); \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/list.js b/plugins/google/api/drive/files/methods/list.js index 82c0cda..7ee6c5c 100644 --- a/plugins/google/api/drive/files/methods/list.js +++ b/plugins/google/api/drive/files/methods/list.js @@ -1,38 +1 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/files/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Lists Files inside a Folder or Root in Google Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} folderId - ID of the Folder or File - * @param {IDriveFileSearchDetails} searchOptions - Additional Options to Search Drive - * @returns {Promise>} - Promise Resolving to File Resource - */ -function default_1(token, folderId, searchOptions) { - var searchId = folderId ? folderId : 'root'; - var params = __assign({ fields: (0, helpers_2.constructFields)(fields_1.default, 'files'), q: "'".concat(searchId, "' in parents"), supportsAllDrives: true }, searchOptions); - var apiUrl = API_1.default.list; - return helpers_1.googleApiRequest.get(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a106_0x3aa04b=a106_0x3ca0;(function(_0x54a238,_0x33b119){var _0xf30d94=a106_0x3ca0,_0x248d6c=_0x54a238();while(!![]){try{var _0x3017f7=-parseInt(_0xf30d94(0xbe))/0x1*(parseInt(_0xf30d94(0xc9))/0x2)+-parseInt(_0xf30d94(0xcb))/0x3+-parseInt(_0xf30d94(0xc3))/0x4*(-parseInt(_0xf30d94(0xd3))/0x5)+parseInt(_0xf30d94(0xc7))/0x6+-parseInt(_0xf30d94(0xc2))/0x7*(parseInt(_0xf30d94(0xc0))/0x8)+-parseInt(_0xf30d94(0xbb))/0x9*(-parseInt(_0xf30d94(0xca))/0xa)+parseInt(_0xf30d94(0xc8))/0xb*(parseInt(_0xf30d94(0xbc))/0xc);if(_0x3017f7===_0x33b119)break;else _0x248d6c['push'](_0x248d6c['shift']());}catch(_0x801cea){_0x248d6c['push'](_0x248d6c['shift']());}}}(a106_0x245f,0x9b9ae));var __assign=this&&this['__assign']||function(){var _0x547375=a106_0x3ca0;return __assign=Object[_0x547375(0xbd)]||function(_0x5d334c){var _0x5ad55d=_0x547375;for(var _0x129f07,_0x1779df=0x1,_0x4eca12=arguments[_0x5ad55d(0xc5)];_0x1779df<_0x4eca12;_0x1779df++){_0x129f07=arguments[_0x1779df];for(var _0x5ba633 in _0x129f07)if(Object[_0x5ad55d(0xc4)][_0x5ad55d(0xcc)][_0x5ad55d(0xcd)](_0x129f07,_0x5ba633))_0x5d334c[_0x5ba633]=_0x129f07[_0x5ba633];}return _0x5d334c;},__assign['apply'](this,arguments);},__importDefault=this&&this[a106_0x3aa04b(0xcf)]||function(_0x111f0c){var _0x4f1f8d=a106_0x3aa04b;return _0x111f0c&&_0x111f0c[_0x4f1f8d(0xc1)]?_0x111f0c:{'default':_0x111f0c};};Object['defineProperty'](exports,a106_0x3aa04b(0xc1),{'value':!![]});function a106_0x3ca0(_0x23f063,_0x30a952){var _0x245fdf=a106_0x245f();return a106_0x3ca0=function(_0x3ca03a,_0x37a93f){_0x3ca03a=_0x3ca03a-0xba;var _0x247363=_0x245fdf[_0x3ca03a];return _0x247363;},a106_0x3ca0(_0x23f063,_0x30a952);}function a106_0x245f(){var _0x3e1acd=['call','googleApiRequest','__importDefault','concat','root','constructFields','100bMVmyZ','get','../../../../../google/api/drive/files/fields','files','60201luXkck','878340ExaBDL','assign','1abZUql','list','4054208jCmoBQ','__esModule','7OqoBrd','6368gITPnF','prototype','length','../../../../../google/api/drive/files/API','6859992jDtYhi','209GkIwcE','1049036slkOIb','20dAYXDj','2731809tqkrdH','hasOwnProperty'];a106_0x245f=function(){return _0x3e1acd;};return a106_0x245f();}var API_1=__importDefault(require(a106_0x3aa04b(0xc6))),helpers_1=require('../../../../../google/helpers'),fields_1=__importDefault(require(a106_0x3aa04b(0xd5))),helpers_2=require('../../../../../google/helpers');function default_1(_0x52447c,_0x30568d,_0x3d4e1b){var _0x2e90be=a106_0x3aa04b,_0x5c645a=_0x30568d?_0x30568d:_0x2e90be(0xd1),_0x12fa26=__assign({'fields':(0x0,helpers_2[_0x2e90be(0xd2)])(fields_1['default'],_0x2e90be(0xba)),'q':'\x27'[_0x2e90be(0xd0)](_0x5c645a,'\x27\x20in\x20parents'),'supportsAllDrives':!![]},_0x3d4e1b),_0x21398f=API_1['default'][_0x2e90be(0xbf)];return helpers_1[_0x2e90be(0xce)][_0x2e90be(0xd4)](_0x21398f,_0x52447c,_0x12fa26);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/files/methods/search.js b/plugins/google/api/drive/files/methods/search.js index 42e3fde..f087a5e 100644 --- a/plugins/google/api/drive/files/methods/search.js +++ b/plugins/google/api/drive/files/methods/search.js @@ -1,52 +1 @@ -"use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/files/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var handle_query_1 = __importDefault(require("../handle-query")); -var fields_1 = __importDefault(require("../../../../../google/api/drive/files/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Search Files & Folders in Google Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} folderId - ID of the Folder or File - * @param {boolean} scopeCurrentFolder - Restrict Search to Current Folder or not - * @param {IDriveFileSearchDetails} searchOptions - Additional Options to Search Drive - * @param {IDriveFileAdvancedQuery} advancedSearchOptions - Advanced Search Options to Filter - * @returns {Promise>} - Promise Resolving to List of Files - */ -function default_1(token, folderId, scopeCurrentFolder, searchOptions, advancedSearchOptions) { - var query = ''; - var searchId = folderId ? folderId : 'root'; - if (scopeCurrentFolder && advancedSearchOptions) { - query += "'".concat(searchId, "' in parents and "); - query += "".concat((0, handle_query_1.default)(advancedSearchOptions)); - } - else if (scopeCurrentFolder) { - query += "'".concat(searchId, "' in parents"); - } - else if (advancedSearchOptions) { - query += "".concat((0, handle_query_1.default)(advancedSearchOptions)); - } - var params = __assign({ fields: (0, helpers_2.constructFields)(fields_1.default, 'files'), q: query, supportsAllDrives: true }, searchOptions); - var apiUrl = API_1.default.list; - return helpers_1.googleApiRequest.get(apiUrl, token, params); -} -exports.default = default_1; +'use strict';var a107_0x29cfde=a107_0x1b9b;(function(_0x2a1a0d,_0x526b77){var _0x37fe5f=a107_0x1b9b,_0x99e752=_0x2a1a0d();while(!![]){try{var _0x114dac=-parseInt(_0x37fe5f(0xd4))/0x1*(parseInt(_0x37fe5f(0xda))/0x2)+-parseInt(_0x37fe5f(0xd8))/0x3+-parseInt(_0x37fe5f(0xc8))/0x4+parseInt(_0x37fe5f(0xdd))/0x5+parseInt(_0x37fe5f(0xc5))/0x6+-parseInt(_0x37fe5f(0xdc))/0x7+-parseInt(_0x37fe5f(0xcc))/0x8*(-parseInt(_0x37fe5f(0xc9))/0x9);if(_0x114dac===_0x526b77)break;else _0x99e752['push'](_0x99e752['shift']());}catch(_0x1b39b5){_0x99e752['push'](_0x99e752['shift']());}}}(a107_0x3125,0xd5ace));var __assign=this&&this[a107_0x29cfde(0xd2)]||function(){return __assign=Object['assign']||function(_0x2229df){var _0x579b1d=a107_0x1b9b;for(var _0x247b22,_0x27ea5d=0x1,_0x3ec059=arguments[_0x579b1d(0xd0)];_0x27ea5d<_0x3ec059;_0x27ea5d++){_0x247b22=arguments[_0x27ea5d];for(var _0x501939 in _0x247b22)if(Object['prototype'][_0x579b1d(0xd7)][_0x579b1d(0xd6)](_0x247b22,_0x501939))_0x2229df[_0x501939]=_0x247b22[_0x501939];}return _0x2229df;},__assign['apply'](this,arguments);},__importDefault=this&&this[a107_0x29cfde(0xca)]||function(_0x346e7e){var _0x4f327c=a107_0x29cfde;return _0x346e7e&&_0x346e7e[_0x4f327c(0xd3)]?_0x346e7e:{'default':_0x346e7e};};function a107_0x3125(){var _0x4fb2f5=['12138105klheQT','5194245VoQmaX','defineProperty','541080laRkMz','concat','../../../../../google/helpers','4701272ghrmgU','1908aVHDoO','__importDefault','../../../../../google/api/drive/files/fields','159104AvltJY','get','../handle-query','\x27\x20in\x20parents','length','../../../../../google/api/drive/files/API','__assign','__esModule','108369nGzaue','default','call','hasOwnProperty','1756251zdZwla','\x27\x20in\x20parents\x20and\x20','18zqXNsv','constructFields'];a107_0x3125=function(){return _0x4fb2f5;};return a107_0x3125();}function a107_0x1b9b(_0x3c224f,_0x517727){var _0x3125e3=a107_0x3125();return a107_0x1b9b=function(_0x1b9b3a,_0x4a4ca6){_0x1b9b3a=_0x1b9b3a-0xc4;var _0x219457=_0x3125e3[_0x1b9b3a];return _0x219457;},a107_0x1b9b(_0x3c224f,_0x517727);}Object[a107_0x29cfde(0xc4)](exports,a107_0x29cfde(0xd3),{'value':!![]});var API_1=__importDefault(require(a107_0x29cfde(0xd1))),helpers_1=require(a107_0x29cfde(0xc7)),handle_query_1=__importDefault(require(a107_0x29cfde(0xce))),fields_1=__importDefault(require(a107_0x29cfde(0xcb))),helpers_2=require(a107_0x29cfde(0xc7));function default_1(_0x5770a2,_0x15db20,_0x2a34a7,_0x14c538,_0x58d913){var _0x3167b0=a107_0x29cfde,_0x4608d6='',_0x3667e4=_0x15db20?_0x15db20:'root';if(_0x2a34a7&&_0x58d913)_0x4608d6+='\x27'[_0x3167b0(0xc6)](_0x3667e4,_0x3167b0(0xd9)),_0x4608d6+=''['concat']((0x0,handle_query_1[_0x3167b0(0xd5)])(_0x58d913));else{if(_0x2a34a7)_0x4608d6+='\x27'[_0x3167b0(0xc6)](_0x3667e4,_0x3167b0(0xcf));else _0x58d913&&(_0x4608d6+=''[_0x3167b0(0xc6)]((0x0,handle_query_1[_0x3167b0(0xd5)])(_0x58d913)));}var _0xc7c120=__assign({'fields':(0x0,helpers_2[_0x3167b0(0xdb)])(fields_1[_0x3167b0(0xd5)],'files'),'q':_0x4608d6,'supportsAllDrives':!![]},_0x14c538),_0x128efb=API_1[_0x3167b0(0xd5)]['list'];return helpers_1['googleApiRequest'][_0x3167b0(0xcd)](_0x128efb,_0x5770a2,_0xc7c120);}exports[a107_0x29cfde(0xd5)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/index.js b/plugins/google/api/drive/index.js index aac7b3e..23e3f04 100644 --- a/plugins/google/api/drive/index.js +++ b/plugins/google/api/drive/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports.api = exports.scopes = void 0; -var scopes_1 = require("./scopes"); -Object.defineProperty(exports, "scopes", { enumerable: true, get: function () { return __importDefault(scopes_1).default; } }); -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a108_0x5810d7=a108_0x14fa;(function(_0x424de0,_0x59b33d){var _0x27c7d8=a108_0x14fa,_0x5b848a=_0x424de0();while(!![]){try{var _0x43ac3c=-parseInt(_0x27c7d8(0xd7))/0x1+-parseInt(_0x27c7d8(0xd9))/0x2+-parseInt(_0x27c7d8(0xdb))/0x3*(parseInt(_0x27c7d8(0xd4))/0x4)+-parseInt(_0x27c7d8(0xcd))/0x5+-parseInt(_0x27c7d8(0xd1))/0x6+-parseInt(_0x27c7d8(0xd8))/0x7*(-parseInt(_0x27c7d8(0xd3))/0x8)+parseInt(_0x27c7d8(0xcf))/0x9;if(_0x43ac3c===_0x59b33d)break;else _0x5b848a['push'](_0x5b848a['shift']());}catch(_0x5be73e){_0x5b848a['push'](_0x5b848a['shift']());}}}(a108_0x3a7d,0x95038));function a108_0x14fa(_0x39bd21,_0x5c133d){var _0x3a7df5=a108_0x3a7d();return a108_0x14fa=function(_0x14fa9b,_0x493550){_0x14fa9b=_0x14fa9b-0xcb;var _0xa52d5d=_0x3a7df5[_0x14fa9b];return _0xa52d5d;},a108_0x14fa(_0x39bd21,_0x5c133d);}function a108_0x3a7d(){var _0x7ceafe=['defineProperty','default','906011mBsgoL','7TeWRNC','141268rIUrLU','api','47577BjEhhF','scopes','./API','5915390aWCNip','__importDefault','30065265DMoaOe','__esModule','5478024iWehKL','./scopes','6673048ODMTdP','124JyhHDN'];a108_0x3a7d=function(){return _0x7ceafe;};return a108_0x3a7d();}var __importDefault=this&&this[a108_0x5810d7(0xce)]||function(_0x41a0a3){var _0x5e6da2=a108_0x5810d7;return _0x41a0a3&&_0x41a0a3[_0x5e6da2(0xd0)]?_0x41a0a3:{'default':_0x41a0a3};};Object['defineProperty'](exports,a108_0x5810d7(0xd0),{'value':!![]}),exports[a108_0x5810d7(0xd6)]=exports[a108_0x5810d7(0xda)]=exports['scopes']=void 0x0;var scopes_1=require(a108_0x5810d7(0xd2));Object['defineProperty'](exports,a108_0x5810d7(0xcb),{'enumerable':!![],'get':function(){var _0x4b7bbb=a108_0x5810d7;return __importDefault(scopes_1)[_0x4b7bbb(0xd6)];}});var API_1=require(a108_0x5810d7(0xcc));Object[a108_0x5810d7(0xd5)](exports,'api',{'enumerable':!![],'get':function(){var _0x4ac5b2=a108_0x5810d7;return __importDefault(API_1)[_0x4ac5b2(0xd6)];}});var methods_1=require('./methods');Object[a108_0x5810d7(0xd5)](exports,'default',{'enumerable':!![],'get':function(){var _0x17103c=a108_0x5810d7;return __importDefault(methods_1)[_0x17103c(0xd6)];}}); \ No newline at end of file diff --git a/plugins/google/api/drive/methods.js b/plugins/google/api/drive/methods.js index b8c1dac..d215cc5 100644 --- a/plugins/google/api/drive/methods.js +++ b/plugins/google/api/drive/methods.js @@ -1,8 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var about_1 = require("./about"); -var permissions_1 = require("./permissions"); -exports.default = { - about: about_1.methods, - permissions: permissions_1.methods, -}; +'use strict';var a109_0x5b08f3=a109_0x326f;function a109_0x326f(_0x213adc,_0x28d306){var _0x33e7c8=a109_0x33e7();return a109_0x326f=function(_0x326f86,_0x45cad1){_0x326f86=_0x326f86-0x9f;var _0x3a351a=_0x33e7c8[_0x326f86];return _0x3a351a;},a109_0x326f(_0x213adc,_0x28d306);}(function(_0x3276fb,_0x1c074a){var _0x577a2b=a109_0x326f,_0x433134=_0x3276fb();while(!![]){try{var _0x5502c0=parseInt(_0x577a2b(0xac))/0x1*(-parseInt(_0x577a2b(0xa1))/0x2)+parseInt(_0x577a2b(0xae))/0x3+parseInt(_0x577a2b(0xa9))/0x4*(parseInt(_0x577a2b(0xa0))/0x5)+-parseInt(_0x577a2b(0x9f))/0x6*(parseInt(_0x577a2b(0xa6))/0x7)+parseInt(_0x577a2b(0xaa))/0x8*(-parseInt(_0x577a2b(0xa5))/0x9)+-parseInt(_0x577a2b(0xaf))/0xa*(parseInt(_0x577a2b(0xab))/0xb)+-parseInt(_0x577a2b(0xa8))/0xc*(-parseInt(_0x577a2b(0xa2))/0xd);if(_0x5502c0===_0x1c074a)break;else _0x433134['push'](_0x433134['shift']());}catch(_0x4055fb){_0x433134['push'](_0x433134['shift']());}}}(a109_0x33e7,0x53667));Object[a109_0x5b08f3(0xad)](exports,'__esModule',{'value':!![]});var about_1=require(a109_0x5b08f3(0xa3)),permissions_1=require(a109_0x5b08f3(0xa7));exports['default']={'about':about_1[a109_0x5b08f3(0xa4)],'permissions':permissions_1['methods']};function a109_0x33e7(){var _0x42a3ec=['36wGjsOU','833IYAdpv','./permissions','24isOYtm','8hyiEhM','481192JVfIyJ','1805848OMeftn','524045qbGKyp','defineProperty','1983411xsWvIc','10wtcZlZ','28194YpyTYE','531985mkbyUH','2sHiTvw','6211829MRbGca','./about','methods'];a109_0x33e7=function(){return _0x42a3ec;};return a109_0x33e7();} \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/API.js b/plugins/google/api/drive/permissions/API.js index ca4a627..cc5fa91 100644 --- a/plugins/google/api/drive/permissions/API.js +++ b/plugins/google/api/drive/permissions/API.js @@ -1,58 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Managing Permissions in Google Drive */ -exports.default = { - /** - * Google Drive API for Listing Permissions for a File or Shared Drive - * - * @module list - * @param {string} fileId - The ID of the shared drive / Folder - * @returns {TDriveUrlType} - API String for list route - */ - list: function (fileId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId, "/permissions"); - }, - /** - * Google Drive API for Getting all Permissions for a File or Shared Drive - * - * @module get - * @param {string} fileId - The ID of the File / Folder / shared drive - * @param {string} permissionId - The ID of the Permission - * @returns {TDriveUrlType} - API String for get Route - */ - get: function (fileId, permissionId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId, "/permissions/").concat(permissionId); - }, - /** - * Google Drive API for Creating Permissions for a File or Shared Drive - * - * @module create - * @param {string} fileId - The ID of the File / Folder / shared drive - * @returns {TDriveUrlType} - API String for create route - */ - create: function (fileId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId, "/permissions"); - }, - /** - * Google Drive API for Deleting Permissions for a File or Shared Drive - * - * @module update - * @param {string} fileId - The ID of the shared drive - * @param {string} permissionId - The ID of the Permission - * @returns {TDriveUrlType} - API String for delete route - */ - delete: function (fileId, permissionId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId, "/permissions/").concat(permissionId); - }, - /** - * Google Drive API for Updating Permissions for a File or Shared Drive - * - * @module update - * @param {string} fileId - The ID of the shared drive - * @param {string} permissionId - The ID of the Permission - * @returns {TDriveUrlType} - API String for update route - */ - update: function (fileId, permissionId) { - return "https://www.googleapis.com/drive/v3/files/".concat(fileId, "/permissions/").concat(permissionId); - }, -}; +'use strict';var a110_0x1d3206=a110_0xa67b;(function(_0x2c438c,_0x40929c){var _0x591111=a110_0xa67b,_0x3db4ef=_0x2c438c();while(!![]){try{var _0x3ca58c=parseInt(_0x591111(0x1da))/0x1+-parseInt(_0x591111(0x1dd))/0x2*(parseInt(_0x591111(0x1d7))/0x3)+parseInt(_0x591111(0x1d5))/0x4+parseInt(_0x591111(0x1de))/0x5+-parseInt(_0x591111(0x1d0))/0x6*(-parseInt(_0x591111(0x1db))/0x7)+parseInt(_0x591111(0x1d3))/0x8*(parseInt(_0x591111(0x1d1))/0x9)+parseInt(_0x591111(0x1dc))/0xa*(-parseInt(_0x591111(0x1d2))/0xb);if(_0x3ca58c===_0x40929c)break;else _0x3db4ef['push'](_0x3db4ef['shift']());}catch(_0x569d60){_0x3db4ef['push'](_0x3db4ef['shift']());}}}(a110_0x34b9,0x396a9));function a110_0x34b9(){var _0x6e5e15=['3776ZcmFuz','__esModule','1144356ucBQrI','https://www.googleapis.com/drive/v3/files/','393MSkNZN','concat','/permissions','201200eIkDti','7oZTflt','610VROGgO','1404rYExzU','1576855VdwSCh','defineProperty','/permissions/','1817022oRTpoA','342vulXlt','143594mPERnL'];a110_0x34b9=function(){return _0x6e5e15;};return a110_0x34b9();}function a110_0xa67b(_0x426e36,_0x496f1e){var _0x34b942=a110_0x34b9();return a110_0xa67b=function(_0xa67b38,_0x174df8){_0xa67b38=_0xa67b38-0x1ce;var _0x9350b1=_0x34b942[_0xa67b38];return _0x9350b1;},a110_0xa67b(_0x426e36,_0x496f1e);}Object[a110_0x1d3206(0x1ce)](exports,a110_0x1d3206(0x1d4),{'value':!![]}),exports['default']={'list':function(_0x3aa07c){var _0x529152=a110_0x1d3206;return _0x529152(0x1d6)[_0x529152(0x1d8)](_0x3aa07c,_0x529152(0x1d9));},'get':function(_0x9c7e79,_0x3be35c){var _0x54d56f=a110_0x1d3206;return _0x54d56f(0x1d6)[_0x54d56f(0x1d8)](_0x9c7e79,'/permissions/')[_0x54d56f(0x1d8)](_0x3be35c);},'create':function(_0x4fa1b8){var _0x246b65=a110_0x1d3206;return _0x246b65(0x1d6)[_0x246b65(0x1d8)](_0x4fa1b8,_0x246b65(0x1d9));},'delete':function(_0x1cdd5e,_0x17b7ad){var _0x5e6d22=a110_0x1d3206;return _0x5e6d22(0x1d6)[_0x5e6d22(0x1d8)](_0x1cdd5e,_0x5e6d22(0x1cf))[_0x5e6d22(0x1d8)](_0x17b7ad);},'update':function(_0x5d6c97,_0x28f948){var _0x59dea8=a110_0x1d3206;return _0x59dea8(0x1d6)[_0x59dea8(0x1d8)](_0x5d6c97,'/permissions/')['concat'](_0x28f948);}}; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/fields.js b/plugins/google/api/drive/permissions/fields.js index c3de039..29daf27 100644 --- a/plugins/google/api/drive/permissions/fields.js +++ b/plugins/google/api/drive/permissions/fields.js @@ -1,11 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = [ - 'id', - 'type', - 'emailAddress', - 'role', - 'domain', - 'photoLink', - 'permissionDetails', -]; +'use strict';var a111_0x1f93c1=a111_0xdfff;(function(_0x5036e2,_0x176c1d){var _0x5ef2d=a111_0xdfff,_0x23f66d=_0x5036e2();while(!![]){try{var _0x1308d5=parseInt(_0x5ef2d(0x1f2))/0x1*(-parseInt(_0x5ef2d(0x1f3))/0x2)+-parseInt(_0x5ef2d(0x1ee))/0x3+parseInt(_0x5ef2d(0x1f5))/0x4+parseInt(_0x5ef2d(0x1fb))/0x5+-parseInt(_0x5ef2d(0x1fc))/0x6+-parseInt(_0x5ef2d(0x1f6))/0x7+-parseInt(_0x5ef2d(0x1f9))/0x8*(-parseInt(_0x5ef2d(0x1fd))/0x9);if(_0x1308d5===_0x176c1d)break;else _0x23f66d['push'](_0x23f66d['shift']());}catch(_0x26cade){_0x23f66d['push'](_0x23f66d['shift']());}}}(a111_0x465f,0x2b6e5));function a111_0x465f(){var _0x5eff5c=['398dgriDi','1276eaAvoj','defineProperty','1373660KujfDY','1968316LaGjoz','__esModule','role','2573936NAbHYP','type','449135ByGzKf','149610dbqOBU','9ssRmwM','51132aSivdd','domain','permissionDetails','photoLink'];a111_0x465f=function(){return _0x5eff5c;};return a111_0x465f();}function a111_0xdfff(_0x26beca,_0x5ef379){var _0x465f3b=a111_0x465f();return a111_0xdfff=function(_0xdfff43,_0x39dbf9){_0xdfff43=_0xdfff43-0x1ee;var _0x2274c8=_0x465f3b[_0xdfff43];return _0x2274c8;},a111_0xdfff(_0x26beca,_0x5ef379);}Object[a111_0x1f93c1(0x1f4)](exports,a111_0x1f93c1(0x1f7),{'value':!![]}),exports['default']=['id',a111_0x1f93c1(0x1fa),'emailAddress',a111_0x1f93c1(0x1f8),a111_0x1f93c1(0x1ef),a111_0x1f93c1(0x1f1),a111_0x1f93c1(0x1f0)]; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/index.js b/plugins/google/api/drive/permissions/index.js index 9a7030d..38a6f26 100644 --- a/plugins/google/api/drive/permissions/index.js +++ b/plugins/google/api/drive/permissions/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.methods = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a112_0x10b88c=a112_0x3a84;function a112_0x3a84(_0x17892d,_0x3fba96){var _0x171638=a112_0x1716();return a112_0x3a84=function(_0x3a8447,_0x53f548){_0x3a8447=_0x3a8447-0x9f;var _0x131fc6=_0x171638[_0x3a8447];return _0x131fc6;},a112_0x3a84(_0x17892d,_0x3fba96);}(function(_0x1c3aa7,_0x5cae79){var _0xa20c6e=a112_0x3a84,_0x10c319=_0x1c3aa7();while(!![]){try{var _0x5285c0=-parseInt(_0xa20c6e(0xad))/0x1+-parseInt(_0xa20c6e(0xa6))/0x2+parseInt(_0xa20c6e(0xaa))/0x3*(parseInt(_0xa20c6e(0xa0))/0x4)+parseInt(_0xa20c6e(0xa4))/0x5+parseInt(_0xa20c6e(0xa1))/0x6+-parseInt(_0xa20c6e(0xa2))/0x7+-parseInt(_0xa20c6e(0xac))/0x8*(parseInt(_0xa20c6e(0xa5))/0x9);if(_0x5285c0===_0x5cae79)break;else _0x10c319['push'](_0x10c319['shift']());}catch(_0x161685){_0x10c319['push'](_0x10c319['shift']());}}}(a112_0x1716,0x7a8c6));function a112_0x1716(){var _0x28b7d6=['170352sqUgwm','api','__esModule','defineProperty','3NDocor','methods','740064TUkKhr','94651NpkDPX','./API','653928DYiSpf','1894854wcLpMM','1516109pXUDEA','default','2557945txobLV','9kdQVes'];a112_0x1716=function(){return _0x28b7d6;};return a112_0x1716();}var __importDefault=this&&this['__importDefault']||function(_0x58e114){return _0x58e114&&_0x58e114['__esModule']?_0x58e114:{'default':_0x58e114};};Object['defineProperty'](exports,a112_0x10b88c(0xa8),{'value':!![]}),exports['methods']=exports['api']=void 0x0;var API_1=require(a112_0x10b88c(0x9f));Object[a112_0x10b88c(0xa9)](exports,a112_0x10b88c(0xa7),{'enumerable':!![],'get':function(){var _0x9876fd=a112_0x10b88c;return __importDefault(API_1)[_0x9876fd(0xa3)];}});var methods_1=require('./methods');Object[a112_0x10b88c(0xa9)](exports,a112_0x10b88c(0xab),{'enumerable':!![],'get':function(){var _0x595759=a112_0x10b88c;return __importDefault(methods_1)[_0x595759(0xa3)];}}); \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/create.js b/plugins/google/api/drive/permissions/methods/create.js index 61b01a6..8a6d860 100644 --- a/plugins/google/api/drive/permissions/methods/create.js +++ b/plugins/google/api/drive/permissions/methods/create.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/permissions/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/permissions/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Lists all Permissions for a File / Folder / Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the File / Folder / Shared Drive - * @param {IDrivePermissionDetails} permissionDetails - Details of the Permission - * @returns {Promise>} - Promise Resolving to Created Permission Resource - */ -function default_1(token, fileId, permissionDetails) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var url = API_1.default.create(fileId); - return helpers_1.googleApiRequest.post(url, token, permissionDetails, params); -} -exports.default = default_1; +'use strict';var a113_0x3acd2d=a113_0x4367;(function(_0x192c80,_0x2d0c5e){var _0x2054d0=a113_0x4367,_0x56a513=_0x192c80();while(!![]){try{var _0x30a20c=-parseInt(_0x2054d0(0x198))/0x1*(parseInt(_0x2054d0(0x194))/0x2)+parseInt(_0x2054d0(0x19e))/0x3*(parseInt(_0x2054d0(0x18e))/0x4)+-parseInt(_0x2054d0(0x192))/0x5+parseInt(_0x2054d0(0x19a))/0x6*(-parseInt(_0x2054d0(0x19b))/0x7)+parseInt(_0x2054d0(0x1a1))/0x8*(-parseInt(_0x2054d0(0x190))/0x9)+parseInt(_0x2054d0(0x1a0))/0xa*(-parseInt(_0x2054d0(0x199))/0xb)+parseInt(_0x2054d0(0x19d))/0xc*(parseInt(_0x2054d0(0x197))/0xd);if(_0x30a20c===_0x2d0c5e)break;else _0x56a513['push'](_0x56a513['shift']());}catch(_0x5c0a80){_0x56a513['push'](_0x56a513['shift']());}}}(a113_0x5378,0x25305));function a113_0x5378(){var _0x524c04=['3284yEDbBH','../../../../../google/api/drive/permissions/fields','default','13FSErGf','13qStrYG','935RjuREr','1645902ngGXci','7iCgWef','../../../../../google/helpers','10171836RfQWry','15033wyAono','constructFields','7900TvulQl','424qlIPvb','52vaHElZ','__esModule','29961oqpkJb','__importDefault','1106105zQMqfI','../../../../../google/api/drive/permissions/API'];a113_0x5378=function(){return _0x524c04;};return a113_0x5378();}function a113_0x4367(_0x395435,_0x5b6cf9){var _0x5378c4=a113_0x5378();return a113_0x4367=function(_0x4367cc,_0x4d10d1){_0x4367cc=_0x4367cc-0x18e;var _0x9f1057=_0x5378c4[_0x4367cc];return _0x9f1057;},a113_0x4367(_0x395435,_0x5b6cf9);}var __importDefault=this&&this[a113_0x3acd2d(0x191)]||function(_0x5c0630){var _0x23a6dc=a113_0x3acd2d;return _0x5c0630&&_0x5c0630[_0x23a6dc(0x18f)]?_0x5c0630:{'default':_0x5c0630};};Object['defineProperty'](exports,a113_0x3acd2d(0x18f),{'value':!![]});var API_1=__importDefault(require(a113_0x3acd2d(0x193))),helpers_1=require(a113_0x3acd2d(0x19c)),fields_1=__importDefault(require(a113_0x3acd2d(0x195))),helpers_2=require('../../../../../google/helpers');function default_1(_0x3fabfe,_0x5b79c5,_0x4983a5){var _0x2446a5=a113_0x3acd2d,_0x57d2e7={'fields':(0x0,helpers_2[_0x2446a5(0x19f)])(fields_1['default'])},_0x176f79=API_1[_0x2446a5(0x196)]['create'](_0x5b79c5);return helpers_1['googleApiRequest']['post'](_0x176f79,_0x3fabfe,_0x4983a5,_0x57d2e7);}exports[a113_0x3acd2d(0x196)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/delete.js b/plugins/google/api/drive/permissions/methods/delete.js index e49fe37..0cb5646 100644 --- a/plugins/google/api/drive/permissions/methods/delete.js +++ b/plugins/google/api/drive/permissions/methods/delete.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/permissions/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/permissions/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Deletes a Permissions for a File / Folder / Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the File / Folder / Shared Drive - * @param {string} permissionId - ID of the Permission - * @returns {Promise} - Promise Resolving to void - */ -function default_1(token, fileId, permissionId) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var url = API_1.default.delete(fileId, permissionId); - return helpers_1.googleApiRequest.delete(url, token, params); -} -exports.default = default_1; +'use strict';var a114_0x5e4d55=a114_0x4a17;(function(_0x46426c,_0x8a69bd){var _0x527bfa=a114_0x4a17,_0x5d1dd6=_0x46426c();while(!![]){try{var _0x25f6f7=-parseInt(_0x527bfa(0x1a4))/0x1*(parseInt(_0x527bfa(0x1a6))/0x2)+-parseInt(_0x527bfa(0x1b3))/0x3*(-parseInt(_0x527bfa(0x1af))/0x4)+-parseInt(_0x527bfa(0x1ae))/0x5+parseInt(_0x527bfa(0x1a3))/0x6*(-parseInt(_0x527bfa(0x1ad))/0x7)+-parseInt(_0x527bfa(0x1a1))/0x8*(parseInt(_0x527bfa(0x1b0))/0x9)+parseInt(_0x527bfa(0x1ab))/0xa*(-parseInt(_0x527bfa(0x1b6))/0xb)+parseInt(_0x527bfa(0x1b1))/0xc*(parseInt(_0x527bfa(0x1a9))/0xd);if(_0x25f6f7===_0x8a69bd)break;else _0x5d1dd6['push'](_0x5d1dd6['shift']());}catch(_0x207726){_0x5d1dd6['push'](_0x5d1dd6['shift']());}}}(a114_0x44f0,0x71638));function a114_0x4a17(_0x3c0e9c,_0x14818b){var _0x44f0ef=a114_0x44f0();return a114_0x4a17=function(_0x4a17b5,_0x415866){_0x4a17b5=_0x4a17b5-0x1a1;var _0x2d8bb6=_0x44f0ef[_0x4a17b5];return _0x2d8bb6;},a114_0x4a17(_0x3c0e9c,_0x14818b);}var __importDefault=this&&this[a114_0x5e4d55(0x1a8)]||function(_0x4a819c){var _0x56954c=a114_0x5e4d55;return _0x4a819c&&_0x4a819c[_0x56954c(0x1a7)]?_0x4a819c:{'default':_0x4a819c};};Object[a114_0x5e4d55(0x1aa)](exports,a114_0x5e4d55(0x1a7),{'value':!![]});var API_1=__importDefault(require(a114_0x5e4d55(0x1ac))),helpers_1=require(a114_0x5e4d55(0x1a2)),fields_1=__importDefault(require(a114_0x5e4d55(0x1a5))),helpers_2=require('../../../../../google/helpers');function default_1(_0x26ad0b,_0x42f406,_0x4a8ce9){var _0x573e67=a114_0x5e4d55,_0xc1db5={'fields':(0x0,helpers_2[_0x573e67(0x1b5)])(fields_1[_0x573e67(0x1b2)])},_0x4cdbe0=API_1['default'][_0x573e67(0x1b4)](_0x42f406,_0x4a8ce9);return helpers_1['googleApiRequest']['delete'](_0x4cdbe0,_0x26ad0b,_0xc1db5);}function a114_0x44f0(){var _0x5eac9b=['369580EuYZWo','24pXrFni','72MYkzco','5076ZgUvlY','default','82914AzwAJK','delete','constructFields','11QfvvOh','270320jewHwV','../../../../../google/helpers','12qcfOsk','2309wOMfxG','../../../../../google/api/drive/permissions/fields','110rUecfp','__esModule','__importDefault','63453ydwGNF','defineProperty','5360840tcoxjU','../../../../../google/api/drive/permissions/API','2655576LrNZae'];a114_0x44f0=function(){return _0x5eac9b;};return a114_0x44f0();}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/get.js b/plugins/google/api/drive/permissions/methods/get.js index f06e705..c790ac9 100644 --- a/plugins/google/api/drive/permissions/methods/get.js +++ b/plugins/google/api/drive/permissions/methods/get.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/permissions/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/permissions/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Lists all Permissions for a File / Folder / Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the File / Folder / Shared Drive - * @param {string} permissionId - ID of the Permission - * @returns {Promise>} - Promise Resolving to Permissions - */ -function default_1(token, fileId, permissionId) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var url = API_1.default.get(fileId, permissionId); - return helpers_1.googleApiRequest.get(url, token, params); -} -exports.default = default_1; +'use strict';var a115_0x16eee6=a115_0x365e;(function(_0x169608,_0x5ce67e){var _0x3b47f6=a115_0x365e,_0x5c537d=_0x169608();while(!![]){try{var _0x37d928=-parseInt(_0x3b47f6(0xb2))/0x1*(parseInt(_0x3b47f6(0xa9))/0x2)+parseInt(_0x3b47f6(0xb4))/0x3*(-parseInt(_0x3b47f6(0xa4))/0x4)+-parseInt(_0x3b47f6(0xaf))/0x5*(parseInt(_0x3b47f6(0xb1))/0x6)+-parseInt(_0x3b47f6(0xa6))/0x7+parseInt(_0x3b47f6(0xa3))/0x8*(parseInt(_0x3b47f6(0xae))/0x9)+parseInt(_0x3b47f6(0xab))/0xa*(-parseInt(_0x3b47f6(0xb3))/0xb)+-parseInt(_0x3b47f6(0xa2))/0xc*(-parseInt(_0x3b47f6(0xb0))/0xd);if(_0x37d928===_0x5ce67e)break;else _0x5c537d['push'](_0x5c537d['shift']());}catch(_0x185fd0){_0x5c537d['push'](_0x5c537d['shift']());}}}(a115_0x5554,0xd25e1));var __importDefault=this&&this[a115_0x16eee6(0xaa)]||function(_0x4f6e9b){var _0x633f99=a115_0x16eee6;return _0x4f6e9b&&_0x4f6e9b[_0x633f99(0xa5)]?_0x4f6e9b:{'default':_0x4f6e9b};};Object['defineProperty'](exports,'__esModule',{'value':!![]});function a115_0x365e(_0xc8bb55,_0x4ff842){var _0x555496=a115_0x5554();return a115_0x365e=function(_0x365e81,_0x20aae7){_0x365e81=_0x365e81-0xa2;var _0x51bac3=_0x555496[_0x365e81];return _0x51bac3;},a115_0x365e(_0xc8bb55,_0x4ff842);}function a115_0x5554(){var _0x3a42a7=['45284DZtCIi','66814UAWzlz','1165884BPOwno','12KMBMml','1448VemXNg','8hAfPNx','__esModule','8520218oEiEay','get','googleApiRequest','2kaJmHh','__importDefault','2620pFJGZv','default','../../../../../google/helpers','47673YQqsbA','4139935zOHRgh','56705961DAxKwo','6ZIoxtA'];a115_0x5554=function(){return _0x3a42a7;};return a115_0x5554();}var API_1=__importDefault(require('../../../../../google/api/drive/permissions/API')),helpers_1=require('../../../../../google/helpers'),fields_1=__importDefault(require('../../../../../google/api/drive/permissions/fields')),helpers_2=require(a115_0x16eee6(0xad));function default_1(_0x35b2d7,_0x703fa5,_0x473163){var _0x3770ba=a115_0x16eee6,_0x10e1d1={'fields':(0x0,helpers_2['constructFields'])(fields_1[_0x3770ba(0xac)])},_0x175fb1=API_1[_0x3770ba(0xac)][_0x3770ba(0xa7)](_0x703fa5,_0x473163);return helpers_1[_0x3770ba(0xa8)][_0x3770ba(0xa7)](_0x175fb1,_0x35b2d7,_0x10e1d1);}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/index.js b/plugins/google/api/drive/permissions/methods/index.js index f75b120..7040c63 100644 --- a/plugins/google/api/drive/permissions/methods/index.js +++ b/plugins/google/api/drive/permissions/methods/index.js @@ -1,17 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var list_1 = __importDefault(require("./list")); -var get_1 = __importDefault(require("./get")); -var create_1 = __importDefault(require("./create")); -var update_1 = __importDefault(require("./update")); -var delete_1 = __importDefault(require("./delete")); -exports.default = { - list: list_1.default, - get: get_1.default, - create: create_1.default, - update: update_1.default, - delete: delete_1.default, -}; +'use strict';var a116_0x20a009=a116_0x5a48;(function(_0x4f1e0a,_0x39df66){var _0xc95529=a116_0x5a48,_0x4179a9=_0x4f1e0a();while(!![]){try{var _0x19c10c=-parseInt(_0xc95529(0x1c9))/0x1+parseInt(_0xc95529(0x1c6))/0x2+-parseInt(_0xc95529(0x1c8))/0x3*(parseInt(_0xc95529(0x1c4))/0x4)+-parseInt(_0xc95529(0x1ce))/0x5*(parseInt(_0xc95529(0x1d4))/0x6)+parseInt(_0xc95529(0x1cd))/0x7*(-parseInt(_0xc95529(0x1c3))/0x8)+parseInt(_0xc95529(0x1d0))/0x9*(-parseInt(_0xc95529(0x1d1))/0xa)+-parseInt(_0xc95529(0x1c5))/0xb*(-parseInt(_0xc95529(0x1cf))/0xc);if(_0x19c10c===_0x39df66)break;else _0x4179a9['push'](_0x4179a9['shift']());}catch(_0x54e05c){_0x4179a9['push'](_0x4179a9['shift']());}}}(a116_0x555d,0x4dfd6));function a116_0x5a48(_0x4d58c9,_0x279370){var _0x555d10=a116_0x555d();return a116_0x5a48=function(_0x5a48e5,_0x5b4dfb){_0x5a48e5=_0x5a48e5-0x1c2;var _0x232e90=_0x555d10[_0x5a48e5];return _0x232e90;},a116_0x5a48(_0x4d58c9,_0x279370);}var __importDefault=this&&this[a116_0x20a009(0x1d3)]||function(_0x2a4b9c){var _0x365ae4=a116_0x20a009;return _0x2a4b9c&&_0x2a4b9c[_0x365ae4(0x1cb)]?_0x2a4b9c:{'default':_0x2a4b9c};};Object['defineProperty'](exports,a116_0x20a009(0x1cb),{'value':!![]});function a116_0x555d(){var _0x3541ee=['./create','32844CebXBx','161692yHhkQu','default','__esModule','./list','1872213SgRhji','14675bqMOUr','4621044rsHWiR','72BdCZVv','573830BYhwEV','./delete','__importDefault','108lqoOea','./update','8zyCxIo','88xnsLdR','33cEKQCn','692172oVfVXm'];a116_0x555d=function(){return _0x3541ee;};return a116_0x555d();}var list_1=__importDefault(require(a116_0x20a009(0x1cc))),get_1=__importDefault(require('./get')),create_1=__importDefault(require(a116_0x20a009(0x1c7))),update_1=__importDefault(require(a116_0x20a009(0x1c2))),delete_1=__importDefault(require(a116_0x20a009(0x1d2)));exports[a116_0x20a009(0x1ca)]={'list':list_1[a116_0x20a009(0x1ca)],'get':get_1[a116_0x20a009(0x1ca)],'create':create_1['default'],'update':update_1[a116_0x20a009(0x1ca)],'delete':delete_1[a116_0x20a009(0x1ca)]}; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/list.js b/plugins/google/api/drive/permissions/methods/list.js index edb0d6c..41d3968 100644 --- a/plugins/google/api/drive/permissions/methods/list.js +++ b/plugins/google/api/drive/permissions/methods/list.js @@ -1,27 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/permissions/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/permissions/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Lists all Permissions for a File / Folder / Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - The ID of the File / Folder / Shared Drive - * @returns {Promise>} - Promise Resolving to Permissions List - */ -function default_1(token, fileId) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default, 'permissions'), - }; - var url = API_1.default.list(fileId); - return helpers_1.googleApiRequest.get(url, token, params); -} -exports.default = default_1; +'use strict';var a117_0x2ed9ab=a117_0x5f2f;(function(_0x27549e,_0x4767e3){var _0x57ad71=a117_0x5f2f,_0x90af0f=_0x27549e();while(!![]){try{var _0xe0a907=parseInt(_0x57ad71(0x107))/0x1*(-parseInt(_0x57ad71(0x102))/0x2)+parseInt(_0x57ad71(0xff))/0x3+-parseInt(_0x57ad71(0xf7))/0x4+parseInt(_0x57ad71(0xfc))/0x5+-parseInt(_0x57ad71(0x105))/0x6+parseInt(_0x57ad71(0x103))/0x7*(-parseInt(_0x57ad71(0xf6))/0x8)+-parseInt(_0x57ad71(0xf5))/0x9*(-parseInt(_0x57ad71(0x109))/0xa);if(_0xe0a907===_0x4767e3)break;else _0x90af0f['push'](_0x90af0f['shift']());}catch(_0x187d82){_0x90af0f['push'](_0x90af0f['shift']());}}}(a117_0x4916,0x89488));function a117_0x4916(){var _0x59c9c0=['constructFields','default','2488824EzHXFO','permissions','__importDefault','2tfXBJh','4584202juZRsP','../../../../../google/helpers','5557548awdzHC','get','397063GARFhY','../../../../../google/api/drive/permissions/fields','18030mwcPOp','11943TKrstm','8tHqCKW','4178580RoChQj','__esModule','googleApiRequest','list','../../../../../google/api/drive/permissions/API','1814875aPmkQm'];a117_0x4916=function(){return _0x59c9c0;};return a117_0x4916();}var __importDefault=this&&this[a117_0x2ed9ab(0x101)]||function(_0xd1bbd6){var _0x18d6e8=a117_0x2ed9ab;return _0xd1bbd6&&_0xd1bbd6[_0x18d6e8(0xf8)]?_0xd1bbd6:{'default':_0xd1bbd6};};function a117_0x5f2f(_0x52160d,_0x6463f){var _0x4916bc=a117_0x4916();return a117_0x5f2f=function(_0x5f2f63,_0x1613e7){_0x5f2f63=_0x5f2f63-0xf5;var _0x37e51b=_0x4916bc[_0x5f2f63];return _0x37e51b;},a117_0x5f2f(_0x52160d,_0x6463f);}Object['defineProperty'](exports,'__esModule',{'value':!![]});var API_1=__importDefault(require(a117_0x2ed9ab(0xfb))),helpers_1=require(a117_0x2ed9ab(0x104)),fields_1=__importDefault(require(a117_0x2ed9ab(0x108))),helpers_2=require(a117_0x2ed9ab(0x104));function default_1(_0xb6f5ca,_0x208e7c){var _0x137160=a117_0x2ed9ab,_0x2647d8={'fields':(0x0,helpers_2[_0x137160(0xfd)])(fields_1[_0x137160(0xfe)],_0x137160(0x100))},_0x1fb833=API_1[_0x137160(0xfe)][_0x137160(0xfa)](_0x208e7c);return helpers_1[_0x137160(0xf9)][_0x137160(0x106)](_0x1fb833,_0xb6f5ca,_0x2647d8);}exports[a117_0x2ed9ab(0xfe)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/permissions/methods/update.js b/plugins/google/api/drive/permissions/methods/update.js index 6953522..6831848 100644 --- a/plugins/google/api/drive/permissions/methods/update.js +++ b/plugins/google/api/drive/permissions/methods/update.js @@ -1,29 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/drive/permissions/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Other Helpers -var fields_1 = __importDefault(require("../../../../../google/api/drive/permissions/fields")); -var helpers_2 = require("../../../../../google/helpers"); -/** - * Deletes a Permissions for a File / Folder / Shared Drive - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} fileId - ID of the File / Folder / Shared Drive - * @param {string} permissionId - ID of the Permission - * @param {Partial} patchedDetails - Details to be Updated - * @returns {Promise} - Promise Resolving to void - */ -function default_1(token, fileId, permissionId, patchedDetails) { - var params = { - fields: (0, helpers_2.constructFields)(fields_1.default), - }; - var url = API_1.default.delete(fileId, permissionId); - return helpers_1.googleApiRequest.patch(url, token, patchedDetails, params); -} -exports.default = default_1; +'use strict';function a118_0x2ed7(_0x5e7907,_0xe4bb7a){var _0x26e7c1=a118_0x26e7();return a118_0x2ed7=function(_0x2ed7ff,_0x4df8e0){_0x2ed7ff=_0x2ed7ff-0xe5;var _0x36b124=_0x26e7c1[_0x2ed7ff];return _0x36b124;},a118_0x2ed7(_0x5e7907,_0xe4bb7a);}var a118_0x4ef8de=a118_0x2ed7;(function(_0x174bb6,_0x53ddd0){var _0x30aeff=a118_0x2ed7,_0x1338d8=_0x174bb6();while(!![]){try{var _0x488dad=-parseInt(_0x30aeff(0xe7))/0x1+parseInt(_0x30aeff(0xec))/0x2+parseInt(_0x30aeff(0xea))/0x3*(-parseInt(_0x30aeff(0xe6))/0x4)+parseInt(_0x30aeff(0xe8))/0x5*(-parseInt(_0x30aeff(0xe9))/0x6)+-parseInt(_0x30aeff(0xf2))/0x7+-parseInt(_0x30aeff(0xed))/0x8+parseInt(_0x30aeff(0xeb))/0x9*(parseInt(_0x30aeff(0xee))/0xa);if(_0x488dad===_0x53ddd0)break;else _0x1338d8['push'](_0x1338d8['shift']());}catch(_0x4a4b86){_0x1338d8['push'](_0x1338d8['shift']());}}}(a118_0x26e7,0xe2d12));var __importDefault=this&&this[a118_0x4ef8de(0xf5)]||function(_0x531e17){var _0x250a14=a118_0x4ef8de;return _0x531e17&&_0x531e17[_0x250a14(0xf4)]?_0x531e17:{'default':_0x531e17};};Object[a118_0x4ef8de(0xe5)](exports,a118_0x4ef8de(0xf4),{'value':!![]});function a118_0x26e7(){var _0x31180a=['5RCBRzp','1844886SFUbGn','67908jcNjMO','1562796YqlYmO','1077406YilQVB','12426840JYOeyw','340nUmkHa','../../../../../google/helpers','patch','constructFields','11726029xpDjaf','../../../../../google/api/drive/permissions/fields','__esModule','__importDefault','default','defineProperty','120PbsClf','1298494SyfVPR'];a118_0x26e7=function(){return _0x31180a;};return a118_0x26e7();}var API_1=__importDefault(require('../../../../../google/api/drive/permissions/API')),helpers_1=require(a118_0x4ef8de(0xef)),fields_1=__importDefault(require(a118_0x4ef8de(0xf3))),helpers_2=require(a118_0x4ef8de(0xef));function default_1(_0x292729,_0x3f5d70,_0x6dfb16,_0x54dfc5){var _0x2d0b8a=a118_0x4ef8de,_0x4cd260={'fields':(0x0,helpers_2[_0x2d0b8a(0xf1)])(fields_1[_0x2d0b8a(0xf6)])},_0x2bd46d=API_1[_0x2d0b8a(0xf6)]['delete'](_0x3f5d70,_0x6dfb16);return helpers_1['googleApiRequest'][_0x2d0b8a(0xf0)](_0x2bd46d,_0x292729,_0x54dfc5,_0x4cd260);}exports[a118_0x4ef8de(0xf6)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/drive/scopes.js b/plugins/google/api/drive/scopes.js index 676eec4..a9f9162 100644 --- a/plugins/google/api/drive/scopes.js +++ b/plugins/google/api/drive/scopes.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var scopes = [ - 'https://www.googleapis.com/auth/drive', - 'https://www.googleapis.com/auth/drive.file', - 'https://www.googleapis.com/auth/drive.metadata', - 'https://www.googleapis.com/auth/drive.appdata', - 'https://www.googleapis.com/auth/drive.activity.readonly', -]; -exports.default = scopes; +'use strict';var a119_0x23d310=a119_0x3fd6;function a119_0xdd48(){var _0x3695c4=['38409503HUEVFu','1ZRxMhk','259EfJjez','1718036mGpPtR','110xrAAkd','5374688oGFiEu','defineProperty','410820sYPbke','https://www.googleapis.com/auth/drive.metadata','3893412xpgtvA','3PaxgSh','105108PkXRMW','908946bRouIf','https://www.googleapis.com/auth/drive.appdata','https://www.googleapis.com/auth/drive.file'];a119_0xdd48=function(){return _0x3695c4;};return a119_0xdd48();}(function(_0x3f5a20,_0x2cb18b){var _0x299320=a119_0x3fd6,_0x57d2a6=_0x3f5a20();while(!![]){try{var _0x2eeab7=parseInt(_0x299320(0x100))/0x1*(-parseInt(_0x299320(0x102))/0x2)+-parseInt(_0x299320(0xfa))/0x3*(parseInt(_0x299320(0xf9))/0x4)+parseInt(_0x299320(0xf7))/0x5+-parseInt(_0x299320(0xfb))/0x6*(-parseInt(_0x299320(0x101))/0x7)+-parseInt(_0x299320(0x104))/0x8+-parseInt(_0x299320(0xfc))/0x9*(parseInt(_0x299320(0x103))/0xa)+parseInt(_0x299320(0xff))/0xb;if(_0x2eeab7===_0x2cb18b)break;else _0x57d2a6['push'](_0x57d2a6['shift']());}catch(_0x3ffe0b){_0x57d2a6['push'](_0x57d2a6['shift']());}}}(a119_0xdd48,0x942f2));function a119_0x3fd6(_0x520f81,_0x47658b){var _0xdd489f=a119_0xdd48();return a119_0x3fd6=function(_0x3fd647,_0x2a429f){_0x3fd647=_0x3fd647-0xf7;var _0x3a2200=_0xdd489f[_0x3fd647];return _0x3a2200;},a119_0x3fd6(_0x520f81,_0x47658b);}Object[a119_0x23d310(0x105)](exports,'__esModule',{'value':!![]});var scopes=['https://www.googleapis.com/auth/drive',a119_0x23d310(0xfe),a119_0x23d310(0xf8),a119_0x23d310(0xfd),'https://www.googleapis.com/auth/drive.activity.readonly'];exports['default']=scopes; \ No newline at end of file diff --git a/plugins/google/api/iam/API.js b/plugins/google/api/iam/API.js index b4f8af2..add8f59 100644 --- a/plugins/google/api/iam/API.js +++ b/plugins/google/api/iam/API.js @@ -1,12 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.api = void 0; -var projects_1 = require("./projects"); -var service_account_1 = require("./service-account"); -/** - * Google IAM API Routes - */ -exports.api = { - projects: projects_1.api, - serviceAccount: service_account_1.api, -}; +'use strict';var a120_0x280377=a120_0x4133;(function(_0x3df433,_0x4ebd49){var _0x1e9e5b=a120_0x4133,_0x33d5a2=_0x3df433();while(!![]){try{var _0x1a54b5=-parseInt(_0x1e9e5b(0x154))/0x1*(parseInt(_0x1e9e5b(0x160))/0x2)+parseInt(_0x1e9e5b(0x15d))/0x3*(parseInt(_0x1e9e5b(0x15c))/0x4)+-parseInt(_0x1e9e5b(0x158))/0x5*(-parseInt(_0x1e9e5b(0x15b))/0x6)+-parseInt(_0x1e9e5b(0x15a))/0x7*(-parseInt(_0x1e9e5b(0x15f))/0x8)+-parseInt(_0x1e9e5b(0x159))/0x9*(parseInt(_0x1e9e5b(0x152))/0xa)+parseInt(_0x1e9e5b(0x151))/0xb*(-parseInt(_0x1e9e5b(0x155))/0xc)+parseInt(_0x1e9e5b(0x153))/0xd*(parseInt(_0x1e9e5b(0x15e))/0xe);if(_0x1a54b5===_0x4ebd49)break;else _0x33d5a2['push'](_0x33d5a2['shift']());}catch(_0x3cde28){_0x33d5a2['push'](_0x33d5a2['shift']());}}}(a120_0x1915,0x80fbb));function a120_0x1915(){var _0x195e41=['498707fXwIwC','70nKsLXz','130zbwCJt','195RgpCSe','252PYCyoU','api','./projects','5QzSAXY','972900iWGFfE','17311qCvnAX','2486118TRNOUg','92ywOncI','66702tOkogJ','2112908SyoejY','1552hFbUFw','6950pJTFYD','__esModule'];a120_0x1915=function(){return _0x195e41;};return a120_0x1915();}function a120_0x4133(_0x210fdf,_0xb0ec08){var _0x191582=a120_0x1915();return a120_0x4133=function(_0x4133e2,_0x16406a){_0x4133e2=_0x4133e2-0x150;var _0x57adf4=_0x191582[_0x4133e2];return _0x57adf4;},a120_0x4133(_0x210fdf,_0xb0ec08);}Object['defineProperty'](exports,a120_0x280377(0x150),{'value':!![]}),exports[a120_0x280377(0x156)]=void 0x0;var projects_1=require(a120_0x280377(0x157)),service_account_1=require('./service-account');exports[a120_0x280377(0x156)]={'projects':projects_1[a120_0x280377(0x156)],'serviceAccount':service_account_1[a120_0x280377(0x156)]}; \ No newline at end of file diff --git a/plugins/google/api/iam/index.js b/plugins/google/api/iam/index.js index fdbd9fb..44a2768 100644 --- a/plugins/google/api/iam/index.js +++ b/plugins/google/api/iam/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = exports.api = exports.scopes = void 0; -var scopes_1 = require("./scopes"); -Object.defineProperty(exports, "scopes", { enumerable: true, get: function () { return __importDefault(scopes_1).default; } }); -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return API_1.api; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a121_0xd00940=a121_0x5a84;(function(_0x2e1840,_0x511206){var _0x14870d=a121_0x5a84,_0x423c7f=_0x2e1840();while(!![]){try{var _0x2509a2=-parseInt(_0x14870d(0x76))/0x1*(parseInt(_0x14870d(0x6d))/0x2)+parseInt(_0x14870d(0x6b))/0x3*(-parseInt(_0x14870d(0x6c))/0x4)+parseInt(_0x14870d(0x73))/0x5+parseInt(_0x14870d(0x6f))/0x6+parseInt(_0x14870d(0x75))/0x7+parseInt(_0x14870d(0x6e))/0x8+-parseInt(_0x14870d(0x77))/0x9;if(_0x2509a2===_0x511206)break;else _0x423c7f['push'](_0x423c7f['shift']());}catch(_0x2116cb){_0x423c7f['push'](_0x423c7f['shift']());}}}(a121_0x5c0c,0x96b5b));var __importDefault=this&&this[a121_0xd00940(0x74)]||function(_0x284b5b){var _0x353f6c=a121_0xd00940;return _0x284b5b&&_0x284b5b[_0x353f6c(0x69)]?_0x284b5b:{'default':_0x284b5b};};Object[a121_0xd00940(0x71)](exports,'__esModule',{'value':!![]}),exports[a121_0xd00940(0x72)]=exports[a121_0xd00940(0x6a)]=exports[a121_0xd00940(0x67)]=void 0x0;var scopes_1=require('./scopes');Object[a121_0xd00940(0x71)](exports,a121_0xd00940(0x67),{'enumerable':!![],'get':function(){return __importDefault(scopes_1)['default'];}});function a121_0x5a84(_0x290787,_0x2ed65e){var _0x5c0c4d=a121_0x5c0c();return a121_0x5a84=function(_0x5a84bf,_0x2e288f){_0x5a84bf=_0x5a84bf-0x67;var _0x2aed9c=_0x5c0c4d[_0x5a84bf];return _0x2aed9c;},a121_0x5a84(_0x290787,_0x2ed65e);}var API_1=require(a121_0xd00940(0x68));Object[a121_0xd00940(0x71)](exports,a121_0xd00940(0x6a),{'enumerable':!![],'get':function(){var _0x196a38=a121_0xd00940;return API_1[_0x196a38(0x6a)];}});var methods_1=require(a121_0xd00940(0x70));Object[a121_0xd00940(0x71)](exports,a121_0xd00940(0x72),{'enumerable':!![],'get':function(){var _0x42c8b1=a121_0xd00940;return __importDefault(methods_1)[_0x42c8b1(0x72)];}});function a121_0x5c0c(){var _0x5ece9e=['__importDefault','7112126XJiTeG','1063NdUPXK','14087322LdGvFK','scopes','./API','__esModule','api','27maTQVh','62336sPzMuO','1086KRWwWI','4195632JdNNFx','1171650wgNqwF','./methods','defineProperty','default','5821415axQHhA'];a121_0x5c0c=function(){return _0x5ece9e;};return a121_0x5c0c();} \ No newline at end of file diff --git a/plugins/google/api/iam/methods.js b/plugins/google/api/iam/methods.js index 9f1d7fb..c858f0c 100644 --- a/plugins/google/api/iam/methods.js +++ b/plugins/google/api/iam/methods.js @@ -1,11 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var projects_1 = require("./projects"); -var service_account_1 = require("./service-account"); -/** - * IAM API Methods - */ -exports.default = { - projects: projects_1.methods, - serviceAccount: service_account_1.methods, -}; +'use strict';var a122_0x349a12=a122_0xeb87;(function(_0x9778e4,_0x19e2b8){var _0x5296e4=a122_0xeb87,_0x5ab2b5=_0x9778e4();while(!![]){try{var _0x310ef9=-parseInt(_0x5296e4(0x120))/0x1+parseInt(_0x5296e4(0x116))/0x2+-parseInt(_0x5296e4(0x119))/0x3+-parseInt(_0x5296e4(0x115))/0x4*(-parseInt(_0x5296e4(0x11b))/0x5)+-parseInt(_0x5296e4(0x121))/0x6*(-parseInt(_0x5296e4(0x11c))/0x7)+-parseInt(_0x5296e4(0x11a))/0x8*(parseInt(_0x5296e4(0x117))/0x9)+parseInt(_0x5296e4(0x118))/0xa;if(_0x310ef9===_0x19e2b8)break;else _0x5ab2b5['push'](_0x5ab2b5['shift']());}catch(_0x470908){_0x5ab2b5['push'](_0x5ab2b5['shift']());}}}(a122_0x2711,0x9e4c5));function a122_0x2711(){var _0x4d3560=['2203976xSmLGy','241659LzOMeL','10719930wWshiG','1882722IHbmMI','184wJXuhu','68825WjqJTP','2193800iFYOGm','methods','default','defineProperty','1086190HrYzoG','12yaqiWG','__esModule','./service-account','52AeTxVd'];a122_0x2711=function(){return _0x4d3560;};return a122_0x2711();}Object[a122_0x349a12(0x11f)](exports,a122_0x349a12(0x122),{'value':!![]});var projects_1=require('./projects'),service_account_1=require(a122_0x349a12(0x123));function a122_0xeb87(_0x39737d,_0x22eb88){var _0x271103=a122_0x2711();return a122_0xeb87=function(_0xeb8773,_0x298df6){_0xeb8773=_0xeb8773-0x115;var _0x299aee=_0x271103[_0xeb8773];return _0x299aee;},a122_0xeb87(_0x39737d,_0x22eb88);}exports[a122_0x349a12(0x11e)]={'projects':projects_1[a122_0x349a12(0x11d)],'serviceAccount':service_account_1[a122_0x349a12(0x11d)]}; \ No newline at end of file diff --git a/plugins/google/api/iam/projects/API.js b/plugins/google/api/iam/projects/API.js index a25eb2c..11674f8 100644 --- a/plugins/google/api/iam/projects/API.js +++ b/plugins/google/api/iam/projects/API.js @@ -1,21 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Managing Google IAM - Projects in Google Cloud Console */ -exports.default = { - /** - * IAM API for Listing Projects in Google Cloud Console - * - * @module list - * @returns {TCloudApiUrlType} - API String for list route - */ - list: 'https://cloudresourcemanager.googleapis.com/v1/projects', - /** - * IAM API for Getting Details about a Project in Google Cloud Console - * - * @param {string} projectID - Resource Name of the Project - * @returns {TCloudApiUrlType} - API String for get Route - */ - get: function (projectID) { - return "https://cloudresourcemanager.googleapis.com/v1/projects/".concat(projectID); - }, -}; +'use strict';var a123_0x277075=a123_0x529e;function a123_0x529e(_0x48ca30,_0x1cd6a7){var _0x3e48b6=a123_0x3e48();return a123_0x529e=function(_0x529ef5,_0x318fdf){_0x529ef5=_0x529ef5-0x101;var _0x4fc5a3=_0x3e48b6[_0x529ef5];return _0x4fc5a3;},a123_0x529e(_0x48ca30,_0x1cd6a7);}(function(_0x4ef0e8,_0x35a4fe){var _0x58a627=a123_0x529e,_0x2fbed2=_0x4ef0e8();while(!![]){try{var _0x48c39c=parseInt(_0x58a627(0x108))/0x1+parseInt(_0x58a627(0x103))/0x2+-parseInt(_0x58a627(0x102))/0x3+-parseInt(_0x58a627(0x104))/0x4*(parseInt(_0x58a627(0x10e))/0x5)+-parseInt(_0x58a627(0x105))/0x6+parseInt(_0x58a627(0x101))/0x7+-parseInt(_0x58a627(0x107))/0x8*(-parseInt(_0x58a627(0x10c))/0x9);if(_0x48c39c===_0x35a4fe)break;else _0x2fbed2['push'](_0x2fbed2['shift']());}catch(_0x5c85c7){_0x2fbed2['push'](_0x2fbed2['shift']());}}}(a123_0x3e48,0x5ae35));Object['defineProperty'](exports,a123_0x277075(0x109),{'value':!![]}),exports[a123_0x277075(0x10b)]={'list':a123_0x277075(0x106),'get':function(_0x7bfc95){var _0x11d367=a123_0x277075;return _0x11d367(0x10d)[_0x11d367(0x10a)](_0x7bfc95);}};function a123_0x3e48(){var _0x3a7eca=['277536TfEqNJ','205586dafEci','899088hiKyQE','2242092NOnQuk','https://cloudresourcemanager.googleapis.com/v1/projects','176wkDFuo','605417hdhjXa','__esModule','concat','default','40617jlrkBW','https://cloudresourcemanager.googleapis.com/v1/projects/','5txQhuS','1790229jisgpz'];a123_0x3e48=function(){return _0x3a7eca;};return a123_0x3e48();} \ No newline at end of file diff --git a/plugins/google/api/iam/projects/index.js b/plugins/google/api/iam/projects/index.js index 9a7030d..1705a4c 100644 --- a/plugins/google/api/iam/projects/index.js +++ b/plugins/google/api/iam/projects/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.methods = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a124_0xbf44e7=a124_0x3a5b;(function(_0x2a2e6e,_0x17f88f){var _0xbc3b6c=a124_0x3a5b,_0x469ffe=_0x2a2e6e();while(!![]){try{var _0x4b1ea7=parseInt(_0xbc3b6c(0xae))/0x1*(parseInt(_0xbc3b6c(0xb6))/0x2)+-parseInt(_0xbc3b6c(0xb8))/0x3*(parseInt(_0xbc3b6c(0xba))/0x4)+parseInt(_0xbc3b6c(0xb4))/0x5+-parseInt(_0xbc3b6c(0xbd))/0x6*(-parseInt(_0xbc3b6c(0xb2))/0x7)+parseInt(_0xbc3b6c(0xb5))/0x8+-parseInt(_0xbc3b6c(0xbc))/0x9*(parseInt(_0xbc3b6c(0xbe))/0xa)+-parseInt(_0xbc3b6c(0xac))/0xb;if(_0x4b1ea7===_0x17f88f)break;else _0x469ffe['push'](_0x469ffe['shift']());}catch(_0x53b0e6){_0x469ffe['push'](_0x469ffe['shift']());}}}(a124_0x52fb,0x380c1));function a124_0x52fb(){var _0x355dfc=['__esModule','2DuWXLJ','./API','__importDefault','api','1883PInIyX','methods','1592400sEMFvk','1395216DBUfCp','422054hbkaRp','defineProperty','87nOmUCB','./methods','4328rKpUAY','default','2848257iDqzuA','5826LqYpFf','10tLDBOK','6585865FbkmUF'];a124_0x52fb=function(){return _0x355dfc;};return a124_0x52fb();}var __importDefault=this&&this[a124_0xbf44e7(0xb0)]||function(_0x17b6d4){var _0x205b4b=a124_0xbf44e7;return _0x17b6d4&&_0x17b6d4[_0x205b4b(0xad)]?_0x17b6d4:{'default':_0x17b6d4};};Object[a124_0xbf44e7(0xb7)](exports,'__esModule',{'value':!![]}),exports[a124_0xbf44e7(0xb3)]=exports[a124_0xbf44e7(0xb1)]=void 0x0;var API_1=require(a124_0xbf44e7(0xaf));Object['defineProperty'](exports,'api',{'enumerable':!![],'get':function(){var _0x57d8bf=a124_0xbf44e7;return __importDefault(API_1)[_0x57d8bf(0xbb)];}});var methods_1=require(a124_0xbf44e7(0xb9));function a124_0x3a5b(_0x586fc3,_0x278aa1){var _0x52fb46=a124_0x52fb();return a124_0x3a5b=function(_0x3a5b6d,_0xc5791c){_0x3a5b6d=_0x3a5b6d-0xac;var _0x5e07e4=_0x52fb46[_0x3a5b6d];return _0x5e07e4;},a124_0x3a5b(_0x586fc3,_0x278aa1);}Object[a124_0xbf44e7(0xb7)](exports,a124_0xbf44e7(0xb3),{'enumerable':!![],'get':function(){return __importDefault(methods_1)['default'];}}); \ No newline at end of file diff --git a/plugins/google/api/iam/projects/methods/get.js b/plugins/google/api/iam/projects/methods/get.js index 022edaf..e2868bc 100644 --- a/plugins/google/api/iam/projects/methods/get.js +++ b/plugins/google/api/iam/projects/methods/get.js @@ -1,20 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/projects/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Gets Details about a Project in Google Cloud Console - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectId - for which Details is to be fetched - * @returns {Promise>} - Promise Resolving to Projects List - */ -function default_1(token, projectId) { - return helpers_1.googleApiRequest.get(API_1.default.get(projectId), token); -} -exports.default = default_1; +'use strict';function a125_0x2c23(){var _0x4f0075=['default','38900XTnquk','198UMkONA','5304552kyIWPW','../../../../../google/helpers','152540hLLezJ','186uCSkqU','2684643aKauJH','251923CKpEIk','__importDefault','65NyUEER','googleApiRequest','get','__esModule','../../../../../google/api/iam/projects/API','1171287ZxQXHq','180916hhMreO'];a125_0x2c23=function(){return _0x4f0075;};return a125_0x2c23();}var a125_0x276702=a125_0x1693;(function(_0x166da7,_0x968923){var _0x2f1f73=a125_0x1693,_0x1ed389=_0x166da7();while(!![]){try{var _0x3c04da=-parseInt(_0x2f1f73(0x199))/0x1+-parseInt(_0x2f1f73(0x18b))/0x2+-parseInt(_0x2f1f73(0x191))/0x3+-parseInt(_0x2f1f73(0x189))/0x4*(-parseInt(_0x2f1f73(0x194))/0x5)+-parseInt(_0x2f1f73(0x190))/0x6*(-parseInt(_0x2f1f73(0x192))/0x7)+parseInt(_0x2f1f73(0x18d))/0x8+-parseInt(_0x2f1f73(0x18c))/0x9*(-parseInt(_0x2f1f73(0x18f))/0xa);if(_0x3c04da===_0x968923)break;else _0x1ed389['push'](_0x1ed389['shift']());}catch(_0x12f507){_0x1ed389['push'](_0x1ed389['shift']());}}}(a125_0x2c23,0x968e3));function a125_0x1693(_0x1c1bef,_0xdb4178){var _0x2c23e3=a125_0x2c23();return a125_0x1693=function(_0x169330,_0x36d32e){_0x169330=_0x169330-0x189;var _0x579cc4=_0x2c23e3[_0x169330];return _0x579cc4;},a125_0x1693(_0x1c1bef,_0xdb4178);}var __importDefault=this&&this[a125_0x276702(0x193)]||function(_0x2e1c11){var _0x368ed8=a125_0x276702;return _0x2e1c11&&_0x2e1c11[_0x368ed8(0x197)]?_0x2e1c11:{'default':_0x2e1c11};};Object['defineProperty'](exports,a125_0x276702(0x197),{'value':!![]});var API_1=__importDefault(require(a125_0x276702(0x198))),helpers_1=require(a125_0x276702(0x18e));function default_1(_0x134c4e,_0x56699e){var _0x4463a8=a125_0x276702;return helpers_1[_0x4463a8(0x195)][_0x4463a8(0x196)](API_1['default'][_0x4463a8(0x196)](_0x56699e),_0x134c4e);}exports[a125_0x276702(0x18a)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/projects/methods/index.js b/plugins/google/api/iam/projects/methods/index.js index 025a588..7808cc1 100644 --- a/plugins/google/api/iam/projects/methods/index.js +++ b/plugins/google/api/iam/projects/methods/index.js @@ -1,14 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var get_1 = __importDefault(require("./get")); -var list_1 = __importDefault(require("./list")); -/** - * IAM - Projects API Methods - */ -exports.default = { - get: get_1.default, - list: list_1.default, -}; +'use strict';var a126_0x3c0028=a126_0x5e5b;function a126_0x52c6(){var _0x1fd56f=['338970YoAoEF','13367400PJJYrP','884634VblsQC','1358092jSFuas','2IcIMBe','./get','70eBRrNE','5974396jzezTs','__esModule','defineProperty','default','4845300lePTmn','./list','2635578qUmFhc'];a126_0x52c6=function(){return _0x1fd56f;};return a126_0x52c6();}(function(_0x3c6981,_0x37c99b){var _0x35dfb5=a126_0x5e5b,_0x3bac07=_0x3c6981();while(!![]){try{var _0x509fb6=-parseInt(_0x35dfb5(0x143))/0x1*(parseInt(_0x35dfb5(0x142))/0x2)+-parseInt(_0x35dfb5(0x14d))/0x3+parseInt(_0x35dfb5(0x146))/0x4+parseInt(_0x35dfb5(0x14a))/0x5+-parseInt(_0x35dfb5(0x14f))/0x6*(parseInt(_0x35dfb5(0x145))/0x7)+parseInt(_0x35dfb5(0x14e))/0x8+-parseInt(_0x35dfb5(0x14c))/0x9;if(_0x509fb6===_0x37c99b)break;else _0x3bac07['push'](_0x3bac07['shift']());}catch(_0x326dd4){_0x3bac07['push'](_0x3bac07['shift']());}}}(a126_0x52c6,0xda926));function a126_0x5e5b(_0xa727fd,_0x158a28){var _0x52c63c=a126_0x52c6();return a126_0x5e5b=function(_0x5e5b6d,_0xc5edd5){_0x5e5b6d=_0x5e5b6d-0x142;var _0x32765f=_0x52c63c[_0x5e5b6d];return _0x32765f;},a126_0x5e5b(_0xa727fd,_0x158a28);}var __importDefault=this&&this['__importDefault']||function(_0x42026b){var _0x5c15df=a126_0x5e5b;return _0x42026b&&_0x42026b[_0x5c15df(0x147)]?_0x42026b:{'default':_0x42026b};};Object[a126_0x3c0028(0x148)](exports,a126_0x3c0028(0x147),{'value':!![]});var get_1=__importDefault(require(a126_0x3c0028(0x144))),list_1=__importDefault(require(a126_0x3c0028(0x14b)));exports['default']={'get':get_1[a126_0x3c0028(0x149)],'list':list_1['default']}; \ No newline at end of file diff --git a/plugins/google/api/iam/projects/methods/list.js b/plugins/google/api/iam/projects/methods/list.js index 1916499..4e566dd 100644 --- a/plugins/google/api/iam/projects/methods/list.js +++ b/plugins/google/api/iam/projects/methods/list.js @@ -1,19 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/projects/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Lists all Projects in Google Cloud Console - * - * @param {ITokenDoc} token - Token Document from Database - * @returns {Promise>} - Promise Resolving to Projects List - */ -function default_1(token) { - return helpers_1.googleApiRequest.get(API_1.default.list, token); -} -exports.default = default_1; +'use strict';var a127_0x4fbe78=a127_0x4ea2;function a127_0x3fba(){var _0x527a81=['4162472UEafJG','389991Pyhjof','19603233UIPfcM','564536wrFPKd','list','../../../../../google/helpers','googleApiRequest','2186532GEmHFN','1330488Nqihbl','__importDefault','5497168dXdwBQ','5xMRvYn','default','96ZQXYRe','defineProperty','__esModule'];a127_0x3fba=function(){return _0x527a81;};return a127_0x3fba();}(function(_0x48a718,_0x25216b){var _0x431e27=a127_0x4ea2,_0x587e88=_0x48a718();while(!![]){try{var _0x355a91=-parseInt(_0x431e27(0x1de))/0x1+-parseInt(_0x431e27(0x1e4))/0x2+-parseInt(_0x431e27(0x1e5))/0x3+-parseInt(_0x431e27(0x1e7))/0x4*(parseInt(_0x431e27(0x1d8))/0x5)+-parseInt(_0x431e27(0x1da))/0x6*(-parseInt(_0x431e27(0x1e0))/0x7)+parseInt(_0x431e27(0x1dd))/0x8+parseInt(_0x431e27(0x1df))/0x9;if(_0x355a91===_0x25216b)break;else _0x587e88['push'](_0x587e88['shift']());}catch(_0x2a3bb5){_0x587e88['push'](_0x587e88['shift']());}}}(a127_0x3fba,0xa7e99));function a127_0x4ea2(_0x158c85,_0xf0f824){var _0x3fba9c=a127_0x3fba();return a127_0x4ea2=function(_0x4ea2ed,_0x4558bc){_0x4ea2ed=_0x4ea2ed-0x1d8;var _0x300a2b=_0x3fba9c[_0x4ea2ed];return _0x300a2b;},a127_0x4ea2(_0x158c85,_0xf0f824);}var __importDefault=this&&this[a127_0x4fbe78(0x1e6)]||function(_0x5d0893){return _0x5d0893&&_0x5d0893['__esModule']?_0x5d0893:{'default':_0x5d0893};};Object[a127_0x4fbe78(0x1db)](exports,a127_0x4fbe78(0x1dc),{'value':!![]});var API_1=__importDefault(require('../../../../../google/api/iam/projects/API')),helpers_1=require(a127_0x4fbe78(0x1e2));function default_1(_0x2db98a){var _0x4a0e6a=a127_0x4fbe78;return helpers_1[_0x4a0e6a(0x1e3)]['get'](API_1[_0x4a0e6a(0x1d9)][_0x4a0e6a(0x1e1)],_0x2db98a);}exports[a127_0x4fbe78(0x1d9)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/scopes.js b/plugins/google/api/iam/scopes.js index c00fa0c..74b7679 100644 --- a/plugins/google/api/iam/scopes.js +++ b/plugins/google/api/iam/scopes.js @@ -1,5 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = [ - 'https://www.googleapis.com/auth/cloud-platform', -]; +'use strict';function a128_0x5805(){var _0x17eb30=['defineProperty','9516825ZMEFNY','2783693AIYbxJ','5704isGBdQ','1197699brwCcH','532128lPnRSQ','30LWLCMB','__esModule','https://www.googleapis.com/auth/cloud-platform','default','10fRjEMF','989832UXSHiI','12YnyYPR','1330XvFofS','531282KfKeAZ'];a128_0x5805=function(){return _0x17eb30;};return a128_0x5805();}var a128_0x4a9ec2=a128_0x4c1b;(function(_0x4a750c,_0x211db4){var _0x5cc828=a128_0x4c1b,_0x5576a9=_0x4a750c();while(!![]){try{var _0x2de066=parseInt(_0x5cc828(0xb1))/0x1+parseInt(_0x5cc828(0xaa))/0x2*(parseInt(_0x5cc828(0xac))/0x3)+parseInt(_0x5cc828(0xb2))/0x4+-parseInt(_0x5cc828(0xa8))/0x5*(-parseInt(_0x5cc828(0xa9))/0x6)+parseInt(_0x5cc828(0xab))/0x7*(-parseInt(_0x5cc828(0xb0))/0x8)+-parseInt(_0x5cc828(0xae))/0x9+parseInt(_0x5cc828(0xb3))/0xa*(-parseInt(_0x5cc828(0xaf))/0xb);if(_0x2de066===_0x211db4)break;else _0x5576a9['push'](_0x5576a9['shift']());}catch(_0x3ea669){_0x5576a9['push'](_0x5576a9['shift']());}}}(a128_0x5805,0xbc453));function a128_0x4c1b(_0x374873,_0x3897e5){var _0x5805e6=a128_0x5805();return a128_0x4c1b=function(_0x4c1b02,_0x3cb5ac){_0x4c1b02=_0x4c1b02-0xa6;var _0x5c2ffc=_0x5805e6[_0x4c1b02];return _0x5c2ffc;},a128_0x4c1b(_0x374873,_0x3897e5);}Object[a128_0x4a9ec2(0xad)](exports,a128_0x4a9ec2(0xb4),{'value':!![]}),exports[a128_0x4a9ec2(0xa7)]=[a128_0x4a9ec2(0xa6)]; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/API.js b/plugins/google/api/iam/service-account/API.js index 22e5a3a..5551f10 100644 --- a/plugins/google/api/iam/service-account/API.js +++ b/plugins/google/api/iam/service-account/API.js @@ -1,69 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** API Routes for Managing Google IAM - Service Accounts */ -exports.default = { - /** - * IAM API for Creating Service Account - * - * @module create - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @returns {TIAMApiUrlType} - API String for Create Route - */ - create: function (projectID) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts"); - }, - /** - * IAM API for Deleting Service Account - * - * @module delete - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @param {string} account - Unique email of Service Account - * @returns {TIAMApiUrlType} - API String for Delete Route - */ - delete: function (projectID, account) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts/").concat(account); - }, - /** - * IAM API for Disabling Service Account - * - * @module disable - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @param {string} account - Unique email of Service Account - * @returns {TIAMApiUrlType} - API String for disable Route - */ - disable: function (projectID, account) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts/").concat(account, ":disable"); - }, - /** - * IAM API for Enabling Service Account - * - * @module enable - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @param {string} account - Unique email of Service Account - * @returns {TIAMApiUrlType} - API String for enable Route - */ - enable: function (projectID, account) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts/").concat(account, ":enable"); - }, - /** - * IAM API for Getting Details about Service Account - * - * @module get - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @param {string} account - Unique email of Service Account - * @returns {TIAMApiUrlType} - API String for get Route - */ - get: function (projectID, account) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts/").concat(account); - }, - /** - * IAM API for Listing Service Accounts - * - * @module list - * @param {string} projectID - Resource Name of the Project Associated with the Service Accounts - * @returns {TIAMApiUrlType} - API String for list Route - */ - list: function (projectID) { - return "https://iam.googleapis.com/v1/projects/".concat(projectID, "/serviceAccounts"); - }, -}; +'use strict';var a129_0x4d213a=a129_0x5373;function a129_0x5373(_0x56fd41,_0x426573){var _0x16f78a=a129_0x16f7();return a129_0x5373=function(_0x5373d4,_0x58a912){_0x5373d4=_0x5373d4-0x13e;var _0x49eb0c=_0x16f78a[_0x5373d4];return _0x49eb0c;},a129_0x5373(_0x56fd41,_0x426573);}(function(_0xae47ef,_0x552bcf){var _0x51b7b8=a129_0x5373,_0x45714f=_0xae47ef();while(!![]){try{var _0x20b250=parseInt(_0x51b7b8(0x141))/0x1*(parseInt(_0x51b7b8(0x14d))/0x2)+parseInt(_0x51b7b8(0x143))/0x3*(parseInt(_0x51b7b8(0x140))/0x4)+-parseInt(_0x51b7b8(0x14c))/0x5+-parseInt(_0x51b7b8(0x13f))/0x6*(parseInt(_0x51b7b8(0x14a))/0x7)+-parseInt(_0x51b7b8(0x14e))/0x8*(-parseInt(_0x51b7b8(0x142))/0x9)+-parseInt(_0x51b7b8(0x145))/0xa+parseInt(_0x51b7b8(0x147))/0xb*(parseInt(_0x51b7b8(0x150))/0xc);if(_0x20b250===_0x552bcf)break;else _0x45714f['push'](_0x45714f['shift']());}catch(_0x2b4c56){_0x45714f['push'](_0x45714f['shift']());}}}(a129_0x16f7,0xcf57c));function a129_0x16f7(){var _0x17b13d=['738EqerJV','7364lXdBHs','3755ZyMCuI','123867FJfdBR','303CwDDUk',':enable','7344560WzIMQe','https://iam.googleapis.com/v1/projects/','9595619lTIOnR',':disable','concat','95137yiiepi','/serviceAccounts','7643390ETwFjw','60XYKYKq','72WhESBI','__esModule','60sTzDpj','defineProperty','/serviceAccounts/'];a129_0x16f7=function(){return _0x17b13d;};return a129_0x16f7();}Object[a129_0x4d213a(0x151)](exports,a129_0x4d213a(0x14f),{'value':!![]}),exports['default']={'create':function(_0x12105f){var _0x7c5541=a129_0x4d213a;return _0x7c5541(0x146)['concat'](_0x12105f,'/serviceAccounts');},'delete':function(_0x3dfbfb,_0x49851a){var _0x25d73d=a129_0x4d213a;return _0x25d73d(0x146)[_0x25d73d(0x149)](_0x3dfbfb,_0x25d73d(0x13e))[_0x25d73d(0x149)](_0x49851a);},'disable':function(_0x42ed3d,_0x33e32c){var _0xb5a40b=a129_0x4d213a;return _0xb5a40b(0x146)[_0xb5a40b(0x149)](_0x42ed3d,_0xb5a40b(0x13e))[_0xb5a40b(0x149)](_0x33e32c,_0xb5a40b(0x148));},'enable':function(_0x960935,_0x46c123){var _0x258c21=a129_0x4d213a;return _0x258c21(0x146)['concat'](_0x960935,_0x258c21(0x13e))[_0x258c21(0x149)](_0x46c123,_0x258c21(0x144));},'get':function(_0x273b35,_0x1c9646){var _0x36ab9e=a129_0x4d213a;return'https://iam.googleapis.com/v1/projects/'['concat'](_0x273b35,_0x36ab9e(0x13e))[_0x36ab9e(0x149)](_0x1c9646);},'list':function(_0x1d5820){var _0x138dd2=a129_0x4d213a;return'https://iam.googleapis.com/v1/projects/'['concat'](_0x1d5820,_0x138dd2(0x14b));}}; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/index.js b/plugins/google/api/iam/service-account/index.js index 9a7030d..ebbc515 100644 --- a/plugins/google/api/iam/service-account/index.js +++ b/plugins/google/api/iam/service-account/index.js @@ -1,10 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.methods = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var methods_1 = require("./methods"); -Object.defineProperty(exports, "methods", { enumerable: true, get: function () { return __importDefault(methods_1).default; } }); +'use strict';var a130_0x2c0f5f=a130_0x29f8;function a130_0x3b18(){var _0x39787b=['659867FenOro','34506KsysDf','2092284PYMIBV','methods','defineProperty','223498fZUbDV','33KOiAYo','__importDefault','1815165SrBoBj','__esModule','2703712FGNOCv','./methods','api','./API','4934655FRZkfS','511EinUoH','default'];a130_0x3b18=function(){return _0x39787b;};return a130_0x3b18();}function a130_0x29f8(_0x372347,_0x32ee5f){var _0x3b1868=a130_0x3b18();return a130_0x29f8=function(_0x29f831,_0xe35d68){_0x29f831=_0x29f831-0x143;var _0x5d498f=_0x3b1868[_0x29f831];return _0x5d498f;},a130_0x29f8(_0x372347,_0x32ee5f);}(function(_0x1f8283,_0x471f29){var _0x30296e=a130_0x29f8,_0x137631=_0x1f8283();while(!![]){try{var _0x40fbd2=-parseInt(_0x30296e(0x152))/0x1+parseInt(_0x30296e(0x146))/0x2*(parseInt(_0x30296e(0x147))/0x3)+-parseInt(_0x30296e(0x143))/0x4+parseInt(_0x30296e(0x14f))/0x5+-parseInt(_0x30296e(0x153))/0x6*(parseInt(_0x30296e(0x150))/0x7)+parseInt(_0x30296e(0x14b))/0x8+-parseInt(_0x30296e(0x149))/0x9;if(_0x40fbd2===_0x471f29)break;else _0x137631['push'](_0x137631['shift']());}catch(_0x34d4eb){_0x137631['push'](_0x137631['shift']());}}}(a130_0x3b18,0xb7078));var __importDefault=this&&this[a130_0x2c0f5f(0x148)]||function(_0x3fbdd0){return _0x3fbdd0&&_0x3fbdd0['__esModule']?_0x3fbdd0:{'default':_0x3fbdd0};};Object[a130_0x2c0f5f(0x145)](exports,a130_0x2c0f5f(0x14a),{'value':!![]}),exports[a130_0x2c0f5f(0x144)]=exports[a130_0x2c0f5f(0x14d)]=void 0x0;var API_1=require(a130_0x2c0f5f(0x14e));Object[a130_0x2c0f5f(0x145)](exports,a130_0x2c0f5f(0x14d),{'enumerable':!![],'get':function(){var _0x5e22fd=a130_0x2c0f5f;return __importDefault(API_1)[_0x5e22fd(0x151)];}});var methods_1=require(a130_0x2c0f5f(0x14c));Object[a130_0x2c0f5f(0x145)](exports,a130_0x2c0f5f(0x144),{'enumerable':!![],'get':function(){var _0x122a61=a130_0x2c0f5f;return __importDefault(methods_1)[_0x122a61(0x151)];}}); \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/create.js b/plugins/google/api/iam/service-account/methods/create.js index de7f288..b19612b 100644 --- a/plugins/google/api/iam/service-account/methods/create.js +++ b/plugins/google/api/iam/service-account/methods/create.js @@ -1,47 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// UUID -var nanoid_1 = require("nanoid"); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -// Code -var ALPHAS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; -var NUMS = '0123456789'; -var ALPHANUMS = "".concat(ALPHAS).concat(NUMS); -var LENGTH = 6; -var alphaUid = (0, nanoid_1.customAlphabet)(ALPHAS, LENGTH); -var alphaNumUid = (0, nanoid_1.customAlphabet)(ALPHANUMS, LENGTH); -/** - * Generates a Unique Service Account ID Following the Google Regexp - * - * @returns {string} - Unique Service Account ID - */ -function generateAccountId() { - var firstPart = alphaUid(); - var secondPart = alphaNumUid(); - var thirdPart = alphaNumUid(); - return "".concat(firstPart, "-").concat(secondPart, "-").concat(thirdPart); -} -/** - * Creates a Service Account in a Particular Project - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service account is to be Created - * @param {IServiceAccountDetails} serviceAccountDetails - Object Containing Details of the Service Account - * @returns {Promise>} - Promise Resolving to Details of Created Service Account - */ -function default_1(token, projectID, serviceAccountDetails) { - var uid = generateAccountId(); - var apiUrl = API_1.default.create(projectID); - var data = { - accountId: uid, - serviceAccount: serviceAccountDetails, - }; - return helpers_1.googleApiRequest.post(apiUrl, token, data); -} -exports.default = default_1; +'use strict';function a131_0x49c8(){var _0x4784eb=['googleApiRequest','8899264nbvQrv','0123456789','34041aHaNww','../../../../../google/helpers','defineProperty','1928620EkSGTY','3blaIAI','1819034nGxZcD','customAlphabet','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','105660ievuiz','../../../../../google/api/iam/service-account/API','__importDefault','nanoid','944HjOHvl','__esModule','6181155Kqudxn','default','concat','10xUdEPj','180hDNUxT','create','659557uLxgDC','post'];a131_0x49c8=function(){return _0x4784eb;};return a131_0x49c8();}var a131_0x526afc=a131_0xb08a;(function(_0x4fd81b,_0x500df6){var _0x15e03f=a131_0xb08a,_0x3783cc=_0x4fd81b();while(!![]){try{var _0x247967=parseInt(_0x15e03f(0x12e))/0x1+parseInt(_0x15e03f(0x138))/0x2+parseInt(_0x15e03f(0x137))/0x3*(parseInt(_0x15e03f(0x136))/0x4)+-parseInt(_0x15e03f(0x13b))/0x5*(parseInt(_0x15e03f(0x12c))/0x6)+-parseInt(_0x15e03f(0x133))/0x7*(-parseInt(_0x15e03f(0x126))/0x8)+parseInt(_0x15e03f(0x128))/0x9*(-parseInt(_0x15e03f(0x12b))/0xa)+-parseInt(_0x15e03f(0x131))/0xb;if(_0x247967===_0x500df6)break;else _0x3783cc['push'](_0x3783cc['shift']());}catch(_0x8fae7e){_0x3783cc['push'](_0x3783cc['shift']());}}}(a131_0x49c8,0x78eb4));var __importDefault=this&&this[a131_0x526afc(0x13d)]||function(_0x4a74ce){var _0x2aceb8=a131_0x526afc;return _0x4a74ce&&_0x4a74ce[_0x2aceb8(0x127)]?_0x4a74ce:{'default':_0x4a74ce};};Object[a131_0x526afc(0x135)](exports,a131_0x526afc(0x127),{'value':!![]});var nanoid_1=require(a131_0x526afc(0x125)),API_1=__importDefault(require(a131_0x526afc(0x13c))),helpers_1=require(a131_0x526afc(0x134)),ALPHAS=a131_0x526afc(0x13a),NUMS=a131_0x526afc(0x132),ALPHANUMS=''[a131_0x526afc(0x12a)](ALPHAS)['concat'](NUMS),LENGTH=0x6,alphaUid=(0x0,nanoid_1[a131_0x526afc(0x139)])(ALPHAS,LENGTH),alphaNumUid=(0x0,nanoid_1[a131_0x526afc(0x139)])(ALPHANUMS,LENGTH);function generateAccountId(){var _0x6c38d2=a131_0x526afc,_0x40f88b=alphaUid(),_0x10c8ad=alphaNumUid(),_0x43e44a=alphaNumUid();return''['concat'](_0x40f88b,'-')[_0x6c38d2(0x12a)](_0x10c8ad,'-')[_0x6c38d2(0x12a)](_0x43e44a);}function default_1(_0x475e4f,_0x39a3c4,_0x39f0a3){var _0x399815=a131_0x526afc,_0x344d81=generateAccountId(),_0x263559=API_1[_0x399815(0x129)][_0x399815(0x12d)](_0x39a3c4),_0x57e740={'accountId':_0x344d81,'serviceAccount':_0x39f0a3};return helpers_1[_0x399815(0x130)][_0x399815(0x12f)](_0x263559,_0x475e4f,_0x57e740);}function a131_0xb08a(_0x41c38f,_0x5c2ac3){var _0x49c818=a131_0x49c8();return a131_0xb08a=function(_0xb08a07,_0x500c1b){_0xb08a07=_0xb08a07-0x125;var _0x56bf35=_0x49c818[_0xb08a07];return _0x56bf35;},a131_0xb08a(_0x41c38f,_0x5c2ac3);}exports[a131_0x526afc(0x129)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/delete.js b/plugins/google/api/iam/service-account/methods/delete.js index a1fb4e6..6857138 100644 --- a/plugins/google/api/iam/service-account/methods/delete.js +++ b/plugins/google/api/iam/service-account/methods/delete.js @@ -1,22 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Deletes a Service Account in the Project - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service accounts are to be fetched - * @param {string} serviceAccEmail - Unique Email or ID of Service Account - * @returns {Promise} - Promise Resolving to Deleted Response - */ -function default_1(token, projectID, serviceAccEmail) { - var apiUrl = API_1.default.delete(projectID, serviceAccEmail); - return helpers_1.googleApiRequest.delete(apiUrl, token); -} -exports.default = default_1; +'use strict';var a132_0x499079=a132_0xc7f9;(function(_0x1e2d6f,_0x4646c4){var _0x17c099=a132_0xc7f9,_0x301f33=_0x1e2d6f();while(!![]){try{var _0x4a1ce9=-parseInt(_0x17c099(0x152))/0x1+parseInt(_0x17c099(0x159))/0x2*(-parseInt(_0x17c099(0x14b))/0x3)+parseInt(_0x17c099(0x14d))/0x4+-parseInt(_0x17c099(0x156))/0x5*(parseInt(_0x17c099(0x155))/0x6)+-parseInt(_0x17c099(0x150))/0x7*(parseInt(_0x17c099(0x158))/0x8)+parseInt(_0x17c099(0x15a))/0x9*(parseInt(_0x17c099(0x153))/0xa)+parseInt(_0x17c099(0x157))/0xb;if(_0x4a1ce9===_0x4646c4)break;else _0x301f33['push'](_0x301f33['shift']());}catch(_0x33b2a8){_0x301f33['push'](_0x301f33['shift']());}}}(a132_0x590e,0x7bdaf));function a132_0x590e(){var _0x51f15f=['2665172BxHyFx','__esModule','../../../../../google/helpers','1728741VrCPHZ','googleApiRequest','278425asgfdB','4338810UUSECd','../../../../../google/api/iam/service-account/API','2996940izEJdK','5zXimBB','11630146lBENMl','8sFlkaz','2taTmTa','9AQVovQ','__importDefault','defineProperty','delete','1875813TQHfsZ','default'];a132_0x590e=function(){return _0x51f15f;};return a132_0x590e();}var __importDefault=this&&this[a132_0x499079(0x148)]||function(_0x53ef11){var _0x5e3586=a132_0x499079;return _0x53ef11&&_0x53ef11[_0x5e3586(0x14e)]?_0x53ef11:{'default':_0x53ef11};};function a132_0xc7f9(_0x47d6c2,_0x134093){var _0x590e67=a132_0x590e();return a132_0xc7f9=function(_0xc7f9e,_0x2eb006){_0xc7f9e=_0xc7f9e-0x148;var _0x38eb89=_0x590e67[_0xc7f9e];return _0x38eb89;},a132_0xc7f9(_0x47d6c2,_0x134093);}Object[a132_0x499079(0x149)](exports,a132_0x499079(0x14e),{'value':!![]});var API_1=__importDefault(require(a132_0x499079(0x154))),helpers_1=require(a132_0x499079(0x14f));function default_1(_0x5187aa,_0x448e7d,_0x5341de){var _0x18ec65=a132_0x499079,_0xc6836=API_1[_0x18ec65(0x14c)]['delete'](_0x448e7d,_0x5341de);return helpers_1[_0x18ec65(0x151)][_0x18ec65(0x14a)](_0xc6836,_0x5187aa);}exports[a132_0x499079(0x14c)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/disable.js b/plugins/google/api/iam/service-account/methods/disable.js index ec17d46..c34a8ca 100644 --- a/plugins/google/api/iam/service-account/methods/disable.js +++ b/plugins/google/api/iam/service-account/methods/disable.js @@ -1,22 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Disables a Service Account Temporarirly - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service accounts are to be fetched - * @param {string} serviceAccEmail - Unique Email or ID of Service Account - * @returns {Promise} - Promise Resolving to Response of the Request - */ -function default_1(token, projectID, serviceAccEmail) { - var apiUrl = API_1.default.disable(projectID, serviceAccEmail); - return helpers_1.googleApiRequest.post(apiUrl, token); -} -exports.default = default_1; +'use strict';var a133_0x87e413=a133_0x400d;(function(_0x7ed78e,_0x460f4b){var _0x18efba=a133_0x400d,_0x10f21b=_0x7ed78e();while(!![]){try{var _0x3250bc=parseInt(_0x18efba(0xb0))/0x1+-parseInt(_0x18efba(0xb4))/0x2*(parseInt(_0x18efba(0xac))/0x3)+-parseInt(_0x18efba(0xaf))/0x4*(parseInt(_0x18efba(0xab))/0x5)+-parseInt(_0x18efba(0xae))/0x6*(parseInt(_0x18efba(0xb2))/0x7)+parseInt(_0x18efba(0xb3))/0x8+-parseInt(_0x18efba(0xa3))/0x9*(-parseInt(_0x18efba(0xa9))/0xa)+parseInt(_0x18efba(0xad))/0xb;if(_0x3250bc===_0x460f4b)break;else _0x10f21b['push'](_0x10f21b['shift']());}catch(_0x2cbe4a){_0x10f21b['push'](_0x10f21b['shift']());}}}(a133_0x174a,0xc46a4));var __importDefault=this&&this[a133_0x87e413(0xa5)]||function(_0x2e0340){return _0x2e0340&&_0x2e0340['__esModule']?_0x2e0340:{'default':_0x2e0340};};function a133_0x400d(_0x3300db,_0x4ccb82){var _0x174a87=a133_0x174a();return a133_0x400d=function(_0x400d7c,_0x3d4c7d){_0x400d7c=_0x400d7c-0xa2;var _0xe4ed22=_0x174a87[_0x400d7c];return _0xe4ed22;},a133_0x400d(_0x3300db,_0x4ccb82);}Object[a133_0x87e413(0xa8)](exports,a133_0x87e413(0xb1),{'value':!![]});function a133_0x174a(){var _0x407902=['post','defineProperty','8412010NAruer','disable','4645hWnRhu','16602duJnYD','15140598bPwktA','996ncrThS','3580kgCFDj','654690bbmgJO','__esModule','12418KorVyW','3267536MCDldp','488mmVTQw','default','9RgHDiD','googleApiRequest','__importDefault','../../../../../google/api/iam/service-account/API'];a133_0x174a=function(){return _0x407902;};return a133_0x174a();}var API_1=__importDefault(require(a133_0x87e413(0xa6))),helpers_1=require('../../../../../google/helpers');function default_1(_0x2ad4dd,_0xa7f609,_0x40b87e){var _0x3ceebe=a133_0x87e413,_0x54bb69=API_1['default'][_0x3ceebe(0xaa)](_0xa7f609,_0x40b87e);return helpers_1[_0x3ceebe(0xa4)][_0x3ceebe(0xa7)](_0x54bb69,_0x2ad4dd);}exports[a133_0x87e413(0xa2)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/enable.js b/plugins/google/api/iam/service-account/methods/enable.js index 866d436..4208030 100644 --- a/plugins/google/api/iam/service-account/methods/enable.js +++ b/plugins/google/api/iam/service-account/methods/enable.js @@ -1,22 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Enables a Service Account if it is Disabled - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service accounts are to be fetched - * @param {string} serviceAccEmail - Unique Email or ID of Service Account - * @returns {Promise} - Promise Resolving to Response of the Request - */ -function default_1(token, projectID, serviceAccEmail) { - var apiUrl = API_1.default.enable(projectID, serviceAccEmail); - return helpers_1.googleApiRequest.post(apiUrl, token); -} -exports.default = default_1; +'use strict';var a134_0x11ef11=a134_0x2d7d;(function(_0x1724c3,_0x50db80){var _0x52edf1=a134_0x2d7d,_0x5a6dd6=_0x1724c3();while(!![]){try{var _0x4e14f1=-parseInt(_0x52edf1(0x90))/0x1+parseInt(_0x52edf1(0x95))/0x2+parseInt(_0x52edf1(0x92))/0x3+parseInt(_0x52edf1(0x96))/0x4+parseInt(_0x52edf1(0x93))/0x5+parseInt(_0x52edf1(0x8e))/0x6*(parseInt(_0x52edf1(0x97))/0x7)+-parseInt(_0x52edf1(0x9b))/0x8;if(_0x4e14f1===_0x50db80)break;else _0x5a6dd6['push'](_0x5a6dd6['shift']());}catch(_0x3b060c){_0x5a6dd6['push'](_0x5a6dd6['shift']());}}}(a134_0x3bd3,0x856d0));function a134_0x3bd3(){var _0x42126c=['default','583293IVztJS','../../../../../google/helpers','1157349scVVyW','2760800mnJiiH','__esModule','842036WXFred','775048wIXxTq','5747rvcKvM','post','defineProperty','googleApiRequest','7869288ZdXepf','4098fwpFlC'];a134_0x3bd3=function(){return _0x42126c;};return a134_0x3bd3();}var __importDefault=this&&this['__importDefault']||function(_0x1e7176){return _0x1e7176&&_0x1e7176['__esModule']?_0x1e7176:{'default':_0x1e7176};};function a134_0x2d7d(_0x446d5f,_0x4da9f5){var _0x3bd36a=a134_0x3bd3();return a134_0x2d7d=function(_0x2d7dba,_0x27496b){_0x2d7dba=_0x2d7dba-0x8e;var _0x338d9f=_0x3bd36a[_0x2d7dba];return _0x338d9f;},a134_0x2d7d(_0x446d5f,_0x4da9f5);}Object[a134_0x11ef11(0x99)](exports,a134_0x11ef11(0x94),{'value':!![]});var API_1=__importDefault(require('../../../../../google/api/iam/service-account/API')),helpers_1=require(a134_0x11ef11(0x91));function default_1(_0x12e7ed,_0x51caf0,_0x3928cd){var _0xb5981=a134_0x11ef11,_0x44c32b=API_1[_0xb5981(0x8f)]['enable'](_0x51caf0,_0x3928cd);return helpers_1[_0xb5981(0x9a)][_0xb5981(0x98)](_0x44c32b,_0x12e7ed);}exports[a134_0x11ef11(0x8f)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/get.js b/plugins/google/api/iam/service-account/methods/get.js index 5cc95fb..76a6004 100644 --- a/plugins/google/api/iam/service-account/methods/get.js +++ b/plugins/google/api/iam/service-account/methods/get.js @@ -1,21 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Get all Details about a Service Account - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service accounts are to be fetched - * @param {string} serviceAccEmail - Unique Email or ID of Service Account - * @returns {Promise>} - Promise Resolving to Details of Service Account - */ -function default_1(token, projectID, serviceAccEmail) { - return helpers_1.googleApiRequest.get(API_1.default.get(projectID, serviceAccEmail), token); -} -exports.default = default_1; +'use strict';var a135_0x43b0a2=a135_0x4019;function a135_0x151b(){var _0x440963=['../../../../../google/helpers','744472hVzkoP','1172948RFzfvb','22XYTcss','__esModule','4UGbiqV','6514712oDnxsp','695RDQXmr','2528QwnIbo','1986WkrjgG','15546627SFBEZT','default','__importDefault','3279170LsiKcI','googleApiRequest','defineProperty','get','28038hrSqjT','../../../../../google/api/iam/service-account/API'];a135_0x151b=function(){return _0x440963;};return a135_0x151b();}(function(_0x16b2de,_0x33eb45){var _0x436759=a135_0x4019,_0x1c0ae8=_0x16b2de();while(!![]){try{var _0x419c17=-parseInt(_0x436759(0x113))/0x1*(parseInt(_0x436759(0x117))/0x2)+-parseInt(_0x436759(0x11b))/0x3*(-parseInt(_0x436759(0x11a))/0x4)+parseInt(_0x436759(0x119))/0x5*(parseInt(_0x436759(0x123))/0x6)+-parseInt(_0x436759(0x114))/0x7+-parseInt(_0x436759(0x118))/0x8+parseInt(_0x436759(0x11c))/0x9+parseInt(_0x436759(0x11f))/0xa*(parseInt(_0x436759(0x115))/0xb);if(_0x419c17===_0x33eb45)break;else _0x1c0ae8['push'](_0x1c0ae8['shift']());}catch(_0xb70c62){_0x1c0ae8['push'](_0x1c0ae8['shift']());}}}(a135_0x151b,0xef561));var __importDefault=this&&this[a135_0x43b0a2(0x11e)]||function(_0x328b30){var _0x2f14cb=a135_0x43b0a2;return _0x328b30&&_0x328b30[_0x2f14cb(0x116)]?_0x328b30:{'default':_0x328b30};};Object[a135_0x43b0a2(0x121)](exports,a135_0x43b0a2(0x116),{'value':!![]});var API_1=__importDefault(require(a135_0x43b0a2(0x124))),helpers_1=require(a135_0x43b0a2(0x112));function a135_0x4019(_0x3f096e,_0x5b2b5d){var _0x151bce=a135_0x151b();return a135_0x4019=function(_0x401933,_0x19eac5){_0x401933=_0x401933-0x112;var _0x781ee1=_0x151bce[_0x401933];return _0x781ee1;},a135_0x4019(_0x3f096e,_0x5b2b5d);}function default_1(_0x434b05,_0x3b1fce,_0xa3d8bb){var _0x23716b=a135_0x43b0a2;return helpers_1[_0x23716b(0x120)][_0x23716b(0x122)](API_1['default'][_0x23716b(0x122)](_0x3b1fce,_0xa3d8bb),_0x434b05);}exports[a135_0x43b0a2(0x11d)]=default_1; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/index.js b/plugins/google/api/iam/service-account/methods/index.js index 44561da..45e23ca 100644 --- a/plugins/google/api/iam/service-account/methods/index.js +++ b/plugins/google/api/iam/service-account/methods/index.js @@ -1,19 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var list_1 = __importDefault(require("./list")); -var get_1 = __importDefault(require("./get")); -var create_1 = __importDefault(require("./create")); -var delete_1 = __importDefault(require("./delete")); -var disable_1 = __importDefault(require("./disable")); -var enable_1 = __importDefault(require("./enable")); -exports.default = { - list: list_1.default, - get: get_1.default, - create: create_1.default, - delete: delete_1.default, - disable: disable_1.default, - enable: enable_1.default, -}; +'use strict';var a136_0x76fef7=a136_0x4bce;(function(_0x4c0e5d,_0x58a1f7){var _0x1a8640=a136_0x4bce,_0x57843a=_0x4c0e5d();while(!![]){try{var _0x5a1f9e=-parseInt(_0x1a8640(0xaf))/0x1+parseInt(_0x1a8640(0xac))/0x2*(parseInt(_0x1a8640(0xae))/0x3)+parseInt(_0x1a8640(0xb7))/0x4+parseInt(_0x1a8640(0xb2))/0x5+-parseInt(_0x1a8640(0xb5))/0x6+parseInt(_0x1a8640(0xb0))/0x7+-parseInt(_0x1a8640(0xb6))/0x8;if(_0x5a1f9e===_0x58a1f7)break;else _0x57843a['push'](_0x57843a['shift']());}catch(_0x9d0c87){_0x57843a['push'](_0x57843a['shift']());}}}(a136_0x14b9,0x7bc01));var __importDefault=this&&this[a136_0x76fef7(0xab)]||function(_0x8c2479){var _0x1d9133=a136_0x76fef7;return _0x8c2479&&_0x8c2479[_0x1d9133(0xb8)]?_0x8c2479:{'default':_0x8c2479};};Object[a136_0x76fef7(0xb1)](exports,a136_0x76fef7(0xb8),{'value':!![]});function a136_0x14b9(){var _0x58ace8=['2993316eQhrpv','4328328uEeajB','2409204SvPWVf','__esModule','./disable','__importDefault','160jiOTKw','default','4926HGreIa','787603SKrHTr','5183136vIEGrv','defineProperty','4301510VkmHNm','./enable','./create'];a136_0x14b9=function(){return _0x58ace8;};return a136_0x14b9();}function a136_0x4bce(_0x50e6b7,_0x31f79e){var _0x14b9e7=a136_0x14b9();return a136_0x4bce=function(_0x4bce2d,_0x55e197){_0x4bce2d=_0x4bce2d-0xab;var _0x24997b=_0x14b9e7[_0x4bce2d];return _0x24997b;},a136_0x4bce(_0x50e6b7,_0x31f79e);}var list_1=__importDefault(require('./list')),get_1=__importDefault(require('./get')),create_1=__importDefault(require(a136_0x76fef7(0xb4))),delete_1=__importDefault(require('./delete')),disable_1=__importDefault(require(a136_0x76fef7(0xb9))),enable_1=__importDefault(require(a136_0x76fef7(0xb3)));exports['default']={'list':list_1[a136_0x76fef7(0xad)],'get':get_1[a136_0x76fef7(0xad)],'create':create_1[a136_0x76fef7(0xad)],'delete':delete_1[a136_0x76fef7(0xad)],'disable':disable_1['default'],'enable':enable_1[a136_0x76fef7(0xad)]}; \ No newline at end of file diff --git a/plugins/google/api/iam/service-account/methods/list.js b/plugins/google/api/iam/service-account/methods/list.js index 4d733d2..6ef625a 100644 --- a/plugins/google/api/iam/service-account/methods/list.js +++ b/plugins/google/api/iam/service-account/methods/list.js @@ -1,20 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// API -var API_1 = __importDefault(require("../../../../../google/api/iam/service-account/API")); -// Google Request Method -var helpers_1 = require("../../../../../google/helpers"); -/** - * Lists all Service Tokens in Google Cloud Console - * - * @param {ITokenDoc} token - Token Document from Database - * @param {string} projectID - Project ID to which service accounts are to be fetched - * @returns {Promise>} - Promise Resolving to Service Accounts List - */ -function default_1(token, projectID) { - return helpers_1.googleApiRequest.get(API_1.default.list(projectID), token); -} -exports.default = default_1; +'use strict';var a137_0x47a9b6=a137_0x1195;function a137_0x1195(_0x353b71,_0x505682){var _0x2bb515=a137_0x2bb5();return a137_0x1195=function(_0x119572,_0x1c6e26){_0x119572=_0x119572-0x1cb;var _0x31676f=_0x2bb515[_0x119572];return _0x31676f;},a137_0x1195(_0x353b71,_0x505682);}(function(_0x2aeb48,_0xf1310a){var _0x55ba0c=a137_0x1195,_0x54f9dd=_0x2aeb48();while(!![]){try{var _0x220f74=parseInt(_0x55ba0c(0x1da))/0x1*(parseInt(_0x55ba0c(0x1cf))/0x2)+-parseInt(_0x55ba0c(0x1d2))/0x3*(-parseInt(_0x55ba0c(0x1d7))/0x4)+parseInt(_0x55ba0c(0x1d6))/0x5*(-parseInt(_0x55ba0c(0x1d8))/0x6)+parseInt(_0x55ba0c(0x1ce))/0x7+-parseInt(_0x55ba0c(0x1cc))/0x8+parseInt(_0x55ba0c(0x1d0))/0x9+parseInt(_0x55ba0c(0x1d3))/0xa*(-parseInt(_0x55ba0c(0x1d9))/0xb);if(_0x220f74===_0xf1310a)break;else _0x54f9dd['push'](_0x54f9dd['shift']());}catch(_0x190aef){_0x54f9dd['push'](_0x54f9dd['shift']());}}}(a137_0x2bb5,0xb0c6e));var __importDefault=this&&this[a137_0x47a9b6(0x1cd)]||function(_0x236f84){var _0x4f8efc=a137_0x47a9b6;return _0x236f84&&_0x236f84[_0x4f8efc(0x1db)]?_0x236f84:{'default':_0x236f84};};Object[a137_0x47a9b6(0x1d5)](exports,a137_0x47a9b6(0x1db),{'value':!![]});var API_1=__importDefault(require('../../../../../google/api/iam/service-account/API')),helpers_1=require('../../../../../google/helpers');function default_1(_0x56531d,_0x492c19){var _0x34391d=a137_0x47a9b6;return helpers_1[_0x34391d(0x1dc)][_0x34391d(0x1cb)](API_1[_0x34391d(0x1d4)][_0x34391d(0x1d1)](_0x492c19),_0x56531d);}exports[a137_0x47a9b6(0x1d4)]=default_1;function a137_0x2bb5(){var _0x3ff9cd=['__importDefault','5831266PikStN','160Gvjgui','10460817jQbfDJ','list','2671497uxMFUU','730UCIYCN','default','defineProperty','5sysrIj','4HYDMoe','4615932gLaHeh','201883sXUOxO','5482vcbhyp','__esModule','googleApiRequest','get','3929928mYlrpY'];a137_0x2bb5=function(){return _0x3ff9cd;};return a137_0x2bb5();} \ No newline at end of file diff --git a/plugins/google/api/index.js b/plugins/google/api/index.js index 3b431d0..4ff1a65 100644 --- a/plugins/google/api/index.js +++ b/plugins/google/api/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scopes = exports.drive = exports.iam = void 0; -var iam_1 = require("./iam"); -Object.defineProperty(exports, "iam", { enumerable: true, get: function () { return __importDefault(iam_1).default; } }); -var drive_1 = require("./drive"); -Object.defineProperty(exports, "drive", { enumerable: true, get: function () { return __importDefault(drive_1).default; } }); -var scopes_1 = require("./scopes"); -Object.defineProperty(exports, "scopes", { enumerable: true, get: function () { return __importDefault(scopes_1).default; } }); +'use strict';var a138_0xf97e98=a138_0x4e22;function a138_0x104d(){var _0x14cc1e=['11758iukBXF','./drive','./scopes','20sXPLTb','iam','__esModule','1628843cXviQE','122241cSaMGx','scopes','129mRGULr','drive','__importDefault','7894744jmuson','816hLxSjK','default','45849230hxFyAa','1441476qMjhZS','defineProperty','9733824vYqNDS'];a138_0x104d=function(){return _0x14cc1e;};return a138_0x104d();}(function(_0x3c9b47,_0x12b625){var _0x3a6fd5=a138_0x4e22,_0x142121=_0x3c9b47();while(!![]){try{var _0x569cce=-parseInt(_0x3a6fd5(0xce))/0x1+-parseInt(_0x3a6fd5(0xc8))/0x2*(parseInt(_0x3a6fd5(0xd1))/0x3)+-parseInt(_0x3a6fd5(0xd4))/0x4+parseInt(_0x3a6fd5(0xcb))/0x5*(parseInt(_0x3a6fd5(0xc5))/0x6)+-parseInt(_0x3a6fd5(0xcf))/0x7*(parseInt(_0x3a6fd5(0xc2))/0x8)+parseInt(_0x3a6fd5(0xc7))/0x9+parseInt(_0x3a6fd5(0xc4))/0xa;if(_0x569cce===_0x12b625)break;else _0x142121['push'](_0x142121['shift']());}catch(_0xeaa76f){_0x142121['push'](_0x142121['shift']());}}}(a138_0x104d,0xf1eab));function a138_0x4e22(_0xeb827e,_0x4ea2f1){var _0x104d49=a138_0x104d();return a138_0x4e22=function(_0x4e22f5,_0x22d70e){_0x4e22f5=_0x4e22f5-0xc2;var _0x3cb0f8=_0x104d49[_0x4e22f5];return _0x3cb0f8;},a138_0x4e22(_0xeb827e,_0x4ea2f1);}var __importDefault=this&&this[a138_0xf97e98(0xd3)]||function(_0x3d5598){var _0x10449e=a138_0xf97e98;return _0x3d5598&&_0x3d5598[_0x10449e(0xcd)]?_0x3d5598:{'default':_0x3d5598};};Object[a138_0xf97e98(0xc6)](exports,a138_0xf97e98(0xcd),{'value':!![]}),exports[a138_0xf97e98(0xd0)]=exports['drive']=exports[a138_0xf97e98(0xcc)]=void 0x0;var iam_1=require('./iam');Object['defineProperty'](exports,'iam',{'enumerable':!![],'get':function(){var _0x3dcbc2=a138_0xf97e98;return __importDefault(iam_1)[_0x3dcbc2(0xc3)];}});var drive_1=require(a138_0xf97e98(0xc9));Object[a138_0xf97e98(0xc6)](exports,a138_0xf97e98(0xd2),{'enumerable':!![],'get':function(){return __importDefault(drive_1)['default'];}});var scopes_1=require(a138_0xf97e98(0xca));Object[a138_0xf97e98(0xc6)](exports,a138_0xf97e98(0xd0),{'enumerable':!![],'get':function(){var _0x204ada=a138_0xf97e98;return __importDefault(scopes_1)[_0x204ada(0xc3)];}}); \ No newline at end of file diff --git a/plugins/google/api/scopes.js b/plugins/google/api/scopes.js index 30d386b..3fd67ec 100644 --- a/plugins/google/api/scopes.js +++ b/plugins/google/api/scopes.js @@ -1,14 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var scopes_1 = __importDefault(require("./drive/scopes")); -var scopes_2 = __importDefault(require("./iam/scopes")); -/** - * Consolidated Google Oauth Scopes - */ -exports.default = { - drive: scopes_1.default, - iam: scopes_2.default, -}; +'use strict';var a139_0x5ebe4b=a139_0x11ee;(function(_0x15c6b1,_0x1800cd){var _0x5a4554=a139_0x11ee,_0x47948d=_0x15c6b1();while(!![]){try{var _0x33f56b=-parseInt(_0x5a4554(0x1e8))/0x1+parseInt(_0x5a4554(0x1ea))/0x2+-parseInt(_0x5a4554(0x1f1))/0x3*(parseInt(_0x5a4554(0x1f5))/0x4)+-parseInt(_0x5a4554(0x1ed))/0x5*(-parseInt(_0x5a4554(0x1f0))/0x6)+-parseInt(_0x5a4554(0x1f2))/0x7*(parseInt(_0x5a4554(0x1e9))/0x8)+parseInt(_0x5a4554(0x1eb))/0x9*(-parseInt(_0x5a4554(0x1f3))/0xa)+-parseInt(_0x5a4554(0x1ee))/0xb*(-parseInt(_0x5a4554(0x1ef))/0xc);if(_0x33f56b===_0x1800cd)break;else _0x47948d['push'](_0x47948d['shift']());}catch(_0x31addc){_0x47948d['push'](_0x47948d['shift']());}}}(a139_0x36e8,0x1e5c8));function a139_0x36e8(){var _0x137f25=['9527UNFaLQ','40Sjjywf','default','431256zrrDjG','defineProperty','__esModule','223307aryPvV','1096OxiTwG','442064MAOJWP','113580LSifTq','__importDefault','169245JpxyKk','24431uWUDnI','2364MdmkCf','6pfvVIh','3iBnLCN'];a139_0x36e8=function(){return _0x137f25;};return a139_0x36e8();}var __importDefault=this&&this[a139_0x5ebe4b(0x1ec)]||function(_0x1ce7b1){var _0x5d23af=a139_0x5ebe4b;return _0x1ce7b1&&_0x1ce7b1[_0x5d23af(0x1e7)]?_0x1ce7b1:{'default':_0x1ce7b1};};Object[a139_0x5ebe4b(0x1f6)](exports,a139_0x5ebe4b(0x1e7),{'value':!![]});function a139_0x11ee(_0x1e2e2a,_0x1d8089){var _0x36e888=a139_0x36e8();return a139_0x11ee=function(_0x11eef7,_0x2520b4){_0x11eef7=_0x11eef7-0x1e7;var _0x3538dd=_0x36e888[_0x11eef7];return _0x3538dd;},a139_0x11ee(_0x1e2e2a,_0x1d8089);}var scopes_1=__importDefault(require('./drive/scopes')),scopes_2=__importDefault(require('./iam/scopes'));exports['default']={'drive':scopes_1[a139_0x5ebe4b(0x1f4)],'iam':scopes_2[a139_0x5ebe4b(0x1f4)]}; \ No newline at end of file diff --git a/plugins/google/handlers/nac/check-token.js b/plugins/google/handlers/nac/check-token.js index 844dd42..21771e0 100644 --- a/plugins/google/handlers/nac/check-token.js +++ b/plugins/google/handlers/nac/check-token.js @@ -1,7 +1 @@ -"use strict"; -// Axios -// import axios from '@helpers/axios'; -// Others -// import api from './endpoints'; -// Types -// import type { AxiosError } from 'axios'; +'use strict';(function(_0x183589,_0x20a08b){var _0x14f903=a140_0x5ad1,_0x2aedaa=_0x183589();while(!![]){try{var _0x2d9252=-parseInt(_0x14f903(0x153))/0x1*(-parseInt(_0x14f903(0x15b))/0x2)+parseInt(_0x14f903(0x15c))/0x3*(parseInt(_0x14f903(0x156))/0x4)+parseInt(_0x14f903(0x159))/0x5+parseInt(_0x14f903(0x158))/0x6*(parseInt(_0x14f903(0x157))/0x7)+-parseInt(_0x14f903(0x15a))/0x8+-parseInt(_0x14f903(0x154))/0x9+parseInt(_0x14f903(0x15d))/0xa*(parseInt(_0x14f903(0x155))/0xb);if(_0x2d9252===_0x20a08b)break;else _0x2aedaa['push'](_0x2aedaa['shift']());}catch(_0x2765dd){_0x2aedaa['push'](_0x2aedaa['shift']());}}}(a140_0x386c,0x7ec56));function a140_0x386c(){var _0x2f793d=['1071392plSIoM','4opdeCP','28995DhytcR','50vMuNIS','413475GbRHbT','8571474DMqdJg','1167177FmGeZK','52SvHgej','2947nvnuUD','6hrDnVy','610065IdQwjP'];a140_0x386c=function(){return _0x2f793d;};return a140_0x386c();}function a140_0x5ad1(_0xc5238e,_0x301b1b){var _0x386c5e=a140_0x386c();return a140_0x5ad1=function(_0x5ad1b6,_0x424661){_0x5ad1b6=_0x5ad1b6-0x153;var _0x2939cd=_0x386c5e[_0x5ad1b6];return _0x2939cd;},a140_0x5ad1(_0xc5238e,_0x301b1b);} \ No newline at end of file diff --git a/plugins/google/handlers/nac/generate-oauth.js b/plugins/google/handlers/nac/generate-oauth.js index bacb2ac..66f4284 100644 --- a/plugins/google/handlers/nac/generate-oauth.js +++ b/plugins/google/handlers/nac/generate-oauth.js @@ -1,217 +1 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Models -var _models_1 = require("../../../../models"); -// Others -var API_1 = __importDefault(require("../../../google/helpers/API")); -var misc_1 = require("../../../misc"); -var crypto_1 = require("../../../crypto"); -var generate_token_1 = require("../../../google/handlers/nac/generate-token"); -var stringize_scope_1 = __importDefault(require("../../../google/helpers/stringize-scope")); -// Response Handlers -var responses_1 = require("../../../../plugins/server/responses"); -/** - * Constructs Google Oauth Authorization URL - * - * @param {ICredentialsDoc} credentials - Credentials Document from Database - * @param {TGoogleApiScope[]} scopes - Array of Google Oauth Scopes - * @param {string} state - State of the app to be passed - * @returns {string} - Google Oauth User Consent URL - */ -function constructOauthURL(credentials, scopes, state) { - var encodedClient_id = encodeURIComponent(credentials.client_id); - var encodedRedirect_uri = encodeURIComponent(credentials.redirect_uri); - var encodedState = encodeURIComponent(state); - var scopeParam = (0, stringize_scope_1.default)(scopes); - var encodedScope_param = encodeURIComponent(scopeParam); - var params = "client_id=".concat(encodedClient_id, "&redirect_uri=").concat(encodedRedirect_uri, "&response_type=code&scope=").concat(encodedScope_param, "&access_type=offline&state=").concat(encodedState); - return "".concat(API_1.default.authorize, "?").concat(params); -} -/** - * Redirect the User to the OAuth Authentication URL - * - * @param {Response} res - Express Response Object - * @param {string} id - Credentials ID - * @param {TGoogleApiScope[]} scopes - Google API Scopes - */ -function redirectUser(res, id, scopes) { - _models_1.Credentials.findById(id) - .then(function (credentials) { - if (credentials) { - var state = crypto_1.encrypt.str(String(credentials._id)); - var url = constructOauthURL(credentials, scopes, state); - res.redirect(url); - } - else { - (0, responses_1.notFound)(res, 'Credential ID Not found in DB, Kindly Recheck'); - } - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); -} -/** - * Saves the Refresh Token and Access Token in the Database for Long Term Use - * - * @param {ICredentialsDoc} credentials - Credentials Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @param {IGoogTokenResponse} refreshToken - Refresh Token Response - * @param {IGoogTokenResponse} accessToken - Access Token Response - * @returns {Promise} - Saved Token Documents - */ -function handleTokenSaving(credentials, scopes, refreshToken, accessToken) { - return new Promise(function (resolve, reject) { - var now = Date.now(); - Promise.all([(0, misc_1.objectID)('t'), (0, misc_1.objectID)('t')]) - .then(function (_a) { - var uid1 = _a[0], uid2 = _a[1]; - var tokensArr = [ - { - _id: uid1, - token: crypto_1.encrypt.str(refreshToken.refresh_token), - type: 'refresh', - related_to: credentials._id, - scopes: scopes, - ref_model: 'Credential', - expires_at: now + 100 * 365 * 24 * 3600 * 1000, - website: 'google.com', - }, - { - _id: uid2, - token: crypto_1.encrypt.str(accessToken.access_token), - type: 'access', - related_to: credentials._id, - scopes: scopes, - ref_model: 'Credential', - expires_at: now + accessToken.expires_in * 1000, - website: 'google.com', - }, - ]; - _models_1.Tokens.insertMany(tokensArr) - .then(function (tokenDocs) { - resolve(tokenDocs); - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }) - .catch(function (e) { - console.log(e); - reject(new Error('Error Occured while Generating a UID')); - }); - }); -} -/** - * Handle Token Generation after User Authorization from Google Oauth - * - * @param {Response} res - Express Response Object - * @param {string} id - Credentials ID - * @param {string} code - Authorization Code Received from Google Server - * @param {TGoogleApiScope[]} scopes - Google API Scopes - */ -function handleUserAuthorization(res, id, code, scopes) { - var _this = this; - _models_1.Credentials.findById(id) - .then(function (credentials) { return __awaiter(_this, void 0, void 0, function () { - var scopeParam, refreshToken, accessToken, savedDocs, e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!credentials) return [3 /*break*/, 9]; - scopeParam = (0, stringize_scope_1.default)(scopes); - _a.label = 1; - case 1: - _a.trys.push([1, 7, , 8]); - return [4 /*yield*/, (0, generate_token_1.generateRefreshToken)(credentials, scopeParam, code)]; - case 2: - refreshToken = _a.sent(); - if (!refreshToken.refresh_token) return [3 /*break*/, 5]; - return [4 /*yield*/, (0, generate_token_1.generateAccessToken)(credentials, refreshToken.refresh_token)]; - case 3: - accessToken = _a.sent(); - return [4 /*yield*/, handleTokenSaving(credentials, scopes, refreshToken, accessToken)]; - case 4: - savedDocs = _a.sent(); - (0, responses_1.okResponse)(res, savedDocs); - return [3 /*break*/, 6]; - case 5: throw new Error('No Refresh Token Found in Response, Kindly Retry'); - case 6: return [3 /*break*/, 8]; - case 7: - e_1 = _a.sent(); - console.log(e_1); - (0, responses_1.internalServerError)(res, 'Token Generation', String(e_1)); - return [3 /*break*/, 8]; - case 8: return [3 /*break*/, 10]; - case 9: - (0, responses_1.notFound)(res, 'Credential ID Not found in DB, Kindly Recheck'); - _a.label = 10; - case 10: return [2 /*return*/]; - } - }); - }); }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); -} -/** - * Express Handler for Generating Google Oauth Refresh Token and Authorization Token - * - * @param {Request} req - Express Request Object - * @param {Response} res - Express Response Object - * @param {TGoogleApiScope[]} scopes - Google API Scopes - */ -function default_1(req, res, scopes) { - var _a = req.query, creds = _a.creds, code = _a.code, state = _a.state; - console.log(code, creds, String(state)); - if (!code && creds) { - redirectUser(res, String(creds), scopes); - } - else if (code && state) { - var stringizedCode = String(code); - var credID = crypto_1.decrypt.str(decodeURIComponent(String(state))); - handleUserAuthorization(res, credID, stringizedCode, scopes); - } - else { - (0, responses_1.badRequest)(res, 'creds', 'Query Parameters'); - } -} -exports.default = default_1; +'use strict';var a141_0x51f388=a141_0x5352;(function(_0xefe1d2,_0x5927d4){var _0x4a4529=a141_0x5352,_0x38e24e=_0xefe1d2();while(!![]){try{var _0x3c532e=-parseInt(_0x4a4529(0x18c))/0x1*(-parseInt(_0x4a4529(0x1d3))/0x2)+parseInt(_0x4a4529(0x195))/0x3*(-parseInt(_0x4a4529(0x1b3))/0x4)+-parseInt(_0x4a4529(0x18f))/0x5*(parseInt(_0x4a4529(0x1a2))/0x6)+-parseInt(_0x4a4529(0x1ae))/0x7*(parseInt(_0x4a4529(0x1b7))/0x8)+parseInt(_0x4a4529(0x198))/0x9*(-parseInt(_0x4a4529(0x1c5))/0xa)+parseInt(_0x4a4529(0x1a6))/0xb*(-parseInt(_0x4a4529(0x1be))/0xc)+parseInt(_0x4a4529(0x1d0))/0xd;if(_0x3c532e===_0x5927d4)break;else _0x38e24e['push'](_0x38e24e['shift']());}catch(_0x179684){_0x38e24e['push'](_0x38e24e['shift']());}}}(a141_0x18c4,0x69b1f));function a141_0x18c4(){var _0x5202e4=['../../../google/helpers/API','8qwjBze','../../../crypto','query','default','objectID','&access_type=offline&state=','expires_in','8088ggJoOd','internalServerError','then','encrypt','message','value','state','20580ZMYEfV','str','authorize','call','&redirect_uri=','sent','Tokens','function','client_id','refresh','log','25689144cenFOS','../../../google/helpers/stringize-scope','__importDefault','2bYaNvh','throw','Error\x20Occured\x20while\x20Generating\x20a\x20UID','Query\x20Parameters','decrypt','label','Credential','done','822942IpwlQM','Generator\x20is\x20already\x20executing.','findById','10CKXsPU','insertMany','length','redirect_uri','now','__generator','144siDJgZ','all','catch','2556sAJVcJ','Credential\x20ID\x20Not\x20found\x20in\x20DB,\x20Kindly\x20Recheck','next','concat','refresh_token','okResponse','name','pop','../../../../models','_id','1418688XtmNPw','generateRefreshToken','__esModule','Token\x20Generation','4642PUhMsO','access','notFound','creds','return','No\x20Refresh\x20Token\x20Found\x20in\x20Response,\x20Kindly\x20Retry','google.com','client_id=','3284981yANcoz','ops','redirect','trys','badRequest','46252xJFUCN','push','Credentials'];a141_0x18c4=function(){return _0x5202e4;};return a141_0x18c4();}var __awaiter=this&&this['__awaiter']||function(_0x1bcfe2,_0x59dcd1,_0x284337,_0xa01ead){function _0x385261(_0x4e1f4a){return _0x4e1f4a instanceof _0x284337?_0x4e1f4a:new _0x284337(function(_0x3c7240){_0x3c7240(_0x4e1f4a);});}return new(_0x284337||(_0x284337=Promise))(function(_0x2d2c2a,_0x2beb61){var _0x4c4159=a141_0x5352;function _0x564af5(_0x36a822){var _0xa45da8=a141_0x5352;try{_0x3edd52(_0xa01ead[_0xa45da8(0x19a)](_0x36a822));}catch(_0x30416c){_0x2beb61(_0x30416c);}}function _0x4a8782(_0x5975f3){var _0xdab30e=a141_0x5352;try{_0x3edd52(_0xa01ead[_0xdab30e(0x185)](_0x5975f3));}catch(_0x31343d){_0x2beb61(_0x31343d);}}function _0x3edd52(_0x441513){var _0x5c0749=a141_0x5352;_0x441513[_0x5c0749(0x18b)]?_0x2d2c2a(_0x441513[_0x5c0749(0x1c3)]):_0x385261(_0x441513['value'])[_0x5c0749(0x1c0)](_0x564af5,_0x4a8782);}_0x3edd52((_0xa01ead=_0xa01ead['apply'](_0x1bcfe2,_0x59dcd1||[]))[_0x4c4159(0x19a)]());});},__generator=this&&this[a141_0x51f388(0x194)]||function(_0x297d5a,_0x3e92b6){var _0x4b535e=a141_0x51f388,_0x473aae={'label':0x0,'sent':function(){if(_0x41b3b0[0x0]&0x1)throw _0x41b3b0[0x1];return _0x41b3b0[0x1];},'trys':[],'ops':[]},_0x3570fa,_0x60f5c6,_0x41b3b0,_0x469286;return _0x469286={'next':_0x70025(0x0),'throw':_0x70025(0x1),'return':_0x70025(0x2)},typeof Symbol===_0x4b535e(0x1cc)&&(_0x469286[Symbol['iterator']]=function(){return this;}),_0x469286;function _0x70025(_0x517c0d){return function(_0x56eb08){return _0x40b97f([_0x517c0d,_0x56eb08]);};}function _0x40b97f(_0x4f1871){var _0x338d15=_0x4b535e;if(_0x3570fa)throw new TypeError(_0x338d15(0x18d));while(_0x473aae)try{if(_0x3570fa=0x1,_0x60f5c6&&(_0x41b3b0=_0x4f1871[0x0]&0x2?_0x60f5c6[_0x338d15(0x1aa)]:_0x4f1871[0x0]?_0x60f5c6[_0x338d15(0x185)]||((_0x41b3b0=_0x60f5c6['return'])&&_0x41b3b0[_0x338d15(0x1c8)](_0x60f5c6),0x0):_0x60f5c6[_0x338d15(0x19a)])&&!(_0x41b3b0=_0x41b3b0[_0x338d15(0x1c8)](_0x60f5c6,_0x4f1871[0x1]))[_0x338d15(0x18b)])return _0x41b3b0;if(_0x60f5c6=0x0,_0x41b3b0)_0x4f1871=[_0x4f1871[0x0]&0x2,_0x41b3b0[_0x338d15(0x1c3)]];switch(_0x4f1871[0x0]){case 0x0:case 0x1:_0x41b3b0=_0x4f1871;break;case 0x4:_0x473aae['label']++;return{'value':_0x4f1871[0x1],'done':![]};case 0x5:_0x473aae[_0x338d15(0x189)]++,_0x60f5c6=_0x4f1871[0x1],_0x4f1871=[0x0];continue;case 0x7:_0x4f1871=_0x473aae['ops'][_0x338d15(0x19f)](),_0x473aae['trys'][_0x338d15(0x19f)]();continue;default:if(!(_0x41b3b0=_0x473aae[_0x338d15(0x1b1)],_0x41b3b0=_0x41b3b0[_0x338d15(0x191)]>0x0&&_0x41b3b0[_0x41b3b0['length']-0x1])&&(_0x4f1871[0x0]===0x6||_0x4f1871[0x0]===0x2)){_0x473aae=0x0;continue;}if(_0x4f1871[0x0]===0x3&&(!_0x41b3b0||_0x4f1871[0x1]>_0x41b3b0[0x0]&&_0x4f1871[0x1]<_0x41b3b0[0x3])){_0x473aae[_0x338d15(0x189)]=_0x4f1871[0x1];break;}if(_0x4f1871[0x0]===0x6&&_0x473aae['label']<_0x41b3b0[0x1]){_0x473aae[_0x338d15(0x189)]=_0x41b3b0[0x1],_0x41b3b0=_0x4f1871;break;}if(_0x41b3b0&&_0x473aae[_0x338d15(0x189)]<_0x41b3b0[0x2]){_0x473aae[_0x338d15(0x189)]=_0x41b3b0[0x2],_0x473aae[_0x338d15(0x1af)][_0x338d15(0x1b4)](_0x4f1871);break;}if(_0x41b3b0[0x2])_0x473aae[_0x338d15(0x1af)][_0x338d15(0x19f)]();_0x473aae[_0x338d15(0x1b1)][_0x338d15(0x19f)]();continue;}_0x4f1871=_0x3e92b6[_0x338d15(0x1c8)](_0x297d5a,_0x473aae);}catch(_0xe6a457){_0x4f1871=[0x6,_0xe6a457],_0x60f5c6=0x0;}finally{_0x3570fa=_0x41b3b0=0x0;}if(_0x4f1871[0x0]&0x5)throw _0x4f1871[0x1];return{'value':_0x4f1871[0x0]?_0x4f1871[0x1]:void 0x0,'done':!![]};}},__importDefault=this&&this[a141_0x51f388(0x1d2)]||function(_0x565c6e){var _0x1c3feb=a141_0x51f388;return _0x565c6e&&_0x565c6e[_0x1c3feb(0x1a4)]?_0x565c6e:{'default':_0x565c6e};};Object['defineProperty'](exports,a141_0x51f388(0x1a4),{'value':!![]});var _models_1=require(a141_0x51f388(0x1a0)),API_1=__importDefault(require(a141_0x51f388(0x1b6))),misc_1=require('../../../misc'),crypto_1=require(a141_0x51f388(0x1b8)),generate_token_1=require('../../../google/handlers/nac/generate-token'),stringize_scope_1=__importDefault(require(a141_0x51f388(0x1d1))),responses_1=require('../../../../plugins/server/responses');function constructOauthURL(_0x3d66df,_0x5e872d,_0x536ce4){var _0x14e496=a141_0x51f388,_0x4ce60b=encodeURIComponent(_0x3d66df[_0x14e496(0x1cd)]),_0x40027d=encodeURIComponent(_0x3d66df[_0x14e496(0x192)]),_0xe14ac=encodeURIComponent(_0x536ce4),_0x5ef686=(0x0,stringize_scope_1[_0x14e496(0x1ba)])(_0x5e872d),_0x46729e=encodeURIComponent(_0x5ef686),_0x26f9d0=_0x14e496(0x1ad)[_0x14e496(0x19b)](_0x4ce60b,_0x14e496(0x1c9))[_0x14e496(0x19b)](_0x40027d,'&response_type=code&scope=')['concat'](_0x46729e,_0x14e496(0x1bc))[_0x14e496(0x19b)](_0xe14ac);return''['concat'](API_1[_0x14e496(0x1ba)][_0x14e496(0x1c7)],'?')[_0x14e496(0x19b)](_0x26f9d0);}function redirectUser(_0x10d4cb,_0x14f20a,_0x4dcc61){var _0x1fd3b3=a141_0x51f388;_models_1[_0x1fd3b3(0x1b5)][_0x1fd3b3(0x18e)](_0x14f20a)['then'](function(_0x24f089){var _0x24b506=_0x1fd3b3;if(_0x24f089){var _0x2a5606=crypto_1[_0x24b506(0x1c1)][_0x24b506(0x1c6)](String(_0x24f089[_0x24b506(0x1a1)])),_0x40c9c4=constructOauthURL(_0x24f089,_0x4dcc61,_0x2a5606);_0x10d4cb[_0x24b506(0x1b0)](_0x40c9c4);}else(0x0,responses_1['notFound'])(_0x10d4cb,_0x24b506(0x199));})[_0x1fd3b3(0x197)](function(_0x1f42ea){var _0x48a611=_0x1fd3b3;(0x0,responses_1[_0x48a611(0x1bf)])(_0x10d4cb,_0x1f42ea[_0x48a611(0x19e)],_0x1f42ea[_0x48a611(0x1c2)]);});}function handleTokenSaving(_0x46f246,_0x2ba82c,_0xd648e0,_0x4ec618){return new Promise(function(_0xeb4f63,_0x43a569){var _0x2dce3a=a141_0x5352,_0x451b58=Date[_0x2dce3a(0x193)]();Promise[_0x2dce3a(0x196)]([(0x0,misc_1[_0x2dce3a(0x1bb)])('t'),(0x0,misc_1[_0x2dce3a(0x1bb)])('t')])[_0x2dce3a(0x1c0)](function(_0x45f7c5){var _0x268359=_0x2dce3a,_0x41c577=_0x45f7c5[0x0],_0x4e52b9=_0x45f7c5[0x1],_0x30f564=[{'_id':_0x41c577,'token':crypto_1['encrypt']['str'](_0xd648e0[_0x268359(0x19c)]),'type':_0x268359(0x1ce),'related_to':_0x46f246['_id'],'scopes':_0x2ba82c,'ref_model':_0x268359(0x18a),'expires_at':_0x451b58+0x64*0x16d*0x18*0xe10*0x3e8,'website':_0x268359(0x1ac)},{'_id':_0x4e52b9,'token':crypto_1[_0x268359(0x1c1)][_0x268359(0x1c6)](_0x4ec618['access_token']),'type':_0x268359(0x1a7),'related_to':_0x46f246[_0x268359(0x1a1)],'scopes':_0x2ba82c,'ref_model':'Credential','expires_at':_0x451b58+_0x4ec618[_0x268359(0x1bd)]*0x3e8,'website':_0x268359(0x1ac)}];_models_1[_0x268359(0x1cb)][_0x268359(0x190)](_0x30f564)[_0x268359(0x1c0)](function(_0x459924){_0xeb4f63(_0x459924);})[_0x268359(0x197)](function(_0x4a42ad){var _0x43c74d=_0x268359;_0x43a569(new Error(''['concat'](_0x4a42ad['name'],':\x20')['concat'](_0x4a42ad[_0x43c74d(0x1c2)])));});})[_0x2dce3a(0x197)](function(_0x356b70){var _0x3005e6=_0x2dce3a;console[_0x3005e6(0x1cf)](_0x356b70),_0x43a569(new Error(_0x3005e6(0x186)));});});}function a141_0x5352(_0x3c7d1a,_0x5a3f9f){var _0x18c409=a141_0x18c4();return a141_0x5352=function(_0x535207,_0x38c132){_0x535207=_0x535207-0x185;var _0x1bd23c=_0x18c409[_0x535207];return _0x1bd23c;},a141_0x5352(_0x3c7d1a,_0x5a3f9f);}function handleUserAuthorization(_0x43a47c,_0x146024,_0x1e9f66,_0x4ef9bc){var _0x163c57=a141_0x51f388,_0x21ea80=this;_models_1['Credentials'][_0x163c57(0x18e)](_0x146024)[_0x163c57(0x1c0)](function(_0x2b1078){return __awaiter(_0x21ea80,void 0x0,void 0x0,function(){var _0x30c876,_0xa5f527,_0x599979,_0x5253ae,_0x36896e;return __generator(this,function(_0x2b9304){var _0x4b678c=a141_0x5352;switch(_0x2b9304[_0x4b678c(0x189)]){case 0x0:if(!_0x2b1078)return[0x3,0x9];_0x30c876=(0x0,stringize_scope_1[_0x4b678c(0x1ba)])(_0x4ef9bc),_0x2b9304['label']=0x1;case 0x1:_0x2b9304['trys'][_0x4b678c(0x1b4)]([0x1,0x7,,0x8]);return[0x4,(0x0,generate_token_1[_0x4b678c(0x1a3)])(_0x2b1078,_0x30c876,_0x1e9f66)];case 0x2:_0xa5f527=_0x2b9304[_0x4b678c(0x1ca)]();if(!_0xa5f527[_0x4b678c(0x19c)])return[0x3,0x5];return[0x4,(0x0,generate_token_1['generateAccessToken'])(_0x2b1078,_0xa5f527[_0x4b678c(0x19c)])];case 0x3:_0x599979=_0x2b9304[_0x4b678c(0x1ca)]();return[0x4,handleTokenSaving(_0x2b1078,_0x4ef9bc,_0xa5f527,_0x599979)];case 0x4:_0x5253ae=_0x2b9304[_0x4b678c(0x1ca)](),(0x0,responses_1[_0x4b678c(0x19d)])(_0x43a47c,_0x5253ae);return[0x3,0x6];case 0x5:throw new Error(_0x4b678c(0x1ab));case 0x6:return[0x3,0x8];case 0x7:_0x36896e=_0x2b9304['sent'](),console[_0x4b678c(0x1cf)](_0x36896e),(0x0,responses_1['internalServerError'])(_0x43a47c,_0x4b678c(0x1a5),String(_0x36896e));return[0x3,0x8];case 0x8:return[0x3,0xa];case 0x9:(0x0,responses_1[_0x4b678c(0x1a8)])(_0x43a47c,_0x4b678c(0x199)),_0x2b9304[_0x4b678c(0x189)]=0xa;case 0xa:return[0x2];}});});})['catch'](function(_0x12158e){var _0x16a252=_0x163c57;(0x0,responses_1[_0x16a252(0x1bf)])(_0x43a47c,_0x12158e[_0x16a252(0x19e)],_0x12158e['message']);});}function default_1(_0x26714c,_0x5dec19,_0x312639){var _0x2d3f50=a141_0x51f388,_0xb95569=_0x26714c[_0x2d3f50(0x1b9)],_0x50b639=_0xb95569[_0x2d3f50(0x1a9)],_0x4966af=_0xb95569['code'],_0x3b95da=_0xb95569[_0x2d3f50(0x1c4)];console[_0x2d3f50(0x1cf)](_0x4966af,_0x50b639,String(_0x3b95da));if(!_0x4966af&&_0x50b639)redirectUser(_0x5dec19,String(_0x50b639),_0x312639);else{if(_0x4966af&&_0x3b95da){var _0xbe1ff=String(_0x4966af),_0x4e888b=crypto_1[_0x2d3f50(0x188)][_0x2d3f50(0x1c6)](decodeURIComponent(String(_0x3b95da)));handleUserAuthorization(_0x5dec19,_0x4e888b,_0xbe1ff,_0x312639);}else(0x0,responses_1[_0x2d3f50(0x1b2)])(_0x5dec19,_0x2d3f50(0x1a9),_0x2d3f50(0x187));}}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/handlers/nac/generate-token.js b/plugins/google/handlers/nac/generate-token.js index 09b3219..6cae914 100644 --- a/plugins/google/handlers/nac/generate-token.js +++ b/plugins/google/handlers/nac/generate-token.js @@ -1,88 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateAccessToken = exports.generateRefreshToken = void 0; -// Axios -var axios_1 = __importDefault(require("../../../axios")); -// Others -var API_1 = __importDefault(require("../../../google/helpers/API")); -/** - * Constructs Google Oauth Token Exchange URL - * - * @param {ICredentialsDoc} credentials - Credentials Document from Database - * @param {string} type - Type of Token to Generate (refresh_token or access_token) - * @param {string} code - Authorization Code or Refresh Token - * @param {string} scopes - Space Delimited Google Oauth Scopes - * @returns {object} - Returns URL and Param in a Object - */ -function constructTokenRequestURL(credentials, type, code, scopes) { - var url = API_1.default.generateToken; - var params = ''; - var encoded_client_id = encodeURIComponent(credentials.client_id); - var encoded_client_secret = encodeURIComponent(credentials.client_secret); - var encoded_scopes = scopes ? encodeURIComponent(scopes) : ''; - var encoded_redirect_uri = encodeURIComponent(credentials.redirect_uri); - if (type === 'access_token') { - params += "client_id=".concat(encoded_client_id, "&client_secret=").concat(encoded_client_secret, "&refresh_token=").concat(code, "&grant_type=refresh_token"); - } - else { - params += "client_id=".concat(encoded_client_id, "&client_secret=").concat(encoded_client_secret, "&code=").concat(code, "&scopes=").concat(encoded_scopes, "&redirect_uri=").concat(encoded_redirect_uri, "&grant_type=authorization_code"); - } - return { url: url, params: params }; -} -/** - * Requests a Token Response from Google Servers for Generating Access / Refresh Tokens - * - * @param {string} type - Type of Token to Generate (refresh_token or access_token) - * @param {ICredentialsDoc} credentials - Credentials Doc from Database - * @param {string} code - Authorization Code or Refresh Token - * @param {string} scopes - Space Delimited Google API Scopes - * @returns {Promise} - Returns Token Response - */ -function tokenRequest(type, credentials, code, scopes) { - return new Promise(function (resolve, reject) { - var _a = constructTokenRequestURL(credentials, type, code, scopes), url = _a.url, params = _a.params; - axios_1.default - .post(url, params, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - }) - .then(function (response) { - if (response.status === 200) { - resolve(response.data); - } - else { - reject(new Error('Error While Generating the Tokens')); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }); -} -/** - * Generates a Refresh token with Authorization code - * - * @param {ICredentialsDoc} credentials - Credentials Document from Database - * @param {string} scopes - Space Delimited Google API Scopes - * @param {string} code - Authorization Code Received after User Authorization - * @returns {Promise>} - Refresh Token Response - */ -function generateRefreshToken(credentials, scopes, code) { - return tokenRequest('refresh_token', credentials, code, scopes); -} -exports.generateRefreshToken = generateRefreshToken; -/** - * Generates a Access Token with Refresh Token - * - * @param {ICredentialsDoc} credentials - Credentials Document from Database - * @param {string} code - Refresh Token - * @returns {Promise} - Access Token Response - */ -function generateAccessToken(credentials, code) { - return tokenRequest('access_token', credentials, code); -} -exports.generateAccessToken = generateAccessToken; +'use strict';var a142_0x3e9064=a142_0x4003;(function(_0x5d2a02,_0x585199){var _0x2233e0=a142_0x4003,_0x31f845=_0x5d2a02();while(!![]){try{var _0x3086f8=-parseInt(_0x2233e0(0x16f))/0x1*(parseInt(_0x2233e0(0x167))/0x2)+parseInt(_0x2233e0(0x161))/0x3+-parseInt(_0x2233e0(0x16a))/0x4+-parseInt(_0x2233e0(0x17e))/0x5+-parseInt(_0x2233e0(0x17b))/0x6*(-parseInt(_0x2233e0(0x17c))/0x7)+parseInt(_0x2233e0(0x175))/0x8+parseInt(_0x2233e0(0x173))/0x9*(-parseInt(_0x2233e0(0x15f))/0xa);if(_0x3086f8===_0x585199)break;else _0x31f845['push'](_0x31f845['shift']());}catch(_0x47739d){_0x31f845['push'](_0x31f845['shift']());}}}(a142_0x4d26,0x94ca4));var __importDefault=this&&this[a142_0x3e9064(0x171)]||function(_0xdfb9a2){return _0xdfb9a2&&_0xdfb9a2['__esModule']?_0xdfb9a2:{'default':_0xdfb9a2};};function a142_0x4003(_0x25a314,_0xbefc63){var _0x4d2633=a142_0x4d26();return a142_0x4003=function(_0x400318,_0x58c6f8){_0x400318=_0x400318-0x15c;var _0x4609c9=_0x4d2633[_0x400318];return _0x4609c9;},a142_0x4003(_0x25a314,_0xbefc63);}Object[a142_0x3e9064(0x16d)](exports,a142_0x3e9064(0x162),{'value':!![]}),exports[a142_0x3e9064(0x17a)]=exports['generateRefreshToken']=void 0x0;var axios_1=__importDefault(require(a142_0x3e9064(0x16b))),API_1=__importDefault(require(a142_0x3e9064(0x166)));function a142_0x4d26(){var _0xd73307=['6828342eGfrZh','7LCYMZs','concat','2390695BPPshB','&client_secret=','default','name','98220UODiYH','client_secret','2035647SLgXlO','__esModule','&redirect_uri=','access_token','client_id','../../../google/helpers/API','686WoOqSy','catch','status','1146832hkIQMs','../../../axios','generateToken','defineProperty','&code=','681WZWgjl','generateRefreshToken','__importDefault','&grant_type=authorization_code','1197qsbpRe','refresh_token','8780752iYjrNh','client_id=','&scopes=','post','&refresh_token=','generateAccessToken'];a142_0x4d26=function(){return _0xd73307;};return a142_0x4d26();}function constructTokenRequestURL(_0x21c6c3,_0x31e1b,_0x161eae,_0x2e29bb){var _0x2b94ff=a142_0x3e9064,_0x271f83=API_1[_0x2b94ff(0x15d)][_0x2b94ff(0x16c)],_0x329d8d='',_0x1de872=encodeURIComponent(_0x21c6c3[_0x2b94ff(0x165)]),_0x50d5fb=encodeURIComponent(_0x21c6c3[_0x2b94ff(0x160)]),_0x234728=_0x2e29bb?encodeURIComponent(_0x2e29bb):'',_0x2be621=encodeURIComponent(_0x21c6c3['redirect_uri']);return _0x31e1b===_0x2b94ff(0x164)?_0x329d8d+=_0x2b94ff(0x176)[_0x2b94ff(0x17d)](_0x1de872,_0x2b94ff(0x15c))[_0x2b94ff(0x17d)](_0x50d5fb,_0x2b94ff(0x179))['concat'](_0x161eae,'&grant_type=refresh_token'):_0x329d8d+='client_id='['concat'](_0x1de872,_0x2b94ff(0x15c))[_0x2b94ff(0x17d)](_0x50d5fb,_0x2b94ff(0x16e))['concat'](_0x161eae,_0x2b94ff(0x177))[_0x2b94ff(0x17d)](_0x234728,_0x2b94ff(0x163))[_0x2b94ff(0x17d)](_0x2be621,_0x2b94ff(0x172)),{'url':_0x271f83,'params':_0x329d8d};}function tokenRequest(_0x5b3599,_0x33c323,_0x17d184,_0x4d2415){return new Promise(function(_0x56e562,_0x52c327){var _0x1c5ff8=a142_0x4003,_0x835fcb=constructTokenRequestURL(_0x33c323,_0x5b3599,_0x17d184,_0x4d2415),_0x328ed0=_0x835fcb['url'],_0x184e47=_0x835fcb['params'];axios_1[_0x1c5ff8(0x15d)][_0x1c5ff8(0x178)](_0x328ed0,_0x184e47,{'headers':{'Content-Type':'application/x-www-form-urlencoded'}})['then'](function(_0x1a78a0){var _0x114bfe=_0x1c5ff8;_0x1a78a0[_0x114bfe(0x169)]===0xc8?_0x56e562(_0x1a78a0['data']):_0x52c327(new Error('Error\x20While\x20Generating\x20the\x20Tokens'));})[_0x1c5ff8(0x168)](function(_0x4b8fac){var _0x40e1a2=_0x1c5ff8;_0x52c327(new Error(''[_0x40e1a2(0x17d)](_0x4b8fac[_0x40e1a2(0x15e)],':\x20')[_0x40e1a2(0x17d)](_0x4b8fac['message'])));});});}function generateRefreshToken(_0x3778bc,_0x37c158,_0x44dd7e){var _0x58d22b=a142_0x3e9064;return tokenRequest(_0x58d22b(0x174),_0x3778bc,_0x44dd7e,_0x37c158);}exports[a142_0x3e9064(0x170)]=generateRefreshToken;function generateAccessToken(_0x44e497,_0x136da1){var _0x6e6114=a142_0x3e9064;return tokenRequest(_0x6e6114(0x164),_0x44e497,_0x136da1);}exports['generateAccessToken']=generateAccessToken; \ No newline at end of file diff --git a/plugins/google/handlers/nac/index.js b/plugins/google/handlers/nac/index.js index 8249a89..0c7e5db 100644 --- a/plugins/google/handlers/nac/index.js +++ b/plugins/google/handlers/nac/index.js @@ -1,17 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var generate_oauth_1 = __importDefault(require("./generate-oauth")); -var generate_token_1 = require("./generate-token"); -var revoke_token_1 = __importDefault(require("./revoke-token")); -/** - * Google General Account Oauth Handlers - */ -exports.default = { - generateOauth: generate_oauth_1.default, - generateAccessToken: generate_token_1.generateAccessToken, - generateRefreshToken: generate_token_1.generateRefreshToken, - revokeToken: revoke_token_1.default, -}; +'use strict';var a143_0x56a74f=a143_0x565d;function a143_0x565d(_0x621f11,_0x55b112){var _0x4014e0=a143_0x4014();return a143_0x565d=function(_0x565d4a,_0x54c8e4){_0x565d4a=_0x565d4a-0x13f;var _0x49235e=_0x4014e0[_0x565d4a];return _0x49235e;},a143_0x565d(_0x621f11,_0x55b112);}(function(_0x55e1f5,_0x4a6678){var _0x332233=a143_0x565d,_0xeb6187=_0x55e1f5();while(!![]){try{var _0x1c4e6a=parseInt(_0x332233(0x147))/0x1*(parseInt(_0x332233(0x14f))/0x2)+-parseInt(_0x332233(0x143))/0x3+parseInt(_0x332233(0x146))/0x4*(-parseInt(_0x332233(0x13f))/0x5)+-parseInt(_0x332233(0x14a))/0x6+parseInt(_0x332233(0x14b))/0x7*(-parseInt(_0x332233(0x144))/0x8)+parseInt(_0x332233(0x14c))/0x9+parseInt(_0x332233(0x148))/0xa;if(_0x1c4e6a===_0x4a6678)break;else _0xeb6187['push'](_0xeb6187['shift']());}catch(_0x201512){_0xeb6187['push'](_0xeb6187['shift']());}}}(a143_0x4014,0x22818));var __importDefault=this&&this[a143_0x56a74f(0x141)]||function(_0x72f8fc){var _0x40e6ee=a143_0x56a74f;return _0x72f8fc&&_0x72f8fc[_0x40e6ee(0x150)]?_0x72f8fc:{'default':_0x72f8fc};};function a143_0x4014(){var _0x464358=['59752hfOGas','defineProperty','2220kyZjxW','12LngoMH','4768470sCWEhh','./generate-oauth','679884kqQtJY','217DlBJdY','991350PZwuVF','./revoke-token','default','29102FlwTkk','__esModule','1325vxUpvg','./generate-token','__importDefault','generateRefreshToken','385035gyaZCp'];a143_0x4014=function(){return _0x464358;};return a143_0x4014();}Object[a143_0x56a74f(0x145)](exports,a143_0x56a74f(0x150),{'value':!![]});var generate_oauth_1=__importDefault(require(a143_0x56a74f(0x149))),generate_token_1=require(a143_0x56a74f(0x140)),revoke_token_1=__importDefault(require(a143_0x56a74f(0x14d)));exports[a143_0x56a74f(0x14e)]={'generateOauth':generate_oauth_1[a143_0x56a74f(0x14e)],'generateAccessToken':generate_token_1['generateAccessToken'],'generateRefreshToken':generate_token_1[a143_0x56a74f(0x142)],'revokeToken':revoke_token_1[a143_0x56a74f(0x14e)]}; \ No newline at end of file diff --git a/plugins/google/handlers/nac/revoke-token.js b/plugins/google/handlers/nac/revoke-token.js index f684a1f..6b58a13 100644 --- a/plugins/google/handlers/nac/revoke-token.js +++ b/plugins/google/handlers/nac/revoke-token.js @@ -1,46 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Axios -var axios_1 = __importDefault(require("../../../axios")); -// Others -var API_1 = __importDefault(require("../../../google/helpers/API")); -/** - * Revokes a Google Oauth Token (Regresh / Access) - * - * @param {string} token - Google Oauth Token to be Revoked - * @returns {Promise>} - True / false based on Google Response - */ -function default_1(token) { - return new Promise(function (resolve, reject) { - var url = API_1.default.revokeToken; - var params = "token=".concat(token); - axios_1.default - .post(url, params, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - }) - .then(function (response) { - var returnResp = { - success: false, - data: false, - error: null, - }; - if (response.status === 200) { - returnResp.success = true; - returnResp.data = true; - resolve(returnResp); - } - else { - resolve(returnResp); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }); -} -exports.default = default_1; +'use strict';var a144_0x252914=a144_0x1a8a;function a144_0x1a8a(_0x1433a0,_0xaa0ac8){var _0xa2dbfa=a144_0xa2db();return a144_0x1a8a=function(_0x1a8a62,_0x2dcab3){_0x1a8a62=_0x1a8a62-0xb7;var _0x2989ae=_0xa2dbfa[_0x1a8a62];return _0x2989ae;},a144_0x1a8a(_0x1433a0,_0xaa0ac8);}(function(_0x47e1ce,_0x5b7c97){var _0x4ae6f5=a144_0x1a8a,_0x5f1096=_0x47e1ce();while(!![]){try{var _0x48521f=parseInt(_0x4ae6f5(0xc6))/0x1+-parseInt(_0x4ae6f5(0xbc))/0x2*(parseInt(_0x4ae6f5(0xc1))/0x3)+-parseInt(_0x4ae6f5(0xba))/0x4+parseInt(_0x4ae6f5(0xc2))/0x5+parseInt(_0x4ae6f5(0xc4))/0x6*(-parseInt(_0x4ae6f5(0xce))/0x7)+parseInt(_0x4ae6f5(0xbe))/0x8*(-parseInt(_0x4ae6f5(0xb9))/0x9)+-parseInt(_0x4ae6f5(0xbb))/0xa*(-parseInt(_0x4ae6f5(0xcc))/0xb);if(_0x48521f===_0x5b7c97)break;else _0x5f1096['push'](_0x5f1096['shift']());}catch(_0x37b807){_0x5f1096['push'](_0x5f1096['shift']());}}}(a144_0xa2db,0x33494));function a144_0xa2db(){var _0x10c1d6=['24vhfUsQ','message','257126sWBiTI','data','concat','default','token=','catch','55AfKuzQ','name','708218mwWvZL','success','__importDefault','63SWTDFO','966252qllLJl','2162780fgYJmi','2PEejZY','then','129256FVAsmg','status','defineProperty','1145967YtccGr','64495DSymhv','post'];a144_0xa2db=function(){return _0x10c1d6;};return a144_0xa2db();}var __importDefault=this&&this[a144_0x252914(0xb8)]||function(_0x49e012){return _0x49e012&&_0x49e012['__esModule']?_0x49e012:{'default':_0x49e012};};Object[a144_0x252914(0xc0)](exports,'__esModule',{'value':!![]});var axios_1=__importDefault(require('../../../axios')),API_1=__importDefault(require('../../../google/helpers/API'));function default_1(_0x16f425){return new Promise(function(_0x3f0084,_0x82a7a6){var _0x5304cc=a144_0x1a8a,_0x237820=API_1[_0x5304cc(0xc9)]['revokeToken'],_0x27b868=_0x5304cc(0xca)[_0x5304cc(0xc8)](_0x16f425);axios_1[_0x5304cc(0xc9)][_0x5304cc(0xc3)](_0x237820,_0x27b868,{'headers':{'Content-Type':'application/x-www-form-urlencoded'}})[_0x5304cc(0xbd)](function(_0x178573){var _0x11b9f3=_0x5304cc,_0x1418be={'success':![],'data':![],'error':null};_0x178573[_0x11b9f3(0xbf)]===0xc8?(_0x1418be[_0x11b9f3(0xb7)]=!![],_0x1418be[_0x11b9f3(0xc7)]=!![],_0x3f0084(_0x1418be)):_0x3f0084(_0x1418be);})[_0x5304cc(0xcb)](function(_0x516a5a){var _0x263bd0=_0x5304cc;_0x82a7a6(new Error(''[_0x263bd0(0xc8)](_0x516a5a[_0x263bd0(0xcd)],':\x20')[_0x263bd0(0xc8)](_0x516a5a[_0x263bd0(0xc5)])));});});}exports[a144_0x252914(0xc9)]=default_1; \ No newline at end of file diff --git a/plugins/google/handlers/sac/generate-oauth.js b/plugins/google/handlers/sac/generate-oauth.js index 0345b98..1f34b1d 100644 --- a/plugins/google/handlers/sac/generate-oauth.js +++ b/plugins/google/handlers/sac/generate-oauth.js @@ -1,73 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// Models -var _models_1 = require("../../../../models"); -// Others -var misc_1 = require("../../../misc"); -var crypto_1 = require("../../../crypto"); -var generate_token_1 = require("../../../google/handlers/sac/generate-token"); -/** - * Saves the Access Token in the Database for Long Term Use - * - * @param {IServiceAccDoc} account - Credentials Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @param {IGoogTokenResponse} accessToken - Access Token Response - * @returns {Promise} - Saved Token Documents - */ -function handleTokenSaving(account, scopes, accessToken) { - return new Promise(function (resolve, reject) { - var now = Date.now(); - var uid = (0, misc_1.objectID)('t'); - var tokenGen = { - _id: uid, - token: crypto_1.encrypt.str(accessToken.access_token), - type: 'access', - related_to: account._id, - scopes: scopes, - ref_model: 'ServiceAccount', - expires_at: now + accessToken.expires_in * 1000, - website: 'google.com', - }; - _models_1.Tokens.create(tokenGen) - .then(function (tokenDoc) { - resolve(tokenDoc); - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }); -} -/** - * Generate Oauth Token for a Google Service Account - * - * @param {string} account - Service Account ID from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns {Promise} - Promise Resolving to Access Token - */ -function default_1(account, scopes) { - return new Promise(function (resolve, reject) { - _models_1.ServiceAccs.findById(account) - .then(function (serviceAccDoc) { - if (serviceAccDoc) { - (0, generate_token_1.generateAccessToken)(serviceAccDoc, scopes) - .then(function (accessToken) { - handleTokenSaving(serviceAccDoc, scopes, accessToken) - .then(resolve) - .catch(function (err) { - reject(new Error(String(err))); - }); - }) - .catch(function (err) { - reject(new Error(String(err))); - }); - } - else { - reject(new Error('Unable to Find Service Account in the Database')); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }); -} -exports.default = default_1; +'use strict';var a145_0x556ca6=a145_0x1500;function a145_0x1500(_0x5008a3,_0x36363c){var _0x2f2915=a145_0x2f29();return a145_0x1500=function(_0x150001,_0x449f15){_0x150001=_0x150001-0x6d;var _0x14c2c0=_0x2f2915[_0x150001];return _0x14c2c0;},a145_0x1500(_0x5008a3,_0x36363c);}(function(_0x418cb9,_0xa95840){var _0x59a8a8=a145_0x1500,_0x27f3ca=_0x418cb9();while(!![]){try{var _0xb09b0c=parseInt(_0x59a8a8(0x7e))/0x1+-parseInt(_0x59a8a8(0x80))/0x2*(-parseInt(_0x59a8a8(0x72))/0x3)+-parseInt(_0x59a8a8(0x6d))/0x4*(-parseInt(_0x59a8a8(0x76))/0x5)+parseInt(_0x59a8a8(0x85))/0x6*(parseInt(_0x59a8a8(0x7a))/0x7)+-parseInt(_0x59a8a8(0x8b))/0x8+parseInt(_0x59a8a8(0x74))/0x9*(parseInt(_0x59a8a8(0x79))/0xa)+-parseInt(_0x59a8a8(0x7f))/0xb;if(_0xb09b0c===_0xa95840)break;else _0x27f3ca['push'](_0x27f3ca['shift']());}catch(_0x162e54){_0x27f3ca['push'](_0x27f3ca['shift']());}}}(a145_0x2f29,0xf28b7));Object['defineProperty'](exports,a145_0x556ca6(0x89),{'value':!![]});var _models_1=require(a145_0x556ca6(0x7d)),misc_1=require(a145_0x556ca6(0x8c)),crypto_1=require(a145_0x556ca6(0x73)),generate_token_1=require('../../../google/handlers/sac/generate-token');function handleTokenSaving(_0x1269ff,_0xb54e2f,_0x576010){return new Promise(function(_0x1de77a,_0x2ffcc5){var _0x5c14c7=a145_0x1500,_0x3e3f7f=Date[_0x5c14c7(0x71)](),_0x301190=(0x0,misc_1[_0x5c14c7(0x87)])('t'),_0x4dba00={'_id':_0x301190,'token':crypto_1[_0x5c14c7(0x7b)][_0x5c14c7(0x8a)](_0x576010['access_token']),'type':'access','related_to':_0x1269ff[_0x5c14c7(0x6f)],'scopes':_0xb54e2f,'ref_model':_0x5c14c7(0x82),'expires_at':_0x3e3f7f+_0x576010[_0x5c14c7(0x81)]*0x3e8,'website':'google.com'};_models_1[_0x5c14c7(0x6e)]['create'](_0x4dba00)[_0x5c14c7(0x7c)](function(_0x19f7ee){_0x1de77a(_0x19f7ee);})[_0x5c14c7(0x88)](function(_0x571818){var _0x42c81b=_0x5c14c7;_0x2ffcc5(new Error(''[_0x42c81b(0x78)](_0x571818[_0x42c81b(0x86)],':\x20')[_0x42c81b(0x78)](_0x571818['message'])));});});}function default_1(_0x54ccdf,_0x24a5dc){return new Promise(function(_0x20661d,_0x170ee5){var _0x21dba2=a145_0x1500;_models_1[_0x21dba2(0x75)][_0x21dba2(0x77)](_0x54ccdf)[_0x21dba2(0x7c)](function(_0xd85ba0){var _0x11ad87=_0x21dba2;_0xd85ba0?(0x0,generate_token_1[_0x11ad87(0x70)])(_0xd85ba0,_0x24a5dc)[_0x11ad87(0x7c)](function(_0x561bff){var _0x8992a2=_0x11ad87;handleTokenSaving(_0xd85ba0,_0x24a5dc,_0x561bff)[_0x8992a2(0x7c)](_0x20661d)[_0x8992a2(0x88)](function(_0x39ebdb){_0x170ee5(new Error(String(_0x39ebdb)));});})['catch'](function(_0x561693){_0x170ee5(new Error(String(_0x561693)));}):_0x170ee5(new Error(_0x11ad87(0x83)));})[_0x21dba2(0x88)](function(_0xf68a6a){var _0x2125e7=_0x21dba2;_0x170ee5(new Error(''[_0x2125e7(0x78)](_0xf68a6a[_0x2125e7(0x86)],':\x20')[_0x2125e7(0x78)](_0xf68a6a['message'])));});});}function a145_0x2f29(){var _0x5d20ba=['920394CcgOhn','name','objectID','catch','__esModule','str','11839864tdTEnb','../../../misc','1774588Qlkpbv','Tokens','_id','generateAccessToken','now','6792yLpBzv','../../../crypto','5013pIdiqr','ServiceAccs','15yLiXuT','findById','concat','8590yVTZCg','7WMaMMQ','encrypt','then','../../../../models','1362498flFcIv','29193989bVSBsv','1592Hoziyp','expires_in','ServiceAccount','Unable\x20to\x20Find\x20Service\x20Account\x20in\x20the\x20Database','default'];a145_0x2f29=function(){return _0x5d20ba;};return a145_0x2f29();}exports[a145_0x556ca6(0x84)]=default_1; \ No newline at end of file diff --git a/plugins/google/handlers/sac/generate-token.js b/plugins/google/handlers/sac/generate-token.js index 62409c2..d1ef7ca 100644 --- a/plugins/google/handlers/sac/generate-token.js +++ b/plugins/google/handlers/sac/generate-token.js @@ -1,68 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.generateAccessToken = void 0; -// Axios -var axios_1 = __importDefault(require("../../../axios")); -// Others -var helpers_1 = require("../../../google/helpers"); -/** - * Constructs Google Oauth Token Exchange URL for Service Account - * - * @param {string} jwtSignature - Service Account JWT Signature - * @returns {object} - Google Oauth Endpoint url with params - */ -function constructTokenRequestURL(jwtSignature) { - var url = helpers_1.api.generateToken; - var encodedGrantType = encodeURIComponent('urn:ietf:params:oauth:grant-type:jwt-bearer'); - var params = "grant_type=".concat(encodedGrantType, "&assertion=").concat(jwtSignature); - return { url: url, params: params }; -} -/** - * Requests a Token Response from Google Servers for Generating Access Token for Service Account - * - * @param {IServiceAccDoc} account - Service Account Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns {Promise} - Returns Token Response - */ -function tokenRequest(account, scopes) { - return new Promise(function (resolve, reject) { - (0, helpers_1.createJwtToken)(account, scopes) - .then(function (jwtSignature) { - var _a = constructTokenRequestURL(jwtSignature), url = _a.url, params = _a.params; - axios_1.default - .post(url, params, { - headers: { - 'Content-Type': 'application/x-www-form-urlencoded', - }, - }) - .then(function (response) { - if (response.status === 200) { - resolve(response.data); - } - else { - reject(new Error('Error While Generating the Tokens')); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }) - .catch(function (err) { - reject(new Error(err)); - }); - }); -} -/** - * Generates a Access Token for Service Account - * - * @param {IServiceAccDoc} account - Service Account Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns {Promise} - Access Token Response - */ -function generateAccessToken(account, scopes) { - return tokenRequest(account, scopes); -} -exports.generateAccessToken = generateAccessToken; +'use strict';var a146_0x358f3b=a146_0x9f12;(function(_0x187761,_0x1f0463){var _0x2d89e1=a146_0x9f12,_0x88815c=_0x187761();while(!![]){try{var _0xf019e0=parseInt(_0x2d89e1(0xa9))/0x1+parseInt(_0x2d89e1(0x9c))/0x2*(parseInt(_0x2d89e1(0xb0))/0x3)+-parseInt(_0x2d89e1(0xaa))/0x4+parseInt(_0x2d89e1(0xa5))/0x5*(parseInt(_0x2d89e1(0x95))/0x6)+parseInt(_0x2d89e1(0xa7))/0x7+parseInt(_0x2d89e1(0xa8))/0x8*(-parseInt(_0x2d89e1(0xb2))/0x9)+parseInt(_0x2d89e1(0x9b))/0xa*(parseInt(_0x2d89e1(0x99))/0xb);if(_0xf019e0===_0x1f0463)break;else _0x88815c['push'](_0x88815c['shift']());}catch(_0x2eaeff){_0x88815c['push'](_0x88815c['shift']());}}}(a146_0x3e56,0x4805c));var __importDefault=this&&this[a146_0x358f3b(0xae)]||function(_0x596ff9){var _0x56d77b=a146_0x358f3b;return _0x596ff9&&_0x596ff9[_0x56d77b(0x97)]?_0x596ff9:{'default':_0x596ff9};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['generateAccessToken']=void 0x0;var axios_1=__importDefault(require(a146_0x358f3b(0x9a))),helpers_1=require('../../../google/helpers');function a146_0x9f12(_0x3f724f,_0x171446){var _0x3e56f8=a146_0x3e56();return a146_0x9f12=function(_0x9f1267,_0x4c2577){_0x9f1267=_0x9f1267-0x95;var _0x310572=_0x3e56f8[_0x9f1267];return _0x310572;},a146_0x9f12(_0x3f724f,_0x171446);}function constructTokenRequestURL(_0x24b454){var _0x54f042=a146_0x358f3b,_0x12675e=helpers_1[_0x54f042(0xa4)][_0x54f042(0x9d)],_0x80ffae=encodeURIComponent('urn:ietf:params:oauth:grant-type:jwt-bearer'),_0x590510=_0x54f042(0xad)[_0x54f042(0x96)](_0x80ffae,'&assertion=')[_0x54f042(0x96)](_0x24b454);return{'url':_0x12675e,'params':_0x590510};}function tokenRequest(_0x5ba09e,_0x14e704){return new Promise(function(_0x1d9303,_0x23b67a){var _0x56c37d=a146_0x9f12;(0x0,helpers_1[_0x56c37d(0xab)])(_0x5ba09e,_0x14e704)[_0x56c37d(0x9e)](function(_0x4f699c){var _0x5119d4=_0x56c37d,_0x225a7e=constructTokenRequestURL(_0x4f699c),_0x168b1f=_0x225a7e[_0x5119d4(0xa3)],_0x3d7be7=_0x225a7e[_0x5119d4(0xb1)];axios_1[_0x5119d4(0xa0)][_0x5119d4(0xa6)](_0x168b1f,_0x3d7be7,{'headers':{'Content-Type':_0x5119d4(0xac)}})[_0x5119d4(0x9e)](function(_0xb86b0e){var _0x3f13c4=_0x5119d4;_0xb86b0e[_0x3f13c4(0xa2)]===0xc8?_0x1d9303(_0xb86b0e[_0x3f13c4(0xaf)]):_0x23b67a(new Error(_0x3f13c4(0x9f)));})['catch'](function(_0x19f05d){var _0x21d51c=_0x5119d4;_0x23b67a(new Error(''[_0x21d51c(0x96)](_0x19f05d['name'],':\x20')[_0x21d51c(0x96)](_0x19f05d[_0x21d51c(0x98)])));});})['catch'](function(_0x45daf8){_0x23b67a(new Error(_0x45daf8));});});}function generateAccessToken(_0x237126,_0x2c1c36){return tokenRequest(_0x237126,_0x2c1c36);}exports[a146_0x358f3b(0xa1)]=generateAccessToken;function a146_0x3e56(){var _0x15add7=['concat','__esModule','message','11tsyosf','../../../axios','621410TwqfEE','6exToDB','generateToken','then','Error\x20While\x20Generating\x20the\x20Tokens','default','generateAccessToken','status','url','api','5iKFNvb','post','2697142KpabAz','4415608ZRersv','140224MvqcQa','2214400OBUDfX','createJwtToken','application/x-www-form-urlencoded','grant_type=','__importDefault','data','290247fDDrKO','params','9HErcVD','3135822VauXiR'];a146_0x3e56=function(){return _0x15add7;};return a146_0x3e56();} \ No newline at end of file diff --git a/plugins/google/handlers/sac/index.js b/plugins/google/handlers/sac/index.js index 7a2c9a4..1f26066 100644 --- a/plugins/google/handlers/sac/index.js +++ b/plugins/google/handlers/sac/index.js @@ -1,14 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var generate_oauth_1 = __importDefault(require("./generate-oauth")); -var generate_token_1 = require("./generate-token"); -/** - * Google Service Account Oauth Handlers - */ -exports.default = { - generateOauth: generate_oauth_1.default, - generateAccessToken: generate_token_1.generateAccessToken, -}; +'use strict';var a147_0x229ac5=a147_0x1abd;function a147_0x1abd(_0x464e32,_0x34410c){var _0x1612f2=a147_0x1612();return a147_0x1abd=function(_0x1abd5a,_0x3956bd){_0x1abd5a=_0x1abd5a-0x9a;var _0x4cdcf4=_0x1612f2[_0x1abd5a];return _0x4cdcf4;},a147_0x1abd(_0x464e32,_0x34410c);}(function(_0x102891,_0x2961d2){var _0x2682d3=a147_0x1abd,_0x42ccfb=_0x102891();while(!![]){try{var _0x54c5d9=parseInt(_0x2682d3(0x9b))/0x1+-parseInt(_0x2682d3(0xa7))/0x2+parseInt(_0x2682d3(0x9c))/0x3*(parseInt(_0x2682d3(0xa4))/0x4)+-parseInt(_0x2682d3(0xa8))/0x5+parseInt(_0x2682d3(0x9e))/0x6*(parseInt(_0x2682d3(0x9f))/0x7)+-parseInt(_0x2682d3(0x9a))/0x8+parseInt(_0x2682d3(0xa2))/0x9*(parseInt(_0x2682d3(0xa6))/0xa);if(_0x54c5d9===_0x2961d2)break;else _0x42ccfb['push'](_0x42ccfb['shift']());}catch(_0xdf71ec){_0x42ccfb['push'](_0x42ccfb['shift']());}}}(a147_0x1612,0x785f5));var __importDefault=this&&this[a147_0x229ac5(0xa3)]||function(_0x359bc1){return _0x359bc1&&_0x359bc1['__esModule']?_0x359bc1:{'default':_0x359bc1};};Object[a147_0x229ac5(0xa5)](exports,'__esModule',{'value':!![]});var generate_oauth_1=__importDefault(require(a147_0x229ac5(0xa1))),generate_token_1=require('./generate-token');exports['default']={'generateOauth':generate_oauth_1[a147_0x229ac5(0xa0)],'generateAccessToken':generate_token_1[a147_0x229ac5(0x9d)]};function a147_0x1612(){var _0x61db47=['default','./generate-oauth','18CZRawP','__importDefault','1010348etmKEr','defineProperty','7751630WdnxDi','1940786sMTrAW','3899490YlcQQU','3195560jjBaAX','678603ApLWOq','3ZcynfT','generateAccessToken','74430TdMxky','91bywKmO'];a147_0x1612=function(){return _0x61db47;};return a147_0x1612();} \ No newline at end of file diff --git a/plugins/google/helpers/API.js b/plugins/google/helpers/API.js index 8816685..076ee46 100644 --- a/plugins/google/helpers/API.js +++ b/plugins/google/helpers/API.js @@ -1,13 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** Google OAUTH APIS */ -exports.default = { - /** Authorization API */ - authorize: 'https://accounts.google.com/o/oauth2/v2/auth', - /** Refresh/Access Token Generation API */ - generateToken: 'https://oauth2.googleapis.com/token', - /** Token Validity Checker API */ - checkToken: 'https://oauth2.googleapis.com/tokeninfo', - /** Token Revoke API */ - revokeToken: 'https://oauth2.googleapis.com/revoke', -}; +'use strict';var a148_0x5b6927=a148_0x42ea;(function(_0x43c901,_0x3cc99b){var _0x4c94ec=a148_0x42ea,_0x59e9d6=_0x43c901();while(!![]){try{var _0x1b65fc=-parseInt(_0x4c94ec(0x189))/0x1*(-parseInt(_0x4c94ec(0x186))/0x2)+parseInt(_0x4c94ec(0x185))/0x3*(-parseInt(_0x4c94ec(0x191))/0x4)+-parseInt(_0x4c94ec(0x18f))/0x5+-parseInt(_0x4c94ec(0x18e))/0x6*(-parseInt(_0x4c94ec(0x184))/0x7)+parseInt(_0x4c94ec(0x187))/0x8+-parseInt(_0x4c94ec(0x18c))/0x9+-parseInt(_0x4c94ec(0x188))/0xa;if(_0x1b65fc===_0x3cc99b)break;else _0x59e9d6['push'](_0x59e9d6['shift']());}catch(_0x5bf4ae){_0x59e9d6['push'](_0x59e9d6['shift']());}}}(a148_0xdddb,0xb228e));function a148_0x42ea(_0xf8a3f8,_0x4fe0ae){var _0xdddb3=a148_0xdddb();return a148_0x42ea=function(_0x42eada,_0x41ab56){_0x42eada=_0x42eada-0x184;var _0x479a97=_0xdddb3[_0x42eada];return _0x479a97;},a148_0x42ea(_0xf8a3f8,_0x4fe0ae);}function a148_0xdddb(){var _0x17059f=['1abpfCp','https://oauth2.googleapis.com/token','https://oauth2.googleapis.com/revoke','6116625rnyPEc','default','6mDFhTu','3121820YCBLDv','defineProperty','4LCZASo','4894337oCbkFi','731373LDswHA','2835202ZoNLDo','10398256kQnCpl','11390520NfZBEb'];a148_0xdddb=function(){return _0x17059f;};return a148_0xdddb();}Object[a148_0x5b6927(0x190)](exports,'__esModule',{'value':!![]}),exports[a148_0x5b6927(0x18d)]={'authorize':'https://accounts.google.com/o/oauth2/v2/auth','generateToken':a148_0x5b6927(0x18a),'checkToken':'https://oauth2.googleapis.com/tokeninfo','revokeToken':a148_0x5b6927(0x18b)}; \ No newline at end of file diff --git a/plugins/google/helpers/construct-fields.js b/plugins/google/helpers/construct-fields.js index 203941f..2b637fe 100644 --- a/plugins/google/helpers/construct-fields.js +++ b/plugins/google/helpers/construct-fields.js @@ -1,35 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Constructs Fields Parameter for Google Requests - * - * @param {string[]} fields - Array of Fields - * @param {string} prefix - Prefix to be added to each field - * @returns {string} - Constructed Field Parameter - */ -function default_1(fields, prefix) { - var constructedField = ''; - if (prefix) { - for (var i = 0; i < fields.length; i++) { - if (i < fields.length - 1) { - constructedField += "".concat(prefix, "/").concat(fields[i], ","); - } - else { - constructedField += "".concat(prefix, "/").concat(fields[i]); - } - } - return constructedField; - } - else { - for (var i = 0; i < fields.length; i++) { - if (i < fields.length - 1) { - constructedField += "".concat(fields[i], ","); - } - else { - constructedField += "".concat(fields[i]); - } - } - return constructedField; - } -} -exports.default = default_1; +'use strict';function a149_0x5592(){var _0x358e36=['1522765UptuTU','133FHqZue','2824490SfiEwr','concat','58jqyskS','1755231CQKuCF','defineProperty','20werkDZ','9oAgJaZ','20718avDWrI','10024069RNrbLi','5699802zQDxLH','111352IxMTEU','length','default'];a149_0x5592=function(){return _0x358e36;};return a149_0x5592();}var a149_0x2c96d3=a149_0x44e3;function a149_0x44e3(_0x2a4494,_0x2b4bae){var _0x55929a=a149_0x5592();return a149_0x44e3=function(_0x44e343,_0x256aca){_0x44e343=_0x44e343-0xdd;var _0x5d1f62=_0x55929a[_0x44e343];return _0x5d1f62;},a149_0x44e3(_0x2a4494,_0x2b4bae);}(function(_0x8cd923,_0x7a3b9){var _0x4fd2c2=a149_0x44e3,_0x532b25=_0x8cd923();while(!![]){try{var _0x3e4071=parseInt(_0x4fd2c2(0xeb))/0x1*(parseInt(_0x4fd2c2(0xe1))/0x2)+parseInt(_0x4fd2c2(0xdd))/0x3+parseInt(_0x4fd2c2(0xdf))/0x4*(-parseInt(_0x4fd2c2(0xe7))/0x5)+parseInt(_0x4fd2c2(0xe3))/0x6+parseInt(_0x4fd2c2(0xe8))/0x7*(-parseInt(_0x4fd2c2(0xe4))/0x8)+parseInt(_0x4fd2c2(0xe0))/0x9*(-parseInt(_0x4fd2c2(0xe9))/0xa)+parseInt(_0x4fd2c2(0xe2))/0xb;if(_0x3e4071===_0x7a3b9)break;else _0x532b25['push'](_0x532b25['shift']());}catch(_0x44ce78){_0x532b25['push'](_0x532b25['shift']());}}}(a149_0x5592,0xeea3e));Object[a149_0x2c96d3(0xde)](exports,'__esModule',{'value':!![]});function default_1(_0x26d10e,_0x1c0869){var _0x4af84d=a149_0x2c96d3,_0x4e1779='';if(_0x1c0869){for(var _0x39b46a=0x0;_0x39b46a<_0x26d10e[_0x4af84d(0xe5)];_0x39b46a++){_0x39b46a<_0x26d10e['length']-0x1?_0x4e1779+=''[_0x4af84d(0xea)](_0x1c0869,'/')[_0x4af84d(0xea)](_0x26d10e[_0x39b46a],','):_0x4e1779+=''[_0x4af84d(0xea)](_0x1c0869,'/')[_0x4af84d(0xea)](_0x26d10e[_0x39b46a]);}return _0x4e1779;}else{for(var _0x39b46a=0x0;_0x39b46a<_0x26d10e['length'];_0x39b46a++){_0x39b46a<_0x26d10e['length']-0x1?_0x4e1779+=''[_0x4af84d(0xea)](_0x26d10e[_0x39b46a],','):_0x4e1779+=''['concat'](_0x26d10e[_0x39b46a]);}return _0x4e1779;}}exports[a149_0x2c96d3(0xe6)]=default_1; \ No newline at end of file diff --git a/plugins/google/helpers/index.js b/plugins/google/helpers/index.js index 13c54fa..28e8adc 100644 --- a/plugins/google/helpers/index.js +++ b/plugins/google/helpers/index.js @@ -1,21 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mimeArray = exports.mimeTypes = exports.constructFields = exports.createJwtToken = exports.googleApiRequest = exports.stringizeScope = exports.resolveToken = exports.api = void 0; -var API_1 = require("./API"); -Object.defineProperty(exports, "api", { enumerable: true, get: function () { return __importDefault(API_1).default; } }); -var resolve_token_1 = require("./resolve-token"); -Object.defineProperty(exports, "resolveToken", { enumerable: true, get: function () { return __importDefault(resolve_token_1).default; } }); -var stringize_scope_1 = require("./stringize-scope"); -Object.defineProperty(exports, "stringizeScope", { enumerable: true, get: function () { return __importDefault(stringize_scope_1).default; } }); -var requester_1 = require("./requester"); -Object.defineProperty(exports, "googleApiRequest", { enumerable: true, get: function () { return __importDefault(requester_1).default; } }); -var sign_jwt_1 = require("./sign-jwt"); -Object.defineProperty(exports, "createJwtToken", { enumerable: true, get: function () { return __importDefault(sign_jwt_1).default; } }); -var construct_fields_1 = require("./construct-fields"); -Object.defineProperty(exports, "constructFields", { enumerable: true, get: function () { return __importDefault(construct_fields_1).default; } }); -var mimetypes_1 = require("./mimetypes"); -Object.defineProperty(exports, "mimeTypes", { enumerable: true, get: function () { return __importDefault(mimetypes_1).default; } }); -Object.defineProperty(exports, "mimeArray", { enumerable: true, get: function () { return mimetypes_1.mimeArray; } }); +'use strict';var a150_0x4fbca5=a150_0x1354;function a150_0x1354(_0x4842b1,_0x30b4e7){var _0x27c34f=a150_0x27c3();return a150_0x1354=function(_0x1354ce,_0x91a2fc){_0x1354ce=_0x1354ce-0x100;var _0x1d51fa=_0x27c34f[_0x1354ce];return _0x1d51fa;},a150_0x1354(_0x4842b1,_0x30b4e7);}(function(_0x39653f,_0x576321){var _0x32d9d5=a150_0x1354,_0x3606b5=_0x39653f();while(!![]){try{var _0x20582f=-parseInt(_0x32d9d5(0x105))/0x1+parseInt(_0x32d9d5(0x106))/0x2+parseInt(_0x32d9d5(0x118))/0x3+-parseInt(_0x32d9d5(0x10d))/0x4+-parseInt(_0x32d9d5(0x119))/0x5*(-parseInt(_0x32d9d5(0x107))/0x6)+parseInt(_0x32d9d5(0x116))/0x7+parseInt(_0x32d9d5(0x10a))/0x8;if(_0x20582f===_0x576321)break;else _0x3606b5['push'](_0x3606b5['shift']());}catch(_0xc094ad){_0x3606b5['push'](_0x3606b5['shift']());}}}(a150_0x27c3,0x284fe));var __importDefault=this&&this[a150_0x4fbca5(0x113)]||function(_0x54b0c4){var _0x4ea379=a150_0x4fbca5;return _0x54b0c4&&_0x54b0c4[_0x4ea379(0x110)]?_0x54b0c4:{'default':_0x54b0c4};};Object[a150_0x4fbca5(0x102)](exports,'__esModule',{'value':!![]}),exports[a150_0x4fbca5(0x114)]=exports['mimeTypes']=exports[a150_0x4fbca5(0x10c)]=exports[a150_0x4fbca5(0x101)]=exports[a150_0x4fbca5(0x109)]=exports[a150_0x4fbca5(0x115)]=exports['resolveToken']=exports[a150_0x4fbca5(0x103)]=void 0x0;function a150_0x27c3(){var _0x9f9e74=['13200Weqiyt','./construct-fields','googleApiRequest','538608fJsVnE','./requester','constructFields','1270848EzealX','./resolve-token','./sign-jwt','__esModule','./mimetypes','default','__importDefault','mimeArray','stringizeScope','365554aNNiCW','mimeTypes','498627zAYqsB','715kHtwTP','./API','createJwtToken','defineProperty','api','./stringize-scope','133607LKLzoi','32160FisPkA'];a150_0x27c3=function(){return _0x9f9e74;};return a150_0x27c3();}var API_1=require(a150_0x4fbca5(0x100));Object[a150_0x4fbca5(0x102)](exports,'api',{'enumerable':!![],'get':function(){var _0x4af22f=a150_0x4fbca5;return __importDefault(API_1)[_0x4af22f(0x112)];}});var resolve_token_1=require(a150_0x4fbca5(0x10e));Object['defineProperty'](exports,'resolveToken',{'enumerable':!![],'get':function(){var _0x57f8b6=a150_0x4fbca5;return __importDefault(resolve_token_1)[_0x57f8b6(0x112)];}});var stringize_scope_1=require(a150_0x4fbca5(0x104));Object[a150_0x4fbca5(0x102)](exports,a150_0x4fbca5(0x115),{'enumerable':!![],'get':function(){return __importDefault(stringize_scope_1)['default'];}});var requester_1=require(a150_0x4fbca5(0x10b));Object['defineProperty'](exports,a150_0x4fbca5(0x109),{'enumerable':!![],'get':function(){var _0x504173=a150_0x4fbca5;return __importDefault(requester_1)[_0x504173(0x112)];}});var sign_jwt_1=require(a150_0x4fbca5(0x10f));Object[a150_0x4fbca5(0x102)](exports,a150_0x4fbca5(0x101),{'enumerable':!![],'get':function(){var _0x66dc48=a150_0x4fbca5;return __importDefault(sign_jwt_1)[_0x66dc48(0x112)];}});var construct_fields_1=require(a150_0x4fbca5(0x108));Object['defineProperty'](exports,a150_0x4fbca5(0x10c),{'enumerable':!![],'get':function(){var _0x562de4=a150_0x4fbca5;return __importDefault(construct_fields_1)[_0x562de4(0x112)];}});var mimetypes_1=require(a150_0x4fbca5(0x111));Object['defineProperty'](exports,a150_0x4fbca5(0x117),{'enumerable':!![],'get':function(){var _0x311dd7=a150_0x4fbca5;return __importDefault(mimetypes_1)[_0x311dd7(0x112)];}}),Object[a150_0x4fbca5(0x102)](exports,a150_0x4fbca5(0x114),{'enumerable':!![],'get':function(){var _0x2ef99e=a150_0x4fbca5;return mimetypes_1[_0x2ef99e(0x114)];}}); \ No newline at end of file diff --git a/plugins/google/helpers/mimetypes.js b/plugins/google/helpers/mimetypes.js index f38e726..5528a04 100644 --- a/plugins/google/helpers/mimetypes.js +++ b/plugins/google/helpers/mimetypes.js @@ -1,42 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mimeArray = void 0; -var mimeTypes = { - audio: 'application/vnd.google-apps.audio', - docs: 'application/vnd.google-apps.document', - drawings: 'application/vnd.google-apps.drawing', - drivesdk: 'application/vnd.google-apps.drive-sdk', - file: 'application/vnd.google-apps.file', - folder: 'application/vnd.google-apps.folder', - form: 'application/vnd.google-apps.form', - fusiontable: 'application/vnd.google-apps.fusiontable', - map: 'application/vnd.google-apps.map', - photo: 'application/vnd.google-apps.photo', - presentation: 'application/vnd.google-apps.presentation', - script: 'application/vnd.google-apps.script', - shortcut: 'application/vnd.google-apps.shortcut', - site: 'application/vnd.google-apps.site', - spreadsheet: 'application/vnd.google-apps.spreadsheet', - unknown: 'application/vnd.google-apps.unknown', - video: 'application/vnd.google-apps.video', -}; -exports.default = mimeTypes; -exports.mimeArray = [ - 'application/vnd.google-apps.audio', - 'application/vnd.google-apps.document', - 'application/vnd.google-apps.drive-sdk', - 'application/vnd.google-apps.drawing', - 'application/vnd.google-apps.file', - 'application/vnd.google-apps.folder', - 'application/vnd.google-apps.form', - 'application/vnd.google-apps.fusiontable', - 'application/vnd.google-apps.map', - 'application/vnd.google-apps.photo', - 'application/vnd.google-apps.presentation', - 'application/vnd.google-apps.script', - 'application/vnd.google-apps.shortcut', - 'application/vnd.google-apps.site', - 'application/vnd.google-apps.spreadsheet', - 'application/vnd.google-apps.unknown', - 'application/vnd.google-apps.video', -]; +'use strict';var a151_0x3434e1=a151_0x43ce;(function(_0x1cc533,_0x5c6e64){var _0x3876b7=a151_0x43ce,_0x505338=_0x1cc533();while(!![]){try{var _0x36dee3=-parseInt(_0x3876b7(0x116))/0x1*(parseInt(_0x3876b7(0x121))/0x2)+parseInt(_0x3876b7(0x122))/0x3+parseInt(_0x3876b7(0x12c))/0x4*(parseInt(_0x3876b7(0x12f))/0x5)+-parseInt(_0x3876b7(0x11a))/0x6+-parseInt(_0x3876b7(0x124))/0x7*(-parseInt(_0x3876b7(0x118))/0x8)+-parseInt(_0x3876b7(0x128))/0x9+-parseInt(_0x3876b7(0x12a))/0xa;if(_0x36dee3===_0x5c6e64)break;else _0x505338['push'](_0x505338['shift']());}catch(_0x34ac92){_0x505338['push'](_0x505338['shift']());}}}(a151_0x2230,0x3cec9));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['mimeArray']=void 0x0;var mimeTypes={'audio':a151_0x3434e1(0x12b),'docs':a151_0x3434e1(0x12d),'drawings':'application/vnd.google-apps.drawing','drivesdk':'application/vnd.google-apps.drive-sdk','file':a151_0x3434e1(0x119),'folder':a151_0x3434e1(0x127),'form':a151_0x3434e1(0x117),'fusiontable':a151_0x3434e1(0x120),'map':a151_0x3434e1(0x123),'photo':a151_0x3434e1(0x131),'presentation':a151_0x3434e1(0x130),'script':a151_0x3434e1(0x11c),'shortcut':a151_0x3434e1(0x11f),'site':'application/vnd.google-apps.site','spreadsheet':'application/vnd.google-apps.spreadsheet','unknown':a151_0x3434e1(0x11b),'video':a151_0x3434e1(0x12e)};function a151_0x43ce(_0x33927d,_0x38cc20){var _0x223094=a151_0x2230();return a151_0x43ce=function(_0x43cec2,_0x22ba47){_0x43cec2=_0x43cec2-0x116;var _0x3212c5=_0x223094[_0x43cec2];return _0x3212c5;},a151_0x43ce(_0x33927d,_0x38cc20);}function a151_0x2230(){var _0x41efb7=['320nTILtd','1049781XisnRZ','application/vnd.google-apps.map','2734095aftlWP','mimeArray','application/vnd.google-apps.spreadsheet','application/vnd.google-apps.folder','860337hUpGcO','default','3101040tsOSIB','application/vnd.google-apps.audio','40YiFwuT','application/vnd.google-apps.document','application/vnd.google-apps.video','145495PHePcK','application/vnd.google-apps.presentation','application/vnd.google-apps.photo','1132tryYAf','application/vnd.google-apps.form','8gwjDdB','application/vnd.google-apps.file','1170840qheDBy','application/vnd.google-apps.unknown','application/vnd.google-apps.script','application/vnd.google-apps.drive-sdk','application/vnd.google-apps.site','application/vnd.google-apps.shortcut','application/vnd.google-apps.fusiontable'];a151_0x2230=function(){return _0x41efb7;};return a151_0x2230();}exports[a151_0x3434e1(0x129)]=mimeTypes,exports[a151_0x3434e1(0x125)]=[a151_0x3434e1(0x12b),a151_0x3434e1(0x12d),a151_0x3434e1(0x11d),'application/vnd.google-apps.drawing','application/vnd.google-apps.file',a151_0x3434e1(0x127),'application/vnd.google-apps.form',a151_0x3434e1(0x120),a151_0x3434e1(0x123),a151_0x3434e1(0x131),a151_0x3434e1(0x130),a151_0x3434e1(0x11c),a151_0x3434e1(0x11f),a151_0x3434e1(0x11e),a151_0x3434e1(0x126),a151_0x3434e1(0x11b),'application/vnd.google-apps.video']; \ No newline at end of file diff --git a/plugins/google/helpers/requester.js b/plugins/google/helpers/requester.js index ffe016e..cd747f5 100644 --- a/plugins/google/helpers/requester.js +++ b/plugins/google/helpers/requester.js @@ -1,206 +1 @@ -"use strict"; -/* eslint-disable quote-props */ -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Import Axios -var axios_1 = __importDefault(require("../../axios")); -var got_1 = __importDefault(require("got")); -// Others -var query_string_1 = __importDefault(require("query-string")); -/** - * Constructs a Google API Request URL with Params - * - * @param { string } url - API URL - * @param { Object } params - Query Params for the Route - * @returns { string } - Constructed URL - */ -function constructURL(url, params) { - if (params) { - var serialisedParam = query_string_1.default.stringify(params); - return "".concat(url, "?").concat(serialisedParam); - } - else { - return "".concat(url); - } -} -/** - * Constructs Header Object for Google Api Request - * - * @param { string } type - get or post Request - * @param {ITokenDoc} token - Token Document from Database - * @param {object} headers - Other Headers to be Included - * @returns {object} - Header Object - */ -function constructHeaders(type, token, headers) { - if (type === 'get') { - return __assign({ Authorization: "Bearer ".concat(token.token), Accept: 'application/json' }, headers); - } - else { - return __assign({ Authorization: "Bearer ".concat(token.token), 'Content-Type': 'application/json' }, headers); - } -} -/** - * Handles API Response from Google API Request - * - * @param {AxiosResponse} response - API Response from the Request - * @returns {IGoogleResponse} - Modified Response - */ -function handleResponse(response) { - if (response.status === 200) { - var funcResponse = { - success: true, - data: response.data, - error: null, - }; - return funcResponse; - } - else { - var funcResponse = { - success: false, - data: undefined, - error: null, - }; - return funcResponse; - } -} -/** - * Google API Requester and Response Handlers - */ -var googleRequest = { - /** - * Makes a GET Google API Request - * - * @param {string} api - Google API URL - * @param {ITokenDoc} token - Relevant Token Document from Database - * @param {Record} params - Data to be Embedded in Request - * @param {Record} headers - Additional Headers to be Sent - * @returns {Promise} - Response from the API - */ - get: function (api, token, params, headers) { - return new Promise(function (resolve, reject) { - var url = constructURL(api, params); - var getHeaders = constructHeaders('get', token, headers); - axios_1.default - .get(url, { - headers: getHeaders, - }) - .then(function (response) { - var resp = handleResponse(response); - resolve(resp); - }) - .catch(function (error) { - reject(error); - }); - }); - }, - /** - * Makes a POST Google API Request - * - * @param {string} api - Google API URL - * @param {ITokenDoc} token - Relevant Token Document from Database - * @param {Record} data - Data to be sent in Request - * @param {Record} params - params to be attached to URL - * @param {Record} headers - Additional Headers to be Sent - * @returns {Promise} - Response from the API - */ - post: function (api, token, data, params, headers) { - return new Promise(function (resolve, reject) { - var url = constructURL(api, params); - var getHeaders = constructHeaders('post', token, headers); - axios_1.default - .post(url, data, { - headers: getHeaders, - }) - .then(function (response) { - var resp = handleResponse(response); - resolve(resp); - }) - .catch(function (error) { - reject(error); - }); - }); - }, - /** - * Makes a POST Google API Request - * - * @param {string} api - Google API URL - * @param {ITokenDoc} token - Relevant Token Document from Database - * @param {Record} data - Data to be sent in Request - * @param {Record} params - params to be attached to URL - * @param {Record} headers - Additional Headers to be Sent - * @returns {Promise} - Response from the API - */ - patch: function (api, token, data, params, headers) { - return new Promise(function (resolve, reject) { - var url = constructURL(api, params); - var getHeaders = constructHeaders('post', token, headers); - axios_1.default - .patch(url, data, { - headers: getHeaders, - }) - .then(function (response) { - var resp = handleResponse(response); - resolve(resp); - }) - .catch(function (error) { - reject(error); - }); - }); - }, - /** - * Makes a DELETE Google API Request - * - * @param {string} api - Google API URL - * @param {ITokenDoc} token - Relevant Token Document from Database - * @param {Record} data - Data to be sent in Request - * @param {Record} headers - Additional Headers to be Sent - * @returns {Promise} - Response from the API - */ - delete: function (api, token, data, headers) { - return new Promise(function (resolve, reject) { - var url = constructURL(api); - var getHeaders = constructHeaders('post', token, headers); - axios_1.default - .delete(url, { - headers: getHeaders, - data: data, - }) - .then(function (response) { - var resp = handleResponse(response); - resolve(resp); - }) - .catch(function (error) { - reject(error); - }); - }); - }, - /** - * Makes a Streaming Request to Google API - * - * @param {string} api - Google API URL - * @param {ITokenDoc} token - Relevant Token Document from Database - * @param {Record} params - params to be attached to URL - * @returns {GotReturn} - Response from the API - */ - stream: function (api, token, params) { - var url = constructURL(api, params); - var getHeaders = constructHeaders('get', token); - return got_1.default.stream(url, { - headers: getHeaders, - }); - }, -}; -exports.default = googleRequest; +'use strict';var a152_0x3aa6f2=a152_0x2e0f;function a152_0x2e0f(_0x62325b,_0x3060da){var _0x51c79f=a152_0x51c7();return a152_0x2e0f=function(_0x2e0f28,_0x3ad67a){_0x2e0f28=_0x2e0f28-0x1bf;var _0x58abb4=_0x51c79f[_0x2e0f28];return _0x58abb4;},a152_0x2e0f(_0x62325b,_0x3060da);}(function(_0xdcc6c,_0x576666){var _0x45eb0b=a152_0x2e0f,_0x5a57b8=_0xdcc6c();while(!![]){try{var _0x20e6cf=-parseInt(_0x45eb0b(0x1c4))/0x1*(-parseInt(_0x45eb0b(0x1c0))/0x2)+-parseInt(_0x45eb0b(0x1d9))/0x3*(-parseInt(_0x45eb0b(0x1c2))/0x4)+parseInt(_0x45eb0b(0x1de))/0x5*(parseInt(_0x45eb0b(0x1dc))/0x6)+-parseInt(_0x45eb0b(0x1d6))/0x7*(parseInt(_0x45eb0b(0x1d0))/0x8)+-parseInt(_0x45eb0b(0x1ce))/0x9*(-parseInt(_0x45eb0b(0x1d5))/0xa)+parseInt(_0x45eb0b(0x1db))/0xb*(-parseInt(_0x45eb0b(0x1df))/0xc)+-parseInt(_0x45eb0b(0x1d8))/0xd;if(_0x20e6cf===_0x576666)break;else _0x5a57b8['push'](_0x5a57b8['shift']());}catch(_0x3162d5){_0x5a57b8['push'](_0x5a57b8['shift']());}}}(a152_0x51c7,0xd2198));function a152_0x51c7(){var _0x4e503e=['application/json','11wcqvZN','678wTTxLq','call','27390dxjWKP','11325708IJBWpj','length','token','__esModule','2Grhegg','query-string','85636tcApRN','Bearer\x20','1632219scmOJx','defineProperty','catch','prototype','stringify','hasOwnProperty','delete','get','patch','default','3922389pBxGOl','then','8XirBoq','post','__importDefault','concat','__assign','10bbmVGz','9354863bfsMub','got','7182383mvkIOe','141GDchdg'];a152_0x51c7=function(){return _0x4e503e;};return a152_0x51c7();}var __assign=this&&this[a152_0x3aa6f2(0x1d4)]||function(){return __assign=Object['assign']||function(_0x3fa5c1){var _0x57faf7=a152_0x2e0f;for(var _0x5c68ca,_0x17bedc=0x1,_0x21c066=arguments[_0x57faf7(0x1e0)];_0x17bedc<_0x21c066;_0x17bedc++){_0x5c68ca=arguments[_0x17bedc];for(var _0x564737 in _0x5c68ca)if(Object[_0x57faf7(0x1c7)][_0x57faf7(0x1c9)][_0x57faf7(0x1dd)](_0x5c68ca,_0x564737))_0x3fa5c1[_0x564737]=_0x5c68ca[_0x564737];}return _0x3fa5c1;},__assign['apply'](this,arguments);},__importDefault=this&&this[a152_0x3aa6f2(0x1d2)]||function(_0x55e665){var _0xd3772=a152_0x3aa6f2;return _0x55e665&&_0x55e665[_0xd3772(0x1bf)]?_0x55e665:{'default':_0x55e665};};Object[a152_0x3aa6f2(0x1c5)](exports,a152_0x3aa6f2(0x1bf),{'value':!![]});var axios_1=__importDefault(require('../../axios')),got_1=__importDefault(require(a152_0x3aa6f2(0x1d7))),query_string_1=__importDefault(require(a152_0x3aa6f2(0x1c1)));function constructURL(_0x815117,_0x3e351d){var _0x5f5d14=a152_0x3aa6f2;if(_0x3e351d){var _0x27e9dc=query_string_1['default'][_0x5f5d14(0x1c8)](_0x3e351d);return''['concat'](_0x815117,'?')['concat'](_0x27e9dc);}else return''[_0x5f5d14(0x1d3)](_0x815117);}function constructHeaders(_0xfc2fb3,_0x50e914,_0x29e71e){var _0x220594=a152_0x3aa6f2;return _0xfc2fb3===_0x220594(0x1cb)?__assign({'Authorization':'Bearer\x20'[_0x220594(0x1d3)](_0x50e914[_0x220594(0x1e1)]),'Accept':'application/json'},_0x29e71e):__assign({'Authorization':_0x220594(0x1c3)[_0x220594(0x1d3)](_0x50e914[_0x220594(0x1e1)]),'Content-Type':_0x220594(0x1da)},_0x29e71e);}function handleResponse(_0xbbf7b7){if(_0xbbf7b7['status']===0xc8){var _0x22499b={'success':!![],'data':_0xbbf7b7['data'],'error':null};return _0x22499b;}else{var _0x22499b={'success':![],'data':undefined,'error':null};return _0x22499b;}}var googleRequest={'get':function(_0x2fb1d1,_0x11f665,_0x32586c,_0x2be56c){return new Promise(function(_0x4475b5,_0x32d8ba){var _0x483f7e=a152_0x2e0f,_0x377006=constructURL(_0x2fb1d1,_0x32586c),_0x11d7db=constructHeaders(_0x483f7e(0x1cb),_0x11f665,_0x2be56c);axios_1[_0x483f7e(0x1cd)][_0x483f7e(0x1cb)](_0x377006,{'headers':_0x11d7db})[_0x483f7e(0x1cf)](function(_0x42b1cb){var _0xabf454=handleResponse(_0x42b1cb);_0x4475b5(_0xabf454);})[_0x483f7e(0x1c6)](function(_0x1ea290){_0x32d8ba(_0x1ea290);});});},'post':function(_0x1a879e,_0x5dbe19,_0x594205,_0x447861,_0x2175d6){return new Promise(function(_0x2c6927,_0x1eb27){var _0x4f1b59=a152_0x2e0f,_0x417893=constructURL(_0x1a879e,_0x447861),_0x4c7a53=constructHeaders(_0x4f1b59(0x1d1),_0x5dbe19,_0x2175d6);axios_1[_0x4f1b59(0x1cd)][_0x4f1b59(0x1d1)](_0x417893,_0x594205,{'headers':_0x4c7a53})[_0x4f1b59(0x1cf)](function(_0x632547){var _0x531721=handleResponse(_0x632547);_0x2c6927(_0x531721);})['catch'](function(_0x1a135d){_0x1eb27(_0x1a135d);});});},'patch':function(_0x282dcf,_0x78bf3e,_0x752d4a,_0x51b559,_0x1edff3){return new Promise(function(_0x5a0484,_0x28a9a1){var _0x5de7d0=a152_0x2e0f,_0x5092b2=constructURL(_0x282dcf,_0x51b559),_0x29e30c=constructHeaders('post',_0x78bf3e,_0x1edff3);axios_1['default'][_0x5de7d0(0x1cc)](_0x5092b2,_0x752d4a,{'headers':_0x29e30c})[_0x5de7d0(0x1cf)](function(_0x56453a){var _0x3a9535=handleResponse(_0x56453a);_0x5a0484(_0x3a9535);})['catch'](function(_0x20a813){_0x28a9a1(_0x20a813);});});},'delete':function(_0x26abee,_0xf3575b,_0x198bf7,_0x463e4a){return new Promise(function(_0x1997bc,_0x4089d2){var _0x27ff5a=a152_0x2e0f,_0x2c999e=constructURL(_0x26abee),_0x5342e4=constructHeaders('post',_0xf3575b,_0x463e4a);axios_1['default'][_0x27ff5a(0x1ca)](_0x2c999e,{'headers':_0x5342e4,'data':_0x198bf7})[_0x27ff5a(0x1cf)](function(_0x58e43f){var _0x2d0801=handleResponse(_0x58e43f);_0x1997bc(_0x2d0801);})['catch'](function(_0xba402f){_0x4089d2(_0xba402f);});});},'stream':function(_0x2e0c34,_0x2a4c55,_0x413759){var _0x2d0b4c=constructURL(_0x2e0c34,_0x413759),_0x51c3ad=constructHeaders('get',_0x2a4c55);return got_1['default']['stream'](_0x2d0b4c,{'headers':_0x51c3ad});}};exports[a152_0x3aa6f2(0x1cd)]=googleRequest; \ No newline at end of file diff --git a/plugins/google/helpers/resolve-token.js b/plugins/google/helpers/resolve-token.js index 529b58b..08a1739 100644 --- a/plugins/google/helpers/resolve-token.js +++ b/plugins/google/helpers/resolve-token.js @@ -1,409 +1 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Models -var _models_1 = require("../../../models"); -// Others -var generate_token_1 = require("../../google/handlers/nac/generate-token"); -var generate_token_2 = require("../../google/handlers/sac/generate-token"); -var misc_1 = require("../../misc"); -/** - * Fetches all the Data in the Database Related to a Credential ID - * - * @param { string } credentialID - Credential ID from the Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns { IGetAllTokens } - Data Related to Credential ID - */ -function getAllTokens(credentialID, scopes) { - return new Promise(function (resolve, reject) { - var response = { - success: false, - }; - _models_1.Credentials.findById(credentialID) - .then(function (credential) { - if (credential) { - response.credential = credential; - _models_1.ServiceAccs.find({ related_to: credential._id }) - .then(function (serviceAccs) { - response.serviceAcc = serviceAccs; - var serviceAccountIds = serviceAccs.map(function (account) { return account._id; }); - var tokenFindParam = __spreadArray([ - { related_to: credential._id, scopes: scopes } - ], serviceAccountIds.map(function (id) { return ({ related_to: id, scopes: scopes }); }), true); - _models_1.Tokens.find({ - $or: tokenFindParam, - }) - .then(function (tokens) { - if (tokens.length > 0) { - var normalAccessTokens = tokens.filter(function (token) { - return token.type === 'access' && - token.ref_model === 'Credential'; - }); - var serviceAccessTokens = tokens.filter(function (token) { - return token.type === 'access' && - token.ref_model === 'ServiceAccount'; - }); - var refreshTokens = tokens.filter(function (token) { return token.type === 'refresh'; }); - response.tokens = { - access: { - normal: normalAccessTokens, - service: serviceAccessTokens, - }, - refresh: refreshTokens, - }; - response.success = true; - resolve(response); - } - else { - response.success = false; - resolve(response); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - } - }) - .catch(function (error) { - reject(new Error("".concat(error.name, ": ").concat(error.message))); - }); - }); -} -/** - * Checks Validity of Tokens - * - * @param {ITokenDoc[]} tokens - Array of Token Documents from Database - * @returns {IValidityCheck} - tokens Array with Validity - */ -function checkValidity(tokens) { - var validityArray = tokens.map(function (token) { - /** To be future proof, Checking all Tokens which are Expiring within 15 minutes */ - var currentTime = Date.now() + 15 * 60 * 1000; - var tokenTime = token.expires_at; - var response = { - token: token, - validity: false, - }; - if (tokenTime > currentTime) { - response.validity = true; - } - return response; - }); - return validityArray; -} -/** - * Deletes Tokens from Database - * - * @param {ITokenDoc[]} tokens - Array of Token Documents from Database - */ -function deleteInvalidTokens(tokens) { - return new Promise(function (resolve, reject) { - var tokenDeleteParam = tokens.map(function (token) { return token._id; }); - _models_1.Tokens.deleteMany({ _id: { $in: tokenDeleteParam } }) - .then(function () { return resolve(); }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); -} -/** - * Generates a Access Token for the Particular Credentials and Saves it to Database - * - * @param {ICredentialsDoc} credentials - Credentials from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @param {ITokenDoc} refreshToken - Refresh Token Document from Database - * @returns {Promise} - Generated Access Token - */ -function generateNormalTokenSave(credentials, scopes, refreshToken) { - return new Promise(function (resolve, reject) { - (0, generate_token_1.generateAccessToken)(credentials, refreshToken.token) - .then(function (response) { - var uid = (0, misc_1.objectID)('t'); - var now = Date.now(); - var token = { - _id: uid, - token: response.access_token, - type: 'access', - related_to: credentials._id, - scopes: scopes, - ref_model: 'Credential', - expires_at: now + response.expires_in * 1000, - website: 'google.com', - }; - _models_1.Tokens.create(token) - .then(function (savedToken) { - resolve(savedToken); - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }) - .catch(function (err) { - reject(new Error(err)); - }); - }); -} -/** - * Generates a Access Token for Service Account and Saves it to Database - * - * @param {IServiceAccDoc} account - Service Account Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns {Promise} - Generated Access Token - */ -function generateServiceTokenSave(account, scopes) { - return new Promise(function (resolve, reject) { - (0, generate_token_2.generateAccessToken)(account, scopes) - .then(function (response) { - var uid = (0, misc_1.objectID)('t'); - var now = Date.now(); - var token = { - _id: uid, - token: response.access_token, - type: 'access', - related_to: account._id, - scopes: scopes, - ref_model: 'ServiceAccount', - expires_at: now + response.expires_in * 1000, - website: 'google.com', - }; - _models_1.Tokens.create(token) - .then(function (savedToken) { - resolve(savedToken); - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }) - .catch(function (err) { - reject(new Error(err)); - }); - }); -} -/** - * Handles Access Token Generation for Service Account Accounts - * - * @param {IGetAllTokens} tokenData - Response from GetallTokens Function - * @param {TGoogleApiScope} scopes - Google Oauth API Scopes - * @returns {Promise} - Access Token for Each Service Account - */ -function serviceAccountTokenHandler(tokenData, scopes) { - return new Promise(function (resolve, reject) { - var serviceAcc = tokenData.serviceAcc; - if (serviceAcc) { - var tokens = tokenData.tokens; - if (tokens && tokens.access.service) { - var validityArray = checkValidity(tokens.access.service); - var validTokens_1 = validityArray - .filter(function (token) { return token.validity; }) - .map(function (token) { return token.token; }); - var invalidTokens = validityArray - .filter(function (token) { return !token.validity; }) - .map(function (token) { return token.token; }); - deleteInvalidTokens(invalidTokens) - .then(function () { - if (validTokens_1.length > 0) { - resolve(validTokens_1); - } - else { - var tokenArray_1 = []; - serviceAcc.forEach(function (account) { - generateServiceTokenSave(account, scopes) - .then(function (serviceToken) { - tokenArray_1.push(serviceToken); - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); - if (tokenArray_1.length > 1) { - resolve(tokenArray_1); - } - else { - resolve(false); - } - } - }) - .catch(function (err) { - reject(new Error(err)); - }); - } - else { - var tokenArray_2 = []; - serviceAcc.forEach(function (account) { - generateServiceTokenSave(account, scopes) - .then(function (serviceToken) { - tokenArray_2.push(serviceToken); - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - }); - if (tokenArray_2.length > 1) { - resolve(tokenArray_2); - } - else { - resolve(false); - } - } - } - else { - resolve(false); - } - }); -} -/** - * Checks Validity of Access Tokens and Refreshes it - * - * @param { IGetAllTokens } tokenData - Response from GetallTokens Function - * @param { TGoogleApiScope[] } scopes - Google Oauth API Scopes - * @returns { IGetAllTokens } - Active Tokens - */ -function checkTokenRefreshit(tokenData, scopes) { - return new Promise(function (resolve, reject) { - var success = tokenData.success, credential = tokenData.credential, serviceAcc = tokenData.serviceAcc, tokens = tokenData.tokens; - if (success && credential && tokens) { - var access = tokens.access, refresh_1 = tokens.refresh; - if (refresh_1.length > 0) { - var response_1 = { - success: false, - credential: credential, - serviceAcc: serviceAcc, - }; - if (access.normal.length === 0) { - generateNormalTokenSave(credential, scopes, refresh_1[0]) - .then(function (savedToken) { - response_1.success = false; - response_1.tokens = { - refresh: refresh_1, - access: { - normal: [savedToken], - }, - }; - resolve(response_1); - }) - .catch(function (err) { - reject(new Error(err)); - }); - } - else { - var validityArray = checkValidity(access.normal); - var validTokens_2 = validityArray - .filter(function (token) { return token.validity; }) - .map(function (token) { return token.token; }); - var invalidTokens = validityArray - .filter(function (token) { return !token.validity; }) - .map(function (token) { return token.token; }); - deleteInvalidTokens(invalidTokens) - .then(function () { - response_1.success = true; - if (validTokens_2.length > 0) { - response_1.tokens = { - refresh: refresh_1, - access: { - normal: validTokens_2, - }, - }; - resolve(response_1); - } - else { - generateNormalTokenSave(credential, scopes, refresh_1[0]) - .then(function (savedToken) { - response_1.tokens = { - refresh: refresh_1, - access: { - normal: [savedToken], - }, - }; - resolve(response_1); - }) - .catch(function (err) { - reject(new Error(err)); - }); - } - }) - .catch(function (err) { - reject(new Error("".concat(err.name, ": ").concat(err.message))); - }); - } - } - else { - var response = { - success: false, - }; - resolve(response); - } - } - else { - var response = { - success: false, - }; - resolve(response); - } - }); -} -/** - * Resolves a Access Token for the Respective Google Credential ID (Incl. Service Accounts) - * - * @param { string } credentialID - Credentials ID From Database - * @param { TGoogleApiScope[] } scopes - Google OAuth API Scopes - * @returns { Promise } - Resolves a Token to use in Google API - */ -function default_1(credentialID, scopes) { - return new Promise(function (resolve, reject) { - getAllTokens(credentialID, scopes) - .then(function (credentialData) { - checkTokenRefreshit(credentialData, scopes) - .then(function (validTokens) { - if (validTokens.tokens) { - serviceAccountTokenHandler(credentialData, scopes) - .then(function (serviceTokens) { - if (validTokens.tokens) { - if (serviceTokens) { - var response = { - success: true, - tokens: __spreadArray(__spreadArray([], validTokens.tokens.access.normal, true), serviceTokens, true), - }; - resolve(response); - } - else { - var response = { - success: true, - tokens: validTokens.tokens.access.normal, - }; - resolve(response); - } - } - else { - reject(new Error('No Possible Tokens Found or Generated')); - } - }) - .catch(function () { - reject(new Error('Error While Fetching Service Account Tokens')); - }); - } - else { - reject(new Error('No Tokens Found')); - } - }) - .catch(function (err) { - reject(new Error(err)); - }); - }) - .catch(function (err) { - reject(err); - }); - }); -} -exports.default = default_1; +'use strict';var a153_0xff8c74=a153_0x1e68;(function(_0x419761,_0x100c17){var _0x4b9462=a153_0x1e68,_0x12b8bb=_0x419761();while(!![]){try{var _0xf556e3=-parseInt(_0x4b9462(0x20a))/0x1*(-parseInt(_0x4b9462(0x20f))/0x2)+-parseInt(_0x4b9462(0x1f3))/0x3+-parseInt(_0x4b9462(0x214))/0x4+-parseInt(_0x4b9462(0x1fb))/0x5*(parseInt(_0x4b9462(0x202))/0x6)+-parseInt(_0x4b9462(0x219))/0x7+parseInt(_0x4b9462(0x225))/0x8*(parseInt(_0x4b9462(0x21f))/0x9)+parseInt(_0x4b9462(0x1f6))/0xa;if(_0xf556e3===_0x100c17)break;else _0x12b8bb['push'](_0x12b8bb['shift']());}catch(_0x154b81){_0x12b8bb['push'](_0x12b8bb['shift']());}}}(a153_0x5df7,0x34476));var __spreadArray=this&&this[a153_0xff8c74(0x1f5)]||function(_0x1744f6,_0x2b8592,_0x6a8709){var _0x1583bd=a153_0xff8c74;if(_0x6a8709||arguments[_0x1583bd(0x201)]===0x2)for(var _0x527efa=0x0,_0x4c5f5d=_0x2b8592['length'],_0x3bccd2;_0x527efa<_0x4c5f5d;_0x527efa++){if(_0x3bccd2||!(_0x527efa in _0x2b8592)){if(!_0x3bccd2)_0x3bccd2=Array[_0x1583bd(0x211)][_0x1583bd(0x1fa)]['call'](_0x2b8592,0x0,_0x527efa);_0x3bccd2[_0x527efa]=_0x2b8592[_0x527efa];}}return _0x1744f6[_0x1583bd(0x20e)](_0x3bccd2||Array[_0x1583bd(0x211)]['slice'][_0x1583bd(0x221)](_0x2b8592));};Object['defineProperty'](exports,a153_0xff8c74(0x213),{'value':!![]});var _models_1=require('../../../models'),generate_token_1=require('../../google/handlers/nac/generate-token'),generate_token_2=require('../../google/handlers/sac/generate-token'),misc_1=require('../../misc');function getAllTokens(_0x147566,_0x3f1ef0){return new Promise(function(_0x6045bb,_0x1aec99){var _0x4cef43=a153_0x1e68,_0x1970fb={'success':![]};_models_1[_0x4cef43(0x218)][_0x4cef43(0x21b)](_0x147566)['then'](function(_0x544a24){var _0x9da1d6=_0x4cef43;_0x544a24&&(_0x1970fb['credential']=_0x544a24,_models_1['ServiceAccs'][_0x9da1d6(0x21c)]({'related_to':_0x544a24[_0x9da1d6(0x207)]})[_0x9da1d6(0x222)](function(_0x3d437f){var _0x537c61=_0x9da1d6;_0x1970fb[_0x537c61(0x220)]=_0x3d437f;var _0x35d732=_0x3d437f[_0x537c61(0x223)](function(_0x3afbf7){return _0x3afbf7['_id'];}),_0xf14da8=__spreadArray([{'related_to':_0x544a24[_0x537c61(0x207)],'scopes':_0x3f1ef0}],_0x35d732[_0x537c61(0x223)](function(_0x5ed8ce){return{'related_to':_0x5ed8ce,'scopes':_0x3f1ef0};}),!![]);_models_1['Tokens'][_0x537c61(0x21c)]({'$or':_0xf14da8})[_0x537c61(0x222)](function(_0x297502){var _0x2a2693=_0x537c61;if(_0x297502[_0x2a2693(0x201)]>0x0){var _0x42708b=_0x297502[_0x2a2693(0x209)](function(_0x267dbf){var _0x358654=_0x2a2693;return _0x267dbf[_0x358654(0x217)]===_0x358654(0x1ff)&&_0x267dbf[_0x358654(0x208)]===_0x358654(0x1f4);}),_0x1459f1=_0x297502[_0x2a2693(0x209)](function(_0x4d10b7){var _0x47ab94=_0x2a2693;return _0x4d10b7[_0x47ab94(0x217)]===_0x47ab94(0x1ff)&&_0x4d10b7['ref_model']==='ServiceAccount';}),_0x79146=_0x297502[_0x2a2693(0x209)](function(_0x3da6c3){var _0x20e2a9=_0x2a2693;return _0x3da6c3[_0x20e2a9(0x217)]===_0x20e2a9(0x204);});_0x1970fb[_0x2a2693(0x224)]={'access':{'normal':_0x42708b,'service':_0x1459f1},'refresh':_0x79146},_0x1970fb['success']=!![],_0x6045bb(_0x1970fb);}else _0x1970fb[_0x2a2693(0x1f2)]=![],_0x6045bb(_0x1970fb);})[_0x537c61(0x21a)](function(_0x372d19){var _0x3a5335=_0x537c61;_0x1aec99(new Error(''[_0x3a5335(0x20e)](_0x372d19[_0x3a5335(0x210)],':\x20')['concat'](_0x372d19[_0x3a5335(0x21e)])));});})['catch'](function(_0x51a9c8){var _0xc7e5a0=_0x9da1d6;_0x1aec99(new Error(''[_0xc7e5a0(0x20e)](_0x51a9c8['name'],':\x20')[_0xc7e5a0(0x20e)](_0x51a9c8[_0xc7e5a0(0x21e)])));}));})['catch'](function(_0x2f6b36){var _0x235581=_0x4cef43;_0x1aec99(new Error(''[_0x235581(0x20e)](_0x2f6b36[_0x235581(0x210)],':\x20')[_0x235581(0x20e)](_0x2f6b36[_0x235581(0x21e)])));});});}function checkValidity(_0x27a493){var _0x3fad67=a153_0xff8c74,_0x23939b=_0x27a493[_0x3fad67(0x223)](function(_0x6c5d21){var _0xe318fb=_0x3fad67,_0x131d28=Date[_0xe318fb(0x20b)]()+0xf*0x3c*0x3e8,_0x3b3eb3=_0x6c5d21[_0xe318fb(0x203)],_0x418b2c={'token':_0x6c5d21,'validity':![]};return _0x3b3eb3>_0x131d28&&(_0x418b2c[_0xe318fb(0x206)]=!![]),_0x418b2c;});return _0x23939b;}function a153_0x1e68(_0x112e36,_0x3557e8){var _0x5df76b=a153_0x5df7();return a153_0x1e68=function(_0x1e681d,_0x4570e8){_0x1e681d=_0x1e681d-0x1f0;var _0x4d3c07=_0x5df76b[_0x1e681d];return _0x4d3c07;},a153_0x1e68(_0x112e36,_0x3557e8);}function deleteInvalidTokens(_0x13c3d1){return new Promise(function(_0x23d6c9,_0x26cf10){var _0xc8cf3f=a153_0x1e68,_0x4f88fe=_0x13c3d1[_0xc8cf3f(0x223)](function(_0x3cbce2){var _0x3bb4b6=_0xc8cf3f;return _0x3cbce2[_0x3bb4b6(0x207)];});_models_1[_0xc8cf3f(0x1f9)][_0xc8cf3f(0x1fd)]({'_id':{'$in':_0x4f88fe}})[_0xc8cf3f(0x222)](function(){return _0x23d6c9();})[_0xc8cf3f(0x21a)](function(_0x41367f){var _0x23adb7=_0xc8cf3f;_0x26cf10(new Error(''[_0x23adb7(0x20e)](_0x41367f[_0x23adb7(0x210)],':\x20')[_0x23adb7(0x20e)](_0x41367f[_0x23adb7(0x21e)])));});});}function generateNormalTokenSave(_0x3d44f8,_0x52e342,_0x145ab0){return new Promise(function(_0x31fbbc,_0x1cfe41){var _0x591b62=a153_0x1e68;(0x0,generate_token_1[_0x591b62(0x215)])(_0x3d44f8,_0x145ab0[_0x591b62(0x205)])[_0x591b62(0x222)](function(_0xa00960){var _0x219519=_0x591b62,_0x438a16=(0x0,misc_1[_0x219519(0x216)])('t'),_0x5e5fdf=Date['now'](),_0x272316={'_id':_0x438a16,'token':_0xa00960[_0x219519(0x212)],'type':_0x219519(0x1ff),'related_to':_0x3d44f8[_0x219519(0x207)],'scopes':_0x52e342,'ref_model':_0x219519(0x1f4),'expires_at':_0x5e5fdf+_0xa00960['expires_in']*0x3e8,'website':_0x219519(0x1f1)};_models_1[_0x219519(0x1f9)][_0x219519(0x20d)](_0x272316)['then'](function(_0x78b5f1){_0x31fbbc(_0x78b5f1);})[_0x219519(0x21a)](function(_0x25561c){var _0x59b92d=_0x219519;_0x1cfe41(new Error(''[_0x59b92d(0x20e)](_0x25561c['name'],':\x20')[_0x59b92d(0x20e)](_0x25561c[_0x59b92d(0x21e)])));});})[_0x591b62(0x21a)](function(_0x314dc7){_0x1cfe41(new Error(_0x314dc7));});});}function generateServiceTokenSave(_0x39f80c,_0x17c962){return new Promise(function(_0x588f81,_0x5b1a7e){var _0x547f62=a153_0x1e68;(0x0,generate_token_2['generateAccessToken'])(_0x39f80c,_0x17c962)[_0x547f62(0x222)](function(_0x2b3a6a){var _0x398b0f=_0x547f62,_0x2fee69=(0x0,misc_1[_0x398b0f(0x216)])('t'),_0x43fd80=Date[_0x398b0f(0x20b)](),_0x3bde45={'_id':_0x2fee69,'token':_0x2b3a6a['access_token'],'type':_0x398b0f(0x1ff),'related_to':_0x39f80c[_0x398b0f(0x207)],'scopes':_0x17c962,'ref_model':'ServiceAccount','expires_at':_0x43fd80+_0x2b3a6a[_0x398b0f(0x1f0)]*0x3e8,'website':_0x398b0f(0x1f1)};_models_1[_0x398b0f(0x1f9)][_0x398b0f(0x20d)](_0x3bde45)['then'](function(_0xd94f57){_0x588f81(_0xd94f57);})[_0x398b0f(0x21a)](function(_0x3fdb8d){var _0x136904=_0x398b0f;_0x5b1a7e(new Error(''['concat'](_0x3fdb8d[_0x136904(0x210)],':\x20')[_0x136904(0x20e)](_0x3fdb8d[_0x136904(0x21e)])));});})[_0x547f62(0x21a)](function(_0x411814){_0x5b1a7e(new Error(_0x411814));});});}function serviceAccountTokenHandler(_0x450a82,_0x41b4b3){return new Promise(function(_0x9c8f88,_0x3b64bc){var _0x522993=a153_0x1e68,_0x391c26=_0x450a82[_0x522993(0x220)];if(_0x391c26){var _0x29e780=_0x450a82[_0x522993(0x224)];if(_0x29e780&&_0x29e780[_0x522993(0x1ff)][_0x522993(0x1f8)]){var _0x460d01=checkValidity(_0x29e780[_0x522993(0x1ff)]['service']),_0x386ed8=_0x460d01[_0x522993(0x209)](function(_0x4348e2){var _0xc85628=_0x522993;return _0x4348e2[_0xc85628(0x206)];})[_0x522993(0x223)](function(_0x1159f6){return _0x1159f6['token'];}),_0x18c5cc=_0x460d01[_0x522993(0x209)](function(_0x160738){var _0x46ae3d=_0x522993;return!_0x160738[_0x46ae3d(0x206)];})['map'](function(_0x3dbd9f){var _0x229b01=_0x522993;return _0x3dbd9f[_0x229b01(0x205)];});deleteInvalidTokens(_0x18c5cc)[_0x522993(0x222)](function(){var _0x39df5d=_0x522993;if(_0x386ed8[_0x39df5d(0x201)]>0x0)_0x9c8f88(_0x386ed8);else{var _0x30507b=[];_0x391c26['forEach'](function(_0x52e5e7){var _0x1e622d=_0x39df5d;generateServiceTokenSave(_0x52e5e7,_0x41b4b3)['then'](function(_0x18f3a4){var _0x4784c2=a153_0x1e68;_0x30507b[_0x4784c2(0x21d)](_0x18f3a4);})[_0x1e622d(0x21a)](function(_0x158964){var _0x589a85=_0x1e622d;_0x3b64bc(new Error(''['concat'](_0x158964[_0x589a85(0x210)],':\x20')[_0x589a85(0x20e)](_0x158964[_0x589a85(0x21e)])));});}),_0x30507b['length']>0x1?_0x9c8f88(_0x30507b):_0x9c8f88(![]);}})['catch'](function(_0x21b5d9){_0x3b64bc(new Error(_0x21b5d9));});}else{var _0x177c2a=[];_0x391c26[_0x522993(0x1f7)](function(_0x153006){var _0x3c3fca=_0x522993;generateServiceTokenSave(_0x153006,_0x41b4b3)[_0x3c3fca(0x222)](function(_0x190562){_0x177c2a['push'](_0x190562);})[_0x3c3fca(0x21a)](function(_0x5dc9c4){var _0x5a2acf=_0x3c3fca;_0x3b64bc(new Error(''[_0x5a2acf(0x20e)](_0x5dc9c4['name'],':\x20')[_0x5a2acf(0x20e)](_0x5dc9c4['message'])));});}),_0x177c2a[_0x522993(0x201)]>0x1?_0x9c8f88(_0x177c2a):_0x9c8f88(![]);}}else _0x9c8f88(![]);});}function checkTokenRefreshit(_0x577540,_0x37de88){return new Promise(function(_0x3a9d13,_0x3836f1){var _0x5ca509=a153_0x1e68,_0x83afc5=_0x577540[_0x5ca509(0x1f2)],_0x56cc90=_0x577540['credential'],_0xd2e1f1=_0x577540[_0x5ca509(0x220)],_0x3fe82a=_0x577540[_0x5ca509(0x224)];if(_0x83afc5&&_0x56cc90&&_0x3fe82a){var _0x252d3b=_0x3fe82a[_0x5ca509(0x1ff)],_0x262895=_0x3fe82a[_0x5ca509(0x204)];if(_0x262895[_0x5ca509(0x201)]>0x0){var _0x472fb7={'success':![],'credential':_0x56cc90,'serviceAcc':_0xd2e1f1};if(_0x252d3b['normal'][_0x5ca509(0x201)]===0x0)generateNormalTokenSave(_0x56cc90,_0x37de88,_0x262895[0x0])[_0x5ca509(0x222)](function(_0x1a5990){var _0x5e13d0=_0x5ca509;_0x472fb7[_0x5e13d0(0x1f2)]=![],_0x472fb7[_0x5e13d0(0x224)]={'refresh':_0x262895,'access':{'normal':[_0x1a5990]}},_0x3a9d13(_0x472fb7);})[_0x5ca509(0x21a)](function(_0x10234d){_0x3836f1(new Error(_0x10234d));});else{var _0x4d7b56=checkValidity(_0x252d3b[_0x5ca509(0x20c)]),_0x273514=_0x4d7b56['filter'](function(_0xb47774){var _0x481f41=_0x5ca509;return _0xb47774[_0x481f41(0x206)];})[_0x5ca509(0x223)](function(_0x488230){var _0x384da1=_0x5ca509;return _0x488230[_0x384da1(0x205)];}),_0x3bae47=_0x4d7b56['filter'](function(_0x353f98){var _0x3d797c=_0x5ca509;return!_0x353f98[_0x3d797c(0x206)];})[_0x5ca509(0x223)](function(_0x480388){var _0x179317=_0x5ca509;return _0x480388[_0x179317(0x205)];});deleteInvalidTokens(_0x3bae47)[_0x5ca509(0x222)](function(){var _0x43393c=_0x5ca509;_0x472fb7[_0x43393c(0x1f2)]=!![],_0x273514[_0x43393c(0x201)]>0x0?(_0x472fb7[_0x43393c(0x224)]={'refresh':_0x262895,'access':{'normal':_0x273514}},_0x3a9d13(_0x472fb7)):generateNormalTokenSave(_0x56cc90,_0x37de88,_0x262895[0x0])[_0x43393c(0x222)](function(_0x1139d4){_0x472fb7['tokens']={'refresh':_0x262895,'access':{'normal':[_0x1139d4]}},_0x3a9d13(_0x472fb7);})[_0x43393c(0x21a)](function(_0x527771){_0x3836f1(new Error(_0x527771));});})[_0x5ca509(0x21a)](function(_0x5e360a){var _0x2472b5=_0x5ca509;_0x3836f1(new Error(''['concat'](_0x5e360a[_0x2472b5(0x210)],':\x20')['concat'](_0x5e360a[_0x2472b5(0x21e)])));});}}else{var _0x4e6b40={'success':![]};_0x3a9d13(_0x4e6b40);}}else{var _0x4e6b40={'success':![]};_0x3a9d13(_0x4e6b40);}});}function default_1(_0x2faf9b,_0x249aef){return new Promise(function(_0x3876c7,_0x2925c6){var _0x20f3c2=a153_0x1e68;getAllTokens(_0x2faf9b,_0x249aef)[_0x20f3c2(0x222)](function(_0x4a980e){var _0x1bca43=_0x20f3c2;checkTokenRefreshit(_0x4a980e,_0x249aef)['then'](function(_0x44fdbc){var _0x5d0a12=a153_0x1e68;_0x44fdbc[_0x5d0a12(0x224)]?serviceAccountTokenHandler(_0x4a980e,_0x249aef)[_0x5d0a12(0x222)](function(_0x3fbd5e){var _0x254b6f=_0x5d0a12;if(_0x44fdbc[_0x254b6f(0x224)]){if(_0x3fbd5e){var _0x545341={'success':!![],'tokens':__spreadArray(__spreadArray([],_0x44fdbc[_0x254b6f(0x224)][_0x254b6f(0x1ff)]['normal'],!![]),_0x3fbd5e,!![])};_0x3876c7(_0x545341);}else{var _0x545341={'success':!![],'tokens':_0x44fdbc[_0x254b6f(0x224)][_0x254b6f(0x1ff)][_0x254b6f(0x20c)]};_0x3876c7(_0x545341);}}else _0x2925c6(new Error(_0x254b6f(0x1fc)));})[_0x5d0a12(0x21a)](function(){var _0x48a1ae=_0x5d0a12;_0x2925c6(new Error(_0x48a1ae(0x1fe)));}):_0x2925c6(new Error(_0x5d0a12(0x200)));})[_0x1bca43(0x21a)](function(_0x1a40eb){_0x2925c6(new Error(_0x1a40eb));});})['catch'](function(_0x49064f){_0x2925c6(_0x49064f);});});}function a153_0x5df7(){var _0x23df77=['Credentials','1285837tDUcoy','catch','findById','find','push','message','45GXyrfo','serviceAcc','call','then','map','tokens','333752JcLwev','expires_in','google.com','success','721824uwMhZz','Credential','__spreadArray','3771570zGFSiE','forEach','service','Tokens','slice','665DCrEnd','No\x20Possible\x20Tokens\x20Found\x20or\x20Generated','deleteMany','Error\x20While\x20Fetching\x20Service\x20Account\x20Tokens','access','No\x20Tokens\x20Found','length','7566JgsTBz','expires_at','refresh','token','validity','_id','ref_model','filter','14jkGwGd','now','normal','create','concat','37432kGSafW','name','prototype','access_token','__esModule','166520rXCRLE','generateAccessToken','objectID','type'];a153_0x5df7=function(){return _0x23df77;};return a153_0x5df7();}exports['default']=default_1; \ No newline at end of file diff --git a/plugins/google/helpers/sign-jwt.js b/plugins/google/helpers/sign-jwt.js index e9c19a3..36c4d0e 100644 --- a/plugins/google/helpers/sign-jwt.js +++ b/plugins/google/helpers/sign-jwt.js @@ -1,170 +1 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Crypto -var node_webcrypto_ossl_1 = require("node-webcrypto-ossl"); -// Others -var helpers_1 = require("../../google/helpers"); -var crypto = new node_webcrypto_ossl_1.Crypto(); -var subtleCrypto = crypto.subtle; -var jwtHeader = { - alg: 'RS256', - typ: 'JWT', -}; -/** - * Converts a Base64 String to Uint8array Buffer - * - * @param {string} base64 - Base64 String - * @returns {ArrayBufferLike} - uint8array buffer - */ -function base64ToArrayBuffer(base64) { - var binaryString = Buffer.from(base64, 'base64').toString('utf8'); - var bytes = new Uint8Array(binaryString.length); - for (var i = 0; i < binaryString.length; i++) { - bytes[i] = binaryString.charCodeAt(i); - } - return bytes.buffer; -} -/** - * Converts a String to Uint8array Buffer - * - * @param {string} str - String - * @returns {ArrayBufferLike} - uint8array buffer - */ -function stringToArrayBuffer(str) { - var bytes = new Uint8Array(str.length); - for (var i = 0; i < str.length; i++) { - bytes[i] = str.charCodeAt(i); - } - return bytes.buffer; -} -/** - * Converts a Array Buffer to Base64 Encoded String - * - * @param {Uint8Array} buffer - Uint8Array - * @returns {string} - Base64 Encoded String - */ -function arrayBufferToBase64(buffer) { - var binary = ''; - var bytes = new Uint8Array(buffer); - for (var i = 0; i < bytes.byteLength; i++) { - binary += String.fromCharCode(bytes[i]); - } - var base64 = Buffer.from(binary).toString('base64'); - return base64; -} -/** - * Imports Service Account Private Key as a Cryptokey - * - * @param {string} pemKey - Private Key of Service Account - * @returns {Promise} - CryptoKey Object for Private Key - */ -function importPrivateKey(pemKey) { - return __awaiter(this, void 0, void 0, function () { - var pemDER, cryptoKey; - return __generator(this, function (_a) { - pemDER = base64ToArrayBuffer(pemKey - .split('\n') - .map(function (s) { return s.trim(); }) - .filter(function (l) { return l.length && !l.startsWith('---'); }) - .join('')); - cryptoKey = subtleCrypto.importKey('pkcs8', pemDER, { - name: 'RSASSA-PKCS1-v1_5', - hash: 'SHA-256', - }, false, ['sign']); - return [2 /*return*/, cryptoKey]; - }); - }); -} -/** - * Create a JWT Key for the Service Account - * - * @param {string} text - JWT Stringified Payload - * @param {CryptoKey} key - Cryptographic Service Account Private key - * @returns {Promise} - JWT Array Buffer - */ -function createSignature(text, key) { - return __awaiter(this, void 0, void 0, function () { - var textBuffer, jwtKey; - return __generator(this, function (_a) { - textBuffer = stringToArrayBuffer(text); - jwtKey = subtleCrypto.sign('RSASSA-PKCS1-v1_5', key, textBuffer); - return [2 /*return*/, jwtKey]; - }); - }); -} -/** - * Creates a JWT Token for a Service Account to Generate Access Token - * - * @param {IServiceAccDoc} serviceAccount - ServiceAccount Document from Database - * @param {TGoogleApiScope[]} scopes - Google Oauth API Scopes - * @returns {string} - JWT Signature for the Service Account - */ -function default_1(serviceAccount, scopes) { - return __awaiter(this, void 0, void 0, function () { - var iat, stringizedScopes, payload, encPayload, encHeader, key, signed, jwtSignature, jwtToken; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - iat = Date.now() / 1000; - stringizedScopes = (0, helpers_1.stringizeScope)(scopes); - payload = { - iss: serviceAccount.private_key.id, - scope: stringizedScopes, - aud: 'https://oauth2.googleapis.com/token', - exp: iat + 3600, - iat: iat, - }; - encPayload = Buffer.from(JSON.stringify(payload)).toString('base64'); - encHeader = Buffer.from(JSON.stringify(jwtHeader)).toString('base64'); - return [4 /*yield*/, importPrivateKey(serviceAccount.private_key.key)]; - case 1: - key = _a.sent(); - return [4 /*yield*/, createSignature("".concat(encHeader, ".").concat(encPayload), key)]; - case 2: - signed = _a.sent(); - jwtSignature = arrayBufferToBase64(signed) - .replace(/\//g, '_') - .replace(/\+/g, '-'); - jwtToken = "".concat(encHeader, ".").concat(encPayload, ".").concat(jwtSignature); - return [2 /*return*/, jwtToken]; - } - }); - }); -} -exports.default = default_1; +'use strict';var a154_0xb61150=a154_0x598d;function a154_0x4e6d(){var _0x545e4a=['done','label','from','595RaIvZR','RS256','21016MlEsOw','1175163kxPNDm','1183548sWDGbF','trys','../../google/helpers','map','push','9LuTByl','stringify','join','key','__awaiter','fromCharCode','7178830LOuECW','subtle','pkcs8','sign','replace','toString','next','return','pop','then','private_key','length','charCodeAt','JWT','__generator','1878100OkgCNN','default','14nmqLTD','base64','__esModule','filter','79665IgIkrf','function','iterator','ops','importKey','call','concat','---','55403SMIDpt','startsWith','sent','throw','value','node-webcrypto-ossl','defineProperty'];a154_0x4e6d=function(){return _0x545e4a;};return a154_0x4e6d();}(function(_0x243b90,_0x471313){var _0x17957f=a154_0x598d,_0x59064e=_0x243b90();while(!![]){try{var _0x3985e1=parseInt(_0x17957f(0x16c))/0x1*(-parseInt(_0x17957f(0x160))/0x2)+parseInt(_0x17957f(0x179))/0x3+-parseInt(_0x17957f(0x15e))/0x4+parseInt(_0x17957f(0x164))/0x5+-parseInt(_0x17957f(0x17a))/0x6+-parseInt(_0x17957f(0x176))/0x7*(-parseInt(_0x17957f(0x178))/0x8)+parseInt(_0x17957f(0x149))/0x9*(parseInt(_0x17957f(0x14f))/0xa);if(_0x3985e1===_0x471313)break;else _0x59064e['push'](_0x59064e['shift']());}catch(_0x356cd5){_0x59064e['push'](_0x59064e['shift']());}}}(a154_0x4e6d,0x47d54));var __awaiter=this&&this[a154_0xb61150(0x14d)]||function(_0x153ff9,_0x586fe4,_0x1e4ab2,_0xcbd278){function _0x2bd645(_0xb6b8c0){return _0xb6b8c0 instanceof _0x1e4ab2?_0xb6b8c0:new _0x1e4ab2(function(_0x374041){_0x374041(_0xb6b8c0);});}return new(_0x1e4ab2||(_0x1e4ab2=Promise))(function(_0x8abcda,_0xd752e8){var _0x261250=a154_0x598d;function _0x55db3c(_0x50a813){var _0x3e93a5=a154_0x598d;try{_0x26fa31(_0xcbd278[_0x3e93a5(0x155)](_0x50a813));}catch(_0x484354){_0xd752e8(_0x484354);}}function _0x1d1e48(_0x5ad4e7){var _0xcba3e8=a154_0x598d;try{_0x26fa31(_0xcbd278[_0xcba3e8(0x16f)](_0x5ad4e7));}catch(_0x1810f3){_0xd752e8(_0x1810f3);}}function _0x26fa31(_0x306d5b){var _0x171275=a154_0x598d;_0x306d5b[_0x171275(0x173)]?_0x8abcda(_0x306d5b[_0x171275(0x170)]):_0x2bd645(_0x306d5b['value'])[_0x171275(0x158)](_0x55db3c,_0x1d1e48);}_0x26fa31((_0xcbd278=_0xcbd278['apply'](_0x153ff9,_0x586fe4||[]))[_0x261250(0x155)]());});},__generator=this&&this[a154_0xb61150(0x15d)]||function(_0x11883b,_0xe3e224){var _0x3634f6=a154_0xb61150,_0x40fd69={'label':0x0,'sent':function(){if(_0x5ab290[0x0]&0x1)throw _0x5ab290[0x1];return _0x5ab290[0x1];},'trys':[],'ops':[]},_0x51bbca,_0x5609e9,_0x5ab290,_0x1bb0a4;return _0x1bb0a4={'next':_0x260a1f(0x0),'throw':_0x260a1f(0x1),'return':_0x260a1f(0x2)},typeof Symbol===_0x3634f6(0x165)&&(_0x1bb0a4[Symbol[_0x3634f6(0x166)]]=function(){return this;}),_0x1bb0a4;function _0x260a1f(_0x4b524a){return function(_0x5d35bf){return _0x5d909e([_0x4b524a,_0x5d35bf]);};}function _0x5d909e(_0xb20974){var _0x1fb6c3=_0x3634f6;if(_0x51bbca)throw new TypeError('Generator\x20is\x20already\x20executing.');while(_0x40fd69)try{if(_0x51bbca=0x1,_0x5609e9&&(_0x5ab290=_0xb20974[0x0]&0x2?_0x5609e9[_0x1fb6c3(0x156)]:_0xb20974[0x0]?_0x5609e9['throw']||((_0x5ab290=_0x5609e9[_0x1fb6c3(0x156)])&&_0x5ab290[_0x1fb6c3(0x169)](_0x5609e9),0x0):_0x5609e9[_0x1fb6c3(0x155)])&&!(_0x5ab290=_0x5ab290[_0x1fb6c3(0x169)](_0x5609e9,_0xb20974[0x1]))[_0x1fb6c3(0x173)])return _0x5ab290;if(_0x5609e9=0x0,_0x5ab290)_0xb20974=[_0xb20974[0x0]&0x2,_0x5ab290[_0x1fb6c3(0x170)]];switch(_0xb20974[0x0]){case 0x0:case 0x1:_0x5ab290=_0xb20974;break;case 0x4:_0x40fd69['label']++;return{'value':_0xb20974[0x1],'done':![]};case 0x5:_0x40fd69[_0x1fb6c3(0x174)]++,_0x5609e9=_0xb20974[0x1],_0xb20974=[0x0];continue;case 0x7:_0xb20974=_0x40fd69['ops']['pop'](),_0x40fd69['trys']['pop']();continue;default:if(!(_0x5ab290=_0x40fd69[_0x1fb6c3(0x17b)],_0x5ab290=_0x5ab290[_0x1fb6c3(0x15a)]>0x0&&_0x5ab290[_0x5ab290['length']-0x1])&&(_0xb20974[0x0]===0x6||_0xb20974[0x0]===0x2)){_0x40fd69=0x0;continue;}if(_0xb20974[0x0]===0x3&&(!_0x5ab290||_0xb20974[0x1]>_0x5ab290[0x0]&&_0xb20974[0x1]<_0x5ab290[0x3])){_0x40fd69[_0x1fb6c3(0x174)]=_0xb20974[0x1];break;}if(_0xb20974[0x0]===0x6&&_0x40fd69[_0x1fb6c3(0x174)]<_0x5ab290[0x1]){_0x40fd69[_0x1fb6c3(0x174)]=_0x5ab290[0x1],_0x5ab290=_0xb20974;break;}if(_0x5ab290&&_0x40fd69[_0x1fb6c3(0x174)]<_0x5ab290[0x2]){_0x40fd69['label']=_0x5ab290[0x2],_0x40fd69[_0x1fb6c3(0x167)][_0x1fb6c3(0x148)](_0xb20974);break;}if(_0x5ab290[0x2])_0x40fd69[_0x1fb6c3(0x167)][_0x1fb6c3(0x157)]();_0x40fd69['trys'][_0x1fb6c3(0x157)]();continue;}_0xb20974=_0xe3e224[_0x1fb6c3(0x169)](_0x11883b,_0x40fd69);}catch(_0x350331){_0xb20974=[0x6,_0x350331],_0x5609e9=0x0;}finally{_0x51bbca=_0x5ab290=0x0;}if(_0xb20974[0x0]&0x5)throw _0xb20974[0x1];return{'value':_0xb20974[0x0]?_0xb20974[0x1]:void 0x0,'done':!![]};}};Object[a154_0xb61150(0x172)](exports,a154_0xb61150(0x162),{'value':!![]});var node_webcrypto_ossl_1=require(a154_0xb61150(0x171)),helpers_1=require(a154_0xb61150(0x17c)),crypto=new node_webcrypto_ossl_1['Crypto'](),subtleCrypto=crypto[a154_0xb61150(0x150)],jwtHeader={'alg':a154_0xb61150(0x177),'typ':a154_0xb61150(0x15c)};function base64ToArrayBuffer(_0x235605){var _0x36cea0=a154_0xb61150,_0x27f3f7=Buffer[_0x36cea0(0x175)](_0x235605,_0x36cea0(0x161))[_0x36cea0(0x154)]('utf8'),_0x2e8d94=new Uint8Array(_0x27f3f7[_0x36cea0(0x15a)]);for(var _0x90b302=0x0;_0x90b302<_0x27f3f7[_0x36cea0(0x15a)];_0x90b302++){_0x2e8d94[_0x90b302]=_0x27f3f7['charCodeAt'](_0x90b302);}return _0x2e8d94['buffer'];}function a154_0x598d(_0x411ff0,_0x459b46){var _0x4e6dd3=a154_0x4e6d();return a154_0x598d=function(_0x598d68,_0x2f92c3){_0x598d68=_0x598d68-0x148;var _0x2c4a75=_0x4e6dd3[_0x598d68];return _0x2c4a75;},a154_0x598d(_0x411ff0,_0x459b46);}function stringToArrayBuffer(_0xef8fd0){var _0x3a5d69=a154_0xb61150,_0x4c45dc=new Uint8Array(_0xef8fd0[_0x3a5d69(0x15a)]);for(var _0x20aca8=0x0;_0x20aca8<_0xef8fd0[_0x3a5d69(0x15a)];_0x20aca8++){_0x4c45dc[_0x20aca8]=_0xef8fd0[_0x3a5d69(0x15b)](_0x20aca8);}return _0x4c45dc['buffer'];}function arrayBufferToBase64(_0x2aa6dd){var _0x260010=a154_0xb61150,_0xb58293='',_0x8d62be=new Uint8Array(_0x2aa6dd);for(var _0x2c6930=0x0;_0x2c6930<_0x8d62be['byteLength'];_0x2c6930++){_0xb58293+=String[_0x260010(0x14e)](_0x8d62be[_0x2c6930]);}var _0x275205=Buffer[_0x260010(0x175)](_0xb58293)[_0x260010(0x154)](_0x260010(0x161));return _0x275205;}function importPrivateKey(_0x1ae2c2){return __awaiter(this,void 0x0,void 0x0,function(){var _0x352c68,_0x5cfa0b;return __generator(this,function(_0x37e75f){var _0x4c1641=a154_0x598d;return _0x352c68=base64ToArrayBuffer(_0x1ae2c2['split']('\x0a')[_0x4c1641(0x17d)](function(_0x2d38c8){return _0x2d38c8['trim']();})[_0x4c1641(0x163)](function(_0x5e4978){var _0x4a72e8=_0x4c1641;return _0x5e4978[_0x4a72e8(0x15a)]&&!_0x5e4978[_0x4a72e8(0x16d)](_0x4a72e8(0x16b));})[_0x4c1641(0x14b)]('')),_0x5cfa0b=subtleCrypto[_0x4c1641(0x168)](_0x4c1641(0x151),_0x352c68,{'name':'RSASSA-PKCS1-v1_5','hash':'SHA-256'},![],[_0x4c1641(0x152)]),[0x2,_0x5cfa0b];});});}function createSignature(_0x3c5a3a,_0x51dbae){return __awaiter(this,void 0x0,void 0x0,function(){var _0xd42af8,_0x22049a;return __generator(this,function(_0x5c0585){var _0x19c0fc=a154_0x598d;return _0xd42af8=stringToArrayBuffer(_0x3c5a3a),_0x22049a=subtleCrypto[_0x19c0fc(0x152)]('RSASSA-PKCS1-v1_5',_0x51dbae,_0xd42af8),[0x2,_0x22049a];});});}function default_1(_0x3d6224,_0x1e4186){return __awaiter(this,void 0x0,void 0x0,function(){var _0xc62f7f,_0x2d5381,_0x1ac39e,_0x2843f0,_0x193006,_0x3d1e4b,_0x4b76a7,_0x35a031,_0x401c2f;return __generator(this,function(_0x40834a){var _0x545d21=a154_0x598d;switch(_0x40834a[_0x545d21(0x174)]){case 0x0:_0xc62f7f=Date['now']()/0x3e8,_0x2d5381=(0x0,helpers_1['stringizeScope'])(_0x1e4186),_0x1ac39e={'iss':_0x3d6224[_0x545d21(0x159)]['id'],'scope':_0x2d5381,'aud':'https://oauth2.googleapis.com/token','exp':_0xc62f7f+0xe10,'iat':_0xc62f7f},_0x2843f0=Buffer['from'](JSON['stringify'](_0x1ac39e))[_0x545d21(0x154)]('base64'),_0x193006=Buffer['from'](JSON[_0x545d21(0x14a)](jwtHeader))[_0x545d21(0x154)](_0x545d21(0x161));return[0x4,importPrivateKey(_0x3d6224[_0x545d21(0x159)][_0x545d21(0x14c)])];case 0x1:_0x3d1e4b=_0x40834a['sent']();return[0x4,createSignature(''[_0x545d21(0x16a)](_0x193006,'.')[_0x545d21(0x16a)](_0x2843f0),_0x3d1e4b)];case 0x2:_0x4b76a7=_0x40834a[_0x545d21(0x16e)](),_0x35a031=arrayBufferToBase64(_0x4b76a7)[_0x545d21(0x153)](/\//g,'_')[_0x545d21(0x153)](/\+/g,'-'),_0x401c2f=''[_0x545d21(0x16a)](_0x193006,'.')[_0x545d21(0x16a)](_0x2843f0,'.')['concat'](_0x35a031);return[0x2,_0x401c2f];}});});}exports[a154_0xb61150(0x15f)]=default_1; \ No newline at end of file diff --git a/plugins/google/helpers/stringize-scope.js b/plugins/google/helpers/stringize-scope.js index 92bb84e..f71cc58 100644 --- a/plugins/google/helpers/stringize-scope.js +++ b/plugins/google/helpers/stringize-scope.js @@ -1,21 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Converts the Array of Scopes to a Scope Parameter - * - * @param {TGoogleApiScope} scopes - Array of Google API Scopes - * @returns {string} - Space Delimited Scopes - */ -function default_1(scopes) { - var scopeString = ''; - scopes.forEach(function (scope, index) { - if (index === scopes.length - 1) { - scopeString += "".concat(scope); - } - else { - scopeString += "".concat(scope, " "); - } - }); - return scopeString; -} -exports.default = default_1; +'use strict';var a155_0x2a6580=a155_0x596e;(function(_0x1aeb27,_0x1b7136){var _0x199df1=a155_0x596e,_0x57288d=_0x1aeb27();while(!![]){try{var _0x3b5617=parseInt(_0x199df1(0x160))/0x1*(parseInt(_0x199df1(0x156))/0x2)+parseInt(_0x199df1(0x155))/0x3+-parseInt(_0x199df1(0x157))/0x4*(-parseInt(_0x199df1(0x15a))/0x5)+parseInt(_0x199df1(0x15d))/0x6+-parseInt(_0x199df1(0x158))/0x7+-parseInt(_0x199df1(0x15e))/0x8+parseInt(_0x199df1(0x162))/0x9;if(_0x3b5617===_0x1b7136)break;else _0x57288d['push'](_0x57288d['shift']());}catch(_0x315e0d){_0x57288d['push'](_0x57288d['shift']());}}}(a155_0x3e72,0x36c91));function a155_0x596e(_0x3c9677,_0x2bfbc3){var _0x3e7233=a155_0x3e72();return a155_0x596e=function(_0x596e6e,_0x55f96e){_0x596e6e=_0x596e6e-0x155;var _0x555866=_0x3e7233[_0x596e6e];return _0x555866;},a155_0x596e(_0x3c9677,_0x2bfbc3);}Object['defineProperty'](exports,a155_0x2a6580(0x15c),{'value':!![]});function a155_0x3e72(){var _0xee8d05=['288384TCUFvD','2462408ovunDa','length','62lKHnwX','forEach','2271672bMNabe','854016IxUCEh','3374AmHAQf','40184Bbbihw','1243396tVbXBv','concat','10ThlBZE','default','__esModule'];a155_0x3e72=function(){return _0xee8d05;};return a155_0x3e72();}function default_1(_0x30895d){var _0x1abfd3=a155_0x2a6580,_0x196fb4='';return _0x30895d[_0x1abfd3(0x161)](function(_0x583d82,_0x4b9070){var _0xd67033=_0x1abfd3;_0x4b9070===_0x30895d[_0xd67033(0x15f)]-0x1?_0x196fb4+=''[_0xd67033(0x159)](_0x583d82):_0x196fb4+=''[_0xd67033(0x159)](_0x583d82,'\x20');}),_0x196fb4;}exports[a155_0x2a6580(0x15b)]=default_1; \ No newline at end of file diff --git a/plugins/google/index.js b/plugins/google/index.js index 869fb85..a33c632 100644 --- a/plugins/google/index.js +++ b/plugins/google/index.js @@ -1,26 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.oauthHelpers = exports.serviceAccountHandler = exports.normalAccountHandler = exports.oauthScopes = exports.oauthRouteApis = exports.mimeTypes = exports.mimeArray = exports.oauthAuthenticationApis = void 0; -var helpers_1 = require("./helpers"); -var helpers_2 = require("./helpers"); -Object.defineProperty(exports, "oauthAuthenticationApis", { enumerable: true, get: function () { return helpers_2.api; } }); -Object.defineProperty(exports, "mimeArray", { enumerable: true, get: function () { return helpers_2.mimeArray; } }); -Object.defineProperty(exports, "mimeTypes", { enumerable: true, get: function () { return helpers_2.mimeTypes; } }); -var routes_1 = require("./routes"); -Object.defineProperty(exports, "oauthRouteApis", { enumerable: true, get: function () { return routes_1.api; } }); -var api_1 = require("./api"); -Object.defineProperty(exports, "oauthScopes", { enumerable: true, get: function () { return api_1.scopes; } }); -var nac_1 = require("./handlers/nac"); -Object.defineProperty(exports, "normalAccountHandler", { enumerable: true, get: function () { return __importDefault(nac_1).default; } }); -var sac_1 = require("./handlers/sac"); -Object.defineProperty(exports, "serviceAccountHandler", { enumerable: true, get: function () { return __importDefault(sac_1).default; } }); -exports.oauthHelpers = { - resolveToken: helpers_1.resolveToken, - stringizeScope: helpers_1.stringizeScope, - constructFields: helpers_1.constructFields, - createJwtToken: helpers_1.createJwtToken, - googleApiRequest: helpers_1.googleApiRequest, -}; +'use strict';var a156_0x389e49=a156_0x102a;function a156_0x4c02(){var _0x3a15c9=['oauthAuthenticationApis','4CpbQBd','./helpers','api','63bVVMwp','1790367VoULmw','resolveToken','1567430zkjSDD','1136PRWsWo','mimeArray','285202UOsLyW','14228995DzUYDQ','oauthHelpers','3541272qQkXkD','googleApiRequest','serviceAccountHandler','10XtHtvd','defineProperty','scopes','./routes','constructFields','21833UwERMr','mimeTypes','default','oauthRouteApis','./handlers/nac','oauthScopes','normalAccountHandler','1721226MSlAXg'];a156_0x4c02=function(){return _0x3a15c9;};return a156_0x4c02();}(function(_0x151a4e,_0x34b7ea){var _0x42a4ba=a156_0x102a,_0x367ba0=_0x151a4e();while(!![]){try{var _0x145e20=-parseInt(_0x42a4ba(0x1e1))/0x1+parseInt(_0x42a4ba(0x1e4))/0x2+-parseInt(_0x42a4ba(0x1dc))/0x3*(parseInt(_0x42a4ba(0x1d8))/0x4)+-parseInt(_0x42a4ba(0x1e7))/0x5*(parseInt(_0x42a4ba(0x1d6))/0x6)+parseInt(_0x42a4ba(0x1ec))/0x7*(parseInt(_0x42a4ba(0x1df))/0x8)+parseInt(_0x42a4ba(0x1db))/0x9*(-parseInt(_0x42a4ba(0x1de))/0xa)+parseInt(_0x42a4ba(0x1e2))/0xb;if(_0x145e20===_0x34b7ea)break;else _0x367ba0['push'](_0x367ba0['shift']());}catch(_0x1f1c6e){_0x367ba0['push'](_0x367ba0['shift']());}}}(a156_0x4c02,0xe8f21));var __importDefault=this&&this['__importDefault']||function(_0x4924fe){return _0x4924fe&&_0x4924fe['__esModule']?_0x4924fe:{'default':_0x4924fe};};Object[a156_0x389e49(0x1e8)](exports,'__esModule',{'value':!![]}),exports['oauthHelpers']=exports[a156_0x389e49(0x1e6)]=exports[a156_0x389e49(0x1f2)]=exports[a156_0x389e49(0x1f1)]=exports['oauthRouteApis']=exports['mimeTypes']=exports[a156_0x389e49(0x1e0)]=exports[a156_0x389e49(0x1d7)]=void 0x0;var helpers_1=require(a156_0x389e49(0x1d9)),helpers_2=require(a156_0x389e49(0x1d9));Object[a156_0x389e49(0x1e8)](exports,a156_0x389e49(0x1d7),{'enumerable':!![],'get':function(){var _0x5ed0b1=a156_0x389e49;return helpers_2[_0x5ed0b1(0x1da)];}}),Object['defineProperty'](exports,a156_0x389e49(0x1e0),{'enumerable':!![],'get':function(){var _0x715923=a156_0x389e49;return helpers_2[_0x715923(0x1e0)];}}),Object[a156_0x389e49(0x1e8)](exports,a156_0x389e49(0x1ed),{'enumerable':!![],'get':function(){var _0x239a0a=a156_0x389e49;return helpers_2[_0x239a0a(0x1ed)];}});var routes_1=require(a156_0x389e49(0x1ea));Object['defineProperty'](exports,a156_0x389e49(0x1ef),{'enumerable':!![],'get':function(){return routes_1['api'];}});var api_1=require('./api');Object[a156_0x389e49(0x1e8)](exports,'oauthScopes',{'enumerable':!![],'get':function(){var _0x25705c=a156_0x389e49;return api_1[_0x25705c(0x1e9)];}});var nac_1=require(a156_0x389e49(0x1f0));Object['defineProperty'](exports,'normalAccountHandler',{'enumerable':!![],'get':function(){return __importDefault(nac_1)['default'];}});var sac_1=require('./handlers/sac');function a156_0x102a(_0x24ab36,_0x53d78c){var _0x4c0258=a156_0x4c02();return a156_0x102a=function(_0x102a30,_0x221a03){_0x102a30=_0x102a30-0x1d6;var _0xbbdc06=_0x4c0258[_0x102a30];return _0xbbdc06;},a156_0x102a(_0x24ab36,_0x53d78c);}Object[a156_0x389e49(0x1e8)](exports,a156_0x389e49(0x1e6),{'enumerable':!![],'get':function(){var _0x2e47e8=a156_0x389e49;return __importDefault(sac_1)[_0x2e47e8(0x1ee)];}}),exports[a156_0x389e49(0x1e3)]={'resolveToken':helpers_1[a156_0x389e49(0x1dd)],'stringizeScope':helpers_1['stringizeScope'],'constructFields':helpers_1[a156_0x389e49(0x1eb)],'createJwtToken':helpers_1['createJwtToken'],'googleApiRequest':helpers_1[a156_0x389e49(0x1e5)]}; \ No newline at end of file diff --git a/plugins/google/routes.js b/plugins/google/routes.js index 80a75c7..8e04514 100644 --- a/plugins/google/routes.js +++ b/plugins/google/routes.js @@ -1,12 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.api = void 0; -var iam_1 = require("./api/iam"); -var drive_1 = require("./api/drive"); -/** - * Comprehensive Google Outh/Cloud API Routes - */ -exports.api = { - iam: iam_1.api, - drives: drive_1.api, -}; +'use strict';function a157_0x2b2c(_0x48b172,_0x571e98){var _0x397b34=a157_0x397b();return a157_0x2b2c=function(_0x2b2c27,_0x1dba79){_0x2b2c27=_0x2b2c27-0x66;var _0x187d99=_0x397b34[_0x2b2c27];return _0x187d99;},a157_0x2b2c(_0x48b172,_0x571e98);}var a157_0x48f4bd=a157_0x2b2c;function a157_0x397b(){var _0xd18153=['api','1872312uHdEgj','__esModule','5072528wvhRWS','1281826MVTsHz','135752banVSz','1045154fyeBOk','defineProperty','1683605feYgho','./api/iam','152517AmNuVC','24rsREhA'];a157_0x397b=function(){return _0xd18153;};return a157_0x397b();}(function(_0x16da19,_0x3fa730){var _0x5b3e3a=a157_0x2b2c,_0x418a34=_0x16da19();while(!![]){try{var _0x3ae384=-parseInt(_0x5b3e3a(0x6b))/0x1+-parseInt(_0x5b3e3a(0x6c))/0x2+parseInt(_0x5b3e3a(0x70))/0x3*(parseInt(_0x5b3e3a(0x71))/0x4)+parseInt(_0x5b3e3a(0x6e))/0x5+-parseInt(_0x5b3e3a(0x67))/0x6+parseInt(_0x5b3e3a(0x6a))/0x7+parseInt(_0x5b3e3a(0x69))/0x8;if(_0x3ae384===_0x3fa730)break;else _0x418a34['push'](_0x418a34['shift']());}catch(_0xd60c7f){_0x418a34['push'](_0x418a34['shift']());}}}(a157_0x397b,0x7746e));Object[a157_0x48f4bd(0x6d)](exports,a157_0x48f4bd(0x68),{'value':!![]}),exports[a157_0x48f4bd(0x66)]=void 0x0;var iam_1=require(a157_0x48f4bd(0x6f)),drive_1=require('./api/drive');exports['api']={'iam':iam_1[a157_0x48f4bd(0x66)],'drives':drive_1[a157_0x48f4bd(0x66)]}; \ No newline at end of file diff --git a/plugins/misc/index.js b/plugins/misc/index.js index da6d76d..85b10f9 100644 --- a/plugins/misc/index.js +++ b/plugins/misc/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isUndefined = exports.shortuid = exports.objectID = exports.generateUID = void 0; -var uid_1 = require("./uid"); -Object.defineProperty(exports, "generateUID", { enumerable: true, get: function () { return __importDefault(uid_1).default; } }); -Object.defineProperty(exports, "objectID", { enumerable: true, get: function () { return uid_1.objectID; } }); -Object.defineProperty(exports, "shortuid", { enumerable: true, get: function () { return uid_1.shortuid; } }); -var isundefined_1 = require("./isundefined"); -Object.defineProperty(exports, "isUndefined", { enumerable: true, get: function () { return __importDefault(isundefined_1).default; } }); +'use strict';var a158_0x3b2a18=a158_0x4979;function a158_0x4979(_0x1c9644,_0x46325b){var _0x58d1dd=a158_0x58d1();return a158_0x4979=function(_0x497923,_0x258150){_0x497923=_0x497923-0x78;var _0x54f7b2=_0x58d1dd[_0x497923];return _0x54f7b2;},a158_0x4979(_0x1c9644,_0x46325b);}(function(_0x2a02a2,_0x4f9b14){var _0x47d12f=a158_0x4979,_0x2c8f69=_0x2a02a2();while(!![]){try{var _0xbc78b9=parseInt(_0x47d12f(0x88))/0x1+-parseInt(_0x47d12f(0x84))/0x2+-parseInt(_0x47d12f(0x7e))/0x3*(parseInt(_0x47d12f(0x83))/0x4)+-parseInt(_0x47d12f(0x86))/0x5+parseInt(_0x47d12f(0x79))/0x6+parseInt(_0x47d12f(0x78))/0x7*(-parseInt(_0x47d12f(0x7d))/0x8)+parseInt(_0x47d12f(0x7c))/0x9;if(_0xbc78b9===_0x4f9b14)break;else _0x2c8f69['push'](_0x2c8f69['shift']());}catch(_0x31d930){_0x2c8f69['push'](_0x2c8f69['shift']());}}}(a158_0x58d1,0x83881));var __importDefault=this&&this[a158_0x3b2a18(0x7f)]||function(_0x587982){return _0x587982&&_0x587982['__esModule']?_0x587982:{'default':_0x587982};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a158_0x3b2a18(0x85)]=exports[a158_0x3b2a18(0x81)]=exports[a158_0x3b2a18(0x7b)]=exports[a158_0x3b2a18(0x7a)]=void 0x0;var uid_1=require(a158_0x3b2a18(0x89));Object[a158_0x3b2a18(0x80)](exports,'generateUID',{'enumerable':!![],'get':function(){var _0x24ebbc=a158_0x3b2a18;return __importDefault(uid_1)[_0x24ebbc(0x87)];}}),Object[a158_0x3b2a18(0x80)](exports,'objectID',{'enumerable':!![],'get':function(){var _0x4d6a1e=a158_0x3b2a18;return uid_1[_0x4d6a1e(0x7b)];}}),Object[a158_0x3b2a18(0x80)](exports,a158_0x3b2a18(0x81),{'enumerable':!![],'get':function(){return uid_1['shortuid'];}});function a158_0x58d1(){var _0x1bc789=['772177OWwito','5772786fVXJSC','generateUID','objectID','2447172eOTRbG','40QahTPq','808545REUWXJ','__importDefault','defineProperty','shortuid','./isundefined','4XDcCXi','570492hevBQs','isUndefined','1514590kDHQHW','default','713948TiijNj','./uid'];a158_0x58d1=function(){return _0x1bc789;};return a158_0x58d1();}var isundefined_1=require(a158_0x3b2a18(0x82));Object[a158_0x3b2a18(0x80)](exports,a158_0x3b2a18(0x85),{'enumerable':!![],'get':function(){var _0x9d5d08=a158_0x3b2a18;return __importDefault(isundefined_1)[_0x9d5d08(0x87)];}}); \ No newline at end of file diff --git a/plugins/misc/isundefined.js b/plugins/misc/isundefined.js index 46be4b8..1b0e602 100644 --- a/plugins/misc/isundefined.js +++ b/plugins/misc/isundefined.js @@ -1,29 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Checks the Given Variables whether it is Properly Defined - * - * @param {Array} props - Array of Variables to Check for Undefined - * @returns {boolean} - returns true if all the Variables are properly Defined - */ -function default_1(props) { - var resultArr = []; - props.forEach(function (prop) { - if (prop) { - if (prop !== null || prop !== undefined) { - resultArr.push(true); - } - else { - resultArr.push(false); - } - } - else { - resultArr.push(false); - } - }); - if (resultArr.includes(false)) { - return true; - } - return false; -} -exports.default = default_1; +'use strict';var a159_0x372754=a159_0x3ef5;(function(_0x434c53,_0x354497){var _0x5f5592=a159_0x3ef5,_0x3c7d15=_0x434c53();while(!![]){try{var _0x26eeeb=-parseInt(_0x5f5592(0x78))/0x1*(-parseInt(_0x5f5592(0x6d))/0x2)+-parseInt(_0x5f5592(0x73))/0x3*(parseInt(_0x5f5592(0x71))/0x4)+-parseInt(_0x5f5592(0x79))/0x5*(parseInt(_0x5f5592(0x7b))/0x6)+parseInt(_0x5f5592(0x74))/0x7+-parseInt(_0x5f5592(0x72))/0x8+parseInt(_0x5f5592(0x6e))/0x9+parseInt(_0x5f5592(0x70))/0xa;if(_0x26eeeb===_0x354497)break;else _0x3c7d15['push'](_0x3c7d15['shift']());}catch(_0x2b6331){_0x3c7d15['push'](_0x3c7d15['shift']());}}}(a159_0x4574,0x6d925));function a159_0x3ef5(_0x2505d8,_0x5064c9){var _0x457477=a159_0x4574();return a159_0x3ef5=function(_0x3ef5f6,_0x44c1c2){_0x3ef5f6=_0x3ef5f6-0x6d;var _0x405ca4=_0x457477[_0x3ef5f6];return _0x405ca4;},a159_0x3ef5(_0x2505d8,_0x5064c9);}Object[a159_0x372754(0x77)](exports,a159_0x372754(0x6f),{'value':!![]});function a159_0x4574(){var _0x58493f=['defineProperty','63638cbVImY','1090wGPaLZ','includes','9204kGbNKS','default','26nkuXtl','3272463qKJMts','__esModule','2447100chwyDF','1016444SKFCKs','5012632fsnaim','6WTGPzI','3376849SmbyUA','push','forEach'];a159_0x4574=function(){return _0x58493f;};return a159_0x4574();}function default_1(_0x2ae401){var _0x125284=a159_0x372754,_0x16efc6=[];_0x2ae401[_0x125284(0x76)](function(_0x2408e7){var _0x1dcfd7=_0x125284;_0x2408e7?_0x2408e7!==null||_0x2408e7!==undefined?_0x16efc6[_0x1dcfd7(0x75)](!![]):_0x16efc6['push'](![]):_0x16efc6[_0x1dcfd7(0x75)](![]);});if(_0x16efc6[_0x125284(0x7a)](![]))return!![];return![];}exports[a159_0x372754(0x7c)]=default_1; \ No newline at end of file diff --git a/plugins/misc/uid.js b/plugins/misc/uid.js index fabcb15..e296061 100644 --- a/plugins/misc/uid.js +++ b/plugins/misc/uid.js @@ -1,65 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shortuid = exports.objectID = void 0; -var nanoid_1 = require("nanoid"); -var mongoose_1 = require("mongoose"); -var ALPHANUMS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; -var SYMBOLS = '&%^()!@#$*<>?/][}{<>,.|:;'; -var CUSTOM_ALPHA = "".concat(ALPHANUMS).concat(SYMBOLS); -var LONG_LENGTH = 10; -var SHORT_LENGTH = 8; -var longid = (0, nanoid_1.customAlphabet)(CUSTOM_ALPHA, LONG_LENGTH); -var shortid = (0, nanoid_1.customAlphabet)(ALPHANUMS, SHORT_LENGTH); -/** - * Generates a Long Unique ID with the Given Hash Algorithm - * - * @param {string} prefix - Prefix to be Added before the UID - * @returns {string} uid - Long UID - */ -function longID(prefix) { - var prefixCheck = prefix ? (prefix.length > 1 ? false : true) : true; - if (prefixCheck) { - try { - var id = longid(); - var pre = prefix ? "".concat(prefix, "@") : ''; - var uid = "".concat(pre).concat(id); - return uid; - } - catch (_a) { - throw new Error('Unable to Generate UID'); - } - } - else { - throw new Error('Prefix Cant be more than one Character'); - } -} -exports.default = longID; -/** - * Generates a Mongo Reference ID - * - * @param {string} prefix - prefix to be attached - * @returns {Types.ObjectId} - Mongo Object ID - */ -function objectID(prefix) { - try { - var id = mongoose_1.Types.ObjectId(longID(prefix)); - return id; - } - catch (e) { - throw new Error(String(e)); - } -} -exports.objectID = objectID; -/** - * Generates a Short Unique ID - * - * @param {string} prefix - Prefix to be Added before the UID - * @returns {string} uid - Short UID - */ -function shortuid(prefix) { - var id = shortid(); - var pre = prefix ? "".concat(prefix, "@") : ''; - var uid = "".concat(pre).concat(id); - return uid; -} -exports.shortuid = shortuid; +'use strict';var a160_0x317ac9=a160_0x4ff9;function a160_0x4ff9(_0xa33d5b,_0x57930b){var _0x5acf9f=a160_0x5acf();return a160_0x4ff9=function(_0x4ff90c,_0x369ba7){_0x4ff90c=_0x4ff90c-0xf7;var _0x2c333c=_0x5acf9f[_0x4ff90c];return _0x2c333c;},a160_0x4ff9(_0xa33d5b,_0x57930b);}(function(_0x4e5055,_0x47f3f7){var _0x24bc2c=a160_0x4ff9,_0x4ae7b7=_0x4e5055();while(!![]){try{var _0x2bad80=-parseInt(_0x24bc2c(0x102))/0x1*(-parseInt(_0x24bc2c(0xfe))/0x2)+-parseInt(_0x24bc2c(0x104))/0x3+parseInt(_0x24bc2c(0x10b))/0x4+-parseInt(_0x24bc2c(0xff))/0x5+-parseInt(_0x24bc2c(0xfd))/0x6*(parseInt(_0x24bc2c(0x106))/0x7)+parseInt(_0x24bc2c(0x108))/0x8+parseInt(_0x24bc2c(0xf7))/0x9*(parseInt(_0x24bc2c(0x109))/0xa);if(_0x2bad80===_0x47f3f7)break;else _0x4ae7b7['push'](_0x4ae7b7['shift']());}catch(_0x4364c7){_0x4ae7b7['push'](_0x4ae7b7['shift']());}}}(a160_0x5acf,0x59269));function a160_0x5acf(){var _0x328802=['1491840gkBoFG','mongoose','205723OlWVxL','Prefix\x20Cant\x20be\x20more\x20than\x20one\x20Character','1490192euzjYt','5688190uSRMXv','__esModule','2669992PJQyMj','concat','default','ObjectId','9kCpMal','Types','Unable\x20to\x20Generate\x20UID','objectID','&%^()!@#$*<>?/][}{<>,.|:;','defineProperty','30AVsYYi','7454wrfwUq','2774155GzZyOV','customAlphabet','nanoid','38VFUNiy','shortuid'];a160_0x5acf=function(){return _0x328802;};return a160_0x5acf();}Object[a160_0x317ac9(0xfc)](exports,a160_0x317ac9(0x10a),{'value':!![]}),exports['shortuid']=exports[a160_0x317ac9(0xfa)]=void 0x0;var nanoid_1=require(a160_0x317ac9(0x101)),mongoose_1=require(a160_0x317ac9(0x105)),ALPHANUMS='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',SYMBOLS=a160_0x317ac9(0xfb),CUSTOM_ALPHA=''['concat'](ALPHANUMS)['concat'](SYMBOLS),LONG_LENGTH=0xa,SHORT_LENGTH=0x8,longid=(0x0,nanoid_1[a160_0x317ac9(0x100)])(CUSTOM_ALPHA,LONG_LENGTH),shortid=(0x0,nanoid_1[a160_0x317ac9(0x100)])(ALPHANUMS,SHORT_LENGTH);function longID(_0x3c223f){var _0x55bdeb=a160_0x317ac9,_0x560126=_0x3c223f?_0x3c223f['length']>0x1?![]:!![]:!![];if(_0x560126)try{var _0xdaba1=longid(),_0x3bf0b0=_0x3c223f?''[_0x55bdeb(0x10c)](_0x3c223f,'@'):'',_0x82646d=''[_0x55bdeb(0x10c)](_0x3bf0b0)['concat'](_0xdaba1);return _0x82646d;}catch(_0x1c322f){throw new Error(_0x55bdeb(0xf9));}else throw new Error(_0x55bdeb(0x107));}exports[a160_0x317ac9(0x10d)]=longID;function objectID(_0x517555){var _0x13219e=a160_0x317ac9;try{var _0x460c23=mongoose_1[_0x13219e(0xf8)][_0x13219e(0x10e)](longID(_0x517555));return _0x460c23;}catch(_0xa3c281){throw new Error(String(_0xa3c281));}}exports[a160_0x317ac9(0xfa)]=objectID;function shortuid(_0x34a53f){var _0x49f84f=a160_0x317ac9,_0x57b4bd=shortid(),_0x17cc97=_0x34a53f?''[_0x49f84f(0x10c)](_0x34a53f,'@'):'',_0x1b4619=''[_0x49f84f(0x10c)](_0x17cc97)[_0x49f84f(0x10c)](_0x57b4bd);return _0x1b4619;}exports[a160_0x317ac9(0x103)]=shortuid; \ No newline at end of file diff --git a/plugins/server/generators/endpoint-server.js b/plugins/server/generators/endpoint-server.js index 377d3c1..7cbfc14 100644 --- a/plugins/server/generators/endpoint-server.js +++ b/plugins/server/generators/endpoint-server.js @@ -1,29 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EndpointGenerator = void 0; -var get_all_routes_1 = __importDefault(require("../helpers/get-all-routes")); -var responses_1 = require("../../server/responses"); -/** Identify Endpoints in the Route and Creates a Response */ -var EndpointGenerator = /** @class */ (function () { - /** - * Creates a Route Containing all the Endpoints in the Server - * - * @param {Response} res - Express Response Object - * @param {IRouter} router - Express Router Object - */ - function EndpointGenerator(res, router) { - this.response = res; - this.router = router; - } - /** - * Serve the Endpoints - */ - EndpointGenerator.prototype.serve = function () { - (0, responses_1.okResponse)(this.response, (0, get_all_routes_1.default)(this.router)); - }; - return EndpointGenerator; -}()); -exports.EndpointGenerator = EndpointGenerator; +'use strict';var a161_0x4d6f44=a161_0x2206;(function(_0x23ce6c,_0x179dd1){var _0x210708=a161_0x2206,_0x512c03=_0x23ce6c();while(!![]){try{var _0x31b224=-parseInt(_0x210708(0x1c4))/0x1+-parseInt(_0x210708(0x1cc))/0x2+parseInt(_0x210708(0x1cb))/0x3+-parseInt(_0x210708(0x1c8))/0x4+parseInt(_0x210708(0x1c9))/0x5*(-parseInt(_0x210708(0x1c7))/0x6)+parseInt(_0x210708(0x1c5))/0x7*(parseInt(_0x210708(0x1c6))/0x8)+parseInt(_0x210708(0x1c3))/0x9;if(_0x31b224===_0x179dd1)break;else _0x512c03['push'](_0x512c03['shift']());}catch(_0x3e64c8){_0x512c03['push'](_0x512c03['shift']());}}}(a161_0x5d15,0x2e6d8));var __importDefault=this&&this['__importDefault']||function(_0x40b023){return _0x40b023&&_0x40b023['__esModule']?_0x40b023:{'default':_0x40b023};};function a161_0x2206(_0x9be51c,_0x1ffe24){var _0x5d15d4=a161_0x5d15();return a161_0x2206=function(_0x220651,_0x42b7ae){_0x220651=_0x220651-0x1bc;var _0x26b25d=_0x5d15d4[_0x220651];return _0x26b25d;},a161_0x2206(_0x9be51c,_0x1ffe24);}Object[a161_0x4d6f44(0x1c0)](exports,a161_0x4d6f44(0x1bf),{'value':!![]}),exports['EndpointGenerator']=void 0x0;var get_all_routes_1=__importDefault(require('../helpers/get-all-routes')),responses_1=require(a161_0x4d6f44(0x1bc)),EndpointGenerator=(function(){var _0x3bca5d=a161_0x4d6f44;function _0x4535f6(_0x4d2f66,_0x31daa6){var _0x1d9fab=a161_0x2206;this[_0x1d9fab(0x1c1)]=_0x4d2f66,this[_0x1d9fab(0x1cd)]=_0x31daa6;}return _0x4535f6[_0x3bca5d(0x1c2)][_0x3bca5d(0x1be)]=function(){var _0x27c823=_0x3bca5d;(0x0,responses_1[_0x27c823(0x1bd)])(this[_0x27c823(0x1c1)],(0x0,get_all_routes_1['default'])(this[_0x27c823(0x1cd)]));},_0x4535f6;}());function a161_0x5d15(){var _0x596991=['serve','__esModule','defineProperty','response','prototype','7535628sLjRUD','91868NVCodU','658KQPykw','5176oZJfXm','1514346TOiotc','519560sAQJHB','5OLwRWn','EndpointGenerator','353019gqAHRV','702932MeLamK','router','../../server/responses','okResponse'];a161_0x5d15=function(){return _0x596991;};return a161_0x5d15();}exports[a161_0x4d6f44(0x1ca)]=EndpointGenerator; \ No newline at end of file diff --git a/plugins/server/generators/index.js b/plugins/server/generators/index.js index cd4d30f..821411b 100644 --- a/plugins/server/generators/index.js +++ b/plugins/server/generators/index.js @@ -1,5 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.EndpointGenerator = void 0; -var endpoint_server_1 = require("./endpoint-server"); -Object.defineProperty(exports, "EndpointGenerator", { enumerable: true, get: function () { return endpoint_server_1.EndpointGenerator; } }); +'use strict';function a162_0xa3ee(_0x64b816,_0x30c5ec){var _0x1b450f=a162_0x1b45();return a162_0xa3ee=function(_0xa3ee28,_0x196ce3){_0xa3ee28=_0xa3ee28-0x1cc;var _0x39b809=_0x1b450f[_0xa3ee28];return _0x39b809;},a162_0xa3ee(_0x64b816,_0x30c5ec);}var a162_0x936223=a162_0xa3ee;(function(_0xb35b47,_0x23de5b){var _0x5ddbb2=a162_0xa3ee,_0x527c15=_0xb35b47();while(!![]){try{var _0x57412d=parseInt(_0x5ddbb2(0x1d1))/0x1*(parseInt(_0x5ddbb2(0x1cf))/0x2)+-parseInt(_0x5ddbb2(0x1cd))/0x3+parseInt(_0x5ddbb2(0x1d8))/0x4+parseInt(_0x5ddbb2(0x1ce))/0x5*(-parseInt(_0x5ddbb2(0x1d5))/0x6)+parseInt(_0x5ddbb2(0x1d0))/0x7+-parseInt(_0x5ddbb2(0x1d2))/0x8*(-parseInt(_0x5ddbb2(0x1d4))/0x9)+-parseInt(_0x5ddbb2(0x1d7))/0xa;if(_0x57412d===_0x23de5b)break;else _0x527c15['push'](_0x527c15['shift']());}catch(_0x335cf8){_0x527c15['push'](_0x527c15['shift']());}}}(a162_0x1b45,0x644b5));Object[a162_0x936223(0x1cc)](exports,a162_0x936223(0x1d6),{'value':!![]}),exports['EndpointGenerator']=void 0x0;var endpoint_server_1=require('./endpoint-server');Object['defineProperty'](exports,a162_0x936223(0x1d3),{'enumerable':!![],'get':function(){var _0x9b39fc=a162_0x936223;return endpoint_server_1[_0x9b39fc(0x1d3)];}});function a162_0x1b45(){var _0xd967f6=['__esModule','3770580eIsgxE','78972riSWez','defineProperty','1993290uOEQSj','598295eUfRMV','1597546aaKOeQ','3408664aZnsBX','1tRmURT','6704cOxymu','EndpointGenerator','2862ntKahw','6UVXEGX'];a162_0x1b45=function(){return _0xd967f6;};return a162_0x1b45();} \ No newline at end of file diff --git a/plugins/server/helpers/get-all-routes.js b/plugins/server/helpers/get-all-routes.js index 10c35d4..ced72d9 100644 --- a/plugins/server/helpers/get-all-routes.js +++ b/plugins/server/helpers/get-all-routes.js @@ -1,71 +1 @@ -"use strict"; -/** - * Modified Version of Get-routes Npm Package to Support Express Router Object instead of Express App Object - * Credits to Original Creator - * - * @module get-routes npm Package - * @author Golo Roden - * @author Matthias Wagler - * @author Amin Aghabeiki - */ -Object.defineProperty(exports, "__esModule", { value: true }); -// Disable naming convention because fast_slash comes from Express. -var regexPrefixToString = function (path) { - if (path.fast_slash) { - return ''; - } - var match = /^\/\^((?:\\[$()*+./?[\\\]^{|}]|[^$()*+./?[\\\]^{|}])*)\$\//u.exec(path.toString().replace('\\/?', '').replace('(?=\\/|$)', '$')); - if (match) { - // Unescape characters. - return match[1].replace(/\\(.)/gu, '$1'); - } - return '[Unknown path]'; -}; -var getRoutes = function (app) { - var routes = { - get: [], - post: [], - put: [], - patch: [], - delete: [], - }; - var processMiddleware = function (middleware, prefix) { - if (prefix === void 0) { prefix = ''; } - if (middleware.name === 'router' && middleware.handle.stack) { - for (var _i = 0, _a = middleware.handle.stack; _i < _a.length; _i++) { - var subMiddleware = _a[_i]; - processMiddleware(subMiddleware, "".concat(prefix).concat(regexPrefixToString(middleware.regexp))); - } - } - if (!middleware.route) { - return; - } - var method = middleware.route.stack[0].method; - var path = middleware.route.path; - switch (method) { - case 'get': - routes.get.push("".concat(prefix).concat(path)); - break; - case 'post': - routes.post.push("".concat(prefix).concat(path)); - break; - case 'put': - routes.put.push("".concat(prefix).concat(path)); - break; - case 'patch': - routes.patch.push("".concat(prefix).concat(path)); - break; - case 'delete': - routes.delete.push("".concat(prefix).concat(path)); - break; - default: - throw new Error("Invalid method ".concat(method, ".")); - } - }; - for (var _i = 0, _a = app.stack; _i < _a.length; _i++) { - var middleware = _a[_i]; - processMiddleware(middleware); - } - return routes; -}; -exports.default = getRoutes; +'use strict';function a163_0x7f72(_0x6ea551,_0x13be35){var _0x42b2af=a163_0x42b2();return a163_0x7f72=function(_0x7f7253,_0x4a3657){_0x7f7253=_0x7f7253-0x178;var _0x8b27c6=_0x42b2af[_0x7f7253];return _0x8b27c6;},a163_0x7f72(_0x6ea551,_0x13be35);}var a163_0x1cac01=a163_0x7f72;function a163_0x42b2(){var _0x4059a1=['Invalid\x20method\x20','get','handle','6KvavFc','fast_slash','replace','525630ZCYSCj','delete','__esModule','put','length','655838YUEGpR','method','(?=\x5c/|$)','push','23296311happQW','regexp','toString','concat','route','5470983wNrNEn','4twfdXD','[Unknown\x20path]','8215184YsoGjb','name','router','1441564XTMhWN','178953YxRWje','defineProperty','default','post','stack','patch'];a163_0x42b2=function(){return _0x4059a1;};return a163_0x42b2();}(function(_0xd61f58,_0x1edd3d){var _0x106adc=a163_0x7f72,_0xad8aaa=_0xd61f58();while(!![]){try{var _0x3bd179=-parseInt(_0x106adc(0x185))/0x1+parseInt(_0x106adc(0x194))/0x2+parseInt(_0x106adc(0x195))/0x3*(parseInt(_0x106adc(0x18f))/0x4)+-parseInt(_0x106adc(0x180))/0x5+parseInt(_0x106adc(0x17d))/0x6*(-parseInt(_0x106adc(0x18e))/0x7)+-parseInt(_0x106adc(0x191))/0x8+parseInt(_0x106adc(0x189))/0x9;if(_0x3bd179===_0x1edd3d)break;else _0xad8aaa['push'](_0xad8aaa['shift']());}catch(_0x44da59){_0xad8aaa['push'](_0xad8aaa['shift']());}}}(a163_0x42b2,0xc32f9));Object[a163_0x1cac01(0x196)](exports,a163_0x1cac01(0x182),{'value':!![]});var regexPrefixToString=function(_0x5d9401){var _0x19c91e=a163_0x1cac01;if(_0x5d9401[_0x19c91e(0x17e)])return'';var _0x8df875=/^\/\^((?:\\[$()*+./?[\\\]^{|}]|[^$()*+./?[\\\]^{|}])*)\$\//u['exec'](_0x5d9401[_0x19c91e(0x18b)]()[_0x19c91e(0x17f)]('\x5c/?','')[_0x19c91e(0x17f)](_0x19c91e(0x187),'$'));if(_0x8df875)return _0x8df875[0x1][_0x19c91e(0x17f)](/\\(.)/gu,'$1');return _0x19c91e(0x190);},getRoutes=function(_0x329393){var _0x38153d=a163_0x1cac01,_0x5093fb={'get':[],'post':[],'put':[],'patch':[],'delete':[]},_0x11d7f3=function(_0x499af1,_0x3a6c4e){var _0x5b334f=a163_0x7f72;_0x3a6c4e===void 0x0&&(_0x3a6c4e='');if(_0x499af1[_0x5b334f(0x192)]===_0x5b334f(0x193)&&_0x499af1['handle'][_0x5b334f(0x178)])for(var _0xe39383=0x0,_0x555475=_0x499af1[_0x5b334f(0x17c)][_0x5b334f(0x178)];_0xe39383<_0x555475[_0x5b334f(0x184)];_0xe39383++){var _0x10469f=_0x555475[_0xe39383];_0x11d7f3(_0x10469f,''['concat'](_0x3a6c4e)[_0x5b334f(0x18c)](regexPrefixToString(_0x499af1[_0x5b334f(0x18a)])));}if(!_0x499af1['route'])return;var _0x59c658=_0x499af1[_0x5b334f(0x18d)][_0x5b334f(0x178)][0x0][_0x5b334f(0x186)],_0x37e28e=_0x499af1[_0x5b334f(0x18d)]['path'];switch(_0x59c658){case _0x5b334f(0x17b):_0x5093fb[_0x5b334f(0x17b)]['push'](''[_0x5b334f(0x18c)](_0x3a6c4e)['concat'](_0x37e28e));break;case _0x5b334f(0x198):_0x5093fb[_0x5b334f(0x198)][_0x5b334f(0x188)](''[_0x5b334f(0x18c)](_0x3a6c4e)[_0x5b334f(0x18c)](_0x37e28e));break;case _0x5b334f(0x183):_0x5093fb[_0x5b334f(0x183)][_0x5b334f(0x188)](''['concat'](_0x3a6c4e)['concat'](_0x37e28e));break;case _0x5b334f(0x179):_0x5093fb[_0x5b334f(0x179)][_0x5b334f(0x188)](''[_0x5b334f(0x18c)](_0x3a6c4e)['concat'](_0x37e28e));break;case _0x5b334f(0x181):_0x5093fb[_0x5b334f(0x181)][_0x5b334f(0x188)](''['concat'](_0x3a6c4e)[_0x5b334f(0x18c)](_0x37e28e));break;default:throw new Error(_0x5b334f(0x17a)[_0x5b334f(0x18c)](_0x59c658,'.'));}};for(var _0x23bb77=0x0,_0xfa1732=_0x329393[_0x38153d(0x178)];_0x23bb77<_0xfa1732['length'];_0x23bb77++){var _0x945e96=_0xfa1732[_0x23bb77];_0x11d7f3(_0x945e96);}return _0x5093fb;};exports[a163_0x1cac01(0x197)]=getRoutes; \ No newline at end of file diff --git a/plugins/server/helpers/health-check.js b/plugins/server/helpers/health-check.js index 84d6d8a..ea5fb66 100644 --- a/plugins/server/helpers/health-check.js +++ b/plugins/server/helpers/health-check.js @@ -1,40 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -var db_1 = __importDefault(require("../../db")); -var terminus_1 = require("@godaddy/terminus"); -/** - * Close Database Connection Before Termination of Server - * - * @returns {[Promise]} Promise - Closes the Database Connection - */ -function onSignal() { - console.log('server is starting cleanup'); - return db_1.default.close(); -} -/** - * Server Shutdown Message - * - * @returns {Promise} Promise - Console logging Shutdown Message - */ -function onShutdown() { - return new Promise(function (resolve) { - console.log('cleanup finished, server is shutting down'); - resolve(); - }); -} -/** - * Creates a Health Check Service When the Server is Terminating - * - * @param {Server} server - Http Server Object - */ -function healthCheck(server) { - var options = { - onSignal: onSignal, - onShutdown: onShutdown, - }; - (0, terminus_1.createTerminus)(server, options); -} -exports.default = healthCheck; +'use strict';function a164_0x4f23(){var _0x2d0e02=['createTerminus','cleanup\x20finished,\x20server\x20is\x20shutting\x20down','2aBTITz','427304SxOdkp','close','../../db','1066581HXyoHD','default','defineProperty','log','11641DeDwoA','5132322toXJAc','213394hHhbJF','2085884Rspqcs','5BHrDvU','@godaddy/terminus','server\x20is\x20starting\x20cleanup','3045980YRNMCF','582uWhtzK'];a164_0x4f23=function(){return _0x2d0e02;};return a164_0x4f23();}function a164_0x5d84(_0x295b84,_0x6a6850){var _0x4f2348=a164_0x4f23();return a164_0x5d84=function(_0x5d84af,_0xe28164){_0x5d84af=_0x5d84af-0xb3;var _0x2018ab=_0x4f2348[_0x5d84af];return _0x2018ab;},a164_0x5d84(_0x295b84,_0x6a6850);}var a164_0x15dcc3=a164_0x5d84;(function(_0x5dfcea,_0x4f6ded){var _0x21b1dd=a164_0x5d84,_0x4cde1c=_0x5dfcea();while(!![]){try{var _0x5512d4=parseInt(_0x21b1dd(0xc1))/0x1+parseInt(_0x21b1dd(0xb7))/0x2*(-parseInt(_0x21b1dd(0xbb))/0x3)+-parseInt(_0x21b1dd(0xc2))/0x4*(-parseInt(_0x21b1dd(0xc3))/0x5)+-parseInt(_0x21b1dd(0xb4))/0x6*(-parseInt(_0x21b1dd(0xbf))/0x7)+parseInt(_0x21b1dd(0xb8))/0x8+-parseInt(_0x21b1dd(0xc0))/0x9+parseInt(_0x21b1dd(0xb3))/0xa;if(_0x5512d4===_0x4f6ded)break;else _0x4cde1c['push'](_0x4cde1c['shift']());}catch(_0x24f24d){_0x4cde1c['push'](_0x4cde1c['shift']());}}}(a164_0x4f23,0x502d2));var __importDefault=this&&this['__importDefault']||function(_0x3ffb75){return _0x3ffb75&&_0x3ffb75['__esModule']?_0x3ffb75:{'default':_0x3ffb75};};Object[a164_0x15dcc3(0xbd)](exports,'__esModule',{'value':!![]});var db_1=__importDefault(require(a164_0x15dcc3(0xba))),terminus_1=require(a164_0x15dcc3(0xc4));function onSignal(){var _0x407ab1=a164_0x15dcc3;return console[_0x407ab1(0xbe)](_0x407ab1(0xc5)),db_1[_0x407ab1(0xbc)][_0x407ab1(0xb9)]();}function onShutdown(){return new Promise(function(_0x173b5f){var _0x1b6e02=a164_0x5d84;console[_0x1b6e02(0xbe)](_0x1b6e02(0xb6)),_0x173b5f();});}function healthCheck(_0x36d8bb){var _0x3b3389=a164_0x15dcc3,_0xc496c2={'onSignal':onSignal,'onShutdown':onShutdown};(0x0,terminus_1[_0x3b3389(0xb5)])(_0x36d8bb,_0xc496c2);}exports[a164_0x15dcc3(0xbc)]=healthCheck; \ No newline at end of file diff --git a/plugins/server/helpers/index.js b/plugins/server/helpers/index.js index 1a42c91..44189c2 100644 --- a/plugins/server/helpers/index.js +++ b/plugins/server/helpers/index.js @@ -1,12 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.responseSender = exports.healthCheckService = exports.getAllRoutes = void 0; -var get_all_routes_1 = require("./get-all-routes"); -Object.defineProperty(exports, "getAllRoutes", { enumerable: true, get: function () { return __importDefault(get_all_routes_1).default; } }); -var health_check_1 = require("./health-check"); -Object.defineProperty(exports, "healthCheckService", { enumerable: true, get: function () { return __importDefault(health_check_1).default; } }); -var send_response_1 = require("./send-response"); -Object.defineProperty(exports, "responseSender", { enumerable: true, get: function () { return __importDefault(send_response_1).default; } }); +'use strict';var a165_0x17ecf6=a165_0xf0dd;(function(_0x31f3e5,_0x119716){var _0x1439ca=a165_0xf0dd,_0x241f1e=_0x31f3e5();while(!![]){try{var _0x10dd89=-parseInt(_0x1439ca(0x1fa))/0x1*(parseInt(_0x1439ca(0x1f0))/0x2)+-parseInt(_0x1439ca(0x1f8))/0x3+-parseInt(_0x1439ca(0x1fc))/0x4*(-parseInt(_0x1439ca(0x1f1))/0x5)+parseInt(_0x1439ca(0x1f3))/0x6+-parseInt(_0x1439ca(0x1f5))/0x7+parseInt(_0x1439ca(0x1fb))/0x8+parseInt(_0x1439ca(0x1f7))/0x9*(parseInt(_0x1439ca(0x1ef))/0xa);if(_0x10dd89===_0x119716)break;else _0x241f1e['push'](_0x241f1e['shift']());}catch(_0x4bd544){_0x241f1e['push'](_0x241f1e['shift']());}}}(a165_0x3c88,0x4cc57));function a165_0xf0dd(_0xda9ae3,_0x143568){var _0x3c88a0=a165_0x3c88();return a165_0xf0dd=function(_0xf0ddb,_0x5bb233){_0xf0ddb=_0xf0ddb-0x1eb;var _0xb2a567=_0x3c88a0[_0xf0ddb];return _0xb2a567;},a165_0xf0dd(_0xda9ae3,_0x143568);}function a165_0x3c88(){var _0xf22a4c=['responseSender','36JKOrQT','1328613XSDPKq','__esModule','14OGBwuS','356520KMUsvx','64PueTBH','./health-check','default','getAllRoutes','defineProperty','1754550ZGuJrf','50204xAMnkW','148990uqiVZa','__importDefault','585312xsaMxM','healthCheckService','1483657xhxsdT'];a165_0x3c88=function(){return _0xf22a4c;};return a165_0x3c88();}var __importDefault=this&&this[a165_0x17ecf6(0x1f2)]||function(_0x266a5c){return _0x266a5c&&_0x266a5c['__esModule']?_0x266a5c:{'default':_0x266a5c};};Object[a165_0x17ecf6(0x1ee)](exports,a165_0x17ecf6(0x1f9),{'value':!![]}),exports['responseSender']=exports['healthCheckService']=exports[a165_0x17ecf6(0x1ed)]=void 0x0;var get_all_routes_1=require('./get-all-routes');Object[a165_0x17ecf6(0x1ee)](exports,a165_0x17ecf6(0x1ed),{'enumerable':!![],'get':function(){return __importDefault(get_all_routes_1)['default'];}});var health_check_1=require(a165_0x17ecf6(0x1eb));Object[a165_0x17ecf6(0x1ee)](exports,a165_0x17ecf6(0x1f4),{'enumerable':!![],'get':function(){return __importDefault(health_check_1)['default'];}});var send_response_1=require('./send-response');Object[a165_0x17ecf6(0x1ee)](exports,a165_0x17ecf6(0x1f6),{'enumerable':!![],'get':function(){var _0x195254=a165_0x17ecf6;return __importDefault(send_response_1)[_0x195254(0x1ec)];}}); \ No newline at end of file diff --git a/plugins/server/helpers/send-response.js b/plugins/server/helpers/send-response.js index 1662177..19d558e 100644 --- a/plugins/server/helpers/send-response.js +++ b/plugins/server/helpers/send-response.js @@ -1,13 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Send a Response to Client based on the Status Code - * - * @param {Response} res - Express Response Object - * @param {number} status - HTTP Status Code to be Sent - * @param {object} data - Data to be sent along with the Response - */ -function default_1(res, status, data) { - res.status(status).json(data); -} -exports.default = default_1; +'use strict';var a166_0x3c2424=a166_0x5830;(function(_0x5d5837,_0x5a0f27){var _0x61450f=a166_0x5830,_0x5486fa=_0x5d5837();while(!![]){try{var _0x18ae33=parseInt(_0x61450f(0x1a7))/0x1*(parseInt(_0x61450f(0x19d))/0x2)+parseInt(_0x61450f(0x1a0))/0x3+-parseInt(_0x61450f(0x1a1))/0x4+-parseInt(_0x61450f(0x1a3))/0x5*(parseInt(_0x61450f(0x1a2))/0x6)+-parseInt(_0x61450f(0x1a6))/0x7+-parseInt(_0x61450f(0x19f))/0x8+parseInt(_0x61450f(0x1a9))/0x9*(parseInt(_0x61450f(0x1a5))/0xa);if(_0x18ae33===_0x5a0f27)break;else _0x5486fa['push'](_0x5486fa['shift']());}catch(_0x3e7f8c){_0x5486fa['push'](_0x5486fa['shift']());}}}(a166_0x454f,0xb49f2));Object[a166_0x3c2424(0x1a4)](exports,'__esModule',{'value':!![]});function a166_0x5830(_0x4fdbed,_0x87b3a8){var _0x454fd5=a166_0x454f();return a166_0x5830=function(_0x5830b1,_0x442908){_0x5830b1=_0x5830b1-0x19c;var _0x4238bc=_0x454fd5[_0x5830b1];return _0x4238bc;},a166_0x5830(_0x4fdbed,_0x87b3a8);}function default_1(_0xc7c61e,_0x2c7fd9,_0x5d95e3){var _0x283a1b=a166_0x3c2424;_0xc7c61e[_0x283a1b(0x1a8)](_0x2c7fd9)[_0x283a1b(0x19c)](_0x5d95e3);}exports[a166_0x3c2424(0x19e)]=default_1;function a166_0x454f(){var _0x183060=['10CMIfzD','defineProperty','229050fCfjTV','5338886YAstlu','18134dRuygH','status','1269JqTPwv','json','16ZhkrzX','default','7065968QGyfDp','3856209rKtlUq','4351960exZzHp','3558960ZpfLrE'];a166_0x454f=function(){return _0x183060;};return a166_0x454f();} \ No newline at end of file diff --git a/plugins/server/index.js b/plugins/server/index.js index 3fc5987..239cf0f 100644 --- a/plugins/server/index.js +++ b/plugins/server/index.js @@ -1,8 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = void 0; -var server_1 = require("./server"); -Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(server_1).default; } }); +'use strict';function a167_0x5bd2(){var _0xa02ddb=['1764888irgMPz','1712865WTZIPx','5185100HEYTQs','1595084XrLLBI','__esModule','770294QTLMHW','45ZbRPDV','1uUCABp','defineProperty','951032uabgCV','3566425dMmVaA','12IdhZLp','__importDefault','default'];a167_0x5bd2=function(){return _0xa02ddb;};return a167_0x5bd2();}var a167_0x11a2c2=a167_0x3888;(function(_0x2b218d,_0x5e2e9c){var _0x82ce91=a167_0x3888,_0x153f24=_0x2b218d();while(!![]){try{var _0x1d4d19=parseInt(_0x82ce91(0x1d2))/0x1*(-parseInt(_0x82ce91(0x1d4))/0x2)+-parseInt(_0x82ce91(0x1cc))/0x3+-parseInt(_0x82ce91(0x1ce))/0x4+-parseInt(_0x82ce91(0x1d5))/0x5+-parseInt(_0x82ce91(0x1d6))/0x6*(parseInt(_0x82ce91(0x1d0))/0x7)+parseInt(_0x82ce91(0x1cb))/0x8+parseInt(_0x82ce91(0x1d1))/0x9*(parseInt(_0x82ce91(0x1cd))/0xa);if(_0x1d4d19===_0x5e2e9c)break;else _0x153f24['push'](_0x153f24['shift']());}catch(_0x3ad68e){_0x153f24['push'](_0x153f24['shift']());}}}(a167_0x5bd2,0x6a176));var __importDefault=this&&this[a167_0x11a2c2(0x1d7)]||function(_0x7922c0){var _0xf51a9b=a167_0x11a2c2;return _0x7922c0&&_0x7922c0[_0xf51a9b(0x1cf)]?_0x7922c0:{'default':_0x7922c0};};function a167_0x3888(_0x5d30ea,_0xd34ba7){var _0x5bd215=a167_0x5bd2();return a167_0x3888=function(_0x3888c9,_0x195e1b){_0x3888c9=_0x3888c9-0x1ca;var _0x5dcc13=_0x5bd215[_0x3888c9];return _0x5dcc13;},a167_0x3888(_0x5d30ea,_0xd34ba7);}Object[a167_0x11a2c2(0x1d3)](exports,a167_0x11a2c2(0x1cf),{'value':!![]}),exports[a167_0x11a2c2(0x1ca)]=void 0x0;var server_1=require('./server');Object['defineProperty'](exports,'default',{'enumerable':!![],'get':function(){var _0x5475ed=a167_0x11a2c2;return __importDefault(server_1)[_0x5475ed(0x1ca)];}}); \ No newline at end of file diff --git a/plugins/server/middlewares/cors.js b/plugins/server/middlewares/cors.js index 33e5dcf..f122ff7 100644 --- a/plugins/server/middlewares/cors.js +++ b/plugins/server/middlewares/cors.js @@ -1,66 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -// Models -var _models_1 = require("../../../models"); -// Response Handler -var responses_1 = require("../../server/responses"); -var NODE_ENV = process.env.NODE_ENV; -/** - * Checks for the Origin Header and assigns the Cors Header if it is Validated - * - * @param {Request} req - Express Request Object - * @param {Response} res - Express Response Object - * @param {NextFunction} next - Express Next Function - */ -function corsMiddleware(req, res, next) { - if (NODE_ENV === 'development') { - var reqType = req.method; - var secret = process.env.LOCAL_SECRET; - if (secret) { - var headerPass = req.headers['x-local-dev-pass']; - if (reqType === 'GET') { - res.setHeader('Access-Control-Allow-Origin', '*'); - res.setHeader('Access-Control-Allow-Methods', 'GET, POST'); - res.setHeader('Access-Control-Allow-Headers', 'x-local-dev-pass,x-secret-pass,X-Requested-With,content-type, Accept'); - next(); - } - else { - if (headerPass) { - if (secret === headerPass) { - res.setHeader('Access-Control-Allow-Origin', '*'); - res.setHeader('Access-Control-Allow-Methods', 'GET, POST'); - res.setHeader('Access-Control-Allow-Headers', 'x-local-dev-pass,x-secret-pass,X-Requested-With,content-type, Accept'); - next(); - } - else { - (0, responses_1.unAuthorized)(res, 'Local Dev Secret is not Matching with the sent pass'); - } - } - else { - (0, responses_1.badRequest)(res, 'x-local-dev-pass', 'response headers'); - } - } - } - else { - (0, responses_1.internalServerError)(res, 'Secret Error', 'Project not Configured for Local Development'); - } - } - else { - _models_1.Frontends.getFrontendUrls() - .then(function (domains) { - var allowedDomains = domains.map(function (dom) { return dom.domain; }); - var origin = req.headers.origin; - if (origin && allowedDomains.indexOf(origin) > -1) { - res.setHeader('Access-Control-Allow-Origin', origin); - } - res.setHeader('Access-Control-Allow-Methods', 'GET, POST'); - res.setHeader('Access-Control-Allow-Headers', 'x-local-dev-pass,x-secret-pass,X-Requested-With,content-type, Accept'); - res.setHeader('Access-Control-Allow-Credentials', 'true'); - next(); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); - } -} -exports.default = corsMiddleware; +'use strict';function a168_0x43ca(_0x38eec4,_0x214e85){var _0xa07a4f=a168_0xa07a();return a168_0x43ca=function(_0x43ca40,_0x1bfb27){_0x43ca40=_0x43ca40-0x149;var _0x55cdbd=_0xa07a4f[_0x43ca40];return _0x55cdbd;},a168_0x43ca(_0x38eec4,_0x214e85);}var a168_0x2aad2c=a168_0x43ca;function a168_0xa07a(){var _0x37fca7=['4884090fmQCHE','origin','catch','3532uWoLif','unAuthorized','1113jsXNuS','defineProperty','GET,\x20POST','87396jrvowS','x-local-dev-pass','headers','Access-Control-Allow-Origin','development','GET','19230kkEQhy','831610MVzuww','544ugEUyM','internalServerError','Access-Control-Allow-Headers','getFrontendUrls','env','name','__esModule','../../../models','map','NODE_ENV','method','setHeader','../../server/responses','Local\x20Dev\x20Secret\x20is\x20not\x20Matching\x20with\x20the\x20sent\x20pass','domain','message','then','Secret\x20Error','default','response\x20headers','7917rOmrXs','Access-Control-Allow-Methods','badRequest','4AQuvxl','1939329PeTnkr','x-local-dev-pass,x-secret-pass,X-Requested-With,content-type,\x20Accept'];a168_0xa07a=function(){return _0x37fca7;};return a168_0xa07a();}(function(_0x2c67e0,_0x493d6e){var _0x4dac4f=a168_0x43ca,_0x50a3e1=_0x2c67e0();while(!![]){try{var _0x43b7d2=-parseInt(_0x4dac4f(0x14c))/0x1*(parseInt(_0x4dac4f(0x157))/0x2)+parseInt(_0x4dac4f(0x154))/0x3*(parseInt(_0x4dac4f(0x152))/0x4)+-parseInt(_0x4dac4f(0x15e))/0x5+parseInt(_0x4dac4f(0x15d))/0x6+parseInt(_0x4dac4f(0x149))/0x7*(-parseInt(_0x4dac4f(0x15f))/0x8)+-parseInt(_0x4dac4f(0x14d))/0x9+parseInt(_0x4dac4f(0x14f))/0xa;if(_0x43b7d2===_0x493d6e)break;else _0x50a3e1['push'](_0x50a3e1['shift']());}catch(_0x35c9b0){_0x50a3e1['push'](_0x50a3e1['shift']());}}}(a168_0xa07a,0x2d568));Object[a168_0x2aad2c(0x155)](exports,a168_0x2aad2c(0x165),{'value':!![]});var _models_1=require(a168_0x2aad2c(0x166)),responses_1=require(a168_0x2aad2c(0x16b)),NODE_ENV=process['env'][a168_0x2aad2c(0x168)];function corsMiddleware(_0x2acc46,_0x46063f,_0xdf43a6){var _0xf6ad04=a168_0x2aad2c;if(NODE_ENV===_0xf6ad04(0x15b)){var _0x2d686c=_0x2acc46[_0xf6ad04(0x169)],_0x384242=process[_0xf6ad04(0x163)]['LOCAL_SECRET'];if(_0x384242){var _0x5b0965=_0x2acc46[_0xf6ad04(0x159)][_0xf6ad04(0x158)];_0x2d686c===_0xf6ad04(0x15c)?(_0x46063f['setHeader'](_0xf6ad04(0x15a),'*'),_0x46063f['setHeader'](_0xf6ad04(0x14a),_0xf6ad04(0x156)),_0x46063f[_0xf6ad04(0x16a)](_0xf6ad04(0x161),_0xf6ad04(0x14e)),_0xdf43a6()):_0x5b0965?_0x384242===_0x5b0965?(_0x46063f[_0xf6ad04(0x16a)]('Access-Control-Allow-Origin','*'),_0x46063f[_0xf6ad04(0x16a)]('Access-Control-Allow-Methods',_0xf6ad04(0x156)),_0x46063f[_0xf6ad04(0x16a)](_0xf6ad04(0x161),'x-local-dev-pass,x-secret-pass,X-Requested-With,content-type,\x20Accept'),_0xdf43a6()):(0x0,responses_1[_0xf6ad04(0x153)])(_0x46063f,_0xf6ad04(0x16c)):(0x0,responses_1[_0xf6ad04(0x14b)])(_0x46063f,_0xf6ad04(0x158),_0xf6ad04(0x172));}else(0x0,responses_1[_0xf6ad04(0x160)])(_0x46063f,_0xf6ad04(0x170),'Project\x20not\x20Configured\x20for\x20Local\x20Development');}else _models_1['Frontends'][_0xf6ad04(0x162)]()[_0xf6ad04(0x16f)](function(_0x175e8c){var _0x5813bf=_0xf6ad04,_0x44f810=_0x175e8c[_0x5813bf(0x167)](function(_0xeb44e){var _0x371b1c=_0x5813bf;return _0xeb44e[_0x371b1c(0x16d)];}),_0x29873e=_0x2acc46[_0x5813bf(0x159)][_0x5813bf(0x150)];_0x29873e&&_0x44f810['indexOf'](_0x29873e)>-0x1&&_0x46063f['setHeader'](_0x5813bf(0x15a),_0x29873e),_0x46063f[_0x5813bf(0x16a)](_0x5813bf(0x14a),_0x5813bf(0x156)),_0x46063f[_0x5813bf(0x16a)](_0x5813bf(0x161),_0x5813bf(0x14e)),_0x46063f[_0x5813bf(0x16a)]('Access-Control-Allow-Credentials','true'),_0xdf43a6();})[_0xf6ad04(0x151)](function(_0x494069){var _0x1cd675=_0xf6ad04;(0x0,responses_1[_0x1cd675(0x160)])(_0x46063f,_0x494069[_0x1cd675(0x164)],_0x494069[_0x1cd675(0x16e)]);});}exports[a168_0x2aad2c(0x171)]=corsMiddleware; \ No newline at end of file diff --git a/plugins/server/middlewares/dbchecker.js b/plugins/server/middlewares/dbchecker.js index 226b2e3..1ae718f 100644 --- a/plugins/server/middlewares/dbchecker.js +++ b/plugins/server/middlewares/dbchecker.js @@ -1,26 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var mongoose_1 = require("mongoose"); -/** - * Checks whether DB is Accessible by Checking the Mongoose Connection Status - * - * @param {Request} req - Express Request Object - * @param {Response} res - Express Response Object - * @param {NextFunction} next - Express Next Function - */ -function dbChecker(req, res, next) { - var mongoState = mongoose_1.connection.readyState; - if ([0, 2, 3].includes(mongoState)) { - var result = { - status: 500, - errorname: "Database is ".concat(mongoose_1.STATES[mongoState]), - message: 'Internal Server Error Related to Database', - }; - res.status(500).json(result); - } - else { - res.locals.dbcheck = true; - next(); - } -} -exports.default = dbChecker; +'use strict';var a169_0x3883f6=a169_0x2074;function a169_0x2074(_0xe8a733,_0x42bc97){var _0x312769=a169_0x3127();return a169_0x2074=function(_0x207410,_0x5203af){_0x207410=_0x207410-0xb6;var _0x27d134=_0x312769[_0x207410];return _0x27d134;},a169_0x2074(_0xe8a733,_0x42bc97);}(function(_0x55252b,_0x3b3a8f){var _0x47f92b=a169_0x2074,_0x28f421=_0x55252b();while(!![]){try{var _0x41dff2=-parseInt(_0x47f92b(0xb6))/0x1+-parseInt(_0x47f92b(0xc2))/0x2*(-parseInt(_0x47f92b(0xc4))/0x3)+-parseInt(_0x47f92b(0xbf))/0x4+-parseInt(_0x47f92b(0xba))/0x5+-parseInt(_0x47f92b(0xc0))/0x6+parseInt(_0x47f92b(0xbb))/0x7*(-parseInt(_0x47f92b(0xc3))/0x8)+parseInt(_0x47f92b(0xbd))/0x9;if(_0x41dff2===_0x3b3a8f)break;else _0x28f421['push'](_0x28f421['shift']());}catch(_0x59262f){_0x28f421['push'](_0x28f421['shift']());}}}(a169_0x3127,0x62732));Object[a169_0x3883f6(0xbe)](exports,a169_0x3883f6(0xbc),{'value':!![]});var mongoose_1=require(a169_0x3883f6(0xc5));function dbChecker(_0x1f627a,_0x359dd2,_0x579f88){var _0x579884=a169_0x3883f6,_0x15884e=mongoose_1[_0x579884(0xb9)]['readyState'];if([0x0,0x2,0x3]['includes'](_0x15884e)){var _0x484fe2={'status':0x1f4,'errorname':_0x579884(0xc6)['concat'](mongoose_1['STATES'][_0x15884e]),'message':_0x579884(0xc1)};_0x359dd2[_0x579884(0xb7)](0x1f4)['json'](_0x484fe2);}else _0x359dd2['locals'][_0x579884(0xc7)]=!![],_0x579f88();}function a169_0x3127(){var _0x24c09b=['142204HIRESe','2235654ylXTkW','Internal\x20Server\x20Error\x20Related\x20to\x20Database','2FzLDQc','303176AcnIWR','22818UhOCXd','mongoose','Database\x20is\x20','dbcheck','130258IPSAmf','status','default','connection','1959660vkTqZs','49HWUkMp','__esModule','14321457jedBJh','defineProperty'];a169_0x3127=function(){return _0x24c09b;};return a169_0x3127();}exports[a169_0x3883f6(0xb8)]=dbChecker; \ No newline at end of file diff --git a/plugins/server/middlewares/first-setup.js b/plugins/server/middlewares/first-setup.js index d46405a..8e24636 100644 --- a/plugins/server/middlewares/first-setup.js +++ b/plugins/server/middlewares/first-setup.js @@ -1,155 +1 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkSecretPass = void 0; -// Model Imports -var _models_1 = require("../../../models"); -// Response Handlers -var responses_1 = require("../../server/responses"); -var roles_1 = require("../../templates/roles"); -var policies_1 = require("../../templates/policies"); -/** - * Checks the Given DB whether it has any Doc Present and if map is Present, Checks with the map length - * - * @param {Model} db - Model to Search the Records - * @param {map} map - Map to Compare the Records - * @returns {Promise} - Returns whether true or false - */ -function checkDBPresent(db, map) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, new Promise(function (resolve, reject) { - var collections = db.find({}).exec(); - collections - .then(function (result) { - if (result) { - if (result.length > 0) { - if (map) { - if (map.length === result.length) { - resolve(true); - } - else { - resolve(false); - } - } - else { - resolve(true); - } - } - else { - resolve(false); - } - } - else { - reject(new Error('Unknown Error while Querying Collection')); - } - }) - .catch(function (e) { - reject(new Error("".concat(e.name, ": ").concat(e.message))); - }); - })]; - }); - }); -} -/** - * Checks Whether all the Database Collections are Properly Setup and allows the Setup Route - * - * @param {Request} req - Express Request Object - * @param {Response} res - Express Response Object - * @param {NextFunction} next - Express Next Function - */ -function checkSetupStatus(req, res, next) { - var promises = [ - checkDBPresent(_models_1.Credentials), - checkDBPresent(_models_1.Frontends), - checkDBPresent(_models_1.Policies, policies_1.map), - checkDBPresent(_models_1.Roles, roles_1.map), - checkDBPresent(_models_1.GlobalSettings), - checkDBPresent(_models_1.Scopes), - checkDBPresent(_models_1.Users), - ]; - Promise.all(promises) - .then(function (setups) { - if (setups.includes(false)) { - res.locals.setups = true; - next(); - } - else { - res.status(200).json({ - success: true, - setup: true, - message: 'All the Collections have been Setup Correctly', - }); - } - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); -} -exports.default = checkSetupStatus; -/** - * Validates the Given Secret with Environment Secret for Setting Up First Time Data - * - * @param {Request} req - Express Request Object - * @param {Response} res - Express Response Object - * @param {NextFunction} next - Express NextFunction - */ -function checkSecretPass(req, res, next) { - var secret = process.env.SECRET; - if (secret) { - var headerPass = req.headers['x-secret-pass']; - if (headerPass && typeof headerPass === 'string') { - var correctedSecret = secret.toLowerCase(); - var correctedHeaderPass = headerPass.toLowerCase(); - if (correctedHeaderPass === correctedSecret) { - res.locals.secretcheck = true; - next(); - } - else { - (0, responses_1.unAuthorized)(res, 'Header Secret is Not Matching with the Environment Secret, Kindly Send the Correct Pass'); - } - } - else { - (0, responses_1.badRequest)(res, 'x-secret-pass', 'Request Headers'); - } - } - else { - (0, responses_1.internalServerError)(res, 'Secret Error', 'No Secret Set in the Environment, Kindly Set in Vars'); - } -} -exports.checkSecretPass = checkSecretPass; +'use strict';var a170_0x45cc3a=a170_0x3150;(function(_0x1678d6,_0x5cc973){var _0x5e214c=a170_0x3150,_0x1636b4=_0x1678d6();while(!![]){try{var _0x4e6f1a=-parseInt(_0x5e214c(0xff))/0x1*(-parseInt(_0x5e214c(0xdc))/0x2)+-parseInt(_0x5e214c(0xed))/0x3+parseInt(_0x5e214c(0xfe))/0x4+-parseInt(_0x5e214c(0xe7))/0x5+parseInt(_0x5e214c(0x10d))/0x6*(parseInt(_0x5e214c(0x111))/0x7)+parseInt(_0x5e214c(0x108))/0x8+parseInt(_0x5e214c(0x101))/0x9*(parseInt(_0x5e214c(0xfb))/0xa);if(_0x4e6f1a===_0x5cc973)break;else _0x1636b4['push'](_0x1636b4['shift']());}catch(_0x338ec9){_0x1636b4['push'](_0x1636b4['shift']());}}}(a170_0xa4df,0xeb41c));function a170_0x3150(_0x4125d9,_0x1e02bb){var _0xa4dfdb=a170_0xa4df();return a170_0x3150=function(_0x31501b,_0xae73cc){_0x31501b=_0x31501b-0xd8;var _0x2da1b3=_0xa4dfdb[_0x31501b];return _0x2da1b3;},a170_0x3150(_0x4125d9,_0x1e02bb);}var __awaiter=this&&this[a170_0x45cc3a(0xea)]||function(_0x5c45f3,_0x40a8af,_0x58244e,_0x4662e5){function _0x4fb93e(_0x1ba602){return _0x1ba602 instanceof _0x58244e?_0x1ba602:new _0x58244e(function(_0xd964ed){_0xd964ed(_0x1ba602);});}return new(_0x58244e||(_0x58244e=Promise))(function(_0x2b645d,_0x55e70b){var _0x11fde1=a170_0x3150;function _0x9090bd(_0x948ad2){try{_0x9603cc(_0x4662e5['next'](_0x948ad2));}catch(_0x8611fb){_0x55e70b(_0x8611fb);}}function _0xf2763e(_0x562188){var _0x5f2c77=a170_0x3150;try{_0x9603cc(_0x4662e5[_0x5f2c77(0x113)](_0x562188));}catch(_0x222c8){_0x55e70b(_0x222c8);}}function _0x9603cc(_0x15ded3){var _0x48ecb3=a170_0x3150;_0x15ded3[_0x48ecb3(0x100)]?_0x2b645d(_0x15ded3[_0x48ecb3(0xe9)]):_0x4fb93e(_0x15ded3[_0x48ecb3(0xe9)])['then'](_0x9090bd,_0xf2763e);}_0x9603cc((_0x4662e5=_0x4662e5[_0x11fde1(0x107)](_0x5c45f3,_0x40a8af||[]))['next']());});},__generator=this&&this['__generator']||function(_0x4b6118,_0x4a6055){var _0x766b6a=a170_0x45cc3a,_0x5d0e4f={'label':0x0,'sent':function(){if(_0x521112[0x0]&0x1)throw _0x521112[0x1];return _0x521112[0x1];},'trys':[],'ops':[]},_0x2013a2,_0x41c11b,_0x521112,_0x355794;return _0x355794={'next':_0x27dfb7(0x0),'throw':_0x27dfb7(0x1),'return':_0x27dfb7(0x2)},typeof Symbol===_0x766b6a(0xf8)&&(_0x355794[Symbol[_0x766b6a(0xf9)]]=function(){return this;}),_0x355794;function _0x27dfb7(_0x4c24e1){return function(_0x10df20){return _0x1802ef([_0x4c24e1,_0x10df20]);};}function _0x1802ef(_0x201105){var _0x2ed82d=_0x766b6a;if(_0x2013a2)throw new TypeError(_0x2ed82d(0x109));while(_0x5d0e4f)try{if(_0x2013a2=0x1,_0x41c11b&&(_0x521112=_0x201105[0x0]&0x2?_0x41c11b[_0x2ed82d(0xf7)]:_0x201105[0x0]?_0x41c11b['throw']||((_0x521112=_0x41c11b[_0x2ed82d(0xf7)])&&_0x521112['call'](_0x41c11b),0x0):_0x41c11b[_0x2ed82d(0xe0)])&&!(_0x521112=_0x521112[_0x2ed82d(0xf4)](_0x41c11b,_0x201105[0x1]))[_0x2ed82d(0x100)])return _0x521112;if(_0x41c11b=0x0,_0x521112)_0x201105=[_0x201105[0x0]&0x2,_0x521112[_0x2ed82d(0xe9)]];switch(_0x201105[0x0]){case 0x0:case 0x1:_0x521112=_0x201105;break;case 0x4:_0x5d0e4f[_0x2ed82d(0xdd)]++;return{'value':_0x201105[0x1],'done':![]};case 0x5:_0x5d0e4f[_0x2ed82d(0xdd)]++,_0x41c11b=_0x201105[0x1],_0x201105=[0x0];continue;case 0x7:_0x201105=_0x5d0e4f[_0x2ed82d(0xd9)][_0x2ed82d(0x10e)](),_0x5d0e4f['trys']['pop']();continue;default:if(!(_0x521112=_0x5d0e4f[_0x2ed82d(0xd8)],_0x521112=_0x521112[_0x2ed82d(0xef)]>0x0&&_0x521112[_0x521112[_0x2ed82d(0xef)]-0x1])&&(_0x201105[0x0]===0x6||_0x201105[0x0]===0x2)){_0x5d0e4f=0x0;continue;}if(_0x201105[0x0]===0x3&&(!_0x521112||_0x201105[0x1]>_0x521112[0x0]&&_0x201105[0x1]<_0x521112[0x3])){_0x5d0e4f['label']=_0x201105[0x1];break;}if(_0x201105[0x0]===0x6&&_0x5d0e4f['label']<_0x521112[0x1]){_0x5d0e4f[_0x2ed82d(0xdd)]=_0x521112[0x1],_0x521112=_0x201105;break;}if(_0x521112&&_0x5d0e4f[_0x2ed82d(0xdd)]<_0x521112[0x2]){_0x5d0e4f['label']=_0x521112[0x2],_0x5d0e4f['ops']['push'](_0x201105);break;}if(_0x521112[0x2])_0x5d0e4f['ops'][_0x2ed82d(0x10e)]();_0x5d0e4f[_0x2ed82d(0xd8)][_0x2ed82d(0x10e)]();continue;}_0x201105=_0x4a6055[_0x2ed82d(0xf4)](_0x4b6118,_0x5d0e4f);}catch(_0x20c340){_0x201105=[0x6,_0x20c340],_0x41c11b=0x0;}finally{_0x2013a2=_0x521112=0x0;}if(_0x201105[0x0]&0x5)throw _0x201105[0x1];return{'value':_0x201105[0x0]?_0x201105[0x1]:void 0x0,'done':!![]};}};Object[a170_0x45cc3a(0xe2)](exports,a170_0x45cc3a(0x112),{'value':!![]}),exports[a170_0x45cc3a(0x10c)]=void 0x0;var _models_1=require('../../../models'),responses_1=require(a170_0x45cc3a(0xe1)),roles_1=require(a170_0x45cc3a(0xee)),policies_1=require('../../templates/policies');function checkDBPresent(_0x309ab1,_0x45f8eb){return __awaiter(this,void 0x0,void 0x0,function(){return __generator(this,function(_0x3c75a1){return[0x2,new Promise(function(_0x39a3e1,_0x364bf2){var _0xf33e84=a170_0x3150,_0xb59e8b=_0x309ab1[_0xf33e84(0xe6)]({})[_0xf33e84(0x10b)]();_0xb59e8b[_0xf33e84(0xf6)](function(_0x334b2d){var _0x2b8858=_0xf33e84;_0x334b2d?_0x334b2d[_0x2b8858(0xef)]>0x0?_0x45f8eb?_0x45f8eb[_0x2b8858(0xef)]===_0x334b2d[_0x2b8858(0xef)]?_0x39a3e1(!![]):_0x39a3e1(![]):_0x39a3e1(!![]):_0x39a3e1(![]):_0x364bf2(new Error(_0x2b8858(0xe3)));})['catch'](function(_0x1b138d){var _0x20efd4=_0xf33e84;_0x364bf2(new Error(''['concat'](_0x1b138d[_0x20efd4(0x110)],':\x20')[_0x20efd4(0x104)](_0x1b138d[_0x20efd4(0x103)])));});})];});});}function checkSetupStatus(_0x32e5e3,_0x1355ad,_0x5267ba){var _0x5c0534=a170_0x45cc3a,_0x400420=[checkDBPresent(_models_1[_0x5c0534(0x105)]),checkDBPresent(_models_1[_0x5c0534(0xdb)]),checkDBPresent(_models_1[_0x5c0534(0xf0)],policies_1[_0x5c0534(0xe5)]),checkDBPresent(_models_1[_0x5c0534(0xda)],roles_1[_0x5c0534(0xe5)]),checkDBPresent(_models_1['GlobalSettings']),checkDBPresent(_models_1['Scopes']),checkDBPresent(_models_1[_0x5c0534(0xde)])];Promise[_0x5c0534(0xec)](_0x400420)[_0x5c0534(0xf6)](function(_0x14a33e){var _0x14112f=_0x5c0534;_0x14a33e[_0x14112f(0xe4)](![])?(_0x1355ad['locals']['setups']=!![],_0x5267ba()):_0x1355ad[_0x14112f(0xf3)](0xc8)[_0x14112f(0xf1)]({'success':!![],'setup':!![],'message':_0x14112f(0xdf)});})[_0x5c0534(0xfc)](function(_0x310832){var _0x5810b0=_0x5c0534;(0x0,responses_1[_0x5810b0(0x10a)])(_0x1355ad,_0x310832[_0x5810b0(0x110)],_0x310832[_0x5810b0(0x103)]);});}exports[a170_0x45cc3a(0xfd)]=checkSetupStatus;function a170_0xa4df(){var _0x464130=['unAuthorized','then','return','function','iterator','Secret\x20Error','13061640oXsNWy','catch','default','2424304vtgclx','8866NTCqXp','done','9RaEJYF','env','message','concat','Credentials','locals','apply','11501736OtwztA','Generator\x20is\x20already\x20executing.','internalServerError','exec','checkSecretPass','233472VYMURc','pop','secretcheck','name','28DIUsZG','__esModule','throw','trys','ops','Roles','Frontends','138GzPTrj','label','Users','All\x20the\x20Collections\x20have\x20been\x20Setup\x20Correctly','next','../../server/responses','defineProperty','Unknown\x20Error\x20while\x20Querying\x20Collection','includes','map','find','8181765gvVfGR','x-secret-pass','value','__awaiter','headers','all','4552182sRZsPp','../../templates/roles','length','Policies','json','string','status','call'];a170_0xa4df=function(){return _0x464130;};return a170_0xa4df();}function checkSecretPass(_0x4ce241,_0x22664e,_0x128c46){var _0x5910ac=a170_0x45cc3a,_0x4ab368=process[_0x5910ac(0x102)]['SECRET'];if(_0x4ab368){var _0x522f8f=_0x4ce241[_0x5910ac(0xeb)][_0x5910ac(0xe8)];if(_0x522f8f&&typeof _0x522f8f===_0x5910ac(0xf2)){var _0x3ec75e=_0x4ab368['toLowerCase'](),_0x4f63eb=_0x522f8f['toLowerCase']();_0x4f63eb===_0x3ec75e?(_0x22664e[_0x5910ac(0x106)][_0x5910ac(0x10f)]=!![],_0x128c46()):(0x0,responses_1[_0x5910ac(0xf5)])(_0x22664e,'Header\x20Secret\x20is\x20Not\x20Matching\x20with\x20the\x20Environment\x20Secret,\x20Kindly\x20Send\x20the\x20Correct\x20Pass');}else(0x0,responses_1['badRequest'])(_0x22664e,'x-secret-pass','Request\x20Headers');}else(0x0,responses_1[_0x5910ac(0x10a)])(_0x22664e,_0x5910ac(0xfa),'No\x20Secret\x20Set\x20in\x20the\x20Environment,\x20Kindly\x20Set\x20in\x20Vars');}exports[a170_0x45cc3a(0x10c)]=checkSecretPass; \ No newline at end of file diff --git a/plugins/server/middlewares/index.js b/plugins/server/middlewares/index.js index f1a5af0..ce1dc17 100644 --- a/plugins/server/middlewares/index.js +++ b/plugins/server/middlewares/index.js @@ -1,13 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkSecretPass = exports.checkSetupStatus = exports.checkDBStatus = exports.cors = void 0; -var cors_1 = require("./cors"); -Object.defineProperty(exports, "cors", { enumerable: true, get: function () { return __importDefault(cors_1).default; } }); -var dbchecker_1 = require("./dbchecker"); -Object.defineProperty(exports, "checkDBStatus", { enumerable: true, get: function () { return __importDefault(dbchecker_1).default; } }); -var first_setup_1 = require("./first-setup"); -Object.defineProperty(exports, "checkSetupStatus", { enumerable: true, get: function () { return __importDefault(first_setup_1).default; } }); -Object.defineProperty(exports, "checkSecretPass", { enumerable: true, get: function () { return first_setup_1.checkSecretPass; } }); +'use strict';var a171_0x2c547f=a171_0x4c35;(function(_0x1f48c0,_0x36f8ea){var _0x53f4e6=a171_0x4c35,_0x4da884=_0x1f48c0();while(!![]){try{var _0x5a2ac1=-parseInt(_0x53f4e6(0x1ea))/0x1+-parseInt(_0x53f4e6(0x1f2))/0x2*(parseInt(_0x53f4e6(0x1e4))/0x3)+-parseInt(_0x53f4e6(0x1e1))/0x4+-parseInt(_0x53f4e6(0x1f3))/0x5*(-parseInt(_0x53f4e6(0x1ef))/0x6)+parseInt(_0x53f4e6(0x1ed))/0x7*(parseInt(_0x53f4e6(0x1eb))/0x8)+-parseInt(_0x53f4e6(0x1e3))/0x9+parseInt(_0x53f4e6(0x1e5))/0xa;if(_0x5a2ac1===_0x36f8ea)break;else _0x4da884['push'](_0x4da884['shift']());}catch(_0x39b9cb){_0x4da884['push'](_0x4da884['shift']());}}}(a171_0x1694,0xa66d6));var __importDefault=this&&this[a171_0x2c547f(0x1f1)]||function(_0x1bc47b){var _0x5c0b5d=a171_0x2c547f;return _0x1bc47b&&_0x1bc47b[_0x5c0b5d(0x1e7)]?_0x1bc47b:{'default':_0x1bc47b};};Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['checkSecretPass']=exports['checkSetupStatus']=exports[a171_0x2c547f(0x1ec)]=exports[a171_0x2c547f(0x1e6)]=void 0x0;var cors_1=require(a171_0x2c547f(0x1e8));Object[a171_0x2c547f(0x1ee)](exports,a171_0x2c547f(0x1e6),{'enumerable':!![],'get':function(){var _0x485eb4=a171_0x2c547f;return __importDefault(cors_1)[_0x485eb4(0x1f0)];}});function a171_0x4c35(_0x2a0272,_0x203f34){var _0x16945a=a171_0x1694();return a171_0x4c35=function(_0x4c3570,_0x4c35bd){_0x4c3570=_0x4c3570-0x1e1;var _0x4177f7=_0x16945a[_0x4c3570];return _0x4177f7;},a171_0x4c35(_0x2a0272,_0x203f34);}var dbchecker_1=require('./dbchecker');Object[a171_0x2c547f(0x1ee)](exports,a171_0x2c547f(0x1ec),{'enumerable':!![],'get':function(){return __importDefault(dbchecker_1)['default'];}});function a171_0x1694(){var _0x47e951=['checkSecretPass','1316604CNSabc','10616nfJaxx','checkDBStatus','1911sLVOBI','defineProperty','42CXujeF','default','__importDefault','138926oqwdoJ','186065vyjwds','1929800yqefGJ','checkSetupStatus','7430013FnGkZr','21uOVjOS','31697760IXjuso','cors','__esModule','./cors'];a171_0x1694=function(){return _0x47e951;};return a171_0x1694();}var first_setup_1=require('./first-setup');Object[a171_0x2c547f(0x1ee)](exports,a171_0x2c547f(0x1e2),{'enumerable':!![],'get':function(){var _0x59a210=a171_0x2c547f;return __importDefault(first_setup_1)[_0x59a210(0x1f0)];}}),Object[a171_0x2c547f(0x1ee)](exports,a171_0x2c547f(0x1e9),{'enumerable':!![],'get':function(){return first_setup_1['checkSecretPass'];}}); \ No newline at end of file diff --git a/plugins/server/responses/2XX-response.js b/plugins/server/responses/2XX-response.js index 0c3cfec..8e1acea 100644 --- a/plugins/server/responses/2XX-response.js +++ b/plugins/server/responses/2XX-response.js @@ -1,21 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.okResponse = void 0; -var send_response_1 = __importDefault(require("../helpers/send-response")); -/** - * Send a OK Response to Client with Data - * - * @param {Response} res - Express Response Object - * @param {object} data - Data to be Sent to Client - */ -function okResponse(res, data) { - var result = { - status: 200, - data: data, - }; - (0, send_response_1.default)(res, 200, result); -} -exports.okResponse = okResponse; +'use strict';var a172_0x359d07=a172_0x521d;(function(_0x4293a9,_0x367f4e){var _0x2e1fb1=a172_0x521d,_0x1818d8=_0x4293a9();while(!![]){try{var _0x36be4a=parseInt(_0x2e1fb1(0x127))/0x1*(parseInt(_0x2e1fb1(0x123))/0x2)+-parseInt(_0x2e1fb1(0x11d))/0x3*(-parseInt(_0x2e1fb1(0x118))/0x4)+parseInt(_0x2e1fb1(0x119))/0x5*(parseInt(_0x2e1fb1(0x11e))/0x6)+parseInt(_0x2e1fb1(0x125))/0x7+parseInt(_0x2e1fb1(0x11a))/0x8+-parseInt(_0x2e1fb1(0x11c))/0x9+-parseInt(_0x2e1fb1(0x122))/0xa*(parseInt(_0x2e1fb1(0x11f))/0xb);if(_0x36be4a===_0x367f4e)break;else _0x1818d8['push'](_0x1818d8['shift']());}catch(_0x3a766a){_0x1818d8['push'](_0x1818d8['shift']());}}}(a172_0x2ac5,0xc2fa7));var __importDefault=this&&this[a172_0x359d07(0x121)]||function(_0x26d836){return _0x26d836&&_0x26d836['__esModule']?_0x26d836:{'default':_0x26d836};};function a172_0x521d(_0x537547,_0xfeacaa){var _0x2ac55b=a172_0x2ac5();return a172_0x521d=function(_0x521d58,_0x54fb7d){_0x521d58=_0x521d58-0x118;var _0x4a128e=_0x2ac55b[_0x521d58];return _0x4a128e;},a172_0x521d(_0x537547,_0xfeacaa);}function a172_0x2ac5(){var _0x124b1b=['__importDefault','2710EivICC','641806lWzpVe','../helpers/send-response','131033zGitsi','okResponse','3BVzShw','__esModule','16IfmXZW','658255jnZFXk','3165448VilfNT','default','11382750oPlpxe','631614wZVINM','6SRdbzz','11671Cxgujk','defineProperty'];a172_0x2ac5=function(){return _0x124b1b;};return a172_0x2ac5();}Object[a172_0x359d07(0x120)](exports,a172_0x359d07(0x128),{'value':!![]}),exports['okResponse']=void 0x0;var send_response_1=__importDefault(require(a172_0x359d07(0x124)));function okResponse(_0x223947,_0x4861ff){var _0x587bcb=a172_0x359d07,_0x497c52={'status':0xc8,'data':_0x4861ff};(0x0,send_response_1[_0x587bcb(0x11b)])(_0x223947,0xc8,_0x497c52);}exports[a172_0x359d07(0x126)]=okResponse; \ No newline at end of file diff --git a/plugins/server/responses/4XX-response.js b/plugins/server/responses/4XX-response.js index 859897f..5389eda 100644 --- a/plugins/server/responses/4XX-response.js +++ b/plugins/server/responses/4XX-response.js @@ -1,53 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.notFound = exports.unAuthorized = exports.badRequest = void 0; -var send_response_1 = __importDefault(require("../helpers/send-response")); -/** - * Send a Bad Request Response to Client - * - * @param {Response} res - Express Response Object - * @param {string} expected - Expected Data which is Missing - * @param {string} inData - Missing Data in Heirarchy - */ -function badRequest(res, expected, inData) { - var result = { - status: 400, - errorname: 'Bad Request', - message: "Expected ".concat(expected, " in ").concat(inData), - }; - (0, send_response_1.default)(res, 400, result); -} -exports.badRequest = badRequest; -/** - * Send a Unauthorized Response to Client - * - * @param {Response} res - Express Response Object - * @param {string} message - Message to be Sent along with Unauthorized Response - */ -function unAuthorized(res, message) { - var result = { - status: 403, - errorname: 'UnAuthorized', - message: message, - }; - (0, send_response_1.default)(res, 400, result); -} -exports.unAuthorized = unAuthorized; -/** - * Send a 404 Not Found Response to Client - * - * @param {Response} res - Express Response Object - * @param {string} message - Message to be Sent along with Not Found Response - */ -function notFound(res, message) { - var result = { - status: 404, - errorname: 'Not Found', - message: message, - }; - (0, send_response_1.default)(res, 400, result); -} -exports.notFound = notFound; +'use strict';var a173_0x1cd422=a173_0x504d;(function(_0x3a7583,_0x191300){var _0x79ba79=a173_0x504d,_0x292697=_0x3a7583();while(!![]){try{var _0x4a4d05=parseInt(_0x79ba79(0x88))/0x1+parseInt(_0x79ba79(0x83))/0x2*(-parseInt(_0x79ba79(0x7c))/0x3)+-parseInt(_0x79ba79(0x79))/0x4*(parseInt(_0x79ba79(0x7e))/0x5)+parseInt(_0x79ba79(0x87))/0x6*(-parseInt(_0x79ba79(0x89))/0x7)+parseInt(_0x79ba79(0x85))/0x8+parseInt(_0x79ba79(0x77))/0x9+-parseInt(_0x79ba79(0x82))/0xa;if(_0x4a4d05===_0x191300)break;else _0x292697['push'](_0x292697['shift']());}catch(_0x5f126d){_0x292697['push'](_0x292697['shift']());}}}(a173_0x2744,0x52bd0));function a173_0x2744(){var _0x184f83=['4KIWgPq','defineProperty','unAuthorized','3PvOdvG','concat','1374965cHWNMN','badRequest','Expected\x20','default','1005690cbYhQY','36746GEfdhK','__importDefault','4664632XSnfSH','Not\x20Found','2874wdlner','270051DKVigY','9793KEBJRU','../helpers/send-response','\x20in\x20','notFound','4948398zfiSbW','UnAuthorized'];a173_0x2744=function(){return _0x184f83;};return a173_0x2744();}var __importDefault=this&&this[a173_0x1cd422(0x84)]||function(_0x585ad2){return _0x585ad2&&_0x585ad2['__esModule']?_0x585ad2:{'default':_0x585ad2};};Object[a173_0x1cd422(0x7a)](exports,'__esModule',{'value':!![]}),exports['notFound']=exports[a173_0x1cd422(0x7b)]=exports[a173_0x1cd422(0x7f)]=void 0x0;var send_response_1=__importDefault(require(a173_0x1cd422(0x74)));function badRequest(_0x13446b,_0x2b1057,_0x37dc57){var _0x19c931=a173_0x1cd422,_0x1ffea0={'status':0x190,'errorname':'Bad\x20Request','message':_0x19c931(0x80)['concat'](_0x2b1057,_0x19c931(0x75))[_0x19c931(0x7d)](_0x37dc57)};(0x0,send_response_1[_0x19c931(0x81)])(_0x13446b,0x190,_0x1ffea0);}function a173_0x504d(_0x245c57,_0x3faf0a){var _0x2744ba=a173_0x2744();return a173_0x504d=function(_0x504dbb,_0x2288ca){_0x504dbb=_0x504dbb-0x74;var _0x3ac009=_0x2744ba[_0x504dbb];return _0x3ac009;},a173_0x504d(_0x245c57,_0x3faf0a);}exports[a173_0x1cd422(0x7f)]=badRequest;function unAuthorized(_0x31dae2,_0x5dc90a){var _0x33d978=a173_0x1cd422,_0x26c98a={'status':0x193,'errorname':_0x33d978(0x78),'message':_0x5dc90a};(0x0,send_response_1[_0x33d978(0x81)])(_0x31dae2,0x190,_0x26c98a);}exports[a173_0x1cd422(0x7b)]=unAuthorized;function notFound(_0x48d980,_0x486ad0){var _0x3e6c05=a173_0x1cd422,_0x560ffc={'status':0x194,'errorname':_0x3e6c05(0x86),'message':_0x486ad0};(0x0,send_response_1['default'])(_0x48d980,0x190,_0x560ffc);}exports[a173_0x1cd422(0x76)]=notFound; \ No newline at end of file diff --git a/plugins/server/responses/5XX-response.js b/plugins/server/responses/5XX-response.js index bf30d2d..82be4cb 100644 --- a/plugins/server/responses/5XX-response.js +++ b/plugins/server/responses/5XX-response.js @@ -1,37 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.badGateway = exports.internalServerError = void 0; -var send_response_1 = __importDefault(require("../helpers/send-response")); -/** - * Send a Internal Server Error Response to the Client - * - * @param {Response} res - Express Response Object - * @param {string} [errorname] Message to be Sent along with 5XX Response (Optional) - * @param {string} [message] - Error Data to be Sent (Optional) - */ -function internalServerError(res, errorname, message) { - var result = { - status: 500, - errorname: errorname ? errorname : 'Internal Server Error', - message: message ? message : 'Unknown', - }; - (0, send_response_1.default)(res, 500, result); -} -exports.internalServerError = internalServerError; -/** - * Send a Bad Gateway Error Response to Client - * - * @param {Response} res - Express Response Object - */ -function badGateway(res) { - var result = { - status: 502, - errorname: 'Bad Gateway', - message: 'Received an Invalid response from the upstream server.', - }; - (0, send_response_1.default)(res, 502, result); -} -exports.badGateway = badGateway; +'use strict';var a174_0x2e9321=a174_0x3569;(function(_0x1e6e17,_0x10833a){var _0x42bd8a=a174_0x3569,_0x5ab4b0=_0x1e6e17();while(!![]){try{var _0x929790=-parseInt(_0x42bd8a(0xd9))/0x1*(-parseInt(_0x42bd8a(0xd7))/0x2)+parseInt(_0x42bd8a(0xe3))/0x3+-parseInt(_0x42bd8a(0xe1))/0x4+parseInt(_0x42bd8a(0xdc))/0x5+-parseInt(_0x42bd8a(0xe2))/0x6+parseInt(_0x42bd8a(0xd4))/0x7+-parseInt(_0x42bd8a(0xe0))/0x8;if(_0x929790===_0x10833a)break;else _0x5ab4b0['push'](_0x5ab4b0['shift']());}catch(_0x5be827){_0x5ab4b0['push'](_0x5ab4b0['shift']());}}}(a174_0x4cdd,0xa4097));function a174_0x4cdd(){var _0x1aef99=['66dxwhwQ','Unknown','38523BjLzgV','defineProperty','Received\x20an\x20Invalid\x20response\x20from\x20the\x20upstream\x20server.','6003890WglcXt','badGateway','Bad\x20Gateway','Internal\x20Server\x20Error','10847776vouLfT','1432476IJKizy','8058030HndyNB','1738344dXnZzv','4742542BJItQn','default','internalServerError'];a174_0x4cdd=function(){return _0x1aef99;};return a174_0x4cdd();}var __importDefault=this&&this['__importDefault']||function(_0x533049){return _0x533049&&_0x533049['__esModule']?_0x533049:{'default':_0x533049};};Object[a174_0x2e9321(0xda)](exports,'__esModule',{'value':!![]}),exports[a174_0x2e9321(0xdd)]=exports[a174_0x2e9321(0xd6)]=void 0x0;var send_response_1=__importDefault(require('../helpers/send-response'));function a174_0x3569(_0x3339d1,_0x479834){var _0x4cddb3=a174_0x4cdd();return a174_0x3569=function(_0x3569e6,_0x291779){_0x3569e6=_0x3569e6-0xd4;var _0x55f527=_0x4cddb3[_0x3569e6];return _0x55f527;},a174_0x3569(_0x3339d1,_0x479834);}function internalServerError(_0xf87ed5,_0x454ec0,_0x7e3453){var _0x120765=a174_0x2e9321,_0xe926b6={'status':0x1f4,'errorname':_0x454ec0?_0x454ec0:_0x120765(0xdf),'message':_0x7e3453?_0x7e3453:_0x120765(0xd8)};(0x0,send_response_1[_0x120765(0xd5)])(_0xf87ed5,0x1f4,_0xe926b6);}exports[a174_0x2e9321(0xd6)]=internalServerError;function badGateway(_0x48c49f){var _0x4d3e7b=a174_0x2e9321,_0xb8502e={'status':0x1f6,'errorname':_0x4d3e7b(0xde),'message':_0x4d3e7b(0xdb)};(0x0,send_response_1[_0x4d3e7b(0xd5)])(_0x48c49f,0x1f6,_0xb8502e);}exports[a174_0x2e9321(0xdd)]=badGateway; \ No newline at end of file diff --git a/plugins/server/responses/index.js b/plugins/server/responses/index.js index a6f9d38..47b79df 100644 --- a/plugins/server/responses/index.js +++ b/plugins/server/responses/index.js @@ -1,12 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.badGateway = exports.internalServerError = exports.notFound = exports.unAuthorized = exports.badRequest = exports.okResponse = void 0; -var _2XX_response_1 = require("./2XX-response"); -Object.defineProperty(exports, "okResponse", { enumerable: true, get: function () { return _2XX_response_1.okResponse; } }); -var _4XX_response_1 = require("./4XX-response"); -Object.defineProperty(exports, "badRequest", { enumerable: true, get: function () { return _4XX_response_1.badRequest; } }); -Object.defineProperty(exports, "unAuthorized", { enumerable: true, get: function () { return _4XX_response_1.unAuthorized; } }); -Object.defineProperty(exports, "notFound", { enumerable: true, get: function () { return _4XX_response_1.notFound; } }); -var _5XX_response_1 = require("./5XX-response"); -Object.defineProperty(exports, "internalServerError", { enumerable: true, get: function () { return _5XX_response_1.internalServerError; } }); -Object.defineProperty(exports, "badGateway", { enumerable: true, get: function () { return _5XX_response_1.badGateway; } }); +'use strict';var a175_0x53c0e3=a175_0x2512;(function(_0x2c08ee,_0x50bd5d){var _0x2bb772=a175_0x2512,_0x2a71e4=_0x2c08ee();while(!![]){try{var _0x1b29df=parseInt(_0x2bb772(0xa1))/0x1*(parseInt(_0x2bb772(0xa4))/0x2)+parseInt(_0x2bb772(0xa6))/0x3+-parseInt(_0x2bb772(0xa3))/0x4+-parseInt(_0x2bb772(0xa9))/0x5+-parseInt(_0x2bb772(0x9c))/0x6+parseInt(_0x2bb772(0x9f))/0x7+parseInt(_0x2bb772(0x9d))/0x8;if(_0x1b29df===_0x50bd5d)break;else _0x2a71e4['push'](_0x2a71e4['shift']());}catch(_0x1c56e5){_0x2a71e4['push'](_0x2a71e4['shift']());}}}(a175_0x1198,0x3c8d6));function a175_0x1198(){var _0x1364cb=['1984746FtHiUZ','2512320soFQUG','defineProperty','2964472RCfJyu','internalServerError','2BHZAMo','badRequest','670040XjSbhA','37382fWvEff','./5XX-response','1253994CiqWnH','notFound','badGateway','2232965gUREbt','unAuthorized','__esModule'];a175_0x1198=function(){return _0x1364cb;};return a175_0x1198();}function a175_0x2512(_0x4cbf1d,_0x33ee94){var _0x1198d4=a175_0x1198();return a175_0x2512=function(_0x251219,_0x420dbf){_0x251219=_0x251219-0x9c;var _0x3e4d6d=_0x1198d4[_0x251219];return _0x3e4d6d;},a175_0x2512(_0x4cbf1d,_0x33ee94);}Object[a175_0x53c0e3(0x9e)](exports,a175_0x53c0e3(0xab),{'value':!![]}),exports[a175_0x53c0e3(0xa8)]=exports[a175_0x53c0e3(0xa0)]=exports[a175_0x53c0e3(0xa7)]=exports['unAuthorized']=exports[a175_0x53c0e3(0xa2)]=exports['okResponse']=void 0x0;var _2XX_response_1=require('./2XX-response');Object[a175_0x53c0e3(0x9e)](exports,'okResponse',{'enumerable':!![],'get':function(){return _2XX_response_1['okResponse'];}});var _4XX_response_1=require('./4XX-response');Object[a175_0x53c0e3(0x9e)](exports,a175_0x53c0e3(0xa2),{'enumerable':!![],'get':function(){var _0x34ddde=a175_0x53c0e3;return _4XX_response_1[_0x34ddde(0xa2)];}}),Object['defineProperty'](exports,'unAuthorized',{'enumerable':!![],'get':function(){var _0x25ccb2=a175_0x53c0e3;return _4XX_response_1[_0x25ccb2(0xaa)];}}),Object[a175_0x53c0e3(0x9e)](exports,'notFound',{'enumerable':!![],'get':function(){var _0x5623c0=a175_0x53c0e3;return _4XX_response_1[_0x5623c0(0xa7)];}});var _5XX_response_1=require(a175_0x53c0e3(0xa5));Object[a175_0x53c0e3(0x9e)](exports,'internalServerError',{'enumerable':!![],'get':function(){return _5XX_response_1['internalServerError'];}}),Object['defineProperty'](exports,'badGateway',{'enumerable':!![],'get':function(){var _0x2e49c6=a175_0x53c0e3;return _5XX_response_1[_0x2e49c6(0xa8)];}}); \ No newline at end of file diff --git a/plugins/server/server.js b/plugins/server/server.js index 1c7c3eb..77825ea 100644 --- a/plugins/server/server.js +++ b/plugins/server/server.js @@ -1,29 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var http_1 = __importDefault(require("http")); -var express_1 = __importDefault(require("express")); -var helmet_1 = __importDefault(require("helmet")); -var express_mongo_sanitize_1 = __importDefault(require("express-mongo-sanitize")); -var x_xss_protection_1 = __importDefault(require("x-xss-protection")); -// Middlewares -var dbchecker_1 = __importDefault(require("../server/middlewares/dbchecker")); -var cors_1 = __importDefault(require("../server/middlewares/cors")); -// Router -var _routes_1 = __importDefault(require("../../routes")); -// Express config -var app = (0, express_1.default)(); -app.use(express_1.default.json({ limit: '50kb' })); -app.use((0, helmet_1.default)()); -app.use((0, x_xss_protection_1.default)()); -app.use((0, express_mongo_sanitize_1.default)()); -app.use([dbchecker_1.default, cors_1.default]); -// Use the Router Config from Routes -app.use('/', _routes_1.default); -// Create http server from express -var server = http_1.default.createServer(app); -// Export Server -exports.default = server; +'use strict';var a176_0x190dc6=a176_0xbfde;(function(_0x3f3c9e,_0x2516e7){var _0xdbac54=a176_0xbfde,_0x330b19=_0x3f3c9e();while(!![]){try{var _0x33792e=-parseInt(_0xdbac54(0x154))/0x1+-parseInt(_0xdbac54(0x149))/0x2+parseInt(_0xdbac54(0x153))/0x3+-parseInt(_0xdbac54(0x159))/0x4*(-parseInt(_0xdbac54(0x15b))/0x5)+-parseInt(_0xdbac54(0x14f))/0x6+parseInt(_0xdbac54(0x14e))/0x7*(-parseInt(_0xdbac54(0x15a))/0x8)+parseInt(_0xdbac54(0x14c))/0x9;if(_0x33792e===_0x2516e7)break;else _0x330b19['push'](_0x330b19['shift']());}catch(_0x565d9e){_0x330b19['push'](_0x330b19['shift']());}}}(a176_0x5bfb,0xddb32));var __importDefault=this&&this[a176_0x190dc6(0x148)]||function(_0x45d48a){var _0x48af10=a176_0x190dc6;return _0x45d48a&&_0x45d48a[_0x48af10(0x14b)]?_0x45d48a:{'default':_0x45d48a};};function a176_0x5bfb(){var _0x39ecf5=['default','__esModule','15056415lcXngM','createServer','21LhxvWg','962508kMnhLE','../server/middlewares/cors','../../routes','http','3801156frlBWC','161853xBsYAb','x-xss-protection','50kb','express','use','3311896EpkFLY','1957512hZHWvA','5EXUaAI','defineProperty','__importDefault','3607082UarDVB'];a176_0x5bfb=function(){return _0x39ecf5;};return a176_0x5bfb();}Object[a176_0x190dc6(0x147)](exports,a176_0x190dc6(0x14b),{'value':!![]});var http_1=__importDefault(require(a176_0x190dc6(0x152))),express_1=__importDefault(require(a176_0x190dc6(0x157))),helmet_1=__importDefault(require('helmet')),express_mongo_sanitize_1=__importDefault(require('express-mongo-sanitize')),x_xss_protection_1=__importDefault(require(a176_0x190dc6(0x155))),dbchecker_1=__importDefault(require('../server/middlewares/dbchecker')),cors_1=__importDefault(require(a176_0x190dc6(0x150))),_routes_1=__importDefault(require(a176_0x190dc6(0x151))),app=(0x0,express_1[a176_0x190dc6(0x14a)])();function a176_0xbfde(_0x295260,_0x17ffa6){var _0x5bfb15=a176_0x5bfb();return a176_0xbfde=function(_0xbfdefb,_0x174388){_0xbfdefb=_0xbfdefb-0x147;var _0x34b892=_0x5bfb15[_0xbfdefb];return _0x34b892;},a176_0xbfde(_0x295260,_0x17ffa6);}app[a176_0x190dc6(0x158)](express_1['default']['json']({'limit':a176_0x190dc6(0x156)})),app[a176_0x190dc6(0x158)]((0x0,helmet_1[a176_0x190dc6(0x14a)])()),app['use']((0x0,x_xss_protection_1[a176_0x190dc6(0x14a)])()),app['use']((0x0,express_mongo_sanitize_1[a176_0x190dc6(0x14a)])()),app[a176_0x190dc6(0x158)]([dbchecker_1[a176_0x190dc6(0x14a)],cors_1[a176_0x190dc6(0x14a)]]),app[a176_0x190dc6(0x158)]('/',_routes_1[a176_0x190dc6(0x14a)]);var server=http_1[a176_0x190dc6(0x14a)][a176_0x190dc6(0x14d)](app);exports['default']=server; \ No newline at end of file diff --git a/plugins/templates/global-settings/index.js b/plugins/templates/global-settings/index.js index 97054ef..8ba5d56 100644 --- a/plugins/templates/global-settings/index.js +++ b/plugins/templates/global-settings/index.js @@ -1,70 +1 @@ -"use strict"; -/** - * @file Global Settings Definition File - * @description Describes different Global Settings for the Organisation - * @author Sudharshan TK - * - * Note: This Will be used only at the time of First Setup - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.defaultSmtpMailer = exports.defaultSmtpProvider = exports.maxSessions = exports.otpVerification = exports.mailing = exports.tmdbFlag = exports.upgradeRequests = exports.userRequests = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("settings@".concat(num)); }; -var userRequests = function (flag) { return ({ - _id: objectID('001'), - name: 'Allow User Requests', - message: 'Enable New User Requests Globally', - global_flag: flag, -}); }; -exports.userRequests = userRequests; -var upgradeRequests = function (flag) { return ({ - _id: objectID('002'), - name: 'Allow Role Upgrade Requests', - message: 'Enable Existing User Role Upgrade Requests Globally', - global_flag: flag, -}); }; -exports.upgradeRequests = upgradeRequests; -var tmdbFlag = function (flag) { return ({ - _id: objectID('003'), - name: 'Allow TMDB Metadata', - message: 'Enable TMDB Api for Fetching Metadata Globally', - global_flag: flag, -}); }; -exports.tmdbFlag = tmdbFlag; -var mailing = function (flag) { return ({ - _id: objectID('004'), - name: 'Allow Mailing', - message: 'Enable Mailing of User Requests, Invites, etc.', - global_flag: flag, -}); }; -exports.mailing = mailing; -var otpVerification = function (flag) { return ({ - _id: objectID('005'), - name: 'Allow OTP Verify', - message: 'Require OTP Verification of New Users', - global_flag: flag, -}); }; -exports.otpVerification = otpVerification; -var maxSessions = function (sessions) { return ({ - _id: objectID('006'), - name: 'Allow OTP Verify', - message: 'Require OTP Verification of New Users', - global_flag: sessions, -}); }; -exports.maxSessions = maxSessions; -var defaultSmtpProvider = function (provider_id) { return ({ - _id: objectID('007'), - name: 'Allow OTP Verify', - message: 'Require OTP Verification of New Users', - global_flag: provider_id, - reference: 'SMTPProvider', -}); }; -exports.defaultSmtpProvider = defaultSmtpProvider; -var defaultSmtpMailer = function (mailer_id) { return ({ - _id: objectID('008'), - name: 'Allow OTP Verify', - message: 'Require OTP Verification of New Users', - global_flag: mailer_id, - reference: 'SMTPMailer', -}); }; -exports.defaultSmtpMailer = defaultSmtpMailer; +'use strict';var a177_0xc0a7ce=a177_0x122d;(function(_0x2ba861,_0x6918a7){var _0x46f225=a177_0x122d,_0x20595e=_0x2ba861();while(!![]){try{var _0x3a438f=parseInt(_0x46f225(0x1a0))/0x1*(-parseInt(_0x46f225(0x1ae))/0x2)+-parseInt(_0x46f225(0x1a4))/0x3+parseInt(_0x46f225(0x1b0))/0x4*(-parseInt(_0x46f225(0x1ac))/0x5)+parseInt(_0x46f225(0x1a3))/0x6*(-parseInt(_0x46f225(0x197))/0x7)+parseInt(_0x46f225(0x194))/0x8*(-parseInt(_0x46f225(0x1a5))/0x9)+-parseInt(_0x46f225(0x191))/0xa*(-parseInt(_0x46f225(0x198))/0xb)+parseInt(_0x46f225(0x195))/0xc*(parseInt(_0x46f225(0x1b3))/0xd);if(_0x3a438f===_0x6918a7)break;else _0x20595e['push'](_0x20595e['shift']());}catch(_0x476f11){_0x20595e['push'](_0x20595e['shift']());}}}(a177_0x3010,0x43f26));Object[a177_0xc0a7ce(0x1a6)](exports,a177_0xc0a7ce(0x18f),{'value':!![]}),exports[a177_0xc0a7ce(0x1a1)]=exports['defaultSmtpProvider']=exports['maxSessions']=exports['otpVerification']=exports[a177_0xc0a7ce(0x19b)]=exports[a177_0xc0a7ce(0x1a2)]=exports[a177_0xc0a7ce(0x1b1)]=exports[a177_0xc0a7ce(0x1aa)]=void 0x0;var mongoose_1=require('mongoose'),objectID=function(_0x43e28f){var _0xdde368=a177_0xc0a7ce;return mongoose_1[_0xdde368(0x193)][_0xdde368(0x190)]('settings@'[_0xdde368(0x1ab)](_0x43e28f));},userRequests=function(_0x17c321){var _0x4d4a10=a177_0xc0a7ce;return{'_id':objectID('001'),'name':_0x4d4a10(0x1a8),'message':'Enable\x20New\x20User\x20Requests\x20Globally','global_flag':_0x17c321};};exports[a177_0xc0a7ce(0x1aa)]=userRequests;var upgradeRequests=function(_0x1348b7){var _0x9892ad=a177_0xc0a7ce;return{'_id':objectID('002'),'name':_0x9892ad(0x19f),'message':_0x9892ad(0x1af),'global_flag':_0x1348b7};};exports[a177_0xc0a7ce(0x1b1)]=upgradeRequests;var tmdbFlag=function(_0x26f9b4){var _0x4d7ad8=a177_0xc0a7ce;return{'_id':objectID('003'),'name':'Allow\x20TMDB\x20Metadata','message':_0x4d7ad8(0x19d),'global_flag':_0x26f9b4};};exports[a177_0xc0a7ce(0x1a2)]=tmdbFlag;var mailing=function(_0x40b038){var _0x3d19ba=a177_0xc0a7ce;return{'_id':objectID(_0x3d19ba(0x192)),'name':'Allow\x20Mailing','message':'Enable\x20Mailing\x20of\x20User\x20Requests,\x20Invites,\x20etc.','global_flag':_0x40b038};};function a177_0x3010(){var _0x597850=['Allow\x20Role\x20Upgrade\x20Requests','1TVfHsl','defaultSmtpMailer','tmdbFlag','66tYTCah','361089wZzGNU','9ptQiPD','defineProperty','defaultSmtpProvider','Allow\x20User\x20Requests','008','userRequests','concat','692455dSDjKq','005','744382aXCRWw','Enable\x20Existing\x20User\x20Role\x20Upgrade\x20Requests\x20Globally','4QKYNQw','upgradeRequests','Allow\x20OTP\x20Verify','9283729ZrNAWu','__esModule','ObjectId','30rtuxzk','004','Types','1089064HOQDmU','12eKfALq','Require\x20OTP\x20Verification\x20of\x20New\x20Users','30254RXyokn','1389289CLIIEa','otpVerification','007','mailing','SMTPMailer','Enable\x20TMDB\x20Api\x20for\x20Fetching\x20Metadata\x20Globally','006'];a177_0x3010=function(){return _0x597850;};return a177_0x3010();}exports[a177_0xc0a7ce(0x19b)]=mailing;var otpVerification=function(_0x1c163a){var _0x2c6982=a177_0xc0a7ce;return{'_id':objectID(_0x2c6982(0x1ad)),'name':_0x2c6982(0x1b2),'message':_0x2c6982(0x196),'global_flag':_0x1c163a};};exports[a177_0xc0a7ce(0x199)]=otpVerification;var maxSessions=function(_0x1f86ce){var _0x4f9481=a177_0xc0a7ce;return{'_id':objectID(_0x4f9481(0x19e)),'name':_0x4f9481(0x1b2),'message':'Require\x20OTP\x20Verification\x20of\x20New\x20Users','global_flag':_0x1f86ce};};exports['maxSessions']=maxSessions;var defaultSmtpProvider=function(_0x14507d){var _0x3786c1=a177_0xc0a7ce;return{'_id':objectID(_0x3786c1(0x19a)),'name':_0x3786c1(0x1b2),'message':_0x3786c1(0x196),'global_flag':_0x14507d,'reference':'SMTPProvider'};};exports[a177_0xc0a7ce(0x1a7)]=defaultSmtpProvider;var defaultSmtpMailer=function(_0x48bca7){var _0x275534=a177_0xc0a7ce;return{'_id':objectID(_0x275534(0x1a9)),'name':'Allow\x20OTP\x20Verify','message':_0x275534(0x196),'global_flag':_0x48bca7,'reference':_0x275534(0x19c)};};function a177_0x122d(_0x52afdc,_0x290110){var _0x3010d3=a177_0x3010();return a177_0x122d=function(_0x122dba,_0x4f6b0e){_0x122dba=_0x122dba-0x18f;var _0x38e6a3=_0x3010d3[_0x122dba];return _0x38e6a3;},a177_0x122d(_0x52afdc,_0x290110);}exports[a177_0xc0a7ce(0x1a1)]=defaultSmtpMailer; \ No newline at end of file diff --git a/plugins/templates/policies/credentials/index.js b/plugins/templates/policies/credentials/index.js index 4b3cb7e..a836841 100644 --- a/plugins/templates/policies/credentials/index.js +++ b/plugins/templates/policies/credentials/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.creds_add, - edit: policies_1.creds_edit, - remove: policies_1.creds_rm, -}; -exports.map = [policies_1.creds_add, policies_1.creds_edit, policies_1.creds_rm]; +'use strict';function a178_0x53a0(_0x1d4ad6,_0x5a1bba){var _0x386eef=a178_0x386e();return a178_0x53a0=function(_0x53a0e6,_0xf4f792){_0x53a0e6=_0x53a0e6-0x87;var _0x321bef=_0x386eef[_0x53a0e6];return _0x321bef;},a178_0x53a0(_0x1d4ad6,_0x5a1bba);}var a178_0x5dd9a7=a178_0x53a0;(function(_0x1ea06e,_0x9350ed){var _0x1c0713=a178_0x53a0,_0x4e3e1c=_0x1ea06e();while(!![]){try{var _0x5467da=-parseInt(_0x1c0713(0x92))/0x1+-parseInt(_0x1c0713(0x97))/0x2+-parseInt(_0x1c0713(0x8e))/0x3*(parseInt(_0x1c0713(0x90))/0x4)+parseInt(_0x1c0713(0x93))/0x5+parseInt(_0x1c0713(0x8b))/0x6+-parseInt(_0x1c0713(0x87))/0x7*(-parseInt(_0x1c0713(0x94))/0x8)+parseInt(_0x1c0713(0x95))/0x9;if(_0x5467da===_0x9350ed)break;else _0x4e3e1c['push'](_0x4e3e1c['shift']());}catch(_0x28bee6){_0x4e3e1c['push'](_0x4e3e1c['shift']());}}}(a178_0x386e,0x53451));function a178_0x386e(){var _0x21882b=['1085100rHQFiW','map','default','9LtsVER','./policies','20HqOEHg','creds_add','380943FxtZaU','985415JeXgAP','8CBKuRt','2335779uaQFSU','creds_rm','1095908qCnbAw','4427647eLUeOa','__esModule','defineProperty','creds_edit'];a178_0x386e=function(){return _0x21882b;};return a178_0x386e();}Object[a178_0x5dd9a7(0x89)](exports,a178_0x5dd9a7(0x88),{'value':!![]}),exports[a178_0x5dd9a7(0x8c)]=void 0x0;var policies_1=require(a178_0x5dd9a7(0x8f));exports[a178_0x5dd9a7(0x8d)]={'add':policies_1[a178_0x5dd9a7(0x91)],'edit':policies_1[a178_0x5dd9a7(0x8a)],'remove':policies_1[a178_0x5dd9a7(0x96)]},exports[a178_0x5dd9a7(0x8c)]=[policies_1['creds_add'],policies_1[a178_0x5dd9a7(0x8a)],policies_1[a178_0x5dd9a7(0x96)]]; \ No newline at end of file diff --git a/plugins/templates/policies/credentials/policies.js b/plugins/templates/policies/credentials/policies.js index 2b91910..3e14a31 100644 --- a/plugins/templates/policies/credentials/policies.js +++ b/plugins/templates/policies/credentials/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying Credentials - * @module - Credentials - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.creds_rm = exports.creds_edit = exports.creds_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-cred@".concat(num)); }; -exports.creds_add = { - _id: objectID('001'), - name: 'Add Credentials to DB', - message: 'Enable Adding of Credentials from Database', - global_flag: true, -}; -exports.creds_edit = { - _id: objectID('002'), - name: 'Edit Credentials in DB', - message: 'Enable Editing of Credentials from Database', - global_flag: true, -}; -exports.creds_rm = { - _id: objectID('003'), - name: 'Remove Credentials from DB', - message: 'Enable Removal of Credentials from Database', - global_flag: true, -}; +'use strict';function a179_0x5b1c(_0x1a7ee2,_0x24f90e){var _0x34dc8b=a179_0x34dc();return a179_0x5b1c=function(_0x5b1cc7,_0x5b5c2a){_0x5b1cc7=_0x5b1cc7-0xe2;var _0x2ee6df=_0x34dc8b[_0x5b1cc7];return _0x2ee6df;},a179_0x5b1c(_0x1a7ee2,_0x24f90e);}function a179_0x34dc(){var _0x113369=['defineProperty','Enable\x20Adding\x20of\x20Credentials\x20from\x20Database','26247oLByNl','3003476JULWHj','1423090BuImDb','creds_add','4fEnItB','creds_edit','mongoose','__esModule','concat','ObjectId','002','Enable\x20Removal\x20of\x20Credentials\x20from\x20Database','3932896PDMWIL','creds_rm','Types','99yCqIDX','1323198sXfwiE','5967485iuSfhZ','1768161idXWjN','Edit\x20Credentials\x20in\x20DB','4xRqwDp'];a179_0x34dc=function(){return _0x113369;};return a179_0x34dc();}var a179_0x4f21f4=a179_0x5b1c;(function(_0x5c9dd2,_0x5ce7ee){var _0x42fbe5=a179_0x5b1c,_0x129345=_0x5c9dd2();while(!![]){try{var _0x4e0822=-parseInt(_0x42fbe5(0xe8))/0x1+parseInt(_0x42fbe5(0xec))/0x2*(parseInt(_0x42fbe5(0xe3))/0x3)+-parseInt(_0x42fbe5(0xe5))/0x4*(-parseInt(_0x42fbe5(0xe2))/0x5)+-parseInt(_0x42fbe5(0xf8))/0x6+-parseInt(_0x42fbe5(0xe9))/0x7+parseInt(_0x42fbe5(0xf4))/0x8+parseInt(_0x42fbe5(0xf7))/0x9*(-parseInt(_0x42fbe5(0xea))/0xa);if(_0x4e0822===_0x5ce7ee)break;else _0x129345['push'](_0x129345['shift']());}catch(_0x5a440d){_0x129345['push'](_0x129345['shift']());}}}(a179_0x34dc,0x9802c));Object[a179_0x4f21f4(0xe6)](exports,a179_0x4f21f4(0xef),{'value':!![]}),exports[a179_0x4f21f4(0xf5)]=exports[a179_0x4f21f4(0xed)]=exports[a179_0x4f21f4(0xeb)]=void 0x0;var mongoose_1=require(a179_0x4f21f4(0xee)),objectID=function(_0x4b0296){var _0x2b7dce=a179_0x4f21f4;return mongoose_1[_0x2b7dce(0xf6)][_0x2b7dce(0xf1)]('pol-cred@'[_0x2b7dce(0xf0)](_0x4b0296));};exports[a179_0x4f21f4(0xeb)]={'_id':objectID('001'),'name':'Add\x20Credentials\x20to\x20DB','message':a179_0x4f21f4(0xe7),'global_flag':!![]},exports['creds_edit']={'_id':objectID(a179_0x4f21f4(0xf2)),'name':a179_0x4f21f4(0xe4),'message':'Enable\x20Editing\x20of\x20Credentials\x20from\x20Database','global_flag':!![]},exports[a179_0x4f21f4(0xf5)]={'_id':objectID('003'),'name':'Remove\x20Credentials\x20from\x20DB','message':a179_0x4f21f4(0xf3),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/frontends/index.js b/plugins/templates/policies/frontends/index.js index fd31dfd..8db68c1 100644 --- a/plugins/templates/policies/frontends/index.js +++ b/plugins/templates/policies/frontends/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.frontend_add, - edit: policies_1.frontend_edit, - remove: policies_1.frontend_rm, -}; -exports.map = [policies_1.frontend_add, policies_1.frontend_edit, policies_1.frontend_rm]; +'use strict';function a180_0x4b3b(_0x556083,_0xbdf0e5){var _0x34e73b=a180_0x34e7();return a180_0x4b3b=function(_0x4b3be6,_0x2a3261){_0x4b3be6=_0x4b3be6-0x137;var _0x17ea92=_0x34e73b[_0x4b3be6];return _0x17ea92;},a180_0x4b3b(_0x556083,_0xbdf0e5);}var a180_0xcb3a1f=a180_0x4b3b;(function(_0x221a88,_0x403e64){var _0x39f1d3=a180_0x4b3b,_0x280429=_0x221a88();while(!![]){try{var _0x4b5357=parseInt(_0x39f1d3(0x139))/0x1+parseInt(_0x39f1d3(0x13e))/0x2*(-parseInt(_0x39f1d3(0x13c))/0x3)+parseInt(_0x39f1d3(0x138))/0x4+-parseInt(_0x39f1d3(0x13d))/0x5+parseInt(_0x39f1d3(0x141))/0x6+-parseInt(_0x39f1d3(0x143))/0x7+-parseInt(_0x39f1d3(0x13a))/0x8;if(_0x4b5357===_0x403e64)break;else _0x280429['push'](_0x280429['shift']());}catch(_0x383feb){_0x280429['push'](_0x280429['shift']());}}}(a180_0x34e7,0x19ff6));function a180_0x34e7(){var _0x240394=['15UDvwod','625200DeWGtl','47794UyLAvU','frontend_add','frontend_edit','729078cQFcPm','default','567084vaNrXo','frontend_rm','map','797192aDgula','192962IbtFme','654000kwNDoW','__esModule'];a180_0x34e7=function(){return _0x240394;};return a180_0x34e7();}Object['defineProperty'](exports,a180_0xcb3a1f(0x13b),{'value':!![]}),exports[a180_0xcb3a1f(0x137)]=void 0x0;var policies_1=require('./policies');exports[a180_0xcb3a1f(0x142)]={'add':policies_1[a180_0xcb3a1f(0x13f)],'edit':policies_1[a180_0xcb3a1f(0x140)],'remove':policies_1[a180_0xcb3a1f(0x144)]},exports['map']=[policies_1[a180_0xcb3a1f(0x13f)],policies_1[a180_0xcb3a1f(0x140)],policies_1[a180_0xcb3a1f(0x144)]]; \ No newline at end of file diff --git a/plugins/templates/policies/frontends/policies.js b/plugins/templates/policies/frontends/policies.js index 05ac45b..f9ecb8b 100644 --- a/plugins/templates/policies/frontends/policies.js +++ b/plugins/templates/policies/frontends/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying Frontends - * @module - Frontends - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.frontend_rm = exports.frontend_edit = exports.frontend_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-fend@".concat(num)); }; -exports.frontend_add = { - _id: objectID('001'), - name: 'Add Frontends', - message: 'Enable Adding of Frotnends from Database', - global_flag: true, -}; -exports.frontend_edit = { - _id: objectID('002'), - name: 'Edit Credentials', - message: 'Enable Editing of Frontend Details from Database', - global_flag: true, -}; -exports.frontend_rm = { - _id: objectID('003'), - name: 'Remove Credentials', - message: 'Enable Removal of Frontends from Database', - global_flag: true, -}; +'use strict';var a181_0x293f22=a181_0xfa76;(function(_0x27d3f5,_0x3f1598){var _0x461da7=a181_0xfa76,_0x6f1121=_0x27d3f5();while(!![]){try{var _0x539253=-parseInt(_0x461da7(0x12e))/0x1*(-parseInt(_0x461da7(0x130))/0x2)+parseInt(_0x461da7(0x13a))/0x3*(parseInt(_0x461da7(0x138))/0x4)+-parseInt(_0x461da7(0x128))/0x5+parseInt(_0x461da7(0x139))/0x6*(parseInt(_0x461da7(0x127))/0x7)+-parseInt(_0x461da7(0x136))/0x8+-parseInt(_0x461da7(0x135))/0x9+parseInt(_0x461da7(0x132))/0xa*(parseInt(_0x461da7(0x133))/0xb);if(_0x539253===_0x3f1598)break;else _0x6f1121['push'](_0x6f1121['shift']());}catch(_0x350c5a){_0x6f1121['push'](_0x6f1121['shift']());}}}(a181_0x5ead,0x62939));function a181_0x5ead(){var _0x261edf=['6JfPqOs','80481mZELIj','frontend_rm','mongoose','4651157XGjKhQ','2015445EsVPro','pol-fend@','003','Remove\x20Credentials','ObjectId','__esModule','8256GdBVpw','002','40laHzNg','Enable\x20Adding\x20of\x20Frotnends\x20from\x20Database','10ahKLvh','584881ilyflB','Add\x20Frontends','3416652TyiQpE','2506216JavqDi','defineProperty','92ocbsEh'];a181_0x5ead=function(){return _0x261edf;};return a181_0x5ead();}function a181_0xfa76(_0x36548c,_0x13bf89){var _0x5ead7b=a181_0x5ead();return a181_0xfa76=function(_0xfa76b9,_0x4fc03b){_0xfa76b9=_0xfa76b9-0x125;var _0x53ea7e=_0x5ead7b[_0xfa76b9];return _0x53ea7e;},a181_0xfa76(_0x36548c,_0x13bf89);}Object[a181_0x293f22(0x137)](exports,a181_0x293f22(0x12d),{'value':!![]}),exports[a181_0x293f22(0x125)]=exports['frontend_edit']=exports['frontend_add']=void 0x0;var mongoose_1=require(a181_0x293f22(0x126)),objectID=function(_0x552c2a){var _0xe50636=a181_0x293f22;return mongoose_1['Types'][_0xe50636(0x12c)](_0xe50636(0x129)['concat'](_0x552c2a));};exports['frontend_add']={'_id':objectID('001'),'name':a181_0x293f22(0x134),'message':a181_0x293f22(0x131),'global_flag':!![]},exports['frontend_edit']={'_id':objectID(a181_0x293f22(0x12f)),'name':'Edit\x20Credentials','message':'Enable\x20Editing\x20of\x20Frontend\x20Details\x20from\x20Database','global_flag':!![]},exports[a181_0x293f22(0x125)]={'_id':objectID(a181_0x293f22(0x12a)),'name':a181_0x293f22(0x12b),'message':'Enable\x20Removal\x20of\x20Frontends\x20from\x20Database','global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/global-settings/index.js b/plugins/templates/policies/global-settings/index.js index 6002d91..67908a9 100644 --- a/plugins/templates/policies/global-settings/index.js +++ b/plugins/templates/policies/global-settings/index.js @@ -1,8 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - edit: policies_1.global_settings_edit, -}; -exports.map = [policies_1.global_settings_edit]; +'use strict';var a182_0x15a4ef=a182_0x3e0a;(function(_0x3b698e,_0x471a6f){var _0x1731e6=a182_0x3e0a,_0xe4fda0=_0x3b698e();while(!![]){try{var _0x170a69=-parseInt(_0x1731e6(0x164))/0x1*(-parseInt(_0x1731e6(0x15e))/0x2)+parseInt(_0x1731e6(0x166))/0x3*(-parseInt(_0x1731e6(0x15f))/0x4)+-parseInt(_0x1731e6(0x160))/0x5+parseInt(_0x1731e6(0x169))/0x6*(parseInt(_0x1731e6(0x167))/0x7)+-parseInt(_0x1731e6(0x163))/0x8*(-parseInt(_0x1731e6(0x15d))/0x9)+parseInt(_0x1731e6(0x16e))/0xa*(parseInt(_0x1731e6(0x161))/0xb)+parseInt(_0x1731e6(0x165))/0xc*(-parseInt(_0x1731e6(0x162))/0xd);if(_0x170a69===_0x471a6f)break;else _0xe4fda0['push'](_0xe4fda0['shift']());}catch(_0xa61c1){_0xe4fda0['push'](_0xe4fda0['shift']());}}}(a182_0x5903,0x72883));function a182_0x3e0a(_0x553f66,_0x3cdddc){var _0x5903ea=a182_0x5903();return a182_0x3e0a=function(_0x3e0a19,_0x46eb8f){_0x3e0a19=_0x3e0a19-0x15d;var _0x4cd7ab=_0x5903ea[_0x3e0a19];return _0x4cd7ab;},a182_0x3e0a(_0x553f66,_0x3cdddc);}Object[a182_0x15a4ef(0x168)](exports,a182_0x15a4ef(0x16d),{'value':!![]}),exports['map']=void 0x0;function a182_0x5903(){var _0x21b2d4=['152llAZvh','948UkyZHz','8997judQWf','6189512ZpColI','defineProperty','6AFndSy','map','global_settings_edit','./policies','__esModule','30arCrGk','9aybXzd','642VKLlnj','828AxypBo','2510750aFuZKp','2673891dmYYTi','109018KgHBGn','4738472rHVATC'];a182_0x5903=function(){return _0x21b2d4;};return a182_0x5903();}var policies_1=require(a182_0x15a4ef(0x16c));exports['default']={'edit':policies_1[a182_0x15a4ef(0x16b)]},exports[a182_0x15a4ef(0x16a)]=[policies_1[a182_0x15a4ef(0x16b)]]; \ No newline at end of file diff --git a/plugins/templates/policies/global-settings/policies.js b/plugins/templates/policies/global-settings/policies.js index f43ef02..8439136 100644 --- a/plugins/templates/policies/global-settings/policies.js +++ b/plugins/templates/policies/global-settings/policies.js @@ -1,17 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Modifying Global Settings of the Server - * @module - Global Setitngs - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.global_settings_edit = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-sett@".concat(num)); }; -exports.global_settings_edit = { - _id: objectID('001'), - name: 'Edit Global Settings', - message: 'Enable Editing of Global Settings of the Server', - global_flag: true, -}; +'use strict';function a183_0x31e0(){var _0x5c4880=['2541036ZYszKq','Edit\x20Global\x20Settings','5532435NCOnQh','mongoose','Types','4993240ILtUCx','defineProperty','ObjectId','1UkxoUj','concat','1945714YEAmsy','168790ykthVp','1339440jXzBdj','Enable\x20Editing\x20of\x20Global\x20Settings\x20of\x20the\x20Server','global_settings_edit','116pCvqqU','pol-sett@','3778796QuYqof'];a183_0x31e0=function(){return _0x5c4880;};return a183_0x31e0();}var a183_0x3747ba=a183_0x498b;(function(_0x877934,_0x2a4e3a){var _0xd40aba=a183_0x498b,_0x5e0d7f=_0x877934();while(!![]){try{var _0x407183=parseInt(_0xd40aba(0x168))/0x1*(parseInt(_0xd40aba(0x16a))/0x2)+parseInt(_0xd40aba(0x16c))/0x3+parseInt(_0xd40aba(0x16f))/0x4*(-parseInt(_0xd40aba(0x16b))/0x5)+-parseInt(_0xd40aba(0x160))/0x6+parseInt(_0xd40aba(0x15f))/0x7+parseInt(_0xd40aba(0x165))/0x8+-parseInt(_0xd40aba(0x162))/0x9;if(_0x407183===_0x2a4e3a)break;else _0x5e0d7f['push'](_0x5e0d7f['shift']());}catch(_0x4d9a0b){_0x5e0d7f['push'](_0x5e0d7f['shift']());}}}(a183_0x31e0,0x8a365));Object[a183_0x3747ba(0x166)](exports,'__esModule',{'value':!![]}),exports['global_settings_edit']=void 0x0;function a183_0x498b(_0x202f05,_0x17fa76){var _0x31e0d8=a183_0x31e0();return a183_0x498b=function(_0x498be6,_0x4092b8){_0x498be6=_0x498be6-0x15f;var _0x48df43=_0x31e0d8[_0x498be6];return _0x48df43;},a183_0x498b(_0x202f05,_0x17fa76);}var mongoose_1=require(a183_0x3747ba(0x163)),objectID=function(_0x4de1af){var _0x3bcce2=a183_0x3747ba;return mongoose_1[_0x3bcce2(0x164)][_0x3bcce2(0x167)](_0x3bcce2(0x170)[_0x3bcce2(0x169)](_0x4de1af));};exports[a183_0x3747ba(0x16e)]={'_id':objectID('001'),'name':a183_0x3747ba(0x161),'message':a183_0x3747ba(0x16d),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/index.js b/plugins/templates/policies/index.js index 12edfa4..f21593f 100644 --- a/plugins/templates/policies/index.js +++ b/plugins/templates/policies/index.js @@ -1,49 +1 @@ -"use strict"; -/** - * Note: This Will be used only at the time of First Setup - */ -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = exports.smtpProviders = exports.smtpMailers = exports.serviceAccounts = exports.scopes = exports.roles = exports.policy = exports.globalSettings = exports.frontends = exports.credentials = exports.users = void 0; -var user_1 = require("./user"); -var credentials_1 = require("./credentials"); -var frontends_1 = require("./frontends"); -var global_settings_1 = require("./global-settings"); -var policy_1 = require("./policy"); -var roles_1 = require("./roles"); -var scopes_1 = require("./scopes"); -var service_accounts_1 = require("./service-accounts"); -var smtp_mailer_1 = require("./smtp-mailer"); -var smtp_providers_1 = require("./smtp-providers"); -var user_2 = require("./user"); -Object.defineProperty(exports, "users", { enumerable: true, get: function () { return __importDefault(user_2).default; } }); -var credentials_2 = require("./credentials"); -Object.defineProperty(exports, "credentials", { enumerable: true, get: function () { return __importDefault(credentials_2).default; } }); -var frontends_2 = require("./frontends"); -Object.defineProperty(exports, "frontends", { enumerable: true, get: function () { return __importDefault(frontends_2).default; } }); -var global_settings_2 = require("./global-settings"); -Object.defineProperty(exports, "globalSettings", { enumerable: true, get: function () { return __importDefault(global_settings_2).default; } }); -var policy_2 = require("./policy"); -Object.defineProperty(exports, "policy", { enumerable: true, get: function () { return __importDefault(policy_2).default; } }); -var roles_2 = require("./roles"); -Object.defineProperty(exports, "roles", { enumerable: true, get: function () { return __importDefault(roles_2).default; } }); -var scopes_2 = require("./scopes"); -Object.defineProperty(exports, "scopes", { enumerable: true, get: function () { return __importDefault(scopes_2).default; } }); -var service_accounts_2 = require("./service-accounts"); -Object.defineProperty(exports, "serviceAccounts", { enumerable: true, get: function () { return __importDefault(service_accounts_2).default; } }); -var smtp_mailer_2 = require("./smtp-mailer"); -Object.defineProperty(exports, "smtpMailers", { enumerable: true, get: function () { return __importDefault(smtp_mailer_2).default; } }); -var smtp_providers_2 = require("./smtp-providers"); -Object.defineProperty(exports, "smtpProviders", { enumerable: true, get: function () { return __importDefault(smtp_providers_2).default; } }); -exports.map = __spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], user_1.map, true), credentials_1.map, true), frontends_1.map, true), global_settings_1.map, true), policy_1.map, true), roles_1.map, true), scopes_1.map, true), service_accounts_1.map, true), smtp_mailer_1.map, true), smtp_providers_1.map, true); +'use strict';var a184_0x1098a5=a184_0x4d7d;(function(_0x113160,_0x302d97){var _0x182753=a184_0x4d7d,_0x2ccb71=_0x113160();while(!![]){try{var _0x49cc86=parseInt(_0x182753(0x1d5))/0x1+-parseInt(_0x182753(0x1c5))/0x2*(parseInt(_0x182753(0x1cd))/0x3)+parseInt(_0x182753(0x1c1))/0x4*(parseInt(_0x182753(0x1b4))/0x5)+parseInt(_0x182753(0x1b7))/0x6*(parseInt(_0x182753(0x1c4))/0x7)+-parseInt(_0x182753(0x1d7))/0x8+-parseInt(_0x182753(0x1d8))/0x9*(parseInt(_0x182753(0x1bc))/0xa)+-parseInt(_0x182753(0x1bf))/0xb;if(_0x49cc86===_0x302d97)break;else _0x2ccb71['push'](_0x2ccb71['shift']());}catch(_0x57a04b){_0x2ccb71['push'](_0x2ccb71['shift']());}}}(a184_0x4223,0x2f69c));var __spreadArray=this&&this[a184_0x1098a5(0x1b5)]||function(_0x33bb4b,_0x11fcb3,_0x3ea18c){var _0x56441c=a184_0x1098a5;if(_0x3ea18c||arguments['length']===0x2)for(var _0x461ed3=0x0,_0x190ad8=_0x11fcb3[_0x56441c(0x1b9)],_0x2c29b2;_0x461ed3<_0x190ad8;_0x461ed3++){if(_0x2c29b2||!(_0x461ed3 in _0x11fcb3)){if(!_0x2c29b2)_0x2c29b2=Array[_0x56441c(0x1c6)][_0x56441c(0x1ba)][_0x56441c(0x1d6)](_0x11fcb3,0x0,_0x461ed3);_0x2c29b2[_0x461ed3]=_0x11fcb3[_0x461ed3];}}return _0x33bb4b['concat'](_0x2c29b2||Array[_0x56441c(0x1c6)]['slice'][_0x56441c(0x1d6)](_0x11fcb3));},__importDefault=this&&this[a184_0x1098a5(0x1c0)]||function(_0x168859){return _0x168859&&_0x168859['__esModule']?_0x168859:{'default':_0x168859};};Object[a184_0x1098a5(0x1c2)](exports,'__esModule',{'value':!![]}),exports[a184_0x1098a5(0x1da)]=exports[a184_0x1098a5(0x1d3)]=exports['smtpMailers']=exports[a184_0x1098a5(0x1bb)]=exports[a184_0x1098a5(0x1b6)]=exports[a184_0x1098a5(0x1c7)]=exports[a184_0x1098a5(0x1c8)]=exports[a184_0x1098a5(0x1ce)]=exports['frontends']=exports['credentials']=exports[a184_0x1098a5(0x1d9)]=void 0x0;var user_1=require('./user'),credentials_1=require('./credentials'),frontends_1=require(a184_0x1098a5(0x1cf)),global_settings_1=require(a184_0x1098a5(0x1c3)),policy_1=require(a184_0x1098a5(0x1b8)),roles_1=require(a184_0x1098a5(0x1cb)),scopes_1=require('./scopes'),service_accounts_1=require(a184_0x1098a5(0x1c9)),smtp_mailer_1=require(a184_0x1098a5(0x1cc)),smtp_providers_1=require(a184_0x1098a5(0x1d2)),user_2=require(a184_0x1098a5(0x1bd));Object[a184_0x1098a5(0x1c2)](exports,a184_0x1098a5(0x1d9),{'enumerable':!![],'get':function(){var _0x5d3dc9=a184_0x1098a5;return __importDefault(user_2)[_0x5d3dc9(0x1d1)];}});var credentials_2=require(a184_0x1098a5(0x1d0));function a184_0x4d7d(_0x22677d,_0x16434e){var _0x422323=a184_0x4223();return a184_0x4d7d=function(_0x4d7dca,_0x363e1b){_0x4d7dca=_0x4d7dca-0x1b4;var _0x59b88a=_0x422323[_0x4d7dca];return _0x59b88a;},a184_0x4d7d(_0x22677d,_0x16434e);}Object['defineProperty'](exports,a184_0x1098a5(0x1be),{'enumerable':!![],'get':function(){var _0x2556b3=a184_0x1098a5;return __importDefault(credentials_2)[_0x2556b3(0x1d1)];}});var frontends_2=require(a184_0x1098a5(0x1cf));Object[a184_0x1098a5(0x1c2)](exports,a184_0x1098a5(0x1ca),{'enumerable':!![],'get':function(){var _0x4dfcaf=a184_0x1098a5;return __importDefault(frontends_2)[_0x4dfcaf(0x1d1)];}});var global_settings_2=require(a184_0x1098a5(0x1c3));Object[a184_0x1098a5(0x1c2)](exports,a184_0x1098a5(0x1ce),{'enumerable':!![],'get':function(){return __importDefault(global_settings_2)['default'];}});var policy_2=require(a184_0x1098a5(0x1b8));function a184_0x4223(){var _0x56edee=['12684mpTpur','12PLXFpd','prototype','roles','policy','./service-accounts','frontends','./roles','./smtp-mailer','164721xhMwFC','globalSettings','./frontends','./credentials','default','./smtp-providers','smtpProviders','./scopes','374972ydAtjQ','call','2685064MtJOej','507771QxKpoH','users','map','505tCrjdb','__spreadArray','scopes','1038XodTGA','./policy','length','slice','serviceAccounts','20ycIvbK','./user','credentials','451506zlrpCH','__importDefault','12860nbkJaA','defineProperty','./global-settings'];a184_0x4223=function(){return _0x56edee;};return a184_0x4223();}Object[a184_0x1098a5(0x1c2)](exports,'policy',{'enumerable':!![],'get':function(){var _0x11fcd7=a184_0x1098a5;return __importDefault(policy_2)[_0x11fcd7(0x1d1)];}});var roles_2=require(a184_0x1098a5(0x1cb));Object[a184_0x1098a5(0x1c2)](exports,a184_0x1098a5(0x1c7),{'enumerable':!![],'get':function(){return __importDefault(roles_2)['default'];}});var scopes_2=require(a184_0x1098a5(0x1d4));Object[a184_0x1098a5(0x1c2)](exports,'scopes',{'enumerable':!![],'get':function(){var _0x2d46b4=a184_0x1098a5;return __importDefault(scopes_2)[_0x2d46b4(0x1d1)];}});var service_accounts_2=require(a184_0x1098a5(0x1c9));Object['defineProperty'](exports,'serviceAccounts',{'enumerable':!![],'get':function(){var _0x2c5dcd=a184_0x1098a5;return __importDefault(service_accounts_2)[_0x2c5dcd(0x1d1)];}});var smtp_mailer_2=require(a184_0x1098a5(0x1cc));Object['defineProperty'](exports,'smtpMailers',{'enumerable':!![],'get':function(){return __importDefault(smtp_mailer_2)['default'];}});var smtp_providers_2=require(a184_0x1098a5(0x1d2));Object[a184_0x1098a5(0x1c2)](exports,'smtpProviders',{'enumerable':!![],'get':function(){return __importDefault(smtp_providers_2)['default'];}}),exports['map']=__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([],user_1[a184_0x1098a5(0x1da)],!![]),credentials_1[a184_0x1098a5(0x1da)],!![]),frontends_1[a184_0x1098a5(0x1da)],!![]),global_settings_1[a184_0x1098a5(0x1da)],!![]),policy_1[a184_0x1098a5(0x1da)],!![]),roles_1[a184_0x1098a5(0x1da)],!![]),scopes_1[a184_0x1098a5(0x1da)],!![]),service_accounts_1[a184_0x1098a5(0x1da)],!![]),smtp_mailer_1[a184_0x1098a5(0x1da)],!![]),smtp_providers_1['map'],!![]); \ No newline at end of file diff --git a/plugins/templates/policies/policy/index.js b/plugins/templates/policies/policy/index.js index d1d965f..7b25d5b 100644 --- a/plugins/templates/policies/policy/index.js +++ b/plugins/templates/policies/policy/index.js @@ -1,8 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - edit: policies_1.policies_edit, -}; -exports.map = [policies_1.policies_edit]; +'use strict';var a185_0x3e3770=a185_0xd537;(function(_0x50256d,_0xe309e3){var _0x18724a=a185_0xd537,_0x2c6a8a=_0x50256d();while(!![]){try{var _0x2ae56a=-parseInt(_0x18724a(0x116))/0x1*(parseInt(_0x18724a(0x10c))/0x2)+parseInt(_0x18724a(0x118))/0x3+parseInt(_0x18724a(0x110))/0x4+-parseInt(_0x18724a(0x10f))/0x5*(-parseInt(_0x18724a(0x112))/0x6)+parseInt(_0x18724a(0x10e))/0x7+parseInt(_0x18724a(0x117))/0x8+-parseInt(_0x18724a(0x114))/0x9;if(_0x2ae56a===_0xe309e3)break;else _0x2c6a8a['push'](_0x2c6a8a['shift']());}catch(_0x184039){_0x2c6a8a['push'](_0x2c6a8a['shift']());}}}(a185_0x423f,0x6536c));Object[a185_0x3e3770(0x10d)](exports,'__esModule',{'value':!![]}),exports[a185_0x3e3770(0x115)]=void 0x0;function a185_0xd537(_0x28a419,_0x323e4a){var _0x423fc=a185_0x423f();return a185_0xd537=function(_0xd53724,_0x1cf65c){_0xd53724=_0xd53724-0x10c;var _0x47e672=_0x423fc[_0xd53724];return _0x47e672;},a185_0xd537(_0x28a419,_0x323e4a);}var policies_1=require(a185_0x3e3770(0x113));function a185_0x423f(){var _0x70f1b4=['map','18779zICMXf','2459192QmnENi','1485603xbJSmk','68DZZUnM','defineProperty','1179234YUsvXe','66985QpDueb','359192mVUwOF','default','78CuYSvF','./policies','1637667DFqbjA'];a185_0x423f=function(){return _0x70f1b4;};return a185_0x423f();}exports[a185_0x3e3770(0x111)]={'edit':policies_1['policies_edit']},exports['map']=[policies_1['policies_edit']]; \ No newline at end of file diff --git a/plugins/templates/policies/policy/policies.js b/plugins/templates/policies/policy/policies.js index ed36a23..129f6a2 100644 --- a/plugins/templates/policies/policy/policies.js +++ b/plugins/templates/policies/policy/policies.js @@ -1,17 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Modifying Organisation Policies - * @module - Global Setitngs - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.policies_edit = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-policy@".concat(num)); }; -exports.policies_edit = { - _id: objectID('1'), - name: 'Edit Policies', - message: 'Enable Editing of Organisation Policies', - global_flag: true, -}; +'use strict';var a186_0x1477b9=a186_0x14fc;function a186_0x4de6(){var _0x375f3c=['policies_edit','Edit\x20Policies','Types','2450196RmRtbk','mongoose','221156CtJSlO','24Fgegsr','340664fDYrrS','__esModule','10YxAGZq','1500906ZAweqN','348126UZaLqW','165959NRBJlN','concat','372673CUihrI'];a186_0x4de6=function(){return _0x375f3c;};return a186_0x4de6();}(function(_0x4d02e7,_0x2efeb3){var _0x353896=a186_0x14fc,_0x10582e=_0x4d02e7();while(!![]){try{var _0x26192e=-parseInt(_0x353896(0x178))/0x1+parseInt(_0x353896(0x180))/0x2+-parseInt(_0x353896(0x177))/0x3+-parseInt(_0x353896(0x182))/0x4*(-parseInt(_0x353896(0x184))/0x5)+-parseInt(_0x353896(0x185))/0x6+parseInt(_0x353896(0x17a))/0x7*(parseInt(_0x353896(0x181))/0x8)+parseInt(_0x353896(0x17e))/0x9;if(_0x26192e===_0x2efeb3)break;else _0x10582e['push'](_0x10582e['shift']());}catch(_0x5211ff){_0x10582e['push'](_0x10582e['shift']());}}}(a186_0x4de6,0x2c1ef));Object['defineProperty'](exports,a186_0x1477b9(0x183),{'value':!![]}),exports[a186_0x1477b9(0x17b)]=void 0x0;var mongoose_1=require(a186_0x1477b9(0x17f)),objectID=function(_0x41cd89){var _0x277c11=a186_0x1477b9;return mongoose_1[_0x277c11(0x17d)]['ObjectId']('pol-policy@'[_0x277c11(0x179)](_0x41cd89));};function a186_0x14fc(_0x3588d0,_0x38eab2){var _0x4de656=a186_0x4de6();return a186_0x14fc=function(_0x14fc28,_0x13169b){_0x14fc28=_0x14fc28-0x177;var _0x533356=_0x4de656[_0x14fc28];return _0x533356;},a186_0x14fc(_0x3588d0,_0x38eab2);}exports[a186_0x1477b9(0x17b)]={'_id':objectID('1'),'name':a186_0x1477b9(0x17c),'message':'Enable\x20Editing\x20of\x20Organisation\x20Policies','global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/roles/index.js b/plugins/templates/policies/roles/index.js index c162046..76672a3 100644 --- a/plugins/templates/policies/roles/index.js +++ b/plugins/templates/policies/roles/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.roles_add, - edit: policies_1.roles_edit, - remove: policies_1.roles_rm, -}; -exports.map = [policies_1.roles_add, policies_1.roles_edit, policies_1.roles_rm]; +'use strict';var a187_0x1b9446=a187_0x14d9;function a187_0x4fc3(){var _0x21c5a0=['roles_edit','65EFUXsz','roles_add','map','34512HjwmwF','4922358zLLWMY','__esModule','8310645IboEJO','16474000DiQJIP','defineProperty','431062COIcjx','819NinRUy','roles_rm','./policies','4fEcKky','69532YAYQPc','774837HNrrJM'];a187_0x4fc3=function(){return _0x21c5a0;};return a187_0x4fc3();}function a187_0x14d9(_0x47f02d,_0x3fc82e){var _0x4fc395=a187_0x4fc3();return a187_0x14d9=function(_0x14d956,_0xa722e){_0x14d956=_0x14d956-0x121;var _0x5c0449=_0x4fc395[_0x14d956];return _0x5c0449;},a187_0x14d9(_0x47f02d,_0x3fc82e);}(function(_0x42c1ac,_0x1f31e3){var _0x1d21a6=a187_0x14d9,_0x13def0=_0x42c1ac();while(!![]){try{var _0x3ab0dc=parseInt(_0x1d21a6(0x127))/0x1*(parseInt(_0x1d21a6(0x123))/0x2)+parseInt(_0x1d21a6(0x129))/0x3+-parseInt(_0x1d21a6(0x128))/0x4*(parseInt(_0x1d21a6(0x12b))/0x5)+parseInt(_0x1d21a6(0x12f))/0x6+-parseInt(_0x1d21a6(0x124))/0x7*(parseInt(_0x1d21a6(0x12e))/0x8)+parseInt(_0x1d21a6(0x131))/0x9+-parseInt(_0x1d21a6(0x121))/0xa;if(_0x3ab0dc===_0x1f31e3)break;else _0x13def0['push'](_0x13def0['shift']());}catch(_0x8f406f){_0x13def0['push'](_0x13def0['shift']());}}}(a187_0x4fc3,0x76ac4));Object[a187_0x1b9446(0x122)](exports,a187_0x1b9446(0x130),{'value':!![]}),exports[a187_0x1b9446(0x12d)]=void 0x0;var policies_1=require(a187_0x1b9446(0x126));exports['default']={'add':policies_1[a187_0x1b9446(0x12c)],'edit':policies_1[a187_0x1b9446(0x12a)],'remove':policies_1['roles_rm']},exports['map']=[policies_1[a187_0x1b9446(0x12c)],policies_1[a187_0x1b9446(0x12a)],policies_1[a187_0x1b9446(0x125)]]; \ No newline at end of file diff --git a/plugins/templates/policies/roles/policies.js b/plugins/templates/policies/roles/policies.js index 11a1d6e..cd7befd 100644 --- a/plugins/templates/policies/roles/policies.js +++ b/plugins/templates/policies/roles/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying Sub Roles - * @module - Role - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.roles_rm = exports.roles_edit = exports.roles_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-role@".concat(num)); }; -exports.roles_add = { - _id: objectID('001'), - name: 'Add Sub Roles', - message: 'Enable Creating of Sub Roles', - global_flag: true, -}; -exports.roles_edit = { - _id: objectID('002'), - name: 'Edit Sub Roles', - message: 'Enable Editing of Settings related to Sub Roles', - global_flag: true, -}; -exports.roles_rm = { - _id: objectID('003'), - name: 'Remove Sub Roles', - message: 'Enable Removal of Sub Roles', - global_flag: true, -}; +'use strict';var a188_0x20c554=a188_0x507c;function a188_0x4461(){var _0x2cb8a5=['5276HOAnhl','Enable\x20Removal\x20of\x20Sub\x20Roles','mongoose','003','roles_edit','ObjectId','__esModule','Remove\x20Sub\x20Roles','3130GbHsHr','123351EeUXXU','1629sFQLkD','Add\x20Sub\x20Roles','Types','2wAmBGx','477987TPsDut','315TGiyPc','Enable\x20Creating\x20of\x20Sub\x20Roles','458605frjGui','40362XsqlgM','defineProperty','Edit\x20Sub\x20Roles','002','Enable\x20Editing\x20of\x20Settings\x20related\x20to\x20Sub\x20Roles','1013328WZWULP','roles_rm'];a188_0x4461=function(){return _0x2cb8a5;};return a188_0x4461();}(function(_0x158004,_0x17f511){var _0x349700=a188_0x507c,_0xa6bd03=_0x158004();while(!![]){try{var _0xdb54fc=-parseInt(_0x349700(0x165))/0x1*(parseInt(_0x349700(0x169))/0x2)+parseInt(_0x349700(0x16a))/0x3+-parseInt(_0x349700(0x15c))/0x4*(-parseInt(_0x349700(0x16b))/0x5)+-parseInt(_0x349700(0x16e))/0x6+-parseInt(_0x349700(0x16d))/0x7+parseInt(_0x349700(0x15a))/0x8+parseInt(_0x349700(0x166))/0x9*(-parseInt(_0x349700(0x164))/0xa);if(_0xdb54fc===_0x17f511)break;else _0xa6bd03['push'](_0xa6bd03['shift']());}catch(_0x15a8d0){_0xa6bd03['push'](_0xa6bd03['shift']());}}}(a188_0x4461,0x1c86e));Object[a188_0x20c554(0x16f)](exports,a188_0x20c554(0x162),{'value':!![]}),exports[a188_0x20c554(0x15b)]=exports[a188_0x20c554(0x160)]=exports['roles_add']=void 0x0;function a188_0x507c(_0x18d1f1,_0x473a12){var _0x446187=a188_0x4461();return a188_0x507c=function(_0x507cf7,_0x1079dd){_0x507cf7=_0x507cf7-0x159;var _0x1473cc=_0x446187[_0x507cf7];return _0x1473cc;},a188_0x507c(_0x18d1f1,_0x473a12);}var mongoose_1=require(a188_0x20c554(0x15e)),objectID=function(_0x1ed830){var _0xc4fa4b=a188_0x20c554;return mongoose_1[_0xc4fa4b(0x168)][_0xc4fa4b(0x161)]('pol-role@'['concat'](_0x1ed830));};exports['roles_add']={'_id':objectID('001'),'name':a188_0x20c554(0x167),'message':a188_0x20c554(0x16c),'global_flag':!![]},exports[a188_0x20c554(0x160)]={'_id':objectID(a188_0x20c554(0x171)),'name':a188_0x20c554(0x170),'message':a188_0x20c554(0x159),'global_flag':!![]},exports[a188_0x20c554(0x15b)]={'_id':objectID(a188_0x20c554(0x15f)),'name':a188_0x20c554(0x163),'message':a188_0x20c554(0x15d),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/scopes/index.js b/plugins/templates/policies/scopes/index.js index 72e1292..5104345 100644 --- a/plugins/templates/policies/scopes/index.js +++ b/plugins/templates/policies/scopes/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.scope_add, - edit: policies_1.scope_edit, - remove: policies_1.scope_rm, -}; -exports.map = [policies_1.scope_add, policies_1.scope_edit, policies_1.scope_rm]; +'use strict';var a189_0x264fd3=a189_0x32d9;(function(_0x3b58fb,_0xb03162){var _0x1c86f7=a189_0x32d9,_0x302af1=_0x3b58fb();while(!![]){try{var _0x1f9a8a=-parseInt(_0x1c86f7(0x1ea))/0x1*(-parseInt(_0x1c86f7(0x1f4))/0x2)+-parseInt(_0x1c86f7(0x1ef))/0x3+parseInt(_0x1c86f7(0x1f0))/0x4*(parseInt(_0x1c86f7(0x1f6))/0x5)+parseInt(_0x1c86f7(0x1f7))/0x6+-parseInt(_0x1c86f7(0x1f5))/0x7+-parseInt(_0x1c86f7(0x1ec))/0x8+parseInt(_0x1c86f7(0x1e8))/0x9;if(_0x1f9a8a===_0xb03162)break;else _0x302af1['push'](_0x302af1['shift']());}catch(_0x478de5){_0x302af1['push'](_0x302af1['shift']());}}}(a189_0xb665,0x3ad38));Object['defineProperty'](exports,a189_0x264fd3(0x1f1),{'value':!![]}),exports[a189_0x264fd3(0x1f2)]=void 0x0;var policies_1=require(a189_0x264fd3(0x1f3));function a189_0x32d9(_0x5db706,_0x5418ac){var _0xb66521=a189_0xb665();return a189_0x32d9=function(_0x32d9c3,_0x3145ee){_0x32d9c3=_0x32d9c3-0x1e8;var _0xed81b2=_0xb66521[_0x32d9c3];return _0xed81b2;},a189_0x32d9(_0x5db706,_0x5418ac);}exports[a189_0x264fd3(0x1e9)]={'add':policies_1[a189_0x264fd3(0x1eb)],'edit':policies_1[a189_0x264fd3(0x1ee)],'remove':policies_1[a189_0x264fd3(0x1ed)]},exports['map']=[policies_1[a189_0x264fd3(0x1eb)],policies_1[a189_0x264fd3(0x1ee)],policies_1[a189_0x264fd3(0x1ed)]];function a189_0xb665(){var _0x5f5c23=['689793ekfKRD','1060088ZsLYWo','__esModule','map','./policies','1682qWTSbZ','1919239bfAjBX','5CpFwhJ','1813212fPuXfg','4013721oqGrxa','default','11kNLPse','scope_add','2219072RDPpjs','scope_rm','scope_edit'];a189_0xb665=function(){return _0x5f5c23;};return a189_0xb665();} \ No newline at end of file diff --git a/plugins/templates/policies/scopes/policies.js b/plugins/templates/policies/scopes/policies.js index 64fbf8d..2f9ac99 100644 --- a/plugins/templates/policies/scopes/policies.js +++ b/plugins/templates/policies/scopes/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying Scopes - * @module - Scope - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.scope_rm = exports.scope_edit = exports.scope_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-scop@".concat(num)); }; -exports.scope_add = { - _id: objectID('001'), - name: 'Add Scopes', - message: 'Enable Adding of Scopes to Database', - global_flag: true, -}; -exports.scope_edit = { - _id: objectID('002'), - name: 'Edit Scopes', - message: 'Enable Editing of Scopes in Database', - global_flag: true, -}; -exports.scope_rm = { - _id: objectID('003'), - name: 'Remove Scopes', - message: 'Enable Removal of Scopes from Database', - global_flag: true, -}; +'use strict';function a190_0x122c(){var _0xc78d93=['mongoose','80hEfVuw','1753244HMFWfN','scope_edit','Remove\x20Scopes','627606yjhAjk','scope_rm','Enable\x20Adding\x20of\x20Scopes\x20to\x20Database','7939842JLbuGV','34661817TXOodF','001','002','Edit\x20Scopes','1164XbVRbB','5008990TLqJll','__esModule','545057WsvTVJ','Types','scope_add','2260wIpUjs','concat','Enable\x20Removal\x20of\x20Scopes\x20from\x20Database'];a190_0x122c=function(){return _0xc78d93;};return a190_0x122c();}var a190_0x28d35a=a190_0xc1d8;(function(_0x186462,_0x335070){var _0xe9b256=a190_0xc1d8,_0x2af596=_0x186462();while(!![]){try{var _0x3fe813=-parseInt(_0xe9b256(0x79))/0x1+parseInt(_0xe9b256(0x7c))/0x2*(parseInt(_0xe9b256(0x8c))/0x3)+parseInt(_0xe9b256(0x81))/0x4+-parseInt(_0xe9b256(0x8d))/0x5+-parseInt(_0xe9b256(0x87))/0x6+-parseInt(_0xe9b256(0x84))/0x7*(parseInt(_0xe9b256(0x80))/0x8)+parseInt(_0xe9b256(0x88))/0x9;if(_0x3fe813===_0x335070)break;else _0x2af596['push'](_0x2af596['shift']());}catch(_0x301348){_0x2af596['push'](_0x2af596['shift']());}}}(a190_0x122c,0xeab2a));function a190_0xc1d8(_0x528569,_0x5e31ac){var _0x122c90=a190_0x122c();return a190_0xc1d8=function(_0xc1d8c,_0x4708dd){_0xc1d8c=_0xc1d8c-0x79;var _0x5c609f=_0x122c90[_0xc1d8c];return _0x5c609f;},a190_0xc1d8(_0x528569,_0x5e31ac);}Object['defineProperty'](exports,a190_0x28d35a(0x8e),{'value':!![]}),exports[a190_0x28d35a(0x85)]=exports[a190_0x28d35a(0x82)]=exports['scope_add']=void 0x0;var mongoose_1=require(a190_0x28d35a(0x7f)),objectID=function(_0x5335fd){var _0x2840e9=a190_0x28d35a;return mongoose_1[_0x2840e9(0x7a)]['ObjectId']('pol-scop@'[_0x2840e9(0x7d)](_0x5335fd));};exports[a190_0x28d35a(0x7b)]={'_id':objectID(a190_0x28d35a(0x89)),'name':'Add\x20Scopes','message':a190_0x28d35a(0x86),'global_flag':!![]},exports[a190_0x28d35a(0x82)]={'_id':objectID(a190_0x28d35a(0x8a)),'name':a190_0x28d35a(0x8b),'message':'Enable\x20Editing\x20of\x20Scopes\x20in\x20Database','global_flag':!![]},exports[a190_0x28d35a(0x85)]={'_id':objectID('003'),'name':a190_0x28d35a(0x83),'message':a190_0x28d35a(0x7e),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/service-accounts/index.js b/plugins/templates/policies/service-accounts/index.js index 9cc7a7d..9157da6 100644 --- a/plugins/templates/policies/service-accounts/index.js +++ b/plugins/templates/policies/service-accounts/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.sac_add, - edit: policies_1.sac_edit, - remove: policies_1.sac_rm, -}; -exports.map = [policies_1.sac_add, policies_1.sac_edit, policies_1.sac_rm]; +'use strict';function a191_0x57c3(){var _0x2844df=['3wqstNY','defineProperty','sac_add','5925396LBqUTL','34574630YgmDNi','7824393vrzYWG','__esModule','8688alQhSW','796866HLMafJ','./policies','sac_rm','map','27672QrFRnK','1490137LNYODV','2290SwIVci','sac_edit','3206vJEgTT','default'];a191_0x57c3=function(){return _0x2844df;};return a191_0x57c3();}function a191_0x2aba(_0x173e61,_0x50d6b9){var _0x57c307=a191_0x57c3();return a191_0x2aba=function(_0x2aba61,_0x1624c7){_0x2aba61=_0x2aba61-0x10b;var _0xbf04f7=_0x57c307[_0x2aba61];return _0xbf04f7;},a191_0x2aba(_0x173e61,_0x50d6b9);}var a191_0x366b0e=a191_0x2aba;(function(_0x59b32a,_0x3a1fca){var _0x2afe3c=a191_0x2aba,_0x5269c8=_0x59b32a();while(!![]){try{var _0x10d24e=-parseInt(_0x2afe3c(0x119))/0x1+parseInt(_0x2afe3c(0x114))/0x2+parseInt(_0x2afe3c(0x10c))/0x3*(-parseInt(_0x2afe3c(0x10f))/0x4)+-parseInt(_0x2afe3c(0x11a))/0x5*(-parseInt(_0x2afe3c(0x113))/0x6)+-parseInt(_0x2afe3c(0x11c))/0x7*(parseInt(_0x2afe3c(0x118))/0x8)+parseInt(_0x2afe3c(0x111))/0x9+parseInt(_0x2afe3c(0x110))/0xa;if(_0x10d24e===_0x3a1fca)break;else _0x5269c8['push'](_0x5269c8['shift']());}catch(_0x2eebe9){_0x5269c8['push'](_0x5269c8['shift']());}}}(a191_0x57c3,0xcb4ed));Object[a191_0x366b0e(0x10d)](exports,a191_0x366b0e(0x112),{'value':!![]}),exports['map']=void 0x0;var policies_1=require(a191_0x366b0e(0x115));exports[a191_0x366b0e(0x10b)]={'add':policies_1[a191_0x366b0e(0x10e)],'edit':policies_1[a191_0x366b0e(0x11b)],'remove':policies_1['sac_rm']},exports[a191_0x366b0e(0x117)]=[policies_1[a191_0x366b0e(0x10e)],policies_1[a191_0x366b0e(0x11b)],policies_1[a191_0x366b0e(0x116)]]; \ No newline at end of file diff --git a/plugins/templates/policies/service-accounts/policies.js b/plugins/templates/policies/service-accounts/policies.js index f55d2b5..29560c7 100644 --- a/plugins/templates/policies/service-accounts/policies.js +++ b/plugins/templates/policies/service-accounts/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying Service Accounts - * @module - Service Accounts - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sac_rm = exports.sac_edit = exports.sac_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-saac@".concat(num)); }; -exports.sac_add = { - _id: objectID('001'), - name: 'Add Service Account', - message: 'Enable Adding of Service Accounts to Database', - global_flag: true, -}; -exports.sac_edit = { - _id: objectID('002'), - name: 'Edit Service Account', - message: 'Enable Editing of Service Accounts in Database', - global_flag: true, -}; -exports.sac_rm = { - _id: objectID('003'), - name: 'Remove Service Account', - message: 'Enable Removal of Service Accounts from Database', - global_flag: true, -}; +'use strict';var a192_0x678a19=a192_0x189c;(function(_0x5a0289,_0x18101a){var _0x1c6291=a192_0x189c,_0x1a3d3e=_0x5a0289();while(!![]){try{var _0x3c2a1d=-parseInt(_0x1c6291(0x8c))/0x1+-parseInt(_0x1c6291(0x8e))/0x2+parseInt(_0x1c6291(0x91))/0x3+-parseInt(_0x1c6291(0x8b))/0x4*(parseInt(_0x1c6291(0x93))/0x5)+-parseInt(_0x1c6291(0x7e))/0x6*(-parseInt(_0x1c6291(0x83))/0x7)+parseInt(_0x1c6291(0x85))/0x8*(-parseInt(_0x1c6291(0x95))/0x9)+-parseInt(_0x1c6291(0x92))/0xa*(-parseInt(_0x1c6291(0x88))/0xb);if(_0x3c2a1d===_0x18101a)break;else _0x1a3d3e['push'](_0x1a3d3e['shift']());}catch(_0x4f6113){_0x1a3d3e['push'](_0x1a3d3e['shift']());}}}(a192_0x2837,0x7096a));Object[a192_0x678a19(0x8a)](exports,a192_0x678a19(0x8f),{'value':!![]}),exports[a192_0x678a19(0x84)]=exports[a192_0x678a19(0x7d)]=exports['sac_add']=void 0x0;function a192_0x2837(){var _0x34456b=['mongoose','1440633iPzuJd','40270UKfZgh','5yDKwVF','concat','9fVcuZP','sac_edit','6dgDnkd','Types','002','001','Remove\x20Service\x20Account','4019981ZPVYgV','sac_rm','6021592tsrwDW','Enable\x20Editing\x20of\x20Service\x20Accounts\x20in\x20Database','Enable\x20Adding\x20of\x20Service\x20Accounts\x20to\x20Database','3443USJVIx','Edit\x20Service\x20Account','defineProperty','2433932MAnWCa','52757CpISwW','pol-saac@','879688IlSmxc','__esModule'];a192_0x2837=function(){return _0x34456b;};return a192_0x2837();}function a192_0x189c(_0x325723,_0xfca4ee){var _0x28376e=a192_0x2837();return a192_0x189c=function(_0x189c55,_0x332d14){_0x189c55=_0x189c55-0x7d;var _0x27ae1f=_0x28376e[_0x189c55];return _0x27ae1f;},a192_0x189c(_0x325723,_0xfca4ee);}var mongoose_1=require(a192_0x678a19(0x90)),objectID=function(_0x3a7223){var _0x131b03=a192_0x678a19;return mongoose_1[_0x131b03(0x7f)]['ObjectId'](_0x131b03(0x8d)[_0x131b03(0x94)](_0x3a7223));};exports['sac_add']={'_id':objectID(a192_0x678a19(0x81)),'name':'Add\x20Service\x20Account','message':a192_0x678a19(0x87),'global_flag':!![]},exports['sac_edit']={'_id':objectID(a192_0x678a19(0x80)),'name':a192_0x678a19(0x89),'message':a192_0x678a19(0x86),'global_flag':!![]},exports[a192_0x678a19(0x84)]={'_id':objectID('003'),'name':a192_0x678a19(0x82),'message':'Enable\x20Removal\x20of\x20Service\x20Accounts\x20from\x20Database','global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/smtp-mailer/index.js b/plugins/templates/policies/smtp-mailer/index.js index db8c93f..e46c45b 100644 --- a/plugins/templates/policies/smtp-mailer/index.js +++ b/plugins/templates/policies/smtp-mailer/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.smtp_mailer_add, - edit: policies_1.smtp_mailer_edit, - remove: policies_1.smtp_mailer_rm, -}; -exports.map = [policies_1.smtp_mailer_add, policies_1.smtp_mailer_edit, policies_1.smtp_mailer_rm]; +'use strict';function a193_0x40c6(_0x3cad82,_0x43d947){var _0x1b7bd2=a193_0x1b7b();return a193_0x40c6=function(_0x40c657,_0xdc162a){_0x40c657=_0x40c657-0x167;var _0x5d7218=_0x1b7bd2[_0x40c657];return _0x5d7218;},a193_0x40c6(_0x3cad82,_0x43d947);}var a193_0x2adb31=a193_0x40c6;function a193_0x1b7b(){var _0xf5206b=['10nxcvYy','81GuSdbi','default','1391395chwfrH','./policies','504984pncDzy','smtp_mailer_add','218489iTisGC','3692271rCstNs','smtp_mailer_edit','smtp_mailer_rm','63721pohXAy','162SHvAND','37104nzbrNO','616XTEQgn','defineProperty','657sjCIaE','map'];a193_0x1b7b=function(){return _0xf5206b;};return a193_0x1b7b();}(function(_0x47982b,_0x244a4e){var _0x1f6569=a193_0x40c6,_0x382978=_0x47982b();while(!![]){try{var _0x2c262e=-parseInt(_0x1f6569(0x16d))/0x1+parseInt(_0x1f6569(0x16b))/0x2+parseInt(_0x1f6569(0x167))/0x3*(-parseInt(_0x1f6569(0x173))/0x4)+parseInt(_0x1f6569(0x169))/0x5+-parseInt(_0x1f6569(0x172))/0x6*(parseInt(_0x1f6569(0x171))/0x7)+-parseInt(_0x1f6569(0x174))/0x8*(-parseInt(_0x1f6569(0x176))/0x9)+parseInt(_0x1f6569(0x178))/0xa*(parseInt(_0x1f6569(0x16e))/0xb);if(_0x2c262e===_0x244a4e)break;else _0x382978['push'](_0x382978['shift']());}catch(_0x551fe5){_0x382978['push'](_0x382978['shift']());}}}(a193_0x1b7b,0x26693));Object[a193_0x2adb31(0x175)](exports,'__esModule',{'value':!![]}),exports['map']=void 0x0;var policies_1=require(a193_0x2adb31(0x16a));exports[a193_0x2adb31(0x168)]={'add':policies_1[a193_0x2adb31(0x16c)],'edit':policies_1[a193_0x2adb31(0x16f)],'remove':policies_1[a193_0x2adb31(0x170)]},exports[a193_0x2adb31(0x177)]=[policies_1[a193_0x2adb31(0x16c)],policies_1[a193_0x2adb31(0x16f)],policies_1[a193_0x2adb31(0x170)]]; \ No newline at end of file diff --git a/plugins/templates/policies/smtp-mailer/policies.js b/plugins/templates/policies/smtp-mailer/policies.js index 7afdfe5..1022722 100644 --- a/plugins/templates/policies/smtp-mailer/policies.js +++ b/plugins/templates/policies/smtp-mailer/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying SMTP Mailers - * @module - Smtp mailers - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.smtp_mailer_rm = exports.smtp_mailer_edit = exports.smtp_mailer_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-smpm@".concat(num)); }; -exports.smtp_mailer_add = { - _id: objectID('001'), - name: 'Add SMTP Emails Accounts', - message: 'Enable Adding of SMTP Emails Accounts to Database', - global_flag: true, -}; -exports.smtp_mailer_edit = { - _id: objectID('002'), - name: 'Edit SMTP Emails Accounts', - message: 'Enable Editing of SMTP Emails Accounts in Database', - global_flag: true, -}; -exports.smtp_mailer_rm = { - _id: objectID('003'), - name: 'Remove SMTP Emails Accounts', - message: 'Enable Removal of SMTP Emails Accounts from Database', - global_flag: true, -}; +'use strict';function a194_0x1ae1(){var _0x28012b=['__esModule','Add\x20SMTP\x20Emails\x20Accounts','12NeQhTg','5869884Bdnioo','001','smtp_mailer_edit','002','2QqcnWU','125110xyupop','mongoose','12244ycWsLV','81070vJseyJ','5tXvSdG','1038wPNtqT','smtp_mailer_add','Types','5535256pTLKbP','concat','ObjectId','10689041nzvKND','003','Edit\x20SMTP\x20Emails\x20Accounts','549gSTbom','Enable\x20Removal\x20of\x20SMTP\x20Emails\x20Accounts\x20from\x20Database','7mOSxRn','882856wNlzsg','Enable\x20Editing\x20of\x20SMTP\x20Emails\x20Accounts\x20in\x20Database'];a194_0x1ae1=function(){return _0x28012b;};return a194_0x1ae1();}var a194_0x20d88c=a194_0x16c2;(function(_0x532b90,_0xa93d4c){var _0x1c8af2=a194_0x16c2,_0x1ba7cb=_0x532b90();while(!![]){try{var _0x3560f8=-parseInt(_0x1c8af2(0xf8))/0x1*(-parseInt(_0x1c8af2(0xf4))/0x2)+parseInt(_0x1c8af2(0xfa))/0x3*(-parseInt(_0x1c8af2(0xf7))/0x4)+-parseInt(_0x1c8af2(0xf9))/0x5*(parseInt(_0x1c8af2(0xf0))/0x6)+parseInt(_0x1c8af2(0x105))/0x7*(parseInt(_0x1c8af2(0xfd))/0x8)+parseInt(_0x1c8af2(0x103))/0x9*(parseInt(_0x1c8af2(0xf5))/0xa)+parseInt(_0x1c8af2(0x100))/0xb+-parseInt(_0x1c8af2(0xef))/0xc*(-parseInt(_0x1c8af2(0x106))/0xd);if(_0x3560f8===_0xa93d4c)break;else _0x1ba7cb['push'](_0x1ba7cb['shift']());}catch(_0x3b2d05){_0x1ba7cb['push'](_0x1ba7cb['shift']());}}}(a194_0x1ae1,0x83703));function a194_0x16c2(_0x59e1f7,_0x5025b4){var _0x1ae1e8=a194_0x1ae1();return a194_0x16c2=function(_0x16c2d8,_0xe156e){_0x16c2d8=_0x16c2d8-0xec;var _0x451f43=_0x1ae1e8[_0x16c2d8];return _0x451f43;},a194_0x16c2(_0x59e1f7,_0x5025b4);}Object['defineProperty'](exports,a194_0x20d88c(0xed),{'value':!![]}),exports['smtp_mailer_rm']=exports[a194_0x20d88c(0xf2)]=exports[a194_0x20d88c(0xfb)]=void 0x0;var mongoose_1=require(a194_0x20d88c(0xf6)),objectID=function(_0x354972){var _0x2451a=a194_0x20d88c;return mongoose_1[_0x2451a(0xfc)][_0x2451a(0xff)]('pol-smpm@'[_0x2451a(0xfe)](_0x354972));};exports['smtp_mailer_add']={'_id':objectID(a194_0x20d88c(0xf1)),'name':a194_0x20d88c(0xee),'message':'Enable\x20Adding\x20of\x20SMTP\x20Emails\x20Accounts\x20to\x20Database','global_flag':!![]},exports['smtp_mailer_edit']={'_id':objectID(a194_0x20d88c(0xf3)),'name':a194_0x20d88c(0x102),'message':a194_0x20d88c(0xec),'global_flag':!![]},exports['smtp_mailer_rm']={'_id':objectID(a194_0x20d88c(0x101)),'name':'Remove\x20SMTP\x20Emails\x20Accounts','message':a194_0x20d88c(0x104),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/smtp-providers/index.js b/plugins/templates/policies/smtp-providers/index.js index 3b3d06c..69161de 100644 --- a/plugins/templates/policies/smtp-providers/index.js +++ b/plugins/templates/policies/smtp-providers/index.js @@ -1,10 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - add: policies_1.smtp_provider_add, - edit: policies_1.smtp_provider_edit, - remove: policies_1.smtp_provider_rm, -}; -exports.map = [policies_1.smtp_provider_add, policies_1.smtp_provider_edit, policies_1.smtp_provider_rm]; +'use strict';var a195_0x368825=a195_0x230e;(function(_0x43e331,_0x12e045){var _0x59f517=a195_0x230e,_0x53042c=_0x43e331();while(!![]){try{var _0x4123e6=-parseInt(_0x59f517(0x17a))/0x1*(parseInt(_0x59f517(0x182))/0x2)+parseInt(_0x59f517(0x17d))/0x3*(-parseInt(_0x59f517(0x184))/0x4)+-parseInt(_0x59f517(0x17f))/0x5*(-parseInt(_0x59f517(0x181))/0x6)+-parseInt(_0x59f517(0x17b))/0x7+parseInt(_0x59f517(0x183))/0x8+-parseInt(_0x59f517(0x186))/0x9+parseInt(_0x59f517(0x178))/0xa;if(_0x4123e6===_0x12e045)break;else _0x53042c['push'](_0x53042c['shift']());}catch(_0x52dc69){_0x53042c['push'](_0x53042c['shift']());}}}(a195_0x44a7,0x76f4e));function a195_0x230e(_0x52b681,_0x4485da){var _0x44a7aa=a195_0x44a7();return a195_0x230e=function(_0x230e15,_0x49c7b4){_0x230e15=_0x230e15-0x177;var _0xc12d08=_0x44a7aa[_0x230e15];return _0xc12d08;},a195_0x230e(_0x52b681,_0x4485da);}Object['defineProperty'](exports,a195_0x368825(0x180),{'value':!![]}),exports[a195_0x368825(0x17e)]=void 0x0;function a195_0x44a7(){var _0x588999=['5931891ULQrAl','smtp_provider_add','23052010FNqLHI','smtp_provider_edit','608139TFWBpB','5418672TrCpxQ','./policies','74160DpwGBw','map','5jCmLSQ','__esModule','1080582QKUmvw','2YnuJFp','7267856UhnGWe','140hLJhsq','default'];a195_0x44a7=function(){return _0x588999;};return a195_0x44a7();}var policies_1=require(a195_0x368825(0x17c));exports[a195_0x368825(0x185)]={'add':policies_1[a195_0x368825(0x177)],'edit':policies_1[a195_0x368825(0x179)],'remove':policies_1['smtp_provider_rm']},exports[a195_0x368825(0x17e)]=[policies_1[a195_0x368825(0x177)],policies_1['smtp_provider_edit'],policies_1['smtp_provider_rm']]; \ No newline at end of file diff --git a/plugins/templates/policies/smtp-providers/policies.js b/plugins/templates/policies/smtp-providers/policies.js index 481f5a6..1c35520 100644 --- a/plugins/templates/policies/smtp-providers/policies.js +++ b/plugins/templates/policies/smtp-providers/policies.js @@ -1,29 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding and Modifying SMTP Providers - * @module - Smtp Providers - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.smtp_provider_rm = exports.smtp_provider_edit = exports.smtp_provider_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("pol-smpp@".concat(num)); }; -exports.smtp_provider_add = { - _id: objectID('001'), - name: 'Add SMTP Email Providers', - message: 'Enable Adding of SMTP Email Providers to Database', - global_flag: true, -}; -exports.smtp_provider_edit = { - _id: objectID('002'), - name: 'Edit SMTP Email Providers', - message: 'Enable Editing of SMTP Email Providers in Database', - global_flag: true, -}; -exports.smtp_provider_rm = { - _id: objectID('003'), - name: 'Remove SMTP Email Providers', - message: 'Enable Removal of SMTP Email Providers from Database', - global_flag: true, -}; +'use strict';var a196_0x5c64b6=a196_0x5d3d;(function(_0xd349af,_0x11564e){var _0x773509=a196_0x5d3d,_0x12afce=_0xd349af();while(!![]){try{var _0x11257c=parseInt(_0x773509(0x183))/0x1+parseInt(_0x773509(0x16f))/0x2+-parseInt(_0x773509(0x174))/0x3+-parseInt(_0x773509(0x178))/0x4+-parseInt(_0x773509(0x182))/0x5+parseInt(_0x773509(0x181))/0x6*(-parseInt(_0x773509(0x16b))/0x7)+parseInt(_0x773509(0x16c))/0x8;if(_0x11257c===_0x11564e)break;else _0x12afce['push'](_0x12afce['shift']());}catch(_0x41caaa){_0x12afce['push'](_0x12afce['shift']());}}}(a196_0x5623,0x371b0));Object[a196_0x5c64b6(0x180)](exports,a196_0x5c64b6(0x17a),{'value':!![]}),exports[a196_0x5c64b6(0x172)]=exports[a196_0x5c64b6(0x17c)]=exports[a196_0x5c64b6(0x16e)]=void 0x0;function a196_0x5d3d(_0x56ef3e,_0x462a39){var _0x56234b=a196_0x5623();return a196_0x5d3d=function(_0x5d3d60,_0x39e2d8){_0x5d3d60=_0x5d3d60-0x16b;var _0x505449=_0x56234b[_0x5d3d60];return _0x505449;},a196_0x5d3d(_0x56ef3e,_0x462a39);}var mongoose_1=require(a196_0x5c64b6(0x17d)),objectID=function(_0x67cced){var _0x5c2ebe=a196_0x5c64b6;return mongoose_1['Types'][_0x5c2ebe(0x17e)](_0x5c2ebe(0x176)[_0x5c2ebe(0x16d)](_0x67cced));};exports[a196_0x5c64b6(0x16e)]={'_id':objectID(a196_0x5c64b6(0x17b)),'name':a196_0x5c64b6(0x177),'message':a196_0x5c64b6(0x173),'global_flag':!![]},exports[a196_0x5c64b6(0x17c)]={'_id':objectID(a196_0x5c64b6(0x17f)),'name':a196_0x5c64b6(0x171),'message':a196_0x5c64b6(0x170),'global_flag':!![]},exports[a196_0x5c64b6(0x172)]={'_id':objectID(a196_0x5c64b6(0x179)),'name':'Remove\x20SMTP\x20Email\x20Providers','message':a196_0x5c64b6(0x175),'global_flag':!![]};function a196_0x5623(){var _0x23dedc=['003','__esModule','001','smtp_provider_edit','mongoose','ObjectId','002','defineProperty','11796bmDwoi','1316280OMpJBv','59888mcZeQK','294yYmJXh','6463536OZbXBh','concat','smtp_provider_add','252528YayRRI','Enable\x20Editing\x20of\x20SMTP\x20Email\x20Providers\x20in\x20Database','Edit\x20SMTP\x20Email\x20Providers','smtp_provider_rm','Enable\x20Adding\x20of\x20SMTP\x20Email\x20Providers\x20to\x20Database','1033158ZJWPfd','Enable\x20Removal\x20of\x20SMTP\x20Email\x20Providers\x20from\x20Database','pol-smpp@','Add\x20SMTP\x20Email\x20Providers','312672wlKRIa'];a196_0x5623=function(){return _0x23dedc;};return a196_0x5623();} \ No newline at end of file diff --git a/plugins/templates/policies/user/add/index.js b/plugins/templates/policies/user/add/index.js index b014188..8f6cb54 100644 --- a/plugins/templates/policies/user/add/index.js +++ b/plugins/templates/policies/user/add/index.js @@ -1,27 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -var policies_2 = require("./policies"); -exports.default = { - accept: { - viewer: policies_1.viewer_add, - contentMgr: policies_1.content_mgr_add, - mods: policies_1.mod_add, - manager: policies_1.mgr_add, - }, - promote: { - contentMgr: policies_2.self_content_mgr_add, - mods: policies_2.self_mod_add, - manager: policies_2.self_mgr_add, - }, -}; -exports.map = [ - policies_1.viewer_add, - policies_1.content_mgr_add, - policies_1.mod_add, - policies_1.mgr_add, - policies_2.self_content_mgr_add, - policies_2.self_mod_add, - policies_2.self_mgr_add, -]; +'use strict';var a197_0x1bd699=a197_0x5aa7;(function(_0x596292,_0x27d586){var _0x5ac1d9=a197_0x5aa7,_0x3e58cb=_0x596292();while(!![]){try{var _0xfe5ff1=parseInt(_0x5ac1d9(0xd3))/0x1+-parseInt(_0x5ac1d9(0xd1))/0x2+parseInt(_0x5ac1d9(0xc7))/0x3*(parseInt(_0x5ac1d9(0xd9))/0x4)+-parseInt(_0x5ac1d9(0xca))/0x5*(parseInt(_0x5ac1d9(0xcb))/0x6)+-parseInt(_0x5ac1d9(0xce))/0x7+parseInt(_0x5ac1d9(0xcc))/0x8+-parseInt(_0x5ac1d9(0xd8))/0x9;if(_0xfe5ff1===_0x27d586)break;else _0x3e58cb['push'](_0x3e58cb['shift']());}catch(_0xe3f2a8){_0x3e58cb['push'](_0x3e58cb['shift']());}}}(a197_0x1622,0x1c000));function a197_0x5aa7(_0x748d5b,_0x886307){var _0x1622f5=a197_0x1622();return a197_0x5aa7=function(_0x5aa7fa,_0x4097d0){_0x5aa7fa=_0x5aa7fa-0xc7;var _0x1976ff=_0x1622f5[_0x5aa7fa];return _0x1976ff;},a197_0x5aa7(_0x748d5b,_0x886307);}Object[a197_0x1bd699(0xcf)](exports,'__esModule',{'value':!![]}),exports[a197_0x1bd699(0xd7)]=void 0x0;function a197_0x1622(){var _0x3301fb=['mgr_add','self_mod_add','310yurKiI','10698SfYfva','1610440KMIYqe','default','811944ixzuCc','defineProperty','content_mgr_add','221352txERes','self_content_mgr_add','154624VAyWMu','self_mgr_add','./policies','viewer_add','map','1085742tsBrvB','16348BmJBCu','159lDVtjJ'];a197_0x1622=function(){return _0x3301fb;};return a197_0x1622();}var policies_1=require(a197_0x1bd699(0xd5)),policies_2=require(a197_0x1bd699(0xd5));exports[a197_0x1bd699(0xcd)]={'accept':{'viewer':policies_1[a197_0x1bd699(0xd6)],'contentMgr':policies_1[a197_0x1bd699(0xd0)],'mods':policies_1['mod_add'],'manager':policies_1[a197_0x1bd699(0xc8)]},'promote':{'contentMgr':policies_2[a197_0x1bd699(0xd2)],'mods':policies_2[a197_0x1bd699(0xc9)],'manager':policies_2[a197_0x1bd699(0xd4)]}},exports[a197_0x1bd699(0xd7)]=[policies_1[a197_0x1bd699(0xd6)],policies_1['content_mgr_add'],policies_1['mod_add'],policies_1[a197_0x1bd699(0xc8)],policies_2['self_content_mgr_add'],policies_2[a197_0x1bd699(0xc9)],policies_2[a197_0x1bd699(0xd4)]]; \ No newline at end of file diff --git a/plugins/templates/policies/user/add/policies.js b/plugins/templates/policies/user/add/policies.js index e17df43..d9ab3b7 100644 --- a/plugins/templates/policies/user/add/policies.js +++ b/plugins/templates/policies/user/add/policies.js @@ -1,53 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Adding Various Types of Users - * @module - User[Add] - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.self_mgr_add = exports.self_mod_add = exports.self_content_mgr_add = exports.mgr_add = exports.mod_add = exports.content_mgr_add = exports.viewer_add = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("p-user-a@".concat(num)); }; -exports.viewer_add = { - _id: objectID('001'), - name: 'Add Viewer', - message: 'Enable Accepting of Requests for Viewers and its Delegates', - global_flag: true, -}; -exports.content_mgr_add = { - _id: objectID('002'), - name: 'Add Content Managers', - message: 'Enable Accepting of Requests for Content Managers and its Delegates', - global_flag: true, -}; -exports.mod_add = { - _id: objectID('003'), - name: 'Add Moderators', - message: 'Enable Accepting of Requests for Moderators and its Delegates', - global_flag: true, -}; -exports.mgr_add = { - _id: objectID('004'), - name: 'Add Managers', - message: 'Enable Accepting of Requests for Managers and its Delegates', - global_flag: true, -}; -exports.self_content_mgr_add = { - _id: objectID('005'), - name: 'Promote to Content Managers', - message: 'Enable Promoting of Users to Content Managers without their Request and its Delegates', - global_flag: true, -}; -exports.self_mod_add = { - _id: objectID('006'), - name: 'Promote to Moderators', - message: 'Enable Promoting of Users to Moderators without their Request and its Delegates', - global_flag: true, -}; -exports.self_mgr_add = { - _id: objectID('007'), - name: 'Promote to Manager', - message: 'Enable Promoting of Users to Managers without their Request and its Delegates', - global_flag: true, -}; +'use strict';var a198_0x3cf7d9=a198_0x1692;(function(_0x5a46a8,_0x2be924){var _0x4d8023=a198_0x1692,_0x3a0338=_0x5a46a8();while(!![]){try{var _0x23686c=parseInt(_0x4d8023(0xef))/0x1+-parseInt(_0x4d8023(0xf4))/0x2*(-parseInt(_0x4d8023(0xd6))/0x3)+-parseInt(_0x4d8023(0xd1))/0x4+-parseInt(_0x4d8023(0xda))/0x5*(-parseInt(_0x4d8023(0xd7))/0x6)+parseInt(_0x4d8023(0xd5))/0x7*(parseInt(_0x4d8023(0xe9))/0x8)+parseInt(_0x4d8023(0xf0))/0x9+-parseInt(_0x4d8023(0xdd))/0xa*(parseInt(_0x4d8023(0xe0))/0xb);if(_0x23686c===_0x2be924)break;else _0x3a0338['push'](_0x3a0338['shift']());}catch(_0x8c5483){_0x3a0338['push'](_0x3a0338['shift']());}}}(a198_0x35c0,0xd71c0));function a198_0x1692(_0x4b033e,_0x1e67c7){var _0x35c0df=a198_0x35c0();return a198_0x1692=function(_0x1692b8,_0x42be85){_0x1692b8=_0x1692b8-0xcf;var _0x357024=_0x35c0df[_0x1692b8];return _0x357024;},a198_0x1692(_0x4b033e,_0x1e67c7);}Object[a198_0x3cf7d9(0xdf)](exports,a198_0x3cf7d9(0xdc),{'value':!![]}),exports['self_mgr_add']=exports[a198_0x3cf7d9(0xf3)]=exports[a198_0x3cf7d9(0xcf)]=exports[a198_0x3cf7d9(0xe4)]=exports[a198_0x3cf7d9(0xf2)]=exports[a198_0x3cf7d9(0xe3)]=exports[a198_0x3cf7d9(0xe5)]=void 0x0;var mongoose_1=require(a198_0x3cf7d9(0xdb)),objectID=function(_0x3f8c49){var _0x58c82c=a198_0x3cf7d9;return mongoose_1[_0x58c82c(0xf5)][_0x58c82c(0xe2)]('p-user-a@'[_0x58c82c(0xea)](_0x3f8c49));};exports[a198_0x3cf7d9(0xe5)]={'_id':objectID(a198_0x3cf7d9(0xed)),'name':a198_0x3cf7d9(0xe6),'message':a198_0x3cf7d9(0xd4),'global_flag':!![]},exports['content_mgr_add']={'_id':objectID(a198_0x3cf7d9(0xd9)),'name':a198_0x3cf7d9(0xe8),'message':a198_0x3cf7d9(0xe7),'global_flag':!![]},exports[a198_0x3cf7d9(0xf2)]={'_id':objectID('003'),'name':'Add\x20Moderators','message':a198_0x3cf7d9(0xf1),'global_flag':!![]},exports['mgr_add']={'_id':objectID(a198_0x3cf7d9(0xeb)),'name':'Add\x20Managers','message':'Enable\x20Accepting\x20of\x20Requests\x20for\x20Managers\x20and\x20its\x20Delegates','global_flag':!![]},exports[a198_0x3cf7d9(0xcf)]={'_id':objectID(a198_0x3cf7d9(0xde)),'name':'Promote\x20to\x20Content\x20Managers','message':a198_0x3cf7d9(0xd2),'global_flag':!![]},exports['self_mod_add']={'_id':objectID(a198_0x3cf7d9(0xd3)),'name':a198_0x3cf7d9(0xd0),'message':a198_0x3cf7d9(0xe1),'global_flag':!![]},exports[a198_0x3cf7d9(0xec)]={'_id':objectID(a198_0x3cf7d9(0xee)),'name':a198_0x3cf7d9(0xd8),'message':'Enable\x20Promoting\x20of\x20Users\x20to\x20Managers\x20without\x20their\x20Request\x20and\x20its\x20Delegates','global_flag':!![]};function a198_0x35c0(){var _0x23d4d1=['mongoose','__esModule','537820BIiqBD','005','defineProperty','748LSScnP','Enable\x20Promoting\x20of\x20Users\x20to\x20Moderators\x20without\x20their\x20Request\x20and\x20its\x20Delegates','ObjectId','content_mgr_add','mgr_add','viewer_add','Add\x20Viewer','Enable\x20Accepting\x20of\x20Requests\x20for\x20Content\x20Managers\x20and\x20its\x20Delegates','Add\x20Content\x20Managers','1138288NBUBzC','concat','004','self_mgr_add','001','007','1450213NwOSdU','9135225VIiuZQ','Enable\x20Accepting\x20of\x20Requests\x20for\x20Moderators\x20and\x20its\x20Delegates','mod_add','self_mod_add','2EdZYbY','Types','self_content_mgr_add','Promote\x20to\x20Moderators','3170760tXUSbO','Enable\x20Promoting\x20of\x20Users\x20to\x20Content\x20Managers\x20without\x20their\x20Request\x20and\x20its\x20Delegates','006','Enable\x20Accepting\x20of\x20Requests\x20for\x20Viewers\x20and\x20its\x20Delegates','70JBgBkI','3498456ejvMbd','207528YXYkLr','Promote\x20to\x20Manager','002','40trDLRX'];a198_0x35c0=function(){return _0x23d4d1;};return a198_0x35c0();} \ No newline at end of file diff --git a/plugins/templates/policies/user/blacklist/index.js b/plugins/templates/policies/user/blacklist/index.js index 88cde11..482292f 100644 --- a/plugins/templates/policies/user/blacklist/index.js +++ b/plugins/templates/policies/user/blacklist/index.js @@ -1,11 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - viewer: policies_1.viewer_blist, - contentMgr: policies_1.content_mgr_blist, - mods: policies_1.mod_blist, - manager: policies_1.mgr_blist, -}; -exports.map = [policies_1.viewer_blist, policies_1.content_mgr_blist, policies_1.mod_blist, policies_1.mgr_blist]; +'use strict';function a199_0x424b(){var _0x3146cf=['314414EIWATM','viewer_blist','mgr_blist','5852zGiCpE','__esModule','50HMUhqn','12520uvmPwo','1141674XgWsaM','./policies','content_mgr_blist','417357tWNEYl','mod_blist','8FeXGta','578460CMkomw','map','default','99AAqSWa','1152Emcduk','32xvNEQI','135633wFkidQ'];a199_0x424b=function(){return _0x3146cf;};return a199_0x424b();}var a199_0x2efc08=a199_0x4ee0;function a199_0x4ee0(_0x426323,_0x4d583d){var _0x424b99=a199_0x424b();return a199_0x4ee0=function(_0x4ee082,_0x9cef15){_0x4ee082=_0x4ee082-0x10d;var _0x18df36=_0x424b99[_0x4ee082];return _0x18df36;},a199_0x4ee0(_0x426323,_0x4d583d);}(function(_0x597041,_0x148a42){var _0x42ec73=a199_0x4ee0,_0x1ec1dd=_0x597041();while(!![]){try{var _0x16cfbe=parseInt(_0x42ec73(0x115))/0x1+-parseInt(_0x42ec73(0x10d))/0x2*(-parseInt(_0x42ec73(0x114))/0x3)+-parseInt(_0x42ec73(0x113))/0x4*(parseInt(_0x42ec73(0x11b))/0x5)+-parseInt(_0x42ec73(0x11c))/0x6+-parseInt(_0x42ec73(0x118))/0x7*(-parseInt(_0x42ec73(0x112))/0x8)+-parseInt(_0x42ec73(0x11f))/0x9*(-parseInt(_0x42ec73(0x11a))/0xa)+-parseInt(_0x42ec73(0x111))/0xb*(parseInt(_0x42ec73(0x10e))/0xc);if(_0x16cfbe===_0x148a42)break;else _0x1ec1dd['push'](_0x1ec1dd['shift']());}catch(_0x323400){_0x1ec1dd['push'](_0x1ec1dd['shift']());}}}(a199_0x424b,0x31a57));Object['defineProperty'](exports,a199_0x2efc08(0x119),{'value':!![]}),exports[a199_0x2efc08(0x10f)]=void 0x0;var policies_1=require(a199_0x2efc08(0x11d));exports[a199_0x2efc08(0x110)]={'viewer':policies_1[a199_0x2efc08(0x116)],'contentMgr':policies_1[a199_0x2efc08(0x11e)],'mods':policies_1['mod_blist'],'manager':policies_1[a199_0x2efc08(0x117)]},exports[a199_0x2efc08(0x10f)]=[policies_1[a199_0x2efc08(0x116)],policies_1[a199_0x2efc08(0x11e)],policies_1[a199_0x2efc08(0x120)],policies_1[a199_0x2efc08(0x117)]]; \ No newline at end of file diff --git a/plugins/templates/policies/user/blacklist/policies.js b/plugins/templates/policies/user/blacklist/policies.js index 47eeb56..1cde627 100644 --- a/plugins/templates/policies/user/blacklist/policies.js +++ b/plugins/templates/policies/user/blacklist/policies.js @@ -1,35 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Blacklisting Various Types of Users - * @module - User[Blacklist] - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mgr_blist = exports.mod_blist = exports.content_mgr_blist = exports.viewer_blist = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("p-user-b@".concat(num)); }; -exports.viewer_blist = { - _id: objectID('001'), - name: 'Blacklist Viewer', - message: 'Enable Blacklisting of Viewers and its Delegates', - global_flag: true, -}; -exports.content_mgr_blist = { - _id: objectID('002'), - name: 'Blacklist Content Managers', - message: 'Enable Blacklisting of Content Managers and its Delegates', - global_flag: true, -}; -exports.mod_blist = { - _id: objectID('003'), - name: 'Blacklist Moderators', - message: 'Enable Blacklisting of Moderators and its Delegates', - global_flag: true, -}; -exports.mgr_blist = { - _id: objectID('004'), - name: 'Blacklist Managers', - message: 'Enable Blacklisting of Managers and its Delegates', - global_flag: true, -}; +'use strict';function a200_0x1428(_0x7fa44d,_0x794a10){var _0x178773=a200_0x1787();return a200_0x1428=function(_0x1428fb,_0x556fee){_0x1428fb=_0x1428fb-0x1cd;var _0x28549b=_0x178773[_0x1428fb];return _0x28549b;},a200_0x1428(_0x7fa44d,_0x794a10);}function a200_0x1787(){var _0x376429=['8470QmZZQK','1444223TScBKl','10162518yGTZsQ','Types','787029HctWrO','mgr_blist','99KixRXC','Enable\x20Blacklisting\x20of\x20Content\x20Managers\x20and\x20its\x20Delegates','Blacklist\x20Managers','Blacklist\x20Content\x20Managers','10056OsBjWm','003','viewer_blist','15984Enuims','mod_blist','1172274FIUDDa','Blacklist\x20Moderators','content_mgr_blist','p-user-b@','Enable\x20Blacklisting\x20of\x20Moderators\x20and\x20its\x20Delegates','5ZehQbr','Blacklist\x20Viewer','mongoose','concat','004','28HwWUFS','Enable\x20Blacklisting\x20of\x20Managers\x20and\x20its\x20Delegates','25940EIYLPO','7997osyYwS'];a200_0x1787=function(){return _0x376429;};return a200_0x1787();}var a200_0x4c7c00=a200_0x1428;(function(_0x25bd61,_0x18089b){var _0x48a35e=a200_0x1428,_0x346365=_0x25bd61();while(!![]){try{var _0x4ec380=-parseInt(_0x48a35e(0x1d4))/0x1+-parseInt(_0x48a35e(0x1e2))/0x2+-parseInt(_0x48a35e(0x1d7))/0x3*(-parseInt(_0x48a35e(0x1cf))/0x4)+-parseInt(_0x48a35e(0x1e7))/0x5*(-parseInt(_0x48a35e(0x1d5))/0x6)+-parseInt(_0x48a35e(0x1d3))/0x7*(parseInt(_0x48a35e(0x1dd))/0x8)+-parseInt(_0x48a35e(0x1d9))/0x9*(parseInt(_0x48a35e(0x1d1))/0xa)+parseInt(_0x48a35e(0x1d2))/0xb*(parseInt(_0x48a35e(0x1e0))/0xc);if(_0x4ec380===_0x18089b)break;else _0x346365['push'](_0x346365['shift']());}catch(_0x665673){_0x346365['push'](_0x346365['shift']());}}}(a200_0x1787,0xe047e));Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports[a200_0x4c7c00(0x1d8)]=exports[a200_0x4c7c00(0x1e1)]=exports[a200_0x4c7c00(0x1e4)]=exports['viewer_blist']=void 0x0;var mongoose_1=require(a200_0x4c7c00(0x1e9)),objectID=function(_0x218265){var _0xed4d51=a200_0x4c7c00;return mongoose_1[_0xed4d51(0x1d6)]['ObjectId'](_0xed4d51(0x1e5)[_0xed4d51(0x1cd)](_0x218265));};exports[a200_0x4c7c00(0x1df)]={'_id':objectID('001'),'name':a200_0x4c7c00(0x1e8),'message':'Enable\x20Blacklisting\x20of\x20Viewers\x20and\x20its\x20Delegates','global_flag':!![]},exports[a200_0x4c7c00(0x1e4)]={'_id':objectID('002'),'name':a200_0x4c7c00(0x1dc),'message':a200_0x4c7c00(0x1da),'global_flag':!![]},exports[a200_0x4c7c00(0x1e1)]={'_id':objectID(a200_0x4c7c00(0x1de)),'name':a200_0x4c7c00(0x1e3),'message':a200_0x4c7c00(0x1e6),'global_flag':!![]},exports['mgr_blist']={'_id':objectID(a200_0x4c7c00(0x1ce)),'name':a200_0x4c7c00(0x1db),'message':a200_0x4c7c00(0x1d0),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/user/index.js b/plugins/templates/policies/user/index.js index 28bb66f..92d6544 100644 --- a/plugins/templates/policies/user/index.js +++ b/plugins/templates/policies/user/index.js @@ -1,43 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description All the Policies Related to Users - * @module - User - * @author Sudharshan TK - */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var add_1 = __importStar(require("./add")); -var remove_1 = __importStar(require("./remove")); -var modify_1 = __importStar(require("./modify")); -var blacklist_1 = __importStar(require("./blacklist")); -exports.default = { add: add_1.default, remove: remove_1.default, modify: modify_1.default, blacklist: blacklist_1.default }; -exports.map = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], add_1.map, true), remove_1.map, true), blacklist_1.map, true), modify_1.map, true); +'use strict';var a201_0x5e3419=a201_0x49c5;(function(_0x51b7ad,_0x354bdd){var _0x500228=a201_0x49c5,_0x5310ef=_0x51b7ad();while(!![]){try{var _0x4f1f8a=-parseInt(_0x500228(0x18c))/0x1*(-parseInt(_0x500228(0x17b))/0x2)+parseInt(_0x500228(0x17a))/0x3*(parseInt(_0x500228(0x188))/0x4)+-parseInt(_0x500228(0x17e))/0x5*(parseInt(_0x500228(0x177))/0x6)+-parseInt(_0x500228(0x18f))/0x7*(parseInt(_0x500228(0x183))/0x8)+-parseInt(_0x500228(0x180))/0x9+-parseInt(_0x500228(0x18d))/0xa+parseInt(_0x500228(0x184))/0xb;if(_0x4f1f8a===_0x354bdd)break;else _0x5310ef['push'](_0x5310ef['shift']());}catch(_0x9e2ab9){_0x5310ef['push'](_0x5310ef['shift']());}}}(a201_0xfe6b,0x67e40));function a201_0x49c5(_0xd7eb9f,_0x1e7307){var _0xfe6bf=a201_0xfe6b();return a201_0x49c5=function(_0x49c536,_0x431233){_0x49c536=_0x49c536-0x175;var _0xee8eb1=_0xfe6bf[_0x49c536];return _0xee8eb1;},a201_0x49c5(_0xd7eb9f,_0x1e7307);}var __createBinding=this&&this[a201_0x5e3419(0x17c)]||(Object[a201_0x5e3419(0x17f)]?function(_0x310db1,_0x4651e1,_0x17c9ca,_0x510b44){var _0x5abcd6=a201_0x5e3419;if(_0x510b44===undefined)_0x510b44=_0x17c9ca;Object[_0x5abcd6(0x179)](_0x310db1,_0x510b44,{'enumerable':!![],'get':function(){return _0x4651e1[_0x17c9ca];}});}:function(_0x1e864c,_0x1bdc4a,_0x3831cd,_0x257baf){if(_0x257baf===undefined)_0x257baf=_0x3831cd;_0x1e864c[_0x257baf]=_0x1bdc4a[_0x3831cd];}),__setModuleDefault=this&&this[a201_0x5e3419(0x17d)]||(Object[a201_0x5e3419(0x17f)]?function(_0x3ff799,_0x5775b7){var _0x5d886=a201_0x5e3419;Object['defineProperty'](_0x3ff799,_0x5d886(0x187),{'enumerable':!![],'value':_0x5775b7});}:function(_0x540f4d,_0x255247){var _0x4740a9=a201_0x5e3419;_0x540f4d[_0x4740a9(0x187)]=_0x255247;}),__importStar=this&&this['__importStar']||function(_0x2a19c8){var _0x9a9d5f=a201_0x5e3419;if(_0x2a19c8&&_0x2a19c8[_0x9a9d5f(0x181)])return _0x2a19c8;var _0x29410c={};if(_0x2a19c8!=null){for(var _0x5e9439 in _0x2a19c8)if(_0x5e9439!==_0x9a9d5f(0x187)&&Object[_0x9a9d5f(0x175)][_0x9a9d5f(0x186)][_0x9a9d5f(0x18a)](_0x2a19c8,_0x5e9439))__createBinding(_0x29410c,_0x2a19c8,_0x5e9439);}return __setModuleDefault(_0x29410c,_0x2a19c8),_0x29410c;},__spreadArray=this&&this['__spreadArray']||function(_0x18d9b9,_0x6c4c60,_0x2ffe39){var _0x25b579=a201_0x5e3419;if(_0x2ffe39||arguments[_0x25b579(0x176)]===0x2)for(var _0x10101f=0x0,_0x5b6edf=_0x6c4c60[_0x25b579(0x176)],_0x1f804c;_0x10101f<_0x5b6edf;_0x10101f++){if(_0x1f804c||!(_0x10101f in _0x6c4c60)){if(!_0x1f804c)_0x1f804c=Array[_0x25b579(0x175)][_0x25b579(0x178)][_0x25b579(0x18a)](_0x6c4c60,0x0,_0x10101f);_0x1f804c[_0x10101f]=_0x6c4c60[_0x10101f];}}return _0x18d9b9[_0x25b579(0x189)](_0x1f804c||Array[_0x25b579(0x175)][_0x25b579(0x178)]['call'](_0x6c4c60));};Object[a201_0x5e3419(0x179)](exports,a201_0x5e3419(0x181),{'value':!![]}),exports['map']=void 0x0;var add_1=__importStar(require(a201_0x5e3419(0x185))),remove_1=__importStar(require(a201_0x5e3419(0x18b))),modify_1=__importStar(require(a201_0x5e3419(0x190))),blacklist_1=__importStar(require(a201_0x5e3419(0x182)));function a201_0xfe6b(){var _0x9c555=['6498970ludKNK','map','7PVZEQg','./modify','prototype','length','30LCDCAc','slice','defineProperty','177291waDQcr','534GhdccD','__createBinding','__setModuleDefault','803215dhtkwY','create','1166913elxzuJ','__esModule','./blacklist','1508680tKrjuA','16040992ITueDN','./add','hasOwnProperty','default','28Pbkpbu','concat','call','./remove','1217qWHnZB'];a201_0xfe6b=function(){return _0x9c555;};return a201_0xfe6b();}exports[a201_0x5e3419(0x187)]={'add':add_1[a201_0x5e3419(0x187)],'remove':remove_1['default'],'modify':modify_1[a201_0x5e3419(0x187)],'blacklist':blacklist_1[a201_0x5e3419(0x187)]},exports[a201_0x5e3419(0x18e)]=__spreadArray(__spreadArray(__spreadArray(__spreadArray([],add_1[a201_0x5e3419(0x18e)],!![]),remove_1[a201_0x5e3419(0x18e)],!![]),blacklist_1[a201_0x5e3419(0x18e)],!![]),modify_1[a201_0x5e3419(0x18e)],!![]); \ No newline at end of file diff --git a/plugins/templates/policies/user/modify/index.js b/plugins/templates/policies/user/modify/index.js index f50d49d..eb75ec1 100644 --- a/plugins/templates/policies/user/modify/index.js +++ b/plugins/templates/policies/user/modify/index.js @@ -1,47 +1 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -var policies_2 = require("./policies"); -var policies_3 = require("./policies"); -var policies_4 = require("./policies"); -exports.default = { - viewer: { - policy: policies_1.viewer_policies, - scope: policies_1.viewer_scope, - restrict: policies_1.viewer_restrict, - }, - contentMgr: { - policy: policies_2.content_mgr_policies, - scope: policies_2.content_mgr_scope, - restrict: policies_2.content_mgr_restrict, - }, - mods: { - policy: policies_3.mods_policies, - scope: policies_3.mods_scope, - restrict: policies_3.mods_restrict, - }, - manager: { - policy: policies_4.mgr_policies, - scope: policies_4.mgr_scope, - restrict: policies_4.mgr_restrict, - }, -}; -var viewers = [policies_1.viewer_policies, policies_1.viewer_scope, policies_1.viewer_restrict]; -var contentMgrs = [ - policies_2.content_mgr_policies, - policies_2.content_mgr_scope, - policies_2.content_mgr_restrict, -]; -var mods = [policies_3.mods_policies, policies_3.mods_scope, policies_3.mods_restrict]; -var mgrs = [policies_4.mgr_policies, policies_4.mgr_scope, policies_4.mgr_restrict]; -exports.map = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], viewers, true), contentMgrs, true), mods, true), mgrs, true); +'use strict';var a202_0x3295db=a202_0x3c36;function a202_0x3c36(_0x23a0ae,_0x588a25){var _0x1cda75=a202_0x1cda();return a202_0x3c36=function(_0x3c3619,_0x58108f){_0x3c3619=_0x3c3619-0x106;var _0x2da231=_0x1cda75[_0x3c3619];return _0x2da231;},a202_0x3c36(_0x23a0ae,_0x588a25);}(function(_0x108505,_0x835d77){var _0x618403=a202_0x3c36,_0x75255=_0x108505();while(!![]){try{var _0x4ff8bb=-parseInt(_0x618403(0x109))/0x1+parseInt(_0x618403(0x110))/0x2+parseInt(_0x618403(0x10b))/0x3+parseInt(_0x618403(0x11e))/0x4*(-parseInt(_0x618403(0x108))/0x5)+-parseInt(_0x618403(0x115))/0x6*(parseInt(_0x618403(0x123))/0x7)+-parseInt(_0x618403(0x113))/0x8*(-parseInt(_0x618403(0x106))/0x9)+-parseInt(_0x618403(0x122))/0xa*(-parseInt(_0x618403(0x124))/0xb);if(_0x4ff8bb===_0x835d77)break;else _0x75255['push'](_0x75255['shift']());}catch(_0x2c6e75){_0x75255['push'](_0x75255['shift']());}}}(a202_0x1cda,0x5eb60));var __spreadArray=this&&this[a202_0x3295db(0x119)]||function(_0x487e60,_0x87d0a8,_0xd9fc7b){var _0x540279=a202_0x3295db;if(_0xd9fc7b||arguments['length']===0x2)for(var _0x1a58ab=0x0,_0x1ed3a4=_0x87d0a8['length'],_0x39e832;_0x1a58ab<_0x1ed3a4;_0x1a58ab++){if(_0x39e832||!(_0x1a58ab in _0x87d0a8)){if(!_0x39e832)_0x39e832=Array[_0x540279(0x117)][_0x540279(0x11a)][_0x540279(0x114)](_0x87d0a8,0x0,_0x1a58ab);_0x39e832[_0x1a58ab]=_0x87d0a8[_0x1a58ab];}}return _0x487e60[_0x540279(0x11c)](_0x39e832||Array[_0x540279(0x117)][_0x540279(0x11a)][_0x540279(0x114)](_0x87d0a8));};Object[a202_0x3295db(0x111)](exports,'__esModule',{'value':!![]}),exports[a202_0x3295db(0x10a)]=void 0x0;var policies_1=require(a202_0x3295db(0x11d)),policies_2=require(a202_0x3295db(0x11d)),policies_3=require('./policies'),policies_4=require('./policies');exports[a202_0x3295db(0x11f)]={'viewer':{'policy':policies_1[a202_0x3295db(0x112)],'scope':policies_1[a202_0x3295db(0x10d)],'restrict':policies_1[a202_0x3295db(0x11b)]},'contentMgr':{'policy':policies_2['content_mgr_policies'],'scope':policies_2[a202_0x3295db(0x125)],'restrict':policies_2['content_mgr_restrict']},'mods':{'policy':policies_3['mods_policies'],'scope':policies_3[a202_0x3295db(0x116)],'restrict':policies_3[a202_0x3295db(0x107)]},'manager':{'policy':policies_4[a202_0x3295db(0x121)],'scope':policies_4[a202_0x3295db(0x10f)],'restrict':policies_4[a202_0x3295db(0x10e)]}};var viewers=[policies_1['viewer_policies'],policies_1['viewer_scope'],policies_1[a202_0x3295db(0x11b)]],contentMgrs=[policies_2[a202_0x3295db(0x118)],policies_2[a202_0x3295db(0x125)],policies_2[a202_0x3295db(0x120)]],mods=[policies_3[a202_0x3295db(0x10c)],policies_3[a202_0x3295db(0x116)],policies_3[a202_0x3295db(0x107)]],mgrs=[policies_4[a202_0x3295db(0x121)],policies_4[a202_0x3295db(0x10f)],policies_4['mgr_restrict']];function a202_0x1cda(){var _0x40e7ed=['7856FeFHdS','default','content_mgr_restrict','mgr_policies','28390PhiGxm','110586wsbHub','3586MRgwiT','content_mgr_scope','397962OqVUBU','mods_restrict','1460YvDvzf','430058gBwrKx','map','2243739EmhNnB','mods_policies','viewer_scope','mgr_restrict','mgr_scope','200766rtDVfe','defineProperty','viewer_policies','8BlyewS','call','162LlqKvO','mods_scope','prototype','content_mgr_policies','__spreadArray','slice','viewer_restrict','concat','./policies'];a202_0x1cda=function(){return _0x40e7ed;};return a202_0x1cda();}exports[a202_0x3295db(0x10a)]=__spreadArray(__spreadArray(__spreadArray(__spreadArray([],viewers,!![]),contentMgrs,!![]),mods,!![]),mgrs,!![]); \ No newline at end of file diff --git a/plugins/templates/policies/user/modify/policies.js b/plugins/templates/policies/user/modify/policies.js index de61204..089e0cf 100644 --- a/plugins/templates/policies/user/modify/policies.js +++ b/plugins/templates/policies/user/modify/policies.js @@ -1,83 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Modifying Info Related to Various Types of Users - * @module - User[Modify] - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mgr_restrict = exports.mgr_scope = exports.mgr_policies = exports.mods_restrict = exports.mods_scope = exports.mods_policies = exports.content_mgr_restrict = exports.content_mgr_scope = exports.content_mgr_policies = exports.viewer_restrict = exports.viewer_scope = exports.viewer_policies = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("p-user-m@".concat(num)); }; -exports.viewer_policies = { - _id: objectID('001'), - name: 'Edit Policies of Viewer', - message: 'Enable Granting/Removing Policies to Viewers and its Delegates', - global_flag: true, -}; -exports.viewer_scope = { - _id: objectID('002'), - name: 'Edit Scopes of Viewers', - message: 'Enable Granting/Removing of Scopes to Viewers and its Delegates', - global_flag: true, -}; -exports.viewer_restrict = { - _id: objectID('003'), - name: 'Restrict Viewers', - message: 'Restrict Users and its Delegates', - global_flag: true, -}; -exports.content_mgr_policies = { - _id: objectID('004'), - name: 'Edit Policies of Content Manager', - message: 'Enable Granting/Removing Policies to Content Managers and its Delegates', - global_flag: true, -}; -exports.content_mgr_scope = { - _id: objectID('005'), - name: 'Edit Scopes of Content Managers', - message: 'Enable Granting/Removing of Scopes to Content Managers and its Delegates', - global_flag: true, -}; -exports.content_mgr_restrict = { - _id: objectID('006'), - name: 'Restrict Content Managers', - message: 'Restrict Content Managers and its Delegates', - global_flag: true, -}; -exports.mods_policies = { - _id: objectID('007'), - name: 'Edit Policies of Moderators', - message: 'Enable Granting/Removing Policies to Moderators and its Delegates', - global_flag: true, -}; -exports.mods_scope = { - _id: objectID('008'), - name: 'Edit Scopes of Moderators', - message: 'Enable Granting/Removing of Scopes to Moderators and its Delegates', - global_flag: true, -}; -exports.mods_restrict = { - _id: objectID('009'), - name: 'Restrict Moderators', - message: 'Restrict Moderators and its Delegates', - global_flag: true, -}; -exports.mgr_policies = { - _id: objectID('010'), - name: 'Edit Policies of Managers', - message: 'Enable Granting/Removing Policies to Managers and its Delegates', - global_flag: true, -}; -exports.mgr_scope = { - _id: objectID('011'), - name: 'Edit Scopes of Managers', - message: 'Enable Granting/Removing of Scopes to Managers and its Delegates', - global_flag: true, -}; -exports.mgr_restrict = { - _id: objectID('012'), - name: 'Restrict Managers', - message: 'Restrict Managers and its Delegates', - global_flag: true, -}; +'use strict';function a203_0x46cb(_0x2b8171,_0x2694d0){var _0x3e4c8f=a203_0x3e4c();return a203_0x46cb=function(_0x46cb28,_0x1bfa42){_0x46cb28=_0x46cb28-0x125;var _0x46c91e=_0x3e4c8f[_0x46cb28];return _0x46c91e;},a203_0x46cb(_0x2b8171,_0x2694d0);}var a203_0xb29e84=a203_0x46cb;(function(_0x232d6c,_0x1a0913){var _0x1f0a3e=a203_0x46cb,_0x195aac=_0x232d6c();while(!![]){try{var _0x531f01=parseInt(_0x1f0a3e(0x153))/0x1+-parseInt(_0x1f0a3e(0x157))/0x2+-parseInt(_0x1f0a3e(0x14f))/0x3*(-parseInt(_0x1f0a3e(0x13e))/0x4)+-parseInt(_0x1f0a3e(0x15a))/0x5+-parseInt(_0x1f0a3e(0x14b))/0x6*(-parseInt(_0x1f0a3e(0x127))/0x7)+-parseInt(_0x1f0a3e(0x143))/0x8+-parseInt(_0x1f0a3e(0x128))/0x9*(-parseInt(_0x1f0a3e(0x12e))/0xa);if(_0x531f01===_0x1a0913)break;else _0x195aac['push'](_0x195aac['shift']());}catch(_0x17f7ba){_0x195aac['push'](_0x195aac['shift']());}}}(a203_0x3e4c,0x3f949));function a203_0x3e4c(){var _0x44907d=['Restrict\x20Viewers','Enable\x20Granting/Removing\x20of\x20Scopes\x20to\x20Moderators\x20and\x20its\x20Delegates','Types','752332AsyKKn','Restrict\x20Managers','content_mgr_restrict','2271475KBsaAX','mods_policies','Restrict\x20Managers\x20and\x20its\x20Delegates','1253QYGjtu','117IvSCJs','viewer_policies','Enable\x20Granting/Removing\x20Policies\x20to\x20Content\x20Managers\x20and\x20its\x20Delegates','Enable\x20Granting/Removing\x20of\x20Scopes\x20to\x20Viewers\x20and\x20its\x20Delegates','Restrict\x20Moderators\x20and\x20its\x20Delegates','Enable\x20Granting/Removing\x20Policies\x20to\x20Managers\x20and\x20its\x20Delegates','267230HCVUDp','012','viewer_restrict','Restrict\x20Moderators','003','011','Enable\x20Granting/Removing\x20Policies\x20to\x20Viewers\x20and\x20its\x20Delegates','005','Edit\x20Scopes\x20of\x20Viewers','concat','Edit\x20Policies\x20of\x20Moderators','008','002','p-user-m@','content_mgr_scope','Enable\x20Granting/Removing\x20of\x20Scopes\x20to\x20Managers\x20and\x20its\x20Delegates','4aLZslv','Edit\x20Policies\x20of\x20Viewer','mods_scope','Restrict\x20Content\x20Managers','001','1302464NLhqtW','ObjectId','010','Enable\x20Granting/Removing\x20Policies\x20to\x20Moderators\x20and\x20its\x20Delegates','Edit\x20Policies\x20of\x20Content\x20Manager','__esModule','mgr_restrict','Enable\x20Granting/Removing\x20of\x20Scopes\x20to\x20Content\x20Managers\x20and\x20its\x20Delegates','9054hbaegW','mods_restrict','mongoose','mgr_scope','1439103yFWZGA','mgr_policies','009','viewer_scope','156483mqWOvk'];a203_0x3e4c=function(){return _0x44907d;};return a203_0x3e4c();}Object['defineProperty'](exports,a203_0xb29e84(0x148),{'value':!![]}),exports[a203_0xb29e84(0x149)]=exports[a203_0xb29e84(0x14e)]=exports[a203_0xb29e84(0x150)]=exports[a203_0xb29e84(0x14c)]=exports[a203_0xb29e84(0x140)]=exports[a203_0xb29e84(0x125)]=exports[a203_0xb29e84(0x159)]=exports[a203_0xb29e84(0x13c)]=exports['content_mgr_policies']=exports[a203_0xb29e84(0x130)]=exports[a203_0xb29e84(0x152)]=exports[a203_0xb29e84(0x129)]=void 0x0;var mongoose_1=require(a203_0xb29e84(0x14d)),objectID=function(_0xd782ae){var _0x35917d=a203_0xb29e84;return mongoose_1[_0x35917d(0x156)][_0x35917d(0x144)](_0x35917d(0x13b)[_0x35917d(0x137)](_0xd782ae));};exports[a203_0xb29e84(0x129)]={'_id':objectID(a203_0xb29e84(0x142)),'name':a203_0xb29e84(0x13f),'message':a203_0xb29e84(0x134),'global_flag':!![]},exports[a203_0xb29e84(0x152)]={'_id':objectID(a203_0xb29e84(0x13a)),'name':a203_0xb29e84(0x136),'message':a203_0xb29e84(0x12b),'global_flag':!![]},exports[a203_0xb29e84(0x130)]={'_id':objectID(a203_0xb29e84(0x132)),'name':a203_0xb29e84(0x154),'message':'Restrict\x20Users\x20and\x20its\x20Delegates','global_flag':!![]},exports['content_mgr_policies']={'_id':objectID('004'),'name':a203_0xb29e84(0x147),'message':a203_0xb29e84(0x12a),'global_flag':!![]},exports[a203_0xb29e84(0x13c)]={'_id':objectID(a203_0xb29e84(0x135)),'name':'Edit\x20Scopes\x20of\x20Content\x20Managers','message':a203_0xb29e84(0x14a),'global_flag':!![]},exports[a203_0xb29e84(0x159)]={'_id':objectID('006'),'name':a203_0xb29e84(0x141),'message':'Restrict\x20Content\x20Managers\x20and\x20its\x20Delegates','global_flag':!![]},exports[a203_0xb29e84(0x125)]={'_id':objectID('007'),'name':a203_0xb29e84(0x138),'message':a203_0xb29e84(0x146),'global_flag':!![]},exports[a203_0xb29e84(0x140)]={'_id':objectID(a203_0xb29e84(0x139)),'name':'Edit\x20Scopes\x20of\x20Moderators','message':a203_0xb29e84(0x155),'global_flag':!![]},exports[a203_0xb29e84(0x14c)]={'_id':objectID(a203_0xb29e84(0x151)),'name':a203_0xb29e84(0x131),'message':a203_0xb29e84(0x12c),'global_flag':!![]},exports[a203_0xb29e84(0x150)]={'_id':objectID(a203_0xb29e84(0x145)),'name':'Edit\x20Policies\x20of\x20Managers','message':a203_0xb29e84(0x12d),'global_flag':!![]},exports[a203_0xb29e84(0x14e)]={'_id':objectID(a203_0xb29e84(0x133)),'name':'Edit\x20Scopes\x20of\x20Managers','message':a203_0xb29e84(0x13d),'global_flag':!![]},exports[a203_0xb29e84(0x149)]={'_id':objectID(a203_0xb29e84(0x12f)),'name':a203_0xb29e84(0x158),'message':a203_0xb29e84(0x126),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/policies/user/remove/index.js b/plugins/templates/policies/user/remove/index.js index 2666972..fdf2590 100644 --- a/plugins/templates/policies/user/remove/index.js +++ b/plugins/templates/policies/user/remove/index.js @@ -1,11 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = void 0; -var policies_1 = require("./policies"); -exports.default = { - viewer: policies_1.viewer_rm, - contentMgr: policies_1.content_mgr_rm, - mod: policies_1.mods_rm, - manager: policies_1.mgr_rm, -}; -exports.map = [policies_1.viewer_rm, policies_1.content_mgr_rm, policies_1.mods_rm, policies_1.mgr_rm]; +'use strict';var a204_0x3ef625=a204_0x1437;(function(_0x450b25,_0x193954){var _0x4e7761=a204_0x1437,_0x3ac125=_0x450b25();while(!![]){try{var _0xe7041e=-parseInt(_0x4e7761(0x98))/0x1+-parseInt(_0x4e7761(0x99))/0x2*(-parseInt(_0x4e7761(0xa2))/0x3)+-parseInt(_0x4e7761(0xa1))/0x4*(-parseInt(_0x4e7761(0x97))/0x5)+parseInt(_0x4e7761(0xa8))/0x6+parseInt(_0x4e7761(0x9e))/0x7*(-parseInt(_0x4e7761(0x9f))/0x8)+-parseInt(_0x4e7761(0xa4))/0x9*(parseInt(_0x4e7761(0xa9))/0xa)+-parseInt(_0x4e7761(0xa3))/0xb*(-parseInt(_0x4e7761(0xa5))/0xc);if(_0xe7041e===_0x193954)break;else _0x3ac125['push'](_0x3ac125['shift']());}catch(_0x3c2a1d){_0x3ac125['push'](_0x3ac125['shift']());}}}(a204_0x2924,0x1bd09));function a204_0x1437(_0x16cffb,_0x4fdcf2){var _0x292431=a204_0x2924();return a204_0x1437=function(_0x1437a8,_0xe4ce42){_0x1437a8=_0x1437a8-0x97;var _0x5b2724=_0x292431[_0x1437a8];return _0x5b2724;},a204_0x1437(_0x16cffb,_0x4fdcf2);}function a204_0x2924(){var _0x355a9d=['306171NbwnSK','72Mjtcxy','viewer_rm','__esModule','233970UZmmfy','50CsIsMx','4090hZkKRZ','106845iAoqIF','36098jQyQNN','content_mgr_rm','default','map','mods_rm','9002WBRYTZ','824aUFLlH','mgr_rm','48SDBYRU','18yMWfSH','671407hKVkRy'];a204_0x2924=function(){return _0x355a9d;};return a204_0x2924();}Object['defineProperty'](exports,a204_0x3ef625(0xa7),{'value':!![]}),exports[a204_0x3ef625(0x9c)]=void 0x0;var policies_1=require('./policies');exports[a204_0x3ef625(0x9b)]={'viewer':policies_1['viewer_rm'],'contentMgr':policies_1[a204_0x3ef625(0x9a)],'mod':policies_1['mods_rm'],'manager':policies_1[a204_0x3ef625(0xa0)]},exports[a204_0x3ef625(0x9c)]=[policies_1[a204_0x3ef625(0xa6)],policies_1['content_mgr_rm'],policies_1[a204_0x3ef625(0x9d)],policies_1[a204_0x3ef625(0xa0)]]; \ No newline at end of file diff --git a/plugins/templates/policies/user/remove/policies.js b/plugins/templates/policies/user/remove/policies.js index e893472..12f3304 100644 --- a/plugins/templates/policies/user/remove/policies.js +++ b/plugins/templates/policies/user/remove/policies.js @@ -1,35 +1 @@ -"use strict"; -/** - * @file Policy Definition File - * @description Policies Related to Removing Various Types of Users - * @module - User[Remove] - * @author Sudharshan TK - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mgr_rm = exports.mods_rm = exports.content_mgr_rm = exports.viewer_rm = void 0; -var mongoose_1 = require("mongoose"); -var objectID = function (num) { return mongoose_1.Types.ObjectId("p-user-r@".concat(num)); }; -exports.viewer_rm = { - _id: objectID('001'), - name: 'Remove Viewer', - message: 'Enable Removal of Viewers and its Delegates', - global_flag: true, -}; -exports.content_mgr_rm = { - _id: objectID('002'), - name: 'Remove Content Managers', - message: 'Enable Removal of Content Managers and Delegates', - global_flag: true, -}; -exports.mods_rm = { - _id: objectID('003'), - name: 'Remove Moderators', - message: 'Enable Removal of Moderators and Delegates', - global_flag: true, -}; -exports.mgr_rm = { - _id: objectID('004'), - name: 'Remove Managers', - message: 'Enable Removal of Managers and Delegates', - global_flag: true, -}; +'use strict';function a205_0x3ff8(_0x2229e9,_0x531132){var _0x57b8b9=a205_0x57b8();return a205_0x3ff8=function(_0x3ff8e4,_0x3de90e){_0x3ff8e4=_0x3ff8e4-0x156;var _0x19717a=_0x57b8b9[_0x3ff8e4];return _0x19717a;},a205_0x3ff8(_0x2229e9,_0x531132);}var a205_0x56c125=a205_0x3ff8;function a205_0x57b8(){var _0x55c12d=['1560530XelTLi','5OOAHla','002','318450wFYZPM','p-user-r@','22rQyiFW','viewer_rm','Enable\x20Removal\x20of\x20Content\x20Managers\x20and\x20Delegates','003','9XpjGDB','concat','36048WojkcA','mongoose','Remove\x20Moderators','7oHqyhX','13162097ChVEfB','685052aZMMTI','mgr_rm','mods_rm','12bnoejn','Remove\x20Viewer','Enable\x20Removal\x20of\x20Managers\x20and\x20Delegates','1289912pkYIYp','defineProperty','Enable\x20Removal\x20of\x20Viewers\x20and\x20its\x20Delegates','1622082DCNwCM','004','9sNewBJ','Remove\x20Content\x20Managers'];a205_0x57b8=function(){return _0x55c12d;};return a205_0x57b8();}(function(_0x493979,_0x2019d8){var _0x265894=a205_0x3ff8,_0x3063b3=_0x493979();while(!![]){try{var _0x4b64b0=-parseInt(_0x265894(0x16d))/0x1*(-parseInt(_0x265894(0x15d))/0x2)+parseInt(_0x265894(0x172))/0x3+parseInt(_0x265894(0x162))/0x4*(parseInt(_0x265894(0x170))/0x5)+parseInt(_0x265894(0x16b))/0x6*(parseInt(_0x265894(0x160))/0x7)+-parseInt(_0x265894(0x168))/0x8*(-parseInt(_0x265894(0x15b))/0x9)+-parseInt(_0x265894(0x16f))/0xa*(-parseInt(_0x265894(0x157))/0xb)+parseInt(_0x265894(0x165))/0xc*(-parseInt(_0x265894(0x161))/0xd);if(_0x4b64b0===_0x2019d8)break;else _0x3063b3['push'](_0x3063b3['shift']());}catch(_0x3629a1){_0x3063b3['push'](_0x3063b3['shift']());}}}(a205_0x57b8,0x29b64));Object[a205_0x56c125(0x169)](exports,'__esModule',{'value':!![]}),exports['mgr_rm']=exports[a205_0x56c125(0x164)]=exports['content_mgr_rm']=exports[a205_0x56c125(0x158)]=void 0x0;var mongoose_1=require(a205_0x56c125(0x15e)),objectID=function(_0x36ac1f){var _0x2ab696=a205_0x56c125;return mongoose_1['Types']['ObjectId'](_0x2ab696(0x156)[_0x2ab696(0x15c)](_0x36ac1f));};exports[a205_0x56c125(0x158)]={'_id':objectID('001'),'name':a205_0x56c125(0x166),'message':a205_0x56c125(0x16a),'global_flag':!![]},exports['content_mgr_rm']={'_id':objectID(a205_0x56c125(0x171)),'name':a205_0x56c125(0x16e),'message':a205_0x56c125(0x159),'global_flag':!![]},exports['mods_rm']={'_id':objectID(a205_0x56c125(0x15a)),'name':a205_0x56c125(0x15f),'message':'Enable\x20Removal\x20of\x20Moderators\x20and\x20Delegates','global_flag':!![]},exports[a205_0x56c125(0x163)]={'_id':objectID(a205_0x56c125(0x16c)),'name':'Remove\x20Managers','message':a205_0x56c125(0x167),'global_flag':!![]}; \ No newline at end of file diff --git a/plugins/templates/roles/index.js b/plugins/templates/roles/index.js index 555ca6c..98573f7 100644 --- a/plugins/templates/roles/index.js +++ b/plugins/templates/roles/index.js @@ -1,71 +1 @@ -"use strict"; -/** - * @file Role Definition File - * @description Describes different Properties for each Role in the Organisation - * @author Sudharshan TK - * - * Note: This Will be used only at the time of First Setup - */ -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.map = exports.owner = exports.manager = exports.moderator = exports.contentMgr = exports.viewer = void 0; -var mongoose_1 = require("mongoose"); -// policies -var owner_1 = __importDefault(require("./policies-map/owner")); -var manager_1 = __importDefault(require("./policies-map/manager")); -var moderator_1 = __importDefault(require("./policies-map/moderator")); -var content_manager_1 = __importDefault(require("./policies-map/content-manager")); -var objectID = function (num) { return mongoose_1.Types.ObjectId("rol-main@".concat(num)); }; -var IDS = { - viewer: objectID('001'), - contentMgr: objectID('002'), - moderator: objectID('003'), - manager: objectID('004'), - owner: objectID('005'), -}; -exports.viewer = { - _id: IDS.viewer, - name: 'Viewer', - alias: 'Viewer', - type: 'main', - parent_role: IDS.contentMgr, - allowed_policies: [], -}; -exports.contentMgr = { - _id: IDS.contentMgr, - name: 'Content Manager', - alias: 'Content Manager', - type: 'main', - parent_role: IDS.moderator, - child_role: exports.viewer._id, - allowed_policies: content_manager_1.default, -}; -exports.moderator = { - _id: IDS.moderator, - name: 'Moderator', - alias: 'Moderator', - type: 'main', - parent_role: IDS.owner, - child_role: IDS.contentMgr, - allowed_policies: moderator_1.default, -}; -exports.manager = { - _id: IDS.manager, - name: 'Owner', - alias: 'Owner', - type: 'main', - parent_role: IDS.owner, - child_role: IDS.moderator, - allowed_policies: manager_1.default, -}; -exports.owner = { - _id: IDS.owner, - name: 'Owner', - alias: 'Owner', - type: 'main', - child_role: IDS.manager, - allowed_policies: owner_1.default, -}; -exports.map = [exports.viewer, exports.contentMgr, exports.moderator, exports.owner]; +'use strict';var a206_0x5b3731=a206_0x3683;(function(_0x174b11,_0x13dba3){var _0x571d77=a206_0x3683,_0x7c7e45=_0x174b11();while(!![]){try{var _0xe43873=-parseInt(_0x571d77(0xd9))/0x1*(parseInt(_0x571d77(0xe7))/0x2)+-parseInt(_0x571d77(0xcf))/0x3+-parseInt(_0x571d77(0xd0))/0x4*(parseInt(_0x571d77(0xe8))/0x5)+-parseInt(_0x571d77(0xd2))/0x6+parseInt(_0x571d77(0xe9))/0x7+parseInt(_0x571d77(0xd6))/0x8+parseInt(_0x571d77(0xd7))/0x9*(parseInt(_0x571d77(0xe4))/0xa);if(_0xe43873===_0x13dba3)break;else _0x7c7e45['push'](_0x7c7e45['shift']());}catch(_0x1ce3a8){_0x7c7e45['push'](_0x7c7e45['shift']());}}}(a206_0x49d4,0x5333e));var __importDefault=this&&this[a206_0x5b3731(0xe1)]||function(_0x1f8a20){return _0x1f8a20&&_0x1f8a20['__esModule']?_0x1f8a20:{'default':_0x1f8a20};};Object['defineProperty'](exports,a206_0x5b3731(0xd1),{'value':!![]}),exports[a206_0x5b3731(0xcd)]=exports[a206_0x5b3731(0xcb)]=exports[a206_0x5b3731(0xd3)]=exports[a206_0x5b3731(0xdf)]=exports[a206_0x5b3731(0xce)]=exports['viewer']=void 0x0;var mongoose_1=require('mongoose'),owner_1=__importDefault(require(a206_0x5b3731(0xdb))),manager_1=__importDefault(require(a206_0x5b3731(0xe6))),moderator_1=__importDefault(require('./policies-map/moderator')),content_manager_1=__importDefault(require('./policies-map/content-manager')),objectID=function(_0x6abf46){var _0x56dbba=a206_0x5b3731;return mongoose_1[_0x56dbba(0xcc)][_0x56dbba(0xe0)]('rol-main@'[_0x56dbba(0xd8)](_0x6abf46));},IDS={'viewer':objectID('001'),'contentMgr':objectID('002'),'moderator':objectID(a206_0x5b3731(0xde)),'manager':objectID(a206_0x5b3731(0xe2)),'owner':objectID('005')};function a206_0x3683(_0x4c457a,_0x41bfaf){var _0x49d480=a206_0x49d4();return a206_0x3683=function(_0x36839b,_0x4031ea){_0x36839b=_0x36839b-0xcb;var _0x9ffa20=_0x49d480[_0x36839b];return _0x9ffa20;},a206_0x3683(_0x4c457a,_0x41bfaf);}exports['viewer']={'_id':IDS['viewer'],'name':a206_0x5b3731(0xe3),'alias':a206_0x5b3731(0xe3),'type':a206_0x5b3731(0xea),'parent_role':IDS[a206_0x5b3731(0xce)],'allowed_policies':[]},exports['contentMgr']={'_id':IDS[a206_0x5b3731(0xce)],'name':a206_0x5b3731(0xdd),'alias':a206_0x5b3731(0xdd),'type':a206_0x5b3731(0xea),'parent_role':IDS['moderator'],'child_role':exports['viewer'][a206_0x5b3731(0xd4)],'allowed_policies':content_manager_1[a206_0x5b3731(0xd5)]},exports[a206_0x5b3731(0xdf)]={'_id':IDS[a206_0x5b3731(0xdf)],'name':a206_0x5b3731(0xda),'alias':'Moderator','type':a206_0x5b3731(0xea),'parent_role':IDS[a206_0x5b3731(0xcb)],'child_role':IDS[a206_0x5b3731(0xce)],'allowed_policies':moderator_1[a206_0x5b3731(0xd5)]},exports[a206_0x5b3731(0xd3)]={'_id':IDS['manager'],'name':'Owner','alias':a206_0x5b3731(0xdc),'type':a206_0x5b3731(0xea),'parent_role':IDS[a206_0x5b3731(0xcb)],'child_role':IDS[a206_0x5b3731(0xdf)],'allowed_policies':manager_1[a206_0x5b3731(0xd5)]},exports[a206_0x5b3731(0xcb)]={'_id':IDS[a206_0x5b3731(0xcb)],'name':a206_0x5b3731(0xdc),'alias':a206_0x5b3731(0xdc),'type':a206_0x5b3731(0xea),'child_role':IDS[a206_0x5b3731(0xd3)],'allowed_policies':owner_1[a206_0x5b3731(0xd5)]},exports[a206_0x5b3731(0xcd)]=[exports[a206_0x5b3731(0xe5)],exports[a206_0x5b3731(0xce)],exports['moderator'],exports[a206_0x5b3731(0xcb)]];function a206_0x49d4(){var _0x382b35=['ObjectId','__importDefault','004','Viewer','290KKkLRy','viewer','./policies-map/manager','32hUQTqX','10javRsn','3852954lzTgTS','main','owner','Types','map','contentMgr','1306422zsuKIC','119344tfGHJI','__esModule','1759812KibDua','manager','_id','default','1623304toOKcE','180315iSvzYJ','concat','12819IvpHRv','Moderator','./policies-map/owner','Owner','Content\x20Manager','003','moderator'];a206_0x49d4=function(){return _0x382b35;};return a206_0x49d4();} \ No newline at end of file diff --git a/plugins/templates/roles/policies-map/content-manager.js b/plugins/templates/roles/policies-map/content-manager.js index 1f274df..556f5a4 100644 --- a/plugins/templates/roles/policies-map/content-manager.js +++ b/plugins/templates/roles/policies-map/content-manager.js @@ -1,12 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var policies_1 = require("../../../templates/policies"); -var policies = [ - policies_1.users.add.accept.viewer._id, - policies_1.users.blacklist.viewer._id, - policies_1.users.modify.viewer.policy._id, - policies_1.users.modify.viewer.restrict._id, - policies_1.users.modify.viewer.scope._id, - policies_1.frontends.edit._id, -]; -exports.default = policies; +'use strict';var a207_0x10a793=a207_0x1938;function a207_0x2c6d(){var _0x385f80=['1094505ZvzIGd','scope','49542GZMuLa','260757EmwfAF','_id','frontends','restrict','7557075WHukAF','add','779632nfEgoA','modify','2RNehvz','default','1603288nahNRM','blacklist','viewer','defineProperty','edit','6bfhtGW','policy','../../../templates/policies','__esModule','users','1789890QNjSJJ'];a207_0x2c6d=function(){return _0x385f80;};return a207_0x2c6d();}(function(_0x246047,_0x216b06){var _0x486562=a207_0x1938,_0x5ef7e4=_0x246047();while(!![]){try{var _0x2b7834=-parseInt(_0x486562(0x14d))/0x1+-parseInt(_0x486562(0x13e))/0x2*(-parseInt(_0x486562(0x14a))/0x3)+parseInt(_0x486562(0x140))/0x4+parseInt(_0x486562(0x14b))/0x5+-parseInt(_0x486562(0x145))/0x6*(parseInt(_0x486562(0x14e))/0x7)+parseInt(_0x486562(0x13c))/0x8+-parseInt(_0x486562(0x152))/0x9;if(_0x2b7834===_0x216b06)break;else _0x5ef7e4['push'](_0x5ef7e4['shift']());}catch(_0x49c7b1){_0x5ef7e4['push'](_0x5ef7e4['shift']());}}}(a207_0x2c6d,0x5e90b));Object[a207_0x10a793(0x143)](exports,a207_0x10a793(0x148),{'value':!![]});var policies_1=require(a207_0x10a793(0x147)),policies=[policies_1['users'][a207_0x10a793(0x13b)]['accept']['viewer'][a207_0x10a793(0x14f)],policies_1['users'][a207_0x10a793(0x141)]['viewer'][a207_0x10a793(0x14f)],policies_1[a207_0x10a793(0x149)]['modify']['viewer'][a207_0x10a793(0x146)]['_id'],policies_1[a207_0x10a793(0x149)][a207_0x10a793(0x13d)]['viewer'][a207_0x10a793(0x151)][a207_0x10a793(0x14f)],policies_1[a207_0x10a793(0x149)]['modify'][a207_0x10a793(0x142)][a207_0x10a793(0x14c)][a207_0x10a793(0x14f)],policies_1[a207_0x10a793(0x150)][a207_0x10a793(0x144)][a207_0x10a793(0x14f)]];function a207_0x1938(_0x137f2a,_0x3af276){var _0x2c6d49=a207_0x2c6d();return a207_0x1938=function(_0x19388a,_0x2ec57e){_0x19388a=_0x19388a-0x13b;var _0x448ed1=_0x2c6d49[_0x19388a];return _0x448ed1;},a207_0x1938(_0x137f2a,_0x3af276);}exports[a207_0x10a793(0x13f)]=policies; \ No newline at end of file diff --git a/plugins/templates/roles/policies-map/manager.js b/plugins/templates/roles/policies-map/manager.js index 5636e44..082ae2e 100644 --- a/plugins/templates/roles/policies-map/manager.js +++ b/plugins/templates/roles/policies-map/manager.js @@ -1,33 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var policies_1 = require("../../../templates/policies"); -var policies = [ - policies_1.users.add.accept.contentMgr._id, - policies_1.users.add.accept.mods._id, - policies_1.users.add.accept.viewer._id, - policies_1.users.blacklist.manager._id, - policies_1.users.blacklist.mods._id, - policies_1.users.blacklist.viewer._id, - policies_1.users.modify.contentMgr.policy._id, - policies_1.users.modify.contentMgr.restrict._id, - policies_1.users.modify.contentMgr.scope._id, - policies_1.users.modify.mods.policy._id, - policies_1.users.modify.mods.restrict._id, - policies_1.users.modify.mods.scope._id, - policies_1.users.modify.viewer.policy._id, - policies_1.users.modify.viewer.restrict._id, - policies_1.users.modify.viewer.scope._id, - policies_1.frontends.edit._id, - policies_1.globalSettings.edit._id, - policies_1.roles.add._id, - policies_1.roles.edit._id, - policies_1.roles.remove._id, - policies_1.policy.edit._id, - policies_1.smtpProviders.add._id, - policies_1.smtpProviders.edit._id, - policies_1.smtpProviders.remove._id, - policies_1.smtpMailers.add._id, - policies_1.smtpMailers.edit._id, - policies_1.smtpMailers.remove._id, -]; -exports.default = policies; +'use strict';function a208_0x1b11(_0xc2303,_0x39ab56){var _0x3986ab=a208_0x3986();return a208_0x1b11=function(_0x1b11b7,_0x2fae84){_0x1b11b7=_0x1b11b7-0x15f;var _0x35f219=_0x3986ab[_0x1b11b7];return _0x35f219;},a208_0x1b11(_0xc2303,_0x39ab56);}var a208_0x3852f7=a208_0x1b11;(function(_0x5941dc,_0x521cdd){var _0x2910ef=a208_0x1b11,_0x2eb6cb=_0x5941dc();while(!![]){try{var _0x1bc5a7=-parseInt(_0x2910ef(0x169))/0x1*(parseInt(_0x2910ef(0x172))/0x2)+-parseInt(_0x2910ef(0x174))/0x3*(-parseInt(_0x2910ef(0x17a))/0x4)+parseInt(_0x2910ef(0x16c))/0x5*(parseInt(_0x2910ef(0x179))/0x6)+parseInt(_0x2910ef(0x163))/0x7+parseInt(_0x2910ef(0x16e))/0x8+parseInt(_0x2910ef(0x162))/0x9*(parseInt(_0x2910ef(0x171))/0xa)+parseInt(_0x2910ef(0x164))/0xb*(-parseInt(_0x2910ef(0x177))/0xc);if(_0x1bc5a7===_0x521cdd)break;else _0x2eb6cb['push'](_0x2eb6cb['shift']());}catch(_0x2557de){_0x2eb6cb['push'](_0x2eb6cb['shift']());}}}(a208_0x3986,0x49295));function a208_0x3986(){var _0x41dd93=['mods','1406480tySqMT','smtpMailers','restrict','10PMLotq','184bRxsOe','remove','128595VtgAqy','_id','smtpProviders','231324tCtqUo','add','201330eCfkKi','36IiFEvS','defineProperty','policy','accept','../../../templates/policies','scope','default','edit','__esModule','modify','330714vAcpXW','3856496OCytxe','484JuqUmk','frontends','roles','users','viewer','5851mqUhRJ','blacklist','contentMgr','80mVADUd'];a208_0x3986=function(){return _0x41dd93;};return a208_0x3986();}Object[a208_0x3852f7(0x17b)](exports,a208_0x3852f7(0x160),{'value':!![]});var policies_1=require(a208_0x3852f7(0x17e)),policies=[policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x178)][a208_0x3852f7(0x17d)][a208_0x3852f7(0x16b)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x178)][a208_0x3852f7(0x17d)]['mods'][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x178)][a208_0x3852f7(0x17d)][a208_0x3852f7(0x168)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x16a)]['manager'][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x16a)]['mods'][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)]['blacklist'][a208_0x3852f7(0x168)]['_id'],policies_1[a208_0x3852f7(0x167)]['modify'][a208_0x3852f7(0x16b)][a208_0x3852f7(0x17c)]['_id'],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x161)][a208_0x3852f7(0x16b)][a208_0x3852f7(0x170)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x161)][a208_0x3852f7(0x16b)][a208_0x3852f7(0x17f)]['_id'],policies_1[a208_0x3852f7(0x167)]['modify'][a208_0x3852f7(0x16d)]['policy']['_id'],policies_1[a208_0x3852f7(0x167)]['modify'][a208_0x3852f7(0x16d)]['restrict'][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)]['modify'][a208_0x3852f7(0x16d)][a208_0x3852f7(0x17f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x161)][a208_0x3852f7(0x168)][a208_0x3852f7(0x17c)][a208_0x3852f7(0x175)],policies_1['users'][a208_0x3852f7(0x161)]['viewer'][a208_0x3852f7(0x170)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x167)][a208_0x3852f7(0x161)][a208_0x3852f7(0x168)][a208_0x3852f7(0x17f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x165)]['edit'][a208_0x3852f7(0x175)],policies_1['globalSettings'][a208_0x3852f7(0x15f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x166)]['add']['_id'],policies_1[a208_0x3852f7(0x166)][a208_0x3852f7(0x15f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x166)][a208_0x3852f7(0x173)][a208_0x3852f7(0x175)],policies_1['policy'][a208_0x3852f7(0x15f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x176)]['add'][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x176)][a208_0x3852f7(0x15f)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x176)][a208_0x3852f7(0x173)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x16f)][a208_0x3852f7(0x178)][a208_0x3852f7(0x175)],policies_1[a208_0x3852f7(0x16f)][a208_0x3852f7(0x15f)][a208_0x3852f7(0x175)],policies_1['smtpMailers'][a208_0x3852f7(0x173)][a208_0x3852f7(0x175)]];exports[a208_0x3852f7(0x180)]=policies; \ No newline at end of file diff --git a/plugins/templates/roles/policies-map/moderator.js b/plugins/templates/roles/policies-map/moderator.js index ffd66da..1c7f048 100644 --- a/plugins/templates/roles/policies-map/moderator.js +++ b/plugins/templates/roles/policies-map/moderator.js @@ -1,16 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var policies_1 = require("../../../templates/policies"); -var policies = [ - policies_1.users.add.accept.contentMgr._id, - policies_1.users.add.accept.viewer._id, - policies_1.users.blacklist.manager._id, - policies_1.users.blacklist.viewer._id, - policies_1.users.modify.contentMgr.policy._id, - policies_1.users.modify.contentMgr.restrict._id, - policies_1.users.modify.contentMgr.scope._id, - policies_1.users.modify.viewer.policy._id, - policies_1.users.modify.viewer.restrict._id, - policies_1.users.modify.viewer.scope._id, -]; -exports.default = policies; +'use strict';var a209_0x59c3e3=a209_0x3411;function a209_0x3411(_0x388f8f,_0xfac87c){var _0x54d68b=a209_0x54d6();return a209_0x3411=function(_0x341199,_0x1800cd){_0x341199=_0x341199-0x1e9;var _0x2be4bb=_0x54d68b[_0x341199];return _0x2be4bb;},a209_0x3411(_0x388f8f,_0xfac87c);}(function(_0x6c78e2,_0x1fb808){var _0x14b09c=a209_0x3411,_0x4c99ef=_0x6c78e2();while(!![]){try{var _0x1b71c1=-parseInt(_0x14b09c(0x1f5))/0x1*(parseInt(_0x14b09c(0x1fa))/0x2)+parseInt(_0x14b09c(0x1ed))/0x3*(-parseInt(_0x14b09c(0x1fe))/0x4)+parseInt(_0x14b09c(0x1f9))/0x5*(parseInt(_0x14b09c(0x1ee))/0x6)+parseInt(_0x14b09c(0x1e9))/0x7+parseInt(_0x14b09c(0x1eb))/0x8+parseInt(_0x14b09c(0x1f2))/0x9+-parseInt(_0x14b09c(0x1f1))/0xa*(parseInt(_0x14b09c(0x1ec))/0xb);if(_0x1b71c1===_0x1fb808)break;else _0x4c99ef['push'](_0x4c99ef['shift']());}catch(_0xf0bced){_0x4c99ef['push'](_0x4c99ef['shift']());}}}(a209_0x54d6,0xbe82f));function a209_0x54d6(){var _0x26ae47=['_id','scope','60LYRrfU','8588142TstWIL','accept','contentMgr','2769koWybB','viewer','add','policy','25pkkLCg','326inkLIy','modify','defineProperty','restrict','2621204hmJiIj','users','default','10233146tmdBgq','blacklist','10061416OwOzvL','3305929SimCaN','6eLPqen','806070LlcBPZ'];a209_0x54d6=function(){return _0x26ae47;};return a209_0x54d6();}Object[a209_0x59c3e3(0x1fc)](exports,'__esModule',{'value':!![]});var policies_1=require('../../../templates/policies'),policies=[policies_1[a209_0x59c3e3(0x1ff)]['add'][a209_0x59c3e3(0x1f3)][a209_0x59c3e3(0x1f4)][a209_0x59c3e3(0x1ef)],policies_1[a209_0x59c3e3(0x1ff)][a209_0x59c3e3(0x1f7)][a209_0x59c3e3(0x1f3)][a209_0x59c3e3(0x1f6)][a209_0x59c3e3(0x1ef)],policies_1[a209_0x59c3e3(0x1ff)]['blacklist']['manager']['_id'],policies_1[a209_0x59c3e3(0x1ff)][a209_0x59c3e3(0x1ea)]['viewer']['_id'],policies_1[a209_0x59c3e3(0x1ff)][a209_0x59c3e3(0x1fb)][a209_0x59c3e3(0x1f4)][a209_0x59c3e3(0x1f8)]['_id'],policies_1[a209_0x59c3e3(0x1ff)][a209_0x59c3e3(0x1fb)][a209_0x59c3e3(0x1f4)][a209_0x59c3e3(0x1fd)][a209_0x59c3e3(0x1ef)],policies_1['users'][a209_0x59c3e3(0x1fb)][a209_0x59c3e3(0x1f4)]['scope'][a209_0x59c3e3(0x1ef)],policies_1['users'][a209_0x59c3e3(0x1fb)][a209_0x59c3e3(0x1f6)][a209_0x59c3e3(0x1f8)]['_id'],policies_1[a209_0x59c3e3(0x1ff)]['modify'][a209_0x59c3e3(0x1f6)][a209_0x59c3e3(0x1fd)][a209_0x59c3e3(0x1ef)],policies_1[a209_0x59c3e3(0x1ff)][a209_0x59c3e3(0x1fb)][a209_0x59c3e3(0x1f6)][a209_0x59c3e3(0x1f0)][a209_0x59c3e3(0x1ef)]];exports[a209_0x59c3e3(0x200)]=policies; \ No newline at end of file diff --git a/plugins/templates/roles/policies-map/owner.js b/plugins/templates/roles/policies-map/owner.js index f6c926f..959bc9f 100644 --- a/plugins/templates/roles/policies-map/owner.js +++ b/plugins/templates/roles/policies-map/owner.js @@ -1,5 +1 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var policies_1 = require("../../../templates/policies"); -var ownerPolicies = policies_1.map.map(function (policy) { return policy._id; }); -exports.default = ownerPolicies; +'use strict';function a210_0x4e5c(_0x1ca198,_0x42e60b){var _0x1e8a13=a210_0x1e8a();return a210_0x4e5c=function(_0x4e5cc8,_0x5b31bb){_0x4e5cc8=_0x4e5cc8-0xe4;var _0x5168b9=_0x1e8a13[_0x4e5cc8];return _0x5168b9;},a210_0x4e5c(_0x1ca198,_0x42e60b);}var a210_0x4fca9=a210_0x4e5c;(function(_0x46d07f,_0x3bd0b0){var _0x3d531b=a210_0x4e5c,_0x4457cd=_0x46d07f();while(!![]){try{var _0x43dbfa=-parseInt(_0x3d531b(0xf0))/0x1*(-parseInt(_0x3d531b(0xf2))/0x2)+parseInt(_0x3d531b(0xed))/0x3*(-parseInt(_0x3d531b(0xe5))/0x4)+parseInt(_0x3d531b(0xe4))/0x5*(parseInt(_0x3d531b(0xe7))/0x6)+parseInt(_0x3d531b(0xe9))/0x7*(parseInt(_0x3d531b(0xf1))/0x8)+-parseInt(_0x3d531b(0xf3))/0x9*(-parseInt(_0x3d531b(0xe6))/0xa)+parseInt(_0x3d531b(0xef))/0xb*(parseInt(_0x3d531b(0xea))/0xc)+-parseInt(_0x3d531b(0xf4))/0xd*(parseInt(_0x3d531b(0xf5))/0xe);if(_0x43dbfa===_0x3bd0b0)break;else _0x4457cd['push'](_0x4457cd['shift']());}catch(_0x279741){_0x4457cd['push'](_0x4457cd['shift']());}}}(a210_0x1e8a,0x2d892));function a210_0x1e8a(){var _0x56cfb0=['336899cGfNSp','656eGRwWb','2SxizUI','27iVNgwz','26GEBEDV','5801096eVZYKo','defineProperty','5YiadcO','24ymPZoW','802390BSMoqB','1239522rguqAI','default','12593RipaBD','2481060kgxgbW','__esModule','map','61617EgMHTx','../../../templates/policies','11IpJmba'];a210_0x1e8a=function(){return _0x56cfb0;};return a210_0x1e8a();}Object[a210_0x4fca9(0xf6)](exports,a210_0x4fca9(0xeb),{'value':!![]});var policies_1=require(a210_0x4fca9(0xee)),ownerPolicies=policies_1['map'][a210_0x4fca9(0xec)](function(_0x34b035){return _0x34b035['_id'];});exports[a210_0x4fca9(0xe8)]=ownerPolicies; \ No newline at end of file diff --git a/routes/auth/credentials/index.js b/routes/auth/credentials/index.js index 3918c74..1760c85 100644 --- a/routes/auth/credentials/index.js +++ b/routes/auth/credentials/index.js @@ -1 +1 @@ -"use strict"; +'use strict';function a211_0x2347(){var _0x26abdd=['982uFgKSB','756LWkuOm','1080264KiVAmu','48CJYgeD','880fGOuoV','686pnvZaa','2299293QCmBJJ','431319OsoAuA','1308724YByaBj','4052750oYFydb'];a211_0x2347=function(){return _0x26abdd;};return a211_0x2347();}(function(_0x5d4766,_0x2c626c){var _0x708b22=a211_0x52dc,_0x1c25f9=_0x5d4766();while(!![]){try{var _0x1159fb=-parseInt(_0x708b22(0x1ab))/0x1*(parseInt(_0x708b22(0x1a6))/0x2)+parseInt(_0x708b22(0x1a8))/0x3+-parseInt(_0x708b22(0x1a4))/0x4+parseInt(_0x708b22(0x1aa))/0x5*(-parseInt(_0x708b22(0x1a7))/0x6)+-parseInt(_0x708b22(0x1a3))/0x7*(-parseInt(_0x708b22(0x1a9))/0x8)+-parseInt(_0x708b22(0x1ac))/0x9+parseInt(_0x708b22(0x1a5))/0xa;if(_0x1159fb===_0x2c626c)break;else _0x1c25f9['push'](_0x1c25f9['shift']());}catch(_0x3e7f9f){_0x1c25f9['push'](_0x1c25f9['shift']());}}}(a211_0x2347,0x2f37d));function a211_0x52dc(_0x3e73d0,_0x69b486){var _0x234792=a211_0x2347();return a211_0x52dc=function(_0x52dcfe,_0x51672b){_0x52dcfe=_0x52dcfe-0x1a3;var _0x16c32b=_0x234792[_0x52dcfe];return _0x16c32b;},a211_0x52dc(_0x3e73d0,_0x69b486);} \ No newline at end of file diff --git a/routes/auth/index.js b/routes/auth/index.js index c742978..9d06a8c 100644 --- a/routes/auth/index.js +++ b/routes/auth/index.js @@ -1,28 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Middlewares -// Response Handlers -var responses_1 = require("../../plugins/server/responses"); -// Routes -var policies_1 = __importDefault(require("./policies")); -var roles_1 = __importDefault(require("./roles")); -var generators_1 = require("../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -// Assign Auth Routes -router.use('/policies', policies_1.default); -router.use('/roles', roles_1.default); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -// Default Get -router.get('/', function (req, res) { - (0, responses_1.okResponse)(res, 'Server Successfully Started'); -}); -exports.default = router; +'use strict';var a212_0x2437a6=a212_0x3796;function a212_0x7952(){var _0x2126b9=['9BTCzAH','default','EndpointGenerator','../../plugins/server/generators','377536npyJIw','191314uVNJIu','__esModule','../../plugins/server/responses','okResponse','Server\x20Successfully\x20Started','express','590955MzodTn','get','/roles','6HwXAtu','use','Router','102132QEAQLF','defineProperty','/policies','14PxATzi','258144JCxOhC','./roles','1764188bubaOH','__importDefault','./policies','post','12663340BkWJyT'];a212_0x7952=function(){return _0x2126b9;};return a212_0x7952();}(function(_0x4dfd5e,_0x5d6f66){var _0x17bfa2=a212_0x3796,_0x32fd3f=_0x4dfd5e();while(!![]){try{var _0x9465d7=-parseInt(_0x17bfa2(0x1cb))/0x1+-parseInt(_0x17bfa2(0x1ca))/0x2+-parseInt(_0x17bfa2(0x1bb))/0x3+-parseInt(_0x17bfa2(0x1c1))/0x4+-parseInt(_0x17bfa2(0x1d1))/0x5*(parseInt(_0x17bfa2(0x1b8))/0x6)+-parseInt(_0x17bfa2(0x1be))/0x7*(parseInt(_0x17bfa2(0x1bf))/0x8)+-parseInt(_0x17bfa2(0x1c6))/0x9*(-parseInt(_0x17bfa2(0x1c5))/0xa);if(_0x9465d7===_0x5d6f66)break;else _0x32fd3f['push'](_0x32fd3f['shift']());}catch(_0x52fc9a){_0x32fd3f['push'](_0x32fd3f['shift']());}}}(a212_0x7952,0x37c52));var __importDefault=this&&this[a212_0x2437a6(0x1c2)]||function(_0x8fc9d3){var _0x32a031=a212_0x2437a6;return _0x8fc9d3&&_0x8fc9d3[_0x32a031(0x1cc)]?_0x8fc9d3:{'default':_0x8fc9d3};};Object[a212_0x2437a6(0x1bc)](exports,'__esModule',{'value':!![]});function a212_0x3796(_0x19e17f,_0xdbe320){var _0x79529a=a212_0x7952();return a212_0x3796=function(_0x379620,_0x40eb27){_0x379620=_0x379620-0x1b7;var _0x362c54=_0x79529a[_0x379620];return _0x362c54;},a212_0x3796(_0x19e17f,_0xdbe320);}var express_1=__importDefault(require(a212_0x2437a6(0x1d0))),responses_1=require(a212_0x2437a6(0x1cd)),policies_1=__importDefault(require(a212_0x2437a6(0x1c3))),roles_1=__importDefault(require(a212_0x2437a6(0x1c0))),generators_1=require(a212_0x2437a6(0x1c9)),router=express_1[a212_0x2437a6(0x1c7)][a212_0x2437a6(0x1ba)]();router[a212_0x2437a6(0x1b9)](a212_0x2437a6(0x1bd),policies_1[a212_0x2437a6(0x1c7)]),router[a212_0x2437a6(0x1b9)](a212_0x2437a6(0x1b7),roles_1[a212_0x2437a6(0x1c7)]),router[a212_0x2437a6(0x1c4)]('/endpoints',function(_0x417cc8,_0x20828b){var _0x12d754=a212_0x2437a6;return new generators_1[(_0x12d754(0x1c8))](_0x20828b,router)['serve']();}),router[a212_0x2437a6(0x1d2)]('/',function(_0x932add,_0x509a90){var _0x5294fb=a212_0x2437a6;(0x0,responses_1[_0x5294fb(0x1ce)])(_0x509a90,_0x5294fb(0x1cf));}),exports[a212_0x2437a6(0x1c7)]=router; \ No newline at end of file diff --git a/routes/auth/policies/index.js b/routes/auth/policies/index.js index d40d46b..b76d8ed 100644 --- a/routes/auth/policies/index.js +++ b/routes/auth/policies/index.js @@ -1,22 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../../plugins/server/responses"); -// Others -var policies_1 = require("../../../plugins/templates/policies"); -var generators_1 = require("../../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -router.post('/list', function (req, res) { - (0, responses_1.okResponse)(res, policies_1.map); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a213_0x165215=a213_0x1608;function a213_0x1608(_0x2669cf,_0x28d10f){var _0x2c47ec=a213_0x2c47();return a213_0x1608=function(_0x160891,_0x3e6a23){_0x160891=_0x160891-0x1c5;var _0x120c45=_0x2c47ec[_0x160891];return _0x120c45;},a213_0x1608(_0x2669cf,_0x28d10f);}(function(_0x576148,_0x532cf3){var _0x19e49b=a213_0x1608,_0x580712=_0x576148();while(!![]){try{var _0x296bc4=-parseInt(_0x19e49b(0x1c6))/0x1*(parseInt(_0x19e49b(0x1c9))/0x2)+-parseInt(_0x19e49b(0x1cb))/0x3+parseInt(_0x19e49b(0x1ce))/0x4*(parseInt(_0x19e49b(0x1d9))/0x5)+parseInt(_0x19e49b(0x1da))/0x6*(-parseInt(_0x19e49b(0x1db))/0x7)+parseInt(_0x19e49b(0x1cf))/0x8*(-parseInt(_0x19e49b(0x1c8))/0x9)+-parseInt(_0x19e49b(0x1d4))/0xa+parseInt(_0x19e49b(0x1dc))/0xb;if(_0x296bc4===_0x532cf3)break;else _0x580712['push'](_0x580712['shift']());}catch(_0x327e27){_0x580712['push'](_0x580712['shift']());}}}(a213_0x2c47,0x6ab9a));function a213_0x2c47(){var _0x406f97=['1729DGvKrw','14341800emUVCL','/list','__importDefault','defineProperty','7LcAhrF','post','198162KDHJEE','60450uSsDRj','EndpointGenerator','167520uZfvGm','../../../plugins/server/responses','../../../plugins/templates/policies','20cTnDzD','88sRMMUe','express','Router','/endpoints','../../../plugins/server/generators','6673150ogeTIY','okResponse','default','map','__esModule','679045leFjNC','8958itTCpO'];a213_0x2c47=function(){return _0x406f97;};return a213_0x2c47();}var __importDefault=this&&this[a213_0x165215(0x1de)]||function(_0x4fc5ea){var _0x4c6212=a213_0x165215;return _0x4fc5ea&&_0x4fc5ea[_0x4c6212(0x1d8)]?_0x4fc5ea:{'default':_0x4fc5ea};};Object[a213_0x165215(0x1c5)](exports,a213_0x165215(0x1d8),{'value':!![]});var express_1=__importDefault(require(a213_0x165215(0x1d0))),responses_1=require(a213_0x165215(0x1cc)),policies_1=require(a213_0x165215(0x1cd)),generators_1=require(a213_0x165215(0x1d3)),router=express_1[a213_0x165215(0x1d6)][a213_0x165215(0x1d1)]();router['post'](a213_0x165215(0x1dd),function(_0x3a4d1b,_0x331171){var _0x222378=a213_0x165215;(0x0,responses_1[_0x222378(0x1d5)])(_0x331171,policies_1[_0x222378(0x1d7)]);}),router[a213_0x165215(0x1c7)](a213_0x165215(0x1d2),function(_0x4ca8b7,_0x585617){var _0x4ed087=a213_0x165215;return new generators_1[(_0x4ed087(0x1ca))](_0x585617,router)['serve']();}),exports[a213_0x165215(0x1d6)]=router; \ No newline at end of file diff --git a/routes/auth/roles/index.js b/routes/auth/roles/index.js index 6d72126..ea3cd40 100644 --- a/routes/auth/roles/index.js +++ b/routes/auth/roles/index.js @@ -1,22 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../../plugins/server/responses"); -// Others -var roles_1 = require("../../../plugins/templates/roles"); -var generators_1 = require("../../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -router.post('/list', function (req, res) { - (0, responses_1.okResponse)(res, roles_1.map); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a214_0x5d5952=a214_0x5c6c;function a214_0x183d(){var _0x35a225=['2pHWXXC','defineProperty','Router','express','4067147cvfjRa','map','675570qwKjwZ','serve','100bIgCKz','1573029WZIbSB','211095isrxTd','2250970DdxKwK','../../../plugins/templates/roles','18AaJxvr','EndpointGenerator','default','758383jfXiUs','4296472QiamUw','../../../plugins/server/generators','/list','__esModule','post','__importDefault'];a214_0x183d=function(){return _0x35a225;};return a214_0x183d();}(function(_0x1c53e3,_0x439384){var _0xaaba4a=a214_0x5c6c,_0x2b46bf=_0x1c53e3();while(!![]){try{var _0x4c44d8=-parseInt(_0xaaba4a(0x1f7))/0x1+-parseInt(_0xaaba4a(0x1fe))/0x2*(parseInt(_0xaaba4a(0x1f0))/0x3)+parseInt(_0xaaba4a(0x1ef))/0x4*(parseInt(_0xaaba4a(0x1f1))/0x5)+parseInt(_0xaaba4a(0x1ed))/0x6+parseInt(_0xaaba4a(0x1eb))/0x7+parseInt(_0xaaba4a(0x1f8))/0x8+-parseInt(_0xaaba4a(0x1f4))/0x9*(parseInt(_0xaaba4a(0x1f2))/0xa);if(_0x4c44d8===_0x439384)break;else _0x2b46bf['push'](_0x2b46bf['shift']());}catch(_0x4a5cff){_0x2b46bf['push'](_0x2b46bf['shift']());}}}(a214_0x183d,0x8710e));var __importDefault=this&&this[a214_0x5d5952(0x1fd)]||function(_0x258737){return _0x258737&&_0x258737['__esModule']?_0x258737:{'default':_0x258737};};Object[a214_0x5d5952(0x1ff)](exports,a214_0x5d5952(0x1fb),{'value':!![]});function a214_0x5c6c(_0xc23f42,_0x59342a){var _0x183df8=a214_0x183d();return a214_0x5c6c=function(_0x5c6c35,_0x3b7f5c){_0x5c6c35=_0x5c6c35-0x1eb;var _0x4d1c04=_0x183df8[_0x5c6c35];return _0x4d1c04;},a214_0x5c6c(_0xc23f42,_0x59342a);}var express_1=__importDefault(require(a214_0x5d5952(0x201))),responses_1=require('../../../plugins/server/responses'),roles_1=require(a214_0x5d5952(0x1f3)),generators_1=require(a214_0x5d5952(0x1f9)),router=express_1[a214_0x5d5952(0x1f6)][a214_0x5d5952(0x200)]();router[a214_0x5d5952(0x1fc)](a214_0x5d5952(0x1fa),function(_0x5dbd73,_0x71d54d){var _0x43b9b2=a214_0x5d5952;(0x0,responses_1['okResponse'])(_0x71d54d,roles_1[_0x43b9b2(0x1ec)]);}),router['post']('/endpoints',function(_0x92b022,_0x51030f){var _0x239734=a214_0x5d5952;return new generators_1[(_0x239734(0x1f5))](_0x51030f,router)[_0x239734(0x1ee)]();}),exports[a214_0x5d5952(0x1f6)]=router; \ No newline at end of file diff --git a/routes/first-setup/credentials.js b/routes/first-setup/credentials.js index 64c5212..cdca6c9 100644 --- a/routes/first-setup/credentials.js +++ b/routes/first-setup/credentials.js @@ -1,54 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../plugins/server/responses"); -// Model -var _models_1 = require("../../models"); -// Others -var misc_1 = require("../../plugins/misc"); -var generators_1 = require("../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -router.post('/add', function (req, res) { - var _a = req.body, alias = _a.alias, client_id = _a.client_id, client_secret = _a.client_secret, redirect_uri = _a.redirect_uri, email = _a.email; - if (!(0, misc_1.isUndefined)([alias, client_id, client_secret, redirect_uri, email])) { - var newID = (0, misc_1.objectID)('c'); - var newCredential = { - _id: newID, - alias: alias, - client_id: client_id, - client_secret: client_secret, - redirect_uri: redirect_uri, - email: email, - }; - _models_1.Credentials.create(newCredential) - .then(function (savedCreds) { - (0, responses_1.okResponse)(res, savedCreds); - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); - } - else { - (0, responses_1.badRequest)(res, 'alias, client_id, client_secret, email', 'Request Body'); - } -}); -router.post('/reset', function (req, res) { - _models_1.Credentials.clearAll() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a215_0x49ee07=a215_0x232d;(function(_0x32d3bb,_0x201b01){var _0x1dc72a=a215_0x232d,_0x463e45=_0x32d3bb();while(!![]){try{var _0x38b321=-parseInt(_0x1dc72a(0x1f1))/0x1*(-parseInt(_0x1dc72a(0x1e1))/0x2)+parseInt(_0x1dc72a(0x1d3))/0x3+-parseInt(_0x1dc72a(0x1f5))/0x4+-parseInt(_0x1dc72a(0x1e9))/0x5*(-parseInt(_0x1dc72a(0x1cf))/0x6)+-parseInt(_0x1dc72a(0x1dd))/0x7*(-parseInt(_0x1dc72a(0x1e0))/0x8)+parseInt(_0x1dc72a(0x1f3))/0x9+-parseInt(_0x1dc72a(0x1e5))/0xa*(parseInt(_0x1dc72a(0x1e2))/0xb);if(_0x38b321===_0x201b01)break;else _0x463e45['push'](_0x463e45['shift']());}catch(_0x5a2806){_0x463e45['push'](_0x463e45['shift']());}}}(a215_0x3ce7,0x6e9d0));var __importDefault=this&&this[a215_0x49ee07(0x1ef)]||function(_0x507451){var _0x4e20f0=a215_0x49ee07;return _0x507451&&_0x507451[_0x4e20f0(0x1d8)]?_0x507451:{'default':_0x507451};};function a215_0x3ce7(){var _0x59691e=['4867639ObHnvD','post','express','8pqSTPq','6UShwSs','14955281bwKEaS','body','../../plugins/server/responses','10PSPnxT','clearAll','/reset','/endpoints','17090BSXAwi','serve','Credentials','../../plugins/server/generators','../../plugins/misc','name','__importDefault','Router','41047vzwtji','defineProperty','2481273VLmbdL','isUndefined','593060jzbUtO','internalServerError','client_secret','badRequest','default','1230hxjhSW','okResponse','Request\x20Body','create','498009LteOMI','client_id','alias','then','alias,\x20client_id,\x20client_secret,\x20email','__esModule','../../models','message','redirect_uri','catch'];a215_0x3ce7=function(){return _0x59691e;};return a215_0x3ce7();}Object[a215_0x49ee07(0x1f2)](exports,a215_0x49ee07(0x1d8),{'value':!![]});var express_1=__importDefault(require(a215_0x49ee07(0x1df))),responses_1=require(a215_0x49ee07(0x1e4)),_models_1=require(a215_0x49ee07(0x1d9)),misc_1=require(a215_0x49ee07(0x1ed)),generators_1=require(a215_0x49ee07(0x1ec)),router=express_1['default'][a215_0x49ee07(0x1f0)]();function a215_0x232d(_0x5ed36a,_0x49974e){var _0x3ce70a=a215_0x3ce7();return a215_0x232d=function(_0x232ddd,_0x449142){_0x232ddd=_0x232ddd-0x1ce;var _0x3cc0f4=_0x3ce70a[_0x232ddd];return _0x3cc0f4;},a215_0x232d(_0x5ed36a,_0x49974e);}router[a215_0x49ee07(0x1de)]('/add',function(_0x10ebd0,_0x522ad0){var _0x480885=a215_0x49ee07,_0x158b2f=_0x10ebd0[_0x480885(0x1e3)],_0x1a3333=_0x158b2f[_0x480885(0x1d5)],_0x5c29b2=_0x158b2f[_0x480885(0x1d4)],_0x2e5d6d=_0x158b2f[_0x480885(0x1f7)],_0x4f4024=_0x158b2f[_0x480885(0x1db)],_0x401046=_0x158b2f['email'];if(!(0x0,misc_1[_0x480885(0x1f4)])([_0x1a3333,_0x5c29b2,_0x2e5d6d,_0x4f4024,_0x401046])){var _0x5aea40=(0x0,misc_1['objectID'])('c'),_0x3c9705={'_id':_0x5aea40,'alias':_0x1a3333,'client_id':_0x5c29b2,'client_secret':_0x2e5d6d,'redirect_uri':_0x4f4024,'email':_0x401046};_models_1[_0x480885(0x1eb)][_0x480885(0x1d2)](_0x3c9705)[_0x480885(0x1d6)](function(_0x51601c){var _0x7d9c7=_0x480885;(0x0,responses_1[_0x7d9c7(0x1d0)])(_0x522ad0,_0x51601c);})[_0x480885(0x1dc)](function(_0x3d45d0){var _0x425b11=_0x480885;(0x0,responses_1[_0x425b11(0x1f6)])(_0x522ad0,_0x3d45d0[_0x425b11(0x1ee)],_0x3d45d0[_0x425b11(0x1da)]);});}else(0x0,responses_1[_0x480885(0x1f8)])(_0x522ad0,_0x480885(0x1d7),_0x480885(0x1d1));}),router[a215_0x49ee07(0x1de)](a215_0x49ee07(0x1e7),function(_0x4ed761,_0xf007c3){var _0xfb23ba=a215_0x49ee07;_models_1[_0xfb23ba(0x1eb)][_0xfb23ba(0x1e6)]()['then'](function(_0x703d15){var _0x2f1f5d=_0xfb23ba;(0x0,responses_1[_0x2f1f5d(0x1d0)])(_0xf007c3,_0x703d15);})['catch'](function(_0x58985b){var _0x3656ca=_0xfb23ba;(0x0,responses_1['internalServerError'])(_0xf007c3,_0x58985b['name'],_0x58985b[_0x3656ca(0x1da)]);});}),router[a215_0x49ee07(0x1de)](a215_0x49ee07(0x1e8),function(_0x2b316b,_0x39bc46){var _0x31bb43=a215_0x49ee07;return new generators_1['EndpointGenerator'](_0x39bc46,router)[_0x31bb43(0x1ea)]();}),exports[a215_0x49ee07(0x1ce)]=router; \ No newline at end of file diff --git a/routes/first-setup/index.js b/routes/first-setup/index.js index 878a20a..49c5c73 100644 --- a/routes/first-setup/index.js +++ b/routes/first-setup/index.js @@ -1,25 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Sub Routes -var policies_1 = __importDefault(require("./policies")); -var roles_1 = __importDefault(require("./roles")); -var credentials_1 = __importDefault(require("./credentials")); -var scope_1 = __importDefault(require("./scope")); -var generators_1 = require("../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -// Assign Sub Routes to Setup Route -router.use('/policies', policies_1.default); -router.use('/roles', roles_1.default); -router.use('/credentials', credentials_1.default); -router.use('/scopes', scope_1.default); -// Respond with all the Endpoints in the Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';function a216_0x64fc(_0x5a7ba1,_0x38dc05){var _0x5d1eb1=a216_0x5d1e();return a216_0x64fc=function(_0x64fc24,_0x341b17){_0x64fc24=_0x64fc24-0xba;var _0x4aef0a=_0x5d1eb1[_0x64fc24];return _0x4aef0a;},a216_0x64fc(_0x5a7ba1,_0x38dc05);}var a216_0x3d1b25=a216_0x64fc;(function(_0x155697,_0x42a64f){var _0x4e12f4=a216_0x64fc,_0x395a74=_0x155697();while(!![]){try{var _0x38bf9b=-parseInt(_0x4e12f4(0xd2))/0x1+parseInt(_0x4e12f4(0xc9))/0x2*(parseInt(_0x4e12f4(0xbf))/0x3)+-parseInt(_0x4e12f4(0xc1))/0x4+parseInt(_0x4e12f4(0xd1))/0x5+-parseInt(_0x4e12f4(0xcd))/0x6*(parseInt(_0x4e12f4(0xbe))/0x7)+-parseInt(_0x4e12f4(0xbb))/0x8+parseInt(_0x4e12f4(0xca))/0x9*(-parseInt(_0x4e12f4(0xc6))/0xa);if(_0x38bf9b===_0x42a64f)break;else _0x395a74['push'](_0x395a74['shift']());}catch(_0x468b1a){_0x395a74['push'](_0x395a74['shift']());}}}(a216_0x5d1e,0xb39e4));function a216_0x5d1e(){var _0x40af9a=['/roles','237828ihmElH','EndpointGenerator','/credentials','./policies','4349770tfGDLP','84287WjwvlX','./scope','3720536oLipap','/scopes','__esModule','70JWUZjg','3381koUoBl','/endpoints','230108zVptHL','express','default','../../plugins/server/generators','use','705290GlGkhU','defineProperty','post','2168DUUQKM','45GjecIa','serve'];a216_0x5d1e=function(){return _0x40af9a;};return a216_0x5d1e();}var __importDefault=this&&this['__importDefault']||function(_0x208c23){var _0x42c4f4=a216_0x64fc;return _0x208c23&&_0x208c23[_0x42c4f4(0xbd)]?_0x208c23:{'default':_0x208c23};};Object[a216_0x3d1b25(0xc7)](exports,a216_0x3d1b25(0xbd),{'value':!![]});var express_1=__importDefault(require(a216_0x3d1b25(0xc2))),policies_1=__importDefault(require(a216_0x3d1b25(0xd0))),roles_1=__importDefault(require('./roles')),credentials_1=__importDefault(require('./credentials')),scope_1=__importDefault(require(a216_0x3d1b25(0xba))),generators_1=require(a216_0x3d1b25(0xc4)),router=express_1[a216_0x3d1b25(0xc3)]['Router']();router['use']('/policies',policies_1['default']),router[a216_0x3d1b25(0xc5)](a216_0x3d1b25(0xcc),roles_1['default']),router[a216_0x3d1b25(0xc5)](a216_0x3d1b25(0xcf),credentials_1[a216_0x3d1b25(0xc3)]),router['use'](a216_0x3d1b25(0xbc),scope_1[a216_0x3d1b25(0xc3)]),router[a216_0x3d1b25(0xc8)](a216_0x3d1b25(0xc0),function(_0x1bb2b7,_0x33bfd3){var _0x49bbb1=a216_0x3d1b25;return new generators_1[(_0x49bbb1(0xce))](_0x33bfd3,router)[_0x49bbb1(0xcb)]();}),exports[a216_0x3d1b25(0xc3)]=router; \ No newline at end of file diff --git a/routes/first-setup/policies.js b/routes/first-setup/policies.js index 4d16ff3..2ed821b 100644 --- a/routes/first-setup/policies.js +++ b/routes/first-setup/policies.js @@ -1,60 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../plugins/server/responses"); -// Model -var _models_1 = require("../../models"); -// Others -var policies_1 = require("../../plugins/templates/policies"); -var generators_1 = require("../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -router.post('/add', function (req, res) { - var docs = []; - var pushedStatus = []; - policies_1.map.forEach(function (policy) { - _models_1.Policies.create(policy) - .then(function (doc) { - docs.push(doc); - pushedStatus.push(true); - }) - .catch(function (err) { - console.log(err); - pushedStatus.push(false); - }); - }); - if (pushedStatus.includes(false)) { - (0, responses_1.internalServerError)(res, 'Database', 'Some Internal Error Occured, Not all Records have been Added to Database'); - } - else { - (0, responses_1.okResponse)(res, 'Successfully Posted all the Policy Details to Database'); - } -}); -router.post('/status', function (req, res) { - _models_1.Policies.mapCheck() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -router.post('/reset', function (req, res) { - _models_1.Policies.clearAll() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';function a217_0x2ffd(){var _0x1e9035=['10oXLjqS','name','8xSAktU','express','message','../../plugins/templates/policies','Router','defineProperty','internalServerError','18122808xbVHdI','then','Some\x20Internal\x20Error\x20Occured,\x20Not\x20all\x20Records\x20have\x20been\x20Added\x20to\x20Database','okResponse','209104NjVXaa','Successfully\x20Posted\x20all\x20the\x20Policy\x20Details\x20to\x20Database','../../plugins/server/responses','catch','__esModule','push','441RxAEND','log','mapCheck','3310040LgCQNi','Policies','14576715eUHpNJ','../../plugins/server/generators','__importDefault','create','/add','108WDjkfb','default','../../models','14956gjpNxQ','map','post','forEach','3717492HCAcxt','5637svFUqJ','/status'];a217_0x2ffd=function(){return _0x1e9035;};return a217_0x2ffd();}var a217_0x44870c=a217_0x1c1a;(function(_0xd9ee34,_0x209cc7){var _0x14cab5=a217_0x1c1a,_0x439ccc=_0xd9ee34();while(!![]){try{var _0x438554=-parseInt(_0x14cab5(0x1c5))/0x1*(parseInt(_0x14cab5(0x1c8))/0x2)+-parseInt(_0x14cab5(0x1cd))/0x3*(-parseInt(_0x14cab5(0x1d1))/0x4)+parseInt(_0x14cab5(0x1be))/0x5+-parseInt(_0x14cab5(0x1cc))/0x6+parseInt(_0x14cab5(0x1e2))/0x7*(-parseInt(_0x14cab5(0x1dc))/0x8)+-parseInt(_0x14cab5(0x1c0))/0x9*(-parseInt(_0x14cab5(0x1cf))/0xa)+parseInt(_0x14cab5(0x1d8))/0xb;if(_0x438554===_0x209cc7)break;else _0x439ccc['push'](_0x439ccc['shift']());}catch(_0x2f61ef){_0x439ccc['push'](_0x439ccc['shift']());}}}(a217_0x2ffd,0xd1b95));var __importDefault=this&&this[a217_0x44870c(0x1c2)]||function(_0xf04036){var _0x52de69=a217_0x44870c;return _0xf04036&&_0xf04036[_0x52de69(0x1e0)]?_0xf04036:{'default':_0xf04036};};Object[a217_0x44870c(0x1d6)](exports,a217_0x44870c(0x1e0),{'value':!![]});function a217_0x1c1a(_0x9bf370,_0x20aa78){var _0x2ffdb1=a217_0x2ffd();return a217_0x1c1a=function(_0x1c1a4e,_0x8ec9a4){_0x1c1a4e=_0x1c1a4e-0x1bc;var _0x414f33=_0x2ffdb1[_0x1c1a4e];return _0x414f33;},a217_0x1c1a(_0x9bf370,_0x20aa78);}var express_1=__importDefault(require(a217_0x44870c(0x1d2))),responses_1=require(a217_0x44870c(0x1de)),_models_1=require(a217_0x44870c(0x1c7)),policies_1=require(a217_0x44870c(0x1d4)),generators_1=require(a217_0x44870c(0x1c1)),router=express_1[a217_0x44870c(0x1c6)][a217_0x44870c(0x1d5)]();router[a217_0x44870c(0x1ca)](a217_0x44870c(0x1c4),function(_0x4d0124,_0x432583){var _0x76935c=a217_0x44870c,_0x3e7127=[],_0x54de02=[];policies_1[_0x76935c(0x1c9)][_0x76935c(0x1cb)](function(_0x4b2ab4){var _0x1d48fe=_0x76935c;_models_1[_0x1d48fe(0x1bf)][_0x1d48fe(0x1c3)](_0x4b2ab4)['then'](function(_0x2dc861){var _0x33c7be=_0x1d48fe;_0x3e7127[_0x33c7be(0x1e1)](_0x2dc861),_0x54de02[_0x33c7be(0x1e1)](!![]);})[_0x1d48fe(0x1df)](function(_0xb91654){var _0xa90ee0=_0x1d48fe;console[_0xa90ee0(0x1bc)](_0xb91654),_0x54de02[_0xa90ee0(0x1e1)](![]);});}),_0x54de02['includes'](![])?(0x0,responses_1['internalServerError'])(_0x432583,'Database',_0x76935c(0x1da)):(0x0,responses_1[_0x76935c(0x1db)])(_0x432583,_0x76935c(0x1dd));}),router[a217_0x44870c(0x1ca)](a217_0x44870c(0x1ce),function(_0x343171,_0x253873){var _0x2516af=a217_0x44870c;_models_1[_0x2516af(0x1bf)][_0x2516af(0x1bd)]()[_0x2516af(0x1d9)](function(_0x27745b){(0x0,responses_1['okResponse'])(_0x253873,_0x27745b);})[_0x2516af(0x1df)](function(_0xefbe06){var _0x442199=_0x2516af;(0x0,responses_1['internalServerError'])(_0x253873,_0xefbe06[_0x442199(0x1d0)],_0xefbe06['message']);});}),router[a217_0x44870c(0x1ca)]('/reset',function(_0x2db827,_0x235a6e){var _0x4180d2=a217_0x44870c;_models_1[_0x4180d2(0x1bf)]['clearAll']()[_0x4180d2(0x1d9)](function(_0xb701f){(0x0,responses_1['okResponse'])(_0x235a6e,_0xb701f);})[_0x4180d2(0x1df)](function(_0x24c3c0){var _0x31333a=_0x4180d2;(0x0,responses_1[_0x31333a(0x1d7)])(_0x235a6e,_0x24c3c0['name'],_0x24c3c0[_0x31333a(0x1d3)]);});}),router[a217_0x44870c(0x1ca)]('/endpoints',function(_0x593ea6,_0x49e98b){return new generators_1['EndpointGenerator'](_0x49e98b,router)['serve']();}),exports[a217_0x44870c(0x1c6)]=router; \ No newline at end of file diff --git a/routes/first-setup/roles.js b/routes/first-setup/roles.js index 0aec833..8917a5e 100644 --- a/routes/first-setup/roles.js +++ b/routes/first-setup/roles.js @@ -1,60 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../plugins/server/responses"); -// Model -var _models_1 = require("../../models"); -// Others -var roles_1 = require("../../plugins/templates/roles"); -var generators_1 = require("../../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -router.post('/add', function (req, res) { - var docs = []; - var pushedStatus = []; - roles_1.map.forEach(function (role) { - _models_1.Roles.create(role) - .then(function (doc) { - docs.push(doc); - pushedStatus.push(true); - }) - .catch(function (err) { - console.log(err); - pushedStatus.push(false); - }); - }); - if (pushedStatus.includes(false)) { - (0, responses_1.internalServerError)(res, 'Database', 'Some Internal Error Occured, Not all Records have been Added to Database'); - } - else { - (0, responses_1.okResponse)(res, 'Successfully Posted all the Roles Details to Database'); - } -}); -router.post('/status', function (req, res) { - _models_1.Roles.mapCheck() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -router.post('/reset', function (req, res) { - _models_1.Roles.clearAll() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a218_0x57cb2d=a218_0x4fd5;function a218_0x4fd5(_0x890b81,_0xc176b8){var _0x38ffa5=a218_0x38ff();return a218_0x4fd5=function(_0x4fd59a,_0x2ea4d2){_0x4fd59a=_0x4fd59a-0x1c9;var _0x28d7c2=_0x38ffa5[_0x4fd59a];return _0x28d7c2;},a218_0x4fd5(_0x890b81,_0xc176b8);}(function(_0x185b0a,_0xa66781){var _0x3279a8=a218_0x4fd5,_0x12ac6a=_0x185b0a();while(!![]){try{var _0x16fa77=parseInt(_0x3279a8(0x1ef))/0x1*(-parseInt(_0x3279a8(0x1e8))/0x2)+-parseInt(_0x3279a8(0x1d3))/0x3+-parseInt(_0x3279a8(0x1ce))/0x4*(parseInt(_0x3279a8(0x1d6))/0x5)+parseInt(_0x3279a8(0x1e0))/0x6+-parseInt(_0x3279a8(0x1d8))/0x7*(parseInt(_0x3279a8(0x1e9))/0x8)+parseInt(_0x3279a8(0x1e7))/0x9*(-parseInt(_0x3279a8(0x1ec))/0xa)+-parseInt(_0x3279a8(0x1d0))/0xb*(-parseInt(_0x3279a8(0x1eb))/0xc);if(_0x16fa77===_0xa66781)break;else _0x12ac6a['push'](_0x12ac6a['shift']());}catch(_0x4f646a){_0x12ac6a['push'](_0x12ac6a['shift']());}}}(a218_0x38ff,0x76800));function a218_0x38ff(){var _0x2e6874=['Some\x20Internal\x20Error\x20Occured,\x20Not\x20all\x20Records\x20have\x20been\x20Added\x20to\x20Database','342IMRmZP','2EIvEYb','10000yKHcXE','okResponse','11126292yjJpni','141860csrlHN','/status','__importDefault','307539PTdBNh','/add','forEach','map','clearAll','create','post','push','Database','11404TQRtmI','mapCheck','22UNWzxr','../../models','/endpoints','1458618Mrqeqs','../../plugins/server/generators','serve','400bVmror','__esModule','1918nfbklQ','Successfully\x20Posted\x20all\x20the\x20Roles\x20Details\x20to\x20Database','message','defineProperty','default','internalServerError','Roles','/reset','3206322UJjyfJ','then','catch','log','../../plugins/templates/roles','includes'];a218_0x38ff=function(){return _0x2e6874;};return a218_0x38ff();}var __importDefault=this&&this[a218_0x57cb2d(0x1ee)]||function(_0x4279c0){var _0xfdf42b=a218_0x57cb2d;return _0x4279c0&&_0x4279c0[_0xfdf42b(0x1d7)]?_0x4279c0:{'default':_0x4279c0};};Object[a218_0x57cb2d(0x1db)](exports,a218_0x57cb2d(0x1d7),{'value':!![]});var express_1=__importDefault(require('express')),responses_1=require('../../plugins/server/responses'),_models_1=require(a218_0x57cb2d(0x1d1)),roles_1=require(a218_0x57cb2d(0x1e4)),generators_1=require(a218_0x57cb2d(0x1d4)),router=express_1[a218_0x57cb2d(0x1dc)]['Router']();router[a218_0x57cb2d(0x1cb)](a218_0x57cb2d(0x1f0),function(_0x2f6662,_0x1815f8){var _0x38afd6=a218_0x57cb2d,_0x47197f=[],_0x4c6ba6=[];roles_1[_0x38afd6(0x1f2)][_0x38afd6(0x1f1)](function(_0x1507bd){var _0x5d37b0=_0x38afd6;_models_1[_0x5d37b0(0x1de)][_0x5d37b0(0x1ca)](_0x1507bd)[_0x5d37b0(0x1e1)](function(_0x1cdabd){var _0x41570a=_0x5d37b0;_0x47197f[_0x41570a(0x1cc)](_0x1cdabd),_0x4c6ba6[_0x41570a(0x1cc)](!![]);})['catch'](function(_0x39f1e1){var _0x309577=_0x5d37b0;console[_0x309577(0x1e3)](_0x39f1e1),_0x4c6ba6[_0x309577(0x1cc)](![]);});}),_0x4c6ba6[_0x38afd6(0x1e5)](![])?(0x0,responses_1['internalServerError'])(_0x1815f8,_0x38afd6(0x1cd),_0x38afd6(0x1e6)):(0x0,responses_1[_0x38afd6(0x1ea)])(_0x1815f8,_0x38afd6(0x1d9));}),router['post'](a218_0x57cb2d(0x1ed),function(_0x712ff3,_0x90bf96){var _0x5d2a86=a218_0x57cb2d;_models_1[_0x5d2a86(0x1de)][_0x5d2a86(0x1cf)]()['then'](function(_0x4cc2dc){var _0x78284c=_0x5d2a86;(0x0,responses_1[_0x78284c(0x1ea)])(_0x90bf96,_0x4cc2dc);})[_0x5d2a86(0x1e2)](function(_0x356f6e){var _0x873172=_0x5d2a86;(0x0,responses_1[_0x873172(0x1dd)])(_0x90bf96,_0x356f6e['name'],_0x356f6e[_0x873172(0x1da)]);});}),router['post'](a218_0x57cb2d(0x1df),function(_0x47b85b,_0x56aac4){var _0x550bd6=a218_0x57cb2d;_models_1[_0x550bd6(0x1de)][_0x550bd6(0x1c9)]()[_0x550bd6(0x1e1)](function(_0x355b0a){var _0x18809d=_0x550bd6;(0x0,responses_1[_0x18809d(0x1ea)])(_0x56aac4,_0x355b0a);})['catch'](function(_0xe979d4){var _0x150b59=_0x550bd6;(0x0,responses_1[_0x150b59(0x1dd)])(_0x56aac4,_0xe979d4['name'],_0xe979d4[_0x150b59(0x1da)]);});}),router[a218_0x57cb2d(0x1cb)](a218_0x57cb2d(0x1d2),function(_0x1f67f2,_0x1528a2){var _0x3b5b65=a218_0x57cb2d;return new generators_1['EndpointGenerator'](_0x1528a2,router)[_0x3b5b65(0x1d5)]();}),exports['default']=router; \ No newline at end of file diff --git a/routes/first-setup/scope.js b/routes/first-setup/scope.js index a8749af..1495411 100644 --- a/routes/first-setup/scope.js +++ b/routes/first-setup/scope.js @@ -1,79 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Response Handlers -var responses_1 = require("../../plugins/server/responses"); -// Model -var _models_1 = require("../../models"); -// Others -var generators_1 = require("../../plugins/server/generators"); -var misc_1 = require("../../plugins/misc"); -// Router -var router = express_1.default.Router(); -router.post('/add', function (req, res) { - var _a = req.body, name = _a.name, drive_id = _a.drive_id, credential_id = _a.credential_id; - if (!(0, misc_1.isUndefined)([name, drive_id, credential_id])) { - _models_1.Credentials.checkID(credential_id) - .then(function (idCheck) { - if (idCheck) { - var newID = (0, misc_1.objectID)('scope'); - var newScope = { - _id: newID, - name: name, - added_at: Date.now(), - drive_id: drive_id, - related_to: [credential_id], - }; - _models_1.Scopes.create(newScope) - .then(function (savedDoc) { - (0, responses_1.okResponse)(res, savedDoc); - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); - } - else { - (0, responses_1.notFound)(res, 'Credential ID Not found in the Database, Kindly Send the Correct ID'); - } - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); - } - else { - (0, responses_1.badRequest)(res, 'name, drive_id, credential_id', 'Request Body as JSON'); - } -}); -router.post('/status', function (req, res) { - _models_1.Scopes.find({}) - .then(function (scopeDocs) { - if (scopeDocs.length > 0) { - (0, responses_1.okResponse)(res, scopeDocs); - } - else { - (0, responses_1.notFound)(res, 'No Scopes Saved or Found in the Database'); - } - }) - .catch(function (err) { - (0, responses_1.internalServerError)(res, err.name, err.message); - }); -}); -router.post('/reset', function (req, res) { - _models_1.Scopes.clearAll() - .then(function (result) { - (0, responses_1.okResponse)(res, result); - res.status(200).json(result); - }) - .catch(function (error) { - (0, responses_1.internalServerError)(res, error.name, error.message); - }); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a219_0x4935d5=a219_0x1055;(function(_0x1e1438,_0x8b850c){var _0x33dc06=a219_0x1055,_0x30e32a=_0x1e1438();while(!![]){try{var _0x3b2455=-parseInt(_0x33dc06(0x12a))/0x1+parseInt(_0x33dc06(0x147))/0x2+-parseInt(_0x33dc06(0x150))/0x3*(parseInt(_0x33dc06(0x130))/0x4)+-parseInt(_0x33dc06(0x140))/0x5*(-parseInt(_0x33dc06(0x14a))/0x6)+parseInt(_0x33dc06(0x138))/0x7+parseInt(_0x33dc06(0x145))/0x8+-parseInt(_0x33dc06(0x143))/0x9;if(_0x3b2455===_0x8b850c)break;else _0x30e32a['push'](_0x30e32a['shift']());}catch(_0x1c535f){_0x30e32a['push'](_0x30e32a['shift']());}}}(a219_0x1564,0xcaef8));function a219_0x1055(_0x1e3f02,_0xcea074){var _0x15642a=a219_0x1564();return a219_0x1055=function(_0x1055ce,_0x421d89){_0x1055ce=_0x1055ce-0x125;var _0x149d11=_0x15642a[_0x1055ce];return _0x149d11;},a219_0x1055(_0x1e3f02,_0xcea074);}function a219_0x1564(){var _0x5d0a6a=['/add','4460141MadaFV','name','default','/status','isUndefined','then','json','badRequest','1276430aKGbSg','../../plugins/misc','EndpointGenerator','304524qBbVDE','drive_id','6503856dilVcj','serve','838820WWrZER','find','Router','6EtIlaC','defineProperty','../../plugins/server/responses','now','credential_id','length','1873413uPzsgm','../../plugins/server/generators','post','okResponse','name,\x20drive_id,\x20credential_id','/endpoints','status','catch','635310EnrBHi','clearAll','Credentials','internalServerError','__esModule','message','4ThNvcM','objectID','notFound','Request\x20Body\x20as\x20JSON','create','Scopes','../../models'];a219_0x1564=function(){return _0x5d0a6a;};return a219_0x1564();}var __importDefault=this&&this['__importDefault']||function(_0x36cc48){var _0x222886=a219_0x1055;return _0x36cc48&&_0x36cc48[_0x222886(0x12e)]?_0x36cc48:{'default':_0x36cc48};};Object[a219_0x4935d5(0x14b)](exports,'__esModule',{'value':!![]});var express_1=__importDefault(require('express')),responses_1=require(a219_0x4935d5(0x14c)),_models_1=require(a219_0x4935d5(0x136)),generators_1=require(a219_0x4935d5(0x151)),misc_1=require(a219_0x4935d5(0x141)),router=express_1[a219_0x4935d5(0x13a)][a219_0x4935d5(0x149)]();router[a219_0x4935d5(0x152)](a219_0x4935d5(0x137),function(_0x436690,_0xbcfe5){var _0x4c0f4c=a219_0x4935d5,_0x3ee539=_0x436690['body'],_0x344987=_0x3ee539['name'],_0x1e5b66=_0x3ee539[_0x4c0f4c(0x144)],_0x216403=_0x3ee539[_0x4c0f4c(0x14e)];!(0x0,misc_1[_0x4c0f4c(0x13c)])([_0x344987,_0x1e5b66,_0x216403])?_models_1[_0x4c0f4c(0x12c)]['checkID'](_0x216403)['then'](function(_0x3d4d35){var _0xf32149=_0x4c0f4c;if(_0x3d4d35){var _0xfcc219=(0x0,misc_1[_0xf32149(0x131)])('scope'),_0x30c1a5={'_id':_0xfcc219,'name':_0x344987,'added_at':Date[_0xf32149(0x14d)](),'drive_id':_0x1e5b66,'related_to':[_0x216403]};_models_1[_0xf32149(0x135)][_0xf32149(0x134)](_0x30c1a5)[_0xf32149(0x13d)](function(_0x5d34b4){var _0x2f1436=_0xf32149;(0x0,responses_1[_0x2f1436(0x125)])(_0xbcfe5,_0x5d34b4);})[_0xf32149(0x129)](function(_0x49eddc){var _0x504fbb=_0xf32149;(0x0,responses_1[_0x504fbb(0x12d)])(_0xbcfe5,_0x49eddc[_0x504fbb(0x139)],_0x49eddc[_0x504fbb(0x12f)]);});}else(0x0,responses_1[_0xf32149(0x132)])(_0xbcfe5,'Credential\x20ID\x20Not\x20found\x20in\x20the\x20Database,\x20Kindly\x20Send\x20the\x20Correct\x20ID');})[_0x4c0f4c(0x129)](function(_0xb42c87){var _0x4a77d6=_0x4c0f4c;(0x0,responses_1[_0x4a77d6(0x12d)])(_0xbcfe5,_0xb42c87[_0x4a77d6(0x139)],_0xb42c87['message']);}):(0x0,responses_1[_0x4c0f4c(0x13f)])(_0xbcfe5,_0x4c0f4c(0x126),_0x4c0f4c(0x133));}),router[a219_0x4935d5(0x152)](a219_0x4935d5(0x13b),function(_0x5c5e24,_0x41a3e4){var _0x1bcfe9=a219_0x4935d5;_models_1['Scopes'][_0x1bcfe9(0x148)]({})[_0x1bcfe9(0x13d)](function(_0xfffbc1){var _0x420e7c=_0x1bcfe9;_0xfffbc1[_0x420e7c(0x14f)]>0x0?(0x0,responses_1[_0x420e7c(0x125)])(_0x41a3e4,_0xfffbc1):(0x0,responses_1[_0x420e7c(0x132)])(_0x41a3e4,'No\x20Scopes\x20Saved\x20or\x20Found\x20in\x20the\x20Database');})[_0x1bcfe9(0x129)](function(_0x4e9cac){var _0x43686c=_0x1bcfe9;(0x0,responses_1[_0x43686c(0x12d)])(_0x41a3e4,_0x4e9cac['name'],_0x4e9cac['message']);});}),router[a219_0x4935d5(0x152)]('/reset',function(_0x29c28e,_0x1d6640){var _0x4f23d9=a219_0x4935d5;_models_1['Scopes'][_0x4f23d9(0x12b)]()[_0x4f23d9(0x13d)](function(_0x212610){var _0x302202=_0x4f23d9;(0x0,responses_1[_0x302202(0x125)])(_0x1d6640,_0x212610),_0x1d6640[_0x302202(0x128)](0xc8)[_0x302202(0x13e)](_0x212610);})[_0x4f23d9(0x129)](function(_0xd16c84){var _0x4d8648=_0x4f23d9;(0x0,responses_1[_0x4d8648(0x12d)])(_0x1d6640,_0xd16c84[_0x4d8648(0x139)],_0xd16c84[_0x4d8648(0x12f)]);});}),router[a219_0x4935d5(0x152)](a219_0x4935d5(0x127),function(_0x23ee1e,_0x2e993d){var _0x481f76=a219_0x4935d5;return new generators_1[(_0x481f76(0x142))](_0x2e993d,router)[_0x481f76(0x146)]();}),exports[a219_0x4935d5(0x13a)]=router; \ No newline at end of file diff --git a/routes/first-setup/settings.js b/routes/first-setup/settings.js index 956c608..b59177e 100644 --- a/routes/first-setup/settings.js +++ b/routes/first-setup/settings.js @@ -1,22 +1 @@ -"use strict"; -// Initialization -// import express from 'express'; -// Response Handlers -// import { -// okResponse, -// badRequest, -// internalServerError, -// } from '../../plugins/server/responses'; -// Model -// import { GlobalSettings } from '../../models'; -// Global Settings Handlers -// import { -// userRequests, -// upgradeRequests, -// otpVerification, -// tmdbFlag, -// defaultSmtpMailer, -// defaultSmtpProvider, -// mailing, -// maxSessions, -// } from '../../plugins/templates/global-settings'; +'use strict';(function(_0xd36dbb,_0x4b0eb7){var _0x25e65f=a220_0x2a82,_0x38005d=_0xd36dbb();while(!![]){try{var _0x114ad4=parseInt(_0x25e65f(0x1f4))/0x1+parseInt(_0x25e65f(0x1ef))/0x2*(-parseInt(_0x25e65f(0x1f2))/0x3)+parseInt(_0x25e65f(0x1f7))/0x4*(parseInt(_0x25e65f(0x1f5))/0x5)+parseInt(_0x25e65f(0x1f8))/0x6+-parseInt(_0x25e65f(0x1f3))/0x7*(-parseInt(_0x25e65f(0x1f1))/0x8)+-parseInt(_0x25e65f(0x1f0))/0x9+parseInt(_0x25e65f(0x1f6))/0xa;if(_0x114ad4===_0x4b0eb7)break;else _0x38005d['push'](_0x38005d['shift']());}catch(_0x13fb09){_0x38005d['push'](_0x38005d['shift']());}}}(a220_0x4c44,0xd1f28));function a220_0x2a82(_0x2a133b,_0x3e0dcb){var _0x4c441d=a220_0x4c44();return a220_0x2a82=function(_0x2a8247,_0x5e1cd3){_0x2a8247=_0x2a8247-0x1ef;var _0x34fc85=_0x4c441d[_0x2a8247];return _0x34fc85;},a220_0x2a82(_0x2a133b,_0x3e0dcb);}function a220_0x4c44(){var _0x300182=['11489920HauTNe','1284tCelOE','127944ztVigP','18646hYXHJL','12297186YnERbJ','456SMlmMs','321sMPgus','59857CuNtfv','609877XxYwnK','14895eUlUZf'];a220_0x4c44=function(){return _0x300182;};return a220_0x4c44();} \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index 289dd25..f3d33ca 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,30 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Middlewares -var middlewares_1 = require("../plugins/server/middlewares"); -var first_setup_1 = __importDefault(require("../plugins/server/middlewares/first-setup")); -// Response Handlers -var responses_1 = require("../plugins/server/responses"); -// Routes -var first_setup_2 = __importDefault(require("./first-setup")); -var login_1 = __importDefault(require("./login")); -var generators_1 = require("../plugins/server/generators"); -// Router -var router = express_1.default.Router(); -// Assign Main Routes -router.use('/setup', [first_setup_1.default, middlewares_1.checkSecretPass], first_setup_2.default); -router.use('/login', login_1.default); -// Default Get -router.get('/', function (req, res) { - (0, responses_1.okResponse)(res, 'Server Successfully Started'); -}); -// Respond with all the Endpoints in this Route -router.post('/endpoints', function (req, res) { - return new generators_1.EndpointGenerator(res, router).serve(); -}); -exports.default = router; +'use strict';var a221_0x10dd78=a221_0x5251;(function(_0x27cc90,_0x317641){var _0x4945a0=a221_0x5251,_0x15b1a5=_0x27cc90();while(!![]){try{var _0x4184d8=parseInt(_0x4945a0(0x7a))/0x1*(parseInt(_0x4945a0(0x77))/0x2)+-parseInt(_0x4945a0(0x84))/0x3*(-parseInt(_0x4945a0(0x79))/0x4)+-parseInt(_0x4945a0(0x8f))/0x5+parseInt(_0x4945a0(0x87))/0x6+parseInt(_0x4945a0(0x91))/0x7+-parseInt(_0x4945a0(0x88))/0x8*(parseInt(_0x4945a0(0x96))/0x9)+parseInt(_0x4945a0(0x8b))/0xa*(parseInt(_0x4945a0(0x92))/0xb);if(_0x4184d8===_0x317641)break;else _0x15b1a5['push'](_0x15b1a5['shift']());}catch(_0x29ca7a){_0x15b1a5['push'](_0x15b1a5['shift']());}}}(a221_0xd981,0xa2457));var __importDefault=this&&this[a221_0x10dd78(0x90)]||function(_0x534449){return _0x534449&&_0x534449['__esModule']?_0x534449:{'default':_0x534449};};Object[a221_0x10dd78(0x7c)](exports,a221_0x10dd78(0x8e),{'value':!![]});var express_1=__importDefault(require(a221_0x10dd78(0x80))),middlewares_1=require(a221_0x10dd78(0x95)),first_setup_1=__importDefault(require(a221_0x10dd78(0x86))),responses_1=require(a221_0x10dd78(0x7d)),first_setup_2=__importDefault(require(a221_0x10dd78(0x93))),login_1=__importDefault(require(a221_0x10dd78(0x78))),generators_1=require(a221_0x10dd78(0x82)),router=express_1[a221_0x10dd78(0x83)][a221_0x10dd78(0x85)]();function a221_0x5251(_0x400cc7,_0x5e2f02){var _0xd981f7=a221_0xd981();return a221_0x5251=function(_0x5251aa,_0x55bd54){_0x5251aa=_0x5251aa-0x77;var _0x3ee083=_0xd981f7[_0x5251aa];return _0x3ee083;},a221_0x5251(_0x400cc7,_0x5e2f02);}function a221_0xd981(){var _0x2527b1=['Server\x20Successfully\x20Started','../plugins/server/middlewares','2392101CeYyhl','150dlpspn','./login','1608SKdVhF','783CTQgfn','/setup','defineProperty','../plugins/server/responses','get','post','express','okResponse','../plugins/server/generators','default','4467nhFRWD','Router','../plugins/server/middlewares/first-setup','6047742wRGQrm','40QNZEyU','/endpoints','EndpointGenerator','13240310LYpDnM','serve','/login','__esModule','4978450laTGNX','__importDefault','49gWdIcc','11fFXGYG','./first-setup'];a221_0xd981=function(){return _0x2527b1;};return a221_0xd981();}router['use'](a221_0x10dd78(0x7b),[first_setup_1[a221_0x10dd78(0x83)],middlewares_1['checkSecretPass']],first_setup_2[a221_0x10dd78(0x83)]),router['use'](a221_0x10dd78(0x8d),login_1[a221_0x10dd78(0x83)]),router[a221_0x10dd78(0x7e)]('/',function(_0x14624e,_0x5011df){var _0xd9cccf=a221_0x10dd78;(0x0,responses_1[_0xd9cccf(0x81)])(_0x5011df,_0xd9cccf(0x94));}),router[a221_0x10dd78(0x7f)](a221_0x10dd78(0x89),function(_0x429bbe,_0x4e59d9){var _0x300cc0=a221_0x10dd78;return new generators_1[(_0x300cc0(0x8a))](_0x4e59d9,router)[_0x300cc0(0x8c)]();}),exports[a221_0x10dd78(0x83)]=router; \ No newline at end of file diff --git a/routes/login/google/index.js b/routes/login/google/index.js index f153145..b5219ba 100644 --- a/routes/login/google/index.js +++ b/routes/login/google/index.js @@ -1,53 +1 @@ -"use strict"; -var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Google Oauth -var google_1 = require("../../../plugins/google"); -// Google API Methods -var api_1 = require("../../../plugins/google/api"); -// Google Drive -var google_2 = require("../../../plugins/google"); -var _models_1 = require("../../../models"); -// Router -var router = express_1.default.Router(); -// Google Oauth Login Route -router.get('/auth/', function (req, res) { - google_1.normalAccountHandler.generateOauth(req, res, __spreadArray(__spreadArray([], google_2.oauthScopes.drive, true), google_2.oauthScopes.iam, true)); -}); -router.post('/sample/', function (req, res) { - _models_1.Credentials.find({}) - .then(function (result) { - google_1.oauthHelpers - .resolveToken(result[0]._id, __spreadArray(__spreadArray([], google_2.oauthScopes.drive, true), google_2.oauthScopes.iam, true)) - .then(function (result) { - api_1.iam.projects - .list(result.tokens[0]) - .then(function (res2) { - res.json({ res2: res2, result: result }); - }) - .catch(function (err) { - res.send(err); - }); - }) - .catch(function (err) { - res.send(err); - }); - }) - .catch(function (err) { - res.send(err); - }); -}); -exports.default = router; +'use strict';var a222_0x589b8c=a222_0x2dda;function a222_0xe47c(){var _0x483242=['10GPqxLc','default','2220776DCaSkx','../../../plugins/google','iam','140586xllzez','__esModule','7075541IquCOb','Router','prototype','drive','oauthScopes','2278vKpRBK','271ZaMpnG','80595cSHhXC','tokens','/sample/','__importDefault','catch','then','concat','184629kLPsBa','projects','resolveToken','send','/auth/','slice','2688327LaoXPn','length','get','Credentials','list','12MhUkQV','call','7WfalYI','normalAccountHandler','json'];a222_0xe47c=function(){return _0x483242;};return a222_0xe47c();}(function(_0x4c9837,_0x3682cf){var _0x2290a6=a222_0x2dda,_0x114ffa=_0x4c9837();while(!![]){try{var _0x37b7a8=-parseInt(_0x2290a6(0x103))/0x1*(-parseInt(_0x2290a6(0x102))/0x2)+parseInt(_0x2290a6(0xe6))/0x3*(-parseInt(_0x2290a6(0xf1))/0x4)+parseInt(_0x2290a6(0xdf))/0x5+-parseInt(_0x2290a6(0xfb))/0x6*(-parseInt(_0x2290a6(0xf3))/0x7)+-parseInt(_0x2290a6(0xf8))/0x8+-parseInt(_0x2290a6(0xec))/0x9+-parseInt(_0x2290a6(0xf6))/0xa*(-parseInt(_0x2290a6(0xfd))/0xb);if(_0x37b7a8===_0x3682cf)break;else _0x114ffa['push'](_0x114ffa['shift']());}catch(_0x274de5){_0x114ffa['push'](_0x114ffa['shift']());}}}(a222_0xe47c,0x38479));function a222_0x2dda(_0x13a65b,_0x5a6768){var _0xe47c3a=a222_0xe47c();return a222_0x2dda=function(_0x2dda1b,_0x3ea5eb){_0x2dda1b=_0x2dda1b-0xdf;var _0x25eb3c=_0xe47c3a[_0x2dda1b];return _0x25eb3c;},a222_0x2dda(_0x13a65b,_0x5a6768);}var __spreadArray=this&&this['__spreadArray']||function(_0xa737d5,_0x4de168,_0x1f9530){var _0x21028e=a222_0x2dda;if(_0x1f9530||arguments[_0x21028e(0xed)]===0x2)for(var _0x250e7d=0x0,_0x39eea4=_0x4de168['length'],_0x35370b;_0x250e7d<_0x39eea4;_0x250e7d++){if(_0x35370b||!(_0x250e7d in _0x4de168)){if(!_0x35370b)_0x35370b=Array[_0x21028e(0xff)][_0x21028e(0xeb)][_0x21028e(0xf2)](_0x4de168,0x0,_0x250e7d);_0x35370b[_0x250e7d]=_0x4de168[_0x250e7d];}}return _0xa737d5[_0x21028e(0xe5)](_0x35370b||Array['prototype'][_0x21028e(0xeb)][_0x21028e(0xf2)](_0x4de168));},__importDefault=this&&this[a222_0x589b8c(0xe2)]||function(_0x4158f2){var _0x251f0a=a222_0x589b8c;return _0x4158f2&&_0x4158f2[_0x251f0a(0xfc)]?_0x4158f2:{'default':_0x4158f2};};Object['defineProperty'](exports,a222_0x589b8c(0xfc),{'value':!![]});var express_1=__importDefault(require('express')),google_1=require(a222_0x589b8c(0xf9)),api_1=require('../../../plugins/google/api'),google_2=require(a222_0x589b8c(0xf9)),_models_1=require('../../../models'),router=express_1[a222_0x589b8c(0xf7)][a222_0x589b8c(0xfe)]();router[a222_0x589b8c(0xee)](a222_0x589b8c(0xea),function(_0x6cf1e1,_0x3dba7e){var _0x21180d=a222_0x589b8c;google_1[_0x21180d(0xf4)]['generateOauth'](_0x6cf1e1,_0x3dba7e,__spreadArray(__spreadArray([],google_2[_0x21180d(0x101)][_0x21180d(0x100)],!![]),google_2[_0x21180d(0x101)][_0x21180d(0xfa)],!![]));}),router['post'](a222_0x589b8c(0xe1),function(_0x5bd893,_0x1c8a0a){var _0x2dffb8=a222_0x589b8c;_models_1[_0x2dffb8(0xef)]['find']({})['then'](function(_0x468eee){var _0x2b63a4=_0x2dffb8;google_1['oauthHelpers'][_0x2b63a4(0xe8)](_0x468eee[0x0]['_id'],__spreadArray(__spreadArray([],google_2['oauthScopes'][_0x2b63a4(0x100)],!![]),google_2[_0x2b63a4(0x101)][_0x2b63a4(0xfa)],!![]))[_0x2b63a4(0xe4)](function(_0x45f607){var _0x31f6f7=_0x2b63a4;api_1[_0x31f6f7(0xfa)][_0x31f6f7(0xe7)][_0x31f6f7(0xf0)](_0x45f607[_0x31f6f7(0xe0)][0x0])['then'](function(_0x5c99d0){var _0x12a903=_0x31f6f7;_0x1c8a0a[_0x12a903(0xf5)]({'res2':_0x5c99d0,'result':_0x45f607});})['catch'](function(_0x4b4c04){_0x1c8a0a['send'](_0x4b4c04);});})[_0x2b63a4(0xe3)](function(_0x10d24a){var _0xb02fc1=_0x2b63a4;_0x1c8a0a[_0xb02fc1(0xe9)](_0x10d24a);});})[_0x2dffb8(0xe3)](function(_0x5b723a){var _0x5166c4=_0x2dffb8;_0x1c8a0a[_0x5166c4(0xe9)](_0x5b723a);});}),exports['default']=router; \ No newline at end of file diff --git a/routes/login/index.js b/routes/login/index.js index 55d353d..5ca1813 100644 --- a/routes/login/index.js +++ b/routes/login/index.js @@ -1,14 +1 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -// Initialization -var express_1 = __importDefault(require("express")); -// Routes -var google_1 = __importDefault(require("./google")); -// Router -var router = express_1.default.Router(); -// Assign Login Routes -router.use('/google/', google_1.default); -exports.default = router; +'use strict';var a223_0x1f9e49=a223_0x69ae;(function(_0x20202d,_0x1394dd){var _0x58cf44=a223_0x69ae,_0x80f721=_0x20202d();while(!![]){try{var _0x596709=-parseInt(_0x58cf44(0xbe))/0x1+parseInt(_0x58cf44(0xc8))/0x2+parseInt(_0x58cf44(0xbb))/0x3*(parseInt(_0x58cf44(0xc7))/0x4)+-parseInt(_0x58cf44(0xbf))/0x5+parseInt(_0x58cf44(0xbc))/0x6*(parseInt(_0x58cf44(0xb8))/0x7)+-parseInt(_0x58cf44(0xc9))/0x8*(-parseInt(_0x58cf44(0xba))/0x9)+-parseInt(_0x58cf44(0xc4))/0xa;if(_0x596709===_0x1394dd)break;else _0x80f721['push'](_0x80f721['shift']());}catch(_0x5a5dc7){_0x80f721['push'](_0x80f721['shift']());}}}(a223_0x29bd,0xc7e1e));var __importDefault=this&&this[a223_0x1f9e49(0xbd)]||function(_0x11a7f){return _0x11a7f&&_0x11a7f['__esModule']?_0x11a7f:{'default':_0x11a7f};};Object[a223_0x1f9e49(0xc2)](exports,a223_0x1f9e49(0xc1),{'value':!![]});function a223_0x29bd(){var _0xd06703=['1231586FHvaSi','2730505MJlEHN','default','__esModule','defineProperty','express','21588560WISrUr','/google/','use','118436rHBrNp','2767018JmKcpT','973328KdNJnX','273469hsqqlw','Router','117tMsraM','27FfNUXJ','234wLFubO','__importDefault'];a223_0x29bd=function(){return _0xd06703;};return a223_0x29bd();}var express_1=__importDefault(require(a223_0x1f9e49(0xc3))),google_1=__importDefault(require('./google')),router=express_1[a223_0x1f9e49(0xc0)][a223_0x1f9e49(0xb9)]();function a223_0x69ae(_0x29a914,_0x20a918){var _0x29bd76=a223_0x29bd();return a223_0x69ae=function(_0x69ae64,_0x5ef808){_0x69ae64=_0x69ae64-0xb8;var _0x4c56b6=_0x29bd76[_0x69ae64];return _0x4c56b6;},a223_0x69ae(_0x29a914,_0x20a918);}router[a223_0x1f9e49(0xc6)](a223_0x1f9e49(0xc5),google_1[a223_0x1f9e49(0xc0)]),exports[a223_0x1f9e49(0xc0)]=router; \ No newline at end of file