Skip to content

Commit 7d4267c

Browse files
authored
Add automation API and migrate to VCS export format 5.1.0 (v1.5.0) (#19)
## Summary - New automation API (`modApi.API`, `ACLibApiImportSession`) to use the wizard without UI, e.g. from scripts or AI agents (msaccess-vcs-mcp `vcs_call_vba`). Result is returned as JSON, no message boxes. - Commands: `GetVersion`, `GetConfig`, `ListInstalled`, `Resolve` (read only), `Import` - Options: `mode=missing|all|selected;tests=0|1;examples=0|1;source=config|local|github;repo=owner/name@branch` - `ACLibFileManager`: `SilentMode` collects messages instead of showing a MsgBox (used by the API) - README: documentation of the automation API - Source exported with MSAccess VCS add-in 5.1.0 (export format 5.1.0: forms as `.form`, hidden attributes/table descriptions in `tbldefs/*.json`) - .gitignore: logs, test results, `.env.*`, generated agent docs - Version 1.5.0 (API version 1) ## Test - Built from source with VCS add-in 5.1.0 (manually in Access), VBA project compiles - `API "GetVersion"` -> `{"ok":true,"version":"1.5.0","api":1}` - `API "Resolve" "data/FilterStringBuilder.cls"` -> dependencies resolved, planned actions correct - `Import` was tested earlier on the branch (before the 5.1.0 export) ## Note The release workflow (self-hosted runner) needs MSAccess VCS add-in >= 5.1.0 to build the new export format.
1 parent 441a633 commit 7d4267c

22 files changed

Lines changed: 1589 additions & 551 deletions

‎.gitignore‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version Control Add-in Binaries
1+
# Version Control Add-in Binaries
22
# (This should be built from source and not committed to version control)
33
*.mdb
44
*.accd[aber]
@@ -11,8 +11,19 @@
1111
*.log
1212

1313
# The local VCS index file is paired with the database and should not
14-
# be comitted to version control.
15-
vcs-index.json
14+
# be committed to version control.
15+
vcs-index.*
1616

1717
# Ignore any dotenv files (used for external database connections)
1818
*.env
19+
logs/
20+
test-results/
21+
.env.*
22+
!.env*.example
23+
24+
# Local MCP server configuration (contains machine-specific paths)
25+
.mcp.json
26+
27+
# Agent docs generated by the VCS add-in on every export
28+
source/AGENTS.md
29+
source/vcs-agent-docs/

‎README.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,46 @@ Details: https://wiki.access-codelib.net/ACLib-Import-Wizard
77
[Video: create new Access application](https://access-codelib.net/videos/ACLib-Import-Wizard/neue-anwendung-erstellen/)
88

99
[Video: Import from GitHub repository](https://access-codelib.net/videos/ACLib-Import-Wizard/ACLib-Import-Wizard_ImportFromGitHub.mp4)
10+
11+
#### Automation API
12+
The wizard can be used without UI, e.g. from scripts or AI agents.
13+
`API` returns a JSON string:
14+
15+
```vba
16+
Application.Run "<add-in path without .accda>.API", "<Command>", "<Files>", "<Options>"
17+
18+
' Example (installed add-in)
19+
Application.Run Environ("APPDATA") & "\Microsoft\AddIns\ACLibImportWizard.API", _
20+
"Resolve", "form/filter/FilterControlManager.cls", "mode=missing"
21+
```
22+
23+
| Command | Arguments | Result |
24+
|---|---|---|
25+
| `GetVersion` | - | add-in and API version |
26+
| `GetConfig` | [Options] | configured repositories, resulting source |
27+
| `ListInstalled` | - | ACLib modules in the current database (`<file>` from the codelib block) |
28+
| `Resolve` | Files, [Options] | read only: files incl. dependencies, references, tests, planned action (`import`/`skip`/`overwrite`), missing files |
29+
| `Import` | Files, [Options] | imports like the wizard form; imported/skipped files, missing dependencies, added/removed references, messages |
30+
31+
* Files: `"data/SqlTools.cls;text/String2.cls"`
32+
* Options: `"mode=missing|all|selected;tests=0|1;examples=0|1;source=config|local|github;repo=owner/name@branch"`
33+
(defaults: `mode=missing`, `tests=0`, `examples=0`, `source=config` = local repository if configured, otherwise GitHub `AccessCodeLib/AccessCodeLib@master`)
34+
35+
Result: `{"ok":true,...}` or `{"ok":false,"error":{"number":...,"source":"...","description":"..."}}` (no message boxes).
36+
37+
```json
38+
{"ok":true,"source":"local","repository":"C:\CodeLib\AccessCodeLib\\","mode":"missing","tests":false,"examples":false,
39+
"files":[{"name":"String2","file":"text/String2.cls","type":"class","action":"import"},
40+
{"name":"_AccessCodeLib_license","file":"_codelib/license.bas","type":"module","action":"skip"},
41+
{"name":"StringTools","file":"text/StringTools.bas","type":"module","action":"import"}],
42+
"missing":[],"references":{"added":[],"removed":[]},"executes":[],"messages":[]}
43+
```
44+
45+
Notes:
46+
* The add-in and the target database must be in trusted locations. Otherwise Access shows a
47+
security prompt (the call blocks) or disables code.
48+
* `Import` stops before importing if a selected file is not available. Missing dependencies are
49+
skipped (as in the wizard form) and listed in `missing`.
50+
* Compile the project after `Import` and check the result.
51+
* With [msaccess-vcs-mcp](https://github.com/joyfullservice/msaccess-vcs-mcp):
52+
`vcs_call_vba(database_path="<target>.accdb", function_name="<add-in path without .accda>.API", args=["Resolve", "text/String2.cls"])`

‎source/dbs-properties.json‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@
6868
"Value": 0,
6969
"Type": 4
7070
},
71+
"Default Zoom Level": {
72+
"Value": 100,
73+
"Type": 4
74+
},
7175
"DesignMasterID": {
7276
"Value": "",
7377
"Type": 15
@@ -101,7 +105,7 @@
101105
"Type": 4
102106
},
103107
"NavPane Width": {
104-
"Value": 591,
108+
"Value": 545,
105109
"Type": 4
106110
},
107111
"Never Cache": {

‎source/documents.json‎

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,26 @@
66
"Items": {
77
"Databases": {
88
"SummaryInfo": {
9-
"Author": "Josef Pötzl",
10-
"Comments": "Access add-in for importing elements from the Access Code Library.",
11-
"Company": "access-codelib.net",
12-
"Manager": "Josef Pötzl",
13-
"Title": "Access Code Library - Import Wizard"
14-
}
15-
},
16-
"Tables": {
17-
"tab1DS": {
18-
"Description": "Tabelle mit einem DS (ist in Abfragen hilfeich)"
9+
"Author": {
10+
"Type": 10,
11+
"Value": "Josef Pötzl"
12+
},
13+
"Comments": {
14+
"Type": 10,
15+
"Value": "Access add-in for importing elements from the Access Code Library."
16+
},
17+
"Company": {
18+
"Type": 10,
19+
"Value": "access-codelib.net"
20+
},
21+
"Manager": {
22+
"Type": 10,
23+
"Value": "Josef Pötzl"
24+
},
25+
"Title": {
26+
"Type": 10,
27+
"Value": "Access Code Library - Import Wizard"
28+
}
1929
}
2030
}
2131
}

0 commit comments

Comments
 (0)