-
Notifications
You must be signed in to change notification settings - Fork 6
refactor(spec): PoC - TypeSpec #45
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
Open
dschmidt
wants to merge
45
commits into
opencloud-eu:main
Choose a base branch
from
dschmidt:refactor/typespec-poc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
2b569c4
feat(spec): scaffold TypeSpec sources for me namespace
dschmidt 0b20e27
refactor(spec): apply emitter patterns to me namespace
dschmidt b4e56b9
feat(spec): add drives namespace with full driveItem schema
dschmidt c154ec8
feat(spec): cover me/drive convenience routes + v1beta1 driveItem ops
dschmidt dd7aa97
feat(spec): add sharing/permissions surface for drives + driveItems
dschmidt bcfb875
feat(spec): cover users, groups, invitations, activities
dschmidt fa4af6a
feat(spec): cover education, applications, roleManagement, tags
dschmidt 036fad0
fix(spec): drop descriptions on remaining direct $ref properties
dschmidt 5a6e4c7
feat(spec): mark unique-item query params + complete appRoleAssignment
dschmidt c278869
feat(spec): match CollectionOfX schema naming + ExportPersonalDataReq…
dschmidt 364b644
fix(spec): inline ad-hoc body+enum to avoid extra schema components
dschmidt 382f5fd
build: regenerate api/openapi-spec/v1.0.yaml from TypeSpec in CI + Ma…
dschmidt 494b45e
refactor(spec): move per-domain schemas out of models.tsp + restore docs
dschmidt b8b1aef
feat(spec): add GET /v1.0/drives/{drive-id}/items/{item-id}/children
dschmidt bf7e814
docs(spec): refresh stale comments + write up the writeOnly trade-off
dschmidt bb6e642
refactor(spec): introduce LibreGraphOps templates + apply to education
dschmidt 84b9d7a
refactor(spec): share driveItem operation shape via DriveItemOps inte…
dschmidt 67c5c8c
refactor(spec): drop misleading Me-prefix on cross-domain response types
dschmidt b2b6209
refactor(spec): move drive-shared models from me.tsp to drives.tsp
dschmidt 6f23c34
refactor(spec): share response shapes via generic Retrieved/Created/N…
dschmidt f379afa
refactor(spec): route /me/drive/root/children through DriveItemOps.li…
dschmidt 65b2fa8
feat(spec): add GET /v1.0/drives/{drive-id}/root/children
dschmidt a84de5a
refactor(spec): share permission/link/invite operation shape via Perm…
dschmidt a1be850
refactor(spec): move drive-anchored sharing routes from permissions.t…
dschmidt 114f06c
build: self-document Makefile targets via inline ## comments
dschmidt a73b07a
build: keep `make` (no args) defaulting to compiling the spec
dschmidt f6e392d
fix(build): rebuild spec when TypeSpec sources change
dschmidt d0ec901
fix(spec): silence openapi3 $-in-component-key warnings in education.tsp
dschmidt d415f21
refactor(spec): share OData collection shape via Collection model tem…
dschmidt 7d86466
refactor(spec): split big domain files by kind (models/templates/routes)
dschmidt cb8bfd6
fix(spec): restore writeOnly on passwordProfile.password + describe P…
dschmidt 3eb6558
fix(ci): quote interpolated CI_COMMIT_MESSAGE/AUTHOR/EMAIL settings
dschmidt 5d969bd
refactor(spec): move domain-specific models out of common.models.tsp
dschmidt 65a6897
fix(spec): restore readOnly markers that were dropped during the Type…
dschmidt 73a4876
fix(spec): restore auth security schemes that were dropped during the…
dschmidt 75fa28e
fix(spec): restore datetime pattern: regex constraints
dschmidt c65121b
fix(spec): restore examples, deprecated marker, and nullable field
dschmidt 8bc3c4e
fix(spec): drop bearerFormat extension that openapi-generator-cli rej…
dschmidt cca242e
docs(spec): keep the bearerFormat extension as a commented-out reminder
dschmidt 61ccf53
fix: address Copilot review comments on #45
dschmidt 2265078
fix(build): always run npm ci, drop the lockfile-timestamp gate
dschmidt 85208d8
fix: address second round of Copilot review comments on #45
dschmidt d55b7e8
fix(spec): split auth scheme declarations into auth.tsp at global nam…
dschmidt 099e4ac
fix(spec): re-enable GetActivities @opExample using utcDateTime.fromISO
dschmidt 02cb5fd
build(spec): bump TypeSpec to 1.13.0-dev and drop #10677 workaround
dschmidt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,11 @@ | ||
| composer.lock | ||
| vendor | ||
| tmp | ||
| tmp | ||
|
|
||
| # Generated by `make spec` (`scripts/compile-spec.sh`). | ||
| api/openapi-spec/v1.0.yaml | ||
|
|
||
| # Local build artefacts. | ||
| build/ | ||
| spec/build/ | ||
| spec/node_modules/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # libre-graph-api local build entry points. | ||
| # | ||
| # `make` (or `make spec`) compiles the TypeSpec sources under spec/ into | ||
| # api/openapi-spec/v1.0.yaml. Per-language client generation targets pull the | ||
| # matching openapi-generator-cli image straight out of the woodpecker pipeline | ||
| # file for that language, so renovatebot remains the single source of truth | ||
| # for the generator version. | ||
|
|
||
| SPEC := api/openapi-spec/v1.0.yaml | ||
| SPEC_SOURCES := $(wildcard spec/*.tsp) spec/tspconfig.yaml spec/package.json spec/package-lock.json | ||
| NODE_IMAGE := node:22-alpine | ||
|
|
||
| # Extract `openapitools/openapi-generator-cli:<tag>@sha256:<digest>` from the | ||
| # .woodpecker pipeline file for the given language. | ||
| # $(call generator_image,go) | ||
| # $(call generator_image,typescript-axios) | ||
| generator_image = $(shell grep -oE "openapitools/openapi-generator-cli:[A-Za-z0-9._@:-]+" .woodpecker/build-$(1).yaml | head -n1) | ||
|
|
||
| DOCKER_RUN = docker run --rm \ | ||
| --user $(shell id -u):$(shell id -g) \ | ||
| -v "$(CURDIR):/work" \ | ||
| -w /work | ||
|
|
||
| .PHONY: all spec go typescript-axios php cpp-qt-client clean help | ||
|
|
||
| all: spec | ||
|
|
||
| help: ## Show this help | ||
| @echo "Common commands:" | ||
| @echo "" | ||
| @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' | ||
|
|
||
| spec: $(SPEC) ## Compile TypeSpec sources into api/openapi-spec/v1.0.yaml | ||
|
|
||
| $(SPEC): $(SPEC_SOURCES) | ||
| $(DOCKER_RUN) -e HOME=/tmp -e npm_config_cache=/tmp/.npm $(NODE_IMAGE) sh scripts/compile-spec.sh | ||
|
|
||
|
dschmidt marked this conversation as resolved.
|
||
| go: $(SPEC) ## Generate the Go client into build/clients/go | ||
| $(DOCKER_RUN) -e OUTPUT_DIR=build/clients/go $(call generator_image,go) sh scripts/generate-go.sh | ||
|
|
||
| typescript-axios: $(SPEC) ## Generate the TypeScript-Axios client into build/clients/typescript-axios | ||
| $(DOCKER_RUN) -e OUTPUT_DIR=build/clients/typescript-axios $(call generator_image,typescript-axios) sh scripts/generate-typescript-axios.sh | ||
|
|
||
| php: $(SPEC) ## Generate the PHP client into build/clients/php | ||
| $(DOCKER_RUN) -e OUTPUT_DIR=build/clients/php $(call generator_image,php) sh scripts/generate-php.sh | ||
|
|
||
| cpp-qt-client: $(SPEC) ## Generate the C++/Qt client into build/clients/cpp-qt-client | ||
| $(DOCKER_RUN) -e OUTPUT_DIR=build/clients/cpp-qt-client $(call generator_image,cpp-qt) sh scripts/generate-cpp-qt-client.sh | ||
|
|
||
| clean: ## Remove build artefacts and the generated spec | ||
| rm -rf build/ spec/build/ $(SPEC) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.