@studyportals/campaign-management-api-interface 0.14.1 → 0.15.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/index.d.ts CHANGED
@@ -6,4 +6,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
8
  import { PrivateCampaignManagementAPIClient } from "./src/private-campaign-management-api.client";
9
- export { AuditorCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, AuditorEntityType, AuditorOperation, GetAuditorDto, CampaignsEntitiesConfigDto, NumberMap, Pricing, ICampaignAuditorData };
9
+ import { UserCampaignManagementAPIClient } from "./src/user-campaign-management-api.client";
10
+ export { AuditorCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, UserCampaignManagementAPIClient, 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.Pricing = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
3
+ exports.Pricing = exports.CampaignsEntitiesConfigDto = exports.GetAuditorDto = exports.AuditorOperation = exports.AuditorEntityType = exports.UserCampaignManagementAPIClient = exports.PrivateCampaignManagementAPIClient = 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");
@@ -17,4 +17,6 @@ const geotargeting_entities_1 = require("./src/domain/auditor/campaigns/geotarge
17
17
  Object.defineProperty(exports, "Pricing", { enumerable: true, get: function () { return geotargeting_entities_1.Pricing; } });
18
18
  const private_campaign_management_api_client_1 = require("./src/private-campaign-management-api.client");
19
19
  Object.defineProperty(exports, "PrivateCampaignManagementAPIClient", { enumerable: true, get: function () { return private_campaign_management_api_client_1.PrivateCampaignManagementAPIClient; } });
20
+ const user_campaign_management_api_client_1 = require("./src/user-campaign-management-api.client");
21
+ Object.defineProperty(exports, "UserCampaignManagementAPIClient", { enumerable: true, get: function () { return user_campaign_management_api_client_1.UserCampaignManagementAPIClient; } });
20
22
  //# 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;AAW9F,mHAXK,2EAAkC,OAWL;AAVtC,yFAAmF;AAW/E,4GAXK,4DAA2B,OAWL;AAV/B,kGAAwF;AAcpF,kGAdK,4CAAiB,OAcL;AAbrB,8FAAqF;AAcjF,iGAdK,yCAAgB,OAcL;AAbpB,0EAAqE;AAgBjE,8FAhBK,+BAAa,OAgBL;AAfjB,mGAA+F;AAkB3F,2GAlBK,wDAA0B,OAkBL;AAjB9B,gGAAgH;AAoB5G,wFApBgB,+BAAO,OAoBhB;AAnBX,yGAAkG;AAM9F,mHANK,2EAAkC,OAML"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,yGAAkG;AAY9F,mHAZK,2EAAkC,OAYL;AAXtC,yFAAmF;AAY/E,4GAZK,4DAA2B,OAYL;AAX/B,kGAAwF;AAgBpF,kGAhBK,4CAAiB,OAgBL;AAfrB,8FAAqF;AAgBjF,iGAhBK,yCAAgB,OAgBL;AAfpB,0EAAqE;AAkBjE,8FAlBK,+BAAa,OAkBL;AAjBjB,mGAA+F;AAoB3F,2GApBK,wDAA0B,OAoBL;AAnB9B,gGAAgH;AAsB5G,wFAtBgB,+BAAO,OAsBhB;AArBX,yGAAkG;AAO9F,mHAPK,2EAAkC,OAOL;AANtC,mGAA4F;AAOxF,gHAPK,qEAA+B,OAOL"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studyportals/campaign-management-api-interface",
3
- "version": "0.14.1",
3
+ "version": "0.15.2",
4
4
  "scripts": {
5
5
  "compile": "rm -fR bin && npx tsc",
6
6
  "test-u": "jest -c jest.config.unit.json --silent --maxWorkers=1",
@@ -0,0 +1,5 @@
1
+ export declare class GetEBPUsersDto {
2
+ id: number;
3
+ name: string;
4
+ constructor(id: number, name: string);
5
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetEBPUsersDto = void 0;
4
+ class GetEBPUsersDto {
5
+ constructor(id, name) {
6
+ this.id = id;
7
+ this.name = name;
8
+ }
9
+ }
10
+ exports.GetEBPUsersDto = GetEBPUsersDto;
11
+ //# sourceMappingURL=get-ebp-users.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-ebp-users.dto.js","sourceRoot":"","sources":["../../../../src/domain/users/get-ebp-users.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAc;IAI1B,YACC,EAAU,EACV,IAAY;QAEZ,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CACD;AAXD,wCAWC"}
@@ -0,0 +1,9 @@
1
+ import "reflect-metadata";
2
+ import { GetEBPUsersDto } from "./domain/users/get-ebp-users.dto";
3
+ export declare class UserCampaignManagementAPIClient {
4
+ private readonly baseUrl;
5
+ constructor(baseUrl: string);
6
+ getAllUsersWithEbpPsm(jwt?: string): Promise<GetEBPUsersDto[]>;
7
+ private getRequest;
8
+ private buildBaseUrl;
9
+ }
@@ -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.UserCampaignManagementAPIClient = void 0;
13
+ require("reflect-metadata");
14
+ const inversify_1 = require("inversify");
15
+ const superagent = require("superagent");
16
+ let UserCampaignManagementAPIClient = class UserCampaignManagementAPIClient {
17
+ constructor(baseUrl) {
18
+ this.baseUrl = baseUrl;
19
+ }
20
+ async getAllUsersWithEbpPsm(jwt = "") {
21
+ const path = 'users/get-all-users-with-ebp-psm';
22
+ const result = await this.getRequest(path, jwt);
23
+ const getEBPUsersDtos = result.body;
24
+ return getEBPUsersDtos;
25
+ }
26
+ async getRequest(relative = "", jwt = "") {
27
+ return await superagent.get(this.buildBaseUrl(relative))
28
+ .set("Content-Type", "application/json")
29
+ .set("Authorization", jwt);
30
+ }
31
+ buildBaseUrl(relative) {
32
+ return `${this.baseUrl}/${relative}`;
33
+ }
34
+ };
35
+ UserCampaignManagementAPIClient = __decorate([
36
+ (0, inversify_1.injectable)(),
37
+ __metadata("design:paramtypes", [String])
38
+ ], UserCampaignManagementAPIClient);
39
+ exports.UserCampaignManagementAPIClient = UserCampaignManagementAPIClient;
40
+ //# sourceMappingURL=user-campaign-management-api.client.js.map
@@ -0,0 +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;QAEhD,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;AAzBY,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;;GACA,+BAA+B,CAyB3C;AAzBY,0EAA+B"}