feat: 添加多项功能和修复

功能新增:
- OSS 存储使用情况显示(文件页面)
- OSS 当日流量统计(阿里云云监控API)
- 分享页面路由修复(/s/xxx 格式支持)

Bug修复:
- 修复分享页面资源路径(相对路径改绝对路径)
- 修复分享码获取逻辑(支持路径格式)
- 修复OSS配额undefined显示问题
- 修复登录流程OSS配置检查
- 修复文件数为null时的显示问题

依赖更新:
- 添加 @alicloud/cms20190101 云监控SDK
- 添加 @alicloud/openapi-client

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 21:04:22 +08:00
parent a86903fcdc
commit b135987fe8
3410 changed files with 494007 additions and 11 deletions

View File

@@ -0,0 +1,19 @@
English | [简体中文](README-CN.md)
![](https://aliyunsdk-pages.alicdn.com/icons/AlibabaCloud.svg)
# Alibaba Cloud OpenApi Client
## Issues
[Opening an Issue](https://github.com/aliyun/darabonba-openapi/issues/new), Issues not conforming to the guidelines may be closed immediately.
## References
- [Latest Release](https://github.com/aliyun/darabonba-openapi)
## License
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.

View File

@@ -0,0 +1,531 @@
/**
* @remarks
* This is for OpenApi SDK
*/
import * as $Util from '@alicloud/tea-util';
import Credential from '@alicloud/credentials';
import SPI, * as $SPI from '@alicloud/gateway-spi';
import { Readable } from 'stream';
import * as $tea from '@alicloud/tea-typescript';
export declare class GlobalParameters extends $tea.Model {
headers?: {
[key: string]: string;
};
queries?: {
[key: string]: string;
};
static names(): {
[key: string]: string;
};
static types(): {
[key: string]: any;
};
constructor(map?: {
[key: string]: any;
});
}
/**
* @remarks
* Model for initing client
*/
export declare class Config extends $tea.Model {
/**
* @remarks
* accesskey id
*/
accessKeyId?: string;
/**
* @remarks
* accesskey secret
*/
accessKeySecret?: string;
/**
* @remarks
* security token
*
* @example
* a.txt
*/
securityToken?: string;
/**
* @remarks
* bearer token
*
* @example
* the-bearer-token
*/
bearerToken?: string;
/**
* @remarks
* http protocol
*
* @example
* http
*/
protocol?: string;
/**
* @remarks
* http method
*
* @example
* GET
*/
method?: string;
/**
* @remarks
* region id
*
* @example
* cn-hangzhou
*/
regionId?: string;
/**
* @remarks
* read timeout
*
* @example
* 10
*/
readTimeout?: number;
/**
* @remarks
* connect timeout
*
* @example
* 10
*/
connectTimeout?: number;
/**
* @remarks
* http proxy
*
* @example
* http://localhost
*/
httpProxy?: string;
/**
* @remarks
* https proxy
*
* @example
* https://localhost
*/
httpsProxy?: string;
/**
* @remarks
* credential
*/
credential?: Credential;
/**
* @remarks
* endpoint
*
* @example
* cs.aliyuncs.com
*/
endpoint?: string;
/**
* @remarks
* proxy white list
*
* @example
* http://localhost
*/
noProxy?: string;
/**
* @remarks
* max idle conns
*
* @example
* 3
*/
maxIdleConns?: number;
/**
* @remarks
* network for endpoint
*
* @example
* public
*/
network?: string;
/**
* @remarks
* user agent
*
* @example
* Alibabacloud/1
*/
userAgent?: string;
/**
* @remarks
* suffix for endpoint
*
* @example
* aliyun
*/
suffix?: string;
/**
* @remarks
* socks5 proxy
*/
socks5Proxy?: string;
/**
* @remarks
* socks5 network
*
* @example
* TCP
*/
socks5NetWork?: string;
/**
* @remarks
* endpoint type
*
* @example
* internal
*/
endpointType?: string;
/**
* @remarks
* OpenPlatform endpoint
*
* @example
* openplatform.aliyuncs.com
*/
openPlatformEndpoint?: string;
/**
* @remarks
* credential type
*
* @example
* access_key
*
* @deprecated
*/
type?: string;
/**
* @remarks
* Signature Version
*
* @example
* v1
*/
signatureVersion?: string;
/**
* @remarks
* Signature Algorithm
*
* @example
* ACS3-HMAC-SHA256
*/
signatureAlgorithm?: string;
/**
* @remarks
* Global Parameters
*/
globalParameters?: GlobalParameters;
/**
* @remarks
* privite key for client certificate
*
* @example
* MIIEvQ
*/
key?: string;
/**
* @remarks
* client certificate
*
* @example
* -----BEGIN CERTIFICATE-----
* xxx-----END CERTIFICATE-----
*/
cert?: string;
/**
* @remarks
* server certificate
*
* @example
* -----BEGIN CERTIFICATE-----
* xxx-----END CERTIFICATE-----
*/
ca?: string;
/**
* @remarks
* disable HTTP/2
*
* @example
* false
*/
disableHttp2?: boolean;
/**
* @remarks
* TLS Minimum Version
*
* @example
* TLSv1, TLSv1.1, TLSv1.2, TLSv1.3
*/
tlsMinVersion?: string;
static names(): {
[key: string]: string;
};
static types(): {
[key: string]: any;
};
constructor(map?: {
[key: string]: any;
});
}
export declare class OpenApiRequest extends $tea.Model {
headers?: {
[key: string]: string;
};
query?: {
[key: string]: string;
};
body?: any;
stream?: Readable;
hostMap?: {
[key: string]: string;
};
endpointOverride?: string;
static names(): {
[key: string]: string;
};
static types(): {
[key: string]: any;
};
constructor(map?: {
[key: string]: any;
});
}
export declare class Params extends $tea.Model {
action: string;
version: string;
protocol: string;
pathname: string;
method: string;
authType: string;
bodyType: string;
reqBodyType: string;
style?: string;
static names(): {
[key: string]: string;
};
static types(): {
[key: string]: any;
};
constructor(map?: {
[key: string]: any;
});
}
export default class Client {
_endpoint: string;
_regionId: string;
_protocol: string;
_method: string;
_userAgent: string;
_endpointRule: string;
_endpointMap: {
[key: string]: string;
};
_suffix: string;
_readTimeout: number;
_connectTimeout: number;
_httpProxy: string;
_httpsProxy: string;
_socks5Proxy: string;
_socks5NetWork: string;
_noProxy: string;
_network: string;
_productId: string;
_maxIdleConns: number;
_endpointType: string;
_openPlatformEndpoint: string;
_credential: Credential;
_signatureVersion: string;
_signatureAlgorithm: string;
_headers: {
[key: string]: string;
};
_spi: SPI;
_globalParameters: GlobalParameters;
_key: string;
_cert: string;
_ca: string;
_disableHttp2: boolean;
_tlsMinVersion: string;
_attributeMap: $SPI.AttributeMap;
/**
* @remarks
* Init client with Config
*
* @param config - config contains the necessary information to create a client
*/
constructor(config: Config);
/**
* @remarks
* Encapsulate the request and invoke the network
*
* @param action - api name
* @param version - product version
* @param protocol - http or https
* @param method - e.g. GET
* @param authType - authorization type e.g. AK
* @param bodyType - response body type e.g. String
* @param request - object of OpenApiRequest
* @param runtime - which controls some details of call api, such as retry times
* @returns the response
*/
doRPCRequest(action: string, version: string, protocol: string, method: string, authType: string, bodyType: string, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
/**
* @remarks
* Encapsulate the request and invoke the network
*
* @param action - api name
* @param version - product version
* @param protocol - http or https
* @param method - e.g. GET
* @param authType - authorization type e.g. AK
* @param pathname - pathname of every api
* @param bodyType - response body type e.g. String
* @param request - object of OpenApiRequest
* @param runtime - which controls some details of call api, such as retry times
* @returns the response
*/
doROARequest(action: string, version: string, protocol: string, method: string, authType: string, pathname: string, bodyType: string, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
/**
* @remarks
* Encapsulate the request and invoke the network with form body
*
* @param action - api name
* @param version - product version
* @param protocol - http or https
* @param method - e.g. GET
* @param authType - authorization type e.g. AK
* @param pathname - pathname of every api
* @param bodyType - response body type e.g. String
* @param request - object of OpenApiRequest
* @param runtime - which controls some details of call api, such as retry times
* @returns the response
*/
doROARequestWithForm(action: string, version: string, protocol: string, method: string, authType: string, pathname: string, bodyType: string, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
/**
* @remarks
* Encapsulate the request and invoke the network
*
* @param action - api name
* @param version - product version
* @param protocol - http or https
* @param method - e.g. GET
* @param authType - authorization type e.g. AK
* @param bodyType - response body type e.g. String
* @param request - object of OpenApiRequest
* @param runtime - which controls some details of call api, such as retry times
* @returns the response
*/
doRequest(params: Params, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
/**
* @remarks
* Encapsulate the request and invoke the network
*
* @param action - api name
* @param version - product version
* @param protocol - http or https
* @param method - e.g. GET
* @param authType - authorization type e.g. AK
* @param bodyType - response body type e.g. String
* @param request - object of OpenApiRequest
* @param runtime - which controls some details of call api, such as retry times
* @returns the response
*/
execute(params: Params, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
callApi(params: Params, request: OpenApiRequest, runtime: $Util.RuntimeOptions): Promise<{
[key: string]: any;
}>;
/**
* @remarks
* Get user agent
* @returns user agent
*/
getUserAgent(): string;
/**
* @remarks
* Get accesskey id by using credential
* @returns accesskey id
*/
getAccessKeyId(): Promise<string>;
/**
* @remarks
* Get accesskey secret by using credential
* @returns accesskey secret
*/
getAccessKeySecret(): Promise<string>;
/**
* @remarks
* Get security token by using credential
* @returns security token
*/
getSecurityToken(): Promise<string>;
/**
* @remarks
* Get bearer token by credential
* @returns bearer token
*/
getBearerToken(): Promise<string>;
/**
* @remarks
* Get credential type by credential
* @returns credential type e.g. access_key
*/
getType(): Promise<string>;
/**
* @remarks
* If inputValue is not null, return it or return defaultValue
*
* @param inputValue - users input value
* @param defaultValue - default value
* @returns the final result
*/
static defaultAny(inputValue: any, defaultValue: any): any;
/**
* @remarks
* If the endpointRule and config.endpoint are empty, throw error
*
* @param config - config contains the necessary information to create a client
*/
checkConfig(config: Config): void;
/**
* @remarks
* set gateway client
*
* @param spi - .
*/
setGatewayClient(spi: SPI): void;
/**
* @remarks
* set RPC header for debug
*
* @param headers - headers for debug, this header can be used only once.
*/
setRpcHeaders(headers: {
[key: string]: string;
}): void;
/**
* @remarks
* get RPC header for debug
*/
getRpcHeaders(): {
[key: string]: string;
};
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,37 @@
{
"name": "@alicloud/openapi-client",
"version": "0.4.15",
"description": "",
"main": "dist/client.js",
"scripts": {
"test": "mocha -r ts-node/register -r source-map-support/register test/**/*.spec.ts --timeout=10000",
"test-cov": "nyc -e .ts -r=html -r=text -r=lcov npm run test",
"build": "tsc",
"prepublishOnly": "tsc"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/mocha": "^5.2.7",
"mocha": "^6.2.0",
"@types/node": "^18.0.0",
"nyc": "^15.0.0",
"source-map-support": "^0.5.16",
"ts-node": "^10.0.0",
"typescript": "^5.6.0",
"@alicloud/gateway-pop": "0.0.6"
},
"dependencies": {
"@alicloud/tea-typescript": "^1.7.1",
"@alicloud/tea-util": "1.4.9",
"@alicloud/credentials": "^2.4.2",
"@alicloud/openapi-util": "^0.3.2",
"@alicloud/gateway-spi": "^0.0.8",
"@alicloud/tea-xml": "0.0.3"
},
"files": [
"dist",
"src"
],
"repository": "git@github.com:aliyun/darabonba-openapi.git"
}

File diff suppressed because it is too large Load Diff