@studyportals/campaign-management-api-interface 0.10.0 → 0.13.0
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/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { AuditorEntityType } from "./src/domain/auditor/enums/auditor-entity-typ
|
|
|
4
4
|
import { AuditorOperation } from "./src/domain/auditor/enums/auditor-operation.enum";
|
|
5
5
|
import { GetAuditorDto } from "./src/domain/auditor/get-auditor.dto";
|
|
6
6
|
import { CampaignsEntitiesConfigDto } from "./src/domain/campaign/CampaignsEntitiesConfig.dto";
|
|
7
|
-
|
|
7
|
+
import { NumberMap, Pricing, ICampaignAuditorData } from "./src/domain/auditor/campaigns/geotargeting.entities";
|
|
8
|
+
export { AuditorCampaignManagementAPIClient, CampaignManagementAPIClient, AuditorEntityType, AuditorOperation, GetAuditorDto, CampaignsEntitiesConfigDto, NumberMap, Pricing, ICampaignAuditorData };
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.CampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
|
|
3
|
+
exports.Pricing = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.CampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
|
|
4
4
|
const auditor_campaign_management_api_client_1 = require("./src/auditor-campaign-management-api.client");
|
|
5
5
|
Object.defineProperty(exports, "AuditorCampaignManagementAPIClient", { enumerable: true, get: function () { return auditor_campaign_management_api_client_1.AuditorCampaignManagementAPIClient; } });
|
|
6
6
|
const campaign_management_api_client_1 = require("./src/campaign-management-api.client");
|
|
@@ -13,4 +13,6 @@ const get_auditor_dto_1 = require("./src/domain/auditor/get-auditor.dto");
|
|
|
13
13
|
Object.defineProperty(exports, "GetAuditorDto", { enumerable: true, get: function () { return get_auditor_dto_1.GetAuditorDto; } });
|
|
14
14
|
const CampaignsEntitiesConfig_dto_1 = require("./src/domain/campaign/CampaignsEntitiesConfig.dto");
|
|
15
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; } });
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yGAAkG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yGAAkG;AAU9F,mHAVK,2EAAkC,OAUL;AATtC,yFAAmF;AAU/E,4GAVK,4DAA2B,OAUL;AAT/B,kGAAwF;AAYpF,kGAZK,4CAAiB,OAYL;AAXrB,8FAAqF;AAYjF,iGAZK,yCAAgB,OAYL;AAXpB,0EAAqE;AAcjE,8FAdK,+BAAa,OAcL;AAbjB,mGAA+F;AAgB3F,2GAhBK,wDAA0B,OAgBL;AAf9B,gGAAgH;AAkB5G,wFAlBgB,+BAAO,OAkBhB"}
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@ import { AuditorOperation } from "./domain/auditor/enums/auditor-operation.enum"
|
|
|
4
4
|
export declare class AuditorCampaignManagementAPIClient {
|
|
5
5
|
private readonly baseUrl;
|
|
6
6
|
constructor(baseUrl: string);
|
|
7
|
-
getCampaignAuditorData(campaignID: number): Promise<GetAuditorDto[]>;
|
|
8
|
-
storeCampaignAuditorData(operation: AuditorOperation, campaignID: number, username: string, isUserAction: boolean, data: any): Promise<GetAuditorDto>;
|
|
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
9
|
private getRequest;
|
|
10
10
|
private postRequest;
|
|
11
11
|
private buildBaseUrl;
|
|
@@ -17,12 +17,12 @@ let AuditorCampaignManagementAPIClient = class AuditorCampaignManagementAPIClien
|
|
|
17
17
|
constructor(baseUrl) {
|
|
18
18
|
this.baseUrl = baseUrl;
|
|
19
19
|
}
|
|
20
|
-
async getCampaignAuditorData(campaignID) {
|
|
21
|
-
const result = await this.getRequest(`auditor/campaigns/${campaignID}
|
|
20
|
+
async getCampaignAuditorData(campaignID, jwt = "") {
|
|
21
|
+
const result = await this.getRequest(`auditor/campaigns/${campaignID}`, jwt);
|
|
22
22
|
const getAuditorDtos = result.body;
|
|
23
23
|
return getAuditorDtos;
|
|
24
24
|
}
|
|
25
|
-
async storeCampaignAuditorData(operation, campaignID, username, isUserAction, data) {
|
|
25
|
+
async storeCampaignAuditorData(operation, campaignID, username, isUserAction, data, jwt = "") {
|
|
26
26
|
const sendData = {
|
|
27
27
|
"operation": operation,
|
|
28
28
|
"entityID": campaignID,
|
|
@@ -30,14 +30,19 @@ let AuditorCampaignManagementAPIClient = class AuditorCampaignManagementAPIClien
|
|
|
30
30
|
"isUserAction": isUserAction,
|
|
31
31
|
"data": data
|
|
32
32
|
};
|
|
33
|
-
const result = await this.postRequest(`auditor/campaigns`, sendData);
|
|
33
|
+
const result = await this.postRequest(`auditor/campaigns`, sendData, jwt);
|
|
34
34
|
return result.body;
|
|
35
35
|
}
|
|
36
|
-
async getRequest(relative = "") {
|
|
37
|
-
return await superagent.get(this.buildBaseUrl(relative))
|
|
36
|
+
async getRequest(relative = "", jwt = "") {
|
|
37
|
+
return await superagent.get(this.buildBaseUrl(relative))
|
|
38
|
+
.set("Content-Type", "application/json")
|
|
39
|
+
.set("Authorization", jwt);
|
|
38
40
|
}
|
|
39
|
-
async postRequest(relative = "", data) {
|
|
40
|
-
return await superagent.post(this.buildBaseUrl(relative))
|
|
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);
|
|
41
46
|
}
|
|
42
47
|
buildBaseUrl(relative) {
|
|
43
48
|
return `${this.baseUrl}/${relative}`;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,wBA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