@studyportals/campaign-management-api-interface 0.33.1-3 → 0.33.1-4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/campaign-management-api-interface",
3
- "version": "0.33.1-3",
3
+ "version": "0.33.1-4",
4
4
  "scripts": {
5
5
  "compile": "rm -fR bin && npx tsc",
6
6
  "test-u": "jest -c jest.config.unit.json --maxWorkers=1",
@@ -0,0 +1,4 @@
1
+ import { Link } from "./link.dto";
2
+ export declare class CreateOrUpdateLinksResponse {
3
+ constructor(createdLinks: Link[], updatedLinks: Link[]);
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateOrUpdateLinksResponse = void 0;
4
+ class CreateOrUpdateLinksResponse {
5
+ constructor(createdLinks, updatedLinks) { }
6
+ }
7
+ exports.CreateOrUpdateLinksResponse = CreateOrUpdateLinksResponse;
8
+ //# sourceMappingURL=create-or-update-link-response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-or-update-link-response.dto.js","sourceRoot":"","sources":["../../../../src/domain/links/create-or-update-link-response.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,2BAA2B;IACvC,YACC,YAAoB,EACpB,YAAoB,IACjB,CAAC;CACL;AALD,kEAKC"}
@@ -0,0 +1,12 @@
1
+ export declare class Link {
2
+ id: number;
3
+ studyId: number;
4
+ organisationId: number;
5
+ countryId: number;
6
+ url: string;
7
+ type: string;
8
+ description: string;
9
+ name: string;
10
+ active: boolean;
11
+ constructor(id: number, studyId: number, organisationId: number, countryId: number, url: string, type: string, description: string, name: string, active: boolean);
12
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Link = void 0;
4
+ class Link {
5
+ constructor(id, studyId, organisationId, countryId, url, type, description, name, active) {
6
+ this.id = id;
7
+ this.studyId = studyId;
8
+ this.organisationId = organisationId;
9
+ this.countryId = countryId;
10
+ this.url = url;
11
+ this.type = type;
12
+ this.description = description;
13
+ this.name = name;
14
+ this.active = active;
15
+ }
16
+ }
17
+ exports.Link = Link;
18
+ //# sourceMappingURL=link.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.dto.js","sourceRoot":"","sources":["../../../../src/domain/links/link.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,IAAI;IAChB,YACQ,EAAU,EACV,OAAe,EACf,cAAsB,EACtB,SAAiB,EACjB,GAAW,EACX,IAAY,EACZ,WAAmB,EACnB,IAAY,EACZ,MAAe;QARf,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAQ;QACf,mBAAc,GAAd,cAAc,CAAQ;QACtB,cAAS,GAAT,SAAS,CAAQ;QACjB,QAAG,GAAH,GAAG,CAAQ;QACX,SAAI,GAAJ,IAAI,CAAQ;QACZ,gBAAW,GAAX,WAAW,CAAQ;QACnB,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAS;IACnB,CAAC;CACL;AAZD,oBAYC"}
@@ -2,10 +2,11 @@ import "reflect-metadata";
2
2
  import { CreateLinkDto } from "./domain/links/create-link.dto";
3
3
  import { UpdateLinkDto } from "./domain/links/update-link.dto";
4
4
  import { ParentEntityDto } from "./domain/links/parent-entity.dto";
5
+ import { CreateOrUpdateLinksResponse } from "./domain/links/create-or-update-link-response.dto";
5
6
  export declare class LinksCampaignManagementAPIClient {
6
7
  private readonly baseUrl;
7
8
  constructor(baseUrl: string);
8
- createOrUpdateLinks(parentEntity: ParentEntityDto, linksToCreate: CreateLinkDto[], linksToUpdate: UpdateLinkDto[], jwt?: string): Promise<void>;
9
+ createOrUpdateLinks(parentEntity: ParentEntityDto, linksToCreate: CreateLinkDto[], linksToUpdate: UpdateLinkDto[], jwt?: string): Promise<CreateOrUpdateLinksResponse>;
9
10
  private postRequest;
10
11
  private buildBaseUrl;
11
12
  }
@@ -27,9 +27,7 @@ let LinksCampaignManagementAPIClient = class LinksCampaignManagementAPIClient {
27
27
  // update path when decided on the path and if changed
28
28
  const path = 'links/create-or-update-links';
29
29
  const result = await this.postRequest(path, sendData, jwt);
30
- if (result.status !== 200) {
31
- throw new Error("Failed to create or update links");
32
- }
30
+ return result.body;
33
31
  }
34
32
  async postRequest(relative = "", data, jwt = "") {
35
33
  return await superagent.post(this.buildBaseUrl(relative))
@@ -1 +1 @@
1
- {"version":3,"file":"links-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/links-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAM1B,yCAAuC;AAEvC,yCAAyC;AASlC,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC5C,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,mBAAmB,CAC/B,YAA6B,EAC7B,aAA8B,EAC9B,aAA8B,EAC9B,MAAc,EAAE;QAEhB,MAAM,QAAQ,GAAG;YAChB,UAAU,EAAE,YAAY,CAAC,IAAI;YAC7B,QAAQ,EAAE,YAAY,CAAC,EAAE;YACzB,aAAa;YACb,aAAa;SACb,CAAC;QACF,sDAAsD;QACtD,MAAM,IAAI,GAAG,8BAA8B,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3D,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE;YAC1B,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;SACpD;IACF,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,EAAE,IAAS,EAAE,GAAG,GAAG,EAAE;QACnE,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACvD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAGO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AApCY,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;;GACA,gCAAgC,CAoC5C;AApCY,4EAAgC"}
1
+ {"version":3,"file":"links-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/links-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAG1B,yCAAuC;AAEvC,yCAAyC;AAOlC,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAC5C,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,mBAAmB,CAC/B,YAA6B,EAC7B,aAA8B,EAC9B,aAA8B,EAC9B,MAAc,EAAE;QAEhB,MAAM,QAAQ,GAAG;YAChB,UAAU,EAAE,YAAY,CAAC,IAAI;YAC7B,QAAQ,EAAE,YAAY,CAAC,EAAE;YACzB,aAAa;YACb,aAAa;SACb,CAAC;QACF,sDAAsD;QACtD,MAAM,IAAI,GAAG,8BAA8B,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;QAE3D,OAAO,MAAM,CAAC,IAAmC,CAAC;IACnD,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,WAAmB,EAAE,EAAE,IAAS,EAAE,GAAG,GAAG,EAAE;QACnE,OAAO,MAAM,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACvD,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC;aACvC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC;aACzB,IAAI,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAGO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AAnCY,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;;GACA,gCAAgC,CAmC5C;AAnCY,4EAAgC"}