@backstage/plugin-scaffolder-backend-module-github 0.0.0-nightly-20250708024259 → 0.0.0-nightly-20250710024421

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @backstage/plugin-scaffolder-backend-module-github
2
2
 
3
- ## 0.0.0-nightly-20250708024259
3
+ ## 0.0.0-nightly-20250710024421
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -22,16 +22,24 @@
22
22
 
23
23
  ```
24
24
 
25
+ - 38db3eb: Fix typo in `InputError`
25
26
  - Updated dependencies
26
- - @backstage/config@0.0.0-nightly-20250708024259
27
- - @backstage/catalog-model@0.0.0-nightly-20250708024259
28
- - @backstage/plugin-scaffolder-node@0.0.0-nightly-20250708024259
29
- - @backstage/integration@0.0.0-nightly-20250708024259
30
- - @backstage/backend-plugin-api@0.0.0-nightly-20250708024259
31
- - @backstage/plugin-catalog-node@0.0.0-nightly-20250708024259
27
+ - @backstage/config@0.0.0-nightly-20250710024421
28
+ - @backstage/catalog-model@0.0.0-nightly-20250710024421
29
+ - @backstage/plugin-scaffolder-node@0.0.0-nightly-20250710024421
30
+ - @backstage/integration@0.0.0-nightly-20250710024421
31
+ - @backstage/backend-plugin-api@0.0.0-nightly-20250710024421
32
+ - @backstage/plugin-catalog-node@0.0.0-nightly-20250710024421
32
33
  - @backstage/errors@1.2.7
33
34
  - @backstage/types@1.2.1
34
35
 
36
+ ## 0.8.1-next.2
37
+
38
+ ### Patch Changes
39
+
40
+ - Updated dependencies
41
+ - @backstage/plugin-scaffolder-node@0.10.0-next.2
42
+
35
43
  ## 0.8.1-next.1
36
44
 
37
45
  ### Patch Changes
package/dist/util.cjs.js CHANGED
@@ -26,7 +26,7 @@ async function getOctokitOptions(options) {
26
26
  }
27
27
  if (!owner || !repo) {
28
28
  throw new errors.InputError(
29
- `No owner and/or owner provided, which is required if a token is not provided`
29
+ `No owner and/or repo provided, which is required if a token is not provided`
30
30
  );
31
31
  }
32
32
  const githubCredentialsProvider = credentialsProvider ?? integration.DefaultGithubCredentialsProvider.fromIntegrations(integrations);
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs.js","sources":["../src/util.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { OctokitOptions } from '@octokit/core/dist-types/types';\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Helper for generating octokit configuration options.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host: string;\n owner?: string;\n repo?: string;\n}): Promise<OctokitOptions>;\n\n/**\n * Helper for generating octokit configuration options for given repoUrl.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n * @deprecated Use options `host`, `owner` and `repo` instead of `repoUrl`.\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n repoUrl: string;\n}): Promise<OctokitOptions>;\n\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host?: string;\n owner?: string;\n repo?: string;\n repoUrl?: string;\n}): Promise<OctokitOptions> {\n const { integrations, credentialsProvider, token, repoUrl } = options;\n const { host, owner, repo } = repoUrl\n ? parseRepoUrl(repoUrl, integrations)\n : options;\n\n const requestOptions = {\n // set timeout to 60 seconds\n timeout: DEFAULT_TIMEOUT_MS,\n };\n\n const integrationConfig = integrations.github.byHost(host!)?.config;\n\n if (!integrationConfig) {\n throw new InputError(`No integration for host ${host}`);\n }\n\n // short circuit the `githubCredentialsProvider` if there is a token provided by the caller already\n if (token) {\n return {\n auth: token,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n request: requestOptions,\n };\n }\n\n if (!owner || !repo) {\n throw new InputError(\n `No owner and/or owner provided, which is required if a token is not provided`,\n );\n }\n\n const githubCredentialsProvider =\n credentialsProvider ??\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n const { token: credentialProviderToken } =\n await githubCredentialsProvider.getCredentials({\n url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(\n repo,\n )}`,\n });\n\n if (!credentialProviderToken) {\n throw new InputError(\n `No token available for host: ${host}, with owner ${owner}, and repo ${repo}. Make sure GitHub auth is configured correctly. See https://backstage.io/docs/auth/github/provider for more details.`,\n );\n }\n\n return {\n auth: credentialProviderToken,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n };\n}\n"],"names":["parseRepoUrl","InputError","DefaultGithubCredentialsProvider"],"mappings":";;;;;;AAyBA,MAAM,kBAAqB,GAAA,GAAA;AA6B3B,eAAsB,kBAAkB,OAQZ,EAAA;AAC1B,EAAA,MAAM,EAAE,YAAA,EAAc,mBAAqB,EAAA,KAAA,EAAO,SAAY,GAAA,OAAA;AAC9D,EAAM,MAAA,EAAE,MAAM,KAAO,EAAA,IAAA,KAAS,OAC1B,GAAAA,iCAAA,CAAa,OAAS,EAAA,YAAY,CAClC,GAAA,OAAA;AAEJ,EAAA,MAAM,cAAiB,GAAA;AAAA;AAAA,IAErB,OAAS,EAAA;AAAA,GACX;AAE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"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport {\n DefaultGithubCredentialsProvider,\n GithubCredentialsProvider,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport { parseRepoUrl } from '@backstage/plugin-scaffolder-node';\nimport { OctokitOptions } from '@octokit/core/dist-types/types';\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n\n/**\n * Helper for generating octokit configuration options.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host: string;\n owner?: string;\n repo?: string;\n}): Promise<OctokitOptions>;\n\n/**\n * Helper for generating octokit configuration options for given repoUrl.\n * If no token is provided, it will attempt to get a token from the credentials provider.\n * @public\n * @deprecated Use options `host`, `owner` and `repo` instead of `repoUrl`.\n */\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n repoUrl: string;\n}): Promise<OctokitOptions>;\n\nexport async function getOctokitOptions(options: {\n integrations: ScmIntegrationRegistry;\n credentialsProvider?: GithubCredentialsProvider;\n token?: string;\n host?: string;\n owner?: string;\n repo?: string;\n repoUrl?: string;\n}): Promise<OctokitOptions> {\n const { integrations, credentialsProvider, token, repoUrl } = options;\n const { host, owner, repo } = repoUrl\n ? parseRepoUrl(repoUrl, integrations)\n : options;\n\n const requestOptions = {\n // set timeout to 60 seconds\n timeout: DEFAULT_TIMEOUT_MS,\n };\n\n const integrationConfig = integrations.github.byHost(host!)?.config;\n\n if (!integrationConfig) {\n throw new InputError(`No integration for host ${host}`);\n }\n\n // short circuit the `githubCredentialsProvider` if there is a token provided by the caller already\n if (token) {\n return {\n auth: token,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n request: requestOptions,\n };\n }\n\n if (!owner || !repo) {\n throw new InputError(\n `No owner and/or repo provided, which is required if a token is not provided`,\n );\n }\n\n const githubCredentialsProvider =\n credentialsProvider ??\n DefaultGithubCredentialsProvider.fromIntegrations(integrations);\n\n const { token: credentialProviderToken } =\n await githubCredentialsProvider.getCredentials({\n url: `https://${host}/${encodeURIComponent(owner)}/${encodeURIComponent(\n repo,\n )}`,\n });\n\n if (!credentialProviderToken) {\n throw new InputError(\n `No token available for host: ${host}, with owner ${owner}, and repo ${repo}. Make sure GitHub auth is configured correctly. See https://backstage.io/docs/auth/github/provider for more details.`,\n );\n }\n\n return {\n auth: credentialProviderToken,\n baseUrl: integrationConfig.apiBaseUrl,\n previews: ['nebula-preview'],\n };\n}\n"],"names":["parseRepoUrl","InputError","DefaultGithubCredentialsProvider"],"mappings":";;;;;;AAyBA,MAAM,kBAAqB,GAAA,GAAA;AA6B3B,eAAsB,kBAAkB,OAQZ,EAAA;AAC1B,EAAA,MAAM,EAAE,YAAA,EAAc,mBAAqB,EAAA,KAAA,EAAO,SAAY,GAAA,OAAA;AAC9D,EAAM,MAAA,EAAE,MAAM,KAAO,EAAA,IAAA,KAAS,OAC1B,GAAAA,iCAAA,CAAa,OAAS,EAAA,YAAY,CAClC,GAAA,OAAA;AAEJ,EAAA,MAAM,cAAiB,GAAA;AAAA;AAAA,IAErB,OAAS,EAAA;AAAA,GACX;AAEA,EAAA,MAAM,iBAAoB,GAAA,YAAA,CAAa,MAAO,CAAA,MAAA,CAAO,IAAK,CAAG,EAAA,MAAA;AAE7D,EAAA,IAAI,CAAC,iBAAmB,EAAA;AACtB,IAAA,MAAM,IAAIC,iBAAA,CAAW,CAA2B,wBAAA,EAAA,IAAI,CAAE,CAAA,CAAA;AAAA;AAIxD,EAAA,IAAI,KAAO,EAAA;AACT,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,KAAA;AAAA,MACN,SAAS,iBAAkB,CAAA,UAAA;AAAA,MAC3B,QAAA,EAAU,CAAC,gBAAgB,CAAA;AAAA,MAC3B,OAAS,EAAA;AAAA,KACX;AAAA;AAGF,EAAI,IAAA,CAAC,KAAS,IAAA,CAAC,IAAM,EAAA;AACnB,IAAA,MAAM,IAAIA,iBAAA;AAAA,MACR,CAAA,2EAAA;AAAA,KACF;AAAA;AAGF,EAAA,MAAM,yBACJ,GAAA,mBAAA,IACAC,4CAAiC,CAAA,gBAAA,CAAiB,YAAY,CAAA;AAEhE,EAAA,MAAM,EAAE,KAAO,EAAA,uBAAA,EACb,GAAA,MAAM,0BAA0B,cAAe,CAAA;AAAA,IAC7C,KAAK,CAAW,QAAA,EAAA,IAAI,IAAI,kBAAmB,CAAA,KAAK,CAAC,CAAI,CAAA,EAAA,kBAAA;AAAA,MACnD;AAAA,KACD,CAAA;AAAA,GACF,CAAA;AAEH,EAAA,IAAI,CAAC,uBAAyB,EAAA;AAC5B,IAAA,MAAM,IAAID,iBAAA;AAAA,MACR,CAAgC,6BAAA,EAAA,IAAI,CAAgB,aAAA,EAAA,KAAK,cAAc,IAAI,CAAA,qHAAA;AAAA,KAC7E;AAAA;AAGF,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,uBAAA;AAAA,IACN,SAAS,iBAAkB,CAAA,UAAA;AAAA,IAC3B,QAAA,EAAU,CAAC,gBAAgB;AAAA,GAC7B;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend-module-github",
3
- "version": "0.0.0-nightly-20250708024259",
3
+ "version": "0.0.0-nightly-20250710024421",
4
4
  "description": "The github module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -50,13 +50,13 @@
