sr-npm 1.7.311 → 1.7.313
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/package.json +1 -1
- package/public/utils.js +33 -28
package/package.json
CHANGED
package/public/utils.js
CHANGED
|
@@ -31,40 +31,45 @@ function htmlToText(html) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async function htmlToRichContent(htmlString) {
|
|
34
|
-
console.log("
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
console.log("i am here")
|
|
35
|
+
const serverlessAuth = await getServerlessAuth()
|
|
36
|
+
console.log("serverlessAuth **********",serverlessAuth)
|
|
37
|
+
// console.log("htmlString **********",htmlString)
|
|
38
|
+
// const raw = JSON.stringify({
|
|
39
|
+
// "content": htmlString
|
|
40
|
+
// });
|
|
41
|
+
|
|
38
42
|
|
|
43
|
+
// const requestOptions = {
|
|
44
|
+
// method: "post",
|
|
45
|
+
// headers: {
|
|
46
|
+
// "Content-Type": "application/json",
|
|
47
|
+
// "Cookie": "XSRF-TOKEN=1753949844|p--a7HsuVjR4",
|
|
48
|
+
// "Authorization": "Bearer "+await getServerlessAuth()
|
|
39
49
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"Content-Type": "application/json",
|
|
44
|
-
"Cookie": "XSRF-TOKEN=1753949844|p--a7HsuVjR4",
|
|
45
|
-
"Authorization": "Bearer "+await getServerlessAuth()
|
|
50
|
+
// },
|
|
51
|
+
// body: raw
|
|
52
|
+
// };
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
body: raw
|
|
49
|
-
};
|
|
54
|
+
// console.log("requestOptions **********",requestOptions)
|
|
50
55
|
|
|
51
|
-
try{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// try{
|
|
57
|
+
// const response = await fetch("https://www.wixapis.com/data-sync/v1/abmp-content-converter", requestOptions);
|
|
58
|
+
// if (response.ok) {
|
|
59
|
+
// const data = await response.json();
|
|
60
|
+
// console.log("data.richContent **********",data.richContent)
|
|
61
|
+
// return data.richContent;
|
|
62
|
+
// }
|
|
58
63
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
// else
|
|
65
|
+
// {
|
|
66
|
+
// console.error(`error in fetching data, response: ${response}`);
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
catch(error){
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
|
+
// catch(error){
|
|
71
|
+
// console.error("error in fetching data",error);
|
|
72
|
+
// }
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
function filterBrokenMarkers(items) {
|