@studyportals/campaign-management-api-interface 0.12.0 → 0.13.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/.vscode/launch.json +36 -0
- package/.vscode/settings.json +4 -0
- package/.vscode/tasks.json +41 -0
- package/README.md +2 -0
- package/{index.d.ts → index.ts} +21 -1
- package/jest.config.single-file.json +20 -0
- package/jest.config.unit.json +19 -0
- package/package.json +2 -2
- package/src/auditor-campaign-management-api.client.ts +54 -0
- package/src/campaign-management-api.client.ts +68 -0
- package/src/domain/auditor/campaigns/geotargeting.entities.ts +20 -0
- package/src/domain/auditor/enums/auditor-entity-type.enum.ts +3 -0
- package/src/domain/auditor/enums/{auditor-operation.enum.d.ts → auditor-operation.enum.ts} +2 -2
- package/src/domain/auditor/get-auditor.dto.ts +33 -0
- package/src/domain/campaign/CampaignsEntitiesConfig.dto.ts +7 -0
- package/src/private-campaign-management-api.client.ts +80 -0
- package/tests-u/domain/auditor/auditor-campaign-management-api-client.test.ts +99 -0
- package/tests-u/domain/auditor/enums/auditor-entity-type-enum.test.ts +22 -0
- package/tests-u/domain/auditor/enums/auditor-operation-enum.test.ts +34 -0
- package/tests-u/domain/auditor/get-auditor-entity.test.ts +34 -0
- package/tests-u/domain/campaign/campaign-management-api-client.test.ts +111 -0
- package/tests-u/domain/campaign/private-campaign-management-api-client.test.ts +114 -0
- package/tsconfig.json +39 -0
- package/index.js +0 -20
- package/index.js.map +0 -1
- package/src/auditor-campaign-management-api.client.d.ts +0 -12
- package/src/auditor-campaign-management-api.client.js +0 -56
- package/src/auditor-campaign-management-api.client.js.map +0 -1
- package/src/campaign-management-api.client.d.ts +0 -13
- package/src/campaign-management-api.client.js +0 -68
- package/src/campaign-management-api.client.js.map +0 -1
- package/src/domain/auditor/campaigns/geotargeting.entities.d.ts +0 -14
- package/src/domain/auditor/campaigns/geotargeting.entities.js +0 -11
- package/src/domain/auditor/campaigns/geotargeting.entities.js.map +0 -1
- package/src/domain/auditor/enums/auditor-entity-type.enum.d.ts +0 -3
- package/src/domain/auditor/enums/auditor-entity-type.enum.js +0 -8
- package/src/domain/auditor/enums/auditor-entity-type.enum.js.map +0 -1
- package/src/domain/auditor/enums/auditor-operation.enum.js +0 -14
- package/src/domain/auditor/enums/auditor-operation.enum.js.map +0 -1
- package/src/domain/auditor/get-auditor.dto.d.ts +0 -13
- package/src/domain/auditor/get-auditor.dto.js +0 -17
- package/src/domain/auditor/get-auditor.dto.js.map +0 -1
- package/src/domain/campaign/CampaignsEntitiesConfig.dto.d.ts +0 -7
- package/src/domain/campaign/CampaignsEntitiesConfig.dto.js +0 -10
- package/src/domain/campaign/CampaignsEntitiesConfig.dto.js.map +0 -1
- package/src/private-campaign-management-api.client.d.ts +0 -18
- package/src/private-campaign-management-api.client.js +0 -79
- package/src/private-campaign-management-api.client.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { suite, test } from "@testdeck/jest";
|
|
2
|
+
import { MockProxy, mock } from "jest-mock-extended";
|
|
3
|
+
import { assert } from "chai";
|
|
4
|
+
import { ISuperAgentRequestFactory } from "@studyportals/mb-platform-http-requests";
|
|
5
|
+
import { SuperAgentRequest } from "superagent";
|
|
6
|
+
import * as superagent from "superagent";
|
|
7
|
+
import { CampaignManagementAPIClient } from "../../../src/campaign-management-api.client";
|
|
8
|
+
import { CampaignsEntitiesConfigDto } from "../../../src/domain/campaign/CampaignsEntitiesConfig.dto";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const superagentMock = require("superagent-mocker")(superagent);
|
|
12
|
+
|
|
13
|
+
@suite
|
|
14
|
+
class CampaignManagementAPIClientTest {
|
|
15
|
+
private campaignManagementAPIClient: CampaignManagementAPIClient;
|
|
16
|
+
private mockedRequest: MockProxy<SuperAgentRequest> = mock<SuperAgentRequest>();
|
|
17
|
+
private mockedSuperAgentRequestFactory: MockProxy<ISuperAgentRequestFactory> = mock<ISuperAgentRequestFactory>();
|
|
18
|
+
private mockedBaseUrl = "SomeBaseUrl";
|
|
19
|
+
|
|
20
|
+
public before() {
|
|
21
|
+
this.mockedSuperAgentRequestFactory.post.mockReturnValue(this.mockedRequest);
|
|
22
|
+
|
|
23
|
+
this.campaignManagementAPIClient = new CampaignManagementAPIClient(this.mockedBaseUrl);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@test()
|
|
27
|
+
public async addCampaignsEntitiesConfigs__CorrectlyCalled() {
|
|
28
|
+
const postData: CampaignsEntitiesConfigDto = {
|
|
29
|
+
campaign_id: 1,
|
|
30
|
+
sp_id: 1,
|
|
31
|
+
product_id: 12,
|
|
32
|
+
product2_id: null,
|
|
33
|
+
type: "study"
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
superagentMock.post(`${this.mockedBaseUrl}/campaigns/add-campaigns-entities-configs`, () => {});
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const result = await this.campaignManagementAPIClient.addCampaignsEntitiesConfigs(1, [postData]);
|
|
40
|
+
} catch {
|
|
41
|
+
assert.fail();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
assert.ok(true);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test()
|
|
48
|
+
public async removeCampaignsEntitiesConfigsByID__CorrectlyCalled() {
|
|
49
|
+
const campaignID = 1;
|
|
50
|
+
const entityIDs = [ 1 ];
|
|
51
|
+
|
|
52
|
+
superagentMock.post(`${this.mockedBaseUrl}/campaigns/remove-campaigns-entities-configs`, () => {});
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const result = await this.campaignManagementAPIClient.removeCampaignsEntitiesConfigsByID(campaignID, entityIDs);
|
|
56
|
+
} catch {
|
|
57
|
+
assert.fail();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
assert.ok(true);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@test()
|
|
64
|
+
public async clearCampaignsEntitiesConfigsByCampaignID__CorrectlyCalled() {
|
|
65
|
+
const postData = 1;
|
|
66
|
+
|
|
67
|
+
superagentMock.post(`${this.mockedBaseUrl}/campaigns/clear-campaigns-entities-configs`, () => {});
|
|
68
|
+
|
|
69
|
+
try {
|
|
70
|
+
const result = await this.campaignManagementAPIClient.clearCampaignsEntitiesConfigsByCampaignID(postData);
|
|
71
|
+
} catch {
|
|
72
|
+
assert.fail();
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
assert.ok(true);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@test()
|
|
79
|
+
public async setEntitiesBasic__CorrectlyCalled() {
|
|
80
|
+
const campaignID = 1;
|
|
81
|
+
const organisationIDs = [1];
|
|
82
|
+
const studyIDs = [5];
|
|
83
|
+
|
|
84
|
+
superagentMock.post(`${this.mockedBaseUrl}/campaigns/set-entities-basic`, () => {});
|
|
85
|
+
|
|
86
|
+
try {
|
|
87
|
+
const result = await this.campaignManagementAPIClient.setEntitiesBasic(campaignID, organisationIDs, studyIDs);
|
|
88
|
+
} catch {
|
|
89
|
+
assert.fail();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
assert.ok(true);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@test()
|
|
96
|
+
public async setEntitiesPremium__CorrectlyCalled() {
|
|
97
|
+
const campaignID = 1;
|
|
98
|
+
const organisationIDs = [1];
|
|
99
|
+
const studyIDs = [5];
|
|
100
|
+
|
|
101
|
+
superagentMock.post(`${this.mockedBaseUrl}/campaigns/set-entities-premium`, () => {});
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const result = await this.campaignManagementAPIClient.setEntitiesPremium(campaignID, organisationIDs, studyIDs);
|
|
105
|
+
} catch {
|
|
106
|
+
assert.fail();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
assert.ok(true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { suite, test } from "@testdeck/jest";
|
|
2
|
+
import { MockProxy, mock } from "jest-mock-extended";
|
|
3
|
+
import { assert } from "chai";
|
|
4
|
+
import { ISuperAgentRequestFactory, SignedRequestSender } from "@studyportals/mb-platform-http-requests";
|
|
5
|
+
import { SuperAgentRequest } from "superagent";
|
|
6
|
+
import * as superagent from "superagent";
|
|
7
|
+
import { CampaignsEntitiesConfigDto } from "../../../src/domain/campaign/CampaignsEntitiesConfig.dto";
|
|
8
|
+
import { PrivateCampaignManagementAPIClient } from "../../../src/private-campaign-management-api.client";
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const superagentMock = require("superagent-mocker")(superagent);
|
|
12
|
+
|
|
13
|
+
@suite
|
|
14
|
+
class PrivateCampaignManagementAPIClientTest {
|
|
15
|
+
private privateCampaignManagementAPIClient: PrivateCampaignManagementAPIClient;
|
|
16
|
+
private mockedRequest: MockProxy<SuperAgentRequest> = mock<SuperAgentRequest>();
|
|
17
|
+
private mockedSuperAgentRequestFactory: MockProxy<ISuperAgentRequestFactory> = mock<ISuperAgentRequestFactory>();
|
|
18
|
+
private mockedResponse: MockProxy<superagent.Response> = mock<superagent.Response>();
|
|
19
|
+
private mockedSignedRequestSender: MockProxy<SignedRequestSender> = mock<SignedRequestSender>();
|
|
20
|
+
private mockedBaseUrl = "SomeBaseUrl";
|
|
21
|
+
|
|
22
|
+
public before() {
|
|
23
|
+
this.mockedSuperAgentRequestFactory.post.mockReturnValue(this.mockedRequest);
|
|
24
|
+
this.mockedSignedRequestSender.send.mockReturnValue(Promise.resolve(this.mockedResponse));
|
|
25
|
+
|
|
26
|
+
this.privateCampaignManagementAPIClient = new PrivateCampaignManagementAPIClient(this.mockedSuperAgentRequestFactory, this.mockedSignedRequestSender, this.mockedBaseUrl);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@test()
|
|
30
|
+
public async addCampaignsEntitiesConfigs__CorrectlyCalled() {
|
|
31
|
+
const postData: CampaignsEntitiesConfigDto = {
|
|
32
|
+
campaign_id: 1,
|
|
33
|
+
sp_id: 1,
|
|
34
|
+
product_id: 12,
|
|
35
|
+
product2_id: null,
|
|
36
|
+
type: "study"
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
superagentMock.post(`${this.mockedBaseUrl}/private/campaigns/add-campaigns-entities-configs`, () => {});
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const result = await this.privateCampaignManagementAPIClient.addCampaignsEntitiesConfigs(1, [postData]);
|
|
43
|
+
} catch {
|
|
44
|
+
assert.fail();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
assert.ok(true);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@test()
|
|
51
|
+
public async removeCampaignsEntitiesConfigsByID__CorrectlyCalled() {
|
|
52
|
+
const campaignID = 1;
|
|
53
|
+
const entityIDs = [ 1 ];
|
|
54
|
+
|
|
55
|
+
superagentMock.post(`${this.mockedBaseUrl}/private/campaigns/remove-campaigns-entities-configs`, () => {});
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
const result = await this.privateCampaignManagementAPIClient.removeCampaignsEntitiesConfigsByID(campaignID, entityIDs);
|
|
59
|
+
} catch {
|
|
60
|
+
assert.fail();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
assert.ok(true);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@test()
|
|
67
|
+
public async clearCampaignsEntitiesConfigsByCampaignID__CorrectlyCalled() {
|
|
68
|
+
const postData = 1;
|
|
69
|
+
|
|
70
|
+
superagentMock.post(`${this.mockedBaseUrl}/private/campaigns/clear-campaigns-entities-configs`, () => {});
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
const result = await this.privateCampaignManagementAPIClient.clearCampaignsEntitiesConfigsByCampaignID(postData);
|
|
74
|
+
} catch {
|
|
75
|
+
assert.fail();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
assert.ok(true);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@test()
|
|
82
|
+
public async setEntitiesBasic__CorrectlyCalled() {
|
|
83
|
+
const campaignID = 1;
|
|
84
|
+
const organisationIDs = [1];
|
|
85
|
+
const studyIDs = [5];
|
|
86
|
+
|
|
87
|
+
superagentMock.post(`${this.mockedBaseUrl}/private/campaigns/set-entities-basic`, () => {});
|
|
88
|
+
|
|
89
|
+
try {
|
|
90
|
+
const result = await this.privateCampaignManagementAPIClient.setEntitiesBasic(campaignID, organisationIDs, studyIDs);
|
|
91
|
+
} catch {
|
|
92
|
+
assert.fail();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
assert.ok(true);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@test()
|
|
99
|
+
public async setEntitiesPremium__CorrectlyCalled() {
|
|
100
|
+
const campaignID = 1;
|
|
101
|
+
const organisationIDs = [1];
|
|
102
|
+
const studyIDs = [5];
|
|
103
|
+
|
|
104
|
+
superagentMock.post(`${this.mockedBaseUrl}/private/campaigns/set-entities-premium`, () => {});
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const result = await this.privateCampaignManagementAPIClient.setEntitiesPremium(campaignID, organisationIDs, studyIDs);
|
|
108
|
+
} catch {
|
|
109
|
+
assert.fail();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
assert.ok(true);
|
|
113
|
+
}
|
|
114
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
|
|
4
|
+
"outDir": "bin",
|
|
5
|
+
"rootDir": ".",
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
|
|
8
|
+
"alwaysStrict": true,
|
|
9
|
+
"strictNullChecks": true,
|
|
10
|
+
|
|
11
|
+
"allowJs": false,
|
|
12
|
+
"allowUnreachableCode": false,
|
|
13
|
+
"allowUnusedLabels": false,
|
|
14
|
+
|
|
15
|
+
"noUnusedLocals": false,
|
|
16
|
+
"noUnusedParameters": false,
|
|
17
|
+
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"noImplicitAny": true,
|
|
20
|
+
"noImplicitReturns": true,
|
|
21
|
+
"noImplicitThis": true,
|
|
22
|
+
|
|
23
|
+
"sourceMap": true,
|
|
24
|
+
"declaration": true,
|
|
25
|
+
|
|
26
|
+
"target": "es2017",
|
|
27
|
+
"lib": ["es2017", "dom"],
|
|
28
|
+
"module": "commonjs",
|
|
29
|
+
|
|
30
|
+
"experimentalDecorators": true,
|
|
31
|
+
"emitDecoratorMetadata": true,
|
|
32
|
+
|
|
33
|
+
"types": [ ]
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
"typeRoots": [ "node_modules/@types/" ],
|
|
37
|
+
|
|
38
|
+
"exclude": [ "node_modules", "bin" ]
|
|
39
|
+
}
|
package/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Pricing = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
|
|
4
|
-
const auditor_campaign_management_api_client_1 = require("./src/auditor-campaign-management-api.client");
|
|
5
|
-
Object.defineProperty(exports, "AuditorCampaignManagementAPIClient", { enumerable: true, get: function () { return auditor_campaign_management_api_client_1.AuditorCampaignManagementAPIClient; } });
|
|
6
|
-
const campaign_management_api_client_1 = require("./src/campaign-management-api.client");
|
|
7
|
-
Object.defineProperty(exports, "CampaignManagementAPIClient", { enumerable: true, get: function () { return campaign_management_api_client_1.CampaignManagementAPIClient; } });
|
|
8
|
-
const auditor_entity_type_enum_1 = require("./src/domain/auditor/enums/auditor-entity-type.enum");
|
|
9
|
-
Object.defineProperty(exports, "AuditorEntityType", { enumerable: true, get: function () { return auditor_entity_type_enum_1.AuditorEntityType; } });
|
|
10
|
-
const auditor_operation_enum_1 = require("./src/domain/auditor/enums/auditor-operation.enum");
|
|
11
|
-
Object.defineProperty(exports, "AuditorOperation", { enumerable: true, get: function () { return auditor_operation_enum_1.AuditorOperation; } });
|
|
12
|
-
const get_auditor_dto_1 = require("./src/domain/auditor/get-auditor.dto");
|
|
13
|
-
Object.defineProperty(exports, "GetAuditorDto", { enumerable: true, get: function () { return get_auditor_dto_1.GetAuditorDto; } });
|
|
14
|
-
const CampaignsEntitiesConfig_dto_1 = require("./src/domain/campaign/CampaignsEntitiesConfig.dto");
|
|
15
|
-
Object.defineProperty(exports, "CampaignsEntitiesConfigDto", { enumerable: true, get: function () { return CampaignsEntitiesConfig_dto_1.CampaignsEntitiesConfigDto; } });
|
|
16
|
-
const geotargeting_entities_1 = require("./src/domain/auditor/campaigns/geotargeting.entities");
|
|
17
|
-
Object.defineProperty(exports, "Pricing", { enumerable: true, get: function () { return geotargeting_entities_1.Pricing; } });
|
|
18
|
-
const private_campaign_management_api_client_1 = require("./src/private-campaign-management-api.client");
|
|
19
|
-
Object.defineProperty(exports, "PrivateCampaignManagementAPIClient", { enumerable: true, get: function () { return private_campaign_management_api_client_1.PrivateCampaignManagementAPIClient; } });
|
|
20
|
-
//# sourceMappingURL=index.js.map
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yGAAkG;AAW9F,mHAXK,2EAAkC,OAWL;AAVtC,yFAAmF;AAW/E,4GAXK,4DAA2B,OAWL;AAV/B,kGAAwF;AAcpF,kGAdK,4CAAiB,OAcL;AAbrB,8FAAqF;AAcjF,iGAdK,yCAAgB,OAcL;AAbpB,0EAAqE;AAgBjE,8FAhBK,+BAAa,OAgBL;AAfjB,mGAA+F;AAkB3F,2GAlBK,wDAA0B,OAkBL;AAjB9B,gGAAgH;AAoB5G,wFApBgB,+BAAO,OAoBhB;AAnBX,yGAAkG;AAM9F,mHANK,2EAAkC,OAML"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import { GetAuditorDto } from "./domain/auditor/get-auditor.dto";
|
|
3
|
-
import { AuditorOperation } from "./domain/auditor/enums/auditor-operation.enum";
|
|
4
|
-
export declare class AuditorCampaignManagementAPIClient {
|
|
5
|
-
private readonly baseUrl;
|
|
6
|
-
constructor(baseUrl: string);
|
|
7
|
-
getCampaignAuditorData(campaignID: number, jwt?: string): Promise<GetAuditorDto[]>;
|
|
8
|
-
storeCampaignAuditorData(operation: AuditorOperation, campaignID: number, username: string, isUserAction: boolean, data: any, jwt?: string): Promise<GetAuditorDto>;
|
|
9
|
-
private getRequest;
|
|
10
|
-
private postRequest;
|
|
11
|
-
private buildBaseUrl;
|
|
12
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AuditorCampaignManagementAPIClient = void 0;
|
|
13
|
-
require("reflect-metadata");
|
|
14
|
-
const inversify_1 = require("inversify");
|
|
15
|
-
const superagent = require("superagent");
|
|
16
|
-
let AuditorCampaignManagementAPIClient = class AuditorCampaignManagementAPIClient {
|
|
17
|
-
constructor(baseUrl) {
|
|
18
|
-
this.baseUrl = baseUrl;
|
|
19
|
-
}
|
|
20
|
-
async getCampaignAuditorData(campaignID, jwt = "") {
|
|
21
|
-
const result = await this.getRequest(`auditor/campaigns/${campaignID}`, jwt);
|
|
22
|
-
const getAuditorDtos = result.body;
|
|
23
|
-
return getAuditorDtos;
|
|
24
|
-
}
|
|
25
|
-
async storeCampaignAuditorData(operation, campaignID, username, isUserAction, data, jwt = "") {
|
|
26
|
-
const sendData = {
|
|
27
|
-
"operation": operation,
|
|
28
|
-
"entityID": campaignID,
|
|
29
|
-
"username": username,
|
|
30
|
-
"isUserAction": isUserAction,
|
|
31
|
-
"data": data
|
|
32
|
-
};
|
|
33
|
-
const result = await this.postRequest(`auditor/campaigns`, sendData, jwt);
|
|
34
|
-
return result.body;
|
|
35
|
-
}
|
|
36
|
-
async getRequest(relative = "", jwt = "") {
|
|
37
|
-
return await superagent.get(this.buildBaseUrl(relative))
|
|
38
|
-
.set("Content-Type", "application/json")
|
|
39
|
-
.set("Authorization", jwt);
|
|
40
|
-
}
|
|
41
|
-
async postRequest(relative = "", data, jwt = "") {
|
|
42
|
-
return await superagent.post(this.buildBaseUrl(relative))
|
|
43
|
-
.set("Content-Type", "application/json")
|
|
44
|
-
.set("Authorization", jwt)
|
|
45
|
-
.send(data);
|
|
46
|
-
}
|
|
47
|
-
buildBaseUrl(relative) {
|
|
48
|
-
return `${this.baseUrl}/${relative}`;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
AuditorCampaignManagementAPIClient = __decorate([
|
|
52
|
-
(0, inversify_1.injectable)(),
|
|
53
|
-
__metadata("design:paramtypes", [String])
|
|
54
|
-
], AuditorCampaignManagementAPIClient);
|
|
55
|
-
exports.AuditorCampaignManagementAPIClient = AuditorCampaignManagementAPIClient;
|
|
56
|
-
//# sourceMappingURL=auditor-campaign-management-api.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auditor-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/auditor-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAK1B,yCAAuC;AAEvC,yCAAyC;AAGlC,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC3C,YACqB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAChC,CAAC;IAEE,KAAK,CAAC,sBAAsB,CAAC,UAAkB,EAAE,GAAG,GAAG,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC;QAC7E,MAAM,cAAc,GAAG,MAAM,CAAC,IAAuB,CAAC;QAEtD,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,SAA2B,EAAE,UAAkB,EAAE,QAAgB,EAAE,YAAqB,EAAE,IAAS,EAAE,GAAG,GAAG,EAAE;QAC/I,MAAM,QAAQ,GAAG;YACb,WAAW,EAAE,SAAS;YACtB,UAAU,EAAE,UAAU;YACtB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,YAAY;YAC5B,MAAM,EAAE,IAAI;SACf,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QAE1E,OAAO,MAAM,CAAC,IAAqB,CAAC;IACxC,CAAC;IAGO,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAE,GAAG,GAAG,EAAE;QACpD,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACnD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,EAAE,IAAS,EAAE,GAAG,GAAG,EAAE;QAChE,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACpD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAEO,YAAY,CAAC,QAAgB;QACjC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACzC,CAAC;CACJ,CAAA;AA3CY,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;;GACA,kCAAkC,CA2C9C;AA3CY,gFAAkC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import { CampaignsEntitiesConfigDto } from "./domain/campaign/CampaignsEntitiesConfig.dto";
|
|
3
|
-
export declare class CampaignManagementAPIClient {
|
|
4
|
-
private readonly baseUrl;
|
|
5
|
-
constructor(baseUrl: string);
|
|
6
|
-
addCampaignsEntitiesConfigs(campaignID: number, campaignsEntitiesConfigs: CampaignsEntitiesConfigDto[]): Promise<any>;
|
|
7
|
-
removeCampaignsEntitiesConfigsByID(campaignID: number, campaignsEntitiesConfigsIDs: number[]): Promise<any>;
|
|
8
|
-
clearCampaignsEntitiesConfigsByCampaignID(campaignID: number): Promise<any>;
|
|
9
|
-
setEntitiesBasic(campaignID: number, organisationIDs: number[], studyIDs: number[]): Promise<any>;
|
|
10
|
-
setEntitiesPremium(campaignID: number, organisationIDs: number[], studyIDs: number[]): Promise<any>;
|
|
11
|
-
private postRequest;
|
|
12
|
-
private buildBaseUrl;
|
|
13
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CampaignManagementAPIClient = void 0;
|
|
13
|
-
require("reflect-metadata");
|
|
14
|
-
const inversify_1 = require("inversify");
|
|
15
|
-
const superagent = require("superagent");
|
|
16
|
-
let CampaignManagementAPIClient = class CampaignManagementAPIClient {
|
|
17
|
-
constructor(baseUrl) {
|
|
18
|
-
this.baseUrl = baseUrl;
|
|
19
|
-
}
|
|
20
|
-
async addCampaignsEntitiesConfigs(campaignID, campaignsEntitiesConfigs) {
|
|
21
|
-
const path = `campaigns/add-campaigns-entities-configs`;
|
|
22
|
-
const data = {
|
|
23
|
-
campaignsEntitiesConfigs: campaignsEntitiesConfigs,
|
|
24
|
-
campaignID: campaignID
|
|
25
|
-
};
|
|
26
|
-
return await this.postRequest(path, data);
|
|
27
|
-
}
|
|
28
|
-
async removeCampaignsEntitiesConfigsByID(campaignID, campaignsEntitiesConfigsIDs) {
|
|
29
|
-
const path = `campaigns/remove-campaigns-entities-configs`;
|
|
30
|
-
const data = { campaignsEntitiesConfigsIDs: campaignsEntitiesConfigsIDs, campaignID: campaignID };
|
|
31
|
-
return await this.postRequest(path, data);
|
|
32
|
-
}
|
|
33
|
-
async clearCampaignsEntitiesConfigsByCampaignID(campaignID) {
|
|
34
|
-
const path = `campaigns/clear-campaigns-entities-configs`;
|
|
35
|
-
const data = { campaignID: campaignID };
|
|
36
|
-
return await this.postRequest(path, data);
|
|
37
|
-
}
|
|
38
|
-
async setEntitiesBasic(campaignID, organisationIDs, studyIDs) {
|
|
39
|
-
const path = `campaigns/set-entities-basic`;
|
|
40
|
-
const data = {
|
|
41
|
-
organisationIDs: organisationIDs,
|
|
42
|
-
studyIDs: studyIDs,
|
|
43
|
-
campaignID: campaignID
|
|
44
|
-
};
|
|
45
|
-
return await this.postRequest(path, data);
|
|
46
|
-
}
|
|
47
|
-
async setEntitiesPremium(campaignID, organisationIDs, studyIDs) {
|
|
48
|
-
const path = `campaigns/set-entities-premium`;
|
|
49
|
-
const data = {
|
|
50
|
-
organisationIDs: organisationIDs,
|
|
51
|
-
studyIDs: studyIDs,
|
|
52
|
-
campaignID: campaignID
|
|
53
|
-
};
|
|
54
|
-
return await this.postRequest(path, data);
|
|
55
|
-
}
|
|
56
|
-
async postRequest(relative = "", data) {
|
|
57
|
-
return await superagent.post(this.buildBaseUrl(relative)).set("Content-Type", "application/json").send(data);
|
|
58
|
-
}
|
|
59
|
-
buildBaseUrl(relative) {
|
|
60
|
-
return `${this.baseUrl}/${relative}`;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
CampaignManagementAPIClient = __decorate([
|
|
64
|
-
(0, inversify_1.injectable)(),
|
|
65
|
-
__metadata("design:paramtypes", [String])
|
|
66
|
-
], CampaignManagementAPIClient);
|
|
67
|
-
exports.CampaignManagementAPIClient = CampaignManagementAPIClient;
|
|
68
|
-
//# sourceMappingURL=campaign-management-api.client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"campaign-management-api.client.js","sourceRoot":"","sources":["../../src/campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAGvC,yCAAyC;AAGlC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACvC,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,2BAA2B,CAAC,UAAkB,EAAE,wBAAsD;QAClH,MAAM,IAAI,GAAG,0CAA0C,CAAC;QACxD,MAAM,IAAI,GAAG;YACZ,wBAAwB,EAAE,wBAAwB;YAClD,UAAU,EAAE,UAAU;SACtB,CAAC;QAEF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,kCAAkC,CAAC,UAAkB,EAAE,2BAAqC;QACxG,MAAM,IAAI,GAAG,6CAA6C,CAAC;QAC3D,MAAM,IAAI,GAAG,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;QAElG,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,yCAAyC,CAAC,UAAkB;QACxE,MAAM,IAAI,GAAG,4CAA4C,CAAC;QAC1D,MAAM,IAAI,GAAG,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;QAExC,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,eAAyB,EAAE,QAAkB;QAC9F,MAAM,IAAI,GAAG,8BAA8B,CAAC;QAC5C,MAAM,IAAI,GAAG;YACZ,eAAe,EAAE,eAAe;YAChC,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,UAAU;SACtB,CAAC;QAEF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,UAAkB,EAAE,eAAyB,EAAE,QAAkB;QAChG,MAAM,IAAI,GAAG,gCAAgC,CAAC;QAC9C,MAAM,IAAI,GAAG;YACZ,eAAe,EAAE,eAAe;YAChC,QAAQ,EAAE,QAAQ;YAClB,UAAU,EAAE,UAAU;SACtB,CAAC;QAEF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,EAAE,IAAS;QACnD,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpH,CAAC;IAEO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AA1DY,2BAA2B;IADvC,IAAA,sBAAU,GAAE;;GACA,2BAA2B,CA0DvC;AA1DY,kEAA2B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
interface NumberMap {
|
|
2
|
-
[key: string]: number;
|
|
3
|
-
}
|
|
4
|
-
interface ICampaignAuditorData {
|
|
5
|
-
geo: any[];
|
|
6
|
-
pricing: Pricing;
|
|
7
|
-
geo_remainders: NumberMap;
|
|
8
|
-
}
|
|
9
|
-
declare class Pricing {
|
|
10
|
-
s: NumberMap;
|
|
11
|
-
o: NumberMap;
|
|
12
|
-
constructor(s?: NumberMap, o?: NumberMap);
|
|
13
|
-
}
|
|
14
|
-
export { ICampaignAuditorData, NumberMap, Pricing };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Pricing = void 0;
|
|
4
|
-
class Pricing {
|
|
5
|
-
constructor(s = {}, o = {}) {
|
|
6
|
-
this.s = s;
|
|
7
|
-
this.o = o;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.Pricing = Pricing;
|
|
11
|
-
//# sourceMappingURL=geotargeting.entities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"geotargeting.entities.js","sourceRoot":"","sources":["../../../../../src/domain/auditor/campaigns/geotargeting.entities.ts"],"names":[],"mappings":";;;AAQA,MAAM,OAAO;IACT,YACW,IAAe,EAAE,EACjB,IAAe,EAAE;QADjB,MAAC,GAAD,CAAC,CAAgB;QACjB,MAAC,GAAD,CAAC,CAAgB;IACzB,CAAC;CACP;AAKG,0BAAO"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuditorEntityType = void 0;
|
|
4
|
-
var AuditorEntityType;
|
|
5
|
-
(function (AuditorEntityType) {
|
|
6
|
-
AuditorEntityType["CAMPAIGN"] = "campaign";
|
|
7
|
-
})(AuditorEntityType = exports.AuditorEntityType || (exports.AuditorEntityType = {}));
|
|
8
|
-
//# sourceMappingURL=auditor-entity-type.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auditor-entity-type.enum.js","sourceRoot":"","sources":["../../../../../src/domain/auditor/enums/auditor-entity-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IACzB,0CAAqB,CAAA;AACzB,CAAC,EAFW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAE5B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AuditorOperation = void 0;
|
|
4
|
-
var AuditorOperation;
|
|
5
|
-
(function (AuditorOperation) {
|
|
6
|
-
AuditorOperation["CLEANUP"] = "cleanup";
|
|
7
|
-
AuditorOperation["UPDATE"] = "update";
|
|
8
|
-
AuditorOperation["CREATE"] = "create";
|
|
9
|
-
AuditorOperation["LINK"] = "link";
|
|
10
|
-
AuditorOperation["UNLINK"] = "unlink";
|
|
11
|
-
AuditorOperation["DELETE"] = "delete";
|
|
12
|
-
AuditorOperation["ENDOR"] = "endor";
|
|
13
|
-
})(AuditorOperation = exports.AuditorOperation || (exports.AuditorOperation = {}));
|
|
14
|
-
//# sourceMappingURL=auditor-operation.enum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auditor-operation.enum.js","sourceRoot":"","sources":["../../../../../src/domain/auditor/enums/auditor-operation.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAQX;AARD,WAAY,gBAAgB;IACxB,uCAAmB,CAAA;IACnB,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,qCAAiB,CAAA;IACjB,qCAAiB,CAAA;IACjB,mCAAe,CAAA;AACnB,CAAC,EARW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAQ3B"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AuditorEntityType } from "./enums/auditor-entity-type.enum";
|
|
2
|
-
import { AuditorOperation } from "./enums/auditor-operation.enum";
|
|
3
|
-
export declare class GetAuditorDto {
|
|
4
|
-
readonly id: number;
|
|
5
|
-
readonly auditTime: string;
|
|
6
|
-
readonly operation: AuditorOperation;
|
|
7
|
-
readonly entityID: number;
|
|
8
|
-
readonly entityType: AuditorEntityType;
|
|
9
|
-
readonly username: string;
|
|
10
|
-
readonly isUserAction: boolean;
|
|
11
|
-
readonly data: any;
|
|
12
|
-
constructor(id: number, auditTime: string, operation: AuditorOperation, entityID: number, entityType: AuditorEntityType, username: string, isUserAction: boolean, data: any);
|
|
13
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetAuditorDto = void 0;
|
|
4
|
-
class GetAuditorDto {
|
|
5
|
-
constructor(id, auditTime, operation, entityID, entityType, username, isUserAction, data) {
|
|
6
|
-
this.id = id;
|
|
7
|
-
this.auditTime = auditTime;
|
|
8
|
-
this.operation = operation;
|
|
9
|
-
this.entityID = entityID;
|
|
10
|
-
this.entityType = entityType;
|
|
11
|
-
this.username = username;
|
|
12
|
-
this.isUserAction = isUserAction;
|
|
13
|
-
this.data = data;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.GetAuditorDto = GetAuditorDto;
|
|
17
|
-
//# sourceMappingURL=get-auditor.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-auditor.dto.js","sourceRoot":"","sources":["../../../../src/domain/auditor/get-auditor.dto.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAUtB,YACI,EAAU,EACV,SAAiB,EACjB,SAA2B,EAC3B,QAAgB,EAChB,UAA6B,EAC7B,QAAgB,EAChB,YAAqB,EACrB,IAAS;QAET,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AA7BD,sCA6BC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CampaignsEntitiesConfigDto = void 0;
|
|
4
|
-
class CampaignsEntitiesConfigDto {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.product2_id = null;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.CampaignsEntitiesConfigDto = CampaignsEntitiesConfigDto;
|
|
10
|
-
//# sourceMappingURL=CampaignsEntitiesConfig.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CampaignsEntitiesConfig.dto.js","sourceRoot":"","sources":["../../../../src/domain/campaign/CampaignsEntitiesConfig.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,0BAA0B;IAAvC;QAIW,gBAAW,GAAkB,IAAI,CAAC;IAE7C,CAAC;CAAA;AAND,gEAMC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
2
|
-
import { CampaignsEntitiesConfigDto } from "./domain/campaign/CampaignsEntitiesConfig.dto";
|
|
3
|
-
import { ISuperAgentRequestFactory, SignedRequestSender } from "@studyportals/mb-platform-http-requests";
|
|
4
|
-
export declare class PrivateCampaignManagementAPIClient {
|
|
5
|
-
private readonly superAgentRequestFactory;
|
|
6
|
-
private readonly requestSender;
|
|
7
|
-
private readonly baseUrl;
|
|
8
|
-
constructor(superAgentRequestFactory: ISuperAgentRequestFactory, requestSender: SignedRequestSender, baseUrl: string);
|
|
9
|
-
addCampaignsEntitiesConfigs(campaignID: number, campaignsEntitiesConfigs: CampaignsEntitiesConfigDto[]): Promise<any>;
|
|
10
|
-
removeCampaignsEntitiesConfigsByID(campaignID: number, campaignsEntitiesConfigsIDs: number[]): Promise<any>;
|
|
11
|
-
clearCampaignsEntitiesConfigsByCampaignID(campaignID: number): Promise<any>;
|
|
12
|
-
setEntitiesBasic(campaignID: number, organisationIDs: number[], studyIDs: number[]): Promise<any>;
|
|
13
|
-
setEntitiesPremium(campaignID: number, organisationIDs: number[], studyIDs: number[]): Promise<any>;
|
|
14
|
-
private postRequest;
|
|
15
|
-
private createPostRequest;
|
|
16
|
-
private sendRequest;
|
|
17
|
-
private buildBaseUrl;
|
|
18
|
-
}
|