@surfside/ads-core 1.0.6 → 2.0.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 -64
- package/lib/cjs/Api.js +195 -0
- package/lib/cjs/Api.js.map +1 -0
- package/lib/cjs/helpers/Generator.js +50 -0
- package/lib/cjs/helpers/Generator.js.map +1 -0
- package/lib/cjs/helpers/Handlebars.js +270 -0
- package/lib/cjs/helpers/Handlebars.js.map +1 -0
- package/lib/cjs/helpers/NativeRequestBuilder.js +174 -0
- package/lib/cjs/helpers/NativeRequestBuilder.js.map +1 -0
- package/lib/cjs/helpers/RequestBuilder.js +160 -0
- package/lib/cjs/helpers/RequestBuilder.js.map +1 -0
- package/lib/cjs/helpers/TryGet.js +14 -0
- package/lib/cjs/helpers/TryGet.js.map +1 -0
- package/lib/cjs/helpers/Window.js +24 -0
- package/lib/cjs/helpers/Window.js.map +1 -0
- package/lib/cjs/helpers/index.js +24 -0
- package/lib/cjs/helpers/index.js.map +1 -0
- package/lib/cjs/helpers/response/Banner.js +4 -0
- package/lib/cjs/helpers/response/Banner.js.map +1 -0
- package/lib/cjs/helpers/response/BuiltResponse.js +27 -0
- package/lib/cjs/helpers/response/BuiltResponse.js.map +1 -0
- package/lib/cjs/helpers/response/Carousel.js +282 -0
- package/lib/cjs/helpers/response/Carousel.js.map +1 -0
- package/lib/cjs/helpers/response/Clickthrough.js +24 -0
- package/lib/cjs/helpers/response/Clickthrough.js.map +1 -0
- package/lib/cjs/helpers/response/ProductCard.js +198 -0
- package/lib/cjs/helpers/response/ProductCard.js.map +1 -0
- package/lib/cjs/helpers/response/Video.js +4 -0
- package/lib/cjs/helpers/response/Video.js.map +1 -0
- package/lib/cjs/helpers/response/index.js +23 -0
- package/lib/cjs/helpers/response/index.js.map +1 -0
- package/lib/cjs/index.js +21 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/models/dynamic/DynamicZone.js +12 -0
- package/lib/cjs/models/dynamic/DynamicZone.js.map +1 -0
- package/lib/cjs/models/dynamic/index.js +18 -0
- package/lib/cjs/models/dynamic/index.js.map +1 -0
- package/lib/cjs/models/index.js +22 -0
- package/lib/cjs/models/index.js.map +1 -0
- package/lib/cjs/models/retail/Configuration.js +10 -0
- package/lib/cjs/models/retail/Configuration.js.map +1 -0
- package/lib/cjs/models/retail/Product.js +4 -0
- package/lib/cjs/models/retail/Product.js.map +1 -0
- package/lib/cjs/models/retail/Recommended.js +3 -0
- package/lib/cjs/models/retail/Recommended.js.map +1 -0
- package/lib/cjs/models/retail/index.js +20 -0
- package/lib/cjs/models/retail/index.js.map +1 -0
- package/lib/cjs/models/rtb/BidRequest.js +20 -0
- package/lib/cjs/models/rtb/BidRequest.js.map +1 -0
- package/lib/cjs/models/rtb/BidResponse.js +3 -0
- package/lib/cjs/models/rtb/BidResponse.js.map +1 -0
- package/lib/cjs/models/rtb/NativeRequest.js +122 -0
- package/lib/cjs/models/rtb/NativeRequest.js.map +1 -0
- package/lib/cjs/models/rtb/NativeResponse.js +26 -0
- package/lib/cjs/models/rtb/NativeResponse.js.map +1 -0
- package/lib/cjs/models/rtb/index.js +21 -0
- package/lib/cjs/models/rtb/index.js.map +1 -0
- package/lib/cjs/models/tracking/Geo.js +3 -0
- package/lib/cjs/models/tracking/Geo.js.map +1 -0
- package/lib/cjs/models/tracking/index.js +18 -0
- package/lib/cjs/models/tracking/index.js.map +1 -0
- package/lib/cjs/models/vast/Vast.js +4 -0
- package/lib/cjs/models/vast/Vast.js.map +1 -0
- package/lib/cjs/models/vast/index.js +18 -0
- package/lib/cjs/models/vast/index.js.map +1 -0
- package/lib/cjs/services/Bidder.js +128 -0
- package/lib/cjs/services/Bidder.js.map +1 -0
- package/lib/cjs/services/Configuration.js +93 -0
- package/lib/cjs/services/Configuration.js.map +1 -0
- package/lib/cjs/services/Device.js +236 -0
- package/lib/cjs/services/Device.js.map +1 -0
- package/lib/cjs/services/Dynamic.js +129 -0
- package/lib/cjs/services/Dynamic.js.map +1 -0
- package/lib/cjs/services/Geo.js +35 -0
- package/lib/cjs/services/Geo.js.map +1 -0
- package/lib/cjs/services/Logger.js +57 -0
- package/lib/cjs/services/Logger.js.map +1 -0
- package/lib/cjs/services/Memoization.js +17 -0
- package/lib/cjs/services/Memoization.js.map +1 -0
- package/lib/cjs/services/Product.js +127 -0
- package/lib/cjs/services/Product.js.map +1 -0
- package/lib/cjs/services/Recommender.js +83 -0
- package/lib/cjs/services/Recommender.js.map +1 -0
- package/lib/cjs/services/Result.js +220 -0
- package/lib/cjs/services/Result.js.map +1 -0
- package/lib/cjs/services/Template.js +43 -0
- package/lib/cjs/services/Template.js.map +1 -0
- package/lib/cjs/services/index.js +28 -0
- package/lib/cjs/services/index.js.map +1 -0
- package/lib/cjs/services/mock/Bidder.js +3 -0
- package/lib/cjs/services/mock/Bidder.js.map +1 -0
- package/lib/cjs/services/mock/index.js +18 -0
- package/lib/cjs/services/mock/index.js.map +1 -0
- package/lib/esm/Api.js +183 -0
- package/lib/esm/Api.js.map +1 -0
- package/lib/esm/helpers/Generator.js +42 -0
- package/lib/esm/helpers/Generator.js.map +1 -0
- package/lib/esm/helpers/Handlebars.js +251 -0
- package/lib/esm/helpers/Handlebars.js.map +1 -0
- package/lib/esm/helpers/NativeRequestBuilder.js +169 -0
- package/lib/esm/helpers/NativeRequestBuilder.js.map +1 -0
- package/lib/esm/helpers/RequestBuilder.js +157 -0
- package/lib/esm/helpers/RequestBuilder.js.map +1 -0
- package/lib/esm/helpers/TryGet.js +10 -0
- package/lib/esm/helpers/TryGet.js.map +1 -0
- package/lib/esm/helpers/Window.js +20 -0
- package/lib/esm/helpers/Window.js.map +1 -0
- package/lib/esm/helpers/index.js +8 -0
- package/lib/esm/helpers/index.js.map +1 -0
- package/lib/esm/helpers/response/Banner.js +3 -0
- package/lib/esm/helpers/response/Banner.js.map +1 -0
- package/lib/esm/helpers/response/BuiltResponse.js +22 -0
- package/lib/esm/helpers/response/BuiltResponse.js.map +1 -0
- package/lib/esm/helpers/response/Carousel.js +273 -0
- package/lib/esm/helpers/response/Carousel.js.map +1 -0
- package/lib/esm/helpers/response/Clickthrough.js +20 -0
- package/lib/esm/helpers/response/Clickthrough.js.map +1 -0
- package/lib/esm/helpers/response/ProductCard.js +189 -0
- package/lib/esm/helpers/response/ProductCard.js.map +1 -0
- package/lib/esm/helpers/response/Video.js +3 -0
- package/lib/esm/helpers/response/Video.js.map +1 -0
- package/lib/esm/helpers/response/index.js +7 -0
- package/lib/esm/helpers/response/index.js.map +1 -0
- package/lib/esm/index.js +5 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/models/dynamic/DynamicZone.js +11 -0
- package/lib/esm/models/dynamic/DynamicZone.js.map +1 -0
- package/lib/esm/models/dynamic/index.js +2 -0
- package/lib/esm/models/dynamic/index.js.map +1 -0
- package/lib/esm/models/index.js +6 -0
- package/lib/esm/models/index.js.map +1 -0
- package/lib/esm/models/retail/Configuration.js +9 -0
- package/lib/esm/models/retail/Configuration.js.map +1 -0
- package/lib/esm/models/retail/Product.js +3 -0
- package/lib/esm/models/retail/Product.js.map +1 -0
- package/lib/esm/models/retail/Recommended.js +2 -0
- package/lib/esm/models/retail/Recommended.js.map +1 -0
- package/lib/esm/models/retail/index.js +4 -0
- package/lib/esm/models/retail/index.js.map +1 -0
- package/lib/esm/models/rtb/BidRequest.js +17 -0
- package/lib/esm/models/rtb/BidRequest.js.map +1 -0
- package/lib/esm/models/rtb/BidResponse.js +2 -0
- package/lib/esm/models/rtb/BidResponse.js.map +1 -0
- package/lib/esm/models/rtb/NativeRequest.js +119 -0
- package/lib/esm/models/rtb/NativeRequest.js.map +1 -0
- package/lib/esm/models/rtb/NativeResponse.js +23 -0
- package/lib/esm/models/rtb/NativeResponse.js.map +1 -0
- package/lib/esm/models/rtb/index.js +5 -0
- package/lib/esm/models/rtb/index.js.map +1 -0
- package/lib/esm/models/tracking/Geo.js +2 -0
- package/lib/esm/models/tracking/Geo.js.map +1 -0
- package/lib/esm/models/tracking/index.js +2 -0
- package/lib/esm/models/tracking/index.js.map +1 -0
- package/lib/esm/models/vast/Vast.js +3 -0
- package/lib/esm/models/vast/Vast.js.map +1 -0
- package/lib/esm/models/vast/index.js +2 -0
- package/lib/esm/models/vast/index.js.map +1 -0
- package/lib/esm/services/Bidder.js +119 -0
- package/lib/esm/services/Bidder.js.map +1 -0
- package/lib/esm/services/Configuration.js +56 -0
- package/lib/esm/services/Configuration.js.map +1 -0
- package/lib/esm/services/Device.js +232 -0
- package/lib/esm/services/Device.js.map +1 -0
- package/lib/esm/services/Dynamic.js +120 -0
- package/lib/esm/services/Dynamic.js.map +1 -0
- package/lib/esm/services/Geo.js +30 -0
- package/lib/esm/services/Geo.js.map +1 -0
- package/lib/esm/services/Logger.js +52 -0
- package/lib/esm/services/Logger.js.map +1 -0
- package/lib/esm/services/Memoization.js +13 -0
- package/lib/esm/services/Memoization.js.map +1 -0
- package/lib/esm/services/Product.js +120 -0
- package/lib/esm/services/Product.js.map +1 -0
- package/lib/esm/services/Recommender.js +78 -0
- package/lib/esm/services/Recommender.js.map +1 -0
- package/lib/esm/services/Result.js +199 -0
- package/lib/esm/services/Result.js.map +1 -0
- package/lib/esm/services/Template.js +38 -0
- package/lib/esm/services/Template.js.map +1 -0
- package/lib/esm/services/index.js +12 -0
- package/lib/esm/services/index.js.map +1 -0
- package/lib/esm/services/mock/Bidder.js +2 -0
- package/lib/esm/services/mock/Bidder.js.map +1 -0
- package/lib/esm/services/mock/index.js +2 -0
- package/lib/esm/services/mock/index.js.map +1 -0
- package/lib/types/Api.d.ts +169 -0
- package/lib/types/helpers/Generator.d.ts +5 -0
- package/lib/types/helpers/{handlebars/index.d.ts → Handlebars.d.ts} +10 -5
- package/lib/types/helpers/NativeRequestBuilder.d.ts +29 -0
- package/lib/types/helpers/RequestBuilder.d.ts +16 -0
- package/lib/types/helpers/TryGet.d.ts +2 -0
- package/lib/types/helpers/Window.d.ts +3 -0
- package/lib/types/helpers/index.d.ts +7 -4
- package/lib/types/helpers/response/Banner.d.ts +22 -0
- package/lib/types/helpers/response/BuiltResponse.d.ts +31 -0
- package/lib/types/helpers/response/Carousel.d.ts +51 -0
- package/lib/types/helpers/response/Clickthrough.d.ts +3 -0
- package/lib/types/helpers/response/ProductCard.d.ts +49 -0
- package/lib/types/helpers/response/Video.d.ts +17 -0
- package/lib/types/helpers/response/index.d.ts +6 -0
- package/lib/types/index.d.ts +2 -17
- package/lib/types/models/dynamic/DynamicZone.d.ts +37 -0
- package/lib/types/models/dynamic/index.d.ts +1 -0
- package/lib/types/models/index.d.ts +2 -1
- package/lib/types/models/retail/{IPublisherConfiguration.d.ts → Configuration.d.ts} +11 -9
- package/lib/types/models/retail/Product.d.ts +19 -0
- package/lib/types/models/retail/index.d.ts +3 -3
- package/lib/types/models/rtb/{IBidRequest.d.ts → BidRequest.d.ts} +28 -18
- package/lib/types/models/rtb/NativeRequest.d.ts +170 -0
- package/lib/types/models/rtb/{native/INativeResponse.d.ts → NativeResponse.d.ts} +5 -5
- package/lib/types/models/rtb/index.d.ts +4 -3
- package/lib/types/models/tracking/index.d.ts +1 -3
- package/lib/types/models/vast/Vast.d.ts +6 -9
- package/lib/types/services/Bidder.d.ts +31 -0
- package/lib/types/services/Configuration.d.ts +6 -0
- package/lib/types/services/Device.d.ts +12 -0
- package/lib/types/services/Dynamic.d.ts +26 -0
- package/lib/types/services/Geo.d.ts +6 -0
- package/lib/types/services/Logger.d.ts +14 -0
- package/lib/types/services/Memoization.d.ts +1 -0
- package/lib/types/services/Product.d.ts +13 -0
- package/lib/types/services/Recommender.d.ts +8 -0
- package/lib/types/services/Result.d.ts +57 -0
- package/lib/types/services/Template.d.ts +7 -0
- package/lib/types/services/index.d.ts +11 -5
- package/lib/types/services/mock/Bidder.d.ts +1 -0
- package/lib/types/services/mock/index.d.ts +1 -0
- package/package.json +42 -47
- package/lib/index.js +0 -1
- package/lib/types/constant-values/index.d.ts +0 -46
- package/lib/types/errors/index.d.ts +0 -3
- package/lib/types/helpers/generators/CollectN.d.ts +0 -2
- package/lib/types/helpers/generators/index.d.ts +0 -1
- package/lib/types/helpers/requests/RequestBuilder.d.ts +0 -124
- package/lib/types/helpers/requests/SimpleBannerRequest.d.ts +0 -26
- package/lib/types/helpers/requests/index.d.ts +0 -2
- package/lib/types/helpers/responses/BuildBannerResponse.d.ts +0 -10
- package/lib/types/helpers/responses/BuildNativeResponse.d.ts +0 -21
- package/lib/types/helpers/responses/BuildVideoResponse.d.ts +0 -0
- package/lib/types/helpers/responses/ClickthroughHelpers.d.ts +0 -2
- package/lib/types/helpers/responses/VastHelpers.d.ts +0 -4
- package/lib/types/helpers/responses/index.d.ts +0 -4
- package/lib/types/middleware/DeviceMiddleware.d.ts +0 -3
- package/lib/types/middleware/GeoMiddleware.d.ts +0 -3
- package/lib/types/middleware/IdentityMiddleware.d.ts +0 -4
- package/lib/types/middleware/index.d.ts +0 -3
- package/lib/types/models/retail/IProductInformation.d.ts +0 -37
- package/lib/types/models/rtb/native/Constants.d.ts +0 -60
- package/lib/types/models/rtb/native/INativeRequest.d.ts +0 -54
- package/lib/types/models/rtb/native/NativeConstants.d.ts +0 -120
- package/lib/types/models/rtb/native/NativeRequestBuilder.d.ts +0 -158
- package/lib/types/models/rtb/native/index.d.ts +0 -4
- package/lib/types/models/tracking/IEvents.d.ts +0 -82
- package/lib/types/models/tracking/IUserID.d.ts +0 -1
- package/lib/types/services/OverrideService.d.ts +0 -10
- package/lib/types/services/logger/ILoggerService.d.ts +0 -39
- package/lib/types/services/logger/LocalLoggerService.d.ts +0 -19
- package/lib/types/services/logger/index.d.ts +0 -2
- package/lib/types/services/product-feed/IProductFeedService.d.ts +0 -5
- package/lib/types/services/product-feed/SurfsideProductFeedService.d.ts +0 -11
- package/lib/types/services/product-feed/index.d.ts +0 -2
- package/lib/types/services/recommender/IRecommenderService.d.ts +0 -47
- package/lib/types/services/recommender/SurfsideRecommenderService.d.ts +0 -31
- package/lib/types/services/recommender/index.d.ts +0 -2
- package/lib/types/services/rtb/bidder/IBidderService.d.ts +0 -12
- package/lib/types/services/rtb/bidder/SurfsideBidderService.d.ts +0 -28
- package/lib/types/services/rtb/bidder/index.d.ts +0 -2
- package/lib/types/services/rtb/configuration/IConfigurationService.d.ts +0 -14
- package/lib/types/services/rtb/configuration/SurfsideConfigurationService.d.ts +0 -29
- package/lib/types/services/rtb/configuration/index.d.ts +0 -2
- package/lib/types/services/rtb/index.d.ts +0 -2
- package/lib/types/services/tracking/device/DeviceOverrideService.d.ts +0 -8
- package/lib/types/services/tracking/device/IDeviceService.d.ts +0 -4
- package/lib/types/services/tracking/device/SurfsideDeviceService.d.ts +0 -16
- package/lib/types/services/tracking/device/index.d.ts +0 -3
- package/lib/types/services/tracking/events/IEventService.d.ts +0 -5
- package/lib/types/services/tracking/events/SurfsideEventService.d.ts +0 -42
- package/lib/types/services/tracking/events/index.d.ts +0 -2
- package/lib/types/services/tracking/geo/GeoOverrideService.d.ts +0 -8
- package/lib/types/services/tracking/geo/IGeoService.d.ts +0 -12
- package/lib/types/services/tracking/geo/SurfsideGeoService.d.ts +0 -7
- package/lib/types/services/tracking/geo/index.d.ts +0 -3
- package/lib/types/services/tracking/index.d.ts +0 -4
- package/lib/types/services/tracking/user/IUserIDService.d.ts +0 -4
- package/lib/types/services/tracking/user/SurfsideUserIDService.d.ts +0 -7
- package/lib/types/services/tracking/user/UserOverrideService.d.ts +0 -8
- package/lib/types/services/tracking/user/index.d.ts +0 -3
- package/lib/types/utils/Protocol.d.ts +0 -1
- package/lib/types/utils/Rendering.d.ts +0 -44
- package/lib/types/utils/index.d.ts +0 -2
- /package/lib/types/models/retail/{IRecommenderResponse.d.ts → Recommended.d.ts} +0 -0
- /package/lib/types/models/rtb/{IBidResponse.d.ts → BidResponse.d.ts} +0 -0
- /package/lib/types/models/tracking/{IGeoContext.d.ts → Geo.d.ts} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
1
|
+
export * from './NativeRequestBuilder';
|
|
2
|
+
export * from './RequestBuilder';
|
|
3
|
+
export * from './response';
|
|
4
|
+
export * from './Handlebars';
|
|
5
|
+
export * from './TryGet';
|
|
6
|
+
export * from './Window';
|
|
7
|
+
export * from './Generator';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type IBuiltResponse } from './BuiltResponse';
|
|
2
|
+
/**
|
|
3
|
+
* A built banner response - includes the `adm` field for the banner as well as the rendered commerce media
|
|
4
|
+
* clickthrough URL template, if applicable.
|
|
5
|
+
*
|
|
6
|
+
* @expandType IBuiltResponse
|
|
7
|
+
*/
|
|
8
|
+
export interface IBuiltBannerResponse extends IBuiltResponse {
|
|
9
|
+
/**
|
|
10
|
+
* Indicates the type of the {@link IBuiltResponse}. 0 means Banner
|
|
11
|
+
*/
|
|
12
|
+
type: 'banner';
|
|
13
|
+
/**
|
|
14
|
+
* The HTML of the banner creative
|
|
15
|
+
*/
|
|
16
|
+
adm: string;
|
|
17
|
+
/**
|
|
18
|
+
* The clickthrough URL of the creative, if it the banner is a commerce media creative (i.e, the URL is built from
|
|
19
|
+
* the clickthrough URL template). For regular static banners that click out to 3rd party sites, this is `undefined`
|
|
20
|
+
*/
|
|
21
|
+
clickthrough?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type IBid } from '../../models';
|
|
2
|
+
export declare const CreativeType: {
|
|
3
|
+
readonly Banner: 0;
|
|
4
|
+
readonly Video: 1;
|
|
5
|
+
readonly ProductCard: 2;
|
|
6
|
+
readonly Carousel: 3;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A built creative response. Includes the bid response which fed the creative as well as a `type` field indicating what
|
|
10
|
+
* kind of creative it is (i.e, {@link IBuiltBannerResponse }, {@link IBuiltVideo}, {@link IBuiltProductCardResponse},
|
|
11
|
+
* {@link IBuiltCarousel}).
|
|
12
|
+
*
|
|
13
|
+
* @see IBuiltBannerResponse
|
|
14
|
+
* @see IBuiltVideo
|
|
15
|
+
* @see IBuiltProductCardResponse
|
|
16
|
+
* @see IBuiltCarousel
|
|
17
|
+
*/
|
|
18
|
+
export interface IBuiltResponse {
|
|
19
|
+
/**
|
|
20
|
+
* The OpenRTB Bid object which created this creative
|
|
21
|
+
*/
|
|
22
|
+
bid: IBid;
|
|
23
|
+
}
|
|
24
|
+
export declare class MissingAdmError extends Error {
|
|
25
|
+
readonly bid: IBid | null;
|
|
26
|
+
constructor(bid: IBid | null);
|
|
27
|
+
}
|
|
28
|
+
export declare class MissingProductError extends Error {
|
|
29
|
+
readonly bid?: IBid | undefined;
|
|
30
|
+
constructor(bid?: IBid | undefined);
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { IBid, IBidRequest } from '../../models';
|
|
2
|
+
import { type ILogger, type NonPersonalRecommenderFn, type PersonalRecommenderFn, type RequestBidsFn, type Result } from '../../services';
|
|
3
|
+
import { type EvaluateClickthroughTemplateFn } from '../../services/Template';
|
|
4
|
+
import type { GenerateSponsoredProductCardResponseFn, IBuiltProductCardResponse } from './ProductCard';
|
|
5
|
+
export type BuildSponsoredCarouselFn = (request: IBidRequest) => Result<IBuiltCarousel>;
|
|
6
|
+
export type BuildSponsoredCarouselFromInitialBidFn = (request: IBidRequest, initialBid: IBid) => Result<IBuiltCarousel>;
|
|
7
|
+
export type BuildRecommendedCarouselFn = (RecommenderType: PublicRecommenderType) => Result<IBuiltCarousel>;
|
|
8
|
+
export type BuildHybridCarouselFn = (recommenderType: PublicRecommenderType, request: IBidRequest) => Result<IBuiltCarousel>;
|
|
9
|
+
export type BuildHybridCarouselFromInitialBidFn = (RecommenderType: PublicRecommenderType, request: IBidRequest, initialBid: IBid) => Result<IBuiltCarousel>;
|
|
10
|
+
export type CarouselNextProductFn = () => AsyncGenerator<IBuiltProductCardResponse>;
|
|
11
|
+
export interface IBuiltCarousel {
|
|
12
|
+
type: 'carousel';
|
|
13
|
+
getProduct: CarouselNextProductFn;
|
|
14
|
+
}
|
|
15
|
+
export type RecommenderType = 'top-products' | 'for-you' | 'past-purchases';
|
|
16
|
+
export interface IPublicTopProductsRecommenderType {
|
|
17
|
+
type: 'top-products';
|
|
18
|
+
}
|
|
19
|
+
export interface IPublicForYouRecommenderType {
|
|
20
|
+
type: 'for-you';
|
|
21
|
+
}
|
|
22
|
+
export interface IPublicPastPurchasesRecommenderType {
|
|
23
|
+
type: 'past-purchases';
|
|
24
|
+
}
|
|
25
|
+
export type PublicRecommenderType = IPublicTopProductsRecommenderType | IPublicForYouRecommenderType | IPublicPastPurchasesRecommenderType;
|
|
26
|
+
export interface ITopProductRecommender {
|
|
27
|
+
recommenderType: 'top-products';
|
|
28
|
+
topProductGenerator: NonPersonalRecommenderFn;
|
|
29
|
+
}
|
|
30
|
+
export interface IForYouProductRecommender {
|
|
31
|
+
recommenderType: 'for-you';
|
|
32
|
+
forYouProductGenerator: PersonalRecommenderFn;
|
|
33
|
+
topProductGenerator: NonPersonalRecommenderFn;
|
|
34
|
+
userId?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IPastPurchasesProductRecommender {
|
|
37
|
+
recommenderType: 'past-purchases';
|
|
38
|
+
pastPurchasesProductGenerator: PersonalRecommenderFn;
|
|
39
|
+
topProductGenerator: NonPersonalRecommenderFn;
|
|
40
|
+
userId?: string;
|
|
41
|
+
}
|
|
42
|
+
export type ProductRecommender = ITopProductRecommender | IForYouProductRecommender | IPastPurchasesProductRecommender;
|
|
43
|
+
export declare const BuildSponsoredCarousel: (logger: ILogger | undefined, requestBids: RequestBidsFn, generateProductCardResponse: GenerateSponsoredProductCardResponseFn, request: IBidRequest) => Result<IBuiltCarousel>;
|
|
44
|
+
export declare const BuildSponsoredCarouselFromInitialBid: (logger: ILogger | undefined, requestBids: RequestBidsFn, generateProductCardResponse: GenerateSponsoredProductCardResponseFn, request: IBidRequest, initialBid: IBid) => Result<IBuiltCarousel>;
|
|
45
|
+
export declare const BuildRecommendedCarousel: (logger: ILogger | undefined, evaluateClickthroughTemplate: EvaluateClickthroughTemplateFn, topProductGenerator: NonPersonalRecommenderFn, forYouProductGenerator: PersonalRecommenderFn, pastPurchasesProductGenerator: PersonalRecommenderFn, userId: string | undefined, recommenderType: PublicRecommenderType) => Result<IBuiltCarousel>;
|
|
46
|
+
export declare const BuildHybridCarousel: (logger: ILogger | undefined, evaluateClickthroughTemplate: EvaluateClickthroughTemplateFn, requestBids: RequestBidsFn, generateProductCardResponse: GenerateSponsoredProductCardResponseFn, topProductGenerator: NonPersonalRecommenderFn, forYouProductGenerator: PersonalRecommenderFn, pastPurchasesProductGenerator: PersonalRecommenderFn, userId: string | undefined, recommenderType: PublicRecommenderType, request: IBidRequest) => Result<IBuiltCarousel>;
|
|
47
|
+
export declare const BuildHybridCarouselFromInitialBid: (logger: ILogger | undefined, evaluateClickthroughTemplate: EvaluateClickthroughTemplateFn, requestBids: RequestBidsFn, generateProductCardResponse: GenerateSponsoredProductCardResponseFn, topProductGenerator: NonPersonalRecommenderFn, forYouProductGenerator: PersonalRecommenderFn, pastPurchasesProductGenerator: PersonalRecommenderFn, userId: string | undefined, recommenderType: PublicRecommenderType, request: IBidRequest, initialBid: IBid) => Result<IBuiltCarousel>;
|
|
48
|
+
export declare class InvalidRecommenderTypeError extends Error {
|
|
49
|
+
type: string;
|
|
50
|
+
constructor(type: string);
|
|
51
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ICompiledPublisherConfiguration, INativeTemplateDelegateWindow, IProductInformation } from '../../models';
|
|
2
|
+
import { type ILogger, type Result } from '../../services';
|
|
3
|
+
export declare const BuildClickthroughUrl: (logger: ILogger | undefined, windowInfo: INativeTemplateDelegateWindow, configuration: ICompiledPublisherConfiguration, product: IProductInformation) => Result<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type IBid, type ICompiledPublisherConfiguration, type INativeResponse, type INativeTemplateDelegateWindow, type IProductInformation } from '../../models';
|
|
2
|
+
import { type AsyncResult, type GetAllSponsoredProductFromNativeIdFn, type ILogger } from '../../services';
|
|
3
|
+
import { type IBuiltResponse } from './BuiltResponse';
|
|
4
|
+
export type BuildAllSponsoredProductCardResponsesFn = (bids: IBid[]) => AsyncResult<IBuiltProductCardBidResponse[]>;
|
|
5
|
+
export type GenerateSponsoredProductCardResponseFn = (bids: IBid[]) => AsyncGenerator<IBuiltProductCardBidResponse>;
|
|
6
|
+
export interface ITracker {
|
|
7
|
+
type: number;
|
|
8
|
+
url: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IPixelTracker extends ITracker {
|
|
11
|
+
type: 1;
|
|
12
|
+
}
|
|
13
|
+
export interface IScriptTracker extends ITracker {
|
|
14
|
+
type: 2;
|
|
15
|
+
}
|
|
16
|
+
export interface ITrackerObject {
|
|
17
|
+
win: string;
|
|
18
|
+
imp: string[];
|
|
19
|
+
others: ITracker[];
|
|
20
|
+
}
|
|
21
|
+
export type IBuiltProductCardBidResponse = IBuiltResponse & IBuiltProductCardResponse & {
|
|
22
|
+
native: INativeResponse;
|
|
23
|
+
sponsored: true;
|
|
24
|
+
};
|
|
25
|
+
export interface IBuiltProductCardResponse {
|
|
26
|
+
type: 'product-card';
|
|
27
|
+
product: IProductInformation;
|
|
28
|
+
trackers?: ITrackerObject;
|
|
29
|
+
clickthrough: string;
|
|
30
|
+
sponsored: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare const BuildAllSponsoredProductCardResponses: (logger: ILogger | undefined, getAllSponsoredProducts: GetAllSponsoredProductFromNativeIdFn, windowInfo: INativeTemplateDelegateWindow, configuration: ICompiledPublisherConfiguration, bids: IBid[]) => AsyncResult<IBuiltProductCardBidResponse[]>;
|
|
33
|
+
export declare function GenerateSponsoredProductCardResponse(logger: ILogger | undefined, getAllSponsoredProducts: GetAllSponsoredProductFromNativeIdFn, windowInfo: INativeTemplateDelegateWindow, configuration: ICompiledPublisherConfiguration, bids: IBid[]): AsyncGenerator<IBuiltProductCardBidResponse>;
|
|
34
|
+
export declare class MissingBidsError extends Error {
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
export declare class MalformedNativeResponseError extends Error {
|
|
38
|
+
readonly bid: IBid;
|
|
39
|
+
constructor(bid: IBid);
|
|
40
|
+
}
|
|
41
|
+
export declare class MissingWinUrlError extends Error {
|
|
42
|
+
readonly bid: IBid;
|
|
43
|
+
constructor(bid: IBid);
|
|
44
|
+
}
|
|
45
|
+
export declare class MissingProductIdError extends Error {
|
|
46
|
+
readonly bid: IBid;
|
|
47
|
+
readonly native: INativeResponse;
|
|
48
|
+
constructor(bid: IBid, native: INativeResponse);
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IVast } from '../../models';
|
|
2
|
+
import type { IBuiltResponse } from './BuiltResponse';
|
|
3
|
+
/**
|
|
4
|
+
* A built video response. The raw Vast XML response from the bidder has been parsed out into a structure object here.
|
|
5
|
+
* @expandType IBuiltResponse
|
|
6
|
+
*/
|
|
7
|
+
export interface IBuiltVideo extends IBuiltResponse {
|
|
8
|
+
type: 'video';
|
|
9
|
+
/**
|
|
10
|
+
* The parsed out Vast Video object
|
|
11
|
+
*/
|
|
12
|
+
video: IVast;
|
|
13
|
+
/**
|
|
14
|
+
* The clickthrough URL for the video
|
|
15
|
+
*/
|
|
16
|
+
clickthrough: string;
|
|
17
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './helpers';
|
|
2
2
|
export * from './models';
|
|
3
3
|
export * from './services';
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './constant-values';
|
|
6
|
-
export * from './helpers';
|
|
7
|
-
export * from './utils';
|
|
8
|
-
export * from './middleware';
|
|
9
|
-
export interface ISurfsideCoreAPI {
|
|
10
|
-
bidder: IBidderService;
|
|
11
|
-
config: IConfigurationService;
|
|
12
|
-
geo: IGeoService;
|
|
13
|
-
productFeed: IProductFeedService;
|
|
14
|
-
userId: IUserIDService;
|
|
15
|
-
recommender: IRecommenderService;
|
|
16
|
-
events: IEventService;
|
|
17
|
-
device: IDeviceService;
|
|
18
|
-
}
|
|
19
|
-
export declare function initSurfsideCore(): ISurfsideCoreAPI;
|
|
4
|
+
export * from './Api';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface IDynamicZone {
|
|
2
|
+
value: IScreenSize[];
|
|
3
|
+
}
|
|
4
|
+
export interface IScreenSize {
|
|
5
|
+
size: 'default' | 'mobile' | 'tablet' | 'desktop';
|
|
6
|
+
values: DynamicCreative[];
|
|
7
|
+
}
|
|
8
|
+
export interface IDynamicCreative {
|
|
9
|
+
zoneId: string;
|
|
10
|
+
keywords?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface IDynamicSimpleCreative extends IDynamicCreative {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IDynamicCatalogCreative extends IDynamicCreative {
|
|
17
|
+
strategy?: 'sponsored' | 'hybrid' | 'recommended';
|
|
18
|
+
recommendation?: 'top-products' | 'for-you' | 'past-purchases';
|
|
19
|
+
}
|
|
20
|
+
export interface IDynamicVideo extends IDynamicSimpleCreative {
|
|
21
|
+
type: 'Video';
|
|
22
|
+
minDuration?: number;
|
|
23
|
+
maxDuration: number;
|
|
24
|
+
}
|
|
25
|
+
export interface IDynamicBanner extends IDynamicSimpleCreative {
|
|
26
|
+
type: 'Banner';
|
|
27
|
+
}
|
|
28
|
+
export interface IDynamicProductCard extends IDynamicCatalogCreative {
|
|
29
|
+
type: 'ProductCard';
|
|
30
|
+
}
|
|
31
|
+
export interface IDynamicCarousel extends IDynamicCatalogCreative {
|
|
32
|
+
type: 'Carousel';
|
|
33
|
+
maxItems?: number;
|
|
34
|
+
cardMinWidth: number;
|
|
35
|
+
nextType: 'page' | 'product';
|
|
36
|
+
}
|
|
37
|
+
export type DynamicCreative = IDynamicBanner | IDynamicCarousel | IDynamicProductCard | IDynamicVideo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DynamicZone';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IProductInformation } from '../../models';
|
|
2
|
-
import type Handlebars from 'handlebars/runtime';
|
|
1
|
+
import type { IDynamicZone, IProductInformation } from '../../models';
|
|
3
2
|
export type ProductCallback = (e: Event, product: IProductInformation) => void;
|
|
4
|
-
export
|
|
5
|
-
|
|
3
|
+
export type Callbacks = Record<string, ProductCallback>;
|
|
4
|
+
export type TemplateDelegate = (context: IProductContext) => string;
|
|
6
5
|
export interface INativeTemplateDelegateWindow {
|
|
6
|
+
href: string;
|
|
7
7
|
origin: string;
|
|
8
8
|
port: string;
|
|
9
9
|
path: string;
|
|
@@ -30,20 +30,20 @@ export interface ICompiledPublisherConfigurationTemplatesDTO {
|
|
|
30
30
|
carouselStylesheet: string;
|
|
31
31
|
javascriptCallbacks: string;
|
|
32
32
|
}
|
|
33
|
-
export interface IProductContext {
|
|
33
|
+
export interface IProductContext extends IProductInformation {
|
|
34
34
|
product: Partial<IProductInformation>;
|
|
35
35
|
window: INativeTemplateDelegateWindow;
|
|
36
36
|
publisher: ICompiledPublisherConfiguration;
|
|
37
37
|
catalog: IProductInformation;
|
|
38
38
|
clickthrough?: string;
|
|
39
|
-
ext
|
|
39
|
+
ext?: any;
|
|
40
40
|
}
|
|
41
41
|
export interface ICompiledPublisherConfigurationTemplates {
|
|
42
|
-
productCardTemplate:
|
|
43
|
-
clickThroughUrlTemplate:
|
|
42
|
+
productCardTemplate: TemplateDelegate;
|
|
43
|
+
clickThroughUrlTemplate: TemplateDelegate;
|
|
44
44
|
productCardStylesheet: string;
|
|
45
45
|
carouselStylesheet: string;
|
|
46
|
-
javascriptCallbacks:
|
|
46
|
+
javascriptCallbacks: Callbacks;
|
|
47
47
|
}
|
|
48
48
|
export interface ICompiledPublisherConfigurationSettingsDTO {
|
|
49
49
|
commerceMediaEnabled: boolean;
|
|
@@ -57,8 +57,10 @@ export interface ICompiledPublisherConfigurationSettingsDTO {
|
|
|
57
57
|
export interface ICompiledPublisherConfigurationDTO {
|
|
58
58
|
templates: ICompiledPublisherConfigurationTemplatesDTO;
|
|
59
59
|
settings: ICompiledPublisherConfigurationSettingsDTO;
|
|
60
|
+
dynamicZones?: Record<string, IDynamicZone>;
|
|
60
61
|
}
|
|
61
62
|
export interface ICompiledPublisherConfiguration {
|
|
62
63
|
settings: ICompiledPublisherConfigurationSettingsDTO;
|
|
63
64
|
templates: ICompiledPublisherConfigurationTemplates;
|
|
65
|
+
dynamicZones?: Record<string, IDynamicZone>;
|
|
64
66
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface IProductInformation {
|
|
2
|
+
id?: string;
|
|
3
|
+
image?: string;
|
|
4
|
+
price?: string;
|
|
5
|
+
salePrice?: string;
|
|
6
|
+
thc?: string;
|
|
7
|
+
strain?: string;
|
|
8
|
+
cbd?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
brand_name?: string;
|
|
11
|
+
brandName?: string;
|
|
12
|
+
productType?: string;
|
|
13
|
+
details?: string;
|
|
14
|
+
cta?: string;
|
|
15
|
+
clickthroughUrl?: string;
|
|
16
|
+
winUrl?: string;
|
|
17
|
+
pixelUrl?: string;
|
|
18
|
+
ext?: any;
|
|
19
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export * from './Configuration';
|
|
2
|
+
export * from './Product';
|
|
3
|
+
export * from './Recommended';
|
|
@@ -13,14 +13,14 @@ export interface IUserAgent {
|
|
|
13
13
|
source?: number;
|
|
14
14
|
ext?: any;
|
|
15
15
|
}
|
|
16
|
-
export declare
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
16
|
+
export declare const AgentTypes: {
|
|
17
|
+
readonly Session: 1;
|
|
18
|
+
readonly Device: 2;
|
|
19
|
+
readonly User: 3;
|
|
20
|
+
};
|
|
21
21
|
export interface IUid {
|
|
22
22
|
id: string;
|
|
23
|
-
atype?:
|
|
23
|
+
atype?: number;
|
|
24
24
|
ext?: any;
|
|
25
25
|
}
|
|
26
26
|
export interface IEid {
|
|
@@ -97,16 +97,16 @@ export interface IGeo {
|
|
|
97
97
|
utcoffset?: number;
|
|
98
98
|
ext?: any;
|
|
99
99
|
}
|
|
100
|
-
export declare
|
|
101
|
-
|
|
102
|
-
PC
|
|
103
|
-
CTV
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
OOH
|
|
109
|
-
}
|
|
100
|
+
export declare const AdCom10DeviceTypes: {
|
|
101
|
+
readonly Mobile: 1;
|
|
102
|
+
readonly PC: 2;
|
|
103
|
+
readonly CTV: 3;
|
|
104
|
+
readonly Phone: 4;
|
|
105
|
+
readonly Tablet: 5;
|
|
106
|
+
readonly Connected: 6;
|
|
107
|
+
readonly SetTop: 7;
|
|
108
|
+
readonly OOH: 8;
|
|
109
|
+
};
|
|
110
110
|
export interface IDevice {
|
|
111
111
|
ua?: string;
|
|
112
112
|
geo?: IGeo;
|
|
@@ -358,7 +358,7 @@ export interface IImp {
|
|
|
358
358
|
rwdd?: number;
|
|
359
359
|
ssai?: number;
|
|
360
360
|
exp?: number;
|
|
361
|
-
ext?:
|
|
361
|
+
ext?: ISurfExtension;
|
|
362
362
|
}
|
|
363
363
|
export interface IRegs {
|
|
364
364
|
coppa?: number;
|
|
@@ -395,5 +395,15 @@ export interface IBidRequest {
|
|
|
395
395
|
bapp?: string[];
|
|
396
396
|
source?: ISource;
|
|
397
397
|
regs?: IRegs;
|
|
398
|
-
ext?:
|
|
398
|
+
ext?: ISurfExtension;
|
|
399
|
+
}
|
|
400
|
+
export interface ISurfExtension {
|
|
401
|
+
accountId: string;
|
|
402
|
+
siteId: string;
|
|
403
|
+
channelId: string;
|
|
404
|
+
locationId: string;
|
|
405
|
+
zoneId: string;
|
|
406
|
+
storeId: string;
|
|
407
|
+
placementId: string;
|
|
408
|
+
keywords?: string[];
|
|
399
409
|
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export declare const NativePosition: {
|
|
2
|
+
readonly Unknown: 0;
|
|
3
|
+
readonly AboveTheFold: 1;
|
|
4
|
+
readonly BelowTheFold: 3;
|
|
5
|
+
readonly Header: 4;
|
|
6
|
+
readonly Footer: 5;
|
|
7
|
+
readonly Sidebar: 6;
|
|
8
|
+
readonly FullScreen: 7;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The type of the image within native ad (icon vs main image)
|
|
12
|
+
*/
|
|
13
|
+
export declare const NativeImageTypes: {
|
|
14
|
+
readonly Icon: 1;
|
|
15
|
+
readonly Main: 3;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The type ID for each native asset type. IDs above 500 are surfside-specific fields, all
|
|
19
|
+
* others are OpenRTB Native Ad Spec 1.2 fields.
|
|
20
|
+
*/
|
|
21
|
+
export declare const NativeDataTypes: {
|
|
22
|
+
readonly Sponsored: 1;
|
|
23
|
+
readonly Desc: 2;
|
|
24
|
+
readonly Rating: 3;
|
|
25
|
+
readonly Likes: 4;
|
|
26
|
+
readonly Downloads: 5;
|
|
27
|
+
readonly Price: 6;
|
|
28
|
+
readonly SalePrice: 7;
|
|
29
|
+
readonly Phone: 8;
|
|
30
|
+
readonly Address: 9;
|
|
31
|
+
readonly Desc2: 10;
|
|
32
|
+
readonly DisplayURL: 11;
|
|
33
|
+
readonly CTAText: 12;
|
|
34
|
+
readonly SurfStrain: 500;
|
|
35
|
+
readonly SurfTHC: 501;
|
|
36
|
+
readonly SurfCBD: 502;
|
|
37
|
+
readonly SurfCategory: 503;
|
|
38
|
+
readonly SurfMetaProduct: 599;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* The ID for each field within a surfside native ad request. The Asset ID matches the asset type, for simplicity.
|
|
42
|
+
*/
|
|
43
|
+
export declare const NativeAssetId: {
|
|
44
|
+
readonly Title: 0;
|
|
45
|
+
readonly Image: 1;
|
|
46
|
+
readonly Sponsored: 2;
|
|
47
|
+
readonly Desc: 3;
|
|
48
|
+
readonly Rating: 4;
|
|
49
|
+
readonly Price: 5;
|
|
50
|
+
readonly SalePrice: 6;
|
|
51
|
+
readonly DisplayURL: 7;
|
|
52
|
+
readonly CTAText: 8;
|
|
53
|
+
readonly Video: 9;
|
|
54
|
+
readonly SurfStrain: 500;
|
|
55
|
+
readonly SurfTHC: 501;
|
|
56
|
+
readonly SurfCBD: 502;
|
|
57
|
+
readonly SurfCategory: 503;
|
|
58
|
+
readonly SurfMetaBrand: 598;
|
|
59
|
+
readonly SurfMetaProduct: 599;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Event types which can be tracked by the native ad unit
|
|
63
|
+
*/
|
|
64
|
+
export declare const EventTypes: {
|
|
65
|
+
readonly Imp: 1;
|
|
66
|
+
readonly ViewableMRC50: 2;
|
|
67
|
+
readonly ViewableMRC100: 3;
|
|
68
|
+
readonly ViewableVIDEO50: 4;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* The context of the page for the native ad unit, i.e what type of content is being displayed
|
|
72
|
+
*/
|
|
73
|
+
export declare const ContextTypes: {
|
|
74
|
+
readonly Content: 1;
|
|
75
|
+
readonly Social: 2;
|
|
76
|
+
readonly Product: 3;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* The sub-type of the context
|
|
80
|
+
*/
|
|
81
|
+
export declare const ContextSubTypes: {
|
|
82
|
+
readonly General: 10;
|
|
83
|
+
readonly Article: 11;
|
|
84
|
+
readonly Video: 12;
|
|
85
|
+
readonly Audio: 13;
|
|
86
|
+
readonly Image: 14;
|
|
87
|
+
readonly UserGenerated: 15;
|
|
88
|
+
readonly GeneralSocial: 20;
|
|
89
|
+
readonly Email: 21;
|
|
90
|
+
readonly Chat: 22;
|
|
91
|
+
readonly Product: 30;
|
|
92
|
+
readonly Application: 31;
|
|
93
|
+
readonly ProductReviews: 32;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The format of the ad unit, i.e: what type of ad is being displayed and where
|
|
97
|
+
*/
|
|
98
|
+
export declare const PlacementTypes: {
|
|
99
|
+
readonly InFeed: 1;
|
|
100
|
+
readonly Atomic: 2;
|
|
101
|
+
readonly OutsideCore: 3;
|
|
102
|
+
readonly Recommendation: 4;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Presets for default video MIME types
|
|
106
|
+
*/
|
|
107
|
+
export declare const VideoMimes: {
|
|
108
|
+
readonly MP4: "video/mp4";
|
|
109
|
+
readonly WEBM: "video/webm";
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* The method used to track events, 1x1 pixel of Javascript tag
|
|
113
|
+
*/
|
|
114
|
+
export declare const EventTrackingMethods: {
|
|
115
|
+
readonly Img: 1;
|
|
116
|
+
readonly JS: 2;
|
|
117
|
+
};
|
|
118
|
+
export interface INativeRequest {
|
|
119
|
+
ver?: string;
|
|
120
|
+
context?: number;
|
|
121
|
+
contextsubtype?: number;
|
|
122
|
+
plcmttype?: number;
|
|
123
|
+
plcmtcnt?: number;
|
|
124
|
+
seq?: number;
|
|
125
|
+
assets: IAssetObject[];
|
|
126
|
+
aurlsupport?: number;
|
|
127
|
+
durlsupport?: number;
|
|
128
|
+
eventtrackers?: IEventTrackerRequestObject[];
|
|
129
|
+
privacy?: number;
|
|
130
|
+
ext?: any;
|
|
131
|
+
}
|
|
132
|
+
export interface IAssetObject {
|
|
133
|
+
id: number;
|
|
134
|
+
required?: number;
|
|
135
|
+
title?: ITitleRequestObject;
|
|
136
|
+
img?: IImageRequestObject;
|
|
137
|
+
video?: IVideoRequestObject;
|
|
138
|
+
data?: IDataRequestObject;
|
|
139
|
+
ext?: any;
|
|
140
|
+
}
|
|
141
|
+
export interface ITitleRequestObject {
|
|
142
|
+
len: number;
|
|
143
|
+
ext?: any;
|
|
144
|
+
}
|
|
145
|
+
export interface IImageRequestObject {
|
|
146
|
+
type?: number;
|
|
147
|
+
w?: number;
|
|
148
|
+
wmin?: number;
|
|
149
|
+
h?: number;
|
|
150
|
+
hmin?: number;
|
|
151
|
+
mimes?: string[];
|
|
152
|
+
ext?: any;
|
|
153
|
+
}
|
|
154
|
+
export interface IVideoRequestObject {
|
|
155
|
+
mimes: number[] | string[];
|
|
156
|
+
minduration: number;
|
|
157
|
+
maxduration: number;
|
|
158
|
+
protocols: number[];
|
|
159
|
+
ext?: any;
|
|
160
|
+
}
|
|
161
|
+
export interface IDataRequestObject {
|
|
162
|
+
type: number;
|
|
163
|
+
len?: number;
|
|
164
|
+
ext?: any;
|
|
165
|
+
}
|
|
166
|
+
export interface IEventTrackerRequestObject {
|
|
167
|
+
event: number;
|
|
168
|
+
methods: number[];
|
|
169
|
+
ext?: any;
|
|
170
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type IProductInformation } from '../../models';
|
|
2
2
|
export interface INativeResponse {
|
|
3
3
|
native: INativeResponseDetails;
|
|
4
4
|
}
|
|
@@ -30,14 +30,14 @@ export interface ITitleResponseObject {
|
|
|
30
30
|
ext?: any;
|
|
31
31
|
}
|
|
32
32
|
export interface IImageResponseObject {
|
|
33
|
-
type:
|
|
33
|
+
type: number;
|
|
34
34
|
url: string;
|
|
35
35
|
w?: number;
|
|
36
36
|
h?: number;
|
|
37
37
|
ext?: any;
|
|
38
38
|
}
|
|
39
39
|
export interface IDataResponseObject {
|
|
40
|
-
type?:
|
|
40
|
+
type?: number;
|
|
41
41
|
value: string;
|
|
42
42
|
ext?: any;
|
|
43
43
|
}
|
|
@@ -51,8 +51,8 @@ export interface ILinkResponseObject {
|
|
|
51
51
|
ext?: any;
|
|
52
52
|
}
|
|
53
53
|
export interface IEventTrackerResponseObject {
|
|
54
|
-
event:
|
|
55
|
-
method:
|
|
54
|
+
event: number;
|
|
55
|
+
method: number;
|
|
56
56
|
url?: string;
|
|
57
57
|
customdata?: any;
|
|
58
58
|
ext?: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './BidRequest';
|
|
2
|
+
export * from './BidResponse';
|
|
3
|
+
export * from './NativeRequest';
|
|
4
|
+
export * from './NativeResponse';
|