@studyportals/campaign-management-api-interface 3.6.2-1 → 3.6.2-2
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/organisations-campaign-management-api.client.d.ts +5 -3
- package/src/organisations-campaign-management-api.client.js +23 -6
- package/src/organisations-campaign-management-api.client.js.map +1 -1
- package/src/validation/dto/organisations/create-source-link-validator.d.ts +8 -0
- package/src/validation/dto/organisations/create-source-link-validator.js +38 -0
- package/src/validation/dto/organisations/create-source-link-validator.js.map +1 -0
- package/src/validation/dto/organisations/create-source-links.request.d.ts +5 -0
- package/src/validation/dto/organisations/create-source-links.request.js +29 -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/update-source-link-validator.d.ts +4 -0
- package/src/validation/dto/organisations/update-source-link-validator.js +23 -0
- package/src/validation/dto/organisations/update-source-link-validator.js.map +1 -0
- package/src/validation/dto/organisations/update-source-links.request.d.ts +5 -0
- package/src/validation/dto/organisations/update-source-links.request.js +29 -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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studyportals/campaign-management-api-interface",
|
|
3
|
-
"version": "3.6.2-
|
|
3
|
+
"version": "3.6.2-2",
|
|
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"
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
2
|
import { MinimalOrganisationDto } from "./domain/organisations/minimal-organisations.dto";
|
|
3
|
-
import {
|
|
3
|
+
import { SourceLinkDto } from "./domain/organisations";
|
|
4
|
+
import { CreateSourceLinkValidator } from "./validation/dto/organisations/create-source-link-validator";
|
|
5
|
+
import { UpdateSourceLinkValidator } from "./validation/dto/organisations/update-source-link-validator";
|
|
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[]>;
|
|
10
|
-
createSourceLinks(sourceLinks:
|
|
11
|
-
updateSourceLinks(sourceLinks:
|
|
12
|
+
createSourceLinks(organisationID: number, sourceLinks: CreateSourceLinkValidator[], jwt?: string): Promise<void>;
|
|
13
|
+
updateSourceLinks(organisationID: number, sourceLinks: UpdateSourceLinkValidator[], jwt?: string): Promise<void>;
|
|
12
14
|
private postRequest;
|
|
13
15
|
private putRequest;
|
|
14
16
|
private getRequest;
|
|
@@ -13,6 +13,9 @@ exports.OrganisationsCampaignManagementAPIClient = void 0;
|
|
|
13
13
|
require("reflect-metadata");
|
|
14
14
|
const inversify_1 = require("inversify");
|
|
15
15
|
const superagent = require("superagent");
|
|
16
|
+
const update_source_links_request_1 = require("./validation/dto/organisations/update-source-links.request");
|
|
17
|
+
const class_validator_1 = require("class-validator");
|
|
18
|
+
const create_source_links_request_1 = require("./validation/dto/organisations/create-source-links.request");
|
|
16
19
|
let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManagementAPIClient {
|
|
17
20
|
constructor(baseUrl) {
|
|
18
21
|
this.baseUrl = baseUrl;
|
|
@@ -50,10 +53,17 @@ let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManage
|
|
|
50
53
|
throw new Error(`getSourceLinks error: ${error}`);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
|
-
async createSourceLinks(sourceLinks, jwt = "") {
|
|
56
|
+
async createSourceLinks(organisationID, sourceLinks, jwt = "") {
|
|
54
57
|
try {
|
|
55
|
-
const path = `organisations/source-links`;
|
|
56
|
-
const
|
|
58
|
+
const path = `organisations/${organisationID}/source-links`;
|
|
59
|
+
const data = new create_source_links_request_1.CreateSourceLinksRequest();
|
|
60
|
+
data.organisationId = organisationID;
|
|
61
|
+
data.sourceLinks = sourceLinks;
|
|
62
|
+
const errors = await (0, class_validator_1.validate)(data);
|
|
63
|
+
if (errors.length > 0) {
|
|
64
|
+
throw new Error(`createSourceLinks validation error: ${errors}`);
|
|
65
|
+
}
|
|
66
|
+
const result = await this.postRequest(path, data, jwt);
|
|
57
67
|
if (result.status !== 201) {
|
|
58
68
|
throw new Error(`createSourceLinks status is not 201. ${result.body}`);
|
|
59
69
|
}
|
|
@@ -62,10 +72,17 @@ let OrganisationsCampaignManagementAPIClient = class OrganisationsCampaignManage
|
|
|
62
72
|
throw new Error(`createSourceLinks error: ${error}`);
|
|
63
73
|
}
|
|
64
74
|
}
|
|
65
|
-
async updateSourceLinks(sourceLinks, jwt = "") {
|
|
75
|
+
async updateSourceLinks(organisationID, sourceLinks, jwt = "") {
|
|
66
76
|
try {
|
|
67
|
-
const path = `organisations/source-links`;
|
|
68
|
-
const
|
|
77
|
+
const path = `organisations/${organisationID}/source-links`;
|
|
78
|
+
const data = new update_source_links_request_1.UpdateSourceLinksRequest();
|
|
79
|
+
data.organisationId = organisationID;
|
|
80
|
+
data.sourceLinks = sourceLinks;
|
|
81
|
+
const errors = await (0, class_validator_1.validate)(data);
|
|
82
|
+
if (errors.length > 0) {
|
|
83
|
+
throw new Error(`updateSourceLinks validation error: ${errors}`);
|
|
84
|
+
}
|
|
85
|
+
const result = await this.putRequest(path, data, jwt);
|
|
69
86
|
if (result.status === 200) {
|
|
70
87
|
throw new Error(`updateSourceLinks status is not 200. ${result.body}`);
|
|
71
88
|
}
|
|
@@ -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;AAKzC,4GAAsG;AACtG,qDAA2C;AAC3C,4GAAsG;AAG/F,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,MAA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G,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAE,IAAY,EAAE,GAAG,GAAG,EAAE;QACrE,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,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;AA7GY,wCAAwC;IADpD,IAAA,sBAAU,GAAE;;GACA,wCAAwC,CA6GpD;AA7GY,4FAAwC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SourceLinkLevels, SourceLinkTypes, SourceLinkSubTypes } from "../../../domain/organisations";
|
|
2
|
+
export declare class CreateSourceLinkValidator {
|
|
3
|
+
level: SourceLinkLevels;
|
|
4
|
+
type: SourceLinkTypes;
|
|
5
|
+
subType: SourceLinkSubTypes;
|
|
6
|
+
url: string;
|
|
7
|
+
doesExist: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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.CreateSourceLinkValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const organisations_1 = require("../../../domain/organisations");
|
|
15
|
+
class CreateSourceLinkValidator {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsEnum)(organisations_1.SourceLinkLevels),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], CreateSourceLinkValidator.prototype, "level", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, class_validator_1.IsEnum)(organisations_1.SourceLinkTypes),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], CreateSourceLinkValidator.prototype, "type", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, class_validator_1.IsIn)([null, ...Object.values(organisations_1.SourceLinkSubTypes)]),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], CreateSourceLinkValidator.prototype, "subType", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, class_validator_1.IsString)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], CreateSourceLinkValidator.prototype, "url", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsBoolean)(),
|
|
35
|
+
__metadata("design:type", Boolean)
|
|
36
|
+
], CreateSourceLinkValidator.prototype, "doesExist", void 0);
|
|
37
|
+
exports.CreateSourceLinkValidator = CreateSourceLinkValidator;
|
|
38
|
+
//# sourceMappingURL=create-source-link-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-source-link-validator.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/create-source-link-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAoE;AACpE,iEAAsG;AAEtG,MAAa,yBAAyB;CAerC;AAdA;IAAC,IAAA,wBAAM,EAAC,gCAAgB,CAAC;;wDACD;AAExB;IAAC,IAAA,wBAAM,EAAC,+BAAe,CAAC;;uDACF;AAEtB;IAAC,IAAA,sBAAI,EAAC,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,kCAAkB,CAAC,CAAC,CAAC;;0DACvB;AAE5B;IAAC,IAAA,0BAAQ,GAAE;;sDACC;AAEZ;IAAC,IAAA,2BAAS,GAAE;;4DACO;AAdpB,8DAeC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 create_source_link_validator_1 = require("./create-source-link-validator");
|
|
16
|
+
class CreateSourceLinksRequest {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsInt)(),
|
|
20
|
+
(0, class_validator_1.Min)(1),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], CreateSourceLinksRequest.prototype, "organisationId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
25
|
+
(0, class_transformer_1.Type)(() => create_source_link_validator_1.CreateSourceLinkValidator),
|
|
26
|
+
__metadata("design:type", Array)
|
|
27
|
+
], CreateSourceLinksRequest.prototype, "sourceLinks", void 0);
|
|
28
|
+
exports.CreateSourceLinksRequest = CreateSourceLinksRequest;
|
|
29
|
+
//# 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,qDAA6D;AAC7D,iFAA2E;AAE3E,MAAa,wBAAwB;CAQpC;AAPA;IAAC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;gEACgB;AAEvB;IAAC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,wDAAyB,CAAC;;6DACG;AAP1C,4DAQC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CreateSourceLinkValidator } from "./create-source-link-validator";
|
|
2
|
+
import { CreateSourceLinksRequest } from "./create-source-links.request";
|
|
3
|
+
import { UpdateSourceLinkValidator } from "./update-source-link-validator";
|
|
4
|
+
import { UpdateSourceLinksRequest } from "./update-source-links.request";
|
|
5
|
+
export { CreateSourceLinksRequest, CreateSourceLinkValidator, 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 create_source_link_validator_1 = require("./create-source-link-validator");
|
|
5
|
+
Object.defineProperty(exports, "CreateSourceLinkValidator", { enumerable: true, get: function () { return create_source_link_validator_1.CreateSourceLinkValidator; } });
|
|
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 update_source_link_validator_1 = require("./update-source-link-validator");
|
|
9
|
+
Object.defineProperty(exports, "UpdateSourceLinkValidator", { enumerable: true, get: function () { return update_source_link_validator_1.UpdateSourceLinkValidator; } });
|
|
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,iFAA2E;AAO1E,0GAPQ,wDAAyB,OAOR;AAN1B,+EAAyE;AAKxE,yGALQ,sDAAwB,OAKR;AAJzB,iFAA2E;AAM1E,0GANQ,wDAAyB,OAMR;AAL1B,+EAAyE;AAMxE,yGANQ,sDAAwB,OAMR"}
|
|
@@ -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.UpdateSourceLinkValidator = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
const create_source_link_validator_1 = require("./create-source-link-validator");
|
|
15
|
+
class UpdateSourceLinkValidator extends create_source_link_validator_1.CreateSourceLinkValidator {
|
|
16
|
+
}
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsInt)(),
|
|
19
|
+
(0, class_validator_1.Min)(1),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], UpdateSourceLinkValidator.prototype, "id", void 0);
|
|
22
|
+
exports.UpdateSourceLinkValidator = UpdateSourceLinkValidator;
|
|
23
|
+
//# sourceMappingURL=update-source-link-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-source-link-validator.js","sourceRoot":"","sources":["../../../../../src/validation/dto/organisations/update-source-link-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6C;AAC7C,iFAA2E;AAE3E,MAAa,yBAA0B,SAAQ,wDAAyB;CAIvE;AAHA;IAAC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;qDACI;AAHZ,8DAIC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 update_source_link_validator_1 = require("./update-source-link-validator");
|
|
16
|
+
class UpdateSourceLinksRequest {
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, class_validator_1.IsInt)(),
|
|
20
|
+
(0, class_validator_1.Min)(1),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], UpdateSourceLinksRequest.prototype, "organisationId", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
25
|
+
(0, class_transformer_1.Type)(() => update_source_link_validator_1.UpdateSourceLinkValidator),
|
|
26
|
+
__metadata("design:type", Array)
|
|
27
|
+
], UpdateSourceLinksRequest.prototype, "sourceLinks", void 0);
|
|
28
|
+
exports.UpdateSourceLinksRequest = UpdateSourceLinksRequest;
|
|
29
|
+
//# 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,qDAA6D;AAC7D,iFAA2E;AAE3E,MAAa,wBAAwB;CAQpC;AAPA;IAAC,IAAA,uBAAK,GAAE;IACP,IAAA,qBAAG,EAAC,CAAC,CAAC;;gEACgB;AAEvB;IAAC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;IAC7B,IAAA,wBAAI,EAAC,GAAG,EAAE,CAAC,wDAAyB,CAAC;;6DACG;AAP1C,4DAQC"}
|
|
@@ -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"}
|