@resolveio/server-lib 8.1.30 → 8.1.32
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,+DAAiE;AACjE,6CAAwC;AACxC,kCAA2C;AAG3C,yCAA+D;AAE/D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,KAAK,EAAE;QACN,IAAI,EAAE,MAAM;KACZ;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,OAAO;KACb;IACD,iBAAiB,EAAE;QAClB,IAAI,EAAE,KAAK;KACX;IACD,mBAAmB,EAAE;QACpB,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ;IACD,yBAAyB,EAAE;QAC1B,IAAI,EAAE,MAAM;KACZ;IACD,wBAAwB,EAAE;QACzB,IAAI,EAAE,MAAM;KACZ;IACD,cAAc,EAAE;QACf,IAAI,EAAE,KAAK;KACX;IACD,gBAAgB,EAAE;QACjB,IAAI,EAAE,MAAM;KACZ;IACD,qBAAqB,EAAE;QACtB,IAAI,EAAE,MAAM;KACZ;IACD,sBAAsB,EAAE;QACvB,IAAI,EAAE,KAAK;KACX;IACD,wBAAwB,EAAE;QACzB,I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,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,aAAa,CAAC,KAAK,CAAC,EAAC,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC,CAAC;QAElD,aAAK,CAAC,mBAAmB,CAAC,GAAG,gBAAgB,CAAC;QAE9C,oBAAY,GAAG,uBAAe,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,aAAK,CAAC,mBAAmB,CAAC,EAAE,aAAa,CAAC,CAAC;QAE5F,qCAAqC;QACrC,IAAI,SAAS,GAAmB,EAAE,CAAC;QAEnC,IAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,uBAAc,CAAC,SAAS,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC;QACnF,aAAK,CAAC,UAAU,CAAC,GAAG,sBAAa,CAAC,QAAQ,CAAC,CAAC;KAC5C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { Schema, Model, PassportLocalDocument, PassportLocalModel, PassportLocalSchema} from 'mongoose';\nimport * as passportLocalMongoose from 'passport-local-mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserModel } from '../models/user.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/common';\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},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\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.$.yard': {\n\t\ttype: String,\n\t\toptional: true\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\tattempts: {\n\t\ttype: Number,\n\t\toptional: true\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\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};\n\nconst DefaultSchema = <PassportLocalSchema>new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.plugin(passportLocalMongoose, {\n\tusernameUnique: true,\n\tlimitAttempts: true,\n\tmaxAttempts: 5,\n\tfindByUsername: (mongooseModel, queryParameters) => {\n\t\t// Add additional query parameter - AND condition - active: true\n\t\tqueryParameters.active = true;\n\t\treturn mongooseModel.findOne(queryParameters);\n\t}\n});\n\nDefaultSchema.index({fullname: 1});\nDefaultSchema.index({active: 1});\n\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\n\nexport let Users: Model<ResolveIOModel> = null;\nexport let UserVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUsers = ResolveIOServer.getMainDB().model('users', DefaultSchema);\n\n\t\tUsers['simplschema'] = new SimpleSchema(schema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\n\t\tUsers['versionCollection'] = 'users.versions';\n\n\t\tUserVersions = ResolveIOServer.getMainDB().model(Users['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tUsers['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/collections/user.collection.ts"],"names":[],"mappings":";;;AAAA,qCAAwG;AACxG,+DAAiE;AACjE,6CAAwC;AACxC,kCAA2C;AAG3C,yCAA+D;AAE/D,IAAI,MAAM,GAAQ;IACjB,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,GAAG,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,IAAI;KACd;IACD,SAAS,EAAE;QACV,IAAI,EAAE,IAAI;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C,CAAC;QACnF,aAAK,CAAC,UAAU,CAAC,GAAG,sBAAa,CAAC,QAAQ,CAAC,CAAC;KAC5C;SACI;QACJ,UAAU,CAAC;YACV,oBAAoB,EAAE,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,CAAC;KACN;AACF,CAAC","file":"user.collection.js","sourcesContent":["import { Schema, Model, PassportLocalDocument, PassportLocalModel, PassportLocalSchema} from 'mongoose';\nimport * as passportLocalMongoose from 'passport-local-mongoose';\nimport SimpleSchema from 'simpl-schema';\nimport { ResolveIOServer } from '../index';\nimport { UserModel } from '../models/user.model';\nimport { LookupTables } from '../models/report-builder.model';\nimport { buildRbSchema, buildRbLookups } from '../util/common';\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},\n\t'roles.approvals.$.key_2': {\n\t\ttype: String\n\t},\n\t'roles.approvals.$.key_3': {\n\t\ttype: String\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.$.yard': {\n\t\ttype: String,\n\t\toptional: true\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\tattempts: {\n\t\ttype: Number,\n\t\toptional: true\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\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};\n\nconst DefaultSchema = <PassportLocalSchema>new Schema(schema, {\n\tskipVersioning: true,\n\tversionKey: false,\n\ttimestamps: true\n});\n\nDefaultSchema.plugin(passportLocalMongoose, {\n\tusernameUnique: true,\n\tlimitAttempts: true,\n\tmaxAttempts: 5,\n\tfindByUsername: (mongooseModel, queryParameters) => {\n\t\t// Add additional query parameter - AND condition - active: true\n\t\tqueryParameters.active = true;\n\t\treturn mongooseModel.findOne(queryParameters);\n\t}\n});\n\nDefaultSchema.index({fullname: 1});\nDefaultSchema.index({active: 1});\n\ninterface ResolveIOModel extends UserModel, PassportLocalDocument {}\n\nexport let Users: Model<ResolveIOModel> = null;\nexport let UserVersions: Model<ResolveIOModel> = null;\n\ninitializeCollection();\n\nfunction initializeCollection() {\n\tif (ResolveIOServer.getMainDB()) {\n\t\tUsers = ResolveIOServer.getMainDB().model('users', DefaultSchema);\n\n\t\tUsers['simplschema'] = new SimpleSchema(schema);\n\n\t\tschema._id = {\n\t\t\ttype: Schema.Types.Mixed\n\t\t};\n\n\t\tlet VersionSchema = new Schema(schema, {\n\t\t\tskipVersioning: true,\n\t\t\tversionKey: false,\n\t\t\ttimestamps: true\n\t\t});\n\n\t\tVersionSchema.index({'_id.__v': 1, '_id._id': 1});\n\n\t\tUsers['versionCollection'] = 'users.versions';\n\n\t\tUserVersions = ResolveIOServer.getMainDB().model(Users['versionCollection'], VersionSchema);\n\n\t\t//------------- Report Builder Schema\n\t\tlet rbLookups: LookupTables[] = [];\n\n\t\tlet rbSchema = Object.assign(schema, buildRbLookups(rbLookups, DefaultSchema, []));\n\t\tUsers['rbSchema'] = buildRbSchema(rbSchema);\n\t}\n\telse {\n\t\tsetTimeout(() => {\n\t\t\tinitializeCollection();\n\t\t}, 0);\n\t}\n}"]}
|
package/methods/cloudconvert.js
CHANGED
|
@@ -100,7 +100,7 @@ function loadCloudConvertMethods(methodManager) {
|
|
|
100
100
|
function: function (file_input_keys, tasks, file_output_key, file_name) {
|
|
101
101
|
var _this = this;
|
|
102
102
|
return new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
103
|
-
var cloudJob, jobImports, jobConverts, jobTasks, request, jobBody, body, requestWait_1, interval_1, error_2;
|
|
103
|
+
var cloudJob, jobImports, jobConverts, jobTasks, request, jobBody, body, requestWait_1, running_1, interval_1, error_2;
|
|
104
104
|
var _this = this;
|
|
105
105
|
return __generator(this, function (_a) {
|
|
106
106
|
switch (_a.label) {
|
|
@@ -164,28 +164,36 @@ function loadCloudConvertMethods(methodManager) {
|
|
|
164
164
|
body = typeof jobBody === 'string' ? JSON.parse(jobBody) : jobBody;
|
|
165
165
|
if (body && body.data && body.data.links) {
|
|
166
166
|
requestWait_1 = bent(body.data.links.self, 'GET', 'json', 200);
|
|
167
|
+
running_1 = false;
|
|
167
168
|
interval_1 = setInterval(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
168
169
|
var bodyWait, responseBody, errorWait_1;
|
|
169
170
|
return __generator(this, function (_a) {
|
|
170
171
|
switch (_a.label) {
|
|
171
172
|
case 0:
|
|
172
|
-
|
|
173
|
+
if (!!running_1) return [3 /*break*/, 5];
|
|
174
|
+
running_1 = true;
|
|
175
|
+
_a.label = 1;
|
|
176
|
+
case 1:
|
|
177
|
+
_a.trys.push([1, 3, , 4]);
|
|
173
178
|
return [4 /*yield*/, requestWait_1('', null, {
|
|
174
179
|
'Authorization': 'Bearer ' + this.serverConfig['CLOUDCONVERT_V2']
|
|
175
180
|
})];
|
|
176
|
-
case
|
|
181
|
+
case 2:
|
|
177
182
|
bodyWait = _a.sent();
|
|
178
183
|
responseBody = typeof bodyWait === 'string' ? JSON.parse(bodyWait) : bodyWait;
|
|
179
184
|
if (responseBody.data.status === 'finished') {
|
|
180
185
|
clearInterval(interval_1);
|
|
181
186
|
resolve(responseBody);
|
|
182
187
|
}
|
|
183
|
-
return [3 /*break*/,
|
|
184
|
-
case
|
|
188
|
+
return [3 /*break*/, 4];
|
|
189
|
+
case 3:
|
|
185
190
|
errorWait_1 = _a.sent();
|
|
186
191
|
console.log('Error happened wait :', JSON.stringify(errorWait_1, null, 2));
|
|
187
|
-
return [3 /*break*/,
|
|
188
|
-
case
|
|
192
|
+
return [3 /*break*/, 4];
|
|
193
|
+
case 4:
|
|
194
|
+
running_1 = false;
|
|
195
|
+
_a.label = 5;
|
|
196
|
+
case 5: return [2 /*return*/];
|
|
189
197
|
}
|
|
190
198
|
});
|
|
191
199
|
}); }, 1000);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/methods/cloudconvert.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2BAA6B;AAC7B,6CAAwC;AAExC,SAAgB,uBAAuB,CAAC,aAA4B;IACnE,aAAa,CAAC,OAAO,CAAC;QACrB,eAAe,EAAE;YAChB,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE;gBAAA,iBAmBT;gBAlBA,OAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAE,MAAM;;;;;gCAClC,OAAO,GAAG,IAAI,CAAC,8BAA8B,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;;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AAC,EAAE,EAAE,IAAI,EAAE;4DAC1C,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC;yDACjE,CAAC,EAAA;;oDAFE,QAAQ,GAAG,SAEb;oDAEE,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;oDAElF,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,KAAK,UAAU,EAAE;wDAC5C,aAAa,CAAC,UAAQ,CAAC,CAAC;wDACxB,OAAO,CAAC,YAAY,CAAC,CAAC;qDACtB;;;;oDAGD,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAC,IAAI,CAAC,SAAS,CAAC,WAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;;oDAEzE,SAAO,GAAG,KAAK,CAAC;;;;;yCAEjB,EAAE,IAAI,CAAC,CAAC;iCACT;;;;gCAGD,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,OAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;gCAChE,MAAM,CAAC,OAAK,CAAC,CAAC;;;;;qBAEf,CAAC,CAAC;YACJ,CAAC;SACD;KACD,CAAC,CAAC;AACJ,CAAC;AAvJD,0DAuJC","file":"cloudconvert.js","sourcesContent":["import { MethodManager } from '../managers/method.manager';\nimport * as bent from 'bent';\nimport SimpleSchema from 'simpl-schema';\n\nexport function loadCloudConvertMethods(methodManager: MethodManager) {\n\tmethodManager.methods({\n\t\tgetCCProcessURL: {\n\t\t\tskipQueue: true,\n\t\t\tfunction: function() {\n\t\t\t\treturn new Promise(async (resolve, reject) => {\n\t\t\t\t\tconst request = bent('https://api.cloudconvert.com', 'POST', 'json', 200);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlet body = await request('/process', {\n\t\t\t\t\t\t\t'apikey': this.serverConfig['CLOUDCONVERT'],\n\t\t\t\t\t\t\t'mode': 'combine',\n\t\t\t\t\t\t\t'inputformat': 'pdf',\n\t\t\t\t\t\t\t'outputformat': 'pdf'\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tresolve(body);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(error) {\n\t\t\t\t\t\tconsole.log('Error happened: ' + error);\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tcreateCloudConvertJob: {\n\t\t\tskipQueue: true,\n\t\t\tcheck: new SimpleSchema({\n\t\t\t\tfile_input_keys: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'file_input_keys.$': {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\ttasks: {\n\t\t\t\t\ttype: Array\n\t\t\t\t},\n\t\t\t\t'tasks.$': {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfile_output_key: {\n\t\t\t\t\ttype: String\n\t\t\t\t},\n\t\t\t\tfile_name: {\n\t\t\t\t\ttype: String\n\t\t\t\t}\n\t\t\t}),\n\t\t\tfunction: function(file_input_keys: string[], tasks: string[], file_output_key: string, file_name: string) {\n\t\t\t\treturn new Promise(async (resolve, reject) => {\n\t\t\t\t\tlet cloudJob = {};\n\t\t\t\t\tlet jobImports = [];\n\n\t\t\t\t\tfile_input_keys.forEach((key, keyIdx) => {\n\t\t\t\t\t\tcloudJob['import-' + (keyIdx + 1)] = {\n\t\t\t\t\t\t\toperation: 'import/s3',\n\t\t\t\t\t\t\tbucket: this.serverConfig['AWSBUCKET'],\n\t\t\t\t\t\t\tregion: this.serverConfig['AWSREGION'],\n\t\t\t\t\t\t\taccess_key_id: this.serverConfig['AWSACCESSKEYID'],\n\t\t\t\t\t\t\tsecret_access_key: this.serverConfig['AWSSECRETACCESSKEY'],\n\t\t\t\t\t\t\tkey: key\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tjobImports.push('import-' + (keyIdx + 1));\n\t\t\t\t\t});\n\n\t\t\t\t\tlet jobConverts = [];\n\n\t\t\t\t\tjobImports.forEach((key, keyIdx) => {\n\t\t\t\t\t\tcloudJob['convert-' + (keyIdx + 1)] = {\n\t\t\t\t\t\t\toperation: 'convert',\n\t\t\t\t\t\t\tinput: key,\n\t\t\t\t\t\t\toutput_format: \"pdf\",\n\t\t\t\t\t\t\twidth: 612,\n\t\t\t\t\t\t\theight: 792,\n\t\t\t\t\t\t\tfit: 'scale',\n\t\t\t\t\t\t\tauto_orient: true\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tjobConverts.push('convert-' + (keyIdx + 1));\n\t\t\t\t\t});\n\n\t\t\t\t\tlet jobTasks = [];\n\n\t\t\t\t\ttasks.forEach((task, taskIdx) => {\n\t\t\t\t\t\tcloudJob['task-' + (taskIdx + 1)] = {\n\t\t\t\t\t\t\toperation: task,\n\t\t\t\t\t\t\toutput_format: 'pdf',\n\t\t\t\t\t\t\tinput: taskIdx === 0 ? jobConverts : 'task-' + taskIdx,\n\t\t\t\t\t\t\tfilename: file_name\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tjobTasks.push('task-' + (taskIdx + 1));\n\t\t\t\t\t});\n\n\t\t\t\t\tcloudJob['export-1'] = {\n\t\t\t\t\t\toperation: 'export/s3',\n\t\t\t\t\t\tinput: jobTasks[jobTasks.length - 1],\n\t\t\t\t\t\tbucket: this.serverConfig['AWSBUCKET'],\n\t\t\t\t\t\tregion: this.serverConfig['AWSREGION'],\n\t\t\t\t\t\taccess_key_id: this.serverConfig['AWSACCESSKEYID'],\n\t\t\t\t\t\tsecret_access_key: this.serverConfig['AWSSECRETACCESSKEY'],\n\t\t\t\t\t\tkey: file_output_key\n\t\t\t\t\t};\n\n\t\t\t\t\tconst request = bent('https://api.cloudconvert.com/v2', 'POST', 'json', 201);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlet jobBody = await request('/jobs', {\n\t\t\t\t\t\t\ttasks: cloudJob\n\t\t\t\t\t\t}, {\n\t\t\t\t\t\t\t'Authorization': 'Bearer ' + this.serverConfig['CLOUDCONVERT_V2']\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tlet body = typeof jobBody === 'string' ? JSON.parse(jobBody) : jobBody;\n\n\t\t\t\t\t\tif (body && body.data && body.data.links) {\n\t\t\t\t\t\t\tconst requestWait = bent(body.data.links.self, 'GET', 'json', 200);\n\n\t\t\t\t\t\t\tlet running = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlet interval = setInterval(async () => {\n\t\t\t\t\t\t\t\tif (!running) {\n\t\t\t\t\t\t\t\t\trunning = true;\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tlet bodyWait = await requestWait('', null, {\n\t\t\t\t\t\t\t\t\t\t\t'Authorization': 'Bearer ' + this.serverConfig['CLOUDCONVERT_V2']\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\n\t\t\t\t\t\t\t\t\t\tlet responseBody = typeof bodyWait === 'string' ? JSON.parse(bodyWait) : bodyWait;\n\t\t\n\t\t\t\t\t\t\t\t\t\tif (responseBody.data.status === 'finished') {\n\t\t\t\t\t\t\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\t\t\t\t\t\t\tresolve(responseBody);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcatch(errorWait) {\n\t\t\t\t\t\t\t\t\t\tconsole.log('Error happened wait :',JSON.stringify(errorWait, null, 2));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\trunning = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch(error) {\n\t\t\t\t\t\tconsole.log('Error happened: ', JSON.stringify(error, null, 2));\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}"]}
|
package/models/user.model.d.ts
CHANGED
package/models/user.model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/models/user.model.ts"],"names":[],"mappings":"","file":"user.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport interface UserModel extends CollectionDocument {\n\troles: UserRoleModel;\n\tattempts?: number;\n\tlast?: Date;\n\tservices?: any;\n\tusername?: string;\n\temail?: string;\n\tfullname: string;\n\tactive: boolean;\n\tphonenumber?: string;\n\treadonly?: boolean;\n\tother: OtherObject;\n\tsettings?: UserSettingsModel;\n}\n\nexport interface UserSettingsModel {\n\ttable_color: string;\n\ttable_font_color: string;\n\tsecondary_table_color: string;\n\tsecondary_table_font_color: string;\n\ttertiary_table_color: string;\n\ttertiary_table_font_color: string;\n\tfont_size: number;\n\tcollapsable_menu: boolean;\n\tentries_per_page: string\n\twarning_color: string;\n\twarning_font_color: string;\n\twarning_hover_color: string;\n\tsuccess_color: string;\n\tsuccess_font_color: string;\n\tsuccess_hover_color: string;\n\tdanger_color: string;\n\tdanger_font_color: string;\n\tdanger_hover_color: string;\n\tinfo_color: string;\n\tinfo_font_color: string;\n\tinfo_hover_color: string;\n\tprimary_color: string;\n\tprimary_font_color: string;\n\tprimary_hover_color: string;\n\tsecondary_color: string;\n\tsecondary_font_color: string;\n\tsecondary_hover_color: string;\n}\n\nexport interface UserRoleModel {\n\tsuper_admin: boolean;\n\tapprovals: UserRoleApprovalModel[];\n\tgroups: UserRoleGroupModel[];\n\tnotifications: string[];\n\tmiscs: string[];\n}\n\nexport interface UserRoleApprovalModel {\n\ttype: string; // po or afe or chemical\n\tkey_1: string; // department or accounting code\n\tkey_2: string; // order type\n\tkey_3: string; // other/additional\n\tname: string; // approval name\n}\n\nexport interface UserRoleGroupModel {\n\tname: string;\n\tviews: string[];\n\tyard?: string;\n}\n\nexport interface OtherObject {\n [key: string]: any;\n}"]}
|
|
1
|
+
{"version":3,"sources":["../../src/models/user.model.ts"],"names":[],"mappings":"","file":"user.model.js","sourcesContent":["import { CollectionDocument } from './collection-document.model';\n\nexport interface UserModel extends CollectionDocument {\n\troles: UserRoleModel;\n\tattempts?: number;\n\tlast?: Date;\n\tservices?: any;\n\tusername?: string;\n\temail?: string;\n\tfullname: string;\n\tactive: boolean;\n\tphonenumber?: string;\n\treadonly?: boolean;\n\tother: OtherObject;\n\tsettings?: UserSettingsModel;\n}\n\nexport interface UserSettingsModel {\n\ttable_color: string;\n\ttable_font_color: string;\n\tsecondary_table_color: string;\n\tsecondary_table_font_color: string;\n\ttertiary_table_color: string;\n\ttertiary_table_font_color: string;\n\tfont_size: number;\n\tcollapsable_menu: boolean;\n\tentries_per_page: string\n\twarning_color: string;\n\twarning_font_color: string;\n\twarning_hover_color: string;\n\tsuccess_color: string;\n\tsuccess_font_color: string;\n\tsuccess_hover_color: string;\n\tdanger_color: string;\n\tdanger_font_color: string;\n\tdanger_hover_color: string;\n\tinfo_color: string;\n\tinfo_font_color: string;\n\tinfo_hover_color: string;\n\tprimary_color: string;\n\tprimary_font_color: string;\n\tprimary_hover_color: string;\n\tsecondary_color: string;\n\tsecondary_font_color: string;\n\tsecondary_hover_color: string;\n\trouting_preference?: string;\n}\n\nexport interface UserRoleModel {\n\tsuper_admin: boolean;\n\tapprovals: UserRoleApprovalModel[];\n\tgroups: UserRoleGroupModel[];\n\tnotifications: string[];\n\tmiscs: string[];\n}\n\nexport interface UserRoleApprovalModel {\n\ttype: string; // po or afe or chemical\n\tkey_1: string; // department or accounting code\n\tkey_2: string; // order type\n\tkey_3: string; // other/additional\n\tname: string; // approval name\n}\n\nexport interface UserRoleGroupModel {\n\tname: string;\n\tviews: string[];\n\tyard?: string;\n}\n\nexport interface OtherObject {\n [key: string]: any;\n}"]}
|