aboutsummaryrefslogtreecommitdiff
path: root/gtad
AgeCommit message (Collapse)Author
2022-09-04GTAD: Stop using eventloader.h in generated filesAlexey Rusakov
2022-06-18operation.cpp.mustache: streamline RequestData constructionAlexey Rusakov
That `std::move(_data)` never worked because the passed object is a precursor to RequestData, and RequestData always takes things by const-ref or by value, never by rvalue. Also, explicit mention of RequestData is unnecessary, as its constructors are implicit by design.
2022-06-11gtad: update submodule (again)Alexey Rusakov
2022-06-11gtad.yaml: Drop deprecated home_server field from login/registerAlexey Rusakov
2022-06-11gtad.yaml: Treat child rooms state as eventsAlexey Rusakov
2022-06-11gtad: update submoduleAlexey Rusakov
2022-06-11gtad.yaml: more clarifying commentsAlexey Rusakov
2022-06-07Add GTAD as a submoduleAlexey Rusakov
Code generation in libQuotient is pretty sensitive to GTAD version (or even a particular commit at times); so it makes sense to have GTAD as a submodule in order to control the revision CI uses. (amended with the GTAD commit that uses the right yaml-cpp commit)
2022-06-06GTAD: inline public_rooms_chunk.yamlAlexey Rusakov
Also: drop inlining PublicRoomResponse by the name because it's already inlined by $ref before that. This configuration needs the latest GTAD (revision 51c53ed3) to work correctly; earlier GTAD will produce FTBFS code.
2022-05-31gtad.yaml (again): shortcut OneTimeKeysAlexey Rusakov
This requires OneTimeKeys in keys.yaml to be marked as such (done in quotient-im/matrix-spec but it's not there in matrix-org/matrix-spec).
2022-05-31Update gtad.yml to match v3 API definitionsAlexey Rusakov
Also: use quotient-im/matrix-spec main branch again, now that it has adjusted definitions; drop un(der)used partials
2022-01-23Omittable: split out from util.h and refreshAlexey Rusakov
Improvements: - Quotient::lift() - a way to invoke a function on an optional (including Omittable) or a pointer if it's 'truthy'. Doesn't need enhanced function_traits<>, only the standard library; works on any number of arguments that can be dereferenced and casted to bool. - then() - the version of lift() as a member function. - edit() was renamed to ensure() (edit() might become a read-write counterpart of then() at some point). It's not really used across libQuotient codebase (or elsewhere) but is staying there just in case. It can also accept an initializer, removing the requirement of default-constructibility. - Quotient::merge() is simplified, with one universal implementation covering both Omittable/optional and plain values. - All that now lives in its dedicated pair of files, further decluttering util.h
2021-12-29operation.h.mustache: Add QUOTIENT_APIAlexey Rusakov
2021-10-04BaseJob: percent-encode variable path partsAlexey Rusakov
This is meant to spare clients from having to percent-encode room aliases, v3 event ids etc. that happen to hit the endpoint path. It is unfair to expect clients to do that since they are not supposed to care about the shape of CS API, which parameter should be encoded in which way. The trick (together with the slightly updated GTAD configuration) is to percent-encode parts that happen to be QStrings and not `const char[]`'s while passing all constant parts as plain C character literals. This also allows to make it more certain that the path is correctly encoded by passing and storing QByteArray's wherever the path is already encoded, and only use QStrings (next to const char arrays) before that. Since the change alters the API contract (even if that contract was crappy), some crude detection of percent-encoded stuff on input is inserted; if input is already percent-encoded, a warning is put to the logs, alerting developers about the change.
2021-10-04gtad.yaml: make _rightQuote example less trivialAlexey Rusakov
2021-08-22Mustache: avoid BaseJob::DataAlexey Rusakov
It's about to be deprecated in the next commits.
2021-08-07gtad.yaml: use QUrl where API uses 'format: uri'Alexey Rusakov
2021-07-02Abandon BaseJob::Query - Mustache templateAlexey Rusakov
2021-06-30Add a commented out delimiter override exampleAlexey Rusakov
2021-06-28gtad.yaml: update for use with GTAD pre-0.8Alexey Rusakov
2021-06-23*.mustache: Drop a stray leading end-of-lineAlexey Rusakov
An SPDX comment in the source code did not collapse entirely.
2021-06-23Update to the new matrix-doc layout and toolingAlexey Rusakov
Among things affecting Quotient, the update involved moving API files from api/ to data/api/, adding extensions to event schema files, and switching from ReStructured Text to Markdown as a lightweight markup language. This commit updates the build system and GTAD configuration to accommodate for these. The build system is also more robust now in choosing whether the update-api target should be provided. Previously the target was provided whenever GTAD_PATH and MATRIX_DOC_PATH were specified, even if they did not point to anything valid. CMake now checks that MATRIX_DOC_PATH is an actual directory and that GTAD_PATH points to an actual file. # Conflicts: # CMakeLists.txt
2021-01-16Updated copyright statements upon Git auditKitsune Ral
After going through all the files and the history of commits on them it was clear that some copyright statements are obsolete (the code has been overwritten since) and some are missing. This commit tries best to remedy that, along with adding SPDX tags where they were still not used. Also, a minimal SPDX convention is documented for further contributions. Closes #426.
2020-06-19Rename a few 'data' responsesKitsune Ral
2020-06-19*.h.mustache: minor fixesKitsune Ral
The Quotient:: workaround seems no more necessary.
2020-06-18gtad: restrict the identifier regexKitsune Ral
2020-06-07gtad/*: optimise and use latest GTAD featuresKitsune Ral
- The generated code is updated to be compatible with the BaseJob changes introduced in the previous commit. This includes greatly reducing the number of header files that have to be explicitly #included, as basejob.h now #includes converters.h. Also, thanks to the changes in BaseJob, none of generated job classes needs a pimpl Private class. - gtad/template.*.mustache files are replaced with data.h.mustache for data structures (entirely defined in header files from now on) and operation.*.mustache for API operations (also massively moved to header files, possibly also becoming header-only in the future). - New variable-dropping and title-overring features in GTAD 0.7 allow to use the upstream matrix-doc repo to generate the code. - CMakeLists.txt makes use of file globbing with CONFIGURE_DEPENDS where possible to alleviate build reconfiguration after a GTAD call.
2020-06-01GTAD parts: new home and format updates for GTAD 0.7Kitsune Ral
All GTAD-related files (gtad.yaml and templates) from now live in their dedicated gtad/ directory - this helps against removing them accidentally along with the rest of the generated files. The format to list generated files in gtad.yaml has changed a bit before GTAD 0.7 beta2; gtad.yaml in this commit conforms to the new structure.