Merge branch 'dev' of codeup.aliyun.com:61c14a7efa282c88e103c23f/oak-external-sdk into dev

This commit is contained in:
Xu Chang 2023-09-14 17:42:30 +08:00
commit b0f7a4e989
28 changed files with 63 additions and 86 deletions

View File

@ -1,7 +1,7 @@
import { WechatMpInstance } from './service/wechat/WechatMp';
import { WechatPublicInstance } from './service/wechat/WechatPublic';
import { WechatWebInstance } from './service/wechat/WechatWeb';
import { load } from 'cheerio';
import { load } from './utils/cheerio';
class WechatSDK {
mpMap;
publicMap;

View File

@ -6,17 +6,15 @@ export declare class QiniuCloudInstance {
*
* https://developer.qiniu.com/kodo/1312/upload
* @param uploadHost
* @param domain
* @param bucket
* @param key
* @returns
*/
getUploadInfo(uploadHost: string, domain: string, bucket: string, key?: string): {
getUploadInfo(uploadHost: string, bucket: string, key?: string): {
key: string | undefined;
uploadToken: string;
uploadHost: string;
bucket: string;
domain: string;
};
/**
* token

View File

@ -13,12 +13,11 @@ export class QiniuCloudInstance {
* 计算客户端上传七牛需要的凭证
* https://developer.qiniu.com/kodo/1312/upload
* @param uploadHost
* @param domain
* @param bucket
* @param key
* @returns
*/
getUploadInfo(uploadHost, domain, bucket, key) {
getUploadInfo(uploadHost, bucket, key) {
try {
const scope = key ? `${bucket}:${key}` : bucket;
const uploadToken = this.getToken(scope);
@ -27,7 +26,6 @@ export class QiniuCloudInstance {
uploadToken,
uploadHost,
bucket,
domain,
};
}
catch (err) {

2
es/utils/cheerio/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

2
es/utils/cheerio/index.mp.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
declare function load(content: string): void;
export { load };

View File

@ -0,0 +1,4 @@
function load(content) {
throw new Error('cheerio load not implemented');
}
export { load };

2
es/utils/cheerio/index.web.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

View File

@ -8,7 +8,7 @@ var WechatPublic_1 = require("./service/wechat/WechatPublic");
Object.defineProperty(exports, "WechatPublicInstance", { enumerable: true, get: function () { return WechatPublic_1.WechatPublicInstance; } });
var WechatWeb_1 = require("./service/wechat/WechatWeb");
Object.defineProperty(exports, "WechatWebInstance", { enumerable: true, get: function () { return WechatWeb_1.WechatWebInstance; } });
var cheerio_1 = require("cheerio");
var cheerio_1 = require("./utils/cheerio");
var WechatSDK = /** @class */ (function () {
function WechatSDK() {
this.mpMap = {};

View File

@ -6,17 +6,15 @@ export declare class QiniuCloudInstance {
*
* https://developer.qiniu.com/kodo/1312/upload
* @param uploadHost
* @param domain
* @param bucket
* @param key
* @returns
*/
getUploadInfo(uploadHost: string, domain: string, bucket: string, key?: string): {
getUploadInfo(uploadHost: string, bucket: string, key?: string): {
key: string | undefined;
uploadToken: string;
uploadHost: string;
bucket: string;
domain: string;
};
/**
* token

View File

@ -15,12 +15,11 @@ var QiniuCloudInstance = /** @class */ (function () {
* 计算客户端上传七牛需要的凭证
* https://developer.qiniu.com/kodo/1312/upload
* @param uploadHost
* @param domain
* @param bucket
* @param key
* @returns
*/
QiniuCloudInstance.prototype.getUploadInfo = function (uploadHost, domain, bucket, key) {
QiniuCloudInstance.prototype.getUploadInfo = function (uploadHost, bucket, key) {
try {
var scope = key ? "".concat(bucket, ":").concat(key) : bucket;
var uploadToken = this.getToken(scope);
@ -29,7 +28,6 @@ var QiniuCloudInstance = /** @class */ (function () {
uploadToken: uploadToken,
uploadHost: uploadHost,
bucket: bucket,
domain: domain,
};
}
catch (err) {

2
lib/utils/cheerio/index.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

View File

@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
var cheerio_1 = require("cheerio");
Object.defineProperty(exports, "load", { enumerable: true, get: function () { return cheerio_1.load; } });

2
lib/utils/cheerio/index.mp.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
declare function load(content: string): void;
export { load };

View File

@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
function load(content) {
throw new Error('cheerio load not implemented');
}
exports.load = load;

2
lib/utils/cheerio/index.web.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
import { load } from 'cheerio';
export { load };

View File

@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
var cheerio_1 = require("cheerio");
Object.defineProperty(exports, "load", { enumerable: true, get: function () { return cheerio_1.load; } });

View File

@ -28,7 +28,7 @@
"@alicloud/pop-core": "^1.7.12",
"cheerio": "^1.0.0-rc.12",
"isomorphic-fetch": "^3.0.0",
"tencentcloud-sdk-nodejs": "^4.0.525",
"tencentcloud-sdk-nodejs": "^4.0.686",
"ts-md5": "^1.3.1"
}
}

8
src/AmapSDK.d.ts vendored
View File

@ -1,8 +0,0 @@
import { AmapInstance } from './service/amap/Amap';
declare class AmapSDK {
webKeyMap: Record<string, AmapInstance>;
constructor();
getInstance(key: string): AmapInstance;
}
declare const SDK: AmapSDK;
export default SDK;

9
src/WechatSDK.d.ts vendored
View File

@ -1,9 +0,0 @@
import { WechatMpInstance } from './service/wechat/WechatMp';
declare class WechatSDK {
mpMap: Record<string, WechatMpInstance>;
publicMap: Record<string, any>;
constructor();
getInstance(appId: string, appSecret: string, type: 'wechatMp' | 'wechatPublic'): WechatMpInstance;
}
declare const SDK: WechatSDK;
export default SDK;

View File

@ -1,7 +1,7 @@
import { WechatMpInstance } from './service/wechat/WechatMp';
import { WechatPublicInstance } from './service/wechat/WechatPublic';
import { WechatWebInstance } from './service/wechat/WechatWeb';
import {load} from 'cheerio';
import { load } from './utils/cheerio';
class WechatSDK {
mpMap: Record<string, WechatMpInstance>;

View File

@ -1,22 +0,0 @@
export declare class AmapInstance {
key: string;
constructor(key: string);
getDrivingPath(data: {
from: [number, number];
to: [number, number];
}): Promise<any>;
regeo(data: {
longitude: number;
latitude: number;
}): Promise<any>;
ipLoc(data: {
ip: string;
}): Promise<any>;
getDistrict(data: {
keywords: string;
subdistrict: string;
}): Promise<any>;
geocode(data: {
address: string;
}): Promise<any>;
}

View File

@ -16,14 +16,12 @@ export class QiniuCloudInstance {
*
* https://developer.qiniu.com/kodo/1312/upload
* @param uploadHost
* @param domain
* @param bucket
* @param key
* @returns
*/
getUploadInfo(
uploadHost: string,
domain: string,
bucket: string,
key?: string
) {
@ -35,7 +33,6 @@ export class QiniuCloudInstance {
uploadToken,
uploadHost,
bucket,
domain,
};
} catch (err) {
throw err;

View File

@ -1,28 +0,0 @@
export declare class WechatMpInstance {
appId: string;
appSecret: string;
accessToken?: string;
refreshAcessTokenHandler?: any;
constructor(appId: string, appSecret: string);
private access;
code2Session(code: string): Promise<{
sessionKey: string;
openId: string;
unionId: string;
}>;
private refreshAccessToken;
decryptData(sessionKey: string, encryptedData: string, iv: string, signature: string): any;
getMpUnlimitWxaCode({ scene, page, envVersion, width, autoColor, lineColor, isHyaline }: {
scene: string;
page: string;
envVersion?: string;
width?: number;
autoColor?: boolean;
lineColor?: {
r: number;
g: number;
b: number;
};
isHyaline?: true;
}): Promise<ArrayBuffer>;
}

View File

@ -0,0 +1,9 @@
function load(content: string) {
throw new Error('cheerio load not implemented');
}
export {
load
}

View File

@ -0,0 +1,3 @@
import { load } from 'cheerio';
export { load };

View File

@ -0,0 +1,6 @@
import { load } from 'cheerio';
export {
load
}