@surfside/ads-core-client 0.1.0 → 0.1.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/README.md +15 -15
- package/lib/cjs/helpers/index.js +18 -0
- package/lib/cjs/helpers/index.js.map +1 -0
- package/lib/cjs/helpers/response/Banner.js +107 -0
- package/lib/cjs/helpers/response/Banner.js.map +1 -0
- package/lib/cjs/helpers/response/BuildAll.js +43 -0
- package/lib/cjs/helpers/response/BuildAll.js.map +1 -0
- package/lib/cjs/helpers/response/Dynamic.js +122 -0
- package/lib/cjs/helpers/response/Dynamic.js.map +1 -0
- package/lib/cjs/helpers/response/Video.js +383 -0
- package/lib/cjs/helpers/response/Video.js.map +1 -0
- package/lib/cjs/helpers/response/index.js +21 -0
- package/lib/cjs/helpers/response/index.js.map +1 -0
- package/lib/cjs/index.js +119 -4193
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/helpers/index.js +2 -0
- package/lib/esm/helpers/index.js.map +1 -0
- package/lib/esm/helpers/response/Banner.js +101 -0
- package/lib/esm/helpers/response/Banner.js.map +1 -0
- package/lib/esm/helpers/response/BuildAll.js +38 -0
- package/lib/esm/helpers/response/BuildAll.js.map +1 -0
- package/lib/esm/helpers/response/Dynamic.js +117 -0
- package/lib/esm/helpers/response/Dynamic.js.map +1 -0
- package/lib/esm/helpers/response/Video.js +371 -0
- package/lib/esm/helpers/response/Video.js.map +1 -0
- package/lib/esm/helpers/response/index.js +5 -0
- package/lib/esm/helpers/response/index.js.map +1 -0
- package/lib/esm/index.js +97 -4159
- package/lib/esm/index.js.map +1 -0
- package/package.json +34 -26
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# @surfside/ads-core-client
|
|
2
|
-
|
|
3
|
-
To install dependencies:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
bun install
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
To run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
bun run src/index.ts
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This project was created using `bun init` in bun v1.2.10. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
1
|
+
# @surfside/ads-core-client
|
|
2
|
+
|
|
3
|
+
To install dependencies:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
bun install
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
To run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
bun run src/index.ts
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
This project was created using `bun init` in bun v1.2.10. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./response"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MissingProductInfoError = exports.getProductInfoFromDivTag = exports.BuildBannerResponse = void 0;
|
|
4
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
const BuildBannerResponse = (logger, windowInfo, config, bid) => {
|
|
6
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('BuildBannerResponse');
|
|
7
|
+
log?.info('Building banner response');
|
|
8
|
+
log?.debug(bid);
|
|
9
|
+
const adm = bid?.adm;
|
|
10
|
+
if (adm === undefined || adm === null) {
|
|
11
|
+
return (0, ads_core_1.Err)(new ads_core_1.MissingAdmError(bid ?? null));
|
|
12
|
+
}
|
|
13
|
+
const parser = new DOMParser();
|
|
14
|
+
const admDoc = parser.parseFromString(adm, 'text/html');
|
|
15
|
+
const dataTag = admDoc.getElementById('surf-product-info');
|
|
16
|
+
admDoc.childNodes.forEach(child => log?.debug(child.outerHTML));
|
|
17
|
+
const productData = (0, exports.getProductInfoFromDivTag)(log, dataTag, bid);
|
|
18
|
+
const clickthrough = buildBidderClickCallback(log, windowInfo, config, (0, ads_core_1.GetValue)(productData), admDoc);
|
|
19
|
+
if (!clickthrough.ok) {
|
|
20
|
+
log?.error('Failed to build banner', clickthrough.error);
|
|
21
|
+
return clickthrough;
|
|
22
|
+
}
|
|
23
|
+
const serializer = new XMLSerializer();
|
|
24
|
+
const html = serializer.serializeToString(admDoc);
|
|
25
|
+
return (0, ads_core_1.Ok)({
|
|
26
|
+
type: 'banner',
|
|
27
|
+
adm: html,
|
|
28
|
+
clickthrough: clickthrough.value,
|
|
29
|
+
bid
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.BuildBannerResponse = BuildBannerResponse;
|
|
33
|
+
const buildBidderClickCallback = (logger, windowInfo, configuration, productData, document) => {
|
|
34
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('buildBidderClickCallback');
|
|
35
|
+
log?.info('Building bidder click callback');
|
|
36
|
+
const bidderClickCallbackUrlAnchors = document.querySelectorAll('a[href*=\\{SURF_COMMERCE_URL\\}]');
|
|
37
|
+
if (bidderClickCallbackUrlAnchors.length > 0) {
|
|
38
|
+
if (productData === undefined) {
|
|
39
|
+
log?.error('The banner had {SURF_COMMERCE_URL} in its clickthrough link, so it is expecting a rendered ' +
|
|
40
|
+
'clickthrough URL, but there was no product info provided. Therefore, the banner cannot be rendered, ' +
|
|
41
|
+
'or else it might redirect to an invalid page');
|
|
42
|
+
return (0, ads_core_1.Err)(new MissingProductInfoError);
|
|
43
|
+
}
|
|
44
|
+
const clickthrough = (0, ads_core_1.BuildClickthroughUrl)(log, windowInfo, configuration, productData // destructure in case it's undefined. ProductInfo has no required fields
|
|
45
|
+
);
|
|
46
|
+
if (clickthrough.ok === false) {
|
|
47
|
+
log?.error('The banner had {SURF_COMMERCE_URL} in its clickthrough link, so it is expecting a rendered ' +
|
|
48
|
+
'clickthrough URL, but the clickthrough failed to render. Therefore, the banner cannot be rendered, ' +
|
|
49
|
+
'or else it might redirect to an invalid page', clickthrough.error);
|
|
50
|
+
return clickthrough; // Error Result
|
|
51
|
+
}
|
|
52
|
+
bidderClickCallbackUrlAnchors.forEach(a => {
|
|
53
|
+
const href = a.getAttribute('href');
|
|
54
|
+
if (href === null) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const finalClick = href.replace('{SURF_COMMERCE_URL}', clickthrough.value);
|
|
58
|
+
a.setAttribute('href', finalClick);
|
|
59
|
+
});
|
|
60
|
+
return (0, ads_core_1.Ok)(clickthrough.value);
|
|
61
|
+
}
|
|
62
|
+
return (0, ads_core_1.Ok)(undefined);
|
|
63
|
+
};
|
|
64
|
+
const getProductInfoFromDivTag = (logger, div, bid) => {
|
|
65
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('getProductInfoFromDivTag');
|
|
66
|
+
log?.info('Getting product info for banner');
|
|
67
|
+
if (div === null) {
|
|
68
|
+
log?.warn('No product data for banner in div tag');
|
|
69
|
+
return (0, ads_core_1.Err)(new MissingProductInfoError);
|
|
70
|
+
}
|
|
71
|
+
const { image, price, saleprice, thc, strain, cbd, name, brandname, producttype, details, cta, clickthroughurl, winurl, pixelurl, } = div.dataset;
|
|
72
|
+
log?.debug('Brand Name:' + brandname + '\nProduct Type' + producttype);
|
|
73
|
+
if (brandname === undefined) {
|
|
74
|
+
log?.warn('Missing brand name field in banner creative. The brand name was probably not set on the banner. ' +
|
|
75
|
+
'Technically, this isn\'t an *error*, but almost all banner creatives rely on brand info, so the ' +
|
|
76
|
+
'banner probably isn\'t working. CHECK THE CREATIVE. Banner ID is: ' + bid.crid);
|
|
77
|
+
}
|
|
78
|
+
const productData = {
|
|
79
|
+
image,
|
|
80
|
+
price,
|
|
81
|
+
salePrice: saleprice,
|
|
82
|
+
thc,
|
|
83
|
+
strain,
|
|
84
|
+
cbd,
|
|
85
|
+
name,
|
|
86
|
+
brand_name: brandname,
|
|
87
|
+
brandName: brandname,
|
|
88
|
+
productType: producttype,
|
|
89
|
+
details,
|
|
90
|
+
cta,
|
|
91
|
+
clickthroughUrl: clickthroughurl,
|
|
92
|
+
winurl,
|
|
93
|
+
pixelurl
|
|
94
|
+
};
|
|
95
|
+
if (Object.keys(productData).length === 0) {
|
|
96
|
+
return (0, ads_core_1.Err)(new MissingProductInfoError());
|
|
97
|
+
}
|
|
98
|
+
return (0, ads_core_1.Ok)(productData);
|
|
99
|
+
};
|
|
100
|
+
exports.getProductInfoFromDivTag = getProductInfoFromDivTag;
|
|
101
|
+
class MissingProductInfoError extends Error {
|
|
102
|
+
constructor() {
|
|
103
|
+
super('Missing product info in banner');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.MissingProductInfoError = MissingProductInfoError;
|
|
107
|
+
//# sourceMappingURL=Banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot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,CACL,kGAAkG;YAClG,kGAAkG;YAClG,oEAAoE,GAAG,GAAG,CAAC,IAAI,CAClF,CAAC;IACN,CAAC;IAED,MAAM,WAAW,GAAG;QAChB,KAAK;QACL,KAAK;QACL,SAAS,EAAE,SAAS;QACpB,GAAG;QACH,MAAM;QACN,GAAG;QACH,IAAI;QACJ,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;QACpB,WAAW,EAAE,WAAW;QACxB,OAAO;QACP,GAAG;QACH,eAAe,EAAE,eAAe;QAChC,MAAM;QACN,QAAQ;KACX,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,OAAO,IAAA,cAAG,EAAC,IAAI,uBAAuB,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,IAAA,aAAE,EAAC,WAAW,CAAC,CAAC;AAC3B,CAAC,CAAC;AA1DW,QAAA,wBAAwB,4BA0DnC;AAEF,MAAa,uBAAwB,SAAQ,KAAK;IAC9C;QACI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IAC5C,CAAC;CACJ;AAJD,0DAIC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GenerateAllResponses = exports.BuildAllResponses = void 0;
|
|
4
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
const BuildAllResponses = async (logger, buildBannerResponse, buildVideoResponse, buildAllProductCardResponses, request, response) => {
|
|
6
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('BuildAllResponses');
|
|
7
|
+
log?.info('Building all bid responses');
|
|
8
|
+
log?.debug(request, response);
|
|
9
|
+
const bannerRequestIds = request.imp.filter(imp => imp.banner !== undefined).map(imp => imp.id);
|
|
10
|
+
const videoRequestIds = request.imp.filter(imp => imp.video !== undefined).map(imp => imp.id);
|
|
11
|
+
const nativeRequestIds = request.imp.filter(imp => imp.native !== undefined).map(imp => imp.id);
|
|
12
|
+
log?.debug(bannerRequestIds, videoRequestIds, nativeRequestIds);
|
|
13
|
+
const bannerBids = response.seatbid?.[0]?.bid.filter(bid => bannerRequestIds.includes(bid.impid)) ?? [];
|
|
14
|
+
const videoBids = response.seatbid?.[0]?.bid.filter(bid => videoRequestIds.includes(bid.impid)) ?? [];
|
|
15
|
+
const nativeBids = response.seatbid?.[0]?.bid.filter(bid => nativeRequestIds.includes(bid.impid)) ?? [];
|
|
16
|
+
log?.debug(bannerBids, videoBids, nativeBids);
|
|
17
|
+
return (0, ads_core_1.Ok)({
|
|
18
|
+
banners: (0, ads_core_1.ValueOr)((0, ads_core_1.AllOrNone)(bannerBids.map(buildBannerResponse)), []),
|
|
19
|
+
videos: (0, ads_core_1.ValueOr)((0, ads_core_1.AllOrNone)(videoBids.map(buildVideoResponse)), []),
|
|
20
|
+
productCards: (0, ads_core_1.ValueOr)(await buildAllProductCardResponses(nativeBids), [])
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
exports.BuildAllResponses = BuildAllResponses;
|
|
24
|
+
const GenerateAllResponses = async (logger, buildBannerResponse, buildVideoResponse, buildProductCard, request, response) => {
|
|
25
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('GenerateAllResponses');
|
|
26
|
+
log?.info('Generating all responses');
|
|
27
|
+
log?.debug(request, response);
|
|
28
|
+
const bannerRequestIds = request.imp.filter(imp => imp.banner !== undefined).map(imp => imp.id);
|
|
29
|
+
const videoRequestIds = request.imp.filter(imp => imp.video !== undefined).map(imp => imp.id);
|
|
30
|
+
const nativeRequestIds = request.imp.filter(imp => imp.native !== undefined).map(imp => imp.id);
|
|
31
|
+
log?.debug(bannerRequestIds, videoRequestIds, nativeRequestIds);
|
|
32
|
+
const bannerBids = response.seatbid?.[0]?.bid.filter(bid => bannerRequestIds.includes(bid.impid)) ?? [];
|
|
33
|
+
const videoBids = response.seatbid?.[0]?.bid.filter(bid => videoRequestIds.includes(bid.impid)) ?? [];
|
|
34
|
+
const nativeBids = response.seatbid?.[0]?.bid.filter(bid => nativeRequestIds.includes(bid.impid)) ?? [];
|
|
35
|
+
log?.debug(bannerBids, videoBids, nativeBids);
|
|
36
|
+
return (0, ads_core_1.Ok)({
|
|
37
|
+
banners: (0, ads_core_1.ValueOr)((0, ads_core_1.AllOrNone)(bannerBids.map(buildBannerResponse)), []),
|
|
38
|
+
videos: (0, ads_core_1.ValueOr)((0, ads_core_1.AllOrNone)(videoBids.map(buildVideoResponse)), []),
|
|
39
|
+
productCards: (0, ads_core_1.GetValue)(await buildProductCard(nativeBids))
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
exports.GenerateAllResponses = GenerateAllResponses;
|
|
43
|
+
//# sourceMappingURL=BuildAll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuildAll.js","sourceRoot":"src/","sources":["helpers/response/BuildAll.ts"],"names":[],"mappings":";;;AAAA,iDAe4B;AA2BrB,MAAM,iBAAiB,GAAG,KAAK,EAClC,MAA2B,EAC3B,mBAA0C,EAC1C,kBAAwC,EACxC,4BAAqE,EACrE,OAAoB,EACpB,QAAsB,EACe,EAAE;IACvC,MAAM,GAAG,GAAG,IAAA,cAAG,EAAC,MAAM,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IACnD,GAAG,EAAE,IAAI,CAAC,4BAA4B,CAAC,CAAC;IACxC,GAAG,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC9B,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChG,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE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
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
const BuildDynamicResponse = async (logger, requestBids, buildBannerResponse, buildVideoResponse, buildHybridCarousel, buildSponsoredCarousel, buildRecommendedCarousel, buildAllSponsoredProductCardResponses, dynamicRequest) => {
|
|
6
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('BuildDynamicResponse');
|
|
7
|
+
log?.info('Building dynamic response');
|
|
8
|
+
log?.debug(dynamicRequest);
|
|
9
|
+
const bidderResult = await requestBids(dynamicRequest.request);
|
|
10
|
+
if (!bidderResult.ok) {
|
|
11
|
+
return bidderResult;
|
|
12
|
+
}
|
|
13
|
+
const bids = bidderResult.value.seatbid?.[0]?.bid;
|
|
14
|
+
log?.debug('bids', bids);
|
|
15
|
+
if (bids === undefined) {
|
|
16
|
+
return (0, ads_core_1.Err)(new ads_core_1.MissingBidsError);
|
|
17
|
+
}
|
|
18
|
+
for (const id in dynamicRequest.requestIds) {
|
|
19
|
+
const creative = dynamicRequest.requestIds[id];
|
|
20
|
+
const bid = bids.filter(bid => bid.impid === id)[0];
|
|
21
|
+
if (bid === undefined) {
|
|
22
|
+
log?.debug('No bid for id', id);
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
const builtCreative = (0, ads_core_1.GetValue)(await (0, ads_core_1.TryDoAsync)(async () => {
|
|
26
|
+
switch (creative.type) {
|
|
27
|
+
case 'Banner': {
|
|
28
|
+
return {
|
|
29
|
+
...(0, ads_core_1.GetValueOrThrow)(buildBannerResponse(bid)),
|
|
30
|
+
dynamicBannerRequest: creative
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
case 'Video': {
|
|
34
|
+
return {
|
|
35
|
+
...(0, ads_core_1.GetValueOrThrow)(buildVideoResponse(bid)),
|
|
36
|
+
dynamicVideoRequest: creative
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
case 'Carousel': {
|
|
40
|
+
const carousel = creative;
|
|
41
|
+
switch (carousel.strategy) {
|
|
42
|
+
case 'hybrid': {
|
|
43
|
+
const hybrid = (0, ads_core_1.GetValueOrThrow)(buildHybridCarousel({
|
|
44
|
+
type: carousel.recommendation ?? 'top-products'
|
|
45
|
+
}, dynamicRequest.request, bid));
|
|
46
|
+
const generator = hybrid.getProduct();
|
|
47
|
+
const [product] = await (0, ads_core_1.ConsumeNAsync)(generator, 1);
|
|
48
|
+
if (product.length === 1) {
|
|
49
|
+
// Success!
|
|
50
|
+
return {
|
|
51
|
+
type: 'carousel',
|
|
52
|
+
getProduct: async function* wrappedGenerator() {
|
|
53
|
+
yield product[0];
|
|
54
|
+
yield* generator;
|
|
55
|
+
},
|
|
56
|
+
bid,
|
|
57
|
+
dynamicCarouselRequest: carousel
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
throw new Error('No inventory in carousel. Skipping');
|
|
61
|
+
}
|
|
62
|
+
case 'recommended': {
|
|
63
|
+
return {
|
|
64
|
+
...(0, ads_core_1.GetValueOrThrow)(buildRecommendedCarousel({
|
|
65
|
+
type: carousel.recommendation ?? 'top-products'
|
|
66
|
+
})),
|
|
67
|
+
dynamicCarouselRequest: carousel
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
case 'sponsored': {
|
|
71
|
+
const sponsored = (0, ads_core_1.GetValueOrThrow)(buildSponsoredCarousel(dynamicRequest.request, bid));
|
|
72
|
+
const generator = sponsored.getProduct();
|
|
73
|
+
const [product] = await (0, ads_core_1.ConsumeNAsync)(generator, 1);
|
|
74
|
+
if (product.length === 1) {
|
|
75
|
+
// Success!
|
|
76
|
+
return {
|
|
77
|
+
type: 'carousel',
|
|
78
|
+
getProduct: async function* wrappedGenerator() {
|
|
79
|
+
yield product[0];
|
|
80
|
+
yield* generator;
|
|
81
|
+
},
|
|
82
|
+
bid,
|
|
83
|
+
dynamicCarouselRequest: carousel
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
throw new Error('No inventory in carousel. Skipping');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
throw new Error('Malformed carousel configuration. Skipping');
|
|
90
|
+
}
|
|
91
|
+
case 'ProductCard': {
|
|
92
|
+
const value = (0, ads_core_1.GetValueOrThrow)(await buildAllSponsoredProductCardResponses([bid]));
|
|
93
|
+
if (value.length === 0) {
|
|
94
|
+
throw new Error('No inventory for product card');
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
...value[0],
|
|
98
|
+
dynamicProductCardRequest: creative
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
throw new Error('Malformed creative. Skipping');
|
|
103
|
+
}));
|
|
104
|
+
if (builtCreative === undefined) {
|
|
105
|
+
log?.debug('No inventory or error on creative. Skipping');
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
return (0, ads_core_1.Ok)(builtCreative);
|
|
109
|
+
}
|
|
110
|
+
return (0, ads_core_1.Err)(new NoDynamicAdsAvailableError(dynamicRequest));
|
|
111
|
+
};
|
|
112
|
+
exports.BuildDynamicResponse = BuildDynamicResponse;
|
|
113
|
+
class NoDynamicAdsAvailableError extends Error {
|
|
114
|
+
dynamicRequest;
|
|
115
|
+
constructor(dynamicRequest) {
|
|
116
|
+
super('No dynamic ads available');
|
|
117
|
+
this.dynamicRequest = dynamicRequest;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.NoDynamicAdsAvailableError = NoDynamicAdsAvailableError;
|
|
121
|
+
;
|
|
122
|
+
//# sourceMappingURL=Dynamic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dynamic.js","sourceRoot":"src/","sources":["helpers/response/Dynamic.ts"],"names":[],"mappings":";;;AAAA,iDAuB4B;AA+BrB,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAA2B,EAClE,WAA0B,EAC1B,mBAA0C,EAC1C,kBAAwC,EACxC,mBAAwD,EACxD,sBAA8D,EAC9D,wBAAoD,EACpD,qCAA8E,EAC9E,cAAmC,EACD,EAAE;IAC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