@famir/database 0.0.1 → 0.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.
- package/README.md +1 -2
- package/dist/database.d.ts +1 -1
- package/dist/database.error.js +1 -1
- package/dist/database.error.js.map +1 -1
- package/dist/database.functions.d.ts +33 -18
- package/dist/database.functions.js +8 -8
- package/dist/database.functions.js.map +1 -1
- package/dist/database.js.map +1 -1
- package/dist/database.keys.d.ts +6 -4
- package/dist/database.keys.js +14 -8
- package/dist/database.keys.js.map +1 -1
- package/dist/database.schemas.js +1 -5
- package/dist/database.schemas.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/modules/base/index.js.map +1 -0
- package/dist/{repositories → modules}/base/redis-base.repository.d.ts +5 -3
- package/dist/{repositories → modules}/base/redis-base.repository.js +22 -18
- package/dist/modules/base/redis-base.repository.js.map +1 -0
- package/dist/{repositories → modules}/campaign/campaign.d.ts +2 -2
- package/dist/{repositories → modules}/campaign/campaign.functions.d.ts +8 -7
- package/dist/{repositories → modules}/campaign/campaign.functions.js +29 -26
- package/dist/modules/campaign/campaign.functions.js.map +1 -0
- package/dist/modules/campaign/campaign.js.map +1 -0
- package/dist/{models/campaign/campaign.d.ts → modules/campaign/campaign.models.d.ts} +3 -2
- package/dist/{models/campaign/campaign.js → modules/campaign/campaign.models.js} +6 -4
- package/dist/modules/campaign/campaign.models.js.map +1 -0
- package/dist/{repositories → modules}/campaign/campaign.schemas.d.ts +2 -2
- package/dist/{repositories → modules}/campaign/campaign.schemas.js +50 -43
- package/dist/modules/campaign/campaign.schemas.js.map +1 -0
- package/dist/{repositories → modules}/campaign/index.d.ts +1 -0
- package/dist/{repositories → modules}/campaign/index.js +1 -0
- package/dist/modules/campaign/index.js.map +1 -0
- package/dist/{repositories → modules}/campaign/redis-campaign.repository.d.ts +5 -5
- package/dist/{repositories → modules}/campaign/redis-campaign.repository.js +11 -11
- package/dist/modules/campaign/redis-campaign.repository.js.map +1 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/{repositories → modules}/lure/index.d.ts +1 -0
- package/dist/{repositories → modules}/lure/index.js +1 -0
- package/dist/modules/lure/index.js.map +1 -0
- package/dist/{repositories → modules}/lure/lure.d.ts +1 -1
- package/dist/{repositories → modules}/lure/lure.functions.d.ts +1 -1
- package/dist/{repositories → modules}/lure/lure.functions.js +12 -12
- package/dist/modules/lure/lure.functions.js.map +1 -0
- package/dist/modules/lure/lure.js.map +1 -0
- package/dist/{models/lure/lure.js → modules/lure/lure.models.js} +1 -1
- package/dist/modules/lure/lure.models.js.map +1 -0
- package/dist/{repositories → modules}/lure/lure.schemas.js +14 -14
- package/dist/modules/lure/lure.schemas.js.map +1 -0
- package/dist/{repositories → modules}/lure/redis-lure.repository.d.ts +4 -4
- package/dist/{repositories → modules}/lure/redis-lure.repository.js +6 -6
- package/dist/modules/lure/redis-lure.repository.js.map +1 -0
- package/dist/{repositories → modules}/message/index.d.ts +1 -0
- package/dist/{repositories → modules}/message/index.js +1 -0
- package/dist/modules/message/index.js.map +1 -0
- package/dist/modules/message/message.d.ts +9 -0
- package/dist/{repositories → modules}/message/message.functions.d.ts +8 -3
- package/dist/{repositories → modules}/message/message.functions.js +23 -12
- package/dist/modules/message/message.functions.js.map +1 -0
- package/dist/modules/message/message.js.map +1 -0
- package/dist/modules/message/message.models.d.ts +29 -0
- package/dist/{models/message/message.js → modules/message/message.models.js} +8 -10
- package/dist/modules/message/message.models.js.map +1 -0
- package/dist/modules/message/message.schemas.js +160 -0
- package/dist/modules/message/message.schemas.js.map +1 -0
- package/dist/modules/message/redis-message.repository.d.ts +23 -0
- package/dist/{repositories → modules}/message/redis-message.repository.js +33 -10
- package/dist/modules/message/redis-message.repository.js.map +1 -0
- package/dist/{repositories → modules}/proxy/index.d.ts +1 -0
- package/dist/{repositories → modules}/proxy/index.js +1 -0
- package/dist/modules/proxy/index.js.map +1 -0
- package/dist/{repositories → modules}/proxy/proxy.d.ts +1 -1
- package/dist/{repositories → modules}/proxy/proxy.functions.d.ts +1 -1
- package/dist/{repositories → modules}/proxy/proxy.functions.js +13 -13
- package/dist/modules/proxy/proxy.functions.js.map +1 -0
- package/dist/modules/proxy/proxy.js.map +1 -0
- package/dist/{models/proxy/proxy.js → modules/proxy/proxy.models.js} +1 -1
- package/dist/modules/proxy/proxy.models.js.map +1 -0
- package/dist/{repositories → modules}/proxy/proxy.schemas.js +12 -12
- package/dist/modules/proxy/proxy.schemas.js.map +1 -0
- package/dist/{repositories → modules}/proxy/redis-proxy.repository.d.ts +4 -4
- package/dist/{repositories → modules}/proxy/redis-proxy.repository.js +6 -6
- package/dist/modules/proxy/redis-proxy.repository.js.map +1 -0
- package/dist/{repositories → modules}/redirector/index.d.ts +1 -0
- package/dist/{repositories → modules}/redirector/index.js +1 -0
- package/dist/modules/redirector/index.js.map +1 -0
- package/dist/{repositories → modules}/redirector/redirector.d.ts +3 -1
- package/dist/{repositories → modules}/redirector/redirector.functions.d.ts +15 -4
- package/dist/{repositories → modules}/redirector/redirector.functions.js +39 -13
- package/dist/modules/redirector/redirector.functions.js.map +1 -0
- package/dist/modules/redirector/redirector.js.map +1 -0
- package/dist/{models/redirector/redirector.d.ts → modules/redirector/redirector.models.d.ts} +5 -1
- package/dist/{models/redirector/redirector.js → modules/redirector/redirector.models.js} +10 -2
- package/dist/modules/redirector/redirector.models.js.map +1 -0
- package/dist/modules/redirector/redirector.schemas.d.ts +7 -0
- package/dist/modules/redirector/redirector.schemas.js +73 -0
- package/dist/modules/redirector/redirector.schemas.js.map +1 -0
- package/dist/{repositories → modules}/redirector/redis-redirector.repository.d.ts +6 -4
- package/dist/{repositories → modules}/redirector/redis-redirector.repository.js +28 -8
- package/dist/modules/redirector/redis-redirector.repository.js.map +1 -0
- package/dist/{repositories → modules}/session/index.d.ts +1 -0
- package/dist/{repositories → modules}/session/index.js +1 -0
- package/dist/modules/session/index.js.map +1 -0
- package/dist/{repositories → modules}/session/redis-session.repository.d.ts +4 -4
- package/dist/{repositories → modules}/session/redis-session.repository.js +11 -11
- package/dist/modules/session/redis-session.repository.js.map +1 -0
- package/dist/{repositories → modules}/session/session.d.ts +1 -1
- package/dist/{repositories → modules}/session/session.functions.d.ts +4 -4
- package/dist/{repositories → modules}/session/session.functions.js +10 -10
- package/dist/modules/session/session.functions.js.map +1 -0
- package/dist/modules/session/session.js.map +1 -0
- package/dist/{models/session/session.d.ts → modules/session/session.models.d.ts} +9 -3
- package/dist/{models/session/session.js → modules/session/session.models.js} +6 -6
- package/dist/modules/session/session.models.js.map +1 -0
- package/dist/modules/session/session.schemas.d.ts +4 -0
- package/dist/modules/session/session.schemas.js +59 -0
- package/dist/modules/session/session.schemas.js.map +1 -0
- package/dist/{repositories → modules}/target/index.d.ts +1 -0
- package/dist/{repositories → modules}/target/index.js +1 -0
- package/dist/modules/target/index.js.map +1 -0
- package/dist/{repositories → modules}/target/redis-target.repository.d.ts +6 -6
- package/dist/{repositories → modules}/target/redis-target.repository.js +16 -14
- package/dist/modules/target/redis-target.repository.js.map +1 -0
- package/dist/{repositories → modules}/target/target.d.ts +3 -3
- package/dist/{repositories → modules}/target/target.functions.d.ts +6 -5
- package/dist/{repositories → modules}/target/target.functions.js +44 -40
- package/dist/modules/target/target.functions.js.map +1 -0
- package/dist/modules/target/target.js.map +1 -0
- package/dist/{models/target/target.d.ts → modules/target/target.models.d.ts} +8 -5
- package/dist/{models/target/target.js → modules/target/target.models.js} +14 -11
- package/dist/modules/target/target.models.js.map +1 -0
- package/dist/{repositories → modules}/target/target.schemas.d.ts +3 -1
- package/dist/{repositories → modules}/target/target.schemas.js +74 -71
- package/dist/modules/target/target.schemas.js.map +1 -0
- package/dist/redis-database-connector.d.ts +3 -2
- package/dist/redis-database-connector.js +10 -8
- package/dist/redis-database-connector.js.map +1 -1
- package/dist/redis-database-manager.d.ts +4 -3
- package/dist/redis-database-manager.js +10 -8
- package/dist/redis-database-manager.js.map +1 -1
- package/dist/redis-functions.d.ts +1 -1
- package/dist/redis-functions.js +30 -1395
- package/dist/redis-functions.js.map +1 -1
- package/package.json +17 -13
- package/dist/models/campaign/campaign.js.map +0 -1
- package/dist/models/campaign/index.d.ts +0 -1
- package/dist/models/campaign/index.js +0 -2
- package/dist/models/campaign/index.js.map +0 -1
- package/dist/models/index.js.map +0 -1
- package/dist/models/lure/index.d.ts +0 -1
- package/dist/models/lure/index.js +0 -2
- package/dist/models/lure/index.js.map +0 -1
- package/dist/models/lure/lure.js.map +0 -1
- package/dist/models/message/index.d.ts +0 -1
- package/dist/models/message/index.js +0 -2
- package/dist/models/message/index.js.map +0 -1
- package/dist/models/message/message.d.ts +0 -38
- package/dist/models/message/message.js.map +0 -1
- package/dist/models/proxy/index.d.ts +0 -1
- package/dist/models/proxy/index.js +0 -2
- package/dist/models/proxy/index.js.map +0 -1
- package/dist/models/proxy/proxy.js.map +0 -1
- package/dist/models/redirector/index.d.ts +0 -1
- package/dist/models/redirector/index.js +0 -2
- package/dist/models/redirector/index.js.map +0 -1
- package/dist/models/redirector/redirector.js.map +0 -1
- package/dist/models/session/index.d.ts +0 -1
- package/dist/models/session/index.js +0 -2
- package/dist/models/session/index.js.map +0 -1
- package/dist/models/session/session.js.map +0 -1
- package/dist/models/target/index.d.ts +0 -1
- package/dist/models/target/index.js +0 -2
- package/dist/models/target/index.js.map +0 -1
- package/dist/models/target/target.js.map +0 -1
- package/dist/repositories/base/index.js.map +0 -1
- package/dist/repositories/base/redis-base.repository.js.map +0 -1
- package/dist/repositories/campaign/campaign.functions.js.map +0 -1
- package/dist/repositories/campaign/campaign.js.map +0 -1
- package/dist/repositories/campaign/campaign.schemas.js.map +0 -1
- package/dist/repositories/campaign/index.js.map +0 -1
- package/dist/repositories/campaign/redis-campaign.repository.js.map +0 -1
- package/dist/repositories/index.d.ts +0 -8
- package/dist/repositories/index.js +0 -9
- package/dist/repositories/index.js.map +0 -1
- package/dist/repositories/lure/index.js.map +0 -1
- package/dist/repositories/lure/lure.functions.js.map +0 -1
- package/dist/repositories/lure/lure.js.map +0 -1
- package/dist/repositories/lure/lure.schemas.js.map +0 -1
- package/dist/repositories/lure/redis-lure.repository.js.map +0 -1
- package/dist/repositories/message/index.js.map +0 -1
- package/dist/repositories/message/message.d.ts +0 -6
- package/dist/repositories/message/message.functions.js.map +0 -1
- package/dist/repositories/message/message.js.map +0 -1
- package/dist/repositories/message/message.schemas.js +0 -206
- package/dist/repositories/message/message.schemas.js.map +0 -1
- package/dist/repositories/message/redis-message.repository.d.ts +0 -20
- package/dist/repositories/message/redis-message.repository.js.map +0 -1
- package/dist/repositories/proxy/index.js.map +0 -1
- package/dist/repositories/proxy/proxy.functions.js.map +0 -1
- package/dist/repositories/proxy/proxy.js.map +0 -1
- package/dist/repositories/proxy/proxy.schemas.js.map +0 -1
- package/dist/repositories/proxy/redis-proxy.repository.js.map +0 -1
- package/dist/repositories/redirector/index.js.map +0 -1
- package/dist/repositories/redirector/redirector.functions.js.map +0 -1
- package/dist/repositories/redirector/redirector.js.map +0 -1
- package/dist/repositories/redirector/redirector.schemas.d.ts +0 -3
- package/dist/repositories/redirector/redirector.schemas.js +0 -51
- package/dist/repositories/redirector/redirector.schemas.js.map +0 -1
- package/dist/repositories/redirector/redis-redirector.repository.js.map +0 -1
- package/dist/repositories/session/index.js.map +0 -1
- package/dist/repositories/session/redis-session.repository.js.map +0 -1
- package/dist/repositories/session/session.functions.js.map +0 -1
- package/dist/repositories/session/session.js.map +0 -1
- package/dist/repositories/session/session.schemas.d.ts +0 -2
- package/dist/repositories/session/session.schemas.js +0 -44
- package/dist/repositories/session/session.schemas.js.map +0 -1
- package/dist/repositories/target/index.js.map +0 -1
- package/dist/repositories/target/redis-target.repository.js.map +0 -1
- package/dist/repositories/target/target.functions.js.map +0 -1
- package/dist/repositories/target/target.js.map +0 -1
- package/dist/repositories/target/target.schemas.js.map +0 -1
- package/dist/{repositories → modules}/base/index.d.ts +0 -0
- package/dist/{repositories → modules}/base/index.js +0 -0
- package/dist/{repositories → modules}/campaign/campaign.js +0 -0
- package/dist/{models → modules}/index.d.ts +0 -0
- package/dist/{models → modules}/index.js +0 -0
- package/dist/{repositories → modules}/lure/lure.js +0 -0
- package/dist/{models/lure/lure.d.ts → modules/lure/lure.models.d.ts} +0 -0
- package/dist/{repositories → modules}/lure/lure.schemas.d.ts +1 -1
- package/dist/{repositories → modules}/message/message.js +0 -0
- package/dist/{repositories → modules}/message/message.schemas.d.ts +0 -0
- package/dist/{repositories → modules}/proxy/proxy.js +0 -0
- package/dist/{models/proxy/proxy.d.ts → modules/proxy/proxy.models.d.ts} +0 -0
- package/dist/{repositories → modules}/proxy/proxy.schemas.d.ts +1 -1
- /package/dist/{repositories → modules}/redirector/redirector.js +0 -0
- /package/dist/{repositories → modules}/session/session.js +0 -0
- /package/dist/{repositories → modules}/target/target.js +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { campaignKey, campaignLockKey, lureIndexKey, lureKey, lurePathsKey, redirectorKey } from '../../database.keys.js';
|
|
1
|
+
import { campaignKey, campaignLockKey, lureIndexKey, lureKey, lurePathsKey, redirectorKey, } from '../../database.keys.js';
|
|
2
2
|
export const lureFunctions = {
|
|
3
3
|
lure: {
|
|
4
4
|
create_lure: {
|
|
5
5
|
NUMBER_OF_KEYS: 6,
|
|
6
|
-
parseCommand(parser, prefix, campaignId, lureId, path, redirectorId, lockSecret) {
|
|
6
|
+
parseCommand(parser, prefix, campaignId, lureId, path, redirectorId, createdAt, lockSecret) {
|
|
7
7
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
8
8
|
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
9
9
|
parser.pushKey(lureKey(prefix, campaignId, lureId));
|
|
@@ -14,10 +14,10 @@ export const lureFunctions = {
|
|
|
14
14
|
parser.push(lureId);
|
|
15
15
|
parser.push(path);
|
|
16
16
|
parser.push(redirectorId);
|
|
17
|
-
parser.push(
|
|
17
|
+
parser.push(createdAt);
|
|
18
18
|
parser.push(lockSecret);
|
|
19
19
|
},
|
|
20
|
-
transformReply: undefined
|
|
20
|
+
transformReply: undefined,
|
|
21
21
|
},
|
|
22
22
|
read_lure: {
|
|
23
23
|
NUMBER_OF_KEYS: 2,
|
|
@@ -25,7 +25,7 @@ export const lureFunctions = {
|
|
|
25
25
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
26
26
|
parser.pushKey(lureKey(prefix, campaignId, lureId));
|
|
27
27
|
},
|
|
28
|
-
transformReply: undefined
|
|
28
|
+
transformReply: undefined,
|
|
29
29
|
},
|
|
30
30
|
find_lure_id: {
|
|
31
31
|
NUMBER_OF_KEYS: 2,
|
|
@@ -34,7 +34,7 @@ export const lureFunctions = {
|
|
|
34
34
|
parser.pushKey(lurePathsKey(prefix, campaignId));
|
|
35
35
|
parser.push(path);
|
|
36
36
|
},
|
|
37
|
-
transformReply: undefined
|
|
37
|
+
transformReply: undefined,
|
|
38
38
|
},
|
|
39
39
|
read_lure_index: {
|
|
40
40
|
NUMBER_OF_KEYS: 2,
|
|
@@ -42,7 +42,7 @@ export const lureFunctions = {
|
|
|
42
42
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
43
43
|
parser.pushKey(lureIndexKey(prefix, campaignId));
|
|
44
44
|
},
|
|
45
|
-
transformReply: undefined
|
|
45
|
+
transformReply: undefined,
|
|
46
46
|
},
|
|
47
47
|
enable_lure: {
|
|
48
48
|
NUMBER_OF_KEYS: 3,
|
|
@@ -52,7 +52,7 @@ export const lureFunctions = {
|
|
|
52
52
|
parser.pushKey(lureKey(prefix, campaignId, lureId));
|
|
53
53
|
parser.push(lockSecret);
|
|
54
54
|
},
|
|
55
|
-
transformReply: undefined
|
|
55
|
+
transformReply: undefined,
|
|
56
56
|
},
|
|
57
57
|
disable_lure: {
|
|
58
58
|
NUMBER_OF_KEYS: 3,
|
|
@@ -62,7 +62,7 @@ export const lureFunctions = {
|
|
|
62
62
|
parser.pushKey(lureKey(prefix, campaignId, lureId));
|
|
63
63
|
parser.push(lockSecret);
|
|
64
64
|
},
|
|
65
|
-
transformReply: undefined
|
|
65
|
+
transformReply: undefined,
|
|
66
66
|
},
|
|
67
67
|
delete_lure: {
|
|
68
68
|
NUMBER_OF_KEYS: 6,
|
|
@@ -75,8 +75,8 @@ export const lureFunctions = {
|
|
|
75
75
|
parser.pushKey(redirectorKey(prefix, campaignId, redirectorId));
|
|
76
76
|
parser.push(lockSecret);
|
|
77
77
|
},
|
|
78
|
-
transformReply: undefined
|
|
79
|
-
}
|
|
80
|
-
}
|
|
78
|
+
transformReply: undefined,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
81
|
};
|
|
82
82
|
//# sourceMappingURL=lure.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lure.functions.js","sourceRoot":"","sources":["../../../src/modules/lure/lure.functions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,eAAe,EACf,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,aAAa,GACd,MAAM,wBAAwB,CAAA;AAoB/B,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE;QACJ,WAAW,EAAE;YACX,cAAc,EAAE,CAAC;YAEjB,YAAY,CACV,MAAqB,EACrB,MAAc,EACd,UAAkB,EAClB,MAAc,EACd,IAAY,EACZ,YAAoB,EACpB,SAAiB,EACjB,UAAkB;gBAElB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAC/C,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBACnD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;gBACnD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAChD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,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EACpB,UAAkB;gBAElB,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAC/C,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBACnD,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;gBACnD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAChD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAChD,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;gBAE/D,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;YACzB,CAAC;YAED,cAAc,EAAE,SAAqC;SACtD;KACF;CACO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lure.js","sourceRoot":"","sources":["../../../src/modules/lure/lure.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lure.models.js","sourceRoot":"","sources":["../../../src/modules/lure/lure.models.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,SAAS;IAUT;IACA;IACA;IACA;IACA;IACA;IACA;IAfX,MAAM,CAAC,SAAS,GAAG,CAAsB,KAAe,EAAc,EAAE;QACtE,OAAO,KAAK,IAAI,IAAI,CAAA;IACtB,CAAC,CAAA;IAED,MAAM,CAAC,SAAS,GAAG,CAAsB,KAAQ,EAAoC,EAAE;QACrF,OAAO,KAAK,CAAC,SAAS,CAAA;IACxB,CAAC,CAAA;IAED,YACW,UAAkB,EAClB,MAAc,EACd,IAAY,EACZ,YAAoB,EACpB,SAAkB,EAClB,YAAoB,EACpB,SAAe;QANf,eAAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,cAAS,GAAT,SAAS,CAAS;QAClB,iBAAY,GAAZ,YAAY,CAAQ;QACpB,cAAS,GAAT,SAAS,CAAM;IACvB,CAAC"}
|
|
@@ -7,39 +7,39 @@ const rawLureSchema = {
|
|
|
7
7
|
'redirector_id',
|
|
8
8
|
'is_enabled',
|
|
9
9
|
'session_count',
|
|
10
|
-
'created_at'
|
|
10
|
+
'created_at',
|
|
11
11
|
],
|
|
12
12
|
properties: {
|
|
13
13
|
campaign_id: {
|
|
14
|
-
type: 'string'
|
|
14
|
+
type: 'string',
|
|
15
15
|
},
|
|
16
16
|
lure_id: {
|
|
17
|
-
type: 'string'
|
|
17
|
+
type: 'string',
|
|
18
18
|
},
|
|
19
19
|
path: {
|
|
20
|
-
type: 'string'
|
|
20
|
+
type: 'string',
|
|
21
21
|
},
|
|
22
22
|
redirector_id: {
|
|
23
|
-
type: 'string'
|
|
23
|
+
type: 'string',
|
|
24
24
|
},
|
|
25
25
|
is_enabled: {
|
|
26
|
-
type: 'integer'
|
|
26
|
+
type: 'integer',
|
|
27
27
|
},
|
|
28
28
|
session_count: {
|
|
29
|
-
type: 'integer'
|
|
29
|
+
type: 'integer',
|
|
30
30
|
},
|
|
31
31
|
created_at: {
|
|
32
|
-
type: 'integer'
|
|
33
|
-
}
|
|
32
|
+
type: 'integer',
|
|
33
|
+
},
|
|
34
34
|
},
|
|
35
|
-
additionalProperties: false
|
|
36
|
-
};
|
|
37
|
-
export const lureSchemas = {
|
|
38
|
-
'database-raw-lure': rawLureSchema
|
|
35
|
+
additionalProperties: false,
|
|
39
36
|
};
|
|
40
37
|
export const lurePathSchema = {
|
|
41
38
|
type: 'string',
|
|
42
39
|
minLength: 1,
|
|
43
|
-
maxLength: 128
|
|
40
|
+
maxLength: 128,
|
|
41
|
+
};
|
|
42
|
+
export const lureSchemas = {
|
|
43
|
+
'database-raw-lure': rawLureSchema,
|
|
44
44
|
};
|
|
45
45
|
//# sourceMappingURL=lure.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lure.schemas.js","sourceRoot":"","sources":["../../../src/modules/lure/lure.schemas.ts"],"names":[],"mappings":"AAOA,MAAM,aAAa,GAA4B;IAC7C,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,aAAa;QACb,SAAS;QACT,MAAM;QACN,eAAe;QACf,YAAY;QACZ,eAAe;QACf,YAAY;KACb;IACD,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;SAChB;QACD,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;SAChB;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;SAChB;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAA;AAMV,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,GAAG;CACN,CAAA;AAMV,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,mBAAmB,EAAE,aAAa;CAC1B,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { DIContainer } from '@famir/common';
|
|
|
2
2
|
import { Config } from '@famir/config';
|
|
3
3
|
import { Logger } from '@famir/logger';
|
|
4
4
|
import { Validator } from '@famir/validator';
|
|
5
|
-
import {
|
|
6
|
-
import { LureModel } from '../../models/index.js';
|
|
5
|
+
import { DatabaseConnector, RedisDatabaseConfig } from '../../database.js';
|
|
7
6
|
import { RedisBaseRepository } from '../base/index.js';
|
|
8
7
|
import { LureRepository } from './lure.js';
|
|
8
|
+
import { LureModel } from './lure.models.js';
|
|
9
9
|
export declare class RedisLureRepository extends RedisBaseRepository implements LureRepository {
|
|
10
|
-
static
|
|
11
|
-
constructor(validator: Validator, config: Config<RedisDatabaseConfig>, logger: Logger,
|
|
10
|
+
static register(container: DIContainer): void;
|
|
11
|
+
constructor(validator: Validator, config: Config<RedisDatabaseConfig>, logger: Logger, connector: DatabaseConnector);
|
|
12
12
|
create(campaignId: string, lureId: string, path: string, redirectorId: string, lockSecret: string): Promise<void>;
|
|
13
13
|
read(campaignId: string, lureId: string): Promise<LureModel | null>;
|
|
14
14
|
find(campaignId: string, path: string): Promise<LureModel | null>;
|
|
@@ -2,22 +2,22 @@ import { CONFIG } from '@famir/config';
|
|
|
2
2
|
import { LOGGER } from '@famir/logger';
|
|
3
3
|
import { VALIDATOR } from '@famir/validator';
|
|
4
4
|
import { DATABASE_CONNECTOR } from '../../database.js';
|
|
5
|
-
import { LureModel } from '../../models/index.js';
|
|
6
5
|
import { RedisBaseRepository } from '../base/index.js';
|
|
7
6
|
import { LURE_REPOSITORY } from './lure.js';
|
|
7
|
+
import { LureModel } from './lure.models.js';
|
|
8
8
|
import { lureSchemas } from './lure.schemas.js';
|
|
9
9
|
export class RedisLureRepository extends RedisBaseRepository {
|
|
10
|
-
static
|
|
11
|
-
container.registerSingleton(LURE_REPOSITORY, (c) => new RedisLureRepository(c.resolve(VALIDATOR), c.resolve(CONFIG), c.resolve(LOGGER), c.resolve(DATABASE_CONNECTOR)
|
|
10
|
+
static register(container) {
|
|
11
|
+
container.registerSingleton(LURE_REPOSITORY, (c) => new RedisLureRepository(c.resolve(VALIDATOR), c.resolve(CONFIG), c.resolve(LOGGER), c.resolve(DATABASE_CONNECTOR)));
|
|
12
12
|
}
|
|
13
|
-
constructor(validator, config, logger,
|
|
14
|
-
super(validator, config, logger,
|
|
13
|
+
constructor(validator, config, logger, connector) {
|
|
14
|
+
super(validator, config, logger, connector, 'lure');
|
|
15
15
|
this.validator.addSchemas(lureSchemas);
|
|
16
16
|
this.logger.debug(`LureRepository initialized`);
|
|
17
17
|
}
|
|
18
18
|
async create(campaignId, lureId, path, redirectorId, lockSecret) {
|
|
19
19
|
try {
|
|
20
|
-
const statusReply = await this.connection.lure.create_lure(this.options.prefix, campaignId, lureId, path, redirectorId, lockSecret);
|
|
20
|
+
const statusReply = await this.connection.lure.create_lure(this.options.prefix, campaignId, lureId, path, redirectorId, Date.now().toString(), lockSecret);
|
|
21
21
|
const mesg = this.handleStatusReply(statusReply);
|
|
22
22
|
this.logger.info(mesg, { lure: { campaignId, lureId, path, redirectorId } });
|
|
23
23
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-lure.repository.js","sourceRoot":"","sources":["../../../src/modules/lure/redis-lure.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAU,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,MAAM,EAAU,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAa,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAA0C,MAAM,mBAAmB,CAAA;AAC9F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,eAAe,EAAkB,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAO/C,MAAM,OAAO,mBAAoB,SAAQ,mBAAmB;IAI1D,MAAM,CAAC,QAAQ,CAAC,SAAsB;QACpC,SAAS,CAAC,iBAAiB,CACzB,eAAe,EACf,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,mBAAmB,CACrB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,EACpB,CAAC,CAAC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IAAI,CAAC,eAAe,CAAU,mBAAmB,EAAE,QAAQ,CAAC,CAAA;QAE5D,OAAO,IAAI,SAAS,CAClB,QAAQ,CAAC,WAAW,EACpB,QAAQ,CAAC,OAAO,EAChB,QAAQ,CAAC,IAAI,EACb,QAAQ,CAAC,aAAa,EACtB,CAAC,CAAC,QAAQ,CAAC,UAAU,EACrB,QAAQ,CAAC,aAAa,EACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAC9B,CAAA;IACH,CAAC;IAES,eAAe,CAAC,aAAsB;QAC9C,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA;QAEtC,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IAC/F,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,+BAA+B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HttpBody, HttpConnection, HttpError, HttpHeaders, HttpMethod, HttpPayload, HttpType } from '@famir/http-proto';
|
|
2
|
+
import { FullMessageModel, MessageModel } from './message.models.js';
|
|
3
|
+
export declare const MESSAGE_REPOSITORY: unique symbol;
|
|
4
|
+
export interface MessageRepository {
|
|
5
|
+
create(campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string, type: HttpType, method: HttpMethod, url: string, requestHeaders: HttpHeaders, requestBody: HttpBody, status: number, responseHeaders: HttpHeaders, responseBody: HttpBody, connection: HttpConnection, payload: HttpPayload, errors: HttpError[], analyze: string, startTime: number, finishTime: number): Promise<void>;
|
|
6
|
+
createDummy(campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string): Promise<void>;
|
|
7
|
+
read(campaignId: string, messageId: string): Promise<MessageModel | null>;
|
|
8
|
+
readFull(campaignId: string, messageId: string): Promise<FullMessageModel | null>;
|
|
9
|
+
}
|
|
@@ -5,11 +5,11 @@ export interface RawMessage {
|
|
|
5
5
|
proxy_id: string;
|
|
6
6
|
target_id: string;
|
|
7
7
|
session_id: string;
|
|
8
|
-
|
|
8
|
+
type: string;
|
|
9
9
|
method: string;
|
|
10
10
|
url: string;
|
|
11
11
|
status: number;
|
|
12
|
-
|
|
12
|
+
analyze: string;
|
|
13
13
|
start_time: number;
|
|
14
14
|
finish_time: number;
|
|
15
15
|
created_at: number;
|
|
@@ -27,7 +27,12 @@ export declare const messageFunctions: {
|
|
|
27
27
|
readonly message: {
|
|
28
28
|
readonly create_message: {
|
|
29
29
|
readonly NUMBER_OF_KEYS: 5;
|
|
30
|
-
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string,
|
|
30
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string, type: string, method: string, url: string, requestHeaders: string, requestBody: string, status: string, responseHeaders: string, responseBody: string, connection: string, payload: string, errors: string, analyze: string, startTime: string, finishTime: string, createdAt: string) => void;
|
|
31
|
+
readonly transformReply: () => unknown;
|
|
32
|
+
};
|
|
33
|
+
readonly create_dummy_message: {
|
|
34
|
+
readonly NUMBER_OF_KEYS: 5;
|
|
35
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string) => void;
|
|
31
36
|
readonly transformReply: () => unknown;
|
|
32
37
|
};
|
|
33
38
|
readonly read_message: {
|
|
@@ -3,7 +3,7 @@ export const messageFunctions = {
|
|
|
3
3
|
message: {
|
|
4
4
|
create_message: {
|
|
5
5
|
NUMBER_OF_KEYS: 5,
|
|
6
|
-
parseCommand(parser, prefix, campaignId, messageId, proxyId, targetId, sessionId,
|
|
6
|
+
parseCommand(parser, prefix, campaignId, messageId, proxyId, targetId, sessionId, type, method, url, requestHeaders, requestBody, status, responseHeaders, responseBody, connection, payload, errors, analyze, startTime, finishTime, createdAt) {
|
|
7
7
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
8
8
|
parser.pushKey(messageKey(prefix, campaignId, messageId));
|
|
9
9
|
parser.pushKey(proxyKey(prefix, campaignId, proxyId));
|
|
@@ -14,23 +14,34 @@ export const messageFunctions = {
|
|
|
14
14
|
parser.push(proxyId);
|
|
15
15
|
parser.push(targetId);
|
|
16
16
|
parser.push(sessionId);
|
|
17
|
-
parser.push(
|
|
17
|
+
parser.push(type);
|
|
18
18
|
parser.push(method);
|
|
19
19
|
parser.push(url);
|
|
20
20
|
parser.push(requestHeaders);
|
|
21
21
|
parser.push(requestBody);
|
|
22
|
-
parser.push(status
|
|
22
|
+
parser.push(status);
|
|
23
23
|
parser.push(responseHeaders);
|
|
24
24
|
parser.push(responseBody);
|
|
25
25
|
parser.push(connection);
|
|
26
26
|
parser.push(payload);
|
|
27
27
|
parser.push(errors);
|
|
28
|
-
parser.push(
|
|
29
|
-
parser.push(startTime
|
|
30
|
-
parser.push(finishTime
|
|
31
|
-
parser.push(
|
|
28
|
+
parser.push(analyze);
|
|
29
|
+
parser.push(startTime);
|
|
30
|
+
parser.push(finishTime);
|
|
31
|
+
parser.push(createdAt);
|
|
32
32
|
},
|
|
33
|
-
transformReply: undefined
|
|
33
|
+
transformReply: undefined,
|
|
34
|
+
},
|
|
35
|
+
create_dummy_message: {
|
|
36
|
+
NUMBER_OF_KEYS: 5,
|
|
37
|
+
parseCommand(parser, prefix, campaignId, messageId, proxyId, targetId, sessionId) {
|
|
38
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
39
|
+
parser.pushKey(messageKey(prefix, campaignId, messageId));
|
|
40
|
+
parser.pushKey(proxyKey(prefix, campaignId, proxyId));
|
|
41
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
42
|
+
parser.pushKey(sessionKey(prefix, campaignId, sessionId));
|
|
43
|
+
},
|
|
44
|
+
transformReply: undefined,
|
|
34
45
|
},
|
|
35
46
|
read_message: {
|
|
36
47
|
NUMBER_OF_KEYS: 2,
|
|
@@ -38,7 +49,7 @@ export const messageFunctions = {
|
|
|
38
49
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
39
50
|
parser.pushKey(messageKey(prefix, campaignId, messageId));
|
|
40
51
|
},
|
|
41
|
-
transformReply: undefined
|
|
52
|
+
transformReply: undefined,
|
|
42
53
|
},
|
|
43
54
|
read_full_message: {
|
|
44
55
|
NUMBER_OF_KEYS: 2,
|
|
@@ -46,8 +57,8 @@ export const messageFunctions = {
|
|
|
46
57
|
parser.pushKey(campaignKey(prefix, campaignId));
|
|
47
58
|
parser.pushKey(messageKey(prefix, campaignId, messageId));
|
|
48
59
|
},
|
|
49
|
-
transformReply: undefined
|
|
50
|
-
}
|
|
51
|
-
}
|
|
60
|
+
transformReply: undefined,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
52
63
|
};
|
|
53
64
|
//# sourceMappingURL=message.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.functions.js","sourceRoot":"","sources":["../../../src/modules/message/message.functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAwCjG,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,OAAO,EAAE;QACP,cAAc,EAAE;YACd,cAAc,EAAE,CAAC;YAEjB,YAAY,CACV,MAAqB,EACrB,MAAc,EACd,UAAkB,EAClB,SAAiB,EACjB,OAAe,EACf,QAAgB,EAChB,SAAiB,EACjB,IAAY,EACZ,MAAc,EACd,GAAW,EACX,cAAsB,EACtB,WAAmB,EACnB,MAAc,EACd,eAAu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AAU,EAAE,SAAS,CAAC,CAAC,CAAA;YAC3D,CAAC;YAED,cAAc,EAAE,SAAqC;SACtD;QAED,iBAAiB,EAAE;YACjB,cAAc,EAAE,CAAC;YAEjB,YAAY,CAAC,MAAqB,EAAE,MAAc,EAAE,UAAkB,EAAE,SAAiB;gBACvF,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAC/C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAA;YAC3D,CAAC;YAED,cAAc,EAAE,SAAqC;SACtD;KACF;CACO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/modules/message/message.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HttpBody, HttpConnection, HttpError, HttpHeaders, HttpMethod, HttpPayload, HttpType } from '@famir/http-proto';
|
|
2
|
+
export declare class MessageModel {
|
|
3
|
+
readonly campaignId: string;
|
|
4
|
+
readonly messageId: string;
|
|
5
|
+
readonly proxyId: string;
|
|
6
|
+
readonly targetId: string;
|
|
7
|
+
readonly sessionId: string;
|
|
8
|
+
readonly type: HttpType;
|
|
9
|
+
readonly method: HttpMethod;
|
|
10
|
+
readonly url: string;
|
|
11
|
+
readonly status: number;
|
|
12
|
+
readonly analyze: string;
|
|
13
|
+
readonly startTime: number;
|
|
14
|
+
readonly finishTime: number;
|
|
15
|
+
readonly createdAt: Date;
|
|
16
|
+
static isNotNull: <T extends MessageModel>(model: T | null) => model is T;
|
|
17
|
+
constructor(campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string, type: HttpType, method: HttpMethod, url: string, status: number, analyze: string, startTime: number, finishTime: number, createdAt: Date);
|
|
18
|
+
get totalTime(): number;
|
|
19
|
+
}
|
|
20
|
+
export declare class FullMessageModel extends MessageModel {
|
|
21
|
+
readonly requestHeaders: HttpHeaders;
|
|
22
|
+
readonly requestBody: HttpBody;
|
|
23
|
+
readonly responseHeaders: HttpHeaders;
|
|
24
|
+
readonly responseBody: HttpBody;
|
|
25
|
+
readonly connection: HttpConnection;
|
|
26
|
+
readonly payload: HttpPayload;
|
|
27
|
+
readonly errors: HttpError[];
|
|
28
|
+
constructor(campaignId: string, messageId: string, proxyId: string, targetId: string, sessionId: string, type: HttpType, method: HttpMethod, url: string, requestHeaders: HttpHeaders, requestBody: HttpBody, status: number, responseHeaders: HttpHeaders, responseBody: HttpBody, connection: HttpConnection, payload: HttpPayload, errors: HttpError[], analyze: string, startTime: number, finishTime: number, createdAt: Date);
|
|
29
|
+
}
|
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
export const MESSAGE_KINDS = ['simple', 'stream-request', 'stream-response'];
|
|
2
|
-
export const MESSAGE_METHODS = ['HEAD', 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'];
|
|
3
1
|
export class MessageModel {
|
|
4
2
|
campaignId;
|
|
5
3
|
messageId;
|
|
6
4
|
proxyId;
|
|
7
5
|
targetId;
|
|
8
6
|
sessionId;
|
|
9
|
-
|
|
7
|
+
type;
|
|
10
8
|
method;
|
|
11
9
|
url;
|
|
12
10
|
status;
|
|
13
|
-
|
|
11
|
+
analyze;
|
|
14
12
|
startTime;
|
|
15
13
|
finishTime;
|
|
16
14
|
createdAt;
|
|
17
15
|
static isNotNull = (model) => {
|
|
18
16
|
return model != null;
|
|
19
17
|
};
|
|
20
|
-
constructor(campaignId, messageId, proxyId, targetId, sessionId,
|
|
18
|
+
constructor(campaignId, messageId, proxyId, targetId, sessionId, type, method, url, status, analyze, startTime, finishTime, createdAt) {
|
|
21
19
|
this.campaignId = campaignId;
|
|
22
20
|
this.messageId = messageId;
|
|
23
21
|
this.proxyId = proxyId;
|
|
24
22
|
this.targetId = targetId;
|
|
25
23
|
this.sessionId = sessionId;
|
|
26
|
-
this.
|
|
24
|
+
this.type = type;
|
|
27
25
|
this.method = method;
|
|
28
26
|
this.url = url;
|
|
29
27
|
this.status = status;
|
|
30
|
-
this.
|
|
28
|
+
this.analyze = analyze;
|
|
31
29
|
this.startTime = startTime;
|
|
32
30
|
this.finishTime = finishTime;
|
|
33
31
|
this.createdAt = createdAt;
|
|
@@ -44,8 +42,8 @@ export class FullMessageModel extends MessageModel {
|
|
|
44
42
|
connection;
|
|
45
43
|
payload;
|
|
46
44
|
errors;
|
|
47
|
-
constructor(campaignId, messageId, proxyId, targetId, sessionId,
|
|
48
|
-
super(campaignId, messageId, proxyId, targetId, sessionId,
|
|
45
|
+
constructor(campaignId, messageId, proxyId, targetId, sessionId, type, method, url, requestHeaders, requestBody, status, responseHeaders, responseBody, connection, payload, errors, analyze, startTime, finishTime, createdAt) {
|
|
46
|
+
super(campaignId, messageId, proxyId, targetId, sessionId, type, method, url, status, analyze, startTime, finishTime, createdAt);
|
|
49
47
|
this.requestHeaders = requestHeaders;
|
|
50
48
|
this.requestBody = requestBody;
|
|
51
49
|
this.responseHeaders = responseHeaders;
|
|
@@ -55,4 +53,4 @@ export class FullMessageModel extends MessageModel {
|
|
|
55
53
|
this.errors = errors;
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
|
-
//# sourceMappingURL=message.js.map
|
|
56
|
+
//# sourceMappingURL=message.models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.models.js","sourceRoot":"","sources":["../../../src/modules/message/message.models.ts"],"names":[],"mappings":"AAeA,MAAM,OAAO,YAAY;IAMZ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAjBX,MAAM,CAAC,SAAS,GAAG,CAAyB,KAAe,EAAc,EAAE;QACzE,OAAO,KAAK,IAAI,IAAI,CAAA;IACtB,CAAC,CAAA;IAED,YACW,UAAkB,EAClB,SAAiB,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Q,mBAAc,GAAd,cAAc,CAAa;QAC3B,gBAAW,GAAX,WAAW,CAAU;QAErB,oBAAe,GAAf,eAAe,CAAa;QAC5B,iBAAY,GAAZ,YAAY,CAAU;QACtB,eAAU,GAAV,UAAU,CAAgB;QAC1B,YAAO,GAAP,OAAO,CAAa;QACpB,WAAM,GAAN,MAAM,CAAa;IAqB9B,CAAC;CACF"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { httpConnectionSchema, httpErrorsSchema, httpHeadersSchema, httpMethodSchema, httpPayloadSchema, httpTypeSchema, } from '@famir/http-proto';
|
|
2
|
+
const rawMessageSchema = {
|
|
3
|
+
type: 'object',
|
|
4
|
+
required: [
|
|
5
|
+
'campaign_id',
|
|
6
|
+
'message_id',
|
|
7
|
+
'proxy_id',
|
|
8
|
+
'target_id',
|
|
9
|
+
'session_id',
|
|
10
|
+
'type',
|
|
11
|
+
'method',
|
|
12
|
+
'url',
|
|
13
|
+
'status',
|
|
14
|
+
'analyze',
|
|
15
|
+
'start_time',
|
|
16
|
+
'finish_time',
|
|
17
|
+
'created_at',
|
|
18
|
+
],
|
|
19
|
+
properties: {
|
|
20
|
+
campaign_id: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
},
|
|
23
|
+
message_id: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
proxy_id: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
},
|
|
29
|
+
target_id: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
},
|
|
32
|
+
session_id: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
},
|
|
38
|
+
method: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
},
|
|
41
|
+
url: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
},
|
|
44
|
+
status: {
|
|
45
|
+
type: 'integer',
|
|
46
|
+
},
|
|
47
|
+
analyze: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
},
|
|
50
|
+
start_time: {
|
|
51
|
+
type: 'integer',
|
|
52
|
+
},
|
|
53
|
+
finish_time: {
|
|
54
|
+
type: 'integer',
|
|
55
|
+
},
|
|
56
|
+
created_at: {
|
|
57
|
+
type: 'integer',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
additionalProperties: false,
|
|
61
|
+
};
|
|
62
|
+
const rawFullMessageSchema = {
|
|
63
|
+
type: 'object',
|
|
64
|
+
required: [
|
|
65
|
+
'campaign_id',
|
|
66
|
+
'message_id',
|
|
67
|
+
'proxy_id',
|
|
68
|
+
'target_id',
|
|
69
|
+
'session_id',
|
|
70
|
+
'type',
|
|
71
|
+
'method',
|
|
72
|
+
'url',
|
|
73
|
+
'request_headers',
|
|
74
|
+
'request_body',
|
|
75
|
+
'status',
|
|
76
|
+
'response_headers',
|
|
77
|
+
'response_body',
|
|
78
|
+
'connection',
|
|
79
|
+
'payload',
|
|
80
|
+
'errors',
|
|
81
|
+
'analyze',
|
|
82
|
+
'start_time',
|
|
83
|
+
'finish_time',
|
|
84
|
+
'created_at',
|
|
85
|
+
],
|
|
86
|
+
properties: {
|
|
87
|
+
campaign_id: {
|
|
88
|
+
type: 'string',
|
|
89
|
+
},
|
|
90
|
+
message_id: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
},
|
|
93
|
+
proxy_id: {
|
|
94
|
+
type: 'string',
|
|
95
|
+
},
|
|
96
|
+
target_id: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
},
|
|
99
|
+
session_id: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
},
|
|
102
|
+
type: {
|
|
103
|
+
type: 'string',
|
|
104
|
+
},
|
|
105
|
+
method: {
|
|
106
|
+
type: 'string',
|
|
107
|
+
},
|
|
108
|
+
url: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
},
|
|
111
|
+
request_headers: {
|
|
112
|
+
type: 'string',
|
|
113
|
+
},
|
|
114
|
+
request_body: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
},
|
|
117
|
+
status: {
|
|
118
|
+
type: 'integer',
|
|
119
|
+
},
|
|
120
|
+
response_headers: {
|
|
121
|
+
type: 'string',
|
|
122
|
+
},
|
|
123
|
+
response_body: {
|
|
124
|
+
type: 'string',
|
|
125
|
+
},
|
|
126
|
+
connection: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
},
|
|
129
|
+
payload: {
|
|
130
|
+
type: 'string',
|
|
131
|
+
},
|
|
132
|
+
errors: {
|
|
133
|
+
type: 'string',
|
|
134
|
+
},
|
|
135
|
+
analyze: {
|
|
136
|
+
type: 'string',
|
|
137
|
+
},
|
|
138
|
+
start_time: {
|
|
139
|
+
type: 'integer',
|
|
140
|
+
},
|
|
141
|
+
finish_time: {
|
|
142
|
+
type: 'integer',
|
|
143
|
+
},
|
|
144
|
+
created_at: {
|
|
145
|
+
type: 'integer',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
additionalProperties: false,
|
|
149
|
+
};
|
|
150
|
+
export const messageSchemas = {
|
|
151
|
+
'database-raw-message': rawMessageSchema,
|
|
152
|
+
'database-raw-full-message': rawFullMessageSchema,
|
|
153
|
+
'database-message-type': httpTypeSchema,
|
|
154
|
+
'database-message-method': httpMethodSchema,
|
|
155
|
+
'database-message-headers': httpHeadersSchema,
|
|
156
|
+
'database-message-connection': httpConnectionSchema,
|
|
157
|
+
'database-message-payload': httpPayloadSchema,
|
|
158
|
+
'database-message-errors': httpErrorsSchema,
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=message.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.schemas.js","sourceRoot":"","sources":["../../../src/modules/message/message.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,GACf,MAAM,mBAAmB,CAAA;AAQ1B,MAAM,gBAAgB,GAA+B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