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(cmd-api-server): missing pretsc npm script #500

Closed
petermetz opened this issue Jan 15, 2021 · 0 comments · Fixed by #501
Closed

fix(cmd-api-server): missing pretsc npm script #500

petermetz opened this issue Jan 15, 2021 · 0 comments · Fixed by #501
Assignees
Labels
API_Server bug Something isn't working dependencies Pull requests that update a dependency file
Milestone

Comments

@petermetz
Copy link
Contributor

Describe the bug

Currently the API server does not export it's OpenAPI generated Typescript client code because the generation does not happen to begin with due to the pretsc script not being defined (which is the one usually responsible for performing the code generation tasks).

To Reproduce

  1. clone the project
  2. open the file ./packages/cactus-cmd-api-server/package.json
  3. observe the lack of code generation tasks defined in there e.g. pretsc

Expected behavior

The API server should export it's client API definitions the same way the plugins do.

Logs/Stack traces

> @hyperledger/cactus-test-plugin-web-service-oidc@0.2.0 tsc /packages/cactus-test-plugin-web-service-oidc
> tsc --project ./tsconfig.json

src/test/typescript/integration/plugin-web-service-oidc/plug-in-to-api-server-and-authenticate.ts(20,39): error TS2307: Cannot find module '@hyperledger/cactus-plugin-kv-storage-memory' or its corresponding type declarations.
src/test/typescript/integration/plugin-web-service-oidc/plug-in-to-api-server-and-authenticate.ts(22,3): error TS2305: Module '"../../../../../node_modules/@hyperledger/cactus-api-client/dist/types/main/typescript"' has no exported member 'Configuration'.
src/test/typescript/integration/plugin-web-service-oidc/plug-in-to-api-server-and-authenticate.ts(23,3): error TS2305: Module '"../../../../../node_modules/@hyperledger/cactus-api-client/dist/types/main/typescript"' has no exported member 'HealthCheckResponse'.
src/test/typescript/integration/plugin-web-service-oidc/plug-in-to-api-server-and-authenticate.ts(196,73): error TS2339: Property 'apiV1ApiServerHealthcheckGet' does not exist on type 'DefaultApi & ApiClient'.

Screenshots

N/A

Cloud provider or hardware configuration:

Dev machine

Operating system name, version, build:

Ubuntu 20.04 LTS

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

main

Hyperledger Cactus Plugins/Connectors Used

N/A

Additional context

N/A

cc: @hartm @takeutak @sfuji822 @jonathan-m-hamilton

@petermetz petermetz added bug Something isn't working API_Server dependencies Pull requests that update a dependency file labels Jan 15, 2021
@petermetz petermetz added this to the v0.4.0 milestone Jan 15, 2021
@petermetz petermetz self-assigned this Jan 15, 2021
petermetz added a commit to petermetz/cacti that referenced this issue Jan 15, 2021
Adds the `pretsc` script that generates the Typescript
client files based on the openapi.json specs.

Also updated the openapi.json so that the healthcheck
endpoint has a shortened operation ID (which is a
separate, larger effort that is still pending across
the entire code-base so figured it's good to start
addressing it piece by piece at least while we are
at it).

Also added the axios dependency to the cmd-api-server
package since this is necessary for the exported
Typescript API client object to work properly
(it is being used for sending the HTTP requests)

Fixes hyperledger-cacti#500

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
(cherry picked from commit 2b7f1cc0adbab31382443d44072ef4e01f73cb88)
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit to petermetz/cacti that referenced this issue Jan 15, 2021
Adds the `pretsc` script that generates the Typescript
client files based on the openapi.json specs.

Also updated the openapi.json so that the healthcheck
endpoint has a shortened operation ID (which is a
separate, larger effort that is still pending across
the entire code-base so figured it's good to start
addressing it piece by piece at least while we are
at it).

Also added the axios dependency to the cmd-api-server
package since this is necessary for the exported
Typescript API client object to work properly
(it is being used for sending the HTTP requests)

Fixes hyperledger-cacti#500

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit that referenced this issue Jan 19, 2021
Adds the `pretsc` script that generates the Typescript
client files based on the openapi.json specs.

Also updated the openapi.json so that the healthcheck
endpoint has a shortened operation ID (which is a
separate, larger effort that is still pending across
the entire code-base so figured it's good to start
addressing it piece by piece at least while we are
at it).

Also added the axios dependency to the cmd-api-server
package since this is necessary for the exported
Typescript API client object to work properly
(it is being used for sending the HTTP requests)

Fixes #500

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
(cherry picked from commit 2b7f1cc0adbab31382443d44072ef4e01f73cb88)
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API_Server bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant