@backstage/plugin-catalog-backend-module-github 0.13.0-next.1 → 0.13.0-next.2

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,5 +1,31 @@
1
1
  # @backstage/plugin-catalog-backend-module-github
2
2
 
3
+ ## 0.13.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 106d1b2: Added a `defaultUserTransformer.useVerifiedEmails` config option for the `githubOrg` provider. When set to `true`, the default user transformer prefers organization verified domain emails over the user's public GitHub email. Defaults to `false`, which uses only the public GitHub email.
8
+
9
+ This option has no effect when a custom user transformer is set via the `githubOrgEntityProviderTransformsExtensionPoint`.
10
+
11
+ ```yaml
12
+ catalog:
13
+ providers:
14
+ githubOrg:
15
+ production:
16
+ githubUrl: https://github.com
17
+ orgs:
18
+ - my-org
19
+ defaultUserTransformer:
20
+ useVerifiedEmails: true
21
+ ```
22
+
23
+ - Updated dependencies
24
+ - @backstage/backend-plugin-api@1.8.0-next.1
25
+ - @backstage/integration@2.0.0-next.2
26
+ - @backstage/plugin-catalog-node@2.1.0-next.2
27
+ - @backstage/plugin-events-node@0.4.20-next.1
28
+
3
29
  ## 0.13.0-next.1
4
30
 
5
31
  ### Minor Changes
