@resolveio/server-lib 1.0.7 → 1.0.8
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/active-subscription.collection.d.ts +0 -1
- package/collections/app-status.collection.d.ts +0 -1
- package/collections/app-version.collection.d.ts +0 -1
- package/collections/counter.collection.d.ts +0 -1
- package/collections/cron-job-history.collection.d.ts +0 -1
- package/collections/cron-job.collection.d.ts +0 -1
- package/collections/file.collection.d.ts +0 -1
- package/collections/flag.collection.d.ts +0 -1
- package/collections/log.collection.d.ts +0 -1
- package/collections/logged-in-users.collection.d.ts +0 -1
- package/collections/method-call.collection.d.ts +0 -1
- package/collections/method-response.collection.d.ts +0 -1
- package/collections/queue-flag.collection.d.ts +0 -1
- package/collections/queue-method.collection.d.ts +0 -1
- package/collections/queue-response.collection.d.ts +0 -1
- package/collections/support-ticket.collection.d.ts +0 -1
- package/collections/user.collection.d.ts +0 -1
- package/cron/cron.d.ts +0 -1
- package/fixtures/cron-jobs.d.ts +0 -1
- package/fixtures/init.d.ts +0 -1
- package/http/auth.d.ts +0 -1
- package/http/auth.js +39 -42
- package/http/health.d.ts +0 -1
- package/index.d.ts +0 -1
- package/managers/cron.manager.d.ts +0 -1
- package/managers/method.manager.d.ts +0 -1
- package/managers/queue-method.manager.d.ts +0 -1
- package/managers/subscription.manager.d.ts +0 -1
- package/managers/support.manager.d.ts +0 -1
- package/methods/accounts.d.ts +0 -1
- package/methods/aws.d.ts +0 -1
- package/methods/cloudconvert.d.ts +0 -1
- package/methods/collections.d.ts +0 -1
- package/methods/counters.d.ts +0 -1
- package/methods/cron-jobs.d.ts +0 -1
- package/methods/flags.d.ts +0 -1
- package/methods/logs.d.ts +0 -1
- package/methods/pdf.d.ts +0 -1
- package/models/active-subscription.model.d.ts +0 -1
- package/models/app-status.model.d.ts +0 -1
- package/models/app-version.model.d.ts +0 -1
- package/models/collection-document.model.d.ts +0 -1
- package/models/counter.model.d.ts +0 -1
- package/models/cron-job-history.model.d.ts +0 -1
- package/models/cron-job.model.d.ts +0 -1
- package/models/dialog.model.d.ts +0 -1
- package/models/file.model.d.ts +0 -1
- package/models/flag.model.d.ts +0 -1
- package/models/log.model.d.ts +0 -1
- package/models/logged-in-users.model.d.ts +0 -1
- package/models/method-call.model.d.ts +0 -1
- package/models/method-response.model.d.ts +0 -1
- package/models/method.model.d.ts +0 -1
- package/models/notification.model.d.ts +0 -1
- package/models/pagination.model.d.ts +0 -1
- package/models/permission.model.d.ts +0 -1
- package/models/queue-method.model.d.ts +0 -1
- package/models/queue-response.model.d.ts +0 -1
- package/models/select-data-label.model.d.ts +0 -1
- package/models/server-response.model.d.ts +0 -1
- package/models/subscription.model.d.ts +0 -1
- package/models/support-method.model.d.ts +0 -1
- package/models/support-ticket.model.d.ts +0 -1
- package/models/user.model.d.ts +0 -1
- package/package.json +20 -20
- package/publications/app-status.d.ts +0 -1
- package/publications/app-version.d.ts +0 -1
- package/publications/cron-jobs.d.ts +0 -1
- package/publications/files.d.ts +0 -1
- package/publications/flags.d.ts +0 -1
- package/publications/logs.d.ts +0 -1
- package/publications/method-calls.d.ts +0 -1
- package/publications/method-responses.d.ts +0 -1
- package/publications/super-admin.d.ts +0 -1
- package/publications/support-tickets.d.ts +0 -1
- package/server-app.d.ts +0 -1
- package/support-methods/aws.d.ts +0 -1
- package/support-methods/collections.d.ts +0 -1
- package/support-methods/counters.d.ts +0 -1
- package/support-methods/support.d.ts +0 -1
- package/util/common.d.ts +0 -1
|
@@ -5,4 +5,3 @@ interface ResolveIOModel extends ActiveSubscriptionModel, Document {
|
|
|
5
5
|
export declare const ActiveSubscriptions: Model<ResolveIOModel>;
|
|
6
6
|
export declare const ActiveSubscriptionVersions: Model<ResolveIOModel>;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=active-subscription.collection.d.ts.map
|
package/cron/cron.d.ts
CHANGED
|
@@ -3,4 +3,3 @@ declare function CrontabManager(key: any, tab: any, task: any, options: any): vo
|
|
|
3
3
|
declare function combineOptions(tab: any, task: any, options: any): {};
|
|
4
4
|
declare function updateTab(key: any, cronstring: any): void;
|
|
5
5
|
declare function updateTask(key: any, task: any): void;
|
|
6
|
-
//# sourceMappingURL=cron.d.ts.map
|
package/fixtures/cron-jobs.d.ts
CHANGED
package/fixtures/init.d.ts
CHANGED
package/http/auth.d.ts
CHANGED
package/http/auth.js
CHANGED
|
@@ -63,49 +63,46 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
63
63
|
_a.label = 4;
|
|
64
64
|
case 4:
|
|
65
65
|
username = user_1 ? user_1.username : request.body.username;
|
|
66
|
-
user_collection_1.Users.authenticate()(username, request.body.password
|
|
67
|
-
if (
|
|
68
|
-
|
|
66
|
+
user_collection_1.Users.authenticate()(username, request.body.password).then(function (res) {
|
|
67
|
+
if (res && res.user && res.user.active) {
|
|
68
|
+
res.user.resetAttempts(function (errAt, resAt, errorAt) {
|
|
69
69
|
response.send(JSON.stringify({
|
|
70
|
-
error:
|
|
71
|
-
result:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
userWhoResetPassword: __1.ResolveIOServer.getClientName() + ' System',
|
|
77
|
-
url: serverConfig['ROOT_URL'] + '/forgot-password?' + encodeURIComponent(serverConfig['SERVER_URL']) + '&' + user_1.services.forgot_password
|
|
78
|
-
};
|
|
79
|
-
user_collection_1.Users.updateOne({ _id: user_1._id }, { $set: { services: user_1.services } }).exec(function (errUp, resUp) {
|
|
80
|
-
mainServer.getMethodManager().readFile('email-templates/forgot-password.html').then(function (html) {
|
|
81
|
-
var template = handlebars.compile(html);
|
|
82
|
-
handlebars.registerHelper('equals', function (a, b) {
|
|
83
|
-
return a === b;
|
|
84
|
-
});
|
|
85
|
-
mainServer.getMethodManager().sendEmail(user_1.email, 'ResolveIO (' + __1.ResolveIOServer.getClientName() + ') - Forgot Password', '', template(emailData_1));
|
|
86
|
-
}, function (errEmail) { return console.log(errEmail); });
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
response.send(JSON.stringify({
|
|
91
|
-
error: true,
|
|
92
|
-
result: error.message
|
|
70
|
+
error: false,
|
|
71
|
+
result: {
|
|
72
|
+
token: jwt.sign({ id_user: res.user._id }, serverConfig['JWT_SECRET'], {
|
|
73
|
+
expiresIn: 90 * 24 * 60 * 60 * 1000 // 90 days
|
|
74
|
+
})
|
|
75
|
+
}
|
|
93
76
|
}));
|
|
94
|
-
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}, function (error) {
|
|
80
|
+
if (error.name === 'TooManyAttemptsError') {
|
|
81
|
+
response.send(JSON.stringify({
|
|
82
|
+
error: true,
|
|
83
|
+
result: error.message + '. A password reset link has been sent to your email, please reset your password.'
|
|
84
|
+
}));
|
|
85
|
+
user_1.services.forgot_password = jwt.sign({ id_user: user_1._id }, serverConfig['JWT_SECRET']);
|
|
86
|
+
var emailData_1 = {
|
|
87
|
+
userToChangePassword: user_1.fullname,
|
|
88
|
+
userWhoResetPassword: __1.ResolveIOServer.getClientName() + ' System',
|
|
89
|
+
url: serverConfig['ROOT_URL'] + '/forgot-password?' + encodeURIComponent(serverConfig['SERVER_URL']) + '&' + user_1.services.forgot_password
|
|
90
|
+
};
|
|
91
|
+
user_collection_1.Users.updateOne({ _id: user_1._id }, { $set: { services: user_1.services } }).exec(function (errUp, resUp) {
|
|
92
|
+
mainServer.getMethodManager().readFile('email-templates/forgot-password.html').then(function (html) {
|
|
93
|
+
var template = handlebars.compile(html);
|
|
94
|
+
handlebars.registerHelper('equals', function (a, b) {
|
|
95
|
+
return a === b;
|
|
96
|
+
});
|
|
97
|
+
mainServer.getMethodManager().sendEmail(user_1.email, 'ResolveIO (' + __1.ResolveIOServer.getClientName() + ') - Forgot Password', '', template(emailData_1));
|
|
98
|
+
}, function (errEmail) { return console.log(errEmail); });
|
|
99
|
+
});
|
|
95
100
|
}
|
|
96
101
|
else {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
result: {
|
|
102
|
-
token: jwt.sign({ id_user: res._id }, serverConfig['JWT_SECRET'], {
|
|
103
|
-
expiresIn: 90 * 24 * 60 * 60 * 1000 // 90 days
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
}));
|
|
107
|
-
});
|
|
108
|
-
}
|
|
102
|
+
response.send(JSON.stringify({
|
|
103
|
+
error: true,
|
|
104
|
+
result: error.message
|
|
105
|
+
}));
|
|
109
106
|
}
|
|
110
107
|
});
|
|
111
108
|
_a.label = 5;
|
|
@@ -135,7 +132,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
135
132
|
user_collection_1.Users.findById(decoded['id_user']).exec().then(function (user) {
|
|
136
133
|
if (user) {
|
|
137
134
|
if (user.active) {
|
|
138
|
-
user.resetAttempts(function (
|
|
135
|
+
user.resetAttempts(function (err, res) {
|
|
139
136
|
user.save();
|
|
140
137
|
response.send(JSON.stringify({
|
|
141
138
|
error: false,
|
|
@@ -182,7 +179,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
182
179
|
user_collection_1.Users.findById(decoded['id_user']).exec().then(function (user) {
|
|
183
180
|
if (user) {
|
|
184
181
|
if (user.active) {
|
|
185
|
-
user.resetAttempts(function (
|
|
182
|
+
user.resetAttempts(function (err, res) {
|
|
186
183
|
user.save();
|
|
187
184
|
response.send(JSON.stringify({
|
|
188
185
|
error: false,
|
|
@@ -427,7 +424,7 @@ function setupAuthRoutes(mainServer, app, serverConfig) {
|
|
|
427
424
|
user.setPassword(request.body.password, function (errSet, resSet) {
|
|
428
425
|
if (resSet) {
|
|
429
426
|
user.services.forgot_password = '';
|
|
430
|
-
user.resetAttempts(function (
|
|
427
|
+
user.resetAttempts(function (err, res) {
|
|
431
428
|
user.save();
|
|
432
429
|
});
|
|
433
430
|
response.send(JSON.stringify({
|
package/http/health.d.ts
CHANGED
package/index.d.ts
CHANGED
package/methods/accounts.d.ts
CHANGED
package/methods/aws.d.ts
CHANGED
package/methods/collections.d.ts
CHANGED
package/methods/counters.d.ts
CHANGED
package/methods/cron-jobs.d.ts
CHANGED
package/methods/flags.d.ts
CHANGED
package/methods/logs.d.ts
CHANGED
package/methods/pdf.d.ts
CHANGED
package/models/dialog.model.d.ts
CHANGED
package/models/file.model.d.ts
CHANGED
package/models/flag.model.d.ts
CHANGED
package/models/log.model.d.ts
CHANGED
package/models/method.model.d.ts
CHANGED
package/models/user.model.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolveio/server-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -13,20 +13,20 @@
|
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"aws-sdk": "2.
|
|
16
|
+
"aws-sdk": "2.401.0",
|
|
17
17
|
"cron": "1.3.0",
|
|
18
18
|
"deep-diff": "1.0.2",
|
|
19
19
|
"express": "4.16.4",
|
|
20
20
|
"forever": "0.15.3",
|
|
21
|
-
"handlebars": "4.0
|
|
21
|
+
"handlebars": "4.1.0",
|
|
22
22
|
"imap": "0.8.19",
|
|
23
|
-
"jsonwebtoken": "8.
|
|
24
|
-
"moment": "2.
|
|
23
|
+
"jsonwebtoken": "8.4.0",
|
|
24
|
+
"moment": "2.24.0",
|
|
25
25
|
"moment-timezone": "0.5.23",
|
|
26
26
|
"mongo-oplog": "2.1.4",
|
|
27
|
-
"mongoose": "5.
|
|
27
|
+
"mongoose": "5.4.11",
|
|
28
28
|
"node-google-timezone": "0.1.1",
|
|
29
|
-
"nodemailer": "
|
|
29
|
+
"nodemailer": "5.1.1",
|
|
30
30
|
"passport": "0.4.0",
|
|
31
31
|
"passport-local": "1.0.0",
|
|
32
32
|
"passport-local-mongoose": "5.0.1",
|
|
@@ -34,39 +34,39 @@
|
|
|
34
34
|
"phantom": "6.0.3",
|
|
35
35
|
"request": "2.88.0",
|
|
36
36
|
"rus-diff": "1.1.0",
|
|
37
|
-
"simpl-schema": "1.5.
|
|
38
|
-
"string-similarity": "
|
|
37
|
+
"simpl-schema": "1.5.5",
|
|
38
|
+
"string-similarity": "3.0.0",
|
|
39
39
|
"string_score": "0.1.22",
|
|
40
|
-
"twilio": "3.
|
|
40
|
+
"twilio": "3.28.0",
|
|
41
41
|
"uuid": "3.3.2",
|
|
42
|
-
"ws": "6.1.
|
|
42
|
+
"ws": "6.1.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/aws-sdk": "2.7.0",
|
|
46
46
|
"@types/core-js": "^2.5.0",
|
|
47
|
-
"@types/express": "4.16.
|
|
48
|
-
"@types/handlebars": "4.0.
|
|
47
|
+
"@types/express": "4.16.1",
|
|
48
|
+
"@types/handlebars": "4.0.40",
|
|
49
49
|
"@types/imap": "0.8.29",
|
|
50
50
|
"@types/jsonwebtoken": "8.3.0",
|
|
51
|
-
"@types/mongodb": "3.1.
|
|
52
|
-
"@types/mongoose": "5.3.
|
|
51
|
+
"@types/mongodb": "3.1.19",
|
|
52
|
+
"@types/mongoose": "5.3.12",
|
|
53
53
|
"@types/nodemailer": "4.6.5",
|
|
54
|
-
"@types/passport": "0.
|
|
54
|
+
"@types/passport": "1.0.0",
|
|
55
55
|
"@types/passport-local": "1.0.33",
|
|
56
|
-
"@types/passport-local-mongoose": "4.0.
|
|
56
|
+
"@types/passport-local-mongoose": "4.0.12",
|
|
57
57
|
"@types/ws": "6.0.1",
|
|
58
58
|
"del": "3.0.0",
|
|
59
59
|
"express-livereload": "0.0.24",
|
|
60
60
|
"gulp": "3.9.1",
|
|
61
|
-
"gulp-nodemon": "2.4.
|
|
61
|
+
"gulp-nodemon": "2.4.2",
|
|
62
62
|
"gulp-rename": "1.4.0",
|
|
63
63
|
"gulp-shell": "0.6.5",
|
|
64
64
|
"gulp-sourcemaps": "^2.6.4",
|
|
65
|
-
"gulp-typescript": "5.0.0
|
|
65
|
+
"gulp-typescript": "5.0.0",
|
|
66
66
|
"gulp-uglify": "3.0.1",
|
|
67
67
|
"gulp-zip": "4.2.0",
|
|
68
68
|
"merge2": "^1.2.3",
|
|
69
69
|
"mkdirs": "0.0.2",
|
|
70
|
-
"typescript": "3.
|
|
70
|
+
"typescript": "3.3.3"
|
|
71
71
|
}
|
|
72
72
|
}
|
package/publications/files.d.ts
CHANGED
package/publications/flags.d.ts
CHANGED
package/publications/logs.d.ts
CHANGED
package/server-app.d.ts
CHANGED
package/support-methods/aws.d.ts
CHANGED
package/util/common.d.ts
CHANGED
|
@@ -12,4 +12,3 @@ export declare function mergeUpdates(...updatesToMerge: any[]): {
|
|
|
12
12
|
export declare function getDeepDiff(doc1: any, doc2: any): any;
|
|
13
13
|
export declare function applyMongoUpdate(uDoc: any, delta: any): any;
|
|
14
14
|
export declare function getBinarySize(string: any): number;
|
|
15
|
-
//# sourceMappingURL=common.d.ts.map
|