@sunnydayfund/sunrise-sdk v0.2.8
Sunrise SDK
To build from current state of API code:
- Navigate to
core/& run the following command:
nest startThen press Ctrl+C to stop execution of the Nest app. The startup process will place a file called swagger-spec.json in the sdk/ directory.
- Navigate to the sdk/ directory & run this command:
npm run buildThis will run @openapitools/openapi-generator-cli and place the newly generated code in the sdk/lib directory, then run the TypeScript compiler on the generated library in lib/dist/.
Note: You must have Java 11 installed in order to use the latest version of the OpenAPITools generator via npx. You can achieve this by running the following commands:
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk11Or by downloading the appropriate installer for Windows{:target="_blank"}
You will then need to add Java to your path. Add the following lines to a system config file, such as ~/.bash_profile or ~/.zshrc:
JAVA_HOME=$(/usr/libexec/java_home -v 11)
export PATH=$JAVA_HOME/bin:$PATHTo test locally:
- Navigate to
sdk/and runnpm link. - Navigate to your client application directory and run
npm link @sunnydayfund/sunrise-sdk. This will create a symbolic link in your app'snode_modules/that will temporarily allow you to use the local build like any other dependency. This will be reset bynpm iand a variety of other commands.
To find out more about how this works, check out the npm-link documentation.
To use the most recent stable version from npmjs:
- Navigate to your project directory and run
npm i -S @sunnydayfund/sunrise-sdk. - Use the package as normally. TypeScript definitions are included, so code hints should be available in supported IDEs.