@aziontech/azion-api-v4-sdk
v1.0.2
Published
OpenAPI client for @aziontech/azion-api-v4-sdk
Maintainers
Readme
@aziontech/azion-api-v4-sdk
TypeScript client for the Azion API v4, generated from its OpenAPI specification. It uses the Fetch API and ships its own type declarations.
Installation
npm install @aziontech/azion-api-v4-sdkUsage
Create a configuration with your personal token and pass it to the API classes. There is one
class per group of endpoints, such as ApplicationsApi, FunctionsApi or WAFsApi.
import { createConfiguration, ApplicationsApi } from "@aziontech/azion-api-v4-sdk";
const config = createConfiguration({
authMethods: {
TokenAuth: `Token ${process.env.AZION_TOKEN}`,
},
});
const applications = new ApplicationsApi(config);
const page = await applications.listApplications();Parameters
Each method takes a single object with its parameters, all named, so you only write the ones you need. For example, to filter the applications by a search term:
const page = await applications.listApplications({
search: "my-application",
pageSize: 50,
});The type of that object is exported as <Class><Method>Request, for example
ApplicationsApiListApplicationsRequest.
Base URL
Requests go to the first server declared in the OpenAPI specification (server1, exported by
the package). To use a different one, pass a baseServer:
import { createConfiguration, ServerConfiguration } from "@aziontech/azion-api-v4-sdk";
const config = createConfiguration({
baseServer: new ServerConfiguration("https://api.azion.com/v4", {}),
authMethods: {
TokenAuth: `Token ${process.env.AZION_TOKEN}`,
},
});Available APIs and models
Every API class, method and model is documented in the
docs/ folder
of the repository, one page per class.
Releases
Each version is listed, with the APIs and models it adds, changes or removes, in the GitHub Releases.
Contributing
This package is generated. Do not edit the code by hand: see the repository for how the SDK is generated and released.
License
MIT
