esoftplay 0.0.143-e → 0.0.143-g
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/bin/cli.js +7 -4
- package/modules/lib/curl_view.tsx +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -548,22 +548,25 @@ async function preload_api() {
|
|
|
548
548
|
if (preload_api?.length > 0) {
|
|
549
549
|
fs.rmSync("./assets/preload_api", { recursive: true, force: true })
|
|
550
550
|
fs.rmSync("./assets/preload_assets", { recursive: true, force: true })
|
|
551
|
+
fs.mkdirSync("./assets/preload_api")
|
|
552
|
+
fs.mkdirSync("./assets/preload_assets")
|
|
551
553
|
for (const apiUri of preload_api) {
|
|
552
554
|
let fullUrl = apiUri.includes("://") ? apiUri : `${(protocol || 'http')}://api.${domain}${(uri || "/")}${apiUri}`
|
|
553
555
|
const lastString = fullUrl.slice(fullUrl.lastIndexOf("/") + 1) // Fixed index adjustment
|
|
554
556
|
try {
|
|
557
|
+
// console.log(data, fullUrl)
|
|
555
558
|
const data = await fetch(fullUrl).then((res) => res.text())
|
|
556
559
|
if (data) {
|
|
557
560
|
try {
|
|
558
561
|
if (JSON.parse(data).ok === 0) {
|
|
559
|
-
consoleError(`-> preload_api: ${fullUrl}`)
|
|
562
|
+
consoleError(`-> 1 preload_api: ${fullUrl}`)
|
|
560
563
|
fs.writeFileSync(`./assets/preload_api/${lastString}.json`, data)
|
|
561
564
|
out = false
|
|
562
565
|
return out
|
|
563
566
|
}
|
|
564
567
|
} catch (error) {
|
|
565
568
|
fs.writeFileSync(`./assets/preload_api/${lastString}.json`, data)
|
|
566
|
-
consoleError(`-> preload_api: ${fullUrl}`)
|
|
569
|
+
consoleError(`-> 2 preload_api: ${fullUrl}`)
|
|
567
570
|
out = false
|
|
568
571
|
return out
|
|
569
572
|
}
|
|
@@ -668,12 +671,12 @@ async function preload_api() {
|
|
|
668
671
|
// }
|
|
669
672
|
|
|
670
673
|
await readDeepObject(objectData)
|
|
671
|
-
consoleSucces("-> preload_api: " + fullUrl)
|
|
674
|
+
consoleSucces("-> 3 preload_api: " + fullUrl)
|
|
672
675
|
/* endSukses */
|
|
673
676
|
}
|
|
674
677
|
} catch (error) {
|
|
675
678
|
out = false
|
|
676
|
-
consoleError(`-> preload_api: ${fullUrl}
|
|
679
|
+
consoleError(`-> 4 preload_api: ${fullUrl}${error}`,)
|
|
677
680
|
}
|
|
678
681
|
}
|
|
679
682
|
}
|
|
@@ -46,7 +46,7 @@ export default function m(props: LibCurl_viewProps): any {
|
|
|
46
46
|
if (props.cache) {
|
|
47
47
|
FastStorage.setItem(key, JSON.stringify({ result, message }))
|
|
48
48
|
}
|
|
49
|
-
setData({ result, message })
|
|
49
|
+
setData({ result, message, ok: 1 })
|
|
50
50
|
}, (err) => {
|
|
51
51
|
setData(err)
|
|
52
52
|
})
|