@media-plans/ts-sdk
v0.25.11
Published
Typescript SDK for Media Plans API
Downloads
88
Readme
ts-sdk
Typescript SDK
Example
import { Api, ApiConfig } from "./Api";
const token = "TOKEN_VALUE"
let axiosConfig: ApiConfig = {
secure : true,
baseURL : "http://localhost:8080",
securityWorker: (accessToken) =>
accessToken ? { headers: { Authorization: `Bearer ${accessToken}` } } : {},
}
const api = new Api(axiosConfig)
api.setSecurityData(token)
const res = await api.users.getUsers()
console.log(res.data)
Update SDK
To update the SDK, the update.sh
script can be run. It will regenerate the module, commit the changes and bump the npm version and push to origin. Make sure the the backend is cloned on the parent folder. The script will attempt to generate from the OpenAPI documentation located at ../api/docs/swagger.yaml
.
Default will create a patch :
sh update "commit message"
Flags
--minor : Bump minor version
--major : Bump to major version