ApitaxJsClient - JavaScript client for apitax-js-client The API for the frontend of Apitax This SDK is automatically generated by the Swagger Codegen project:
- API version: 2
- Package version: 2
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
For Node.js
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install apitax-js-client --save
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your apitax-js-client from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('apitax-js-client')
in javascript files from the directory you ran the last
command above from.
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/apitax-js-client then install it via:
npm install YOUR_USERNAME/apitax-js-client --save
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
var ApitaxJsClient = require('apitax-js-client');
var defaultClient = ApitaxJsClient.ApiClient.instance;
// Configure API key authorization: Bearer
var Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix['Authorization'] = "Token"
var api = new ApitaxJsClient.ApiApi()
var driver = "driver_example"; // {String} The driver to use for the request. ie. github
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.getDriverApiCatalog(driver, callback);
All URIs are relative to https://localhost/apitax/2
Class | Method | HTTP request | Description |
---|---|---|---|
ApitaxJsClient.ApiApi | getDriverApiCatalog | GET /drivers/{driver}/api/catalog | Retrieve the api catalog |
ApitaxJsClient.ApiApi | getDriverApiStatus | GET /drivers/{driver}/api/status | Retrieve the status of an api backing a driver |
ApitaxJsClient.ApitaxApi | authenticate | POST /apitax/auth | Authenticate |
ApitaxJsClient.ApitaxApi | createUser | POST /drivers/{driver}/apitax/users/{user} | Create a new user |
ApitaxJsClient.ApitaxApi | deleteUser | DELETE /drivers/{driver}/apitax/users/{user} | Delete a user |
ApitaxJsClient.ApitaxApi | getConfig | GET /apitax/config | Retrieve the system config |
ApitaxJsClient.ApitaxApi | getLog | GET /apitax/logs/{log} | Retrieve the logs |
ApitaxJsClient.ApitaxApi | getUser | GET /drivers/{driver}/apitax/users/{user} | Retrieve a user |
ApitaxJsClient.ApitaxApi | getUserList | GET /drivers/{driver}/apitax/users | Retrieve a list of users |
ApitaxJsClient.ApitaxApi | refreshToken | POST /apitax/auth/refresh | Refreshes login token using refresh token |
ApitaxJsClient.ApitaxApi | saveUser | PUT /drivers/{driver}/apitax/users/{user} | Save a user |
ApitaxJsClient.ApitaxApi | systemStatus | GET /apitax/status | Retrieve the system status |
ApitaxJsClient.CommandtaxApi | command | POST /drivers/{driver}/commandtax/command | Execute a Command |
ApitaxJsClient.DriversApi | getDriverBlacklist | GET /drivers/{driver}/blacklist | Retrieve the blacklist in the driver |
ApitaxJsClient.DriversApi | getDriverConfig | GET /drivers/{driver}/config | Retrieve the config of a loaded driver |
ApitaxJsClient.DriversApi | getDriverList | GET /drivers | Retrieve the catalog of drivers |
ApitaxJsClient.DriversApi | getDriverStatus | GET /drivers/{driver}/status | Retrieve the status of a loaded driver |
ApitaxJsClient.DriversApi | getDriverWhitelist | GET /drivers/{driver}/whitelist | Retrieve the whitelist in the driver |
ApitaxJsClient.ScriptaxApi | createDriverScript | POST /drivers/{driver}/scriptax/scripts | Create a new script |
ApitaxJsClient.ScriptaxApi | deleteDriverScript | DELETE /drivers/{driver}/scriptax/scripts | Delete a script |
ApitaxJsClient.ScriptaxApi | getDriverScript | GET /drivers/{driver}/scriptax/scripts | Retrieve the contents of a script |
ApitaxJsClient.ScriptaxApi | getDriverScriptCatalog | GET /drivers/{driver}/scriptax/catalog | Retrieve the script catalog |
ApitaxJsClient.ScriptaxApi | renameDriverScript | PATCH /drivers/{driver}/scriptax/scripts | Rename a script |
ApitaxJsClient.ScriptaxApi | saveDriverScript | PUT /drivers/{driver}/scriptax/scripts | Save a script |
- ApitaxJsClient.AuthResponse
- ApitaxJsClient.Command
- ApitaxJsClient.ErrorResponse
- ApitaxJsClient.Execute
- ApitaxJsClient.Response
- ApitaxJsClient.Script
- ApitaxJsClient.ScriptCreate
- ApitaxJsClient.ScriptDelete
- ApitaxJsClient.ScriptRename
- ApitaxJsClient.ScriptSave
- ApitaxJsClient.User
- ApitaxJsClient.UserAuth
- ApitaxJsClient.UserCreate
- ApitaxJsClient.UserDelete
- ApitaxJsClient.UserSave
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header