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:
19
backend/node_modules/@alicloud/openapi-core/README.md
generated
vendored
Normal file
19
backend/node_modules/@alicloud/openapi-core/README.md
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
English | [简体中文](README-CN.md)
|
||||
|
||||

|
||||
|
||||
# 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.
|
||||
211
backend/node_modules/@alicloud/openapi-core/dist/client.d.ts
generated
vendored
Normal file
211
backend/node_modules/@alicloud/openapi-core/dist/client.d.ts
generated
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
import * as $OpenApiUtil from './utils';
|
||||
import Credential from '@alicloud/credentials';
|
||||
import SPI, * as $SPI from '@alicloud/gateway-spi';
|
||||
export * as $OpenApiUtil from './utils';
|
||||
export { default as OpenApiUtil } from './utils';
|
||||
export * from './exceptions/error';
|
||||
import * as $_model from './models/model';
|
||||
export * from './models/model';
|
||||
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: $OpenApiUtil.GlobalParameters;
|
||||
_key: string;
|
||||
_cert: string;
|
||||
_ca: string;
|
||||
_disableHttp2: boolean;
|
||||
_retryOptions: $dara.RetryOptions;
|
||||
_tlsMinVersion: string;
|
||||
_attributeMap: $SPI.AttributeMap;
|
||||
/**
|
||||
* @remarks
|
||||
* Init client with Config
|
||||
*
|
||||
* @param config - config contains the necessary information to create a client
|
||||
*/
|
||||
constructor(config: $OpenApiUtil.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: $OpenApiUtil.OpenApiRequest, runtime: $dara.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: $OpenApiUtil.OpenApiRequest, runtime: $dara.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: $OpenApiUtil.OpenApiRequest, runtime: $dara.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: $OpenApiUtil.Params, request: $OpenApiUtil.OpenApiRequest, runtime: $dara.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: $OpenApiUtil.Params, request: $OpenApiUtil.OpenApiRequest, runtime: $dara.RuntimeOptions): Promise<{
|
||||
[key: string]: any;
|
||||
}>;
|
||||
callSSEApi(params: $OpenApiUtil.Params, request: $OpenApiUtil.OpenApiRequest, runtime: $dara.RuntimeOptions): AsyncGenerator<$_model.SSEResponse, any, unknown>;
|
||||
callApi(params: $OpenApiUtil.Params, request: $OpenApiUtil.OpenApiRequest, runtime: $dara.RuntimeOptions): Promise<{
|
||||
[key: string]: any;
|
||||
}>;
|
||||
/**
|
||||
* @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 the endpointRule and config.endpoint are empty, throw error
|
||||
*
|
||||
* @param config - config contains the necessary information to create a client
|
||||
*/
|
||||
checkConfig(config: $OpenApiUtil.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;
|
||||
};
|
||||
getAccessDeniedDetail(err: {
|
||||
[key: string]: any;
|
||||
}): {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
1519
backend/node_modules/@alicloud/openapi-core/dist/client.js
generated
vendored
Normal file
1519
backend/node_modules/@alicloud/openapi-core/dist/client.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
backend/node_modules/@alicloud/openapi-core/dist/client.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/client.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.d.ts
generated
vendored
Normal file
11
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
export declare class AlibabaCloudError extends $dara.ResponseError {
|
||||
statusCode?: number;
|
||||
code: string;
|
||||
message: string;
|
||||
description?: string;
|
||||
requestId?: string;
|
||||
constructor(map?: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
37
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.js
generated
vendored
Normal file
37
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AlibabaCloudError = void 0;
|
||||
// This file is auto-generated, don't edit it
|
||||
const $dara = __importStar(require("@darabonba/typescript"));
|
||||
class AlibabaCloudError extends $dara.ResponseError {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
this.name = "AlibabaCloudError";
|
||||
Object.setPrototypeOf(this, AlibabaCloudError.prototype);
|
||||
this.statusCode = map.statusCode;
|
||||
this.code = map.code;
|
||||
this.description = map.description;
|
||||
this.requestId = map.requestId;
|
||||
}
|
||||
}
|
||||
exports.AlibabaCloudError = AlibabaCloudError;
|
||||
//# sourceMappingURL=AlibabaCloudError.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/AlibabaCloudError.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AlibabaCloudError.js","sourceRoot":"","sources":["../../src/exceptions/AlibabaCloudError.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,6DAA+C;AAG/C,MAAa,iBAAkB,SAAQ,KAAK,CAAC,aAAa;IAOxD,YAAY,GAA4B;QACtC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QACnC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IACjC,CAAC;CACF;AAhBD,8CAgBC"}
|
||||
9
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.d.ts
generated
vendored
Normal file
9
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
export declare class ClientError extends AlibabaCloudError {
|
||||
accessDeniedDetail?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
constructor(map?: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
14
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.js
generated
vendored
Normal file
14
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ClientError = void 0;
|
||||
const AlibabaCloudError_1 = require("./AlibabaCloudError");
|
||||
class ClientError extends AlibabaCloudError_1.AlibabaCloudError {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
this.name = "ClientError";
|
||||
Object.setPrototypeOf(this, ClientError.prototype);
|
||||
this.accessDeniedDetail = map.accessDeniedDetail;
|
||||
}
|
||||
}
|
||||
exports.ClientError = ClientError;
|
||||
//# sourceMappingURL=ClientError.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ClientError.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ClientError.js","sourceRoot":"","sources":["../../src/exceptions/ClientError.ts"],"names":[],"mappings":";;;AAEA,2DAAwD;AAGxD,MAAa,WAAY,SAAQ,qCAAiB;IAGhD,YAAY,GAA4B;QACtC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,kBAAkB,GAAG,GAAG,CAAC,kBAAkB,CAAC;IACnD,CAAC;CACF;AATD,kCASC"}
|
||||
6
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.d.ts
generated
vendored
Normal file
6
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
export declare class ServerError extends AlibabaCloudError {
|
||||
constructor(map?: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
13
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.js
generated
vendored
Normal file
13
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ServerError = void 0;
|
||||
const AlibabaCloudError_1 = require("./AlibabaCloudError");
|
||||
class ServerError extends AlibabaCloudError_1.AlibabaCloudError {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
this.name = "ServerError";
|
||||
Object.setPrototypeOf(this, ServerError.prototype);
|
||||
}
|
||||
}
|
||||
exports.ServerError = ServerError;
|
||||
//# sourceMappingURL=ServerError.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ServerError.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ServerError.js","sourceRoot":"","sources":["../../src/exceptions/ServerError.ts"],"names":[],"mappings":";;;AAEA,2DAAwD;AAGxD,MAAa,WAAY,SAAQ,qCAAiB;IAEhD,YAAY,GAA4B;QACtC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;CACF;AAPD,kCAOC"}
|
||||
7
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.d.ts
generated
vendored
Normal file
7
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
export declare class ThrottlingError extends AlibabaCloudError {
|
||||
retryAfter?: number;
|
||||
constructor(map?: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
14
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.js
generated
vendored
Normal file
14
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ThrottlingError = void 0;
|
||||
const AlibabaCloudError_1 = require("./AlibabaCloudError");
|
||||
class ThrottlingError extends AlibabaCloudError_1.AlibabaCloudError {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
this.name = "ThrottlingError";
|
||||
Object.setPrototypeOf(this, ThrottlingError.prototype);
|
||||
this.retryAfter = map.retryAfter;
|
||||
}
|
||||
}
|
||||
exports.ThrottlingError = ThrottlingError;
|
||||
//# sourceMappingURL=ThrottlingError.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/ThrottlingError.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ThrottlingError.js","sourceRoot":"","sources":["../../src/exceptions/ThrottlingError.ts"],"names":[],"mappings":";;;AAEA,2DAAwD;AAGxD,MAAa,eAAgB,SAAQ,qCAAiB;IAGpD,YAAY,GAA4B;QACtC,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACvD,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IACnC,CAAC;CACF;AATD,0CASC"}
|
||||
4
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.d.ts
generated
vendored
Normal file
4
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { AlibabaCloudError } from './AlibabaCloudError';
|
||||
export { ClientError } from './ClientError';
|
||||
export { ServerError } from './ServerError';
|
||||
export { ThrottlingError } from './ThrottlingError';
|
||||
11
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.js
generated
vendored
Normal file
11
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var AlibabaCloudError_1 = require("./AlibabaCloudError");
|
||||
Object.defineProperty(exports, "AlibabaCloudError", { enumerable: true, get: function () { return AlibabaCloudError_1.AlibabaCloudError; } });
|
||||
var ClientError_1 = require("./ClientError");
|
||||
Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return ClientError_1.ClientError; } });
|
||||
var ServerError_1 = require("./ServerError");
|
||||
Object.defineProperty(exports, "ServerError", { enumerable: true, get: function () { return ServerError_1.ServerError; } });
|
||||
var ThrottlingError_1 = require("./ThrottlingError");
|
||||
Object.defineProperty(exports, "ThrottlingError", { enumerable: true, get: function () { return ThrottlingError_1.ThrottlingError; } });
|
||||
//# sourceMappingURL=error.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/exceptions/error.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/exceptions/error.ts"],"names":[],"mappings":";;AAAA,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA"}
|
||||
26
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.d.ts
generated
vendored
Normal file
26
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
/**
|
||||
* @remarks
|
||||
* This is for OpenApi SDK
|
||||
*/
|
||||
export declare class SSEResponse extends $dara.Model {
|
||||
headers: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* @remarks
|
||||
* HTTP Status Code
|
||||
*/
|
||||
statusCode: number;
|
||||
event: $dara.SSEEvent;
|
||||
static names(): {
|
||||
[key: string]: string;
|
||||
};
|
||||
static types(): {
|
||||
[key: string]: any;
|
||||
};
|
||||
validate(): void;
|
||||
constructor(map?: {
|
||||
[key: string]: any;
|
||||
});
|
||||
}
|
||||
58
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.js
generated
vendored
Normal file
58
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SSEResponse = void 0;
|
||||
// This file is auto-generated, don't edit it
|
||||
const $dara = __importStar(require("@darabonba/typescript"));
|
||||
/**
|
||||
* @remarks
|
||||
* This is for OpenApi SDK
|
||||
*/
|
||||
class SSEResponse extends $dara.Model {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
}
|
||||
static names() {
|
||||
return {
|
||||
headers: 'headers',
|
||||
statusCode: 'statusCode',
|
||||
event: 'event',
|
||||
};
|
||||
}
|
||||
static types() {
|
||||
return {
|
||||
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
statusCode: 'number',
|
||||
event: $dara.SSEEvent,
|
||||
};
|
||||
}
|
||||
validate() {
|
||||
if (this.headers) {
|
||||
$dara.Model.validateMap(this.headers);
|
||||
}
|
||||
$dara.Model.validateRequired("headers", this.headers);
|
||||
$dara.Model.validateRequired("statusCode", this.statusCode);
|
||||
$dara.Model.validateRequired("event", this.event);
|
||||
super.validate();
|
||||
}
|
||||
}
|
||||
exports.SSEResponse = SSEResponse;
|
||||
//# sourceMappingURL=Sseresponse.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/models/Sseresponse.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Sseresponse.js","sourceRoot":"","sources":["../../src/models/Sseresponse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA6C;AAC7C,6DAA+C;AAG/C;;;GAGG;AACH,MAAa,WAAY,SAAQ,KAAK,CAAC,KAAK;IAkC1C,YAAY,GAA4B;QACtC,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;IA5BD,MAAM,CAAC,KAAK;QACV,OAAO;YACL,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,YAAY;YACxB,KAAK,EAAE,OAAO;SACf,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,KAAK;QACV,OAAO;YACL,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;YACtE,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,KAAK,CAAC,QAAQ;SACtB,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,IAAG,IAAI,CAAC,OAAO,EAAE;YACf,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;SACvC;QACD,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtD,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC5D,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAClD,KAAK,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC;CAKF;AArCD,kCAqCC"}
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/models/model.d.ts
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/models/model.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { SSEResponse } from './Sseresponse';
|
||||
5
backend/node_modules/@alicloud/openapi-core/dist/models/model.js
generated
vendored
Normal file
5
backend/node_modules/@alicloud/openapi-core/dist/models/model.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Sseresponse_1 = require("./Sseresponse");
|
||||
Object.defineProperty(exports, "SSEResponse", { enumerable: true, get: function () { return Sseresponse_1.SSEResponse; } });
|
||||
//# sourceMappingURL=model.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/models/model.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/models/model.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/models/model.ts"],"names":[],"mappings":";;AAAA,6CAA4C;AAAnC,0GAAA,WAAW,OAAA"}
|
||||
446
backend/node_modules/@alicloud/openapi-core/dist/utils.d.ts
generated
vendored
Normal file
446
backend/node_modules/@alicloud/openapi-core/dist/utils.d.ts
generated
vendored
Normal file
@@ -0,0 +1,446 @@
|
||||
/// <reference types="node" />
|
||||
/**
|
||||
* This is for OpenApi Util
|
||||
*/
|
||||
import * as $tea from '@alicloud/tea-typescript';
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
import Credential from '@alicloud/credentials';
|
||||
import { Readable } from 'stream';
|
||||
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
|
||||
*/
|
||||
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;
|
||||
tlsMinVersion?: string;
|
||||
/**
|
||||
* @remarks
|
||||
* retry options
|
||||
*/
|
||||
retryOptions?: $dara.RetryOptions;
|
||||
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 {
|
||||
/**
|
||||
* Convert all params of body other than type of readable into content
|
||||
* @param body source Model
|
||||
* @param content target Model
|
||||
* @return void
|
||||
*/
|
||||
static convert(input: $tea.Model, output: $tea.Model): void;
|
||||
/**
|
||||
* If endpointType is internal, use internal endpoint
|
||||
* If serverUse is true and endpointType is accelerate, use accelerate endpoint
|
||||
* Default return endpoint
|
||||
* @param serverUse whether use accelerate endpoint
|
||||
* @param endpointType value must be internal or accelerate
|
||||
* @return the final endpoint
|
||||
*/
|
||||
static getEndpoint(endpoint: string, serverUse: boolean, endpointType: string): string;
|
||||
/**
|
||||
* Get throttling param
|
||||
* @param the response headers
|
||||
* @return time left
|
||||
*/
|
||||
static getThrottlingTimeLeft(headers: {
|
||||
[key: string]: string;
|
||||
}): number;
|
||||
/**
|
||||
* Hash the raw data with signatureAlgorithm
|
||||
* @param raw hashing data
|
||||
* @param signatureAlgorithm the autograph method
|
||||
* @return hashed bytes
|
||||
*/
|
||||
static hash(raw: Buffer, signatureAlgorithm: string): Buffer;
|
||||
/**
|
||||
* Generate a nonce string
|
||||
* @return the nonce string
|
||||
*/
|
||||
static getNonce(): string;
|
||||
/**
|
||||
* Get the string to be signed according to request
|
||||
* @param request which contains signed messages
|
||||
* @return the signed string
|
||||
*/
|
||||
static getStringToSign(request: $tea.Request): string;
|
||||
/**
|
||||
* Get signature according to stringToSign, secret
|
||||
* @param stringToSign the signed string
|
||||
* @param secret accesskey secret
|
||||
* @return the signature
|
||||
*/
|
||||
static getROASignature(stringToSign: string, secret: string): string;
|
||||
/**
|
||||
* Parse filter into a form string
|
||||
* @param filter object
|
||||
* @return the string
|
||||
*/
|
||||
static toForm(filter: {
|
||||
[key: string]: any;
|
||||
}): string;
|
||||
/**
|
||||
* Get timestamp
|
||||
* @return the timestamp string
|
||||
*/
|
||||
static getTimestamp(): string;
|
||||
/**
|
||||
* Get UTC string
|
||||
* @return the UTC string
|
||||
*/
|
||||
static getDateUTCString(): string;
|
||||
/**
|
||||
* Parse filter into a object which's type is map[string]string
|
||||
* @param filter query param
|
||||
* @return the object
|
||||
*/
|
||||
static query(filter: {
|
||||
[key: string]: any;
|
||||
}): {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Get signature according to signedParams, method and secret
|
||||
* @param signedParams params which need to be signed
|
||||
* @param method http method e.g. GET
|
||||
* @param secret AccessKeySecret
|
||||
* @return the signature
|
||||
*/
|
||||
static getRPCSignature(signedParams: {
|
||||
[key: string]: string;
|
||||
}, method: string, secret: string): string;
|
||||
/**
|
||||
* Parse array into a string with specified style
|
||||
* @param array the array
|
||||
* @param prefix the prefix string
|
||||
* @style specified style e.g. repeatList
|
||||
* @return the string
|
||||
*/
|
||||
static arrayToStringWithSpecifiedStyle(array: any, prefix: string, style: string): string;
|
||||
static stringifyMapValue(m: {
|
||||
[key: string]: any;
|
||||
}): {
|
||||
[key: string]: string;
|
||||
};
|
||||
static toArray(input: any): {
|
||||
[key: string]: any;
|
||||
}[];
|
||||
static getEndpointRules(product: string, regionId: string, endpointType: string, network: string, suffix: string): string;
|
||||
/**
|
||||
* Transform input as map.
|
||||
*/
|
||||
static parseToMap(input: any): {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Get the authorization
|
||||
* @param request request params
|
||||
* @param signatureAlgorithm the autograph method
|
||||
* @param payload the hashed request
|
||||
* @param accessKey the accessKey string
|
||||
* @param accessKeySecret the accessKeySecret string
|
||||
* @return authorization string
|
||||
*/
|
||||
static getAuthorization(request: $tea.Request, signatureAlgorithm: string, payload: string, accessKey: string, accessKeySecret: string): string;
|
||||
static getUserAgent(userAgent: string): string;
|
||||
static signatureMethod(secret: string, source: string, signatureAlgorithm: string): Buffer;
|
||||
/**
|
||||
* Transform a map to a flat style map where keys are prefixed with length info.
|
||||
* Map keys are transformed from "key" to "#length#key" format.
|
||||
* @param input the input object (can be an object, array, or primitive type)
|
||||
* @return the transformed object
|
||||
*/
|
||||
static mapToFlatStyle(input: any): any;
|
||||
}
|
||||
818
backend/node_modules/@alicloud/openapi-core/dist/utils.js
generated
vendored
Normal file
818
backend/node_modules/@alicloud/openapi-core/dist/utils.js
generated
vendored
Normal file
@@ -0,0 +1,818 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Params = exports.OpenApiRequest = exports.Config = exports.GlobalParameters = void 0;
|
||||
// This file is auto-generated, don't edit it
|
||||
/**
|
||||
* This is for OpenApi Util
|
||||
*/
|
||||
const $tea = __importStar(require("@alicloud/tea-typescript"));
|
||||
const $dara = __importStar(require("@darabonba/typescript"));
|
||||
const credentials_1 = __importDefault(require("@alicloud/credentials"));
|
||||
const querystring_1 = __importDefault(require("querystring"));
|
||||
const crypto_1 = __importDefault(require("crypto"));
|
||||
const os_1 = __importDefault(require("os"));
|
||||
const PEM_BEGIN = "-----BEGIN PRIVATE KEY-----\n";
|
||||
const PEM_END = "\n-----END PRIVATE KEY-----";
|
||||
const DEFAULT_USER_AGENT = `AlibabaCloud (${os_1.default.platform()}; ${os_1.default.arch()}) Node.js/${process.version} Core/1.0.1 TeaDSL/2`;
|
||||
class GlobalParameters extends $tea.Model {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
}
|
||||
static names() {
|
||||
return {
|
||||
headers: 'headers',
|
||||
queries: 'queries',
|
||||
};
|
||||
}
|
||||
static types() {
|
||||
return {
|
||||
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
queries: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.GlobalParameters = GlobalParameters;
|
||||
/**
|
||||
* @remarks
|
||||
* Model for initing client
|
||||
*/
|
||||
class Config extends $tea.Model {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
}
|
||||
static names() {
|
||||
return {
|
||||
accessKeyId: 'accessKeyId',
|
||||
accessKeySecret: 'accessKeySecret',
|
||||
securityToken: 'securityToken',
|
||||
bearerToken: 'bearerToken',
|
||||
protocol: 'protocol',
|
||||
method: 'method',
|
||||
regionId: 'regionId',
|
||||
readTimeout: 'readTimeout',
|
||||
connectTimeout: 'connectTimeout',
|
||||
httpProxy: 'httpProxy',
|
||||
httpsProxy: 'httpsProxy',
|
||||
credential: 'credential',
|
||||
endpoint: 'endpoint',
|
||||
noProxy: 'noProxy',
|
||||
maxIdleConns: 'maxIdleConns',
|
||||
network: 'network',
|
||||
userAgent: 'userAgent',
|
||||
suffix: 'suffix',
|
||||
socks5Proxy: 'socks5Proxy',
|
||||
socks5NetWork: 'socks5NetWork',
|
||||
endpointType: 'endpointType',
|
||||
openPlatformEndpoint: 'openPlatformEndpoint',
|
||||
type: 'type',
|
||||
signatureVersion: 'signatureVersion',
|
||||
signatureAlgorithm: 'signatureAlgorithm',
|
||||
globalParameters: 'globalParameters',
|
||||
key: 'key',
|
||||
cert: 'cert',
|
||||
ca: 'ca',
|
||||
disableHttp2: 'disableHttp2',
|
||||
tlsMinVersion: 'tlsMinVersion',
|
||||
retryOptions: 'retryOptions',
|
||||
};
|
||||
}
|
||||
static types() {
|
||||
return {
|
||||
accessKeyId: 'string',
|
||||
accessKeySecret: 'string',
|
||||
securityToken: 'string',
|
||||
bearerToken: 'string',
|
||||
protocol: 'string',
|
||||
method: 'string',
|
||||
regionId: 'string',
|
||||
readTimeout: 'number',
|
||||
connectTimeout: 'number',
|
||||
httpProxy: 'string',
|
||||
httpsProxy: 'string',
|
||||
credential: credentials_1.default,
|
||||
endpoint: 'string',
|
||||
noProxy: 'string',
|
||||
maxIdleConns: 'number',
|
||||
network: 'string',
|
||||
userAgent: 'string',
|
||||
suffix: 'string',
|
||||
socks5Proxy: 'string',
|
||||
socks5NetWork: 'string',
|
||||
endpointType: 'string',
|
||||
openPlatformEndpoint: 'string',
|
||||
type: 'string',
|
||||
signatureVersion: 'string',
|
||||
signatureAlgorithm: 'string',
|
||||
globalParameters: GlobalParameters,
|
||||
key: 'string',
|
||||
cert: 'string',
|
||||
ca: 'string',
|
||||
disableHttp2: 'boolean',
|
||||
tlsMinVersion: 'string',
|
||||
retryOptions: $dara.RetryOptions,
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.Config = Config;
|
||||
class OpenApiRequest extends $tea.Model {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
}
|
||||
static names() {
|
||||
return {
|
||||
headers: 'headers',
|
||||
query: 'query',
|
||||
body: 'body',
|
||||
stream: 'stream',
|
||||
hostMap: 'hostMap',
|
||||
endpointOverride: 'endpointOverride',
|
||||
};
|
||||
}
|
||||
static types() {
|
||||
return {
|
||||
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
query: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
body: 'any',
|
||||
stream: 'Readable',
|
||||
hostMap: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
endpointOverride: 'string',
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.OpenApiRequest = OpenApiRequest;
|
||||
class Params extends $tea.Model {
|
||||
constructor(map) {
|
||||
super(map);
|
||||
}
|
||||
static names() {
|
||||
return {
|
||||
action: 'action',
|
||||
version: 'version',
|
||||
protocol: 'protocol',
|
||||
pathname: 'pathname',
|
||||
method: 'method',
|
||||
authType: 'authType',
|
||||
bodyType: 'bodyType',
|
||||
reqBodyType: 'reqBodyType',
|
||||
style: 'style',
|
||||
};
|
||||
}
|
||||
static types() {
|
||||
return {
|
||||
action: 'string',
|
||||
version: 'string',
|
||||
protocol: 'string',
|
||||
pathname: 'string',
|
||||
method: 'string',
|
||||
authType: 'string',
|
||||
bodyType: 'string',
|
||||
reqBodyType: 'string',
|
||||
style: 'string',
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.Params = Params;
|
||||
function replaceRepeatList(target, repeat, prefix) {
|
||||
if (prefix) {
|
||||
prefix = prefix + '.';
|
||||
}
|
||||
for (var i = 0; i < repeat.length; i++) {
|
||||
var item = repeat[i];
|
||||
let key = prefix + (i + 1);
|
||||
if (typeof item === 'undefined' || item == null) {
|
||||
continue;
|
||||
}
|
||||
if (Array.isArray(item)) {
|
||||
replaceRepeatList(target, item, key);
|
||||
}
|
||||
else if (item instanceof Object) {
|
||||
flatMap(target, item, key);
|
||||
}
|
||||
else {
|
||||
target[key] = item.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
function flatMap(target, params, prefix = '') {
|
||||
if (prefix) {
|
||||
prefix = prefix + '.';
|
||||
}
|
||||
params = toMap(params);
|
||||
let keys = Object.keys(params);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let key = keys[i];
|
||||
let value = params[key];
|
||||
key = prefix + key;
|
||||
if (typeof value === 'undefined' || value == null) {
|
||||
continue;
|
||||
}
|
||||
if (Array.isArray(value)) {
|
||||
replaceRepeatList(target, value, key);
|
||||
}
|
||||
else if (value instanceof Object) {
|
||||
flatMap(target, value, key);
|
||||
}
|
||||
else {
|
||||
target[key] = value.toString();
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
function filter(value) {
|
||||
return value.replace(/[\t\n\r\f]/g, ' ');
|
||||
}
|
||||
function getCanonicalizedHeaders(headers) {
|
||||
const prefix = 'x-acs-';
|
||||
const keys = Object.keys(headers);
|
||||
const canonicalizedKeys = [];
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
if (key.startsWith(prefix)) {
|
||||
canonicalizedKeys.push(key);
|
||||
}
|
||||
}
|
||||
canonicalizedKeys.sort();
|
||||
var result = '';
|
||||
for (let i = 0; i < canonicalizedKeys.length; i++) {
|
||||
const key = canonicalizedKeys[i];
|
||||
result += `${key}:${filter(headers[key]).trim()}\n`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function getCanonicalizedResource(uriPattern, query) {
|
||||
const keys = !query ? [] : Object.keys(query).sort();
|
||||
if (keys.length === 0) {
|
||||
return uriPattern;
|
||||
}
|
||||
var result = [];
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
result.push(`${key}=${query[key]}`);
|
||||
}
|
||||
return `${uriPattern}?${result.join('&')}`;
|
||||
}
|
||||
function getAuthorizationQueryString(query) {
|
||||
let canonicalQueryArray = [];
|
||||
const keys = !query ? [] : Object.keys(query).sort();
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
let param = key + '=';
|
||||
if (typeof query[key] !== 'undefined' && query[key] !== null) {
|
||||
param = param + encode(query[key]);
|
||||
}
|
||||
canonicalQueryArray.push(param);
|
||||
}
|
||||
return canonicalQueryArray.join('&');
|
||||
}
|
||||
function getAuthorizationHeaders(header) {
|
||||
let canonicalheaders = "";
|
||||
let tmp = {};
|
||||
const keys = !header ? [] : Object.keys(header);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
const lowerKey = keys[i].toLowerCase();
|
||||
if (lowerKey.startsWith("x-acs-") || lowerKey === "host" || lowerKey === "content-type") {
|
||||
if (tmp[lowerKey]) {
|
||||
tmp[lowerKey].push((header[key] || "").trim());
|
||||
}
|
||||
else {
|
||||
tmp[lowerKey] = [(header[key] || "").trim()];
|
||||
}
|
||||
}
|
||||
}
|
||||
var hsKeys = Object.keys(tmp).sort();
|
||||
for (let i = 0; i < hsKeys.length; i++) {
|
||||
const hsKey = hsKeys[i];
|
||||
let listSort = tmp[hsKey].sort();
|
||||
canonicalheaders += `${hsKey}:${listSort.join(",")}\n`;
|
||||
}
|
||||
return { canonicalheaders, hsKeys };
|
||||
}
|
||||
function encode(str) {
|
||||
var result = encodeURIComponent(str);
|
||||
return result.replace(/!/g, '%21')
|
||||
.replace(/'/g, '%27')
|
||||
.replace(/\(/g, '%28')
|
||||
.replace(/\)/g, '%29')
|
||||
.replace(/\*/g, '%2A');
|
||||
}
|
||||
function normalize(params) {
|
||||
var list = [];
|
||||
var flated = {};
|
||||
flatMap(flated, params);
|
||||
var keys = Object.keys(flated).sort();
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var value = flated[key];
|
||||
list.push([encode(key), encode(value)]);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
function canonicalize(normalized) {
|
||||
var fields = [];
|
||||
for (var i = 0; i < normalized.length; i++) {
|
||||
var [key, value] = normalized[i];
|
||||
fields.push(key + '=' + value);
|
||||
}
|
||||
return fields.join('&');
|
||||
}
|
||||
function isModelClass(t) {
|
||||
if (!t) {
|
||||
return false;
|
||||
}
|
||||
return typeof t.types === 'function' && typeof t.names === 'function';
|
||||
}
|
||||
function isObjectOrArray(t) {
|
||||
return Array.isArray(t) || (t instanceof Object && typeof t !== 'function');
|
||||
}
|
||||
function getTimeLeft(rateLimit) {
|
||||
if (rateLimit) {
|
||||
const pairs = rateLimit.split(',');
|
||||
for (const pair of pairs) {
|
||||
const kv = pair.split(':');
|
||||
if (kv.length === 2) {
|
||||
const key = kv[0].trim();
|
||||
const value = kv[1].trim();
|
||||
if (key === 'TimeLeft') {
|
||||
const timeLeftValue = parseInt(value, 10);
|
||||
if (isNaN(timeLeftValue)) {
|
||||
return null;
|
||||
}
|
||||
return timeLeftValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function toMap(input) {
|
||||
if (!isObjectOrArray(input)) {
|
||||
return null;
|
||||
}
|
||||
else if (input instanceof $tea.Model) {
|
||||
return $tea.toMap(input);
|
||||
}
|
||||
else if (input && input.toMap && typeof input.toMap === 'function') {
|
||||
// 解决跨版本 Model 不互认的问题
|
||||
return input.toMap();
|
||||
}
|
||||
else if (Array.isArray(input)) {
|
||||
const result = [];
|
||||
input.forEach((value) => {
|
||||
if (isObjectOrArray(value)) {
|
||||
result.push(toMap(value));
|
||||
}
|
||||
else {
|
||||
result.push(value);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
else if (input instanceof Object) {
|
||||
const result = {};
|
||||
Object.entries(input).forEach(([key, value]) => {
|
||||
if (isObjectOrArray(value)) {
|
||||
result[key] = toMap(value);
|
||||
}
|
||||
else {
|
||||
result[key] = value;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
class Client {
|
||||
/**
|
||||
* Convert all params of body other than type of readable into content
|
||||
* @param body source Model
|
||||
* @param content target Model
|
||||
* @return void
|
||||
*/
|
||||
static convert(input, output) {
|
||||
if (!output) {
|
||||
return;
|
||||
}
|
||||
let inputModel = Object.assign({}, input);
|
||||
let constructor = output.constructor;
|
||||
let types = constructor.types();
|
||||
// let constructor = <any>output.constructor;
|
||||
for (let key of Object.keys(constructor.names())) {
|
||||
if (inputModel[key] !== null && inputModel[key] !== undefined) {
|
||||
if (isModelClass(types[key])) {
|
||||
output[key] = new types[key](output[key]);
|
||||
Client.convert(inputModel[key], output[key]);
|
||||
}
|
||||
else if (types[key] && types[key].type === 'array') {
|
||||
output[key] = inputModel[key].map(function (d) {
|
||||
if (isModelClass(types[key].itemType)) {
|
||||
var item = new types[key].itemType({});
|
||||
Client.convert(d, item);
|
||||
return item;
|
||||
}
|
||||
return d;
|
||||
});
|
||||
}
|
||||
else if (types[key] && types[key].type === 'map') {
|
||||
output[key] = {};
|
||||
Object.keys(inputModel[key]).map(function (d) {
|
||||
if (isModelClass(types[key].valueType)) {
|
||||
var item = new types[key].valueType({});
|
||||
Client.convert(inputModel[key][d], item);
|
||||
output[key][d] = item;
|
||||
}
|
||||
else {
|
||||
output[key][d] = inputModel[key][d];
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
output[key] = inputModel[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If endpointType is internal, use internal endpoint
|
||||
* If serverUse is true and endpointType is accelerate, use accelerate endpoint
|
||||
* Default return endpoint
|
||||
* @param serverUse whether use accelerate endpoint
|
||||
* @param endpointType value must be internal or accelerate
|
||||
* @return the final endpoint
|
||||
*/
|
||||
static getEndpoint(endpoint, serverUse, endpointType) {
|
||||
if (endpointType == "internal") {
|
||||
let strs = endpoint.split(".");
|
||||
strs[0] += "-internal";
|
||||
endpoint = strs.join(".");
|
||||
}
|
||||
if (serverUse && endpointType == "accelerate") {
|
||||
return "oss-accelerate.aliyuncs.com";
|
||||
}
|
||||
return endpoint;
|
||||
}
|
||||
/**
|
||||
* Get throttling param
|
||||
* @param the response headers
|
||||
* @return time left
|
||||
*/
|
||||
static getThrottlingTimeLeft(headers) {
|
||||
const rateLimitForUserApi = headers["x-ratelimit-user-api"];
|
||||
const rateLimitForUser = headers["x-ratelimit-user"];
|
||||
const timeLeftForUserApi = getTimeLeft(rateLimitForUserApi);
|
||||
const timeLeftForUser = getTimeLeft(rateLimitForUser);
|
||||
if (timeLeftForUserApi > timeLeftForUser) {
|
||||
return timeLeftForUserApi;
|
||||
}
|
||||
else {
|
||||
return timeLeftForUser;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Hash the raw data with signatureAlgorithm
|
||||
* @param raw hashing data
|
||||
* @param signatureAlgorithm the autograph method
|
||||
* @return hashed bytes
|
||||
*/
|
||||
static hash(raw, signatureAlgorithm) {
|
||||
if (signatureAlgorithm === "ACS3-HMAC-SHA256" || signatureAlgorithm === "ACS3-RSA-SHA256") {
|
||||
const obj = crypto_1.default.createHash('sha256');
|
||||
obj.update(raw);
|
||||
return obj.digest();
|
||||
}
|
||||
else if (signatureAlgorithm == "ACS3-HMAC-SM3") {
|
||||
const obj = crypto_1.default.createHash('sm3');
|
||||
obj.update(raw);
|
||||
return obj.digest();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Generate a nonce string
|
||||
* @return the nonce string
|
||||
*/
|
||||
static getNonce() {
|
||||
let counter = 0;
|
||||
let last;
|
||||
const machine = os_1.default.hostname();
|
||||
const pid = process.pid;
|
||||
var val = Math.floor(Math.random() * 1000000000000);
|
||||
if (val === last) {
|
||||
counter++;
|
||||
}
|
||||
else {
|
||||
counter = 0;
|
||||
}
|
||||
last = val;
|
||||
var uid = `${machine}${pid}${val}${counter}`;
|
||||
var shasum = crypto_1.default.createHash('md5');
|
||||
shasum.update(uid);
|
||||
return shasum.digest('hex');
|
||||
}
|
||||
/**
|
||||
* Get the string to be signed according to request
|
||||
* @param request which contains signed messages
|
||||
* @return the signed string
|
||||
*/
|
||||
static getStringToSign(request) {
|
||||
const method = request.method;
|
||||
const accept = request.headers['accept'];
|
||||
const contentMD5 = request.headers['content-md5'] || '';
|
||||
const contentType = request.headers['content-type'] || '';
|
||||
const date = request.headers['date'] || '';
|
||||
const header = `${method}
|
||||
${accept}
|
||||
${contentMD5}
|
||||
${contentType}
|
||||
${date}
|
||||
`;
|
||||
const canonicalizedHeaders = getCanonicalizedHeaders(request.headers);
|
||||
const canonicalizedResource = getCanonicalizedResource(request.pathname, request.query);
|
||||
return `${header}${canonicalizedHeaders}${canonicalizedResource}`;
|
||||
}
|
||||
/**
|
||||
* Get signature according to stringToSign, secret
|
||||
* @param stringToSign the signed string
|
||||
* @param secret accesskey secret
|
||||
* @return the signature
|
||||
*/
|
||||
static getROASignature(stringToSign, secret) {
|
||||
const utf8Buff = Buffer.from(stringToSign, 'utf8');
|
||||
return crypto_1.default.createHmac('sha1', secret).update(utf8Buff).digest('base64');
|
||||
}
|
||||
/**
|
||||
* Parse filter into a form string
|
||||
* @param filter object
|
||||
* @return the string
|
||||
*/
|
||||
static toForm(filter) {
|
||||
if (!filter) {
|
||||
return '';
|
||||
}
|
||||
let target = {};
|
||||
flatMap(target, filter);
|
||||
return $dara.Form.toFormString(target);
|
||||
}
|
||||
/**
|
||||
* Get timestamp
|
||||
* @return the timestamp string
|
||||
*/
|
||||
static getTimestamp() {
|
||||
let date = new Date();
|
||||
let YYYY = date.getUTCFullYear();
|
||||
let MM = `${date.getUTCMonth() + 1}`.padStart(2, '0');
|
||||
let DD = `${date.getUTCDate()}`.padStart(2, '0');
|
||||
let HH = `${date.getUTCHours()}`.padStart(2, '0');
|
||||
let mm = `${date.getUTCMinutes()}`.padStart(2, '0');
|
||||
let ss = `${date.getUTCSeconds()}`.padStart(2, '0');
|
||||
return `${YYYY}-${MM}-${DD}T${HH}:${mm}:${ss}Z`;
|
||||
}
|
||||
/**
|
||||
* Get UTC string
|
||||
* @return the UTC string
|
||||
*/
|
||||
static getDateUTCString() {
|
||||
const now = new Date();
|
||||
return now.toUTCString();
|
||||
}
|
||||
/**
|
||||
* Parse filter into a object which's type is map[string]string
|
||||
* @param filter query param
|
||||
* @return the object
|
||||
*/
|
||||
static query(filter) {
|
||||
if (!filter) {
|
||||
return {};
|
||||
}
|
||||
let ret = {};
|
||||
flatMap(ret, filter);
|
||||
return ret;
|
||||
}
|
||||
/**
|
||||
* Get signature according to signedParams, method and secret
|
||||
* @param signedParams params which need to be signed
|
||||
* @param method http method e.g. GET
|
||||
* @param secret AccessKeySecret
|
||||
* @return the signature
|
||||
*/
|
||||
static getRPCSignature(signedParams, method, secret) {
|
||||
var normalized = normalize(signedParams);
|
||||
var canonicalized = canonicalize(normalized);
|
||||
var stringToSign = `${method}&${encode('/')}&${encode(canonicalized)}`;
|
||||
const key = secret + '&';
|
||||
return crypto_1.default.createHmac('sha1', key).update(stringToSign).digest('base64');
|
||||
}
|
||||
/**
|
||||
* Parse array into a string with specified style
|
||||
* @param array the array
|
||||
* @param prefix the prefix string
|
||||
* @style specified style e.g. repeatList
|
||||
* @return the string
|
||||
*/
|
||||
static arrayToStringWithSpecifiedStyle(array, prefix, style) {
|
||||
if (!array) {
|
||||
return '';
|
||||
}
|
||||
if (style === 'repeatList') {
|
||||
let target = {};
|
||||
replaceRepeatList(target, array, prefix);
|
||||
return querystring_1.default.stringify(target, '&&');
|
||||
}
|
||||
else if (style === 'json') {
|
||||
return JSON.stringify(toMap(array));
|
||||
}
|
||||
else if (style === 'simple') {
|
||||
return array.join(',');
|
||||
}
|
||||
else if (style === 'spaceDelimited') {
|
||||
return array.join(' ');
|
||||
}
|
||||
else if (style === 'pipeDelimited') {
|
||||
return array.join('|');
|
||||
}
|
||||
else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
static stringifyMapValue(m) {
|
||||
if (!m) {
|
||||
return m;
|
||||
}
|
||||
const result = {};
|
||||
for (const [key, value] of Object.entries(m)) {
|
||||
if (typeof value === 'undefined' || value === null) {
|
||||
continue;
|
||||
}
|
||||
result[key] = String(value);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
static toArray(input) {
|
||||
if (!(input instanceof Array)) {
|
||||
return null;
|
||||
}
|
||||
let ret = [];
|
||||
input.forEach((model) => {
|
||||
if (!model) {
|
||||
return;
|
||||
}
|
||||
ret.push($tea.toMap(model));
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
static getEndpointRules(product, regionId, endpointType, network, suffix) {
|
||||
let result;
|
||||
if (network && network.length && network != "public") {
|
||||
network = "-" + network;
|
||||
}
|
||||
else {
|
||||
network = "";
|
||||
}
|
||||
suffix = suffix || "";
|
||||
if (suffix.length) {
|
||||
suffix = "-" + suffix;
|
||||
}
|
||||
if (endpointType == "regional") {
|
||||
if (!regionId || !regionId.length) {
|
||||
throw new Error("RegionId is empty, please set a valid RegionId");
|
||||
}
|
||||
result = `${product}${suffix}${network}.${regionId}.aliyuncs.com`;
|
||||
}
|
||||
else {
|
||||
result = `${product}${suffix}${network}.aliyuncs.com`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Transform input as map.
|
||||
*/
|
||||
static parseToMap(input) {
|
||||
return toMap(input);
|
||||
}
|
||||
/**
|
||||
* Get the authorization
|
||||
* @param request request params
|
||||
* @param signatureAlgorithm the autograph method
|
||||
* @param payload the hashed request
|
||||
* @param accessKey the accessKey string
|
||||
* @param accessKeySecret the accessKeySecret string
|
||||
* @return authorization string
|
||||
*/
|
||||
static getAuthorization(request, signatureAlgorithm, payload, accessKey, accessKeySecret) {
|
||||
const canonicalURI = (request.pathname || "").replace("+", "%20").replace("*", "%2A").replace("%7E", "~");
|
||||
const method = request.method;
|
||||
const canonicalQueryString = getAuthorizationQueryString(request.query);
|
||||
const tuple = getAuthorizationHeaders(request.headers);
|
||||
const canonicalheaders = tuple["canonicalheaders"];
|
||||
const signedHeaders = tuple["hsKeys"];
|
||||
const canonicalRequest = method + "\n" + canonicalURI + "\n" + canonicalQueryString + "\n" + canonicalheaders + "\n" +
|
||||
signedHeaders.join(";") + "\n" + payload;
|
||||
let raw = Buffer.from(canonicalRequest);
|
||||
const stringToSign = signatureAlgorithm + "\n" + Client.hash(raw, signatureAlgorithm).toString("hex");
|
||||
const signature = Client.signatureMethod(accessKeySecret, stringToSign, signatureAlgorithm).toString("hex");
|
||||
const auth = `${signatureAlgorithm} Credential=${accessKey},SignedHeaders=${signedHeaders.join(';')},Signature=${signature}`;
|
||||
return auth;
|
||||
}
|
||||
static getUserAgent(userAgent) {
|
||||
if (!userAgent || !userAgent.length) {
|
||||
return DEFAULT_USER_AGENT;
|
||||
}
|
||||
return DEFAULT_USER_AGENT + " " + userAgent;
|
||||
}
|
||||
static signatureMethod(secret, source, signatureAlgorithm) {
|
||||
if (signatureAlgorithm === "ACS3-HMAC-SHA256") {
|
||||
const obj = crypto_1.default.createHmac('sha256', secret);
|
||||
obj.update(source);
|
||||
return obj.digest();
|
||||
}
|
||||
else if (signatureAlgorithm === "ACS3-HMAC-SM3") {
|
||||
const obj = crypto_1.default.createHmac('sm3', secret);
|
||||
obj.update(source);
|
||||
return obj.digest();
|
||||
}
|
||||
else if (signatureAlgorithm === "ACS3-RSA-SHA256") {
|
||||
if (!secret.startsWith(PEM_BEGIN)) {
|
||||
secret = PEM_BEGIN + secret;
|
||||
}
|
||||
if (!secret.endsWith(PEM_END)) {
|
||||
secret = secret + PEM_END;
|
||||
}
|
||||
var signerObject = crypto_1.default.createSign("RSA-SHA256");
|
||||
signerObject.update(source);
|
||||
var signature = signerObject.sign({ key: secret, padding: crypto_1.default.constants.RSA_PKCS1_PADDING });
|
||||
return signature;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Transform a map to a flat style map where keys are prefixed with length info.
|
||||
* Map keys are transformed from "key" to "#length#key" format.
|
||||
* @param input the input object (can be an object, array, or primitive type)
|
||||
* @return the transformed object
|
||||
*/
|
||||
static mapToFlatStyle(input) {
|
||||
if (input === null || input === undefined) {
|
||||
return input;
|
||||
}
|
||||
// Handle array
|
||||
if (Array.isArray(input)) {
|
||||
const result = [];
|
||||
for (const item of input) {
|
||||
result.push(Client.mapToFlatStyle(item));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
// Handle $tea.Model
|
||||
if (input instanceof $tea.Model) {
|
||||
// Modify the original Model object's fields
|
||||
for (const [key, value] of Object.entries(input)) {
|
||||
if (value !== null && value !== undefined && typeof value === 'object' && !Array.isArray(value) && !(value instanceof $tea.Model)) {
|
||||
// This is a plain object (dictionary), apply flat style to keys
|
||||
const flatMap = {};
|
||||
for (const [nestedKey, nestedValue] of Object.entries(value)) {
|
||||
const flatKey = `#${nestedKey.length}#${nestedKey}`;
|
||||
flatMap[flatKey] = Client.mapToFlatStyle(nestedValue);
|
||||
}
|
||||
input[key] = flatMap;
|
||||
}
|
||||
else {
|
||||
// Recursively process other fields
|
||||
input[key] = Client.mapToFlatStyle(value);
|
||||
}
|
||||
}
|
||||
return input; // Return the modified original Model
|
||||
}
|
||||
// Handle plain object
|
||||
if (typeof input === 'object' && !Array.isArray(input)) {
|
||||
const flatMap = {};
|
||||
for (const [key, value] of Object.entries(input)) {
|
||||
const flatKey = `#${key.length}#${key}`;
|
||||
flatMap[flatKey] = Client.mapToFlatStyle(value);
|
||||
}
|
||||
return flatMap;
|
||||
}
|
||||
// For primitive types, return as-is
|
||||
return input;
|
||||
}
|
||||
}
|
||||
exports.default = Client;
|
||||
//# sourceMappingURL=utils.js.map
|
||||
1
backend/node_modules/@alicloud/openapi-core/dist/utils.js.map
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/dist/utils.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
37
backend/node_modules/@alicloud/openapi-core/package.json
generated
vendored
Normal file
37
backend/node_modules/@alicloud/openapi-core/package.json
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "@alicloud/openapi-core",
|
||||
"version": "1.0.7",
|
||||
"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",
|
||||
"select-version": "node scripts/ts_version.js",
|
||||
"postinstall": "npm run select-version",
|
||||
"build": "tsc",
|
||||
"prepublishOnly": "tsc"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^5.2.7",
|
||||
"mocha": "^6.2.0",
|
||||
"@types/node": "^12.12.26",
|
||||
"nyc": "^14.1.1",
|
||||
"source-map-support": "^0.5.16",
|
||||
"ts-node": "^8.6.2",
|
||||
"typescript": "^3.7.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@alicloud/credentials": "^2.4.2",
|
||||
"@alicloud/gateway-pop": "0.0.6",
|
||||
"@alicloud/gateway-spi": "^0.0.8",
|
||||
"@darabonba/typescript": "^1.0.2"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"scripts",
|
||||
"src"
|
||||
],
|
||||
"repository": "git@github.com:aliyun/darabonba-openapi.git"
|
||||
}
|
||||
33
backend/node_modules/@alicloud/openapi-core/scripts/ts_version.js
generated
vendored
Normal file
33
backend/node_modules/@alicloud/openapi-core/scripts/ts_version.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const nodeVersion = process.versions.node;
|
||||
console.log(`Running with Node.js version: ${nodeVersion}`);
|
||||
|
||||
// 定义不同 Node 版本对应的 TypeScript 和 @types/node 版本
|
||||
const depsMap = {
|
||||
'10': {
|
||||
typescript: 'typescript@^3.9.7',
|
||||
nodeTypes: '@types/node@^12.0.0'
|
||||
},
|
||||
'12': {
|
||||
typescript: 'typescript@^4.1.3',
|
||||
nodeTypes: '@types/node@^12.0.0'
|
||||
}
|
||||
};
|
||||
|
||||
// 获取当前 Node major 版本
|
||||
const majorVersion = nodeVersion.split('.')[0];
|
||||
|
||||
// 选择合适的版本
|
||||
const { typescript, nodeTypes } = depsMap[majorVersion] || {};
|
||||
if(!typescript) {
|
||||
process.exit(0);
|
||||
}
|
||||
console.log(`Installing ${typescript} and ${nodeTypes}...`);
|
||||
|
||||
try {
|
||||
execSync(`npm install --no-save ${typescript} ${nodeTypes}`, { stdio: 'inherit' });
|
||||
} catch (error) {
|
||||
console.error('Error installing specific TypeScript and @types/node version:', error);
|
||||
process.exit(1);
|
||||
}
|
||||
1697
backend/node_modules/@alicloud/openapi-core/src/client.ts
generated
vendored
Normal file
1697
backend/node_modules/@alicloud/openapi-core/src/client.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
22
backend/node_modules/@alicloud/openapi-core/src/exceptions/AlibabaCloudError.ts
generated
vendored
Normal file
22
backend/node_modules/@alicloud/openapi-core/src/exceptions/AlibabaCloudError.ts
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// This file is auto-generated, don't edit it
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
|
||||
|
||||
export class AlibabaCloudError extends $dara.ResponseError {
|
||||
statusCode?: number;
|
||||
code: string;
|
||||
message: string;
|
||||
description?: string;
|
||||
requestId?: string;
|
||||
|
||||
constructor(map?: { [key: string]: any }) {
|
||||
super(map);
|
||||
this.name = "AlibabaCloudError";
|
||||
Object.setPrototypeOf(this, AlibabaCloudError.prototype);
|
||||
this.statusCode = map.statusCode;
|
||||
this.code = map.code;
|
||||
this.description = map.description;
|
||||
this.requestId = map.requestId;
|
||||
}
|
||||
}
|
||||
|
||||
16
backend/node_modules/@alicloud/openapi-core/src/exceptions/ClientError.ts
generated
vendored
Normal file
16
backend/node_modules/@alicloud/openapi-core/src/exceptions/ClientError.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file is auto-generated, don't edit it
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
|
||||
|
||||
export class ClientError extends AlibabaCloudError {
|
||||
accessDeniedDetail?: { [key: string]: any };
|
||||
|
||||
constructor(map?: { [key: string]: any }) {
|
||||
super(map);
|
||||
this.name = "ClientError";
|
||||
Object.setPrototypeOf(this, ClientError.prototype);
|
||||
this.accessDeniedDetail = map.accessDeniedDetail;
|
||||
}
|
||||
}
|
||||
|
||||
14
backend/node_modules/@alicloud/openapi-core/src/exceptions/ServerError.ts
generated
vendored
Normal file
14
backend/node_modules/@alicloud/openapi-core/src/exceptions/ServerError.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// This file is auto-generated, don't edit it
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
|
||||
|
||||
export class ServerError extends AlibabaCloudError {
|
||||
|
||||
constructor(map?: { [key: string]: any }) {
|
||||
super(map);
|
||||
this.name = "ServerError";
|
||||
Object.setPrototypeOf(this, ServerError.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
16
backend/node_modules/@alicloud/openapi-core/src/exceptions/ThrottlingError.ts
generated
vendored
Normal file
16
backend/node_modules/@alicloud/openapi-core/src/exceptions/ThrottlingError.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// This file is auto-generated, don't edit it
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
import { AlibabaCloudError } from "./AlibabaCloudError";
|
||||
|
||||
|
||||
export class ThrottlingError extends AlibabaCloudError {
|
||||
retryAfter?: number;
|
||||
|
||||
constructor(map?: { [key: string]: any }) {
|
||||
super(map);
|
||||
this.name = "ThrottlingError";
|
||||
Object.setPrototypeOf(this, ThrottlingError.prototype);
|
||||
this.retryAfter = map.retryAfter;
|
||||
}
|
||||
}
|
||||
|
||||
4
backend/node_modules/@alicloud/openapi-core/src/exceptions/error.ts
generated
vendored
Normal file
4
backend/node_modules/@alicloud/openapi-core/src/exceptions/error.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export { AlibabaCloudError } from './AlibabaCloudError';
|
||||
export { ClientError } from './ClientError';
|
||||
export { ServerError } from './ServerError';
|
||||
export { ThrottlingError } from './ThrottlingError';
|
||||
47
backend/node_modules/@alicloud/openapi-core/src/models/Sseresponse.ts
generated
vendored
Normal file
47
backend/node_modules/@alicloud/openapi-core/src/models/Sseresponse.ts
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// This file is auto-generated, don't edit it
|
||||
import * as $dara from '@darabonba/typescript';
|
||||
|
||||
|
||||
/**
|
||||
* @remarks
|
||||
* This is for OpenApi SDK
|
||||
*/
|
||||
export class SSEResponse extends $dara.Model {
|
||||
headers: { [key: string]: string };
|
||||
/**
|
||||
* @remarks
|
||||
* HTTP Status Code
|
||||
*/
|
||||
statusCode: number;
|
||||
event: $dara.SSEEvent;
|
||||
static names(): { [key: string]: string } {
|
||||
return {
|
||||
headers: 'headers',
|
||||
statusCode: 'statusCode',
|
||||
event: 'event',
|
||||
};
|
||||
}
|
||||
|
||||
static types(): { [key: string]: any } {
|
||||
return {
|
||||
headers: { 'type': 'map', 'keyType': 'string', 'valueType': 'string' },
|
||||
statusCode: 'number',
|
||||
event: $dara.SSEEvent,
|
||||
};
|
||||
}
|
||||
|
||||
validate() {
|
||||
if(this.headers) {
|
||||
$dara.Model.validateMap(this.headers);
|
||||
}
|
||||
$dara.Model.validateRequired("headers", this.headers);
|
||||
$dara.Model.validateRequired("statusCode", this.statusCode);
|
||||
$dara.Model.validateRequired("event", this.event);
|
||||
super.validate();
|
||||
}
|
||||
|
||||
constructor(map?: { [key: string]: any }) {
|
||||
super(map);
|
||||
}
|
||||
}
|
||||
|
||||
1
backend/node_modules/@alicloud/openapi-core/src/models/model.ts
generated
vendored
Normal file
1
backend/node_modules/@alicloud/openapi-core/src/models/model.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { SSEResponse } from './Sseresponse';
|
||||
1089
backend/node_modules/@alicloud/openapi-core/src/utils.ts
generated
vendored
Normal file
1089
backend/node_modules/@alicloud/openapi-core/src/utils.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user