Skip to content
Permalink
Browse files

feat(api-v2): Remove client code generation (#1610)

  • Loading branch information
benjamingeer committed Feb 28, 2020
1 parent 73a0afe commit 6977ab3fa7a1e4cd5ea9cc157062c65045f36559
Showing with 2,119 additions and 8,898 deletions.
  1. +0 −192 docs/src/paradox/05-internals/design/client-api/index.md
  2. +0 −1 docs/src/paradox/05-internals/design/index.md
  3. +20 −14 ...src/paradox/05-internals/development/{generating-client-apis.md → generating-client-test-data.md}
  4. +1 −1 docs/src/paradox/05-internals/development/index.md
  5. +3 −1 webapi/_test_data/all_data/admin-data.ttl
  6. +3 −128 webapi/src/main/scala/org/knora/webapi/OntologyConstants.scala
  7. +13 −1 webapi/src/main/scala/org/knora/webapi/SharedTestDataADM.scala
  8. +0 −1,899 ...a/webapi/messages/v2/responder/ontologymessages/KnoraAdminToApiV2ComplexTransformationRules.scala
  9. +3 −1 ...i/src/main/scala/org/knora/webapi/messages/v2/responder/ontologymessages/OntologyMessagesV2.scala
  10. +3 −12 ...n/scala/org/knora/webapi/messages/v2/responder/ontologymessages/OntologyTransformationRules.scala
  11. +4 −8 webapi/src/main/scala/org/knora/webapi/responders/v2/OntologyResponderV2.scala
  12. +14 −45 webapi/src/main/scala/org/knora/webapi/routing/ClientApiRoute.scala
  13. +3 −144 webapi/src/main/scala/org/knora/webapi/routing/admin/AdminClientApi.scala
  14. +21 −122 webapi/src/main/scala/org/knora/webapi/routing/admin/GroupsRouteADM.scala
  15. +23 −138 webapi/src/main/scala/org/knora/webapi/routing/admin/ListsRouteADM.scala
  16. +6 −60 webapi/src/main/scala/org/knora/webapi/routing/admin/PermissionsRouteADM.scala
  17. +32 −251 webapi/src/main/scala/org/knora/webapi/routing/admin/ProjectsRouteADM.scala
  18. +1 −1 webapi/src/main/scala/org/knora/webapi/routing/admin/StoreRouteADM.scala
  19. +30 −275 webapi/src/main/scala/org/knora/webapi/routing/admin/UsersRouteADM.scala
  20. +10 −14 webapi/src/main/scala/org/knora/webapi/routing/v2/ListsRouteV2.scala
  21. +12 −17 webapi/src/main/scala/org/knora/webapi/routing/v2/OntologiesRouteV2.scala
  22. +36 −41 webapi/src/main/scala/org/knora/webapi/routing/v2/ResourcesRouteV2.scala
  23. +8 −13 webapi/src/main/scala/org/knora/webapi/routing/v2/SearchRouteV2.scala
  24. +5 −74 webapi/src/main/scala/org/knora/webapi/routing/v2/V2ClientApi.scala
  25. +106 −111 webapi/src/main/scala/org/knora/webapi/routing/v2/ValuesRouteV2.scala
  26. +148 −0 webapi/src/main/scala/org/knora/webapi/util/ClientApi.scala
  27. +14 −46 webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala
  28. +0 −971 webapi/src/main/scala/org/knora/webapi/util/clientapi/ClientApi.scala
  29. +0 −492 webapi/src/main/scala/org/knora/webapi/util/clientapi/ClientCollectionTypeParser.scala
  30. +0 −157 webapi/src/main/scala/org/knora/webapi/util/clientapi/GeneratorBackEnd.scala
  31. +0 −637 webapi/src/main/scala/org/knora/webapi/util/clientapi/GeneratorFrontEnd.scala
  32. +0 −684 webapi/src/main/scala/org/knora/webapi/util/clientapi/TypeScriptBackEnd.scala
  33. +0 −53 webapi/src/main/twirl/clientapi/typescript/generateKnoraApiConnection.scala.txt
  34. +0 −57 webapi/src/main/twirl/clientapi/typescript/generateTypeScriptClass.scala.txt
  35. +0 −62 webapi/src/main/twirl/clientapi/typescript/generateTypeScriptEndpoint.scala.txt
  36. +0 −59 webapi/src/main/twirl/clientapi/typescript/generateTypeScriptMainEndpoint.scala.txt
  37. +3 −4 webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologyWithValueObjects.jsonld
  38. +1,456 −1,457 webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologyWithValueObjects.rdf
  39. +3 −4 webapi/src/test/resources/test-data/ontologyR2RV2/knoraApiOntologyWithValueObjects.ttl
  40. +18 −39 webapi/src/test/scala/org/knora/webapi/e2e/ClientApiRouteE2ESpec.scala
  41. +110 −253 webapi/src/test/scala/org/knora/webapi/e2e/InstanceChecker.scala
  42. +0 −45 webapi/src/test/scala/org/knora/webapi/e2e/InstanceCheckerSpec.scala
  43. +3 −3 webapi/src/test/scala/org/knora/webapi/e2e/admin/ProjectsADME2ESpec.scala
  44. +2 −2 webapi/src/test/scala/org/knora/webapi/responders/admin/ProjectsResponderADMSpec.scala
  45. +0 −25 webapi/src/test/scala/org/knora/webapi/util/StringFormatterSpec.scala
  46. +0 −175 webapi/src/test/scala/org/knora/webapi/util/clientapi/ClientCollectionTypeParserSpec.scala
  47. +0 −107 webapi/src/test/scala/org/knora/webapi/util/clientapi/SourceCodeFilePathSpec.scala
  48. +5 −2 webapi/src/test/scala/org/knora/webapi/util/jsonld/JsonLDUtilSpec.scala

This file was deleted.

@@ -27,6 +27,5 @@ License along with Knora. If not, see <http://www.gnu.org/licenses/>.
- [API v1 Design](api-v1/index.md)
- [API v2 Design](api-v2/index.md)
- [Admin API Design](api-admin/index.md)
- [Client API Code Generation Framework](client-api/index.md)

@@@
@@ -17,24 +17,30 @@ You should have received a copy of the GNU Affero General Public
License along with Knora. If not, see <http://www.gnu.org/licenses/>.
-->

# Generating Client API Code
# Generating Client Test Data

The following route returns a Zip file containing generated client API
code for the specified target:
@@toc

```
HTTP GET to http://host/clientapi/TARGET
```
## Requirements

Generate test requests and responses for Knora's routes, to be used in testing
client code without the need for a running Knora instance.

## Implementation

Currently the only supported `TARGET` is `typescript`. For documentation
on defining client APIs, see
@ref:[Client API Code Generation Framework](../design/client-api/index.md).
A class for each Knora API extends the `ClientApi` trait.
A `ClientApi` contains one or more `KnoraRoute` implementations that extend
`ClientEndpoint`. Each endpoint provides functions that return generated
client test data.

To check whether the generated TypeScript code compiles, without actually
integrating it into `knora-api-js-lib`, use:
The route `ClientApiRoute` returns a Zip file containing generated test data.
returning source code in a Zip file.

## Usage

The following route returns a Zip file containing generated client test
data:

```
HTTP GET to http://host/clientapi/typescript?mock=true
HTTP GET to http://host/clientapitest
```

This adds mock TypeScript library dependencies.
@@ -35,6 +35,6 @@ License along with Knora. If not, see <http://www.gnu.org/licenses/>.
- [Profiling Knora](profiling.md)
- [Starting the Knora Stack inside Docker Container](docker-compose.md)
- [Updating Repositories](updating-repositories.md)
- [Generating Client API Code](generating-client-apis.md)
- [Generating Client Test Data](generating-client-test-data.md)

@@@
@@ -392,7 +392,9 @@ Die Internetpublikation macht das digitalisierte Korpus dieser Frühdrucke durc
knora-admin:projectLongname "Anything Project"^^xsd:string ;
knora-admin:projectDescription "Anything Project"^^xsd:string ;
knora-admin:status "true"^^xsd:boolean ;
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean .
knora-admin:hasSelfJoinEnabled "false"^^xsd:boolean ;
knora-admin:projectKeyword "things"^^xsd:string,
"arbitrary test data"^^xsd:string .

<http://rdfh.ch/users/9XBCrDV3SRa7kS1WwynB4Q> a knora-admin:User ;
knora-admin:username "anything.user01"^^xsd:string ;

0 comments on commit 6977ab3

Please sign in to comment.