@surfside/ads-core 2.0.1 → 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.
Files changed (274) hide show
  1. package/README.md +15 -15
  2. package/lib/cjs/Api.js +195 -0
  3. package/lib/cjs/Api.js.map +1 -0
  4. package/lib/cjs/helpers/Generator.js +50 -0
  5. package/lib/cjs/helpers/Generator.js.map +1 -0
  6. package/lib/cjs/helpers/Handlebars.js +270 -0
  7. package/lib/cjs/helpers/Handlebars.js.map +1 -0
  8. package/lib/cjs/helpers/NativeRequestBuilder.js +174 -0
  9. package/lib/cjs/helpers/NativeRequestBuilder.js.map +1 -0
  10. package/lib/cjs/helpers/RequestBuilder.js +160 -0
  11. package/lib/cjs/helpers/RequestBuilder.js.map +1 -0
  12. package/lib/cjs/helpers/TryGet.js +14 -0
  13. package/lib/cjs/helpers/TryGet.js.map +1 -0
  14. package/lib/cjs/helpers/Window.js +24 -0
  15. package/lib/cjs/helpers/Window.js.map +1 -0
  16. package/lib/cjs/helpers/index.js +24 -0
  17. package/lib/cjs/helpers/index.js.map +1 -0
  18. package/lib/cjs/helpers/response/Banner.js +4 -0
  19. package/lib/cjs/helpers/response/Banner.js.map +1 -0
  20. package/lib/cjs/helpers/response/BuiltResponse.js +27 -0
  21. package/lib/cjs/helpers/response/BuiltResponse.js.map +1 -0
  22. package/lib/cjs/helpers/response/Carousel.js +282 -0
  23. package/lib/cjs/helpers/response/Carousel.js.map +1 -0
  24. package/lib/cjs/helpers/response/Clickthrough.js +24 -0
  25. package/lib/cjs/helpers/response/Clickthrough.js.map +1 -0
  26. package/lib/cjs/helpers/response/ProductCard.js +198 -0
  27. package/lib/cjs/helpers/response/ProductCard.js.map +1 -0
  28. package/lib/cjs/helpers/response/Video.js +4 -0
  29. package/lib/cjs/helpers/response/Video.js.map +1 -0
  30. package/lib/cjs/helpers/response/index.js +23 -0
  31. package/lib/cjs/helpers/response/index.js.map +1 -0
  32. package/lib/cjs/index.js +21 -3488
  33. package/lib/cjs/index.js.map +1 -54
  34. package/lib/cjs/models/dynamic/DynamicZone.js +12 -0
  35. package/lib/cjs/models/dynamic/DynamicZone.js.map +1 -0
  36. package/lib/cjs/models/dynamic/index.js +18 -0
  37. package/lib/cjs/models/dynamic/index.js.map +1 -0
  38. package/lib/cjs/models/index.js +22 -0
  39. package/lib/cjs/models/index.js.map +1 -0
  40. package/lib/cjs/models/retail/Configuration.js +10 -0
  41. package/lib/cjs/models/retail/Configuration.js.map +1 -0
  42. package/lib/cjs/models/retail/Product.js +4 -0
  43. package/lib/cjs/models/retail/Product.js.map +1 -0
  44. package/lib/cjs/models/retail/Recommended.js +3 -0
  45. package/lib/cjs/models/retail/Recommended.js.map +1 -0
  46. package/lib/cjs/models/retail/index.js +20 -0
  47. package/lib/cjs/models/retail/index.js.map +1 -0
  48. package/lib/cjs/models/rtb/BidRequest.js +20 -0
  49. package/lib/cjs/models/rtb/BidRequest.js.map +1 -0
  50. package/lib/cjs/models/rtb/BidResponse.js +3 -0
  51. package/lib/cjs/models/rtb/BidResponse.js.map +1 -0
  52. package/lib/cjs/models/rtb/NativeRequest.js +122 -0
  53. package/lib/cjs/models/rtb/NativeRequest.js.map +1 -0
  54. package/lib/cjs/models/rtb/NativeResponse.js +26 -0
  55. package/lib/cjs/models/rtb/NativeResponse.js.map +1 -0
  56. package/lib/cjs/models/rtb/index.js +21 -0
  57. package/lib/cjs/models/rtb/index.js.map +1 -0
  58. package/lib/cjs/models/tracking/Geo.js +3 -0
  59. package/lib/cjs/models/tracking/Geo.js.map +1 -0
  60. package/lib/cjs/models/tracking/index.js +18 -0
  61. package/lib/cjs/models/tracking/index.js.map +1 -0
  62. package/lib/cjs/models/vast/Vast.js +4 -0
  63. package/lib/cjs/models/vast/Vast.js.map +1 -0
  64. package/lib/cjs/models/vast/index.js +18 -0
  65. package/lib/cjs/models/vast/index.js.map +1 -0
  66. package/lib/cjs/services/Bidder.js +128 -0
  67. package/lib/cjs/services/Bidder.js.map +1 -0
  68. package/lib/cjs/services/Configuration.js +93 -0
  69. package/lib/cjs/services/Configuration.js.map +1 -0
  70. package/lib/cjs/services/Device.js +236 -0
  71. package/lib/cjs/services/Device.js.map +1 -0
  72. package/lib/cjs/services/Dynamic.js +129 -0
  73. package/lib/cjs/services/Dynamic.js.map +1 -0
  74. package/lib/cjs/services/Geo.js +35 -0
  75. package/lib/cjs/services/Geo.js.map +1 -0
  76. package/lib/cjs/services/Logger.js +57 -0
  77. package/lib/cjs/services/Logger.js.map +1 -0
  78. package/lib/cjs/services/Memoization.js +17 -0
  79. package/lib/cjs/services/Memoization.js.map +1 -0
  80. package/lib/cjs/services/Product.js +127 -0
  81. package/lib/cjs/services/Product.js.map +1 -0
  82. package/lib/cjs/services/Recommender.js +83 -0
  83. package/lib/cjs/services/Recommender.js.map +1 -0
  84. package/lib/cjs/services/Result.js +220 -0
  85. package/lib/cjs/services/Result.js.map +1 -0
  86. package/lib/cjs/services/Template.js +43 -0
  87. package/lib/cjs/services/Template.js.map +1 -0
  88. package/lib/cjs/services/index.js +28 -0
  89. package/lib/cjs/services/index.js.map +1 -0
  90. package/lib/cjs/services/mock/Bidder.js +3 -0
  91. package/lib/cjs/services/mock/Bidder.js.map +1 -0
  92. package/lib/cjs/services/mock/index.js +18 -0
  93. package/lib/cjs/services/mock/index.js.map +1 -0
  94. package/lib/esm/Api.js +183 -0
  95. package/lib/esm/Api.js.map +1 -0
  96. package/lib/esm/helpers/Generator.js +42 -0
  97. package/lib/esm/helpers/Generator.js.map +1 -0
  98. package/lib/esm/helpers/Handlebars.js +251 -0
  99. package/lib/esm/helpers/Handlebars.js.map +1 -0
  100. package/lib/esm/helpers/NativeRequestBuilder.js +169 -0
  101. package/lib/esm/helpers/NativeRequestBuilder.js.map +1 -0
  102. package/lib/esm/helpers/RequestBuilder.js +157 -0
  103. package/lib/esm/helpers/RequestBuilder.js.map +1 -0
  104. package/lib/esm/helpers/TryGet.js +10 -0
  105. package/lib/esm/helpers/TryGet.js.map +1 -0
  106. package/lib/esm/helpers/Window.js +20 -0
  107. package/lib/esm/helpers/Window.js.map +1 -0
  108. package/lib/esm/helpers/index.js +8 -0
  109. package/lib/esm/helpers/index.js.map +1 -0
  110. package/lib/esm/helpers/response/Banner.js +3 -0
  111. package/lib/esm/helpers/response/Banner.js.map +1 -0
  112. package/lib/esm/helpers/response/BuiltResponse.js +22 -0
  113. package/lib/esm/helpers/response/BuiltResponse.js.map +1 -0
  114. package/lib/esm/helpers/response/Carousel.js +273 -0
  115. package/lib/esm/helpers/response/Carousel.js.map +1 -0
  116. package/lib/esm/helpers/response/Clickthrough.js +20 -0
  117. package/lib/esm/helpers/response/Clickthrough.js.map +1 -0
  118. package/lib/esm/helpers/response/ProductCard.js +189 -0
  119. package/lib/esm/helpers/response/ProductCard.js.map +1 -0
  120. package/lib/esm/helpers/response/Video.js +3 -0
  121. package/lib/esm/helpers/response/Video.js.map +1 -0
  122. package/lib/esm/helpers/response/index.js +7 -0
  123. package/lib/esm/helpers/response/index.js.map +1 -0
  124. package/lib/esm/index.js +5 -3460
  125. package/lib/esm/index.js.map +1 -54
  126. package/lib/esm/models/dynamic/DynamicZone.js +11 -0
  127. package/lib/esm/models/dynamic/DynamicZone.js.map +1 -0
  128. package/lib/esm/models/dynamic/index.js +2 -0
  129. package/lib/esm/models/dynamic/index.js.map +1 -0
  130. package/lib/esm/models/index.js +6 -0
  131. package/lib/esm/models/index.js.map +1 -0
  132. package/lib/esm/models/retail/Configuration.js +9 -0
  133. package/lib/esm/models/retail/Configuration.js.map +1 -0
  134. package/lib/esm/models/retail/Product.js +3 -0
  135. package/lib/esm/models/retail/Product.js.map +1 -0
  136. package/lib/esm/models/retail/Recommended.js +2 -0
  137. package/lib/esm/models/retail/Recommended.js.map +1 -0
  138. package/lib/esm/models/retail/index.js +4 -0
  139. package/lib/esm/models/retail/index.js.map +1 -0
  140. package/lib/esm/models/rtb/BidRequest.js +17 -0
  141. package/lib/esm/models/rtb/BidRequest.js.map +1 -0
  142. package/lib/esm/models/rtb/BidResponse.js +2 -0
  143. package/lib/esm/models/rtb/BidResponse.js.map +1 -0
  144. package/lib/esm/models/rtb/NativeRequest.js +119 -0
  145. package/lib/esm/models/rtb/NativeRequest.js.map +1 -0
  146. package/lib/esm/models/rtb/NativeResponse.js +23 -0
  147. package/lib/esm/models/rtb/NativeResponse.js.map +1 -0
  148. package/lib/esm/models/rtb/index.js +5 -0
  149. package/lib/esm/models/rtb/index.js.map +1 -0
  150. package/lib/esm/models/tracking/Geo.js +2 -0
  151. package/lib/esm/models/tracking/Geo.js.map +1 -0
  152. package/lib/esm/models/tracking/index.js +2 -0
  153. package/lib/esm/models/tracking/index.js.map +1 -0
  154. package/lib/esm/models/vast/Vast.js +3 -0
  155. package/lib/esm/models/vast/Vast.js.map +1 -0
  156. package/lib/esm/models/vast/index.js +2 -0
  157. package/lib/esm/models/vast/index.js.map +1 -0
  158. package/lib/esm/services/Bidder.js +119 -0
  159. package/lib/esm/services/Bidder.js.map +1 -0
  160. package/lib/esm/services/Configuration.js +56 -0
  161. package/lib/esm/services/Configuration.js.map +1 -0
  162. package/lib/esm/services/Device.js +232 -0
  163. package/lib/esm/services/Device.js.map +1 -0
  164. package/lib/esm/services/Dynamic.js +120 -0
  165. package/lib/esm/services/Dynamic.js.map +1 -0
  166. package/lib/esm/services/Geo.js +30 -0
  167. package/lib/esm/services/Geo.js.map +1 -0
  168. package/lib/esm/services/Logger.js +52 -0
  169. package/lib/esm/services/Logger.js.map +1 -0
  170. package/lib/esm/services/Memoization.js +13 -0
  171. package/lib/esm/services/Memoization.js.map +1 -0
  172. package/lib/esm/services/Product.js +120 -0
  173. package/lib/esm/services/Product.js.map +1 -0
  174. package/lib/esm/services/Recommender.js +78 -0
  175. package/lib/esm/services/Recommender.js.map +1 -0
  176. package/lib/esm/services/Result.js +199 -0
  177. package/lib/esm/services/Result.js.map +1 -0
  178. package/lib/esm/services/Template.js +38 -0
  179. package/lib/esm/services/Template.js.map +1 -0
  180. package/lib/esm/services/index.js +12 -0
  181. package/lib/esm/services/index.js.map +1 -0
  182. package/lib/esm/services/mock/Bidder.js +2 -0
  183. package/lib/esm/services/mock/Bidder.js.map +1 -0
  184. package/lib/esm/services/mock/index.js +2 -0
  185. package/lib/esm/services/mock/index.js.map +1 -0
  186. package/lib/types/Api.d.ts +5 -5
  187. package/lib/types/helpers/Handlebars.d.ts +3 -3
  188. package/lib/types/helpers/NativeRequestBuilder.d.ts +1 -1
  189. package/lib/types/helpers/RequestBuilder.d.ts +1 -1
  190. package/lib/types/helpers/TryGet.d.ts +1 -1
  191. package/lib/types/helpers/Window.d.ts +2 -2
  192. package/lib/types/helpers/response/Banner.d.ts +1 -1
  193. package/lib/types/helpers/response/BuiltResponse.d.ts +1 -1
  194. package/lib/types/helpers/response/Carousel.d.ts +1 -1
  195. package/lib/types/helpers/response/Clickthrough.d.ts +1 -1
  196. package/lib/types/helpers/response/ProductCard.d.ts +3 -3
  197. package/lib/types/helpers/response/Video.d.ts +2 -2
  198. package/lib/types/services/Bidder.d.ts +3 -3
  199. package/lib/types/services/Configuration.d.ts +1 -1
  200. package/lib/types/services/Dynamic.d.ts +6 -6
  201. package/lib/types/services/Geo.d.ts +1 -1
  202. package/lib/types/services/Product.d.ts +1 -1
  203. package/lib/types/services/Template.d.ts +3 -3
  204. package/package.json +41 -33
  205. package/lib/index.js +0 -1
  206. package/lib/index.js.map +0 -1
  207. package/lib/types/constant-values/index.d.ts +0 -46
  208. package/lib/types/errors/index.d.ts +0 -3
  209. package/lib/types/helpers/generators/CollectN.d.ts +0 -2
  210. package/lib/types/helpers/generators/index.d.ts +0 -1
  211. package/lib/types/helpers/handlebars/index.d.ts +0 -119
  212. package/lib/types/helpers/requests/RequestBuilder.d.ts +0 -124
  213. package/lib/types/helpers/requests/SimpleBannerRequest.d.ts +0 -26
  214. package/lib/types/helpers/requests/index.d.ts +0 -2
  215. package/lib/types/helpers/responses/BuildBannerResponse.d.ts +0 -10
  216. package/lib/types/helpers/responses/BuildNativeResponse.d.ts +0 -21
  217. package/lib/types/helpers/responses/BuildVideoResponse.d.ts +0 -0
  218. package/lib/types/helpers/responses/ClickthroughHelpers.d.ts +0 -2
  219. package/lib/types/helpers/responses/VastHelpers.d.ts +0 -4
  220. package/lib/types/helpers/responses/index.d.ts +0 -4
  221. package/lib/types/middleware/DeviceMiddleware.d.ts +0 -3
  222. package/lib/types/middleware/GeoMiddleware.d.ts +0 -3
  223. package/lib/types/middleware/IdentityMiddleware.d.ts +0 -4
  224. package/lib/types/middleware/index.d.ts +0 -3
  225. package/lib/types/models/retail/IProductInformation.d.ts +0 -37
  226. package/lib/types/models/retail/IPublisherConfiguration.d.ts +0 -64
  227. package/lib/types/models/retail/IRecommenderResponse.d.ts +0 -10
  228. package/lib/types/models/rtb/IBidRequest.d.ts +0 -399
  229. package/lib/types/models/rtb/IBidResponse.d.ts +0 -47
  230. package/lib/types/models/rtb/native/Constants.d.ts +0 -60
  231. package/lib/types/models/rtb/native/INativeRequest.d.ts +0 -54
  232. package/lib/types/models/rtb/native/INativeResponse.d.ts +0 -60
  233. package/lib/types/models/rtb/native/NativeConstants.d.ts +0 -120
  234. package/lib/types/models/rtb/native/NativeRequestBuilder.d.ts +0 -158
  235. package/lib/types/models/rtb/native/index.d.ts +0 -4
  236. package/lib/types/models/tracking/IEvents.d.ts +0 -82
  237. package/lib/types/models/tracking/IGeoContext.d.ts +0 -14
  238. package/lib/types/models/tracking/IUserID.d.ts +0 -1
  239. package/lib/types/services/OverrideService.d.ts +0 -10
  240. package/lib/types/services/logger/ILoggerService.d.ts +0 -39
  241. package/lib/types/services/logger/LocalLoggerService.d.ts +0 -19
  242. package/lib/types/services/logger/index.d.ts +0 -2
  243. package/lib/types/services/product-feed/IProductFeedService.d.ts +0 -5
  244. package/lib/types/services/product-feed/SurfsideProductFeedService.d.ts +0 -11
  245. package/lib/types/services/product-feed/index.d.ts +0 -2
  246. package/lib/types/services/recommender/IRecommenderService.d.ts +0 -47
  247. package/lib/types/services/recommender/SurfsideRecommenderService.d.ts +0 -31
  248. package/lib/types/services/recommender/index.d.ts +0 -2
  249. package/lib/types/services/rtb/bidder/IBidderService.d.ts +0 -12
  250. package/lib/types/services/rtb/bidder/SurfsideBidderService.d.ts +0 -28
  251. package/lib/types/services/rtb/bidder/index.d.ts +0 -2
  252. package/lib/types/services/rtb/configuration/IConfigurationService.d.ts +0 -14
  253. package/lib/types/services/rtb/configuration/SurfsideConfigurationService.d.ts +0 -29
  254. package/lib/types/services/rtb/configuration/index.d.ts +0 -2
  255. package/lib/types/services/rtb/index.d.ts +0 -2
  256. package/lib/types/services/tracking/device/DeviceOverrideService.d.ts +0 -8
  257. package/lib/types/services/tracking/device/IDeviceService.d.ts +0 -4
  258. package/lib/types/services/tracking/device/SurfsideDeviceService.d.ts +0 -16
  259. package/lib/types/services/tracking/device/index.d.ts +0 -3
  260. package/lib/types/services/tracking/events/IEventService.d.ts +0 -5
  261. package/lib/types/services/tracking/events/SurfsideEventService.d.ts +0 -42
  262. package/lib/types/services/tracking/events/index.d.ts +0 -2
  263. package/lib/types/services/tracking/geo/GeoOverrideService.d.ts +0 -8
  264. package/lib/types/services/tracking/geo/IGeoService.d.ts +0 -12
  265. package/lib/types/services/tracking/geo/SurfsideGeoService.d.ts +0 -7
  266. package/lib/types/services/tracking/geo/index.d.ts +0 -3
  267. package/lib/types/services/tracking/index.d.ts +0 -4
  268. package/lib/types/services/tracking/user/IUserIDService.d.ts +0 -4
  269. package/lib/types/services/tracking/user/SurfsideUserIDService.d.ts +0 -7
  270. package/lib/types/services/tracking/user/UserOverrideService.d.ts +0 -8
  271. package/lib/types/services/tracking/user/index.d.ts +0 -3
  272. package/lib/types/utils/Protocol.d.ts +0 -1
  273. package/lib/types/utils/Rendering.d.ts +0 -44
  274. package/lib/types/utils/index.d.ts +0 -2
