@famir/database 0.0.1
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 +4 -0
- package/dist/database.d.ts +27 -0
- package/dist/database.error.d.ts +9 -0
- package/dist/database.error.js +13 -0
- package/dist/database.error.js.map +1 -0
- package/dist/database.functions.d.ts +242 -0
- package/dist/database.functions.js +17 -0
- package/dist/database.functions.js.map +1 -0
- package/dist/database.js +5 -0
- package/dist/database.js.map +1 -0
- package/dist/database.keys.d.ts +21 -0
- package/dist/database.keys.js +67 -0
- package/dist/database.keys.js.map +1 -0
- package/dist/database.schemas.d.ts +3 -0
- package/dist/database.schemas.js +12 -0
- package/dist/database.schemas.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/models/campaign/campaign.d.ts +24 -0
- package/dist/models/campaign/campaign.js +47 -0
- package/dist/models/campaign/campaign.js.map +1 -0
- package/dist/models/campaign/index.d.ts +1 -0
- package/dist/models/campaign/index.js +2 -0
- package/dist/models/campaign/index.js.map +1 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +8 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/lure/index.d.ts +1 -0
- package/dist/models/lure/index.js +2 -0
- package/dist/models/lure/index.js.map +1 -0
- package/dist/models/lure/lure.d.ts +17 -0
- package/dist/models/lure/lure.js +25 -0
- package/dist/models/lure/lure.js.map +1 -0
- package/dist/models/message/index.d.ts +1 -0
- package/dist/models/message/index.js +2 -0
- package/dist/models/message/index.js.map +1 -0
- package/dist/models/message/message.d.ts +38 -0
- package/dist/models/message/message.js +58 -0
- package/dist/models/message/message.js.map +1 -0
- package/dist/models/proxy/index.d.ts +1 -0
- package/dist/models/proxy/index.js +2 -0
- package/dist/models/proxy/index.js.map +1 -0
- package/dist/models/proxy/proxy.d.ts +16 -0
- package/dist/models/proxy/proxy.js +23 -0
- package/dist/models/proxy/proxy.js.map +1 -0
- package/dist/models/redirector/index.d.ts +1 -0
- package/dist/models/redirector/index.js +2 -0
- package/dist/models/redirector/index.js.map +1 -0
- package/dist/models/redirector/redirector.d.ts +12 -0
- package/dist/models/redirector/redirector.js +23 -0
- package/dist/models/redirector/redirector.js.map +1 -0
- package/dist/models/session/index.d.ts +1 -0
- package/dist/models/session/index.js +2 -0
- package/dist/models/session/index.js.map +1 -0
- package/dist/models/session/session.d.ts +13 -0
- package/dist/models/session/session.js +27 -0
- package/dist/models/session/session.js.map +1 -0
- package/dist/models/target/index.d.ts +1 -0
- package/dist/models/target/index.js +2 -0
- package/dist/models/target/index.js.map +1 -0
- package/dist/models/target/target.d.ts +51 -0
- package/dist/models/target/target.js +110 -0
- package/dist/models/target/target.js.map +1 -0
- package/dist/redis-database-connector.d.ts +15 -0
- package/dist/redis-database-connector.js +47 -0
- package/dist/redis-database-connector.js.map +1 -0
- package/dist/redis-database-manager.d.ts +11 -0
- package/dist/redis-database-manager.js +27 -0
- package/dist/redis-database-manager.js.map +1 -0
- package/dist/redis-functions.d.ts +1 -0
- package/dist/redis-functions.js +1396 -0
- package/dist/redis-functions.js.map +1 -0
- package/dist/repositories/base/index.d.ts +1 -0
- package/dist/repositories/base/index.js +2 -0
- package/dist/repositories/base/index.js.map +1 -0
- package/dist/repositories/base/redis-base.repository.d.ts +23 -0
- package/dist/repositories/base/redis-base.repository.js +140 -0
- package/dist/repositories/base/redis-base.repository.js.map +1 -0
- package/dist/repositories/campaign/campaign.d.ts +13 -0
- package/dist/repositories/campaign/campaign.functions.d.ts +66 -0
- package/dist/repositories/campaign/campaign.functions.js +111 -0
- package/dist/repositories/campaign/campaign.functions.js.map +1 -0
- package/dist/repositories/campaign/campaign.js +2 -0
- package/dist/repositories/campaign/campaign.js.map +1 -0
- package/dist/repositories/campaign/campaign.schemas.d.ts +9 -0
- package/dist/repositories/campaign/campaign.schemas.js +148 -0
- package/dist/repositories/campaign/campaign.schemas.js.map +1 -0
- package/dist/repositories/campaign/index.d.ts +3 -0
- package/dist/repositories/campaign/index.js +4 -0
- package/dist/repositories/campaign/index.js.map +1 -0
- package/dist/repositories/campaign/redis-campaign.repository.d.ts +25 -0
- package/dist/repositories/campaign/redis-campaign.repository.js +138 -0
- package/dist/repositories/campaign/redis-campaign.repository.js.map +1 -0
- package/dist/repositories/index.d.ts +8 -0
- package/dist/repositories/index.js +9 -0
- package/dist/repositories/index.js.map +1 -0
- package/dist/repositories/lure/index.d.ts +3 -0
- package/dist/repositories/lure/index.js +4 -0
- package/dist/repositories/lure/index.js.map +1 -0
- package/dist/repositories/lure/lure.d.ts +11 -0
- package/dist/repositories/lure/lure.functions.d.ts +49 -0
- package/dist/repositories/lure/lure.functions.js +82 -0
- package/dist/repositories/lure/lure.functions.js.map +1 -0
- package/dist/repositories/lure/lure.js +2 -0
- package/dist/repositories/lure/lure.js.map +1 -0
- package/dist/repositories/lure/lure.schemas.d.ts +3 -0
- package/dist/repositories/lure/lure.schemas.js +45 -0
- package/dist/repositories/lure/lure.schemas.js.map +1 -0
- package/dist/repositories/lure/redis-lure.repository.d.ts +21 -0
- package/dist/repositories/lure/redis-lure.repository.js +107 -0
- package/dist/repositories/lure/redis-lure.repository.js.map +1 -0
- package/dist/repositories/message/index.d.ts +3 -0
- package/dist/repositories/message/index.js +4 -0
- package/dist/repositories/message/index.js.map +1 -0
- package/dist/repositories/message/message.d.ts +6 -0
- package/dist/repositories/message/message.functions.d.ts +44 -0
- package/dist/repositories/message/message.functions.js +53 -0
- package/dist/repositories/message/message.functions.js.map +1 -0
- package/dist/repositories/message/message.js +2 -0
- package/dist/repositories/message/message.js.map +1 -0
- package/dist/repositories/message/message.schemas.d.ts +2 -0
- package/dist/repositories/message/message.schemas.js +206 -0
- package/dist/repositories/message/message.schemas.js.map +1 -0
- package/dist/repositories/message/redis-message.repository.d.ts +20 -0
- package/dist/repositories/message/redis-message.repository.js +72 -0
- package/dist/repositories/message/redis-message.repository.js.map +1 -0
- package/dist/repositories/proxy/index.d.ts +3 -0
- package/dist/repositories/proxy/index.js +4 -0
- package/dist/repositories/proxy/index.js.map +1 -0
- package/dist/repositories/proxy/proxy.d.ts +10 -0
- package/dist/repositories/proxy/proxy.functions.d.ts +43 -0
- package/dist/repositories/proxy/proxy.functions.js +72 -0
- package/dist/repositories/proxy/proxy.functions.js.map +1 -0
- package/dist/repositories/proxy/proxy.js +2 -0
- package/dist/repositories/proxy/proxy.js.map +1 -0
- package/dist/repositories/proxy/proxy.schemas.d.ts +3 -0
- package/dist/repositories/proxy/proxy.schemas.js +34 -0
- package/dist/repositories/proxy/proxy.schemas.js.map +1 -0
- package/dist/repositories/proxy/redis-proxy.repository.d.ts +20 -0
- package/dist/repositories/proxy/redis-proxy.repository.js +93 -0
- package/dist/repositories/proxy/redis-proxy.repository.js.map +1 -0
- package/dist/repositories/redirector/index.d.ts +3 -0
- package/dist/repositories/redirector/index.js +4 -0
- package/dist/repositories/redirector/index.js.map +1 -0
- package/dist/repositories/redirector/redirector.d.ts +11 -0
- package/dist/repositories/redirector/redirector.functions.d.ts +44 -0
- package/dist/repositories/redirector/redirector.functions.js +70 -0
- package/dist/repositories/redirector/redirector.functions.js.map +1 -0
- package/dist/repositories/redirector/redirector.js +2 -0
- package/dist/repositories/redirector/redirector.js.map +1 -0
- package/dist/repositories/redirector/redirector.schemas.d.ts +3 -0
- package/dist/repositories/redirector/redirector.schemas.js +51 -0
- package/dist/repositories/redirector/redirector.schemas.js.map +1 -0
- package/dist/repositories/redirector/redis-redirector.repository.d.ts +23 -0
- package/dist/repositories/redirector/redis-redirector.repository.js +121 -0
- package/dist/repositories/redirector/redis-redirector.repository.js.map +1 -0
- package/dist/repositories/session/index.d.ts +3 -0
- package/dist/repositories/session/index.js +4 -0
- package/dist/repositories/session/index.js.map +1 -0
- package/dist/repositories/session/redis-session.repository.d.ts +18 -0
- package/dist/repositories/session/redis-session.repository.js +85 -0
- package/dist/repositories/session/redis-session.repository.js.map +1 -0
- package/dist/repositories/session/session.d.ts +8 -0
- package/dist/repositories/session/session.functions.d.ts +35 -0
- package/dist/repositories/session/session.functions.js +47 -0
- package/dist/repositories/session/session.functions.js.map +1 -0
- package/dist/repositories/session/session.js +2 -0
- package/dist/repositories/session/session.js.map +1 -0
- package/dist/repositories/session/session.schemas.d.ts +2 -0
- package/dist/repositories/session/session.schemas.js +44 -0
- package/dist/repositories/session/session.schemas.js.map +1 -0
- package/dist/repositories/target/index.d.ts +3 -0
- package/dist/repositories/target/index.js +4 -0
- package/dist/repositories/target/index.js.map +1 -0
- package/dist/repositories/target/redis-target.repository.d.ts +30 -0
- package/dist/repositories/target/redis-target.repository.js +198 -0
- package/dist/repositories/target/redis-target.repository.js.map +1 -0
- package/dist/repositories/target/target.d.ts +17 -0
- package/dist/repositories/target/target.functions.d.ts +89 -0
- package/dist/repositories/target/target.functions.js +184 -0
- package/dist/repositories/target/target.functions.js.map +1 -0
- package/dist/repositories/target/target.js +2 -0
- package/dist/repositories/target/target.js.map +1 -0
- package/dist/repositories/target/target.schemas.d.ts +13 -0
- package/dist/repositories/target/target.schemas.js +241 -0
- package/dist/repositories/target/target.schemas.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { campaignKey, campaignLockKey, targetIndexKey, targetKey, targetLabelsKey, targetMirrorHostsKey, targetUniqueDonorKey, targetUniqueMirrorKey } from '../../database.keys.js';
|
|
2
|
+
export const targetFunctions = {
|
|
3
|
+
target: {
|
|
4
|
+
create_target: {
|
|
5
|
+
NUMBER_OF_KEYS: 7,
|
|
6
|
+
parseCommand(parser, prefix, campaignId, targetId, isLanding, donorSecure, donorSub, donorDomain, donorPort, mirrorSecure, mirrorSub, mirrorPort, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret) {
|
|
7
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
8
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
9
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
10
|
+
parser.pushKey(targetUniqueDonorKey(prefix, campaignId));
|
|
11
|
+
parser.pushKey(targetUniqueMirrorKey(prefix, campaignId));
|
|
12
|
+
parser.pushKey(targetMirrorHostsKey(prefix));
|
|
13
|
+
parser.pushKey(targetIndexKey(prefix, campaignId));
|
|
14
|
+
parser.push(campaignId);
|
|
15
|
+
parser.push(targetId);
|
|
16
|
+
parser.push(isLanding ? '1' : '0');
|
|
17
|
+
parser.push(donorSecure ? '1' : '0');
|
|
18
|
+
parser.push(donorSub);
|
|
19
|
+
parser.push(donorDomain);
|
|
20
|
+
parser.push(donorPort.toString());
|
|
21
|
+
parser.push(mirrorSecure ? '1' : '0');
|
|
22
|
+
parser.push(mirrorSub);
|
|
23
|
+
parser.push(mirrorPort.toString());
|
|
24
|
+
parser.push(connectTimeout.toString());
|
|
25
|
+
parser.push(simpleTimeout.toString());
|
|
26
|
+
parser.push(streamTimeout.toString());
|
|
27
|
+
parser.push(headersSizeLimit.toString());
|
|
28
|
+
parser.push(bodySizeLimit.toString());
|
|
29
|
+
parser.push(mainPage);
|
|
30
|
+
parser.push(notFoundPage);
|
|
31
|
+
parser.push(faviconIco);
|
|
32
|
+
parser.push(robotsTxt);
|
|
33
|
+
parser.push(sitemapXml);
|
|
34
|
+
parser.push(Date.now().toString());
|
|
35
|
+
parser.push(lockSecret);
|
|
36
|
+
},
|
|
37
|
+
transformReply: undefined
|
|
38
|
+
},
|
|
39
|
+
read_target: {
|
|
40
|
+
NUMBER_OF_KEYS: 3,
|
|
41
|
+
parseCommand(parser, prefix, campaignId, targetId) {
|
|
42
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
43
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
44
|
+
parser.pushKey(targetLabelsKey(prefix, campaignId, targetId));
|
|
45
|
+
},
|
|
46
|
+
transformReply: undefined
|
|
47
|
+
},
|
|
48
|
+
read_full_target: {
|
|
49
|
+
NUMBER_OF_KEYS: 3,
|
|
50
|
+
parseCommand(parser, prefix, campaignId, targetId) {
|
|
51
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
52
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
53
|
+
parser.pushKey(targetLabelsKey(prefix, campaignId, targetId));
|
|
54
|
+
},
|
|
55
|
+
transformReply: undefined
|
|
56
|
+
},
|
|
57
|
+
find_target_link: {
|
|
58
|
+
NUMBER_OF_KEYS: 1,
|
|
59
|
+
parseCommand(parser, prefix, mirrorHost) {
|
|
60
|
+
parser.pushKey(targetMirrorHostsKey(prefix));
|
|
61
|
+
parser.push(mirrorHost);
|
|
62
|
+
},
|
|
63
|
+
transformReply: undefined
|
|
64
|
+
},
|
|
65
|
+
read_target_index: {
|
|
66
|
+
NUMBER_OF_KEYS: 2,
|
|
67
|
+
parseCommand(parser, prefix, campaignId) {
|
|
68
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
69
|
+
parser.pushKey(targetIndexKey(prefix, campaignId));
|
|
70
|
+
},
|
|
71
|
+
transformReply: undefined
|
|
72
|
+
},
|
|
73
|
+
update_target: {
|
|
74
|
+
NUMBER_OF_KEYS: 3,
|
|
75
|
+
parseCommand(parser, prefix, campaignId, targetId, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret) {
|
|
76
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
77
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
78
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
79
|
+
if (connectTimeout != null) {
|
|
80
|
+
parser.push('connect_timeout');
|
|
81
|
+
parser.push(connectTimeout.toString());
|
|
82
|
+
}
|
|
83
|
+
if (simpleTimeout != null) {
|
|
84
|
+
parser.push('simple_timeout');
|
|
85
|
+
parser.push(simpleTimeout.toString());
|
|
86
|
+
}
|
|
87
|
+
if (streamTimeout != null) {
|
|
88
|
+
parser.push('stream_timeout');
|
|
89
|
+
parser.push(streamTimeout.toString());
|
|
90
|
+
}
|
|
91
|
+
if (headersSizeLimit != null) {
|
|
92
|
+
parser.push('headers_size_limit');
|
|
93
|
+
parser.push(headersSizeLimit.toString());
|
|
94
|
+
}
|
|
95
|
+
if (bodySizeLimit != null) {
|
|
96
|
+
parser.push('body_size_limit');
|
|
97
|
+
parser.push(bodySizeLimit.toString());
|
|
98
|
+
}
|
|
99
|
+
if (mainPage != null) {
|
|
100
|
+
parser.push('main_page');
|
|
101
|
+
parser.push(mainPage);
|
|
102
|
+
}
|
|
103
|
+
if (notFoundPage != null) {
|
|
104
|
+
parser.push('not_found_page');
|
|
105
|
+
parser.push(notFoundPage);
|
|
106
|
+
}
|
|
107
|
+
if (faviconIco != null) {
|
|
108
|
+
parser.push('favicon_ico');
|
|
109
|
+
parser.push(faviconIco);
|
|
110
|
+
}
|
|
111
|
+
if (robotsTxt != null) {
|
|
112
|
+
parser.push('robots_txt');
|
|
113
|
+
parser.push(robotsTxt);
|
|
114
|
+
}
|
|
115
|
+
if (sitemapXml != null) {
|
|
116
|
+
parser.push('sitemap_xml');
|
|
117
|
+
parser.push(sitemapXml);
|
|
118
|
+
}
|
|
119
|
+
parser.push(lockSecret);
|
|
120
|
+
},
|
|
121
|
+
transformReply: undefined
|
|
122
|
+
},
|
|
123
|
+
enable_target: {
|
|
124
|
+
NUMBER_OF_KEYS: 3,
|
|
125
|
+
parseCommand(parser, prefix, campaignId, targetId, lockSecret) {
|
|
126
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
127
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
128
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
129
|
+
parser.push(lockSecret);
|
|
130
|
+
},
|
|
131
|
+
transformReply: undefined
|
|
132
|
+
},
|
|
133
|
+
disable_target: {
|
|
134
|
+
NUMBER_OF_KEYS: 3,
|
|
135
|
+
parseCommand(parser, prefix, campaignId, targetId, lockSecret) {
|
|
136
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
137
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
138
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
139
|
+
parser.push(lockSecret);
|
|
140
|
+
},
|
|
141
|
+
transformReply: undefined
|
|
142
|
+
},
|
|
143
|
+
append_target_label: {
|
|
144
|
+
NUMBER_OF_KEYS: 4,
|
|
145
|
+
parseCommand(parser, prefix, campaignId, targetId, label, lockSecret) {
|
|
146
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
147
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
148
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
149
|
+
parser.pushKey(targetLabelsKey(prefix, campaignId, targetId));
|
|
150
|
+
parser.push(label.toLowerCase());
|
|
151
|
+
parser.push(lockSecret);
|
|
152
|
+
},
|
|
153
|
+
transformReply: undefined
|
|
154
|
+
},
|
|
155
|
+
remove_target_label: {
|
|
156
|
+
NUMBER_OF_KEYS: 4,
|
|
157
|
+
parseCommand(parser, prefix, campaignId, targetId, label, lockSecret) {
|
|
158
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
159
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
160
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
161
|
+
parser.pushKey(targetLabelsKey(prefix, campaignId, targetId));
|
|
162
|
+
parser.push(label.toLowerCase());
|
|
163
|
+
parser.push(lockSecret);
|
|
164
|
+
},
|
|
165
|
+
transformReply: undefined
|
|
166
|
+
},
|
|
167
|
+
delete_target: {
|
|
168
|
+
NUMBER_OF_KEYS: 8,
|
|
169
|
+
parseCommand(parser, prefix, campaignId, targetId, lockSecret) {
|
|
170
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
171
|
+
parser.pushKey(campaignLockKey(prefix, campaignId));
|
|
172
|
+
parser.pushKey(targetKey(prefix, campaignId, targetId));
|
|
173
|
+
parser.pushKey(targetLabelsKey(prefix, campaignId, targetId));
|
|
174
|
+
parser.pushKey(targetUniqueDonorKey(prefix, campaignId));
|
|
175
|
+
parser.pushKey(targetUniqueMirrorKey(prefix, campaignId));
|
|
176
|
+
parser.pushKey(targetMirrorHostsKey(prefix));
|
|
177
|
+
parser.pushKey(targetIndexKey(prefix, campaignId));
|
|
178
|
+
parser.push(lockSecret);
|
|
179
|
+
},
|
|
180
|
+
transformReply: undefined
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
//# sourceMappingURL=target.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.functions.js","sourceRoot":"","sources":["../../../src/repositories/target/target.functions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,eAAe,EACf,cAAc,EACd,SAAS,EACT,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,wBAAwB,CAAA;AAiC/B,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE;QACN,aAAa,EAAE;YACb,cAAc,EAAE,CAAC;YAEjB,YAAY,CACV,MAAqB,EACrB,MAAc,EACd,UAAkB,EAClB,QAAgB,EAChB,SAAkB,EAClB,WAAoB,EACpB,QAAgB,EAChB,WAAmB,EACnB,SAAiB,EACjB,YAAqB,EACrB,SAAiB,EACjB,UAAkB,EAClB,cAAsB,EACtB,aAAqB,EACrB,aAAqB,EACrB,gBAAwB,EACxB,aAAqB,EACrB,QAAgB,EAChB,YAAoB,EACpB,UAAkB,EAClB,SAAiB,EACjB,UAAkB,EAClB,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,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sourceRoot":"","sources":["../../../src/repositories/target/target.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSONSchemaType, ValidatorSchemas } from '@famir/validator';
|
|
2
|
+
export declare const targetSchemas: ValidatorSchemas;
|
|
3
|
+
export declare const targetSubSchema: JSONSchemaType<string>;
|
|
4
|
+
export declare const targetDomainSchema: JSONSchemaType<string>;
|
|
5
|
+
export declare const targetPortSchema: JSONSchemaType<number>;
|
|
6
|
+
export declare const targetLabelSchema: JSONSchemaType<string>;
|
|
7
|
+
export declare const targetLabelsSchema: JSONSchemaType<string[]>;
|
|
8
|
+
export declare const targetConnectTimeoutSchema: JSONSchemaType<number>;
|
|
9
|
+
export declare const targetSimpleTimeoutSchema: JSONSchemaType<number>;
|
|
10
|
+
export declare const targetStreamTimeoutSchema: JSONSchemaType<number>;
|
|
11
|
+
export declare const targetHeadersSizeLimitSchema: JSONSchemaType<number>;
|
|
12
|
+
export declare const targetBodySizeLimitSchema: JSONSchemaType<number>;
|
|
13
|
+
export declare const targetContentSchema: JSONSchemaType<string>;
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
const rawTargetSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
required: [
|
|
4
|
+
'campaign_id',
|
|
5
|
+
'target_id',
|
|
6
|
+
'is_landing',
|
|
7
|
+
'donor_secure',
|
|
8
|
+
'donor_sub',
|
|
9
|
+
'donor_domain',
|
|
10
|
+
'donor_port',
|
|
11
|
+
'mirror_secure',
|
|
12
|
+
'mirror_sub',
|
|
13
|
+
'mirror_domain',
|
|
14
|
+
'mirror_port',
|
|
15
|
+
'labels',
|
|
16
|
+
'is_enabled',
|
|
17
|
+
'message_count',
|
|
18
|
+
'created_at'
|
|
19
|
+
],
|
|
20
|
+
properties: {
|
|
21
|
+
campaign_id: {
|
|
22
|
+
type: 'string'
|
|
23
|
+
},
|
|
24
|
+
target_id: {
|
|
25
|
+
type: 'string'
|
|
26
|
+
},
|
|
27
|
+
is_landing: {
|
|
28
|
+
type: 'integer'
|
|
29
|
+
},
|
|
30
|
+
donor_secure: {
|
|
31
|
+
type: 'integer'
|
|
32
|
+
},
|
|
33
|
+
donor_sub: {
|
|
34
|
+
type: 'string'
|
|
35
|
+
},
|
|
36
|
+
donor_domain: {
|
|
37
|
+
type: 'string'
|
|
38
|
+
},
|
|
39
|
+
donor_port: {
|
|
40
|
+
type: 'integer'
|
|
41
|
+
},
|
|
42
|
+
mirror_secure: {
|
|
43
|
+
type: 'integer'
|
|
44
|
+
},
|
|
45
|
+
mirror_sub: {
|
|
46
|
+
type: 'string'
|
|
47
|
+
},
|
|
48
|
+
mirror_domain: {
|
|
49
|
+
type: 'string'
|
|
50
|
+
},
|
|
51
|
+
mirror_port: {
|
|
52
|
+
type: 'integer'
|
|
53
|
+
},
|
|
54
|
+
labels: {
|
|
55
|
+
type: 'array',
|
|
56
|
+
items: {
|
|
57
|
+
type: 'string'
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
is_enabled: {
|
|
61
|
+
type: 'integer'
|
|
62
|
+
},
|
|
63
|
+
message_count: {
|
|
64
|
+
type: 'integer'
|
|
65
|
+
},
|
|
66
|
+
created_at: {
|
|
67
|
+
type: 'integer'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
additionalProperties: false
|
|
71
|
+
};
|
|
72
|
+
const rawFullTargetSchema = {
|
|
73
|
+
type: 'object',
|
|
74
|
+
required: [
|
|
75
|
+
'campaign_id',
|
|
76
|
+
'target_id',
|
|
77
|
+
'is_landing',
|
|
78
|
+
'donor_secure',
|
|
79
|
+
'donor_sub',
|
|
80
|
+
'donor_domain',
|
|
81
|
+
'donor_port',
|
|
82
|
+
'mirror_secure',
|
|
83
|
+
'mirror_sub',
|
|
84
|
+
'mirror_domain',
|
|
85
|
+
'mirror_port',
|
|
86
|
+
'labels',
|
|
87
|
+
'connect_timeout',
|
|
88
|
+
'simple_timeout',
|
|
89
|
+
'stream_timeout',
|
|
90
|
+
'headers_size_limit',
|
|
91
|
+
'body_size_limit',
|
|
92
|
+
'main_page',
|
|
93
|
+
'not_found_page',
|
|
94
|
+
'favicon_ico',
|
|
95
|
+
'robots_txt',
|
|
96
|
+
'sitemap_xml',
|
|
97
|
+
'is_enabled',
|
|
98
|
+
'message_count',
|
|
99
|
+
'created_at'
|
|
100
|
+
],
|
|
101
|
+
properties: {
|
|
102
|
+
campaign_id: {
|
|
103
|
+
type: 'string'
|
|
104
|
+
},
|
|
105
|
+
target_id: {
|
|
106
|
+
type: 'string'
|
|
107
|
+
},
|
|
108
|
+
is_landing: {
|
|
109
|
+
type: 'integer'
|
|
110
|
+
},
|
|
111
|
+
donor_secure: {
|
|
112
|
+
type: 'integer'
|
|
113
|
+
},
|
|
114
|
+
donor_sub: {
|
|
115
|
+
type: 'string'
|
|
116
|
+
},
|
|
117
|
+
donor_domain: {
|
|
118
|
+
type: 'string'
|
|
119
|
+
},
|
|
120
|
+
donor_port: {
|
|
121
|
+
type: 'integer'
|
|
122
|
+
},
|
|
123
|
+
mirror_secure: {
|
|
124
|
+
type: 'integer'
|
|
125
|
+
},
|
|
126
|
+
mirror_sub: {
|
|
127
|
+
type: 'string'
|
|
128
|
+
},
|
|
129
|
+
mirror_domain: {
|
|
130
|
+
type: 'string'
|
|
131
|
+
},
|
|
132
|
+
mirror_port: {
|
|
133
|
+
type: 'integer'
|
|
134
|
+
},
|
|
135
|
+
labels: {
|
|
136
|
+
type: 'array',
|
|
137
|
+
items: {
|
|
138
|
+
type: 'string'
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
connect_timeout: {
|
|
142
|
+
type: 'integer'
|
|
143
|
+
},
|
|
144
|
+
simple_timeout: {
|
|
145
|
+
type: 'integer'
|
|
146
|
+
},
|
|
147
|
+
stream_timeout: {
|
|
148
|
+
type: 'integer'
|
|
149
|
+
},
|
|
150
|
+
headers_size_limit: {
|
|
151
|
+
type: 'integer'
|
|
152
|
+
},
|
|
153
|
+
body_size_limit: {
|
|
154
|
+
type: 'integer'
|
|
155
|
+
},
|
|
156
|
+
main_page: {
|
|
157
|
+
type: 'string'
|
|
158
|
+
},
|
|
159
|
+
not_found_page: {
|
|
160
|
+
type: 'string'
|
|
161
|
+
},
|
|
162
|
+
favicon_ico: {
|
|
163
|
+
type: 'string'
|
|
164
|
+
},
|
|
165
|
+
robots_txt: {
|
|
166
|
+
type: 'string'
|
|
167
|
+
},
|
|
168
|
+
sitemap_xml: {
|
|
169
|
+
type: 'string'
|
|
170
|
+
},
|
|
171
|
+
is_enabled: {
|
|
172
|
+
type: 'integer'
|
|
173
|
+
},
|
|
174
|
+
message_count: {
|
|
175
|
+
type: 'integer'
|
|
176
|
+
},
|
|
177
|
+
created_at: {
|
|
178
|
+
type: 'integer'
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
additionalProperties: false
|
|
182
|
+
};
|
|
183
|
+
export const targetSchemas = {
|
|
184
|
+
'database-raw-target': rawTargetSchema,
|
|
185
|
+
'database-raw-full-target': rawFullTargetSchema
|
|
186
|
+
};
|
|
187
|
+
export const targetSubSchema = {
|
|
188
|
+
type: 'string',
|
|
189
|
+
minLength: 1,
|
|
190
|
+
maxLength: 128
|
|
191
|
+
};
|
|
192
|
+
export const targetDomainSchema = {
|
|
193
|
+
type: 'string',
|
|
194
|
+
minLength: 1,
|
|
195
|
+
maxLength: 128
|
|
196
|
+
};
|
|
197
|
+
export const targetPortSchema = {
|
|
198
|
+
type: 'number',
|
|
199
|
+
minimum: 0,
|
|
200
|
+
maximum: 65535
|
|
201
|
+
};
|
|
202
|
+
export const targetLabelSchema = {
|
|
203
|
+
type: 'string',
|
|
204
|
+
minLength: 3,
|
|
205
|
+
maxLength: 64
|
|
206
|
+
};
|
|
207
|
+
export const targetLabelsSchema = {
|
|
208
|
+
type: 'array',
|
|
209
|
+
items: targetLabelSchema
|
|
210
|
+
};
|
|
211
|
+
export const targetConnectTimeoutSchema = {
|
|
212
|
+
type: 'integer',
|
|
213
|
+
minimum: 1,
|
|
214
|
+
maximum: 60 * 1000
|
|
215
|
+
};
|
|
216
|
+
export const targetSimpleTimeoutSchema = {
|
|
217
|
+
type: 'integer',
|
|
218
|
+
minimum: 1,
|
|
219
|
+
maximum: 5 * 60 * 1000
|
|
220
|
+
};
|
|
221
|
+
export const targetStreamTimeoutSchema = {
|
|
222
|
+
type: 'integer',
|
|
223
|
+
minimum: 1,
|
|
224
|
+
maximum: 3600 * 1000
|
|
225
|
+
};
|
|
226
|
+
export const targetHeadersSizeLimitSchema = {
|
|
227
|
+
type: 'integer',
|
|
228
|
+
minimum: 1,
|
|
229
|
+
maximum: 1024 * 1024
|
|
230
|
+
};
|
|
231
|
+
export const targetBodySizeLimitSchema = {
|
|
232
|
+
type: 'integer',
|
|
233
|
+
minimum: 1,
|
|
234
|
+
maximum: 1024 * 1024 * 1024
|
|
235
|
+
};
|
|
236
|
+
export const targetContentSchema = {
|
|
237
|
+
type: 'string',
|
|
238
|
+
minLength: 0,
|
|
239
|
+
maxLength: 10 * 1024 * 1024
|
|
240
|
+
};
|
|
241
|
+
//# sourceMappingURL=target.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.schemas.js","sourceRoot":"","sources":["../../../src/repositories/target/target.schemas.ts"],"names":[],"mappings":"AAGA,MAAM,eAAe,GAA8B;IACjD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,aAAa;QACb,WAAW;QACX,YAAY;QACZ,cAAc;QACd,WAAW;QACX,cAAc;QACd,YAAY;QACZ,eAAe;QACf,YAAY;QACZ,eAAe;QACf,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,eAAe;QACf,YAAY;KACb;IACD,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;SACf;QACD,UAA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V,MAAM,CAAC,MAAM,mBAAmB,GAA2B;IACzD,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;CACnB,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@famir/database",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"description": "Famir database module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"famir",
|
|
8
|
+
"fake-mirrors",
|
|
9
|
+
"man-in-the-middle",
|
|
10
|
+
"phishing",
|
|
11
|
+
"reverse-proxy"
|
|
12
|
+
],
|
|
13
|
+
"author": "Dmitry Krutikov <d.krutikov@gmail.com>",
|
|
14
|
+
"license": "Apache-2.0",
|
|
15
|
+
"main": "dist/index.js",
|
|
16
|
+
"types": "dist/index.d.ts",
|
|
17
|
+
"scripts": {
|
|
18
|
+
"format": "prettier -w \"src/**/*.ts\"",
|
|
19
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
20
|
+
"test": "node --test dist/**/*.test.js",
|
|
21
|
+
"stylua": "stylua redis-functions",
|
|
22
|
+
"selene": "selene redis-functions",
|
|
23
|
+
"prebuild": "./generate-redis-functions.sh",
|
|
24
|
+
"build": "tsc -b"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/bitnoize/famir.git",
|
|
33
|
+
"directory": "packages/database"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/bitnoize/famir/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/bitnoize/famir",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@famir/common": "*",
|
|
41
|
+
"@famir/config": "*",
|
|
42
|
+
"@famir/logger": "*",
|
|
43
|
+
"@famir/validator": "*",
|
|
44
|
+
"redis": "^5.11.0"
|
|
45
|
+
}
|
|
46
|
+
}
|