tencentcloud-sdk-nodejs-common

  • Version 4.0.871
  • Published
  • 114 kB
  • 8 dependencies
  • Apache-2.0 license

Install

npm i tencentcloud-sdk-nodejs-common
yarn add tencentcloud-sdk-nodejs-common
pnpm add tencentcloud-sdk-nodejs-common

Overview

Tencent Cloud API NODEJS SDK

Index

Variables

variable SUPPORT_LANGUAGE_LIST

const SUPPORT_LANGUAGE_LIST: string[];
  • ClientProfile.language 属性支持的取值列表

Classes

class AbstractClient

class AbstractClient {}

constructor

constructor(
endpoint: string,
version: string,
{ credential, region, profile }: ClientConfig
);
  • 实例化client对象

    Parameter endpoint

    接入点域名

    Parameter version

    产品版本

    Parameter credential

    认证信息实例

    Parameter region

    产品地域

    Parameter profile

    可选配置实例

property apiVersion

apiVersion: string;

    property credential

    credential: Credential | DynamicCredential;

      property endpoint

      endpoint: string;

        property path

        path: string;

          property profile

          profile: ClientProfile;

            property region

            region: string;

              property sdkVersion

              sdkVersion: string;

                method getCredential

                getCredential: () => Promise<Credential>;

                  method request

                  request: (
                  action: string,
                  req: any,
                  options?: ResponseCallback | RequestOptions,
                  cb?: ResponseCallback
                  ) => Promise<ResponseData>;

                  method requestOctetStream

                  requestOctetStream: (
                  action: string,
                  req: any,
                  options?: ResponseCallback | RequestOptions,
                  cb?: ResponseCallback
                  ) => Promise<any>;

                  class CommonClient

                  class CommonClient extends AbstractClient {}

                    Interfaces

                    interface ClientConfig

                    interface ClientConfig {}
                    • 初始化client对象参数类型

                    property credential

                    credential: Credential | DynamicCredential;
                    • Parameter credential

                      认证信息 必选

                    property profile

                    profile?: ClientProfile;
                    • Parameter profile

                      可选配置实例 可选,没有特殊需求可以跳过。

                    property region

                    region?: string;
                    • Parameter region

                      产品地域 对于要求区分地域的产品,此参数必选(如 cvm);对于不区分地域的产品(如 sms),无需传入。

                    interface ClientProfile

                    interface ClientProfile {}
                    • 可选配置实例

                    property httpProfile

                    httpProfile?: HttpProfile;
                    • http相关选项实例 {HttpProfile} 非必选

                    property language

                    language?: 'zh-CN' | 'en-US';
                    • api请求时附带的 language 字段 {"zh-CN" | "en-US"} 非必选

                    property signMethod

                    signMethod?: 'TC3-HMAC-SHA256' | 'HmacSHA256' | 'HmacSHA1';
                    • 签名方法 (TC3-HMAC-SHA256 HmacSHA1 HmacSHA256) {string} 非必选

                    interface Credential

                    interface Credential {}
                    • 认证信息类

                    property secretId

                    secretId?: string;
                    • 腾讯云账户secretId,secretKey 非必选,和 token 二选一

                    property secretKey

                    secretKey?: string;
                    • 腾讯云账户secretKey 非必选,和 token 二选一

                    property token

                    token?: string;
                    • 腾讯云账户token 非必选,和 secretId 二选一

                    interface DynamicCredential

                    interface DynamicCredential {}
                    • 动态认证信息

                    method getCredential

                    getCredential: () => Promise<Credential>;

                      interface HttpProfile

                      interface HttpProfile {}

                        property agent

                        agent?: Agent;
                        • 高级请求代理,例如 new HttpsProxyAgent("http://127.0.0.1:8899")

                          优先级高于 proxy 配置

                        property endpoint

                        endpoint?: string;
                        • 接入点域名,形如(cvm.ap-shanghai.tencentcloud.com) {string} 非必选

                        property headers

                        headers?: Record<string, string>;
                        • 自定义请求头,例如 { "X-TC-TraceId": "ffe0c072-8a5d-4e17-8887-a8a60252abca" } {Record<string, string>} 非必选

                        property protocol

                        protocol?: string;
                        • 协议,目前支持(https://) {string} 非必选

                        property proxy

                        proxy?: string;
                        • http请求代理,例如 "http://127.0.0.1:8899"

                        property reqMethod

                        reqMethod?: 'POST' | 'GET';
                        • 请求方法 {"POST" | "GET"} 非必选

                        property reqTimeout

                        reqTimeout?: number;
                        • 请求超时时间,默认60s {number} 非必选

                        interface RequestOptions

                        interface RequestOptions extends Partial<Pick<HttpProfile, 'headers'>> {}

                          property multipart

                          multipart?: boolean;

                            property signal

                            signal?: AbortSignal;
                            • 中止请求信号

                            Type Aliases

                            type ResponseCallback

                            type ResponseCallback<TReuslt = any> = (error: string, rep: TReuslt) => void;

                              Namespaces

                              namespace get-stream

                              module 'get-stream' {}

                                namespace is-stream

                                module 'is-stream' {}

                                  Package Files (5)

                                  Dependencies (8)

                                  Dev Dependencies (15)

                                  Peer Dependencies (0)

                                  No peer dependencies.

                                  Badge

                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/tencentcloud-sdk-nodejs-common.

                                  • Markdown
                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/tencentcloud-sdk-nodejs-common)
                                  • HTML
                                    <a href="https://www.jsdocs.io/package/tencentcloud-sdk-nodejs-common"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>