@resolveio/server-lib 20.5.1 → 20.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/collections/app-status.collection.js +1 -1
- package/collections/app-status.collection.js.map +1 -1
- package/collections/counter.collection.js +1 -1
- package/collections/counter.collection.js.map +1 -1
- package/collections/cron-job-history.collection.js +1 -1
- package/collections/cron-job-history.collection.js.map +1 -1
- package/collections/cron-job.collection.js +1 -1
- package/collections/cron-job.collection.js.map +1 -1
- package/collections/email-history.collection.js +1 -1
- package/collections/email-history.collection.js.map +1 -1
- package/collections/email-verified.collection.js +1 -1
- package/collections/email-verified.collection.js.map +1 -1
- package/collections/file.collection.js +1 -1
- package/collections/file.collection.js.map +1 -1
- package/collections/flag-update.collection.js +1 -1
- package/collections/flag-update.collection.js.map +1 -1
- package/collections/flag.collection.js +1 -1
- package/collections/flag.collection.js.map +1 -1
- package/collections/log-method-latency.collection.js +1 -1
- package/collections/log-method-latency.collection.js.map +1 -1
- package/collections/log-subscription.collection.js +1 -1
- package/collections/log-subscription.collection.js.map +1 -1
- package/collections/log.collection.js +1 -1
- package/collections/log.collection.js.map +1 -1
- package/collections/logged-in-users.collection.js +1 -1
- package/collections/logged-in-users.collection.js.map +1 -1
- package/collections/method-response.collection.js +1 -1
- package/collections/method-response.collection.js.map +1 -1
- package/collections/monitor-cpu.collection.js +1 -1
- package/collections/monitor-cpu.collection.js.map +1 -1
- package/collections/monitor-memory.collection.js +1 -1
- package/collections/monitor-memory.collection.js.map +1 -1
- package/collections/monitor-mongo.collection.js +1 -1
- package/collections/monitor-mongo.collection.js.map +1 -1
- package/collections/notification.collection.js +1 -1
- package/collections/notification.collection.js.map +1 -1
- package/collections/report-builder-dashboard-builder.collection.js +1 -1
- package/collections/report-builder-dashboard-builder.collection.js.map +1 -1
- package/collections/report-builder-library.collection.js +1 -1
- package/collections/report-builder-library.collection.js.map +1 -1
- package/collections/report-builder-report.collection.js +1 -1
- package/collections/report-builder-report.collection.js.map +1 -1
- package/collections/user-group.collection.js +1 -1
- package/collections/user-group.collection.js.map +1 -1
- package/collections/user-guide.collection.js +1 -1
- package/collections/user-guide.collection.js.map +1 -1
- package/collections/user.collection.js +1 -1
- package/collections/user.collection.js.map +1 -1
- package/collections/worker-task-request.collection.js +1 -1
- package/collections/worker-task-request.collection.js.map +1 -1
- package/collections/worker-task-response.collection.js +1 -1
- package/collections/worker-task-response.collection.js.map +1 -1
- package/fixtures/cron-jobs.js +1 -1
- package/fixtures/cron-jobs.js.map +1 -1
- package/fixtures/init.js +1 -1
- package/fixtures/init.js.map +1 -1
- package/http/auth.d.ts +1 -2
- package/http/auth.js +1 -1
- package/http/auth.js.map +1 -1
- package/http/home.d.ts +1 -2
- package/http/home.js +1 -1
- package/http/home.js.map +1 -1
- package/index.d.ts +0 -30
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/managers/cron.manager.js +1 -1
- package/managers/cron.manager.js.map +1 -1
- package/managers/local-log.manager.js +1 -1
- package/managers/local-log.manager.js.map +1 -1
- package/managers/method.manager.js +1 -1
- package/managers/method.manager.js.map +1 -1
- package/managers/mongo.manager.d.ts +1 -2
- package/managers/mongo.manager.js +1 -1
- package/managers/mongo.manager.js.map +1 -1
- package/managers/monitor.manager.d.ts +0 -1
- package/managers/monitor.manager.js +1 -1
- package/managers/monitor.manager.js.map +1 -1
- package/managers/subscription.manager.js +1 -1
- package/managers/subscription.manager.js.map +1 -1
- package/managers/websocket.manager.d.ts +1 -2
- package/managers/websocket.manager.js.map +1 -1
- package/methods/accounts.js +1 -1
- package/methods/accounts.js.map +1 -1
- package/methods/aws.js +1 -1
- package/methods/aws.js.map +1 -1
- package/methods/collections.js +1 -1
- package/methods/collections.js.map +1 -1
- package/methods/counters.js +1 -1
- package/methods/counters.js.map +1 -1
- package/methods/logs.js +1 -1
- package/methods/logs.js.map +1 -1
- package/methods/monitor.js +1 -1
- package/methods/monitor.js.map +1 -1
- package/methods/report-builder.js +1 -1
- package/methods/report-builder.js.map +1 -1
- package/package.json +1 -1
- package/public_api.d.ts +1 -0
- package/public_api.js +1 -1
- package/public_api.js.map +1 -1
- package/resolveio-server-app.d.ts +31 -0
- package/resolveio-server-app.js +2 -0
- package/resolveio-server-app.js.map +1 -0
- package/server-app.d.ts +2 -1
- package/server-app.js +1 -1
- package/server-app.js.map +1 -1
- package/util/common.d.ts +1 -0
- package/util/common.js +1 -1
- package/util/common.js.map +1 -1
- package/util/schema-report-builder.js +1 -1
- package/util/schema-report-builder.js.map +1 -1
- package/client-server-app.d.ts +0 -1
- package/client-server-app.js +0 -2
- package/client-server-app.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/report-builder-dashboard-builder.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/report-builder-dashboard-builder.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","name","date_created","id_user_created","user_created","num_rows","num_columns","report_rows","Array","report_rows.$","Object","report_rows.$.report_columns","report_rows.$.report_columns.$","report_rows.$.report_columns.$.id_report","report_rows.$.report_columns.$.report_name","report_rows.$.report_columns.$.report_type","report_rows.$.report_columns.$.display_type","report_rows.$.report_columns.$.display_values","report_rows.$.report_columns.$.display_values.$","report_rows.$.report_columns.$.display_text","report_rows.$.report_columns.$.display_value","other","blackbox","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","ReportBuilderDashboardBuilders","collection_main","createIndex","setTimeout"],"mappings":"kHAAA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,aAAc,CACbT,KAAMM,I,EAEPI,gBAAiB,CAChBV,KAAMC,M,EAEPU,aAAc,CACbX,KAAMC,M,EAEPW,SAAU,CACTZ,KAAMI,M,EAEPS,YAAa,CACZb,KAAMI,M,EAEPU,YAAa,CACZd,KAAMe,K,EAEPC,gBAAiB,CAChBhB,KAAMiB,M,EAEPC,+BAAgC,CAC/BlB,KAAMe,K,EAEPI,iCAAkC,CACjCnB,KAAMiB,M,EAEPG,2CAA4C,CAC3CpB,KAAMC,M,EAEPoB,6CAA8C,CAC7CrB,KAAMC,M,EAEPqB,6CAA8C,CAC7CtB,KAAMC,M,EAEPsB,8CAA+C,CAC9CvB,KAAMC,M,EAEPuB,gDAAiD,CAChDxB,KAAMe,K,EAEPU,kDAAmD,CAClDzB,KAAMC,M,EAEPyB,8CAA+C,CAC9C1B,KAAMC,M,EAEP0B,+CAAgD,CAC/C3B,KAAMC,M,EAEP2B,MAAO,CACN5B,KAAMiB,OACNY,SAAU,CAAA,EACV3B,SAAU,CAAA,C,GAQZ,SAAS4B,uBACR,IACOC,EADHpC,uBAAAqC,iBAAmBrC,uBAAAqC,gBAAgBC,UAAS,GACzCF,EAAQ,IAAIlC,gBAAAqC,kBAAsD,CACvEC,eAAgB,oCAChBrC,OAAQA,OACRsC,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,+BAAiCb,EAAMc,gBACvCF,QAAAC,+BAA+BE,YAAY,CAACtC,KAAM,CAAC,CAAC,EACpDmC,QAAAC,+BAA+BE,YAAY,CAACrC,aAAc,CAAC,CAAC,GAG5DsC,WAAW,WACVjB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA1BWa,QAAAC,+BAA6F,KAExGd,qBAAoB","file":"report-builder-dashboard-builder.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { ReportBuilderDashboardBuilderModel } from '../models/report-builder-dashboard-builder.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tdate_created: {\n\t\ttype: Date\n\t},\n\tid_user_created: {\n\t\ttype: String\n\t},\n\tuser_created: {\n\t\ttype: String\n\t},\n\tnum_rows: {\n\t\ttype: Number\n\t},\n\tnum_columns: {\n\t\ttype: Number\n\t},\n\treport_rows: {\n\t\ttype: Array\n\t},\n\t'report_rows.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$': {\n\t\ttype: Object\n\t},\n\t'report_rows.$.report_columns.$.id_report': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_name': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.report_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_type': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_values': {\n\t\ttype: Array\n\t},\n\t'report_rows.$.report_columns.$.display_values.$': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_text': {\n\t\ttype: String\n\t},\n\t'report_rows.$.report_columns.$.display_value': {\n\t\ttype: String\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true,\n\t\toptional: true\n\t}\n};\n\nexport let ReportBuilderDashboardBuilders: MongoManagerCollection<ReportBuilderDashboardBuilderModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<ReportBuilderDashboardBuilderModel>({\n\t\t\tcollectionName: 'report-builder-dashboard-builders',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tReportBuilderDashboardBuilders = model.collection_main;\n\t\tReportBuilderDashboardBuilders.createIndex({name: 1});\n\t\tReportBuilderDashboardBuilders.createIndex({date_created: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReportBuilderLibraries=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReportBuilderLibraries=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},name:{type:String},id_user_create:{type:String},user_create:{type:String},date:{type:Date},reports:{type:Array},"reports.$":{type:Object},"reports.$.id_report":{type:String},"reports.$.report":{type:String},user_groups:{type:Array},"user_groups.$":{type:Object},"user_groups.$.id_user_group":{type:String},"user_groups.$.user_group":{type:String}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"report-builder-libraries",schema:schema,useVersionCollection:!1,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!0,checkSchema:!0,collectionOptions:null}),exports.ReportBuilderLibraries=e.collection_main,exports.ReportBuilderLibraries.createIndex({name:1}),exports.ReportBuilderLibraries.createIndex({id_user_create:1}),exports.ReportBuilderLibraries.createIndex({"user_groups.id_user_group":1})):setTimeout(function(){initializeCollection()},1)}exports.ReportBuilderLibraries=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=report-builder-library.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/report-builder-library.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/report-builder-library.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","name","id_user_create","user_create","date","reports","Array","reports.$","Object","reports.$.id_report","reports.$.report","user_groups","user_groups.$","user_groups.$.id_user_group","user_groups.$.user_group","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","ReportBuilderLibraries","collection_main","createIndex","user_groups.id_user_group","setTimeout"],"mappings":"0GAAA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,eAAgB,CACfT,KAAMC,M,EAEPS,YAAa,CACZV,KAAMC,M,EAEPU,KAAM,CACLX,KAAMM,I,EAEPM,QAAS,CACRZ,KAAMa,K,EAEPC,YAAa,CACZd,KAAMe,M,EAEPC,sBAAuB,CACtBhB,KAAMC,M,EAEPgB,mBAAoB,CACnBjB,KAAMC,M,EAEPiB,YAAa,CACZlB,KAAMa,K,EAEPM,gBAAiB,CAChBnB,KAAMe,M,EAEPK,8BAA+B,CAC9BpB,KAAMC,M,EAEPoB,2BAA4B,CAC3BrB,KAAMC,M,GAUR,SAASqB,uBACR,IACOC,EADH5B,uBAAA6B,iBAAmB7B,uBAAA6B,gBAAgBC,UAAS,GACzCF,EAAQ,IAAI1B,gBAAA6B,kBAA6C,CAC9DC,eAAgB,2BAChB7B,OAAQA,OACR8B,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,uBAAyBb,EAAMc,gBAC/BF,QAAAC,uBAAuBE,YAAY,CAAC9B,KAAM,CAAC,CAAC,EAC5C2B,QAAAC,uBAAuBE,YAAY,CAAC7B,eAAgB,CAAC,CAAC,EACtD0B,QAAAC,uBAAuBE,YAAY,CAACC,4BAA6B,CAAC,CAAC,GAGnEC,WAAW,WACVlB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA3BWa,QAAAC,uBAA4E,KAEvFd,qBAAoB","file":"report-builder-library.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { ReportBuilderLibraryModel } from '../models/report-builder-library.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tid_user_create: {\n\t\ttype: String\n\t},\n\tuser_create: {\n\t\ttype: String\n\t},\n\tdate: {\n\t\ttype: Date\n\t},\n\treports: {\n\t\ttype: Array\n\t},\n\t'reports.$': {\n\t\ttype: Object\n\t},\n\t'reports.$.id_report': {\n\t\ttype: String\n\t},\n\t'reports.$.report': {\n\t\ttype: String\n\t},\n\tuser_groups: {\n\t\ttype: Array\n\t},\n\t'user_groups.$': {\n\t\ttype: Object\n\t},\n\t'user_groups.$.id_user_group': {\n\t\ttype: String\n\t},\n\t'user_groups.$.user_group': {\n\t\ttype: String\n\t}\n};\n\n\n\nexport let ReportBuilderLibraries: MongoManagerCollection<ReportBuilderLibraryModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<ReportBuilderLibraryModel>({\n\t\t\tcollectionName: 'report-builder-libraries',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tReportBuilderLibraries = model.collection_main;\n\t\tReportBuilderLibraries.createIndex({name: 1});\n\t\tReportBuilderLibraries.createIndex({id_user_create: 1});\n\t\tReportBuilderLibraries.createIndex({'user_groups.id_user_group': 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReportBuilderReportVersions=exports.ReportBuilderReports=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ReportBuilderReportVersions=exports.ReportBuilderReports=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},collection_root:{type:String},report_name:{type:String},fields_sort:{type:Array},"fields_sort.$":{type:Object},"fields_sort.$.field":{type:String},"fields_sort.$.order":{type:String},fields_filter:{type:Array},"fields_filter.$":{type:Object,blackbox:!0},fields_custom:{type:Array},"fields_custom.$":{type:Object,blackbox:!0},fields_selected:{type:Array},"fields_selected.$":{type:Object,blackbox:!0},fields_total:{type:Array},"fields_total.$":{type:Object,blackbox:!0},fields_link:{type:Array},"fields_link.$":{type:Object,blackbox:!0},id_user:{type:String},user:{type:String},date_created:{type:Date},shared_users:{type:Array},"shared_users.$":{type:String},type:{type:String},groups_row:{type:Array},"groups_row.$":{type:Object,blackbox:!0},groups_column:{type:Array},"groups_column.$":{type:Object,blackbox:!0},group_type:{type:String},id_date_field:{type:String,optional:!0},date_interval:{type:String,optional:!0}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"report-builder-reports",schema:schema,useVersionCollection:!0,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!0,checkSchema:!0,collectionOptions:null}),exports.ReportBuilderReports=e.collection_main,exports.ReportBuilderReports.createIndex({id_user:1}),exports.ReportBuilderReports.createIndex({shared_users:1}),exports.ReportBuilderReports.createIndex({report_name:1,collection_root:1}),exports.ReportBuilderReportVersions=e.collection_version):setTimeout(function(){initializeCollection()},1)}exports.ReportBuilderReports=null,exports.ReportBuilderReportVersions=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=report-builder-report.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/report-builder-report.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/report-builder-report.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","collection_root","report_name","fields_sort","Array","fields_sort.$","Object","fields_sort.$.field","fields_sort.$.order","fields_filter","fields_filter.$","blackbox","fields_custom","fields_custom.$","fields_selected","fields_selected.$","fields_total","fields_total.$","fields_link","fields_link.$","id_user","user","date_created","shared_users","shared_users.$","groups_row","groups_row.$","groups_column","groups_column.$","group_type","id_date_field","date_interval","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","ReportBuilderReports","collection_main","createIndex","ReportBuilderReportVersions","collection_version","setTimeout"],"mappings":"4IAAA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,gBAAiB,CAChBR,KAAMC,M,EAEPQ,YAAa,CACZT,KAAMC,M,EAEPS,YAAa,CACZV,KAAMW,K,EAEPC,gBAAiB,CAChBZ,KAAMa,M,EAEPC,sBAAuB,CACtBd,KAAMC,M,EAEPc,sBAAuB,CACtBf,KAAMC,M,EAEPe,cAAe,CACdhB,KAAMW,K,EAEPM,kBAAmB,CAClBjB,KAAMa,OACNK,SAAU,CAAA,C,EAEXC,cAAe,CACdnB,KAAMW,K,EAEPS,kBAAmB,CAClBpB,KAAMa,OACNK,SAAU,CAAA,C,EAEXG,gBAAiB,CAChBrB,KAAMW,K,EAEPW,oBAAqB,CACpBtB,KAAMa,OACNK,SAAU,CAAA,C,EAEXK,aAAc,CACbvB,KAAMW,K,EAEPa,iBAAkB,CACjBxB,KAAMa,OACNK,SAAU,CAAA,C,EAEXO,YAAa,CACZzB,KAAMW,K,EAEPe,gBAAiB,CAChB1B,KAAMa,OACNK,SAAU,CAAA,C,EAEXS,QAAS,CACR3B,KAAMC,M,EAEP2B,KAAM,CACL5B,KAAMC,M,EAEP4B,aAAc,CACb7B,KAAMM,I,EAEPwB,aAAc,CACb9B,KAAMW,K,EAEPoB,iBAAkB,CACjB/B,KAAMC,M,EAEPD,KAAM,CACLA,KAAMC,M,EAEP+B,WAAY,CACXhC,KAAMW,K,EAEPsB,eAAgB,CACfjC,KAAMa,OACNK,SAAU,CAAA,C,EAEXgB,cAAe,CACdlC,KAAMW,K,EAEPwB,kBAAmB,CAClBnC,KAAMa,OACNK,SAAU,CAAA,C,EAEXkB,WAAY,CACXpC,KAAMC,M,EAEPoC,cAAe,CACdrC,KAAMC,OACNC,SAAU,CAAA,C,EAEXoC,cAAe,CACdtC,KAAMC,OACNC,SAAU,CAAA,C,GASZ,SAASqC,uBACR,IACOC,EADH7C,uBAAA8C,iBAAmB9C,uBAAA8C,gBAAgBC,UAAS,GACzCF,EAAQ,IAAI3C,gBAAA8C,kBAA4C,CAC7DC,eAAgB,yBAChB9C,OAAQA,OACR+C,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,qBAAuBb,EAAMc,gBAC7BF,QAAAC,qBAAqBE,YAAY,CAAC5B,QAAS,CAAC,CAAC,EAC7CyB,QAAAC,qBAAqBE,YAAY,CAACzB,aAAc,CAAC,CAAC,EAClDsB,QAAAC,qBAAqBE,YAAY,CAAC9C,YAAa,EAAGD,gBAAiB,CAAC,CAAC,EACrE4C,QAAAI,4BAA8BhB,EAAMiB,oBAGpCC,WAAW,WACVnB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA7BWa,QAAAC,qBAAyE,KACzED,QAAAI,4BAAgF,KAE3FjB,qBAAoB","file":"report-builder-report.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { ReportBuilderReportModel } from '../models/report-builder-report.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcollection_root: {\n\t\ttype: String\n\t},\n\treport_name: {\n\t\ttype: String\n\t},\n\tfields_sort: {\n\t\ttype: Array\n\t},\n\t'fields_sort.$': {\n\t\ttype: Object\n\t},\n\t'fields_sort.$.field': {\n\t\ttype: String\n\t},\n\t'fields_sort.$.order': {\n\t\ttype: String\n\t},\n\tfields_filter: {\n\t\ttype: Array\n\t},\n\t'fields_filter.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_custom: {\n\t\ttype: Array\n\t},\n\t'fields_custom.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_selected: {\n\t\ttype: Array\n\t},\n\t'fields_selected.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_total: {\n\t\ttype: Array\n\t},\n\t'fields_total.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tfields_link: {\n\t\ttype: Array\n\t},\n\t'fields_link.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tdate_created: {\n\t\ttype: Date\n\t},\n\tshared_users: {\n\t\ttype: Array\n\t},\n\t'shared_users.$': {\n\t\ttype: String\n\t},\n\ttype: {\n\t\ttype: String\n\t},\n\tgroups_row: {\n\t\ttype: Array\n\t},\n\t'groups_row.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroups_column: {\n\t\ttype: Array\n\t},\n\t'groups_column.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tgroup_type: {\n\t\ttype: String\n\t},\n\tid_date_field: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tdate_interval: {\n\t\ttype: String,\n\t\toptional: true\n\t}\n};\n\nexport let ReportBuilderReports: MongoManagerCollection<ReportBuilderReportModel> = null;\nexport let ReportBuilderReportVersions: MongoManagerCollection<ReportBuilderReportModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<ReportBuilderReportModel>({\n\t\t\tcollectionName: 'report-builder-reports',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tReportBuilderReports = model.collection_main;\n\t\tReportBuilderReports.createIndex({id_user: 1});\n\t\tReportBuilderReports.createIndex({shared_users: 1});\n\t\tReportBuilderReports.createIndex({report_name: 1, collection_root: 1});\n\t\tReportBuilderReportVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserGroupVersions=exports.UserGroups=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserGroupVersions=exports.UserGroups=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},name:{type:String},landing_page:{type:String,optional:!0},permissions:{type:Array},"permissions.$":{type:Object},"permissions.$.name":{type:String},"permissions.$.selected":{type:Boolean},"permissions.$.views":{type:Array},"permissions.$.views.$":{type:Object},"permissions.$.views.$.link":{type:String},"permissions.$.views.$.selected":{type:Boolean},notifications:{type:Array},"notifications.$":{type:Object,blackbox:!0}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"user-groups",schema:schema,useVersionCollection:!0,useReportBuilder:!0,reportBuilderLookupTables:[],timestamps:!0,createLogs:!1,checkSchema:!0,collectionOptions:null}),exports.UserGroups=e.collection_main,exports.UserGroups.createIndex({name:1}),exports.UserGroupVersions=e.collection_version):setTimeout(function(){initializeCollection()},1)}exports.UserGroups=null,exports.UserGroupVersions=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=user-group.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-group.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","name","landing_page","permissions","Array","permissions.$","Object","permissions.$.name","permissions.$.selected","Boolean","permissions.$.views","permissions.$.views.$","permissions.$.views.$.link","permissions.$.views.$.selected","notifications","notifications.$","blackbox","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","UserGroups","collection_main","createIndex","UserGroupVersions","collection_version","setTimeout"],"mappings":"wHAAA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,aAAc,CACbT,KAAMC,OACNC,SAAU,CAAA,C,EAEXQ,YAAa,CACZV,KAAMW,K,EAEPC,gBAAiB,CAChBZ,KAAOa,M,EAERC,qBAAsB,CACrBd,KAAMC,M,EAEPc,yBAA0B,CACzBf,KAAMgB,O,EAEPC,sBAAuB,CACtBjB,KAAMW,K,EAEPO,wBAAyB,CACxBlB,KAAMa,M,EAEPM,6BAA8B,CAC7BnB,KAAMC,M,EAEPmB,iCAAkC,CACjCpB,KAAMgB,O,EAEPK,cAAe,CACdrB,KAAMW,K,EAEPW,kBAAmB,CAClBtB,KAAOa,OACPU,SAAU,CAAA,C,GASZ,SAASC,uBACR,IACOC,EADH9B,uBAAA+B,iBAAmB/B,uBAAA+B,gBAAgBC,UAAS,GACzCF,EAAQ,IAAI5B,gBAAA+B,kBAAkC,CACnDC,eAAgB,cAChB/B,OAAQA,OACRgC,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,WAAab,EAAMc,gBACnBF,QAAAC,WAAWE,YAAY,CAAChC,KAAM,CAAC,CAAC,EAChC6B,QAAAI,kBAAoBhB,EAAMiB,oBAG1BC,WAAW,WACVnB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA3BWa,QAAAC,WAAqD,KACrDD,QAAAI,kBAA4D,KAEvEjB,qBAAoB","file":"user-group.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGroupModel } from '../models/user-group.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tname: {\n\t\ttype: String\n\t},\n\tlanding_page: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tpermissions: {\n\t\ttype: Array\n\t},\n\t'permissions.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.name': {\n\t\ttype: String\n\t},\n\t'permissions.$.selected': {\n\t\ttype: Boolean\n\t},\n\t'permissions.$.views': {\n\t\ttype: Array\n\t},\n\t'permissions.$.views.$': {\n\t\ttype: Object\n\t},\n\t'permissions.$.views.$.link': {\n\t\ttype: String\n\t},\n\t'permissions.$.views.$.selected': {\n\t\ttype: Boolean\n\t},\n\tnotifications: {\n\t\ttype: Array\n\t},\n\t'notifications.$': {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n};\n\nexport let UserGroups: MongoManagerCollection<UserGroupModel> = null;\nexport let UserGroupVersions: MongoManagerCollection<UserGroupModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<UserGroupModel>({\n\t\t\tcollectionName: 'user-groups',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGroups = model.collection_main;\n\t\tUserGroups.createIndex({name: 1});\n\t\tUserGroupVersions = model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserGuides=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserGuides=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},link:{type:String},label:{type:String},message:{type:String}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"user-guides",schema:schema,useVersionCollection:!1,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!1,checkSchema:!0,collectionOptions:null}),exports.UserGuides=e.collection_main):setTimeout(function(){initializeCollection()},1)}exports.UserGuides=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=user-guide.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user-guide.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","link","label","message","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","UserGuides","collection_main","setTimeout"],"mappings":"8FAAA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EAGIE,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,KAAM,CACLR,KAAMC,M,EAEPQ,MAAO,CACNT,KAAMC,M,EAEPS,QAAS,CACRV,KAAMC,M,GAQR,SAASU,uBACR,IACOC,EADHjB,uBAAAkB,iBAAmBlB,uBAAAkB,gBAAgBC,UAAS,GACzCF,EAAQ,IAAIf,gBAAAkB,kBAAkC,CACnDC,eAAgB,cAChBlB,OAAQA,OACRmB,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,WAAab,EAAMc,iBAGnBC,WAAW,WACVhB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CAxBWa,QAAAC,WAAqD,KAEhEd,qBAAoB","file":"user-guide.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport { UserGuideModel } from '../models/user-guide.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tlink: {\n\t\ttype: String\n\t},\n\tlabel: {\n\t\ttype: String\n\t},\n\tmessage: {\n\t\ttype: String\n\t},\n};\n\nexport let UserGuides: MongoManagerCollection<UserGuideModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<UserGuideModel>({\n\t\t\tcollectionName: 'user-guides',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUserGuides = model.collection_main;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserVersions=exports.Users=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UserVersions=exports.Users=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},roles:{type:Object},"roles.super_admin":{type:Boolean},"roles.approvals":{type:Array},"roles.approvals.$":{type:Object},"roles.approvals.$.type":{type:String},"roles.approvals.$.key_1":{type:String,optional:!0},"roles.approvals.$.key_2":{type:String,optional:!0},"roles.approvals.$.key_3":{type:String,optional:!0},"roles.approvals.$.name":{type:String},"roles.groups":{type:Array},"roles.groups.$":{type:Object},"roles.groups.$.name":{type:String},"roles.groups.$.views":{type:Array},"roles.groups.$.views.$":{type:String},"roles.groups.$.yards":{type:Array,optional:!0},"roles.groups.$.yards.$":{type:String},"roles.notifications":{type:Array},"roles.notifications.$":{type:String},"roles.miscs":{type:Array},"roles.miscs.$":{type:String},username:{type:String,optional:!0},email:{type:String,optional:!0},fullname:{type:String},active:{type:Boolean},phonenumber:{type:String,optional:!0},readonly:{type:Boolean,optional:!0},other:{type:Object,blackbox:!0},settings:{type:Object,optional:!0},"settings.table_color":{type:String},"settings.table_font_color":{type:String},"settings.secondary_table_color":{type:String},"settings.secondary_table_font_color":{type:String},"settings.tertiary_table_color":{type:String},"settings.tertiary_table_font_color":{type:String},"settings.font_size":{type:Number},"settings.collapsable_menu":{type:Boolean},"settings.entries_per_page":{type:String},"settings.warning_color":{type:String},"settings.warning_font_color":{type:String},"settings.warning_hover_color":{type:String},"settings.success_color":{type:String},"settings.success_font_color":{type:String},"settings.success_hover_color":{type:String},"settings.danger_color":{type:String},"settings.danger_font_color":{type:String},"settings.danger_hover_color":{type:String},"settings.info_color":{type:String},"settings.info_font_color":{type:String},"settings.info_hover_color":{type:String},"settings.primary_color":{type:String},"settings.primary_font_color":{type:String},"settings.primary_hover_color":{type:String},"settings.secondary_color":{type:String},"settings.secondary_font_color":{type:String},"settings.secondary_hover_color":{type:String},"settings.routing_preference":{type:String},"settings.opening_route":{type:String},salt:{type:String},hash:{type:String},attempts:{type:Number},last:{type:Date,optional:!0},services:{type:Object,optional:!0},"services.enrollment":{type:String,optional:!0},"services.forgot_password":{type:String,optional:!0},"services.reset_password":{type:String,optional:!0},is_customer:{type:Boolean,optional:!0}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"users",schema:schema,useVersionCollection:!0,useReportBuilder:!0,reportBuilderLookupTables:[],timestamps:!0,createLogs:!0,checkSchema:!0,collectionOptions:null}),exports.Users=e.collection_main,exports.Users.createIndex({fullname:1}),exports.Users.createIndex({active:1}),exports.UserVersions=e.collection_version):setTimeout(function(){initializeCollection()},1)}exports.Users=null,exports.UserVersions=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=user.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":["index_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","roles","Object","roles.super_admin","Boolean","roles.approvals","Array","roles.approvals.$","roles.approvals.$.type","roles.approvals.$.key_1","roles.approvals.$.key_2","roles.approvals.$.key_3","roles.approvals.$.name","roles.groups","roles.groups.$","roles.groups.$.name","roles.groups.$.views","roles.groups.$.views.$","roles.groups.$.yards","roles.groups.$.yards.$","roles.notifications","roles.notifications.$","roles.miscs","roles.miscs.$","username","email","fullname","active","phonenumber","readonly","other","blackbox","settings","settings.table_color","settings.table_font_color","settings.secondary_table_color","settings.secondary_table_font_color","settings.tertiary_table_color","settings.tertiary_table_font_color","settings.font_size","settings.collapsable_menu","settings.entries_per_page","settings.warning_color","settings.warning_font_color","settings.warning_hover_color","settings.success_color","settings.success_font_color","settings.success_hover_color","settings.danger_color","settings.danger_font_color","settings.danger_hover_color","settings.info_color","settings.info_font_color","settings.info_hover_color","settings.primary_color","settings.primary_font_color","settings.primary_hover_color","settings.secondary_color","settings.secondary_font_color","settings.secondary_hover_color","settings.routing_preference","settings.opening_route","salt","hash","attempts","last","services","services.enrollment","services.forgot_password","services.reset_password","is_customer","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","Users","collection_main","createIndex","UserVersions","collection_version","setTimeout"],"mappings":"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","file":"user.collection.js","sourcesContent":["import { ResolveIOServer } from '../index';\nimport { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","roles","Object","roles.super_admin","Boolean","roles.approvals","Array","roles.approvals.$","roles.approvals.$.type","roles.approvals.$.key_1","roles.approvals.$.key_2","roles.approvals.$.key_3","roles.approvals.$.name","roles.groups","roles.groups.$","roles.groups.$.name","roles.groups.$.views","roles.groups.$.views.$","roles.groups.$.yards","roles.groups.$.yards.$","roles.notifications","roles.notifications.$","roles.miscs","roles.miscs.$","username","email","fullname","active","phonenumber","readonly","other","blackbox","settings","settings.table_color","settings.table_font_color","settings.secondary_table_color","settings.secondary_table_font_color","settings.tertiary_table_color","settings.tertiary_table_font_color","settings.font_size","settings.collapsable_menu","settings.entries_per_page","settings.warning_color","settings.warning_font_color","settings.warning_hover_color","settings.success_color","settings.success_font_color","settings.success_hover_color","settings.danger_color","settings.danger_font_color","settings.danger_hover_color","settings.info_color","settings.info_font_color","settings.info_hover_color","settings.primary_color","settings.primary_font_color","settings.primary_hover_color","settings.secondary_color","settings.secondary_font_color","settings.secondary_hover_color","settings.routing_preference","settings.opening_route","salt","hash","attempts","last","services","services.enrollment","services.forgot_password","services.reset_password","is_customer","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","Users","collection_main","createIndex","UserVersions","collection_version","setTimeout"],"mappings":"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","file":"user.collection.js","sourcesContent":["import { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerModel, MongoManagerUserCollection } from '../managers/mongo.manager';\nimport { UserModel } from '../models/user.model';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\troles: {\n\t\ttype: Object\n\t},\n\t'roles.super_admin': {\n\t\ttype: Boolean\n\t},\n\t'roles.approvals': {\n\t\ttype: Array\n\t},\n\t'roles.approvals.$': {\n\t\ttype: Object\n\t},\n\t'roles.approvals.$.type': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_1': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'roles.approvals.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$': {\n\t\ttype: Object\n\t},\n\t'roles.groups.$.name': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.views': {\n\t\ttype: Array\n\t},\n\t'roles.groups.$.views.$': {\n\t\ttype: String\n\t},\n\t'roles.groups.$.yards': {\n\t\ttype: Array,\n\t\toptional: true\n\t},\n\t'roles.groups.$.yards.$': {\n\t\ttype: String\n\t},\n\t'roles.notifications': {\n\t\ttype: Array\n\t},\n\t'roles.notifications.$': {\n\t\ttype: String\n\t},\n\t'roles.miscs': {\n\t\ttype: Array\n\t},\n\t'roles.miscs.$': {\n\t\ttype: String\n\t},\n\tusername: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\temail: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tfullname: {\n\t\ttype: String\n\t},\n\tactive: {\n\t\ttype: Boolean\n\t},\n\tphonenumber: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\treadonly: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t},\n\tother: {\n\t\ttype: Object,\n\t\tblackbox: true\n\t},\n\tsettings: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'settings.table_color': {\n\t\ttype: String\n\t},\n\t'settings.table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_color': {\n\t\ttype: String\n\t},\n\t'settings.tertiary_table_font_color': {\n\t\ttype: String\n\t},\n\t'settings.font_size': {\n\t\ttype: Number\n\t},\n\t'settings.collapsable_menu': {\n\t\ttype: Boolean\n\t},\n\t'settings.entries_per_page': {\n\t\ttype: String\n\t},\n\t'settings.warning_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_font_color': {\n\t\ttype: String\n\t},\n\t'settings.warning_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.success_color': {\n\t\ttype: String\n\t},\n\t'settings.success_font_color': {\n\t\ttype: String\n\t},\n\t'settings.success_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_font_color': {\n\t\ttype: String\n\t},\n\t'settings.danger_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.info_color': {\n\t\ttype: String\n\t},\n\t'settings.info_font_color': {\n\t\ttype: String\n\t},\n\t'settings.info_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.primary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_font_color': {\n\t\ttype: String\n\t},\n\t'settings.secondary_hover_color': {\n\t\ttype: String\n\t},\n\t'settings.routing_preference': {\n\t\ttype: String\n\t},\n\t'settings.opening_route': {\n\t\ttype: String\n\t},\n\tsalt: {\n\t\ttype: String\n\t},\n\thash: {\n\t\ttype: String\n\t},\n\tattempts: {\n\t\ttype: Number\n\t},\n\tlast: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tservices: {\n\t\ttype: Object,\n\t\toptional: true\n\t},\n\t'services.enrollment': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.forgot_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t'services.reset_password': {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\tis_customer: {\n\t\ttype: Boolean,\n\t\toptional: true\n\t}\n};\n\nexport let Users: MongoManagerUserCollection<UserModel> = null;\nexport let UserVersions: MongoManagerUserCollection<UserModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<UserModel>({\n\t\t\tcollectionName: 'users',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: true,\n\t\t\tuseReportBuilder: true,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: true,\n\t\t\tcheckSchema: true,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tUsers = <MongoManagerUserCollection<UserModel>>model.collection_main;\n\t\tUsers.createIndex({fullname: 1});\n\t\tUsers.createIndex({active: 1});\n\t\tUserVersions = <MongoManagerUserCollection<UserModel>>model.collection_version;\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 1);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerTaskRequests=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerTaskRequests=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),simpl_schema_1=require("simpl-schema"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},method:{type:String},params:{type:Array},"params.$":{type:simpl_schema_1.default.oneOf(Object,String,Number,Boolean,Date),blackbox:!0},status:{type:String},id_user:{type:String},user:{type:String},id_ws:{type:String}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"worker-task-requests",schema:schema,useVersionCollection:!1,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!1,checkSchema:!1,collectionOptions:null}),exports.WorkerTaskRequests=e.collection_main,exports.WorkerTaskRequests.createIndex({createdAt:1},{expireAfterSeconds:1296e3}),exports.WorkerTaskRequests.createIndex({status:1,createdAt:1}),exports.WorkerTaskRequests.createIndex({_id:1,status:1}),exports.WorkerTaskRequests.createIndex({user:1,createdAt:-1})):setTimeout(function(){initializeCollection()},0)}exports.WorkerTaskRequests=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=worker-task-request.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/worker-task-request.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/worker-task-request.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","simpl_schema_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","method","params","Array","params.$","default","oneOf","Object","Boolean","blackbox","status","id_user","user","id_ws","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","WorkerTaskRequests","collection_main","createIndex","expireAfterSeconds","setTimeout"],"mappings":"sGACA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EACAE,eAAAF,QAAA,cAAA,EAEIG,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,OAAQ,CACPR,KAAMC,M,EAEPQ,OAAQ,CACPT,KAAMU,K,EAEPC,WAAY,CACXX,KAAMH,eAAAe,QAAaC,MAAMC,OAAQb,OAAQG,OAAQW,QAAST,IAAI,EAC9DU,SAAU,CAAA,C,EAEXC,OAAQ,CACPjB,KAAMC,M,EAEPiB,QAAS,CACRlB,KAAMC,M,EAEPkB,KAAM,CACLnB,KAAMC,M,EAEPmB,MAAO,CACNpB,KAAMC,M,GAQR,SAASoB,uBACR,IACOC,EADH5B,uBAAA6B,iBAAmB7B,uBAAA6B,gBAAgBC,UAAS,GACzCF,EAAQ,IAAI1B,gBAAA6B,kBAA0C,CAC3DC,eAAgB,uBAChB5B,OAAQA,OACR6B,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,mBAAqBb,EAAMc,gBAC3BF,QAAAC,mBAAmBE,YAAY,CAAC9B,UAAW,CAAC,EAAG,CAAC+B,mBAAoB,MAAiB,CAAC,EACtFJ,QAAAC,mBAAmBE,YAAY,CAACpB,OAAQ,EAAGV,UAAW,CAAC,CAAC,EACxD2B,QAAAC,mBAAmBE,YAAY,CAACtC,IAAK,EAAGkB,OAAQ,CAAC,CAAC,EAClDiB,QAAAC,mBAAmBE,YAAY,CAAClB,KAAM,EAAGZ,UAAW,CAAC,CAAC,CAAC,GAGvDgC,WAAW,WACVlB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA5BWa,QAAAC,mBAAqE,KAEhFd,qBAAoB","file":"worker-task-request.collection.js","sourcesContent":["import { WorkerTaskRequestModel } from '../models/worker-task-request.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport SimpleSchema from 'simpl-schema';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tmethod: {\n\t\ttype: String\n\t},\n\tparams: {\n\t\ttype: Array, // Declaring params as an array\n\t},\n\t'params.$': {\n\t\ttype: SimpleSchema.oneOf(Object, String, Number, Boolean, Date), // Allowing multiple types\n\t\tblackbox: true // Blackbox for the object type\n\t},\n\tstatus: {\n\t\ttype: String\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t}\n};\n\nexport let WorkerTaskRequests: MongoManagerCollection<WorkerTaskRequestModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<WorkerTaskRequestModel>({\n\t\t\tcollectionName: 'worker-task-requests',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: false,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tWorkerTaskRequests = model.collection_main;\n\t\tWorkerTaskRequests.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 15});\n\t\tWorkerTaskRequests.createIndex({status: 1, createdAt: 1});\n\t\tWorkerTaskRequests.createIndex({_id: 1, status: 1});\n\t\tWorkerTaskRequests.createIndex({user: 1, createdAt: -1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerTaskResponses=void 0;var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WorkerTaskResponses=void 0;var resolveio_server_app_1=require("../resolveio-server-app"),mongo_manager_1=require("../managers/mongo.manager"),simpl_schema_1=require("simpl-schema"),schema={_id:{type:String,optional:!0},__v:{type:Number,optional:!0},updatedAt:{type:Date,optional:!0},createdAt:{type:Date,optional:!0},id_request:{type:String},data:{type:Array},"data.$":{type:simpl_schema_1.default.oneOf(Object,String,Number,Boolean,Date),blackbox:!0},id_user:{type:String},user:{type:String},id_ws:{type:String}};function initializeCollection(){var e;resolveio_server_app_1.ResolveIOServer&&resolveio_server_app_1.ResolveIOServer.getMainDB()?(e=new mongo_manager_1.MongoManagerModel({collectionName:"worker-task-responses",schema:schema,useVersionCollection:!1,useReportBuilder:!1,reportBuilderLookupTables:[],timestamps:!0,createLogs:!1,checkSchema:!1,collectionOptions:null}),exports.WorkerTaskResponses=e.collection_main,exports.WorkerTaskResponses.createIndex({createdAt:1},{expireAfterSeconds:1296e3}),exports.WorkerTaskResponses.createIndex({id_request:1})):setTimeout(function(){initializeCollection()},0)}exports.WorkerTaskResponses=null,initializeCollection();
|
|
2
2
|
//# sourceMappingURL=worker-task-response.collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/worker-task-response.collection.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../src/collections/worker-task-response.collection.ts"],"names":["resolveio_server_app_1","require","mongo_manager_1","simpl_schema_1","schema","_id","type","String","optional","__v","Number","updatedAt","Date","createdAt","id_request","data","Array","data.$","default","oneOf","Object","Boolean","blackbox","id_user","user","id_ws","initializeCollection","model","ResolveIOServer","getMainDB","MongoManagerModel","collectionName","useVersionCollection","useReportBuilder","reportBuilderLookupTables","timestamps","createLogs","checkSchema","collectionOptions","exports","WorkerTaskResponses","collection_main","createIndex","expireAfterSeconds","setTimeout"],"mappings":"uGACA,IAAAA,uBAAAC,QAAA,yBAAA,EACAC,gBAAAD,QAAA,2BAAA,EACAE,eAAAF,QAAA,cAAA,EAEIG,OAAc,CACjBC,IAAK,CACJC,KAAMC,OACNC,SAAU,CAAA,C,EAEXC,IAAK,CACJH,KAAMI,OACNF,SAAU,CAAA,C,EAEXG,UAAW,CACVL,KAAMM,KACNJ,SAAU,CAAA,C,EAEXK,UAAW,CACVP,KAAMM,KACNJ,SAAU,CAAA,C,EAEXM,WAAY,CACXR,KAAMC,M,EAEPQ,KAAM,CACLT,KAAMU,K,EAEPC,SAAU,CACTX,KAAMH,eAAAe,QAAaC,MAAMC,OAAQb,OAAQG,OAAQW,QAAST,IAAI,EAC9DU,SAAU,CAAA,C,EAEXC,QAAS,CACRjB,KAAMC,M,EAEPiB,KAAM,CACLlB,KAAMC,M,EAEPkB,MAAO,CACNnB,KAAMC,M,GAQR,SAASmB,uBACR,IACOC,EADH3B,uBAAA4B,iBAAmB5B,uBAAA4B,gBAAgBC,UAAS,GACzCF,EAAQ,IAAIzB,gBAAA4B,kBAA2C,CAC5DC,eAAgB,wBAChB3B,OAAQA,OACR4B,qBAAsB,CAAA,EACtBC,iBAAkB,CAAA,EAClBC,0BAA2B,GAC3BC,WAAY,CAAA,EACZC,WAAY,CAAA,EACZC,YAAa,CAAA,EACbC,kBAAmB,I,CACnB,EACDC,QAAAC,oBAAsBb,EAAMc,gBAC5BF,QAAAC,oBAAoBE,YAAY,CAAC7B,UAAW,CAAC,EAAG,CAAC8B,mBAAoB,MAAiB,CAAC,EACvFJ,QAAAC,oBAAoBE,YAAY,CAAC5B,WAAY,CAAC,CAAC,GAG/C8B,WAAW,WACVlB,qBAAoB,CACrB,EAAG,CAAC,CAEN,CA1BWa,QAAAC,oBAAuE,KAElFd,qBAAoB","file":"worker-task-response.collection.js","sourcesContent":["import { WorkerTaskResponseModel } from '../models/worker-task-response.model';\nimport { ResolveIOServer } from '../resolveio-server-app';\nimport { MongoManagerCollection, MongoManagerModel } from '../managers/mongo.manager';\nimport SimpleSchema from 'simpl-schema';\n\nlet schema: any = {\n\t_id: {\n\t\ttype: String,\n\t\toptional: true\n\t},\n\t__v: {\n\t\ttype: Number,\n\t\toptional: true\n\t},\n\tupdatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tcreatedAt: {\n\t\ttype: Date,\n\t\toptional: true\n\t},\n\tid_request: {\n\t\ttype: String\n\t},\n\tdata: {\n\t\ttype: Array, // Declaring params as an array\n\t},\n\t'data.$': {\n\t\ttype: SimpleSchema.oneOf(Object, String, Number, Boolean, Date), // Allowing multiple types\n\t\tblackbox: true // Blackbox for the object type\n\t},\n\tid_user: {\n\t\ttype: String\n\t},\n\tuser: {\n\t\ttype: String\n\t},\n\tid_ws: {\n\t\ttype: String\n\t}\n};\n\nexport let WorkerTaskResponses: MongoManagerCollection<WorkerTaskResponseModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer && ResolveIOServer.getMainDB()) {\n\t\tconst model = new MongoManagerModel<WorkerTaskResponseModel>({\n\t\t\tcollectionName: 'worker-task-responses',\n\t\t\tschema: schema,\n\t\t\tuseVersionCollection: false,\n\t\t\tuseReportBuilder: false,\n\t\t\treportBuilderLookupTables: [],\n\t\t\ttimestamps: true,\n\t\t\tcreateLogs: false,\n\t\t\tcheckSchema: false,\n\t\t\tcollectionOptions: null\n\t\t});\n\t\tWorkerTaskResponses = model.collection_main;\n\t\tWorkerTaskResponses.createIndex({createdAt: 1}, {expireAfterSeconds: 60 * 60 * 24 * 15});\n\t\tWorkerTaskResponses.createIndex({id_request: 1});\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
package/fixtures/cron-jobs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,r,t,c){return new(t=t||Promise)(function(o,n){function fulfilled(e){try{step(c.next(e))}catch(e){n(e)}}function rejected(e){try{step(c.throw(e))}catch(e){n(e)}}function step(e){var n;e.done?o(e.value):((n=e.value)instanceof t?n:new t(function(e){e(n)})).then(fulfilled,rejected)}step((c=c.apply(e,r||[])).next())})},__generator=this&&this.__generator||function(r,t){var c,i,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},u={next:verb(0),throw:verb(1),return:verb(2)};return"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function verb(o){return function(e){var n=[o,e];if(c)throw new TypeError("Generator is already executing.");for(;l=u&&n[u=0]?0:l;)try{if(c=1,i&&(a=2&n[0]?i.return:n[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,n[1])).done)return a;switch(i=0,(n=a?[2&n[0],a.value]:n)[0]){case 0:case 1:a=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,i=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3]))l.label=n[1];else if(6===n[0]&&l.label<a[1])l.label=a[1],a=n;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(n)}}n=t.call(r,l)}catch(e){n=[6,e],i=0}finally{c=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}}},cron_job_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadServerCronJobs=void 0,require("../collections/cron-job.collection")),common_1=require("../util/common");function loadServerCronJobs(){return __awaiter(this,void 0,void 0,function(){var n;return __generator(this,function(e){switch(e.label){case 0:return[4,cron_job_collection_1.CronJobs.find({})];case 1:return(n=e.sent()).some(function(e){return"Email Merged Docs Cleanup"===e.name})||cron_job_collection_1.CronJobs.create({_id:(0,common_1.objectIdHexString)(),__v:0,name:"Email Merged Docs Cleanup",repeat:!0,time_to_run:"0 0 * * *",method_run:"cronEmailMergedDocsCleanUp",method_run_data:null,next_run:new Date,running:!1,timezone:process.env.TZ_CLIENT||"America/Chicago"}),n.some(function(e){return"Stuck Cron Job"===e.name})||cron_job_collection_1.CronJobs.create({_id:(0,common_1.objectIdHexString)(),__v:0,name:"Stuck Cron Job",repeat:!0,time_to_run:"*/5 * * * *",method_run:"stuckCronJob",method_run_data:null,next_run:new Date,running:!1,timezone:process.env.TZ_CLIENT||"America/Chicago"}),n.some(function(e){return e.running})&&cron_job_collection_1.CronJobs.updateMany({running:!0},{$set:{running:!1}}),[2]}})})}exports.loadServerCronJobs=loadServerCronJobs;
|
|
2
2
|
//# sourceMappingURL=cron-jobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":["cron_job_collection_1","require","
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/cron-jobs.ts"],"names":["cron_job_collection_1","require","common_1","loadServerCronJobs","CronJobs","find","cronJobs","_a","sent","some","a","name","create","_id","objectIdHexString","__v","repeat","time_to_run","method_run","method_run_data","next_run","Date","running","timezone","process","env","TZ_CLIENT","updateMany","$set","exports"],"mappings":"k8CAAAA,uB,yFAAAC,QAAA,oCAAA,GACAC,SAAAD,QAAA,gBAAA,EAEA,SAAsBE,qB,gHAEN,MAAA,CAAA,EAAMH,sBAAAI,SAASC,KAAK,EAAE,G,cAAjCC,EAAWC,EAAAC,KAAA,GAEDC,KAAK,SAAAC,GAAK,MAAW,8BAAXA,EAAEC,IAAF,CAAsC,GAC7DX,sBAAAI,SAASQ,OAAO,CACfC,KAAK,EAAAX,SAAAY,mBAAiB,EACtBC,IAAK,EACLJ,KAAO,4BACPK,OAAS,CAAA,EACTC,YAAc,YACdC,WAAa,6BACbC,gBAAkB,KAClBC,SAAW,IAAIC,KACfC,QAAU,CAAA,EACVC,SAAUC,QAAQC,IAAIC,WAAa,iB,CACnC,EAGGpB,EAASG,KAAK,SAAAC,GAAK,MAAW,mBAAXA,EAAEC,IAAF,CAA2B,GAClDX,sBAAAI,SAASQ,OAAO,CACfC,KAAK,EAAAX,SAAAY,mBAAiB,EACtBC,IAAK,EACLJ,KAAO,iBACPK,OAAS,CAAA,EACTC,YAAc,cACdC,WAAa,eACbC,gBAAkB,KAClBC,SAAW,IAAIC,KACfC,QAAU,CAAA,EACVC,SAAUC,QAAQC,IAAIC,WAAa,iB,CACnC,EAGEpB,EAASG,KAAK,SAAAC,GAAK,OAAAA,EAAEY,OAAF,CAAS,GAC/BtB,sBAAAI,SAASuB,WAAW,CAACL,QAAS,CAAA,CAAI,EAAG,CAACM,KAAM,CAACN,QAAS,CAAA,CAAK,CAAC,CAAC,E,SAnC/DO,QAAA1B,mBAAAA","file":"cron-jobs.js","sourcesContent":["import { CronJobs } from '../collections/cron-job.collection';\nimport { objectIdHexString } from '../util/common';\n\nexport async function loadServerCronJobs() {\n\n\tlet cronJobs = await CronJobs.find({});\n\n\tif (!cronJobs.some(a => a.name === 'Email Merged Docs Cleanup')) {\n\t\tCronJobs.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\t__v: 0,\n\t\t\tname : 'Email Merged Docs Cleanup', \n\t\t\trepeat : true, \n\t\t\ttime_to_run : '0 0 * * *', \n\t\t\tmethod_run : 'cronEmailMergedDocsCleanUp', \n\t\t\tmethod_run_data : null, \n\t\t\tnext_run : new Date(), \n\t\t\trunning : false,\n\t\t\ttimezone: process.env.TZ_CLIENT || 'America/Chicago'\n\t\t});\n\t}\n\n\tif (!cronJobs.some(a => a.name === 'Stuck Cron Job')) {\n\t\tCronJobs.create({\n\t\t\t_id: objectIdHexString(),\n\t\t\t__v: 0,\n\t\t\tname : 'Stuck Cron Job', \n\t\t\trepeat : true, \n\t\t\ttime_to_run : '*/5 * * * *', \n\t\t\tmethod_run : 'stuckCronJob', \n\t\t\tmethod_run_data : null, \n\t\t\tnext_run : new Date(), \n\t\t\trunning : false,\n\t\t\ttimezone: process.env.TZ_CLIENT || 'America/Chicago'\n\t\t});\n\t}\n\n\tif (cronJobs.some(a => a.running)) {\n\t\tCronJobs.updateMany({running: true}, {$set: {running: false}});\n\t}\n}"]}
|
package/fixtures/init.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,n,l,o){return new(l=l||Promise)(function(r,t){function fulfilled(e){try{step(o.next(e))}catch(e){t(e)}}function rejected(e){try{step(o.throw(e))}catch(e){t(e)}}function step(e){var t;e.done?r(e.value):((t=e.value)instanceof l?t:new l(function(e){e(t)})).then(fulfilled,rejected)}step((o=o.apply(e,n||[])).next())})},__generator=this&&this.__generator||function(n,l){var o,i,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},c={next:verb(0),throw:verb(1),return:verb(2)};return"function"==typeof Symbol&&(c[Symbol.iterator]=function(){return this}),c;function verb(r){return function(e){var t=[r,e];if(o)throw new TypeError("Generator is already executing.");for(;s=c&&t[c=0]?0:s;)try{if(o=1,i&&(a=2&t[0]?i.return:t[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,t[1])).done)return a;switch(i=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,i=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))s.label=t[1];else if(6===t[0]&&s.label<a[1])s.label=a[1],a=t;else{if(!(a&&s.label<a[2])){a[2]&&s.ops.pop(),s.trys.pop();continue}s.label=a[2],s.ops.push(t)}}t=l.call(n,s)}catch(e){t=[6,e],i=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},flag_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.loadServerInit=void 0,require("../collections/flag.collection")),email_history_collection_1=require("../collections/email-history.collection"),resolveio_server_app_1=require("../resolveio-server-app");function loadServerInit(){return __awaiter(this,void 0,void 0,function(){var t;return __generator(this,function(e){switch(e.label){case 0:return email_history_collection_1.EmailHistories.updateMany({status:"processing"},{$set:{status:"pending"}}),[4,flag_collection_1.Flags.findOne({type:"Enable Debug"})];case 1:return e.sent()||flag_collection_1.Flags.insertOne({type:"Enable Debug",value:!1}),[4,flag_collection_1.Flags.findOne({type:"Enable Debug PDF"})];case 2:return(t=e.sent())?t.value&&"http://localhost:4200"!==resolveio_server_app_1.ResolveIOServer.getServerConfig().ROOT_URL&&flag_collection_1.Flags.updateOne({_id:t._id},{$set:{value:!1}}):flag_collection_1.Flags.insertOne({type:"Enable Debug PDF",value:!1}),[2]}})})}exports.loadServerInit=loadServerInit;
|
|
2
2
|
//# sourceMappingURL=init.js.map
|
package/fixtures/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":["flag_collection_1","require","email_history_collection_1","
|
|
1
|
+
{"version":3,"sources":["../../src/fixtures/init.ts"],"names":["flag_collection_1","require","email_history_collection_1","resolveio_server_app_1","loadServerInit","EmailHistories","updateMany","status","$set","Flags","findOne","type","_a","sent","insertOne","value","enableDebugFlagPDF","ResolveIOServer","getServerConfig","updateOne","_id","exports"],"mappings":"k8CAAAA,mB,qFAAAC,QAAA,gCAAA,GACAC,2BAAAD,QAAA,yCAAA,EACAE,uBAAAF,QAAA,yBAAA,EAEA,SAAsBG,iB,gHAGC,OAFtBF,2BAAAG,eAAeC,WAAW,CAACC,OAAQ,YAAY,EAAG,CAACC,KAAM,CAACD,OAAQ,SAAS,CAAC,CAAC,EAEvD,CAAA,EAAMP,kBAAAS,MAAMC,QAAQ,CAACC,KAAM,cAAc,CAAC,G,OAMvC,OANHC,EAAAC,KAAA,GAGrBb,kBAAAS,MAAMK,UAAU,CAACH,KAAM,eAAgBI,MAAO,CAAA,CAAK,CAAC,EAG5B,CAAA,EAAMf,kBAAAS,MAAMC,QAAQ,CAACC,KAAM,kBAAkB,CAAC,G,cAAnEK,EAAqBJ,EAAAC,KAAA,GAKhBG,EAAmBD,OAA2D,0BAAlDZ,uBAAAc,gBAAgBC,gBAAe,EAAa,UAChFlB,kBAAAS,MAAMU,UAAU,CAACC,IAAKJ,EAAmBI,GAAG,EAAG,CAACZ,KAAM,CAACO,MAAO,CAAA,CAAK,CAAC,CAAC,EAHrEf,kBAAAS,MAAMK,UAAU,CAACH,KAAM,mBAAoBI,MAAO,CAAA,CAAK,CAAC,E,SAZ1DM,QAAAjB,eAAAA","file":"init.js","sourcesContent":["import { Flags } from '../collections/flag.collection';\nimport { EmailHistories } from '../collections/email-history.collection';\nimport { ResolveIOServer } from '../resolveio-server-app';\n\nexport async function loadServerInit() {\n\tEmailHistories.updateMany({status: 'processing'}, {$set: {status: 'pending'}});\n\n\tlet enableDebugFlag = await Flags.findOne({type: 'Enable Debug'});\n\n\tif (!enableDebugFlag) {\n\t\tFlags.insertOne({type: 'Enable Debug', value: false});\n\t}\n\n\tlet enableDebugFlagPDF = await Flags.findOne({type: 'Enable Debug PDF'});\n\n\tif (!enableDebugFlagPDF) {\n\t\tFlags.insertOne({type: 'Enable Debug PDF', value: false});\n\t}\n\telse if (enableDebugFlagPDF.value && ResolveIOServer.getServerConfig()['ROOT_URL'] !== 'http://localhost:4200') {\n\t\tFlags.updateOne({_id: enableDebugFlagPDF._id}, {$set: {value: false}});\n\t}\n}"]}
|
package/http/auth.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function setupAuthRoutes(mainServer: ResolveIOMainServer, app: any, serverConfig: any): void;
|
|
1
|
+
export declare function setupAuthRoutes(mainServer: any, app: any, serverConfig: any): void;
|
package/http/auth.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var __awaiter=this&&this.__awaiter||function(e,s,t,o){return new(t=t||Promise)(function(n,r){function fulfilled(e){try{step(o.next(e))}catch(e){r(e)}}function rejected(e){try{step(o.throw(e))}catch(e){r(e)}}function step(e){var r;e.done?n(e.value):((r=e.value)instanceof t?r:new t(function(e){e(r)})).then(fulfilled,rejected)}step((o=o.apply(e,s||[])).next())})},__generator=this&&this.__generator||function(s,t){var o,i,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},d={next:verb(0),throw:verb(1),return:verb(2)};return"function"==typeof Symbol&&(d[Symbol.iterator]=function(){return this}),d;function verb(n){return function(e){var r=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l=d&&r[d=0]?0:l;)try{if(o=1,i&&(a=2&r[0]?i.return:r[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;switch(i=0,(r=a?[2&r[0],a.value]:r)[0]){case 0:case 1:a=r;break;case 4:return l.label++,{value:r[1],done:!1};case 5:l.label++,i=r[1],r=[0];continue;case 7:r=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===r[0]||2===r[0])){l=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3]))l.label=r[1];else if(6===r[0]&&l.label<a[1])l.label=a[1],a=r;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(r)}}r=t.call(s,l)}catch(e){r=[6,e],i=0}finally{o=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}}},user_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupAuthRoutes=void 0,require("../collections/user.collection")),jwt=require("jsonwebtoken"),handlebars=require("handlebars"),__1=require(".."),mongo_manager_1=require("../managers/mongo.manager"),simpl_schema_1=require("simpl-schema"),bodyParser=require("body-parser"),jwt_decode_1=require("jwt-decode");function setupAuthRoutes(d,e,u){var r=this;e.post("/login365",bodyParser.json(),function(i,a){return __awaiter(r,void 0,void 0,function(){var r,n,s,t,o;return __generator(this,function(e){switch(e.label){case 0:return i.headers.origin===u.ROOT_URL||i.headers.origin===u.SEC_ROOT_URL?[3,1]:(a.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,11]);case 1:n=i.body,r=new simpl_schema_1.default({id_token:{type:String}});try{r.validate(n)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/login)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /login365\n\nData Being Checked\n"+JSON.stringify(n,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),a.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return(r=n.id_token.split("&"),n=r[0].split("=")[1],(s=(0,jwt_decode_1.default)(n))&&s.name&&s.preferred_username&&s.oid)?[4,user_collection_1.Users.findOne({"other.ms_oid":s.oid})]:[3,10];case 2:return(t=e.sent())?[3,5]:[4,user_collection_1.Users.findOne({email:s.preferred_username.toLowerCase()})];case 3:return(t=e.sent())?[4,user_collection_1.Users.updateOne({_id:t._id},{$set:{"other.ms_oid":s.oid}})]:[3,5];case 4:e.sent(),e.label=5;case 5:return t?[3,7]:(t={_id:(0,mongo_manager_1.objectIdHexString)(),__v:0,roles:{super_admin:!1,approvals:[],groups:[],notifications:[],miscs:[]},username:s.preferred_username.toLowerCase(),email:s.preferred_username.toLowerCase(),fullname:s.name,active:!0,phonenumber:"",readonly:!1,other:{ms_oid:s.oid},attempts:0,salt:jwt.sign({now:(Date.now()-1e3).toString()},u.JWT_SECRET,{expiresIn:7776e6}),hash:jwt.sign({now:(Date.now()+1e3).toString()},u.JWT_SECRET,{expiresIn:7776e6}),last:new Date,settings:null,services:null,is_customer:!1},[4,user_collection_1.Users.create(t)]);case 6:return e.sent(),[3,9];case 7:return(o=!1,t.email!==s.preferred_username.toLowerCase()&&(t.email=s.preferred_username.toLowerCase(),o=!0),t.fullname!==s.name&&(t.fullname=s.name,o=!0),o)?[4,user_collection_1.Users.updateOne({_id:t._id},{$set:{email:t.email,fullname:t.fullname}})]:[3,9];case 8:e.sent(),e.label=9;case 9:return a.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:t._id},u.JWT_SECRET,{expiresIn:7776e6})}})),[3,11];case 10:console.log("ERROR - 1",r,n,s),a.send(JSON.stringify({error:!0,result:"Invalid Azure Token"})),e.label=11;case 11:return[2]}})})}),e.post("/login",bodyParser.json(),function(a,l){return __awaiter(r,void 0,void 0,function(){var r,n,s,t,o,i;return __generator(this,function(e){switch(e.label){case 0:return a.headers.origin===u.ROOT_URL||a.headers.origin===u.SEC_ROOT_URL?[3,1]:(l.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,8]);case 1:r=a.body,n=new simpl_schema_1.default({username:{type:String},password:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/login)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /login\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),l.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return[4,user_collection_1.Users.findOne({active:!0,username:r.username})];case 2:return(s=e.sent())?[3,4]:[4,user_collection_1.Users.findOne({active:!0,email:r.username})];case 3:s=e.sent(),e.label=4;case 4:return s?[4,user_collection_1.Users.authenticate(s,r.password)]:(l.send(JSON.stringify({error:!0,result:"Invalid Username And Password"})),[2]);case 5:return(t=e.sent()).error?("Too Many Attempts"===t.error?(l.send(JSON.stringify({error:!0,result:t.error+". A password reset link has been sent to your email, please reset your password."})),s.services||(s.services={}),s.services.forgot_password=jwt.sign({id_user:s._id},u.JWT_SECRET),o={userToChangePassword:s.fullname,userWhoResetPassword:__1.ResolveIOServer.getClientName()+" System",url:u.ROOT_URL+"/forgot-password?"+encodeURIComponent(u.SERVER_URL)+"&"+s.services.forgot_password},user_collection_1.Users.updateOne({_id:s._id},{$set:{services:s.services}}).then(function(e){d.getMethodManager().readFile("email-templates/forgot-password.html").then(function(e){e=handlebars.compile(e);handlebars.registerHelper("equals",function(e,r){return e===r}),d.getMethodManager().sendEmail(s.email,"ResolveIO ("+__1.ResolveIOServer.getClientName()+") - Forgot Password","",e(o),null,null,"")},function(e){return console.log(e)})},function(e){})):"No Salt Value Stored"===t.error?(l.send(JSON.stringify({error:!0,result:"A password reset link has been sent to your email, please reset your password."})),s.services||(s.services={}),s.services.forgot_password=jwt.sign({id_user:s._id},u.JWT_SECRET),i={userToChangePassword:s.fullname,userWhoResetPassword:__1.ResolveIOServer.getClientName()+" System",url:u.ROOT_URL+"/forgot-password?"+encodeURIComponent(u.SERVER_URL)+"&"+s.services.forgot_password},user_collection_1.Users.updateOne({_id:s._id},{$set:{services:s.services}}).then(function(e){d.getMethodManager().readFile("email-templates/forgot-password.html").then(function(e){e=handlebars.compile(e);handlebars.registerHelper("equals",function(e,r){return e===r}),d.getMethodManager().sendEmail(s.email,"ResolveIO ("+__1.ResolveIOServer.getClientName()+") - Forgot Password","",e(i),null,null,"")},function(e){return console.log(e)})},function(e){})):l.send(JSON.stringify({error:!0,result:t.error})),[3,8]):[3,6];case 6:return t&&t.data&&t.data.active?[4,user_collection_1.Users.resetAttempts(t.data)]:[3,8];case 7:e.sent(),l.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:t.data._id},u.JWT_SECRET,{expiresIn:7776e6})}})),e.label=8;case 8:return[2]}})})}),e.post("/accessToken",bodyParser.json(),function(t,o){return __awaiter(this,void 0,void 0,function(){var r,n,s=this;return __generator(this,function(e){if(t.headers.origin!==u.ROOT_URL&&t.headers.origin!==u.SEC_ROOT_URL&&t.headers.origin!==u.RESOLVEIO_URL&&t.headers.origin!==u.RESOLVEIO_SECONDARY_URL)o.send(JSON.stringify({error:!0,result:"Invalid header"}));else{r=t.body,n=new simpl_schema_1.default({refreshToken:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/accessToken)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /accessToken\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),o.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}jwt.verify(r.refreshToken,u.JWT_SECRET,function(e,r){e?o.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findById(r.id_user).then(function(r){return __awaiter(s,void 0,void 0,function(){return __generator(this,function(e){return r?r.active?o.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:r._id},u.JWT_SECRET,{expiresIn:2592e5}),user:r}})):o.send(JSON.stringify({error:!0,result:"Account is Disabled"})):o.send(JSON.stringify({error:!0,result:"Invalid User"})),[2]})})},function(e){o.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}return[2]})})}),e.post("/userWithEnrollmentToken",bodyParser.json(),function(e,n){if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)n.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var s=e.body,e=new simpl_schema_1.default({enrollmentToken:{type:String}});try{e.validate(s)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/userWithEnrollmentToken)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /userWithEnrollmentToken\n\nData Being Checked\n"+JSON.stringify(s,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void n.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(s.enrollmentToken,u.JWT_SECRET,function(e,r){e?n.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:r.id_user},{"services.enrollment":s.enrollmentToken}]},{projection:{_id:1,__v:1,username:1,active:1}}).then(function(e){e?e.active?n.send(JSON.stringify({error:!1,result:{user:e}})):n.send(JSON.stringify({error:!0,result:"Account is Disabled"})):n.send(JSON.stringify({error:!0,result:"Invalid User"}))},function(e){n.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}}),e.post("/setUserWithEnrollmentToken",bodyParser.json(),function(e,t){var n=this;if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)t.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var o=e.body,e=new simpl_schema_1.default({enrollmentToken:{type:String},password:{type:String}});try{e.validate(o)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/setUserWithEnrollmentToken)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /setUserWithEnrollmentToken\n\nData Being Checked\n"+JSON.stringify(o,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void t.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(o.enrollmentToken,u.JWT_SECRET,function(r,s){return __awaiter(n,void 0,void 0,function(){var n=this;return __generator(this,function(e){return r?t.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:s.id_user},{"services.enrollment":o.enrollmentToken}]}).then(function(r){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return r?r.active?[4,user_collection_1.Users.setPassword(r,o.password)]:[3,2]:[3,4];case 1:return e.sent(),t.send(JSON.stringify({error:!1,result:!0})),[3,3];case 2:t.send(JSON.stringify({error:!0,result:"Account is Disabled"})),e.label=3;case 3:return[3,5];case 4:t.send(JSON.stringify({error:!0,result:"Invalid User"})),e.label=5;case 5:return[2]}})})},function(e){t.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))}),[2]})})})}}),e.post("/userWithForgotPasswordToken",bodyParser.json(),function(e,n){if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)n.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var s=e.body,e=new simpl_schema_1.default({forgotPasswordToken:{type:String}});try{e.validate(s)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/userWithForgotPasswordToken)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /userWithForgotPasswordToken\n\nData Being Checked\n"+JSON.stringify(s,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void n.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(s.forgotPasswordToken,u.JWT_SECRET,function(e,r){e?n.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:r.id_user},{"services.forgot_password":s.forgotPasswordToken}]},{projection:{_id:1,__v:1,username:1,active:1}}).then(function(e){e?e.active?n.send(JSON.stringify({error:!1,result:{user:e}})):n.send(JSON.stringify({error:!0,result:"Account is Disabled"})):n.send(JSON.stringify({error:!0,result:"Invalid Token"}))},function(e){n.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}}),e.post("/setUserWithForgotPasswordToken",bodyParser.json(),function(e,t){var n=this;if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)t.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var o=e.body,e=new simpl_schema_1.default({forgotPasswordToken:{type:String},password:{type:String}});try{e.validate(o)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/setUserWithForgotPasswordToken)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /setUserWithForgotPasswordToken\n\nData Being Checked\n"+JSON.stringify(o,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void t.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(o.forgotPasswordToken,u.JWT_SECRET,function(r,s){return __awaiter(n,void 0,void 0,function(){var n=this;return __generator(this,function(e){return r?t.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:s.id_user},{"services.forgot_password":o.forgotPasswordToken}]}).then(function(r){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return r?r.active?[4,user_collection_1.Users.setPassword(r,o.password)]:[3,2]:[3,4];case 1:return e.sent(),t.send(JSON.stringify({error:!1,result:!0})),[3,3];case 2:t.send(JSON.stringify({error:!0,result:"Account is Disabled"})),e.label=3;case 3:return[3,5];case 4:t.send(JSON.stringify({error:!0,result:"Invalid User"})),e.label=5;case 5:return[2]}})})},function(e){t.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))}),[2]})})})}}),e.post("/resetPassword",bodyParser.json(),function(t,o){return __awaiter(r,void 0,void 0,function(){var r,n,s;return __generator(this,function(e){switch(e.label){case 0:return t.headers.origin===u.ROOT_URL||t.headers.origin===u.SEC_ROOT_URL?[3,1]:(o.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,5]);case 1:r=t.body,n=new simpl_schema_1.default({username:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/resetPassword)",e),__1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",__1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /resetPassword\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),o.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return[4,user_collection_1.Users.findOne({active:!0,username:r.username})];case 2:return(s=e.sent())?[3,4]:[4,user_collection_1.Users.findOne({active:!0,email:r.username})];case 3:s=e.sent(),e.label=4;case 4:s&&d.getMethodManager().callMethodInternal.call(d.getMethodManager(),"resetUserPassword",s._id),o.send(JSON.stringify({error:!1,result:""})),e.label=5;case 5:return[2]}})})})}exports.setupAuthRoutes=setupAuthRoutes;
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,s,t,o){return new(t=t||Promise)(function(n,r){function fulfilled(e){try{step(o.next(e))}catch(e){r(e)}}function rejected(e){try{step(o.throw(e))}catch(e){r(e)}}function step(e){var r;e.done?n(e.value):((r=e.value)instanceof t?r:new t(function(e){e(r)})).then(fulfilled,rejected)}step((o=o.apply(e,s||[])).next())})},__generator=this&&this.__generator||function(s,t){var o,i,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},d={next:verb(0),throw:verb(1),return:verb(2)};return"function"==typeof Symbol&&(d[Symbol.iterator]=function(){return this}),d;function verb(n){return function(e){var r=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l=d&&r[d=0]?0:l;)try{if(o=1,i&&(a=2&r[0]?i.return:r[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,r[1])).done)return a;switch(i=0,(r=a?[2&r[0],a.value]:r)[0]){case 0:case 1:a=r;break;case 4:return l.label++,{value:r[1],done:!1};case 5:l.label++,i=r[1],r=[0];continue;case 7:r=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===r[0]||2===r[0])){l=0;continue}if(3===r[0]&&(!a||r[1]>a[0]&&r[1]<a[3]))l.label=r[1];else if(6===r[0]&&l.label<a[1])l.label=a[1],a=r;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(r)}}r=t.call(s,l)}catch(e){r=[6,e],i=0}finally{o=a=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}}},user_collection_1=(Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupAuthRoutes=void 0,require("../collections/user.collection")),jwt=require("jsonwebtoken"),handlebars=require("handlebars"),resolveio_server_app_1=require("../resolveio-server-app"),simpl_schema_1=require("simpl-schema"),bodyParser=require("body-parser"),jwt_decode_1=require("jwt-decode"),common_1=require("../util/common");function setupAuthRoutes(d,e,u){var r=this;e.post("/login365",bodyParser.json(),function(i,a){return __awaiter(r,void 0,void 0,function(){var r,n,s,t,o;return __generator(this,function(e){switch(e.label){case 0:return i.headers.origin===u.ROOT_URL||i.headers.origin===u.SEC_ROOT_URL?[3,1]:(a.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,11]);case 1:n=i.body,r=new simpl_schema_1.default({id_token:{type:String}});try{r.validate(n)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/login)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /login365\n\nData Being Checked\n"+JSON.stringify(n,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),a.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return(r=n.id_token.split("&"),n=r[0].split("=")[1],(s=(0,jwt_decode_1.default)(n))&&s.name&&s.preferred_username&&s.oid)?[4,user_collection_1.Users.findOne({"other.ms_oid":s.oid})]:[3,10];case 2:return(t=e.sent())?[3,5]:[4,user_collection_1.Users.findOne({email:s.preferred_username.toLowerCase()})];case 3:return(t=e.sent())?[4,user_collection_1.Users.updateOne({_id:t._id},{$set:{"other.ms_oid":s.oid}})]:[3,5];case 4:e.sent(),e.label=5;case 5:return t?[3,7]:(t={_id:(0,common_1.objectIdHexString)(),__v:0,roles:{super_admin:!1,approvals:[],groups:[],notifications:[],miscs:[]},username:s.preferred_username.toLowerCase(),email:s.preferred_username.toLowerCase(),fullname:s.name,active:!0,phonenumber:"",readonly:!1,other:{ms_oid:s.oid},attempts:0,salt:jwt.sign({now:(Date.now()-1e3).toString()},u.JWT_SECRET,{expiresIn:7776e6}),hash:jwt.sign({now:(Date.now()+1e3).toString()},u.JWT_SECRET,{expiresIn:7776e6}),last:new Date,settings:null,services:null,is_customer:!1},[4,user_collection_1.Users.create(t)]);case 6:return e.sent(),[3,9];case 7:return(o=!1,t.email!==s.preferred_username.toLowerCase()&&(t.email=s.preferred_username.toLowerCase(),o=!0),t.fullname!==s.name&&(t.fullname=s.name,o=!0),o)?[4,user_collection_1.Users.updateOne({_id:t._id},{$set:{email:t.email,fullname:t.fullname}})]:[3,9];case 8:e.sent(),e.label=9;case 9:return a.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:t._id},u.JWT_SECRET,{expiresIn:7776e6})}})),[3,11];case 10:console.log("ERROR - 1",r,n,s),a.send(JSON.stringify({error:!0,result:"Invalid Azure Token"})),e.label=11;case 11:return[2]}})})}),e.post("/login",bodyParser.json(),function(a,l){return __awaiter(r,void 0,void 0,function(){var r,n,s,t,o,i;return __generator(this,function(e){switch(e.label){case 0:return a.headers.origin===u.ROOT_URL||a.headers.origin===u.SEC_ROOT_URL?[3,1]:(l.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,8]);case 1:r=a.body,n=new simpl_schema_1.default({username:{type:String},password:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/login)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /login\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),l.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return[4,user_collection_1.Users.findOne({active:!0,username:r.username})];case 2:return(s=e.sent())?[3,4]:[4,user_collection_1.Users.findOne({active:!0,email:r.username})];case 3:s=e.sent(),e.label=4;case 4:return s?[4,user_collection_1.Users.authenticate(s,r.password)]:(l.send(JSON.stringify({error:!0,result:"Invalid Username And Password"})),[2]);case 5:return(t=e.sent()).error?("Too Many Attempts"===t.error?(l.send(JSON.stringify({error:!0,result:t.error+". A password reset link has been sent to your email, please reset your password."})),s.services||(s.services={}),s.services.forgot_password=jwt.sign({id_user:s._id},u.JWT_SECRET),o={userToChangePassword:s.fullname,userWhoResetPassword:resolveio_server_app_1.ResolveIOServer.getClientName()+" System",url:u.ROOT_URL+"/forgot-password?"+encodeURIComponent(u.SERVER_URL)+"&"+s.services.forgot_password},user_collection_1.Users.updateOne({_id:s._id},{$set:{services:s.services}}).then(function(e){d.getMethodManager().readFile("email-templates/forgot-password.html").then(function(e){e=handlebars.compile(e);handlebars.registerHelper("equals",function(e,r){return e===r}),d.getMethodManager().sendEmail(s.email,"ResolveIO ("+resolveio_server_app_1.ResolveIOServer.getClientName()+") - Forgot Password","",e(o),null,null,"")},function(e){return console.log(e)})},function(e){})):"No Salt Value Stored"===t.error?(l.send(JSON.stringify({error:!0,result:"A password reset link has been sent to your email, please reset your password."})),s.services||(s.services={}),s.services.forgot_password=jwt.sign({id_user:s._id},u.JWT_SECRET),i={userToChangePassword:s.fullname,userWhoResetPassword:resolveio_server_app_1.ResolveIOServer.getClientName()+" System",url:u.ROOT_URL+"/forgot-password?"+encodeURIComponent(u.SERVER_URL)+"&"+s.services.forgot_password},user_collection_1.Users.updateOne({_id:s._id},{$set:{services:s.services}}).then(function(e){d.getMethodManager().readFile("email-templates/forgot-password.html").then(function(e){e=handlebars.compile(e);handlebars.registerHelper("equals",function(e,r){return e===r}),d.getMethodManager().sendEmail(s.email,"ResolveIO ("+resolveio_server_app_1.ResolveIOServer.getClientName()+") - Forgot Password","",e(i),null,null,"")},function(e){return console.log(e)})},function(e){})):l.send(JSON.stringify({error:!0,result:t.error})),[3,8]):[3,6];case 6:return t&&t.data&&t.data.active?[4,user_collection_1.Users.resetAttempts(t.data)]:[3,8];case 7:e.sent(),l.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:t.data._id},u.JWT_SECRET,{expiresIn:7776e6})}})),e.label=8;case 8:return[2]}})})}),e.post("/accessToken",bodyParser.json(),function(t,o){return __awaiter(this,void 0,void 0,function(){var r,n,s=this;return __generator(this,function(e){if(t.headers.origin!==u.ROOT_URL&&t.headers.origin!==u.SEC_ROOT_URL&&t.headers.origin!==u.RESOLVEIO_URL&&t.headers.origin!==u.RESOLVEIO_SECONDARY_URL)o.send(JSON.stringify({error:!0,result:"Invalid header"}));else{r=t.body,n=new simpl_schema_1.default({refreshToken:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/accessToken)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /accessToken\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),o.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}jwt.verify(r.refreshToken,u.JWT_SECRET,function(e,r){e?o.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findById(r.id_user).then(function(r){return __awaiter(s,void 0,void 0,function(){return __generator(this,function(e){return r?r.active?o.send(JSON.stringify({error:!1,result:{token:jwt.sign({id_user:r._id},u.JWT_SECRET,{expiresIn:2592e5}),user:r}})):o.send(JSON.stringify({error:!0,result:"Account is Disabled"})):o.send(JSON.stringify({error:!0,result:"Invalid User"})),[2]})})},function(e){o.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}return[2]})})}),e.post("/userWithEnrollmentToken",bodyParser.json(),function(e,n){if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)n.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var s=e.body,e=new simpl_schema_1.default({enrollmentToken:{type:String}});try{e.validate(s)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/userWithEnrollmentToken)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /userWithEnrollmentToken\n\nData Being Checked\n"+JSON.stringify(s,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void n.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(s.enrollmentToken,u.JWT_SECRET,function(e,r){e?n.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:r.id_user},{"services.enrollment":s.enrollmentToken}]},{projection:{_id:1,__v:1,username:1,active:1}}).then(function(e){e?e.active?n.send(JSON.stringify({error:!1,result:{user:e}})):n.send(JSON.stringify({error:!0,result:"Account is Disabled"})):n.send(JSON.stringify({error:!0,result:"Invalid User"}))},function(e){n.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}}),e.post("/setUserWithEnrollmentToken",bodyParser.json(),function(e,t){var n=this;if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)t.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var o=e.body,e=new simpl_schema_1.default({enrollmentToken:{type:String},password:{type:String}});try{e.validate(o)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/setUserWithEnrollmentToken)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /setUserWithEnrollmentToken\n\nData Being Checked\n"+JSON.stringify(o,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void t.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(o.enrollmentToken,u.JWT_SECRET,function(r,s){return __awaiter(n,void 0,void 0,function(){var n=this;return __generator(this,function(e){return r?t.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:s.id_user},{"services.enrollment":o.enrollmentToken}]}).then(function(r){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return r?r.active?[4,user_collection_1.Users.setPassword(r,o.password)]:[3,2]:[3,4];case 1:return e.sent(),t.send(JSON.stringify({error:!1,result:!0})),[3,3];case 2:t.send(JSON.stringify({error:!0,result:"Account is Disabled"})),e.label=3;case 3:return[3,5];case 4:t.send(JSON.stringify({error:!0,result:"Invalid User"})),e.label=5;case 5:return[2]}})})},function(e){t.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))}),[2]})})})}}),e.post("/userWithForgotPasswordToken",bodyParser.json(),function(e,n){if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)n.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var s=e.body,e=new simpl_schema_1.default({forgotPasswordToken:{type:String}});try{e.validate(s)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/userWithForgotPasswordToken)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /userWithForgotPasswordToken\n\nData Being Checked\n"+JSON.stringify(s,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void n.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(s.forgotPasswordToken,u.JWT_SECRET,function(e,r){e?n.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:r.id_user},{"services.forgot_password":s.forgotPasswordToken}]},{projection:{_id:1,__v:1,username:1,active:1}}).then(function(e){e?e.active?n.send(JSON.stringify({error:!1,result:{user:e}})):n.send(JSON.stringify({error:!0,result:"Account is Disabled"})):n.send(JSON.stringify({error:!0,result:"Invalid Token"}))},function(e){n.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))})})}}),e.post("/setUserWithForgotPasswordToken",bodyParser.json(),function(e,t){var n=this;if(e.headers.origin!==u.ROOT_URL&&e.headers.origin!==u.SEC_ROOT_URL&&e.headers.origin!==u.RESOLVEIO_URL&&e.headers.origin!==u.RESOLVEIO_SECONDARY_URL)t.send(JSON.stringify({error:!0,result:"Invalid header"}));else{var o=e.body,e=new simpl_schema_1.default({forgotPasswordToken:{type:String},password:{type:String}});try{e.validate(o)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/setUserWithForgotPasswordToken)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /setUserWithForgotPasswordToken\n\nData Being Checked\n"+JSON.stringify(o,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),void t.send(JSON.stringify({error:!0,result:"Invalid Parameters"}))}jwt.verify(o.forgotPasswordToken,u.JWT_SECRET,function(r,s){return __awaiter(n,void 0,void 0,function(){var n=this;return __generator(this,function(e){return r?t.send(JSON.stringify({error:!0,result:"Invalid Token"})):user_collection_1.Users.findOne({$and:[{_id:s.id_user},{"services.forgot_password":o.forgotPasswordToken}]}).then(function(r){return __awaiter(n,void 0,void 0,function(){return __generator(this,function(e){switch(e.label){case 0:return r?r.active?[4,user_collection_1.Users.setPassword(r,o.password)]:[3,2]:[3,4];case 1:return e.sent(),t.send(JSON.stringify({error:!1,result:!0})),[3,3];case 2:t.send(JSON.stringify({error:!0,result:"Account is Disabled"})),e.label=3;case 3:return[3,5];case 4:t.send(JSON.stringify({error:!0,result:"Invalid User"})),e.label=5;case 5:return[2]}})})},function(e){t.send(JSON.stringify({error:!0,result:"Invalid Mongo Get User"}))}),[2]})})})}}),e.post("/resetPassword",bodyParser.json(),function(t,o){return __awaiter(r,void 0,void 0,function(){var r,n,s;return __generator(this,function(e){switch(e.label){case 0:return t.headers.origin===u.ROOT_URL||t.headers.origin===u.SEC_ROOT_URL?[3,1]:(o.send(JSON.stringify({error:!0,result:"Invalid header"})),[3,5]);case 1:r=t.body,n=new simpl_schema_1.default({username:{type:String}});try{n.validate(r)}catch(e){if(e)return console.error(new Date,"Error in HTTP Check (/resetPassword)",e),resolveio_server_app_1.ResolveIOServer.getMainServer().getMethodManager().sendEmail("dev@resolveio.com",resolveio_server_app_1.ResolveIOServer.getClientName()+"HTTP - Error Detected","Match Error On HTTP /resetPassword\n\nData Being Checked\n"+JSON.stringify(r,null,2)+"\n\nErrors\n"+JSON.stringify(e,null,2)),o.send(JSON.stringify({error:!0,result:"Invalid Parameters"})),[2]}return[4,user_collection_1.Users.findOne({active:!0,username:r.username})];case 2:return(s=e.sent())?[3,4]:[4,user_collection_1.Users.findOne({active:!0,email:r.username})];case 3:s=e.sent(),e.label=4;case 4:s&&d.getMethodManager().callMethodInternal.call(d.getMethodManager(),"resetUserPassword",s._id),o.send(JSON.stringify({error:!1,result:""})),e.label=5;case 5:return[2]}})})})}exports.setupAuthRoutes=setupAuthRoutes;
|
|
2
2
|
//# sourceMappingURL=auth.js.map
|