@abapify/adt-plugin-gcts-cli 0.4.34 → 0.4.38
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 +17 -33
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +50 -33
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,49 +1,33 @@
|
|
|
1
1
|
# @abapify/adt-plugin-gcts-cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[
|
|
3
|
+
[](https://www.npmjs.com/package/@abapify/adt-plugin-gcts-cli)
|
|
4
|
+
[](https://github.com/abapify/adt-cli/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
CLI command plugin for SAP gCTS (git-enabled CTS) — mirrors sapcli's `sap gcts`.
|
|
5
7
|
|
|
6
8
|
## Install
|
|
7
9
|
|
|
8
10
|
```bash
|
|
9
|
-
|
|
11
|
+
npm install @abapify/adt-plugin-gcts-cli
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
## Usage
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
export default {
|
|
16
|
-
commands: ['@abapify/adt-plugin-gcts-cli/commands/gcts'],
|
|
17
|
-
};
|
|
18
|
-
```
|
|
16
|
+
Bundled with `@abapify/adt-cli` — no registration needed:
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
```bash
|
|
19
|
+
adt gcts --help
|
|
20
|
+
```
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
| ------------------------------------------------------- | ---------------------------------------------- |
|
|
24
|
-
| `adt gcts repo list` | GET `/repository` |
|
|
25
|
-
| `adt gcts repo create <rid> <url>` | POST `/repository` |
|
|
26
|
-
| `adt gcts repo clone <rid>` | POST `/repository/<rid>/clone` |
|
|
27
|
-
| `adt gcts repo delete <rid>` | DELETE `/repository/<rid>` |
|
|
28
|
-
| `adt gcts repo pull <rid>` | GET `/repository/<rid>/pullByCommit` |
|
|
29
|
-
| `adt gcts repo push <rid>` | GET `/repository/<rid>/push` |
|
|
30
|
-
| `adt gcts repo checkout <rid> <branch> [current]` | GET `/branches/<current>/switch?branch=<…>` |
|
|
31
|
-
| `adt gcts branch list <rid>` | GET `/repository/<rid>/branches` |
|
|
32
|
-
| `adt gcts branch create <rid> <name>` | POST `/repository/<rid>/branches` |
|
|
33
|
-
| `adt gcts branch delete <rid> <name>` | DELETE `/repository/<rid>/branches/<name>` |
|
|
34
|
-
| `adt gcts branch switch <rid> <target> [current]` | GET `/branches/<current>/switch?branch=<…>` |
|
|
35
|
-
| `adt gcts commit <rid> [--corrnr <TR>] [-d <pkg>] [-m]` | POST `/repository/<rid>/commit` |
|
|
36
|
-
| `adt gcts log <rid>` | GET `/repository/<rid>/getCommit` |
|
|
37
|
-
| `adt gcts objects <rid>` | GET `/repository/<rid>/getObjects` |
|
|
38
|
-
| `adt gcts config <rid> [get\|set\|unset\|list]` | GET/POST/DELETE `/repository/<rid>/config/...` |
|
|
22
|
+
## Features
|
|
39
23
|
|
|
40
|
-
|
|
24
|
+
- `adt gcts` commands mirroring sapcli `sap gcts`
|
|
25
|
+
- Repository, branch, commit, pull, and push operations
|
|
41
26
|
|
|
42
|
-
##
|
|
27
|
+
## Documentation
|
|
43
28
|
|
|
44
|
-
-
|
|
45
|
-
- [`@abapify/adt-contracts`](../adt-contracts) — `client.adt.gcts.*` namespace
|
|
29
|
+
**[adt-cli.netlify.app/sdk/packages/adt-plugin-gcts-cli](https://adt-cli.netlify.app/sdk/packages/adt-plugin-gcts-cli)**
|
|
46
30
|
|
|
47
|
-
|
|
31
|
+
---
|
|
48
32
|
|
|
49
|
-
|
|
33
|
+
Part of [**abapify**](https://github.com/abapify/adt-cli) — open, typed tooling for SAP ABAP Development Tools (ADT): CLI, MCP server, and SDK.
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/commands/gcts.ts","../src/lib/client/gcts-client.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/commands/gcts.ts","../src/lib/client/gcts-client.ts"],"mappings":";;cAomBa,aAAa;UC5kBT;EACf;IACE;MACE;QACE,YAAY,QAAQ;QACpB,MAAM,gBAAgB,QAAQ;QAC9B,SACE,MAAM,gCACH,QAAQ;QACb,SAAS,gBAAgB,QAAQ;QACjC,QAAQ,gBAAgB,QAAQ;QAChC,OAAO,gBAAgB,QAAQ;QAC/B,OAAO,gBAAgB,QAAQ;QAC/B,WACE,aACA,uBACA,yBACG,QAAQ;QACb,MAAM,gBAAgB,QAAQ;QAC9B,UAAU,gBAAgB,QAAQ;QAClC,UACE,aACA,MAAM,4BACH,QAAQ;;MAEf;QACE,OAAO,gBAAgB,QAAQ;QAC/B,SACE,aACA,MAAM,4BACH,QAAQ;QACb,SAAS,aAAa,iBAAiB,QAAQ;QAC/C,SACE,aACA,uBACA,mBACG,QAAQ;;MAEf;QACE,SACE,aACA,MAAM,sBACH,QAAQ;;MAEf;QACE,MAAM,aAAa,gBAAgB,QAAQ;QAC3C,MACE,aACA,MAAM,yBACH,QAAQ;QACb,SAAS,aAAa,gBAAgB,QAAQ"}
|
package/dist/index.mjs
CHANGED
|
@@ -515,6 +515,50 @@ const objectsCmd = {
|
|
|
515
515
|
for (const o of objs) console.log(`${o.pgmid ?? ""}\t${o.type ?? ""}\t${o.object ?? ""}`);
|
|
516
516
|
}
|
|
517
517
|
};
|
|
518
|
+
/** `config list` — print the full repository configuration. */
|
|
519
|
+
async function configList(client, rid, args) {
|
|
520
|
+
const cfg = (await client.adt.gcts.repository.get(rid)).result?.config ?? [];
|
|
521
|
+
if (args.json) {
|
|
522
|
+
console.log(json(cfg));
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
for (const c of cfg) console.log(`${c.key}=${c.value ?? ""}`);
|
|
526
|
+
}
|
|
527
|
+
/** `config get` — print a single config entry. */
|
|
528
|
+
async function configGet(client, rid, key, args) {
|
|
529
|
+
const res = await client.adt.gcts.config.get(rid, key);
|
|
530
|
+
if (args.json) {
|
|
531
|
+
console.log(json(res));
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
console.log(`${res.result?.key ?? key}=${res.result?.value ?? ""}`);
|
|
535
|
+
}
|
|
536
|
+
/** `config set` — write a config entry. */
|
|
537
|
+
async function configSet(client, rid, key, args, ctx) {
|
|
538
|
+
const value = str(args.value);
|
|
539
|
+
if (!value) {
|
|
540
|
+
ctx.logger.error("❌ \"set\" requires a value argument.");
|
|
541
|
+
process.exit(1);
|
|
542
|
+
}
|
|
543
|
+
const res = await client.adt.gcts.config.set(rid, {
|
|
544
|
+
key,
|
|
545
|
+
value
|
|
546
|
+
});
|
|
547
|
+
if (args.json) {
|
|
548
|
+
console.log(json(res));
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
ctx.logger.info(`✅ ${key}=${value}`);
|
|
552
|
+
}
|
|
553
|
+
/** `config unset` / `config delete` — remove a config entry. */
|
|
554
|
+
async function configUnset(client, rid, key, args, ctx) {
|
|
555
|
+
const res = await client.adt.gcts.config.delete(rid, key);
|
|
556
|
+
if (args.json) {
|
|
557
|
+
console.log(json(res));
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
ctx.logger.info(`🗑 unset ${key}`);
|
|
561
|
+
}
|
|
518
562
|
const configCmd = {
|
|
519
563
|
name: "config",
|
|
520
564
|
description: "Manage repository configuration (GET/POST/DELETE /repository/<rid>/config)",
|
|
@@ -547,12 +591,7 @@ const configCmd = {
|
|
|
547
591
|
const action = (str(args.action) || "list").toLowerCase();
|
|
548
592
|
const key = str(args.key);
|
|
549
593
|
if (action === "list") {
|
|
550
|
-
|
|
551
|
-
if (args.json) {
|
|
552
|
-
console.log(json(cfg));
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
for (const c of cfg) console.log(`${c.key}=${c.value ?? ""}`);
|
|
594
|
+
await configList(client, rid, args);
|
|
556
595
|
return;
|
|
557
596
|
}
|
|
558
597
|
if (!key) {
|
|
@@ -560,38 +599,15 @@ const configCmd = {
|
|
|
560
599
|
process.exit(1);
|
|
561
600
|
}
|
|
562
601
|
if (action === "get") {
|
|
563
|
-
|
|
564
|
-
if (args.json) {
|
|
565
|
-
console.log(json(res));
|
|
566
|
-
return;
|
|
567
|
-
}
|
|
568
|
-
console.log(`${res.result?.key ?? key}=${res.result?.value ?? ""}`);
|
|
602
|
+
await configGet(client, rid, key, args);
|
|
569
603
|
return;
|
|
570
604
|
}
|
|
571
605
|
if (action === "set") {
|
|
572
|
-
|
|
573
|
-
if (!value) {
|
|
574
|
-
ctx.logger.error("❌ \"set\" requires a value argument.");
|
|
575
|
-
process.exit(1);
|
|
576
|
-
}
|
|
577
|
-
const res = await client.adt.gcts.config.set(rid, {
|
|
578
|
-
key,
|
|
579
|
-
value
|
|
580
|
-
});
|
|
581
|
-
if (args.json) {
|
|
582
|
-
console.log(json(res));
|
|
583
|
-
return;
|
|
584
|
-
}
|
|
585
|
-
ctx.logger.info(`✅ ${key}=${value}`);
|
|
606
|
+
await configSet(client, rid, key, args, ctx);
|
|
586
607
|
return;
|
|
587
608
|
}
|
|
588
609
|
if (action === "unset" || action === "delete") {
|
|
589
|
-
|
|
590
|
-
if (args.json) {
|
|
591
|
-
console.log(json(res));
|
|
592
|
-
return;
|
|
593
|
-
}
|
|
594
|
-
ctx.logger.info(`🗑 unset ${key}`);
|
|
610
|
+
await configUnset(client, rid, key, args, ctx);
|
|
595
611
|
return;
|
|
596
612
|
}
|
|
597
613
|
ctx.logger.error(`❌ Unknown config action "${action}" (expected: get|set|unset|list)`);
|
|
@@ -609,9 +625,10 @@ const gctsCommand = {
|
|
|
609
625
|
objectsCmd,
|
|
610
626
|
configCmd
|
|
611
627
|
],
|
|
612
|
-
|
|
628
|
+
execute(_args, ctx) {
|
|
613
629
|
ctx.logger.info("Usage: adt gcts <repo|branch|commit|log|objects|config> [...]");
|
|
614
630
|
ctx.logger.info("Run `adt gcts <subcommand> --help` for subcommand-specific options.");
|
|
631
|
+
return Promise.resolve();
|
|
615
632
|
}
|
|
616
633
|
};
|
|
617
634
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/client/gcts-client.ts","../src/lib/commands/gcts.ts"],"sourcesContent":["/**\n * Typed interface for the subset of the ADT client used by the gCTS CLI.\n *\n * The `CliContext.getAdtClient()` factory (provided by `adt-cli`) returns\n * `Promise<unknown>`. To keep the plugin self-contained, we declare the\n * exact shape we need here, structurally matching `client.adt.gcts.*` from\n * `@abapify/adt-contracts`.\n */\n\nimport type {\n GctsRepositoryEnvelope,\n GctsRepositoriesResponse,\n GctsBranchesResponse,\n GctsCreateBranchResponse,\n GctsLogResponse,\n GctsPullResponse,\n GctsObjectsResponse,\n GctsConfigResponse,\n GctsCreateRepositoryRequest,\n GctsCreateBranchRequest,\n GctsCommitRequest,\n GctsSetConfigRequest,\n} from '@abapify/adt-contracts';\n\nexport interface GctsClient {\n adt: {\n gcts: {\n repository: {\n list: () => Promise<GctsRepositoriesResponse>;\n get: (rid: string) => Promise<GctsRepositoryEnvelope>;\n create: (\n body: GctsCreateRepositoryRequest,\n ) => Promise<GctsRepositoryEnvelope>;\n delete: (rid: string) => Promise<Record<string, unknown>>;\n clone: (rid: string) => Promise<Record<string, unknown>>;\n pull: (rid: string) => Promise<GctsPullResponse>;\n push: (rid: string) => Promise<Record<string, unknown>>;\n checkout: (\n rid: string,\n currentBranch: string,\n targetBranch: string,\n ) => Promise<Record<string, unknown>>;\n log: (rid: string) => Promise<GctsLogResponse>;\n objects: (rid: string) => Promise<GctsObjectsResponse>;\n setItem: (\n rid: string,\n body: Record<string, unknown>,\n ) => Promise<Record<string, unknown>>;\n };\n branches: {\n list: (rid: string) => Promise<GctsBranchesResponse>;\n create: (\n rid: string,\n body: GctsCreateBranchRequest,\n ) => Promise<GctsCreateBranchResponse>;\n delete: (rid: string, name: string) => Promise<Record<string, unknown>>;\n switch: (\n rid: string,\n currentBranch: string,\n target: string,\n ) => Promise<Record<string, unknown>>;\n };\n commits: {\n commit: (\n rid: string,\n body: GctsCommitRequest,\n ) => Promise<Record<string, unknown>>;\n };\n config: {\n get: (rid: string, key: string) => Promise<GctsConfigResponse>;\n set: (\n rid: string,\n body: GctsSetConfigRequest,\n ) => Promise<Record<string, unknown>>;\n delete: (rid: string, key: string) => Promise<Record<string, unknown>>;\n };\n };\n };\n}\n\nimport type { CliContext } from '@abapify/adt-plugin';\n\n/**\n * Resolve a `GctsClient` from the CLI context, printing a friendly error and\n * exiting when no authenticated client is available (mirrors the pattern in\n * `@abapify/adt-atc`).\n */\nexport async function getGctsClient(ctx: CliContext): Promise<GctsClient> {\n if (!ctx.getAdtClient) {\n ctx.logger.error(\n '❌ ADT client not available. gCTS commands require authentication.',\n );\n ctx.logger.error(' Run: adt auth login');\n process.exit(1);\n }\n return (await ctx.getAdtClient()) as GctsClient;\n}\n","/**\n * `adt gcts` — top-level CLI command plugin.\n *\n * Mirrors sapcli's `sap gcts` surface:\n * - `adt gcts repo list / create / clone / delete / pull / push / checkout`\n * - `adt gcts branch list / create / switch / delete`\n * - `adt gcts commit <rid>`\n * - `adt gcts log <rid>`\n * - `adt gcts config <rid> get|set|unset [key] [value]`\n * - `adt gcts objects <rid>`\n *\n * All commands talk to `/sap/bc/cts_abapvcs/` via the typed contracts in\n * `@abapify/adt-contracts` (accessed as `client.adt.gcts.*`). JSON responses\n * are printed via `console.log` (respects `--json` flag where applicable).\n */\n\nimport type { CliCommandPlugin, CliContext } from '@abapify/adt-plugin';\nimport { getGctsClient } from '../client/gcts-client';\n\n// ── small helpers ──────────────────────────────────────────────────────────\n\n/** Stringify an object with 2-space indent (matches `sap gcts ... -f JSON`). */\nfunction json(x: unknown): string {\n return JSON.stringify(x, null, 2);\n}\n\n/** Safely coerce an `args` value to a string. */\nfunction str(v: unknown): string {\n return typeof v === 'string' ? v : '';\n}\n\n// ── repo subcommands ───────────────────────────────────────────────────────\n\nconst repoList: CliCommandPlugin = {\n name: 'list',\n description: 'List all gCTS repositories (GET /repository)',\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const res = await client.adt.gcts.repository.list();\n const repos = res.result ?? [];\n if (args.json) {\n console.log(json(repos));\n return;\n }\n if (repos.length === 0) {\n ctx.logger.info('No gCTS repositories found.');\n return;\n }\n for (const r of repos) {\n console.log(\n `${r.rid}\\t${r.status ?? ''}\\t${r.branch ?? ''}\\t${r.url ?? ''}`,\n );\n }\n },\n};\n\nconst repoCreate: CliCommandPlugin = {\n name: 'create',\n description: 'Create a new gCTS repository (POST /repository)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<url>', description: 'Git URL (https://...)' },\n ],\n options: [\n {\n flags: '--vsid <vsid>',\n description: 'Virtual system ID',\n default: '6IT',\n },\n {\n flags: '--role <role>',\n description: 'Repository role (SOURCE|TARGET)',\n default: 'SOURCE',\n },\n {\n flags: '--type <type>',\n description: 'Repository type (GITHUB|GIT)',\n default: 'GITHUB',\n },\n {\n flags: '--starting-folder <dir>',\n description: 'Repository start dir',\n default: 'src/',\n },\n { flags: '--vcs-token <token>', description: 'VCS authentication token' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const url = str(args.url);\n const config: Array<{ key: string; value: string }> = [];\n if (args.startingFolder)\n config.push({ key: 'VCS_TARGET_DIR', value: str(args.startingFolder) });\n if (args.vcsToken)\n config.push({ key: 'CLIENT_VCS_AUTH_TOKEN', value: str(args.vcsToken) });\n\n const body = {\n repository: rid,\n data: {\n rid,\n name: rid,\n vsid: str(args.vsid) || '6IT',\n url,\n role: str(args.role) || 'SOURCE',\n type: str(args.type) || 'GITHUB',\n connection: 'ssl',\n ...(config.length > 0 ? { config } : {}),\n },\n };\n const res = await client.adt.gcts.repository.create(body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const repo = res.repository ?? res.result;\n ctx.logger.info(`✅ Created repository \"${rid}\"`);\n if (repo?.status) ctx.logger.info(` status: ${repo.status}`);\n },\n};\n\nconst repoClone: CliCommandPlugin = {\n name: 'clone',\n description:\n 'Clone repository on target system (POST /repository/<rid>/clone)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.clone(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Cloned repository \"${rid}\"`);\n },\n};\n\nconst repoDelete: CliCommandPlugin = {\n name: 'delete',\n description: 'Delete a gCTS repository (DELETE /repository/<rid>)',\n alias: 'rm',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.delete(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 Deleted repository \"${rid}\"`);\n },\n};\n\nconst repoPull: CliCommandPlugin = {\n name: 'pull',\n description: 'Pull a gCTS repository (GET /repository/<rid>/pullByCommit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.pull(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Pulled repository \"${rid}\"`);\n if (res.fromCommit && res.toCommit) {\n ctx.logger.info(` ${res.fromCommit} -> ${res.toCommit}`);\n } else if (res.toCommit) {\n ctx.logger.info(` HEAD = ${res.toCommit}`);\n }\n },\n};\n\nconst repoPush: CliCommandPlugin = {\n name: 'push',\n description: 'Push a gCTS repository (GET /repository/<rid>/push)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.push(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Pushed repository \"${rid}\"`);\n },\n};\n\nconst repoCheckout: CliCommandPlugin = {\n name: 'checkout',\n description:\n 'Check out a branch (GET /repository/<rid>/branches/<current>/switch?branch=X)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<branch>', description: 'Target branch name' },\n {\n name: '[currentBranch]',\n description:\n 'Current branch (optional — inferred from repo if omitted; defaults to \"main\")',\n },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const target = str(args.branch);\n let current = str(args.currentBranch);\n\n if (!current) {\n // Discover current branch — mirrors sapcli's behaviour of reading\n // the repo `branch` property before building the switch URL.\n try {\n const repoRes = await client.adt.gcts.repository.get(rid);\n current = str(repoRes.result?.branch) || 'main';\n } catch {\n current = 'main';\n }\n }\n\n const res = await client.adt.gcts.repository.checkout(rid, current, target);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Switched \"${rid}\" from \"${current}\" to \"${target}\"`);\n },\n};\n\nconst repoGroup: CliCommandPlugin = {\n name: 'repo',\n description: 'Manage gCTS repositories',\n subcommands: [\n repoList,\n repoCreate,\n repoClone,\n repoDelete,\n repoPull,\n repoPush,\n repoCheckout,\n ],\n};\n\n// ── branch subcommands ─────────────────────────────────────────────────────\n\nconst branchList: CliCommandPlugin = {\n name: 'list',\n description: 'List branches of a repository (GET /branches)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [\n { flags: '-r, --remote', description: 'Show remote branches only' },\n { flags: '-a, --all', description: 'Show all branches (local + remote)' },\n { flags: '--json', description: 'Output as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.branches.list(rid);\n const all = res.branches ?? [];\n let filtered: typeof all;\n if (args.remote) {\n filtered = all.filter((b) => b.type === 'remote');\n } else if (args.all) {\n filtered = all;\n } else {\n filtered = all.filter((b) => b.type === 'local');\n }\n\n if (args.json) {\n console.log(json(filtered));\n return;\n }\n for (const b of filtered) {\n console.log(`${b.name}\\t${b.type ?? ''}\\t${b.ref ?? ''}`);\n }\n },\n};\n\nconst branchCreate: CliCommandPlugin = {\n name: 'create',\n description: 'Create a new branch (POST /branches)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<name>', description: 'Branch name' },\n ],\n options: [\n { flags: '--local-only', description: 'Create a local branch only' },\n { flags: '--symbolic', description: 'Create a symbolic ref' },\n { flags: '--peeled', description: 'Create a peeled ref' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const name = str(args.name);\n const body = {\n branch: name,\n type: args.localOnly ? ('local' as const) : ('global' as const),\n isSymbolic: Boolean(args.symbolic),\n isPeeled: Boolean(args.peeled),\n };\n const res = await client.adt.gcts.branches.create(rid, body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const branchName = res.branch?.name ?? name;\n ctx.logger.info(`✅ Branch \"${branchName}\" created in \"${rid}\"`);\n },\n};\n\nconst branchDelete: CliCommandPlugin = {\n name: 'delete',\n description: 'Delete a branch (DELETE /branches/<name>)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<name>', description: 'Branch name' },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const name = str(args.name);\n const res = await client.adt.gcts.branches.delete(rid, name);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 Deleted branch \"${name}\" in \"${rid}\"`);\n },\n};\n\nconst branchSwitch: CliCommandPlugin = {\n name: 'switch',\n description:\n 'Switch branches (GET /branches/<current>/switch?branch=<target>)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<target>', description: 'Target branch name' },\n { name: '[current]', description: 'Current branch (defaults to \"main\")' },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const target = str(args.target);\n let current = str(args.current);\n if (!current) {\n try {\n const r = await client.adt.gcts.repository.get(rid);\n current = str(r.result?.branch) || 'main';\n } catch {\n current = 'main';\n }\n }\n const res = await client.adt.gcts.branches.switch(rid, current, target);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Switched to \"${target}\" in \"${rid}\"`);\n },\n};\n\nconst branchGroup: CliCommandPlugin = {\n name: 'branch',\n description: 'Manage gCTS branches',\n subcommands: [branchList, branchCreate, branchDelete, branchSwitch],\n};\n\n// ── top-level `commit` / `log` / `config` / `objects` ──────────────────────\n\nconst commitCmd: CliCommandPlugin = {\n name: 'commit',\n description: 'Commit a package or transport (POST /repository/<rid>/commit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [\n {\n flags: '-m, --message <text>',\n description: 'Commit message (default: auto-generated)',\n },\n {\n flags: '-d, --devc <pkg>',\n description: 'ABAP package name (defaults to <rid>)',\n },\n {\n flags: '--corrnr <tr>',\n description: 'Transport number (mutually exclusive with --devc)',\n },\n { flags: '--description <text>', description: 'Long commit description' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const corrnr = str(args.corrnr);\n\n const objects = corrnr\n ? [{ object: corrnr, type: 'TRANSPORT' }]\n : [\n {\n object: (str(args.devc) || rid).toUpperCase(),\n type: 'FULL_PACKAGE',\n },\n ];\n\n const defaultMsg = corrnr\n ? `Transport ${corrnr}`\n : `Export package ${(str(args.devc) || rid).toUpperCase()}`;\n\n const body = {\n message: str(args.message) || defaultMsg,\n autoPush: 'true' as const,\n objects,\n ...(args.description ? { description: str(args.description) } : {}),\n };\n\n const res = await client.adt.gcts.commits.commit(rid, body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const detail = corrnr\n ? `transport ${corrnr}`\n : `package ${objects[0].object}`;\n ctx.logger.info(`✅ Committed to \"${rid}\": ${detail}`);\n },\n};\n\nconst logCmd: CliCommandPlugin = {\n name: 'log',\n description:\n 'Show repository commit history (GET /repository/<rid>/getCommit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.log(rid);\n const commits = res.commits ?? [];\n if (args.json) {\n console.log(json(commits));\n return;\n }\n for (const c of commits) {\n console.log(`commit ${c.id ?? ''}`);\n if (c.author) console.log(`Author: ${c.author} <${c.authorMail ?? ''}>`);\n if (c.date) console.log(`Date: ${c.date}`);\n console.log('');\n console.log(` ${c.message ?? ''}`);\n console.log('');\n }\n },\n};\n\nconst objectsCmd: CliCommandPlugin = {\n name: 'objects',\n description: 'List repository objects (GET /repository/<rid>/getObjects)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.objects(rid);\n const objs = res.objects ?? [];\n if (args.json) {\n console.log(json(objs));\n return;\n }\n for (const o of objs) {\n console.log(`${o.pgmid ?? ''}\\t${o.type ?? ''}\\t${o.object ?? ''}`);\n }\n },\n};\n\nconst configCmd: CliCommandPlugin = {\n name: 'config',\n description:\n 'Manage repository configuration (GET/POST/DELETE /repository/<rid>/config)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n {\n name: '[action]',\n description: 'get | set | unset | list (default: list)',\n default: 'list',\n },\n { name: '[key]', description: 'Config key (for get/set/unset)' },\n { name: '[value]', description: 'Config value (for set)' },\n ],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const action = (str(args.action) || 'list').toLowerCase();\n const key = str(args.key);\n\n if (action === 'list') {\n const repo = await client.adt.gcts.repository.get(rid);\n const cfg = repo.result?.config ?? [];\n if (args.json) {\n console.log(json(cfg));\n return;\n }\n for (const c of cfg) {\n console.log(`${c.key}=${c.value ?? ''}`);\n }\n return;\n }\n\n if (!key) {\n ctx.logger.error(`❌ \"${action}\" requires a key argument.`);\n process.exit(1);\n }\n\n if (action === 'get') {\n const res = await client.adt.gcts.config.get(rid, key);\n if (args.json) {\n console.log(json(res));\n return;\n }\n console.log(`${res.result?.key ?? key}=${res.result?.value ?? ''}`);\n return;\n }\n\n if (action === 'set') {\n const value = str(args.value);\n if (!value) {\n ctx.logger.error('❌ \"set\" requires a value argument.');\n process.exit(1);\n }\n const res = await client.adt.gcts.config.set(rid, { key, value });\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ ${key}=${value}`);\n return;\n }\n\n if (action === 'unset' || action === 'delete') {\n const res = await client.adt.gcts.config.delete(rid, key);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 unset ${key}`);\n return;\n }\n\n ctx.logger.error(\n `❌ Unknown config action \"${action}\" (expected: get|set|unset|list)`,\n );\n process.exit(1);\n },\n};\n\n// ── root ───────────────────────────────────────────────────────────────────\n\nexport const gctsCommand: CliCommandPlugin = {\n name: 'gcts',\n description: 'SAP gCTS (git-enabled CTS) operations (repo/branch/commit/...)',\n subcommands: [\n repoGroup,\n branchGroup,\n commitCmd,\n logCmd,\n objectsCmd,\n configCmd,\n ],\n async execute(\n _args: Record<string, unknown>,\n ctx: CliContext,\n ): Promise<void> {\n // Surfaces help when called without a subcommand.\n ctx.logger.info(\n 'Usage: adt gcts <repo|branch|commit|log|objects|config> [...]',\n );\n ctx.logger.info(\n 'Run `adt gcts <subcommand> --help` for subcommand-specific options.',\n );\n },\n};\n\nexport default gctsCommand;\n"],"mappings":";;;;;;AAuFA,eAAsB,cAAc,KAAsC;CACxE,IAAI,CAAC,IAAI,cAAc;EACrB,IAAI,OAAO,MACT,mEACF;EACA,IAAI,OAAO,MAAM,wBAAwB;EACzC,QAAQ,KAAK,CAAC;CAChB;CACA,OAAQ,MAAM,IAAI,aAAa;AACjC;;;;AC1EA,SAAS,KAAK,GAAoB;CAChC,OAAO,KAAK,UAAU,GAAG,MAAM,CAAC;AAClC;;AAGA,SAAS,IAAI,GAAoB;CAC/B,OAAO,OAAO,MAAM,WAAW,IAAI;AACrC;AAgNA,MAAM,YAA8B;CAClC,MAAM;CACN,aAAa;CACb,aAAa;EACX;GA/MF,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAU,aAAa;GAAiB,CAAC;GAC5D,MAAM,QAAQ,MAAM,KAAK;IAGvB,MAAM,SAAQ,OADI,MADG,cAAc,GAAG,EACd,CAAC,IAAI,KAAK,WAAW,KAAK,EACjC,CAAC,UAAU,CAAC;IAC7B,IAAI,KAAK,MAAM;KACb,QAAQ,IAAI,KAAK,KAAK,CAAC;KACvB;IACF;IACA,IAAI,MAAM,WAAW,GAAG;KACtB,IAAI,OAAO,KAAK,6BAA6B;KAC7C;IACF;IACA,KAAK,MAAM,KAAK,OACd,QAAQ,IACN,GAAG,EAAE,IAAI,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,OAAO,IAC9D;GAEJ;EA2LS;EACP;GAxLF,MAAM;GACN,aAAa;GACb,WAAW,CACT;IAAE,MAAM;IAAS,aAAa;GAAgB,GAC9C;IAAE,MAAM;IAAS,aAAa;GAAwB,CACxD;GACA,SAAS;IACP;KACE,OAAO;KACP,aAAa;KACb,SAAS;IACX;IACA;KACE,OAAO;KACP,aAAa;KACb,SAA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AM,MAAM,MAAM,OAAO,IAAI,KAAK,OAAO,IAAI,KAAK,GAAG;GACrD,IAAI,KAAK,MAAM;IACb,QAAQ,IAAI,KAAK,GAAG,CAAC;IACrB;GACF;GACA,QAAQ,IAAI,GAAG,IAAI,QAAQ,OAAO,IAAI,GAAG,IAAI,QAAQ,SAAS,IAAI;GAClE;EACF;EAEA,IAAI,WAAW,OAAO;GACpB,MAAM,QAAQ,IAAI,KAAK,KAAK;GAC5B,IAAI,CAAC,OAAO;IACV,IAAI,OAAO,MAAM,sCAAoC;IACrD,QAAQ,KAAK,CAAC;GAChB;GACA,MAAM,MAAM,MAAM,OAAO,IAAI,KAAK,OAAO,IAAI,KAAK;IAAE;IAAK;GAAM,CAAC;GAChE,IAAI,KAAK,MAAM;IACb,QAAQ,IAAI,KAAK,GAAG,CAAC;IACrB;GACF;GACA,IAAI,OAAO,KAAK,KAAK,IAAI,GAAG,OAAO;GACnC;EACF;EAEA,IAAI,WAAW,WAAW,WAAW,UAAU;GAC7C,MAAM,MAAM,MAAM,OAAO,IAAI,KAAK,OAAO,OAAO,KAAK,GAAG;GACxD,IAAI,KAAK,MAAM;IACb,QAAQ,IAAI,KAAK,GAAG,CAAC;IACrB;GACF;GACA,IAAI,OAAO,KAAK,aAAa,KAAK;GAClC;EACF;EAEA,IAAI,OAAO,MACT,4BAA4B,OAAO,iCACrC;EACA,QAAQ,KAAK,CAAC;CAChB;AACF;AAIA,MAAa,cAAgC;CAC3C,MAAM;CACN,aAAa;CACb,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;CACF;CACA,MAAM,QACJ,OACA,KACe;EAEf,IAAI,OAAO,KACT,+DACF;EACA,IAAI,OAAO,KACT,qEACF;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/client/gcts-client.ts","../src/lib/commands/gcts.ts"],"sourcesContent":["/**\n * Typed interface for the subset of the ADT client used by the gCTS CLI.\n *\n * The `CliContext.getAdtClient()` factory (provided by `adt-cli`) returns\n * `Promise<unknown>`. To keep the plugin self-contained, we declare the\n * exact shape we need here, structurally matching `client.adt.gcts.*` from\n * `@abapify/adt-contracts`.\n */\n\nimport type {\n GctsRepositoryEnvelope,\n GctsRepositoriesResponse,\n GctsBranchesResponse,\n GctsCreateBranchResponse,\n GctsLogResponse,\n GctsPullResponse,\n GctsObjectsResponse,\n GctsConfigResponse,\n GctsCreateRepositoryRequest,\n GctsCreateBranchRequest,\n GctsCommitRequest,\n GctsSetConfigRequest,\n} from '@abapify/adt-contracts';\n\nexport interface GctsClient {\n adt: {\n gcts: {\n repository: {\n list: () => Promise<GctsRepositoriesResponse>;\n get: (rid: string) => Promise<GctsRepositoryEnvelope>;\n create: (\n body: GctsCreateRepositoryRequest,\n ) => Promise<GctsRepositoryEnvelope>;\n delete: (rid: string) => Promise<Record<string, unknown>>;\n clone: (rid: string) => Promise<Record<string, unknown>>;\n pull: (rid: string) => Promise<GctsPullResponse>;\n push: (rid: string) => Promise<Record<string, unknown>>;\n checkout: (\n rid: string,\n currentBranch: string,\n targetBranch: string,\n ) => Promise<Record<string, unknown>>;\n log: (rid: string) => Promise<GctsLogResponse>;\n objects: (rid: string) => Promise<GctsObjectsResponse>;\n setItem: (\n rid: string,\n body: Record<string, unknown>,\n ) => Promise<Record<string, unknown>>;\n };\n branches: {\n list: (rid: string) => Promise<GctsBranchesResponse>;\n create: (\n rid: string,\n body: GctsCreateBranchRequest,\n ) => Promise<GctsCreateBranchResponse>;\n delete: (rid: string, name: string) => Promise<Record<string, unknown>>;\n switch: (\n rid: string,\n currentBranch: string,\n target: string,\n ) => Promise<Record<string, unknown>>;\n };\n commits: {\n commit: (\n rid: string,\n body: GctsCommitRequest,\n ) => Promise<Record<string, unknown>>;\n };\n config: {\n get: (rid: string, key: string) => Promise<GctsConfigResponse>;\n set: (\n rid: string,\n body: GctsSetConfigRequest,\n ) => Promise<Record<string, unknown>>;\n delete: (rid: string, key: string) => Promise<Record<string, unknown>>;\n };\n };\n };\n}\n\nimport type { CliContext } from '@abapify/adt-plugin';\n\n/**\n * Resolve a `GctsClient` from the CLI context, printing a friendly error and\n * exiting when no authenticated client is available (mirrors the pattern in\n * `@abapify/adt-atc`).\n */\nexport async function getGctsClient(ctx: CliContext): Promise<GctsClient> {\n if (!ctx.getAdtClient) {\n ctx.logger.error(\n '❌ ADT client not available. gCTS commands require authentication.',\n );\n ctx.logger.error(' Run: adt auth login');\n process.exit(1);\n }\n return (await ctx.getAdtClient()) as GctsClient;\n}\n","/**\n * `adt gcts` — top-level CLI command plugin.\n *\n * Mirrors sapcli's `sap gcts` surface:\n * - `adt gcts repo list / create / clone / delete / pull / push / checkout`\n * - `adt gcts branch list / create / switch / delete`\n * - `adt gcts commit <rid>`\n * - `adt gcts log <rid>`\n * - `adt gcts config <rid> get|set|unset [key] [value]`\n * - `adt gcts objects <rid>`\n *\n * All commands talk to `/sap/bc/cts_abapvcs/` via the typed contracts in\n * `@abapify/adt-contracts` (accessed as `client.adt.gcts.*`). JSON responses\n * are printed via `console.log` (respects `--json` flag where applicable).\n */\n\nimport type { CliCommandPlugin, CliContext } from '@abapify/adt-plugin';\nimport { getGctsClient } from '../client/gcts-client';\n\n// ── small helpers ──────────────────────────────────────────────────────────\n\n/** Stringify an object with 2-space indent (matches `sap gcts ... -f JSON`). */\nfunction json(x: unknown): string {\n return JSON.stringify(x, null, 2);\n}\n\n/** Safely coerce an `args` value to a string. */\nfunction str(v: unknown): string {\n return typeof v === 'string' ? v : '';\n}\n\n// ── repo subcommands ───────────────────────────────────────────────────────\n\nconst repoList: CliCommandPlugin = {\n name: 'list',\n description: 'List all gCTS repositories (GET /repository)',\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const res = await client.adt.gcts.repository.list();\n const repos = res.result ?? [];\n if (args.json) {\n console.log(json(repos));\n return;\n }\n if (repos.length === 0) {\n ctx.logger.info('No gCTS repositories found.');\n return;\n }\n for (const r of repos) {\n console.log(\n `${r.rid}\\t${r.status ?? ''}\\t${r.branch ?? ''}\\t${r.url ?? ''}`,\n );\n }\n },\n};\n\nconst repoCreate: CliCommandPlugin = {\n name: 'create',\n description: 'Create a new gCTS repository (POST /repository)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<url>', description: 'Git URL (https://...)' },\n ],\n options: [\n {\n flags: '--vsid <vsid>',\n description: 'Virtual system ID',\n default: '6IT',\n },\n {\n flags: '--role <role>',\n description: 'Repository role (SOURCE|TARGET)',\n default: 'SOURCE',\n },\n {\n flags: '--type <type>',\n description: 'Repository type (GITHUB|GIT)',\n default: 'GITHUB',\n },\n {\n flags: '--starting-folder <dir>',\n description: 'Repository start dir',\n default: 'src/',\n },\n { flags: '--vcs-token <token>', description: 'VCS authentication token' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const url = str(args.url);\n const config: Array<{ key: string; value: string }> = [];\n if (args.startingFolder)\n config.push({ key: 'VCS_TARGET_DIR', value: str(args.startingFolder) });\n if (args.vcsToken)\n config.push({ key: 'CLIENT_VCS_AUTH_TOKEN', value: str(args.vcsToken) });\n\n const body = {\n repository: rid,\n data: {\n rid,\n name: rid,\n vsid: str(args.vsid) || '6IT',\n url,\n role: str(args.role) || 'SOURCE',\n type: str(args.type) || 'GITHUB',\n connection: 'ssl',\n ...(config.length > 0 ? { config } : {}),\n },\n };\n const res = await client.adt.gcts.repository.create(body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const repo = res.repository ?? res.result;\n ctx.logger.info(`✅ Created repository \"${rid}\"`);\n if (repo?.status) ctx.logger.info(` status: ${repo.status}`);\n },\n};\n\nconst repoClone: CliCommandPlugin = {\n name: 'clone',\n description:\n 'Clone repository on target system (POST /repository/<rid>/clone)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.clone(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Cloned repository \"${rid}\"`);\n },\n};\n\nconst repoDelete: CliCommandPlugin = {\n name: 'delete',\n description: 'Delete a gCTS repository (DELETE /repository/<rid>)',\n alias: 'rm',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.delete(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 Deleted repository \"${rid}\"`);\n },\n};\n\nconst repoPull: CliCommandPlugin = {\n name: 'pull',\n description: 'Pull a gCTS repository (GET /repository/<rid>/pullByCommit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.pull(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Pulled repository \"${rid}\"`);\n if (res.fromCommit && res.toCommit) {\n ctx.logger.info(` ${res.fromCommit} -> ${res.toCommit}`);\n } else if (res.toCommit) {\n ctx.logger.info(` HEAD = ${res.toCommit}`);\n }\n },\n};\n\nconst repoPush: CliCommandPlugin = {\n name: 'push',\n description: 'Push a gCTS repository (GET /repository/<rid>/push)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.push(rid);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Pushed repository \"${rid}\"`);\n },\n};\n\nconst repoCheckout: CliCommandPlugin = {\n name: 'checkout',\n description:\n 'Check out a branch (GET /repository/<rid>/branches/<current>/switch?branch=X)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<branch>', description: 'Target branch name' },\n {\n name: '[currentBranch]',\n description:\n 'Current branch (optional — inferred from repo if omitted; defaults to \"main\")',\n },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const target = str(args.branch);\n let current = str(args.currentBranch);\n\n if (!current) {\n // Discover current branch — mirrors sapcli's behaviour of reading\n // the repo `branch` property before building the switch URL.\n try {\n const repoRes = await client.adt.gcts.repository.get(rid);\n current = str(repoRes.result?.branch) || 'main';\n } catch {\n current = 'main';\n }\n }\n\n const res = await client.adt.gcts.repository.checkout(rid, current, target);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Switched \"${rid}\" from \"${current}\" to \"${target}\"`);\n },\n};\n\nconst repoGroup: CliCommandPlugin = {\n name: 'repo',\n description: 'Manage gCTS repositories',\n subcommands: [\n repoList,\n repoCreate,\n repoClone,\n repoDelete,\n repoPull,\n repoPush,\n repoCheckout,\n ],\n};\n\n// ── branch subcommands ─────────────────────────────────────────────────────\n\nconst branchList: CliCommandPlugin = {\n name: 'list',\n description: 'List branches of a repository (GET /branches)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [\n { flags: '-r, --remote', description: 'Show remote branches only' },\n { flags: '-a, --all', description: 'Show all branches (local + remote)' },\n { flags: '--json', description: 'Output as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.branches.list(rid);\n const all = res.branches ?? [];\n let filtered: typeof all;\n if (args.remote) {\n filtered = all.filter((b) => b.type === 'remote');\n } else if (args.all) {\n filtered = all;\n } else {\n filtered = all.filter((b) => b.type === 'local');\n }\n\n if (args.json) {\n console.log(json(filtered));\n return;\n }\n for (const b of filtered) {\n console.log(`${b.name}\\t${b.type ?? ''}\\t${b.ref ?? ''}`);\n }\n },\n};\n\nconst branchCreate: CliCommandPlugin = {\n name: 'create',\n description: 'Create a new branch (POST /branches)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<name>', description: 'Branch name' },\n ],\n options: [\n { flags: '--local-only', description: 'Create a local branch only' },\n { flags: '--symbolic', description: 'Create a symbolic ref' },\n { flags: '--peeled', description: 'Create a peeled ref' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const name = str(args.name);\n const body = {\n branch: name,\n type: args.localOnly ? ('local' as const) : ('global' as const),\n isSymbolic: Boolean(args.symbolic),\n isPeeled: Boolean(args.peeled),\n };\n const res = await client.adt.gcts.branches.create(rid, body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const branchName = res.branch?.name ?? name;\n ctx.logger.info(`✅ Branch \"${branchName}\" created in \"${rid}\"`);\n },\n};\n\nconst branchDelete: CliCommandPlugin = {\n name: 'delete',\n description: 'Delete a branch (DELETE /branches/<name>)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<name>', description: 'Branch name' },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const name = str(args.name);\n const res = await client.adt.gcts.branches.delete(rid, name);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 Deleted branch \"${name}\" in \"${rid}\"`);\n },\n};\n\nconst branchSwitch: CliCommandPlugin = {\n name: 'switch',\n description:\n 'Switch branches (GET /branches/<current>/switch?branch=<target>)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n { name: '<target>', description: 'Target branch name' },\n { name: '[current]', description: 'Current branch (defaults to \"main\")' },\n ],\n options: [{ flags: '--json', description: 'Output response as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const target = str(args.target);\n let current = str(args.current);\n if (!current) {\n try {\n const r = await client.adt.gcts.repository.get(rid);\n current = str(r.result?.branch) || 'main';\n } catch {\n current = 'main';\n }\n }\n const res = await client.adt.gcts.branches.switch(rid, current, target);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ Switched to \"${target}\" in \"${rid}\"`);\n },\n};\n\nconst branchGroup: CliCommandPlugin = {\n name: 'branch',\n description: 'Manage gCTS branches',\n subcommands: [branchList, branchCreate, branchDelete, branchSwitch],\n};\n\n// ── top-level `commit` / `log` / `config` / `objects` ──────────────────────\n\nconst commitCmd: CliCommandPlugin = {\n name: 'commit',\n description: 'Commit a package or transport (POST /repository/<rid>/commit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [\n {\n flags: '-m, --message <text>',\n description: 'Commit message (default: auto-generated)',\n },\n {\n flags: '-d, --devc <pkg>',\n description: 'ABAP package name (defaults to <rid>)',\n },\n {\n flags: '--corrnr <tr>',\n description: 'Transport number (mutually exclusive with --devc)',\n },\n { flags: '--description <text>', description: 'Long commit description' },\n { flags: '--json', description: 'Output response as JSON' },\n ],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const corrnr = str(args.corrnr);\n\n const objects = corrnr\n ? [{ object: corrnr, type: 'TRANSPORT' }]\n : [\n {\n object: (str(args.devc) || rid).toUpperCase(),\n type: 'FULL_PACKAGE',\n },\n ];\n\n const defaultMsg = corrnr\n ? `Transport ${corrnr}`\n : `Export package ${(str(args.devc) || rid).toUpperCase()}`;\n\n const body = {\n message: str(args.message) || defaultMsg,\n autoPush: 'true' as const,\n objects,\n ...(args.description ? { description: str(args.description) } : {}),\n };\n\n const res = await client.adt.gcts.commits.commit(rid, body);\n if (args.json) {\n console.log(json(res));\n return;\n }\n const detail = corrnr\n ? `transport ${corrnr}`\n : `package ${objects[0].object}`;\n ctx.logger.info(`✅ Committed to \"${rid}\": ${detail}`);\n },\n};\n\nconst logCmd: CliCommandPlugin = {\n name: 'log',\n description:\n 'Show repository commit history (GET /repository/<rid>/getCommit)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.log(rid);\n const commits = res.commits ?? [];\n if (args.json) {\n console.log(json(commits));\n return;\n }\n for (const c of commits) {\n console.log(`commit ${c.id ?? ''}`);\n if (c.author) console.log(`Author: ${c.author} <${c.authorMail ?? ''}>`);\n if (c.date) console.log(`Date: ${c.date}`);\n console.log('');\n console.log(` ${c.message ?? ''}`);\n console.log('');\n }\n },\n};\n\nconst objectsCmd: CliCommandPlugin = {\n name: 'objects',\n description: 'List repository objects (GET /repository/<rid>/getObjects)',\n arguments: [{ name: '<rid>', description: 'Repository ID' }],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const res = await client.adt.gcts.repository.objects(rid);\n const objs = res.objects ?? [];\n if (args.json) {\n console.log(json(objs));\n return;\n }\n for (const o of objs) {\n console.log(`${o.pgmid ?? ''}\\t${o.type ?? ''}\\t${o.object ?? ''}`);\n }\n },\n};\n\n// ── config subcommand helpers ──────────────────────────────────────────────\n\ntype GctsClient = Awaited<ReturnType<typeof getGctsClient>>;\ntype CliArgs = Parameters<CliCommandPlugin['execute']>[0];\n\n/** `config list` — print the full repository configuration. */\nasync function configList(\n client: GctsClient,\n rid: string,\n args: CliArgs,\n): Promise<void> {\n const repo = await client.adt.gcts.repository.get(rid);\n const cfg = repo.result?.config ?? [];\n if (args.json) {\n console.log(json(cfg));\n return;\n }\n for (const c of cfg) {\n console.log(`${c.key}=${c.value ?? ''}`);\n }\n}\n\n/** `config get` — print a single config entry. */\nasync function configGet(\n client: GctsClient,\n rid: string,\n key: string,\n args: CliArgs,\n): Promise<void> {\n const res = await client.adt.gcts.config.get(rid, key);\n if (args.json) {\n console.log(json(res));\n return;\n }\n console.log(`${res.result?.key ?? key}=${res.result?.value ?? ''}`);\n}\n\n/** `config set` — write a config entry. */\nasync function configSet(\n client: GctsClient,\n rid: string,\n key: string,\n args: CliArgs,\n ctx: CliContext,\n): Promise<void> {\n const value = str(args.value);\n if (!value) {\n ctx.logger.error('❌ \"set\" requires a value argument.');\n process.exit(1);\n }\n const res = await client.adt.gcts.config.set(rid, { key, value });\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`✅ ${key}=${value}`);\n}\n\n/** `config unset` / `config delete` — remove a config entry. */\nasync function configUnset(\n client: GctsClient,\n rid: string,\n key: string,\n args: CliArgs,\n ctx: CliContext,\n): Promise<void> {\n const res = await client.adt.gcts.config.delete(rid, key);\n if (args.json) {\n console.log(json(res));\n return;\n }\n ctx.logger.info(`🗑 unset ${key}`);\n}\n\nconst configCmd: CliCommandPlugin = {\n name: 'config',\n description:\n 'Manage repository configuration (GET/POST/DELETE /repository/<rid>/config)',\n arguments: [\n { name: '<rid>', description: 'Repository ID' },\n {\n name: '[action]',\n description: 'get | set | unset | list (default: list)',\n default: 'list',\n },\n { name: '[key]', description: 'Config key (for get/set/unset)' },\n { name: '[value]', description: 'Config value (for set)' },\n ],\n options: [{ flags: '--json', description: 'Output as JSON' }],\n async execute(args, ctx) {\n const client = await getGctsClient(ctx);\n const rid = str(args.rid);\n const action = (str(args.action) || 'list').toLowerCase();\n const key = str(args.key);\n\n if (action === 'list') {\n await configList(client, rid, args);\n return;\n }\n\n if (!key) {\n ctx.logger.error(`❌ \"${action}\" requires a key argument.`);\n process.exit(1);\n }\n\n if (action === 'get') {\n await configGet(client, rid, key, args);\n return;\n }\n\n if (action === 'set') {\n await configSet(client, rid, key, args, ctx);\n return;\n }\n\n if (action === 'unset' || action === 'delete') {\n await configUnset(client, rid, key, args, ctx);\n return;\n }\n\n ctx.logger.error(\n `❌ Unknown config action \"${action}\" (expected: get|set|unset|list)`,\n );\n process.exit(1);\n },\n};\n\n// ── root ───────────────────────────────────────────────────────────────────\n\nexport const gctsCommand: CliCommandPlugin = {\n name: 'gcts',\n description: 'SAP gCTS (git-enabled CTS) operations (repo/branch/commit/...)',\n subcommands: [\n repoGroup,\n branchGroup,\n commitCmd,\n logCmd,\n objectsCmd,\n configCmd,\n ],\n execute(_args: Record<string, unknown>, ctx: CliContext): Promise<void> {\n // Surfaces help when called without a subcommand.\n ctx.logger.info(\n 'Usage: adt gcts <repo|branch|commit|log|objects|config> [...]',\n );\n ctx.logger.info(\n 'Run `adt gcts <subcommand> --help` for subcommand-specific options.',\n );\n return Promise.resolve();\n },\n};\n\nexport default gctsCommand;\n"],"mappings":";;;;;;AAuFA,eAAsB,cAAc,KAAsC;CACxE,IAAI,CAAC,IAAI,cAAc;EACrB,IAAI,OAAO,MACT,mEACF;EACA,IAAI,OAAO,MAAM,wBAAwB;EACzC,QAAQ,KAAK,CAAC;CAChB;CACA,OAAQ,MAAM,IAAI,aAAa;AACjC;;;;AC1EA,SAAS,KAAK,GAAoB;CAChC,OAAO,KAAK,UAAU,GAAG,MAAM,CAAC;AAClC;;AAGA,SAAS,IAAI,GAAoB;CAC/B,OAAO,OAAO,MAAM,WAAW,IAAI;AACrC;AAgNA,MAAM,YAA8B;CAClC,MAAM;CACN,aAAa;CACb,aAAa;EACX;GA/MF,MAAM;GACN,aAAa;GACb,SAAS,CAAC;IAAE,OAAO;IAAU,aAAa;GAAiB,CAAC;GAC5D,MAAM,QAAQ,MAAM,KAAK;IAGvB,MAAM,SAAQ,OADI,MADG,cAAc,GAAG,EACd,CAAC,IAAI,KAAK,WAAW,KAAK,EACjC,CAAC,UAAU,CAAC;IAC7B,IAAI,KAAK,MAAM;KACb,QAAQ,IAAI,KAAK,KAAK,CAAC;KACvB;IACF;IACA,IAAI,MAAM,WAAW,GAAG;KACtB,IAAI,OAAO,KAAK,6BAA6B;KAC7C;IACF;IACA,KAAK,MAAM,KAAK,OACd,QAAQ,IACN,GAAG,EAAE,IAAI,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,U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EAEA,IAAI,WAAW,OAAO;GACpB,MAAM,UAAU,QAAQ,KAAK,KAAK,MAAM,GAAG;GAC3C;EACF;EAEA,IAAI,WAAW,WAAW,WAAW,UAAU;GAC7C,MAAM,YAAY,QAAQ,KAAK,KAAK,MAAM,GAAG;GAC7C;EACF;EAEA,IAAI,OAAO,MACT,4BAA4B,OAAO,iCACrC;EACA,QAAQ,KAAK,CAAC;CAChB;AACF;AAIA,MAAa,cAAgC;CAC3C,MAAM;CACN,aAAa;CACb,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;CACF;CACA,QAAQ,OAAgC,KAAgC;EAEtE,IAAI,OAAO,KACT,+DACF;EACA,IAAI,OAAO,KACT,qEACF;EACA,OAAO,QAAQ,QAAQ;CACzB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abapify/adt-plugin-gcts-cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.38",
|
|
4
4
|
"description": "CLI command plugin for SAP gCTS (git-enabled CTS) — mirrors sapcli's `sap gcts`",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"cts_abapvcs"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@abapify/adt-plugin": "0.4.
|
|
31
|
-
"@abapify/adt-contracts": "0.4.
|
|
30
|
+
"@abapify/adt-plugin": "0.4.38",
|
|
31
|
+
"@abapify/adt-contracts": "0.4.38",
|
|
32
32
|
"zod": "^4.6.7"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|