@release-please-oss/release-please 0.0.0-stage → 17.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +279 -2
  3. package/build/src/bin/release-please.d.ts +22 -0
  4. package/build/src/bin/release-please.js +727 -0
  5. package/build/src/bootstrapper.d.ts +18 -0
  6. package/build/src/bootstrapper.js +64 -0
  7. package/build/src/changelog-notes/default.d.ts +15 -0
  8. package/build/src/changelog-notes/default.js +96 -0
  9. package/build/src/changelog-notes/github.d.ts +8 -0
  10. package/build/src/changelog-notes/github.js +29 -0
  11. package/build/src/changelog-notes.d.ts +22 -0
  12. package/build/src/changelog-notes.js +40 -0
  13. package/build/src/commit.d.ts +33 -0
  14. package/build/src/commit.js +422 -0
  15. package/build/src/errors/index.d.ts +36 -0
  16. package/build/src/errors/index.js +77 -0
  17. package/build/src/factories/changelog-notes-factory.d.ts +16 -0
  18. package/build/src/factories/changelog-notes-factory.js +44 -0
  19. package/build/src/factories/plugin-factory.d.ts +23 -0
  20. package/build/src/factories/plugin-factory.js +94 -0
  21. package/build/src/factories/versioning-strategy-factory.d.ts +16 -0
  22. package/build/src/factories/versioning-strategy-factory.js +52 -0
  23. package/build/src/factory.d.ts +18 -0
  24. package/build/src/factory.js +161 -0
  25. package/build/src/github-api.d.ts +260 -0
  26. package/build/src/github-api.js +714 -0
  27. package/build/src/github.d.ts +306 -0
  28. package/build/src/github.js +769 -0
  29. package/build/src/index.d.ts +17 -0
  30. package/build/src/index.js +41 -0
  31. package/build/src/local-github.d.ts +270 -0
  32. package/build/src/local-github.js +756 -0
  33. package/build/src/manifest.d.ts +370 -0
  34. package/build/src/manifest.js +1142 -0
  35. package/build/src/plugin.d.ts +37 -0
  36. package/build/src/plugin.js +57 -0
  37. package/build/src/plugins/cargo-workspace.d.ts +58 -0
  38. package/build/src/plugins/cargo-workspace.js +339 -0
  39. package/build/src/plugins/group-priority.d.ts +29 -0
  40. package/build/src/plugins/group-priority.js +82 -0
  41. package/build/src/plugins/linked-versions.d.ts +36 -0
  42. package/build/src/plugins/linked-versions.js +137 -0
  43. package/build/src/plugins/maven-workspace.d.ts +81 -0
  44. package/build/src/plugins/maven-workspace.js +431 -0
  45. package/build/src/plugins/merge.d.ts +27 -0
  46. package/build/src/plugins/merge.js +99 -0
  47. package/build/src/plugins/node-workspace.d.ts +50 -0
  48. package/build/src/plugins/node-workspace.js +352 -0
  49. package/build/src/plugins/sentence-case.d.ts +19 -0
  50. package/build/src/plugins/sentence-case.js +80 -0
  51. package/build/src/plugins/workspace.d.ts +173 -0
  52. package/build/src/plugins/workspace.js +308 -0
  53. package/build/src/pull-request.d.ts +11 -0
  54. package/build/src/pull-request.js +16 -0
  55. package/build/src/release-pull-request.d.ts +14 -0
  56. package/build/src/release-pull-request.js +16 -0
  57. package/build/src/release.d.ts +7 -0
  58. package/build/src/release.js +16 -0
  59. package/build/src/repository.d.ts +5 -0
  60. package/build/src/repository.js +16 -0
  61. package/build/src/scm.d.ts +80 -0
  62. package/build/src/scm.js +16 -0
  63. package/build/src/strategies/base.d.ts +162 -0
  64. package/build/src/strategies/base.js +494 -0
  65. package/build/src/strategies/bazel.d.ts +7 -0
  66. package/build/src/strategies/bazel.js +49 -0
  67. package/build/src/strategies/dart.d.ts +8 -0
  68. package/build/src/strategies/dart.js +73 -0
  69. package/build/src/strategies/dotnet-yoshi.d.ts +13 -0
  70. package/build/src/strategies/dotnet-yoshi.js +109 -0
  71. package/build/src/strategies/elixir.d.ts +5 -0
  72. package/build/src/strategies/elixir.js +46 -0
  73. package/build/src/strategies/expo.d.ts +15 -0
  74. package/build/src/strategies/expo.js +51 -0
  75. package/build/src/strategies/go-librarian.d.ts +11 -0
  76. package/build/src/strategies/go-librarian.js +84 -0
  77. package/build/src/strategies/go-yoshi.d.ts +14 -0
  78. package/build/src/strategies/go-yoshi.js +168 -0
  79. package/build/src/strategies/go.d.ts +7 -0
  80. package/build/src/strategies/go.js +53 -0
  81. package/build/src/strategies/helm.d.ts +8 -0
  82. package/build/src/strategies/helm.js +73 -0
  83. package/build/src/strategies/java-yoshi-mono-repo.d.ts +22 -0
  84. package/build/src/strategies/java-yoshi-mono-repo.js +308 -0
  85. package/build/src/strategies/java-yoshi.d.ts +20 -0
  86. package/build/src/strategies/java-yoshi.js +210 -0
  87. package/build/src/strategies/java.d.ts +28 -0
  88. package/build/src/strategies/java.js +176 -0
  89. package/build/src/strategies/krm-blueprint.d.ts +7 -0
  90. package/build/src/strategies/krm-blueprint.js +65 -0
  91. package/build/src/strategies/maven.d.ts +9 -0
  92. package/build/src/strategies/maven.js +56 -0
  93. package/build/src/strategies/node-librarian.d.ts +10 -0
  94. package/build/src/strategies/node-librarian.js +121 -0
  95. package/build/src/strategies/node.d.ts +10 -0
  96. package/build/src/strategies/node.js +111 -0
  97. package/build/src/strategies/ocaml.d.ts +5 -0
  98. package/build/src/strategies/ocaml.js +86 -0
  99. package/build/src/strategies/php-librarian.d.ts +6 -0
  100. package/build/src/strategies/php-librarian.js +35 -0
  101. package/build/src/strategies/php-yoshi.d.ts +13 -0
  102. package/build/src/strategies/php-yoshi.js +255 -0
  103. package/build/src/strategies/php.d.ts +6 -0
  104. package/build/src/strategies/php.js +76 -0
  105. package/build/src/strategies/python-librarian.d.ts +6 -0
  106. package/build/src/strategies/python-librarian.js +35 -0
  107. package/build/src/strategies/python.d.ts +11 -0
  108. package/build/src/strategies/python.js +175 -0
  109. package/build/src/strategies/r.d.ts +8 -0
  110. package/build/src/strategies/r.js +67 -0
  111. package/build/src/strategies/ruby-librarian.d.ts +6 -0
  112. package/build/src/strategies/ruby-librarian.js +35 -0
  113. package/build/src/strategies/ruby-yoshi.d.ts +13 -0
  114. package/build/src/strategies/ruby-yoshi.js +97 -0
  115. package/build/src/strategies/ruby.d.ts +9 -0
  116. package/build/src/strategies/ruby.js +71 -0
  117. package/build/src/strategies/rust.d.ts +17 -0
  118. package/build/src/strategies/rust.js +149 -0
  119. package/build/src/strategies/sfdx.d.ts +9 -0
  120. package/build/src/strategies/sfdx.js +67 -0
  121. package/build/src/strategies/simple.d.ts +7 -0
  122. package/build/src/strategies/simple.js +51 -0
  123. package/build/src/strategies/terraform-module.d.ts +7 -0
  124. package/build/src/strategies/terraform-module.js +90 -0
  125. package/build/src/strategy.d.ts +68 -0
  126. package/build/src/strategy.js +16 -0
  127. package/build/src/update.d.ts +24 -0
  128. package/build/src/update.js +16 -0
  129. package/build/src/updaters/base-xml.d.ts +19 -0
  130. package/build/src/updaters/base-xml.js +43 -0
  131. package/build/src/updaters/bazel/module-bazel.d.ts +7 -0
  132. package/build/src/updaters/bazel/module-bazel.js +33 -0
  133. package/build/src/updaters/changelog-json.d.ts +29 -0
  134. package/build/src/updaters/changelog-json.js +100 -0
  135. package/build/src/updaters/changelog.d.ts +13 -0
  136. package/build/src/updaters/changelog.js +55 -0
  137. package/build/src/updaters/composite.d.ts +20 -0
  138. package/build/src/updaters/composite.js +65 -0
  139. package/build/src/updaters/dart/pubspec-yaml.d.ts +13 -0
  140. package/build/src/updaters/dart/pubspec-yaml.js +50 -0
  141. package/build/src/updaters/default.d.ts +21 -0
  142. package/build/src/updaters/default.js +36 -0
  143. package/build/src/updaters/dotnet/apis.d.ts +18 -0
  144. package/build/src/updaters/dotnet/apis.js +45 -0
  145. package/build/src/updaters/dotnet/csproj.d.ts +12 -0
  146. package/build/src/updaters/dotnet/csproj.js +33 -0
  147. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +13 -0
  148. package/build/src/updaters/elixir/elixir-mix-exs.js +42 -0
  149. package/build/src/updaters/expo/app-json.d.ts +31 -0
  150. package/build/src/updaters/expo/app-json.js +67 -0
  151. package/build/src/updaters/generic-json.d.ts +14 -0
  152. package/build/src/updaters/generic-json.js +54 -0
  153. package/build/src/updaters/generic-toml.d.ts +21 -0
  154. package/build/src/updaters/generic-toml.js +66 -0
  155. package/build/src/updaters/generic-xml.d.ts +8 -0
  156. package/build/src/updaters/generic-xml.js +38 -0
  157. package/build/src/updaters/generic-yaml.d.ts +23 -0
  158. package/build/src/updaters/generic-yaml.js +85 -0
  159. package/build/src/updaters/generic.d.ts +54 -0
  160. package/build/src/updaters/generic.js +187 -0
  161. package/build/src/updaters/go/version-go.d.ts +4 -0
  162. package/build/src/updaters/go/version-go.js +24 -0
  163. package/build/src/updaters/helm/chart-yaml.d.ts +13 -0
  164. package/build/src/updaters/helm/chart-yaml.js +41 -0
  165. package/build/src/updaters/java/java-released.d.ts +28 -0
  166. package/build/src/updaters/java/java-released.js +59 -0
  167. package/build/src/updaters/java/java-update.d.ts +21 -0
  168. package/build/src/updaters/java/java-update.js +80 -0
  169. package/build/src/updaters/java/pom-xml.d.ts +29 -0
  170. package/build/src/updaters/java/pom-xml.js +135 -0
  171. package/build/src/updaters/java/versions-manifest.d.ts +19 -0
  172. package/build/src/updaters/java/versions-manifest.js +71 -0
  173. package/build/src/updaters/krm/krm-blueprint-version.d.ts +13 -0
  174. package/build/src/updaters/krm/krm-blueprint-version.js +46 -0
  175. package/build/src/updaters/librarian-yaml.d.ts +45 -0
  176. package/build/src/updaters/librarian-yaml.js +149 -0
  177. package/build/src/updaters/node/package-json.d.ts +46 -0
  178. package/build/src/updaters/node/package-json.js +106 -0
  179. package/build/src/updaters/node/package-lock-json.d.ts +14 -0
  180. package/build/src/updaters/node/package-lock-json.js +83 -0
  181. package/build/src/updaters/node/samples-package-json.d.ts +24 -0
  182. package/build/src/updaters/node/samples-package-json.js +49 -0
  183. package/build/src/updaters/ocaml/dune-project.d.ts +13 -0
  184. package/build/src/updaters/ocaml/dune-project.js +37 -0
  185. package/build/src/updaters/ocaml/esy-json.d.ts +13 -0
  186. package/build/src/updaters/ocaml/esy-json.js +37 -0
  187. package/build/src/updaters/ocaml/opam.d.ts +13 -0
  188. package/build/src/updaters/ocaml/opam.js +37 -0
  189. package/build/src/updaters/php/php-client-version.d.ts +12 -0
  190. package/build/src/updaters/php/php-client-version.js +32 -0
  191. package/build/src/updaters/php/root-composer-update-packages.d.ts +13 -0
  192. package/build/src/updaters/php/root-composer-update-packages.js +60 -0
  193. package/build/src/updaters/python/pyproject-toml.d.ts +29 -0
  194. package/build/src/updaters/python/pyproject-toml.js +53 -0
  195. package/build/src/updaters/python/python-file-with-version.d.ts +12 -0
  196. package/build/src/updaters/python/python-file-with-version.js +32 -0
  197. package/build/src/updaters/python/setup-cfg.d.ts +12 -0
  198. package/build/src/updaters/python/setup-cfg.js +32 -0
  199. package/build/src/updaters/python/setup-py.d.ts +12 -0
  200. package/build/src/updaters/python/setup-py.js +32 -0
  201. package/build/src/updaters/r/description.d.ts +12 -0
  202. package/build/src/updaters/r/description.js +32 -0
  203. package/build/src/updaters/r/news.d.ts +12 -0
  204. package/build/src/updaters/r/news.js +49 -0
  205. package/build/src/updaters/raw-content.d.ts +19 -0
  206. package/build/src/updaters/raw-content.js +39 -0
  207. package/build/src/updaters/release-please-config.d.ts +8 -0
  208. package/build/src/updaters/release-please-config.js +80 -0
  209. package/build/src/updaters/release-please-manifest.d.ts +4 -0
  210. package/build/src/updaters/release-please-manifest.js +34 -0
  211. package/build/src/updaters/ruby/common.d.ts +17 -0
  212. package/build/src/updaters/ruby/common.js +46 -0
  213. package/build/src/updaters/ruby/gemfile-lock.d.ts +24 -0
  214. package/build/src/updaters/ruby/gemfile-lock.js +53 -0
  215. package/build/src/updaters/ruby/version-rb.d.ts +12 -0
  216. package/build/src/updaters/ruby/version-rb.js +34 -0
  217. package/build/src/updaters/rust/cargo-lock.d.ts +16 -0
  218. package/build/src/updaters/rust/cargo-lock.js +64 -0
  219. package/build/src/updaters/rust/cargo-toml.d.ts +13 -0
  220. package/build/src/updaters/rust/cargo-toml.js +89 -0
  221. package/build/src/updaters/rust/common.d.ts +54 -0
  222. package/build/src/updaters/rust/common.js +35 -0
  223. package/build/src/updaters/sfdx/sfdx-project-json.d.ts +21 -0
  224. package/build/src/updaters/sfdx/sfdx-project-json.js +41 -0
  225. package/build/src/updaters/terraform/metadata-version.d.ts +13 -0
  226. package/build/src/updaters/terraform/metadata-version.js +37 -0
  227. package/build/src/updaters/terraform/module-version.d.ts +13 -0
  228. package/build/src/updaters/terraform/module-version.js +37 -0
  229. package/build/src/updaters/terraform/readme.d.ts +12 -0
  230. package/build/src/updaters/terraform/readme.js +32 -0
  231. package/build/src/util/branch-name.d.ts +20 -0
  232. package/build/src/util/branch-name.js +225 -0
  233. package/build/src/util/code-suggester/default-options-handler.d.ts +10 -0
  234. package/build/src/util/code-suggester/default-options-handler.js +45 -0
  235. package/build/src/util/code-suggester/errors.d.ts +4 -0
  236. package/build/src/util/code-suggester/errors.js +24 -0
  237. package/build/src/util/code-suggester/github/branch.d.ts +45 -0
  238. package/build/src/util/code-suggester/github/branch.js +118 -0
  239. package/build/src/util/code-suggester/github/commit-and-push.d.ts +51 -0
  240. package/build/src/util/code-suggester/github/commit-and-push.js +141 -0
  241. package/build/src/util/code-suggester/github/create-commit.d.ts +20 -0
  242. package/build/src/util/code-suggester/github/create-commit.js +60 -0
  243. package/build/src/util/code-suggester/github/fork.d.ts +15 -0
  244. package/build/src/util/code-suggester/github/fork.js +48 -0
  245. package/build/src/util/code-suggester/github/labels.d.ts +14 -0
  246. package/build/src/util/code-suggester/github/labels.js +42 -0
  247. package/build/src/util/code-suggester/github/open-pull-request.d.ts +16 -0
  248. package/build/src/util/code-suggester/github/open-pull-request.js +56 -0
  249. package/build/src/util/code-suggester/index.d.ts +28 -0
  250. package/build/src/util/code-suggester/index.js +110 -0
  251. package/build/src/util/code-suggester/logger.d.ts +4 -0
  252. package/build/src/util/code-suggester/logger.js +37 -0
  253. package/build/src/util/code-suggester/types.d.ts +109 -0
  254. package/build/src/util/code-suggester/types.js +30 -0
  255. package/build/src/util/coerce-option.d.ts +1 -0
  256. package/build/src/util/coerce-option.js +40 -0
  257. package/build/src/util/commit-exclude.d.ts +10 -0
  258. package/build/src/util/commit-exclude.js +49 -0
  259. package/build/src/util/commit-split.d.ts +26 -0
  260. package/build/src/util/commit-split.js +100 -0
  261. package/build/src/util/commit-utils.d.ts +1 -0
  262. package/build/src/util/commit-utils.js +34 -0
  263. package/build/src/util/filter-commits.d.ts +12 -0
  264. package/build/src/util/filter-commits.js +59 -0
  265. package/build/src/util/indent-commit.d.ts +2 -0
  266. package/build/src/util/indent-commit.js +39 -0
  267. package/build/src/util/json-stringify.d.ts +1 -0
  268. package/build/src/util/json-stringify.js +22 -0
  269. package/build/src/util/logger.d.ts +24 -0
  270. package/build/src/util/logger.js +54 -0
  271. package/build/src/util/pull-request-body.d.ts +25 -0
  272. package/build/src/util/pull-request-body.js +147 -0
  273. package/build/src/util/pull-request-overflow-handler.d.ts +54 -0
  274. package/build/src/util/pull-request-overflow-handler.js +78 -0
  275. package/build/src/util/pull-request-title.d.ts +22 -0
  276. package/build/src/util/pull-request-title.js +146 -0
  277. package/build/src/util/signoff-commit-message.d.ts +1 -0
  278. package/build/src/util/signoff-commit-message.js +35 -0
  279. package/build/src/util/tag-name.d.ts +10 -0
  280. package/build/src/util/tag-name.js +42 -0
  281. package/build/src/util/toml-edit.d.ts +16 -0
  282. package/build/src/util/toml-edit.js +126 -0
  283. package/build/src/version.d.ts +35 -0
  284. package/build/src/version.js +74 -0
  285. package/build/src/versioning-strategies/always-bump-major.d.ts +10 -0
  286. package/build/src/versioning-strategies/always-bump-major.js +28 -0
  287. package/build/src/versioning-strategies/always-bump-minor.d.ts +10 -0
  288. package/build/src/versioning-strategies/always-bump-minor.js +28 -0
  289. package/build/src/versioning-strategies/always-bump-patch.d.ts +11 -0
  290. package/build/src/versioning-strategies/always-bump-patch.js +29 -0
  291. package/build/src/versioning-strategies/default.d.ts +48 -0
  292. package/build/src/versioning-strategies/default.js +102 -0
  293. package/build/src/versioning-strategies/dependency-manifest.d.ts +15 -0
  294. package/build/src/versioning-strategies/dependency-manifest.js +103 -0
  295. package/build/src/versioning-strategies/java-add-snapshot.d.ts +13 -0
  296. package/build/src/versioning-strategies/java-add-snapshot.js +54 -0
  297. package/build/src/versioning-strategies/java-snapshot.d.ts +13 -0
  298. package/build/src/versioning-strategies/java-snapshot.js +70 -0
  299. package/build/src/versioning-strategies/prerelease.d.ts +20 -0
  300. package/build/src/versioning-strategies/prerelease.js +163 -0
  301. package/build/src/versioning-strategies/service-pack.d.ts +12 -0
  302. package/build/src/versioning-strategies/service-pack.js +47 -0
  303. package/build/src/versioning-strategy.d.ts +90 -0
  304. package/build/src/versioning-strategy.js +82 -0
  305. package/package.json +114 -4
  306. package/schemas/config.json +513 -0
  307. package/schemas/manifest.json +9 -0
  308. package/templates/commit.hbs +2 -0
  309. package/templates/header.hbs +9 -0
  310. package/templates/template.hbs +19 -0
