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
@@ -8,9 +8,9 @@ var oauthMethods = require('@octokit/oauth-methods');
8
8
 
9
9
  async function getOAuthAccessToken(state, options) {
10
10
  const cachedAuthentication = getCachedAuthentication(state, options.auth);
11
- if (cachedAuthentication) return cachedAuthentication; // Step 1: Request device and user codes
11
+ if (cachedAuthentication) return cachedAuthentication;
12
+ // Step 1: Request device and user codes
12
13
  // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github
13
-
14
14
  const {
15
15
  data: verification
16
16
  } = await oauthMethods.createDeviceCode({
@@ -19,48 +19,45 @@ async function getOAuthAccessToken(state, options) {
19
19
  request: options.request || state.request,
20
20
  // @ts-expect-error the extra code to make TS happy is not worth it
21
21
  scopes: options.auth.scopes || state.scopes
22
- }); // Step 2: User must enter the user code on https://github.com/login/device
22
+ });
23
+ // Step 2: User must enter the user code on https://github.com/login/device
23
24
  // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser
24
-
25
- await state.onVerification(verification); // Step 3: Exchange device code for access token
25
+ await state.onVerification(verification);
26
+ // Step 3: Exchange device code for access token
26
27
  // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device
27
-
28
28
  const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);
29
29
  state.authentication = authentication;
30
30
  return authentication;
31
31
  }
32
-
33
32
  function getCachedAuthentication(state, auth) {
34
33
  if (auth.refresh === true) return false;
35
34
  if (!state.authentication) return false;
36
-
37
35
  if (state.clientType === "github-app") {
38
36
  return state.authentication;
39
37
  }
40
-
41
38
  const authentication = state.authentication;
42
39
  const newScope = ("scopes" in auth && auth.scopes || state.scopes).join(" ");
43
40
  const currentScope = authentication.scopes.join(" ");
44
41
  return newScope === currentScope ? authentication : false;
45
42
  }
46
-
47
43
  async function wait(seconds) {
48
44
  await new Promise(resolve => setTimeout(resolve, seconds * 1000));
49
45
  }
