@surfside/ads-core-mock 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/index.js +58 -6358
- package/lib/cjs/index.js.map +1 -41
- package/lib/cjs/mock/Bidder.js +451 -0
- package/lib/cjs/mock/Bidder.js.map +1 -0
- package/lib/cjs/mock/CheatCodes.js +9 -0
- package/lib/cjs/mock/CheatCodes.js.map +1 -0
- package/lib/cjs/mock/Configuration.js +309 -0
- package/lib/cjs/mock/Configuration.js.map +1 -0
- package/lib/cjs/mock/Device.js +15 -0
- package/lib/cjs/mock/Device.js.map +1 -0
- package/lib/cjs/mock/Dynamic.js +66 -0
- package/lib/cjs/mock/Dynamic.js.map +1 -0
- package/lib/cjs/mock/Geo.js +19 -0
- package/lib/cjs/mock/Geo.js.map +1 -0
- package/lib/cjs/mock/Product.js +146 -0
- package/lib/cjs/mock/Product.js.map +1 -0
- package/lib/cjs/mock/Recommender.js +13 -0
- package/lib/cjs/mock/Recommender.js.map +1 -0
- package/lib/cjs/mock/index.js +20 -0
- package/lib/cjs/mock/index.js.map +1 -0
- package/lib/esm/index.js +51 -6330
- package/lib/esm/index.js.map +1 -41
- package/lib/esm/mock/Bidder.js +446 -0
- package/lib/esm/mock/Bidder.js.map +1 -0
- package/lib/esm/mock/CheatCodes.js +6 -0
- package/lib/esm/mock/CheatCodes.js.map +1 -0
- package/lib/esm/mock/Configuration.js +305 -0
- package/lib/esm/mock/Configuration.js.map +1 -0
- package/lib/esm/mock/Device.js +11 -0
- package/lib/esm/mock/Device.js.map +1 -0
- package/lib/esm/mock/Dynamic.js +62 -0
- package/lib/esm/mock/Dynamic.js.map +1 -0
- package/lib/esm/mock/Geo.js +15 -0
- package/lib/esm/mock/Geo.js.map +1 -0
- package/lib/esm/mock/Product.js +139 -0
- package/lib/esm/mock/Product.js.map +1 -0
- package/lib/esm/mock/Recommender.js +9 -0
- package/lib/esm/mock/Recommender.js.map +1 -0
- package/lib/esm/mock/index.js +4 -0
- package/lib/esm/mock/index.js.map +1 -0
- package/package.json +32 -22
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGetConfiguration = void 0;
|
|
4
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
// import clickThroughUrlTemplate from './mock-configuration-templates/ClickthroughURL.component.hbs';
|
|
6
|
+
// import productCardTemplate from './mock-configuration-templates/ProductCard.component.hbs';
|
|
7
|
+
// import productCardStylesheet from './mock-configuration-templates/ProductCardStylesheet.component.scss';
|
|
8
|
+
// import carouselStylesheet from './mock-configuration-templates/CarouselStylesheet.component.scss';
|
|
9
|
+
/**
|
|
10
|
+
* A mock configuration service that returns a hard-coded configuration. Enables geo and IP targeting by default.
|
|
11
|
+
*/
|
|
12
|
+
const productCardTemplate = (data) => `
|
|
13
|
+
<div class="mock-product-card">
|
|
14
|
+
<div class="card-shadow-area"></div>
|
|
15
|
+
<div class="card-pattern-area"></div>
|
|
16
|
+
<div class="main-card-area">
|
|
17
|
+
<div class="product-image" _mousemove="moveImage" _mouseleave="stopMove">
|
|
18
|
+
<img src="${data.product.image}" />
|
|
19
|
+
</div>
|
|
20
|
+
<div class="product-data">
|
|
21
|
+
<h1>
|
|
22
|
+
${data.product.name}
|
|
23
|
+
<div class="filter"></div>
|
|
24
|
+
</h1>
|
|
25
|
+
<div class="brand">
|
|
26
|
+
<div class="horizontal-rule"></div>
|
|
27
|
+
<span>by ${data.product.brandName}</span>
|
|
28
|
+
</div>
|
|
29
|
+
<p>${data.product.details}</p>
|
|
30
|
+
</div>
|
|
31
|
+
<a _click="" href="${data.clickthrough}" target="_blank">
|
|
32
|
+
<div class="cta">
|
|
33
|
+
Add To Cart
|
|
34
|
+
</div>
|
|
35
|
+
</a>
|
|
36
|
+
</div>
|
|
37
|
+
</div>`;
|
|
38
|
+
const productCardStylesheet = `
|
|
39
|
+
@keyframes scrollBackground {
|
|
40
|
+
from {
|
|
41
|
+
background-position: 0px 0px;
|
|
42
|
+
}
|
|
43
|
+
to {
|
|
44
|
+
background-position: 50px 50px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.mock-product-card {
|
|
49
|
+
display: none;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-grow: 1;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
position: relative;
|
|
54
|
+
margin-right: 30px;
|
|
55
|
+
|
|
56
|
+
.product-image {
|
|
57
|
+
|
|
58
|
+
width: calc(100% - 20px);
|
|
59
|
+
margin: 10px;
|
|
60
|
+
transition: transform 0.3s;
|
|
61
|
+
z-index: 3;
|
|
62
|
+
|
|
63
|
+
&:hover {
|
|
64
|
+
transform: scale(1.25);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
img {
|
|
68
|
+
box-shadow: 4px 4px 1px -1px rgba(0, 0, 0, 0.2), 0px 0px 4px 0px rgba(0, 0, 0, 0.2);
|
|
69
|
+
transition: transform 0.1s;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.product-data {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.main-card-area {
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
background-color: rgb(244, 244, 244);
|
|
82
|
+
transform: translate(-10px, -10px);
|
|
83
|
+
transition: transform 0.1s ease-in, box-shadow 0.1s ease-in;
|
|
84
|
+
box-shadow: 0px 0px 3px 2px rgba(0, 0, 0, 0.2);
|
|
85
|
+
border: 2px dotted rgba(0, 0, 0, 0.4);
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
|
|
90
|
+
.product-image {
|
|
91
|
+
img {
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
h1 {
|
|
97
|
+
font-family: 'Trebuchet MS', Helvetica, sans-serif;
|
|
98
|
+
letter-spacing: 3px;
|
|
99
|
+
text-transform: uppercase;
|
|
100
|
+
padding: 0 5px;
|
|
101
|
+
position: relative;
|
|
102
|
+
font-size: 22px;
|
|
103
|
+
margin-left: 5px;
|
|
104
|
+
text-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
|
|
105
|
+
|
|
106
|
+
.filter {
|
|
107
|
+
position: absolute;
|
|
108
|
+
background: #baf7db;
|
|
109
|
+
mix-blend-mode: multiply;
|
|
110
|
+
width: calc(4ch + 10px);
|
|
111
|
+
height: 1.5em;
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.brand {
|
|
118
|
+
font-family: 'Tahoma', Helvetica, sans-serif;
|
|
119
|
+
text-transform: uppercase;
|
|
120
|
+
color: rgba(0, 0, 0, 0.4);
|
|
121
|
+
font-size: 12px;
|
|
122
|
+
width: 100%;
|
|
123
|
+
display: flex;
|
|
124
|
+
justify-content: flex-end;
|
|
125
|
+
text-align: right;
|
|
126
|
+
letter-spacing: 2px;
|
|
127
|
+
box-sizing: border-box;
|
|
128
|
+
padding: 0 10px;
|
|
129
|
+
gap: 5px;
|
|
130
|
+
text-shadow: 0 0 1px rgba(0, 0, 0, 0.3);
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
.horizontal-rule {
|
|
134
|
+
height: 2px;
|
|
135
|
+
background: #baf7db;
|
|
136
|
+
mix-blend-mode: multiply;
|
|
137
|
+
flex-grow: 1;
|
|
138
|
+
box-sizing: border-box;
|
|
139
|
+
padding: 0 5px;
|
|
140
|
+
transform: translateY(6px);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
span {
|
|
144
|
+
flex-shrink: 2;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
p {
|
|
149
|
+
font-family: 'Tahoma', Helvetica, sans-serif;
|
|
150
|
+
padding: 0 10px;
|
|
151
|
+
margin: 10px auto;
|
|
152
|
+
font-size: 14px;
|
|
153
|
+
line-height: 32px;
|
|
154
|
+
display: -webkit-box;
|
|
155
|
+
-webkit-line-clamp: 3;
|
|
156
|
+
-webkit-box-orient: vertical;
|
|
157
|
+
overflow: hidden;
|
|
158
|
+
text-overflow: ellipsis " [...]";
|
|
159
|
+
color: rgb(59, 48, 68);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
> a {
|
|
163
|
+
text-decoration: none;
|
|
164
|
+
letter-spacing: 3px;
|
|
165
|
+
color: rgb(59, 48, 68);
|
|
166
|
+
padding: 10px 10px;
|
|
167
|
+
}
|
|
168
|
+
.cta {
|
|
169
|
+
width: 100%;
|
|
170
|
+
background: #baf7db;
|
|
171
|
+
padding: 5px 10px;
|
|
172
|
+
display: flex;
|
|
173
|
+
justify-content: space-around;
|
|
174
|
+
box-sizing: border-box;
|
|
175
|
+
font-family: 'Trebuchet MS', Helvetica, sans-serif;
|
|
176
|
+
border: 2px dotted grey;
|
|
177
|
+
transition: background 0.1s ease-in, color 0.1s ease-in;
|
|
178
|
+
font-weight: 100;
|
|
179
|
+
|
|
180
|
+
&:hover {
|
|
181
|
+
background: #c0abff;
|
|
182
|
+
color: #ecf0f1;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.card-shadow-area {
|
|
188
|
+
position: absolute;
|
|
189
|
+
left: 0;
|
|
190
|
+
top: 0;
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 100%;
|
|
193
|
+
background: #c0abff;
|
|
194
|
+
border: 2px dashed rgba(0, 0, 0, 0.8);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.card-pattern-area {
|
|
198
|
+
position: absolute;
|
|
199
|
+
left: 0;
|
|
200
|
+
top: 0;
|
|
201
|
+
width: 100%;
|
|
202
|
+
height: 100%;
|
|
203
|
+
|
|
204
|
+
background-color: #c0abff;
|
|
205
|
+
background-image: linear-gradient(#f4f4f4 2px, transparent 2px),
|
|
206
|
+
linear-gradient(90deg, #f4f4f4 2px, transparent 2px),
|
|
207
|
+
linear-gradient(#f4f4f4 1px, transparent 1px),
|
|
208
|
+
linear-gradient(90deg, #f4f4f4 1px, #c0abff 1px);
|
|
209
|
+
background-size: 50px 50px, 50px 50px, 10px 10px, 10px 10px;
|
|
210
|
+
background-position: -2px -2px, -2px -2px, -1px -1px, -1px -1px;
|
|
211
|
+
|
|
212
|
+
opacity: 0;
|
|
213
|
+
transition: opacity 0.4s ease-in;
|
|
214
|
+
animation: scrollBackground 2s linear infinite;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&:hover {
|
|
218
|
+
.main-card-area {
|
|
219
|
+
transform: translate(-20px, -20px);
|
|
220
|
+
box-shadow: 10px 10px 7px 2px rgba(0, 0, 0, 0.2);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.card-pattern-area {
|
|
224
|
+
opacity: 0.7;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.surf-product-card.sponsored {
|
|
230
|
+
position: relative;
|
|
231
|
+
|
|
232
|
+
&::after {
|
|
233
|
+
left: -18px;
|
|
234
|
+
letter-spacing: 2px;
|
|
235
|
+
text-transform: uppercase;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
`;
|
|
240
|
+
const carouselStylesheet = `
|
|
241
|
+
.surf-carousel {
|
|
242
|
+
.sponsored-by {
|
|
243
|
+
font-family: 'Trebuchet MS', Verdana, Geneva, Tahoma, sans-serif;
|
|
244
|
+
margin: 0 0 20px 0;
|
|
245
|
+
padding: 0;
|
|
246
|
+
font-size: 26px;
|
|
247
|
+
font-weight: 100;
|
|
248
|
+
letter-spacing: 3px;
|
|
249
|
+
text-transform: uppercase;
|
|
250
|
+
text-decoration: underline dashed;
|
|
251
|
+
color: rgba(0, 0, 0, 0.7);
|
|
252
|
+
|
|
253
|
+
&.sponsoredByOne::before {
|
|
254
|
+
content: 'Brought to you by ';
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
&.recommended::before {
|
|
258
|
+
content: 'Suggested';
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
`;
|
|
264
|
+
const clickThroughUrlTemplate = (data) => `https://surfside.io/${data.product.brandName}`;
|
|
265
|
+
const MockGetConfiguration = async (logger) => {
|
|
266
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('MockGetConfiguration');
|
|
267
|
+
log?.info('getting mock configuration');
|
|
268
|
+
return (0, ads_core_1.Ok)({
|
|
269
|
+
templates: {
|
|
270
|
+
productCardTemplate,
|
|
271
|
+
clickThroughUrlTemplate,
|
|
272
|
+
productCardStylesheet,
|
|
273
|
+
carouselStylesheet,
|
|
274
|
+
javascriptCallbacks: {
|
|
275
|
+
'moveImage': (e) => {
|
|
276
|
+
const target = e.currentTarget;
|
|
277
|
+
const img = target.querySelector('img');
|
|
278
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
279
|
+
const offsetX = e.clientX - rect.left;
|
|
280
|
+
const offsetY = e.clientY - rect.top;
|
|
281
|
+
const dx = (offsetX - (target.clientWidth / 2)) /
|
|
282
|
+
(target.clientWidth / 2);
|
|
283
|
+
const dy = (offsetY - target.clientHeight / 2) /
|
|
284
|
+
(target.clientHeight / 2);
|
|
285
|
+
console.log(dx, dy);
|
|
286
|
+
img.style.transform = `perspective(1000px)
|
|
287
|
+
rotateY(${dx * 40}deg)
|
|
288
|
+
rotateX(${-dy * 40}deg)`;
|
|
289
|
+
},
|
|
290
|
+
'stopMove': (e) => {
|
|
291
|
+
if (e.target === e.currentTarget) {
|
|
292
|
+
e.currentTarget.querySelector('img').style.transform = '';
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
settings: {
|
|
298
|
+
commerceMediaEnabled: true,
|
|
299
|
+
ipTargetingEnabled: true,
|
|
300
|
+
geoTargetingEnabled: true,
|
|
301
|
+
reauctionEnabled: true,
|
|
302
|
+
reauctionIntervalMs: 30000,
|
|
303
|
+
productFeedEnabled: true,
|
|
304
|
+
sponsoredByEnabled: true
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
};
|
|
308
|
+
exports.MockGetConfiguration = MockGetConfiguration;
|
|
309
|
+
//# sourceMappingURL=Configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Configuration.js","sourceRoot":"src/","sources":["mock/Configuration.ts"],"names":[],"mappings":";;;AAAA,iDAM4B;AAE5B,sGAAsG;AACtG,8FAA8F;AAC9F,2GAA2G;AAC3G,qGAAqG;AAErG;;EAEE;AAEF,MAAM,mBAAmB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC;;;;;;wBAMnB,IAAI,CAAC,OAAO,CAAC,KAAK;;;;kBAIxB,IAAI,CAAC,OAAO,CAAC,IAAI;;;;;2BAKR,IAAI,CAAC,OAAO,CAAC,SAAS;;iBAEhC,IAAI,CAAC,OAAO,CAAC,OAAO;;6BAER,IAAI,CAAC,YAAY;;;;;;OAMvC,CAAC;AAER,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyM7B,CAAC;AAEF,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB1B,CAAC;AAEF,MAAM,uBAAuB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,uBAAuB,IAAI,CAAC,OAAO,CAAC,SA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AAE;oBACd,IACI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,aAAa,EAC9B,CAAC;wBACE,CAAC,CAAC,aAA6B,CAAC,aAAa,CAAC,KAAK,CAAE,CAAC,KAAK,CAAC,SAAS,GAAG,EAAE,CAAC;oBAChF,CAAC;gBACL,CAAC;aACJ;SACJ;QACD,QAAQ,EAAE;YACN,oBAAoB,EAAE,IAAI;YAC1B,kBAAkB,EAAE,IAAI;YACxB,mBAAmB,EAAE,IAAI;YACzB,gBAAgB,EAAE,IAAI;YACtB,mBAAmB,EAAE,KAAK;YAC1B,kBAAkB,EAAE,IAAI;YACxB,kBAAkB,EAAE,IAAI;SAC3B;KACJ,CAAC,CAAC;AACP,CAAC,CAAC;AA/CW,QAAA,oBAAoB,wBA+C/B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGetDevice = void 0;
|
|
4
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
const MockGetDevice = () => (0, ads_core_1.Ok)({
|
|
6
|
+
ua: 'Mozilla/5.0 (X11; Linux x86_64; rv:138.0) Gecko/20100101 Firefox/138.0',
|
|
7
|
+
make: 'Windows',
|
|
8
|
+
model: 'PC',
|
|
9
|
+
os: 'Windows',
|
|
10
|
+
osv: '11',
|
|
11
|
+
w: 1920,
|
|
12
|
+
h: 1080
|
|
13
|
+
});
|
|
14
|
+
exports.MockGetDevice = MockGetDevice;
|
|
15
|
+
//# sourceMappingURL=Device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Device.js","sourceRoot":"src/","sources":["mock/Device.ts"],"names":[],"mappings":";;;AAAA,iDAAmE;AAE5D,MAAM,aAAa,GAAG,GAAoB,EAAE,CAAC,IAAA,aAAE,EAAC;IACnD,EAAE,EAAE,wEAAwE;IAC5E,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,IAAI;IACX,EAAE,EAAE,SAAS;IACb,GAAG,EAAE,IAAI;IACT,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,IAAI;CACV,CAAC,CAAC;AARU,QAAA,aAAa,iBAQvB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGetDynamicZone = void 0;
|
|
4
|
+
const ads_core_client_1 = require("@surfside/ads-core-client");
|
|
5
|
+
const MockGetDynamicZone = async () => {
|
|
6
|
+
return (0, ads_core_client_1.Ok)({
|
|
7
|
+
value: [
|
|
8
|
+
{
|
|
9
|
+
'size': 'mobile',
|
|
10
|
+
'values': [
|
|
11
|
+
{
|
|
12
|
+
'type': 'Video',
|
|
13
|
+
'zoneId': 'my-video',
|
|
14
|
+
width: 320,
|
|
15
|
+
height: 240,
|
|
16
|
+
maxDuration: 30
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
'type': 'Carousel',
|
|
20
|
+
'zoneId': 'my-zone',
|
|
21
|
+
'cardMinWidth': 320,
|
|
22
|
+
'nextType': 'page',
|
|
23
|
+
'catalog': true,
|
|
24
|
+
'strategy': 'hybrid',
|
|
25
|
+
'recommend': 'top-products'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
'type': 'Banner',
|
|
29
|
+
'zoneId': 'my-zone',
|
|
30
|
+
'width': 4,
|
|
31
|
+
'height': 1
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
'size': 'default',
|
|
37
|
+
'values': [
|
|
38
|
+
{
|
|
39
|
+
'type': 'Banner',
|
|
40
|
+
'zoneId': 'my-zone',
|
|
41
|
+
'width': 8,
|
|
42
|
+
'height': 1
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
'type': 'Video',
|
|
46
|
+
'zoneId': 'my-video',
|
|
47
|
+
width: 320,
|
|
48
|
+
height: 240,
|
|
49
|
+
maxDuration: 30
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
'type': 'Carousel',
|
|
53
|
+
'zoneId': 'my-zone',
|
|
54
|
+
'cardMinWidth': 320,
|
|
55
|
+
'nextType': 'page',
|
|
56
|
+
'catalog': true,
|
|
57
|
+
'strategy': 'hybrid',
|
|
58
|
+
'recommend': 'top-products'
|
|
59
|
+
},
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
exports.MockGetDynamicZone = MockGetDynamicZone;
|
|
66
|
+
//# sourceMappingURL=Dynamic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dynamic.js","sourceRoot":"src/","sources":["mock/Dynamic.ts"],"names":[],"mappings":";;;AAAA,+DAAoF;AAE7E,MAAM,kBAAkB,GAAG,KAAK,IAA+B,EAAE;IACpE,OAAO,IAAA,oBAAE,EAAC;QACN,KAAK,EAAE;YACH;gBACI,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE;oBACN;wBACI,MAAM,EAAE,OAAO;wBACf,QAAQ,EAAE,UAAU;wBACpB,KAAK,EAAE,GAAG;wBACV,MAAM,EAAE,GAAG;wBACX,WAAW,EAAE,EAAE;qBAClB;oBACD;wBACI,MAAM,EAAE,UAAU;wBAClB,QAAQ,EAAE,SAAS;wBACnB,cAAc,EAAE,GAAG;wBACnB,UAAU,EAAE,MAAM;wBAClB,SAAS,EAAE,IAAI;wBACf,UAAU,EAAE,QAAQ;wBACpB,WAAW,EAAE,cAAc;qBAC9B;oBACD;wBACI,MAAM,EAAE,QAAQ;wBAChB,QAAQ,EAAE,SAAS;wBACnB,OAAO,EAAE,CAAC;wBACV,QAAQ,EAAE,CAAC;qBACd;iBACJ;aACJ;YACD;gBACI,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE;oBACN;wBACI,MAAM,EAAE,QAAQ;wBAChB,QAAQ,EAAE,SAAS;wBACnB,OAAO,EAAE,CAAC;wBACV,QAAQ,EAAE,CAAC;qBACd;oBACD;wBACI,MAAM,EAAE,OAAO;wBACf,QAAQ,EAAE,UAAU;wBACpB,KAAK,EAAE,GAAG;wBACV,MAAM,EAAE,GAAG;wBACX,WAAW,EAAE,EAAE;qBAClB;oBACD;wBACI,MAAM,EAAE,UAAU;wBAClB,QAAQ,EAAE,SAAS;wBACnB,cAAc,EAAE,GAAG;wBACnB,UAAU,EAAE,MAAM;wBAClB,SAAS,EAAE,IAAI;wBACf,UAAU,EAAE,QAAQ;wBACpB,WAAW,EAAE,cAAc;qBAC9B;iBAEJ;aACJ;SACJ;KACJ,CAAC,CAAC;AACP,CAAC,CAAC;AA5DW,QAAA,kBAAkB,sBA4D7B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGetGeo = void 0;
|
|
4
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
5
|
+
const MockGetGeo = async () => (0, ads_core_1.Ok)({
|
|
6
|
+
country: 'USA',
|
|
7
|
+
region: 'Virginia',
|
|
8
|
+
city: 'Richmond',
|
|
9
|
+
zip: '23218',
|
|
10
|
+
coords: {
|
|
11
|
+
latitude: 37.538837527059044,
|
|
12
|
+
longitude: -77.43359909814527,
|
|
13
|
+
accuracy: 1
|
|
14
|
+
},
|
|
15
|
+
utcoffset: -4,
|
|
16
|
+
ip: '127.0.0.1'
|
|
17
|
+
});
|
|
18
|
+
exports.MockGetGeo = MockGetGeo;
|
|
19
|
+
//# sourceMappingURL=Geo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Geo.js","sourceRoot":"src/","sources":["mock/Geo.ts"],"names":[],"mappings":";;;AAAA,iDAA4E;AAErE,MAAM,UAAU,GAAG,KAAK,IAA8B,EAAE,CAAC,IAAA,aAAE,EAAC;IAC/D,OAAO,EAAE,KAAK;IACd,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,UAAU;IAChB,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE;QACJ,QAAQ,EAAE,kBAAkB;QAC5B,SAAS,EAAE,CAAC,iBAAiB;QAC7B,QAAQ,EAAE,CAAC;KACd;IACD,SAAS,EAAE,CAAC,CAAC;IACb,EAAE,EAAE,WAAW;CAClB,CAAC,CAAC;AAZU,QAAA,UAAU,cAYpB"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGetRecommendedProduct = exports.MockGetAllSponsoredProducts = void 0;
|
|
4
|
+
exports.MockGetSposoredProduct = MockGetSposoredProduct;
|
|
5
|
+
exports.MockGenerateSponsoredProductCard = MockGenerateSponsoredProductCard;
|
|
6
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
7
|
+
const CheatCodes_1 = require("./CheatCodes");
|
|
8
|
+
const FakeProducts = [
|
|
9
|
+
{
|
|
10
|
+
'name': 'SkyHigh OG',
|
|
11
|
+
'description': 'Premium indica strain with earthy undertones and deep relaxation effects',
|
|
12
|
+
//"brand": "CannaCloud"
|
|
13
|
+
'brand': 'Mid Software'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
'name': 'Mellow Mint Tincture',
|
|
17
|
+
'description': 'Fast-acting CBD oil with refreshing mint flavor for daytime relief',
|
|
18
|
+
//"brand": "GreenLeaf Therapeutics"
|
|
19
|
+
'brand': 'Mid Software'
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
'name': 'DreamWalker Gummies',
|
|
23
|
+
'description': 'Balanced THC:CBD ratio gummies for gentle euphoria and sleep support',
|
|
24
|
+
//"brand": "Elevated Edibles"
|
|
25
|
+
'brand': 'Mid Software'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
'name': 'Purple Haze Cartridge',
|
|
29
|
+
'description': 'Sativa-dominant vape cartridge with berry notes and creative stimulation',
|
|
30
|
+
//"brand": "Vapor Valley"
|
|
31
|
+
'brand': 'Zen Cloud'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
'name': 'Zen Garden Pre-rolls',
|
|
35
|
+
'description': 'Hand-rolled hybrid joints featuring calming terpene profile',
|
|
36
|
+
//"brand": "Chronic Creations"
|
|
37
|
+
'brand': 'Zen Cloud'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
'name': 'Relief Balm Plus',
|
|
41
|
+
'description': 'High-potency topical with cooling menthol for targeted muscle recovery',
|
|
42
|
+
//"brand": "HempHeal"
|
|
43
|
+
'brand': 'Zen Cloud'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
'name': 'Cosmic Cookie',
|
|
47
|
+
'description': 'Infused chocolate chip delight with precise 10mg THC microdosing',
|
|
48
|
+
//"brand": "Baked Bliss"
|
|
49
|
+
'brand': 'Zen Cloud'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
'name': 'Morning Mist Spray',
|
|
53
|
+
'description': 'Rapid sublingual delivery system with citrus essence for mood elevation',
|
|
54
|
+
//"brand": "Aurora Botanicals"
|
|
55
|
+
'brand': 'Mid Software'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
'name': 'Night Owl Resin',
|
|
59
|
+
'description': 'Premium live resin concentrate with sedative indica properties',
|
|
60
|
+
//"brand": "Extract Experts"
|
|
61
|
+
'brand': 'Mid Software'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
'name': 'Harmony Drops',
|
|
65
|
+
'description': '1:1 CBD:THC oil drops for balanced relief without intense psychoactivity',
|
|
66
|
+
//"brand": "Balanced Botanics"
|
|
67
|
+
'brand': 'Mid Software'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
'name': 'Commander Kief',
|
|
71
|
+
'description': 'Billy Blazed - 28 year old man of below-average work ethic, working diligently in his living ' +
|
|
72
|
+
'room has created a device for slowing the progression of time using a crushed soda can and ' +
|
|
73
|
+
'tin foil. At 3pm on a Wednesday, when others are at work, Billy enters his living room, activates his ' +
|
|
74
|
+
'device with a Bic lighter, and transforms into... COMMANDER KIEF - Doer of nothing!',
|
|
75
|
+
//"brand": "Mid Software"
|
|
76
|
+
'brand': 'Mid Software'
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
async function* MockGetSposoredProduct(logger, accountId) {
|
|
80
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('MockGetSponsoredProduct');
|
|
81
|
+
log?.info('Getting mock sponsored product');
|
|
82
|
+
while (true) {
|
|
83
|
+
for (const fake of FakeProducts) {
|
|
84
|
+
log?.debug('Fake product', accountId);
|
|
85
|
+
yield productify(fake);
|
|
86
|
+
}
|
|
87
|
+
log?.debug('Back to the beginning');
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const MockGetAllSponsoredProducts = async () => (0, ads_core_1.Ok)(FakeProducts.map(productify));
|
|
91
|
+
exports.MockGetAllSponsoredProducts = MockGetAllSponsoredProducts;
|
|
92
|
+
const MockGetRecommendedProduct = async () => (0, ads_core_1.Ok)(productify(FakeProducts[Math.floor(Math.random() * FakeProducts.length)]));
|
|
93
|
+
exports.MockGetRecommendedProduct = MockGetRecommendedProduct;
|
|
94
|
+
const productify = (product) => ({
|
|
95
|
+
name: product.name,
|
|
96
|
+
brand_name: product.brand,
|
|
97
|
+
brandName: product.brand,
|
|
98
|
+
details: product.description,
|
|
99
|
+
image: `http://creative.surfside.io/mock/flower${Math.floor(Math.random() * 10) + 1}.jpg`
|
|
100
|
+
});
|
|
101
|
+
async function* MockGenerateSponsoredProductCard(logger, windowInfo, config, accountId, bids) {
|
|
102
|
+
const log = (0, ads_core_1.Ctx)(logger)?.with('MockGenerateSponsoredProductCard');
|
|
103
|
+
log?.info('Generating mock sponsored product card response');
|
|
104
|
+
for (const bid of bids) {
|
|
105
|
+
log?.info('Going through bids', bid);
|
|
106
|
+
const native = JSON.parse(bid?.adm ?? '');
|
|
107
|
+
log?.debug('Native', native);
|
|
108
|
+
for await (const product of MockGetSposoredProduct(logger, accountId)) {
|
|
109
|
+
log?.info('Yielding sponsored product card');
|
|
110
|
+
switch (accountId) {
|
|
111
|
+
case CheatCodes_1.CHEAT_CODES.returnSome: {
|
|
112
|
+
log?.info('Checking cheatcode...');
|
|
113
|
+
if (Math.random() > 0.75) {
|
|
114
|
+
log?.info('Returning no product');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case CheatCodes_1.CHEAT_CODES.returnNone: {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
yield {
|
|
125
|
+
type: 'product-card',
|
|
126
|
+
native,
|
|
127
|
+
clickthrough: config.templates.clickThroughUrlTemplate({
|
|
128
|
+
product,
|
|
129
|
+
window: windowInfo,
|
|
130
|
+
publisher: config,
|
|
131
|
+
catalog: product
|
|
132
|
+
}),
|
|
133
|
+
bid: bid,
|
|
134
|
+
product,
|
|
135
|
+
trackers: {
|
|
136
|
+
imp: ['https://surfside.io/track'],
|
|
137
|
+
win: 'https://surfside.io/win',
|
|
138
|
+
others: []
|
|
139
|
+
},
|
|
140
|
+
sponsored: true
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
;
|
|
146
|
+
//# sourceMappingURL=Product.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Product.js","sourceRoot":"src/","sources":["mock/Product.ts"],"names":[],"mappings":";;;AAqFA,wDAaC;AAkBD,4EAiDC;AArKD,iDAU4B;AAC5B,6CAA2C;AAE3C,MAAM,YAAY,GAAG;IACjB;QACI,MAAM,EAAE,YAAY;QACpB,aAAa,EAAE,0EAA0E;QACzF,uBAAuB;QACvB,OAAO,EAAE,cAAc;KAC1B;IACD;QACI,MAAM,EAAE,sBAAsB;QAC9B,aAAa,EAAE,oEAAoE;QACnF,mCAAmC;QACnC,O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@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MockGeneratePastPurchases = exports.MockGenerateForYou = void 0;
|
|
4
|
+
exports.MockGenerateTopProducts = MockGenerateTopProducts;
|
|
5
|
+
const ads_core_1 = require("@surfside/ads-core");
|
|
6
|
+
async function* MockGenerateTopProducts(productFeed) {
|
|
7
|
+
while (true) {
|
|
8
|
+
yield (0, ads_core_1.GetValueOrThrow)(await productFeed('12345')); // Doesn't matter for mock service
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.MockGenerateForYou = MockGenerateTopProducts;
|
|
12
|
+
exports.MockGeneratePastPurchases = MockGenerateTopProducts;
|
|
13
|
+
//# sourceMappingURL=Recommender.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Recommender.js","sourceRoot":"src/","sources":["mock/Recommender.ts"],"names":[],"mappings":";;;AAMA,0DAMC;AAZD,iDAI4B;AAErB,KAAK,SAAU,CAAC,CAAA,uBAAuB,CAC1C,WAAiD;IAEjD,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,IAAA,0BAAe,EAAC,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kCAAkC;IACzF,CAAC;AACL,CAAC;AAEY,QAAA,kBAAkB,GAAG,uBAAuB,CAAC;AAC7C,QAAA,yBAAyB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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("./Bidder"), exports);
|
|
18
|
+
__exportStar(require("./Configuration"), exports);
|
|
19
|
+
__exportStar(require("./CheatCodes"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"src/","sources":["mock/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,kDAAgC;AAChC,+CAA6B"}
|