aws-delivlib 14.4.2 → 14.4.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 (599) hide show
  1. package/lib/publishing/github/node_modules/.yarn-integrity +42 -36
  2. package/lib/publishing/github/node_modules/@octokit/app/dist-node/index.js +146 -106
  3. package/lib/publishing/github/node_modules/@octokit/app/dist-node/index.js.map +7 -1
  4. package/lib/publishing/github/node_modules/@octokit/app/dist-src/each-installation.js +34 -23
  5. package/lib/publishing/github/node_modules/@octokit/app/dist-src/each-repository.js +46 -38
  6. package/lib/publishing/github/node_modules/@octokit/app/dist-src/get-installation-octokit.js +16 -13
  7. package/lib/publishing/github/node_modules/@octokit/app/dist-src/index.js +76 -63
  8. package/lib/publishing/github/node_modules/@octokit/app/dist-src/middleware/node/index.js +48 -41
  9. package/lib/publishing/github/node_modules/@octokit/app/dist-src/middleware/node/on-unhandled-request-default.js +12 -7
  10. package/lib/publishing/github/node_modules/@octokit/app/dist-src/version.js +4 -1
  11. package/lib/publishing/github/node_modules/@octokit/app/dist-src/webhooks.js +44 -51
  12. package/lib/publishing/github/node_modules/@octokit/app/dist-types/each-installation.d.ts +6 -3
  13. package/lib/publishing/github/node_modules/@octokit/app/dist-types/each-repository.d.ts +1 -0
  14. package/lib/publishing/github/node_modules/@octokit/app/dist-types/version.d.ts +1 -1
  15. package/lib/publishing/github/node_modules/@octokit/app/dist-web/index.js +306 -0
  16. package/lib/publishing/github/node_modules/@octokit/app/dist-web/index.js.map +7 -0
  17. package/lib/publishing/github/node_modules/@octokit/app/package.json +22 -21
  18. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-node/index.js +239 -180
  19. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-node/index.js.map +7 -1
  20. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/auth.js +27 -24
  21. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/cache.js +73 -66
  22. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/get-app-authentication.js +28 -21
  23. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/get-installation-authentication.js +96 -74
  24. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/hook.js +79 -75
  25. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/index.js +51 -39
  26. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/requires-app-auth.js +30 -47
  27. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/to-token-authentication.js +29 -11
  28. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/version.js +4 -1
  29. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/auth.d.ts +1 -1
  30. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/cache.d.ts +3 -3
  31. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/get-app-authentication.d.ts +1 -1
  32. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/get-installation-authentication.d.ts +1 -1
  33. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/hook.d.ts +1 -1
  34. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/index.d.ts +2 -2
  35. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/to-token-authentication.d.ts +1 -1
  36. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/types.d.ts +1 -1
  37. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-types/version.d.ts +1 -1
  38. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-web/index.js +405 -360
  39. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-web/index.js.map +7 -1
  40. package/lib/publishing/github/node_modules/@octokit/auth-app/package.json +24 -25
  41. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-node/index.js +15 -17
  42. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-node/index.js.map +1 -1
  43. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-src/version.js +1 -1
  44. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-types/types.d.ts +17 -17
  45. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-types/version.d.ts +1 -1
  46. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-web/index.js +1 -1
  47. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/dist-web/index.js.map +1 -1
  48. package/lib/publishing/github/node_modules/@octokit/auth-oauth-app/package.json +3 -3
  49. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-node/index.js +23 -31
  50. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-node/index.js.map +1 -1
  51. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-src/version.js +1 -1
  52. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-types/types.d.ts +12 -12
  53. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-types/version.d.ts +1 -1
  54. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-web/index.js +1 -1
  55. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/dist-web/index.js.map +1 -1
  56. package/lib/publishing/github/node_modules/@octokit/auth-oauth-device/package.json +5 -5
  57. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/README.md +23 -1
  58. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-node/index.js +40 -39
  59. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-node/index.js.map +1 -1
  60. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/auth.js +8 -0
  61. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/get-authentication.js +3 -0
  62. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/index.js +2 -1
  63. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-src/version.js +1 -1
  64. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/hook.d.ts +1 -1
  65. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/types.d.ts +38 -34
  66. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-types/version.d.ts +1 -1
  67. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-web/index.js +14 -2
  68. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/dist-web/index.js.map +1 -1
  69. package/lib/publishing/github/node_modules/@octokit/auth-oauth-user/package.json +5 -5
  70. package/lib/publishing/github/node_modules/@octokit/auth-token/README.md +5 -10
  71. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-node/index.js +44 -20
  72. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-node/index.js.map +7 -1
  73. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/auth.js +13 -17
  74. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/hook.js +10 -4
  75. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/index.js +16 -11
  76. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js +8 -10
  77. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/auth.d.ts +1 -1
  78. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/hook.d.ts +1 -1
  79. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/index.d.ts +2 -2
  80. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-types/types.d.ts +13 -13
  81. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-web/index.js +42 -45
  82. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-web/index.js.map +7 -1
  83. package/lib/publishing/github/node_modules/@octokit/auth-token/package.json +23 -27
  84. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-node/index.js +47 -22
  85. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-node/index.js.map +7 -1
  86. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/auth.js +8 -5
  87. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/hook.js +33 -24
  88. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/index.js +12 -7
  89. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/is-abuse-limit-error.js +8 -5
  90. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/is-rate-limit-error.js +11 -9
  91. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-types/index.d.ts +1 -1
  92. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-types/types.d.ts +9 -9
  93. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-web/index.js +62 -50
  94. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-web/index.js.map +7 -1
  95. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/package.json +22 -23
  96. package/lib/publishing/github/node_modules/@octokit/core/README.md +4 -4
  97. package/lib/publishing/github/node_modules/@octokit/core/dist-node/index.js +119 -100
  98. package/lib/publishing/github/node_modules/@octokit/core/dist-node/index.js.map +7 -1
  99. package/lib/publishing/github/node_modules/@octokit/core/dist-src/index.js +114 -112
  100. package/lib/publishing/github/node_modules/@octokit/core/dist-src/version.js +4 -1
  101. package/lib/publishing/github/node_modules/@octokit/core/dist-types/types.d.ts +7 -7
  102. package/lib/publishing/github/node_modules/@octokit/core/dist-types/version.d.ts +1 -1
  103. package/lib/publishing/github/node_modules/@octokit/core/dist-web/index.js +124 -122
  104. package/lib/publishing/github/node_modules/@octokit/core/dist-web/index.js.map +7 -1
  105. package/lib/publishing/github/node_modules/@octokit/core/package.json +26 -27
  106. package/lib/publishing/github/node_modules/@octokit/endpoint/README.md +3 -3
  107. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-node/index.js +22 -62
  108. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-node/index.js.map +1 -1
  109. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-src/version.js +1 -1
  110. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-types/version.d.ts +1 -1
  111. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-web/index.js +1 -1
  112. package/lib/publishing/github/node_modules/@octokit/endpoint/dist-web/index.js.map +1 -1
  113. package/lib/publishing/github/node_modules/@octokit/endpoint/package.json +4 -4
  114. package/lib/publishing/github/node_modules/@octokit/graphql/README.md +1 -1
  115. package/lib/publishing/github/node_modules/@octokit/graphql/dist-node/index.js +81 -39
  116. package/lib/publishing/github/node_modules/@octokit/graphql/dist-node/index.js.map +7 -1
  117. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/error.js +17 -17
  118. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/graphql.js +55 -44
  119. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/index.js +17 -12
  120. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/version.js +4 -1
  121. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/with-defaults.js +12 -9
  122. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/error.d.ts +3 -3
  123. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/graphql.d.ts +1 -1
  124. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/index.d.ts +1 -1
  125. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/types.d.ts +7 -7
  126. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/version.d.ts +1 -1
  127. package/lib/publishing/github/node_modules/@octokit/graphql/dist-types/with-defaults.d.ts +1 -1
  128. package/lib/publishing/github/node_modules/@octokit/graphql/dist-web/index.js +103 -90
  129. package/lib/publishing/github/node_modules/@octokit/graphql/dist-web/index.js.map +7 -1
  130. package/lib/publishing/github/node_modules/@octokit/graphql/package.json +23 -24
  131. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-node/index.js +290 -263
  132. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-node/index.js.map +7 -1
  133. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/add-event-handler.js +13 -10
  134. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/emit-event.js +13 -10
  135. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/index.js +108 -64
  136. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/check-token.js +14 -11
  137. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/create-token.js +27 -24
  138. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/delete-authorization.js +43 -40
  139. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/delete-token.js +32 -29
  140. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-oauth-client-code.js +5 -2
  141. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-user-octokit.js +29 -24
  142. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/get-web-flow-authorization-url.js +16 -28
  143. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/refresh-token.js +34 -29
  144. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/reset-token.js +58 -55
  145. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/methods/scope-token.js +34 -29
  146. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2-parse-request.js +14 -11
  147. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2-send-response.js +9 -6
  148. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/aws-lambda/api-gateway-v2.js +21 -13
  149. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/handle-request.js +217 -210
  150. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/index.js +30 -20
  151. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/parse-request.js +13 -13
  152. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/node/send-response.js +6 -3
  153. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/on-unhandled-request-default.js +11 -8
  154. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/index.js +31 -19
  155. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/parse-request.js +11 -9
  156. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/web-worker/send-response.js +8 -5
  157. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/oauth-app-octokit.js +5 -2
  158. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/version.js +4 -1
  159. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-types/middleware/web-worker/index.d.ts +1 -1
  160. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-types/version.d.ts +1 -1
  161. package/lib/publishing/github/node_modules/@octokit/oauth-app/package.json +20 -20
  162. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-node/index.js +1 -1
  163. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-node/index.js.map +1 -1
  164. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-src/version.js +1 -1
  165. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/check-token.d.ts +4 -4
  166. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/create-device-code.d.ts +3 -3
  167. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/delete-authorization.d.ts +3 -3
  168. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/delete-token.d.ts +3 -3
  169. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/exchange-device-code.d.ts +11 -11
  170. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/exchange-web-flow-code.d.ts +4 -4
  171. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/get-web-flow-authorization-url.d.ts +4 -4
  172. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/refresh-token.d.ts +2 -2
  173. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/reset-token.d.ts +4 -4
  174. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/scope-token.d.ts +8 -8
  175. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/types.d.ts +9 -9
  176. package/lib/publishing/github/node_modules/@octokit/oauth-methods/dist-types/version.d.ts +1 -1
  177. package/lib/publishing/github/node_modules/@octokit/oauth-methods/package.json +7 -7
  178. package/lib/publishing/github/node_modules/@octokit/openapi-types/package.json +2 -2
  179. package/lib/publishing/github/node_modules/@octokit/openapi-types/types.d.ts +77450 -13127
  180. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +292 -57
  181. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js.map +7 -1
  182. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/compose-paginate.js +5 -2
  183. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/generated/paginating-endpoints.js +226 -213
  184. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/index.js +17 -12
  185. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/iterator.js +36 -37
  186. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/normalize-paginated-list-response.js +29 -45
  187. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/paginate.js +31 -21
  188. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/paginating-endpoints.js +14 -9
  189. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/version.js +4 -1
  190. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/compose-paginate.d.ts +1 -1
  191. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/generated/paginating-endpoints.d.ts +183 -111
  192. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/index.d.ts +3 -4
  193. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/iterator.d.ts +3 -3
  194. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/normalize-paginated-list-response.d.ts +1 -1
  195. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/paginate.d.ts +3 -3
  196. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/types.d.ts +29 -29
  197. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-types/version.d.ts +1 -1
  198. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js +334 -334
  199. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-web/index.js.map +7 -1
  200. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/package.json +24 -26
  201. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +99 -39
  202. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js.map +1 -1
  203. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/generated/endpoints.js +197 -77
  204. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-src/version.js +1 -1
  205. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types.d.ts +1419 -661
  206. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/generated/parameters-and-response-types.d.ts +359 -119
  207. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types.d.ts +3 -3
  208. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/version.d.ts +1 -1
  209. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js +198 -78
  210. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-web/index.js.map +1 -1
  211. package/lib/publishing/github/node_modules/@octokit/plugin-rest-endpoint-methods/package.json +9 -9
  212. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-node/index.js +80 -35
  213. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-node/index.js.map +7 -1
  214. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/error-request.js +12 -13
  215. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/index.js +29 -22
  216. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/version.js +4 -1
  217. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-src/wrap-request.js +31 -15
  218. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/error-request.d.ts +1 -1
  219. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/version.d.ts +1 -1
  220. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-types/wrap-request.d.ts +1 -1
  221. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-web/index.js +68 -54
  222. package/lib/publishing/github/node_modules/@octokit/plugin-retry/dist-web/index.js.map +7 -1
  223. package/lib/publishing/github/node_modules/@octokit/plugin-retry/package.json +21 -22
  224. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-node/index.js +18 -11
  225. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-node/index.js.map +1 -1
  226. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-src/index.js +21 -14
  227. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-src/version.js +1 -1
  228. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/index.d.ts +6 -0
  229. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/types.d.ts +13 -12
  230. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-types/version.d.ts +1 -1
  231. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-web/index.js +22 -15
  232. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/dist-web/index.js.map +1 -1
  233. package/lib/publishing/github/node_modules/@octokit/plugin-throttling/package.json +7 -7
  234. package/lib/publishing/github/node_modules/@octokit/request/README.md +3 -3
  235. package/lib/publishing/github/node_modules/@octokit/request/dist-node/index.js +105 -77
  236. package/lib/publishing/github/node_modules/@octokit/request/dist-node/index.js.map +7 -1
  237. package/lib/publishing/github/node_modules/@octokit/request/dist-src/fetch-wrapper.js +111 -108
  238. package/lib/publishing/github/node_modules/@octokit/request/dist-src/get-buffer-response.js +5 -2
  239. package/lib/publishing/github/node_modules/@octokit/request/dist-src/index.js +7 -4
  240. package/lib/publishing/github/node_modules/@octokit/request/dist-src/version.js +4 -1
  241. package/lib/publishing/github/node_modules/@octokit/request/dist-src/with-defaults.js +23 -18
  242. package/lib/publishing/github/node_modules/@octokit/request/dist-types/version.d.ts +1 -1
  243. package/lib/publishing/github/node_modules/@octokit/request/dist-web/index.js +148 -138
  244. package/lib/publishing/github/node_modules/@octokit/request/dist-web/index.js.map +7 -1
  245. package/lib/publishing/github/node_modules/@octokit/request/package.json +23 -24
  246. package/lib/publishing/github/node_modules/@octokit/request-error/dist-node/index.js +10 -19
  247. package/lib/publishing/github/node_modules/@octokit/request-error/dist-node/index.js.map +1 -1
  248. package/lib/publishing/github/node_modules/@octokit/request-error/dist-types/types.d.ts +1 -1
  249. package/lib/publishing/github/node_modules/@octokit/request-error/package.json +4 -4
  250. package/lib/publishing/github/node_modules/@octokit/tsconfig/LICENSE +7 -0
  251. package/lib/publishing/github/node_modules/@octokit/tsconfig/README.md +31 -0
  252. package/lib/publishing/github/node_modules/@octokit/tsconfig/package.json +28 -0
  253. package/lib/publishing/github/node_modules/@octokit/types/dist-node/index.js +1 -1
  254. package/lib/publishing/github/node_modules/@octokit/types/dist-src/VERSION.js +1 -1
  255. package/lib/publishing/github/node_modules/@octokit/types/dist-types/EndpointDefaults.d.ts +1 -1
  256. package/lib/publishing/github/node_modules/@octokit/types/dist-types/EndpointOptions.d.ts +1 -1
  257. package/lib/publishing/github/node_modules/@octokit/types/dist-types/Fetch.d.ts +1 -1
  258. package/lib/publishing/github/node_modules/@octokit/types/dist-types/GetResponseTypeFromEndpointMethod.d.ts +4 -4
  259. package/lib/publishing/github/node_modules/@octokit/types/dist-types/OctokitResponse.d.ts +1 -1
  260. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestError.d.ts +1 -1
  261. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestHeaders.d.ts +1 -1
  262. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestMethod.d.ts +1 -1
  263. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestOptions.d.ts +1 -1
  264. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestParameters.d.ts +1 -1
  265. package/lib/publishing/github/node_modules/@octokit/types/dist-types/RequestRequestOptions.d.ts +1 -1
  266. package/lib/publishing/github/node_modules/@octokit/types/dist-types/ResponseHeaders.d.ts +1 -1
  267. package/lib/publishing/github/node_modules/@octokit/types/dist-types/Route.d.ts +1 -1
  268. package/lib/publishing/github/node_modules/@octokit/types/dist-types/Signal.d.ts +1 -1
  269. package/lib/publishing/github/node_modules/@octokit/types/dist-types/Url.d.ts +1 -1
  270. package/lib/publishing/github/node_modules/@octokit/types/dist-types/VERSION.d.ts +1 -1
  271. package/lib/publishing/github/node_modules/@octokit/types/dist-types/generated/Endpoints.d.ts +464 -332
  272. package/lib/publishing/github/node_modules/@octokit/types/dist-web/index.js +1 -1
  273. package/lib/publishing/github/node_modules/@octokit/types/package.json +10 -10
  274. package/lib/publishing/github/node_modules/@octokit/webhooks/README.md +68 -64
  275. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-node/index.js +467 -97
  276. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-node/index.js.map +7 -1
  277. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/createLogger.js +11 -6
  278. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/index.js +23 -16
  279. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/on.js +31 -22
  280. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/receive.js +51 -49
  281. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/remove-listener.js +18 -15
  282. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/event-handler/wrap-error-handler.js +17 -18
  283. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/generated/webhook-names.js +262 -254
  284. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/index.js +40 -22
  285. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/get-missing-headers.js +8 -6
  286. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/get-payload.js +27 -22
  287. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/index.js +19 -6
  288. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/middleware.js +86 -72
  289. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/on-unhandled-request-default.js +12 -7
  290. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/sign.js +8 -2
  291. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/to-normalized-json-string.js +8 -8
  292. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/verify-and-receive.js +22 -16
  293. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/verify.js +9 -2
  294. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/event-handler/on.d.ts +1 -1
  295. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/event-handler/remove-listener.d.ts +1 -1
  296. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/generated/webhook-names.d.ts +1 -1
  297. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/index.d.ts +14 -4
  298. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/get-missing-headers.d.ts +1 -1
  299. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/get-payload.d.ts +3 -3
  300. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/index.d.ts +2 -2
  301. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/middleware.d.ts +4 -4
  302. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/on-unhandled-request-default.d.ts +2 -2
  303. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/middleware/node/types.d.ts +5 -4
  304. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/to-normalized-json-string.d.ts +1 -1
  305. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/types.d.ts +12 -11
  306. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-types/verify-and-receive.d.ts +1 -1
  307. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-web/index.js +609 -533
  308. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-web/index.js.map +7 -1
  309. package/lib/publishing/github/node_modules/@octokit/webhooks/package.json +20 -22
  310. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/README.md +84 -3
  311. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-node/index.js +89 -48
  312. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-node/index.js.map +7 -1
  313. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/index.js +22 -2
  314. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/node/sign.js +19 -16
  315. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/node/verify.js +18 -14
  316. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/types.js +8 -5
  317. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/utils.js +5 -2
  318. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/version.js +4 -1
  319. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-src/web.js +62 -44
  320. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/index.d.ts +3 -1
  321. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/node/sign.d.ts +1 -1
  322. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/types.d.ts +2 -2
  323. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/version.d.ts +1 -1
  324. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-types/web.d.ts +1 -1
  325. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-web/index.js +71 -53
  326. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/dist-web/index.js.map +7 -1
  327. package/lib/publishing/github/node_modules/@octokit/webhooks-methods/package.json +36 -25
  328. package/lib/publishing/github/node_modules/@octokit/webhooks-types/package.json +1 -1
  329. package/lib/publishing/github/node_modules/@octokit/webhooks-types/schema.d.ts +670 -35
  330. package/lib/publishing/github/node_modules/@types/aws-lambda/README.md +2 -2
  331. package/lib/publishing/github/node_modules/@types/aws-lambda/index.d.ts +3 -2
  332. package/lib/publishing/github/node_modules/@types/aws-lambda/package.json +3 -8
  333. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/amplify-resolver.d.ts +38 -0
  334. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +75 -1
  335. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +4 -0
  336. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/codecommit.d.ts +36 -0
  337. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +8 -4
  338. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-sms-sender.d.ts +49 -0
  339. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +1 -0
  340. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +11 -1
  341. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +26 -1
  342. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/msk.d.ts +7 -0
  343. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/self-managed-kafka.d.ts +27 -0
  344. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/sns.d.ts +2 -2
  345. package/lib/publishing/github/node_modules/@types/aws-lambda/trigger/sqs.d.ts +1 -0
  346. package/lib/publishing/github/node_modules/@types/jsonwebtoken/README.md +1 -1
  347. package/lib/publishing/github/node_modules/@types/jsonwebtoken/index.d.ts +14 -0
  348. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/README.md +2 -2
  349. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/assert.d.ts +135 -75
  350. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/async_hooks.d.ts +67 -38
  351. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/buffer.d.ts +220 -101
  352. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/child_process.d.ts +87 -58
  353. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/cluster.d.ts +25 -29
  354. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/console.d.ts +5 -5
  355. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/crypto.d.ts +873 -249
  356. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dgram.d.ts +16 -16
  357. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/diagnostics_channel.d.ts +60 -21
  358. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns/promises.d.ts +52 -8
  359. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dns.d.ts +27 -18
  360. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/dom-events.d.ts +126 -0
  361. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/domain.d.ts +6 -5
  362. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/events.d.ts +166 -93
  363. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs/promises.d.ts +149 -74
  364. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/fs.d.ts +288 -121
  365. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/globals.d.ts +22 -13
  366. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http.d.ts +453 -125
  367. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/http2.d.ts +74 -46
  368. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/https.d.ts +103 -53
  369. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/index.d.ts +6 -2
  370. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/inspector.d.ts +20 -16
  371. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/module.d.ts +6 -4
  372. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/net.d.ts +106 -16
  373. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/os.d.ts +36 -14
  374. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/package.json +15 -3
  375. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/path.d.ts +37 -26
  376. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/perf_hooks.d.ts +96 -15
  377. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/process.d.ts +53 -50
  378. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/punycode.d.ts +1 -1
  379. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/querystring.d.ts +6 -6
  380. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline/promises.d.ts +145 -0
  381. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/readline.d.ts +51 -175
  382. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/repl.d.ts +21 -21
  383. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream/consumers.d.ts +2 -14
  384. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/stream.d.ts +983 -824
  385. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/string_decoder.d.ts +6 -6
  386. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/test.d.ts +1052 -0
  387. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers/promises.d.ts +26 -1
  388. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/timers.d.ts +125 -4
  389. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tls.d.ts +149 -50
  390. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/trace_events.d.ts +30 -9
  391. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
  392. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/assert.d.ts +972 -0
  393. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/async_hooks.d.ts +530 -0
  394. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/buffer.d.ts +2351 -0
  395. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/child_process.d.ts +1395 -0
  396. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
  397. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/console.d.ts +412 -0
  398. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  399. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/crypto.d.ts +3961 -0
  400. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
  401. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +191 -0
  402. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dns/promises.d.ts +414 -0
  403. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dns.d.ts +668 -0
  404. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
  405. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
  406. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/events.d.ts +724 -0
  407. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/fs/promises.d.ts +1189 -0
  408. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/fs.d.ts +4043 -0
  409. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/globals.d.ts +303 -0
  410. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  411. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/http.d.ts +1724 -0
  412. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/http2.d.ts +2129 -0
  413. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/https.d.ts +441 -0
  414. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/index.d.ts +88 -0
  415. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/inspector.d.ts +2748 -0
  416. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/module.d.ts +116 -0
  417. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/net.d.ts +886 -0
  418. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/os.d.ts +477 -0
  419. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/path.d.ts +191 -0
  420. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/perf_hooks.d.ts +638 -0
  421. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/process.d.ts +1485 -0
  422. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
  423. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
  424. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/readline/promises.d.ts +145 -0
  425. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/readline.d.ts +526 -0
  426. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
  427. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
  428. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
  429. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
  430. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/stream.d.ts +1392 -0
  431. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
  432. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/test.d.ts +1052 -0
  433. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
  434. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/timers.d.ts +215 -0
  435. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/tls.d.ts +1119 -0
  436. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/trace_events.d.ts +182 -0
  437. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/tty.d.ts +205 -0
  438. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/url.d.ts +901 -0
  439. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/util.d.ts +2052 -0
  440. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/v8.d.ts +635 -0
  441. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/vm.d.ts +894 -0
  442. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/wasi.d.ts +152 -0
  443. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/worker_threads.d.ts +693 -0
  444. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
  445. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/tty.d.ts +7 -6
  446. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/url.d.ts +66 -56
  447. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/util.d.ts +528 -70
  448. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/v8.d.ts +271 -14
  449. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/vm.d.ts +421 -34
  450. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/wasi.d.ts +13 -19
  451. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/worker_threads.d.ts +81 -37
  452. package/lib/publishing/github/node_modules/@types/jsonwebtoken/node_modules/@types/node/zlib.d.ts +11 -11
  453. package/lib/publishing/github/node_modules/@types/jsonwebtoken/package.json +3 -3
  454. package/lib/publishing/github/node_modules/@types/node/README.md +1 -1
  455. package/lib/publishing/github/node_modules/@types/node/child_process.d.ts +41 -2
  456. package/lib/publishing/github/node_modules/@types/node/crypto.d.ts +77 -7
  457. package/lib/publishing/github/node_modules/@types/node/fs/promises.d.ts +15 -12
  458. package/lib/publishing/github/node_modules/@types/node/globals.d.ts +5 -3
  459. package/lib/publishing/github/node_modules/@types/node/http.d.ts +142 -53
  460. package/lib/publishing/github/node_modules/@types/node/http2.d.ts +1 -2
  461. package/lib/publishing/github/node_modules/@types/node/https.d.ts +192 -62
  462. package/lib/publishing/github/node_modules/@types/node/index.d.ts +1 -1
  463. package/lib/publishing/github/node_modules/@types/node/inspector.d.ts +1 -1
  464. package/lib/publishing/github/node_modules/@types/node/net.d.ts +1 -0
  465. package/lib/publishing/github/node_modules/@types/node/os.d.ts +1 -0
  466. package/lib/publishing/github/node_modules/@types/node/package.json +10 -3
  467. package/lib/publishing/github/node_modules/@types/node/path.d.ts +32 -21
  468. package/lib/publishing/github/node_modules/@types/node/stream.d.ts +99 -0
  469. package/lib/publishing/github/node_modules/@types/node/tls.d.ts +13 -13
  470. package/lib/publishing/github/node_modules/@types/node/ts4.8/assert.d.ts +128 -0
  471. package/lib/publishing/github/node_modules/@types/node/ts4.8/async_hooks.d.ts +229 -0
  472. package/lib/publishing/github/node_modules/@types/node/ts4.8/buffer.d.ts +89 -0
  473. package/lib/publishing/github/node_modules/@types/node/ts4.8/child_process.d.ts +553 -0
  474. package/lib/publishing/github/node_modules/@types/node/ts4.8/cluster.d.ts +265 -0
  475. package/lib/publishing/github/node_modules/@types/node/ts4.8/console.d.ts +142 -0
  476. package/lib/publishing/github/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
  477. package/lib/publishing/github/node_modules/@types/node/ts4.8/crypto.d.ts +1283 -0
  478. package/lib/publishing/github/node_modules/@types/node/ts4.8/dgram.d.ts +144 -0
  479. package/lib/publishing/github/node_modules/@types/node/ts4.8/dns.d.ts +387 -0
  480. package/lib/publishing/github/node_modules/@types/node/ts4.8/domain.d.ts +27 -0
  481. package/lib/publishing/github/node_modules/@types/node/ts4.8/events.d.ts +82 -0
  482. package/lib/publishing/github/node_modules/@types/node/ts4.8/fs/promises.d.ts +572 -0
  483. package/lib/publishing/github/node_modules/@types/node/ts4.8/fs.d.ts +2281 -0
  484. package/lib/publishing/github/node_modules/@types/node/ts4.8/globals.d.ts +746 -0
  485. package/lib/publishing/github/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
  486. package/lib/publishing/github/node_modules/@types/node/ts4.8/http.d.ts +580 -0
  487. package/lib/publishing/github/node_modules/@types/node/ts4.8/http2.d.ts +961 -0
  488. package/lib/publishing/github/node_modules/@types/node/ts4.8/https.d.ts +272 -0
  489. package/lib/publishing/github/node_modules/@types/node/ts4.8/index.d.ts +53 -0
  490. package/lib/publishing/github/node_modules/@types/node/ts4.8/inspector.d.ts +3051 -0
  491. package/lib/publishing/github/node_modules/@types/node/ts4.8/module.d.ts +56 -0
  492. package/lib/publishing/github/node_modules/@types/node/ts4.8/net.d.ts +309 -0
  493. package/lib/publishing/github/node_modules/@types/node/ts4.8/os.d.ts +243 -0
  494. package/lib/publishing/github/node_modules/@types/node/ts4.8/path.d.ts +168 -0
  495. package/lib/publishing/github/node_modules/@types/node/ts4.8/perf_hooks.d.ts +274 -0
  496. package/lib/publishing/github/node_modules/@types/node/ts4.8/process.d.ts +413 -0
  497. package/lib/publishing/github/node_modules/@types/node/ts4.8/punycode.d.ts +78 -0
  498. package/lib/publishing/github/node_modules/@types/node/ts4.8/querystring.d.ts +31 -0
  499. package/lib/publishing/github/node_modules/@types/node/ts4.8/readline.d.ts +174 -0
  500. package/lib/publishing/github/node_modules/@types/node/ts4.8/repl.d.ts +398 -0
  501. package/lib/publishing/github/node_modules/@types/node/ts4.8/stream.d.ts +458 -0
  502. package/lib/publishing/github/node_modules/@types/node/ts4.8/string_decoder.d.ts +10 -0
  503. package/lib/publishing/github/node_modules/@types/node/ts4.8/timers.d.ts +19 -0
  504. package/lib/publishing/github/node_modules/@types/node/ts4.8/tls.d.ts +784 -0
  505. package/lib/publishing/github/node_modules/@types/node/ts4.8/trace_events.d.ts +64 -0
  506. package/lib/publishing/github/node_modules/@types/node/ts4.8/tty.d.ts +69 -0
  507. package/lib/publishing/github/node_modules/@types/node/ts4.8/url.d.ts +177 -0
  508. package/lib/publishing/github/node_modules/@types/node/ts4.8/util.d.ts +216 -0
  509. package/lib/publishing/github/node_modules/@types/node/ts4.8/v8.d.ts +190 -0
  510. package/lib/publishing/github/node_modules/@types/node/ts4.8/vm.d.ts +155 -0
  511. package/lib/publishing/github/node_modules/@types/node/ts4.8/wasi.d.ts +89 -0
  512. package/lib/publishing/github/node_modules/@types/node/ts4.8/worker_threads.d.ts +241 -0
  513. package/lib/publishing/github/node_modules/@types/node/ts4.8/zlib.d.ts +364 -0
  514. package/lib/publishing/github/node_modules/@types/node/url.d.ts +28 -0
  515. package/lib/publishing/github/node_modules/before-after-hook/README.md +1 -3
  516. package/lib/publishing/github/node_modules/before-after-hook/index.d.ts +48 -48
  517. package/lib/publishing/github/node_modules/before-after-hook/index.js +43 -39
  518. package/lib/publishing/github/node_modules/before-after-hook/package.json +15 -10
  519. package/lib/publishing/github/node_modules/lru-cache/LICENSE +1 -1
  520. package/lib/publishing/github/node_modules/lru-cache/README.md +1127 -104
  521. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.d.ts +834 -0
  522. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.d.ts.map +1 -0
  523. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.js +1395 -0
  524. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.js.map +1 -0
  525. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.min.js +2 -0
  526. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/index.min.js.map +7 -0
  527. package/lib/publishing/github/node_modules/lru-cache/dist/cjs/package.json +3 -0
  528. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.d.ts +834 -0
  529. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.d.ts.map +1 -0
  530. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.js +1391 -0
  531. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.js.map +1 -0
  532. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.min.js +2 -0
  533. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/index.min.js.map +7 -0
  534. package/lib/publishing/github/node_modules/lru-cache/dist/mjs/package.json +3 -0
  535. package/lib/publishing/github/node_modules/lru-cache/package.json +86 -12
  536. package/lib/publishing/github/node_modules/node-fetch/README.md +43 -0
  537. package/lib/publishing/github/node_modules/node-fetch/browser.js +7 -7
  538. package/lib/publishing/github/node_modules/node-fetch/lib/index.es.js +92 -2
  539. package/lib/publishing/github/node_modules/node-fetch/lib/index.js +92 -2
  540. package/lib/publishing/github/node_modules/node-fetch/lib/index.mjs +92 -2
  541. package/lib/publishing/github/node_modules/node-fetch/package.json +16 -3
  542. package/lib/publishing/github/node_modules/octokit/README.md +4 -4
  543. package/lib/publishing/github/node_modules/octokit/dist-node/index.js +60 -33
  544. package/lib/publishing/github/node_modules/octokit/dist-node/index.js.map +7 -1
  545. package/lib/publishing/github/node_modules/octokit/dist-src/app.js +8 -3
  546. package/lib/publishing/github/node_modules/octokit/dist-src/index.js +8 -2
  547. package/lib/publishing/github/node_modules/octokit/dist-src/octokit.js +28 -20
  548. package/lib/publishing/github/node_modules/octokit/dist-src/version.js +4 -1
  549. package/lib/publishing/github/node_modules/octokit/dist-types/app.d.ts +2 -2
  550. package/lib/publishing/github/node_modules/octokit/dist-types/octokit.d.ts +1 -1
  551. package/lib/publishing/github/node_modules/octokit/dist-types/version.d.ts +1 -1
  552. package/lib/publishing/github/node_modules/octokit/dist-web/index.js +46 -34
  553. package/lib/publishing/github/node_modules/octokit/dist-web/index.js.map +7 -1
  554. package/lib/publishing/github/node_modules/octokit/package.json +26 -28
  555. package/lib/publishing/github/node_modules/semver/README.md +67 -0
  556. package/lib/publishing/github/node_modules/semver/bin/semver.js +16 -2
  557. package/lib/publishing/github/node_modules/semver/classes/comparator.js +37 -33
  558. package/lib/publishing/github/node_modules/semver/classes/range.js +6 -2
  559. package/lib/publishing/github/node_modules/semver/classes/semver.js +27 -14
  560. package/lib/publishing/github/node_modules/semver/functions/diff.js +48 -17
  561. package/lib/publishing/github/node_modules/semver/functions/inc.js +3 -2
  562. package/lib/publishing/github/node_modules/semver/functions/parse.js +5 -22
  563. package/lib/publishing/github/node_modules/semver/index.js +1 -0
  564. package/lib/publishing/github/node_modules/semver/internal/constants.js +15 -2
  565. package/lib/publishing/github/node_modules/semver/internal/parse-options.js +14 -10
  566. package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/LICENSE +15 -0
  567. package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/README.md +166 -0
  568. package/lib/publishing/github/node_modules/semver/node_modules/lru-cache/package.json +34 -0
  569. package/lib/publishing/github/node_modules/semver/package.json +7 -6
  570. package/lib/publishing/github/node_modules/semver/ranges/intersects.js +1 -1
  571. package/lib/publishing/github/node_modules/semver/ranges/subset.js +6 -3
  572. package/lib/publishing/github/node_modules/typescript/lib/tsc.js +8 -3
  573. package/lib/publishing/github/node_modules/typescript/lib/tsserver.js +13 -3
  574. package/lib/publishing/github/node_modules/typescript/lib/tsserverlibrary.js +13 -3
  575. package/lib/publishing/github/node_modules/typescript/lib/typescript.js +13 -3
  576. package/lib/publishing/github/node_modules/typescript/lib/typescriptServices.js +13 -3
  577. package/lib/publishing/github/node_modules/typescript/lib/typingsInstaller.js +13 -3
  578. package/lib/publishing/github/node_modules/typescript/package.json +1 -1
  579. package/lib/publishing/github/package-lock.json +675 -0
  580. package/lib/publishing/github/package.json +1 -1
  581. package/lib/publishing/github/publish.sh +3 -1
  582. package/package.json +1 -1
  583. package/lib/publishing/github/node_modules/@octokit/app/dist-src/types.js +0 -1
  584. package/lib/publishing/github/node_modules/@octokit/auth-app/dist-src/types.js +0 -1
  585. package/lib/publishing/github/node_modules/@octokit/auth-token/dist-src/types.js +0 -1
  586. package/lib/publishing/github/node_modules/@octokit/auth-unauthenticated/dist-src/types.js +0 -1
  587. package/lib/publishing/github/node_modules/@octokit/core/dist-src/types.js +0 -1
  588. package/lib/publishing/github/node_modules/@octokit/graphql/dist-src/types.js +0 -1
  589. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/middleware/types.js +0 -1
  590. package/lib/publishing/github/node_modules/@octokit/oauth-app/dist-src/types.js +0 -1
  591. package/lib/publishing/github/node_modules/@octokit/plugin-paginate-rest/dist-src/types.js +0 -1
  592. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/middleware/node/types.js +0 -1
  593. package/lib/publishing/github/node_modules/@octokit/webhooks/dist-src/types.js +0 -1
  594. package/lib/publishing/github/node_modules/@types/lru-cache/LICENSE +0 -21
  595. package/lib/publishing/github/node_modules/@types/lru-cache/README.md +0 -16
  596. package/lib/publishing/github/node_modules/@types/lru-cache/index.d.ts +0 -193
  597. package/lib/publishing/github/node_modules/@types/lru-cache/package.json +0 -30
  598. package/lib/publishing/github/yarn.lock +0 -473
  599. /package/lib/publishing/github/node_modules/{lru-cache → semver/node_modules/lru-cache}/index.js +0 -0
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sources":["../dist-src/get-app-authentication.js","../dist-src/cache.js","../dist-src/to-token-authentication.js","../dist-src/get-installation-authentication.js","../dist-src/auth.js","../dist-src/requires-app-auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { githubAppJwt } from \"universal-github-app-jwt\";\nexport async function getAppAuthentication({ appId, privateKey, timeDifference, }) {\n try {\n const appAuthentication = await githubAppJwt({\n id: +appId,\n privateKey,\n now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,\n });\n return {\n type: \"app\",\n token: appAuthentication.token,\n appId: appAuthentication.appId,\n expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),\n };\n }\n catch (error) {\n if (privateKey === \"-----BEGIN RSA PRIVATE KEY-----\") {\n throw new Error(\"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\\n'\");\n }\n else {\n throw error;\n }\n }\n}\n","// https://github.com/isaacs/node-lru-cache#readme\nimport LRU from \"lru-cache\";\nexport function getCache() {\n return new LRU({\n // cache max. 15000 tokens, that will use less than 10mb memory\n max: 15000,\n // Cache for 1 minute less than GitHub expiry\n maxAge: 1000 * 60 * 59,\n });\n}\nexport async function get(cache, options) {\n const cacheKey = optionsToCacheKey(options);\n const result = await cache.get(cacheKey);\n if (!result) {\n return;\n }\n const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split(\"|\");\n const permissions = options.permissions ||\n permissionsString.split(/,/).reduce((permissions, string) => {\n if (/!$/.test(string)) {\n permissions[string.slice(0, -1)] = \"write\";\n }\n else {\n permissions[string] = \"read\";\n }\n return permissions;\n }, {});\n return {\n token,\n createdAt,\n expiresAt,\n permissions,\n repositoryIds: options.repositoryIds,\n repositoryNames: options.repositoryNames,\n singleFileName,\n repositorySelection: repositorySelection,\n };\n}\nexport async function set(cache, options, data) {\n const key = optionsToCacheKey(options);\n const permissionsString = options.permissions\n ? \"\"\n : Object.keys(data.permissions)\n .map((name) => `${name}${data.permissions[name] === \"write\" ? \"!\" : \"\"}`)\n .join(\",\");\n const value = [\n data.token,\n data.createdAt,\n data.expiresAt,\n data.repositorySelection,\n permissionsString,\n data.singleFileName,\n ].join(\"|\");\n await cache.set(key, value);\n}\nfunction optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {\n const permissionsString = Object.keys(permissions)\n .sort()\n .map((name) => (permissions[name] === \"read\" ? name : `${name}!`))\n .join(\",\");\n const repositoryIdsString = repositoryIds.sort().join(\",\");\n const repositoryNamesString = repositoryNames.join(\",\");\n return [\n installationId,\n repositoryIdsString,\n repositoryNamesString,\n permissionsString,\n ]\n .filter(Boolean)\n .join(\"|\");\n}\n","export function toTokenAuthentication({ installationId, token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, repositoryNames, singleFileName, }) {\n return Object.assign({\n type: \"token\",\n tokenType: \"installation\",\n token,\n installationId,\n permissions,\n createdAt,\n expiresAt,\n repositorySelection,\n }, repositoryIds ? { repositoryIds } : null, repositoryNames ? { repositoryNames } : null, singleFileName ? { singleFileName } : null);\n}\n","import { get, set } from \"./cache\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { toTokenAuthentication } from \"./to-token-authentication\";\nexport async function getInstallationAuthentication(state, options, customRequest) {\n const installationId = Number(options.installationId || state.installationId);\n if (!installationId) {\n throw new Error(\"[@octokit/auth-app] installationId option is required for installation authentication.\");\n }\n if (options.factory) {\n const { type, factory, oauthApp, ...factoryAuthOptions } = {\n ...state,\n ...options,\n };\n // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise<ReturnType<options.factory>>`\n return factory(factoryAuthOptions);\n }\n const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);\n if (!options.refresh) {\n const result = await get(state.cache, optionsWithInstallationTokenFromState);\n if (result) {\n const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n permissions,\n repositorySelection,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n }\n }\n const appAuthentication = await getAppAuthentication(state);\n const request = customRequest || state.request;\n const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request(\"POST /app/installations/{installation_id}/access_tokens\", {\n installation_id: installationId,\n repository_ids: options.repositoryIds,\n repositories: options.repositoryNames,\n permissions: options.permissions,\n mediaType: {\n previews: [\"machine-man\"],\n },\n headers: {\n authorization: `bearer ${appAuthentication.token}`,\n },\n });\n /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */\n const permissions = permissionsOptional || {};\n /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */\n const repositorySelection = repositorySelectionOptional || \"all\";\n const repositoryIds = repositories\n ? repositories.map((r) => r.id)\n : void 0;\n const repositoryNames = repositories\n ? repositories.map((repo) => repo.name)\n : void 0;\n const createdAt = new Date().toISOString();\n await set(state.cache, optionsWithInstallationTokenFromState, {\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName,\n });\n}\n","import { Deprecation } from \"deprecation\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nexport async function auth(state, authOptions) {\n switch (authOptions.type) {\n case \"app\":\n return getAppAuthentication(state);\n // @ts-expect-error \"oauth\" is not supperted in types\n case \"oauth\":\n state.log.warn(\n // @ts-expect-error `log.warn()` expects string\n new Deprecation(`[@octokit/auth-app] {type: \"oauth\"} is deprecated. Use {type: \"oauth-app\"} instead`));\n case \"oauth-app\":\n return state.oauthApp({ type: \"oauth-app\" });\n case \"installation\":\n authOptions;\n return getInstallationAuthentication(state, {\n ...authOptions,\n type: \"installation\",\n });\n case \"oauth-user\":\n // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as \"WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions\"\n return state.oauthApp(authOptions);\n default:\n // @ts-expect-error type is \"never\" at this point\n throw new Error(`Invalid auth type: ${authOptions.type}`);\n }\n}\n","const PATHS = [\n \"/app\",\n \"/app/hook/config\",\n \"/app/hook/deliveries\",\n \"/app/hook/deliveries/{delivery_id}\",\n \"/app/hook/deliveries/{delivery_id}/attempts\",\n \"/app/installations\",\n \"/app/installations/{installation_id}\",\n \"/app/installations/{installation_id}/access_tokens\",\n \"/app/installations/{installation_id}/suspended\",\n \"/marketplace_listing/accounts/{account_id}\",\n \"/marketplace_listing/plan\",\n \"/marketplace_listing/plans\",\n \"/marketplace_listing/plans/{plan_id}/accounts\",\n \"/marketplace_listing/stubbed/accounts/{account_id}\",\n \"/marketplace_listing/stubbed/plan\",\n \"/marketplace_listing/stubbed/plans\",\n \"/marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"/orgs/{org}/installation\",\n \"/repos/{owner}/{repo}/installation\",\n \"/users/{username}/installation\",\n];\n// CREDIT: Simon Grondin (https://github.com/SGrondin)\n// https://github.com/octokit/plugin-throttling.js/blob/45c5d7f13b8af448a9dbca468d9c9150a73b3948/lib/route-matcher.js\nfunction routeMatcher(paths) {\n // EXAMPLE. For the following paths:\n /* [\n \"/orgs/{org}/invitations\",\n \"/repos/{owner}/{repo}/collaborators/{username}\"\n ] */\n const regexes = paths.map((p) => p\n .split(\"/\")\n .map((c) => (c.startsWith(\"{\") ? \"(?:.+?)\" : c))\n .join(\"/\"));\n // 'regexes' would contain:\n /* [\n '/orgs/(?:.+?)/invitations',\n '/repos/(?:.+?)/(?:.+?)/collaborators/(?:.+?)'\n ] */\n const regex = `^(?:${regexes.map((r) => `(?:${r})`).join(\"|\")})[^/]*$`;\n // 'regex' would contain:\n /*\n ^(?:(?:\\/orgs\\/(?:.+?)\\/invitations)|(?:\\/repos\\/(?:.+?)\\/(?:.+?)\\/collaborators\\/(?:.+?)))[^\\/]*$\n \n It may look scary, but paste it into https://www.debuggex.com/\n and it will make a lot more sense!\n */\n return new RegExp(regex, \"i\");\n}\nconst REGEX = routeMatcher(PATHS);\nexport function requiresAppAuth(url) {\n return !!url && REGEX.test(url);\n}\n","import { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nimport { requiresAppAuth } from \"./requires-app-auth\";\nconst FIVE_SECONDS_IN_MS = 5 * 1000;\nfunction isNotTimeSkewError(error) {\n return !(error.message.match(/'Expiration time' claim \\('exp'\\) must be a numeric value representing the future time at which the assertion expires/) ||\n error.message.match(/'Issued at' claim \\('iat'\\) must be an Integer representing the time that the assertion was issued/));\n}\nexport async function hook(state, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n const url = endpoint.url;\n // Do not intercept request to retrieve a new token\n if (/\\/login\\/oauth\\/access_token$/.test(url)) {\n return request(endpoint);\n }\n if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, \"\"))) {\n const { token } = await getAppAuthentication(state);\n endpoint.headers.authorization = `bearer ${token}`;\n let response;\n try {\n response = await request(endpoint);\n }\n catch (error) {\n // If there's an issue with the expiration, regenerate the token and try again.\n // Otherwise rethrow the error for upstream handling.\n if (isNotTimeSkewError(error)) {\n throw error;\n }\n // If the date header is missing, we can't correct the system time skew.\n // Throw the error to be handled upstream.\n if (typeof error.response.headers.date === \"undefined\") {\n throw error;\n }\n const diff = Math.floor((Date.parse(error.response.headers.date) -\n Date.parse(new Date().toString())) /\n 1000);\n state.log.warn(error.message);\n state.log.warn(`[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`);\n const { token } = await getAppAuthentication({\n ...state,\n timeDifference: diff,\n });\n endpoint.headers.authorization = `bearer ${token}`;\n return request(endpoint);\n }\n return response;\n }\n if (requiresBasicAuth(url)) {\n const authentication = await state.oauthApp({ type: \"oauth-app\" });\n endpoint.headers.authorization = authentication.headers.authorization;\n return request(endpoint);\n }\n const { token, createdAt } = await getInstallationAuthentication(state, \n // @ts-expect-error TBD\n {}, request);\n endpoint.headers.authorization = `token ${token}`;\n return sendRequestWithRetries(state, request, endpoint, createdAt);\n}\n/**\n * Newly created tokens might not be accessible immediately after creation.\n * In case of a 401 response, we retry with an exponential delay until more\n * than five seconds pass since the creation of the token.\n *\n * @see https://github.com/octokit/auth-app.js/issues/65\n */\nasync function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {\n const timeSinceTokenCreationInMs = +new Date() - +new Date(createdAt);\n try {\n return await request(options);\n }\n catch (error) {\n if (error.status !== 401) {\n throw error;\n }\n if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {\n if (retries > 0) {\n error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1000}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;\n }\n throw error;\n }\n ++retries;\n const awaitTime = retries * 1000;\n state.log.warn(`[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1000}s)`);\n await new Promise((resolve) => setTimeout(resolve, awaitTime));\n return sendRequestWithRetries(state, request, options, createdAt, retries);\n }\n}\n","export const VERSION = \"4.0.8\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as defaultRequest } from \"@octokit/request\";\nimport { createOAuthAppAuth } from \"@octokit/auth-oauth-app\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { getCache } from \"./cache\";\nimport { VERSION } from \"./version\";\nexport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nexport function createAppAuth(options) {\n if (!options.appId) {\n throw new Error(\"[@octokit/auth-app] appId option is required\");\n }\n if (!Number.isFinite(+options.appId)) {\n throw new Error(\"[@octokit/auth-app] appId option must be a number or numeric string\");\n }\n if (!options.privateKey) {\n throw new Error(\"[@octokit/auth-app] privateKey option is required\");\n }\n if (\"installationId\" in options && !options.installationId) {\n throw new Error(\"[@octokit/auth-app] installationId is set to a falsy value\");\n }\n const log = Object.assign({\n warn: console.warn.bind(console),\n }, options.log);\n const request = options.request ||\n defaultRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const state = Object.assign({\n request,\n cache: getCache(),\n }, options, options.installationId\n ? { installationId: Number(options.installationId) }\n : {}, {\n log,\n oauthApp: createOAuthAppAuth({\n clientType: \"github-app\",\n clientId: options.clientId || \"\",\n clientSecret: options.clientSecret || \"\",\n request,\n }),\n });\n // @ts-expect-error not worth the extra code to appease TS\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["getAppAuthentication","appId","privateKey","timeDifference","appAuthentication","githubAppJwt","id","now","Math","floor","Date","type","token","expiresAt","expiration","toISOString","error","Error","getCache","LRU","max","maxAge","get","cache","options","cacheKey","optionsToCacheKey","result","createdAt","repositorySelection","permissionsString","singleFileName","split","permissions","reduce","string","test","slice","repositoryIds","repositoryNames","set","data","key","Object","keys","map","name","join","value","installationId","sort","repositoryIdsString","repositoryNamesString","filter","Boolean","toTokenAuthentication","assign","tokenType","getInstallationAuthentication","state","customRequest","Number","factory","oauthApp","factoryAuthOptions","optionsWithInstallationTokenFromState","refresh","request","expires_at","repositories","permissionsOptional","repository_selection","repositorySelectionOptional","single_file","installation_id","repository_ids","mediaType","previews","headers","authorization","r","repo","auth","authOptions","log","warn","Deprecation","PATHS","routeMatcher","paths","regexes","p","c","startsWith","regex","RegExp","REGEX","requiresAppAuth","url","FIVE_SECONDS_IN_MS","isNotTimeSkewError","message","match","hook","route","parameters","endpoint","merge","replace","DEFAULTS","baseUrl","response","date","diff","parse","toString","requiresBasicAuth","authentication","sendRequestWithRetries","retries","timeSinceTokenCreationInMs","status","awaitTime","Promise","resolve","setTimeout","VERSION","createAppAuth","isFinite","console","bind","defaultRequest","defaults","getUserAgent","createOAuthAppAuth","clientType","clientId","clientSecret"],"mappings":";;;;;;;;;;;;;;AACO,eAAeA,oBAAoB,CAAC;EAAEC,KAAK;EAA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;;;;;;"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../dist-src/index.js", "../dist-src/auth.js", "../dist-src/get-app-authentication.js", "../dist-src/cache.js", "../dist-src/to-token-authentication.js", "../dist-src/get-installation-authentication.js", "../dist-src/hook.js", "../dist-src/requires-app-auth.js", "../dist-src/version.js"],
4
+ "sourcesContent": ["import { getUserAgent } from \"universal-user-agent\";\nimport { request as defaultRequest } from \"@octokit/request\";\nimport { createOAuthAppAuth } from \"@octokit/auth-oauth-app\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { getCache } from \"./cache\";\nimport { VERSION } from \"./version\";\nimport { createOAuthUserAuth } from \"@octokit/auth-oauth-user\";\nfunction createAppAuth(options) {\n if (!options.appId) {\n throw new Error(\"[@octokit/auth-app] appId option is required\");\n }\n if (!Number.isFinite(+options.appId)) {\n throw new Error(\n \"[@octokit/auth-app] appId option must be a number or numeric string\"\n );\n }\n if (!options.privateKey) {\n throw new Error(\"[@octokit/auth-app] privateKey option is required\");\n }\n if (\"installationId\" in options && !options.installationId) {\n throw new Error(\n \"[@octokit/auth-app] installationId is set to a falsy value\"\n );\n }\n const log = Object.assign(\n {\n warn: console.warn.bind(console)\n },\n options.log\n );\n const request = options.request || defaultRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-app.js/${VERSION} ${getUserAgent()}`\n }\n });\n const state = Object.assign(\n {\n request,\n cache: getCache()\n },\n options,\n options.installationId ? { installationId: Number(options.installationId) } : {},\n {\n log,\n oauthApp: createOAuthAppAuth({\n clientType: \"github-app\",\n clientId: options.clientId || \"\",\n clientSecret: options.clientSecret || \"\",\n request\n })\n }\n );\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state)\n });\n}\nexport {\n createAppAuth,\n createOAuthUserAuth\n};\n", "import { Deprecation } from \"deprecation\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nasync function auth(state, authOptions) {\n switch (authOptions.type) {\n case \"app\":\n return getAppAuthentication(state);\n case \"oauth\":\n state.log.warn(\n // @ts-expect-error `log.warn()` expects string\n new Deprecation(\n `[@octokit/auth-app] {type: \"oauth\"} is deprecated. Use {type: \"oauth-app\"} instead`\n )\n );\n case \"oauth-app\":\n return state.oauthApp({ type: \"oauth-app\" });\n case \"installation\":\n authOptions;\n return getInstallationAuthentication(state, {\n ...authOptions,\n type: \"installation\"\n });\n case \"oauth-user\":\n return state.oauthApp(authOptions);\n default:\n throw new Error(`Invalid auth type: ${authOptions.type}`);\n }\n}\nexport {\n auth\n};\n", "import { githubAppJwt } from \"universal-github-app-jwt\";\nasync function getAppAuthentication({\n appId,\n privateKey,\n timeDifference\n}) {\n try {\n const appAuthentication = await githubAppJwt({\n id: +appId,\n privateKey,\n now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference\n });\n return {\n type: \"app\",\n token: appAuthentication.token,\n appId: appAuthentication.appId,\n expiresAt: new Date(appAuthentication.expiration * 1e3).toISOString()\n };\n } catch (error) {\n if (privateKey === \"-----BEGIN RSA PRIVATE KEY-----\") {\n throw new Error(\n \"The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\\n'\"\n );\n } else {\n throw error;\n }\n }\n}\nexport {\n getAppAuthentication\n};\n", "import { LRUCache } from \"lru-cache\";\nfunction getCache() {\n return new LRUCache({\n // cache max. 15000 tokens, that will use less than 10mb memory\n max: 15e3,\n // Cache for 1 minute less than GitHub expiry\n ttl: 1e3 * 60 * 59\n });\n}\nasync function get(cache, options) {\n const cacheKey = optionsToCacheKey(options);\n const result = await cache.get(cacheKey);\n if (!result) {\n return;\n }\n const [\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissionsString,\n singleFileName\n ] = result.split(\"|\");\n const permissions = options.permissions || permissionsString.split(/,/).reduce((permissions2, string) => {\n if (/!$/.test(string)) {\n permissions2[string.slice(0, -1)] = \"write\";\n } else {\n permissions2[string] = \"read\";\n }\n return permissions2;\n }, {});\n return {\n token,\n createdAt,\n expiresAt,\n permissions,\n repositoryIds: options.repositoryIds,\n repositoryNames: options.repositoryNames,\n singleFileName,\n repositorySelection\n };\n}\nasync function set(cache, options, data) {\n const key = optionsToCacheKey(options);\n const permissionsString = options.permissions ? \"\" : Object.keys(data.permissions).map(\n (name) => `${name}${data.permissions[name] === \"write\" ? \"!\" : \"\"}`\n ).join(\",\");\n const value = [\n data.token,\n data.createdAt,\n data.expiresAt,\n data.repositorySelection,\n permissionsString,\n data.singleFileName\n ].join(\"|\");\n await cache.set(key, value);\n}\nfunction optionsToCacheKey({\n installationId,\n permissions = {},\n repositoryIds = [],\n repositoryNames = []\n}) {\n const permissionsString = Object.keys(permissions).sort().map((name) => permissions[name] === \"read\" ? name : `${name}!`).join(\",\");\n const repositoryIdsString = repositoryIds.sort().join(\",\");\n const repositoryNamesString = repositoryNames.join(\",\");\n return [\n installationId,\n repositoryIdsString,\n repositoryNamesString,\n permissionsString\n ].filter(Boolean).join(\"|\");\n}\nexport {\n get,\n getCache,\n set\n};\n", "function toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName\n}) {\n return Object.assign(\n {\n type: \"token\",\n tokenType: \"installation\",\n token,\n installationId,\n permissions,\n createdAt,\n expiresAt,\n repositorySelection\n },\n repositoryIds ? { repositoryIds } : null,\n repositoryNames ? { repositoryNames } : null,\n singleFileName ? { singleFileName } : null\n );\n}\nexport {\n toTokenAuthentication\n};\n", "import { get, set } from \"./cache\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { toTokenAuthentication } from \"./to-token-authentication\";\nasync function getInstallationAuthentication(state, options, customRequest) {\n const installationId = Number(options.installationId || state.installationId);\n if (!installationId) {\n throw new Error(\n \"[@octokit/auth-app] installationId option is required for installation authentication.\"\n );\n }\n if (options.factory) {\n const { type, factory, oauthApp, ...factoryAuthOptions } = {\n ...state,\n ...options\n };\n return factory(factoryAuthOptions);\n }\n const optionsWithInstallationTokenFromState = Object.assign(\n { installationId },\n options\n );\n if (!options.refresh) {\n const result = await get(\n state.cache,\n optionsWithInstallationTokenFromState\n );\n if (result) {\n const {\n token: token2,\n createdAt: createdAt2,\n expiresAt: expiresAt2,\n permissions: permissions2,\n repositoryIds: repositoryIds2,\n repositoryNames: repositoryNames2,\n singleFileName: singleFileName2,\n repositorySelection: repositorySelection2\n } = result;\n return toTokenAuthentication({\n installationId,\n token: token2,\n createdAt: createdAt2,\n expiresAt: expiresAt2,\n permissions: permissions2,\n repositorySelection: repositorySelection2,\n repositoryIds: repositoryIds2,\n repositoryNames: repositoryNames2,\n singleFileName: singleFileName2\n });\n }\n }\n const appAuthentication = await getAppAuthentication(state);\n const request = customRequest || state.request;\n const {\n data: {\n token,\n expires_at: expiresAt,\n repositories,\n permissions: permissionsOptional,\n repository_selection: repositorySelectionOptional,\n single_file: singleFileName\n }\n } = await request(\"POST /app/installations/{installation_id}/access_tokens\", {\n installation_id: installationId,\n repository_ids: options.repositoryIds,\n repositories: options.repositoryNames,\n permissions: options.permissions,\n mediaType: {\n previews: [\"machine-man\"]\n },\n headers: {\n authorization: `bearer ${appAuthentication.token}`\n }\n });\n const permissions = permissionsOptional || {};\n const repositorySelection = repositorySelectionOptional || \"all\";\n const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;\n const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;\n const createdAt = (/* @__PURE__ */ new Date()).toISOString();\n await set(state.cache, optionsWithInstallationTokenFromState, {\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName\n });\n return toTokenAuthentication({\n installationId,\n token,\n createdAt,\n expiresAt,\n repositorySelection,\n permissions,\n repositoryIds,\n repositoryNames,\n singleFileName\n });\n}\nexport {\n getInstallationAuthentication\n};\n", "import { requiresBasicAuth } from \"@octokit/auth-oauth-user\";\nimport { getAppAuthentication } from \"./get-app-authentication\";\nimport { getInstallationAuthentication } from \"./get-installation-authentication\";\nimport { requiresAppAuth } from \"./requires-app-auth\";\nconst FIVE_SECONDS_IN_MS = 5 * 1e3;\nfunction isNotTimeSkewError(error) {\n return !(error.message.match(\n /'Expiration time' claim \\('exp'\\) must be a numeric value representing the future time at which the assertion expires/\n ) || error.message.match(\n /'Issued at' claim \\('iat'\\) must be an Integer representing the time that the assertion was issued/\n ));\n}\nasync function hook(state, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n const url = endpoint.url;\n if (/\\/login\\/oauth\\/access_token$/.test(url)) {\n return request(endpoint);\n }\n if (requiresAppAuth(url.replace(request.endpoint.DEFAULTS.baseUrl, \"\"))) {\n const { token: token2 } = await getAppAuthentication(state);\n endpoint.headers.authorization = `bearer ${token2}`;\n let response;\n try {\n response = await request(endpoint);\n } catch (error) {\n if (isNotTimeSkewError(error)) {\n throw error;\n }\n if (typeof error.response.headers.date === \"undefined\") {\n throw error;\n }\n const diff = Math.floor(\n (Date.parse(error.response.headers.date) - Date.parse((/* @__PURE__ */ new Date()).toString())) / 1e3\n );\n state.log.warn(error.message);\n state.log.warn(\n `[@octokit/auth-app] GitHub API time and system time are different by ${diff} seconds. Retrying request with the difference accounted for.`\n );\n const { token: token3 } = await getAppAuthentication({\n ...state,\n timeDifference: diff\n });\n endpoint.headers.authorization = `bearer ${token3}`;\n return request(endpoint);\n }\n return response;\n }\n if (requiresBasicAuth(url)) {\n const authentication = await state.oauthApp({ type: \"oauth-app\" });\n endpoint.headers.authorization = authentication.headers.authorization;\n return request(endpoint);\n }\n const { token, createdAt } = await getInstallationAuthentication(\n state,\n // @ts-expect-error TBD\n {},\n request\n );\n endpoint.headers.authorization = `token ${token}`;\n return sendRequestWithRetries(\n state,\n request,\n endpoint,\n createdAt\n );\n}\nasync function sendRequestWithRetries(state, request, options, createdAt, retries = 0) {\n const timeSinceTokenCreationInMs = +/* @__PURE__ */ new Date() - +new Date(createdAt);\n try {\n return await request(options);\n } catch (error) {\n if (error.status !== 401) {\n throw error;\n }\n if (timeSinceTokenCreationInMs >= FIVE_SECONDS_IN_MS) {\n if (retries > 0) {\n error.message = `After ${retries} retries within ${timeSinceTokenCreationInMs / 1e3}s of creating the installation access token, the response remains 401. At this point, the cause may be an authentication problem or a system outage. Please check https://www.githubstatus.com for status information`;\n }\n throw error;\n }\n ++retries;\n const awaitTime = retries * 1e3;\n state.log.warn(\n `[@octokit/auth-app] Retrying after 401 response to account for token replication delay (retry: ${retries}, wait: ${awaitTime / 1e3}s)`\n );\n await new Promise((resolve) => setTimeout(resolve, awaitTime));\n return sendRequestWithRetries(state, request, options, createdAt, retries);\n }\n}\nexport {\n hook\n};\n", "const PATHS = [\n \"/app\",\n \"/app/hook/config\",\n \"/app/hook/deliveries\",\n \"/app/hook/deliveries/{delivery_id}\",\n \"/app/hook/deliveries/{delivery_id}/attempts\",\n \"/app/installations\",\n \"/app/installations/{installation_id}\",\n \"/app/installations/{installation_id}/access_tokens\",\n \"/app/installations/{installation_id}/suspended\",\n \"/marketplace_listing/accounts/{account_id}\",\n \"/marketplace_listing/plan\",\n \"/marketplace_listing/plans\",\n \"/marketplace_listing/plans/{plan_id}/accounts\",\n \"/marketplace_listing/stubbed/accounts/{account_id}\",\n \"/marketplace_listing/stubbed/plan\",\n \"/marketplace_listing/stubbed/plans\",\n \"/marketplace_listing/stubbed/plans/{plan_id}/accounts\",\n \"/orgs/{org}/installation\",\n \"/repos/{owner}/{repo}/installation\",\n \"/users/{username}/installation\"\n];\nfunction routeMatcher(paths) {\n const regexes = paths.map(\n (p) => p.split(\"/\").map((c) => c.startsWith(\"{\") ? \"(?:.+?)\" : c).join(\"/\")\n );\n const regex = `^(?:${regexes.map((r) => `(?:${r})`).join(\"|\")})$`;\n return new RegExp(regex, \"i\");\n}\nconst REGEX = routeMatcher(PATHS);\nfunction requiresAppAuth(url) {\n return !!url && REGEX.test(url.split(\"?\")[0]);\n}\nexport {\n requiresAppAuth\n};\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AAU,QAAQ,WAAW,eAAAC,QAAe,SAAS;AAAA,IACzD,SAAS;AAAA,MACP,cAAc,uBAAuB,eAAW,0CAAa;AAAA,IAC/D;AAAA,EACF,CAAC;AACD,QAAM,QAAQ,OAAO;AAAA,IACnB;AAAA,MACE;AAAA,MACA,OAAO,SAAS;AAAA,IAClB;AAAA,IACA;AAAA,IACA,QAAQ,iBAAiB,EAAE,gBAAgB,OAAO,QAAQ,cAAc,EAAE,IAAI,CAAC;AAAA,IAC/E;AAAA,MACE;AAAA,MACA,cAAU,0CAAmB;AAAA,QAC3B,YAAY;AAAA,QACZ,UAAU,QAAQ,YAAY;AAAA,QAC9B,cAAc,QAAQ,gBAAgB;AAAA,QACtC;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO,OAAO,OAAO,KAAK,KAAK,MAAM,KAAK,GAAG;AAAA,IAC3C,MAAM,KAAK,KAAK,MAAM,KAAK;AAAA,EAC7B,CAAC;AACH;",
6
+ "names": ["import_auth_oauth_user", "defaultRequest"]
7
+ }
@@ -1,28 +1,31 @@
1
1
  import { Deprecation } from "deprecation";