package/config.d.ts CHANGED
@@ -270,6 +270,24 @@ export interface Config {
270
270
  */
271
271
  excludeSuspendedUsers?: boolean;
272
272
 
273
+ /**
274
+ * (Optional) Configuration for the default user transformer.
275
+ * These options only apply when using the built-in transformer;
276
+ * they have no effect if a custom transformer is set via the
277
+ * extension point.
278
+ */
279
+ defaultUserTransformer?: {
280
+ /**
281
+ * (Optional) Whether to prefer organization verified domain emails
282
+ * over the user's public GitHub email when populating user entity profiles.
283
+ * When enabled, the transformer uses the first verified domain email
284
+ * (with plus-addressed routing tags stripped) and falls back to the
285
+ * public email if none are available.
286
+ * Default: `false`.
287
+ */
288
+ useVerifiedEmails?: boolean;
289
+ };
290
+
273
291
  /**
274
292
  * The refresh schedule to use.
275
293
  */
@@ -327,6 +345,24 @@ export interface Config {
327
345
  */
328
346
  excludeSuspendedUsers?: boolean;
329
347
 
348
+ /**
349
+ * (Optional) Configuration for the default user transformer.
350
+ * These options only apply when using the built-in transformer;
351
+ * they have no effect if a custom transformer is set via the
352
+ * extension point.
353
+ */
354
+ defaultUserTransformer?: {
355
+ /**
356
+ * (Optional) Whether to prefer organization verified domain emails
357
+ * over the user's public GitHub email when populating user entity profiles.
358
+ * When enabled, the transformer uses the first verified domain email
359
+ * (with plus-addressed routing tags stripped) and falls back to the
360
+ * public email if none are available.
361
+ * Default: `false`.
362
+ */
363
+ useVerifiedEmails?: boolean;
364
+ };
365
+
330
366
  /**
331
367
  * The refresh schedule to use.
332
368
  */
package/dist/index.cjs.js CHANGED
@@ -27,6 +27,7 @@ exports.GithubOrgReaderProcessor = GithubOrgReaderProcessor.GithubOrgReaderProce
27
27
  exports.GithubEntityProvider = GithubEntityProvider.GithubEntityProvider;
28
28
  exports.GithubMultiOrgEntityProvider = GithubMultiOrgEntityProvider.GithubMultiOrgEntityProvider;
29
29
  exports.GithubOrgEntityProvider = GithubOrgEntityProvider.GithubOrgEntityProvider;
30
+ exports.buildDefaultUserTransformer = defaultTransformers.buildDefaultUserTransformer;
30
31
  exports.defaultOrganizationTeamTransformer = defaultTransformers.defaultOrganizationTeamTransformer;
31
32
  exports.defaultUserTransformer = defaultTransformers.defaultUserTransformer;
32
33
  exports.GitHubEntityProvider = deprecated.GitHubEntityProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { AuthService, LoggerService, SchedulerServiceTaskRunner, SchedulerService } from '@backstage/backend-plugin-api';
3
3
  import * as _backstage_catalog_model from '@backstage/catalog-model';
4
- import { Entity, UserEntity } from '@backstage/catalog-model';
4
+ import { Entity } from '@backstage/catalog-model';
5
5
  import { GithubCredentialsProvider, ScmIntegrationRegistry, GithubIntegrationConfig } from '@backstage/integration';
6
6
  import { ScmLocationAnalyzer, CatalogService, AnalyzeOptions, CatalogProcessor, LocationSpec, CatalogProcessorEmit, EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-node';
7
7
  import { Config } from '@backstage/config';
@@ -116,12 +116,34 @@ type UserTransformer = (item: GithubUser, ctx: TransformerContext) => Promise<En
116
116
  * @public
117
117
  */
118
118
  type TeamTransformer = (item: GithubTeam, ctx: TransformerContext) => Promise<Entity | undefined>;
119
+ /**
120
+ * Options for {@link buildDefaultUserTransformer}.
121
+ *
122
+ * @public
123
+ */
124
+ interface DefaultUserTransformerOptions {
125
+ /**
126
+ * Whether to prefer organization verified domain emails over the user's
127
+ * public GitHub email. When enabled, the transformer uses the first
128
+ * verified domain email (with plus-addressed routing tags stripped) and
129
+ * falls back to the public email if none are available.
130
+ *
131
+ * @defaultValue false
132
+ */
133
+ useVerifiedEmails?: boolean;
134
+ }
135
+ /**
136
+ * Builds a user transformer with configurable email behavior.
137
+ *
138
+ * @public
139
+ */
140
+ declare function buildDefaultUserTransformer(options?: DefaultUserTransformerOptions): UserTransformer;
119
141
  /**
120
142
  * Default transformer for GitHub users to UserEntity
121
143
  *
122
144
  * @public
123
145
  */
124
- declare const defaultUserTransformer: (item: GithubUser, _ctx: TransformerContext) => Promise<UserEntity | undefined>;
146
+ declare const defaultUserTransformer: UserTransformer;
125
147
  /**
126
148
  * Default transformer for GitHub Team to GroupEntity
127
149
  *
@@ -616,5 +638,5 @@ declare class GitHubEntityProvider implements EntityProvider {
616
638
  refresh(logger: LoggerService): Promise<void>;
617
639
  }
618
640
 
619
- export { GitHubEntityProvider, GitHubOrgEntityProvider, GithubDiscoveryProcessor, GithubEntityProvider, GithubLocationAnalyzer, GithubMultiOrgEntityProvider, GithubMultiOrgReaderProcessor, GithubOrgEntityProvider, GithubOrgReaderProcessor, githubCatalogModule as default, defaultOrganizationTeamTransformer, defaultUserTransformer };
620
- export type { GitHubOrgEntityProviderOptions, GithubLocationAnalyzerOptions, GithubMultiOrgConfig, GithubMultiOrgEntityProviderOptions, GithubOrgEntityProviderOptions, GithubPageSizes, GithubTeam, GithubUser, TeamTransformer, TransformerContext, UserTransformer };
641
+ export { GitHubEntityProvider, GitHubOrgEntityProvider, GithubDiscoveryProcessor, GithubEntityProvider, GithubLocationAnalyzer, GithubMultiOrgEntityProvider, GithubMultiOrgReaderProcessor, GithubOrgEntityProvider, GithubOrgReaderProcessor, buildDefaultUserTransformer, githubCatalogModule as default, defaultOrganizationTeamTransformer, defaultUserTransformer };
642
+ export type { DefaultUserTransformerOptions, GitHubOrgEntityProviderOptions, GithubLocationAnalyzerOptions, GithubMultiOrgConfig, GithubMultiOrgEntityProviderOptions, GithubOrgEntityProviderOptions, GithubPageSizes, GithubTeam, GithubUser, TeamTransformer, TransformerContext, UserTransformer };
@@ -2,29 +2,36 @@
2
2
 
3
3
  var annotation = require('./annotation.cjs.js');
4
4
 
5
- const defaultUserTransformer = async (item, _ctx) => {
6
- const entity = {
7
- apiVersion: "backstage.io/v1alpha1",
8
- kind: "User",
9
- metadata: {
10
- name: item.login,
11
- annotations: {
12
- [annotation.ANNOTATION_GITHUB_USER_LOGIN]: item.login,
13
- ...item.id && { [annotation.ANNOTATION_GITHUB_USER_ID]: item.id }
5
+ function buildDefaultUserTransformer(options) {
6
+ return async (item, _ctx) => {
7
+ const entity = {
8
+ apiVersion: "backstage.io/v1alpha1",
9
+ kind: "User",
10
+ metadata: {
11
+ name: item.login,
12
+ annotations: {
13
+ [annotation.ANNOTATION_GITHUB_USER_LOGIN]: item.login,
14
+ ...item.id && { [annotation.ANNOTATION_GITHUB_USER_ID]: item.id }
15
+ }
16
+ },
17
+ spec: {
18
+ profile: {},
19
+ memberOf: []
14
20
  }
15
- },
16
- spec: {
17
- profile: {},
18
- memberOf: []
21
+ };
22
+ if (item.bio) entity.metadata.description = item.bio;
23
+ if (item.name) entity.spec.profile.displayName = item.name;
24
+ if (options?.useVerifiedEmails) {
25
+ const email = item.organizationVerifiedDomainEmails?.length ? item.organizationVerifiedDomainEmails[0].replace(/\+[^@]*/, "") : item.email;
26
+ if (email) entity.spec.profile.email = email;
27
+ } else {
28
+ if (item.email) entity.spec.profile.email = item.email;
19
29
  }
30
+ if (item.avatarUrl) entity.spec.profile.picture = item.avatarUrl;
31
+ return entity;
20
32
  };
