-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathadapters.js
126 lines (102 loc) · 4.39 KB
/
adapters.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
const CartProperties = require('./cartproperties');
module.exports.splashforceCartProperties = (e, cartNum) => {
const email = e.fields[0]['value'];
const pass = e.fields[1]['value'];
const loginURL = e.url;
const img = e.thumbnail.url;
const size = e.fields[3]['value'];
const sku = e.fields[2]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.ycoppCartProperties = (e, cartNum) => {
const email = e.fields[0]['value'];
const pass = e.fields[1]['value'];
const loginURL = e.url;
const img = `http://demandware.edgesuite.net/sits_pod20-adidas/dw/image/v2/aaqx_prd/on/demandware.static/-/;Sites-adidas-products/en_US/dw8b928257/zoom/${sku}_01_standard.jpg`;
const size = e.title.split(',')[1];
const sku = e.title.split(',')[0];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.latchkeyCartProperties = (e, cartNum) => {
const email = e.fields[4]['value'];
const pass = e.fields[5]['value'];
const loginURL = e.url;
const img = e.thumbnail.url;
const size = e.fields[2]['value'];
const sku = e.fields[1]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.balkoCartProperties = (e, cartNum) => {
const email = e.fields[0]['value'];
const pass = e.fields[1]['value'];
const loginURL = e.url;
const img = e.thumbnail.url;
const size = e.fields[2]['value'];
const sku = e.fields[4]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.soleaioCartProperties = (e, cartNum) => {
if (e.fields.length >= 6) {
const email = e.fields[6]['value'];
const pass = e.fields[7]['value'];
const loginURL = e.description;
const img = e.thumbnail.url;
const size = e.fields[1]['value'];
const sku = e.fields[0]['value'];
} else {
const email = e.fields[2]['value'];
const pass = e.fields[3]['value'];
const loginURL = e.description;
const img = e.thumbnail.url;
const size = e.fields[1]['value'];
const sku = e.title.split(' ')[0];
}
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.adisplashCartProperties = (e, cartNum) => {
const userPass = e.fields[2]['value']; //the user and password value colon separated
const email = userPass.split(': ')[1].split('\n')[0];
const pass = userPass.split(': ')[2];
const loginURL = e.url;
const sku = e.fields[0]['value'];
const img = 'https://transform.dis.commercecloud.salesforce.com/transform/aagl_prd/on/demandware.static/-/Sites-adidas-products/default/zoom/' + sku + '_00_plp_standard.jpg?sw=276&sh=276&sm=fit&strip=false';
const size = e.fields[1]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.phantomCartProperties = (e, cartNum) => {
const userPass = e.fields[4]['value'];
const email = userPass.split(':')[0];
const pass = userPass.split(':')[1];
const loginURL = 'https://www.adidas.com/';
const img = '';
const size = e.fields[1]['value'];
const sku = e.fields[0]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.gen5CartProperties = (e, cartNum) => {
const email = e.fields[3]['value'];
const pass = e.fields[4]['value'];
const loginURL = e.url;
const img = e.thumbnail.url;
const size = e.fields[1]['value'];
const sku = e.fields[0]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.nomercyCartProperties = (e, cartNum) => {
const email = e.fields[3]['value'];
const pass = e.fields[4]['value'];
const loginURL = e.url;
const img = e.thumbnail.url;
const size = e.fields[1]['value'];
const sku = e.fields[0]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}
module.exports.kodaiCartProperties = (e, cartNum) => {
const email = e.fields[5]['value'];
const pass = e.fields[6]['value'];
const loginURL = e.fields[4]['value'].split('(')[1].split(')')[0];
const img = e.thumbnail.url;
const size = e.fields[0]['value'];
const sku = e.fields[1]['value'];
return new CartProperties(cartNum, email, pass, loginURL, img, size, sku);
}