news 2026/11/5 17:42:14

google-api-nodejs-client 的 certificatemanager 客户端库版本演进:CHANGELOG 全量解读(1.0.0 → 16.0.1)

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
google-api-nodejs-client 的 certificatemanager 客户端库版本演进:CHANGELOG 全量解读(1.0.0 → 16.0.1)
  • 后端

【免费下载链接】google-api-nodejs-client

Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.

项目地址:https://gitcode.com/gh_mirrors/go/google-api-nodejs-client
点击查看免费下载

导读

本篇文章以 src/apis/certificatemanager/CHANGELOG.md 为唯一主线,系统梳理 Google 官方 Node.js API 客户端库中 certificatemanager(Certificate Manager API v1)子包的完整版本演进史:从 2023 年 8 月的 1.0.0 到 2026 年 9 月的 16.0.1,共 42 个版本条目。通过逐一解读其中记录的 Features、Bug Fixes 与 ⚠ BREAKING CHANGES,并结合 src/generator/synth.ts、release-please-config.json 与 v1.ts 等仓库源码,你将掌握该子包的版本号策略、Node.js 运行时要求演进、依赖升级路径,以及「run the generator / update the API」这类自动化变更背后的真实含义,从而能准确判断升级影响并安全使用@googleapis/certificatemanager。

一、包定位与维护状态:先弄清这个库「值不值得用」

在解读版本历史之前,先看官方在 src/apis/certificatemanager/README.md 中给出的定位声明:

  • 该库处于maintenance mode(维护模式),Google 会继续为存量应用提供支持,但不再作为主推方案;
  • 对于新应用或存量应用现代化改造,官方建议改用@google-cloud/certificate-manager这一云生态专用库;
  • 子包以 npm 包@googleapis/certificatemanager形式独立发布,安装命令为npm install @googleapis/certificatemanager;
  • 许可证为 Apache-2.0。

对应的 src/apis/certificatemanager/package.json 提供了包的技术底座:

{ "name": "@googleapis/certificatemanager", "version": "16.0.1", "main": "build/index.js", "types": "build/index.d.ts", "license": "Apache-2.0", "engines": { "node": ">=22.0.0" }, "dependencies": { "googleapis-common": "^9.0.0" } }

值得注意:engines.node已收紧到>=22.0.0,这与 CHANGELOG 中 2026 年 9 月那批 "Update apiary to minimum Node version of 22" 的破坏性变更完全一致(详见第三节)。而googleapis-common依赖当前为^9.0.0,这条依赖线也是 CHANGELOG 中反复出现的 Bug Fixes 主题。

二、版本时间线全景:两份「镜像」序列背后是一次发布模型切换

通读 CHANGELOG.md 会发现一个显著特征:文件中存在两套从 1.0.0 起步的版本序列,旧序列止步于 6.0.1(2025-07-08),新序列则从 1.0.0(2025-08-07)重新计数并一路攀升到 16.0.1(2026-09-23)。从文件结构与包形态可以推断:2025 年 8 月前后,certificatemanager 子包改为以独立 npm 包(@googleapis/certificatemanager)发布,版本号随之重置。这是阅读本 CHANGELOG 时必须先建立的前提,否则很容易把两个 2.0.0、两个 6.0.0 误当成同一版本。

旧序列(2023-08 → 2025-07,作为 monorepo 内子包阶段)

