@simplysf/simply-gitlab 0.1.0
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/README.md +1203 -0
- package/bin/run.js +9 -0
- package/lib/commands/gitlab/branch/create.d.ts +14 -0
- package/lib/commands/gitlab/branch/create.js +50 -0
- package/lib/commands/gitlab/branch/create.js.map +1 -0
- package/lib/commands/gitlab/branch/list.d.ts +12 -0
- package/lib/commands/gitlab/branch/list.js +45 -0
- package/lib/commands/gitlab/branch/list.js.map +1 -0
- package/lib/commands/gitlab/ci/environment/list.d.ts +14 -0
- package/lib/commands/gitlab/ci/environment/list.js +47 -0
- package/lib/commands/gitlab/ci/environment/list.js.map +1 -0
- package/lib/commands/gitlab/ci/job/list.d.ts +12 -0
- package/lib/commands/gitlab/ci/job/list.js +55 -0
- package/lib/commands/gitlab/ci/job/list.js.map +1 -0
- package/lib/commands/gitlab/ci/job/log.d.ts +12 -0
- package/lib/commands/gitlab/ci/job/log.js +54 -0
- package/lib/commands/gitlab/ci/job/log.js.map +1 -0
- package/lib/commands/gitlab/ci/variable/list.d.ts +12 -0
- package/lib/commands/gitlab/ci/variable/list.js +56 -0
- package/lib/commands/gitlab/ci/variable/list.js.map +1 -0
- package/lib/commands/gitlab/commit/create.d.ts +22 -0
- package/lib/commands/gitlab/commit/create.js +74 -0
- package/lib/commands/gitlab/commit/create.js.map +1 -0
- package/lib/commands/gitlab/commit/diff.d.ts +12 -0
- package/lib/commands/gitlab/commit/diff.js +61 -0
- package/lib/commands/gitlab/commit/diff.js.map +1 -0
- package/lib/commands/gitlab/commit/list.d.ts +17 -0
- package/lib/commands/gitlab/commit/list.js +58 -0
- package/lib/commands/gitlab/commit/list.js.map +1 -0
- package/lib/commands/gitlab/commit/view.d.ts +11 -0
- package/lib/commands/gitlab/commit/view.js +52 -0
- package/lib/commands/gitlab/commit/view.js.map +1 -0
- package/lib/commands/gitlab/file/create.d.ts +20 -0
- package/lib/commands/gitlab/file/create.js +65 -0
- package/lib/commands/gitlab/file/create.js.map +1 -0
- package/lib/commands/gitlab/file/update.d.ts +21 -0
- package/lib/commands/gitlab/file/update.js +67 -0
- package/lib/commands/gitlab/file/update.js.map +1 -0
- package/lib/commands/gitlab/file/view.d.ts +13 -0
- package/lib/commands/gitlab/file/view.js +59 -0
- package/lib/commands/gitlab/file/view.js.map +1 -0
- package/lib/commands/gitlab/mr/create.d.ts +25 -0
- package/lib/commands/gitlab/mr/create.js +77 -0
- package/lib/commands/gitlab/mr/create.js.map +1 -0
- package/lib/commands/gitlab/mr/list.d.ts +18 -0
- package/lib/commands/gitlab/mr/list.js +64 -0
- package/lib/commands/gitlab/mr/list.js.map +1 -0
- package/lib/commands/gitlab/mr/update.d.ts +25 -0
- package/lib/commands/gitlab/mr/update.js +82 -0
- package/lib/commands/gitlab/mr/update.js.map +1 -0
- package/lib/commands/gitlab/mr/view.d.ts +11 -0
- package/lib/commands/gitlab/mr/view.js +54 -0
- package/lib/commands/gitlab/mr/view.js.map +1 -0
- package/lib/commands/gitlab/project/list.d.ts +14 -0
- package/lib/commands/gitlab/project/list.js +56 -0
- package/lib/commands/gitlab/project/list.js.map +1 -0
- package/lib/commands/gitlab/project/view.d.ts +10 -0
- package/lib/commands/gitlab/project/view.js +45 -0
- package/lib/commands/gitlab/project/view.js.map +1 -0
- package/lib/commands/gitlab/release/list.d.ts +11 -0
- package/lib/commands/gitlab/release/list.js +43 -0
- package/lib/commands/gitlab/release/list.js.map +1 -0
- package/lib/commands/gitlab/search.d.ts +14 -0
- package/lib/commands/gitlab/search.js +68 -0
- package/lib/commands/gitlab/search.js.map +1 -0
- package/lib/commands/gitlab/tag/list.d.ts +14 -0
- package/lib/commands/gitlab/tag/list.js +50 -0
- package/lib/commands/gitlab/tag/list.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +22 -0
- package/lib/index.js.map +1 -0
- package/lib/shared/base-command.d.ts +91 -0
- package/lib/shared/base-command.js +242 -0
- package/lib/shared/base-command.js.map +1 -0
- package/package.json +243 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { formatTable, mergeRequestColumns } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, limitFlag, parseList, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
const DEFAULT_LIMIT = 20;
|
|
20
|
+
export default class GitlabMrList extends GitLabCommand {
|
|
21
|
+
static summary = 'List merge requests for a project.';
|
|
22
|
+
static description = 'Defaults to open merge requests, which is what a list is nearly always for; pass --state all ' +
|
|
23
|
+
'to include closed and merged ones. The IID column is the number to pass to the other mr ' +
|
|
24
|
+
'commands — it is per-project, and is not the "id" field in the JSON payload.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --state merged --target-branch main --limit 10',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --project group/project --author-username someone --json',
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...projectFlag,
|
|
32
|
+
...limitFlag(DEFAULT_LIMIT, 'merge requests'),
|
|
33
|
+
state: Flags.option({
|
|
34
|
+
summary: 'Merge request state to return.',
|
|
35
|
+
options: ['opened', 'closed', 'locked', 'merged', 'all'],
|
|
36
|
+
default: 'opened',
|
|
37
|
+
})(),
|
|
38
|
+
'source-branch': Flags.string({ summary: 'Only merge requests from this source branch.' }),
|
|
39
|
+
'target-branch': Flags.string({ summary: 'Only merge requests into this target branch.' }),
|
|
40
|
+
'author-username': Flags.string({ summary: 'Only merge requests opened by this username.' }),
|
|
41
|
+
'reviewer-username': Flags.string({ summary: 'Only merge requests this username is reviewing.' }),
|
|
42
|
+
labels: Flags.string({ summary: 'Comma-separated labels every result must carry.' }),
|
|
43
|
+
search: Flags.string({ summary: 'Match against the title and description.' }),
|
|
44
|
+
};
|
|
45
|
+
async run() {
|
|
46
|
+
const result = await this.gitlab().listMergeRequests(this.flags.project, {
|
|
47
|
+
state: this.flags.state,
|
|
48
|
+
sourceBranch: this.flags['source-branch'],
|
|
49
|
+
targetBranch: this.flags['target-branch'],
|
|
50
|
+
authorUsername: this.flags['author-username'],
|
|
51
|
+
reviewerUsername: this.flags['reviewer-username'],
|
|
52
|
+
labels: parseList(this.flags.labels),
|
|
53
|
+
search: this.flags.search,
|
|
54
|
+
}, this.flags.limit);
|
|
55
|
+
if (result.items.length === 0) {
|
|
56
|
+
this.log('No merge requests matched.');
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
this.logSafe(formatTable(result.items, mergeRequestColumns));
|
|
60
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'merge request(s)');
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/mr/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAY,MAAM,8BAA8B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ACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,iBAAiB,CAClD,IAAI,CAAC,KAAK,CAAC,OAAO,EAClB;YACE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YACzC,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC;YACzC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC;YAC7C,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC;YACjD,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACpC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;SAC1B,EACD,IAAI,CAAC,KAAK,CAAC,KAAK,CACjB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;YACvC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,KAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC;QACtE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;QAC1G,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabMrUpdate extends GitLabCommand<typeof GitlabMrUpdate> {
|
|
3
|
+
static isWrite: boolean;
|
|
4
|
+
static readonly summary = "Change an existing merge request.";
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
mr: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'target-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
state: import("@oclif/core/interfaces").OptionFlag<"close" | "reopen" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
squash: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
'remove-source-branch': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
'assignee-id': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'reviewer-id': import("@oclif/core/interfaces").OptionFlag<number[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
labels: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
'milestone-id': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
body: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
'body-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
22
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
};
|
|
24
|
+
run(): Promise<unknown>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { assertIid, buildMergeRequestUpdateBody, formatKeyValue, parseBodyInput } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, parseList, projectFlag, writeFlags } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabMrUpdate extends GitLabCommand {
|
|
20
|
+
static isWrite = true;
|
|
21
|
+
static summary = 'Change an existing merge request.';
|
|
22
|
+
static description = 'Only the attributes you name are changed, with one exception worth knowing: --labels replaces ' +
|
|
23
|
+
'the whole label set rather than adding to it.\n\n' +
|
|
24
|
+
'Naming nothing to change is refused rather than sent, because GitLab answers an empty update ' +
|
|
25
|
+
'with a cheerful 200 and an unchanged merge request. --state close and --state reopen do what ' +
|
|
26
|
+
'the buttons of those names do; neither merges anything.';
|
|
27
|
+
static examples = [
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --project group/project --mr 42 --title "feat: renamed"',
|
|
29
|
+
'<%= config.bin %> <%= command.id %> --project group/project --mr 42 --state close',
|
|
30
|
+
'<%= config.bin %> <%= command.id %> --project group/project --mr 42 --labels backend,urgent --dry-run',
|
|
31
|
+
];
|
|
32
|
+
static flags = {
|
|
33
|
+
...projectFlag,
|
|
34
|
+
...writeFlags,
|
|
35
|
+
mr: Flags.integer({ summary: 'Merge request iid.', required: true }),
|
|
36
|
+
title: Flags.string({ summary: 'New title.' }),
|
|
37
|
+
description: Flags.string({ summary: 'New description, as Markdown.' }),
|
|
38
|
+
'target-branch': Flags.string({ summary: 'New target branch.' }),
|
|
39
|
+
state: Flags.option({
|
|
40
|
+
summary: 'Close or reopen the merge request.',
|
|
41
|
+
options: ['close', 'reopen'],
|
|
42
|
+
})(),
|
|
43
|
+
squash: Flags.boolean({ summary: 'Squash the commits when it merges.', allowNo: true }),
|
|
44
|
+
'remove-source-branch': Flags.boolean({ summary: 'Delete the source branch on merge.', allowNo: true }),
|
|
45
|
+
'assignee-id': Flags.integer({ summary: 'User id to assign, replacing the set. Repeatable.', multiple: true }),
|
|
46
|
+
'reviewer-id': Flags.integer({ summary: 'User id to review, replacing the set. Repeatable.', multiple: true }),
|
|
47
|
+
labels: Flags.string({ summary: 'Comma-separated labels, replacing the existing set.' }),
|
|
48
|
+
'milestone-id': Flags.integer({ summary: 'Milestone id to attach.' }),
|
|
49
|
+
body: Flags.string({ summary: 'Raw JSON request body.', exclusive: ['body-file'] }),
|
|
50
|
+
'body-file': Flags.string({ summary: 'Path to a file holding the raw JSON request body.' }),
|
|
51
|
+
};
|
|
52
|
+
async run() {
|
|
53
|
+
const iid = assertIid(this.flags.mr);
|
|
54
|
+
const request = buildMergeRequestUpdateBody({
|
|
55
|
+
title: this.flags.title,
|
|
56
|
+
description: this.flags.description,
|
|
57
|
+
targetBranch: this.flags['target-branch'],
|
|
58
|
+
stateEvent: this.flags.state,
|
|
59
|
+
squash: this.flags.squash,
|
|
60
|
+
removeSourceBranch: this.flags['remove-source-branch'],
|
|
61
|
+
assigneeIds: this.flags['assignee-id'],
|
|
62
|
+
reviewerIds: this.flags['reviewer-id'],
|
|
63
|
+
labels: parseList(this.flags.labels),
|
|
64
|
+
milestoneId: this.flags['milestone-id'],
|
|
65
|
+
body: parseBodyInput(this.flags.body, this.flags['body-file']),
|
|
66
|
+
});
|
|
67
|
+
if (this.flags['dry-run']) {
|
|
68
|
+
this.log('Dry run — not sent. Request body:');
|
|
69
|
+
this.logSafe(JSON.stringify(request, null, 2));
|
|
70
|
+
return request;
|
|
71
|
+
}
|
|
72
|
+
const updated = (await this.gitlab().updateMergeRequest(this.flags.project, iid, request));
|
|
73
|
+
this.logSafe(formatKeyValue([
|
|
74
|
+
['Updated', `!${updated.iid ?? iid}`],
|
|
75
|
+
['Title', updated.title],
|
|
76
|
+
['State', updated.state],
|
|
77
|
+
['URL', updated.web_url],
|
|
78
|
+
]));
|
|
79
|
+
return updated;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/mr/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,2BAA2B,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AASpG,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,aAAoC;IACvE,MAAM,CAAU,OAAO,GAAG,IAAI,CAAC;IAE/B,MAAM,CAAmB,OAAO,GAAG,mCAAmC,CAAC;IACvE,MAAM,CAAmB,WAAW,GACzC,gGAAgG;QAChG,mDAAmD;QACnD,+FAA+F;QAC/F,+FAA+F;QAC/F,yDAAyD,CAAC;IAErD,MAAM,CAAmB,QAAQ,GAAG;QACzC,6FAA6F;QAC7F,mFAAmF;QACnF,uGAAuG;KACxG,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,UAAU;QACb,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,oBAAoB,E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b,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;YACrC,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;YACxB,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;YACxB,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC;SACzB,CAAC,CACH,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabMrView extends GitLabCommand<typeof GitlabMrView> {
|
|
3
|
+
static readonly summary = "Show one merge request.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
mr: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { assertIid, formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabMrView extends GitLabCommand {
|
|
20
|
+
static summary = 'Show one merge request.';
|
|
21
|
+
static description = 'Takes the project-scoped iid — the number in the merge request URL — not the instance-wide ' +
|
|
22
|
+
'id. Use --json for the full payload, which carries the pipeline status, approvals, and diff ' +
|
|
23
|
+
'refs the summary below leaves out.';
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> <%= command.id %> --project group/project --mr 42',
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --mr 42 --json',
|
|
27
|
+
];
|
|
28
|
+
static flags = {
|
|
29
|
+
...projectFlag,
|
|
30
|
+
mr: Flags.integer({ summary: 'Merge request iid.', required: true }),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const iid = assertIid(this.flags.mr);
|
|
34
|
+
const mr = (await this.gitlab().getMergeRequest(this.flags.project, iid));
|
|
35
|
+
this.logSafe(formatKeyValue([
|
|
36
|
+
['Merge request', `!${mr.iid ?? iid}`],
|
|
37
|
+
['Title', mr.title],
|
|
38
|
+
['State', mr.draft === true ? `${mr.state ?? 'opened'} (draft)` : mr.state],
|
|
39
|
+
['Branches', `${mr.source_branch ?? '?'} -> ${mr.target_branch ?? '?'}`],
|
|
40
|
+
['Author', mr.author?.username],
|
|
41
|
+
['Merge status', mr.detailed_merge_status ?? mr.merge_status],
|
|
42
|
+
['Conflicts', mr.has_conflicts === true ? 'yes' : undefined],
|
|
43
|
+
['Labels', mr.labels?.join(', ')],
|
|
44
|
+
['Updated', mr.updated_at],
|
|
45
|
+
['URL', mr.web_url],
|
|
46
|
+
]));
|
|
47
|
+
if (typeof mr.description === 'string' && mr.description.trim() !== '') {
|
|
48
|
+
this.log('');
|
|
49
|
+
this.logSafe(mr.description.trimEnd());
|
|
50
|
+
}
|
|
51
|
+
return mr;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|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,EAAE,CAAC,KAAK,IAAI,QAAQ,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;YAC3E,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,aAAa,IAAI,GAAG,OAAO,EAAE,CAAC,aAAa,IAAI,GAAG,EAAE,CAAC;YACxE,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;YAC/B,CAAC,cAAc,EAAE,EAAE,CAAC,qBAAqB,IAAI,EAAE,CAAC,YAAY,CAAC;YAC7D,CAAC,WAAW,EAAE,EAAE,CAAC,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5D,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACjC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC;YAC1B,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC;SACpB,CAAC,CACH,CAAC;QACF,IAAI,OAAO,EAAE,CAAC,WAAW,KAAK,QAAQ,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACvE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabProjectList extends GitLabCommand<typeof GitlabProjectList> {
|
|
3
|
+
static readonly summary = "List projects you can see.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
membership: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
owned: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
simple: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { formatTable, projectColumns } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, limitFlag } from '../../../shared/base-command.js';
|
|
19
|
+
const DEFAULT_LIMIT = 20;
|
|
20
|
+
export default class GitlabProjectList extends GitLabCommand {
|
|
21
|
+
static summary = 'List projects you can see.';
|
|
22
|
+
static description = 'Without --search this lists every project the token can reach, newest activity first, which ' +
|
|
23
|
+
'on a large instance is not a useful answer — narrow it with --search or --membership. Use ' +
|
|
24
|
+
'--simple for a much smaller payload when you only need ids and paths.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --membership',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --search platform --limit 10',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --search platform --simple --json',
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...limitFlag(DEFAULT_LIMIT, 'projects'),
|
|
32
|
+
search: Flags.string({ summary: 'Match against the project name and path.' }),
|
|
33
|
+
membership: Flags.boolean({ summary: 'Only projects you are a member of.', default: false }),
|
|
34
|
+
owned: Flags.boolean({ summary: 'Only projects you own.', default: false }),
|
|
35
|
+
simple: Flags.boolean({
|
|
36
|
+
summary: 'Return only the core fields, for a much smaller payload.',
|
|
37
|
+
default: false,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const result = await this.gitlab().listProjects({
|
|
42
|
+
search: this.flags.search,
|
|
43
|
+
membership: this.flags.membership || undefined,
|
|
44
|
+
owned: this.flags.owned || undefined,
|
|
45
|
+
simple: this.flags.simple || undefined,
|
|
46
|
+
}, this.flags.limit);
|
|
47
|
+
if (result.items.length === 0) {
|
|
48
|
+
this.log('No projects matched.');
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
this.log(formatTable(result.items, projectColumns));
|
|
52
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'project(s)');
|
|
53
|
+
return result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/project/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAY,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE3E,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,aAAuC;IAC7E,MAAM,CAAmB,OAAO,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C,WAAW,CAAC,MAAM,CAAC,KAAc,EAAE,cAAc,CAAC,CAAC,CAAC;QAC7D,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACpG,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabProjectView extends GitLabCommand<typeof GitlabProjectView> {
|
|
3
|
+
static readonly summary = "Show one project.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<unknown>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
17
|
+
import { GitLabCommand, projectFlag } from '../../../shared/base-command.js';
|
|
18
|
+
export default class GitlabProjectView extends GitLabCommand {
|
|
19
|
+
static summary = 'Show one project.';
|
|
20
|
+
static description = 'Accepts either the numeric id or the full path. Use --json for the complete, unmodified API ' +
|
|
21
|
+
'payload, which carries far more than the summary below — permissions, statistics, and every ' +
|
|
22
|
+
'feature toggle on the project.';
|
|
23
|
+
static examples = [
|
|
24
|
+
'<%= config.bin %> <%= command.id %> --project group/project',
|
|
25
|
+
'<%= config.bin %> <%= command.id %> --project 1234 --json',
|
|
26
|
+
];
|
|
27
|
+
static flags = { ...projectFlag };
|
|
28
|
+
async run() {
|
|
29
|
+
const project = (await this.gitlab().getProject(this.flags.project));
|
|
30
|
+
this.logSafe(formatKeyValue([
|
|
31
|
+
['Project', project.path_with_namespace],
|
|
32
|
+
['ID', project.id],
|
|
33
|
+
['Description', project.description],
|
|
34
|
+
['Visibility', project.visibility],
|
|
35
|
+
['Default branch', project.default_branch],
|
|
36
|
+
['Open issues', project.open_issues_count],
|
|
37
|
+
['Stars', project.star_count],
|
|
38
|
+
['Forks', project.forks_count],
|
|
39
|
+
['Last activity', project.last_activity_at],
|
|
40
|
+
['URL', project.web_url],
|
|
41
|
+
]));
|
|
42
|
+
return project;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/project/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAe7E,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,aAAuC;IAC7E,MAAM,CAAmB,OAAO,GAAG,mBAAmB,CAAC;IACvD,MAAM,CAAmB,WAAW,GACzC,8FAA8F;QAC9F,8FAA8F;QAC9F,gCAAgC,CAAC;IAE5B,MAAM,CAAmB,QAAQ,GAAG;QACzC,6DAA6D;QAC7D,2DAA2D;KAC5D,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC;IAEpD,KAAK,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAY,CAAC;QAEhF,IAAI,CAAC,OAAO,CACV,cAAc,CAAC;YACb,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC;YACxC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;YAClB,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC;YACpC,CAAC,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC;YAClC,CAAC,gBAAgB,EAAE,OAAO,CAAC,cAAc,CAAC;YAC1C,CAAC,aAAa,EAAE,OAAO,CAAC,iBAAiB,CAAC;YAC1C,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC;YAC7B,CAAC,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC;YAC9B,CAAC,eAAe,EAAE,OAAO,CAAC,gBAAgB,CAAC;YAC3C,CAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC;SACzB,CAAC,CACH,CAAC;QAEF,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabReleaseList extends GitLabCommand<typeof GitlabReleaseList> {
|
|
3
|
+
static readonly summary = "List releases for a project.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { formatTable, releaseColumns } from '@simplysf/simply-gitlab-core';
|
|
17
|
+
import { GitLabCommand, limitFlag, projectFlag } from '../../../shared/base-command.js';
|
|
18
|
+
const DEFAULT_LIMIT = 20;
|
|
19
|
+
export default class GitlabReleaseList extends GitLabCommand {
|
|
20
|
+
static summary = 'List releases for a project.';
|
|
21
|
+
static description = 'Releases are tags with notes and assets attached, so a project can have many tags and no ' +
|
|
22
|
+
'releases at all. Use --json for the release notes, asset links, and the commit each release ' +
|
|
23
|
+
'points at.';
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> <%= command.id %> --project group/project',
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --limit 5 --json',
|
|
27
|
+
];
|
|
28
|
+
static flags = {
|
|
29
|
+
...projectFlag,
|
|
30
|
+
...limitFlag(DEFAULT_LIMIT, 'releases'),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const result = await this.gitlab().listReleases(this.flags.project, this.flags.limit);
|
|
34
|
+
if (result.items.length === 0) {
|
|
35
|
+
this.log('No releases found.');
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
this.logSafe(formatTable(result.items, releaseColumns));
|
|
39
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'release(s)');
|
|
40
|
+
return result;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/release/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,cAAc,EAAY,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAExF,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,aAAuC;IAC7E,MAAM,CAAmB,OAAO,GAAG,8BAA8B,CAAC;IAClE,MAAM,CAAmB,WAAW,GACzC,2FAA2F;QAC3F,8FAA8F;QAC9F,YAAY,CAAC;IAER,MAAM,CAAmB,QAAQ,GAAG;QACzC,6DAA6D;QAC7D,8EAA8E;KAC/E,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC;KACxC,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAEtF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAC/B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,KAAc,EAAE,cAAc,CAAC,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACpG,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../shared/base-command.js';
|
|
2
|
+
export default class GitlabSearch extends GitLabCommand<typeof GitlabSearch> {
|
|
3
|
+
static readonly summary = "Search GitLab.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
scope: import("@oclif/core/interfaces").OptionFlag<"projects" | "issues" | "merge_requests" | "milestones" | "wiki_blobs" | "commits" | "blobs" | "notes" | "users" | "snippet_titles", import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
query: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
group: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { formatTable, needsAdvancedSearch, searchColumns, } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, limitFlag } from '../../shared/base-command.js';
|
|
19
|
+
const DEFAULT_LIMIT = 20;
|
|
20
|
+
const SCOPES = [
|
|
21
|
+
'projects',
|
|
22
|
+
'issues',
|
|
23
|
+
'merge_requests',
|
|
24
|
+
'milestones',
|
|
25
|
+
'wiki_blobs',
|
|
26
|
+
'commits',
|
|
27
|
+
'blobs',
|
|
28
|
+
'notes',
|
|
29
|
+
'users',
|
|
30
|
+
'snippet_titles',
|
|
31
|
+
];
|
|
32
|
+
export default class GitlabSearch extends GitLabCommand {
|
|
33
|
+
static summary = 'Search GitLab.';
|
|
34
|
+
static description = 'Searches the whole instance by default, or one project with --project, or one group with ' +
|
|
35
|
+
'--group. These are three different GitLab endpoints, and they do not accept the same scopes: ' +
|
|
36
|
+
'projects and users are instance-wide only, while a project search can look at notes.\n\n' +
|
|
37
|
+
'The blobs, commits, wiki_blobs, notes, and snippet_titles scopes need Advanced Search ' +
|
|
38
|
+
'(Elasticsearch) enabled on the instance. Where it is not, GitLab answers with an empty list ' +
|
|
39
|
+
'and a 200 rather than an error, so an empty result for one of those scopes is reported here ' +
|
|
40
|
+
'as possibly meaning "not enabled" rather than "no matches".';
|
|
41
|
+
static examples = [
|
|
42
|
+
'<%= config.bin %> <%= command.id %> --scope projects --query platform',
|
|
43
|
+
'<%= config.bin %> <%= command.id %> --scope blobs --query UMCN_Account --project group/project',
|
|
44
|
+
'<%= config.bin %> <%= command.id %> --scope merge_requests --query "flaky test" --group my-group --json',
|
|
45
|
+
];
|
|
46
|
+
static flags = {
|
|
47
|
+
...limitFlag(DEFAULT_LIMIT, 'results'),
|
|
48
|
+
scope: Flags.option({ summary: 'What to search.', options: SCOPES, required: true })(),
|
|
49
|
+
query: Flags.string({ summary: 'The search term.', required: true }),
|
|
50
|
+
project: Flags.string({ summary: 'Search within this project id or path.', exclusive: ['group'] }),
|
|
51
|
+
group: Flags.string({ summary: 'Search within this group id or path.' }),
|
|
52
|
+
};
|
|
53
|
+
async run() {
|
|
54
|
+
const scope = this.flags.scope;
|
|
55
|
+
const result = await this.gitlab().search({ scope, search: this.flags.query, project: this.flags.project, group: this.flags.group }, this.flags.limit);
|
|
56
|
+
if (result.items.length === 0) {
|
|
57
|
+
const caveat = needsAdvancedSearch(scope)
|
|
58
|
+
? ` The ${scope} scope needs Advanced Search on the instance; without it GitLab returns an empty list rather than an error.`
|
|
59
|
+
: '';
|
|
60
|
+
this.log(`No results.${caveat}`);
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
this.logSafe(formatTable(result.items, searchColumns(scope)));
|
|
64
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'result(s)');
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/gitlab/search.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,aAAa,GAGd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,MAAM,GAAG;IACb,UAAU;IACV,QAAQ;IACR,gBAAgB;IAChB,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;IACP,gBAAgB;C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;QAEF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,MAAM,GAAG,mBAAmB,CAAC,KAAK,CAAC;gBACvC,CAAC,CAAC,QAAQ,KAAK,6GAA6G;gBAC5H,CAAC,CAAC,EAAE,CAAC;YACP,IAAI,CAAC,GAAG,CAAC,cAAc,MAAM,EAAE,CAAC,CAAC;YACjC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,KAAc,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QACnG,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabTagList extends GitLabCommand<typeof GitlabTagList> {
|
|
3
|
+
static readonly summary = "List repository tags.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'order-by': import("@oclif/core/interfaces").OptionFlag<"name" | "updated" | "version" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
sort: import("@oclif/core/interfaces").OptionFlag<"asc" | "desc" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
11
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<unknown>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Flags } from '@oclif/core';
|
|
17
|
+
import { formatTable, tagColumns } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, limitFlag, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
const DEFAULT_LIMIT = 20;
|
|
20
|
+
export default class GitlabTagList extends GitLabCommand {
|
|
21
|
+
static summary = 'List repository tags.';
|
|
22
|
+
static description = 'Tags come back newest first by the commit date they point at. That is the commit date, not ' +
|
|
23
|
+
'the tag creation date, so a tag cut today on an old commit sorts by the old commit — use ' +
|
|
24
|
+
'--order-by name if you need a deterministic order instead.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --search v1. --limit 50',
|
|
28
|
+
];
|
|
29
|
+
static flags = {
|
|
30
|
+
...projectFlag,
|
|
31
|
+
...limitFlag(DEFAULT_LIMIT, 'tags'),
|
|
32
|
+
search: Flags.string({ summary: 'Return only tags whose name contains this term.' }),
|
|
33
|
+
'order-by': Flags.option({
|
|
34
|
+
summary: 'Field to sort by.',
|
|
35
|
+
options: ['name', 'updated', 'version'],
|
|
36
|
+
})(),
|
|
37
|
+
sort: Flags.option({ summary: 'Sort direction.', options: ['asc', 'desc'] })(),
|
|
38
|
+
};
|
|
39
|
+
async run() {
|
|
40
|
+
const result = await this.gitlab().listTags(this.flags.project, { search: this.flags.search, orderBy: this.flags['order-by'], sort: this.flags.sort }, this.flags.limit);
|
|
41
|
+
if (result.items.length === 0) {
|
|
42
|
+
this.log('No tags matched.');
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
this.logSafe(formatTable(result.items, tagColumns));
|
|
46
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'tag(s)');
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/tag/list.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAY,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAExF,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,aAAmC;IACrE,MAAM,CAAmB,OAAO,GAAG,uBAAuB,CAAC;IAC3D,MAAM,CAAmB,WAAW,GACzC,6FAA6F;QAC7F,2FAA2F;QAC3F,4DAA4D,CAAC;IAExD,MAAM,CAAmB,QAAQ,GAAG;QACzC,6DAA6D;QAC7D,qFAAqF;KACtF,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;QACnC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,iDAAiD,EAAE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