abapgit-agent 1.7.0 ā 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/bin/abapgit-agent +102 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -52,6 +52,9 @@ abapgit-agent init --folder /abap/ --package ZMY_PACKAGE
|
|
|
52
52
|
# Create online repository in ABAP
|
|
53
53
|
abapgit-agent create
|
|
54
54
|
|
|
55
|
+
# Delete online repository from ABAP (keeps local files)
|
|
56
|
+
abapgit-agent delete
|
|
57
|
+
|
|
55
58
|
# Import objects from ABAP package to git
|
|
56
59
|
abapgit-agent import
|
|
57
60
|
```
|
|
@@ -113,6 +116,11 @@ abapgit-agent preview --objects SFLIGHT --where "CARRID = 'AA'"
|
|
|
113
116
|
abapgit-agent preview --objects SFLIGHT --columns CARRID,CONNID,PRICE
|
|
114
117
|
abapgit-agent preview --objects SFLIGHT --vertical
|
|
115
118
|
abapgit-agent preview --objects SFLIGHT --compact
|
|
119
|
+
|
|
120
|
+
# Find where-used (objects using a specific object)
|
|
121
|
+
abapgit-agent where --objects ZCL_MY_CLASS
|
|
122
|
+
abapgit-agent where --objects ZIF_MY_INTERFACE
|
|
123
|
+
abapgit-agent where --objects ZCL_MY_CLASS --type CLAS
|
|
116
124
|
```
|
|
117
125
|
|
|
118
126
|
### Utility Commands
|
|
@@ -147,6 +155,7 @@ npm run pull -- --url <git-url> --branch main
|
|
|
147
155
|
| Installation & Setup | [INSTALL.md](INSTALL.md) |
|
|
148
156
|
| init Command | [docs/init-command.md](docs/init-command.md) |
|
|
149
157
|
| create Command | [docs/create-command.md](docs/create-command.md) |
|
|
158
|
+
| delete Command | [docs/delete-command.md](docs/delete-command.md) |
|
|
150
159
|
| import Command | [docs/import-command.md](docs/import-command.md) |
|
|
151
160
|
| pull Command | [docs/pull-command.md](docs/pull-command.md) |
|
|
152
161
|
| inspect Command | [docs/inspect-command.md](docs/inspect-command.md) |
|
|
@@ -154,6 +163,7 @@ npm run pull -- --url <git-url> --branch main
|
|
|
154
163
|
| tree Command | [docs/tree-command.md](docs/tree-command.md) |
|
|
155
164
|
| view Command | [docs/view-command.md](docs/view-command.md) |
|
|
156
165
|
| preview Command | [docs/preview-command.md](docs/preview-command.md) |
|
|
166
|
+
| where Command | [docs/where-command.md](docs/where-command.md) |
|
|
157
167
|
| ref Command | [docs/ref-command.md](docs/ref-command.md) |
|
|
158
168
|
| REST API Reference | [API.md](API.md) |
|
|
159
169
|
| Error Handling | [ERROR_HANDLING.md](ERROR_HANDLING.md) |
|
package/bin/abapgit-agent
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* abapgit-agent init --folder <folder> --package <package> # Initialize: copies config, CLAUDE.md, guidelines
|
|
7
7
|
* abapgit-agent init --update # Update existing files to latest version
|
|
8
8
|
* abapgit-agent create
|
|
9
|
+
* abapgit-agent delete
|
|
9
10
|
* abapgit-agent import [--message <message>]
|
|
10
11
|
* abapgit-agent pull [--branch <branch>]
|
|
11
12
|
* abapgit-agent pull --url <git-url> [--branch <branch>]
|
|
@@ -1228,10 +1229,19 @@ async function runInit(args) {
|
|
|
1228
1229
|
const updateMode = args.includes('--update');
|
|
1229
1230
|
|
|
1230
1231
|
// Get parameters
|
|
1231
|
-
|
|
1232
|
+
let folder = folderArgIndex !== -1 && folderArgIndex + 1 < args.length
|
|
1232
1233
|
? args[folderArgIndex + 1]
|
|
1233
1234
|
: '/src/';
|
|
1234
1235
|
|
|
1236
|
+
// Normalize folder path: ensure it starts with / and ends with /
|
|
1237
|
+
folder = folder.trim();
|
|
1238
|
+
if (!folder.startsWith('/')) {
|
|
1239
|
+
folder = '/' + folder;
|
|
1240
|
+
}
|
|
1241
|
+
if (!folder.endsWith('/')) {
|
|
1242
|
+
folder = folder + '/';
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1235
1245
|
const packageName = packageArgIndex !== -1 && packageArgIndex + 1 < args.length
|
|
1236
1246
|
? args[packageArgIndex + 1]
|
|
1237
1247
|
: null;
|
|
@@ -1503,7 +1513,7 @@ To enable integration:
|
|
|
1503
1513
|
}
|
|
1504
1514
|
|
|
1505
1515
|
// Version compatibility check for commands that interact with ABAP
|
|
1506
|
-
const abapCommands = ['create', 'import', 'pull', 'inspect', 'unit', 'tree', 'view', 'preview', 'list'];
|
|
1516
|
+
const abapCommands = ['create', 'delete', 'import', 'pull', 'inspect', 'unit', 'tree', 'view', 'preview', 'list'];
|
|
1507
1517
|
if (command && abapCommands.includes(command)) {
|
|
1508
1518
|
await checkVersionCompatibility();
|
|
1509
1519
|
}
|
|
@@ -1605,6 +1615,67 @@ Examples:
|
|
|
1605
1615
|
break;
|
|
1606
1616
|
}
|
|
1607
1617
|
|
|
1618
|
+
case 'delete': {
|
|
1619
|
+
const helpIndex = args.findIndex(a => a === '--help' || a === '-h');
|
|
1620
|
+
|
|
1621
|
+
// Show help if requested
|
|
1622
|
+
if (helpIndex !== -1) {
|
|
1623
|
+
console.log(`
|
|
1624
|
+
Usage:
|
|
1625
|
+
abapgit-agent delete
|
|
1626
|
+
|
|
1627
|
+
Description:
|
|
1628
|
+
Delete abapGit online repository from ABAP system.
|
|
1629
|
+
Auto-detects URL from git remote of current directory.
|
|
1630
|
+
|
|
1631
|
+
Prerequisites:
|
|
1632
|
+
- Run "abapgit-agent create" first
|
|
1633
|
+
|
|
1634
|
+
Examples:
|
|
1635
|
+
abapgit-agent delete # Delete repo for current git remote
|
|
1636
|
+
`);
|
|
1637
|
+
return;
|
|
1638
|
+
}
|
|
1639
|
+
|
|
1640
|
+
// Get URL from current git remote
|
|
1641
|
+
const config = loadConfig();
|
|
1642
|
+
const repoUrl = getGitRemoteUrl();
|
|
1643
|
+
|
|
1644
|
+
if (!repoUrl) {
|
|
1645
|
+
console.error('Error: No git remote configured. Please configure a remote origin.');
|
|
1646
|
+
process.exit(1);
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
console.log(`\nšļø Deleting online repository`);
|
|
1650
|
+
console.log(` URL: ${repoUrl}`);
|
|
1651
|
+
|
|
1652
|
+
const csrfToken = await fetchCsrfToken(config);
|
|
1653
|
+
|
|
1654
|
+
const data = {
|
|
1655
|
+
url: repoUrl
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1658
|
+
const result = await request('POST', '/sap/bc/z_abapgit_agent/delete', data, { csrfToken });
|
|
1659
|
+
|
|
1660
|
+
console.log('\n');
|
|
1661
|
+
|
|
1662
|
+
// Handle uppercase keys from ABAP
|
|
1663
|
+
const success = result.SUCCESS || result.success;
|
|
1664
|
+
const repoKey = result.REPO_KEY || result.repo_key;
|
|
1665
|
+
const message = result.MESSAGE || result.message;
|
|
1666
|
+
const error = result.ERROR || result.error;
|
|
1667
|
+
|
|
1668
|
+
if (success === 'X' || success === true) {
|
|
1669
|
+
console.log(`ā
Repository deleted successfully!`);
|
|
1670
|
+
console.log(` Key: ${repoKey}`);
|
|
1671
|
+
} else {
|
|
1672
|
+
console.log(`ā Failed to delete repository`);
|
|
1673
|
+
console.log(` Error: ${error || message || 'Unknown error'}`);
|
|
1674
|
+
process.exit(1);
|
|
1675
|
+
}
|
|
1676
|
+
break;
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1608
1679
|
case 'import': {
|
|
1609
1680
|
const helpIndex = args.findIndex(a => a === '--help' || a === '-h');
|
|
1610
1681
|
|
|
@@ -1739,6 +1810,34 @@ Examples:
|
|
|
1739
1810
|
if (isAbapIntegrationEnabled()) {
|
|
1740
1811
|
console.log('ā
ABAP Git Agent is ENABLED');
|
|
1741
1812
|
console.log(' Config location:', pathModule.join(process.cwd(), '.abapGitAgent'));
|
|
1813
|
+
|
|
1814
|
+
// Check if repo exists in ABAP
|
|
1815
|
+
const config = loadConfig();
|
|
1816
|
+
const repoUrl = getGitRemoteUrl();
|
|
1817
|
+
|
|
1818
|
+
if (repoUrl) {
|
|
1819
|
+
try {
|
|
1820
|
+
const csrfToken = await fetchCsrfToken(config);
|
|
1821
|
+
const result = await request('POST', '/sap/bc/z_abapgit_agent/status', { url: repoUrl }, { csrfToken });
|
|
1822
|
+
|
|
1823
|
+
const status = result.status || result.STATUS || result.SUCCESS;
|
|
1824
|
+
if (status === 'Found' || status === 'X' || status === true) {
|
|
1825
|
+
console.log(' Repository: ā
Created');
|
|
1826
|
+
console.log(` Package: ${result.PACKAGE || result.package}`);
|
|
1827
|
+
console.log(` URL: ${repoUrl}`);
|
|
1828
|
+
console.log(` Key: ${result.REPO_KEY || result.repo_key}`);
|
|
1829
|
+
} else {
|
|
1830
|
+
console.log(' Repository: ā Not created in ABAP system');
|
|
1831
|
+
console.log(` URL: ${repoUrl}`);
|
|
1832
|
+
console.log(' Run "abapgit-agent create" to create repository');
|
|
1833
|
+
}
|
|
1834
|
+
} catch (err) {
|
|
1835
|
+
console.log(' Repository: ā ļø Unable to check status');
|
|
1836
|
+
console.log(' Error:', err.message);
|
|
1837
|
+
}
|
|
1838
|
+
} else {
|
|
1839
|
+
console.log(' No git remote configured');
|
|
1840
|
+
}
|
|
1742
1841
|
} else {
|
|
1743
1842
|
console.log('ā ABAP Git Agent is NOT configured');
|
|
1744
1843
|
}
|
|
@@ -2691,6 +2790,7 @@ Examples:
|
|
|
2691
2790
|
abapgit-agent init --folder /src --package ZMY_PACKAGE # Initialize
|
|
2692
2791
|
abapgit-agent init --update # Update files to latest
|
|
2693
2792
|
abapgit-agent create # Create repo
|
|
2793
|
+
abapgit-agent delete # Delete repo
|
|
2694
2794
|
abapgit-agent import # Import objects to git
|
|
2695
2795
|
abapgit-agent import --message "Initial import" # Import with message
|
|
2696
2796
|
abapgit-agent pull # Auto-detect from git
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abapgit-agent",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "ABAP Git Agent - Pull and activate ABAP code via abapGit from any git repository",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"test": "jest",
|
|
19
19
|
"test:all": "node scripts/test-all.js",
|
|
20
20
|
"test:jest": "jest",
|
|
21
|
-
"test:aunit": "node scripts/test-all.js --
|
|
22
|
-
"test:cmd": "node scripts/test-all.js --
|
|
21
|
+
"test:aunit": "node scripts/test-all.js --aunit",
|
|
22
|
+
"test:cmd": "node scripts/test-all.js --cmd",
|
|
23
23
|
"pull": "node bin/abapgit-agent",
|
|
24
24
|
"release": "node scripts/release.js",
|
|
25
25
|
"unrelease": "node scripts/unrelease.js"
|