@@ -0,0 +1,714 @@
1
+ "use strict";
2
+ // Copyright 2026 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.sleepInMs = exports.wrapAsync = exports.GitHubApi = exports.MAX_ISSUE_BODY_SIZE = exports.MAX_SLEEP_SECONDS = exports.GH_GRAPHQL_URL = exports.GH_API_URL = void 0;
17
+ const rest_1 = require("@octokit/rest");
18
+ const request_1 = require("@octokit/request");
19
+ const request_error_1 = require("@octokit/request-error");
20
+ const errors_1 = require("./errors");
21
+ const logger_1 = require("./util/logger");
22
+ const graphql_1 = require("@octokit/graphql");
23
+ const https_proxy_agent_1 = require("https-proxy-agent");
24
+ const http_proxy_agent_1 = require("http-proxy-agent");
25
+ exports.GH_API_URL = 'https://api.github.com';
26
+ exports.GH_GRAPHQL_URL = 'https://api.github.com';
27
+ exports.MAX_SLEEP_SECONDS = 20;
28
+ exports.MAX_ISSUE_BODY_SIZE = 65536;
29
+ class GitHubApi {
30
+ constructor(options) {
31
+ var _a;
32
+ this.graphqlRequest = (0, exports.wrapAsync)(async (opts, options) => {
33
+ var _a;
34
+ let maxRetries = (_a = options === null || options === void 0 ? void 0 : options.maxRetries) !== null && _a !== void 0 ? _a : 5;
35
+ let seconds = 1;
36
+ while (maxRetries >= 0) {
37
+ try {
38
+ const response = await this.graphql(opts);
39
+ if (response) {
40
+ return response;
41
+ }
42
+ this.logger.trace('no GraphQL response, retrying');
43
+ }
44
+ catch (err) {
45
+ if (err.status !== 502) {
46
+ throw err;
47
+ }
48
+ if (maxRetries === 0) {
49
+ this.logger.warn('ran out of retries and response is required');
50
+ throw err;
51
+ }
52
+ this.logger.info(`received 502 error, ${maxRetries} attempts remaining`);
53
+ if (typeof opts.num === 'number') {
54
+ if (maxRetries === 1) {
55
+ this.logger.info('last retry, forcing batch size to 1');
56
+ opts.num = 1;
57
+ }
58
+ else {
59
+ const nextNum = Math.floor(opts.num / 2);
60
+ if (nextNum >= 1) {
61
+ this.logger.info(`halving batch size from ${opts.num} to ${nextNum}`);
62
+ opts.num = nextNum;
63
+ }
64
+ }
65
+ }
66
+ }
67
+ maxRetries -= 1;
68
+ if (maxRetries >= 0) {
69
+ this.logger.trace(`sleeping ${seconds} seconds`);
70
+ await (0, exports.sleepInMs)(1000 * seconds);
71
+ seconds = Math.min(seconds * 2, exports.MAX_SLEEP_SECONDS);
72
+ }
73
+ }
74
+ this.logger.trace('ran out of retries');
75
+ return undefined;
76
+ });
77
+ this.createPullRequest = (0, exports.wrapAsync)(async (pullRequest, targetBranch, options) => {
78
+ const pullResponseData = (await this.octokit.pulls.create({
79
+ owner: this.repository.owner,
80
+ repo: this.repository.repo,
81
+ title: pullRequest.title,
82
+ head: `${this.repository.owner}:${pullRequest.headBranchName}`,
83
+ base: targetBranch,
84
+ body: pullRequest.body,
85
+ maintainer_can_modify: true,
86
+ draft: !!(options === null || options === void 0 ? void 0 : options.draft),
87
+ })).data;
88
+ this.logger.info(`Successfully opened pull request available at url: ${pullResponseData.html_url}.`);
89
+ return await this.getPullRequest(pullResponseData.number);
90
+ });
91
+ /**
92
+ * Fetch a pull request given the pull number
93
+ * @param {number} number The pull request number
94
+ * @returns {PullRequest}
95
+ */
96
+ this.getPullRequest = (0, exports.wrapAsync)(async (number) => {
97
+ const response = await this.octokit.pulls.get({
98
+ owner: this.repository.owner,
99
+ repo: this.repository.repo,
100
+ pull_number: number,
101
+ });
102
+ return {
103
+ headBranchName: response.data.head.ref,
104
+ baseBranchName: response.data.base.ref,
105
+ number: response.data.number,
106
+ title: response.data.title,
107
+ body: response.data.body || '',
108
+ files: [],
109
+ labels: response.data.labels
110
+ .map((label) => label.name)
111
+ .filter((name) => !!name),
112
+ };
113
+ });
114
+ this.updatePullRequest = (0, exports.wrapAsync)(async (number, title, body) => {
115
+ const response = await this.octokit.pulls.update({
116
+ owner: this.repository.owner,
117
+ repo: this.repository.repo,
118
+ pull_number: number,
119
+ title,
120
+ body,
121
+ state: 'open',
122
+ });
123
+ return {
124
+ headBranchName: response.data.head.ref,
125
+ baseBranchName: response.data.base.ref,
126
+ number: response.data.number,
127
+ title: response.data.title,
128
+ body: response.data.body || '',
129
+ files: [],
130
+ labels: response.data.labels
131
+ .map((label) => label.name)
132
+ .filter((name) => !!name),
133
+ };
134
+ });
135
+ /**
136
+ * Create a GitHub release
137
+ *
138
+ * @param {Release} release Release parameters
139
+ * @param {ScmReleaseOptions} options Release option parameters
140
+ * @throws {DuplicateReleaseError} if the release tag already exists
141
+ * @throws {GitHubAPIError} on other API errors
142
+ */
143
+ this.createRelease = (0, exports.wrapAsync)(async (release, options = {}) => {
144
+ if (options.forceTag) {
145
+ try {
146
+ await this.octokit.git.createRef({
147
+ owner: this.repository.owner,
148
+ repo: this.repository.repo,
149
+ ref: `refs/tags/${release.tag.toString()}`,
150
+ sha: release.sha,
151
+ });
152
+ }
153
+ catch (err) {
154
+ // ignore if tag already exists
155
+ if (err.status === 422) {
156
+ this.logger.debug(`Tag ${release.tag.toString()} already exists, skipping tag creation`);
157
+ }
158
+ else {
159
+ throw err;
160
+ }
161
+ }
162
+ }
163
+ const resp = await this.octokit.repos.createRelease({
164
+ name: release.name,
165
+ owner: this.repository.owner,
166
+ repo: this.repository.repo,
167
+ tag_name: release.tag.toString(),
168
+ body: release.notes,
169
+ draft: !!options.draft,
170
+ prerelease: !!options.prerelease,
171
+ target_commitish: release.sha,
172
+ });
173
+ return {
174
+ id: resp.data.id,
175
+ name: resp.data.name || undefined,
176
+ tagName: resp.data.tag_name,
177
+ sha: resp.data.target_commitish,
178
+ notes: resp.data.body_text ||
179
+ resp.data.body ||
180
+ resp.data.body_html ||
181
+ undefined,
182
+ url: resp.data.html_url,
183
+ draft: resp.data.draft,
184
+ uploadUrl: resp.data.upload_url,
185
+ };
186
+ }, e => {
187
+ if (e instanceof request_error_1.RequestError) {
188
+ if (e.status === 422 &&
189
+ errors_1.GitHubAPIError.parseErrors(e).some(error => {
190
+ return error.code === 'already_exists';
191
+ })) {
192
+ throw new errors_1.DuplicateReleaseError(e, 'tagName');
193
+ }
194
+ }
195
+ });
196
+ /**
197
+ * Makes a comment on a issue/pull request.
198
+ *
199
+ * @param {string} comment - The body of the comment to post.
200
+ * @param {number} number - The issue or pull request number.
201
+ * @throws {GitHubAPIError} on an API error
202
+ */
203
+ this.commentOnIssue = (0, exports.wrapAsync)(async (comment, number) => {
204
+ this.logger.debug(`adding comment to https://github.com/${this.repository.owner}/${this.repository.repo}/issues/${number}`);
205
+ const resp = await this.octokit.issues.createComment({
206
+ owner: this.repository.owner,
207
+ repo: this.repository.repo,
208
+ issue_number: number,
209
+ body: comment,
210
+ });
211
+ return resp.data.html_url;
212
+ });
213
+ /**
214
+ * Removes labels from an issue/pull request.
215
+ *
216
+ * @param {string[]} labels The labels to remove.
217
+ * @param {number} number The issue/pull request number.
218
+ */
219
+ this.removeIssueLabels = (0, exports.wrapAsync)(async (labels, number) => {
220
+ if (labels.length === 0) {
221
+ return;
222
+ }
223
+ this.logger.debug(`removing labels: ${labels} from issue/pull ${number}`);
224
+ await Promise.all(labels.map(label => this.octokit.issues.removeLabel({
225
+ owner: this.repository.owner,
226
+ repo: this.repository.repo,
227
+ issue_number: number,
228
+ name: label,
229
+ })));
230
+ });
231
+ /**
232
+ * Adds label to an issue/pull request.
233
+ *
234
+ * @param {string[]} labels The labels to add.
235
+ * @param {number} number The issue/pull request number.
236
+ */
237
+ this.addIssueLabels = (0, exports.wrapAsync)(async (labels, number) => {
238
+ if (labels.length === 0) {
239
+ return;
240
+ }
241
+ this.logger.debug(`adding labels: ${labels} from issue/pull ${number}`);
242
+ await this.octokit.issues.addLabels({
243
+ owner: this.repository.owner,
244
+ repo: this.repository.repo,
245
+ issue_number: number,
246
+ labels,
247
+ });
248
+ });
249
+ this.repository = options.repository;
250
+ this.octokitAPIs = options.octokitAPIs;
251
+ this.octokit = options.octokitAPIs.octokit;
252
+ this.graphql = options.octokitAPIs.graphql;
253
+ this.logger = (_a = options.logger) !== null && _a !== void 0 ? _a : logger_1.logger;
254
+ }
255
+ static createDefaultAgent(baseUrl, defaultProxy) {
256
+ if (!defaultProxy) {
257
+ return undefined;
258
+ }
259
+ const { host, port } = defaultProxy;
260
+ if (new URL(baseUrl).protocol.replace(':', '') === 'http') {
261
+ return new http_proxy_agent_1.HttpProxyAgent(`http://${host}:${port}`);
262
+ }
263
+ else {
264
+ return new https_proxy_agent_1.HttpsProxyAgent(`https://${host}:${port}`);
265
+ }
266
+ }
267
+ static async create(options) {
268
+ var _a, _b, _c, _d;
269
+ const apiUrl = (_a = options.apiUrl) !== null && _a !== void 0 ? _a : exports.GH_API_URL;
270
+ const graphqlUrl = (_b = options.graphqlUrl) !== null && _b !== void 0 ? _b : exports.GH_GRAPHQL_URL;
271
+ const releasePleaseVersion = require('../../package.json').version;
272
+ const apis = (_c = options.octokitAPIs) !== null && _c !== void 0 ? _c : {
273
+ octokit: new rest_1.Octokit({
274
+ baseUrl: apiUrl,
275
+ auth: options.token,
276
+ request: {
277
+ agent: this.createDefaultAgent(apiUrl, options.proxy),
278
+ fetch: options.fetch,
279
+ },
280
+ }),
281
+ request: request_1.request.defaults({
282
+ baseUrl: apiUrl,
283
+ headers: {
284
+ 'user-agent': `release-please/${releasePleaseVersion}`,
285
+ Authorization: `token ${options.token}`,
286
+ },
287
+ fetch: options.fetch,
288
+ }),
289
+ graphql: graphql_1.graphql.defaults({
290
+ baseUrl: graphqlUrl,
291
+ request: {
292
+ agent: this.createDefaultAgent(graphqlUrl, options.proxy),
293
+ fetch: options.fetch,
294
+ },
295
+ headers: {
296
+ 'user-agent': `release-please/${releasePleaseVersion}`,
297
+ Authorization: `token ${options.token}`,
298
+ 'content-type': 'application/vnd.github.v3+json',
299
+ },
300
+ }),
301
+ };
302
+ const opts = {
303
+ repository: {
304
+ owner: options.owner,
305
+ repo: options.repo,
306
+ defaultBranch: (_d = options.defaultBranch) !== null && _d !== void 0 ? _d : (await GitHubApi.defaultBranch(options.owner, options.repo, apis.octokit)),
307
+ },
308
+ octokitAPIs: apis,
309
+ logger: options.logger,
310
+ };
311
+ return new GitHubApi(opts);
312
+ }
313
+ static async defaultBranch(owner, repo, octokit) {
314
+ const { data } = await octokit.repos.get({
315
+ repo,
316
+ owner,
317
+ });
318
+ return data.default_branch;
319
+ }
320
+ /**
321
+ * Iterate through merged pull requests with a max number of results scanned.
322
+ *
323
+ * @param {string} targetBranch Target branch of commit.
324
+ * @param {string} status The status of the pull request. Defaults to 'MERGED'.
325
+ * @param {number} maxResults Limit the number of results searched. Defaults to
326
+ * unlimited.
327
+ * @param {boolean} includeFiles Whether to fetch the list of files included in
328
+ * the pull request. Defaults to `true`.
329
+ * @yields {PullRequest}
330
+ * @throws {GitHubAPIError} on an API error
331
+ */
332
+ async *pullRequestIterator(targetBranch, status = 'MERGED', maxResults = Number.MAX_SAFE_INTEGER, includeFiles = true) {
333
+ const generator = includeFiles
334
+ ? this.pullRequestIteratorWithFiles(targetBranch, status, maxResults)
335
+ : this.pullRequestIteratorWithoutFiles(targetBranch, status, maxResults);
336
+ for await (const pullRequest of generator) {
337
+ yield pullRequest;
338
+ }
339
+ }
340
+ /**
341
+ * Helper implementation of pullRequestIterator that includes files via
342
+ * the graphQL API.
343
+ *
344
+ * @param {string} targetBranch The base branch of the pull request
345
+ * @param {string} status The status of the pull request
346
+ * @param {number} maxResults Limit the number of results searched
347
+ */
348
+ async *pullRequestIteratorWithFiles(targetBranch, status = 'MERGED', maxResults = Number.MAX_SAFE_INTEGER) {
349
+ let cursor = undefined;
350
+ let results = 0;
351
+ while (results < maxResults) {
352
+ const response = await this.pullRequestsGraphQL(targetBranch, status, cursor);
353
+ // no response usually means we ran out of results
354
+ if (!response) {
355
+ break;
356
+ }
357
+ for (let i = 0; i < response.data.length; i++) {
358
+ results += 1;
359
+ yield response.data[i];
360
+ }
361
+ if (!response.pageInfo.hasNextPage) {
362
+ break;
363
+ }
364
+ cursor = response.pageInfo.endCursor;
365
+ }
366
+ }
367
+ /**
368
+ * Helper implementation of pullRequestIterator that excludes files
369
+ * via the REST API.
370
+ *
371
+ * @param {string} targetBranch The base branch of the pull request
372
+ * @param {string} status The status of the pull request
373
+ * @param {number} maxResults Limit the number of results searched
374
+ */
375
+ async *pullRequestIteratorWithoutFiles(targetBranch, status = 'MERGED', maxResults = Number.MAX_SAFE_INTEGER) {
376
+ const statusMap = {
377
+ OPEN: 'open',
378
+ CLOSED: 'closed',
379
+ MERGED: 'closed',
380
+ };
381
+ let results = 0;
382
+ for await (const { data: pulls } of this.octokit.paginate.iterator('GET /repos/{owner}/{repo}/pulls', {
383
+ state: statusMap[status],
384
+ owner: this.repository.owner,
385
+ repo: this.repository.repo,
386
+ base: targetBranch,
387
+ sort: 'updated',
388
+ direction: 'desc',
389
+ })) {
390
+ for (const pull of pulls) {
391
+ // The REST API does not have an option for "merged"
392
+ // pull requests - they are closed with a `merged_at` timestamp
393
+ if (status !== 'MERGED' || pull.merged_at) {
394
+ results += 1;
395
+ yield {
396
+ headBranchName: pull.head.ref,
397
+ baseBranchName: pull.base.ref,
398
+ number: pull.number,
399
+ title: pull.title,
400
+ body: pull.body || '',
401
+ labels: pull.labels.map((label) => label.name),
402
+ files: [],
403
+ sha: pull.merge_commit_sha || undefined,
404
+ };
405
+ if (results >= maxResults) {
406
+ break;
407
+ }
408
+ }
409
+ }
410
+ if (results >= maxResults) {
411
+ break;
412
+ }
413
+ }
414
+ }
415
+ /**
416
+ * Return a list of merged pull requests. The list is not guaranteed to be sorted
417
+ * by merged_at, but is generally most recent first.
418
+ *
419
+ * @param {string} targetBranch - Base branch of the pull request. Defaults to
420
+ * the configured default branch.
421
+ * @param {number} page - Page of results. Defaults to 1.
422
+ * @param {number} perPage - Number of results per page. Defaults to 100.
423
+ * @returns {PullRequestHistory | null} - List of merged pull requests
424
+ * @throws {GitHubAPIError} on an API error
425
+ */
426
+ async pullRequestsGraphQL(targetBranch, states = 'MERGED', cursor) {
427
+ var _a;
428
+ this.logger.debug(`Fetching ${states} pull requests on branch ${targetBranch} with cursor ${cursor}`);
429
+ const response = await this.graphqlRequest({
430
+ query: `query mergedPullRequests($owner: String!, $repo: String!, $num: Int!, $maxFilesChanged: Int, $targetBranch: String!, $states: [PullRequestState!], $cursor: String) {
431
+ repository(owner: $owner, name: $repo) {
432
+ pullRequests(first: $num, after: $cursor, baseRefName: $targetBranch, states: $states, orderBy: {field: CREATED_AT, direction: DESC}) {
433
+ nodes {
434
+ number
435
+ title
436
+ baseRefName
437
+ headRefName
438
+ labels(first: 10) {
439
+ nodes {
440
+ name
441
+ }
442
+ }
443
+ body
444
+ mergeCommit {
445
+ oid
446
+ }
447
+ files(first: $maxFilesChanged) {
448
+ nodes {
449
+ path
450
+ }
451
+ pageInfo {
452
+ endCursor
453
+ hasNextPage
454
+ }
455
+ }
456
+ }
457
+ pageInfo {
458
+ endCursor
459
+ hasNextPage
460
+ }
461
+ }
462
+ }
463
+ }`,
464
+ cursor,
465
+ owner: this.repository.owner,
466
+ repo: this.repository.repo,
467
+ num: 25,
468
+ targetBranch,
469
+ states,
470
+ maxFilesChanged: 64,
471
+ });
472
+ if (!((_a = response === null || response === void 0 ? void 0 : response.repository) === null || _a === void 0 ? void 0 : _a.pullRequests)) {
473
+ this.logger.warn(`Could not find merged pull requests for branch ${targetBranch} - it likely does not exist.`);
474
+ return null;
475
+ }
476
+ const pullRequests = (response.repository.pullRequests.nodes ||
477
+ []);
478
+ return {
479
+ pageInfo: response.repository.pullRequests.pageInfo,
480
+ data: pullRequests.map(pullRequest => {
481
+ var _a, _b, _c;
482
+ return {
483
+ sha: (_a = pullRequest.mergeCommit) === null || _a === void 0 ? void 0 : _a.oid,
484
+ number: pullRequest.number,
485
+ baseBranchName: pullRequest.baseRefName,
486
+ headBranchName: pullRequest.headRefName,
487
+ labels: (((_b = pullRequest.labels) === null || _b === void 0 ? void 0 : _b.nodes) || []).map(l => l.name),
488
+ title: pullRequest.title,
489
+ body: pullRequest.body + '',
490
+ files: (((_c = pullRequest.files) === null || _c === void 0 ? void 0 : _c.nodes) || []).map(node => node.path),
491
+ };
492
+ }),
493
+ };
494
+ }
495
+ /**
496
+ * Iterate through releases with a max number of results scanned.
497
+ *
498
+ * @param {ReleaseIteratorOptions} options Query options
499
+ * @param {number} options.maxResults Limit the number of results scanned.
500
+ * Defaults to unlimited.
501
+ * @yields {ScmRelease}
502
+ * @throws {GitHubAPIError} on an API error
503
+ */
504
+ async *releaseIterator(options = {}) {
505
+ var _a;
506
+ const maxResults = (_a = options.maxResults) !== null && _a !== void 0 ? _a : Number.MAX_SAFE_INTEGER;
507
+ let results = 0;
508
+ let cursor = undefined;
509
+ while (true) {
510
+ const response = await this.releaseGraphQL(cursor);
511
+ if (!response) {
512
+ break;
513
+ }
514
+ for (let i = 0; i < response.data.length; i++) {
515
+ if ((results += 1) > maxResults) {
516
+ break;
517
+ }
518
+ yield response.data[i];
519
+ }
520
+ if (results > maxResults || !response.pageInfo.hasNextPage) {
521
+ break;
522
+ }
523
+ cursor = response.pageInfo.endCursor;
524
+ }
525
+ }
526
+ async releaseGraphQL(cursor) {
527
+ var _a, _b, _c;
528
+ this.logger.debug(`Fetching releases with cursor ${cursor}`);
529
+ const response = await this.graphqlRequest({
530
+ query: `query releases($owner: String!, $repo: String!, $num: Int!, $cursor: String) {
531
+ repository(owner: $owner, name: $repo) {
532
+ releases(first: $num, after: $cursor, orderBy: {field: CREATED_AT, direction: DESC}) {
533
+ nodes {
534
+ name
535
+ tag {
536
+ name
537
+ }
538
+ tagCommit {
539
+ oid
540
+ }
541
+ url
542
+ description
543
+ isDraft
544
+ }
545
+ pageInfo {
546
+ endCursor
547
+ hasNextPage
548
+ }
549
+ }
550
+ }
551
+ }`,
552
+ cursor,
553
+ owner: this.repository.owner,
554
+ repo: this.repository.repo,
555
+ num: 25,
556
+ });
557
+ if (!((_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.repository) === null || _a === void 0 ? void 0 : _a.releases) === null || _b === void 0 ? void 0 : _b.nodes) === null || _c === void 0 ? void 0 : _c.length)) {
558
+ this.logger.warn('Could not find releases.');
559
+ return null;
560
+ }
561
+ const releases = response.repository.releases.nodes;
562
+ return {
563
+ pageInfo: response.repository.releases.pageInfo,
564
+ data: releases
565
+ .filter(release => !!release.tagCommit)
566
+ .map(release => {
567
+ if (!release.tag || !release.tagCommit) {
568
+ this.logger.debug(release);
569
+ }
570
+ return {
571
+ name: release.name || undefined,
572
+ tagName: release.tag ? release.tag.name : 'unknown',
573
+ sha: release.tagCommit.oid,
574
+ notes: release.description,
575
+ url: release.url,
576
+ draft: release.isDraft,
577
+ };
578
+ }),
579
+ };
580
+ }
581
+ /**
582
+ * Generate release notes from GitHub at tag
583
+ * @param {string} tagName Name of new release tag
584
+ * @param {string} targetCommitish Target commitish for new tag
585
+ * @param {string} previousTag Optional. Name of previous tag to analyze commits since
586
+ */
587
+ async generateReleaseNotes(tagName, targetCommitish, previousTag) {
588
+ const resp = await this.octokit.repos.generateReleaseNotes({
589
+ owner: this.repository.owner,
590
+ repo: this.repository.repo,
591
+ tag_name: tagName,
592
+ previous_tag_name: previousTag,
593
+ target_commitish: targetCommitish,
594
+ });
595
+ return resp.data.body;
596
+ }
597
+ /**
598
+ * Create a single file on a new branch based on an existing
599
+ * branch. This will force-push to that branch.
600
+ * @param {string} filename Filename with path in the repository
601
+ * @param {string} contents Contents of the file
602
+ * @param {string} newBranchName Name of the new branch
603
+ * @param {string} baseBranchName Name of the base branch (where
604
+ * new branch is forked from)
605
+ * @returns {string} HTML URL of the new file
606
+ */
607
+ async createFileOnNewBranch(filename, contents, newBranchName, baseBranchName) {
608
+ // create or update new branch to match base branch
609
+ await this.forkBranch(newBranchName, baseBranchName);
610
+ // use the single file upload API
611
+ const { data: { content }, } = await this.octokit.repos.createOrUpdateFileContents({
612
+ owner: this.repository.owner,
613
+ repo: this.repository.repo,
614
+ path: filename,
615
+ // contents need to be base64 encoded
616
+ content: Buffer.from(contents, 'binary').toString('base64'),
617
+ message: 'Saving release notes',
618
+ branch: newBranchName,
619
+ });
620
+ return (content === null || content === void 0 ? void 0 : content.html_url) || '';
621
+ }
622
+ /**
623
+ * Fork a branch from a base branch.
624
+ */
625
+ async forkBranch(targetBranchName, baseBranchName) {
626
+ const baseBranchSha = await this.getBranchSha(baseBranchName);
627
+ if (!baseBranchSha) {
628
+ throw new errors_1.ConfigurationError(`Unable to find base branch: ${baseBranchName}`, 'core', `${this.repository.owner}/${this.repository.repo}`);
629
+ }
630
+ if (await this.getBranchSha(targetBranchName)) {
631
+ const branchSha = await this.updateBranchSha(targetBranchName, baseBranchSha);
632
+ this.logger.debug(`Updated ${targetBranchName} to match ${baseBranchName} at ${branchSha}`);
633
+ return branchSha;
634
+ }
635
+ else {
636
+ const branchSha = await this.createNewBranch(targetBranchName, baseBranchSha);
637
+ this.logger.debug(`Created ${targetBranchName} from ${baseBranchName} at ${branchSha}`);
638
+ return branchSha;
639
+ }
640
+ }
641
+ /**
642
+ * Helper to fetch the SHA of a branch
643
+ */
644
+ async getBranchSha(branchName) {
645
+ this.logger.debug(`Looking up SHA for branch: ${branchName}`);
646
+ try {
647
+ const { data: { object: { sha }, }, } = await this.octokit.git.getRef({
648
+ owner: this.repository.owner,
649
+ repo: this.repository.repo,
650
+ ref: `heads/${branchName}`,
651
+ });
652
+ this.logger.debug(`SHA for branch: ${sha}`);
653
+ return sha;
654
+ }
655
+ catch (e) {
656
+ if (e instanceof request_error_1.RequestError && e.status === 404) {
657
+ this.logger.debug(`Branch: ${branchName} does not exist`);
658
+ return undefined;
659
+ }
660
+ throw e;
661
+ }
662
+ }
663
+ /**
664
+ * Helper to create a new branch from a given SHA.
665
+ */
666
+ async createNewBranch(branchName, branchSha) {
667
+ this.logger.debug(`Creating new branch: ${branchName} at ${branchSha}`);
668
+ const { data: { object: { sha }, }, } = await this.octokit.git.createRef({
669
+ owner: this.repository.owner,
670
+ repo: this.repository.repo,
671
+ ref: `refs/heads/${branchName}`,
672
+ sha: branchSha,
673
+ });
674
+ this.logger.debug(`New branch: ${branchName} at ${sha}`);
675
+ return sha;
676
+ }
677
+ /**
678
+ * Helper to update branch SHA.
679
+ */
680
+ async updateBranchSha(branchName, branchSha) {
681
+ this.logger.debug(`Updating branch ${branchName} to ${branchSha}`);
682
+ const { data: { object: { sha }, }, } = await this.octokit.git.updateRef({
683
+ owner: this.repository.owner,
684
+ repo: this.repository.repo,
685
+ ref: `heads/${branchName}`,
686
+ sha: branchSha,
687
+ force: true,
688
+ });
689
+ this.logger.debug(`Updated branch: ${branchName} to ${sha}`);
690
+ return sha;
691
+ }
692
+ }
693
+ exports.GitHubApi = GitHubApi;
694
+ /* eslint-disable @typescript-eslint/no-explicit-any */
695
+ const wrapAsync = (fn, errorHandler) => {
696
+ return async (...args) => {
697
+ try {
698
+ return await fn(...args);
699
+ }
700
+ catch (e) {
701
+ if (errorHandler) {
702
+ errorHandler(e);
703
+ }
704
+ if (e instanceof request_error_1.RequestError) {
705
+ throw new errors_1.GitHubAPIError(e);
706
+ }
707
+ throw e;
708
+ }
709
+ };
710
+ };
711
+ exports.wrapAsync = wrapAsync;
712
+ const sleepInMs = (ms) => new Promise(resolve => setTimeout(resolve, ms));
713
+ exports.sleepInMs = sleepInMs;
714
+ //# sourceMappingURL=github-api.js.map