@backstage/plugin-scaffolder-backend-module-gitlab 0.11.4-next.0 → 0.11.4-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 +21 -0
- package/dist/actions/gitlabGroupAccessAction.cjs.js +177 -0
- package/dist/actions/gitlabGroupAccessAction.cjs.js.map +1 -0
- package/dist/actions/gitlabGroupAccessAction.examples.cjs.js +103 -0
- package/dist/actions/gitlabGroupAccessAction.examples.cjs.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +23 -1
- package/dist/module.cjs.js +2 -0
- package/dist/module.cjs.js.map +1 -1
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-gitlab
|
|
2
2
|
|
|
3
|
+
## 0.11.4-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-plugin-api@1.8.0-next.1
|
|
9
|
+
- @backstage/integration@2.0.0-next.2
|
|
10
|
+
- @backstage/plugin-scaffolder-node@0.13.0-next.2
|
|
11
|
+
|
|
12
|
+
## 0.11.4-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 0c1726a: Added new `gitlab:group:access` scaffolder action to add or remove users and groups as members of GitLab groups. The action supports specifying members via `userIds` and/or `groupIds` array parameters, configurable access levels (Guest, Reporter, Developer, Maintainer, Owner), and defaults to the 'add' action when not specified.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
- @backstage/integration@2.0.0-next.1
|
|
19
|
+
- @backstage/plugin-scaffolder-node@0.13.0-next.1
|
|
20
|
+
- @backstage/backend-plugin-api@1.7.1-next.0
|
|
21
|
+
- @backstage/config@1.3.6
|
|
22
|
+
- @backstage/errors@1.2.7
|
|
23
|
+
|
|
3
24
|
## 0.11.4-next.0
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors = require('@backstage/errors');
|
|
4
|
+
var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
|
|
5
|
+
var util = require('../util.cjs.js');
|
|
6
|
+
var gitlabGroupAccessAction_examples = require('./gitlabGroupAccessAction.examples.cjs.js');
|
|
7
|
+
|
|
8
|
+
const accessLevelMapping = {
|
|
9
|
+
no_access: 0,
|
|
10
|
+
minimal_access: 5,
|
|
11
|
+
guest: 10,
|
|
12
|
+
planner: 15,
|
|
13
|
+
reporter: 20,
|
|
14
|
+
developer: 30,
|
|
15
|
+
maintainer: 40,
|
|
16
|
+
owner: 50
|
|
17
|
+
};
|
|
18
|
+
function resolveAccessLevel(level) {
|
|
19
|
+
if (typeof level === "number") return level;
|
|
20
|
+
const resolved = accessLevelMapping[level.toLocaleLowerCase("en-US")];
|
|
21
|
+
if (resolved === void 0) {
|
|
22
|
+
throw new errors.InputError(
|
|
23
|
+
`Invalid access level: "${level}". Valid values are: ${Object.keys(
|
|
24
|
+
accessLevelMapping
|
|
25
|
+
).join(", ")} or a numeric GitLab access level`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
return resolved;
|
|
29
|
+
}
|
|
30
|
+
const createGitlabGroupAccessAction = (options) => {
|
|
31
|
+
const { integrations } = options;
|
|
32
|
+
return pluginScaffolderNode.createTemplateAction({
|
|
33
|
+
id: "gitlab:group:access",
|
|
34
|
+
description: "Adds or removes users and groups from a GitLab group",
|
|
35
|
+
supportsDryRun: true,
|
|
36
|
+
examples: gitlabGroupAccessAction_examples.examples,
|
|
37
|
+
schema: {
|
|
38
|
+
input: {
|
|
39
|
+
repoUrl: (z) => z.string({
|
|
40
|
+
description: "The host of the GitLab instance, for example 'gitlab.com' or 'gitlab.my-company.com'."
|
|
41
|
+
}),
|
|
42
|
+
token: (z) => z.string({
|
|
43
|
+
description: "The token to use for authorization to GitLab"
|
|
44
|
+
}).optional(),
|
|
45
|
+
path: (z) => z.union([z.number(), z.string()], {
|
|
46
|
+
description: "The ID or path of the group to add/remove members from"
|
|
47
|
+
}),
|
|
48
|
+
userIds: (z) => z.array(z.number(), {
|
|
49
|
+
description: "The IDs of the users to add/remove"
|
|
50
|
+
}).optional(),
|
|
51
|
+
groupIds: (z) => z.array(z.number(), {
|
|
52
|
+
description: "The IDs of the groups to share with or unshare from the target group"
|
|
53
|
+
}).optional(),
|
|
54
|
+
action: (z) => z.enum(["add", "remove"], {
|
|
55
|
+
description: 'The action to perform: add or remove the members. Defaults to "add".'
|
|
56
|
+
}).default("add").optional(),
|
|
57
|
+
accessLevel: (z) => z.union([z.number(), z.string()], {
|
|
58
|
+
description: 'The access level for the members. Can be a number (0=No access, 5=Minimal access, 10=Guest, 15=Planner, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner) or a string (e.g., "guest", "developer"). Defaults to 30 (Developer).'
|
|
59
|
+
}).default(30).optional()
|
|
60
|
+
},
|
|
61
|
+
output: {
|
|
62
|
+
userIds: (z) => z.array(z.number(), {
|
|
63
|
+
description: "The IDs of the users that were added or removed"
|
|
64
|
+
}).optional(),
|
|
65
|
+
groupIds: (z) => z.array(z.number(), {
|
|
66
|
+
description: "The IDs of the groups that were shared with or unshared from"
|
|
67
|
+
}).optional(),
|
|
68
|
+
path: (z) => z.union([z.number(), z.string()], {
|
|
69
|
+
description: "The ID or path of the group the members were added to or removed from"
|
|
70
|
+
}).optional(),
|
|
71
|
+
accessLevel: (z) => z.number({
|
|
72
|
+
description: "The access level granted to the members (only for add action)"
|
|
73
|
+
}).optional()
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
async handler(ctx) {
|
|
77
|
+
const {
|
|
78
|
+
token,
|
|
79
|
+
repoUrl,
|
|
80
|
+
path,
|
|
81
|
+
userIds = [],
|
|
82
|
+
groupIds = [],
|
|
83
|
+
accessLevel: rawAccessLevel = 30,
|
|
84
|
+
action = "add"
|
|
85
|
+
} = ctx.input;
|
|
86
|
+
if (userIds.length === 0 && groupIds.length === 0) {
|
|
87
|
+
throw new errors.InputError(
|
|
88
|
+
"At least one of userIds or groupIds must be provided and non-empty"
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const accessLevel = resolveAccessLevel(rawAccessLevel);
|
|
92
|
+
if (ctx.isDryRun) {
|
|
93
|
+
if (userIds.length > 0) {
|
|
94
|
+
ctx.output("userIds", userIds);
|
|
95
|
+
}
|
|
96
|
+
if (groupIds.length > 0) {
|
|
97
|
+
ctx.output("groupIds", groupIds);
|
|
98
|
+
}
|
|
99
|
+
ctx.output("path", path);
|
|
100
|
+
if (action === "add") {
|
|
101
|
+
ctx.output("accessLevel", accessLevel);
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const host = util.parseRepoHost(repoUrl);
|
|
106
|
+
const api = util.getClient({ host, integrations, token });
|
|
107
|
+
for (const userId of userIds) {
|
|
108
|
+
ctx.logger.info(
|
|
109
|
+
`${action === "add" ? "Adding" : "Removing"} user ${userId} ${action === "add" ? "to" : "from"} group ${path}`
|
|
110
|
+
);
|
|
111
|
+
await ctx.checkpoint({
|
|
112
|
+
key: `gitlab.group.member.user.${action}.${path}.${userId}`,
|
|
113
|
+
fn: async () => {
|
|
114
|
+
if (action === "add") {
|
|
115
|
+
try {
|
|
116
|
+
await api.GroupMembers.add(
|
|
117
|
+
path,
|
|
118
|
+
accessLevel,
|
|
119
|
+
{ userId }
|
|
120
|
+
);
|
|
121
|
+
} catch (error) {
|
|
122
|
+
if (error.cause?.response?.status === 409) {
|
|
123
|
+
await api.GroupMembers.edit(
|
|
124
|
+
path,
|
|
125
|
+
userId,
|
|
126
|
+
accessLevel
|
|
127
|
+
);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
await api.GroupMembers.remove(path, userId);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
for (const sharedGroupId of groupIds) {
|
|
139
|
+
ctx.logger.info(
|
|
140
|
+
`${action === "add" ? "Adding" : "Removing"} group ${sharedGroupId} ${action === "add" ? "to" : "from"} group ${path}`
|
|
141
|
+
);
|
|
142
|
+
await ctx.checkpoint({
|
|
143
|
+
key: `gitlab.group.member.group.${action}.${path}.${sharedGroupId}`,
|
|
144
|
+
fn: async () => {
|
|
145
|
+
if (action === "add") {
|
|
146
|
+
try {
|
|
147
|
+
await api.Groups.share(path, sharedGroupId, accessLevel, {});
|
|
148
|
+
} catch (error) {
|
|
149
|
+
if (error.cause?.response?.status === 409) {
|
|
150
|
+
await api.Groups.unshare(path, sharedGroupId, {});
|
|
151
|
+
await api.Groups.share(path, sharedGroupId, accessLevel, {});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
await api.Groups.unshare(path, sharedGroupId, {});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
ctx.output("path", path);
|
|
163
|
+
if (userIds.length > 0) {
|
|
164
|
+
ctx.output("userIds", userIds);
|
|
165
|
+
}
|
|
166
|
+
if (groupIds.length > 0) {
|
|
167
|
+
ctx.output("groupIds", groupIds);
|
|
168
|
+
}
|
|
169
|
+
if (action === "add") {
|
|
170
|
+
ctx.output("accessLevel", accessLevel);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
exports.createGitlabGroupAccessAction = createGitlabGroupAccessAction;
|
|
177
|
+
//# sourceMappingURL=gitlabGroupAccessAction.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabGroupAccessAction.cjs.js","sources":["../../src/actions/gitlabGroupAccessAction.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { ScmIntegrationRegistry } from '@backstage/integration';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { AccessLevel } from '@gitbeaker/core';\nimport { getClient, parseRepoHost } from '../util';\nimport { examples } from './gitlabGroupAccessAction.examples';\n\ntype NonAdminAccessLevel = Exclude<AccessLevel, AccessLevel.ADMIN>;\n\nconst accessLevelMapping: Record<string, number> = {\n no_access: 0,\n minimal_access: 5,\n guest: 10,\n planner: 15,\n reporter: 20,\n developer: 30,\n maintainer: 40,\n owner: 50,\n};\n\nfunction resolveAccessLevel(level: string | number): number {\n if (typeof level === 'number') return level;\n const resolved = accessLevelMapping[level.toLocaleLowerCase('en-US')];\n if (resolved === undefined) {\n throw new InputError(\n `Invalid access level: \"${level}\". Valid values are: ${Object.keys(\n accessLevelMapping,\n ).join(', ')} or a numeric GitLab access level`,\n );\n }\n return resolved;\n}\n\n/**\n * Creates a `gitlab:group:access` Scaffolder action.\n *\n * @public\n */\nexport const createGitlabGroupAccessAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'gitlab:group:access',\n description: 'Adds or removes users and groups from a GitLab group',\n supportsDryRun: true,\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description:\n \"The host of the GitLab instance, for example 'gitlab.com' or 'gitlab.my-company.com'.\",\n }),\n token: z =>\n z\n .string({\n description: 'The token to use for authorization to GitLab',\n })\n .optional(),\n path: z =>\n z.union([z.number(), z.string()], {\n description:\n 'The ID or path of the group to add/remove members from',\n }),\n userIds: z =>\n z\n .array(z.number(), {\n description: 'The IDs of the users to add/remove',\n })\n .optional(),\n groupIds: z =>\n z\n .array(z.number(), {\n description:\n 'The IDs of the groups to share with or unshare from the target group',\n })\n .optional(),\n action: z =>\n z\n .enum(['add', 'remove'], {\n description:\n 'The action to perform: add or remove the members. Defaults to \"add\".',\n })\n .default('add')\n .optional(),\n accessLevel: z =>\n z\n .union([z.number(), z.string()], {\n description:\n 'The access level for the members. Can be a number (0=No access, 5=Minimal access, 10=Guest, 15=Planner, 20=Reporter, 30=Developer, 40=Maintainer, 50=Owner) or a string (e.g., \"guest\", \"developer\"). Defaults to 30 (Developer).',\n })\n .default(30)\n .optional(),\n },\n output: {\n userIds: z =>\n z\n .array(z.number(), {\n description: 'The IDs of the users that were added or removed',\n })\n .optional(),\n groupIds: z =>\n z\n .array(z.number(), {\n description:\n 'The IDs of the groups that were shared with or unshared from',\n })\n .optional(),\n path: z =>\n z\n .union([z.number(), z.string()], {\n description:\n 'The ID or path of the group the members were added to or removed from',\n })\n .optional(),\n accessLevel: z =>\n z\n .number({\n description:\n 'The access level granted to the members (only for add action)',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n const {\n token,\n repoUrl,\n path,\n userIds = [],\n groupIds = [],\n accessLevel: rawAccessLevel = 30,\n action = 'add',\n } = ctx.input;\n\n if (userIds.length === 0 && groupIds.length === 0) {\n throw new InputError(\n 'At least one of userIds or groupIds must be provided and non-empty',\n );\n }\n\n const accessLevel = resolveAccessLevel(rawAccessLevel);\n\n if (ctx.isDryRun) {\n if (userIds.length > 0) {\n ctx.output('userIds', userIds);\n }\n if (groupIds.length > 0) {\n ctx.output('groupIds', groupIds);\n }\n ctx.output('path', path);\n if (action === 'add') {\n ctx.output('accessLevel', accessLevel);\n }\n return;\n }\n\n const host = parseRepoHost(repoUrl);\n\n const api = getClient({ host, integrations, token });\n\n // Process users\n for (const userId of userIds) {\n ctx.logger.info(\n `${action === 'add' ? 'Adding' : 'Removing'} user ${userId} ${\n action === 'add' ? 'to' : 'from'\n } group ${path}`,\n );\n await ctx.checkpoint({\n key: `gitlab.group.member.user.${action}.${path}.${userId}`,\n fn: async () => {\n if (action === 'add') {\n try {\n await api.GroupMembers.add(\n path,\n accessLevel as NonAdminAccessLevel,\n { userId },\n );\n } catch (error: any) {\n // If member already exists, try to edit instead\n if (error.cause?.response?.status === 409) {\n await api.GroupMembers.edit(\n path,\n userId,\n accessLevel as NonAdminAccessLevel,\n );\n return;\n }\n throw error;\n }\n } else {\n await api.GroupMembers.remove(path, userId);\n }\n },\n });\n }\n\n // Process groups\n for (const sharedGroupId of groupIds) {\n ctx.logger.info(\n `${action === 'add' ? 'Adding' : 'Removing'} group ${sharedGroupId} ${\n action === 'add' ? 'to' : 'from'\n } group ${path}`,\n );\n await ctx.checkpoint({\n key: `gitlab.group.member.group.${action}.${path}.${sharedGroupId}`,\n fn: async () => {\n if (action === 'add') {\n try {\n await api.Groups.share(path, sharedGroupId, accessLevel, {});\n } catch (error: any) {\n // If group is already shared, unshare and re-share\n if (error.cause?.response?.status === 409) {\n await api.Groups.unshare(path, sharedGroupId, {});\n await api.Groups.share(path, sharedGroupId, accessLevel, {});\n return;\n }\n throw error;\n }\n } else {\n await api.Groups.unshare(path, sharedGroupId, {});\n }\n },\n });\n }\n\n ctx.output('path', path);\n\n if (userIds.length > 0) {\n ctx.output('userIds', userIds);\n }\n if (groupIds.length > 0) {\n ctx.output('groupIds', groupIds);\n }\n\n if (action === 'add') {\n ctx.output('accessLevel', accessLevel);\n }\n },\n });\n};\n"],"names":["InputError","createTemplateAction","examples","parseRepoHost","getClient"],"mappings":";;;;;;;AAyBA,MAAM,kBAAA,GAA6C;AAAA,EACjD,SAAA,EAAW,CAAA;AAAA,EACX,cAAA,EAAgB,CAAA;AAAA,EAChB,KAAA,EAAO,EAAA;AAAA,EACP,OAAA,EAAS,EAAA;AAAA,EACT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=== 'object' && 'default' in e ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
|
|
8
|
+
|
|
9
|
+
const examples = [
|
|
10
|
+
{
|
|
11
|
+
description: "Add users to a group using numeric group ID",
|
|
12
|
+
example: yaml__default.default.stringify({
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
id: "gitlabGroupAccess",
|
|
16
|
+
name: "Add Users to Group",
|
|
17
|
+
action: "gitlab:group:access",
|
|
18
|
+
input: {
|
|
19
|
+
repoUrl: "gitlab.com",
|
|
20
|
+
path: 123,
|
|
21
|
+
userIds: [456, 789],
|
|
22
|
+
accessLevel: 30
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
description: "Add users to a group using string path",
|
|
30
|
+
example: yaml__default.default.stringify({
|
|
31
|
+
steps: [
|
|
32
|
+
{
|
|
33
|
+
id: "gitlabGroupAccess",
|
|
34
|
+
name: "Add Users to Group",
|
|
35
|
+
action: "gitlab:group:access",
|
|
36
|
+
input: {
|
|
37
|
+
repoUrl: "gitlab.com",
|
|
38
|
+
path: "group1",
|
|
39
|
+
userIds: [456],
|
|
40
|
+
accessLevel: "developer"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
description: "Remove users from a group",
|
|
48
|
+
example: yaml__default.default.stringify({
|
|
49
|
+
steps: [
|
|
50
|
+
{
|
|
51
|
+
id: "gitlabGroupAccess",
|
|
52
|
+
name: "Remove Users from Group",
|
|
53
|
+
action: "gitlab:group:access",
|
|
54
|
+
input: {
|
|
55
|
+
repoUrl: "gitlab.com",
|
|
56
|
+
path: 123,
|
|
57
|
+
userIds: [456, 789],
|
|
58
|
+
action: "remove"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
description: "Share a group with another group",
|
|
66
|
+
example: yaml__default.default.stringify({
|
|
67
|
+
steps: [
|
|
68
|
+
{
|
|
69
|
+
id: "gitlabGroupAccess",
|
|
70
|
+
name: "Share Group",
|
|
71
|
+
action: "gitlab:group:access",
|
|
72
|
+
input: {
|
|
73
|
+
repoUrl: "gitlab.com",
|
|
74
|
+
path: 123,
|
|
75
|
+
groupIds: [456],
|
|
76
|
+
accessLevel: 30
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
})
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
description: "Unshare a group",
|
|
84
|
+
example: yaml__default.default.stringify({
|
|
85
|
+
steps: [
|
|
86
|
+
{
|
|
87
|
+
id: "gitlabGroupAccess",
|
|
88
|
+
name: "Unshare Group",
|
|
89
|
+
action: "gitlab:group:access",
|
|
90
|
+
input: {
|
|
91
|
+
repoUrl: "gitlab.com",
|
|
92
|
+
path: 123,
|
|
93
|
+
groupIds: [456],
|
|
94
|
+
action: "remove"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
exports.examples = examples;
|
|
103
|
+
//# sourceMappingURL=gitlabGroupAccessAction.examples.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabGroupAccessAction.examples.cjs.js","sources":["../../src/actions/gitlabGroupAccessAction.examples.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { TemplateExample } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'yaml';\n\nexport const examples: TemplateExample[] = [\n {\n description: 'Add users to a group using numeric group ID',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroupAccess',\n name: 'Add Users to Group',\n action: 'gitlab:group:access',\n input: {\n repoUrl: 'gitlab.com',\n path: 123,\n userIds: [456, 789],\n accessLevel: 30,\n },\n },\n ],\n }),\n },\n {\n description: 'Add users to a group using string path',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroupAccess',\n name: 'Add Users to Group',\n action: 'gitlab:group:access',\n input: {\n repoUrl: 'gitlab.com',\n path: 'group1',\n userIds: [456],\n accessLevel: 'developer',\n },\n },\n ],\n }),\n },\n {\n description: 'Remove users from a group',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroupAccess',\n name: 'Remove Users from Group',\n action: 'gitlab:group:access',\n input: {\n repoUrl: 'gitlab.com',\n path: 123,\n userIds: [456, 789],\n action: 'remove',\n },\n },\n ],\n }),\n },\n {\n description: 'Share a group with another group',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroupAccess',\n name: 'Share Group',\n action: 'gitlab:group:access',\n input: {\n repoUrl: 'gitlab.com',\n path: 123,\n groupIds: [456],\n accessLevel: 30,\n },\n },\n ],\n }),\n },\n {\n description: 'Unshare a group',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabGroupAccess',\n name: 'Unshare Group',\n action: 'gitlab:group:access',\n input: {\n repoUrl: 'gitlab.com',\n path: 123,\n groupIds: [456],\n action: 'remove',\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAkBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EAAa,6CAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EA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AM,aAAA;AAAA,UACN,MAAA,EAAQ,qBAAA;AAAA,UACR,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,YAAA;AAAA,YACT,IAAA,EAAM,GAAA;AAAA,YACN,QAAA,EAAU,CAAC,GAAG,CAAA;AAAA,YACd,WAAA,EAAa;AAAA;AACf;AACF;AACF,KACD;AAAA,GACH;AAAA,EACA;AAAA,IACE,WAAA,EAAa,iBAAA;AAAA,IACb,OAAA,EAASA,sBAAK,SAAA,CAAU;AAAA,MACtB,KAAA,EAAO;AAAA,QACL;AAAA,UACE,EAAA,EAAI,mBAAA;AAAA,UACJ,IAAA,EAAM,eAAA;AAAA,UACN,MAAA,EAAQ,qBAAA;AAAA,UACR,KAAA,EAAO;AAAA,YACL,OAAA,EAAS,YAAA;AAAA,YACT,IAAA,EAAM,GAAA;AAAA,YACN,QAAA,EAAU,CAAC,GAAG,CAAA;AAAA,YACd,MAAA,EAAQ;AAAA;AACV;AACF;AACF,KACD;AAAA;AAEL;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var gitlab = require('./actions/gitlab.cjs.js');
|
|
6
6
|
var gitlabGroupEnsureExists = require('./actions/gitlabGroupEnsureExists.cjs.js');
|
|
7
|
+
var gitlabGroupAccessAction = require('./actions/gitlabGroupAccessAction.cjs.js');
|
|
7
8
|
var gitlabIssueCreate = require('./actions/gitlabIssueCreate.cjs.js');
|
|
8
9
|
var gitlabIssueEdit = require('./actions/gitlabIssueEdit.cjs.js');
|
|
9
10
|
var gitlabMergeRequest = require('./actions/gitlabMergeRequest.cjs.js');
|
|
@@ -20,6 +21,7 @@ var module$1 = require('./module.cjs.js');
|
|
|
20
21
|
|
|
21
22
|
exports.createPublishGitlabAction = gitlab.createPublishGitlabAction;
|
|
22
23
|
exports.createGitlabGroupEnsureExistsAction = gitlabGroupEnsureExists.createGitlabGroupEnsureExistsAction;
|
|
24
|
+
exports.createGitlabGroupAccessAction = gitlabGroupAccessAction.createGitlabGroupAccessAction;
|
|
23
25
|
exports.createGitlabIssueAction = gitlabIssueCreate.createGitlabIssueAction;
|
|
24
26
|
exports.editGitlabIssueAction = gitlabIssueEdit.editGitlabIssueAction;
|
|
25
27
|
exports.createPublishGitlabMergeRequestAction = gitlabMergeRequest.createPublishGitlabMergeRequestAction;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -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
|
@@ -82,6 +82,28 @@ declare const createGitlabGroupEnsureExistsAction: (options: {
|
|
|
82
82
|
groupId?: number | undefined;
|
|
83
83
|
}, "v2">;
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* Creates a `gitlab:group:access` Scaffolder action.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
declare const createGitlabGroupAccessAction: (options: {
|
|
91
|
+
integrations: ScmIntegrationRegistry;
|
|
92
|
+
}) => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
93
|
+
repoUrl: string;
|
|
94
|
+
path: string | number;
|
|
95
|
+
token?: string | undefined;
|
|
96
|
+
userIds?: number[] | undefined;
|
|
97
|
+
groupIds?: number[] | undefined;
|
|
98
|
+
action?: "add" | "remove" | undefined;
|
|
99
|
+
accessLevel?: string | number | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
userIds?: number[] | undefined;
|
|
102
|
+
groupIds?: number[] | undefined;
|
|
103
|
+
path?: string | number | undefined;
|
|
104
|
+
accessLevel?: number | undefined;
|
|
105
|
+
}, "v2">;
|
|
106
|
+
|
|
85
107
|
/**
|
|
86
108
|
* Creates a `gitlab:issues:create` Scaffolder action.
|
|
87
109
|
*
|
|
@@ -359,4 +381,4 @@ declare namespace IssueStateEvent {
|
|
|
359
381
|
*/
|
|
360
382
|
declare const gitlabModule: _backstage_backend_plugin_api.BackendFeature;
|
|
361
383
|
|
|
362
|
-
export { IssueStateEvent, IssueType, createGitlabGroupEnsureExistsAction, createGitlabIssueAction, createGitlabProjectAccessTokenAction, createGitlabProjectDeployTokenAction, createGitlabProjectVariableAction, createGitlabRepoPushAction, createGitlabUserInfoAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createTriggerGitlabPipelineAction, gitlabModule as default, editGitlabIssueAction };
|
|
384
|
+
export { IssueStateEvent, IssueType, createGitlabGroupAccessAction, createGitlabGroupEnsureExistsAction, createGitlabIssueAction, createGitlabProjectAccessTokenAction, createGitlabProjectDeployTokenAction, createGitlabProjectVariableAction, createGitlabRepoPushAction, createGitlabUserInfoAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createTriggerGitlabPipelineAction, gitlabModule as default, editGitlabIssueAction };
|
package/dist/module.cjs.js
CHANGED
|
@@ -5,6 +5,7 @@ var integration = require('@backstage/integration');
|
|
|
5
5
|
var alpha = require('@backstage/plugin-scaffolder-node/alpha');
|
|
6
6
|
var gitlab = require('./actions/gitlab.cjs.js');
|
|
7
7
|
var gitlabGroupEnsureExists = require('./actions/gitlabGroupEnsureExists.cjs.js');
|
|
8
|
+
var gitlabGroupAccessAction = require('./actions/gitlabGroupAccessAction.cjs.js');
|
|
8
9
|
var gitlabIssueCreate = require('./actions/gitlabIssueCreate.cjs.js');
|
|
9
10
|
var gitlabIssueEdit = require('./actions/gitlabIssueEdit.cjs.js');
|
|
10
11
|
var gitlabMergeRequest = require('./actions/gitlabMergeRequest.cjs.js');
|
|
@@ -33,6 +34,7 @@ const gitlabModule = backendPluginApi.createBackendModule({
|
|
|
33
34
|
const integrations = integration.ScmIntegrations.fromConfig(config);
|
|
34
35
|
scaffolder.addActions(
|
|
35
36
|
gitlabGroupEnsureExists.createGitlabGroupEnsureExistsAction({ integrations }),
|
|
37
|
+
gitlabGroupAccessAction.createGitlabGroupAccessAction({ integrations }),
|
|
36
38
|
gitlabProjectMigrate.createGitlabProjectMigrateAction({ integrations }),
|
|
37
39
|
gitlabIssueCreate.createGitlabIssueAction({ integrations }),
|
|
38
40
|
gitlabProjectAccessTokenCreate.createGitlabProjectAccessTokenAction({ integrations }),
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { scaffolderAutocompleteExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGitlabGroupEnsureExistsAction,\n createGitlabIssueAction,\n createGitlabProjectAccessTokenAction,\n createGitlabProjectDeployTokenAction,\n createGitlabProjectVariableAction,\n createGitlabRepoPushAction,\n createGitlabUserInfoAction,\n createPublishGitlabAction,\n createPublishGitlabMergeRequestAction,\n createTriggerGitlabPipelineAction,\n editGitlabIssueAction,\n} from './actions';\nimport { createGitlabProjectMigrateAction } from './actions/gitlabProjectMigrate';\nimport { createHandleAutocompleteRequest } from './autocomplete/autocomplete';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';\n\n/**\n * @public\n * The GitLab Module for the Scaffolder Backend\n */\nexport const gitlabModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitlab',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, autocomplete, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createGitlabGroupEnsureExistsAction({ integrations }),\n createGitlabProjectMigrateAction({ integrations }),\n createGitlabIssueAction({ integrations }),\n createGitlabProjectAccessTokenAction({ integrations }),\n createGitlabProjectDeployTokenAction({ integrations }),\n createGitlabProjectVariableAction({ integrations }),\n createGitlabRepoPushAction({ integrations }),\n createGitlabUserInfoAction({ integrations }),\n editGitlabIssueAction({ integrations }),\n createPublishGitlabAction({ config, integrations }),\n createPublishGitlabMergeRequestAction({ integrations }),\n createTriggerGitlabPipelineAction({ integrations }),\n );\n\n autocomplete.addAutocompleteProvider({\n id: 'gitlab',\n handler: createHandleAutocompleteRequest({ integrations }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","scaffolderAutocompleteExtensionPoint","coreServices","autocomplete","ScmIntegrations","createGitlabGroupEnsureExistsAction","createGitlabProjectMigrateAction","createGitlabIssueAction","createGitlabProjectAccessTokenAction","createGitlabProjectDeployTokenAction","createGitlabProjectVariableAction","createGitlabRepoPushAction","createGitlabUserInfoAction","editGitlabIssueAction","createPublishGitlabAction","createPublishGitlabMergeRequestAction","createTriggerGitlabPipelineAction","createHandleAutocompleteRequest"],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { scaffolderAutocompleteExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\nimport {\n createGitlabGroupEnsureExistsAction,\n createGitlabGroupAccessAction,\n createGitlabIssueAction,\n createGitlabProjectAccessTokenAction,\n createGitlabProjectDeployTokenAction,\n createGitlabProjectVariableAction,\n createGitlabRepoPushAction,\n createGitlabUserInfoAction,\n createPublishGitlabAction,\n createPublishGitlabMergeRequestAction,\n createTriggerGitlabPipelineAction,\n editGitlabIssueAction,\n} from './actions';\nimport { createGitlabProjectMigrateAction } from './actions/gitlabProjectMigrate';\nimport { createHandleAutocompleteRequest } from './autocomplete/autocomplete';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node';\n\n/**\n * @public\n * The GitLab Module for the Scaffolder Backend\n */\nexport const gitlabModule = createBackendModule({\n pluginId: 'scaffolder',\n moduleId: 'gitlab',\n register({ registerInit }) {\n registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n autocomplete: scaffolderAutocompleteExtensionPoint,\n config: coreServices.rootConfig,\n },\n async init({ scaffolder, autocomplete, config }) {\n const integrations = ScmIntegrations.fromConfig(config);\n\n scaffolder.addActions(\n createGitlabGroupEnsureExistsAction({ integrations }),\n createGitlabGroupAccessAction({ integrations }),\n createGitlabProjectMigrateAction({ integrations }),\n createGitlabIssueAction({ integrations }),\n createGitlabProjectAccessTokenAction({ integrations }),\n createGitlabProjectDeployTokenAction({ integrations }),\n createGitlabProjectVariableAction({ integrations }),\n createGitlabRepoPushAction({ integrations }),\n createGitlabUserInfoAction({ integrations }),\n editGitlabIssueAction({ integrations }),\n createPublishGitlabAction({ config, integrations }),\n createPublishGitlabMergeRequestAction({ integrations }),\n createTriggerGitlabPipelineAction({ integrations }),\n );\n\n autocomplete.addAutocompleteProvider({\n id: 'gitlab',\n handler: createHandleAutocompleteRequest({ integrations }),\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","scaffolderAutocompleteExtensionPoint","coreServices","autocomplete","ScmIntegrations","createGitlabGroupEnsureExistsAction","createGitlabGroupAccessAction","createGitlabProjectMigrateAction","createGitlabIssueAction","createGitlabProjectAccessTokenAction","createGitlabProjectDeployTokenAction","createGitlabProjectVariableAction","createGitlabRepoPushAction","createGitlabUserInfoAction","editGitlabIssueAction","createPublishGitlabAction","createPublishGitlabMergeRequestAction","createTriggerGitlabPipelineAction","createHandleAutocompleteRequest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2CO,MAAM,eAAeA,oCAAA,CAAoB;AAAA,EAC9C,QAAA,EAAU,YAAA;AAAA,EACV,QAAA,EAAU,QAAA;AAAA,EACV,QAAA,CAAS,EAAE,YAAA,EAAa,EAAG;AACzB,IAAA,YAAA,CAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,UAAA,EAAYC,oDAAA;AAAA,QACZ,YAAA,EAAcC,0CAAA;AAAA,QACd,QAAQC,6BAAA,CAAa;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,gBAAYC,cAAA,EAAc,QAAO,EAAG;AAC/C,QAAA,MAAM,YAAA,GAAeC,2BAAA,CAAgB,UAAA,CAAW,MAAM,CAAA;AAEtD,QAAA,UAAA,CAAW,UAAA;AAAA,UACTC,2DAAA,CAAoC,EAAE,YAAA,EAAc,CAAA;AAAA,UACpDC,qDAAA,CAA8B,EAAE,YAAA,EAAc,CAAA;AAAA,UAC9CC,qDAAA,CAAiC,EAAE,YAAA,EAAc,CAAA;AAAA,UACjDC,yCAAA,CAAwB,EAAE,YAAA,EAAc,CAAA;AAAA,UACxCC,mEAAA,CAAqC,EAAE,YAAA,EAAc,CAAA;AAAA,UACrDC,mEAAA,CAAqC,EAAE,YAAA,EAAc,CAAA;AAAA,UACrDC,6DAAA,CAAkC,EAAE,YAAA,EAAc,CAAA;AAAA,UAClDC,yCAAA,CAA2B,EAAE,YAAA,EAAc,CAAA;AAAA,UAC3CC,yCAAA,CAA2B,EAAE,YAAA,EAAc,CAAA;AAAA,UAC3CC,qCAAA,CAAsB,EAAE,YAAA,EAAc,CAAA;AAAA,UACtCC,gCAAA,CAA0B,EAAE,MAAA,EAAQ,YAAA,EAAc,CAAA;AAAA,UAClDC,wDAAA,CAAsC,EAAE,YAAA,EAAc,CAAA;AAAA,UACtDC,uDAAA,CAAkC,EAAE,YAAA,EAAc;AAAA,SACpD;AAEA,QAAAd,cAAA,CAAa,uBAAA,CAAwB;AAAA,UACnC,EAAA,EAAI,QAAA;AAAA,UACJ,OAAA,EAASe,4CAAA,CAAgC,EAAE,YAAA,EAAc;AAAA,SAC1D,CAAA;AAAA,MACH;AAAA,KACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-backend-module-gitlab",
|
|
3
|
-
"version": "0.11.4-next.
|
|
3
|
+
"version": "0.11.4-next.2",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "backend-plugin-module",
|
|
6
6
|
"pluginId": "scaffolder",
|
|
@@ -53,11 +53,12 @@
|
|
|
53
53
|
"test": "backstage-cli package test"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@backstage/backend-plugin-api": "1.
|
|
56
|
+
"@backstage/backend-plugin-api": "1.8.0-next.1",
|
|
57
57
|
"@backstage/config": "1.3.6",
|
|
58
58
|
"@backstage/errors": "1.2.7",
|
|
59
|
-
"@backstage/integration": "
|
|
60
|
-
"@backstage/plugin-scaffolder-node": "0.
|
|
59
|
+
"@backstage/integration": "2.0.0-next.2",
|
|
60
|
+
"@backstage/plugin-scaffolder-node": "0.13.0-next.2",
|
|
61
|
+
"@gitbeaker/core": "^43.8.0",
|
|
61
62
|
"@gitbeaker/requester-utils": "^43.8.0",
|
|
62
63
|
"@gitbeaker/rest": "^43.8.0",
|
|
63
64
|
"luxon": "^3.0.0",
|
|
@@ -65,8 +66,8 @@
|
|
|
65
66
|
"zod": "^3.25.76"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
|
-
"@backstage/backend-test-utils": "1.11.1-next.
|
|
69
|
-
"@backstage/cli": "0.
|
|
70
|
-
"@backstage/plugin-scaffolder-node-test-utils": "0.3.9-next.
|
|
69
|
+
"@backstage/backend-test-utils": "1.11.1-next.2",
|
|
70
|
+
"@backstage/cli": "0.36.0-next.2",
|
|
71
|
+
"@backstage/plugin-scaffolder-node-test-utils": "0.3.9-next.2"
|
|
71
72
|
}
|
|
72
73
|
}
|