r2-explorer 0.2.3 → 0.2.4
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/r2-explorer.js +1 -1
- package/dist/{index.js → umd/index.js} +13 -13
- package/package.json +1 -1
package/bin/r2-explorer.js
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
if (headers === void 0) { headers = {}; }
|
|
76
76
|
return new Response(JSON.stringify(json), {
|
|
77
77
|
headers: __assign({ 'content-type': 'application/json;charset=UTF-8', 'access-control-allow-origin': '*', 'access-control-allow-headers': '*', 'access-control-allow-methods': '*' }, headers),
|
|
78
|
-
status: status
|
|
78
|
+
status: status
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
bucket = env[disk];
|
|
198
198
|
name = body.name;
|
|
199
199
|
path = body.path;
|
|
200
|
-
return [4 /*yield*/, bucket
|
|
200
|
+
return [4 /*yield*/, bucket["delete"]("".concat(path).concat(name))];
|
|
201
201
|
case 2:
|
|
202
202
|
_a.sent();
|
|
203
203
|
return [2 /*return*/, JsonResponse({})];
|
|
@@ -225,14 +225,14 @@
|
|
|
225
225
|
return [4 /*yield*/, bucket.put("".concat(path).concat(newName), object.body)];
|
|
226
226
|
case 3:
|
|
227
227
|
_a.sent();
|
|
228
|
-
return [4 /*yield*/, bucket
|
|
228
|
+
return [4 /*yield*/, bucket["delete"]("".concat(path).concat(oldName))];
|
|
229
229
|
case 4:
|
|
230
230
|
_a.sent();
|
|
231
231
|
headers = new Headers();
|
|
232
232
|
object.writeHttpMetadata(headers);
|
|
233
233
|
headers.set('etag', object.httpEtag);
|
|
234
234
|
return [2 /*return*/, new Response(object.body, {
|
|
235
|
-
headers: headers
|
|
235
|
+
headers: headers
|
|
236
236
|
})];
|
|
237
237
|
}
|
|
238
238
|
});
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
object.writeHttpMetadata(headers);
|
|
262
262
|
headers.set('etag', object.httpEtag);
|
|
263
263
|
return [2 /*return*/, new Response(object.body, {
|
|
264
|
-
headers: headers
|
|
264
|
+
headers: headers
|
|
265
265
|
})];
|
|
266
266
|
}
|
|
267
267
|
});
|
|
@@ -280,24 +280,24 @@
|
|
|
280
280
|
return new Response(atob(html), {
|
|
281
281
|
status: 200,
|
|
282
282
|
headers: {
|
|
283
|
-
'content-type': 'text/html;charset=UTF-8'
|
|
284
|
-
}
|
|
283
|
+
'content-type': 'text/html;charset=UTF-8'
|
|
284
|
+
}
|
|
285
285
|
});
|
|
286
286
|
});
|
|
287
287
|
router.get('/js/app.js', function () {
|
|
288
288
|
return new Response(atob(app), {
|
|
289
289
|
status: 200,
|
|
290
290
|
headers: {
|
|
291
|
-
'content-type': 'text/js;charset=UTF-8'
|
|
292
|
-
}
|
|
291
|
+
'content-type': 'text/js;charset=UTF-8'
|
|
292
|
+
}
|
|
293
293
|
});
|
|
294
294
|
});
|
|
295
295
|
router.get('/favicon.png', function () {
|
|
296
296
|
return new Response(atob(favicon), {
|
|
297
297
|
status: 200,
|
|
298
298
|
headers: {
|
|
299
|
-
'content-type': 'image/png'
|
|
300
|
-
}
|
|
299
|
+
'content-type': 'image/png'
|
|
300
|
+
}
|
|
301
301
|
});
|
|
302
302
|
});
|
|
303
303
|
router.get('/api/disks', listDisks);
|
|
@@ -310,9 +310,9 @@
|
|
|
310
310
|
router.get('/api/*', function (request, env, context) {
|
|
311
311
|
return new Response(JSON.stringify({ msg: '404, not found!' }), {
|
|
312
312
|
headers: {
|
|
313
|
-
'content-type': 'application/json;charset=UTF-8'
|
|
313
|
+
'content-type': 'application/json;charset=UTF-8'
|
|
314
314
|
},
|
|
315
|
-
status: 404
|
|
315
|
+
status: 404
|
|
316
316
|
});
|
|
317
317
|
});
|
|
318
318
|
router.all('*', function () { return new Response('404, not found!', { status: 404 }); });
|