@studyportals/campaign-management-api-interface 16.2.0 → 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/package.json
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "reflect-metadata";
|
|
1
2
|
import { SaveCampaignGeotargetingRequest } from "./domain/types/geotarginator";
|
|
2
3
|
export declare class GeotarginatorFrontCMAClient {
|
|
3
4
|
private readonly baseUrl;
|
|
@@ -10,7 +11,7 @@ export declare class GeotarginatorFrontCMAClient {
|
|
|
10
11
|
*
|
|
11
12
|
* @param campaignId - The campaign ID (used in URL path).
|
|
12
13
|
* @param data - The full save payload (geotargeting + pricing).
|
|
13
|
-
* @param
|
|
14
|
+
* @param jwt - Authorization header value (e.g., a JWT string as used in other CMA clients).
|
|
14
15
|
*/
|
|
15
|
-
saveCampaignGeotargeting(campaignId: number, data: SaveCampaignGeotargetingRequest,
|
|
16
|
+
saveCampaignGeotargeting(campaignId: number, data: SaveCampaignGeotargetingRequest, jwt: string): Promise<void>;
|
|
16
17
|
}
|
|
@@ -1,7 +1,18 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.GeotarginatorFrontCMAClient = void 0;
|
|
4
|
-
|
|
13
|
+
require("reflect-metadata");
|
|
14
|
+
const inversify_1 = require("inversify");
|
|
15
|
+
let GeotarginatorFrontCMAClient = class GeotarginatorFrontCMAClient {
|
|
5
16
|
constructor(baseUrl) {
|
|
6
17
|
this.baseUrl = baseUrl;
|
|
7
18
|
}
|
|
@@ -13,14 +24,14 @@ class GeotarginatorFrontCMAClient {
|
|
|
13
24
|
*
|
|
14
25
|
* @param campaignId - The campaign ID (used in URL path).
|
|
15
26
|
* @param data - The full save payload (geotargeting + pricing).
|
|
16
|
-
* @param
|
|
27
|
+
* @param jwt - Authorization header value (e.g., a JWT string as used in other CMA clients).
|
|
17
28
|
*/
|
|
18
|
-
async saveCampaignGeotargeting(campaignId, data,
|
|
29
|
+
async saveCampaignGeotargeting(campaignId, data, jwt) {
|
|
19
30
|
const response = await fetch(`${this.baseUrl}/campaigns/${campaignId}/geotargeting`, {
|
|
20
31
|
method: 'POST',
|
|
21
32
|
headers: {
|
|
22
33
|
'Content-Type': 'application/json',
|
|
23
|
-
'Authorization':
|
|
34
|
+
'Authorization': jwt
|
|
24
35
|
},
|
|
25
36
|
body: JSON.stringify(data)
|
|
26
37
|
});
|
|
@@ -28,6 +39,10 @@ class GeotarginatorFrontCMAClient {
|
|
|
28
39
|
throw new Error(`Failed to save campaign geotargeting: ${response.status} ${response.statusText}`);
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
|
-
}
|
|
42
|
+
};
|
|
32
43
|
exports.GeotarginatorFrontCMAClient = GeotarginatorFrontCMAClient;
|
|
44
|
+
exports.GeotarginatorFrontCMAClient = GeotarginatorFrontCMAClient = __decorate([
|
|
45
|
+
(0, inversify_1.injectable)(),
|
|
46
|
+
__metadata("design:paramtypes", [String])
|
|
47
|
+
], GeotarginatorFrontCMAClient);
|
|
33
48
|
//# sourceMappingURL=geotarginator-front-cma-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geotarginator-front-cma-client.js","sourceRoot":"","sources":["../../src/geotarginator-front-cma-client.ts"],"names":[],"mappings":"
|
|
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"}
|