@studyportals/campaign-management-api-interface 16.1.4 → 16.2.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 +4 -1
- package/index.js +6 -1
- package/index.js.map +1 -1
- package/package.json +52 -52
- package/src/auditor-campaign-management-api.client.d.ts +4 -0
- package/src/auditor-campaign-management-api.client.js +4 -0
- package/src/auditor-campaign-management-api.client.js.map +1 -1
- package/src/domain/campaign/enriched-organisation-geotargeting.dto.d.ts +2 -2
- package/src/domain/campaign/enriched-study-geotargeting.dto.d.ts +2 -2
- package/src/domain/campaign/entity-geotargeting.dto.d.ts +5 -5
- package/src/domain/campaign/targeted-countries.dto.d.ts +3 -0
- package/src/domain/campaign/targeted-countries.dto.js +3 -0
- package/src/domain/campaign/targeted-countries.dto.js.map +1 -1
- package/src/domain/types/geotarginator/entity-configs-group.d.ts +5 -0
- package/src/domain/types/geotarginator/entity-configs-group.js +3 -0
- package/src/domain/types/geotarginator/entity-configs-group.js.map +1 -0
- package/src/domain/types/geotarginator/flat-entity-config.d.ts +5 -0
- package/src/domain/types/geotarginator/flat-entity-config.js +3 -0
- package/src/domain/types/geotarginator/flat-entity-config.js.map +1 -0
- package/src/domain/types/geotarginator/geotargeting-entity.d.ts +5 -0
- package/src/domain/types/geotarginator/geotargeting-entity.js +3 -0
- package/src/domain/types/geotarginator/geotargeting-entity.js.map +1 -0
- package/src/domain/types/geotarginator/index.d.ts +5 -0
- package/src/domain/types/geotarginator/index.js +3 -0
- package/src/domain/types/geotarginator/index.js.map +1 -0
- package/src/domain/types/geotarginator/save-campaign-geotargeting-request.d.ts +7 -0
- package/src/domain/types/geotarginator/save-campaign-geotargeting-request.js +3 -0
- package/src/domain/types/geotarginator/save-campaign-geotargeting-request.js.map +1 -0
- package/src/domain/types/geotarginator/targeted-countries.d.ts +5 -0
- package/src/domain/types/geotarginator/targeted-countries.js +3 -0
- package/src/domain/types/geotarginator/targeted-countries.js.map +1 -0
- package/src/geotarginator-front-cma-client.d.ts +17 -0
- package/src/geotarginator-front-cma-client.js +48 -0
- package/src/geotarginator-front-cma-client.js.map +1 -0
- package/src/utils/entity-configs.d.ts +17 -0
- package/src/utils/entity-configs.js +37 -0
- package/src/utils/entity-configs.js.map +1 -0
package/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ import { PublicStatusClient } from "./src/public-status-client";
|
|
|
21
21
|
import { CampaignEditorFrontendStatusDto, StatusHealthy, StatusBlocked } from "./src/domain/types/campaign-editor-frontend-status.dto";
|
|
22
22
|
import { PrivateUserCampaignManagementAPIClient } from "./src/private-user-campaign-management-api.client";
|
|
23
23
|
import { IdDto } from "./src/domain/id.dto";
|
|
24
|
+
import { GeotarginatorFrontCMAClient } from "./src/geotarginator-front-cma-client";
|
|
25
|
+
import { groupEntityConfigs, flattenEntityConfigs } from "./src/utils/entity-configs";
|
|
26
|
+
import { SaveCampaignGeotargetingRequest, GeotargetingEntity, TargetedCountries, EntityConfigsGroup, FlatEntityConfig } from "./src/domain/types/geotarginator";
|
|
24
27
|
export * from "./src/domain/campaign";
|
|
25
28
|
export * from "./src/domain/users";
|
|
26
29
|
export * from "./src/validation";
|
|
@@ -28,4 +31,4 @@ export * from "./src/domain/organisations";
|
|
|
28
31
|
export * from "./src/domain/products";
|
|
29
32
|
export * from "./src/domain/degrees";
|
|
30
33
|
export * from "./src/campaign-saving";
|
|
31
|
-
export { AuditorCampaignManagementAPIClient, OrganisationsCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, PrivateUserCampaignManagementAPIClient, UserCampaignManagementAPIClient, StudyCampaignManagementAPIClient, LinksCampaignManagementAPIClient, ProductsCampaignManagementAPIClient, PublicStatusClient, AuditorEntityType, AuditorOperation, LinkType, LinkEntityType, SwappingEnabledLinkTypes, GetAuditorDto, PersistGoogleLinkerResultDto, IdDto, CampaignsEntitiesConfigDto, MinimalOrganisationDto, CampaignEditorFrontendStatusDto, StatusHealthy, StatusBlocked, NumberMap, Pricing, ICampaignAuditorData, SuperAgentResponseCover };
|
|
34
|
+
export { AuditorCampaignManagementAPIClient, OrganisationsCampaignManagementAPIClient, CampaignManagementAPIClient, PrivateCampaignManagementAPIClient, PrivateUserCampaignManagementAPIClient, UserCampaignManagementAPIClient, StudyCampaignManagementAPIClient, LinksCampaignManagementAPIClient, ProductsCampaignManagementAPIClient, PublicStatusClient, GeotarginatorFrontCMAClient, AuditorEntityType, AuditorOperation, LinkType, LinkEntityType, SwappingEnabledLinkTypes, GetAuditorDto, PersistGoogleLinkerResultDto, IdDto, CampaignsEntitiesConfigDto, MinimalOrganisationDto, CampaignEditorFrontendStatusDto, StatusHealthy, StatusBlocked, SaveCampaignGeotargetingRequest, GeotargetingEntity, TargetedCountries, EntityConfigsGroup, FlatEntityConfig, groupEntityConfigs, flattenEntityConfigs, NumberMap, Pricing, ICampaignAuditorData, SuperAgentResponseCover };
|
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Pricing = exports.MinimalOrganisationDto = exports.CampaignsEntitiesConfigDto = exports.IdDto = exports.PersistGoogleLinkerResultDto = exports.GetAuditorDto = exports.SwappingEnabledLinkTypes = exports.LinkEntityType = exports.LinkType = exports.AuditorOperation = exports.AuditorEntityType = exports.PublicStatusClient = exports.ProductsCampaignManagementAPIClient = exports.LinksCampaignManagementAPIClient = exports.StudyCampaignManagementAPIClient = exports.UserCampaignManagementAPIClient = exports.PrivateUserCampaignManagementAPIClient = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.OrganisationsCampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
|
|
17
|
+
exports.Pricing = exports.flattenEntityConfigs = exports.groupEntityConfigs = exports.MinimalOrganisationDto = exports.CampaignsEntitiesConfigDto = exports.IdDto = exports.PersistGoogleLinkerResultDto = exports.GetAuditorDto = exports.SwappingEnabledLinkTypes = exports.LinkEntityType = exports.LinkType = exports.AuditorOperation = exports.AuditorEntityType = exports.GeotarginatorFrontCMAClient = exports.PublicStatusClient = exports.ProductsCampaignManagementAPIClient = exports.LinksCampaignManagementAPIClient = exports.StudyCampaignManagementAPIClient = exports.UserCampaignManagementAPIClient = exports.PrivateUserCampaignManagementAPIClient = exports.PrivateCampaignManagementAPIClient = exports.CampaignManagementAPIClient = exports.OrganisationsCampaignManagementAPIClient = exports.AuditorCampaignManagementAPIClient = void 0;
|
|
18
18
|
const auditor_campaign_management_api_client_1 = require("./src/auditor-campaign-management-api.client");
|
|
19
19
|
Object.defineProperty(exports, "AuditorCampaignManagementAPIClient", { enumerable: true, get: function () { return auditor_campaign_management_api_client_1.AuditorCampaignManagementAPIClient; } });
|
|
20
20
|
const organisations_campaign_management_api_client_1 = require("./src/organisations-campaign-management-api.client");
|
|
@@ -57,6 +57,11 @@ const private_user_campaign_management_api_client_1 = require("./src/private-use
|
|
|
57
57
|
Object.defineProperty(exports, "PrivateUserCampaignManagementAPIClient", { enumerable: true, get: function () { return private_user_campaign_management_api_client_1.PrivateUserCampaignManagementAPIClient; } });
|
|
58
58
|
const id_dto_1 = require("./src/domain/id.dto");
|
|
59
59
|
Object.defineProperty(exports, "IdDto", { enumerable: true, get: function () { return id_dto_1.IdDto; } });
|
|
60
|
+
const geotarginator_front_cma_client_1 = require("./src/geotarginator-front-cma-client");
|
|
61
|
+
Object.defineProperty(exports, "GeotarginatorFrontCMAClient", { enumerable: true, get: function () { return geotarginator_front_cma_client_1.GeotarginatorFrontCMAClient; } });
|
|
62
|
+
const entity_configs_1 = require("./src/utils/entity-configs");
|
|
63
|
+
Object.defineProperty(exports, "groupEntityConfigs", { enumerable: true, get: function () { return entity_configs_1.groupEntityConfigs; } });
|
|
64
|
+
Object.defineProperty(exports, "flattenEntityConfigs", { enumerable: true, get: function () { return entity_configs_1.flattenEntityConfigs; } });
|
|
60
65
|
__exportStar(require("./src/domain/campaign"), exports);
|
|
61
66
|
__exportStar(require("./src/domain/users"), exports);
|
|
62
67
|
__exportStar(require("./src/validation"), exports);
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yGAAkG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,yGAAkG;AA2CjG,mHA3CQ,2EAAkC,OA2CR;AA1CnC,qHAA8G;AA2C7G,yHA3CQ,uFAAwC,OA2CR;AA1CzC,yFAAmF;AA2ClF,4GA3CQ,4DAA2B,OA2CR;AA1C5B,kGAAwF;AAqDvF,kGArDQ,4CAAiB,OAqDR;AApDlB,8FAAqF;AAqDpF,iGArDQ,yCAAgB,OAqDR;AApDjB,0EAAqE;AA0DpE,8FA1DQ,+BAAa,OA0DR;AAzDd,qGAAgG;AA8D/F,2GA9DQ,yDAA0B,OA8DR;AA7D3B,gGAAgH;AAmF/G,wFAnFmB,+BAAO,OAmFnB;AAlFR,yGAAkG;AAsCjG,mHAtCQ,2EAAkC,OAsCR;AArCnC,mGAA4F;AAuC3F,gHAvCQ,qEAA+B,OAuCR;AAtChC,qGAA8F;AAuC7F,iHAvCQ,uEAAgC,OAuCR;AAtCjC,oGAA8F;AA4D7F,uGA5DQ,kDAAsB,OA4DR;AA3DvB,8EAAqE;AA8CpE,yFA9CQ,yBAAQ,OA8CR;AA7CT,6GAAsG;AAmDrG,6GAnDQ,+DAA4B,OAmDR;AAlD7B,oFAA0E;AA6CzE,+FA7CQ,sCAAc,OA6CR;AA5Cf,qGAA8F;AAmC7F,iHAnCQ,uEAAgC,OAmCR;AAlCjC,0GAA+F;AA4C9F,yGA5CQ,2DAAwB,OA4CR;AA1CzB,2GAAoG;AAiCnG,oHAjCQ,6EAAmC,OAiCR;AAhCpC,qEAAgE;AAiC/D,mGAjCQ,yCAAkB,OAiCR;AA/BnB,mHAA2G;AA0B1G,uHA1BQ,oFAAsC,OA0BR;AAzBvC,gDAA4C;AA2C3C,sFA3CQ,cAAK,OA2CR;AA1CN,yFAAmF;AA8BlF,4GA9BQ,4DAA2B,OA8BR;AA7B5B,+DAAsF;AA8DrF,mGA9DQ,mCAAkB,OA8DR;AAClB,qGA/D4B,qCAAoB,OA+D5B;AAtDrB,wDAAsC;AACtC,qDAAmC;AACnC,mDAAiC;AACjC,6DAA2C;AAC3C,wDAAsC;AACtC,uDAAqC;AACrC,wDAAsC"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@studyportals/campaign-management-api-interface",
|
|
3
|
-
"version": "16.1
|
|
4
|
-
"scripts": {
|
|
5
|
-
"compile": "rm -fR bin && npx tsc",
|
|
6
|
-
"test-u": "jest -c jest.config.unit.json --maxWorkers=1",
|
|
7
|
-
"test-i": "nyc mocha src tests-i",
|
|
8
|
-
"prepare-deployment": "npm run test-u && npm run compile && cp package.json bin/package.json && rm -fR bin/tests-u",
|
|
9
|
-
"predeploy": "npm run prepare-deployment",
|
|
10
|
-
"deploy": "npm publish ./bin --access=public",
|
|
11
|
-
"deploy-patch": "npm version patch && npm run deploy",
|
|
12
|
-
"deploy-minor": "npm version minor && npm run deploy",
|
|
13
|
-
"deploy-major": "npm version major && npm run deploy",
|
|
14
|
-
"deploy-beta": "npm version prerelease && npm run deploy -- --tag beta"
|
|
15
|
-
},
|
|
16
|
-
"author": "SPNightsWatch",
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"types": "bin/index.d.ts",
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@studyportals/code-style": "^2.2.1",
|
|
21
|
-
"@testdeck/jest": "^0.3.3",
|
|
22
|
-
"@types/chai": "^4.3.20",
|
|
23
|
-
"@types/jest": "^29.5.14",
|
|
24
|
-
"@types/node": "^22.19.7",
|
|
25
|
-
"@types/superagent": "^8.1.9",
|
|
26
|
-
"chai": "^4.5.0",
|
|
27
|
-
"eslint": "^8.57.1",
|
|
28
|
-
"jest": "^29.7.0",
|
|
29
|
-
"jest-mock-extended": "^3.0.7",
|
|
30
|
-
"superagent-mocker": "^0.5.2",
|
|
31
|
-
"ts-jest": "^29.4.6",
|
|
32
|
-
"ts-node": "^10.9.2",
|
|
33
|
-
"typescript": "^5.9.3"
|
|
34
|
-
},
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@aws-crypto/sha256-js": "^5.2.0",
|
|
37
|
-
"@aws-sdk/credential-provider-node": "^3.972.2",
|
|
38
|
-
"@smithy/signature-v4": "^5.3.8",
|
|
39
|
-
"@studyportals/mb-platform-date-time": "^1.3.1",
|
|
40
|
-
"@studyportals/mb-platform-http-requests": "^2.8.0",
|
|
41
|
-
"@studyportals/university-scheduler-interface": "^0.7.0",
|
|
42
|
-
"class-transformer": "^0.5.1",
|
|
43
|
-
"class-validator": "^0.14.3",
|
|
44
|
-
"inversify": "^6.2.2",
|
|
45
|
-
"reflect-metadata": "^0.2.2",
|
|
46
|
-
"superagent": "^8.1.2"
|
|
47
|
-
},
|
|
48
|
-
"engines": {
|
|
49
|
-
"node": ">=18.x <=22.x",
|
|
50
|
-
"npm ": ">=10.x <=11.x"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@studyportals/campaign-management-api-interface",
|
|
3
|
+
"version": "16.2.1",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"compile": "rm -fR bin && npx tsc",
|
|
6
|
+
"test-u": "jest -c jest.config.unit.json --maxWorkers=1",
|
|
7
|
+
"test-i": "nyc mocha src tests-i",
|
|
8
|
+
"prepare-deployment": "npm run test-u && npm run compile && cp package.json bin/package.json && rm -fR bin/tests-u",
|
|
9
|
+
"predeploy": "npm run prepare-deployment",
|
|
10
|
+
"deploy": "npm publish ./bin --access=public",
|
|
11
|
+
"deploy-patch": "npm version patch && npm run deploy",
|
|
12
|
+
"deploy-minor": "npm version minor && npm run deploy",
|
|
13
|
+
"deploy-major": "npm version major && npm run deploy",
|
|
14
|
+
"deploy-beta": "npm version prerelease && npm run deploy -- --tag beta"
|
|
15
|
+
},
|
|
16
|
+
"author": "SPNightsWatch",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"types": "bin/index.d.ts",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@studyportals/code-style": "^2.2.1",
|
|
21
|
+
"@testdeck/jest": "^0.3.3",
|
|
22
|
+
"@types/chai": "^4.3.20",
|
|
23
|
+
"@types/jest": "^29.5.14",
|
|
24
|
+
"@types/node": "^22.19.7",
|
|
25
|
+
"@types/superagent": "^8.1.9",
|
|
26
|
+
"chai": "^4.5.0",
|
|
27
|
+
"eslint": "^8.57.1",
|
|
28
|
+
"jest": "^29.7.0",
|
|
29
|
+
"jest-mock-extended": "^3.0.7",
|
|
30
|
+
"superagent-mocker": "^0.5.2",
|
|
31
|
+
"ts-jest": "^29.4.6",
|
|
32
|
+
"ts-node": "^10.9.2",
|
|
33
|
+
"typescript": "^5.9.3"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@aws-crypto/sha256-js": "^5.2.0",
|
|
37
|
+
"@aws-sdk/credential-provider-node": "^3.972.2",
|
|
38
|
+
"@smithy/signature-v4": "^5.3.8",
|
|
39
|
+
"@studyportals/mb-platform-date-time": "^1.3.1",
|
|
40
|
+
"@studyportals/mb-platform-http-requests": "^2.8.0",
|
|
41
|
+
"@studyportals/university-scheduler-interface": "^0.7.0",
|
|
42
|
+
"class-transformer": "^0.5.1",
|
|
43
|
+
"class-validator": "^0.14.3",
|
|
44
|
+
"inversify": "^6.2.2",
|
|
45
|
+
"reflect-metadata": "^0.2.2",
|
|
46
|
+
"superagent": "^8.1.2"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=18.x <=22.x",
|
|
50
|
+
"npm ": ">=10.x <=11.x"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -6,6 +6,10 @@ export declare class AuditorCampaignManagementAPIClient {
|
|
|
6
6
|
constructor(baseUrl: string);
|
|
7
7
|
getCampaignAuditorData(campaignID: number, jwt?: string): Promise<GetAuditorDto[]>;
|
|
8
8
|
getStudyAuditorData(studyID: number, jwt?: string): Promise<GetAuditorDto[]>;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Auditing is now handled internally by CMA as part of write operations.
|
|
11
|
+
* Use GeotarginatorFrontCMAClient.saveCampaignGeotargeting() instead—auditing is automatic.
|
|
12
|
+
*/
|
|
9
13
|
storeCampaignAuditorData(operation: AuditorOperation, campaignID: number, username: string, isUserAction: boolean, data: any, jwt?: string): Promise<GetAuditorDto>;
|
|
10
14
|
storeStudyAuditorData(operation: AuditorOperation, studyID: number, username: string, isUserAction: boolean, messageType: string, message: any, jwt?: string): Promise<GetAuditorDto>;
|
|
11
15
|
storeStudiesAuditorData(operation: AuditorOperation, studyIDs: number[], username: string, isUserAction: boolean, messageType: string, message: any, jwt?: string): Promise<GetAuditorDto[]>;
|
|
@@ -27,6 +27,10 @@ let AuditorCampaignManagementAPIClient = class AuditorCampaignManagementAPIClien
|
|
|
27
27
|
const getAuditorDtos = result.body;
|
|
28
28
|
return getAuditorDtos;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Auditing is now handled internally by CMA as part of write operations.
|
|
32
|
+
* Use GeotarginatorFrontCMAClient.saveCampaignGeotargeting() instead—auditing is automatic.
|
|
33
|
+
*/
|
|
30
34
|
async storeCampaignAuditorData(operation, campaignID, username, isUserAction, data, jwt = "") {
|
|
31
35
|
const sendData = {
|
|
32
36
|
"operation": operation,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auditor-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/auditor-campaign-management-api.client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAK1B,yCAAuC;AAEvC,yCAAyC;AAGlC,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAC3C,YACqB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAChC,CAAC;IAEE,KAAK,CAAC,sBAAsB,CAAC,UAAkB,EAAE,GAAG,GAAG,EAAE;QAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,qBAAqB,UAAU,EAAE,EAAE,GAAG,CAAC,CAAC;QAC7E,MAAM,cAAc,GAAG,MAAM,CAAC,IAAuB,CAAC;QAEtD,OAAO,cAAc,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAAC,OAAe,EAAE,GAAG,GAAG,EAAE;QACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,mBAAmB,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;QACxE,MAAM,cAAc,GAAG,MAAM,CAAC,IAAuB,CAAC;QAEtD,OAAO,cAAc,CAAC;IAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"auditor-campaign-management-api.client.js","sourceRoot":"","sources":["../../src/auditor-campaign-management-api.client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GeotargetingEntity } from "../types/geotarginator/geotargeting-entity";
|
|
2
2
|
import { GeotarginatorEntityType } from "./enums";
|
|
3
|
-
export type EnrichedOrganisationGeotargetingDto =
|
|
3
|
+
export type EnrichedOrganisationGeotargetingDto = GeotargetingEntity & {
|
|
4
4
|
name: string;
|
|
5
5
|
entityType: GeotarginatorEntityType.ORGANISATION;
|
|
6
6
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GeotargetingEntity } from "../types/geotarginator/geotargeting-entity";
|
|
2
2
|
import { BachelorDegrees, MasterDegrees, PHDDegrees, PreparationDegrees, ShortDegrees } from "../degrees/enums";
|
|
3
3
|
import { GeotarginatorEntityType, StudyTypes } from "./enums";
|
|
4
4
|
export type StudyDegrees = BachelorDegrees | MasterDegrees | PHDDegrees | PreparationDegrees | ShortDegrees;
|
|
5
|
-
export type EnrichedStudyGeotargetingDto =
|
|
5
|
+
export type EnrichedStudyGeotargetingDto = GeotargetingEntity & {
|
|
6
6
|
name: string;
|
|
7
7
|
degree: StudyDegrees | null;
|
|
8
8
|
level: StudyTypes;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { GeotargetingEntity } from "../types/geotarginator/geotargeting-entity";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use GeotargetingEntity instead.
|
|
4
|
+
*/
|
|
5
|
+
export type EntityGeotargetingDto = GeotargetingEntity;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TargetedCountriesDto = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use TargetedCountries instead.
|
|
6
|
+
*/
|
|
4
7
|
class TargetedCountriesDto {
|
|
5
8
|
}
|
|
6
9
|
exports.TargetedCountriesDto = TargetedCountriesDto;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targeted-countries.dto.js","sourceRoot":"","sources":["../../../../src/domain/campaign/targeted-countries.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;CAIhC;AAJD,oDAIC"}
|
|
1
|
+
{"version":3,"file":"targeted-countries.dto.js","sourceRoot":"","sources":["../../../../src/domain/campaign/targeted-countries.dto.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,oBAAoB;CAIhC;AAJD,oDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-configs-group.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/entity-configs-group.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat-entity-config.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/flat-entity-config.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geotargeting-entity.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/geotargeting-entity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { TargetedCountries } from "./targeted-countries";
|
|
2
|
+
export { GeotargetingEntity } from "./geotargeting-entity";
|
|
3
|
+
export { EntityConfigsGroup } from "./entity-configs-group";
|
|
4
|
+
export { SaveCampaignGeotargetingRequest } from "./save-campaign-geotargeting-request";
|
|
5
|
+
export { FlatEntityConfig } from "./flat-entity-config";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GeotargetingEntity } from "./geotargeting-entity";
|
|
2
|
+
import { EntityConfigsGroup } from "./entity-configs-group";
|
|
3
|
+
export type SaveCampaignGeotargetingRequest = {
|
|
4
|
+
studies: GeotargetingEntity[];
|
|
5
|
+
organisations: GeotargetingEntity[];
|
|
6
|
+
changedEntityConfigGroups: EntityConfigsGroup[];
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-campaign-geotargeting-request.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/save-campaign-geotargeting-request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targeted-countries.js","sourceRoot":"","sources":["../../../../../src/domain/types/geotarginator/targeted-countries.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
2
|
+
import { SaveCampaignGeotargetingRequest } from "./domain/types/geotarginator";
|
|
3
|
+
export declare class GeotarginatorFrontCMAClient {
|
|
4
|
+
private readonly baseUrl;
|
|
5
|
+
constructor(baseUrl: string);
|
|
6
|
+
/**
|
|
7
|
+
* Save campaign geotargeting and pricing configuration.
|
|
8
|
+
*
|
|
9
|
+
* CMA handles routing (active vs future campaign) and auditing internally.
|
|
10
|
+
* The front-end does not need to make separate audit calls.
|
|
11
|
+
*
|
|
12
|
+
* @param campaignId - The campaign ID (used in URL path).
|
|
13
|
+
* @param data - The full save payload (geotargeting + pricing).
|
|
14
|
+
* @param jwt - Authorization header value (e.g., a JWT string as used in other CMA clients).
|
|
15
|
+
*/
|
|
16
|
+
saveCampaignGeotargeting(campaignId: number, data: SaveCampaignGeotargetingRequest, jwt: string): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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.GeotarginatorFrontCMAClient = void 0;
|
|
13
|
+
require("reflect-metadata");
|
|
14
|
+
const inversify_1 = require("inversify");
|
|
15
|
+
let GeotarginatorFrontCMAClient = class GeotarginatorFrontCMAClient {
|
|
16
|
+
constructor(baseUrl) {
|
|
17
|
+
this.baseUrl = baseUrl;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Save campaign geotargeting and pricing configuration.
|
|
21
|
+
*
|
|
22
|
+
* CMA handles routing (active vs future campaign) and auditing internally.
|
|
23
|
+
* The front-end does not need to make separate audit calls.
|
|
24
|
+
*
|
|
25
|
+
* @param campaignId - The campaign ID (used in URL path).
|
|
26
|
+
* @param data - The full save payload (geotargeting + pricing).
|
|
27
|
+
* @param jwt - Authorization header value (e.g., a JWT string as used in other CMA clients).
|
|
28
|
+
*/
|
|
29
|
+
async saveCampaignGeotargeting(campaignId, data, jwt) {
|
|
30
|
+
const response = await fetch(`${this.baseUrl}/campaigns/${campaignId}/geotargeting`, {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers: {
|
|
33
|
+
'Content-Type': 'application/json',
|
|
34
|
+
'Authorization': jwt
|
|
35
|
+
},
|
|
36
|
+
body: JSON.stringify(data)
|
|
37
|
+
});
|
|
38
|
+
if (!response.ok) {
|
|
39
|
+
throw new Error(`Failed to save campaign geotargeting: ${response.status} ${response.statusText}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
exports.GeotarginatorFrontCMAClient = GeotarginatorFrontCMAClient;
|
|
44
|
+
exports.GeotarginatorFrontCMAClient = GeotarginatorFrontCMAClient = __decorate([
|
|
45
|
+
(0, inversify_1.injectable)(),
|
|
46
|
+
__metadata("design:paramtypes", [String])
|
|
47
|
+
], GeotarginatorFrontCMAClient);
|
|
48
|
+
//# sourceMappingURL=geotarginator-front-cma-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geotarginator-front-cma-client.js","sourceRoot":"","sources":["../../src/geotarginator-front-cma-client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4BAA0B;AAC1B,yCAAuC;AAIhC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IACvC,YACkB,OAAe;QAAf,YAAO,GAAP,OAAO,CAAQ;IAC9B,CAAC;IAEJ;;;;;;;;;OASG;IACI,KAAK,CAAC,wBAAwB,CACpC,UAAkB,EAClB,IAAqC,EACrC,GAAW;QAEX,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC3B,GAAG,IAAI,CAAC,OAAO,cAAc,UAAU,eAAe,EACtD;YACC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACR,cAAc,EAAE,kBAAkB;gBAClC,eAAe,EAAE,GAAG;aACpB;YACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC1B,CACD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,yCAAyC,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACpG,CAAC;IACF,CAAC;CACD,CAAA;AApCY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;;GACA,2BAA2B,CAoCvC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EntityConfigsGroup, FlatEntityConfig } from "../domain/types/geotarginator";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a flat list of entity-product assignments into grouped form
|
|
4
|
+
* for use in SaveCampaignGeotargetingRequest.
|
|
5
|
+
*
|
|
6
|
+
* @param flatConfigs - Flat list of entity-product assignments
|
|
7
|
+
* @returns Grouped entity configs
|
|
8
|
+
*/
|
|
9
|
+
export declare function groupEntityConfigs(flatConfigs: FlatEntityConfig[]): EntityConfigsGroup[];
|
|
10
|
+
/**
|
|
11
|
+
* Converts EntityConfigsGroup[] back into a flat list of FlatEntityConfig.
|
|
12
|
+
* Useful for consumers that need to iterate over individual (entity, product) pairs.
|
|
13
|
+
*
|
|
14
|
+
* @param groups - Grouped entity configs
|
|
15
|
+
* @returns Flat list of entity-product assignments
|
|
16
|
+
*/
|
|
17
|
+
export declare function flattenEntityConfigs(groups: EntityConfigsGroup[]): FlatEntityConfig[];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupEntityConfigs = groupEntityConfigs;
|
|
4
|
+
exports.flattenEntityConfigs = flattenEntityConfigs;
|
|
5
|
+
/**
|
|
6
|
+
* Converts a flat list of entity-product assignments into grouped form
|
|
7
|
+
* for use in SaveCampaignGeotargetingRequest.
|
|
8
|
+
*
|
|
9
|
+
* @param flatConfigs - Flat list of entity-product assignments
|
|
10
|
+
* @returns Grouped entity configs
|
|
11
|
+
*/
|
|
12
|
+
function groupEntityConfigs(flatConfigs) {
|
|
13
|
+
const map = new Map();
|
|
14
|
+
for (const config of flatConfigs) {
|
|
15
|
+
const key = `${config.entityType}-${config.entityID}`;
|
|
16
|
+
if (!map.has(key)) {
|
|
17
|
+
map.set(key, { entityID: config.entityID, entityType: config.entityType, productIDs: [] });
|
|
18
|
+
}
|
|
19
|
+
map.get(key).productIDs.push(config.productID);
|
|
20
|
+
}
|
|
21
|
+
return [...map.values()];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Converts EntityConfigsGroup[] back into a flat list of FlatEntityConfig.
|
|
25
|
+
* Useful for consumers that need to iterate over individual (entity, product) pairs.
|
|
26
|
+
*
|
|
27
|
+
* @param groups - Grouped entity configs
|
|
28
|
+
* @returns Flat list of entity-product assignments
|
|
29
|
+
*/
|
|
30
|
+
function flattenEntityConfigs(groups) {
|
|
31
|
+
return groups.flatMap(group => group.productIDs.map(productID => ({
|
|
32
|
+
entityID: group.entityID,
|
|
33
|
+
productID,
|
|
34
|
+
entityType: group.entityType
|
|
35
|
+
})));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=entity-configs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-configs.js","sourceRoot":"","sources":["../../../src/utils/entity-configs.ts"],"names":[],"mappings":";;AASA,gDAUC;AASD,oDAQC;AAlCD;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,WAA+B;IACjE,MAAM,GAAG,GAAG,IAAI,GAAG,EAA8B,CAAC;IAClD,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5F,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,MAA4B;IAChE,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAC7B,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAClC,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,SAAS;QACT,UAAU,EAAE,KAAK,CAAC,UAAU;KAC5B,CAAC,CAAC,CACH,CAAC;AACH,CAAC"}
|