npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jiangzhx/tencent-ads-marketing-api-sdk

v1.7.84-port.3

Published

TypeScript SDK for Tencent Ads Marketing API.

Readme

@jiangzhx/tencent-ads-marketing-api-sdk

基于腾讯广告官方 Go SDK github.com/tencentad/marketing-api-go-sdk porting 生成的 Node.js/TypeScript SDK。

安装

npm install @jiangzhx/tencent-ads-marketing-api-sdk

本发布线对标官方 Go SDK github.com/tencentad/[email protected]

使用入口

v3 接口从 api/v3 导入,对应 Go SDK 的 pkg/api/v3

import {
  ApiClient,
  AdgroupsApi,
} from "@jiangzhx/tencent-ads-marketing-api-sdk/api/v3";

const client = new ApiClient().setAccessToken("access-token");
const api = new AdgroupsApi(client);

await api.get({
  accountId: "1234567890",
  fields: ["adgroup_id", "adgroup_name"],
});

@jiangzhx/tencent-ads-marketing-api-sdk/api/v3 对应 Go SDK pkg/api/v3 下的接口,默认请求 https://api.e.qq.com/v3.0@jiangzhx/tencent-ads-marketing-api-sdk/api 对应 Go SDK pkg/api 下的接口,按官方 Go SDK 配置请求 https://sandbox-api.e.qq.com/v1.3

Porting 来源

当前 SDK 的目标源码是官方 Go SDK:

  • Go module: github.com/tencentad/marketing-api-go-sdk
  • 当前源码版本: v1.7.84
  • API 源码: pkg/api/*.gopkg/api/v3/*.go,生成到 src/api/*.tssrc/api/v3/*.ts
  • Model 源码: pkg/model/*.gopkg/model/v3/*.go,生成到 src/model/*.tssrc/model/v3/*.ts
  • Config 源码: pkg/config/configuration.gopkg/config/v3/configuration.go,生成到 src/config/configuration.tssrc/config/v3/configuration.ts
  • 仓库源码中的生成版本记录: src/manifest.jsonsourceVersion

生成链路读取 Go SDK 源码,生成 TypeScript API、类型模型和运行时调用配置。

Porting 规则

生成器维护在内部包 packages/codegen,入口命令:

bun run codegen:tencent-ads:generate /path/to/marketing-api-go-sdk

核心映射规则:

  • Go 文件按相对目录生成到 TypeScript 文件,例如 pkg/api/v3/api_adgroups.go 生成 src/api/v3/api_adgroups.ts
  • Go 的 XxxApiService 映射为 TypeScript XxxApi class。
  • Go service method 映射为 TypeScript request object 方法,例如 Get(ctx, accountId, opts) 映射为 get({ accountId, ...opts })
  • Go required 参数和 optional.* 参数统一收口到 request object。
  • Go localVarQueryParams 映射为 queryParams
  • Go localVarPostBody 映射为 JSON request body。
  • Go localVarFormParams 和文件参数映射为 formParamsfiles,用于 multipart/form-data 上传。
  • JSON 响应使用 json-bigintstoreAsString: true 配置解析,避免响应体里的大整数在解析阶段丢失精度。
  • Go int64 中 ID 类字段映射为 number | string,允许调用方在请求入参里传字符串 ID。

包形态

发布到 npm 的包只包含 dist/README.mdpackage.jsonpackage.json 的 exports 指向 dist 构建产物;prepack 会在打包前执行 bun run build,生成可被 Node.js 直接导入的 ESM .js 文件和 .d.ts 类型声明。

包验证

在当前 SDK 目录执行:

bun run build
bun run typecheck
bun run test
npm pack --dry-run