From 2e5ddc57cdacb49052f2e7c4626207f6400c379b Mon Sep 17 00:00:00 2001 From: Angular Robot Date: Wed, 6 Nov 2024 15:27:15 +0000 Subject: [PATCH] build: update dependency @octokit/auth-app to v7.1.2 --- .github/local-actions/branch-manager/main.js | 73 ++++++++++++------- .github/local-actions/changelog/main.js | 73 ++++++++++++------- .github/local-actions/labels-sync/main.js | 73 ++++++++++++------- .github/local-actions/lock-closed/main.js | 73 ++++++++++++------- github-actions/branch-manager/main.js | 73 ++++++++++++------- .../commit-message-based-labels/main.js | 73 ++++++++++++------- github-actions/feature-request/main.js | 73 ++++++++++++------- github-actions/org-file-sync/main.js | 73 ++++++++++++------- github-actions/post-approval-changes/main.js | 73 ++++++++++++------- github-actions/slash-commands/main.js | 73 ++++++++++++------- github-actions/unified-status-check/main.js | 73 ++++++++++++------- package.json | 2 +- yarn.lock | 21 ++++-- 13 files changed, 543 insertions(+), 283 deletions(-) diff --git a/.github/local-actions/branch-manager/main.js b/.github/local-actions/branch-manager/main.js index ece970a0d..443f5f2da 100644 --- a/.github/local-actions/branch-manager/main.js +++ b/.github/local-actions/branch-manager/main.js @@ -67132,11 +67132,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -67299,6 +67304,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token: token2, @@ -67308,34 +67333,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo2) => repo2.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token: token2, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token: token2, createdAt, @@ -67343,9 +67363,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -67483,7 +67506,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/.github/local-actions/changelog/main.js b/.github/local-actions/changelog/main.js index c0446c062..a57af0436 100644 --- a/.github/local-actions/changelog/main.js +++ b/.github/local-actions/changelog/main.js @@ -66207,11 +66207,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -66374,6 +66379,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -66383,34 +66408,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -66418,9 +66438,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -66558,7 +66581,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/.github/local-actions/labels-sync/main.js b/.github/local-actions/labels-sync/main.js index 51466525e..b14198bbe 100644 --- a/.github/local-actions/labels-sync/main.js +++ b/.github/local-actions/labels-sync/main.js @@ -45835,11 +45835,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -46002,6 +46007,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -46011,34 +46036,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -46046,9 +46066,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -46186,7 +46209,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/.github/local-actions/lock-closed/main.js b/.github/local-actions/lock-closed/main.js index b40a9d59e..c3a0eff74 100644 --- a/.github/local-actions/lock-closed/main.js +++ b/.github/local-actions/lock-closed/main.js @@ -45591,11 +45591,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -45758,6 +45763,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -45767,34 +45792,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -45802,9 +45822,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -45942,7 +45965,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/branch-manager/main.js b/github-actions/branch-manager/main.js index 710ea8606..49517e77c 100644 --- a/github-actions/branch-manager/main.js +++ b/github-actions/branch-manager/main.js @@ -45835,11 +45835,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -46002,6 +46007,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -46011,34 +46036,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -46046,9 +46066,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -46186,7 +46209,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/commit-message-based-labels/main.js b/github-actions/commit-message-based-labels/main.js index e70b89344..ece1cac69 100644 --- a/github-actions/commit-message-based-labels/main.js +++ b/github-actions/commit-message-based-labels/main.js @@ -46300,11 +46300,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -46467,6 +46472,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -46476,34 +46501,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -46511,9 +46531,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -46651,7 +46674,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/feature-request/main.js b/github-actions/feature-request/main.js index 5ed188a44..c7efcf244 100644 --- a/github-actions/feature-request/main.js +++ b/github-actions/feature-request/main.js @@ -45591,11 +45591,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -45758,6 +45763,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -45767,34 +45792,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -45802,9 +45822,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -45942,7 +45965,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/org-file-sync/main.js b/github-actions/org-file-sync/main.js index e047b3ebc..ec59bd523 100644 --- a/github-actions/org-file-sync/main.js +++ b/github-actions/org-file-sync/main.js @@ -45591,11 +45591,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -45758,6 +45763,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -45767,34 +45792,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -45802,9 +45822,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -45942,7 +45965,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/post-approval-changes/main.js b/github-actions/post-approval-changes/main.js index a8944003e..57e85e3ca 100644 --- a/github-actions/post-approval-changes/main.js +++ b/github-actions/post-approval-changes/main.js @@ -45591,11 +45591,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -45758,6 +45763,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -45767,34 +45792,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -45802,9 +45822,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -45942,7 +45965,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/slash-commands/main.js b/github-actions/slash-commands/main.js index 6bb42a099..624f8b137 100644 --- a/github-actions/slash-commands/main.js +++ b/github-actions/slash-commands/main.js @@ -61142,11 +61142,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -61309,6 +61314,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -61318,34 +61343,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -61353,9 +61373,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -61493,7 +61516,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/github-actions/unified-status-check/main.js b/github-actions/unified-status-check/main.js index c66c8c89b..30ffafe62 100644 --- a/github-actions/unified-status-check/main.js +++ b/github-actions/unified-status-check/main.js @@ -45878,11 +45878,16 @@ async function getAppAuthentication({ timeDifference }) { try { - const appAuthentication = await githubAppJwt({ + const authOptions = { id: appId, - privateKey, - now: timeDifference && Math.floor(Date.now() / 1e3) + timeDifference - }); + privateKey + }; + if (timeDifference) { + Object.assign(authOptions, { + now: Math.floor(Date.now() / 1e3) + timeDifference + }); + } + const appAuthentication = await githubAppJwt(authOptions); return { type: "app", token: appAuthentication.token, @@ -46045,6 +46050,26 @@ async function getInstallationAuthentication(state, options, customRequest) { } const appAuthentication = await getAppAuthentication(state); const request2 = customRequest || state.request; + const payload = { + installation_id: installationId, + mediaType: { + previews: ["machine-man"] + }, + headers: { + authorization: `bearer ${appAuthentication.token}` + } + }; + if (options.repositoryIds) { + Object.assign(payload, { repository_ids: options.repositoryIds }); + } + if (options.repositoryNames) { + Object.assign(payload, { + repositories: options.repositoryNames + }); + } + if (options.permissions) { + Object.assign(payload, { permissions: options.permissions }); + } const { data: { token, @@ -46054,34 +46079,29 @@ async function getInstallationAuthentication(state, options, customRequest) { repository_selection: repositorySelectionOptional, single_file: singleFileName } - } = await request2("POST /app/installations/{installation_id}/access_tokens", { - installation_id: installationId, - repository_ids: options.repositoryIds, - repositories: options.repositoryNames, - permissions: options.permissions, - mediaType: { - previews: ["machine-man"] - }, - headers: { - authorization: `bearer ${appAuthentication.token}` - } - }); + } = await request2( + "POST /app/installations/{installation_id}/access_tokens", + payload + ); const permissions = permissionsOptional || {}; const repositorySelection = repositorySelectionOptional || "all"; const repositoryIds = repositories ? repositories.map((r) => r.id) : void 0; const repositoryNames = repositories ? repositories.map((repo) => repo.name) : void 0; const createdAt = (/* @__PURE__ */ new Date()).toISOString(); - await set(state.cache, optionsWithInstallationTokenFromState, { + const cacheOptions = { token, createdAt, expiresAt, repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); - return toTokenAuthentication({ + repositoryNames + }; + if (singleFileName) { + Object.assign(payload, { singleFileName }); + } + await set(state.cache, optionsWithInstallationTokenFromState, cacheOptions); + const cacheData = { installationId, token, createdAt, @@ -46089,9 +46109,12 @@ async function getInstallationAuthentication(state, options, customRequest) { repositorySelection, permissions, repositoryIds, - repositoryNames, - singleFileName - }); + repositoryNames + }; + if (singleFileName) { + Object.assign(cacheData, { singleFileName }); + } + return toTokenAuthentication(cacheData); } async function auth5(state, authOptions) { switch (authOptions.type) { @@ -46229,7 +46252,7 @@ async function sendRequestWithRetries(state, request2, options, createdAt, retri return sendRequestWithRetries(state, request2, options, createdAt, retries); } } -var VERSION12 = "7.1.1"; +var VERSION12 = "7.1.2"; function createAppAuth(options) { if (!options.appId) { throw new Error("[@octokit/auth-app] appId option is required"); diff --git a/package.json b/package.json index 597897405..054763eed 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@lezer/common": "^1.1.1", "@lezer/highlight": "^1.2.0", "@lezer/javascript": "^1.4.9", - "@octokit/auth-app": "7.1.1", + "@octokit/auth-app": "7.1.2", "@octokit/core": "6.1.2", "@octokit/graphql": "8.1.1", "@octokit/graphql-schema": "patch:@octokit/graphql-schema@npm%3A15.3.0#~/.yarn/patches/@octokit-graphql-schema-npm-15.3.0-4046a59648.patch", diff --git a/yarn.lock b/yarn.lock index 07d1c1365..3422bc6f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -286,7 +286,7 @@ __metadata: "@lezer/highlight": "npm:^1.2.0" "@lezer/javascript": "npm:^1.4.9" "@microsoft/api-extractor": "npm:7.47.11" - "@octokit/auth-app": "npm:7.1.1" + "@octokit/auth-app": "npm:7.1.2" "@octokit/core": "npm:6.1.2" "@octokit/graphql": "npm:8.1.1" "@octokit/graphql-schema": "patch:@octokit/graphql-schema@npm%3A15.3.0#~/.yarn/patches/@octokit-graphql-schema-npm-15.3.0-4046a59648.patch" @@ -3687,19 +3687,19 @@ __metadata: languageName: node linkType: hard -"@octokit/auth-app@npm:7.1.1": - version: 7.1.1 - resolution: "@octokit/auth-app@npm:7.1.1" +"@octokit/auth-app@npm:7.1.2": + version: 7.1.2 + resolution: "@octokit/auth-app@npm:7.1.2" dependencies: "@octokit/auth-oauth-app": "npm:^8.1.0" "@octokit/auth-oauth-user": "npm:^5.1.0" "@octokit/request": "npm:^9.1.1" "@octokit/request-error": "npm:^6.1.1" "@octokit/types": "npm:^13.4.1" - lru-cache: "npm:^10.0.0" + lru-cache: "npm:@wolfy1339/lru-cache@^11.0.2-patch.1" universal-github-app-jwt: "npm:^2.2.0" universal-user-agent: "npm:^7.0.0" - checksum: 10c0/2430e90b3c6505b0d29cf5b0c63f5998e9c9524844f3c7a38dc435b42953740da8e333abb22666cb6563ae8a81f92043f1df29af17ec7a7a132f37c9f69e597f + checksum: 10c0/e2ca3e0d05ef519af6d9a698e5d38a633b72f8e71be4b57e293f7ecad92a5633cf7dceebcb8324f5b2230b9c123733354bcc4b8aa8157ce7a1ceaf370fef5a9b languageName: node linkType: hard @@ -11266,7 +11266,14 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^10.0.0, lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": +"lru-cache@npm:@wolfy1339/lru-cache@^11.0.2-patch.1": + version: 11.0.2-patch.1 + resolution: "@wolfy1339/lru-cache@npm:11.0.2-patch.1" + checksum: 10c0/0279b18e46bec0ff00eb18cb19ab3d42dd49bc5c7d1f30f7b0d2deb50c13a99c9ad6a8e4e8cf8a5df614e79e0e62a80df2870c8092c13bfe32f8ecb9a40352b9 + languageName: node + linkType: hard + +"lru-cache@npm:^10.0.1, lru-cache@npm:^10.2.0": version: 10.4.3 resolution: "lru-cache@npm:10.4.3" checksum: 10c0/ebd04fbca961e6c1d6c0af3799adcc966a1babe798f685bb84e6599266599cd95d94630b10262f5424539bc4640107e8a33aa28585374abf561d30d16f4b39fb