@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 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/commit/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAW7E,4EAA4E;AAC5E,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,qGAAqG;AACrG,SAAS,OAAO,CAAC,KAAgB;IAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC;IACvC,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,IAAI,OAAO,CAAC;IACrC,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI;QAAE,OAAO,WAAW,IAAI,EAAE,CAAC;IAC1D,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI;QAAE,OAAO,SAAS,EAAE,EAAE,CAAC;IAClD,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI;QAAE,OAAO,WAAW,IAAI,OAAO,EAAE,EAAE,CAAC;IACnE,OAAO,YAAY,EAAE,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAsC;IAC3E,MAAM,CAAmB,OAAO,GAAG,iCAAiC,CAAC;IACrE,MAAM,CAAmB,WAAW,GACzC,8FAA8F;QAC9F,iGAAiG;QACjG,uCAAuC,CAAC;IAEnC,MAAM,CAAmB,QAAQ,GAAG;QACzC,2EAA2E;QAC3E,kFAAkF;KACnF,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC7F,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,oDAAoD,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;KACvG,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC;QAEvG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpD,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;YAC1C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;YAC7B,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;gBAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC7F,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,mBAAmB,CAAC,CAAC;QACjD,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabCommitList extends GitLabCommand<typeof GitlabCommitList> {
|
|
3
|
+
static readonly summary = "List repository commits.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
ref: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
path: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
since: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
until: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
author: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
stats: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
14
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<unknown>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { commitColumns, formatTable } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, limitFlag, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
const DEFAULT_LIMIT = 20;
|
|
20
|
+
export default class GitlabCommitList extends GitLabCommand {
|
|
21
|
+
static summary = 'List repository commits.';
|
|
22
|
+
static description = 'Walks the history of a ref, newest first. --path narrows to commits that touched one file ' +
|
|
23
|
+
'or directory, which is the fastest way to answer "when did this change and who changed it".\n\n' +
|
|
24
|
+
'--since and --until take ISO 8601 timestamps (2026-01-31T00:00:00Z); a bare date works too.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --ref main --limit 10',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path src/index.ts',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --project group/project --since 2026-01-01 --until 2026-02-01',
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...projectFlag,
|
|
32
|
+
...limitFlag(DEFAULT_LIMIT, 'commits'),
|
|
33
|
+
ref: Flags.string({ summary: 'Branch, tag, or SHA to list from. Defaults to the default branch.' }),
|
|
34
|
+
path: Flags.string({ summary: 'Only commits that touched this file or directory.' }),
|
|
35
|
+
since: Flags.string({ summary: 'Only commits on or after this ISO 8601 timestamp.' }),
|
|
36
|
+
until: Flags.string({ summary: 'Only commits on or before this ISO 8601 timestamp.' }),
|
|
37
|
+
author: Flags.string({ summary: 'Only commits by this author name or email.' }),
|
|
38
|
+
stats: Flags.boolean({ summary: 'Include per-commit line counts in the JSON payload.', default: false }),
|
|
39
|
+
};
|
|
40
|
+
async run() {
|
|
41
|
+
const result = await this.gitlab().listCommits(this.flags.project, {
|
|
42
|
+
ref: this.flags.ref,
|
|
43
|
+
path: this.flags.path,
|
|
44
|
+
since: this.flags.since,
|
|
45
|
+
until: this.flags.until,
|
|
46
|
+
author: this.flags.author,
|
|
47
|
+
withStats: this.flags.stats || undefined,
|
|
48
|
+
}, this.flags.limit);
|
|
49
|
+
if (result.items.length === 0) {
|
|
50
|
+
this.log('No commits matched.');
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
this.logSafe(formatTable(result.items, commitColumns));
|
|
54
|
+
this.reportList(result.items.length, result.total, result.complete, this.flags.limit, 'commit(s)');
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
}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E,OAAO,EAAE,KAAK,EAAE,CAAC;KACzG,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,CAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,EAClB;YACE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;YACnB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;YACzB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS;SACzC,EACD,IAAI,CAAC,KAAK,CAAC,KAAK,CACjB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;YAChC,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,KAAc,EAAE,aAAa,CAAC,CAAC,CAAC;QAChE,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,11 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabCommitView extends GitLabCommand<typeof GitlabCommitView> {
|
|
3
|
+
static readonly summary = "Show one commit.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
sha: import("@oclif/core/interfaces").OptionFlag<string, 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,52 @@
|
|
|
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 { formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabCommitView extends GitLabCommand {
|
|
20
|
+
static summary = 'Show one commit.';
|
|
21
|
+
static description = 'Accepts a full or short SHA, or the name of a branch or tag — in which case the commit at ' +
|
|
22
|
+
'its tip is shown, so the answer changes as the branch moves. Use commit diff for the changes ' +
|
|
23
|
+
'themselves.';
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> <%= command.id %> --project group/project --sha 9a1b2c3',
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --sha main --json',
|
|
27
|
+
];
|
|
28
|
+
static flags = {
|
|
29
|
+
...projectFlag,
|
|
30
|
+
sha: Flags.string({ summary: 'Commit SHA, or the name of a branch or tag.', required: true }),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const commit = (await this.gitlab().getCommit(this.flags.project, this.flags.sha));
|
|
34
|
+
this.logSafe(formatKeyValue([
|
|
35
|
+
['Commit', commit.id],
|
|
36
|
+
['Author', commit.author_name],
|
|
37
|
+
['Date', commit.created_at],
|
|
38
|
+
['Parents', commit.parent_ids?.join(', ')],
|
|
39
|
+
[
|
|
40
|
+
'Changes',
|
|
41
|
+
commit.stats === undefined ? undefined : `+${commit.stats.additions ?? 0} -${commit.stats.deletions ?? 0}`,
|
|
42
|
+
],
|
|
43
|
+
['URL', commit.web_url],
|
|
44
|
+
]));
|
|
45
|
+
if (typeof commit.message === 'string') {
|
|
46
|
+
this.log('');
|
|
47
|
+
this.logSafe(commit.message.trimEnd());
|
|
48
|
+
}
|
|
49
|
+
return commit;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/commit/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAe7E,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAsC;IAC3E,MAAM,CAAmB,OAAO,GAAG,kBAAkB,CAAC;IACtD,MAAM,CAAmB,WAAW,GACzC,4FAA4F;QAC5F,+FAA+F;QAC/F,aAAa,CAAC;IAET,MAAM,CAAmB,QAAQ,GAAG;QACzC,2EAA2E;QAC3E,+EAA+E;KAChF,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC9F,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,MAAM,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAW,CAAC;QAE7F,IAAI,CAAC,OAAO,CACV,cAAc,CAAC;YACb,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;YACrB,CAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC;YAC9B,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC;YAC3B,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1C;gBACE,SAAS;gBACT,MAAM,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,MAAM,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,EAAE;aAC3G;YACD,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC;SACxB,CAAC,CACH,CAAC;QACF,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YACvC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACb,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabFileCreate extends GitLabCommand<typeof GitlabFileCreate> {
|
|
3
|
+
static isWrite: boolean;
|
|
4
|
+
static readonly summary = "Create a file in a repository.";
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
path: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
content: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'content-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
message: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'start-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'author-email': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'author-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<unknown>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { buildFileWrite, formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, projectFlag, writeFlags } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabFileCreate extends GitLabCommand {
|
|
20
|
+
static isWrite = true;
|
|
21
|
+
static summary = 'Create a file in a repository.';
|
|
22
|
+
static description = 'Commits one new file to a branch. GitLab refuses the request if the file already exists — ' +
|
|
23
|
+
'use file update for that — and refuses it if the branch is protected and the token lacks ' +
|
|
24
|
+
'the role to push to it. Use --dry-run to see exactly what would be sent.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path docs/new.md --branch main --content-file ./new.md --message "docs: add page"',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path src/config.json --branch feature --content-file ./config.json --message "feat: add config" --dry-run',
|
|
28
|
+
];
|
|
29
|
+
static flags = {
|
|
30
|
+
...projectFlag,
|
|
31
|
+
...writeFlags,
|
|
32
|
+
path: Flags.string({ summary: 'Path the file will have in the repository.', required: true }),
|
|
33
|
+
branch: Flags.string({ summary: 'Branch to commit to.', required: true }),
|
|
34
|
+
content: Flags.string({ summary: 'File contents.', exclusive: ['content-file'] }),
|
|
35
|
+
'content-file': Flags.string({ summary: 'Path to a local file holding the contents.' }),
|
|
36
|
+
message: Flags.string({ summary: 'Commit message.', required: true }),
|
|
37
|
+
'start-branch': Flags.string({ summary: 'Branch to create --branch from, if it does not exist.' }),
|
|
38
|
+
'author-email': Flags.string({ summary: 'Commit author email.' }),
|
|
39
|
+
'author-name': Flags.string({ summary: 'Commit author name.' }),
|
|
40
|
+
};
|
|
41
|
+
async run() {
|
|
42
|
+
const input = buildFileWrite({
|
|
43
|
+
branch: this.flags.branch,
|
|
44
|
+
content: this.flags.content,
|
|
45
|
+
contentFile: this.flags['content-file'],
|
|
46
|
+
message: this.flags.message,
|
|
47
|
+
startBranch: this.flags['start-branch'],
|
|
48
|
+
authorEmail: this.flags['author-email'],
|
|
49
|
+
authorName: this.flags['author-name'],
|
|
50
|
+
});
|
|
51
|
+
const request = { file_path: this.flags.path, ...input };
|
|
52
|
+
if (this.flags['dry-run']) {
|
|
53
|
+
this.log('Dry run — not sent. Request body:');
|
|
54
|
+
this.logSafe(JSON.stringify(request, null, 2));
|
|
55
|
+
return request;
|
|
56
|
+
}
|
|
57
|
+
const created = (await this.gitlab().createFile(this.flags.project, this.flags.path, input));
|
|
58
|
+
this.logSafe(formatKeyValue([
|
|
59
|
+
['Created', created.file_path ?? this.flags.path],
|
|
60
|
+
['Branch', created.branch ?? this.flags.branch],
|
|
61
|
+
]));
|
|
62
|
+
return created;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/file/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAOzF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAsC;IAC3E,MAAM,CAAU,OAAO,GAAG,IAAI,CAAC;IAE/B,MAAM,CAAmB,OAAO,GAAG,gCAAgC,CAAC;IACpE,MAAM,CAAmB,WAAW,GACzC,4FAA4F;QAC5F,2FAA2F;QAC3F,0EAA0E,CAAC;IAEtE,MAAM,CAAmB,QAAQ,GAAG;QACzC,iJAAiJ;QACjJ,yKAAyK;KAC1K,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,G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OAAO,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;QAEzD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAoB,CAAC;QAChH,IAAI,CAAC,OAAO,CACV,cAAc,CAAC;YACb,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACjD,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;SAChD,CAAC,CACH,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabFileUpdate extends GitLabCommand<typeof GitlabFileUpdate> {
|
|
3
|
+
static isWrite: boolean;
|
|
4
|
+
static readonly summary = "Replace a file in a repository.";
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
path: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
content: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'content-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
message: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'start-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
'last-commit-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'author-email': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
'author-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
};
|
|
20
|
+
run(): Promise<unknown>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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 { buildFileWrite, formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, projectFlag, writeFlags } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabFileUpdate extends GitLabCommand {
|
|
20
|
+
static isWrite = true;
|
|
21
|
+
static summary = 'Replace a file in a repository.';
|
|
22
|
+
static description = 'Commits new contents over an existing file. The whole file is replaced; there is no partial ' +
|
|
23
|
+
'edit. Pass --last-commit-id with the value file view reported to have GitLab reject the ' +
|
|
24
|
+
'write if someone else changed the file meanwhile, instead of silently overwriting them.';
|
|
25
|
+
static examples = [
|
|
26
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path README.md --branch main --content-file ./README.md --message "docs: refresh readme"',
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path README.md --branch main --content-file ./README.md --message "docs: refresh" --last-commit-id 9a1b2c3',
|
|
28
|
+
];
|
|
29
|
+
static flags = {
|
|
30
|
+
...projectFlag,
|
|
31
|
+
...writeFlags,
|
|
32
|
+
path: Flags.string({ summary: 'Path to the file within the repository.', required: true }),
|
|
33
|
+
branch: Flags.string({ summary: 'Branch to commit to.', required: true }),
|
|
34
|
+
content: Flags.string({ summary: 'New file contents.', exclusive: ['content-file'] }),
|
|
35
|
+
'content-file': Flags.string({ summary: 'Path to a local file holding the new contents.' }),
|
|
36
|
+
message: Flags.string({ summary: 'Commit message.', required: true }),
|
|
37
|
+
'start-branch': Flags.string({ summary: 'Branch to create --branch from, if it does not exist.' }),
|
|
38
|
+
'last-commit-id': Flags.string({ summary: 'Reject the write if the file changed since this commit.' }),
|
|
39
|
+
'author-email': Flags.string({ summary: 'Commit author email.' }),
|
|
40
|
+
'author-name': Flags.string({ summary: 'Commit author name.' }),
|
|
41
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
const input = buildFileWrite({
|
|
44
|
+
branch: this.flags.branch,
|
|
45
|
+
content: this.flags.content,
|
|
46
|
+
contentFile: this.flags['content-file'],
|
|
47
|
+
message: this.flags.message,
|
|
48
|
+
startBranch: this.flags['start-branch'],
|
|
49
|
+
lastCommitId: this.flags['last-commit-id'],
|
|
50
|
+
authorEmail: this.flags['author-email'],
|
|
51
|
+
authorName: this.flags['author-name'],
|
|
52
|
+
});
|
|
53
|
+
const request = { file_path: this.flags.path, ...input };
|
|
54
|
+
if (this.flags['dry-run']) {
|
|
55
|
+
this.log('Dry run — not sent. Request body:');
|
|
56
|
+
this.logSafe(JSON.stringify(request, null, 2));
|
|
57
|
+
return request;
|
|
58
|
+
}
|
|
59
|
+
const updated = (await this.gitlab().updateFile(this.flags.project, this.flags.path, input));
|
|
60
|
+
this.logSafe(formatKeyValue([
|
|
61
|
+
['Updated', updated.file_path ?? this.flags.path],
|
|
62
|
+
['Branch', updated.branch ?? this.flags.branch],
|
|
63
|
+
]));
|
|
64
|
+
return updated;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/file/update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAOzF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,aAAsC;IAC3E,MAAM,CAAU,OAAO,GAAG,IAAI,CAAC;IAE/B,MAAM,CAAmB,OAAO,GAAG,iCAAiC,CAAC;IACrE,MAAM,CAAmB,WAAW,GACzC,8FAA8F;QAC9F,0FAA0F;QAC1F,yFAAyF,CAAC;IAErF,MAAM,CAAmB,QAAQ,GAAG;QACzC,wJAAwJ;QACxJ,0KAA0K;KAC3K,CAAC;IAEK,MAAM,CAAmB,KAAK,GAAG;QACtC,GAAG,WAAW;QACd,GAAG,UAAU;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WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;YACvC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;SACtC,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;QAEzD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAoB,CAAC;QAChH,IAAI,CAAC,OAAO,CACV,cAAc,CAAC;YACb,CAAC,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACjD,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;SAChD,CAAC,CACH,CAAC;QACF,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabFileView extends GitLabCommand<typeof GitlabFileView> {
|
|
3
|
+
static readonly summary = "Print a file from a repository.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
path: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
ref: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
raw: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { decodeFileContent, formatKeyValue } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, projectFlag } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabFileView extends GitLabCommand {
|
|
20
|
+
static summary = 'Print a file from a repository.';
|
|
21
|
+
static description = 'Reads one file at a ref and writes its decoded contents to stdout, under a short metadata ' +
|
|
22
|
+
'header. Use --raw for the contents alone, or --json for the API payload, whose "content" is ' +
|
|
23
|
+
'base64 exactly as GitLab sends it.\n\n' +
|
|
24
|
+
'A binary file is not printed: its bytes would emit escape sequences to a terminal and noise ' +
|
|
25
|
+
'to whatever reads this stream. The metadata still is, so you can see what was found.';
|
|
26
|
+
static examples = [
|
|
27
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path src/index.ts --ref main',
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --project group/project --path README.md --ref v1.2.0 --raw',
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...projectFlag,
|
|
32
|
+
path: Flags.string({ summary: 'Path to the file within the repository.', required: true }),
|
|
33
|
+
ref: Flags.string({ summary: 'Branch, tag, or commit SHA to read from.', required: true }),
|
|
34
|
+
raw: Flags.boolean({ summary: 'Print only the file contents, with no metadata header.', default: false }),
|
|
35
|
+
};
|
|
36
|
+
async run() {
|
|
37
|
+
const payload = (await this.gitlab().getFile(this.flags.project, this.flags.path, {
|
|
38
|
+
ref: this.flags.ref,
|
|
39
|
+
}));
|
|
40
|
+
const decoded = decodeFileContent(payload);
|
|
41
|
+
if (!this.flags.raw) {
|
|
42
|
+
this.logSafe(formatKeyValue([
|
|
43
|
+
['File', payload.file_path],
|
|
44
|
+
['Ref', payload.ref],
|
|
45
|
+
['Size', decoded.bytes],
|
|
46
|
+
['Last commit', payload.last_commit_id],
|
|
47
|
+
]));
|
|
48
|
+
this.log('');
|
|
49
|
+
}
|
|
50
|
+
if (decoded.printable) {
|
|
51
|
+
this.logSafe(decoded.text);
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
this.log(`(${decoded.bytes} bytes of binary content, not printed)`);
|
|
55
|
+
}
|
|
56
|
+
return payload;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/file/view.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAoB,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE7E,MAAM,CAAC,OAAO,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CAAC;aACxC,CAAC,CACH,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACf,CAAC;QAED,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,KAAK,wCAAwC,CAAC,CAAC;QACtE,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabMrCreate extends GitLabCommand<typeof GitlabMrCreate> {
|
|
3
|
+
static isWrite: boolean;
|
|
4
|
+
static readonly summary = "Open a merge request.";
|
|
5
|
+
static readonly description: string;
|
|
6
|
+
static readonly examples: string[];
|
|
7
|
+
static readonly flags: {
|
|
8
|
+
'source-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'target-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
title: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
draft: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
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,77 @@
|
|
|
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 { buildMergeRequestCreateBody, formatKeyValue, parseBodyInput } from '@simplysf/simply-gitlab-core';
|
|
18
|
+
import { GitLabCommand, parseList, projectFlag, writeFlags } from '../../../shared/base-command.js';
|
|
19
|
+
export default class GitlabMrCreate extends GitLabCommand {
|
|
20
|
+
static isWrite = true;
|
|
21
|
+
static summary = 'Open a merge request.';
|
|
22
|
+
static description = 'Both branches must already exist on the project. --draft prefixes the title with "Draft: ", ' +
|
|
23
|
+
'which is how GitLab itself marks a draft; there is no separate field for it.\n\n' +
|
|
24
|
+
'Assignees and reviewers are numeric user ids, not usernames — GitLab accepts only ids here. ' +
|
|
25
|
+
'--body or --body-file supplies raw JSON for anything the flags do not cover, such as ' +
|
|
26
|
+
'approval rules. Use --dry-run to see exactly what would be sent.';
|
|
27
|
+
static examples = [
|
|
28
|
+
'<%= config.bin %> <%= command.id %> --project group/project --source-branch feature --target-branch main --title "feat: the thing"',
|
|
29
|
+
'<%= config.bin %> <%= command.id %> --project group/project --source-branch feature --target-branch main --title wip --draft --squash',
|
|
30
|
+
];
|
|
31
|
+
static flags = {
|
|
32
|
+
...projectFlag,
|
|
33
|
+
...writeFlags,
|
|
34
|
+
'source-branch': Flags.string({ summary: 'Branch holding the changes.' }),
|
|
35
|
+
'target-branch': Flags.string({ summary: 'Branch the changes are proposed for.' }),
|
|
36
|
+
title: Flags.string({ summary: 'Merge request title.' }),
|
|
37
|
+
description: Flags.string({ summary: 'Merge request description, as Markdown.' }),
|
|
38
|
+
draft: Flags.boolean({ summary: 'Open it as a draft.', default: false }),
|
|
39
|
+
squash: Flags.boolean({ summary: 'Squash the commits when it merges.', default: false }),
|
|
40
|
+
'remove-source-branch': Flags.boolean({ summary: 'Delete the source branch on merge.', default: false }),
|
|
41
|
+
'assignee-id': Flags.integer({ summary: 'User id to assign. Repeatable.', multiple: true }),
|
|
42
|
+
'reviewer-id': Flags.integer({ summary: 'User id to request review from. Repeatable.', multiple: true }),
|
|
43
|
+
labels: Flags.string({ summary: 'Comma-separated labels to apply.' }),
|
|
44
|
+
'milestone-id': Flags.integer({ summary: 'Milestone id to attach.' }),
|
|
45
|
+
body: Flags.string({ summary: 'Raw JSON request body.', exclusive: ['body-file'] }),
|
|
46
|
+
'body-file': Flags.string({ summary: 'Path to a file holding the raw JSON request body.' }),
|
|
47
|
+
};
|
|
48
|
+
async run() {
|
|
49
|
+
const request = buildMergeRequestCreateBody({
|
|
50
|
+
sourceBranch: this.flags['source-branch'],
|
|
51
|
+
targetBranch: this.flags['target-branch'],
|
|
52
|
+
title: this.flags.title,
|
|
53
|
+
description: this.flags.description,
|
|
54
|
+
draft: this.flags.draft || undefined,
|
|
55
|
+
squash: this.flags.squash || undefined,
|
|
56
|
+
removeSourceBranch: this.flags['remove-source-branch'] || undefined,
|
|
57
|
+
assigneeIds: this.flags['assignee-id'],
|
|
58
|
+
reviewerIds: this.flags['reviewer-id'],
|
|
59
|
+
labels: parseList(this.flags.labels),
|
|
60
|
+
milestoneId: this.flags['milestone-id'],
|
|
61
|
+
body: parseBodyInput(this.flags.body, this.flags['body-file']),
|
|
62
|
+
});
|
|
63
|
+
if (this.flags['dry-run']) {
|
|
64
|
+
this.log('Dry run — not sent. Request body:');
|
|
65
|
+
this.logSafe(JSON.stringify(request, null, 2));
|
|
66
|
+
return request;
|
|
67
|
+
}
|
|
68
|
+
const created = (await this.gitlab().createMergeRequest(this.flags.project, request));
|
|
69
|
+
this.logSafe(formatKeyValue([
|
|
70
|
+
['Created', created.iid === undefined ? undefined : `!${created.iid}`],
|
|
71
|
+
['Title', created.title],
|
|
72
|
+
['URL', created.web_url],
|
|
73
|
+
]));
|
|
74
|
+
return created;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/gitlab/mr/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,2BAA2B,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAQpG,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,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G,CAAC,mCAAmC,CAAC,CAAC;YAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC/C,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAwB,CAAC;QAC7G,IAAI,CAAC,OAAO,CACV,cAAc,CAAC;YACb,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YACtE,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,18 @@
|
|
|
1
|
+
import { GitLabCommand } from '../../../shared/base-command.js';
|
|
2
|
+
export default class GitlabMrList extends GitLabCommand<typeof GitlabMrList> {
|
|
3
|
+
static readonly summary = "List merge requests for a project.";
|
|
4
|
+
static readonly description: string;
|
|
5
|
+
static readonly examples: string[];
|
|
6
|
+
static readonly flags: {
|
|
7
|
+
state: import("@oclif/core/interfaces").OptionFlag<"opened" | "closed" | "locked" | "merged" | "all", import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'source-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'target-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'author-username': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'reviewer-username': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
labels: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
search: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
limit: import("@oclif/core/interfaces").OptionFlag<number>;
|
|
15
|
+
project: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
};
|
|
17
|
+
run(): Promise<unknown>;
|
|
18
|
+
}
|