@bobbykim/manguito-cms-admin 0.5.2 → 0.5.3
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-cms-admin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Bobby Kim <bobby.sihun.kim@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/bobbykim89/manguito-cms",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vite": "^8.1.3",
|
|
42
42
|
"vue": "^3.5.39",
|
|
43
43
|
"vue-router": "^4.6.4",
|
|
44
|
-
"@bobbykim/manguito-cms-core": "0.
|
|
44
|
+
"@bobbykim/manguito-cms-core": "0.9.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@testing-library/vue": "^8.1.0",
|
|
@@ -57,8 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "vue-tsc && vite build && tsup",
|
|
60
|
+
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p tsconfig.tests.json && tsc --noEmit -p tsconfig.codegen.json && tsc --noEmit -p tsconfig.adapter.json",
|
|
60
61
|
"dev": "vite",
|
|
61
62
|
"test": "dotenv -e ../../.env.test -- vitest run",
|
|
62
|
-
"lint": "eslint src"
|
|
63
|
+
"lint": "eslint src codegen index.ts tests __tests__"
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -135,9 +135,8 @@ async function uploadPresigned(file: File, alt: string): Promise<MediaItem> {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
xhr.onload = () => {
|
|
138
|
-
xhr.status >= 200 && xhr.status < 300
|
|
139
|
-
|
|
140
|
-
: reject(new Error(`Storage upload failed (${xhr.status})`))
|
|
138
|
+
if (xhr.status >= 200 && xhr.status < 300) resolve()
|
|
139
|
+
else reject(new Error(`Storage upload failed (${xhr.status})`))
|
|
141
140
|
}
|
|
142
141
|
xhr.onerror = () => reject(new Error('Network error during upload'))
|
|
143
142
|
if (method === 'POST' && fields) {
|
|
@@ -182,7 +182,8 @@ function uploadDirect(file: File, alt: string): Promise<MediaItem> {
|
|
|
182
182
|
xhr.onload = () => {
|
|
183
183
|
try {
|
|
184
184
|
const json = JSON.parse(xhr.responseText) as { ok: boolean; data?: MediaItem; error?: { message: string } }
|
|
185
|
-
json.ok && json.data
|
|
185
|
+
if (json.ok && json.data) resolve(json.data)
|
|
186
|
+
else reject(new Error(json.error?.message ?? 'Upload failed'))
|
|
186
187
|
} catch {
|
|
187
188
|
reject(new Error('Invalid server response'))
|
|
188
189
|
}
|