r2-explorer 0.2.1 → 0.2.2
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/README.md +76 -0
- package/bin/r2-explorer.js +1 -1
- package/dist/cjs/api/core.js +23 -0
- package/dist/cjs/api/createFolder.js +60 -0
- package/dist/cjs/api/deleteObject.js +61 -0
- package/dist/cjs/api/downloadFile.js +68 -0
- package/dist/cjs/api/listContents.js +72 -0
- package/dist/cjs/api/listDisks.js +57 -0
- package/dist/cjs/api/renameObject.js +72 -0
- package/dist/cjs/api/uploadFiles.js +77 -0
- package/dist/cjs/index.js +65 -0
- package/dist/esm/api/core.js +19 -0
- package/dist/esm/api/createFolder.js +56 -0
- package/dist/esm/api/deleteObject.js +57 -0
- package/dist/esm/api/downloadFile.js +64 -0
- package/dist/esm/api/listContents.js +68 -0
- package/dist/esm/api/listDisks.js +53 -0
- package/dist/esm/api/renameObject.js +68 -0
- package/dist/esm/api/uploadFiles.js +73 -0
- package/dist/esm/index.js +58 -0
- package/dist/index.js +311 -195
- package/dist/types/api/core.d.ts +1 -0
- package/dist/types/api/createFolder.d.ts +1 -0
- package/dist/types/api/deleteObject.d.ts +1 -0
- package/dist/types/api/downloadFile.d.ts +1 -0
- package/dist/types/api/listContents.d.ts +1 -0
- package/dist/types/api/listDisks.d.ts +1 -0
- package/dist/types/api/renameObject.d.ts +1 -0
- package/dist/types/api/uploadFiles.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +77 -15
- package/.eslintrc.yml +0 -31
- package/rollup.config.js +0 -40
- package/spa/favicon.png +0 -0
- package/spa/index.html +0 -1
- package/spa/js/app.js +0 -127
- package/spa/js/app.js.map +0 -1
- package/src/api/core.js +0 -12
- package/src/api/createFolder.js +0 -13
- package/src/api/deleteObject.js +0 -15
- package/src/api/downloadFile.js +0 -23
- package/src/api/listContents.js +0 -27
- package/src/api/listDisks.js +0 -15
- package/src/api/renameObject.js +0 -24
- package/src/api/uploadFiles.js +0 -23
- package/src/index.js +0 -60
- package/wrangler.toml +0 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function JsonResponse(json: any, status?: number, headers?: {}): Response;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createFolder(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function deleteObject(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function downloadFile(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function listContents(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function listDisks(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renameObject(request: any, env: any, context: any): Promise<Response>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uploadFiles(request: any, env: any, context: any): Promise<Response>;
|
package/package.json
CHANGED
|
@@ -1,29 +1,91 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "r2-explorer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "A Google Drive Interface for your Cloudflare R2 Buckets",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"umd:main": "dist/umd/index.js",
|
|
8
|
+
"types": "dist/types/index.d.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"_postinstall": "husky install",
|
|
11
|
+
"prepublishOnly": "pinst --disable",
|
|
12
|
+
"postpublish": "pinst --enable",
|
|
13
|
+
"build": "npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types",
|
|
14
|
+
"build:cjs": "node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json",
|
|
15
|
+
"build:esm": "node tools/cleanup esm && tsc -p config/tsconfig.esm.json",
|
|
16
|
+
"build:umd": "node tools/cleanup umd && rollup --config rollup.config.js",
|
|
17
|
+
"build:types": "node tools/cleanup types && tsc -p config/tsconfig.types.json",
|
|
18
|
+
"clean": "node tools/cleanup",
|
|
19
|
+
"package": "npm run build && npm pack",
|
|
20
|
+
"test": "jest --no-cache --runInBand",
|
|
21
|
+
"test:cov": "jest --coverage --no-cache --runInBand",
|
|
22
|
+
"addscope": "node tools/packagejson name @g4brym/workers-qb",
|
|
23
|
+
"prettify": "prettier . --write --ignore-unknown",
|
|
24
|
+
"prepare": "husky install"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"cloudflare",
|
|
34
|
+
"worker",
|
|
35
|
+
"workers",
|
|
36
|
+
"serverless",
|
|
37
|
+
"cloudflare r2",
|
|
38
|
+
"r2",
|
|
39
|
+
"r2 storage",
|
|
40
|
+
"drive",
|
|
41
|
+
"google drive",
|
|
42
|
+
"ui",
|
|
43
|
+
"cf",
|
|
44
|
+
"typescript",
|
|
45
|
+
"npm",
|
|
46
|
+
"package",
|
|
47
|
+
"cjs",
|
|
48
|
+
"esm",
|
|
49
|
+
"umd",
|
|
50
|
+
"typed"
|
|
51
|
+
],
|
|
52
|
+
"author": "Gabriel Massadas",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"homepage": "https://github.com/G4brym/R2-Explorer",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git@github.com:G4brym/R2-Explorer.git"
|
|
58
|
+
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/G4brym/R2-Explorer/issues"
|
|
61
|
+
},
|
|
4
62
|
"devDependencies": {
|
|
63
|
+
"@commitlint/cli": "^13.1.0",
|
|
64
|
+
"@commitlint/config-conventional": "^13.1.0",
|
|
5
65
|
"@rollup/plugin-commonjs": "^17.0.0",
|
|
6
|
-
"@rollup/plugin-
|
|
7
|
-
"@rollup/plugin-html": "^1.0.1",
|
|
8
|
-
"@rollup/plugin-json": "^4.1.0",
|
|
66
|
+
"@rollup/plugin-json": "^5.0.1",
|
|
9
67
|
"@rollup/plugin-node-resolve": "^11.1.0",
|
|
10
|
-
"
|
|
11
|
-
"
|
|
68
|
+
"@types/jest": "^27.0.1",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^4.31.1",
|
|
70
|
+
"@typescript-eslint/parser": "^4.31.1",
|
|
71
|
+
"eslint": "^7.32.0",
|
|
72
|
+
"eslint-config-prettier": "^8.3.0",
|
|
73
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
74
|
+
"husky": "^7.0.2",
|
|
75
|
+
"jest": "^28.1.2",
|
|
76
|
+
"pinst": "^2.1.6",
|
|
77
|
+
"prettier": "^2.4.0",
|
|
12
78
|
"rollup": "^2.36.1",
|
|
13
|
-
"rollup-plugin-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"rollup-plugin-terser": "^7.0.2",
|
|
79
|
+
"rollup-plugin-ts": "^3.0.2",
|
|
80
|
+
"ts-jest": "^28.0.5",
|
|
81
|
+
"ts-loader": "^9.2.5",
|
|
82
|
+
"typescript": "^4.4.3",
|
|
18
83
|
"wrangler": "^2.4.2"
|
|
19
84
|
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "rollup --config rollup.config.js"
|
|
22
|
-
},
|
|
23
85
|
"dependencies": {
|
|
24
86
|
"itty-router": "^2.6.1"
|
|
25
87
|
},
|
|
26
88
|
"bin": {
|
|
27
|
-
|
|
89
|
+
"r2-explorer": "bin/r2-explorer.js"
|
|
28
90
|
}
|
|
29
91
|
}
|
package/.eslintrc.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
env:
|
|
2
|
-
browser: true
|
|
3
|
-
es6: true
|
|
4
|
-
|
|
5
|
-
extends: 'eslint:recommended'
|
|
6
|
-
|
|
7
|
-
parserOptions:
|
|
8
|
-
ecmaVersion: 9
|
|
9
|
-
sourceType: module
|
|
10
|
-
|
|
11
|
-
rules:
|
|
12
|
-
indent:
|
|
13
|
-
- error
|
|
14
|
-
- 2
|
|
15
|
-
linebreak-style:
|
|
16
|
-
- error
|
|
17
|
-
- unix
|
|
18
|
-
quotes:
|
|
19
|
-
- error
|
|
20
|
-
- single
|
|
21
|
-
semi:
|
|
22
|
-
- off
|
|
23
|
-
no-unused-vars:
|
|
24
|
-
- warn
|
|
25
|
-
- args: none
|
|
26
|
-
no-empty:
|
|
27
|
-
- warn
|
|
28
|
-
no-trailing-spaces:
|
|
29
|
-
- error
|
|
30
|
-
|
|
31
|
-
root: true
|
package/rollup.config.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import {nodeResolve} from '@rollup/plugin-node-resolve'
|
|
2
|
-
import commonjs from '@rollup/plugin-commonjs'
|
|
3
|
-
import json from '@rollup/plugin-json'
|
|
4
|
-
import {readFileSync} from 'fs';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function r2ExplorerPlugin() {
|
|
8
|
-
return {
|
|
9
|
-
name: 'custom',
|
|
10
|
-
resolveId: (id) => {
|
|
11
|
-
if (id.startsWith('explorer:')) {
|
|
12
|
-
return id
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
load: async (id) => {
|
|
16
|
-
if (id.startsWith('explorer:')) {
|
|
17
|
-
const path = id.replace('explorer:', '')
|
|
18
|
-
|
|
19
|
-
const fileData = readFileSync(`./spa/${path}`);
|
|
20
|
-
return `export default "${fileData.toString('base64')}";`
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
input: 'src/index.js',
|
|
28
|
-
cache: false,
|
|
29
|
-
output: {
|
|
30
|
-
format: 'cjs',
|
|
31
|
-
file: 'dist/index.js',
|
|
32
|
-
sourcemap: false
|
|
33
|
-
},
|
|
34
|
-
plugins: [
|
|
35
|
-
r2ExplorerPlugin(),
|
|
36
|
-
commonjs(),
|
|
37
|
-
json(),
|
|
38
|
-
nodeResolve({browser: true}),
|
|
39
|
-
]
|
|
40
|
-
}
|
package/spa/favicon.png
DELETED
|
Binary file
|
package/spa/index.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/png" href="/favicon.png"/><title>r2-explorer-spa</title><script defer="defer" src="/js/app.js"></script></head><body><noscript><strong>We're sorry but r2-explorer-spa doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|