vtb-appit 0.0.31 → 0.0.35
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/appit-base-transformer.js +21 -1
- package/appit.js +5 -1
- package/package.json +1 -1
|
@@ -108,7 +108,27 @@ class AppitBaseTransformer {
|
|
|
108
108
|
return result;
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
tsDataProductField(fieldId)
|
|
112
|
+
{
|
|
113
|
+
let result = '';
|
|
114
|
+
|
|
115
|
+
if(this.tsData && this.tsData.product) {
|
|
116
|
+
Object.keys(this.tsData.product).forEach(key => {
|
|
117
|
+
if(this.tsData.product[key].extraFields && this.tsData.product[key].extraFields.length) {
|
|
118
|
+
this.tsData.product[key].extraFields.forEach(extraField => {
|
|
119
|
+
if(extraField.field_id === fieldId) {
|
|
120
|
+
result = extraField.value;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
console.log(result);
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
async tsGetData()
|
|
112
132
|
{
|
|
113
133
|
return new Promise(async (resolve) => {
|
|
114
134
|
const jwt = await this.fetchTSJWT();
|
package/appit.js
CHANGED
|
@@ -50,7 +50,11 @@ class Appit {
|
|
|
50
50
|
if(!await this.login()) return false;
|
|
51
51
|
|
|
52
52
|
if(this.options && this.options.tsData) {
|
|
53
|
-
|
|
53
|
+
try {
|
|
54
|
+
this.transformer.tsData = await this.transformer.tsGetData();
|
|
55
|
+
} catch(e) {
|
|
56
|
+
|
|
57
|
+
}
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
await this.excursion();
|