版本日期变更类型关键内容
1.0.02023-08-17Bug Fixes首次发布,同步上游 API 更新
1.0.12023-08-17Bug Fixesupdate the API
1.0.22023-08-25Bug Fixesdeps: googleapis-common 升至 v7
1.0.32023-10-11Bug Fixesupdate the API;googleapis-common v7
2.0.02024-03-12⚠ Breaking + Featuresrun the generator(PR #3434)
3.0.02024-04-04⚠ Breaking + Featuresrun the generator(#3434、#3456)
3.0.12024-05-02Bug Fixesupdate the API
4.0.02024-05-02⚠ Breaking + Featuresrun the generator(#3434、#3456)
4.1.0 / 4.2.02024-08-16Featuresupdate the API
4.2.12025-02-04Bug Fixesupdate the API
4.3.0 / 4.4.02025-03-18Featuresupdate the API
4.5.02025-05-05Featuresupdate the API
5.0.02025-05-29⚠ Breakingupgrade to node 18
5.0.12025-06-04Bug Fixesdeps: googleapis-common 8.0.2-rc
6.0.02025-06-30⚠ Breaking + Featuresupgrade to node 18;update the API
6.0.12025-07-08Bug Fixesupdate the API

新序列(2025-08 → 2026-09,独立 npm 子包阶段)

版本日期变更类型关键内容
1.0.02025-08-07Bug Fixesupdate the API;googleapis-common 8.0.0
1.0.12025-08-13Bug Fixesupdate the API;googleapis-common 8.0.0
1.0.22025-08-21Bug Fixesupdate the API;googleapis-common 8.0.0
2.0.02025-08-25⚠ Breakingrun the generator(#3751)
3.0.02025-08-26⚠ Breakingrun the generator(#3751)
4.0.02025-08-27⚠ Breakingrun the generator(#3751)
5.0.02025-08-28⚠ Breakingrun the generator(#3751)
6.0.02025-08-29⚠ Breakingrun the generator(#3751);googleapis-common 8.0.0
7.0.02025-09-16⚠ Breakingrun the generator(#3751);googleapis-common 8.0.0
8.0.02025-09-30⚠ Breakingrun the generator(#3795)
9.0.02025-10-09⚠ Breakingrun the generator(#3805)
10.0.02025-10-15⚠ Breakingrun the generator(#3814)
11.0.02025-11-11⚠ Breakingrun the generator(#3831)
11.0.12025-12-05Bug Fixesupdate the API
11.1.02025-12-15Featuresupdate the API
11.1.12026-05-19Bug Fixesupdate the API(两次)
12.0.02026-08-03⚠ Breakingrun the generator(#3955)
12.1.02026-09-02Featuresrun the generator(#3992);依赖升至 Node 22 系
12.1.12026-09-09Bug Fixesadd back support for node 18
13.0.02026-09-09⚠ BreakingNode 22 门槛(#4011);run the generator(#3955)
14.0.02026-09-10⚠ BreakingNode 22 门槛(#4011)
15.0.02026-09-10⚠ BreakingNode 22 门槛(#4011);run the generator
16.0.02026-09-14⚠ BreakingNode 22 门槛「again」(#4020)
16.0.12026-09-23Bug Fixesupdate the API

三、三大变更类型的源码级解读

CHANGELOG 中的每一条都归属于三类之一,理解它们的生成机制,比只看文字更有价值。

3.1 ⚠ BREAKING CHANGES:版本号与运行时门槛的信号灯

CHANGELOG 里的破坏性变更可以归纳为三类来源:

其一,Node.js 最低版本要求的两次整体升级。旧序列中 5.0.0(2025-05-29)与 6.0.0(2025-06-30)两次出现 "upgrade to node 18";新序列中 13.0.0 / 14.0.0 / 15.0.0(2026-09-09/10)连续三次标注 "Update apiary to minimum Node version of 22"(PR #4011),16.0.0(2026-09-14)又出现 "Update apiary to minimum Node version of 22 again"(PR #4020),而 12.1.1(2026-09-09)曾短暂 "add back support for node 18"。这一来一回说明:Node 18 支持先在 12.x 被恢复,随即又被统一移除,最终所有 apiary 生成包将最低 Node 版本锁定在 22。这正是 package.json 中"engines": {"node": ">=22.0.0"}的由来。对使用者的直接后果:Node 18 环境无法再安装最新版,升级到 13.x 及以上前必须确认运行时为 Node ≥ 22。

其二,run the generator(重新运行代码生成器)。生成器会依据 discovery/certificatemanager-v1.json 这份上游 Discovery 文档重新生成 v1.ts 与 index.ts,方法签名、Schema 字段都可能变化,因此一律标记为破坏性变更。新序列中 2.0.0 → 11.0.0 连续十个大版本几乎全部由它驱动,可见上游 API 迭代之频繁。

其三,"This release has breaking changes."** 的通用占位说明,属于 release-please 自动生成的兜底描述,常见于涉及 Schema 增删或方法重命名的批次中。

3.2 Features:update the API与run the generator

  • update the API:表示同步了上游 Certificate Manager API 的最新定义,通常会带来新资源、新方法或新字段;
  • run the generator:表示触发了 src/generator/synth.ts 中的synth()流程。该流程会比对 Discovery 文档差异,为每个发生变化的 API 子包生成提交,并依createChangelog()(synth.ts 第 178-204 行)生成变更日志正文、依getSemverity()(第 220-242 行)计算语义化版本等级:ADDED → MINOR,CHANGED → PATCH,DELETED → MAJOR,最终由getPrefix()(第 206-214 行)决定提交前缀是feat还是fix。也就是说,CHANGELOG 中「Features / Bug Fixes」分类并不是人工撰写的,而是对 Discovery 文档 diff 的自动化产物。

3.3 Bug Fixes:API 同步与依赖升级

Bug Fixes 主要来自两类提交:

  • certificatemanager: update the API:携带 Discovery 文档的增量同步(通常是小范围字段调整,语义化为 PATCH);
  • 依赖升级:deps系列,如旧序列 1.0.2/1.0.3 将googleapis-common升至 v7,5.0.1/6.0.0 升至 8.0.2-rc,新序列中又统一升级至 8.0.0(PR #3731),当前 package.json 已使用^9.0.0。

googleapis-common是这些生成包共享的底层库(提供createAPIRequest、AuthPlus、getAPI等基础能力,见 index.ts),它的每个大版本升级都会辐射到所有 API 子包,因此在 CHANGELOG 中高频出现。

四、CHANGELOG 背后:这个子包实际暴露了哪些 API 能力

虽然 CHANGELOG 只记录版本事件,但通过 v1.ts 可以确认update the API每次同步的对象——当前 v1 版本共暴露 9 个资源类(v1.ts 第 900-6050 行):

  • Resource$Projects:顶层入口,挂载locations
  • Resource$Projects$Locations:get/list获取区域信息(v1.ts 第 909-937 行)
  • Resource$Projects$Locations$Certificateissuanceconfigs:证书签发配置的create/delete/get/list/patch
  • Resource$Projects$Locations$Certificatemaps:证书映射的create/delete/get/list/patch
  • Resource$Projects$Locations$Certificatemaps$Certificatemapentries:映射条目的完整 CRUD
  • Resource$Projects$Locations$Certificates:TLS 证书的create/delete/get/list/patch(v1.ts 第 3776 行起)
  • Resource$Projects$Locations$Dnsauthorizations:DNS 授权的 CRUD
  • Resource$Projects$Locations$Operations:长时任务(Operation)的delete/get/list
  • Resource$Projects$Locations$Trustconfigs:信任配置的create/delete/get/list/patch/update

对应的 Schema 定义(如Schema$Certificate、Schema$ManagedCertificate、Schema$DnsAuthorization、Schema$TrustConfig)也随每次update the API演进。例如Schema$ManagedCertificate(v1.ts 第 662-687 行)包含domains、dnsAuthorizations、issuanceConfig、authorizationAttemptInfo等字段,其中的issuanceConfig字段即对应 2024 年前后新增的 CertificateIssuanceConfig 资源——这类能力正是旧序列 4.x 与 6.0.0 中多次update the API的落地成果。

五、实际使用:结合 CHANGELOG 判断升级,结合源码写出可运行代码

5.1 安装与运行环境前提

npm install @googleapis/certificatemanager

根据 package.json 的engines与 CHANGELOG 中的破坏性变更记录,当前版本要求 Node.js ≥ 22;若项目运行在 Node 18 上,需要固定安装 12.1.1 或更早版本。

5.2 最小可用示例(来源于 v1.ts 内置 JSDoc 示例)

v1.ts 中每个方法都内嵌了可直接运行的示例(如第 939-996 行的locations.get、第 6216-6275 行的trustConfigs.delete),统一模式如下:

const {google} = require('googleapis'); const certificatemanager = google.certificatemanager('v1'); async function main() { const auth = new google.auth.GoogleAuth({ // Scopes 可传数组,也可传单个空格分隔的字符串 scopes: ['https://www.googleapis.com/auth/cloud-platform'], }); const authClient = await auth.getClient(); google.options({auth: authClient}); // 获取某个区域的信息 const res = await certificatemanager.projects.locations.get({ name: 'projects/my-project/locations/my-location', }); console.log(res.data); // 删除一个 TrustConfig(携带 etag 做乐观并发控制) const res2 = await certificatemanager.projects.locations.trustConfigs.delete({ etag: 'placeholder-value', name: 'projects/my-project/locations/my-location/trustConfigs/my-trustConfig', }); console.log(res2.data); } main().catch(e => { console.error(e); throw e; });

执行前需先在 Google Cloud 控制台启用certificatemanager.googleapis.comAPI,并通过gcloud auth application-default login完成本地凭据配置——这两步同样写在 v1.ts 的示例注释中。方法均支持 Promise(async/await)与 callback 两种调用方式,返回值类型为GaxiosResponseWithHTTP2<T>,可结合 HTTP/2 传输使用。

5.3 升级决策速查

当前版本目标版本需关注点
≤ 4.5.05.0.0 / 6.0.0Node 最低版本升到 18,确认运行时
≤ 6.0.1新序列任意版本版本号已重置,按新序列比对功能差异
≤ 12.1.1≥ 13.0.0Node 最低版本升到 22(#4011/#4020),必须升级运行时
任意版本最新 16.0.1大版本多为run the generator所致,关注方法签名与 Schema 字段变化

六、小结:从 CHANGELOG 读出「生成式客户端库」的生命周期

certificatemanager 子包的 CHANGELOG 是理解 google-api-nodejs-client 这种自动生成、批量发布的客户端库运维模式的绝佳样本:

  • 版本号由 release-please 依据提交类型自动推进,破坏性变更触发大版本;
  • 几乎所有功能演进都源自对上游 Discovery 文档的重新生成(run the generator/update the API),而非人工手写代码;
  • 运行时要求(Node 18 → 22)与公共依赖(googleapis-common 7 → 8 → 9)的升级是跨子包统一进行的,会在所有子包 CHANGELOG 中同步出现;
  • 2025 年 8 月后该子包转为独立 npm 发布,版本号从 1.0.0 重新计数,阅读历史时务必区分两个序列。

对于开发者而言,这篇 CHANGELOG 既是升级前的「影响面检查清单」,也是判断包维护活跃度、追溯某个 API 能力引入时间的可靠索引。若在升级中遇到类型错误或接口不匹配,优先对照 v1.ts 中的最新方法签名与 Schema 定义,再结合本 CHANGELOG 定位引入该变化的版本。

  • 后端

【免费下载链接】google-api-nodejs-client

Google's officially supported Node.js client library for accessing Google APIs. Support for authorization and authentication with OAuth 2.0, API Keys and JWT (Service Tokens) is included.

项目地址:https://gitcode.com/gh_mirrors/go/google-api-nodejs-client
点击查看免费下载
上一篇:Popcorn Time观影神器完全攻略:从零基础到高级玩家速成指南
下一篇:深度学习可视化:告别手绘神经网络的时代

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/11/5 17:42:14

用过才敢说!2026最新AI论文网站测评与推荐

2026年真正好用的AI论文网站&#xff0c;核心看生成的论文质量、低AI味、格式正确、学术适配四大指标。综合实测&#xff0c;千笔AI、ThouPen、豆包、DeepSeek、Grammarly 是当前最值得推荐的梯队&#xff0c;覆盖从免费到付费、从中文到英文、从文科到理工的全场景需求。 一、…

作者头像 李华
网站建设 2026/10/24 8:05:31

Gyroflow 1.5 滚动快门校正全指南:3 步告别果冻效应

Gyroflow 1.5 滚动快门校正全指南&#xff1a;3 步告别果冻效应 【免费下载链接】gyroflow Video stabilization using gyroscope data 项目地址: https://gitcode.com/GitHub_Trending/gy/gyroflow 手持奔跑、车载颠簸、无人机穿越&#xff0c;画面里的楼房一歪、地平线…

作者头像 李华
网站建设 2026/10/22 5:08:39

OpenClaw 小龙虾 AI 本地部署,新手也能看懂的 Windows 教程

Windows 一键部署 OpenClaw 教程&#xff5c;5 分钟搞定本地 AI 智能体&#xff0c;告别复杂配置 说明&#xff1a;本文适配 CSDN 发布&#xff0c;全部版本号、链接、文件大小已替换&#xff0c;删除标签 / 日期 / 阅读量 / 示意图&#xff0c;规避禁用词汇&#xff0c;首次全…

作者头像 李华
网站建设 2026/10/24 19:04:13

汽车零件专用机床装配图设计与实践指南

1. 汽车零件专用机床装配图概述在汽车制造行业中&#xff0c;专用机床是生产线上不可或缺的核心设备。作为一名在汽车零部件行业摸爬滚打多年的工程师&#xff0c;我深知一张精准的装配图对于机床制造的重要性。汽车零件专用机床装配图不仅是一份技术文档&#xff0c;更是连接设…

作者头像 李华
网站建设 2026/10/24 6:19:19

Python游戏助手脚本实战:图像识别与自动化操作指南

简介&#xff1a;Python游戏助手脚本是一套面向游戏玩家与Python初学者的辅助工具项目&#xff0c;基于Python语言编写&#xff0c;旨在通过自动化与数据分析提升游戏体验和操作效率。项目涵盖自动截图、物品价格查询、自动登录、宏命令录制执行、性能监控及游戏数据统计等模块…

作者头像 李华