@qqbrowser/qbot-claw-launcher 0.9.78 → 0.9.80
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/dist/api/content-review.js +2 -1
- package/dist/api/content-review.js.map +1 -1
- package/dist/build.js +1 -1
- package/dist/config.js +1 -1
- package/dist/installer.js +8 -8
- package/dist/openai-proxy.js +17 -4
- package/node_modules/@tencent/qb-auth-send-h5/README.md +118 -0
- package/node_modules/@tencent/qb-auth-send-h5/index.cjs +1 -0
- package/node_modules/@tencent/qb-auth-send-h5/index.d.ts +1 -0
- package/node_modules/@tencent/qb-auth-send-h5/index.js +1317 -0
- package/node_modules/@tencent/qb-auth-send-h5/package.json +35 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/src/authSend.d.ts +2 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/src/index.d.ts +2 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/src/modules/jsapi.d.ts +26 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/src/utils/constant.d.ts +1 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/src/utils/index.d.ts +3 -0
- package/node_modules/@tencent/qb-auth-send-h5/packages/auth-send/h5/types/index.d.ts +29 -0
- package/package.json +4 -3
- package/dist/qqbrowser-skill-installer.js +0 -2
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tencent/qb-auth-send-h5",
|
|
3
|
+
"version": "2.5.0",
|
|
4
|
+
"displayName": "统一鉴权 - H5",
|
|
5
|
+
"summary": "统一鉴权发送请求",
|
|
6
|
+
"description": "统一鉴权发送请求",
|
|
7
|
+
"author": "gallonhe",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build-demo": "webpack --mode development && node ./scripts/meta.js",
|
|
10
|
+
"build-server": "webpack --watch --mode production --config webpack.build.config.js & node scripts/meta.js",
|
|
11
|
+
"lint": "eslint ./src --ext .ts,.tsx --fix",
|
|
12
|
+
"parse": "node ./scripts/parseProps.js && eslint ./meta.js --fix",
|
|
13
|
+
"start": "webpack server --mode development"
|
|
14
|
+
},
|
|
15
|
+
"QBSetting": {
|
|
16
|
+
"static": {
|
|
17
|
+
"bid": 0,
|
|
18
|
+
"type": "func/"
|
|
19
|
+
},
|
|
20
|
+
"group": "公线",
|
|
21
|
+
"framework": "h5",
|
|
22
|
+
"project": "auth-send"
|
|
23
|
+
},
|
|
24
|
+
"module": "./index.js",
|
|
25
|
+
"main": "./index.cjs",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"types": "./src/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./src/index.d.ts",
|
|
31
|
+
"import": "./index.js",
|
|
32
|
+
"require": "./index.cjs"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Scene } from '../../types';
|
|
2
|
+
export declare const getAccountInfo: (scene: string) => Promise<unknown>;
|
|
3
|
+
export declare const getDeviceInfo: (scene: string) => Promise<unknown>;
|
|
4
|
+
export declare const refreshToken: (scene: string, accountInfo: any, type: 'token' | 'qbtoken') => Promise<unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* 刷新登录token。只有能取到QB票据的QB版本,才能刷新QB票据
|
|
7
|
+
*
|
|
8
|
+
* @param param 刷新token需要传入的信息
|
|
9
|
+
* @param param.qbid 用户的qbid
|
|
10
|
+
* @param param.openid 用户的openid
|
|
11
|
+
* @param param.type 传入qbtoken,表示刷新QB票据。不传入,则刷新社交票据
|
|
12
|
+
* @param callback 刷新完成后的回调函数
|
|
13
|
+
*/
|
|
14
|
+
export declare const refreshMacToken: (type: 'token' | 'qbtoken', callback: (res: any) => void) => void;
|
|
15
|
+
/**
|
|
16
|
+
* 根据客户端返回的mode,判断当前登录类型。wx: 微信登录。qq: qq登录。qqsdk: 老的qqsdk登录
|
|
17
|
+
*
|
|
18
|
+
* @param mode 客户端返回的登录mode
|
|
19
|
+
* @returns 登录类型
|
|
20
|
+
* mac 2是qq 3是微信
|
|
21
|
+
* win 2是qq 3是微信 5是qq
|
|
22
|
+
*/
|
|
23
|
+
export declare const getLoginTypeByMode: (scene: Scene, mode: number) => number;
|
|
24
|
+
export declare const getVersion: (scene: Scene) => Promise<unknown>;
|
|
25
|
+
export declare const getSocialMediaTokenInfoOfPhone: (scene: Scene) => Promise<unknown>;
|
|
26
|
+
export declare const getUsKey: (scene: Scene, busInfo: string) => Promise<unknown>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const QIMEISDKAPPKEY = "7800236";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare type AuthSendOptions = {
|
|
2
|
+
servantName: string;
|
|
3
|
+
funcName: string;
|
|
4
|
+
isAuth?: boolean;
|
|
5
|
+
scene?: Scene;
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
authType?: string;
|
|
8
|
+
usKey?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare enum Scene {
|
|
11
|
+
h5 = "h5",
|
|
12
|
+
windows = "windows",
|
|
13
|
+
mac = "mac",
|
|
14
|
+
external = "external",
|
|
15
|
+
wxminiprogram = "wxminiprogram"
|
|
16
|
+
}
|
|
17
|
+
export declare type ExtInfo = {
|
|
18
|
+
loginInfo?: LoginInfo;
|
|
19
|
+
overRideInfo?: any;
|
|
20
|
+
};
|
|
21
|
+
export declare type LoginInfo = {
|
|
22
|
+
guid?: string;
|
|
23
|
+
openid?: string;
|
|
24
|
+
access_token?: string;
|
|
25
|
+
qbaccess_token?: string;
|
|
26
|
+
qbid?: string;
|
|
27
|
+
appid?: string;
|
|
28
|
+
account_type?: string;
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qqbrowser/qbot-claw-launcher",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.80",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
],
|
|
13
13
|
"bundledDependencies": [
|
|
14
14
|
"fs-xattr",
|
|
15
|
-
"@parcel/watcher"
|
|
15
|
+
"@parcel/watcher",
|
|
16
|
+
"@tencent/qb-auth-send-h5"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
|
18
19
|
"build": "node scripts/inject-version.js && tsc && node scripts/obfuscate.js && chmod +x dist/index.js",
|
|
19
20
|
"prepare": "test -d prebuilds && mkdir -p fs-xattr/build/Release parcel-watcher/build/Release && cp prebuilds/xattr.node fs-xattr/build/Release/ && cp prebuilds/watcher.node parcel-watcher/build/Release/ && echo '✅ prebuilds copied' || true",
|
|
20
|
-
"prepack": "rm -rf node_modules/fs-xattr && cp -r fs-xattr node_modules/fs-xattr && rm -rf node_modules/@parcel/watcher && mkdir -p node_modules/@parcel && cp -r parcel-watcher node_modules/@parcel/watcher && mkdir -p node_modules/fs-xattr/build/Release && cp prebuilds/xattr.node node_modules/fs-xattr/build/Release/ && mkdir -p node_modules/@parcel/watcher/build/Release && cp prebuilds/watcher.node node_modules/@parcel/watcher/build/Release/ && bash scripts/clean-native-sources.sh && bash scripts/verify-universal-binary.sh",
|
|
21
|
+
"prepack": "rm -rf node_modules/fs-xattr && cp -r fs-xattr node_modules/fs-xattr && rm -rf node_modules/@parcel/watcher && mkdir -p node_modules/@parcel && cp -r parcel-watcher node_modules/@parcel/watcher && mkdir -p node_modules/fs-xattr/build/Release && cp prebuilds/xattr.node node_modules/fs-xattr/build/Release/ && mkdir -p node_modules/@parcel/watcher/build/Release && cp prebuilds/watcher.node node_modules/@parcel/watcher/build/Release/ && bash scripts/clean-native-sources.sh && bash scripts/verify-universal-binary.sh && echo '✅ @tencent/qb-auth-send-h5 bundled'",
|
|
21
22
|
"start": "node dist/index.js",
|
|
22
23
|
"dev": "ts-node src/index.ts",
|
|
23
24
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var _=exports&&exports.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.installQQBrowserSkill=y;const x=_(require("fs")),$=require("child_process"),f=_(require("path")),o=require("./config"),l=require("./reportLog"),d="https://test.pypi.org/simple/",I="https://mirrors.tencent.com/pypi/simple/",m=!1,b=m?d:I;function a(i,r,t,u){return new Promise(w=>{let p="";const q=(0,$.spawn)(i,r,{stdio:["ignore","pipe","pipe"],env:{...process.env,...u}});q.stdout.on("data",e=>{const s=e.toString().trim();s&&((0,l.log)(`[qqbrowser-skill] ${s}`),t(`[qqbrowser-skill] ${s}`))}),q.stderr.on("data",e=>{const s=e.toString().trim();s&&(p+=s+`
|
|
2
|
-
`,(0,l.log)(`[qqbrowser-skill] ${s}`),t(`[qqbrowser-skill] ${s}`))}),q.on("close",e=>{w({code:e??1,stderr:p})}),q.on("error",e=>{(0,l.log)(`[qqbrowser-skill] \u547D\u4EE4\u6267\u884C\u5931\u8D25: ${e.message}`),w({code:1,stderr:e.message})})})}const n=f.default.join(o.PYTHON_DIR,"bin","pipx");let k=null;async function N(){if(x.default.existsSync(n)){const{code:i}=await a(n,["--version"],()=>{});if(i===0)return k=n,!0}return!1}function g(){return k||n}async function h(i){if(await N())return(0,l.log)(`[qqbrowser-skill] pipx \u5DF2\u5B89\u88C5 (${k})`),!0;if((0,l.log)("[qqbrowser-skill] pipx \u672A\u5B89\u88C5\uFF0C\u5F00\u59CB\u901A\u8FC7 pip \u5B89\u88C5 pipx..."),i("[qqbrowser-skill] pipx \u672A\u5B89\u88C5\uFF0C\u6B63\u5728\u5B89\u88C5 pipx..."),!x.default.existsSync(o.PYTHON_BIN))return(0,l.log)(`[qqbrowser-skill] \u5185\u7F6E Python \u4E0D\u5B58\u5728: ${o.PYTHON_BIN}\uFF0C\u65E0\u6CD5\u5B89\u88C5 pipx`),i("[qqbrowser-skill] \u5185\u7F6E Python \u4E0D\u5B58\u5728\uFF0C\u65E0\u6CD5\u5B89\u88C5 pipx"),!1;const{code:r,stderr:t}=await a(o.PYTHON_BIN,["-m","pip","install","-i",b,"pipx"],i);return r!==0?((0,l.log)(`[qqbrowser-skill] pipx \u5B89\u88C5\u5931\u8D25\uFF0C\u9000\u51FA\u7801: ${r}\uFF0Cstderr: ${t}`),i("[qqbrowser-skill] pipx \u5B89\u88C5\u5931\u8D25"),!1):(k=n,(0,l.log)(`[qqbrowser-skill] pipx \u5B89\u88C5\u6210\u529F (${n})`),i("[qqbrowser-skill] pipx \u5B89\u88C5\u6210\u529F"),!0)}const c="qqbrowser-skill";async function y(i){try{if((0,l.log)("[qqbrowser-skill] \u5F00\u59CB\u5B89\u88C5..."),i("[qqbrowser-skill] \u5F00\u59CB\u5B89\u88C5..."),process.platform==="darwin"){if(!await h(i)){(0,l.log)("[qqbrowser-skill] pipx \u4E0D\u53EF\u7528\uFF0C\u8DF3\u8FC7 qqbrowser-skill \u5B89\u88C5"),i("[qqbrowser-skill] pipx \u4E0D\u53EF\u7528\uFF0C\u8DF3\u8FC7\u5B89\u88C5");return}const t=g(),u={PIPX_HOME:f.default.join(o.PYTHON_DIR,"pipx"),PIPX_BIN_DIR:f.default.join(o.PYTHON_DIR,"bin")};(0,l.log)(`[qqbrowser-skill] \u5C1D\u8BD5\u5347\u7EA7 ${c} (pipx: ${t})`),i("[qqbrowser-skill] \u6B63\u5728\u68C0\u67E5\u66F4\u65B0...");const{code:w}=await a(t,["upgrade","--index-url",b,c],i,u);if(w===0)(0,l.log)("[qqbrowser-skill] \u5347\u7EA7\u6210\u529F"),i("[qqbrowser-skill] \u5347\u7EA7\u6210\u529F");else{(0,l.log)("[qqbrowser-skill] \u672A\u5B89\u88C5\u6216\u5347\u7EA7\u5931\u8D25\uFF0C\u5C1D\u8BD5\u5168\u65B0\u5B89\u88C5..."),i("[qqbrowser-skill] \u6B63\u5728\u901A\u8FC7 pipx \u5B89\u88C5...");const{code:p,stderr:q}=await a(t,["install","--index-url",b,c],i,u);if(p!==0){(0,l.log)(`[qqbrowser-skill] pipx install \u5931\u8D25\uFF0C\u9000\u51FA\u7801: ${p}\uFF0Cstderr: ${q}`),i(`[qqbrowser-skill] \u5B89\u88C5\u5931\u8D25\uFF08\u9000\u51FA\u7801: ${p})`);return}}}else if(process.platform==="win32"){(0,l.log)(`[qqbrowser-skill] \u4F7F\u7528 pip \u5B89\u88C5/\u5347\u7EA7: ${c}`),i("[qqbrowser-skill] \u6B63\u5728\u901A\u8FC7 pip \u5B89\u88C5/\u5347\u7EA7...");const{code:r,stderr:t}=await a("pip",["install","--upgrade","-i",b,"--prefix",o.PYTHON_DIR,c],i);if(r!==0){(0,l.log)(`[qqbrowser-skill] pip install \u5931\u8D25\uFF0C\u9000\u51FA\u7801: ${r}\uFF0Cstderr: ${t}`),i(`[qqbrowser-skill] \u5B89\u88C5\u5931\u8D25\uFF08\u9000\u51FA\u7801: ${r}\uFF09`);return}}else{(0,l.log)(`[qqbrowser-skill] \u4E0D\u652F\u6301\u7684\u5E73\u53F0: ${process.platform}\uFF0C\u8DF3\u8FC7\u5B89\u88C5`),i("[qqbrowser-skill] \u4E0D\u652F\u6301\u7684\u5E73\u53F0\uFF0C\u8DF3\u8FC7\u5B89\u88C5");return}(0,l.log)("[qqbrowser-skill] \u5B89\u88C5\u5B8C\u6210"),i("[qqbrowser-skill] \u5B89\u88C5\u5B8C\u6210")}catch(r){(0,l.log)(`[qqbrowser-skill] \u5B89\u88C5\u8FC7\u7A0B\u4E2D\u53D1\u751F\u5F02\u5E38: ${r.message}`),i(`[qqbrowser-skill] \u5B89\u88C5\u5F02\u5E38: ${r.message}`)}}
|