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

fix(clientapi): Use 'Endpoint' instead of 'Api' #1426

Merged
merged 5 commits into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class AdminClientApi(routeData: KnoraRouteData) extends ClientApi {
/**
* The name of this [[ClientApi]].
*/
override val name: String = "AdminApi"
override val name: String = "AdminEndpoint"

/**
* The directory name to be used for this API's code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import org.knora.webapi.util.{FileUtil, SmartIri, StringFormatter}
class TypeScriptBackEnd extends GeneratorBackEnd {
private implicit val stringFormatter: StringFormatter = StringFormatter.getGeneralInstance

// The directory where TypeScript compilation stubs are located.
private val mockCodeDir: Path = Paths.get("_test_data/typescript-client-mock-src").toAbsolutePath

/**
Expand Down Expand Up @@ -343,7 +344,7 @@ class TypeScriptBackEnd extends GeneratorBackEnd {

SourceCodeFilePath(
directoryPath = Seq("api", apiDef.directoryName),
filename = s"$apiLocalName-endpoint",
filename = s"$apiLocalName",
fileExtension = "ts"
)
}
Expand Down Expand Up @@ -382,23 +383,6 @@ class TypeScriptBackEnd extends GeneratorBackEnd {
)
}

/**
* Generates the file path of an interface.
*
* @param apiDef the API definition.
* @param className the name of the interface.
* @return the file path of the generated interface.
*/
private def makeInterfaceFilePath(apiDef: ClientApi, className: String): SourceCodeFilePath = {
val classLocalName: String = stringFormatter.camelCaseToSeparatedLowerCase(className)

SourceCodeFilePath(
directoryPath = Seq("interfaces", "models", apiDef.directoryName),
filename = s"i-$classLocalName",
fileExtension = "ts"
)
}

/**
* Generates a variable name that can be used for an instance of a class.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ClientApiRouteE2ESpec extends E2ESpec(ClientApiRouteE2ESpec.config) {
"./knora-api-config.ts",
"./knora-api-connection.ts",
"./api/endpoint.ts",
"./api/admin/admin-api-endpoint.ts",
"./api/admin/admin-endpoint.ts",
"./api/admin/users/users-endpoint.ts",
"./models/admin/user.ts"
)
Expand Down