@studyportals/campaign-management-api-interface 3.8.1-0 → 3.8.1-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -1
- package/src/domain/organisations/enums/source-link-sub-types.enum.d.ts +2 -1
- package/src/domain/organisations/enums/source-link-sub-types.enum.js +1 -0
- package/src/domain/organisations/enums/source-link-sub-types.enum.js.map +1 -1
- package/src/domain/organisations/index.d.ts +2 -1
- package/src/domain/organisations/index.js +3 -1
- package/src/domain/organisations/index.js.map +1 -1
- package/src/domain/organisations/source-link-data.dto.d.ts +12 -0
- package/src/domain/organisations/source-link-data.dto.js +15 -0
- package/src/domain/organisations/source-link-data.dto.js.map +1 -0
- package/src/domain/organisations/source-links.dto.d.ts +4 -3
- package/src/domain/organisations/source-links.dto.js +3 -1
- package/src/domain/organisations/source-links.dto.js.map +1 -1
- package/src/errors/internal-error.d.ts +3 -0
- package/src/errors/internal-error.js +12 -0
- package/src/errors/internal-error.js.map +1 -0
- package/src/organisations-campaign-management-api.client.d.ts +5 -0
- package/src/organisations-campaign-management-api.client.js +75 -2
- package/src/organisations-campaign-management-api.client.js.map +1 -1
- package/src/private-campaign-management-api.client.d.ts +0 -2
- package/src/private-campaign-management-api.client.js +0 -3
- package/src/private-campaign-management-api.client.js.map +1 -1
- package/src/validation/dto/organisations/create-source-links.request.d.ts +4 -0
- package/src/validation/dto/organisations/create-source-links.request.js +25 -0
- package/src/validation/dto/organisations/create-source-links.request.js.map +1 -0
- package/src/validation/dto/organisations/index.d.ts +5 -0
- package/src/validation/dto/organisations/index.js +12 -0
- package/src/validation/dto/organisations/index.js.map +1 -0
- package/src/validation/dto/organisations/source-link-create.dto.d.ts +8 -0
- package/src/validation/dto/organisations/source-link-create.dto.js +40 -0
- package/src/validation/dto/organisations/source-link-create.dto.js.map +1 -0
- package/src/validation/dto/organisations/source-link-update.dto.d.ts +4 -0
- package/src/validation/dto/organisations/source-link-update.dto.js +23 -0
- package/src/validation/dto/organisations/source-link-update.dto.js.map +1 -0
- package/src/validation/dto/organisations/update-source-links.request.d.ts +4 -0
- package/src/validation/dto/organisations/update-source-links.request.js +25 -0
- package/src/validation/dto/organisations/update-source-links.request.js.map +1 -0
- package/src/validation/index.d.ts +1 -0
- package/src/validation/index.js +15 -0
- package/src/validation/index.js.map +1 -1
- package/src/domain/campaign/get-campaigns-lift-overview.dto.d.ts +0 -4
- package/src/domain/campaign/get-campaigns-lift-overview.dto.js +0 -10
- package/src/domain/campaign/get-campaigns-lift-overview.dto.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/campaign-management-api-interface",
|
|
3
|
-
"version": "3.8.1-
|
|
3
|
+
"version": "3.8.1-3",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"compile": "rm -fR bin && npx tsc",
|
|
6
6
|
"test-u": "jest -c jest.config.unit.json --maxWorkers=1",
|
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
"@types/chai": "^4.3.4",
|
|
35
35
|
"@types/jest": "^29.4.0",
|
|
36
36
|
"@types/node": "^16.9.4",
|
|
37
|
+
"class-transformer": "^0.5.1",
|
|
38
|
+
"class-validator": "^0.14.1",
|
|
37
39
|
"inversify": "^6.0.1",
|
|
38
40
|
"reflect-metadata": "^0.1.13",
|
|
39
41
|
"typescript": "^4.9.5"
|
|
@@ -8,5 +8,6 @@ var SourceLinkSubTypes;
|
|
|
8
8
|
SourceLinkSubTypes["EEA"] = "eea";
|
|
9
9
|
SourceLinkSubTypes["NATIONAL_EEA"] = "national_eea";
|
|
10
10
|
SourceLinkSubTypes["LOCAL"] = "local";
|
|
11
|
+
SourceLinkSubTypes["NO_SUB_TYPE"] = "no_sub_type";
|
|
11
12
|
})(SourceLinkSubTypes = exports.SourceLinkSubTypes || (exports.SourceLinkSubTypes = {}));
|
|
12
13
|
//# sourceMappingURL=source-link-sub-types.enum.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-link-sub-types.enum.js","sourceRoot":"","sources":["../../../../../src/domain/organisations/enums/source-link-sub-types.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"source-link-sub-types.enum.js","sourceRoot":"","sources":["../../../../../src/domain/organisations/enums/source-link-sub-types.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC7B,2CAAqB,CAAA;IACrB,qDAA+B,CAAA;IAC/B,iCAAW,CAAA;IACX,mDAA6B,CAAA;IAC7B,qCAAe,CAAA;IACf,iDAA2B,CAAA;AAC5B,CAAC,EAPW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAO7B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SourceLinkLevels } from "./enums/source-link-levels.enum";
|
|
2
2
|
import { SourceLinkSubTypes } from "./enums/source-link-sub-types.enum";
|
|
3
3
|
import { SourceLinkTypes } from "./enums/source-link-types.enum";
|
|
4
|
+
import { SourceLinkDataDto } from "./source-link-data.dto";
|
|
4
5
|
import { SourceLinkDto } from "./source-links.dto";
|
|
5
|
-
export { SourceLinkDto, SourceLinkLevels, SourceLinkSubTypes, SourceLinkTypes };
|
|
6
|
+
export { SourceLinkDto, SourceLinkDataDto, SourceLinkLevels, SourceLinkSubTypes, SourceLinkTypes };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SourceLinkTypes = exports.SourceLinkSubTypes = exports.SourceLinkLevels = exports.SourceLinkDto = void 0;
|
|
3
|
+
exports.SourceLinkTypes = exports.SourceLinkSubTypes = exports.SourceLinkLevels = exports.SourceLinkDataDto = exports.SourceLinkDto = void 0;
|
|
4
4
|
const source_link_levels_enum_1 = require("./enums/source-link-levels.enum");
|
|
5
5
|
Object.defineProperty(exports, "SourceLinkLevels", { enumerable: true, get: function () { return source_link_levels_enum_1.SourceLinkLevels; } });
|
|
6
6
|
const source_link_sub_types_enum_1 = require("./enums/source-link-sub-types.enum");
|
|
7
7
|
Object.defineProperty(exports, "SourceLinkSubTypes", { enumerable: true, get: function () { return source_link_sub_types_enum_1.SourceLinkSubTypes; } });
|
|
8
8
|
const source_link_types_enum_1 = require("./enums/source-link-types.enum");
|
|
9
9
|
Object.defineProperty(exports, "SourceLinkTypes", { enumerable: true, get: function () { return source_link_types_enum_1.SourceLinkTypes; } });
|
|
10
|
+
const source_link_data_dto_1 = require("./source-link-data.dto");
|
|
11
|
+
Object.defineProperty(exports, "SourceLinkDataDto", { enumerable: true, get: function () { return source_link_data_dto_1.SourceLinkDataDto; } });
|
|
10
12
|
const source_links_dto_1 = require("./source-links.dto");
|
|
11
13
|
Object.defineProperty(exports, "SourceLinkDto", { enumerable: true, get: function () { return source_links_dto_1.SourceLinkDto; } });
|
|
12
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/organisations/index.ts"],"names":[],"mappings":";;;AAAA,6EAAmE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/organisations/index.ts"],"names":[],"mappings":";;;AAAA,6EAAmE;AAWlE,iGAXQ,0CAAgB,OAWR;AAVjB,mFAAwE;AAWvE,mGAXQ,+CAAkB,OAWR;AAVnB,2EAAiE;AAWhE,gGAXQ,wCAAe,OAWR;AAVhB,iEAA2D;AAM1D,kGANQ,wCAAiB,OAMR;AALlB,yDAAmD;AAIlD,8FAJQ,gCAAa,OAIR"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceLinkLevels } from "./enums/source-link-levels.enum";
|
|
2
|
+
import { SourceLinkSubTypes } from "./enums/source-link-sub-types.enum";
|
|
3
|
+
import { SourceLinkTypes } from "./enums/source-link-types.enum";
|
|
4
|
+
export declare class SourceLinkDataDto {
|
|
5
|
+
readonly organisationId: number;
|
|
6
|
+
readonly level: SourceLinkLevels;
|
|
7
|
+
readonly type: SourceLinkTypes;
|
|
8
|
+
readonly subType: SourceLinkSubTypes;
|
|
9
|
+
readonly url: string | null;
|
|
10
|
+
readonly doesExist: boolean;
|
|
11
|
+
constructor(organisationId: number, level: SourceLinkLevels, type: SourceLinkTypes, subType: SourceLinkSubTypes, url: string | null, doesExist: boolean);
|
|
12
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SourceLinkDataDto = void 0;
|
|
4
|
+
class SourceLinkDataDto {
|
|
5
|
+
constructor(organisationId, level, type, subType, url, doesExist) {
|
|
6
|
+
this.organisationId = organisationId;
|
|
7
|
+
this.level = level;
|
|
8
|
+
this.type = type;
|
|
9
|
+
this.subType = subType;
|
|
10
|
+
this.url = url;
|
|
11
|
+
this.doesExist = doesExist;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.SourceLinkDataDto = SourceLinkDataDto;
|
|
15
|
+
//# sourceMappingURL=source-link-data.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-link-data.dto.js","sourceRoot":"","sources":["../../../../src/domain/organisations/source-link-data.dto.ts"],"names":[],"mappings":";;;AAIA,MAAa,iBAAiB;IAC7B,YACiB,cAAsB,EACtB,KAAuB,EACvB,IAAqB,EACrB,OAA2B,EAC3B,GAAkB,EAClB,SAAkB;QALlB,mBAAc,GAAd,cAAc,CAAQ;QACtB,UAAK,GAAL,KAAK,CAAkB;QACvB,SAAI,GAAJ,IAAI,CAAiB;QACrB,YAAO,GAAP,OAAO,CAAoB;QAC3B,QAAG,GAAH,GAAG,CAAe;QAClB,cAAS,GAAT,SAAS,CAAS;IAChC,CAAC;CACJ;AATD,8CASC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { SourceLinkLevels } from "./enums/source-link-levels.enum";
|
|
2
2
|
import { SourceLinkSubTypes } from "./enums/source-link-sub-types.enum";
|
|
3
3
|
import { SourceLinkTypes } from "./enums/source-link-types.enum";
|
|
4
|
-
|
|
4
|
+
import { SourceLinkDataDto } from "./source-link-data.dto";
|
|
5
|
+
export declare class SourceLinkDto extends SourceLinkDataDto {
|
|
5
6
|
readonly id: number;
|
|
6
7
|
readonly organisationId: number;
|
|
7
8
|
readonly level: SourceLinkLevels;
|
|
8
9
|
readonly type: SourceLinkTypes;
|
|
9
|
-
readonly subType: SourceLinkSubTypes
|
|
10
|
+
readonly subType: SourceLinkSubTypes;
|
|
10
11
|
readonly url: string | null;
|
|
11
12
|
readonly doesExist: boolean;
|
|
12
|
-
constructor(id: number, organisationId: number, level: SourceLinkLevels, type: SourceLinkTypes, subType: SourceLinkSubTypes
|
|
13
|
+
constructor(id: number, organisationId: number, level: SourceLinkLevels, type: SourceLinkTypes, subType: SourceLinkSubTypes, url: string | null, doesExist: boolean);
|
|
13
14
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SourceLinkDto = void 0;
|
|
4
|
-
|
|
4
|
+
const source_link_data_dto_1 = require("./source-link-data.dto");
|
|
5
|
+
class SourceLinkDto extends source_link_data_dto_1.SourceLinkDataDto {
|
|
5
6
|
constructor(id, organisationId, level, type, subType, url, doesExist) {
|
|
7
|
+
super(organisationId, level, type, subType, url, doesExist);
|
|
6
8
|
this.id = id;
|
|
7
9
|
this.organisationId = organisationId;
|
|
8
10
|
this.level = level;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-links.dto.js","sourceRoot":"","sources":["../../../../src/domain/organisations/source-links.dto.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"source-links.dto.js","sourceRoot":"","sources":["../../../../src/domain/organisations/source-links.dto.ts"],"names":[],"mappings":";;;AAGA,iEAA2D;AAE3D,MAAa,aAAc,SAAQ,wCAAiB;IACnD,YACiB,EAAU,EACV,cAAsB,EACtB,KAAuB,EACvB,IAAqB,EACrB,OAA2B,EAC3B,GAAkB,EAClB,SAAkB;QAElC,KAAK,CAAC,cAAc,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;QAR5C,OAAE,GAAF,EAAE,CAAQ;QACV,mBAAc,GAAd,cAAc,CAAQ;QACtB,UAAK,GAAL,KAAK,CAAkB;QACvB,SAAI,GAAJ,IAAI,CAAiB;QACrB,YAAO,GAAP,OAAO,CAAoB;QAC3B,QAAG,GAAH,GAAG,CAAe;QAClB,cAAS,GAAT,SAAS,CAAS;IAGnC,CAAC;CACD;AAZD,sCAYC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InternalError = void 0;
|
|
4
|
+
class InternalError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'InternalError';
|
|
8
|
+
this.message = message;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.InternalError = InternalError;
|
|
12
|
+
//# sourceMappingURL=internal-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal-error.js","sourceRoot":"","sources":["../../../src/errors/internal-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAc,SAAQ,KAAK;IACvC,YAAY,OAAe;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;CACD;AAND,sCAMC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
import { MinimalOrganisationDto } from "./domain/organisations/minimal-organisations.dto";
|
|
3
3
|
import { SourceLinkDto } from "./domain/organisations";
|
|
4
|
+
import { SourceLinkCreateDto } from "./validation/dto/organisations/source-link-create.dto";
|
|
5
|
+
import { SourceLinkUpdateDto } from "./validation/dto/organisations/source-link-update.dto";
|
|
4
6
|
export declare class OrganisationsCampaignManagementAPIClient {
|
|
5
7
|
private readonly baseUrl;
|
|
6
8
|
constructor(baseUrl: string);
|
|
7
9
|
getMinimalOrganisation(organisationID: number, jwt?: string): Promise<MinimalOrganisationDto>;
|
|
8
10
|
searchOrganisations(searchTerm: string, jwt?: string, limit?: number): Promise<MinimalOrganisationDto[]>;
|
|
9
11
|
getSourceLinks(organisationID: number, jwt?: string): Promise<SourceLinkDto[]>;
|
|
12
|
+
createSourceLinks(organisationID: number, sourceLinks: SourceLinkCreateDto[], jwt?: string): Promise<void>;
|
|
13
|
+
updateSourceLinks(organisationID: number, sourceLinks: SourceLinkUpdateDto[], jwt?: string): Promise<void>;
|
|
10
14
|
private postRequest;
|
|
15
|
+
private putRequest;
|
|
11
16
|
private getRequest;
|
|
12
17
|
private buildBaseUrl;
|
|
13
18
|
}
|
|
@@ -13,6 +13,12 @@ exports.OrganisationsCampaignManagementAPIClient = void 0;
|
|
|
13
13
|
require("reflect-metadata");
|
|
14
14
|
const inversify_1 = require("inversify");
|
|
15
15
|
const superagent = require("superagent");
|
|
16
|
+
const source_link_create_dto_1 = require("./validation/dto/organisations/source-link-create.dto");
|
|
17
|
+
const source_link_update_dto_1 = require("./validation/dto/organisations/source-link-update.dto");
|
|
18
|
+
const update_source_links_request_1 = require("./validation/dto/organisations/update-source-links.request");
|
|
19
|
+
const class_validator_1 = require("class-validator");
|
|
20
|
+
const create_source_links_request_1 = require("./validation/dto/organisations/create-source-links.request");
|
|
21
|
+
const internal_error_1 = require("./errors/internal-error");
|
|
16
22
|
let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManagementAPIClient {
|
|
17
23
|
constructor(baseUrl) {
|
|
18
24
|
this.baseUrl = baseUrl;
|
|
@@ -31,8 +37,8 @@ let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManage
|
|
|
31
37
|
try {
|
|
32
38
|
const path = `organisations/search`;
|
|
33
39
|
const result = await this.postRequest(path, {
|
|
34
|
-
searchTerm
|
|
35
|
-
limit
|
|
40
|
+
searchTerm,
|
|
41
|
+
limit
|
|
36
42
|
}, jwt);
|
|
37
43
|
return result.body;
|
|
38
44
|
}
|
|
@@ -50,12 +56,79 @@ let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManage
|
|
|
50
56
|
throw new Error(`getSourceLinks error: ${error}`);
|
|
51
57
|
}
|
|
52
58
|
}
|
|
59
|
+
async createSourceLinks(organisationID, sourceLinks, jwt = "") {
|
|
60
|
+
try {
|
|
61
|
+
const path = `organisations/${organisationID}/source-links`;
|
|
62
|
+
const sourceLinksValidatorMap = sourceLinks.map(dto => {
|
|
63
|
+
const validator = new source_link_create_dto_1.SourceLinkCreateDto();
|
|
64
|
+
validator.level = dto.level;
|
|
65
|
+
validator.type = dto.type;
|
|
66
|
+
validator.subType = dto.subType;
|
|
67
|
+
validator.url = dto.url;
|
|
68
|
+
validator.doesExist = dto.doesExist;
|
|
69
|
+
return validator;
|
|
70
|
+
});
|
|
71
|
+
const data = new create_source_links_request_1.CreateSourceLinksRequest();
|
|
72
|
+
data.sourceLinks = sourceLinksValidatorMap;
|
|
73
|
+
const errors = await (0, class_validator_1.validate)(data);
|
|
74
|
+
if (errors.length > 0) {
|
|
75
|
+
throw new internal_error_1.InternalError(`createSourceLinks validation error: ${errors}`);
|
|
76
|
+
}
|
|
77
|
+
const result = await this.postRequest(path, data, jwt);
|
|
78
|
+
if (result.status !== 201) {
|
|
79
|
+
throw new internal_error_1.InternalError(`createSourceLinks status is not 201. ${result.body}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof internal_error_1.InternalError) {
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
throw new Error(`createSourceLinks error: ${error}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async updateSourceLinks(organisationID, sourceLinks, jwt = "") {
|
|
90
|
+
try {
|
|
91
|
+
const path = `organisations/${organisationID}/source-links`;
|
|
92
|
+
const sourceLinksValidatorMap = sourceLinks.map(dto => {
|
|
93
|
+
const validator = new source_link_update_dto_1.SourceLinkUpdateDto();
|
|
94
|
+
validator.level = dto.level;
|
|
95
|
+
validator.type = dto.type;
|
|
96
|
+
validator.subType = dto.subType;
|
|
97
|
+
validator.url = dto.url;
|
|
98
|
+
validator.doesExist = dto.doesExist;
|
|
99
|
+
validator.id = dto.id;
|
|
100
|
+
return validator;
|
|
101
|
+
});
|
|
102
|
+
const data = new update_source_links_request_1.UpdateSourceLinksRequest();
|
|
103
|
+
data.sourceLinks = sourceLinksValidatorMap;
|
|
104
|
+
const errors = await (0, class_validator_1.validate)(data);
|
|
105
|
+
if (errors.length > 0) {
|
|
106
|
+
throw new internal_error_1.InternalError(`updateSourceLinks validation error: ${errors}`);
|
|
107
|
+
}
|
|
108
|
+
const result = await this.putRequest(path, data, jwt);
|
|
109
|
+
if (result.status !== 200) {
|
|
110
|
+
throw new internal_error_1.InternalError(`updateSourceLinks status is not 200. ${result.body}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
if (error instanceof internal_error_1.InternalError) {
|
|
115
|
+
throw error;
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`updateSourceLinks error: ${error}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
53
120
|
async postRequest(relative = "", data, jwt = "") {
|
|
54
121
|
return await superagent.post(this.buildBaseUrl(relative))
|
|
55
122
|
.set("Content-Type", "application/json")
|
|
56
123
|
.set("Authorization", jwt)
|
|
57
124
|
.send(data);
|
|
58
125
|
}
|
|
126
|
+
async putRequest(relative = "", data, jwt = "") {
|
|
127
|
+
return await superagent.put(this.buildBaseUrl(relative))
|
|
128
|
+
.set("Content-Type", "application/json")
|
|
129
|
+
.set("Authorization", jwt)
|
|
130
|
+
.send(data);
|
|
131
|
+
}
|
|
59
132
|
async getRequest(relative = "", jwt = "") {
|
|
60
133
|
return await superagent.get(this.buildBaseUrl(relative))
|
|
61
134
|
.set("Content-Type", "application/json")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisations-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/organisations-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAEvC,yCAAyC;
|
|
1
|
+
{"version":3,"file":"organisations-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/organisations-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAEvC,yCAAyC;AAGzC,kGAA4F;AAC5F,kGAA4F;AAC5F,4GAAsG;AACtG,qDAA2C;AAC3C,4GAAsG;AACtG,4DAAwD;AAGjD,IAAM,wCAAwC,GAA9C,MAAM,wCAAwC;IACpD,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,sBAAsB,CAAC,cAAsB,EAAE,GAAG,GAAG,EAAE;QACnE,IAAI;YACH,MAAM,IAAI,GAAG,yBAAyB,cAAc,EAAE,CAAC;YACvD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAEhD,OAAO,MAAM,CAAC,IAA8B,CAAC;SAC7C;QAAC,OAAO,KAAK,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,EAAE,CAAC,CAAC;SAC1D;IACF,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,UAAkB,EAAE,GAAG,GAAG,EAAE,EAAE,KAAK,GAAG,EAAE;QACxE,IAAI;YACH,MAAM,IAAI,GAAG,sBAAsB,CAAC;YACpC,MAAM,MAAM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AAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAE,GAAG,GAAG,EAAE;QACvD,OAAO,MAAM,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACtD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,EAAE,CAAC;IACV,CAAC;IAGO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AAxIY,wCAAwC;IADpD,IAAA,sBAAU,GAAE;;GACA,wCAAwC,CAwIpD;AAxIY,4FAAwC"}
|
|
@@ -3,7 +3,6 @@ import { CampaignsEntitiesConfigDto } from "./domain/campaign/campaign-entities-
|
|
|
3
3
|
import { ISuperAgentRequestFactory, SignedRequestSender } from "@studyportals/mb-platform-http-requests";
|
|
4
4
|
import { CampaignWithDates } from "./domain/campaign/campaign-with-dates.entity";
|
|
5
5
|
import { PersistGoogleLinkerResultDto } from "./domain/campaign/persist-google-linker-result.dto";
|
|
6
|
-
import { GetCampaignsLiftOverviewDto } from "./domain/campaign/get-campaigns-lift-overview.dto";
|
|
7
6
|
export declare class PrivateCampaignManagementAPIClient {
|
|
8
7
|
private readonly superAgentRequestFactory;
|
|
9
8
|
private readonly requestSender;
|
|
@@ -17,7 +16,6 @@ export declare class PrivateCampaignManagementAPIClient {
|
|
|
17
16
|
setEntitiesPremium(campaignID: number, organisationIDs: number[], studyIDs: number[]): Promise<void>;
|
|
18
17
|
getCampaignPersistGoogleLinkerProperty(campaignID: number): Promise<PersistGoogleLinkerResultDto>;
|
|
19
18
|
setEntitiesPersistGoogleLinkerProperty(organisationIds: number[], studyIds: number[], persistGoogleLinkerValue: boolean): Promise<void>;
|
|
20
|
-
getCampaignLiftOverview(): Promise<GetCampaignsLiftOverviewDto>;
|
|
21
19
|
private getRequest;
|
|
22
20
|
private createGetRequest;
|
|
23
21
|
private postRequest;
|
|
@@ -75,9 +75,6 @@ let PrivateCampaignManagementAPIClient = class PrivateCampaignManagementAPIClien
|
|
|
75
75
|
};
|
|
76
76
|
await this.postRequest(path, data);
|
|
77
77
|
}
|
|
78
|
-
async getCampaignLiftOverview() {
|
|
79
|
-
return await this.getRequest(`private/campaigns/lift-overview`);
|
|
80
|
-
}
|
|
81
78
|
async getRequest(relative = "") {
|
|
82
79
|
const request = this.createGetRequest(relative);
|
|
83
80
|
return await this.requestSender.sendAndExtractBody(request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/private-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAEvC,uFAAyG;
|
|
1
|
+
{"version":3,"file":"private-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/private-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAEvC,uFAAyG;AAKlG,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC9C,YACkB,wBAAmD,EACnD,aAAkC,EAClC,OAAe;QAFf,6BAAwB,GAAxB,wBAAwB,CAA2B;QACnD,kBAAa,GAAb,aAAa,CAAqB;QAClC,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,iBAAiB,CAAC,WAAqB;QACnD,MAAM,IAAI,GAAG,wCAAwC,CAAC;QACtD,MAAM,IAAI,GAAG;YACZ,WAAW,EAAE,WAAW;SACxB,CAAC;QACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClD,OAA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AI,CAAC,wBAAwB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,OAA0B,EAAE,OAAY;QACjE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAEO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AA1GY,kCAAkC;IAD9C,IAAA,sBAAU,GAAE;6CAIqB,+CAAmB;GAHxC,kCAAkC,CA0G9C;AA1GY,gFAAkC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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.CreateSourceLinksRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const source_link_create_dto_1 = require("./source-link-create.dto");
|
|
16
|
+
class CreateSourceLinksRequest {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsArray)(),
|
|
20
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
21
|
+
(0, class_transformer_1.Type)(() => source_link_create_dto_1.SourceLinkCreateDto),
|
|
22
|
+
__metadata("design:type", Array)
|
|
23
|
+
], CreateSourceLinksRequest.prototype, "sourceLinks", void 0);
|
|
24
|
+
exports.CreateSourceLinksRequest = CreateSourceLinksRequest;
|
|
25
|
+
//# sourceMappingURL=create-source-links.request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-source-links.request.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/create-source-links.request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAA0D;AAC1D,qEAA+D;AAE/D,MAAa,wBAAwB;CAKpC;AAJA;IAAC,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,4CAAmB,CAAC;;6DACG;AAJpC,4DAKC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SourceLinkCreateDto } from "./source-link-create.dto";
|
|
2
|
+
import { CreateSourceLinksRequest } from "./create-source-links.request";
|
|
3
|
+
import { SourceLinkUpdateDto } from "./source-link-update.dto";
|
|
4
|
+
import { UpdateSourceLinksRequest } from "./update-source-links.request";
|
|
5
|
+
export { CreateSourceLinksRequest, SourceLinkCreateDto as CreateSourceLinkValidator, SourceLinkUpdateDto as UpdateSourceLinkValidator, UpdateSourceLinksRequest };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateSourceLinksRequest = exports.UpdateSourceLinkValidator = exports.CreateSourceLinkValidator = exports.CreateSourceLinksRequest = void 0;
|
|
4
|
+
const source_link_create_dto_1 = require("./source-link-create.dto");
|
|
5
|
+
Object.defineProperty(exports, "CreateSourceLinkValidator", { enumerable: true, get: function () { return source_link_create_dto_1.SourceLinkCreateDto; } });
|
|
6
|
+
const create_source_links_request_1 = require("./create-source-links.request");
|
|
7
|
+
Object.defineProperty(exports, "CreateSourceLinksRequest", { enumerable: true, get: function () { return create_source_links_request_1.CreateSourceLinksRequest; } });
|
|
8
|
+
const source_link_update_dto_1 = require("./source-link-update.dto");
|
|
9
|
+
Object.defineProperty(exports, "UpdateSourceLinkValidator", { enumerable: true, get: function () { return source_link_update_dto_1.SourceLinkUpdateDto; } });
|
|
10
|
+
const update_source_links_request_1 = require("./update-source-links.request");
|
|
11
|
+
Object.defineProperty(exports, "UpdateSourceLinksRequest", { enumerable: true, get: function () { return update_source_links_request_1.UpdateSourceLinksRequest; } });
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAOvC,0GAPf,4CAAmB,OAOqB;AANjD,+EAAyE;AAKxE,yGALQ,sDAAwB,OAKR;AAJzB,qEAA+D;AAMvC,0GANf,4CAAmB,OAMqB;AALjD,+EAAyE;AAMxE,yGANQ,sDAAwB,OAMR"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SourceLinkLevels, SourceLinkTypes, SourceLinkSubTypes } from "../../../domain/organisations";
|
|
2
|
+
export declare class SourceLinkCreateDto {
|
|
3
|
+
level: SourceLinkLevels;
|
|
4
|
+
type: SourceLinkTypes;
|
|
5
|
+
subType: SourceLinkSubTypes;
|
|
6
|
+
url: string | null;
|
|
7
|
+
doesExist: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.SourceLinkCreateDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const organisations_1 = require("../../../domain/organisations");
|
|
15
|
+
class SourceLinkCreateDto {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsEnum)(organisations_1.SourceLinkLevels),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], SourceLinkCreateDto.prototype, "level", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsEnum)(organisations_1.SourceLinkTypes),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], SourceLinkCreateDto.prototype, "type", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsEnum)(organisations_1.SourceLinkSubTypes),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], SourceLinkCreateDto.prototype, "subType", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
(0, class_validator_1.ValidateIf)((_, value) => value !== null) // Allows only null, but disallows undefined
|
|
32
|
+
,
|
|
33
|
+
__metadata("design:type", Object)
|
|
34
|
+
], SourceLinkCreateDto.prototype, "url", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, class_validator_1.IsBoolean)(),
|
|
37
|
+
__metadata("design:type", Boolean)
|
|
38
|
+
], SourceLinkCreateDto.prototype, "doesExist", void 0);
|
|
39
|
+
exports.SourceLinkCreateDto = SourceLinkCreateDto;
|
|
40
|
+
//# sourceMappingURL=source-link-create.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-link-create.dto.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/source-link-create.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0E;AAC1E,iEAAsG;AAEtG,MAAa,mBAAmB;CAgB/B;AAfA;IAAC,IAAA,wBAAM,EAAC,gCAAgB,CAAC;;kDACD;AAExB;IAAC,IAAA,wBAAM,EAAC,+BAAe,CAAC;;iDACF;AAEtB;IAAC,IAAA,wBAAM,EAAC,kCAAkB,CAAC;;oDACC;AAE5B;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,EAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,4CAA4C;;;gDACnE;AAEnB;IAAC,IAAA,2BAAS,GAAE;;sDACO;AAfpB,kDAgBC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.SourceLinkUpdateDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const source_link_create_dto_1 = require("./source-link-create.dto");
|
|
15
|
+
class SourceLinkUpdateDto extends source_link_create_dto_1.SourceLinkCreateDto {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.Min)(1),
|
|
19
|
+
(0, class_validator_1.IsInt)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], SourceLinkUpdateDto.prototype, "id", void 0);
|
|
22
|
+
exports.SourceLinkUpdateDto = SourceLinkUpdateDto;
|
|
23
|
+
//# sourceMappingURL=source-link-update.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-link-update.dto.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/source-link-update.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6C;AAC7C,qEAA+D;AAE/D,MAAa,mBAAoB,SAAQ,4CAAmB;CAI3D;AAHA;IAAC,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,uBAAK,GAAE;;+CACG;AAHZ,kDAIC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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.UpdateSourceLinksRequest = void 0;
|
|
13
|
+
const class_transformer_1 = require("class-transformer");
|
|
14
|
+
const class_validator_1 = require("class-validator");
|
|
15
|
+
const source_link_update_dto_1 = require("./source-link-update.dto");
|
|
16
|
+
class UpdateSourceLinksRequest {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsArray)(),
|
|
20
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
21
|
+
(0, class_transformer_1.Type)(() => source_link_update_dto_1.SourceLinkUpdateDto),
|
|
22
|
+
__metadata("design:type", Array)
|
|
23
|
+
], UpdateSourceLinksRequest.prototype, "sourceLinks", void 0);
|
|
24
|
+
exports.UpdateSourceLinksRequest = UpdateSourceLinksRequest;
|
|
25
|
+
//# sourceMappingURL=update-source-links.request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-source-links.request.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/update-source-links.request.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAyC;AACzC,qDAA0D;AAC1D,qEAA+D;AAE/D,MAAa,wBAAwB;CAKpC;AAJA;IAAC,IAAA,yBAAO,GAAE;IACT,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,4CAAmB,CAAC;;6DACG;AAJpC,4DAKC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CampaignMandatoryFieldsValidator } from "./campaign/mandatory-fields-validator";
|
|
2
2
|
import { SpecificResult } from "./types/SpecificResult";
|
|
3
3
|
import { ValidationResult } from "./types/ValidationResult";
|
|
4
|
+
export * from "./dto/organisations";
|
|
4
5
|
export { ValidationResult, SpecificResult, CampaignMandatoryFieldsValidator };
|
package/src/validation/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
17
|
exports.CampaignMandatoryFieldsValidator = exports.SpecificResult = void 0;
|
|
4
18
|
const mandatory_fields_validator_1 = require("./campaign/mandatory-fields-validator");
|
|
5
19
|
Object.defineProperty(exports, "CampaignMandatoryFieldsValidator", { enumerable: true, get: function () { return mandatory_fields_validator_1.CampaignMandatoryFieldsValidator; } });
|
|
6
20
|
const SpecificResult_1 = require("./types/SpecificResult");
|
|
7
21
|
Object.defineProperty(exports, "SpecificResult", { enumerable: true, get: function () { return SpecificResult_1.SpecificResult; } });
|
|
22
|
+
__exportStar(require("./dto/organisations"), exports);
|
|
8
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/validation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sFAAyF;AASxF,iHATQ,6DAAgC,OASR;AARjC,2DAAwD;AAOvD,+FAPQ,+BAAc,OAOR;AAJf,sDAAoC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetCampaignsLiftOverviewDto = void 0;
|
|
4
|
-
class GetCampaignsLiftOverviewDto {
|
|
5
|
-
constructor(campaignIds) {
|
|
6
|
-
this.campaignIds = campaignIds;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
exports.GetCampaignsLiftOverviewDto = GetCampaignsLiftOverviewDto;
|
|
10
|
-
//# sourceMappingURL=get-campaigns-lift-overview.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-campaigns-lift-overview.dto.js","sourceRoot":"","sources":["../../../../src/domain/campaign/get-campaigns-lift-overview.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,2BAA2B;IACpC,YACoB,WAAqB;QAArB,gBAAW,GAAX,WAAW,CAAU;IACrC,CAAC;CACR;AAJD,kEAIC"}
|