@go-mailer/jarvis 4.0.1 → 4.0.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.
|
@@ -57,7 +57,6 @@ function RequestLogger() {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
let error = payload ? payload.error : statusMessage;
|
|
60
|
-
console.log(pathname, hashLogData(log))
|
|
61
60
|
// if (error) {
|
|
62
61
|
// log.error = error;
|
|
63
62
|
// logtail.error(pathname, hashLogData(log));
|
|
@@ -86,7 +85,7 @@ class ProcessLogger {
|
|
|
86
85
|
// params,
|
|
87
86
|
// }));
|
|
88
87
|
// logtail.flush();
|
|
89
|
-
console.log(`${this.service}:${method}:${error.message}
|
|
88
|
+
console.log(`${this.service}:${method}:${error.message}`, error.stack)
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
info(info, method = "unspecified_method", params = {}) {
|
package/lib/redis/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { createClient } = require('redis')
|
|
2
|
+
const { Repository } = require('redis-om')
|
|
2
3
|
const Schemas = require('./schemas')
|
|
3
4
|
|
|
4
5
|
class RedisClient {
|
|
@@ -8,7 +9,9 @@ class RedisClient {
|
|
|
8
9
|
|
|
9
10
|
async connect (url = '') {
|
|
10
11
|
try {
|
|
11
|
-
this.client =
|
|
12
|
+
this.client = createClient({ url })
|
|
13
|
+
this.client.on('error', e => console.log(`Redis connection: ${e.message}`))
|
|
14
|
+
await this.client.connect()
|
|
12
15
|
console.log('Redis connection established')
|
|
13
16
|
} catch (e) {
|
|
14
17
|
console.log(`Redis connection: ${e.message}`)
|
|
@@ -19,14 +22,15 @@ class RedisClient {
|
|
|
19
22
|
return this.client
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
register_schema (schema = {}) {
|
|
23
|
-
const repo = this.client
|
|
24
|
-
repo.createIndex()
|
|
25
|
+
async register_schema (schema = {}) {
|
|
26
|
+
const repo = new Repository(schema, this.client)
|
|
27
|
+
await repo.createIndex()
|
|
25
28
|
return repo
|
|
26
29
|
}
|
|
27
30
|
}
|
|
28
31
|
//
|
|
32
|
+
const redisClient = new RedisClient()
|
|
29
33
|
module.exports ={
|
|
30
|
-
RedisClient:
|
|
34
|
+
RedisClient: redisClient,
|
|
31
35
|
Schemas
|
|
32
36
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
const { Schema
|
|
2
|
-
const client = require('../index')
|
|
1
|
+
const { Schema } = require('redis-om')
|
|
3
2
|
|
|
4
3
|
const CampaignSchema = new Schema('campaign', {
|
|
5
|
-
id: {type: 'number'},
|
|
6
|
-
status: {type: '
|
|
4
|
+
id: { type: 'number' },
|
|
5
|
+
status: { type: 'string' }
|
|
7
6
|
})
|
|
8
7
|
|
|
9
8
|
module.exports = {
|
|
10
|
-
|
|
9
|
+
CampaignSchema
|
|
11
10
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const { Schema
|
|
2
|
-
const client = require('../index')
|
|
1
|
+
const { Schema } = require('redis-om')
|
|
3
2
|
|
|
4
3
|
const ContactImportSchema = new Schema('contactimport', {
|
|
5
4
|
data: { type: 'string' }
|
|
6
5
|
})
|
|
7
6
|
|
|
8
7
|
module.exports = {
|
|
9
|
-
|
|
8
|
+
ContactImportSchema
|
|
10
9
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
const {
|
|
2
|
-
const {
|
|
1
|
+
const { CampaignSchema } = require('./Campaign')
|
|
2
|
+
const { ContactImportSchema } = require('./Contact')
|
|
3
|
+
const { PostalSchema } = require('./Postal')
|
|
3
4
|
|
|
4
5
|
module.exports = {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
CampaignSchema,
|
|
7
|
+
ContactImportSchema,
|
|
8
|
+
PostalSchema
|
|
7
9
|
}
|