@studyportals/campaign-management-api-interface 0.19.1-2 → 0.20.1-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/index.d.ts CHANGED
@@ -10,6 +10,5 @@ import { PrivateCampaignManagementAPIClient } from "./src/private-campaign-manag
10
10
  import { UserCampaignManagementAPIClient } from "./src/user-campaign-management-api.client";
11
11
  import { StudyCampaignManagementAPIClient } from "./src/study-campaign-management-api.client";
12
12
  import { MinimalOrganisationDto } from "./src/domain/organisations/minimal-organisations.dto";
13
- import { CmsGroupDto } from "./src/domain/users/cms-group.dto";
14
- import { DetailedUserDto } from "./src/domain/users/detailed-user.dto";
15
- export { AuditorCampaignManagementAPIClient, OrganisationsCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, UserCampaignManagementAPIClient, StudyCampaignManagementAPIClient, AuditorEntityType, AuditorOperation, GetAuditorDto, CampaignsEntitiesConfigDto, MinimalOrganisationDto, DetailedUserDto, CmsGroupDto, NumberMap, Pricing, ICampaignAuditorData };
13
+ import { LinkType } from "./src/domain/studies/enums/link-type.enum";
14
+ export { AuditorCampaignManagementAPIClient, OrganisationsCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, UserCampaignManagementAPIClient, StudyCampaignManagementAPIClient, AuditorEntityType, AuditorOperation, LinkType, GetAuditorDto, CampaignsEntitiesConfigDto, MinimalOrganisationDto, 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.Pricing = exports.CmsGroupDto = exports.DetailedUserDto = exports.MinimalOrganisationDto = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.StudyCampaignManagementAPIClient = exports.UserCampaignManagementAPIClient = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.OrganisationsCampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
3
+ exports.Pricing = exports.MinimalOrganisationDto = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.LinkType = exports.AuditorOperation = exports.AuditorEntityType = exports.StudyCampaignManagementAPIClient = exports.UserCampaignManagementAPIClient = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.OrganisationsCampaignManagementAPIClient = 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 organisations_campaign_management_api_client_1 = require("./src/organisations-campaign-management-api.client");
@@ -25,8 +25,6 @@ const study_campaign_management_api_client_1 = require("./src/study-campaign-man
25
25
  Object.defineProperty(exports, "StudyCampaignManagementAPIClient", { enumerable: true, get: function () { return study_campaign_management_api_client_1.StudyCampaignManagementAPIClient; } });
26
26
  const minimal_organisations_dto_1 = require("./src/domain/organisations/minimal-organisations.dto");
27
27
  Object.defineProperty(exports, "MinimalOrganisationDto", { enumerable: true, get: function () { return minimal_organisations_dto_1.MinimalOrganisationDto; } });
28
- const cms_group_dto_1 = require("./src/domain/users/cms-group.dto");
29
- Object.defineProperty(exports, "CmsGroupDto", { enumerable: true, get: function () { return cms_group_dto_1.CmsGroupDto; } });
30
- const detailed_user_dto_1 = require("./src/domain/users/detailed-user.dto");
31
- Object.defineProperty(exports, "DetailedUserDto", { enumerable: true, get: function () { return detailed_user_dto_1.DetailedUserDto; } });
28
+ const link_type_enum_1 = require("./src/domain/studies/enums/link-type.enum");
29
+ Object.defineProperty(exports, "LinkType", { enumerable: true, get: function () { return link_type_enum_1.LinkType; } });
32
30
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index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GAA8F;AAW1F,iHAXK,uEAAgC,OAWL;AAVpC,oGAA8F;AAwB1F,uGAxBK,kDAAsB,OAwBL;AAvB1B,8EAAqE;AAcjE,yFAdK,yBAAQ,OAcL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/campaign-management-api-interface",
3
- "version": "0.19.1-2",
3
+ "version": "0.20.1-1",
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,15 @@
1
+ export declare enum LinkType {
2
+ OTHER = "other",
3
+ HOMEPAGE = "homepage",
4
+ FEATURED = "featured",
5
+ FACEBOOK = "facebook",
6
+ TWITTER = "twitter",
7
+ RSS = "rss",
8
+ FLICKR = "flickr",
9
+ FUNDING = "funding",
10
+ PIXEL = "pixel",
11
+ YOUTUBE = "youtube",
12
+ INSTAGRAM = "instagram",
13
+ SWAPPABLE = "swappable",
14
+ TUITION_FEE = "tuition-fee"
15
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LinkType = void 0;
4
+ var LinkType;
5
+ (function (LinkType) {
6
+ LinkType["OTHER"] = "other";
7
+ LinkType["HOMEPAGE"] = "homepage";
8
+ LinkType["FEATURED"] = "featured";
9
+ LinkType["FACEBOOK"] = "facebook";
10
+ LinkType["TWITTER"] = "twitter";
11
+ LinkType["RSS"] = "rss";
12
+ LinkType["FLICKR"] = "flickr";
13
+ LinkType["FUNDING"] = "funding";
14
+ LinkType["PIXEL"] = "pixel";
15
+ LinkType["YOUTUBE"] = "youtube";
16
+ LinkType["INSTAGRAM"] = "instagram";
17
+ LinkType["SWAPPABLE"] = "swappable";
18
+ LinkType["TUITION_FEE"] = "tuition-fee";
19
+ })(LinkType = exports.LinkType || (exports.LinkType = {}));
20
+ //# sourceMappingURL=link-type.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-type.enum.js","sourceRoot":"","sources":["../../../../../src/domain/studies/enums/link-type.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAcX;AAdD,WAAY,QAAQ;IAChB,2BAAe,CAAA;IACf,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;IACrB,+BAAmB,CAAA;IACnB,uBAAW,CAAA;IACX,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,+BAAmB,CAAA;IACnB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA;IACvB,uCAA2B,CAAA;AAC/B,CAAC,EAdW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAcnB"}
@@ -1,5 +1,7 @@
1
+ import { LinkType } from "./enums/link-type.enum";
1
2
  export declare class LinkDto {
2
3
  url: string;
3
- type: string;
4
+ type: LinkType;
4
5
  description: string;
6
+ name?: string;
5
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"link-dto.js","sourceRoot":"","sources":["../../../../src/domain/studies/link-dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,OAAO;CAInB;AAJD,0BAIC"}
1
+ {"version":3,"file":"link-dto.js","sourceRoot":"","sources":["../../../../src/domain/studies/link-dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,OAAO;CAKnB;AALD,0BAKC"}
@@ -0,0 +1,6 @@
1
+ export declare class SearchUserDto {
2
+ id: number;
3
+ name: string;
4
+ email: string;
5
+ constructor(id: number, name: string, email: string);
6
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchUserDto = void 0;
4
+ class SearchUserDto {
5
+ constructor(id, name, email) {
6
+ this.id = id;
7
+ this.name = name;
8
+ this.email = email;
9
+ }
10
+ }
11
+ exports.SearchUserDto = SearchUserDto;
12
+ //# sourceMappingURL=search-users.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-users.dto.js","sourceRoot":"","sources":["../../../../src/domain/users/search-users.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IAKzB,YACC,EAAU,EACV,IAAY,EACZ,KAAa;QAEb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;CACD;AAdD,sCAcC"}
@@ -1,9 +1,13 @@
1
1
  import "reflect-metadata";
2
2
  import { GetEBPUsersDto } from "./domain/users/get-ebp-users.dto";
3
+ import { SearchUserDto } from "./domain/users/search-users.dto";
3
4
  export declare class UserCampaignManagementAPIClient {
4
5
  private readonly baseUrl;
5
6
  constructor(baseUrl: string);
6
7
  getAllUsersWithEbpPsm(jwt?: string): Promise<GetEBPUsersDto[]>;
8
+ searchUsers(searchParam: string, limit?: number, jwt?: string): Promise<SearchUserDto[]>;
9
+ attachToOrganisation(userId: number, organisationId: number, jwt?: string): Promise<void>;
7
10
  private getRequest;
11
+ private postRequest;
8
12
  private buildBaseUrl;
9
13
  }
@@ -23,11 +23,27 @@ let UserCampaignManagementAPIClient = class UserCampaignManagementAPIClient {
23
23
  const getEBPUsersDtos = result.body;
24
24
  return getEBPUsersDtos;
25
25
  }
26
+ async searchUsers(searchParam, limit, jwt = "") {
27
+ const path = 'users/search-users';
28
+ const result = await this.postRequest(path, { searchParam, limit }, jwt);
29
+ const users = result.body;
30
+ return users;
31
+ }
32
+ async attachToOrganisation(userId, organisationId, jwt = "") {
33
+ const path = 'users/attach-to-organisation';
34
+ await this.postRequest(path, { userId, organisationId }, jwt);
35
+ }
26
36
  async getRequest(relative = "", jwt = "") {
27
37
  return await superagent.get(this.buildBaseUrl(relative))
28
38
  .set("Content-Type", "application/json")
29
39
  .set("Authorization", jwt);
30
40
  }
41
+ async postRequest(relative = "", body, jwt = "") {
42
+ return await superagent.post(this.buildBaseUrl(relative))
43
+ .set("Content-Type", "application/json")
44
+ .set("Authorization", jwt)
45
+ .send(body);
46
+ }
31
47
  buildBaseUrl(relative) {
32
48
  return `${this.baseUrl}/${relative}`;
33
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"user-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/user-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAE1B,yCAAuC;AACvC,yCAAyC;AAIlC,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC3C,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC7B,CAAC;IAEE,KAAK,CAAC,qBAAqB,CAAC,MAAc,EAAE;QAClD,MAAM,IAAI,GAAG,kCAAkC,CAAC;QAEhD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAChD,MAAM,eAAe,GAAG,MAAM,CAAC,IAAwB,CAAC;QAExD,OAAO,eAAe,CAAC;IACxB,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,WAAmB,EAAE,EAAE,MAAc,EAAE;QAC/D,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,CAAC;IAC7B,CAAC;IAGO,YAAY,CAAC,QAAgB;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;IACtC,CAAC;CACD,CAAA;AAxBY,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;;GACA,+BAA+B,CAwB3C;AAxBY,0EAA+B"}
1
+ {"version":3,"file":"user-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/user-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAE1B,yCAAuC;AACvC,yCAAyC;AAKlC,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAC3C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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;AA9CY,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;;GACA,+BAA+B,CA8C3C;AA9CY,0EAA+B"}
@@ -1,5 +0,0 @@
1
- export declare class CmsGroupDto {
2
- readonly id: number;
3
- readonly name: string;
4
- constructor(id: number, name: string);
5
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CmsGroupDto = void 0;
4
- class CmsGroupDto {
5
- constructor(id, name) {
6
- this.id = id;
7
- this.name = name;
8
- }
9
- }
10
- exports.CmsGroupDto = CmsGroupDto;
11
- //# sourceMappingURL=cms-group.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cms-group.dto.js","sourceRoot":"","sources":["../../../../src/domain/users/cms-group.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;IACpB,YACoB,EAAU,EACV,IAAY;QADZ,OAAE,GAAF,EAAE,CAAQ;QACV,SAAI,GAAJ,IAAI,CAAQ;IAC7B,CAAC;CACP;AALD,kCAKC"}
@@ -1,14 +0,0 @@
1
- import { CmsGroupDto } from "./cms-group.dto";
2
- export declare class DetailedUserDto {
3
- readonly id: number;
4
- readonly fullName: string;
5
- readonly email: string;
6
- readonly Role: string;
7
- readonly cmsGroups: CmsGroupDto[];
8
- readonly phoneNumber: string;
9
- readonly canSeeleads: boolean;
10
- readonly hasTableauAccess: boolean;
11
- readonly hasERTAccess: boolean;
12
- readonly hasSMTAccess: boolean;
13
- constructor(id: number, fullName: string, email: string, Role: string, cmsGroups: CmsGroupDto[], phoneNumber: string, canSeeleads: boolean, hasTableauAccess: boolean, hasERTAccess: boolean, hasSMTAccess: boolean);
14
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DetailedUserDto = void 0;
4
- class DetailedUserDto {
5
- constructor(id, fullName, email, Role, cmsGroups, phoneNumber, canSeeleads, hasTableauAccess, hasERTAccess, hasSMTAccess) {
6
- this.id = id;
7
- this.fullName = fullName;
8
- this.email = email;
9
- this.Role = Role;
10
- this.cmsGroups = cmsGroups;
11
- this.phoneNumber = phoneNumber;
12
- this.canSeeleads = canSeeleads;
13
- this.hasTableauAccess = hasTableauAccess;
14
- this.hasERTAccess = hasERTAccess;
15
- this.hasSMTAccess = hasSMTAccess;
16
- }
17
- }
18
- exports.DetailedUserDto = DetailedUserDto;
19
- //# sourceMappingURL=detailed-user.dto.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"detailed-user.dto.js","sourceRoot":"","sources":["../../../../src/domain/users/detailed-user.dto.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAe;IACxB,YACoB,EAAU,EACV,QAAgB,EAChB,KAAa,EACb,IAAY,EACZ,SAAwB,EACxB,WAAmB,EACnB,WAAoB,EACpB,gBAAyB,EACzB,YAAqB,EACrB,YAAqB;QATrB,OAAE,GAAF,EAAE,CAAQ;QACV,aAAQ,GAAR,QAAQ,CAAQ;QAChB,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;QACZ,cAAS,GAAT,SAAS,CAAe;QACxB,gBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAW,GAAX,WAAW,CAAS;QACpB,qBAAgB,GAAhB,gBAAgB,CAAS;QACzB,iBAAY,GAAZ,YAAY,CAAS;QACrB,iBAAY,GAAZ,YAAY,CAAS;IACrC,CAAC;CACR;AAbD,0CAaC"}