Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep only listed root resources #271

Merged
merged 43 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
85c14bb
First stab
ralfhandl Nov 20, 2023
904ca22
Suppress deep paths to unkept types
ralfhandl Nov 20, 2023
6ee9921
Stub references
ralfhandl Nov 20, 2023
20a43b4
README, TODO
ralfhandl Nov 20, 2023
1a732e4
0.24.1
ralfhandl Nov 20, 2023
ee2cdcd
Bump version and dependencies
ralfhandl Nov 20, 2023
cb6ead3
Update package-lock.json
ralfhandl Nov 20, 2023
5e9195c
Also keep contained entities
ralfhandl Nov 21, 2023
08d29ee
Update keep.test.js
ralfhandl Nov 21, 2023
6ad41b4
Keep types of contained entities
ralfhandl Dec 14, 2023
124d123
Keep entity types contained in kept entity types
ralfhandl Dec 14, 2023
102682c
Keep function import and its parameters and return types
ralfhandl Dec 14, 2023
d97770e
Action and function import
ralfhandl Dec 14, 2023
82f5f7b
Merge branch 'main' into feat/keep
ralfhandl Dec 14, 2023
2758b74
Update keep.test.js
ralfhandl Dec 14, 2023
acd2453
Merge branch 'feat/keep' of https://github.com/oasis-tcs/odata-openap…
ralfhandl Dec 14, 2023
5087abf
Expected diagram
ralfhandl Dec 14, 2023
f81b3e8
Simple diagram
ralfhandl Dec 14, 2023
7f91b0d
More diagrams
ralfhandl Dec 14, 2023
0d29f03
More to do
ralfhandl Dec 14, 2023
36e0cb1
Bump dependencies
ralfhandl Dec 14, 2023
6978f7d
Update package-lock.json
ralfhandl Dec 14, 2023
2bbfc26
0.25.0
ralfhandl Dec 14, 2023
faef9ba
Ignore bound overloads for keeping return types
ralfhandl Dec 15, 2023
15c3d7e
Bound actions and functions
ralfhandl Dec 15, 2023
c560526
Fix color bug in diagram
ralfhandl Dec 19, 2023
f22e20c
Merge branch 'main' into feat/keep
ralfhandl Dec 19, 2023
ddc1576
Merge branch 'main' into feat/keep
ralfhandl Dec 20, 2023
13e638d
Adjust to incoming change
ralfhandl Dec 20, 2023
ce33f96
Only rootResources, no types
ralfhandl Dec 20, 2023
fa878b4
Squashed two bugs
ralfhandl Dec 20, 2023
d7355fd
pretest to test cli wiring
ralfhandl Dec 21, 2023
17fde13
Cleanup
ralfhandl Dec 21, 2023
05136be
Merge branch 'main' into feat/keep
ralfhandl Jan 16, 2024
2f30352
Extract and test CLI logic (#275)
ralfhandl Jan 17, 2024
5864ca0
Merge branch 'main' into feat/keep
ralfhandl Jan 17, 2024
92ffa0f
Update cliParts.test.js
ralfhandl Jan 17, 2024
564d6b0
bump dependencies
ralfhandl Jan 29, 2024
56ce87a
Update package-lock.json
ralfhandl Jan 29, 2024
9af4188
Merge branch 'main' into feat/keep
ralfhandl Jan 29, 2024
b80abf1
Inline stub object
ralfhandl Jan 29, 2024
9577cea
Bump dependencies
ralfhandl Feb 1, 2024
e991a25
Update package-lock.json
ralfhandl Feb 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.25.0] - 2024-01-12

### Added

- Command-line option `--keep` (short `-k`) to specify which root resources (entity sets, singletons, action imports, function imports) to keep.
- Paths for the root resources are kept, as are paths to contained entities and bound actions and functions.
- Types referenced by the (return) type of root resources via structural properties or containment navigation properties are also kept.
- Non-containment navigation properties to entity types not kept are changed to use a generic stub object type without properties.
- Deep paths to stubbed entity types are omitted.
- The `/$batch` resource is omitted.

## [0.24.2] - 2024-01-16

### Fixed
Expand Down
1 change: 1 addition & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Options:
-d, --diagram include YUML diagram
-h, --help show this info
--host host (default: localhost)
-k, --keep root resource to keep (can be specified multiple times with one name each)
--levels maximum number of path segments
-o, --openapi-version 3.0.0 to 3.0.3 or 3.1.0 (default: 3.0.2)
-p, --pretty pretty-print JSON result
Expand Down
7 changes: 7 additions & 0 deletions lib/cliParts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function parseArgs(argv) {
-d, --diagram include YUML diagram
-h, --help show this info
--host host (default: localhost)
-k, --keep root resource to keep (can be specified multiple times with one name each)
--levels maximum number of path segments
-o, --openapi-version 3.0.0 to 3.0.3 or 3.1.0 (default: 3.0.2)
-p, --pretty pretty-print JSON result
Expand All @@ -30,6 +31,7 @@ function parseArgs(argv) {
"basePath",
"description",
"host",
"keep",
"levels",
"openapi-version",
"scheme",
Expand All @@ -40,6 +42,7 @@ function parseArgs(argv) {
alias: {
d: "diagram",
h: "help",
k: "keep",
o: "openapi-version",
p: "pretty",
t: "target",
Expand Down Expand Up @@ -77,6 +80,10 @@ function parseArgs(argv) {
case "description":
options.defaultDescription = value;
break;
case "keep":
if (Array.isArray(value)) options.rootResourcesToKeep = value;
else options.rootResourcesToKeep = [value];
break;
case "levels": {
const l = Number(value);
if (!isNaN(l)) options.maxLevels = l;
Expand Down
Loading
Loading