@@ -1,46 +0,0 @@
1
- export declare enum HttpStatus {
2
- OK = 200,
3
- NO_CONTENT = 204,
4
- BAD_REQUEST = 400,
5
- NOT_FOUND = 404,
6
- UNAUTHORIZED = 401,
7
- FORBIDDEN = 403
8
- }
9
- export declare enum HttpStatusClass {
10
- SUCCESS = 2,
11
- CLIENT_ERROR = 4,
12
- SERVER_ERROR = 5
13
- }
14
- export declare enum SurfColors {
15
- INDIGO = "#331c7a",
16
- ULTRAMARINE = "#1f69ff",
17
- AQUAMARINE = "#4ceaaa",
18
- ELECTRIC_LIME = "#c5f700",
19
- CRAYOLA = "#f7a800",
20
- ORANGE = "#f66d18",
21
- RED = "#e72024",
22
- LAVENDER = "#c0abff",
23
- ULTRA_RED = "#f97585",
24
- SOFT_GOLD = "#f4bd5d",
25
- MAGIC_MINT = "#baf7db",
26
- SKY_BLUE = "#7eceeb",
27
- CARIBBEAN_GREN = "#0dcc91",
28
- LAVENDER_GRAY = "#d3d3e0"
29
- }
30
- export declare enum IPServices {
31
- IP2LOCATION = 1,
32
- NEUSTAR = 2,
33
- MAXMIND = 3,
34
- NETACUITY = 4
35
- }
36
- export declare enum LocationType {
37
- GPS = 1,
38
- IP = 2,
39
- USER = 3
40
- }
41
- export declare enum Environment {
42
- PROD = "PROD",
43
- STAGING = "STAGING",
44
- LOCAL = "LOCAL",
45
- MOCK = "MOCK"
46
- }
@@ -1,3 +0,0 @@
1
- export declare class NoBidResponseError extends Error {
2
- constructor(message: string);
3
- }
@@ -1,2 +0,0 @@
1
- export declare function CollectN<T>(generator: Generator<T>, n: number): T[];
2
- export declare function CollectNAsync<T>(generator: AsyncGenerator<T>, n: number): Promise<T[]>;
@@ -1 +0,0 @@
1
- export * from './CollectN';
@@ -1,119 +0,0 @@
1
- /**
2
- * Converts the passed string to a slug with the specified options. By default, the slug is hyphenated and only
3
- * contains alphanumeric characters. You can pass a different hyphenation regex and a different drop regex to
4
- * customize the slug. For example, {{slug "My Product Name"}} will return "my-product-name".
5
- *
6
- * To change which characters are converted to hyphens, you can pass a regular expression to the hyphenate option.
7
- * For example, {{slug "My Product's Name" hyphenate="[\s']"}} will return "my-product-s-name".
8
- * The default hyphenate regex is /[\s_\-,]/ig.
9
- *
10
- * To remove characters instead of hyphenate them, you can pass a regular expression to the drop option.
11
- * For example, {{slug "My Product's Name" drop="[^A-Za-z0-9\s']"}} will return "my-product's-name".
12
- * The default drop regex is /[^A-Za-z0-9\-]/ig.
13
- *
14
- * To limit the max number of hyphenated slug components returned, you can pass a length option.
15
- * For example, {{slug "My Product's Name" length=2}} will return "my-product".
16
- * The default length is 5.
17
- *
18
- * @param name The string to be slugified
19
- * @param options The options object. Can take "hypenate", "drop", and "length" options.
20
- * @returns The slugified string
21
- */
22
- export declare function slug(name: string, options: {
23
- hash: {
24
- hyphenate: string | undefined;
25
- drop: string | undefined;
26
- length: number | undefined;
27
- };
28
- }): string;
29
- /**
30
- * Converts the passed string to lowercase. For example, {{lower "My Product Name"}} will return "my product name".
31
- *
32
- * @param name The string to be converted to lowercase
33
- * @returns A lowercase version of the passed string
34
- */
35
- export declare function lower(name: string): string;
36
- /**
37
- * Returns the path component of the URL at the specified position, 1-indexed
38
- * For example, if the URL is "https://example.com/foo/bar", {{path 1}} will return "foo".
39
- *
40
- * @param position The position of the path component to return, 1-indexed
41
- * @returns The path component at the specified position
42
- */
43
- export declare function path(position: number): string;
44
- export declare function global(): any;
45
- export declare function sed(input: string, searchRegex: string, replacement: string): string;
46
- /**
47
- * Returns the value of the specified query parameter from the URL, specified by key.
48
- * For example, if the URL is "https://example.com?foo=bar", {{search "foo"}} will return "bar".
49
- *
50
- * @param name The name of the query parameter to return
51
- * @returns The value of the query parameter, or an empty string if the parameter is not found
52
- */
53
- export declare function search(name: string): string;
54
- /**
55
- * Returns the first truthy argument, or an empty string if all arguments are falsy. Returns false for empty strings
56
- * For example, {{coalesce false (eq "b" "d") c}} will return "c", because false is falsy, "b" is not equal to "d",
57
- * and c is truthy.
58
- *
59
- * @returns The first truthy argument, or an empty string if all arguments are falsy
60
- */
61
- export declare function coalesce(): string;
62
- /**
63
- * Joins the passed arguments with the specified separator.
64
- * For example, {{join "foo" "bar" "baz"}} will return "foo/bar/baz"..
65
- *
66
- * There is an optional "separator" argument that can be passed to change the separator. For example,
67
- * {{join "foo" "bar" "baz" separator=","}} will return "foo,bar,baz".
68
- *
69
- * @returns The joined string
70
- */
71
- export declare function join(): string;
72
- /**
73
- * Encodes the passed string for use in a URI component.
74
- *
75
- * @param component The string to encode
76
- * @returns The encoded string, or an empty string if the component is falsy
77
- */
78
- export declare function uri(component: string): string;
79
- /**
80
- * Returns true if the two passed arguments are equal (using javascript ===), false otherwise.
81
- *
82
- * @param a The first argument
83
- * @param b The second argument
84
- * @returns True if the two arguments are equal, false otherwise
85
- */
86
- export declare function eq(a: any, b: any): boolean;
87
- /**
88
- * Returns true if either of the passed arguments are truthy, false otherwise.
89
- *
90
- * @param a The first argument
91
- * @param b The second argument
92
- * @returns True if either of the arguments are truthy, false otherwise
93
- */
94
- export declare function or(a: any, b: any): boolean;
95
- /**
96
- * Returns true if both of the passed arguments are truthy, false otherwise.
97
- *
98
- * @param a The first argument
99
- * @param b The second argument
100
- * @returns True if both of the arguments are truthy, false otherwise
101
- */
102
- export declare function and(a: any, b: any): boolean;
103
- /**
104
- * Returns true if the first argument is in the second argument (an array). Otherwise, returns false.
105
- * If the second argument is not an array, or the array is empty, this will return false.
106
- *
107
- * The name of the helper is "in" but the name of the function is "isIn" because "in" is a reserved word in javascript.
108
- *
109
- * @param a The value to check
110
- * @param b The array to check against
111
- * @returns True if the value is in the array, false otherwise
112
- */
113
- export declare function isIn(a: any, b: any[]): boolean;
114
- /**
115
- * Returns an array of the passed arguments. Useful with the "in" helper
116
- *
117
- * @returns An array of the passed arguments
118
- */
119
- export declare function array(): any[];
@@ -1,124 +0,0 @@
1
- import type { IApp, IBanner, IBidRequest, IDevice, IImp, INative, IRegs, ISite, IUser, IVideo } from '../../models';
2
- declare enum BuilderCreativeType {
3
- BANNER = 0,
4
- VIDEO = 1,
5
- NATIVE = 2
6
- }
7
- interface IBuilderState<T, U> {
8
- currentCreative: T;
9
- type: U;
10
- imp: IImp;
11
- }
12
- export interface IBannerBuilderState extends IBuilderState<IBanner, BuilderCreativeType.BANNER> {
13
- }
14
- export interface IVideoBuilderState extends IBuilderState<IVideo, BuilderCreativeType.VIDEO> {
15
- }
16
- export interface INativeBuilderState extends IBuilderState<INative, BuilderCreativeType.NATIVE> {
17
- }
18
- /** Builds an OpenRTB 2.6 bid request */
19
- export declare class RequestBuilder {
20
- private readonly _request;
21
- private _builderState;
22
- /**
23
- *
24
- * @param id The ID of the request. If not provided, a random ID will be generated.
25
- */
26
- constructor(id?: string);
27
- /**
28
- *
29
- * @returns The built bid request
30
- */
31
- build(): IBidRequest;
32
- /**
33
- * Adds surfside-specific information to the top level bid request and all subsequent impression objects
34
- * @param accountId The account ID of the current store
35
- * @param siteId The site ID of the current store
36
- * @param locationId The location ID of the current store (i.e: the ID of the specific brick and mortar store)
37
- * @param zoneId The ID for the zone on the advertisement
38
- * @param channelId The channel ID being advertised on
39
- * @param keywords A set of keywords describing the content of the page.
40
- * @returns The builder instance
41
- */
42
- withSurfContext(accountId: string, siteId: string, locationId: string, zoneId: string, channelId?: string, keywords?: string[]): this;
43
- /**
44
- * Adds a banner impression to the request. If a creative is already being built,
45
- * it will be appended to the request.
46
- * @param w The width of the banner being requested
47
- * @param h The height of the banner being requested
48
- * @param options Other OpenRTB fields to include in the banner object.
49
- * @returns The builder instance
50
- */
51
- withBanner(w: number, h: number, options?: Partial<IBanner>): this;
52
- /**
53
- * Adds a video impression to the request. If a create is already being built,
54
- * it will be appended to the request
55
- * @param w The width of the video being requested
56
- * @param h The height of the video being requested
57
- * @param minduration The minimum duration of the video, in seconds
58
- * @param maxduration The maximum duration of the video, in seconds
59
- * @param mimes A list of MIME types supported by the video. Defaults to ['video/mp4', 'video/webm']
60
- * @param options Other OpenRTB fields to include in the video object
61
- * @returns The builder instance
62
- */
63
- withVideo(w: number, h: number, minduration: number, maxduration: number, mimes?: string[], options?: Partial<IVideo>): this;
64
- /**
65
- * Adds a native impression to the request. If a creative is already being built,
66
- * it will be appended to the request. Native requests are stringified JSON objects
67
- * in the OpenRTB Native 1.2 format. Use the NativeRequestBuilder to build these objects.
68
- * @param request The native request object, as a stringified JSON object
69
- * @param options Other OpenRTB fields to include in the native object
70
- * @returns The builder instance
71
- */
72
- withNative(request: string, options?: Partial<INative>): this;
73
- /**
74
- * Sets the bid floor on the current impression. This operates on each impression,
75
- * so it needs to be called again for each impression if multiple are present.
76
- * @param bidfloor The bid floor to set
77
- * @param bidfloorcur The currency of the bid floor. Defaults to 'USD'
78
- * @returns The builder instance
79
- */
80
- withBidFloor(bidfloor: number, bidfloorcur?: string): this;
81
- /**
82
- * Adds an extension to the current impression. Extensions are dynamically typed dictionaries
83
- * with options that are specific to the bidder. This operates on each impression, so it needs
84
- * to be called again for each impression if multiple are present.
85
- * @param ext The extension to add
86
- * @returns The builder instance
87
- */
88
- withImpExt(ext: any): this;
89
- /**
90
- * The site that the ad appears on.
91
- * @param site The site object. If not provided, a default site object will be created using the current hostname.
92
- * @returns The builder instance
93
- */
94
- withSite(site?: ISite): this;
95
- /**
96
- * The app that the ad appears in.
97
- * @param app The app object. If not provided, a default app object will be created using the current hostname.
98
- * @returns The builder instance
99
- */
100
- withApp(app?: IApp): this;
101
- /**
102
- * Information about the current user's device, including useragent, IP, make and model as well as geo information.
103
- * @param device The device object
104
- * @returns The builder instance
105
- */
106
- withDevice(device: IDevice): this;
107
- /**
108
- * Information about the current user. Geo information can be included here, but is different
109
- * from the device's geo information; this is the user's home location.
110
- * @param user The user object
111
- * @returns The builder instance
112
- */
113
- withUser(user: IUser): this;
114
- /**
115
- * Used if any data privacy regulations are relevant to the request (i.e: COPPA, GDPR, etc.)
116
- * @param regs The regs object
117
- * @returns The builder instance
118
- */
119
- withRegulations(regs: IRegs): this;
120
- private _appendBuilderState;
121
- private _appendImpression;
122
- private _generateId;
123
- }
124
- export {};
@@ -1,26 +0,0 @@
1
- import type { IApp, IBidRequest, IDevice, IImp, IRegs, ISite, ISource, IUser } from '../../models';
2
- export declare class SimpleBannerRequest implements IBidRequest {
3
- id: string;
4
- imp: IImp[];
5
- site?: ISite | undefined;
6
- app?: IApp | undefined;
7
- device?: IDevice | undefined;
8
- user?: IUser | undefined;
9
- test?: number | undefined;
10
- at?: number | undefined;
11
- tmax?: number | undefined;
12
- wseat?: string[] | undefined;
13
- bseat?: string[] | undefined;
14
- allimps?: number | undefined;
15
- cur?: string[] | undefined;
16
- wlang?: string[] | undefined;
17
- wlangb?: string[] | undefined;
18
- bcat?: string[] | undefined;
19
- cattax?: number[] | undefined;
20
- badv?: string[] | undefined;
21
- bapp?: string[] | undefined;
22
- source?: ISource | undefined;
23
- regs?: IRegs | undefined;
24
- ext?: any;
25
- constructor(id: string, w: number, h: number);
26
- }
@@ -1,2 +0,0 @@
1
- export * from './SimpleBannerRequest';
2
- export * from './RequestBuilder';
@@ -1,10 +0,0 @@
1
- import type { IBid, IBidResponse, ICompiledPublisherConfiguration, IProductInformation } from '../../models';
2
- interface IBuiltBanner {
3
- element: HTMLDivElement | null;
4
- product: IProductInformation | null;
5
- clickThrough: string | null;
6
- }
7
- export declare function BuildBanner(response: IBidResponse | null, config?: ICompiledPublisherConfiguration): IBuiltBanner;
8
- export declare function BuildBannerFromBid(bid: IBid): HTMLDivElement | null;
9
- export declare function BuildProductInfoFromElement(element: HTMLDivElement): IProductInformation | null;
10
- export {};
@@ -1,21 +0,0 @@
1
- import { type IBidResponse, type ICompiledPublisherConfiguration, type INativeResponse } from '../../models';
2
- import { ILoggerService, type IProductFeedService } from '../../services';
3
- export interface ITrackers {
4
- pixels: string[];
5
- js: string[];
6
- }
7
- export interface IBuiltNative {
8
- data: INativeResponse;
9
- clickThrough: string;
10
- winUrl: string;
11
- trackers: ITrackers;
12
- element?: Element;
13
- }
14
- export interface IPublisherContext {
15
- config: ICompiledPublisherConfiguration;
16
- productService: IProductFeedService;
17
- accountId: string;
18
- siteId: string;
19
- locationId: string;
20
- }
21
- export declare function BuildNativeResponse(response: IBidResponse | null, context?: IPublisherContext, logger?: ILoggerService): Promise<IBuiltNative[]>;
@@ -1,2 +0,0 @@
1
- import type { ICompiledPublisherConfiguration, IProductInformation } from '../../models';
2
- export declare function BuildClickThroughUrl(configuration: ICompiledPublisherConfiguration, product: IProductInformation, catalog: IProductInformation, ext?: any): string;
@@ -1,4 +0,0 @@
1
- import type { IBidResponse, IVast } from '../../models';
2
- import type { ILoggerService } from '../../services';
3
- export declare function DeserializeVideo(response: IBidResponse, logger?: ILoggerService): IVast | null;
4
- export declare function DeserializeVast(logger: ILoggerService | undefined, adm: string): IVast;
@@ -1,4 +0,0 @@
1
- export * from './BuildBannerResponse';
2
- export * from './BuildNativeResponse';
3
- export * from './ClickthroughHelpers';
4
- export * from './VastHelpers';
@@ -1,3 +0,0 @@
1
- import type { IBidRequest } from '../models';
2
- import type { IDeviceService, ILoggerService } from '../services';
3
- export declare function DeviceMiddleware(logger: ILoggerService | undefined, deviceService: IDeviceService | undefined, request: IBidRequest): Promise<IBidRequest>;
@@ -1,3 +0,0 @@
1
- import type { IBidRequest } from '../models';
2
- import type { IGeoService, ILoggerService } from '../services';
3
- export declare function GeoMiddlewareImmediate(geoService: IGeoService, logger: ILoggerService | undefined, request: IBidRequest, geoTargetingEnabled: boolean, ipTargetingEnabled: boolean): Promise<IBidRequest>;
@@ -1,4 +0,0 @@
1
- import { type IBidRequest } from '../models';
2
- import type { ILoggerService, IUserIDService } from '../services';
3
- export declare function IdentityMiddleware(userIDService: IUserIDService, logger: ILoggerService | undefined, request: IBidRequest): Promise<IBidRequest>;
4
- export declare const buildIdentityMiddleware: (userIdService: IUserIDService, logger: ILoggerService | undefined) => (request: IBidRequest) => Promise<IBidRequest>;
@@ -1,3 +0,0 @@
1
- export * from './GeoMiddleware';
2
- export * from './DeviceMiddleware';
3
- export * from './IdentityMiddleware';
@@ -1,37 +0,0 @@
1
- export interface IProductInformation {
2
- image: string | null;
3
- price: string | null;
4
- salePrice: string | null;
5
- thc: string | null;
6
- strain: string | null;
7
- cbd: string | null;
8
- name: string | null;
9
- brand_name: string | null;
10
- brandName: string | null;
11
- productType: string | null;
12
- details: string | null;
13
- cta: string | null;
14
- clickthroughUrl: string | null;
15
- winUrl: string | null;
16
- pixelUrl: string | null;
17
- ext?: any;
18
- }
19
- export declare class DefaultProductInformation implements IProductInformation {
20
- image: string | null;
21
- price: string | null;
22
- salePrice: string | null;
23
- thc: string | null;
24
- strain: string | null;
25
- cbd: string | null;
26
- name: string | null;
27
- brand_name: string | null;
28
- brandName: string | null;
29
- productType: string | null;
30
- details: string | null;
31
- cta: string | null;
32
- clickthroughUrl: string | null;
33
- winUrl: string | null;
34
- pixelUrl: string | null;
35
- ext?: any;
36
- constructor();
37
- }
@@ -1,64 +0,0 @@
1
- import type { IProductInformation } from '../../models';
2
- import type Handlebars from 'handlebars/runtime';
3
- export type ProductCallback = (e: Event, product: IProductInformation) => void;
4
- export interface ICallbacks extends Record<string, ProductCallback> {
5
- }
6
- export interface INativeTemplateDelegateWindow {
7
- origin: string;
8
- port: string;
9
- path: string;
10
- host: string;
11
- host_name: string;
12
- search: string;
13
- hash: string;
14
- protocol: string;
15
- }
16
- export interface IPublisherConfiguration {
17
- geoTargeting?: boolean;
18
- ipTargeting?: boolean;
19
- clickThroughUrlTemplate?: string;
20
- productCardTemplate?: string;
21
- productCardStyleSheet?: string;
22
- carouselStyleSheet?: string;
23
- reAuctionEnabled?: boolean;
24
- reAuctionInterval?: number;
25
- }
26
- export interface ICompiledPublisherConfigurationTemplatesDTO {
27
- productCardTemplate: string;
28
- productCardStylesheet: string;
29
- clickThroughUrlTemplate: string;
30
- carouselStylesheet: string;
31
- javascriptCallbacks: string;
32
- }
33
- export interface IProductContext {
34
- product: Partial<IProductInformation>;
35
- window: INativeTemplateDelegateWindow;
36
- publisher: ICompiledPublisherConfiguration;
37
- catalog: IProductInformation;
38
- clickthrough?: string;
39
- ext: any;
40
- }
41
- export interface ICompiledPublisherConfigurationTemplates {
42
- productCardTemplate: Handlebars.TemplateDelegate<IProductContext>;
43
- clickThroughUrlTemplate: Handlebars.TemplateDelegate<IProductContext>;
44
- productCardStylesheet: string;
45
- carouselStylesheet: string;
46
- javascriptCallbacks: ICallbacks;
47
- }
48
- export interface ICompiledPublisherConfigurationSettingsDTO {
49
- commerceMediaEnabled: boolean;
50
- ipTargetingEnabled: boolean;
51
- geoTargetingEnabled: boolean;
52
- reauctionEnabled: boolean;
53
- reauctionIntervalMs: number;
54
- productFeedEnabled: boolean;
55
- sponsoredByEnabled?: boolean;
56
- }
57
- export interface ICompiledPublisherConfigurationDTO {
58
- templates: ICompiledPublisherConfigurationTemplatesDTO;
59
- settings: ICompiledPublisherConfigurationSettingsDTO;
60
- }
61
- export interface ICompiledPublisherConfiguration {
62
- settings: ICompiledPublisherConfigurationSettingsDTO;
63
- templates: ICompiledPublisherConfigurationTemplates;
64
- }
@@ -1,10 +0,0 @@
1
- export interface IRecommendedProduct {
2
- item_id: string;
3
- rating?: number;
4
- }
5
- export interface IRecommenderResponse {
6
- id: string;
7
- error?: string;
8
- locationId: string;
9
- recommendations: IRecommendedProduct[];
10
- }