@backstage/plugin-catalog-backend-module-gitlab 0.5.1-next.0 → 0.5.1-next.1
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,20 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-gitlab
|
|
2
2
|
|
|
3
|
+
## 0.5.1-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5c9cc05: Use native fetch instead of node-fetch
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-defaults@0.6.0-next.1
|
|
10
|
+
- @backstage/plugin-catalog-node@1.15.0-next.1
|
|
11
|
+
- @backstage/backend-plugin-api@1.1.0-next.1
|
|
12
|
+
- @backstage/catalog-model@1.7.1
|
|
13
|
+
- @backstage/config@1.3.0
|
|
14
|
+
- @backstage/integration@1.16.0-next.0
|
|
15
|
+
- @backstage/plugin-catalog-common@1.1.1
|
|
16
|
+
- @backstage/plugin-events-node@0.4.6-next.1
|
|
17
|
+
|
|
3
18
|
## 0.5.1-next.0
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/lib/client.cjs.js
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var integration = require('@backstage/integration');
|
|
4
|
-
var fetch = require('node-fetch');
|
|
5
|
-
|
|
6
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var fetch__default = /*#__PURE__*/_interopDefaultCompat(fetch);
|
|
9
4
|
|
|
10
5
|
class GitLabClient {
|
|
11
6
|
config;
|
|
@@ -86,7 +81,7 @@ class GitLabClient {
|
|
|
86
81
|
let hasNextPage = false;
|
|
87
82
|
let endCursor = null;
|
|
88
83
|
do {
|
|
89
|
-
const response = await
|
|
84
|
+
const response = await fetch(
|
|
90
85
|
`${this.config.baseUrl}/api/graphql`,
|
|
91
86
|
{
|
|
92
87
|
method: "POST",
|
|
@@ -157,7 +152,7 @@ class GitLabClient {
|
|
|
157
152
|
let hasNextPage = false;
|
|
158
153
|
let endCursor = null;
|
|
159
154
|
do {
|
|
160
|
-
const response = await
|
|
155
|
+
const response = await fetch(
|
|
161
156
|
`${this.config.baseUrl}/api/graphql`,
|
|
162
157
|
{
|
|
163
158
|
method: "POST",
|
|
@@ -244,7 +239,7 @@ class GitLabClient {
|
|
|
244
239
|
)}/repository/files/${encodeURIComponent(filePath)}`;
|
|
245
240
|
const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);
|
|
246
241
|
request.searchParams.append("ref", branch);
|
|
247
|
-
const response = await
|
|
242
|
+
const response = await fetch(request.toString(), {
|
|
248
243
|
headers: integration.getGitLabRequestOptions(this.config).headers,
|
|
249
244
|
method: "HEAD"
|
|
250
245
|
});
|
|
@@ -281,7 +276,7 @@ class GitLabClient {
|
|
|
281
276
|
}
|
|
282
277
|
}
|
|
283
278
|
this.logger.debug(`Fetching: ${request.toString()}`);
|
|
284
|
-
const response = await
|
|
279
|
+
const response = await fetch(
|
|
285
280
|
request.toString(),
|
|
286
281
|
integration.getGitLabRequestOptions(this.config)
|
|
287
282
|
);
|
|
@@ -308,7 +303,7 @@ class GitLabClient {
|
|
|
308
303
|
}
|
|
309
304
|
}
|
|
310
305
|
}
|
|
311
|
-
const response = await
|
|
306
|
+
const response = await fetch(
|
|
312
307
|
request.toString(),
|
|
313
308
|
integration.getGitLabRequestOptions(this.config)
|
|
314
309
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.cjs.js","sources":["../../src/lib/client.ts"],"sourcesContent":["/*\n * Copyright 2021 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 */\nimport {\n getGitLabRequestOptions,\n GitLabIntegrationConfig,\n} from '@backstage/integration';\nimport fetch from 'node-fetch';\nimport { LoggerService } from '@backstage/backend-plugin-api';\n\nimport {\n GitLabDescendantGroupsResponse,\n GitLabGroup,\n GitLabGroupMembersResponse,\n GitLabProject,\n GitLabUser,\n PagedResponse,\n} from './types';\n\nexport type CommonListOptions = {\n [key: string]: string | number | boolean | undefined;\n per_page?: number | undefined;\n page?: number | undefined;\n active?: boolean;\n};\n\ninterface ListProjectOptions extends CommonListOptions {\n archived?: boolean;\n group?: string;\n}\n\ninterface UserListOptions extends CommonListOptions {\n without_project_bots?: boolean | undefined;\n exclude_internal?: boolean | undefined;\n}\n\nexport class GitLabClient {\n private readonly config: GitLabIntegrationConfig;\n private readonly logger: LoggerService;\n\n constructor(options: {\n config: GitLabIntegrationConfig;\n logger: LoggerService;\n }) {\n this.config = options.config;\n this.logger = options.logger;\n }\n\n /**\n * Indicates whether the client is for a SaaS or self managed GitLab instance.\n */\n isSelfManaged(): boolean {\n return this.config.host !== 'gitlab.com';\n }\n\n async listProjects(\n options?: ListProjectOptions,\n ): Promise<PagedResponse<any>> {\n if (options?.group) {\n return this.pagedRequest(\n `/groups/${encodeURIComponent(options?.group)}/projects`,\n {\n ...options,\n include_subgroups: true,\n },\n );\n }\n\n return this.pagedRequest(`/projects`, options);\n }\n\n async getProjectById(\n projectId: number,\n options?: CommonListOptions,\n ): Promise<GitLabProject> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(\n `/projects/${projectId}`,\n options,\n );\n\n return response;\n }\n\n async getGroupById(\n groupId: number,\n options?: CommonListOptions,\n ): Promise<GitLabGroup> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(`/groups/${groupId}`, options);\n\n return response;\n }\n\n async getUserById(\n userId: number,\n options?: CommonListOptions,\n ): Promise<GitLabUser> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(`/users/${userId}`, options);\n\n return response;\n }\n\n async listGroupMembers(\n groupPath: string,\n options?: CommonListOptions,\n ): Promise<PagedResponse<GitLabUser>> {\n return this.pagedRequest(\n `/groups/${encodeURIComponent(groupPath)}/members/all`,\n options,\n );\n }\n\n async listUsers(\n options?: UserListOptions,\n ): Promise<PagedResponse<GitLabUser>> {\n return this.pagedRequest(`/users?`, {\n ...options,\n without_project_bots: true,\n exclude_internal: true,\n });\n }\n\n async listSaaSUsers(\n groupPath: string,\n options?: CommonListOptions,\n includeUsersWithoutSeat?: boolean,\n ): Promise<PagedResponse<GitLabUser>> {\n const botFilterRegex = /^(?:project|group)_(\\w+)_bot_(\\w+)$/;\n\n return this.listGroupMembers(groupPath, {\n ...options,\n active: true, // Users with seat are always active but for users without seat we need to filter\n show_seat_info: true,\n }).then(resp => {\n // Filter is optional to allow to import Gitlab Free users without seats\n // https://github.com/backstage/backstage/issues/26438\n // Filter out API tokens https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#bot-users-for-projects\n if (includeUsersWithoutSeat) {\n resp.items = resp.items.filter(user => {\n return !botFilterRegex.test(user.username);\n });\n } else {\n resp.items = resp.items.filter(user => user.is_using_seat);\n }\n return resp;\n });\n }\n\n async listGroups(\n options?: CommonListOptions,\n ): Promise<PagedResponse<GitLabGroup>> {\n return this.pagedRequest(`/groups`, options);\n }\n\n async listDescendantGroups(\n groupPath: string,\n ): Promise<PagedResponse<GitLabGroup>> {\n const items: GitLabGroup[] = [];\n let hasNextPage: boolean = false;\n let endCursor: string | null = null;\n\n do {\n const response: GitLabDescendantGroupsResponse = await fetch(\n `${this.config.baseUrl}/api/graphql`,\n {\n method: 'POST',\n headers: {\n ...getGitLabRequestOptions(this.config).headers,\n ['Content-Type']: 'application/json',\n },\n body: JSON.stringify({\n variables: { group: groupPath, endCursor },\n query: /* GraphQL */ `\n query listDescendantGroups($group: ID!, $endCursor: String) {\n group(fullPath: $group) {\n descendantGroups(first: 100, after: $endCursor) {\n nodes {\n id\n name\n description\n fullPath\n visibility\n parent {\n id\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n `,\n }),\n },\n ).then(r => r.json());\n if (response.errors) {\n throw new Error(`GraphQL errors: ${JSON.stringify(response.errors)}`);\n }\n\n if (!response.data.group?.descendantGroups?.nodes) {\n this.logger.warn(\n `Couldn't get groups under ${groupPath}. The provided token might not have sufficient permissions`,\n );\n continue;\n }\n\n for (const groupItem of response.data.group.descendantGroups.nodes.filter(\n group => group?.id,\n )) {\n const formattedGroupResponse = {\n id: Number(groupItem.id.replace(/^gid:\\/\\/gitlab\\/Group\\//, '')),\n name: groupItem.name,\n description: groupItem.description,\n full_path: groupItem.fullPath,\n visibility: groupItem.visibility,\n parent_id: Number(\n groupItem.parent.id.replace(/^gid:\\/\\/gitlab\\/Group\\//, ''),\n ),\n };\n\n items.push(formattedGroupResponse);\n }\n ({ hasNextPage, endCursor } =\n response.data.group.descendantGroups.pageInfo);\n } while (hasNextPage);\n return { items };\n }\n\n async getGroupMembers(\n groupPath: string,\n relations: string[],\n ): Promise<PagedResponse<GitLabUser>> {\n const items: GitLabUser[] = [];\n let hasNextPage: boolean = false;\n let endCursor: string | null = null;\n do {\n const response: GitLabGroupMembersResponse = await fetch(\n `${this.config.baseUrl}/api/graphql`,\n {\n method: 'POST',\n headers: {\n ...getGitLabRequestOptions(this.config).headers,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n variables: { group: groupPath, relations: relations, endCursor },\n query: /* GraphQL */ `\n query getGroupMembers(\n $group: ID!\n $relations: [GroupMemberRelation!]\n $endCursor: String\n ) {\n group(fullPath: $group) {\n groupMembers(\n first: 100\n relations: $relations\n after: $endCursor\n ) {\n nodes {\n user {\n id\n username\n publicEmail\n name\n state\n webUrl\n avatarUrl\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n `,\n }),\n },\n ).then(r => r.json());\n if (response.errors) {\n throw new Error(`GraphQL errors: ${JSON.stringify(response.errors)}`);\n }\n\n if (!response.data.group?.groupMembers?.nodes) {\n this.logger.warn(\n `Couldn't get members for group ${groupPath}. The provided token might not have sufficient permissions`,\n );\n continue;\n }\n\n for (const userItem of response.data.group.groupMembers.nodes.filter(\n user => user.user?.id,\n )) {\n const formattedUserResponse = {\n id: Number(userItem.user.id.replace(/^gid:\\/\\/gitlab\\/User\\//, '')),\n username: userItem.user.username,\n email: userItem.user.publicEmail,\n name: userItem.user.name,\n state: userItem.user.state,\n web_url: userItem.user.webUrl,\n avatar_url: userItem.user.avatarUrl,\n };\n\n items.push(formattedUserResponse);\n }\n ({ hasNextPage, endCursor } = response.data.group.groupMembers.pageInfo);\n } while (hasNextPage);\n return { items };\n }\n\n /**\n * General existence check.\n *\n * @param projectPath - The path to the project\n * @param branch - The branch used to search\n * @param filePath - The path to the file\n */\n async hasFile(\n projectPath: string,\n branch: string,\n filePath: string,\n ): Promise<boolean> {\n const endpoint: string = `/projects/${encodeURIComponent(\n projectPath,\n )}/repository/files/${encodeURIComponent(filePath)}`;\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n request.searchParams.append('ref', branch);\n\n const response = await fetch(request.toString(), {\n headers: getGitLabRequestOptions(this.config).headers,\n method: 'HEAD',\n });\n\n if (!response.ok) {\n if (response.status >= 500) {\n this.logger.debug(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n return false;\n }\n\n return true;\n }\n\n /**\n * Performs a request against a given paginated GitLab endpoint.\n *\n * This method may be used to perform authenticated REST calls against any\n * paginated GitLab endpoint which uses X-NEXT-PAGE headers. The return value\n * can be be used with the {@link paginated} async-generator function to yield\n * each item from the paged request.\n *\n * @see {@link paginated}\n * @param endpoint - The request endpoint, e.g. /projects.\n * @param options - Request queryString options which may also include page variables.\n */\n async pagedRequest<T = any>(\n endpoint: string,\n options?: CommonListOptions,\n ): Promise<PagedResponse<T>> {\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n\n for (const key in options) {\n if (options.hasOwnProperty(key)) {\n const value = options[key];\n if (value !== undefined && value !== '') {\n request.searchParams.append(key, value.toString());\n }\n }\n }\n\n this.logger.debug(`Fetching: ${request.toString()}`);\n const response = await fetch(\n request.toString(),\n getGitLabRequestOptions(this.config),\n );\n\n if (!response.ok) {\n throw new Error(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n\n return response.json().then(items => {\n const nextPage = response.headers.get('x-next-page');\n\n return {\n items,\n nextPage: nextPage ? Number(nextPage) : null,\n } as PagedResponse<any>;\n });\n }\n\n async nonPagedRequest<T = any>(\n endpoint: string,\n options?: CommonListOptions,\n ): Promise<T> {\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n\n for (const key in options) {\n if (options.hasOwnProperty(key)) {\n const value = options[key];\n if (value !== undefined && value !== '') {\n request.searchParams.append(key, value.toString());\n }\n }\n }\n\n const response = await fetch(\n request.toString(),\n getGitLabRequestOptions(this.config),\n );\n\n if (!response.ok) {\n throw new Error(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n\n return response.json();\n }\n}\n\n/**\n * Advances through each page and provides each item from a paginated request.\n *\n * The async generator function yields each item from repeated calls to the\n * provided request function. The generator walks through each available page by\n * setting the page key in the options passed into the request function and\n * making repeated calls until there are no more pages.\n *\n * @see {@link pagedRequest}\n * @param request - Function which returns a PagedResponse to walk through.\n * @param options - Initial ListOptions for the request function.\n */\nexport async function* paginated<T = any>(\n request: (options: CommonListOptions) => Promise<PagedResponse<T>>,\n options: CommonListOptions,\n) {\n let res;\n do {\n res = await request(options);\n options.page = res.nextPage;\n for (const item of res.items) {\n yield item;\n }\n } while (res.nextPage);\n}\n"],"names":["fetch","getGitLabRequestOptions"],"mappings":";;;;;;;;;AAgDO,M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":3,"file":"client.cjs.js","sources":["../../src/lib/client.ts"],"sourcesContent":["/*\n * Copyright 2021 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 {\n getGitLabRequestOptions,\n GitLabIntegrationConfig,\n} from '@backstage/integration';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport {\n GitLabDescendantGroupsResponse,\n GitLabGroup,\n GitLabGroupMembersResponse,\n GitLabProject,\n GitLabUser,\n PagedResponse,\n} from './types';\n\nexport type CommonListOptions = {\n [key: string]: string | number | boolean | undefined;\n per_page?: number | undefined;\n page?: number | undefined;\n active?: boolean;\n};\n\ninterface ListProjectOptions extends CommonListOptions {\n archived?: boolean;\n group?: string;\n}\n\ninterface UserListOptions extends CommonListOptions {\n without_project_bots?: boolean | undefined;\n exclude_internal?: boolean | undefined;\n}\n\nexport class GitLabClient {\n private readonly config: GitLabIntegrationConfig;\n private readonly logger: LoggerService;\n\n constructor(options: {\n config: GitLabIntegrationConfig;\n logger: LoggerService;\n }) {\n this.config = options.config;\n this.logger = options.logger;\n }\n\n /**\n * Indicates whether the client is for a SaaS or self managed GitLab instance.\n */\n isSelfManaged(): boolean {\n return this.config.host !== 'gitlab.com';\n }\n\n async listProjects(\n options?: ListProjectOptions,\n ): Promise<PagedResponse<any>> {\n if (options?.group) {\n return this.pagedRequest(\n `/groups/${encodeURIComponent(options?.group)}/projects`,\n {\n ...options,\n include_subgroups: true,\n },\n );\n }\n\n return this.pagedRequest(`/projects`, options);\n }\n\n async getProjectById(\n projectId: number,\n options?: CommonListOptions,\n ): Promise<GitLabProject> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(\n `/projects/${projectId}`,\n options,\n );\n\n return response;\n }\n\n async getGroupById(\n groupId: number,\n options?: CommonListOptions,\n ): Promise<GitLabGroup> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(`/groups/${groupId}`, options);\n\n return response;\n }\n\n async getUserById(\n userId: number,\n options?: CommonListOptions,\n ): Promise<GitLabUser> {\n // Make the request to the GitLab API\n const response = await this.nonPagedRequest(`/users/${userId}`, options);\n\n return response;\n }\n\n async listGroupMembers(\n groupPath: string,\n options?: CommonListOptions,\n ): Promise<PagedResponse<GitLabUser>> {\n return this.pagedRequest(\n `/groups/${encodeURIComponent(groupPath)}/members/all`,\n options,\n );\n }\n\n async listUsers(\n options?: UserListOptions,\n ): Promise<PagedResponse<GitLabUser>> {\n return this.pagedRequest(`/users?`, {\n ...options,\n without_project_bots: true,\n exclude_internal: true,\n });\n }\n\n async listSaaSUsers(\n groupPath: string,\n options?: CommonListOptions,\n includeUsersWithoutSeat?: boolean,\n ): Promise<PagedResponse<GitLabUser>> {\n const botFilterRegex = /^(?:project|group)_(\\w+)_bot_(\\w+)$/;\n\n return this.listGroupMembers(groupPath, {\n ...options,\n active: true, // Users with seat are always active but for users without seat we need to filter\n show_seat_info: true,\n }).then(resp => {\n // Filter is optional to allow to import Gitlab Free users without seats\n // https://github.com/backstage/backstage/issues/26438\n // Filter out API tokens https://docs.gitlab.com/ee/user/project/settings/project_access_tokens.html#bot-users-for-projects\n if (includeUsersWithoutSeat) {\n resp.items = resp.items.filter(user => {\n return !botFilterRegex.test(user.username);\n });\n } else {\n resp.items = resp.items.filter(user => user.is_using_seat);\n }\n return resp;\n });\n }\n\n async listGroups(\n options?: CommonListOptions,\n ): Promise<PagedResponse<GitLabGroup>> {\n return this.pagedRequest(`/groups`, options);\n }\n\n async listDescendantGroups(\n groupPath: string,\n ): Promise<PagedResponse<GitLabGroup>> {\n const items: GitLabGroup[] = [];\n let hasNextPage: boolean = false;\n let endCursor: string | null = null;\n\n do {\n const response: GitLabDescendantGroupsResponse = await fetch(\n `${this.config.baseUrl}/api/graphql`,\n {\n method: 'POST',\n headers: {\n ...getGitLabRequestOptions(this.config).headers,\n ['Content-Type']: 'application/json',\n },\n body: JSON.stringify({\n variables: { group: groupPath, endCursor },\n query: /* GraphQL */ `\n query listDescendantGroups($group: ID!, $endCursor: String) {\n group(fullPath: $group) {\n descendantGroups(first: 100, after: $endCursor) {\n nodes {\n id\n name\n description\n fullPath\n visibility\n parent {\n id\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n `,\n }),\n },\n ).then(r => r.json());\n if (response.errors) {\n throw new Error(`GraphQL errors: ${JSON.stringify(response.errors)}`);\n }\n\n if (!response.data.group?.descendantGroups?.nodes) {\n this.logger.warn(\n `Couldn't get groups under ${groupPath}. The provided token might not have sufficient permissions`,\n );\n continue;\n }\n\n for (const groupItem of response.data.group.descendantGroups.nodes.filter(\n group => group?.id,\n )) {\n const formattedGroupResponse = {\n id: Number(groupItem.id.replace(/^gid:\\/\\/gitlab\\/Group\\//, '')),\n name: groupItem.name,\n description: groupItem.description,\n full_path: groupItem.fullPath,\n visibility: groupItem.visibility,\n parent_id: Number(\n groupItem.parent.id.replace(/^gid:\\/\\/gitlab\\/Group\\//, ''),\n ),\n };\n\n items.push(formattedGroupResponse);\n }\n ({ hasNextPage, endCursor } =\n response.data.group.descendantGroups.pageInfo);\n } while (hasNextPage);\n return { items };\n }\n\n async getGroupMembers(\n groupPath: string,\n relations: string[],\n ): Promise<PagedResponse<GitLabUser>> {\n const items: GitLabUser[] = [];\n let hasNextPage: boolean = false;\n let endCursor: string | null = null;\n do {\n const response: GitLabGroupMembersResponse = await fetch(\n `${this.config.baseUrl}/api/graphql`,\n {\n method: 'POST',\n headers: {\n ...getGitLabRequestOptions(this.config).headers,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n variables: { group: groupPath, relations: relations, endCursor },\n query: /* GraphQL */ `\n query getGroupMembers(\n $group: ID!\n $relations: [GroupMemberRelation!]\n $endCursor: String\n ) {\n group(fullPath: $group) {\n groupMembers(\n first: 100\n relations: $relations\n after: $endCursor\n ) {\n nodes {\n user {\n id\n username\n publicEmail\n name\n state\n webUrl\n avatarUrl\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n }\n `,\n }),\n },\n ).then(r => r.json());\n if (response.errors) {\n throw new Error(`GraphQL errors: ${JSON.stringify(response.errors)}`);\n }\n\n if (!response.data.group?.groupMembers?.nodes) {\n this.logger.warn(\n `Couldn't get members for group ${groupPath}. The provided token might not have sufficient permissions`,\n );\n continue;\n }\n\n for (const userItem of response.data.group.groupMembers.nodes.filter(\n user => user.user?.id,\n )) {\n const formattedUserResponse = {\n id: Number(userItem.user.id.replace(/^gid:\\/\\/gitlab\\/User\\//, '')),\n username: userItem.user.username,\n email: userItem.user.publicEmail,\n name: userItem.user.name,\n state: userItem.user.state,\n web_url: userItem.user.webUrl,\n avatar_url: userItem.user.avatarUrl,\n };\n\n items.push(formattedUserResponse);\n }\n ({ hasNextPage, endCursor } = response.data.group.groupMembers.pageInfo);\n } while (hasNextPage);\n return { items };\n }\n\n /**\n * General existence check.\n *\n * @param projectPath - The path to the project\n * @param branch - The branch used to search\n * @param filePath - The path to the file\n */\n async hasFile(\n projectPath: string,\n branch: string,\n filePath: string,\n ): Promise<boolean> {\n const endpoint: string = `/projects/${encodeURIComponent(\n projectPath,\n )}/repository/files/${encodeURIComponent(filePath)}`;\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n request.searchParams.append('ref', branch);\n\n const response = await fetch(request.toString(), {\n headers: getGitLabRequestOptions(this.config).headers,\n method: 'HEAD',\n });\n\n if (!response.ok) {\n if (response.status >= 500) {\n this.logger.debug(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n return false;\n }\n\n return true;\n }\n\n /**\n * Performs a request against a given paginated GitLab endpoint.\n *\n * This method may be used to perform authenticated REST calls against any\n * paginated GitLab endpoint which uses X-NEXT-PAGE headers. The return value\n * can be be used with the {@link paginated} async-generator function to yield\n * each item from the paged request.\n *\n * @see {@link paginated}\n * @param endpoint - The request endpoint, e.g. /projects.\n * @param options - Request queryString options which may also include page variables.\n */\n async pagedRequest<T = any>(\n endpoint: string,\n options?: CommonListOptions,\n ): Promise<PagedResponse<T>> {\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n\n for (const key in options) {\n if (options.hasOwnProperty(key)) {\n const value = options[key];\n if (value !== undefined && value !== '') {\n request.searchParams.append(key, value.toString());\n }\n }\n }\n\n this.logger.debug(`Fetching: ${request.toString()}`);\n const response = await fetch(\n request.toString(),\n getGitLabRequestOptions(this.config),\n );\n\n if (!response.ok) {\n throw new Error(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n\n return response.json().then(items => {\n const nextPage = response.headers.get('x-next-page');\n\n return {\n items,\n nextPage: nextPage ? Number(nextPage) : null,\n } as PagedResponse<any>;\n });\n }\n\n async nonPagedRequest<T = any>(\n endpoint: string,\n options?: CommonListOptions,\n ): Promise<T> {\n const request = new URL(`${this.config.apiBaseUrl}${endpoint}`);\n\n for (const key in options) {\n if (options.hasOwnProperty(key)) {\n const value = options[key];\n if (value !== undefined && value !== '') {\n request.searchParams.append(key, value.toString());\n }\n }\n }\n\n const response = await fetch(\n request.toString(),\n getGitLabRequestOptions(this.config),\n );\n\n if (!response.ok) {\n throw new Error(\n `Unexpected response when fetching ${request.toString()}. Expected 200 but got ${\n response.status\n } - ${response.statusText}`,\n );\n }\n\n return response.json();\n }\n}\n\n/**\n * Advances through each page and provides each item from a paginated request.\n *\n * The async generator function yields each item from repeated calls to the\n * provided request function. The generator walks through each available page by\n * setting the page key in the options passed into the request function and\n * making repeated calls until there are no more pages.\n *\n * @see {@link pagedRequest}\n * @param request - Function which returns a PagedResponse to walk through.\n * @param options - Initial ListOptions for the request function.\n */\nexport async function* paginated<T = any>(\n request: (options: CommonListOptions) => Promise<PagedResponse<T>>,\n options: CommonListOptions,\n) {\n let res;\n do {\n res = await request(options);\n options.page = res.nextPage;\n for (const item of res.items) {\n yield item;\n }\n } while (res.nextPage);\n}\n"],"names":["getGitLabRequestOptions"],"mappings":";;;;AA+CO,MAAM,YAAa,CAAA;AAAA,EACP,MAAA;AAAA,EACA,MAAA;AAAA,EAEjB,YAAY,OAGT,EAAA;AACD,IAAA,IAAA,CAAK,SAAS,OAAQ,CAAA,MAAA;AACtB,IAAA,IAAA,CAAK,SAAS,OAAQ,CAAA,MAAA;AAAA;AACxB;AAAA;AAAA;AAAA,EAKA,aAAyB,GAAA;AACvB,IAAO,OAAA,IAAA,CAAK,OAAO,IAAS,KAAA,YAAA;AAAA;AAC9B,EAEA,MAAM,aACJ,OAC6B,EAAA;AAC7B,IAAA,IAAI,SAAS,KAAO,EAAA;AAClB,MAAA,OAAO,IAAK,CAAA,YAAA;AAAA,QACV,CAAW,QAAA,EAAA,kBAAA,CAAmB,OAAS,EAAA,KAAK,CAAC,CAAA,SAAA,CAAA;AAAA,QAC7C;AAAA,UACE,GAAG,OAAA;AAAA,UACH,iBAAmB,EAAA;AAAA;AACrB,OACF;AAAA;AAGF,IAAO,OAAA,IAAA,CAAK,YAAa,CAAA,CAAA,SAAA,CAAA,EAAa,OAAO,CAAA;AAAA;AAC/C,EAEA,MAAM,cACJ,CAAA,SAAA,EACA,OACwB,EAAA;AAExB,IAAM,MAAA,QAAA,GAAW,MAAM,IAAK,CAAA,eAAA;AAAA,MAC1B,aAAa,SAAS,CAAA,CAAA;AAAA,MACtB;AAAA,KACF;AAEA,IAAO,OAAA,QAAA;AAAA;AACT,EAEA,MAAM,YACJ,CAAA,OAAA,EACA,OACsB,EAAA;AAEtB,IAAA,MAAM,WAAW,MAAM,IAAA,CAAK,gBAAgB,CAAW,QAAA,EAAA,OAAO,IAAI,OAAO,CAAA;AAEzE,IAAO,OAAA,QAAA;AAAA;AACT,EAEA,MAAM,WACJ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,OAAO,GAAI,CAAA,QAAA;AACnB,IAAW,KAAA,MAAA,IAAA,IAAQ,IAAI,KAAO,EAAA;AAC5B,MAAM,MAAA,IAAA;AAAA;AACR,WACO,GAAI,CAAA,QAAA;AACf;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogModuleGitlabDiscoveryEntityProvider.cjs.js","sources":["../../src/module/catalogModuleGitlabDiscoveryEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { GitlabDiscoveryEntityProvider } from '../providers';\n\n/**\n * Registers the GitlabDiscoveryEntityProvider with the catalog processing extension point.\n *\n * @public\n */\n\nexport const catalogModuleGitlabDiscoveryEntityProvider = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'gitlab-discovery-entity-provider',\n register(env) {\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n events: eventsServiceRef,\n },\n async init({ config, catalog, logger, scheduler, events }) {\n const gitlabDiscoveryEntityProvider =\n GitlabDiscoveryEntityProvider.fromConfig(config, {\n logger,\n events,\n scheduler,\n });\n catalog.addEntityProvider(gitlabDiscoveryEntityProvider);\n },\n });\n },\n});\n"],"names":["createBackendModule","coreServices","catalogProcessingExtensionPoint","eventsServiceRef","GitlabDiscoveryEntityProvider"],"mappings":"
|
|
1
|
+
{"version":3,"file":"catalogModuleGitlabDiscoveryEntityProvider.cjs.js","sources":["../../src/module/catalogModuleGitlabDiscoveryEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport { eventsServiceRef } from '@backstage/plugin-events-node';\nimport { GitlabDiscoveryEntityProvider } from '../providers';\n\n/**\n * Registers the GitlabDiscoveryEntityProvider with the catalog processing extension point.\n *\n * @public\n */\n\nexport const catalogModuleGitlabDiscoveryEntityProvider = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'gitlab-discovery-entity-provider',\n register(env) {\n env.registerInit({\n deps: {\n config: coreServices.rootConfig,\n catalog: catalogProcessingExtensionPoint,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n events: eventsServiceRef,\n },\n async init({ config, catalog, logger, scheduler, events }) {\n const gitlabDiscoveryEntityProvider =\n GitlabDiscoveryEntityProvider.fromConfig(config, {\n logger,\n events,\n scheduler,\n });\n catalog.addEntityProvider(gitlabDiscoveryEntityProvider);\n },\n });\n },\n});\n"],"names":["createBackendModule","coreServices","catalogProcessingExtensionPoint","eventsServiceRef","GitlabDiscoveryEntityProvider"],"mappings":";;;;;;;;;;;AA8BO,MAAM,6CAA6CA,oCAAoB,CAAA;AAAA,EAC5E,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,kCAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,QAAQC,6BAAa,CAAA,UAAA;AAAA,QACrB,OAAS,EAAAC,qCAAA;AAAA,QACT,QAAQD,6BAAa,CAAA,MAAA;AAAA,QACrB,WAAWA,6BAAa,CAAA,SAAA;AAAA,QACxB,MAAQ,EAAAE;AAAA,OACV;AAAA,MACA,MAAM,KAAK,EAAE,MAAA,EAAQ,SAAS,MAAQ,EAAA,SAAA,EAAW,QAAU,EAAA;AACzD,QAAM,MAAA,6BAAA,GACJC,2DAA8B,CAAA,UAAA,CAAW,MAAQ,EAAA;AAAA,UAC/C,MAAA;AAAA,UACA,MAAA;AAAA,UACA;AAAA,SACD,CAAA;AACH,QAAA,OAAA,CAAQ,kBAAkB,6BAA6B,CAAA;AAAA;AACzD,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-gitlab",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.1",
|
|
4
4
|
"description": "A Backstage catalog backend module that helps integrate towards GitLab",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -61,23 +61,22 @@
|
|
|
61
61
|
"test": "backstage-cli package test"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@backstage/backend-defaults": "0.6.0-next.
|
|
65
|
-
"@backstage/backend-plugin-api": "1.0
|
|
64
|
+
"@backstage/backend-defaults": "0.6.0-next.1",
|
|
65
|
+
"@backstage/backend-plugin-api": "1.1.0-next.1",
|
|
66
66
|
"@backstage/catalog-model": "1.7.1",
|
|
67
67
|
"@backstage/config": "1.3.0",
|
|
68
68
|
"@backstage/integration": "1.16.0-next.0",
|
|
69
69
|
"@backstage/plugin-catalog-common": "1.1.1",
|
|
70
|
-
"@backstage/plugin-catalog-node": "1.
|
|
71
|
-
"@backstage/plugin-events-node": "0.4.6-next.
|
|
70
|
+
"@backstage/plugin-catalog-node": "1.15.0-next.1",
|
|
71
|
+
"@backstage/plugin-events-node": "0.4.6-next.1",
|
|
72
72
|
"@gitbeaker/rest": "^40.0.3",
|
|
73
73
|
"lodash": "^4.17.21",
|
|
74
|
-
"node-fetch": "^2.7.0",
|
|
75
74
|
"uuid": "^11.0.0"
|
|
76
75
|
},
|
|
77
76
|
"devDependencies": {
|
|
78
|
-
"@backstage/backend-test-utils": "1.2.0-next.
|
|
79
|
-
"@backstage/cli": "0.29.3-next.
|
|
80
|
-
"@backstage/plugin-events-backend-test-utils": "0.1.39-next.
|
|
77
|
+
"@backstage/backend-test-utils": "1.2.0-next.1",
|
|
78
|
+
"@backstage/cli": "0.29.3-next.1",
|
|
79
|
+
"@backstage/plugin-events-backend-test-utils": "0.1.39-next.1",
|
|
81
80
|
"@types/lodash": "^4.14.151",
|
|
82
81
|
"luxon": "^3.0.0",
|
|
83
82
|
"msw": "^1.0.0"
|