@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,35 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export interface RawSession {
|
|
3
|
+
campaign_id: string;
|
|
4
|
+
session_id: string;
|
|
5
|
+
proxy_id: string;
|
|
6
|
+
secret: string;
|
|
7
|
+
is_landing: number;
|
|
8
|
+
message_count: number;
|
|
9
|
+
created_at: number;
|
|
10
|
+
last_auth_at: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const sessionFunctions: {
|
|
13
|
+
readonly session: {
|
|
14
|
+
readonly create_session: {
|
|
15
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
16
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, sessionId: string, secret: string) => void;
|
|
17
|
+
readonly transformReply: () => unknown;
|
|
18
|
+
};
|
|
19
|
+
readonly read_session: {
|
|
20
|
+
readonly NUMBER_OF_KEYS: 2;
|
|
21
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, sessionId: string) => void;
|
|
22
|
+
readonly transformReply: () => unknown;
|
|
23
|
+
};
|
|
24
|
+
readonly auth_session: {
|
|
25
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
26
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, sessionId: string) => void;
|
|
27
|
+
readonly transformReply: () => unknown;
|
|
28
|
+
};
|
|
29
|
+
readonly upgrade_session: {
|
|
30
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
31
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, lureId: string, sessionId: string, secret: string) => void;
|
|
32
|
+
readonly transformReply: () => unknown;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { campaignKey, enabledProxyIndexKey, lureKey, sessionKey } from '../../database.keys.js';
|
|
2
|
+
export const sessionFunctions = {
|
|
3
|
+
session: {
|
|
4
|
+
create_session: {
|
|
5
|
+
NUMBER_OF_KEYS: 3,
|
|
6
|
+
parseCommand(parser, prefix, campaignId, sessionId, secret) {
|
|
7
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
8
|
+
parser.pushKey(sessionKey(prefix, campaignId, sessionId));
|
|
9
|
+
parser.pushKey(enabledProxyIndexKey(prefix, campaignId));
|
|
10
|
+
parser.push(campaignId);
|
|
11
|
+
parser.push(sessionId);
|
|
12
|
+
parser.push(secret);
|
|
13
|
+
parser.push(Date.now().toString());
|
|
14
|
+
},
|
|
15
|
+
transformReply: undefined
|
|
16
|
+
},
|
|
17
|
+
read_session: {
|
|
18
|
+
NUMBER_OF_KEYS: 2,
|
|
19
|
+
parseCommand(parser, prefix, campaignId, sessionId) {
|
|
20
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
21
|
+
parser.pushKey(sessionKey(prefix, campaignId, sessionId));
|
|
22
|
+
},
|
|
23
|
+
transformReply: undefined
|
|
24
|
+
},
|
|
25
|
+
auth_session: {
|
|
26
|
+
NUMBER_OF_KEYS: 3,
|
|
27
|
+
parseCommand(parser, prefix, campaignId, sessionId) {
|
|
28
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
29
|
+
parser.pushKey(sessionKey(prefix, campaignId, sessionId));
|
|
30
|
+
parser.pushKey(enabledProxyIndexKey(prefix, campaignId));
|
|
31
|
+
parser.push(Date.now().toString());
|
|
32
|
+
},
|
|
33
|
+
transformReply: undefined
|
|
34
|
+
},
|
|
35
|
+
upgrade_session: {
|
|
36
|
+
NUMBER_OF_KEYS: 3,
|
|
37
|
+
parseCommand(parser, prefix, campaignId, lureId, sessionId, secret) {
|
|
38
|
+
parser.pushKey(campaignKey(prefix, campaignId));
|
|
39
|
+
parser.pushKey(lureKey(prefix, campaignId, lureId));
|
|
40
|
+
parser.pushKey(sessionKey(prefix, campaignId, sessionId));
|
|
41
|
+
parser.push(secret);
|
|
42
|
+
},
|
|
43
|
+
transformReply: undefined
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=session.functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.functions.js","sourceRoot":"","sources":["../../../src/repositories/session/session.functions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAa/F,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,MAAc;gBAEd,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAC/C,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MA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ACf,cAAc,EAAE,CAAC;YAEjB,YAAY,CACV,MAAqB,EACrB,MAAc,EACd,UAAkB,EAClB,MAAc,EACd,SAAiB,EACjB,MAAc;gBAEd,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAA;gBAC/C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;gBACnD,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC,CAAA;gBAEzD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YACrB,CAAC;YAED,cAAc,EAAE,SAAqC;SACtD;KACF;CACO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/repositories/session/session.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const rawSessionSchema = {
|
|
2
|
+
type: 'object',
|
|
3
|
+
required: [
|
|
4
|
+
'campaign_id',
|
|
5
|
+
'session_id',
|
|
6
|
+
'proxy_id',
|
|
7
|
+
'secret',
|
|
8
|
+
'is_landing',
|
|
9
|
+
'message_count',
|
|
10
|
+
'created_at',
|
|
11
|
+
'last_auth_at'
|
|
12
|
+
],
|
|
13
|
+
properties: {
|
|
14
|
+
campaign_id: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
},
|
|
17
|
+
session_id: {
|
|
18
|
+
type: 'string'
|
|
19
|
+
},
|
|
20
|
+
proxy_id: {
|
|
21
|
+
type: 'string'
|
|
22
|
+
},
|
|
23
|
+
secret: {
|
|
24
|
+
type: 'string'
|
|
25
|
+
},
|
|
26
|
+
is_landing: {
|
|
27
|
+
type: 'integer'
|
|
28
|
+
},
|
|
29
|
+
message_count: {
|
|
30
|
+
type: 'integer'
|
|
31
|
+
},
|
|
32
|
+
created_at: {
|
|
33
|
+
type: 'integer'
|
|
34
|
+
},
|
|
35
|
+
last_auth_at: {
|
|
36
|
+
type: 'integer'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
additionalProperties: false
|
|
40
|
+
};
|
|
41
|
+
export const sessionSchemas = {
|
|
42
|
+
'database-raw-session': rawSessionSchema
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=session.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.schemas.js","sourceRoot":"","sources":["../../../src/repositories/session/session.schemas.ts"],"names":[],"mappings":"AAGA,MAAM,gBAAgB,GAA+B;IACnD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,aAAa;QACb,YAAY;QACZ,UAAU;QACV,QAAQ;QACR,YAAY;QACZ,eAAe;QACf,YAAY;QACZ,cAAc;KACf;IACD,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;SACf;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,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;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,SAAS;SAChB;KACF;IACD,oBAAoB,EAAE,KAAK;CACnB,CAAA;AAEV,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C,sBAAsB,EAAE,gBAAgB;CAChC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/repositories/target/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAA;AAC5C,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DIContainer } from '@famir/common';
|
|
2
|
+
import { Config } from '@famir/config';
|
|
3
|
+
import { Logger } from '@famir/logger';
|
|
4
|
+
import { Validator } from '@famir/validator';
|
|
5
|
+
import { RedisDatabaseConfig, RedisDatabaseConnection } from '../../database.js';
|
|
6
|
+
import { FullTargetModel, TargetModel } from '../../models/index.js';
|
|
7
|
+
import { RedisBaseRepository } from '../base/index.js';
|
|
8
|
+
import { TargetRepository } from './target.js';
|
|
9
|
+
export declare class RedisTargetRepository extends RedisBaseRepository implements TargetRepository {
|
|
10
|
+
static inject(container: DIContainer): void;
|
|
11
|
+
constructor(validator: Validator, config: Config<RedisDatabaseConfig>, logger: Logger, connection: RedisDatabaseConnection);
|
|
12
|
+
create(campaignId: string, targetId: string, isLanding: boolean, donorSecure: boolean, donorSub: string, donorDomain: string, donorPort: number, mirrorSecure: boolean, mirrorSub: string, mirrorPort: number, connectTimeout: number, simpleTimeout: number, streamTimeout: number, headersSizeLimit: number, bodySizeLimit: number, mainPage: string, notFoundPage: string, faviconIco: string, robotsTxt: string, sitemapXml: string, lockSecret: string): Promise<void>;
|
|
13
|
+
read(campaignId: string, targetId: string): Promise<TargetModel | null>;
|
|
14
|
+
readFull(campaignId: string, targetId: string): Promise<FullTargetModel | null>;
|
|
15
|
+
find(mirrorHost: string): Promise<TargetModel | null>;
|
|
16
|
+
findFull(mirrorHost: string): Promise<FullTargetModel | null>;
|
|
17
|
+
update(campaignId: string, targetId: string, connectTimeout: number | null | undefined, simpleTimeout: number | null | undefined, streamTimeout: number | null | undefined, headersSizeLimit: number | null | undefined, bodySizeLimit: number | null | undefined, mainPage: string | null | undefined, notFoundPage: string | null | undefined, faviconIco: string | null | undefined, robotsTxt: string | null | undefined, sitemapXml: string | null | undefined, lockSecret: string): Promise<void>;
|
|
18
|
+
enable(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
19
|
+
disable(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
20
|
+
appendLabel(campaignId: string, targetId: string, label: string, lockSecret: string): Promise<void>;
|
|
21
|
+
removeLabel(campaignId: string, targetId: string, label: string, lockSecret: string): Promise<void>;
|
|
22
|
+
delete(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
23
|
+
list(campaignId: string): Promise<TargetModel[] | null>;
|
|
24
|
+
listFull(campaignId: string): Promise<FullTargetModel[] | null>;
|
|
25
|
+
protected buildModel(rawModel: unknown): TargetModel | null;
|
|
26
|
+
protected buildFullModel(rawModel: unknown): FullTargetModel | null;
|
|
27
|
+
protected buildCollection(rawCollection: unknown): TargetModel[];
|
|
28
|
+
protected buildFullCollection(rawCollection: unknown): FullTargetModel[];
|
|
29
|
+
protected buildTargetLink(value: unknown): [string, string];
|
|
30
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { CONFIG } from '@famir/config';
|
|
2
|
+
import { LOGGER } from '@famir/logger';
|
|
3
|
+
import { VALIDATOR } from '@famir/validator';
|
|
4
|
+
import { DatabaseError } from '../../database.error.js';
|
|
5
|
+
import { DATABASE_CONNECTOR } from '../../database.js';
|
|
6
|
+
import { FullTargetModel, TargetModel } from '../../models/index.js';
|
|
7
|
+
import { RedisBaseRepository } from '../base/index.js';
|
|
8
|
+
import { TARGET_REPOSITORY } from './target.js';
|
|
9
|
+
import { targetSchemas } from './target.schemas.js';
|
|
10
|
+
export class RedisTargetRepository extends RedisBaseRepository {
|
|
11
|
+
static inject(container) {
|
|
12
|
+
container.registerSingleton(TARGET_REPOSITORY, (c) => new RedisTargetRepository(c.resolve(VALIDATOR), c.resolve(CONFIG), c.resolve(LOGGER), c.resolve(DATABASE_CONNECTOR).connection()));
|
|
13
|
+
}
|
|
14
|
+
constructor(validator, config, logger, connection) {
|
|
15
|
+
super(validator, config, logger, connection, 'target');
|
|
16
|
+
this.validator.addSchemas(targetSchemas);
|
|
17
|
+
this.logger.debug(`TargetRepository initialized`);
|
|
18
|
+
}
|
|
19
|
+
async create(campaignId, targetId, isLanding, donorSecure, donorSub, donorDomain, donorPort, mirrorSecure, mirrorSub, mirrorPort, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret) {
|
|
20
|
+
try {
|
|
21
|
+
const statusReply = await this.connection.target.create_target(this.options.prefix, campaignId, targetId, isLanding, donorSecure, donorSub, donorDomain, donorPort, mirrorSecure, mirrorSub, mirrorPort, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret);
|
|
22
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
23
|
+
this.logger.info(mesg, { target: { campaignId, targetId } });
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
this.raiseError(error, 'create', { campaignId, targetId });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async read(campaignId, targetId) {
|
|
30
|
+
try {
|
|
31
|
+
const rawModel = await this.connection.target.read_target(this.options.prefix, campaignId, targetId);
|
|
32
|
+
return this.buildModel(rawModel);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.raiseError(error, 'read', { campaignId, targetId });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async readFull(campaignId, targetId) {
|
|
39
|
+
try {
|
|
40
|
+
const rawModel = await this.connection.target.read_full_target(this.options.prefix, campaignId, targetId);
|
|
41
|
+
return this.buildFullModel(rawModel);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
this.raiseError(error, 'readFull', { campaignId, targetId });
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async find(mirrorHost) {
|
|
48
|
+
try {
|
|
49
|
+
const targetLink = await this.connection.target.find_target_link(this.options.prefix, mirrorHost);
|
|
50
|
+
if (targetLink === null) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const [campaignId, targetId] = this.buildTargetLink(targetLink);
|
|
54
|
+
const rawModel = await this.connection.target.read_target(this.options.prefix, campaignId, targetId);
|
|
55
|
+
return this.buildModel(rawModel);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.raiseError(error, 'find', { mirrorHost });
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
async findFull(mirrorHost) {
|
|
62
|
+
try {
|
|
63
|
+
const targetLink = await this.connection.target.find_target_link(this.options.prefix, mirrorHost);
|
|
64
|
+
if (targetLink === null) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const [campaignId, targetId] = this.buildTargetLink(targetLink);
|
|
68
|
+
const rawModel = await this.connection.target.read_full_target(this.options.prefix, campaignId, targetId);
|
|
69
|
+
return this.buildFullModel(rawModel);
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
this.raiseError(error, 'findFull', { mirrorHost });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async update(campaignId, targetId, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret) {
|
|
76
|
+
try {
|
|
77
|
+
const statusReply = await this.connection.target.update_target(this.options.prefix, campaignId, targetId, connectTimeout, simpleTimeout, streamTimeout, headersSizeLimit, bodySizeLimit, mainPage, notFoundPage, faviconIco, robotsTxt, sitemapXml, lockSecret);
|
|
78
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
79
|
+
this.logger.info(mesg, { target: { campaignId, targetId } });
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
this.raiseError(error, 'update', { campaignId, targetId });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async enable(campaignId, targetId, lockSecret) {
|
|
86
|
+
try {
|
|
87
|
+
const statusReply = await this.connection.target.enable_target(this.options.prefix, campaignId, targetId, lockSecret);
|
|
88
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
89
|
+
this.logger.info(mesg, { target: { campaignId, targetId } });
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
this.raiseError(error, 'enable', { campaignId, targetId });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async disable(campaignId, targetId, lockSecret) {
|
|
96
|
+
try {
|
|
97
|
+
const statusReply = await this.connection.target.disable_target(this.options.prefix, campaignId, targetId, lockSecret);
|
|
98
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
99
|
+
this.logger.info(mesg, { target: { campaignId, targetId } });
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
this.raiseError(error, 'disable', { campaignId, targetId });
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async appendLabel(campaignId, targetId, label, lockSecret) {
|
|
106
|
+
try {
|
|
107
|
+
const statusReply = await this.connection.target.append_target_label(this.options.prefix, campaignId, targetId, label, lockSecret);
|
|
108
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
109
|
+
this.logger.info(mesg, { target: { campaignId, targetId, label } });
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
this.raiseError(error, 'appendLabel', { campaignId, targetId, label });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async removeLabel(campaignId, targetId, label, lockSecret) {
|
|
116
|
+
try {
|
|
117
|
+
const statusReply = await this.connection.target.remove_target_label(this.options.prefix, campaignId, targetId, label, lockSecret);
|
|
118
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
119
|
+
this.logger.info(mesg, { target: { campaignId, targetId, label } });
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
this.raiseError(error, 'removeLabel', { campaignId, targetId, label });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async delete(campaignId, targetId, lockSecret) {
|
|
126
|
+
try {
|
|
127
|
+
const statusReply = await this.connection.target.delete_target(this.options.prefix, campaignId, targetId, lockSecret);
|
|
128
|
+
const mesg = this.handleStatusReply(statusReply);
|
|
129
|
+
this.logger.info(mesg, { target: { campaignId, targetId } });
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
this.raiseError(error, 'delete', { campaignId, targetId });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
async list(campaignId) {
|
|
136
|
+
try {
|
|
137
|
+
const index = await this.connection.target.read_target_index(this.options.prefix, campaignId);
|
|
138
|
+
if (index === null) {
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
this.validateArrayStringsReply(index);
|
|
142
|
+
const rawCollection = await Promise.all(index.map((targetId) => this.connection.target.read_target(this.options.prefix, campaignId, targetId)));
|
|
143
|
+
return this.buildCollection(rawCollection);
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
this.raiseError(error, 'list', { campaignId });
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async listFull(campaignId) {
|
|
150
|
+
try {
|
|
151
|
+
const index = await this.connection.target.read_target_index(this.options.prefix, campaignId);
|
|
152
|
+
if (index === null) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
this.validateArrayStringsReply(index);
|
|
156
|
+
const rawCollection = await Promise.all(index.map((targetId) => this.connection.target.read_full_target(this.options.prefix, campaignId, targetId)));
|
|
157
|
+
return this.buildFullCollection(rawCollection);
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
this.raiseError(error, 'listFull', { campaignId });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
buildModel(rawModel) {
|
|
164
|
+
if (rawModel === null) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
this.validateRawData('database-raw-target', rawModel);
|
|
168
|
+
return new TargetModel(rawModel.campaign_id, rawModel.target_id, !!rawModel.is_landing, !!rawModel.donor_secure, rawModel.donor_sub, rawModel.donor_domain, rawModel.donor_port, !!rawModel.mirror_secure, rawModel.mirror_sub, rawModel.mirror_domain, rawModel.mirror_port, rawModel.labels, !!rawModel.is_enabled, rawModel.message_count, new Date(rawModel.created_at));
|
|
169
|
+
}
|
|
170
|
+
buildFullModel(rawModel) {
|
|
171
|
+
if (rawModel === null) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
this.validateRawData('database-raw-full-target', rawModel);
|
|
175
|
+
return new FullTargetModel(rawModel.campaign_id, rawModel.target_id, !!rawModel.is_landing, !!rawModel.donor_secure, rawModel.donor_sub, rawModel.donor_domain, rawModel.donor_port, !!rawModel.mirror_secure, rawModel.mirror_sub, rawModel.mirror_domain, rawModel.mirror_port, rawModel.labels, rawModel.connect_timeout, rawModel.simple_timeout, rawModel.stream_timeout, rawModel.headers_size_limit, rawModel.body_size_limit, rawModel.main_page, rawModel.not_found_page, rawModel.favicon_ico, rawModel.robots_txt, rawModel.sitemap_xml, !!rawModel.is_enabled, rawModel.message_count, new Date(rawModel.created_at));
|
|
176
|
+
}
|
|
177
|
+
buildCollection(rawCollection) {
|
|
178
|
+
this.validateArrayReply(rawCollection);
|
|
179
|
+
return rawCollection.map((rawModel) => this.buildModel(rawModel)).filter(TargetModel.isNotNull);
|
|
180
|
+
}
|
|
181
|
+
buildFullCollection(rawCollection) {
|
|
182
|
+
this.validateArrayReply(rawCollection);
|
|
183
|
+
return rawCollection
|
|
184
|
+
.map((rawModel) => this.buildFullModel(rawModel))
|
|
185
|
+
.filter(TargetModel.isNotNull);
|
|
186
|
+
}
|
|
187
|
+
buildTargetLink(value) {
|
|
188
|
+
this.validateArrayStringsReply(value);
|
|
189
|
+
const [campaignId, targetId] = value;
|
|
190
|
+
if (!(campaignId && targetId)) {
|
|
191
|
+
throw new DatabaseError(`TargetLink validate failed`, {
|
|
192
|
+
code: 'INTERNAL_ERROR'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
return [campaignId, targetId];
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=redis-target.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-target.repository.js","sourceRoot":"","sources":["../../../src/repositories/target/redis-target.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,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EACL,kBAAkB,EAInB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,iBAAiB,EAAoB,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,OAAO,qBAAsB,SAAQ,mBAAmB;IAC5D,MAAM,CAAC,MAAM,CAAC,SAAsB;QAClC,SAAS,CAAC,iBAAiB,CACzB,iBAAiB,EACjB,CAAC,CAAC,EAAE,EAAE,CACJ,IAAI,qBAAqB,CACvB,CAAC,CAAC,OAAO,CAAY,SAAS,CAAC,EAC/B,CAAC,CAAC,OAAO,CAA8B,MAAM,CAAC,EAC9C,CAAC,CAAC,OAAO,CAAS,MAAM,CAAC,EACzB,CAAC,CAAC,OAAO,CAAoB,kBAAkB,CAAC,CAAC,UAAU,EAA2B,CACvF,CACJ,CAAA;IACH,CAAC;IAED,YACE,SAAoB,EACpB,MAAmC,EACnC,MAAc,EACd,UAAmC;QAEnC,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;QAEtD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;QAExC,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D,IAAI,EAAE,gBAAgB;aACvB,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAC/B,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FullTargetModel, TargetModel } from '../../models/index.js';
|
|
2
|
+
export declare const TARGET_REPOSITORY: unique symbol;
|
|
3
|
+
export interface TargetRepository {
|
|
4
|
+
create(campaignId: string, targetId: string, isLanding: boolean, donorSecure: boolean, donorSub: string, donorDomain: string, donorPort: number, mirrorSecure: boolean, mirrorSub: string, mirrorPort: number, connectTimeout: number, simpleTimeout: number, streamTimeout: number, headersSizeLimit: number, bodySizeLimit: number, mainPage: string, notFoundPage: string, faviconIco: string, robotsTxt: string, sitemapXml: string, lockSecret: string): Promise<void>;
|
|
5
|
+
read(campaignId: string, targetId: string): Promise<TargetModel | null>;
|
|
6
|
+
readFull(campaignId: string, targetId: string): Promise<FullTargetModel | null>;
|
|
7
|
+
find(mirrorHost: string): Promise<TargetModel | null>;
|
|
8
|
+
findFull(mirrorHost: string): Promise<FullTargetModel | null>;
|
|
9
|
+
update(campaignId: string, targetId: string, connectTimeout: number | null | undefined, simpleTimeout: number | null | undefined, streamTimeout: number | null | undefined, headersSizeLimit: number | null | undefined, bodySizeLimit: number | null | undefined, mainPage: string | null | undefined, notFoundPage: string | null | undefined, faviconIco: string | null | undefined, robotsTxt: string | null | undefined, sitemapXml: string | null | undefined, lockSecret: string): Promise<void>;
|
|
10
|
+
enable(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
11
|
+
disable(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
12
|
+
appendLabel(campaignId: string, targetId: string, label: string, lockSecret: string): Promise<void>;
|
|
13
|
+
removeLabel(campaignId: string, targetId: string, label: string, lockSecret: string): Promise<void>;
|
|
14
|
+
delete(campaignId: string, targetId: string, lockSecret: string): Promise<void>;
|
|
15
|
+
list(campaignId: string): Promise<TargetModel[] | null>;
|
|
16
|
+
listFull(campaignId: string): Promise<FullTargetModel[] | null>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { CommandParser } from '@redis/client';
|
|
2
|
+
export interface RawTarget {
|
|
3
|
+
campaign_id: string;
|
|
4
|
+
target_id: string;
|
|
5
|
+
is_landing: number;
|
|
6
|
+
donor_secure: number;
|
|
7
|
+
donor_sub: string;
|
|
8
|
+
donor_domain: string;
|
|
9
|
+
donor_port: number;
|
|
10
|
+
mirror_secure: number;
|
|
11
|
+
mirror_sub: string;
|
|
12
|
+
mirror_domain: string;
|
|
13
|
+
mirror_port: number;
|
|
14
|
+
labels: string[];
|
|
15
|
+
is_enabled: number;
|
|
16
|
+
message_count: number;
|
|
17
|
+
created_at: number;
|
|
18
|
+
}
|
|
19
|
+
export interface RawFullTarget extends RawTarget {
|
|
20
|
+
connect_timeout: number;
|
|
21
|
+
simple_timeout: number;
|
|
22
|
+
stream_timeout: number;
|
|
23
|
+
headers_size_limit: number;
|
|
24
|
+
body_size_limit: number;
|
|
25
|
+
main_page: string;
|
|
26
|
+
not_found_page: string;
|
|
27
|
+
favicon_ico: string;
|
|
28
|
+
robots_txt: string;
|
|
29
|
+
sitemap_xml: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const targetFunctions: {
|
|
32
|
+
readonly target: {
|
|
33
|
+
readonly create_target: {
|
|
34
|
+
readonly NUMBER_OF_KEYS: 7;
|
|
35
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, isLanding: boolean, donorSecure: boolean, donorSub: string, donorDomain: string, donorPort: number, mirrorSecure: boolean, mirrorSub: string, mirrorPort: number, connectTimeout: number, simpleTimeout: number, streamTimeout: number, headersSizeLimit: number, bodySizeLimit: number, mainPage: string, notFoundPage: string, faviconIco: string, robotsTxt: string, sitemapXml: string, lockSecret: string) => void;
|
|
36
|
+
readonly transformReply: () => unknown;
|
|
37
|
+
};
|
|
38
|
+
readonly read_target: {
|
|
39
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
40
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string) => void;
|
|
41
|
+
readonly transformReply: () => unknown;
|
|
42
|
+
};
|
|
43
|
+
readonly read_full_target: {
|
|
44
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
45
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string) => void;
|
|
46
|
+
readonly transformReply: () => unknown;
|
|
47
|
+
};
|
|
48
|
+
readonly find_target_link: {
|
|
49
|
+
readonly NUMBER_OF_KEYS: 1;
|
|
50
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, mirrorHost: string) => void;
|
|
51
|
+
readonly transformReply: () => unknown;
|
|
52
|
+
};
|
|
53
|
+
readonly read_target_index: {
|
|
54
|
+
readonly NUMBER_OF_KEYS: 2;
|
|
55
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string) => void;
|
|
56
|
+
readonly transformReply: () => unknown;
|
|
57
|
+
};
|
|
58
|
+
readonly update_target: {
|
|
59
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
60
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, connectTimeout: number | null | undefined, simpleTimeout: number | null | undefined, streamTimeout: number | null | undefined, headersSizeLimit: number | null | undefined, bodySizeLimit: number | null | undefined, mainPage: string | null | undefined, notFoundPage: string | null | undefined, faviconIco: string | null | undefined, robotsTxt: string | null | undefined, sitemapXml: string | null | undefined, lockSecret: string) => void;
|
|
61
|
+
readonly transformReply: () => unknown;
|
|
62
|
+
};
|
|
63
|
+
readonly enable_target: {
|
|
64
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
65
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, lockSecret: string) => void;
|
|
66
|
+
readonly transformReply: () => unknown;
|
|
67
|
+
};
|
|
68
|
+
readonly disable_target: {
|
|
69
|
+
readonly NUMBER_OF_KEYS: 3;
|
|
70
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, lockSecret: string) => void;
|
|
71
|
+
readonly transformReply: () => unknown;
|
|
72
|
+
};
|
|
73
|
+
readonly append_target_label: {
|
|
74
|
+
readonly NUMBER_OF_KEYS: 4;
|
|
75
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, label: string, lockSecret: string) => void;
|
|
76
|
+
readonly transformReply: () => unknown;
|
|
77
|
+
};
|
|
78
|
+
readonly remove_target_label: {
|
|
79
|
+
readonly NUMBER_OF_KEYS: 4;
|
|
80
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, label: string, lockSecret: string) => void;
|
|
81
|
+
readonly transformReply: () => unknown;
|
|
82
|
+
};
|
|
83
|
+
readonly delete_target: {
|
|
84
|
+
readonly NUMBER_OF_KEYS: 8;
|
|
85
|
+
readonly parseCommand: (parser: CommandParser, prefix: string, campaignId: string, targetId: string, lockSecret: string) => void;
|
|
86
|
+
readonly transformReply: () => unknown;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|