50
50
  "test": "backstage-cli package test"
51
51
  },
52
52
  "dependencies": {
53
- "@backstage/backend-plugin-api": "0.0.0-nightly-20250708024259",
54
- "@backstage/catalog-model": "0.0.0-nightly-20250708024259",
55
- "@backstage/config": "0.0.0-nightly-20250708024259",
53
+ "@backstage/backend-plugin-api": "0.0.0-nightly-20250710024421",
54
+ "@backstage/catalog-model": "0.0.0-nightly-20250710024421",
55
+ "@backstage/config": "0.0.0-nightly-20250710024421",
56
56
  "@backstage/errors": "1.2.7",
57
- "@backstage/integration": "0.0.0-nightly-20250708024259",
58
- "@backstage/plugin-catalog-node": "0.0.0-nightly-20250708024259",
59
- "@backstage/plugin-scaffolder-node": "0.0.0-nightly-20250708024259",
57
+ "@backstage/integration": "0.0.0-nightly-20250710024421",
58
+ "@backstage/plugin-catalog-node": "0.0.0-nightly-20250710024421",
59
+ "@backstage/plugin-scaffolder-node": "0.0.0-nightly-20250710024421",
60
60
  "@backstage/types": "1.2.1",
61
61
  "@octokit/webhooks": "^10.9.2",
62
62
  "libsodium-wrappers": "^0.7.11",
@@ -66,9 +66,9 @@
66
66
  "zod": "^3.22.4"
67
67
  },
68
68
  "devDependencies": {
69
- "@backstage/backend-test-utils": "0.0.0-nightly-20250708024259",
70
- "@backstage/cli": "0.0.0-nightly-20250708024259",
71
- "@backstage/plugin-scaffolder-node-test-utils": "0.0.0-nightly-20250708024259",
69
+ "@backstage/backend-test-utils": "0.0.0-nightly-20250710024421",
70
+ "@backstage/cli": "0.0.0-nightly-20250710024421",
71
+ "@backstage/plugin-scaffolder-node-test-utils": "0.0.0-nightly-20250710024421",
72
72
  "@types/libsodium-wrappers": "^0.7.10",
73
73
  "fs-extra": "^11.2.0",
74
74
  "jsonschema": "^1.2.6"