@backstage/plugin-scaffolder-backend-module-gitlab 0.11.2-next.0 → 0.11.3-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 +10 -0
- package/dist/actions/gitlabUserInfo.cjs.js +84 -0
- package/dist/actions/gitlabUserInfo.cjs.js.map +1 -0
- package/dist/actions/gitlabUserInfo.examples.cjs.js +77 -0
- package/dist/actions/gitlabUserInfo.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 +24 -1
- package/dist/module.cjs.js +2 -0
- package/dist/module.cjs.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-backend-module-gitlab
|
|
2
2
|
|
|
3
|
+
## 0.11.3-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 32c51c0: Added new `gitlab:user:info` scaffolder action that retrieves information about a GitLab user. The action can fetch either the current authenticated user or a specific user by ID.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/integration@1.20.0-next.1
|
|
10
|
+
- @backstage/backend-plugin-api@1.7.0-next.1
|
|
11
|
+
- @backstage/plugin-scaffolder-node@0.12.5-next.1
|
|
12
|
+
|
|
3
13
|
## 0.11.2-next.0
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors = require('@backstage/errors');
|
|
4
|
+
var pluginScaffolderNode = require('@backstage/plugin-scaffolder-node');
|
|
5
|
+
var gitlabUserInfo_examples = require('./gitlabUserInfo.examples.cjs.js');
|
|
6
|
+
var util = require('../util.cjs.js');
|
|
7
|
+
var helpers = require('./helpers.cjs.js');
|
|
8
|
+
|
|
9
|
+
const createGitlabUserInfoAction = (options) => {
|
|
10
|
+
const { integrations } = options;
|
|
11
|
+
return pluginScaffolderNode.createTemplateAction({
|
|
12
|
+
id: "gitlab:user:info",
|
|
13
|
+
description: "Retrieves information about a GitLab user or the current authenticated user",
|
|
14
|
+
examples: gitlabUserInfo_examples.examples,
|
|
15
|
+
schema: {
|
|
16
|
+
input: {
|
|
17
|
+
repoUrl: (z) => z.string({
|
|
18
|
+
description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`
|
|
19
|
+
}),
|
|
20
|
+
token: (z) => z.string({
|
|
21
|
+
description: "The token to use for authorization to GitLab"
|
|
22
|
+
}).optional(),
|
|
23
|
+
userId: (z) => z.number({
|
|
24
|
+
description: "User ID. If not provided, returns current authenticated user"
|
|
25
|
+
}).optional()
|
|
26
|
+
},
|
|
27
|
+
output: {
|
|
28
|
+
id: (z) => z.number({
|
|
29
|
+
description: "The user ID"
|
|
30
|
+
}),
|
|
31
|
+
username: (z) => z.string({
|
|
32
|
+
description: "The username"
|
|
33
|
+
}),
|
|
34
|
+
name: (z) => z.string({
|
|
35
|
+
description: "The display name"
|
|
36
|
+
}),
|
|
37
|
+
state: (z) => z.string({
|
|
38
|
+
description: "User state (active, blocked, etc.)"
|
|
39
|
+
}),
|
|
40
|
+
webUrl: (z) => z.string({
|
|
41
|
+
description: "URL to user profile"
|
|
42
|
+
}),
|
|
43
|
+
email: (z) => z.string({
|
|
44
|
+
description: "Email address (only available for current user or admins)"
|
|
45
|
+
}).optional(),
|
|
46
|
+
createdAt: (z) => z.string({
|
|
47
|
+
description: "User creation date"
|
|
48
|
+
}).optional(),
|
|
49
|
+
publicEmail: (z) => z.string({
|
|
50
|
+
description: "Public email address"
|
|
51
|
+
}).optional()
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
async handler(ctx) {
|
|
55
|
+
try {
|
|
56
|
+
const { repoUrl, token, userId } = ctx.input;
|
|
57
|
+
const { host } = util.parseRepoUrl(repoUrl, integrations);
|
|
58
|
+
const api = util.getClient({ host, integrations, token });
|
|
59
|
+
const userInfo = userId !== void 0 ? await api.Users.show(userId) : await api.Users.showCurrentUser();
|
|
60
|
+
ctx.output("id", userInfo.id);
|
|
61
|
+
ctx.output("username", userInfo.username);
|
|
62
|
+
ctx.output("name", userInfo.name);
|
|
63
|
+
ctx.output("state", userInfo.state);
|
|
64
|
+
ctx.output("webUrl", userInfo.web_url);
|
|
65
|
+
if (userInfo.email) {
|
|
66
|
+
ctx.output("email", userInfo.email);
|
|
67
|
+
}
|
|
68
|
+
if (userInfo.created_at) {
|
|
69
|
+
ctx.output("createdAt", userInfo.created_at);
|
|
70
|
+
}
|
|
71
|
+
if (userInfo.public_email) {
|
|
72
|
+
ctx.output("publicEmail", userInfo.public_email);
|
|
73
|
+
}
|
|
74
|
+
} catch (error) {
|
|
75
|
+
throw new errors.InputError(
|
|
76
|
+
`Failed to retrieve GitLab user info: ${helpers.getErrorMessage(error)}`
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
exports.createGitlabUserInfoAction = createGitlabUserInfoAction;
|
|
84
|
+
//# sourceMappingURL=gitlabUserInfo.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabUserInfo.cjs.js","sources":["../../src/actions/gitlabUserInfo.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 { examples } from './gitlabUserInfo.examples';\nimport { getClient, parseRepoUrl } from '../util';\nimport { getErrorMessage } from './helpers';\n\n/**\n * Creates a `gitlab:user:info` Scaffolder action.\n *\n * @param options - Templating configuration.\n * @public\n */\nexport const createGitlabUserInfoAction = (options: {\n integrations: ScmIntegrationRegistry;\n}) => {\n const { integrations } = options;\n\n return createTemplateAction({\n id: 'gitlab:user:info',\n description:\n 'Retrieves information about a GitLab user or the current authenticated user',\n examples,\n schema: {\n input: {\n repoUrl: z =>\n z.string({\n description: `Accepts the format 'gitlab.com?repo=project_name&owner=group_name' where 'project_name' is the repository name and 'group_name' is a group or username`,\n }),\n token: z =>\n z\n .string({\n description: 'The token to use for authorization to GitLab',\n })\n .optional(),\n userId: z =>\n z\n .number({\n description:\n 'User ID. If not provided, returns current authenticated user',\n })\n .optional(),\n },\n output: {\n id: z =>\n z.number({\n description: 'The user ID',\n }),\n username: z =>\n z.string({\n description: 'The username',\n }),\n name: z =>\n z.string({\n description: 'The display name',\n }),\n state: z =>\n z.string({\n description: 'User state (active, blocked, etc.)',\n }),\n webUrl: z =>\n z.string({\n description: 'URL to user profile',\n }),\n email: z =>\n z\n .string({\n description:\n 'Email address (only available for current user or admins)',\n })\n .optional(),\n createdAt: z =>\n z\n .string({\n description: 'User creation date',\n })\n .optional(),\n publicEmail: z =>\n z\n .string({\n description: 'Public email address',\n })\n .optional(),\n },\n },\n async handler(ctx) {\n try {\n const { repoUrl, token, userId } = ctx.input;\n\n const { host } = parseRepoUrl(repoUrl, integrations);\n const api = getClient({ host, integrations, token });\n\n const userInfo =\n userId !== undefined\n ? await api.Users.show(userId)\n : await api.Users.showCurrentUser();\n\n ctx.output('id', userInfo.id);\n ctx.output('username', userInfo.username);\n ctx.output('name', userInfo.name);\n ctx.output('state', userInfo.state);\n ctx.output('webUrl', userInfo.web_url as string);\n\n if (userInfo.email) {\n ctx.output('email', userInfo.email as string);\n }\n if (userInfo.created_at) {\n ctx.output('createdAt', userInfo.created_at as string);\n }\n if (userInfo.public_email) {\n ctx.output('publicEmail', userInfo.public_email as string);\n }\n } catch (error: any) {\n throw new InputError(\n `Failed to retrieve GitLab user info: ${getErrorMessage(error)}`,\n );\n }\n },\n });\n};\n"],"names":["createTemplateAction","examples","parseRepoUrl","getClient","InputError","getErrorMessage"],"mappings":";;;;;;;;AA6BO,MAAM,0BAAA,GAA6B,CAAC,OAAA,KAErC;AACJ,EAAA,MAAM,EAAE,cAAa,GAAI,OAAA;AAEzB,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,kBAAA;AAAA,IACJ,WAAA,EACE,6EAAA;AAAA,cACFC,gCAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,OAAA,EAAS,CAAA,CAAA,KACP,CAAA,CAAE,MAAA,CAAO;AAAA,UACP,WAAA,EAAa,CAAA,sJAAA;AAAA,SACd,CAAA;AAAA,QACH,KAAA,EAAO,CAAA,CAAA,KACL,CAAA,CACG,MAAA,CAAO;AAAA,UACN,WAAA,EAAa;AAAA,SACd,EACA,QAAA,EAAS;AAAA,QACd,MAAA,EAAQ,CAAA,CAAA,KACN,CAAA,CACG,MAAA,CAAO;AAAA,UACN,WAAA,EACE;AAAA,SACH,EACA,QAAA;AAAS,OAChB;AAAA,MACA,MAAA,EAAQ;AAAA,QACN,EAAA,EAAI,CAAA,CAAA,KACF,CAAA,CAAE,MAAA,CAAO;AAAA,UACP,WAAA,EAAa;AAAA,SACd,CAAA;AAAA,QACH,QAAA,EAAU,CAAA,CAAA,KACR,CAAA,CAAE,MAAA,CAAO;AAAA,UACP,WAAA,EAAa;AAAA,SACd,CAAA;AAAA,QACH,IAAA,EAAM,CAAA,CAAA,KACJ,CAAA,CAAE,MAAA,CAAO;AAAA,UACP,WAAA,EAAa;AAAA,SACd,CAAA;AAAA,QACH,KAAA,EAAO,CAAA,CAAA,KACL,CAAA,CAAE,M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AAS,KAAK,CAAA;AAClC,QAAA,GAAA,CAAI,MAAA,CAAO,QAAA,EAAU,QAAA,CAAS,OAAiB,CAAA;AAE/C,QAAA,IAAI,SAAS,KAAA,EAAO;AAClB,UAAA,GAAA,CAAI,MAAA,CAAO,OAAA,EAAS,QAAA,CAAS,KAAe,CAAA;AAAA,QAC9C;AACA,QAAA,IAAI,SAAS,UAAA,EAAY;AACvB,UAAA,GAAA,CAAI,MAAA,CAAO,WAAA,EAAa,QAAA,CAAS,UAAoB,CAAA;AAAA,QACvD;AACA,QAAA,IAAI,SAAS,YAAA,EAAc;AACzB,UAAA,GAAA,CAAI,MAAA,CAAO,aAAA,EAAe,QAAA,CAAS,YAAsB,CAAA;AAAA,QAC3D;AAAA,MACF,SAAS,KAAA,EAAY;AACnB,QAAA,MAAM,IAAIC,iBAAA;AAAA,UACR,CAAA,qCAAA,EAAwCC,uBAAA,CAAgB,KAAK,CAAC,CAAA;AAAA,SAChE;AAAA,MACF;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var yaml = require('yaml');
|
|
4
|
+
|
|
5
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
6
|
+
|
|
7
|
+
var yaml__default = /*#__PURE__*/_interopDefaultCompat(yaml);
|
|
8
|
+
|
|
9
|
+
const examples = [
|
|
10
|
+
{
|
|
11
|
+
description: "Get current authenticated user information",
|
|
12
|
+
example: yaml__default.default.stringify({
|
|
13
|
+
steps: [
|
|
14
|
+
{
|
|
15
|
+
id: "gitlabUserInfo",
|
|
16
|
+
name: "Get Current User Info",
|
|
17
|
+
action: "gitlab:user:info",
|
|
18
|
+
input: {
|
|
19
|
+
repoUrl: "gitlab.com?repo=repo&owner=owner"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
description: "Get user information by user ID",
|
|
27
|
+
example: yaml__default.default.stringify({
|
|
28
|
+
steps: [
|
|
29
|
+
{
|
|
30
|
+
id: "gitlabUserInfo",
|
|
31
|
+
name: "Get User Info",
|
|
32
|
+
action: "gitlab:user:info",
|
|
33
|
+
input: {
|
|
34
|
+
repoUrl: "gitlab.com?repo=repo&owner=owner",
|
|
35
|
+
userId: 12345
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
description: "Get user information with a custom token",
|
|
43
|
+
example: yaml__default.default.stringify({
|
|
44
|
+
steps: [
|
|
45
|
+
{
|
|
46
|
+
id: "gitlabUserInfo",
|
|
47
|
+
name: "Get User Info",
|
|
48
|
+
action: "gitlab:user:info",
|
|
49
|
+
input: {
|
|
50
|
+
repoUrl: "gitlab.com?repo=repo&owner=owner",
|
|
51
|
+
token: "${{ secrets.GITLAB_TOKEN }}",
|
|
52
|
+
userId: 12345
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
description: "Get user information from a self-hosted GitLab instance",
|
|
60
|
+
example: yaml__default.default.stringify({
|
|
61
|
+
steps: [
|
|
62
|
+
{
|
|
63
|
+
id: "gitlabUserInfo",
|
|
64
|
+
name: "Get User Info",
|
|
65
|
+
action: "gitlab:user:info",
|
|
66
|
+
input: {
|
|
67
|
+
repoUrl: "gitlab.example.com?repo=repo&owner=owner",
|
|
68
|
+
userId: 12345
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
];
|
|
75
|
+
|
|
76
|
+
exports.examples = examples;
|
|
77
|
+
//# sourceMappingURL=gitlabUserInfo.examples.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitlabUserInfo.examples.cjs.js","sources":["../../src/actions/gitlabUserInfo.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: 'Get current authenticated user information',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabUserInfo',\n name: 'Get Current User Info',\n action: 'gitlab:user:info',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n },\n },\n ],\n }),\n },\n {\n description: 'Get user information by user ID',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabUserInfo',\n name: 'Get User Info',\n action: 'gitlab:user:info',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n userId: 12345,\n },\n },\n ],\n }),\n },\n {\n description: 'Get user information with a custom token',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabUserInfo',\n name: 'Get User Info',\n action: 'gitlab:user:info',\n input: {\n repoUrl: 'gitlab.com?repo=repo&owner=owner',\n token: '${{ secrets.GITLAB_TOKEN }}',\n userId: 12345,\n },\n },\n ],\n }),\n },\n {\n description: 'Get user information from a self-hosted GitLab instance',\n example: yaml.stringify({\n steps: [\n {\n id: 'gitlabUserInfo',\n name: 'Get User Info',\n action: 'gitlab:user:info',\n input: {\n repoUrl: 'gitlab.example.com?repo=repo&owner=owner',\n userId: 12345,\n },\n },\n ],\n }),\n },\n];\n"],"names":["yaml"],"mappings":";;;;;;;;AAkBO,MAAM,QAAA,GAA8B;AAAA,EACzC;AAAA,IACE,WAAA,EAAa,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ACF;AACF,KACD;AAAA;AAEL;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -12,6 +12,7 @@ var gitlabProjectAccessTokenCreate = require('./actions/gitlabProjectAccessToken
|
|
|
12
12
|
var gitlabProjectDeployTokenCreate = require('./actions/gitlabProjectDeployTokenCreate.cjs.js');
|
|
13
13
|
var gitlabProjectVariableCreate = require('./actions/gitlabProjectVariableCreate.cjs.js');
|
|
14
14
|
var gitlabRepoPush = require('./actions/gitlabRepoPush.cjs.js');
|
|
15
|
+
var gitlabUserInfo = require('./actions/gitlabUserInfo.cjs.js');
|
|
15
16
|
var commonGitlabConfig = require('./commonGitlabConfig.cjs.js');
|
|
16
17
|
var module$1 = require('./module.cjs.js');
|
|
17
18
|
|
|
@@ -27,6 +28,7 @@ exports.createGitlabProjectAccessTokenAction = gitlabProjectAccessTokenCreate.cr
|
|
|
27
28
|
exports.createGitlabProjectDeployTokenAction = gitlabProjectDeployTokenCreate.createGitlabProjectDeployTokenAction;
|
|
28
29
|
exports.createGitlabProjectVariableAction = gitlabProjectVariableCreate.createGitlabProjectVariableAction;
|
|
29
30
|
exports.createGitlabRepoPushAction = gitlabRepoPush.createGitlabRepoPushAction;
|
|
31
|
+
exports.createGitlabUserInfoAction = gitlabUserInfo.createGitlabUserInfoAction;
|
|
30
32
|
exports.IssueStateEvent = commonGitlabConfig.IssueStateEvent;
|
|
31
33
|
exports.IssueType = commonGitlabConfig.IssueType;
|
|
32
34
|
exports.default = module$1.gitlabModule;
|
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
|
@@ -282,6 +282,29 @@ declare const createGitlabRepoPushAction: (options: {
|
|
|
282
282
|
commitHash: string;
|
|
283
283
|
}, "v2">;
|
|
284
284
|
|
|
285
|
+
/**
|
|
286
|
+
* Creates a `gitlab:user:info` Scaffolder action.
|
|
287
|
+
*
|
|
288
|
+
* @param options - Templating configuration.
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
declare const createGitlabUserInfoAction: (options: {
|
|
292
|
+
integrations: ScmIntegrationRegistry;
|
|
293
|
+
}) => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
294
|
+
repoUrl: string;
|
|
295
|
+
token?: string | undefined;
|
|
296
|
+
userId?: number | undefined;
|
|
297
|
+
}, {
|
|
298
|
+
id: number;
|
|
299
|
+
username: string;
|
|
300
|
+
name: string;
|
|
301
|
+
state: string;
|
|
302
|
+
webUrl: string;
|
|
303
|
+
email?: string | undefined;
|
|
304
|
+
createdAt?: string | undefined;
|
|
305
|
+
publicEmail?: string | undefined;
|
|
306
|
+
}, "v2">;
|
|
307
|
+
|
|
285
308
|
/**
|
|
286
309
|
* Gitlab issue types as specified by gitlab api
|
|
287
310
|
*
|
|
@@ -333,4 +356,4 @@ declare namespace IssueStateEvent {
|
|
|
333
356
|
*/
|
|
334
357
|
declare const gitlabModule: _backstage_backend_plugin_api.BackendFeature;
|
|
335
358
|
|
|
336
|
-
export { IssueStateEvent, IssueType, createGitlabGroupEnsureExistsAction, createGitlabIssueAction, createGitlabProjectAccessTokenAction, createGitlabProjectDeployTokenAction, createGitlabProjectVariableAction, createGitlabRepoPushAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createTriggerGitlabPipelineAction, gitlabModule as default, editGitlabIssueAction };
|
|
359
|
+
export { IssueStateEvent, IssueType, createGitlabGroupEnsureExistsAction, createGitlabIssueAction, createGitlabProjectAccessTokenAction, createGitlabProjectDeployTokenAction, createGitlabProjectVariableAction, createGitlabRepoPushAction, createGitlabUserInfoAction, createPublishGitlabAction, createPublishGitlabMergeRequestAction, createTriggerGitlabPipelineAction, gitlabModule as default, editGitlabIssueAction };
|
package/dist/module.cjs.js
CHANGED
|
@@ -13,6 +13,7 @@ var gitlabProjectAccessTokenCreate = require('./actions/gitlabProjectAccessToken
|
|
|
13
13
|
var gitlabProjectDeployTokenCreate = require('./actions/gitlabProjectDeployTokenCreate.cjs.js');
|
|
14
14
|
var gitlabProjectVariableCreate = require('./actions/gitlabProjectVariableCreate.cjs.js');
|
|
15
15
|
var gitlabRepoPush = require('./actions/gitlabRepoPush.cjs.js');
|
|
16
|
+
var gitlabUserInfo = require('./actions/gitlabUserInfo.cjs.js');
|
|
16
17
|
require('./commonGitlabConfig.cjs.js');
|
|
17
18
|
var gitlabProjectMigrate = require('./actions/gitlabProjectMigrate.cjs.js');
|
|
18
19
|
var autocomplete = require('./autocomplete/autocomplete.cjs.js');
|
|
@@ -38,6 +39,7 @@ const gitlabModule = backendPluginApi.createBackendModule({
|
|
|
38
39
|
gitlabProjectDeployTokenCreate.createGitlabProjectDeployTokenAction({ integrations }),
|
|
39
40
|
gitlabProjectVariableCreate.createGitlabProjectVariableAction({ integrations }),
|
|
40
41
|
gitlabRepoPush.createGitlabRepoPushAction({ integrations }),
|
|
42
|
+
gitlabUserInfo.createGitlabUserInfoAction({ integrations }),
|
|
41
43
|
gitlabIssueEdit.editGitlabIssueAction({ integrations }),
|
|
42
44
|
gitlab.createPublishGitlabAction({ config, integrations }),
|
|
43
45
|
gitlabMergeRequest.createPublishGitlabMergeRequestAction({ 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 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 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","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 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":";;;;;;;;;;;;;;;;;;;;;AA0CO,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,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,QAAAb,cAAA,CAAa,uBAAA,CAAwB;AAAA,UACnC,EAAA,EAAI,QAAA;AAAA,UACJ,OAAA,EAASc,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.
|
|
3
|
+
"version": "0.11.3-next.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "backend-plugin-module",
|
|
6
6
|
"pluginId": "scaffolder",
|
|
@@ -53,11 +53,11 @@
|
|
|
53
53
|
"test": "backstage-cli package test"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@backstage/backend-plugin-api": "1.7.0-next.
|
|
56
|
+
"@backstage/backend-plugin-api": "1.7.0-next.1",
|
|
57
57
|
"@backstage/config": "1.3.6",
|
|
58
58
|
"@backstage/errors": "1.2.7",
|
|
59
|
-
"@backstage/integration": "1.
|
|
60
|
-
"@backstage/plugin-scaffolder-node": "0.12.
|
|
59
|
+
"@backstage/integration": "1.20.0-next.1",
|
|
60
|
+
"@backstage/plugin-scaffolder-node": "0.12.5-next.1",
|
|
61
61
|
"@gitbeaker/requester-utils": "^41.2.0",
|
|
62
62
|
"@gitbeaker/rest": "^41.2.0",
|
|
63
63
|
"luxon": "^3.0.0",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"zod": "^3.25.76"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@backstage/backend-test-utils": "1.10.
|
|
69
|
-
"@backstage/cli": "0.35.
|
|
68
|
+
"@backstage/backend-test-utils": "1.10.5-next.0",
|
|
69
|
+
"@backstage/cli": "0.35.4-next.1",
|
|
70
70
|
"@backstage/plugin-scaffolder-node-test-utils": "0.3.8-next.0"
|
|
71
71
|
}
|
|
72
72
|
}
|