2
2
  import { getAppAuthentication } from "./get-app-authentication";
3
3
  import { getInstallationAuthentication } from "./get-installation-authentication";
4
- export async function auth(state, authOptions) {
5
- switch (authOptions.type) {
6
- case "app":
7
- return getAppAuthentication(state);
8
- // @ts-expect-error "oauth" is not supperted in types
9
- case "oauth":
10
- state.log.warn(
11
- // @ts-expect-error `log.warn()` expects string
12
- new Deprecation(`[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`));
13
- case "oauth-app":
14
- return state.oauthApp({ type: "oauth-app" });
15
- case "installation":
16
- authOptions;
17
- return getInstallationAuthentication(state, {
18
- ...authOptions,
19
- type: "installation",
20
- });
21
- case "oauth-user":
22
- // @ts-expect-error TODO: infer correct auth options type based on type. authOptions should be typed as "WebFlowAuthOptions | OAuthAppDeviceFlowAuthOptions | GitHubAppDeviceFlowAuthOptions"
23
- return state.oauthApp(authOptions);
24
- default:
25
- // @ts-expect-error type is "never" at this point
26
- throw new Error(`Invalid auth type: ${authOptions.type}`);
27
- }
4
+ async function auth(state, authOptions) {
5
+ switch (authOptions.type) {
6
+ case "app":
7
+ return getAppAuthentication(state);
8
+ case "oauth":
9
+ state.log.warn(
10
+ // @ts-expect-error `log.warn()` expects string
11
+ new Deprecation(
12
+ `[@octokit/auth-app] {type: "oauth"} is deprecated. Use {type: "oauth-app"} instead`
13
+ )
14
+ );
15
+ case "oauth-app":
16
+ return state.oauthApp({ type: "oauth-app" });
17
+ case "installation":
18
+ authOptions;
19
+ return getInstallationAuthentication(state, {
20
+ ...authOptions,
21
+ type: "installation"
22
+ });
23
+ case "oauth-user":
24
+ return state.oauthApp(authOptions);
25
+ default:
26
+ throw new Error(`Invalid auth type: ${authOptions.type}`);
27
+ }
28
28
  }
29
+ export {
30
+ auth
31
+ };
@@ -1,71 +1,78 @@
1
- // https://github.com/isaacs/node-lru-cache#readme
2
- import LRU from "lru-cache";
3
- export function getCache() {
4
- return new LRU({
5
- // cache max. 15000 tokens, that will use less than 10mb memory
6
- max: 15000,
7
- // Cache for 1 minute less than GitHub expiry
8
- maxAge: 1000 * 60 * 59,
9
- });
1
+ import { LRUCache } from "lru-cache";
2
+ function getCache() {
3
+ return new LRUCache({
4
+ // cache max. 15000 tokens, that will use less than 10mb memory
5
+ max: 15e3,
6
+ // Cache for 1 minute less than GitHub expiry
7
+ ttl: 1e3 * 60 * 59
8
+ });
10
9
  }
11
- export async function get(cache, options) {
12
- const cacheKey = optionsToCacheKey(options);
13
- const result = await cache.get(cacheKey);
14
- if (!result) {
15
- return;
10
+ async function get(cache, options) {
11
+ const cacheKey = optionsToCacheKey(options);
12
+ const result = await cache.get(cacheKey);
13
+ if (!result) {
14
+ return;
15
+ }
16
+ const [
17
+ token,
18
+ createdAt,
19
+ expiresAt,
20
+ repositorySelection,
21
+ permissionsString,
22
+ singleFileName
23
+ ] = result.split("|");
24
+ const permissions = options.permissions || permissionsString.split(/,/).reduce((permissions2, string) => {
25
+ if (/!$/.test(string)) {
26
+ permissions2[string.slice(0, -1)] = "write";
27
+ } else {
28
+ permissions2[string] = "read";
16
29
  }
17
- const [token, createdAt, expiresAt, repositorySelection, permissionsString, singleFileName,] = result.split("|");
18
- const permissions = options.permissions ||
19
- permissionsString.split(/,/).reduce((permissions, string) => {
20
- if (/!$/.test(string)) {
21
- permissions[string.slice(0, -1)] = "write";
22
- }
23
- else {
24
- permissions[string] = "read";
25
- }
26
- return permissions;
27
- }, {});
28
- return {
29
- token,
30
- createdAt,
31
- expiresAt,
32
- permissions,
33
- repositoryIds: options.repositoryIds,
34
- repositoryNames: options.repositoryNames,
35
- singleFileName,
36
- repositorySelection: repositorySelection,
37
- };
30
+ return permissions2;
31
+ }, {});
32
+ return {
33
+ token,
34
+ createdAt,
35
+ expiresAt,
36
+ permissions,
37
+ repositoryIds: options.repositoryIds,
38
+ repositoryNames: options.repositoryNames,
39
+ singleFileName,
40
+ repositorySelection
41
+ };
38
42
  }
39
- export async function set(cache, options, data) {
40
- const key = optionsToCacheKey(options);
41
- const permissionsString = options.permissions
42
- ? ""
43
- : Object.keys(data.permissions)
44
- .map((name) => `${name}${data.permissions[name] === "write" ? "!" : ""}`)
45
- .join(",");
46
- const value = [
47
- data.token,
48
- data.createdAt,
49
- data.expiresAt,
50
- data.repositorySelection,
51
- permissionsString,
52
- data.singleFileName,
53
- ].join("|");
54
- await cache.set(key, value);
43
+ async function set(cache, options, data) {
44
+ const key = optionsToCacheKey(options);
45
+ const permissionsString = options.permissions ? "" : Object.keys(data.permissions).map(
46
+ (name) => `${name}${data.permissions[name] === "write" ? "!" : ""}`
47
+ ).join(",");
48
+ const value = [
49
+ data.token,
50
+ data.createdAt,
51
+ data.expiresAt,
52
+ data.repositorySelection,
53
+ permissionsString,
54
+ data.singleFileName
55
+ ].join("|");
56
+ await cache.set(key, value);
55
57
  }
56
- function optionsToCacheKey({ installationId, permissions = {}, repositoryIds = [], repositoryNames = [], }) {
57
- const permissionsString = Object.keys(permissions)
58
- .sort()
59
- .map((name) => (permissions[name] === "read" ? name : `${name}!`))
60
- .join(",");
61
- const repositoryIdsString = repositoryIds.sort().join(",");
62
- const repositoryNamesString = repositoryNames.join(",");
63
- return [
64
- installationId,
65
- repositoryIdsString,
66
- repositoryNamesString,
67
- permissionsString,
68
- ]
69
- .filter(Boolean)
70
- .join("|");
58
+ function optionsToCacheKey({
59
+ installationId,
60
+ permissions = {},
61
+ repositoryIds = [],
62
+ repositoryNames = []
63
+ }) {
64
+ const permissionsString = Object.keys(permissions).sort().map((name) => permissions[name] === "read" ? name : `${name}!`).join(",");
65
+ const repositoryIdsString = repositoryIds.sort().join(",");
66
+ const repositoryNamesString = repositoryNames.join(",");
67
+ return [
68
+ installationId,
69
+ repositoryIdsString,
70
+ repositoryNamesString,
71
+ permissionsString
72
+ ].filter(Boolean).join("|");
71
73
  }
74
+ export {
75
+ get,
76
+ getCache,
77
+ set
78
+ };
@@ -1,24 +1,31 @@
1
1
  import { githubAppJwt } from "universal-github-app-jwt";
2
- export async function getAppAuthentication({ appId, privateKey, timeDifference, }) {
3
- try {
4
- const appAuthentication = await githubAppJwt({
5
- id: +appId,
6
- privateKey,
7
- now: timeDifference && Math.floor(Date.now() / 1000) + timeDifference,
8
- });
9
- return {
10
- type: "app",
11
- token: appAuthentication.token,
12
- appId: appAuthentication.appId,
13
- expiresAt: new Date(appAuthentication.expiration * 1000).toISOString(),
14
- };
15
- }
16
- catch (error) {
17
- if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
18
- throw new Error("The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'");
19
- }
20
- else {
21
- throw error;
22
- }
2
+ async function getAppAuthentication({
3
+ appId,
4
+ privateKey,
5
+ timeDifference
6
+ }) {
7
+ try {
8
+ const appAuthentication = await githubAppJwt({
9
+ id: +appId,
10
+ privateKey,
11
+ now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference
12
+ });
13
+ return {
14
+ type: "app",
15
+ token: appAuthentication.token,
16
+ appId: appAuthentication.appId,
17
+ expiresAt: new Date(appAuthentication.expiration * 1e3).toISOString()
18
+ };
19
+ } catch (error) {
20
+ if (privateKey === "-----BEGIN RSA PRIVATE KEY-----") {
21
+ throw new Error(
22
+ "The 'privateKey` option contains only the first line '-----BEGIN RSA PRIVATE KEY-----'. If you are setting it using a `.env` file, make sure it is set on a single line with newlines replaced by '\n'"
23
+ );
24
+ } else {
25
+ throw error;
23
26
  }
27
+ }
24
28
  }
29
+ export {
30
+ getAppAuthentication
31
+ };
@@ -1,81 +1,103 @@
1
1
  import { get, set } from "./cache";
2
2
  import { getAppAuthentication } from "./get-app-authentication";
3
3
  import { toTokenAuthentication } from "./to-token-authentication";
4
- export async function getInstallationAuthentication(state, options, customRequest) {
5
- const installationId = Number(options.installationId || state.installationId);
6
- if (!installationId) {
7
- throw new Error("[@octokit/auth-app] installationId option is required for installation authentication.");
4
+ async function getInstallationAuthentication(state, options, customRequest) {
5
+ const installationId = Number(options.installationId || state.installationId);
6
+ if (!installationId) {
7
+ throw new Error(
8
+ "[@octokit/auth-app] installationId option is required for installation authentication."
9
+ );
10
+ }
11
+ if (options.factory) {
12
+ const { type, factory, oauthApp, ...factoryAuthOptions } = {
13
+ ...state,
14
+ ...options
15
+ };
16
+ return factory(factoryAuthOptions);
17
+ }
18
+ const optionsWithInstallationTokenFromState = Object.assign(
19
+ { installationId },
20
+ options
21
+ );
22
+ if (!options.refresh) {
23
+ const result = await get(
24
+ state.cache,
25
+ optionsWithInstallationTokenFromState
26
+ );
27
+ if (result) {
28
+ const {
29
+ token: token2,
30
+ createdAt: createdAt2,
31
+ expiresAt: expiresAt2,
32
+ permissions: permissions2,
33
+ repositoryIds: repositoryIds2,
34
+ repositoryNames: repositoryNames2,
35
+ singleFileName: singleFileName2,
36
+ repositorySelection: repositorySelection2
37
+ } = result;
38
+ return toTokenAuthentication({
39
+ installationId,
40
+ token: token2,
41
+ createdAt: createdAt2,
42
+ expiresAt: expiresAt2,
43
+ permissions: permissions2,
44
+ repositorySelection: repositorySelection2,
45
+ repositoryIds: repositoryIds2,
46
+ repositoryNames: repositoryNames2,
47
+ singleFileName: singleFileName2
48
+ });
8
49
  }
9
- if (options.factory) {
10
- const { type, factory, oauthApp, ...factoryAuthOptions } = {
11
- ...state,
12
- ...options,
13
- };
14
- // @ts-expect-error if `options.factory` is set, the return type for `auth()` should be `Promise<ReturnType<options.factory>>`
15
- return factory(factoryAuthOptions);
50
+ }
51
+ const appAuthentication = await getAppAuthentication(state);
52
+ const request = customRequest || state.request;
53
+ const {
54
+ data: {
55
+ token,
56
+ expires_at: expiresAt,
57
+ repositories,
58
+ permissions: permissionsOptional,
59
+ repository_selection: repositorySelectionOptional,
60
+ single_file: singleFileName
16
61
  }
17
- const optionsWithInstallationTokenFromState = Object.assign({ installationId }, options);
18
- if (!options.refresh) {
19
- const result = await get(state.cache, optionsWithInstallationTokenFromState);
20
- if (result) {
21
- const { token, createdAt, expiresAt, permissions, repositoryIds, repositoryNames, singleFileName, repositorySelection, } = result;
22
- return toTokenAuthentication({
23
- installationId,
24
- token,
25
- createdAt,
26
- expiresAt,
27
- permissions,
28
- repositorySelection,
29
- repositoryIds,
30
- repositoryNames,
31
- singleFileName,
32
- });
33
- }
62
+ } = await request("POST /app/installations/{installation_id}/access_tokens", {
63
+ installation_id: installationId,
64
+ repository_ids: options.repositoryIds,
65
+ repositories: options.repositoryNames,
66
+ permissions: options.permissions,
67
+ mediaType: {
68
+ previews: ["machine-man"]
69
+ },
70
+ headers: {
71
+ authorization: `bearer ${appAuthentication.token}`
34
72
  }
35
- const appAuthentication = await getAppAuthentication(state);
36
- const request = customRequest || state.request;
37
- const { data: { token, expires_at: expiresAt, repositories, permissions: permissionsOptional, repository_selection: repositorySelectionOptional, single_file: singleFileName, }, } = await request("POST /app/installations/{installation_id}/access_tokens", {
38
- installation_id: installationId,
39
- repository_ids: options.repositoryIds,
40
- repositories: options.repositoryNames,
41
- permissions: options.permissions,
42
- mediaType: {
43
- previews: ["machine-man"],
44
- },
45
- headers: {
46
- authorization: `bearer ${appAuthentication.token}`,
47
- },
48
- });
49
- /* istanbul ignore next - permissions are optional per OpenAPI spec, but we think that is incorrect */
50
- const permissions = permissionsOptional || {};
51
- /* istanbul ignore next - repositorySelection are optional per OpenAPI spec, but we think that is incorrect */
52
- const repositorySelection = repositorySelectionOptional || "all";
53
- const repositoryIds = repositories
54
- ? repositories.map((r) => r.id)
55
- : void 0;
56
- const repositoryNames = repositories
57
- ? repositories.map((repo) => repo.name)
58
- : void 0;
59
- const createdAt = new Date().toISOString();
60
- await set(state.cache, optionsWithInstallationTokenFromState, {
61
- token,
62
- createdAt,
63
- expiresAt,
64
- repositorySelection,
65
- permissions,
66
- repositoryIds,
67
- repositoryNames,
68
- singleFileName,
69
- });
70
- return toTokenAuthentication({
71
- installationId,
72
- token,
73
- createdAt,
74
- expiresAt,
75
- repositorySelection,
76
- permissions,
77
- repositoryIds,
78
- repositoryNames,
79
- singleFileName,
80
- });
73
+ });
74
+ const permissions = permissionsOptional || {};
75
+ const repositorySelection = repositorySelectionOptional || "all";
76
+ const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0;
77
+ const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0;
78
+ const createdAt = (/* @__PURE__ */ new Date()).toISOString();
79
+ await set(state.cache, optionsWithInstallationTokenFromState, {
80
+ token,
81
+ createdAt,
82
+ expiresAt,
83
+ repositorySelection,
84
+ permissions,
85
+ repositoryIds,
86
+ repositoryNames,
87
+ singleFileName
88
+ });
89
+ return toTokenAuthentication({
90
+ installationId,
91
+ token,
92
+ createdAt,
93
+ expiresAt,
94
+ repositorySelection,
95
+ permissions,
96
+ repositoryIds,
97
+ repositoryNames,
98
+ singleFileName
99
+ });
81
100
  }
101
+ export {
102
+ getInstallationAuthentication
103
+ };