deal 115 baidu cloud
This commit is contained in:
parent
720fc60365
commit
29ec2fdf59
1
.idea/dictionaries/project.xml
generated
1
.idea/dictionaries/project.xml
generated
@ -2,6 +2,7 @@
|
||||
<dictionary name="project">
|
||||
<words>
|
||||
<w>alicloud</w>
|
||||
<w>baiduyun</w>
|
||||
</words>
|
||||
</dictionary>
|
||||
</component>
|
38
.idea/workspace.xml
generated
38
.idea/workspace.xml
generated
@ -4,14 +4,21 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="987ac7e2-ceaa-49a2-b5c9-aed65a7c598d" name="更改" comment="deal ali cloud scan login">
|
||||
<change afterPath="$PROJECT_DIR$/.idea/dictionaries/project.xml" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/aliui.ts" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/oneui.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
|
||||
<list default="true" id="987ac7e2-ceaa-49a2-b5c9-aed65a7c598d" name="更改" comment="deal 115 baidu cloud">
|
||||
<change afterPath="$PROJECT_DIR$/public/test.html" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/115ui.ts" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/baidu.ts" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/error.ts" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/goapi.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/dictionaries/project.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dictionaries/project.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/public/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/public/index.html" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/aliui.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/aliui.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.ts" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/oneui.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/oneui.ts" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@ -45,7 +52,7 @@
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"last_opened_file_path": "G:/AList/cf-worker-api",
|
||||
"last_opened_file_path": "G:/AList/cf-worker-api/src",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
@ -58,8 +65,12 @@
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="G:\AList\cf-worker-api\src" />
|
||||
<recent name="G:\AList\cf-worker-api" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="G:\AList\cf-worker-api\public" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
@ -77,7 +88,7 @@
|
||||
<updated>1749696640494</updated>
|
||||
<workItem from="1749696641557" duration="119000" />
|
||||
<workItem from="1749696773818" duration="18000" />
|
||||
<workItem from="1749696801474" duration="20247000" />
|
||||
<workItem from="1749696801474" duration="43946000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="fin onedrive official token">
|
||||
<option name="closed" value="true" />
|
||||
@ -119,7 +130,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1749714906877</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="6" />
|
||||
<task id="LOCAL-00006" summary="deal ali cloud scan login">
|
||||
<option name="closed" value="true" />
|
||||
<created>1749720117274</created>
|
||||
<option name="number" value="00006" />
|
||||
<option name="presentableId" value="LOCAL-00006" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1749720117274</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="7" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
@ -131,6 +150,7 @@
|
||||
<MESSAGE value="add onedrive area: cn us de" />
|
||||
<MESSAGE value="deal merge issue" />
|
||||
<MESSAGE value="deal ali cloud scan login" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="deal ali cloud scan login" />
|
||||
<MESSAGE value="deal 115 baidu cloud" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="deal 115 baidu cloud" />
|
||||
</component>
|
||||
</project>
|
67
README.md
67
README.md
@ -1,10 +1,77 @@
|
||||
# OpenList API Token Generator
|
||||
|
||||
## 项目说明
|
||||
|
||||
用于OpenList获取部分网盘API的接口和页面
|
||||
|
||||
部署地址:[OpenList Token 获取工具](https://api.oplist.org/)
|
||||
|
||||
## 接口文档
|
||||
|
||||
### 登录接口
|
||||
|
||||
- #### 接口地址
|
||||
|
||||
#### `https://api.oplist.org/<driver>/requests`
|
||||
|
||||
- #### 接口参数
|
||||
|
||||
| 参数名称 | 类型 | 必要 | 示例 | 说明 |
|
||||
| ------------ | ----- | ---- | -------------------------------- | ---------------------------------- |
|
||||
| `driver` | `str` | 是 | onedrive | 平台驱动名称,详见"配置设置"部分 |
|
||||
| `client_uid` | `str` | 是 | 4308adf60f3fe4058533 | 提供客户端ID,详见"配置设置"部分 |
|
||||
| `client_key` | `str` | 是 | 09F260A4BF5EF7F4181E35E59759C0BC | 提供应用密码,详见"配置设置"部分 |
|
||||
| `apps_types` | `str` | 是 | onedrive_go | 驱动类型,格式 `driver`+`类型后缀` |
|
||||
| `server_set` | `str` | 是 | true | 是否使用服务器预设的应用ID和密钥 |
|
||||
| `secret_key` | `str` | 否 | 3yp8NOMsRulxll44f5ayrxF1vgBfPW85 | 百度网盘额外需要 secret_key字段 |
|
||||
|
||||
|
||||
|
||||
### 回调接口
|
||||
|
||||
- #### 接口地址
|
||||
|
||||
#### `https://api.oplist.org/<driver>/callback`
|
||||
|
||||
- #### 接口参数
|
||||
|
||||
| 参数名称 | 类型 | 必要 | 示例 | 说明 |
|
||||
| ------------ | ----- | ---- | -------------------------------- | -------------------------------- |
|
||||
| `driver` | `str` | 是 | onedrive | 平台驱动名称,详见"配置设置"部分 |
|
||||
| `code` | `str` | 是 | 40YJzShAJSodbIXvNEw3Ru9N4Lkznx93 | 回调的认证代码,登录之后URL自带 |
|
||||
| `client_uid` | `str` | 否 | 4308adf60f3fe4058533 | 阿里云盘验证码登录提供client_uid |
|
||||
| `client_key` | `str` | 否 | 09F260A4BF5EF7F4181E35E59759C0BC | 阿里云盘验证码登录提供client_key |
|
||||
| `grant_type` | `str` | 否 | authorization_code | 阿里云盘,固定authorization_code |
|
||||
|
||||
## 配置设置
|
||||
|
||||
| 网盘驱动 | 区域类型 | driver | apps_types | client_uid | client_key | secret_key |
|
||||
| -------- | -------- | -------- | ----------- | ---------- | ------------- | ---------- |
|
||||
| Onedrive | 企业版本 | onedrive | onedrive_go | 客户端ID | 客户端秘钥 | / |
|
||||
| Onedrive | 世纪互联 | onedrive | onedrive_cn | 客户端ID | 客户端秘钥 | / |
|
||||
| Onedrive | 美国版本 | onedrive | onedrive_us | 客户端ID | 客户端秘钥 | / |
|
||||
| Onedrive | 德国版本 | onedrive | onedrive_de | 客户端ID | 客户端秘钥 | / |
|
||||
| 阿里云盘 | 扫码登录 | alicloud | alicloud_qr | APP ID | App Secret | / |
|
||||
| 百度云盘 | 验证登录 | baiduyun | baiduyun_go | AppID | AppKey | SecretKey |
|
||||
| 115 云盘 | 验证登录 | 115cloud | 115cloud_go | AppID | AppSecret | / |
|
||||
| 123 云盘 | 验证登录 | 123cloud | 123cloud_go | client_id | client_secret | / |
|
||||
| 谷歌云盘 | 验证登录 | googleui | googleui_go | 客户端ID | 客户端秘钥 | / |
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 部署方法
|
||||
|
||||
### 测试代码
|
||||
|
||||
```txt
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### 部署项目
|
||||
|
||||
```txt
|
||||
npm run deploy
|
||||
```
|
||||
|
700
package-lock.json
generated
700
package-lock.json
generated
@ -7,6 +7,8 @@
|
||||
"name": "cf-worker-api",
|
||||
"dependencies": {
|
||||
"@cloudflare/workers-types": "^4.20250610.0",
|
||||
"@google-cloud/local-auth": "^2.1.0",
|
||||
"googleapis": "^105.0.0",
|
||||
"hono": "^4.7.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -592,6 +594,21 @@
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/@google-cloud/local-auth": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@google-cloud/local-auth/-/local-auth-2.1.0.tgz",
|
||||
"integrity": "sha512-ymZ1XuyKcRcro0aiMYz3hVGbZ+QZmN5V1Eyjvw2k1xqq76PwmDer0DIPxdxkLzfW9Inr8+g+MS9t9fZ7dOlTOQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"arrify": "^2.0.1",
|
||||
"google-auth-library": "^8.0.2",
|
||||
"open": "^7.0.3",
|
||||
"server-destroy": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-darwin-arm64": {
|
||||
"version": "0.33.5",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz",
|
||||
@ -1023,6 +1040,27 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/arrify": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
|
||||
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/as-table": {
|
||||
"version": "1.0.55",
|
||||
"resolved": "https://registry.npmjs.org/as-table/-/as-table-1.0.55.tgz",
|
||||
@ -1033,6 +1071,35 @@
|
||||
"printable-characters": "^1.0.42"
|
||||
}
|
||||
},
|
||||
"node_modules/base64-js": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
|
||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/bignumber.js": {
|
||||
"version": "9.3.0",
|
||||
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.0.tgz",
|
||||
"integrity": "sha512-EM7aMFTXbptt/wZdMlBv2t8IViwQL+h6SLHosp8Yf0dqJMTnY6iL32opnAB6kAdL0SZPuvcAzFr31o0c/R3/RA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/blake3-wasm": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",
|
||||
@ -1040,6 +1107,41 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/buffer-equal-constant-time": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
|
||||
"integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
|
||||
"license": "BSD-3-Clause"
|
||||
},
|
||||
"node_modules/call-bind-apply-helpers": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
|
||||
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bound": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
|
||||
"integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"get-intrinsic": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/color": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
|
||||
@ -1102,6 +1204,23 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.4.1",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz",
|
||||
"integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "^2.1.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"supports-color": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/defu": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
|
||||
@ -1119,6 +1238,59 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/dunder-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"gopd": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/ecdsa-sig-formatter": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
|
||||
"integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/es-define-property": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
|
||||
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-errors": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
|
||||
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es-object-atoms": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
|
||||
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.25.4",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.4.tgz",
|
||||
@ -1180,6 +1352,18 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/extend": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/fast-text-encoding": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz",
|
||||
"integrity": "sha512-VhXlQgj9ioXCqGstD37E/HBeqEGV/qOD/kmbVG8h5xKBYvM1L3lR1Zn4555cQ8GkYbJa8aJSipLPndE1k6zK2w==",
|
||||
"license": "Apache-2.0"
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
@ -1195,6 +1379,80 @@
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
|
||||
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/gaxios": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz",
|
||||
"integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"extend": "^3.0.2",
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"is-stream": "^2.0.0",
|
||||
"node-fetch": "^2.6.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/gcp-metadata": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz",
|
||||
"integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"gaxios": "^5.0.0",
|
||||
"json-bigint": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bind-apply-helpers": "^1.0.2",
|
||||
"es-define-property": "^1.0.1",
|
||||
"es-errors": "^1.3.0",
|
||||
"es-object-atoms": "^1.1.1",
|
||||
"function-bind": "^1.1.2",
|
||||
"get-proto": "^1.0.1",
|
||||
"gopd": "^1.2.0",
|
||||
"has-symbols": "^1.1.0",
|
||||
"hasown": "^2.0.2",
|
||||
"math-intrinsics": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-proto": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
|
||||
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dunder-proto": "^1.0.1",
|
||||
"es-object-atoms": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/get-source": {
|
||||
"version": "2.0.12",
|
||||
"resolved": "https://registry.npmjs.org/get-source/-/get-source-2.0.12.tgz",
|
||||
@ -1213,6 +1471,122 @@
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/google-auth-library": {
|
||||
"version": "8.9.0",
|
||||
"resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-8.9.0.tgz",
|
||||
"integrity": "sha512-f7aQCJODJFmYWN6PeNKzgvy9LI2tYmXnzpNDHEjG5sDNPgGb2FXQyTBnXeSH+PAtpKESFD+LmHw3Ox3mN7e1Fg==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"arrify": "^2.0.0",
|
||||
"base64-js": "^1.3.0",
|
||||
"ecdsa-sig-formatter": "^1.0.11",
|
||||
"fast-text-encoding": "^1.0.0",
|
||||
"gaxios": "^5.0.0",
|
||||
"gcp-metadata": "^5.3.0",
|
||||
"gtoken": "^6.1.0",
|
||||
"jws": "^4.0.0",
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/google-p12-pem": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-4.0.1.tgz",
|
||||
"integrity": "sha512-WPkN4yGtz05WZ5EhtlxNDWPhC4JIic6G8ePitwUWy4l+XPVYec+a0j0Ts47PDtW59y3RwAhUd9/h9ZZ63px6RQ==",
|
||||
"deprecated": "Package is no longer maintained",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"node-forge": "^1.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"gp12-pem": "build/src/bin/gp12-pem.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/googleapis": {
|
||||
"version": "105.0.0",
|
||||
"resolved": "https://registry.npmjs.org/googleapis/-/googleapis-105.0.0.tgz",
|
||||
"integrity": "sha512-wH/jU/6QpqwsjTKj4vfKZz97ne7xT7BBbKwzQEwnbsG8iH9Seyw19P+AuLJcxNNrmgblwLqfr3LORg4Okat1BQ==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"google-auth-library": "^8.0.2",
|
||||
"googleapis-common": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/googleapis-common": {
|
||||
"version": "6.0.4",
|
||||
"resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-6.0.4.tgz",
|
||||
"integrity": "sha512-m4ErxGE8unR1z0VajT6AYk3s6a9gIMM6EkDZfkPnES8joeOlEtFEJeF8IyZkb0tjPXkktUfYrE4b3Li1DNyOwA==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"extend": "^3.0.2",
|
||||
"gaxios": "^5.0.1",
|
||||
"google-auth-library": "^8.0.2",
|
||||
"qs": "^6.7.0",
|
||||
"url-template": "^2.0.8",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/gopd": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
|
||||
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/gtoken": {
|
||||
"version": "6.1.2",
|
||||
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-6.1.2.tgz",
|
||||
"integrity": "sha512-4ccGpzz7YAr7lxrT2neugmXQ3hP9ho2gcaityLVkiUecAiwiy60Ii8gRbZeOsXV19fYaRjgBSshs8kXw+NKCPQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"gaxios": "^5.0.1",
|
||||
"google-p12-pem": "^4.0.0",
|
||||
"jws": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
|
||||
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hasown": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz",
|
||||
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/hono": {
|
||||
"version": "4.7.11",
|
||||
"resolved": "https://registry.npmjs.org/hono/-/hono-4.7.11.tgz",
|
||||
@ -1222,6 +1596,19 @@
|
||||
"node": ">=16.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/https-proxy-agent": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
|
||||
"integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"agent-base": "6",
|
||||
"debug": "4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/is-arrayish": {
|
||||
"version": "0.3.2",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
|
||||
@ -1229,6 +1616,96 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/is-docker": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz",
|
||||
"integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"is-docker": "cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-stream": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
|
||||
"integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-wsl": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz",
|
||||
"integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/json-bigint": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
|
||||
"integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bignumber.js": "^9.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/jwa": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
|
||||
"integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"buffer-equal-constant-time": "^1.0.1",
|
||||
"ecdsa-sig-formatter": "1.0.11",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/jws": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz",
|
||||
"integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"jwa": "^2.0.0",
|
||||
"safe-buffer": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/math-intrinsics": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
|
||||
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/mime": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz",
|
||||
@ -1269,6 +1746,12 @@
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/mustache": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
|
||||
@ -1279,6 +1762,47 @@
|
||||
"mustache": "bin/mustache"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/node-forge": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
|
||||
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
|
||||
"license": "(BSD-3-Clause OR GPL-2.0)",
|
||||
"engines": {
|
||||
"node": ">= 6.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
"integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/ohash": {
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz",
|
||||
@ -1286,6 +1810,22 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/open": {
|
||||
"version": "7.4.2",
|
||||
"resolved": "https://registry.npmjs.org/open/-/open-7.4.2.tgz",
|
||||
"integrity": "sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"is-docker": "^2.0.0",
|
||||
"is-wsl": "^2.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
|
||||
@ -1307,6 +1847,41 @@
|
||||
"dev": true,
|
||||
"license": "Unlicense"
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.14.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",
|
||||
"integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",
|
||||
"license": "BSD-3-Clause",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.7.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",
|
||||
@ -1320,6 +1895,12 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/server-destroy": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz",
|
||||
"integrity": "sha512-rb+9B5YBIEzYcD6x2VKidaa+cqYBJQKnU4oe4E3ANwRRN56yk/ua1YCJT1n21NTS8w6CcOclAKNP3PhdCXKYtQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/sharp": {
|
||||
"version": "0.33.5",
|
||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz",
|
||||
@ -1360,6 +1941,78 @@
|
||||
"@img/sharp-win32-x64": "0.33.5"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz",
|
||||
"integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-list": "^1.0.0",
|
||||
"side-channel-map": "^1.0.1",
|
||||
"side-channel-weakmap": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-list": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz",
|
||||
"integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"es-errors": "^1.3.0",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-map": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
|
||||
"integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel-weakmap": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
|
||||
"integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"call-bound": "^1.0.2",
|
||||
"es-errors": "^1.3.0",
|
||||
"get-intrinsic": "^1.2.5",
|
||||
"object-inspect": "^1.13.3",
|
||||
"side-channel-map": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/simple-swizzle": {
|
||||
"version": "0.2.2",
|
||||
"resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
|
||||
@ -1402,6 +2055,12 @@
|
||||
"npm": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
@ -1444,6 +2103,41 @@
|
||||
"ufo": "^1.6.1"
|
||||
}
|
||||
},
|
||||
"node_modules/url-template": {
|
||||
"version": "2.0.8",
|
||||
"resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz",
|
||||
"integrity": "sha512-XdVKMF4SJ0nP/O7XIPB0JwAEuT9lDIYnNsK8yGVe43y0AWoKeJNdv3ZNWh7ksJ6KqQFjOO6ox/VEitLnaVNufw==",
|
||||
"license": "BSD"
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.1",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz",
|
||||
"integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==",
|
||||
"funding": [
|
||||
"https://github.com/sponsors/broofa",
|
||||
"https://github.com/sponsors/ctavan"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||
"license": "BSD-2-Clause"
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/workerd": {
|
||||
"version": "1.20250525.0",
|
||||
"resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20250525.0.tgz",
|
||||
@ -1522,6 +2216,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/youch": {
|
||||
"version": "3.3.4",
|
||||
"resolved": "https://registry.npmjs.org/youch/-/youch-3.3.4.tgz",
|
||||
|
@ -7,6 +7,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@cloudflare/workers-types": "^4.20250610.0",
|
||||
"@google-cloud/local-auth": "^2.1.0",
|
||||
"googleapis": "^105.0.0",
|
||||
"hono": "^4.7.11"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -102,13 +102,22 @@
|
||||
<div class="mb-3">
|
||||
<label for="site-select" class="form-label">网盘名称</label>
|
||||
<select id="site-select" class="form-select">
|
||||
<option value="onedrive_go" selected>OneDrive 官方站点</option>
|
||||
<!-- <option value="onedrive_pr" selected>OneDrive 个人账户</option>-->
|
||||
<option value="onedrive_go">OneDrive 企业版本</option>
|
||||
<option value="onedrive_cn">OneDrive 世纪互联</option>
|
||||
<option value="onedrive_us">OneDrive 美国版本</option>
|
||||
<option value="onedrive_de">OneDrive 德国版本</option>
|
||||
<option value="alicloud_qr">阿里网盘 扫码登录</option>
|
||||
<option value="baiduyun_go">百度网盘 验证登录</option>
|
||||
<option value="115cloud_go">115 网盘 验证登录</option>
|
||||
<option value="googleui_go">Google Drive Team</option>
|
||||
</select>
|
||||
|
||||
<div class="mb-3" style="margin-top: 15px">
|
||||
<input type="checkbox" id="use-openlist-key" class="form-check-input">
|
||||
<label for="use-openlist-key" class="form-check-label">使用 OpenList 提供的API</label>
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="client-id" class="form-label">客户端 ID</label>
|
||||
<input type="text" id="client-id" class="form-control">
|
||||
@ -119,6 +128,11 @@
|
||||
<input type="text" id="app-secret" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="mb-3" id="secret-key-view">
|
||||
<label for="secret-key" class="form-label">访问密钥(SecretKey)</label>
|
||||
<input type="text" id="secret-key" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="callback-url" class="form-label">回调地址</label>
|
||||
<input type="text" id="callback-url" class="form-control" value="https://api.oplist.org/onedrive/callback"
|
||||
@ -159,6 +173,7 @@
|
||||
let apps_uuid = document.getElementById("client-id").value;
|
||||
let apps_keys = document.getElementById("app-secret").value;
|
||||
let apps_type = document.getElementById("site-select").value;
|
||||
let secret_key = document.getElementById("secret-key").value;
|
||||
if (apps_uuid === "" || apps_keys === "") {
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
@ -171,7 +186,8 @@
|
||||
}
|
||||
let apps_subs = apps_type.split("_")[0]
|
||||
let post_urls = "/" + apps_subs + "/requests?client_uid=" + apps_uuid
|
||||
+ "&client_key=" + apps_keys + "&apps_type=" + apps_type;
|
||||
+ "&client_key=" + apps_keys + "&apps_types=" + apps_type;
|
||||
if (apps_subs === "baiduyun") post_urls += "&secret_key=" + secret_key
|
||||
try {
|
||||
const response = await fetch(post_urls, {
|
||||
method: 'GET', headers: {'Content-Type': 'application/json'}
|
||||
@ -179,7 +195,8 @@
|
||||
// 解析响应内容 ===============================================
|
||||
const response_data = await response.json();
|
||||
if (response.status === 200) {
|
||||
if (apps_subs === "onedrive") {
|
||||
if (apps_subs === "onedrive" || apps_subs === "115cloud"
|
||||
|| apps_subs === "baiduyun") {
|
||||
window.location.href = response_data.text;
|
||||
}
|
||||
if (apps_type === "alicloud_qr") {
|
||||
@ -251,11 +268,40 @@
|
||||
const strSearch = window.location.search;
|
||||
const urlParams = new URLSearchParams(strSearch);
|
||||
const client_uid = urlParams.get("client_uid");
|
||||
const secret_key = urlParams.get("secret_key");
|
||||
const driver_txt = urlParams.get("driver_txt");
|
||||
const client_key = urlParams.get("client_key");
|
||||
const access_token = urlParams.get("access_token");
|
||||
const refresh_token = urlParams.get("refresh_token");
|
||||
const message_err = urlParams.get("message_err");
|
||||
if (message_err && client_uid) {
|
||||
document.getElementById("site-select").value = driver_txt;
|
||||
document.getElementById("app-secret").value = client_key;
|
||||
document.getElementById("client-id").value = client_uid;
|
||||
document.getElementById("access-token").value = access_token;
|
||||
document.getElementById("refresh-token").value = refresh_token;
|
||||
if(secret_key)
|
||||
document.getElementById("secret-key").value = secret_key;
|
||||
// 获取select元素和输入框元素
|
||||
const siteSelect = document.getElementById('site-select');
|
||||
const callbackUrlInput = document.getElementById('callback-url');
|
||||
|
||||
// 监听select的变化
|
||||
siteSelect.addEventListener('change', function () {
|
||||
const selectedValue = this.value.split("_")[0]; // 获取选中的value
|
||||
// 更新输入框的值
|
||||
callbackUrlInput.value = `https://api.oplist.org/${selectedValue}/callback`;
|
||||
document.getElementById('secret-key-view').hidden = true;
|
||||
if (siteSelect.value === "baiduyun_go") {
|
||||
document.getElementById('secret-key-view').hidden = false;
|
||||
}
|
||||
|
||||
});
|
||||
// 页面加载时初始化回调地址
|
||||
window.onload = function () {
|
||||
siteSelect.dispatchEvent(new Event('change'));
|
||||
};
|
||||
|
||||
if (message_err) {
|
||||
Swal.fire({
|
||||
position: 'top',
|
||||
icon: 'error',
|
||||
@ -264,13 +310,9 @@
|
||||
showConfirmButton: true,
|
||||
});
|
||||
}
|
||||
document.getElementById("client-id").value = client_uid;
|
||||
document.getElementById("app-secret").value = client_key;
|
||||
document.getElementById("access-token").value = access_token;
|
||||
document.getElementById("refresh-token").value = refresh_token;
|
||||
}
|
||||
|
||||
getToken();
|
||||
|
||||
}
|
||||
|
||||
//手动切换主题模式
|
||||
function toggleTheme() {
|
||||
@ -285,6 +327,7 @@
|
||||
if (hour < 6 || hour >= 18) document.documentElement.setAttribute("data-theme", "dark");
|
||||
getToken();
|
||||
})();
|
||||
getToken();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
107
src/115ui.ts
Normal file
107
src/115ui.ts
Normal file
@ -0,0 +1,107 @@
|
||||
import * as local from "hono/cookie";
|
||||
import {Context} from "hono";
|
||||
import {showErr} from "./error";
|
||||
|
||||
|
||||
const driver_map: string[] = [
|
||||
"https://passportapi.115.com/open/authorize",
|
||||
"https://passportapi.115.com/open/authCodeToToken"
|
||||
]
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
export async function oneLogin(c: Context) {
|
||||
const client_uid = c.req.query('client_uid');
|
||||
const client_key = c.req.query('client_key');
|
||||
const driver_txt = c.req.query('apps_types');
|
||||
if(!driver_txt||!client_uid||!client_key)
|
||||
return c.json({text: "参数缺少"}, 500);
|
||||
const random_key = getRandomString(64);
|
||||
// 请求参数 ==========================================================================
|
||||
const params_all: Record<string, any> = {
|
||||
client_id: client_uid,
|
||||
state: random_key,
|
||||
response_type: 'code',
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback'
|
||||
};
|
||||
const urlWithParams = new URL(driver_map[0]);
|
||||
Object.keys(params_all).forEach(key => {
|
||||
urlWithParams.searchParams.append(key, params_all[key]);
|
||||
});
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const response = await fetch(urlWithParams.href, {method: 'GET',});
|
||||
local.setCookie(c, 'client_uid', client_uid);
|
||||
local.setCookie(c, 'client_key', client_key);
|
||||
local.setCookie(c, 'driver_txt', driver_txt);
|
||||
local.setCookie(c, 'random_key', random_key);
|
||||
console.log(response);
|
||||
return c.json({text: response.url}, 200);
|
||||
} catch (error) {
|
||||
return c.json({text: error}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
export async function oneToken(c: Context) {
|
||||
let login_data, client_uid, client_key, random_key, client_url, params_all, random_uid, driver_txt;
|
||||
try { // 请求参数 ====================================================================
|
||||
login_data = c.req.query('code');
|
||||
random_uid = c.req.query('state');
|
||||
client_uid = local.getCookie(c, 'client_uid')
|
||||
client_key = local.getCookie(c, 'client_key')
|
||||
random_key = local.getCookie(c, 'random_key')
|
||||
driver_txt = local.getCookie(c, 'driver_txt')
|
||||
if (!random_uid || !random_key || random_uid !== random_key
|
||||
|| !driver_txt || !login_data || !client_uid || !client_key)
|
||||
return c.redirect(showErr("Cookie无效", "", ""));
|
||||
client_url = driver_map[1];
|
||||
params_all = {
|
||||
client_id: client_uid,
|
||||
client_secret: client_key,
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback',
|
||||
code: login_data,
|
||||
grant_type: 'authorization_code'
|
||||
};
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, "", ""));
|
||||
}
|
||||
// console.log(login_data);
|
||||
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const paramsString = new URLSearchParams(params_all).toString();
|
||||
const response: Response = await fetch(client_url, {
|
||||
method: 'POST', body: paramsString,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
});
|
||||
local.deleteCookie(c, 'client_uid');
|
||||
local.deleteCookie(c, 'client_key');
|
||||
local.deleteCookie(c, 'random_key');
|
||||
local.deleteCookie(c, 'driver_txt');
|
||||
let json: Record<string, any> = await response.json();
|
||||
if (json.state == 1) {
|
||||
return c.redirect(
|
||||
`/?access_token=${json.data.access_token}`
|
||||
+ `&refresh_token=${json.data.refresh_token}`
|
||||
+ `&client_uid=${client_uid}`
|
||||
+ `&client_key=${client_key}`
|
||||
+ `&driver_txt=${driver_txt}`
|
||||
);
|
||||
}
|
||||
return c.redirect(showErr(json.message, client_uid, client_key));
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, client_uid, client_key));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getRandomString(length: number): string {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let result = '';
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
return result;
|
||||
}
|
12
src/aliui.ts
12
src/aliui.ts
@ -1,4 +1,5 @@
|
||||
import {Context} from "hono";
|
||||
import * as local from "hono/cookie";
|
||||
|
||||
const driver_map = [
|
||||
'https://openapi.aliyundrive.com/oauth/authorize/qrcode',
|
||||
@ -29,9 +30,14 @@ interface AliQrcodeReq {
|
||||
// 登录申请 ##############################################################################
|
||||
export async function alyLogin(c: Context) {
|
||||
try {
|
||||
const client_uid = c.req.query('client_uid');
|
||||
const client_key = c.req.query('client_key');
|
||||
const driver_txt = c.req.query('apps_types');
|
||||
if (!driver_txt || !client_uid || !client_key)
|
||||
return c.json({text: "参数缺少"}, 500);
|
||||
const req: AliQrcodeReq = {
|
||||
client_id: <string>c.req.query('client_uid'),
|
||||
client_secret: <string>c.req.query('client_key'),
|
||||
client_id: client_uid,
|
||||
client_secret: client_key,
|
||||
scopes: ['user:base', 'file:all:read', 'file:all:write']
|
||||
}
|
||||
const response = await fetch(driver_map[0], {
|
||||
@ -43,6 +49,7 @@ export async function alyLogin(c: Context) {
|
||||
const error: AliAccessTokenErr = await response.json();
|
||||
return c.json({text: `${error.code}: ${error.message}`}, 403);
|
||||
}
|
||||
local.setCookie(c, 'driver_txt', driver_txt);
|
||||
const data: Record<string, any> = await response.json();
|
||||
console.log(data);
|
||||
return c.json({
|
||||
@ -79,6 +86,7 @@ export async function alyToken(c: Context) {
|
||||
}
|
||||
req.code = code_data.authCode;
|
||||
}
|
||||
local.deleteCookie(c, 'driver_txt');
|
||||
try {
|
||||
const response = await fetch(driver_map[1], {
|
||||
method: 'POST',
|
||||
|
100
src/baidu.ts
Normal file
100
src/baidu.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import * as local from "hono/cookie";
|
||||
import {Context} from "hono";
|
||||
import {showErr} from "./error";
|
||||
|
||||
|
||||
const driver_map: string[] = [
|
||||
"https://openapi.baidu.com/oauth/2.0/authorize",
|
||||
"https://openapi.baidu.com/oauth/2.0/token"
|
||||
]
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
export async function oneLogin(c: Context) {
|
||||
const client_uid = c.req.query('client_uid');
|
||||
const client_key = c.req.query('client_key');
|
||||
const secret_key = c.req.query('secret_key');
|
||||
const driver_txt = c.req.query('apps_types');
|
||||
if (!driver_txt || !client_uid || !client_key || !secret_key)
|
||||
return c.json({text: "参数缺少"}, 500);
|
||||
// 请求参数 ==========================================================================
|
||||
const params_all: Record<string, any> = {
|
||||
client_id: client_key,
|
||||
device_id: client_uid,
|
||||
scope: "basic,netdisk",
|
||||
response_type: 'code',
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/baiduyun/callback'
|
||||
};
|
||||
const urlWithParams = new URL(driver_map[0]);
|
||||
Object.keys(params_all).forEach(key => {
|
||||
urlWithParams.searchParams.append(key, params_all[key]);
|
||||
});
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const response = await fetch(urlWithParams.href, {
|
||||
method: 'GET',
|
||||
});
|
||||
local.setCookie(c, 'client_uid', client_uid);
|
||||
local.setCookie(c, 'client_key', client_key);
|
||||
local.setCookie(c, 'driver_txt', driver_txt);
|
||||
local.setCookie(c, 'secret_key', secret_key);
|
||||
console.log(response.url);
|
||||
return c.json({text: response.url}, 200);
|
||||
} catch (error) {
|
||||
return c.json({text: error}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
export async function oneToken(c: Context) {
|
||||
let login_data, client_uid, client_key, secret_key, client_url;
|
||||
let driver_txt, params_all: Record<string, any>;
|
||||
try { // 请求参数 ====================================================================
|
||||
login_data = c.req.query('code');
|
||||
client_uid = local.getCookie(c, 'client_uid')
|
||||
client_key = local.getCookie(c, 'client_key')
|
||||
secret_key = local.getCookie(c, 'secret_key')
|
||||
driver_txt = local.getCookie(c, 'driver_txt')
|
||||
if (!login_data || !client_uid || !client_key || !secret_key)
|
||||
return c.redirect(showErr("Cookie缺少", "", ""));
|
||||
client_url = driver_map[1];
|
||||
params_all = {
|
||||
client_id: client_key,
|
||||
client_secret: secret_key,
|
||||
code: login_data,
|
||||
grant_type: 'authorization_code',
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/baiduyun/callback'
|
||||
};
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, "", ""));
|
||||
}
|
||||
// console.log(login_data);
|
||||
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const paramsString = new URLSearchParams(params_all).toString();
|
||||
const urlWithParams = new URL(client_url);
|
||||
Object.keys(params_all).forEach(key => {
|
||||
urlWithParams.searchParams.append(key, params_all[key]);
|
||||
});
|
||||
const response: Response = await fetch(urlWithParams, {method: 'GET'});
|
||||
local.deleteCookie(c, 'client_uid');
|
||||
local.deleteCookie(c, 'client_key');
|
||||
local.deleteCookie(c, 'secret_key');
|
||||
const json: Record<string, any> = await response.json();
|
||||
// console.log(response, json);
|
||||
if (response.ok) {
|
||||
return c.redirect(
|
||||
`/?access_token=${json.access_token}`
|
||||
+ `&refresh_token=${json.refresh_token}`
|
||||
+ `&client_uid=${client_uid}`
|
||||
+ `&client_key=${client_key}`
|
||||
+ `&secret_key=${secret_key}`
|
||||
+ `&driver_txt=${driver_txt}`
|
||||
);
|
||||
}
|
||||
return c.redirect(showErr(json.error_description, client_uid, client_key));
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, client_uid, client_key));
|
||||
}
|
||||
}
|
||||
|
9
src/error.ts
Normal file
9
src/error.ts
Normal file
@ -0,0 +1,9 @@
|
||||
export function showErr(error: string, client_uid: string, client_key: string) {
|
||||
return `/?message_err=${"授权失败,请检查: <br>" +
|
||||
"1、应用ID和应用机密是否正确<br>" +
|
||||
"2、登录账号是否具有应用权限<br>" +
|
||||
"3、回调地址是否包括上面地址<br>" +
|
||||
"错误信息: <br>" + error}`
|
||||
+ `&client_uid=${client_uid}`
|
||||
+ `&client_key=${client_key}`;
|
||||
}
|
107
src/goapi.ts
Normal file
107
src/goapi.ts
Normal file
@ -0,0 +1,107 @@
|
||||
import * as local from "hono/cookie";
|
||||
import {Context} from "hono";
|
||||
import {showErr} from "./error";
|
||||
|
||||
|
||||
const driver_map: string[] = [
|
||||
"https://passportapi.115.com/open/authorize",
|
||||
"https://passportapi.115.com/open/authCodeToToken"
|
||||
]
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
export async function oneLogin(c: Context) {
|
||||
const client_uid = c.req.query('client_uid');
|
||||
const client_key = c.req.query('client_key');
|
||||
const driver_txt = c.req.query('apps_types');
|
||||
if (!driver_txt || !client_uid || !client_key)
|
||||
return c.json({text: "参数缺少"}, 500);
|
||||
const random_key = getRandomString(64);
|
||||
// 请求参数 ==========================================================================
|
||||
const params_all: Record<string, any> = {
|
||||
client_id: client_uid,
|
||||
state: random_key,
|
||||
response_type: 'code',
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback'
|
||||
};
|
||||
const urlWithParams = new URL(driver_map[0]);
|
||||
Object.keys(params_all).forEach(key => {
|
||||
urlWithParams.searchParams.append(key, params_all[key]);
|
||||
});
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const response = await fetch(urlWithParams.href, {method: 'GET',});
|
||||
local.setCookie(c, 'client_uid', client_uid);
|
||||
local.setCookie(c, 'client_key', client_key);
|
||||
local.setCookie(c, 'driver_txt', driver_txt);
|
||||
local.setCookie(c, 'random_key', random_key);
|
||||
console.log(response);
|
||||
return c.json({text: response.url}, 200);
|
||||
} catch (error) {
|
||||
return c.json({text: error}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
export async function oneToken(c: Context) {
|
||||
let login_data, client_uid, client_key, random_key;
|
||||
let driver_txt, client_url, params_all, random_uid;
|
||||
try { // 请求参数 ====================================================================
|
||||
login_data = <string>c.req.query('code');
|
||||
random_uid = <string>c.req.query('state');
|
||||
client_uid = <string>local.getCookie(c, 'client_uid')
|
||||
client_key = <string>local.getCookie(c, 'client_key')
|
||||
random_key = <string>local.getCookie(c, 'random_key')
|
||||
driver_txt = local.getCookie(c, 'driver_txt')
|
||||
if (!client_uid || !client_key || random_uid !== random_key || !client_uid || !client_key)
|
||||
return c.redirect(showErr("Cookie无效", "", ""));
|
||||
client_url = driver_map[1];
|
||||
params_all = {
|
||||
client_id: client_uid,
|
||||
client_secret: client_key,
|
||||
redirect_uri: 'https://' + c.env.MAIN_URLS + '/onedrive/callback',
|
||||
code: login_data,
|
||||
grant_type: 'authorization_code'
|
||||
};
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, "", ""));
|
||||
}
|
||||
// console.log(login_data);
|
||||
|
||||
// 执行请求 ===========================================================================
|
||||
try {
|
||||
const paramsString = new URLSearchParams(params_all).toString();
|
||||
const response: Response = await fetch(client_url, {
|
||||
method: 'POST', body: paramsString,
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
},
|
||||
});
|
||||
local.deleteCookie(c, 'client_uid');
|
||||
local.deleteCookie(c, 'client_key');
|
||||
local.deleteCookie(c, 'random_key');
|
||||
local.deleteCookie(c, 'driver_txt');
|
||||
let json: Record<string, any> = await response.json();
|
||||
if (json.state == 1) {
|
||||
return c.redirect(
|
||||
`/?access_token=${json.data.access_token}`
|
||||
+ `&refresh_token=${json.data.refresh_token}`
|
||||
+ `&client_uid=${client_uid}`
|
||||
+ `&client_key=${client_key}`
|
||||
+ `&driver_txt=${driver_txt}`
|
||||
);
|
||||
}
|
||||
return c.redirect(showErr(json.message, client_uid, client_key));
|
||||
} catch (error) {
|
||||
return c.redirect(showErr(<string>error, client_uid, client_key));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getRandomString(length: number): string {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
let result = '';
|
||||
for (let i = 0; i < length; i++) {
|
||||
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
return result;
|
||||
}
|
35
src/index.ts
35
src/index.ts
@ -5,7 +5,9 @@ import manifest from '__STATIC_CONTENT_MANIFEST'
|
||||
import * as local from "hono/cookie";
|
||||
import * as oneui from './oneui';
|
||||
import * as aliui from './aliui';
|
||||
|
||||
import * as ui115 from './115ui';
|
||||
import * as baidu from './baidu';
|
||||
import * as goapi from './goapi';
|
||||
export type Bindings = {
|
||||
MAIN_URLS: string
|
||||
}
|
||||
@ -31,4 +33,35 @@ app.get('/alicloud/callback', async (c: Context) => {
|
||||
return aliui.alyToken(c);
|
||||
});
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
app.get('/baiduyun/requests', async (c: Context) => {
|
||||
return baidu.oneLogin(c);
|
||||
});
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
app.get('/baiduyun/callback', async (c: Context) => {
|
||||
return baidu.oneToken(c);
|
||||
});
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
app.get('/115cloud/requests', async (c: Context) => {
|
||||
return ui115.oneLogin(c);
|
||||
});
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
app.get('/115cloud/callback', async (c: Context) => {
|
||||
return ui115.oneToken(c);
|
||||
});
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
app.get('/googleui/requests', async (c: Context) => {
|
||||
return goapi.oneLogin(c);
|
||||
});
|
||||
|
||||
// 令牌申请 ##############################################################################
|
||||
app.get('/googleui/callback', async (c: Context) => {
|
||||
return goapi.oneToken(c);
|
||||
});
|
||||
|
||||
|
||||
export default app
|
46
src/oneui.ts
46
src/oneui.ts
@ -1,6 +1,7 @@
|
||||
import * as local from "hono/cookie";
|
||||
import {Context} from "hono";
|
||||
|
||||
|
||||
const driver_map: Record<string, string[]> = {
|
||||
"onedrive_go": [
|
||||
'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
|
||||
@ -22,9 +23,11 @@ const driver_map: Record<string, string[]> = {
|
||||
|
||||
// 登录申请 ##############################################################################
|
||||
export async function oneLogin(c: Context) {
|
||||
const client_uid = <string>c.req.query('client_uid');
|
||||
const client_key = <string>c.req.query('client_key');
|
||||
const driver_txt = <string>c.req.query('apps_type');
|
||||
const client_uid = c.req.query('client_uid');
|
||||
const client_key = c.req.query('client_key');
|
||||
const driver_txt = c.req.query('apps_types');
|
||||
if (!driver_txt || !client_uid || !client_key)
|
||||
return c.json({text: "参数缺少"}, 500);
|
||||
const scopes_all = 'offline_access Files.ReadWrite.All';
|
||||
const client_url: string = driver_map[driver_txt][0];
|
||||
// 请求参数 ==========================================================================
|
||||
@ -45,7 +48,7 @@ export async function oneLogin(c: Context) {
|
||||
});
|
||||
local.setCookie(c, 'client_uid', client_uid);
|
||||
local.setCookie(c, 'client_key', client_key);
|
||||
local.setCookie(c, 'apps_types', driver_txt);
|
||||
local.setCookie(c, 'driver_txt', driver_txt);
|
||||
return c.json({text: response.url}, 200);
|
||||
} catch (error) {
|
||||
return c.json({text: error}, 500);
|
||||
@ -59,7 +62,7 @@ export async function oneToken(c: Context) {
|
||||
login_data = <string>c.req.query('code');
|
||||
client_uid = <string>local.getCookie(c, 'client_uid')
|
||||
client_key = <string>local.getCookie(c, 'client_key')
|
||||
driver_txt = <string>local.getCookie(c, 'apps_types')
|
||||
driver_txt = <string>local.getCookie(c, 'driver_txt')
|
||||
client_url = driver_map[driver_txt][1];
|
||||
params_all = {
|
||||
client_id: client_uid,
|
||||
@ -76,7 +79,7 @@ export async function oneToken(c: Context) {
|
||||
"3、回调地址是否包括上面地址<br>" +
|
||||
"4、登录可能过期,请重新登录<br>" +
|
||||
"错误信息: <br> " + error}`
|
||||
+ `&client_uid=NULL`
|
||||
+ `&client_uid=`
|
||||
+ `&client_key=`);
|
||||
}
|
||||
// console.log(login_data);
|
||||
@ -95,6 +98,7 @@ export async function oneToken(c: Context) {
|
||||
local.deleteCookie(c, 'client_uid');
|
||||
local.deleteCookie(c, 'client_key');
|
||||
local.deleteCookie(c, 'apps_types');
|
||||
local.deleteCookie(c, 'driver_txt');
|
||||
if (!response.ok)
|
||||
return c.redirect(
|
||||
`/?message_err=${"授权失败,请检查: <br>" +
|
||||
@ -110,7 +114,9 @@ export async function oneToken(c: Context) {
|
||||
`/?access_token=${json.access_token}`
|
||||
+ `&refresh_token=${json.refresh_token}`
|
||||
+ `&client_uid=${client_uid}`
|
||||
+ `&client_key=${client_key}`);
|
||||
+ `&client_key=${client_key}`
|
||||
+ `&driver_txt=${driver_txt}`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
return c.redirect(
|
||||
@ -123,3 +129,29 @@ export async function oneToken(c: Context) {
|
||||
+ `&client_key=${client_key}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function spSiteID(c: Context) {
|
||||
type Req = {
|
||||
access_token: string;
|
||||
site_url: string;
|
||||
zone: string;
|
||||
};
|
||||
const req: Req = await c.req.json();
|
||||
|
||||
const u = new URL(req.site_url);
|
||||
const siteName = u.pathname;
|
||||
|
||||
if (driver_map[req.zone]) {
|
||||
const response = await fetch(`${driver_map[req.zone][1]}/v1.0/sites/root:/${siteName}`, {
|
||||
headers: {'Authorization': `Bearer ${req.access_token}`}
|
||||
});
|
||||
if (!response.ok) {
|
||||
return c.json({error: 'Failed to fetch site ID'}, 403);
|
||||
}
|
||||
const data: Record<string, any> = await response.json();
|
||||
console.log(data);
|
||||
return c.json(data);
|
||||
} else {
|
||||
return c.json({error: 'Zone does not exist'}, 400);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user