50
-
51
46
  async function waitForAccessToken(request, clientId, clientType, verification) {
52
47
  try {
53
48
  const options = {
54
49
  clientId,
55
50
  request,
56
51
  code: verification.device_code
57
- }; // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME
58
-
52
+ };
53
+ // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME
59
54
  const {
60
55
  authentication
61
- } = clientType === "oauth-app" ? await oauthMethods.exchangeDeviceCode({ ...options,
56
+ } = clientType === "oauth-app" ? await oauthMethods.exchangeDeviceCode({
57
+ ...options,
62
58
  clientType: "oauth-app"
63
- }) : await oauthMethods.exchangeDeviceCode({ ...options,
59
+ }) : await oauthMethods.exchangeDeviceCode({
60
+ ...options,
64
61
  clientType: "github-app"
65
62
  });
66
63
  return {
@@ -71,20 +68,17 @@ async function waitForAccessToken(request, clientId, clientType, verification) {
71
68
  } catch (error) {
72
69
  // istanbul ignore if
73
70
  // @ts-ignore
74
- if (!error.response) throw error; // @ts-ignore
75
-
71
+ if (!error.response) throw error;
72
+ // @ts-ignore
76
73
  const errorType = error.response.data.error;
77
-
78
74
  if (errorType === "authorization_pending") {
79
75
  await wait(verification.interval);
80
76
  return waitForAccessToken(request, clientId, clientType, verification);
81
77
  }
82
-
83
78
  if (errorType === "slow_down") {
84
79
  await wait(verification.interval + 5);
85
80
  return waitForAccessToken(request, clientId, clientType, verification);
86
81
  }
87
-
88
82
  throw error;
89
83
  }
90
84
  }
@@ -96,12 +90,11 @@ async function auth(state, authOptions) {
96
90
  }
97
91
 
98
92
  async function hook(state, request, route, parameters) {
99
- let endpoint = request.endpoint.merge(route, parameters); // Do not intercept request to retrieve codes or token
100
-
93
+ let endpoint = request.endpoint.merge(route, parameters);
94
+ // Do not intercept request to retrieve codes or token
101
95
  if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
102
96
  return request(endpoint);
103
97
  }
104
-
105
98
  const {
106
99
  token
107
100
  } = await getOAuthAccessToken(state, {
@@ -114,7 +107,7 @@ async function hook(state, request, route, parameters) {
114
107
  return request(endpoint);
115
108
  }
116
109
 
117
- const VERSION = "4.0.3";
110
+ const VERSION = "4.0.4";
118
111
 
119
112
  function createOAuthDeviceAuth(options) {
120
113
  const requestWithDefaults = options.request || request.request.defaults({
@@ -126,24 +119,23 @@ function createOAuthDeviceAuth(options) {
126
119
  request: request$1 = requestWithDefaults,
127
120
  ...otherOptions
128
121
  } = options;
129
- const state = options.clientType === "github-app" ? { ...otherOptions,
122
+ const state = options.clientType === "github-app" ? {
123
+ ...otherOptions,
130
124
  clientType: "github-app",
131
125
  request: request$1
132
- } : { ...otherOptions,
126
+ } : {
127
+ ...otherOptions,
133
128
  clientType: "oauth-app",
134
129
  request: request$1,
135
130
  scopes: options.scopes || []
136
131
  };
137
-
138
132
  if (!options.clientId) {
139
133
  throw new Error('[@octokit/auth-oauth-device] "clientId" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');
140
134
  }
141
-
142
135
  if (!options.onVerification) {
143
136
  throw new Error('[@octokit/auth-oauth-device] "onVerification" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');
144
- } // @ts-ignore too much for tsc / ts-jest ¯\_(ツ)_/¯
145
-
146
-
137
+ }
138
+ // @ts-ignore too much for tsc / ts-jest ¯\_(ツ)_/¯
147
139
  return Object.assign(auth.bind(null, state), {
148
140
  hook: hook.bind(null, state)
149
141
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n // @ts-ignore\n if (!error.response)\n throw error;\n // @ts-ignore\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"4.0.3\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["getOAuthAccessToken","state","options","cachedAuthentication","getCachedAuthentication","auth","data","verification","createDeviceCode","clientType","clientId","request","scopes","onVerification","authentication","waitForAccessToken","refresh","newScope","join","currentScope","wait","seconds","Promise","resolve","setTimeout","code","device_code","exchangeDeviceCode","type","tokenType","error","response","errorType","interval","authOptions","hook","route","parameters","endpoint","merge","test","url","token","headers","authorization","VERSION","createOAuthDeviceAuth","requestWithDefaults","octokitRequest","defaults","getUserAgent","otherOptions","Error","Object","assign","bind"],"mappings":";;;;;;;;AACO,eAAeA,mBAAf,CAAmCC,KAAnC,EAA0CC,OAA1C,EAAmD;EACtD,MAAMC,oBAAoB,GAAGC,uBAAuB,CAACH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AAE,WAFd;aAGEE,SAHF;IAIEC,MAAM,EAAEV,OAAO,CAACU,MAAR,IAAkB;GAVlC;;EAYA,IAAI,CAACV,OAAO,CAACQ,QAAb,EAAuB;IACnB,MAAM,IAAI0C,KAAJ,CAAU,oHAAV,CAAN;;;EAEJ,IAAI,CAAClD,OAAO,CAACW,cAAb,EAA6B;IACzB,MAAM,IAAIuC,KAAJ,CAAU,iIAAV,CAAN;GAxBuC;;;EA2B3C,OAAOC,MAAM,CAACC,MAAP,CAAcjD,IAAI,CAACkD,IAAL,CAAU,IAAV,EAAgBtD,KAAhB,CAAd,EAAsC;IACzCkC,IAAI,EAAEA,IAAI,CAACoB,IAAL,CAAU,IAAV,EAAgBtD,KAAhB;GADH,CAAP;AAGH;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n // @ts-ignore\n if (!error.response)\n throw error;\n // @ts-ignore\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"4.0.4\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["getOAuthAccessToken","state","options","cachedAuthentication","getCachedAuthentication","auth","data","verification","createDeviceCode","clientType","clientId","request","scopes","onVerification","authentication","waitForAccessToken","refresh","newScope","join","currentScope","wait","seconds","Promise","resolve","setTimeout","code","device_code","exchangeDeviceCode","type","tokenType","error","response","errorType","interval","authOptions","hook","route","parameters","endpoint","merge","test","url","token","headers","authorization","VERSION","createOAuthDeviceAuth","requestWithDefaults","octokitRequest","defaults","getUserAgent","otherOptions","Error","Object","assign","bind"],"mappings":";;;;;;;;AACO,eAAeA,mBAAmB,CAACC,KAAK,EAAEC,OAAO,EAAE;EACtD,MAAMC,oBAAoB,GAAGC,uBAAuB,CAACH,KAAK,EAAEC,OAAO,CAACG,IAAI,CAAC;EACzE,IAAIF,oBAAoB,EACpB,OAAOA,oBAAoB;;;EAG/B,MAAM;IAAEG,IAAI,EAAEC;GAAc,GAAG,MAAMC,6BAAgB,CAAC;IAClDC,UAAU,EAAER,KAA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IAAI,CAAC,IAAI,EAAEtD,KAAK,CAAC,EAAE;IACzCkC,IAAI,EAAEA,IAAI,CAACoB,IAAI,CAAC,IAAI,EAAEtD,KAAK;GAC9B,CAAC;AACN;;;;"}
@@ -1 +1 @@
1
- export const VERSION = "4.0.3";
1
+ export const VERSION = "4.0.4";
@@ -1,14 +1,14 @@
1
1
  import { RequestInterface, Route, EndpointOptions, RequestParameters, OctokitResponse } from "@octokit/types";
2
2
  import * as OAuthMethodsTypes from "@octokit/oauth-methods";
3
- export declare type ClientType = "oauth-app" | "github-app";
4
- export declare type OAuthAppStrategyOptions = {
3
+ export type ClientType = "oauth-app" | "github-app";
4
+ export type OAuthAppStrategyOptions = {
5
5
  clientId: string;
6
6
  clientType?: "oauth-app";
7
7
  onVerification: OnVerificationCallback;
8
8
  scopes?: string[];
9
9
  request?: RequestInterface;
10
10
  };
11
- export declare type GitHubAppStrategyOptions = {
11
+ export type GitHubAppStrategyOptions = {
12
12
  clientId: string;
13
13
  clientType: "github-app";
14
14
  onVerification: OnVerificationCallback;
@@ -22,36 +22,36 @@ export interface GitHubAppAuthInterface {
22
22
  (options: GitHubAppAuthOptions): Promise<GitHubAppAuthentication | GitHubAppAuthenticationWithExpiration>;
23
23
  hook(request: RequestInterface, route: Route | EndpointOptions, parameters?: RequestParameters): Promise<OctokitResponse<any>>;
24
24
  }
25
- export declare type OAuthAppAuthOptions = {
25
+ export type OAuthAppAuthOptions = {
26
26
  type: "oauth";
27
27
  scopes?: string[];
28
28
  refresh?: boolean;
29
29
  };
30
- export declare type GitHubAppAuthOptions = {
30
+ export type GitHubAppAuthOptions = {
31
31
  type: "oauth";
32
32
  refresh?: boolean;
33
33
  };
34
- export declare type OAuthAppAuthentication = {
34
+ export type OAuthAppAuthentication = {
35
35
  type: "token";
36
36
  tokenType: "oauth";
37
37
  } & Omit<OAuthMethodsTypes.OAuthAppAuthentication, "clientSecret">;
38
- export declare type GitHubAppAuthentication = {
38
+ export type GitHubAppAuthentication = {
39
39
  type: "token";
40
40
  tokenType: "oauth";
41
41
  } & Omit<OAuthMethodsTypes.GitHubAppAuthentication, "clientSecret">;
42
- export declare type GitHubAppAuthenticationWithExpiration = {
42
+ export type GitHubAppAuthenticationWithExpiration = {
43
43
  type: "token";
44
44
  tokenType: "oauth";
45
45
  } & Omit<OAuthMethodsTypes.GitHubAppAuthentication, "clientSecret">;
46
- export declare type Verification = {
46
+ export type Verification = {
47
47
  device_code: string;
48
48
  user_code: string;
49
49
  verification_uri: string;
50
50
  expires_in: number;
51
51
  interval: number;
52
52
  };
53
- export declare type OnVerificationCallback = (verification: Verification) => any | Promise<any>;
54
- export declare type OAuthAppState = {
53
+ export type OnVerificationCallback = (verification: Verification) => any | Promise<any>;
54
+ export type OAuthAppState = {
55
55
  clientId: string;
56
56
  clientType: "oauth-app";
57
57
  onVerification: OnVerificationCallback;
@@ -59,7 +59,7 @@ export declare type OAuthAppState = {
59
59
  request: RequestInterface;
60
60
  authentication?: OAuthAppAuthentication;
61
61
  };
62
- export declare type GitHubAppState = {
62
+ export type GitHubAppState = {
63
63
  clientId: string;
64
64
  clientType: "github-app";
65
65
  onVerification: OnVerificationCallback;
@@ -1 +1 @@
1
- export declare const VERSION = "4.0.3";
1
+ export declare const VERSION = "4.0.4";
@@ -102,7 +102,7 @@ async function hook(state, request, route, parameters) {
102
102
  return request(endpoint);
103
103
  }
104
104
 
105
- const VERSION = "4.0.3";
105
+ const VERSION = "4.0.4";
106
106
 
107
107
  function createOAuthDeviceAuth(options) {
108
108
  const requestWithDefaults = options.request ||
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n // @ts-ignore\n if (!error.response)\n throw error;\n // @ts-ignore\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"4.0.3\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["octokitRequest","request"],"mappings":";;;;AACO,eAAe,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE;AAC1D,IAAI,MAAM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C;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../dist-src/get-oauth-access-token.js","../dist-src/auth.js","../dist-src/hook.js","../dist-src/version.js","../dist-src/index.js"],"sourcesContent":["import { createDeviceCode, exchangeDeviceCode } from \"@octokit/oauth-methods\";\nexport async function getOAuthAccessToken(state, options) {\n const cachedAuthentication = getCachedAuthentication(state, options.auth);\n if (cachedAuthentication)\n return cachedAuthentication;\n // Step 1: Request device and user codes\n // https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-1-app-requests-the-device-and-user-verification-codes-from-github\n const { data: verification } = await createDeviceCode({\n clientType: state.clientType,\n clientId: state.clientId,\n request: options.request || state.request,\n // @ts-expect-error the extra code to make TS happy is not worth it\n scopes: options.auth.scopes || state.scopes,\n });\n // Step 2: User must enter the user code on https://github.com/login/device\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-2-prompt-the-user-to-enter-the-user-code-in-a-browser\n await state.onVerification(verification);\n // Step 3: Exchange device code for access token\n // See https://docs.github.com/en/developers/apps/authorizing-oauth-apps#step-3-app-polls-github-to-check-if-the-user-authorized-the-device\n const authentication = await waitForAccessToken(options.request || state.request, state.clientId, state.clientType, verification);\n state.authentication = authentication;\n return authentication;\n}\nfunction getCachedAuthentication(state, auth) {\n if (auth.refresh === true)\n return false;\n if (!state.authentication)\n return false;\n if (state.clientType === \"github-app\") {\n return state.authentication;\n }\n const authentication = state.authentication;\n const newScope = ((\"scopes\" in auth && auth.scopes) || state.scopes).join(\" \");\n const currentScope = authentication.scopes.join(\" \");\n return newScope === currentScope ? authentication : false;\n}\nasync function wait(seconds) {\n await new Promise((resolve) => setTimeout(resolve, seconds * 1000));\n}\nasync function waitForAccessToken(request, clientId, clientType, verification) {\n try {\n const options = {\n clientId,\n request,\n code: verification.device_code,\n };\n // WHY TYPESCRIPT WHY ARE YOU DOING THIS TO ME\n const { authentication } = clientType === \"oauth-app\"\n ? await exchangeDeviceCode({\n ...options,\n clientType: \"oauth-app\",\n })\n : await exchangeDeviceCode({\n ...options,\n clientType: \"github-app\",\n });\n return {\n type: \"token\",\n tokenType: \"oauth\",\n ...authentication,\n };\n }\n catch (error) {\n // istanbul ignore if\n // @ts-ignore\n if (!error.response)\n throw error;\n // @ts-ignore\n const errorType = error.response.data.error;\n if (errorType === \"authorization_pending\") {\n await wait(verification.interval);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n if (errorType === \"slow_down\") {\n await wait(verification.interval + 5);\n return waitForAccessToken(request, clientId, clientType, verification);\n }\n throw error;\n }\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function auth(state, authOptions) {\n return getOAuthAccessToken(state, {\n auth: authOptions,\n });\n}\n","import { getOAuthAccessToken } from \"./get-oauth-access-token\";\nexport async function hook(state, request, route, parameters) {\n let endpoint = request.endpoint.merge(route, parameters);\n // Do not intercept request to retrieve codes or token\n if (/\\/login\\/(oauth\\/access_token|device\\/code)$/.test(endpoint.url)) {\n return request(endpoint);\n }\n const { token } = await getOAuthAccessToken(state, {\n request,\n auth: { type: \"oauth\" },\n });\n endpoint.headers.authorization = `token ${token}`;\n return request(endpoint);\n}\n","export const VERSION = \"4.0.4\";\n","import { getUserAgent } from \"universal-user-agent\";\nimport { request as octokitRequest } from \"@octokit/request\";\nimport { auth } from \"./auth\";\nimport { hook } from \"./hook\";\nimport { VERSION } from \"./version\";\nexport function createOAuthDeviceAuth(options) {\n const requestWithDefaults = options.request ||\n octokitRequest.defaults({\n headers: {\n \"user-agent\": `octokit-auth-oauth-device.js/${VERSION} ${getUserAgent()}`,\n },\n });\n const { request = requestWithDefaults, ...otherOptions } = options;\n const state = options.clientType === \"github-app\"\n ? {\n ...otherOptions,\n clientType: \"github-app\",\n request,\n }\n : {\n ...otherOptions,\n clientType: \"oauth-app\",\n request,\n scopes: options.scopes || [],\n };\n if (!options.clientId) {\n throw new Error('[@octokit/auth-oauth-device] \"clientId\" option must be set (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n if (!options.onVerification) {\n throw new Error('[@octokit/auth-oauth-device] \"onVerification\" option must be a function (https://github.com/octokit/auth-oauth-device.js#usage)');\n }\n // @ts-ignore too much for tsc / ts-jest ¯\\_(ツ)_/¯\n return Object.assign(auth.bind(null, state), {\n hook: hook.bind(null, state),\n });\n}\n"],"names":["octokitRequest","request"],"mappings":";;;;AACO,eAAe,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE;AAC1D,IAAI,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9E,IAAI,IAAI,oBAAoB;AAC5B,QAAQ,OAAO,oBAAoB,CAAC;AACpC;AACA;AACA,IAAI,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,gBAAgB,CAAC;AAC1D,QAAQ,UAAU,EAAE,KAAK,CAAC,UAAU;AACpC,QAAQ,QAAQ,EAAE,KAAK,CAAC,QAAQ;AAChC,QAAQ,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO;AACjD;AACA,QAAQ,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM;AACnD,KAAK,CAAC,CAAC;AACP;AACA;AACA,IAAI,MAAM,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AAC7C;AACA;AACA,IAAI,MAAM,cAAc,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACtI,IAAI,KAAK,CAAC,cAAc,GAAG,cAAc,CAAC;AAC1C,IAAI,OAAO,cAAc,CAAC;AAC1B,CAAC;AACD,SAAS,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE;AAC9C,IAAI,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI;AAC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AAC;AAC9I,KAAK;AACL,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;AACjC,QAAQ,MAAM,IAAI,KAAK,CAAC,iIAAiI,CAAC,CAAC;AAC3J,KAAK;AACL;AACA,IAAI,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE;AACjD,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC;AACpC,KAAK,CAAC,CAAC;AACP,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@octokit/auth-oauth-device",
3
3
  "description": "GitHub OAuth Device authentication strategy for JavaScript",
4
- "version": "4.0.3",
4
+ "version": "4.0.4",
5
5
  "license": "MIT",
6
6
  "files": [
7
7
  "dist-*/",
@@ -19,7 +19,7 @@
19
19
  "dependencies": {
20
20
  "@octokit/oauth-methods": "^2.0.0",
21
21
  "@octokit/request": "^6.0.0",
22
- "@octokit/types": "^8.0.0",
22
+ "@octokit/types": "^9.0.0",
23
23
  "universal-user-agent": "^6.0.0"
24
24
  },
25
25
  "devDependencies": {
@@ -29,11 +29,11 @@
29
29
  "@pika/plugin-build-web": "^0.9.2",
30
30
  "@pika/plugin-ts-standard-pkg": "^0.9.2",
31
31
  "@types/jest": "^29.0.0",
32
- "@types/node": "^16.0.0",
32
+ "@types/node": "^18.0.0",
33
33
  "fetch-mock": "^9.11.0",
34
34
  "jest": "^29.0.0",
35
- "prettier": "2.7.1",
36
- "semantic-release": "^19.0.0",
35
+ "prettier": "2.8.3",
36
+ "semantic-release": "^20.0.0",
37
37
  "semantic-release-plugin-update-version-in-files": "^1.1.0",
38
38
  "ts-jest": "^29.0.0",
39
39
  "typescript": "^4.2.2"
@@ -281,7 +281,7 @@ The unguessable random string you provided in [Step 1 of GitHub's OAuth web appl
281
281
  <code>string</code>
282
282
  </th>
283
283
  <td>
284
-
284
+
285
285
  The <code>redirect_uri</code> parameter you provided in [Step 1 of GitHub's OAuth web application flow](https://docs.github.com/en/developers/apps/authorizing-oauth-apps#1-request-a-users-github-identity).
286
286
 
287
287
  </td>
@@ -709,6 +709,17 @@ The differences are
709
709
  array of scope names enabled for the token
710
710
  </td>
711
711
  </tr>
712
+ <tr>
713
+ <th>
714
+ <code>onTokenCreated</code>
715
+ </th>
716
+ <th>
717
+ <code>function</code>
718
+ </th>
719
+ <td>
720
+ callback invoked when a token is "reset" or "refreshed"
721
+ </td>
722
+ </tr>
712
723
  <tr>
713
724
  <th>
714
725
  <code>invalid</code>
@@ -808,6 +819,17 @@ Either `undefined` or `true`. Will be set to `true` if the token was invalided e
808
819
  The user access token
809
820
  </td>
810
821
  </tr>
822
+ <tr>
823
+ <th>
824
+ <code>onTokenCreated</code>
825
+ </th>
826
+ <th>
827
+ <code>function</code>
828
+ </th>
829
+ <td>
830
+ callback invoked when a token is "reset" or "refreshed"
831
+ </td>
832
+ </tr>
811
833
  <tr>
812
834
  <th>
813
835
  <code>invalid</code>
@@ -10,7 +10,7 @@ var authOauthDevice = require('@octokit/auth-oauth-device');
10
10
  var oauthMethods = require('@octokit/oauth-methods');
11
11
  var btoa = _interopDefault(require('btoa-lite'));
12
12
 
13
- const VERSION = "2.0.4";
13
+ const VERSION = "2.1.1";
14
14
 
15
15
  // @ts-nocheck there is only place for one of us in this file. And it's not you, TS
16
16
  async function getAuthentication(state) {
@@ -22,6 +22,7 @@ async function getAuthentication(state) {
22
22
  clientId: state.clientId,
23
23
  clientSecret: state.clientSecret,
24
24
  clientType: state.clientType,
25
+ onTokenCreated: state.onTokenCreated,
25
26
  ...state.strategyOptions,
26
27
  request: state.request
27
28
  });
@@ -30,13 +31,13 @@ async function getAuthentication(state) {
30
31
  tokenType: "oauth",
31
32
  ...authentication
32
33
  };
33
- } // handle OAuth device flow
34
-
35
-
34
+ }
35
+ // handle OAuth device flow
36
36
  if ("onVerification" in state.strategyOptions) {
37
37
  const deviceAuth = authOauthDevice.createOAuthDeviceAuth({
38
38
  clientType: state.clientType,
39
39
  clientId: state.clientId,
40
+ onTokenCreated: state.onTokenCreated,
40
41
  ...state.strategyOptions,
41
42
  request: state.request
42
43
  });
@@ -47,9 +48,8 @@ async function getAuthentication(state) {
47
48
  clientSecret: state.clientSecret,
48
49
  ...authentication
49
50
  };
50
- } // use existing authentication
51
-
52
-
51
+ }
52
+ // use existing authentication
53
53
  if ("token" in state.strategyOptions) {
54
54
  return {
55
55
  type: "token",
@@ -57,10 +57,10 @@ async function getAuthentication(state) {
57
57
  clientId: state.clientId,
58
58
  clientSecret: state.clientSecret,
59
59
  clientType: state.clientType,
60
+ onTokenCreated: state.onTokenCreated,
60
61
  ...state.strategyOptions
61
62
  };
62
63
  }
63
-
64
64
  throw new Error("[@octokit/auth-oauth-user] Invalid strategy options");
65
65
  }
66
66
 
@@ -69,13 +69,11 @@ async function auth(state, options = {}) {
69
69
  // This is what TS makes us do ¯\_(ツ)_/¯
70
70
  state.authentication = state.clientType === "oauth-app" ? await getAuthentication(state) : await getAuthentication(state);
71
71
  }
72
-
73
72
  if (state.authentication.invalid) {
74
73
  throw new Error("[@octokit/auth-oauth-user] Token is invalid");
75
74
  }
76
-
77
- const currentAuthentication = state.authentication; // (auto) refresh for user-to-server tokens
78
-
75
+ const currentAuthentication = state.authentication;
76
+ // (auto) refresh for user-to-server tokens
79
77
  if ("expiresAt" in currentAuthentication) {
80
78
  if (options.type === "refresh" || new Date(currentAuthentication.expiresAt) < new Date()) {
81
79
  const {
@@ -93,23 +91,23 @@ async function auth(state, options = {}) {
93
91
  ...authentication
94
92
  };
95
93
  }
96
- } // throw error for invalid refresh call
97
-
98
-
94
+ }
95
+ // throw error for invalid refresh call
99
96
  if (options.type === "refresh") {
97
+ var _state$onTokenCreated;
100
98
  if (state.clientType === "oauth-app") {
101
99
  throw new Error("[@octokit/auth-oauth-user] OAuth Apps do not support expiring tokens");
102
100
  }
103
-
104
101
  if (!currentAuthentication.hasOwnProperty("expiresAt")) {
105
102
  throw new Error("[@octokit/auth-oauth-user] Refresh token missing");
106
103
  }
107
- } // check or reset token
108
-
109
-
104
+ await ((_state$onTokenCreated = state.onTokenCreated) === null || _state$onTokenCreated === void 0 ? void 0 : _state$onTokenCreated.call(state, state.authentication, {
105
+ type: options.type
106
+ }));
107
+ }
108
+ // check or reset token
110
109
  if (options.type === "check" || options.type === "reset") {
111
110
  const method = options.type === "check" ? oauthMethods.checkToken : oauthMethods.resetToken;
112
-
113
111
  try {
114
112
  const {
115
113
  authentication
@@ -127,23 +125,26 @@ async function auth(state, options = {}) {
127
125
  // @ts-expect-error TBD
128
126
  ...authentication
129
127
  };
128
+ if (options.type === "reset") {
129
+ var _state$onTokenCreated2;
130
+ await ((_state$onTokenCreated2 = state.onTokenCreated) === null || _state$onTokenCreated2 === void 0 ? void 0 : _state$onTokenCreated2.call(state, state.authentication, {
131
+ type: options.type
132
+ }));
133
+ }
130
134
  return state.authentication;
131
135
  } catch (error) {
132
136
  // istanbul ignore else
133
137
  if (error.status === 404) {
134
- error.message = "[@octokit/auth-oauth-user] Token is invalid"; // @ts-expect-error TBD
135
-
138
+ error.message = "[@octokit/auth-oauth-user] Token is invalid";
139
+ // @ts-expect-error TBD
136
140
  state.authentication.invalid = true;
137
141
  }
138
-
139
142
  throw error;
140
143
  }
141
- } // invalidate
142
-
143
-
144
+ }
145
+ // invalidate
144
146
  if (options.type === "delete" || options.type === "deleteAuthorization") {
145
147
  const method = options.type === "delete" ? oauthMethods.deleteToken : oauthMethods.deleteAuthorization;
146
-
147
148
  try {
148
149
  await method({
149
150
  // @ts-expect-error making TS happy would require unnecessary code so no
@@ -157,11 +158,9 @@ async function auth(state, options = {}) {
157
158
  // istanbul ignore if
158
159
  if (error.status !== 404) throw error;
159
160
  }
160
-
161
161
  state.authentication.invalid = true;
162
162
  return state.authentication;
163
163
  }
164
-
165
164
  return state.authentication;
166
165
  }
167
166
 
@@ -187,24 +186,24 @@ function requiresBasicAuth(url) {
187
186
  }
188
187
 
189
188
  async function hook(state, request, route, parameters = {}) {
190
- const endpoint = request.endpoint.merge(route, parameters); // Do not intercept OAuth Web/Device flow request
191
-
189
+ const endpoint = request.endpoint.merge(route, parameters);
190
+ // Do not intercept OAuth Web/Device flow request
192
191
  if (/\/login\/(oauth\/access_token|device\/code)$/.test(endpoint.url)) {
193
192
  return request(endpoint);
194
193
  }
195
-
196
194
  if (requiresBasicAuth(endpoint.url)) {
197
195
  const credentials = btoa(`${state.clientId}:${state.clientSecret}`);
198
196
  endpoint.headers.authorization = `basic ${credentials}`;
199
197
  return request(endpoint);
200
- } // TS makes us do this ¯\_(ツ)_/¯
201
-
202
-
198
+ }
199
+ // TS makes us do this ¯\_(ツ)_/¯
203
200
  const {
204
201
  token
205
- } = state.clientType === "oauth-app" ? await auth({ ...state,
202
+ } = state.clientType === "oauth-app" ? await auth({
203
+ ...state,
206
204
  request
207
- }) : await auth({ ...state,
205
+ }) : await auth({
206
+ ...state,
208
207
  request
209
208
  });
210
209
  endpoint.headers.authorization = "token " + token;
@@ -220,16 +219,18 @@ function createOAuthUserAuth({
220
219
  "user-agent": `octokit-auth-oauth-app.js/${VERSION} ${universalUserAgent.getUserAgent()}`
221
220
  }
222
221
  }),
222
+ onTokenCreated,
223
223
  ...strategyOptions
224
224
  }) {
225
225
  const state = Object.assign({
226
226
  clientType,
227
227
  clientId,
228
228
  clientSecret,
229
+ onTokenCreated,
229
230
  strategyOptions,
230
231
  request: request$1
231
- }); // @ts-expect-error not worth the extra code needed to appease TS
232
-
232
+ });
233
+ // @ts-expect-error not worth the extra code needed to appease TS
233
234
  return Object.assign(auth.bind(null, state), {
234
235
  // @ts-expect-error not worth the extra code needed to appease TS
235
236
  hook: hook.bind(null, state)