21
- if (item.bio) entity.metadata.description = item.bio;
22
- if (item.name) entity.spec.profile.displayName = item.name;
23
- const email = item.organizationVerifiedDomainEmails?.length ? item.organizationVerifiedDomainEmails[0].replace(/\+[^@]*/, "") : item.email;
24
- if (email) entity.spec.profile.email = email;
25
- if (item.avatarUrl) entity.spec.profile.picture = item.avatarUrl;
26
- return entity;
27
- };
33
+ }
34
+ const defaultUserTransformer = buildDefaultUserTransformer();
28
35
  const defaultOrganizationTeamTransformer = async (team) => {
29
36
  const annotations = {
30
37
  [annotation.ANNOTATION_GITHUB_TEAM_SLUG]: team.combinedSlug
@@ -61,6 +68,7 @@ const defaultOrganizationTeamTransformer = async (team) => {
61
68
  return entity;
62
69
  };
63
70
 
71
+ exports.buildDefaultUserTransformer = buildDefaultUserTransformer;
64
72
  exports.defaultOrganizationTeamTransformer = defaultOrganizationTeamTransformer;
65
73
  exports.defaultUserTransformer = defaultUserTransformer;
66
74
  //# sourceMappingURL=defaultTransformers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultTransformers.cjs.js","sources":["../../src/lib/defaultTransformers.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Entity, GroupEntity, UserEntity } from '@backstage/catalog-model';\nimport { graphql } from '@octokit/graphql';\nimport {\n ANNOTATION_GITHUB_TEAM_SLUG,\n ANNOTATION_GITHUB_USER_LOGIN,\n ANNOTATION_GITHUB_USER_ID,\n} from './annotation';\nimport { GithubTeam, GithubUser } from './github';\n\n/**\n * Context passed to Transformers\n *\n * @public\n */\nexport interface TransformerContext {\n client: typeof graphql;\n query: string;\n org: string;\n}\n\n/**\n * Transformer for GitHub users to an Entity\n *\n * @public\n */\nexport type UserTransformer = (\n item: GithubUser,\n ctx: TransformerContext,\n) => Promise<Entity | undefined>;\n\n/**\n * Transformer for GitHub Team to an Entity\n *\n * @public\n */\nexport type TeamTransformer = (\n item: GithubTeam,\n ctx: TransformerContext,\n) => Promise<Entity | undefined>;\n\n/**\n * Default transformer for GitHub users to UserEntity\n *\n * @public\n */\nexport const defaultUserTransformer = async (\n item: GithubUser,\n _ctx: TransformerContext,\n): Promise<UserEntity | undefined> => {\n const entity: UserEntity = {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'User',\n metadata: {\n name: item.login,\n annotations: {\n [ANNOTATION_GITHUB_USER_LOGIN]: item.login,\n ...(item.id && { [ANNOTATION_GITHUB_USER_ID]: item.id }),\n },\n },\n spec: {\n profile: {},\n memberOf: [],\n },\n };\n\n if (item.bio) entity.metadata.description = item.bio;\n if (item.name) entity.spec.profile!.displayName = item.name;\n // GitHub returns verified domain emails as plus-addressed routing aliases\n // (e.g. user+abc123@example.com). Strip the tag to get the real address.\n const email = item.organizationVerifiedDomainEmails?.length\n ? item.organizationVerifiedDomainEmails[0].replace(/\\+[^@]*/, '')\n : item.email;\n if (email) entity.spec.profile!.email = email;\n if (item.avatarUrl) entity.spec.profile!.picture = item.avatarUrl;\n return entity;\n};\n\n/**\n * Default transformer for GitHub Team to GroupEntity\n *\n * @public\n */\nexport const defaultOrganizationTeamTransformer: TeamTransformer =\n async team => {\n const annotations: { [annotationName: string]: string } = {\n [ANNOTATION_GITHUB_TEAM_SLUG]: team.combinedSlug,\n };\n\n if (team.editTeamUrl) {\n annotations['backstage.io/edit-url'] = team.editTeamUrl;\n }\n\n const entity: GroupEntity = {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Group',\n metadata: {\n name: team.slug,\n annotations,\n },\n spec: {\n type: 'team',\n profile: {},\n children: [],\n },\n };\n\n if (team.description) {\n entity.metadata.description = team.description;\n }\n if (team.name) {\n entity.spec.profile!.displayName = team.name;\n }\n if (team.avatarUrl) {\n entity.spec.profile!.picture = team.avatarUrl;\n }\n if (team.parentTeam) {\n entity.spec.parent = team.parentTeam.slug;\n }\n\n entity.spec.members = team.members.map(user => user.login);\n\n return entity;\n };\n"],"names":["ANNOTATION_GITHUB_USER_LOGIN","ANNOTATION_GITHUB_USER_ID","ANNOTATION_GITHUB_TEAM_SLUG"],"mappings":";;;;AA6DO,MAAM,sBAAA,GAAyB,OACpC,IAAA,EACA,IAAA,KACoC;AACpC,EAAA,MAAM,MAAA,GAAqB;AAAA,IACzB,UAAA,EAAY,uBAAA;AAAA,IACZ,IAAA,EAAM,MAAA;AAAA,IACN,QAAA,EAAU;AAAA,MACR,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,WAAA,EAAa;AAAA,QACX,CAACA,uCAA4B,GAAG,IAAA,CAAK,KAAA;AAAA,QACrC,GAAI,KAAK,EAAA,IAAM,EAAE,CAACC,oCAAyB,GAAG,KAAK,EAAA;AAAG;AACxD,KACF;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,SAAS,EAAC;AAAA,MACV,UAAU;AAAC;AACb,GACF;AAEA,EAAA,IAAI,IAAA,CAAK,GAAA,EAAK,MAAA,CAAO,QAAA,CAAS,c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,CAAK,IAAA;AAAA,EAC1C;AACA,EAAA,IAAI,KAAK,SAAA,EAAW;AAClB,IAAA,MAAA,CAAO,IAAA,CAAK,OAAA,CAAS,OAAA,GAAU,IAAA,CAAK,SAAA;AAAA,EACtC;AACA,EAAA,IAAI,KAAK,UAAA,EAAY;AACnB,IAAA,MAAA,CAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,UAAA,CAAW,IAAA;AAAA,EACvC;AAEA,EAAA,MAAA,CAAO,KAAK,OAAA,GAAU,IAAA,CAAK,QAAQ,GAAA,CAAI,CAAA,IAAA,KAAQ,KAAK,KAAK,CAAA;AAEzD,EAAA,OAAO,MAAA;AACT;;;;;"}
1
+ {"version":3,"file":"defaultTransformers.cjs.js","sources":["../../src/lib/defaultTransformers.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { Entity, GroupEntity, UserEntity } from '@backstage/catalog-model';\nimport { graphql } from '@octokit/graphql';\nimport {\n ANNOTATION_GITHUB_TEAM_SLUG,\n ANNOTATION_GITHUB_USER_LOGIN,\n ANNOTATION_GITHUB_USER_ID,\n} from './annotation';\nimport { GithubTeam, GithubUser } from './github';\n\n/**\n * Context passed to Transformers\n *\n * @public\n */\nexport interface TransformerContext {\n client: typeof graphql;\n query: string;\n org: string;\n}\n\n/**\n * Transformer for GitHub users to an Entity\n *\n * @public\n */\nexport type UserTransformer = (\n item: GithubUser,\n ctx: TransformerContext,\n) => Promise<Entity | undefined>;\n\n/**\n * Transformer for GitHub Team to an Entity\n *\n * @public\n */\nexport type TeamTransformer = (\n item: GithubTeam,\n ctx: TransformerContext,\n) => Promise<Entity | undefined>;\n\n/**\n * Options for {@link buildDefaultUserTransformer}.\n *\n * @public\n */\nexport interface DefaultUserTransformerOptions {\n /**\n * Whether to prefer organization verified domain emails over the user's\n * public GitHub email. When enabled, the transformer uses the first\n * verified domain email (with plus-addressed routing tags stripped) and\n * falls back to the public email if none are available.\n *\n * @defaultValue false\n */\n useVerifiedEmails?: boolean;\n}\n\n/**\n * Builds a user transformer with configurable email behavior.\n *\n * @public\n */\nexport function buildDefaultUserTransformer(\n options?: DefaultUserTransformerOptions,\n): UserTransformer {\n return async (item, _ctx) => {\n const entity: UserEntity = {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'User',\n metadata: {\n name: item.login,\n annotations: {\n [ANNOTATION_GITHUB_USER_LOGIN]: item.login,\n ...(item.id && { [ANNOTATION_GITHUB_USER_ID]: item.id }),\n },\n },\n spec: {\n profile: {},\n memberOf: [],\n },\n };\n\n if (item.bio) entity.metadata.description = item.bio;\n if (item.name) entity.spec.profile!.displayName = item.name;\n\n if (options?.useVerifiedEmails) {\n // GitHub returns verified domain emails as plus-addressed routing aliases\n // (e.g. user+abc123@example.com). Strip the tag to get the real address.\n const email = item.organizationVerifiedDomainEmails?.length\n ? item.organizationVerifiedDomainEmails[0].replace(/\\+[^@]*/, '')\n : item.email;\n if (email) entity.spec.profile!.email = email;\n } else {\n if (item.email) entity.spec.profile!.email = item.email;\n }\n\n if (item.avatarUrl) entity.spec.profile!.picture = item.avatarUrl;\n return entity;\n };\n}\n\n/**\n * Default transformer for GitHub users to UserEntity\n *\n * @public\n */\nexport const defaultUserTransformer: UserTransformer =\n buildDefaultUserTransformer();\n\n/**\n * Default transformer for GitHub Team to GroupEntity\n *\n * @public\n */\nexport const defaultOrganizationTeamTransformer: TeamTransformer =\n async team => {\n const annotations: { [annotationName: string]: string } = {\n [ANNOTATION_GITHUB_TEAM_SLUG]: team.combinedSlug,\n };\n\n if (team.editTeamUrl) {\n annotations['backstage.io/edit-url'] = team.editTeamUrl;\n }\n\n const entity: GroupEntity = {\n apiVersion: 'backstage.io/v1alpha1',\n kind: 'Group',\n metadata: {\n name: team.slug,\n annotations,\n },\n spec: {\n type: 'team',\n profile: {},\n children: [],\n },\n };\n\n if (team.description) {\n entity.metadata.description = team.description;\n }\n if (team.name) {\n entity.spec.profile!.displayName = team.name;\n }\n if (team.avatarUrl) {\n entity.spec.profile!.picture = team.avatarUrl;\n }\n if (team.parentTeam) {\n entity.spec.parent = team.parentTeam.slug;\n }\n\n entity.spec.members = team.members.map(user => user.login);\n\n return entity;\n };\n"],"names":["ANNOTATION_GITHUB_USER_LOGIN","ANNOTATION_GITHUB_USER_ID","ANNOTATION_GITHUB_TEAM_SLUG"],"mappings":";;;;AA8EO,SAAS,4BACd,OAAA,EACiB;AACjB,EAAA,OAAO,OAAO,MAAM,IAAA,KAAS;AAC3B,IAAA,MAAM,MAAA,GAAqB;AAAA,MACzB,UAAA,EAAY,uBAAA;AAAA,MACZ,IAAA,EAAM,MAAA;AAAA,MACN,QAAA,EAAU;AAAA,QACR,MAAM,IAAA,CAAK,KAAA;AAAA,QACX,WAAA,EAAa;AAAA,UACX,CAACA,uCAA4B,GAAG,IAAA,CAAK,KAAA;AAAA,UACrC,GAAI,KAAK,EAAA,IAAM,EAAE,CAACC,oCAAyB,GAAG,KAAK,EAAA;AAAG;AACxD,OACF;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,SAAS,EAAC;AAAA,QACV,UAAU;AAAC;AACb,KACF;AAEA,IAAA,IAAI,IAAA,CAAK,GAAA,EAAK,MAAA,CAAO,QAAA,CAAS,cAAc,IAAA,CAAK,GAAA;AACjD,IAAA,IAAI,KAAK,IAAA,EAAM,MAAA,CAAO,IAAA,CAAK,OAAA,CAAS,cAAc,IAAA,CAAK,IAAA;AAEvD,IAAA,IAAI,SAAS,iBAAA,EAAmB;AAG9B,MAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,gCAAA,EAAkC,MAAA,GAC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A;AAAA,EAC1C;AACA,EAAA,IAAI,KAAK,SAAA,EAAW;AAClB,IAAA,MAAA,CAAO,IAAA,CAAK,OAAA,CAAS,OAAA,GAAU,IAAA,CAAK,SAAA;AAAA,EACtC;AACA,EAAA,IAAI,KAAK,UAAA,EAAY;AACnB,IAAA,MAAA,CAAO,IAAA,CAAK,MAAA,GAAS,IAAA,CAAK,UAAA,CAAW,IAAA;AAAA,EACvC;AAEA,EAAA,MAAA,CAAO,KAAK,OAAA,GAAU,IAAA,CAAK,QAAQ,GAAA,CAAI,CAAA,IAAA,KAAQ,KAAK,KAAK,CAAA;AAEzD,EAAA,OAAO,MAAA;AACT;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend-module-github",
3
- "version": "0.13.0-next.1",
3
+ "version": "0.13.0-next.2",
4
4
  "description": "A Backstage catalog backend module that helps integrate towards GitHub",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -65,14 +65,14 @@
65
65
  "test": "backstage-cli package test"
66
66
  },
67
67
  "dependencies": {
68
- "@backstage/backend-plugin-api": "1.7.1-next.0",
68
+ "@backstage/backend-plugin-api": "1.8.0-next.1",
69
69
  "@backstage/catalog-model": "1.7.6",
70
70
  "@backstage/config": "1.3.6",
71
71
  "@backstage/errors": "1.2.7",
72
- "@backstage/integration": "2.0.0-next.1",
72
+ "@backstage/integration": "2.0.0-next.2",
73
73
  "@backstage/plugin-catalog-common": "1.1.8",
74
- "@backstage/plugin-catalog-node": "2.1.0-next.1",
75
- "@backstage/plugin-events-node": "0.4.20-next.0",
74
+ "@backstage/plugin-catalog-node": "2.1.0-next.2",
75
+ "@backstage/plugin-events-node": "0.4.20-next.1",
76
76
  "@backstage/types": "1.2.2",
77
77
  "@octokit/auth-callback": "^5.0.0",
78
78
  "@octokit/core": "^5.2.0",
@@ -87,13 +87,13 @@
87
87
  "uuid": "^11.0.0"
88
88
  },
89
89
  "devDependencies": {
90
- "@backstage/backend-defaults": "0.16.0-next.1",
91
- "@backstage/backend-test-utils": "1.11.1-next.1",
92
- "@backstage/cli": "0.36.0-next.1",
93
- "@backstage/plugin-catalog-backend": "3.5.0-next.1",
94
- "@backstage/plugin-events-backend": "0.6.0-next.1",
95
- "@backstage/plugin-events-backend-module-github": "0.4.10-next.1",
96
- "@backstage/plugin-events-backend-module-google-pubsub": "0.2.1-next.0",
90
+ "@backstage/backend-defaults": "0.16.0-next.2",
91
+ "@backstage/backend-test-utils": "1.11.1-next.2",
92
+ "@backstage/cli": "0.36.0-next.2",
93
+ "@backstage/plugin-catalog-backend": "3.5.0-next.2",
94
+ "@backstage/plugin-events-backend": "0.6.0-next.2",
95
+ "@backstage/plugin-events-backend-module-github": "0.4.10-next.2",
96
+ "@backstage/plugin-events-backend-module-google-pubsub": "0.2.1-next.1",
97
97
  "@types/lodash": "^4.14.151",
98
98
  "msw": "^2.0.0",
99
99
  "type-fest": "^4.41.0"