Merge pull request #589 from openziti/node-sdk

Node.js SDK (#400)
This commit is contained in:
Michael Quigley 2024-05-01 16:03:25 -04:00 committed by GitHub
commit 7d2ae34880
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
125 changed files with 16335 additions and 5 deletions

97
.github/workflows/node-sdk.yml vendored Normal file
View File

@ -0,0 +1,97 @@
name: Build/Release Node SDK
on:
release:
types: [ published ]
push:
branches: [ main ]
paths-ignore:
- 'package.json'
- 'CHANGELOG.md'
pull_request:
branches: [ main ]
jobs:
build:
name: Build for Node-${{ matrix.node_ver }} ${{ matrix.config.target }}/${{ matrix.config.arch }}
runs-on: ${{ matrix.config.os }}
env:
BUILD_NUMBER: ${{ github.run_number }}
AWS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
strategy:
matrix:
config:
- { os: ubuntu-20.04, target: "linux", arch: "x64" }
node_ver: [ 20 ]
fail-fast: false
steps:
- name: Node Version
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_ver }}
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
- name: Get current zrok repo tag
id: tag
run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0)
- name: Update zrok NodeJS-SDK's package.json version based on current zrok repo git tag
if: github.ref == 'refs/heads/main'
run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm version ${{ steps.tag.outputs.TAG }} --no-git-tag-version --allow-same-version
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "Update package.json version to ${{ steps.tag.outputs.TAG }}" || echo "No changes to commit"
- name: Push changes to zrok NodeJS-SDK's package.json
if: github.ref == 'refs/heads/main'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Pull newly bumped zrok NodeJS-SDK semver
if: github.ref == 'refs/heads/main'
run: git pull
- name: Setup .npmrc
if: github.ref == 'refs/heads/main'
# Setup .npmrc file to prepare for possible publish to npm
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Build the zrok NodeJS-SDK
run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm install
npm run build
env:
BUILD_DATE: ${{ steps.date.outputs.date }}
- name: Publish production release
if: github.ref == 'refs/heads/main'
run: |
cd ${{ runner.workspace }}/${{ github.event.repository.name }}/sdk/nodejs/sdk
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: NPM Publish
if: github.ref == 'refs/heads/main'
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public

4
.gitignore vendored
View File

@ -7,10 +7,10 @@ etc/dev.yml
etc/dev-frontend.yml
# Dependencies
/node_modules/
node_modules/
# Artifacts
/dist/
dist/
# Generated files
.docusaurus

View File

@ -13,7 +13,17 @@ command -v openapi >/dev/null 2>&1 || {
}
command -v swagger-codegen 2>&1 || {
echo >&2 "command 'swagger-codegen. see: https://github.com/swagger-api/swagger-codegen for installation"
echo >&2 "command 'swagger-codegen' not installed. see: https://github.com/swagger-api/swagger-codegen for installation"
exit 1
}
command -v openapi-generator-cli 2>&1 || {
echo >&2 "command 'openapi-generator-cli' not installed. see: https://www.npmjs.com/package/@openapitools/openapi-generator-cli for installation"
exit 1
}
command -v realpath 2>&1 || {
echo >&2 "command 'realpath' not installed. see: https://www.npmjs.com/package/realpath for installation"
exit 1
}
@ -35,6 +45,9 @@ swagger generate client -P rest_model_zrok.Principal -f "$zrokSpec" -c rest_clie
echo "...generating js client"
openapi -s specs/zrok.yml -o ui/src/api -l js
echo "...generating ts client"
openapi-generator-cli generate -i specs/zrok.yml -o sdk/nodejs/sdk/src/zrok/api -g typescript-node
echo "...generating python client"
swagger-codegen generate -i specs/zrok.yml -o sdk/python/sdk/zrok -c $pythonConfig -l python

View File

@ -20,7 +20,7 @@ func main() {
}
shr, err := sdk.CreateShare(root, &sdk.ShareRequest{
BackendMode: sdk.TcpTunnelBackendMode,
BackendMode: sdk.ProxyBackendMode,
ShareMode: sdk.PublicShareMode,
Frontends: []string{"public"},
Target: "http-server",

View File

@ -0,0 +1,73 @@
# "http-server" SDK Example
This `http-server` example is a minimal `zrok` application that surfaces a basic http server over a private zrok share.
## Implementation
```js
let root = zrok.Load()
```
The `root` is a structure that contains all of the user's environment detail and allows the SDK application to access the `zrok` service instance and the underlying OpenZiti network.
```js
let shr = await zrok.CreateShare(root, new zrok.ShareRequest(zrok.PROXY_BACKEND_MODE, zrok.PRIVATE_SHARE_MODE, "http-server", ["private"]));
console.log(`access your private HTTP Server on another machine using: 'zrok access private ${shr.Token}'`)
```
The `zrok.CreateShare` call uses the loaded `environment` root along with the details of the share request (`zrok.ShareRequest`) to create the share that will be used to access the `http-server`.
We are using the `zrok.PROXY_BACKEND_MODE` to handle tcp traffic. This time we are using `zrok.PRIVATE_SHARE_MODE` to take advantage of a private share that is running. With that we set which frontends to listen on, so we use whatever is configured, `private` here.
Further down we emit where to access the service.
Then we create a NodeJS Express web server that is configured to listen for ONLY incoming Ziti connections. No TCP connections from the open internet are possible.
```js
let app = zrok.express( shr.Token );
...
app.listen(undefined, () => {
console.log(`private HTTP Server is now listening for incoming requests`)
})
...
app.get('/', function(_: Request, res: any){
...
}
```
Then we create a signal handler that catches CTRL-C. When that signal is caught, we tear down teh zrok share, and exit the process.
```js
process.on('SIGINT', async () => {
console.log("Now deleting your private zrok share...")
await zrok.DeleteShare(root, shr)
process.exit(15);
});
```
## How to execute this example
You should first set up and enable your local `zrok` environment. Then execute the following cmds:
```cmd
npm install
node dist/index.js http-server
```
When the example app begins execution, you should see output on the console that resembles the following:
```
Now creating your private zrok share...
access your private HTTP Server on another machine using: 'zrok access private <SOME_TOKEN>'
private HTTP Server is now listening for incoming requests
```
Later, when you are done using the http-server, you can press CTRL_C, and the app will shut down, like this:
```
Now deleting your private zrok share...
```

View File

@ -0,0 +1,18 @@
{
"dependencies": {
"commander": "^11.1.0",
"express": "^4.18.2",
"path": "^0.12.7",
"readline-sync": "^1.4.10",
"@openziti/zrok": "^0.1.0"
},
"devDependencies": {
"@types/node": "^20.9.0",
"nodemon": "^3.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.4.3"
},
"scripts": {
"build": "npx tsc"
}
}

View File

@ -0,0 +1,55 @@
const { Command } = require("commander");
const zrok = require("zrok")
const program = new Command();
program
.command('http-server')
.version("1.0.0")
.description("command to host an HTTP Server")
.action(async () => {
// Load the zrok env
let root = zrok.Load()
// Authenticate with the Ziti network
await zrok.init( root ).catch(( err: Error ) => { console.error(err); return process.exit(1) });
// Set this to a larger value (e.g. 10) to trace lower-level Ziti SDK activity
zrok.setLogLevel(0)
// Create the zrok private share that will represent this web server
console.log("Now creating your private zrok share...")
let shr = await zrok.CreateShare(root, new zrok.ShareRequest(zrok.PROXY_BACKEND_MODE, zrok.PRIVATE_SHARE_MODE, "http-server", []));
console.log(`access your private HTTP Server on another machine using: 'zrok access private ${shr.Token}'`)
// Create a NodeJS Express web server that listens NOT on a TCP port, but for incoming Ziti connections to the private zrok share
let app = zrok.express( shr.Token );
// Set up a simple route
let reqCtr = 0;
app.get('/', function(_: Request, res: any){
reqCtr++;
console.log(`received a GET request... reqCtr[${reqCtr}]`);
res.write(`Hello zrok! reqCtr[${reqCtr}]`)
res.end()
});
// Start listening for incoming requests
app.listen(undefined, () => {
console.log(`private HTTP Server is now listening for incoming requests`)
})
// Delete the private share upon CTRL-C
process.on('SIGINT', async () => {
console.log("Now deleting your private zrok share...")
await zrok.DeleteShare(root, shr)
process.exit(15);
});
});
program.parse(process.argv)
const options = program.opts();

View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"strict": true,
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}

View File

@ -0,0 +1,18 @@
{
"dependencies": {
"commander": "^11.1.0",
"express": "^4.18.2",
"path": "^0.12.7",
"readline-sync": "^1.4.10",
"@openziti/zrok": "^0.1.0"
},
"devDependencies": {
"@types/node": "^20.9.0",
"nodemon": "^3.0.1",
"ts-node": "^10.9.1",
"typescript": "^5.4.3"
},
"scripts": {
"build": "npx tsc"
}
}

View File

@ -0,0 +1,90 @@
const { Command } = require("commander");
const zrok = require("@openziti/zrok")
var readlineSync = require('readline-sync');
const program = new Command();
program
.command('copyto')
.version("1.0.0")
.description("command to host content to be pastedfrom'd")
.action(async () => {
var data = readlineSync.question('Input some text... ');
console.log("data is: ", data)
var enc = new TextEncoder();
var buf = enc.encode(data); //
zrok.setLogLevel(0)
let root = zrok.Load()
await zrok.init( root ).catch(( err: Error ) => { console.error(err); return process.exit(1) });
console.log("setting up zrok.CreateShare...")
let shr = await zrok.CreateShare(root, new zrok.ShareRequest(zrok.TCP_TUNNEL_BACKEND_MODE, zrok.PRIVATE_SHARE_MODE, "pastebin", []));
console.log(`access your pastebin using 'pastefrom ${shr.Token}'`)
zrok.listener(
shr.Token,
(data: any) => { // listenCallback
},
(data: any) => { // listenClientCallback
},
(data: any) => { // clientConnectCallback
// when we receive a client connection, then write the data to them
zrok.write(
data.client,
buf,
(data: any) => { // writeCallback
}
);
},
(data: any) => { // clientDataCallback
},
);
// Delete the private share upon CTRL-C
process.on('SIGINT', async () => {
console.log("Now deleting your private zrok share...")
await zrok.DeleteShare(root, shr)
process.exit(15);
});
});
program
.command('pastefrom <shrToken>')
.version("1.0.0")
.description("command to paste content from coptyo")
.action(async (shrToken: string) => {
zrok.setLogLevel(0)
let root = zrok.Load();
await zrok.init(root).catch((err: any) => {
console.log(err)
});
let acc = await zrok.CreateAccess(root, new zrok.AccessRequest(shrToken))
var dec = new TextDecoder("utf-8");
zrok.dialer(
root,
shrToken,
(data: any) => { // on_connect_cb
},
(data: any) => { // on_data_cb
console.log("data is: ", dec.decode(data));
process.exit(0);
},
);
process.on('SIGINT', async () => {
process.exit(15);
});
});
program.parse(process.argv)
const options = program.opts();

View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"strict": true,
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"esModuleInterop": true,
"moduleResolution": "node"
}
}

5559
sdk/nodejs/sdk/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
{
"name": "@openziti/zrok",
"version": "0.1.0",
"description": "SDK to enable programmatic use of the zrok sharing methods",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup --external request",
"test": "echo \\\"Error: no test specified\\\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/openziti/zrok.git"
},
"keywords": [
"security",
"network",
"peer-to-peer",
"reverse-proxy",
"zero-trust"
],
"author": "NetFoundry",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/openziti/zrok/issues"
},
"homepage": "https://github.com/openziti/zrok#readme",
"dependencies": {
"@openziti/ziti-sdk-nodejs": "^0.16.0",
"axios": "^1.6.8",
"express": "^4.19.2"
},
"exports": {
".": "./dist/index.js",
"./zrok": "./dist/zrok",
"./environment": "./dist/environment"
},
"imports": {
"./zrok": "./zrok"
},
"devDependencies": {
"@types/express": "^4.17.21",
"@types/isomorphic-fetch": "^0.0.39",
"ts-node": "^10.9.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2"
}
}

View File

@ -0,0 +1,26 @@
import { homedir } from "os"
import { join } from "node:path"
export function rootDir(): string {
return join(homedir(), ".zrok")
}
export function metadataFile(): string {
return join(rootDir(), "metadata.json")
}
export function configFile(): string {
return join(rootDir(), "config.json")
}
export function environmentFile(): string {
return join(rootDir(), "environment.json")
}
export function identitiesDir(): string {
return join(rootDir(), "identities")
}
export function identityFile(name: string): string {
return join(identitiesDir(), name + ".json")
}

View File

@ -0,0 +1,164 @@
import { configFile, environmentFile, identityFile, metadataFile, rootDir } from "./dirs";
import fs from "node:fs"
import { Configuration, MetadataApi, HTTPHeaders } from "../zrok/api"
const V = "v0.4"
export class Metadata {
V: string;
RootPath: string;
constructor(V: string, RootPath: string = "") {
this.V = V
this.RootPath = RootPath
}
}
export class ApiEndpoint {
endpoint: string
frm: string
constructor(endpoint: string, frm: string) {
this.endpoint = endpoint
this.frm = frm
}
}
export class Config {
ApiEndpoint: string
constructor(ApiEndpoint: string) {
this.ApiEndpoint = ApiEndpoint
}
}
export class Environment {
Token: string
ZitiIdentity: string
ApiEndpoint: string
constructor(Token: string, ZitiIdentity: string, ApiEndpoint: string) {
this.Token = Token
this.ZitiIdentity = ZitiIdentity
this.ApiEndpoint = ApiEndpoint
}
}
export class Root {
meta: Metadata
cfg: Config
env: Environment
constructor(meta: Metadata = new Metadata(V, rootDir()), cfg: Config, env: Environment) {
this.meta = meta
this.cfg = cfg
this.env = env
}
public HasConfig(): boolean {
return this.cfg !== undefined && Object.keys(this.cfg).length === 0
}
public async Client(): Promise<Configuration> {
let apiEndpoint = this.ApiEndpoint()
let conf = new Configuration({
basePath: apiEndpoint.endpoint + '/api/v1',
apiKey: this.env.Token,
})
let mapi = new MetadataApi(conf)
let ver: Promise<string> = mapi.version()
const regex : RegExp = new RegExp("^(refs/(heads|tags)/)?" + V);
await ver.then(v => {
if(!regex.test(v)) {
throw new Error("Expected a '" + V + "' version, received: '" + v+ "'")
}
})
return conf
}
public ApiEndpoint(): ApiEndpoint {
let apiEndpoint = "https://api.zrok.io"
let frm = "binary"
if (this.cfg.ApiEndpoint != "") {
apiEndpoint = this.cfg.ApiEndpoint
frm = "config"
}
let env = process.env.ZROK_API_ENDPOINT
if (env != null) {
apiEndpoint = env
frm = "ZROK_API_ENDPOINT"
}
if (this.IsEnabled()) {
apiEndpoint = this.env.ApiEndpoint
frm = "env"
}
return new ApiEndpoint(apiEndpoint.replace(/\/+$/, ""), frm)
}
public IsEnabled(): boolean {
return this.env !== undefined && Object.keys(this.env).length > 0
}
private PublicIdentityName(): string {
return "public"
}
public EnvironmentIdentityName(): string {
return "environment"
}
public ZitiIdentityNamed(name: string): string {
return identityFile(name)
}
}
export function Assert(): boolean {
if (rootExists()) {
let meta = loadMetadata()
return meta.V == V
}
return false
}
export function Load(): Root {
if (rootExists()) {
return new Root(loadMetadata(), loadConfig(), loadEnvironment())
}
throw new Error("unable to load root. Does not exist")
}
function rootExists(): boolean {
return fs.existsSync(metadataFile())
}
function loadMetadata(): Metadata {
let mf = metadataFile()
let data = fs.readFileSync(mf)
let serial = JSON.parse(data.toString())
return new Metadata(serial.v)
}
function loadConfig(): Config {
let cf = configFile()
if (fs.existsSync(cf)) { // the config.json file may not be present
let data = fs.readFileSync(cf)
let serial = JSON.parse(data.toString())
return new Config(serial.api_endpoint)
} else {
return new Config('')
}
}
function loadEnvironment(): Environment {
let ef = environmentFile()
let data = fs.readFileSync(ef)
let serial = JSON.parse(data.toString())
return new Environment(serial.zrok_token, serial.ziti_identity, serial.api_endpoint)
}

View File

@ -0,0 +1,7 @@
//module.exports = require("./environment");
export * from "./zrok/model"
export * from "./zrok/share"
export * from "./zrok/access"
export * from "./zrok/zrok"
export * from "./environment/dirs"
export * from "./environment/root"

View File

@ -0,0 +1,51 @@
import {Root} from "../environment/root"
import {
Share,
ShareApi,
AccessRequest,
AccessResponse,
AuthUser,
UnaccessRequest} from "./api"
import * as model from "./model"
export async function CreateAccess(root: Root, request: model.AccessRequest): Promise<model.Access> {
if (!root.IsEnabled()){
throw new Error("environment is not enabled; enable with 'zrok enable' first!")
}
let out: AccessRequest = {
envZId: root.env.ZitiIdentity,
shrToken: request.ShareToken
}
let conf = await root.Client()
let client = new ShareApi(conf)
let shr: AccessResponse = await client.access({body: out})
.catch(resp => {
throw new Error("unable to create access " + resp)
})
if (shr.frontendToken == undefined) {
throw new Error("expected frontend token from access. Got none")
}
if (shr.backendMode == undefined) {
throw new Error("expected backend mode from access. Got none")
}
return new model.Access(shr.frontendToken, request.ShareToken, shr.backendMode)
}
export async function DeleteAccess(root: Root, acc: model.Access): Promise<void> {
let out: UnaccessRequest = {
frontendToken: acc.Token,
shrToken: acc.ShareToken,
envZId: root.env.ZitiIdentity
}
let conf = await root.Client()
let client = new ShareApi(conf)
return client.unaccess({body:out})
.catch(resp => {
throw new Error("error deleting access " + resp)
})
}

View File

@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist

View File

@ -0,0 +1,24 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
git_push.sh

View File

@ -0,0 +1,49 @@
.gitignore
api.ts
api/accountApi.ts
api/adminApi.ts
api/apis.ts
api/environmentApi.ts
api/metadataApi.ts
api/shareApi.ts
model/accessRequest.ts
model/accessResponse.ts
model/authUser.ts
model/changePasswordRequest.ts
model/configuration.ts
model/createFrontendRequest.ts
model/createFrontendResponse.ts
model/createIdentity201Response.ts
model/createIdentityRequest.ts
model/deleteFrontendRequest.ts
model/disableRequest.ts
model/enableRequest.ts
model/enableResponse.ts
model/environment.ts
model/environmentAndResources.ts
model/frontend.ts
model/inviteRequest.ts
model/inviteTokenGenerateRequest.ts
model/loginRequest.ts
model/metrics.ts
model/metricsSample.ts
model/models.ts
model/overview.ts
model/passwordRequirements.ts
model/principal.ts
model/publicFrontend.ts
model/regenerateToken200Response.ts
model/regenerateTokenRequest.ts
model/registerRequest.ts
model/registerResponse.ts
model/resetPasswordRequest.ts
model/share.ts
model/shareRequest.ts
model/shareResponse.ts
model/sparkDataSample.ts
model/unaccessRequest.ts
model/unshareRequest.ts
model/updateFrontendRequest.ts
model/updateShareRequest.ts
model/verifyRequest.ts
model/verifyResponse.ts

View File

@ -0,0 +1 @@
7.4.0

View File

@ -0,0 +1,3 @@
// This is the entrypoint for the package
export * from './api/apis';
export * from './model/models';

View File

@ -0,0 +1,600 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { ChangePasswordRequest } from '../model/changePasswordRequest';
import { InviteRequest } from '../model/inviteRequest';
import { LoginRequest } from '../model/loginRequest';
import { RegenerateToken200Response } from '../model/regenerateToken200Response';
import { RegenerateTokenRequest } from '../model/regenerateTokenRequest';
import { RegisterRequest } from '../model/registerRequest';
import { RegisterResponse } from '../model/registerResponse';
import { ResetPasswordRequest } from '../model/resetPasswordRequest';
import { VerifyRequest } from '../model/verifyRequest';
import { VerifyResponse } from '../model/verifyResponse';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = '/api/v1';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum AccountApiApiKeys {
key,
}
export class AccountApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'key': new ApiKeyAuth('header', 'x-token'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: AccountApiApiKeys, value: string) {
(this.authentications as any)[AccountApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @param body
*/
public async changePassword (body?: ChangePasswordRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/changePassword';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "ChangePasswordRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async invite (body?: InviteRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/invite';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "InviteRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async login (body?: LoginRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
const localVarPath = this.basePath + '/login';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "LoginRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "string");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async regenerateToken (body?: RegenerateTokenRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RegenerateToken200Response; }> {
const localVarPath = this.basePath + '/regenerateToken';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RegenerateTokenRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: RegenerateToken200Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "RegenerateToken200Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async register (body?: RegisterRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RegisterResponse; }> {
const localVarPath = this.basePath + '/register';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RegisterRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: RegisterResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "RegisterResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async resetPassword (body?: ResetPasswordRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/resetPassword';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "ResetPasswordRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async resetPasswordRequest (body?: RegenerateTokenRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/resetPasswordRequest';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RegenerateTokenRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async verify (body?: VerifyRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VerifyResponse; }> {
const localVarPath = this.basePath + '/verify';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "VerifyRequest")
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: VerifyResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "VerifyResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}

View File

@ -0,0 +1,469 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { CreateFrontendRequest } from '../model/createFrontendRequest';
import { CreateFrontendResponse } from '../model/createFrontendResponse';
import { CreateIdentity201Response } from '../model/createIdentity201Response';
import { CreateIdentityRequest } from '../model/createIdentityRequest';
import { DeleteFrontendRequest } from '../model/deleteFrontendRequest';
import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest';
import { PublicFrontend } from '../model/publicFrontend';
import { UpdateFrontendRequest } from '../model/updateFrontendRequest';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = '/api/v1';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum AdminApiApiKeys {
key,
}
export class AdminApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'key': new ApiKeyAuth('header', 'x-token'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: AdminApiApiKeys, value: string) {
(this.authentications as any)[AdminApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @param body
*/
public async createFrontend (body?: CreateFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateFrontendResponse; }> {
const localVarPath = this.basePath + '/frontend';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "CreateFrontendRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: CreateFrontendResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "CreateFrontendResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async createIdentity (body?: CreateIdentityRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateIdentity201Response; }> {
const localVarPath = this.basePath + '/identity';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "CreateIdentityRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: CreateIdentity201Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "CreateIdentity201Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async deleteFrontend (body?: DeleteFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/frontend';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "DeleteFrontendRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async inviteTokenGenerate (body?: InviteTokenGenerateRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/invite/token/generate';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "InviteTokenGenerateRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
*/
public async listFrontends (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<PublicFrontend>; }> {
const localVarPath = this.basePath + '/frontends';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Array<PublicFrontend>; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Array<PublicFrontend>");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async updateFrontend (body?: UpdateFrontendRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/frontend';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'PATCH',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "UpdateFrontendRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}

View File

@ -0,0 +1,22 @@
export * from './accountApi';
import { AccountApi } from './accountApi';
export * from './adminApi';
import { AdminApi } from './adminApi';
export * from './environmentApi';
import { EnvironmentApi } from './environmentApi';
export * from './metadataApi';
import { MetadataApi } from './metadataApi';
export * from './shareApi';
import { ShareApi } from './shareApi';
import * as http from 'http';
export class HttpError extends Error {
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
super('HTTP request failed');
this.name = 'HttpError';
}
}
export { RequestFile } from '../model/models';
export const APIS = [AccountApi, AdminApi, EnvironmentApi, MetadataApi, ShareApi];

View File

@ -0,0 +1,218 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { DisableRequest } from '../model/disableRequest';
import { EnableRequest } from '../model/enableRequest';
import { EnableResponse } from '../model/enableResponse';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = '/api/v1';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum EnvironmentApiApiKeys {
key,
}
export class EnvironmentApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'key': new ApiKeyAuth('header', 'x-token'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: EnvironmentApiApiKeys, value: string) {
(this.authentications as any)[EnvironmentApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @param body
*/
public async disable (body?: DisableRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/disable';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "DisableRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async enable (body?: EnableRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EnableResponse; }> {
const localVarPath = this.basePath + '/enable';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "EnableRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: EnableResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "EnableResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}

View File

@ -0,0 +1,782 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { Configuration } from '../model/configuration';
import { Environment } from '../model/environment';
import { EnvironmentAndResources } from '../model/environmentAndResources';
import { Frontend } from '../model/frontend';
import { Metrics } from '../model/metrics';
import { Overview } from '../model/overview';
import { Share } from '../model/share';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = '/api/v1';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum MetadataApiApiKeys {
key,
}
export class MetadataApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'key': new ApiKeyAuth('header', 'x-token'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: MetadataApiApiKeys, value: string) {
(this.authentications as any)[MetadataApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
*/
public async configuration (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Configuration; }> {
const localVarPath = this.basePath + '/configuration';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Configuration; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Configuration");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
*/
public async getAccountDetail (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Environment>; }> {
const localVarPath = this.basePath + '/detail/account';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Array<Environment>; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Array<Environment>");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param duration
*/
public async getAccountMetrics (duration?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Metrics; }> {
const localVarPath = this.basePath + '/metrics/account';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
if (duration !== undefined) {
localVarQueryParameters['duration'] = ObjectSerializer.serialize(duration, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Metrics; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Metrics");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param envZId
*/
public async getEnvironmentDetail (envZId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: EnvironmentAndResources; }> {
const localVarPath = this.basePath + '/detail/environment/{envZId}'
.replace('{' + 'envZId' + '}', encodeURIComponent(String(envZId)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'envZId' is not null or undefined
if (envZId === null || envZId === undefined) {
throw new Error('Required parameter envZId was null or undefined when calling getEnvironmentDetail.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: EnvironmentAndResources; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "EnvironmentAndResources");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param envId
* @param duration
*/
public async getEnvironmentMetrics (envId: string, duration?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Metrics; }> {
const localVarPath = this.basePath + '/metrics/environment/{envId}'
.replace('{' + 'envId' + '}', encodeURIComponent(String(envId)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'envId' is not null or undefined
if (envId === null || envId === undefined) {
throw new Error('Required parameter envId was null or undefined when calling getEnvironmentMetrics.');
}
if (duration !== undefined) {
localVarQueryParameters['duration'] = ObjectSerializer.serialize(duration, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Metrics; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Metrics");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param feId
*/
public async getFrontendDetail (feId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Frontend; }> {
const localVarPath = this.basePath + '/detail/frontend/{feId}'
.replace('{' + 'feId' + '}', encodeURIComponent(String(feId)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'feId' is not null or undefined
if (feId === null || feId === undefined) {
throw new Error('Required parameter feId was null or undefined when calling getFrontendDetail.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Frontend; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Frontend");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param shrToken
*/
public async getShareDetail (shrToken: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Share; }> {
const localVarPath = this.basePath + '/detail/share/{shrToken}'
.replace('{' + 'shrToken' + '}', encodeURIComponent(String(shrToken)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'shrToken' is not null or undefined
if (shrToken === null || shrToken === undefined) {
throw new Error('Required parameter shrToken was null or undefined when calling getShareDetail.');
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Share; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Share");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param shrToken
* @param duration
*/
public async getShareMetrics (shrToken: string, duration?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Metrics; }> {
const localVarPath = this.basePath + '/metrics/share/{shrToken}'
.replace('{' + 'shrToken' + '}', encodeURIComponent(String(shrToken)));
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
// verify required parameter 'shrToken' is not null or undefined
if (shrToken === null || shrToken === undefined) {
throw new Error('Required parameter shrToken was null or undefined when calling getShareMetrics.');
}
if (duration !== undefined) {
localVarQueryParameters['duration'] = ObjectSerializer.serialize(duration, "string");
}
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Metrics; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Metrics");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
*/
public async overview (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Overview; }> {
const localVarPath = this.basePath + '/overview';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: Overview; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "Overview");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
*/
public async version (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
const localVarPath = this.basePath + '/version';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
};
let authenticationPromise = Promise.resolve();
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "string");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}

View File

@ -0,0 +1,411 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import localVarRequest from 'request';
import http from 'http';
/* tslint:disable:no-unused-locals */
import { AccessRequest } from '../model/accessRequest';
import { AccessResponse } from '../model/accessResponse';
import { ShareRequest } from '../model/shareRequest';
import { ShareResponse } from '../model/shareResponse';
import { UnaccessRequest } from '../model/unaccessRequest';
import { UnshareRequest } from '../model/unshareRequest';
import { UpdateShareRequest } from '../model/updateShareRequest';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
import { HttpError, RequestFile } from './apis';
let defaultBasePath = '/api/v1';
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
export enum ShareApiApiKeys {
key,
}
export class ShareApi {
protected _basePath = defaultBasePath;
protected _defaultHeaders : any = {};
protected _useQuerystring : boolean = false;
protected authentications = {
'default': <Authentication>new VoidAuth(),
'key': new ApiKeyAuth('header', 'x-token'),
}
protected interceptors: Interceptor[] = [];
constructor(basePath?: string);
constructor(basePathOrUsername: string, password?: string, basePath?: string) {
if (password) {
if (basePath) {
this.basePath = basePath;
}
} else {
if (basePathOrUsername) {
this.basePath = basePathOrUsername
}
}
}
set useQuerystring(value: boolean) {
this._useQuerystring = value;
}
set basePath(basePath: string) {
this._basePath = basePath;
}
set defaultHeaders(defaultHeaders: any) {
this._defaultHeaders = defaultHeaders;
}
get defaultHeaders() {
return this._defaultHeaders;
}
get basePath() {
return this._basePath;
}
public setDefaultAuthentication(auth: Authentication) {
this.authentications.default = auth;
}
public setApiKey(key: ShareApiApiKeys, value: string) {
(this.authentications as any)[ShareApiApiKeys[key]].apiKey = value;
}
public addInterceptor(interceptor: Interceptor) {
this.interceptors.push(interceptor);
}
/**
*
* @param body
*/
public async access (body?: AccessRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: AccessResponse; }> {
const localVarPath = this.basePath + '/access';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "AccessRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: AccessResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "AccessResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async share (body?: ShareRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ShareResponse; }> {
const localVarPath = this.basePath + '/share';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "ShareRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: ShareResponse; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "ShareResponse");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async unaccess (body?: UnaccessRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/unaccess';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "UnaccessRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async unshare (body?: UnshareRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/unshare';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "UnshareRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async updateShare (body?: UpdateShareRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/share';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'PATCH',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "UpdateShareRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
}

View File

@ -0,0 +1,238 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
InviteRequest,
LoginRequest,
RegisterRequest,
RegisterResponse,
ResetPasswordRequest,
ResetPasswordRequestRequest,
VerifyRequest,
VerifyResponse,
} from '../models/index';
import {
InviteRequestFromJSON,
InviteRequestToJSON,
LoginRequestFromJSON,
LoginRequestToJSON,
RegisterRequestFromJSON,
RegisterRequestToJSON,
RegisterResponseFromJSON,
RegisterResponseToJSON,
ResetPasswordRequestFromJSON,
ResetPasswordRequestToJSON,
ResetPasswordRequestRequestFromJSON,
ResetPasswordRequestRequestToJSON,
VerifyRequestFromJSON,
VerifyRequestToJSON,
VerifyResponseFromJSON,
VerifyResponseToJSON,
} from '../models/index';
export interface InviteOperationRequest {
body?: InviteRequest;
}
export interface LoginOperationRequest {
body?: LoginRequest;
}
export interface RegisterOperationRequest {
body?: RegisterRequest;
}
export interface ResetPasswordOperationRequest {
body?: ResetPasswordRequest;
}
export interface ResetPasswordRequestOperationRequest {
body?: ResetPasswordRequestRequest;
}
export interface VerifyOperationRequest {
body?: VerifyRequest;
}
/**
*
*/
export class AccountApi extends runtime.BaseAPI {
/**
*/
async inviteRaw(requestParameters: InviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/invite`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: InviteRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async invite(requestParameters: InviteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.inviteRaw(requestParameters, initOverrides);
}
/**
*/
async loginRaw(requestParameters: LoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/login`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: LoginRequestToJSON(requestParameters.body),
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
*/
async login(requestParameters: LoginOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.loginRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async registerRaw(requestParameters: RegisterOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RegisterResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/register`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: RegisterRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RegisterResponseFromJSON(jsonValue));
}
/**
*/
async register(requestParameters: RegisterOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RegisterResponse> {
const response = await this.registerRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async resetPasswordRaw(requestParameters: ResetPasswordOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/resetPassword`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async resetPassword(requestParameters: ResetPasswordOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.resetPasswordRaw(requestParameters, initOverrides);
}
/**
*/
async resetPasswordRequestRaw(requestParameters: ResetPasswordRequestOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/resetPasswordRequest`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async resetPasswordRequest(requestParameters: ResetPasswordRequestOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.resetPasswordRequestRaw(requestParameters, initOverrides);
}
/**
*/
async verifyRaw(requestParameters: VerifyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
const response = await this.request({
path: `/verify`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: VerifyRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VerifyResponseFromJSON(jsonValue));
}
/**
*/
async verify(requestParameters: VerifyOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyResponse> {
const response = await this.verifyRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,251 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
CreateFrontendRequest,
CreateFrontendResponse,
CreateIdentity201Response,
CreateIdentityRequest,
DeleteFrontendRequest,
InviteTokenGenerateRequest,
PublicFrontend,
UpdateFrontendRequest,
} from '../models/index';
import {
CreateFrontendRequestFromJSON,
CreateFrontendRequestToJSON,
CreateFrontendResponseFromJSON,
CreateFrontendResponseToJSON,
CreateIdentity201ResponseFromJSON,
CreateIdentity201ResponseToJSON,
CreateIdentityRequestFromJSON,
CreateIdentityRequestToJSON,
DeleteFrontendRequestFromJSON,
DeleteFrontendRequestToJSON,
InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON,
PublicFrontendFromJSON,
PublicFrontendToJSON,
UpdateFrontendRequestFromJSON,
UpdateFrontendRequestToJSON,
} from '../models/index';
export interface CreateFrontendOperationRequest {
body?: CreateFrontendRequest;
}
export interface CreateIdentityOperationRequest {
body?: CreateIdentityRequest;
}
export interface DeleteFrontendOperationRequest {
body?: DeleteFrontendRequest;
}
export interface InviteTokenGenerateOperationRequest {
body?: InviteTokenGenerateRequest;
}
export interface UpdateFrontendOperationRequest {
body?: UpdateFrontendRequest;
}
/**
*
*/
export class AdminApi extends runtime.BaseAPI {
/**
*/
async createFrontendRaw(requestParameters: CreateFrontendOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateFrontendResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/frontend`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateFrontendRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CreateFrontendResponseFromJSON(jsonValue));
}
/**
*/
async createFrontend(requestParameters: CreateFrontendOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateFrontendResponse> {
const response = await this.createFrontendRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async createIdentityRaw(requestParameters: CreateIdentityOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateIdentity201Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/identity`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: CreateIdentityRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => CreateIdentity201ResponseFromJSON(jsonValue));
}
/**
*/
async createIdentity(requestParameters: CreateIdentityOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateIdentity201Response> {
const response = await this.createIdentityRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async deleteFrontendRaw(requestParameters: DeleteFrontendOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/frontend`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: DeleteFrontendRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async deleteFrontend(requestParameters: DeleteFrontendOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.deleteFrontendRaw(requestParameters, initOverrides);
}
/**
*/
async inviteTokenGenerateRaw(requestParameters: InviteTokenGenerateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/invite/token/generate`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: InviteTokenGenerateRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async inviteTokenGenerate(requestParameters: InviteTokenGenerateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.inviteTokenGenerateRaw(requestParameters, initOverrides);
}
/**
*/
async listFrontendsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PublicFrontend>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/frontends`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PublicFrontendFromJSON));
}
/**
*/
async listFrontends(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PublicFrontend>> {
const response = await this.listFrontendsRaw(initOverrides);
return await response.value();
}
/**
*/
async updateFrontendRaw(requestParameters: UpdateFrontendOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/frontend`,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: UpdateFrontendRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async updateFrontend(requestParameters: UpdateFrontendOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.updateFrontendRaw(requestParameters, initOverrides);
}
}

View File

@ -0,0 +1,105 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
DisableRequest,
EnableRequest,
EnableResponse,
} from '../models/index';
import {
DisableRequestFromJSON,
DisableRequestToJSON,
EnableRequestFromJSON,
EnableRequestToJSON,
EnableResponseFromJSON,
EnableResponseToJSON,
} from '../models/index';
export interface DisableOperationRequest {
body?: DisableRequest;
}
export interface EnableOperationRequest {
body?: EnableRequest;
}
/**
*
*/
export class EnvironmentApi extends runtime.BaseAPI {
/**
*/
async disableRaw(requestParameters: DisableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/disable`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: DisableRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async disable(requestParameters: DisableOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.disableRaw(requestParameters, initOverrides);
}
/**
*/
async enableRaw(requestParameters: EnableOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EnableResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/enable`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: EnableRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EnableResponseFromJSON(jsonValue));
}
/**
*/
async enable(requestParameters: EnableOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EnableResponse> {
const response = await this.enableRaw(requestParameters, initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,382 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
Environment,
EnvironmentAndResources,
Frontend,
Metrics,
ModelConfiguration,
Overview,
Share,
} from '../models/index';
import {
EnvironmentFromJSON,
EnvironmentToJSON,
EnvironmentAndResourcesFromJSON,
EnvironmentAndResourcesToJSON,
FrontendFromJSON,
FrontendToJSON,
MetricsFromJSON,
MetricsToJSON,
ModelConfigurationFromJSON,
ModelConfigurationToJSON,
OverviewFromJSON,
OverviewToJSON,
ShareFromJSON,
ShareToJSON,
} from '../models/index';
export interface GetAccountMetricsRequest {
duration?: string;
}
export interface GetEnvironmentDetailRequest {
envZId: string;
}
export interface GetEnvironmentMetricsRequest {
envId: string;
duration?: string;
}
export interface GetFrontendDetailRequest {
feId: number;
}
export interface GetShareDetailRequest {
shrToken: string;
}
export interface GetShareMetricsRequest {
shrToken: string;
duration?: string;
}
/**
*
*/
export class MetadataApi extends runtime.BaseAPI {
/**
*/
async _configurationRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ModelConfiguration>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/configuration`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ModelConfigurationFromJSON(jsonValue));
}
/**
*/
async _configuration(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ModelConfiguration> {
const response = await this._configurationRaw(initOverrides);
return await response.value();
}
/**
*/
async getAccountDetailRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Environment>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/detail/account`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(EnvironmentFromJSON));
}
/**
*/
async getAccountDetail(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Environment>> {
const response = await this.getAccountDetailRaw(initOverrides);
return await response.value();
}
/**
*/
async getAccountMetricsRaw(requestParameters: GetAccountMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Metrics>> {
const queryParameters: any = {};
if (requestParameters.duration !== undefined) {
queryParameters['duration'] = requestParameters.duration;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/metrics/account`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
}
/**
*/
async getAccountMetrics(requestParameters: GetAccountMetricsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Metrics> {
const response = await this.getAccountMetricsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getEnvironmentDetailRaw(requestParameters: GetEnvironmentDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EnvironmentAndResources>> {
if (requestParameters.envZId === null || requestParameters.envZId === undefined) {
throw new runtime.RequiredError('envZId','Required parameter requestParameters.envZId was null or undefined when calling getEnvironmentDetail.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/detail/environment/{envZId}`.replace(`{${"envZId"}}`, encodeURIComponent(String(requestParameters.envZId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => EnvironmentAndResourcesFromJSON(jsonValue));
}
/**
*/
async getEnvironmentDetail(requestParameters: GetEnvironmentDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EnvironmentAndResources> {
const response = await this.getEnvironmentDetailRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getEnvironmentMetricsRaw(requestParameters: GetEnvironmentMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Metrics>> {
if (requestParameters.envId === null || requestParameters.envId === undefined) {
throw new runtime.RequiredError('envId','Required parameter requestParameters.envId was null or undefined when calling getEnvironmentMetrics.');
}
const queryParameters: any = {};
if (requestParameters.duration !== undefined) {
queryParameters['duration'] = requestParameters.duration;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/metrics/environment/{envId}`.replace(`{${"envId"}}`, encodeURIComponent(String(requestParameters.envId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
}
/**
*/
async getEnvironmentMetrics(requestParameters: GetEnvironmentMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Metrics> {
const response = await this.getEnvironmentMetricsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getFrontendDetailRaw(requestParameters: GetFrontendDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Frontend>> {
if (requestParameters.feId === null || requestParameters.feId === undefined) {
throw new runtime.RequiredError('feId','Required parameter requestParameters.feId was null or undefined when calling getFrontendDetail.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/detail/frontend/{feId}`.replace(`{${"feId"}}`, encodeURIComponent(String(requestParameters.feId))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => FrontendFromJSON(jsonValue));
}
/**
*/
async getFrontendDetail(requestParameters: GetFrontendDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Frontend> {
const response = await this.getFrontendDetailRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getShareDetailRaw(requestParameters: GetShareDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Share>> {
if (requestParameters.shrToken === null || requestParameters.shrToken === undefined) {
throw new runtime.RequiredError('shrToken','Required parameter requestParameters.shrToken was null or undefined when calling getShareDetail.');
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/detail/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ShareFromJSON(jsonValue));
}
/**
*/
async getShareDetail(requestParameters: GetShareDetailRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Share> {
const response = await this.getShareDetailRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async getShareMetricsRaw(requestParameters: GetShareMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Metrics>> {
if (requestParameters.shrToken === null || requestParameters.shrToken === undefined) {
throw new runtime.RequiredError('shrToken','Required parameter requestParameters.shrToken was null or undefined when calling getShareMetrics.');
}
const queryParameters: any = {};
if (requestParameters.duration !== undefined) {
queryParameters['duration'] = requestParameters.duration;
}
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/metrics/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
}
/**
*/
async getShareMetrics(requestParameters: GetShareMetricsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Metrics> {
const response = await this.getShareMetricsRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async overviewRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Overview>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/overview`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => OverviewFromJSON(jsonValue));
}
/**
*/
async overview(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Overview> {
const response = await this.overviewRaw(initOverrides);
return await response.value();
}
/**
*/
async versionRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/version`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
if (this.isJsonMime(response.headers.get('content-type'))) {
return new runtime.JSONApiResponse<string>(response);
} else {
return new runtime.TextApiResponse(response) as any;
}
}
/**
*/
async version(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string> {
const response = await this.versionRaw(initOverrides);
return await response.value();
}
}

View File

@ -0,0 +1,220 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import * as runtime from '../runtime';
import type {
AccessRequest,
AccessResponse,
ShareRequest,
ShareResponse,
UnaccessRequest,
UnshareRequest,
UpdateShareRequest,
} from '../models/index';
import {
AccessRequestFromJSON,
AccessRequestToJSON,
AccessResponseFromJSON,
AccessResponseToJSON,
ShareRequestFromJSON,
ShareRequestToJSON,
ShareResponseFromJSON,
ShareResponseToJSON,
UnaccessRequestFromJSON,
UnaccessRequestToJSON,
UnshareRequestFromJSON,
UnshareRequestToJSON,
UpdateShareRequestFromJSON,
UpdateShareRequestToJSON,
} from '../models/index';
export interface AccessOperationRequest {
body?: AccessRequest;
}
export interface ShareOperationRequest {
body?: ShareRequest;
}
export interface UnaccessOperationRequest {
body?: UnaccessRequest;
}
export interface UnshareOperationRequest {
body?: UnshareRequest;
}
export interface UpdateShareOperationRequest {
body?: UpdateShareRequest;
}
/**
*
*/
export class ShareApi extends runtime.BaseAPI {
/**
*/
async accessRaw(requestParameters: AccessOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccessResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/access`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: AccessRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => AccessResponseFromJSON(jsonValue));
}
/**
*/
async access(requestParameters: AccessOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccessResponse> {
const response = await this.accessRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async shareRaw(requestParameters: ShareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ShareResponse>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/share`,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ShareRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => ShareResponseFromJSON(jsonValue));
}
/**
*/
async share(requestParameters: ShareOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ShareResponse> {
const response = await this.shareRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async unaccessRaw(requestParameters: UnaccessOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/unaccess`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: UnaccessRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async unaccess(requestParameters: UnaccessOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.unaccessRaw(requestParameters, initOverrides);
}
/**
*/
async unshareRaw(requestParameters: UnshareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/unshare`,
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: UnshareRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async unshare(requestParameters: UnshareOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.unshareRaw(requestParameters, initOverrides);
}
/**
*/
async updateShareRaw(requestParameters: UpdateShareOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token"); // key authentication
}
const response = await this.request({
path: `/share`,
method: 'PATCH',
headers: headerParameters,
query: queryParameters,
body: UpdateShareRequestToJSON(requestParameters.body),
}, initOverrides);
return new runtime.VoidApiResponse(response);
}
/**
*/
async updateShare(requestParameters: UpdateShareOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.updateShareRaw(requestParameters, initOverrides);
}
}

View File

@ -0,0 +1,7 @@
/* tslint:disable */
/* eslint-disable */
export * from './AccountApi';
export * from './AdminApi';
export * from './EnvironmentApi';
export * from './MetadataApi';
export * from './ShareApi';

View File

@ -0,0 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis/index';
export * from './models/index';

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class AccessRequest {
'envZId'?: string;
'shrToken'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
} ];
static getAttributeTypeMap() {
return AccessRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class AccessResponse {
'frontendToken'?: string;
'backendMode'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
"name": "backendMode",
"baseName": "backendMode",
"type": "string"
} ];
static getAttributeTypeMap() {
return AccessResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class AuthUser {
'username'?: string;
'password'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "username",
"baseName": "username",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
} ];
static getAttributeTypeMap() {
return AuthUser.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class ChangePasswordRequest {
'email'?: string;
'oldPassword'?: string;
'newPassword'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "oldPassword",
"baseName": "oldPassword",
"type": "string"
},
{
"name": "newPassword",
"baseName": "newPassword",
"type": "string"
} ];
static getAttributeTypeMap() {
return ChangePasswordRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,62 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { PasswordRequirements } from './passwordRequirements';
export class Configuration {
'version'?: string;
'touLink'?: string;
'invitesOpen'?: boolean;
'requiresInviteToken'?: boolean;
'inviteTokenContact'?: string;
'passwordRequirements'?: PasswordRequirements;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "version",
"baseName": "version",
"type": "string"
},
{
"name": "touLink",
"baseName": "touLink",
"type": "string"
},
{
"name": "invitesOpen",
"baseName": "invitesOpen",
"type": "boolean"
},
{
"name": "requiresInviteToken",
"baseName": "requiresInviteToken",
"type": "boolean"
},
{
"name": "inviteTokenContact",
"baseName": "inviteTokenContact",
"type": "string"
},
{
"name": "passwordRequirements",
"baseName": "passwordRequirements",
"type": "PasswordRequirements"
} ];
static getAttributeTypeMap() {
return Configuration.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class CreateFrontendRequest {
'zId'?: string;
'urlTemplate'?: string;
'publicName'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "urlTemplate",
"baseName": "url_template",
"type": "string"
},
{
"name": "publicName",
"baseName": "public_name",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateFrontendRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class CreateFrontendResponse {
'token'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateFrontendResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class CreateIdentity201Response {
'identity'?: string;
'cfg'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "identity",
"baseName": "identity",
"type": "string"
},
{
"name": "cfg",
"baseName": "cfg",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateIdentity201Response.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class CreateIdentityRequest {
'name'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "name",
"baseName": "name",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateIdentityRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class DeleteFrontendRequest {
'frontendToken'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
} ];
static getAttributeTypeMap() {
return DeleteFrontendRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class DisableRequest {
'identity'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "identity",
"baseName": "identity",
"type": "string"
} ];
static getAttributeTypeMap() {
return DisableRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class EnableRequest {
'description'?: string;
'host'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "description",
"baseName": "description",
"type": "string"
},
{
"name": "host",
"baseName": "host",
"type": "string"
} ];
static getAttributeTypeMap() {
return EnableRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class EnableResponse {
'identity'?: string;
'cfg'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "identity",
"baseName": "identity",
"type": "string"
},
{
"name": "cfg",
"baseName": "cfg",
"type": "string"
} ];
static getAttributeTypeMap() {
return EnableResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,74 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { SparkDataSample } from './sparkDataSample';
export class Environment {
'description'?: string;
'host'?: string;
'address'?: string;
'zId'?: string;
'activity'?: Array<SparkDataSample>;
'limited'?: boolean;
'createdAt'?: number;
'updatedAt'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "description",
"baseName": "description",
"type": "string"
},
{
"name": "host",
"baseName": "host",
"type": "string"
},
{
"name": "address",
"baseName": "address",
"type": "string"
},
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "activity",
"baseName": "activity",
"type": "Array<SparkDataSample>"
},
{
"name": "limited",
"baseName": "limited",
"type": "boolean"
},
{
"name": "createdAt",
"baseName": "createdAt",
"type": "number"
},
{
"name": "updatedAt",
"baseName": "updatedAt",
"type": "number"
} ];
static getAttributeTypeMap() {
return Environment.attributeTypeMap;
}
}

View File

@ -0,0 +1,46 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { Environment } from './environment';
import { Frontend } from './frontend';
import { Share } from './share';
export class EnvironmentAndResources {
'environment'?: Environment;
'frontends'?: Array<Frontend>;
'shares'?: Array<Share>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "environment",
"baseName": "environment",
"type": "Environment"
},
{
"name": "frontends",
"baseName": "frontends",
"type": "Array<Frontend>"
},
{
"name": "shares",
"baseName": "shares",
"type": "Array<Share>"
} ];
static getAttributeTypeMap() {
return EnvironmentAndResources.attributeTypeMap;
}
}

View File

@ -0,0 +1,61 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class Frontend {
'id'?: number;
'token'?: string;
'shrToken'?: string;
'zId'?: string;
'createdAt'?: number;
'updatedAt'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
},
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "createdAt",
"baseName": "createdAt",
"type": "number"
},
{
"name": "updatedAt",
"baseName": "updatedAt",
"type": "number"
} ];
static getAttributeTypeMap() {
return Frontend.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class InviteRequest {
'email'?: string;
'token'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "token",
"baseName": "token",
"type": "string"
} ];
static getAttributeTypeMap() {
return InviteRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class InviteTokenGenerateRequest {
'tokens'?: Array<string>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "tokens",
"baseName": "tokens",
"type": "Array<string>"
} ];
static getAttributeTypeMap() {
return InviteTokenGenerateRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class LoginRequest {
'email'?: string;
'password'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
} ];
static getAttributeTypeMap() {
return LoginRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,50 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { MetricsSample } from './metricsSample';
export class Metrics {
'scope'?: string;
'id'?: string;
'period'?: number;
'samples'?: Array<MetricsSample>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "scope",
"baseName": "scope",
"type": "string"
},
{
"name": "id",
"baseName": "id",
"type": "string"
},
{
"name": "period",
"baseName": "period",
"type": "number"
},
{
"name": "samples",
"baseName": "samples",
"type": "Array<MetricsSample>"
} ];
static getAttributeTypeMap() {
return Metrics.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class MetricsSample {
'rx'?: number;
'tx'?: number;
'timestamp'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "rx",
"baseName": "rx",
"type": "number"
},
{
"name": "tx",
"baseName": "tx",
"type": "number"
},
{
"name": "timestamp",
"baseName": "timestamp",
"type": "number"
} ];
static getAttributeTypeMap() {
return MetricsSample.attributeTypeMap;
}
}

View File

@ -0,0 +1,343 @@
import localVarRequest from 'request';
export * from './accessRequest';
export * from './accessResponse';
export * from './authUser';
export * from './changePasswordRequest';
export * from './configuration';
export * from './createFrontendRequest';
export * from './createFrontendResponse';
export * from './createIdentity201Response';
export * from './createIdentityRequest';
export * from './deleteFrontendRequest';
export * from './disableRequest';
export * from './enableRequest';
export * from './enableResponse';
export * from './environment';
export * from './environmentAndResources';
export * from './frontend';
export * from './inviteRequest';
export * from './inviteTokenGenerateRequest';
export * from './loginRequest';
export * from './metrics';
export * from './metricsSample';
export * from './overview';
export * from './passwordRequirements';
export * from './principal';
export * from './publicFrontend';
export * from './regenerateToken200Response';
export * from './regenerateTokenRequest';
export * from './registerRequest';
export * from './registerResponse';
export * from './resetPasswordRequest';
export * from './share';
export * from './shareRequest';
export * from './shareResponse';
export * from './sparkDataSample';
export * from './unaccessRequest';
export * from './unshareRequest';
export * from './updateFrontendRequest';
export * from './updateShareRequest';
export * from './verifyRequest';
export * from './verifyResponse';
import * as fs from 'fs';
export interface RequestDetailedFile {
value: Buffer;
options?: {
filename?: string;
contentType?: string;
}
}
export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
import { AccessRequest } from './accessRequest';
import { AccessResponse } from './accessResponse';
import { AuthUser } from './authUser';
import { ChangePasswordRequest } from './changePasswordRequest';
import { Configuration } from './configuration';
import { CreateFrontendRequest } from './createFrontendRequest';
import { CreateFrontendResponse } from './createFrontendResponse';
import { CreateIdentity201Response } from './createIdentity201Response';
import { CreateIdentityRequest } from './createIdentityRequest';
import { DeleteFrontendRequest } from './deleteFrontendRequest';
import { DisableRequest } from './disableRequest';
import { EnableRequest } from './enableRequest';
import { EnableResponse } from './enableResponse';
import { Environment } from './environment';
import { EnvironmentAndResources } from './environmentAndResources';
import { Frontend } from './frontend';
import { InviteRequest } from './inviteRequest';
import { InviteTokenGenerateRequest } from './inviteTokenGenerateRequest';
import { LoginRequest } from './loginRequest';
import { Metrics } from './metrics';
import { MetricsSample } from './metricsSample';
import { Overview } from './overview';
import { PasswordRequirements } from './passwordRequirements';
import { Principal } from './principal';
import { PublicFrontend } from './publicFrontend';
import { RegenerateToken200Response } from './regenerateToken200Response';
import { RegenerateTokenRequest } from './regenerateTokenRequest';
import { RegisterRequest } from './registerRequest';
import { RegisterResponse } from './registerResponse';
import { ResetPasswordRequest } from './resetPasswordRequest';
import { Share } from './share';
import { ShareRequest } from './shareRequest';
import { ShareResponse } from './shareResponse';
import { SparkDataSample } from './sparkDataSample';
import { UnaccessRequest } from './unaccessRequest';
import { UnshareRequest } from './unshareRequest';
import { UpdateFrontendRequest } from './updateFrontendRequest';
import { UpdateShareRequest } from './updateShareRequest';
import { VerifyRequest } from './verifyRequest';
import { VerifyResponse } from './verifyResponse';
/* tslint:disable:no-unused-variable */
let primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];
let enumsMap: {[index: string]: any} = {
"ShareRequest.ShareModeEnum": ShareRequest.ShareModeEnum,
"ShareRequest.BackendModeEnum": ShareRequest.BackendModeEnum,
"ShareRequest.OauthProviderEnum": ShareRequest.OauthProviderEnum,
"ShareRequest.PermissionModeEnum": ShareRequest.PermissionModeEnum,
}
let typeMap: {[index: string]: any} = {
"AccessRequest": AccessRequest,
"AccessResponse": AccessResponse,
"AuthUser": AuthUser,
"ChangePasswordRequest": ChangePasswordRequest,
"Configuration": Configuration,
"CreateFrontendRequest": CreateFrontendRequest,
"CreateFrontendResponse": CreateFrontendResponse,
"CreateIdentity201Response": CreateIdentity201Response,
"CreateIdentityRequest": CreateIdentityRequest,
"DeleteFrontendRequest": DeleteFrontendRequest,
"DisableRequest": DisableRequest,
"EnableRequest": EnableRequest,
"EnableResponse": EnableResponse,
"Environment": Environment,
"EnvironmentAndResources": EnvironmentAndResources,
"Frontend": Frontend,
"InviteRequest": InviteRequest,
"InviteTokenGenerateRequest": InviteTokenGenerateRequest,
"LoginRequest": LoginRequest,
"Metrics": Metrics,
"MetricsSample": MetricsSample,
"Overview": Overview,
"PasswordRequirements": PasswordRequirements,
"Principal": Principal,
"PublicFrontend": PublicFrontend,
"RegenerateToken200Response": RegenerateToken200Response,
"RegenerateTokenRequest": RegenerateTokenRequest,
"RegisterRequest": RegisterRequest,
"RegisterResponse": RegisterResponse,
"ResetPasswordRequest": ResetPasswordRequest,
"Share": Share,
"ShareRequest": ShareRequest,
"ShareResponse": ShareResponse,
"SparkDataSample": SparkDataSample,
"UnaccessRequest": UnaccessRequest,
"UnshareRequest": UnshareRequest,
"UpdateFrontendRequest": UpdateFrontendRequest,
"UpdateShareRequest": UpdateShareRequest,
"VerifyRequest": VerifyRequest,
"VerifyResponse": VerifyResponse,
}
export class ObjectSerializer {
public static findCorrectType(data: any, expectedType: string) {
if (data == undefined) {
return expectedType;
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
} else if (expectedType === "Date") {
return expectedType;
} else {
if (enumsMap[expectedType]) {
return expectedType;
}
if (!typeMap[expectedType]) {
return expectedType; // w/e we don't know the type
}
// Check the discriminator
let discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType; // the type does not have a discriminator. use it.
} else {
if (data[discriminatorProperty]) {
var discriminatorType = data[discriminatorProperty];
if(typeMap[discriminatorType]){
return discriminatorType; // use the type given in the discriminator
} else {
return expectedType; // discriminator did not map to a type
}
} else {
return expectedType; // discriminator was not present (or an empty string)
}
}
}
}
public static serialize(data: any, type: string) {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.serialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return data.toISOString();
} else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) { // in case we dont know the type
return data;
}
// Get the actual type of this object
type = this.findCorrectType(data, type);
// get the map for the correct type.
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
}
public static deserialize(data: any, type: string) {
// polymorphism may change the actual type.
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.deserialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return new Date(data);
} else {
if (enumsMap[type]) {// is Enum
return data;
}
if (!typeMap[type]) { // dont know the type
return data;
}
let instance = new typeMap[type]();
let attributeTypes = typeMap[type].getAttributeTypeMap();
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
}
}
export interface Authentication {
/**
* Apply authentication settings to header and query params.
*/
applyToRequest(requestOptions: localVarRequest.Options): Promise<void> | void;
}
export class HttpBasicAuth implements Authentication {
public username: string = '';
public password: string = '';
applyToRequest(requestOptions: localVarRequest.Options): void {
requestOptions.auth = {
username: this.username, password: this.password
}
}
}
export class HttpBearerAuth implements Authentication {
public accessToken: string | (() => string) = '';
applyToRequest(requestOptions: localVarRequest.Options): void {
if (requestOptions && requestOptions.headers) {
const accessToken = typeof this.accessToken === 'function'
? this.accessToken()
: this.accessToken;
requestOptions.headers["Authorization"] = "Bearer " + accessToken;
}
}
}
export class ApiKeyAuth implements Authentication {
public apiKey: string = '';
constructor(private location: string, private paramName: string) {
}
applyToRequest(requestOptions: localVarRequest.Options): void {
if (this.location == "query") {
(<any>requestOptions.qs)[this.paramName] = this.apiKey;
} else if (this.location == "header" && requestOptions && requestOptions.headers) {
requestOptions.headers[this.paramName] = this.apiKey;
} else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {
if (requestOptions.headers['Cookie']) {
requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);
}
else {
requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);
}
}
}
}
export class OAuth implements Authentication {
public accessToken: string = '';
applyToRequest(requestOptions: localVarRequest.Options): void {
if (requestOptions && requestOptions.headers) {
requestOptions.headers["Authorization"] = "Bearer " + this.accessToken;
}
}
}
export class VoidAuth implements Authentication {
public username: string = '';
public password: string = '';
applyToRequest(_: localVarRequest.Options): void {
// Do nothing
}
}
export type Interceptor = (requestOptions: localVarRequest.Options) => (Promise<void> | void);

View File

@ -0,0 +1,38 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { EnvironmentAndResources } from './environmentAndResources';
export class Overview {
'accountLimited'?: boolean;
'environments'?: Array<EnvironmentAndResources>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "accountLimited",
"baseName": "accountLimited",
"type": "boolean"
},
{
"name": "environments",
"baseName": "environments",
"type": "Array<EnvironmentAndResources>"
} ];
static getAttributeTypeMap() {
return Overview.attributeTypeMap;
}
}

View File

@ -0,0 +1,55 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class PasswordRequirements {
'length'?: number;
'requireCapital'?: boolean;
'requireNumeric'?: boolean;
'requireSpecial'?: boolean;
'validSpecialCharacters'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "length",
"baseName": "length",
"type": "number"
},
{
"name": "requireCapital",
"baseName": "requireCapital",
"type": "boolean"
},
{
"name": "requireNumeric",
"baseName": "requireNumeric",
"type": "boolean"
},
{
"name": "requireSpecial",
"baseName": "requireSpecial",
"type": "boolean"
},
{
"name": "validSpecialCharacters",
"baseName": "validSpecialCharacters",
"type": "string"
} ];
static getAttributeTypeMap() {
return PasswordRequirements.attributeTypeMap;
}
}

View File

@ -0,0 +1,55 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class Principal {
'id'?: number;
'email'?: string;
'token'?: string;
'limitless'?: boolean;
'admin'?: boolean;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "id",
"baseName": "id",
"type": "number"
},
{
"name": "email",
"baseName": "email",
"type": "string"
},
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "limitless",
"baseName": "limitless",
"type": "boolean"
},
{
"name": "admin",
"baseName": "admin",
"type": "boolean"
} ];
static getAttributeTypeMap() {
return Principal.attributeTypeMap;
}
}

View File

@ -0,0 +1,61 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class PublicFrontend {
'token'?: string;
'zId'?: string;
'urlTemplate'?: string;
'publicName'?: string;
'createdAt'?: number;
'updatedAt'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "urlTemplate",
"baseName": "urlTemplate",
"type": "string"
},
{
"name": "publicName",
"baseName": "publicName",
"type": "string"
},
{
"name": "createdAt",
"baseName": "createdAt",
"type": "number"
},
{
"name": "updatedAt",
"baseName": "updatedAt",
"type": "number"
} ];
static getAttributeTypeMap() {
return PublicFrontend.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class RegenerateToken200Response {
'token'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
} ];
static getAttributeTypeMap() {
return RegenerateToken200Response.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class RegenerateTokenRequest {
'emailAddress'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "emailAddress",
"baseName": "emailAddress",
"type": "string"
} ];
static getAttributeTypeMap() {
return RegenerateTokenRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class RegisterRequest {
'token'?: string;
'password'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
} ];
static getAttributeTypeMap() {
return RegisterRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class RegisterResponse {
'token'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
} ];
static getAttributeTypeMap() {
return RegisterResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class ResetPasswordRequest {
'token'?: string;
'password'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
} ];
static getAttributeTypeMap() {
return ResetPasswordRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class ResetPasswordRequestRequest {
'emailAddress'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "emailAddress",
"baseName": "emailAddress",
"type": "string"
} ];
static getAttributeTypeMap() {
return ResetPasswordRequestRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,98 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { SparkDataSample } from './sparkDataSample';
export class Share {
'token'?: string;
'zId'?: string;
'shareMode'?: string;
'backendMode'?: string;
'frontendSelection'?: string;
'frontendEndpoint'?: string;
'backendProxyEndpoint'?: string;
'reserved'?: boolean;
'activity'?: Array<SparkDataSample>;
'limited'?: boolean;
'createdAt'?: number;
'updatedAt'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
},
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "shareMode",
"baseName": "shareMode",
"type": "string"
},
{
"name": "backendMode",
"baseName": "backendMode",
"type": "string"
},
{
"name": "frontendSelection",
"baseName": "frontendSelection",
"type": "string"
},
{
"name": "frontendEndpoint",
"baseName": "frontendEndpoint",
"type": "string"
},
{
"name": "backendProxyEndpoint",
"baseName": "backendProxyEndpoint",
"type": "string"
},
{
"name": "reserved",
"baseName": "reserved",
"type": "boolean"
},
{
"name": "activity",
"baseName": "activity",
"type": "Array<SparkDataSample>"
},
{
"name": "limited",
"baseName": "limited",
"type": "boolean"
},
{
"name": "createdAt",
"baseName": "createdAt",
"type": "number"
},
{
"name": "updatedAt",
"baseName": "updatedAt",
"type": "number"
} ];
static getAttributeTypeMap() {
return Share.attributeTypeMap;
}
}

View File

@ -0,0 +1,133 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
import { AuthUser } from './authUser';
export class ShareRequest {
'envZId'?: string;
'shareMode'?: ShareRequest.ShareModeEnum;
'frontendSelection'?: Array<string>;
'backendMode'?: ShareRequest.BackendModeEnum;
'backendProxyEndpoint'?: string;
'authScheme'?: string;
'authUsers'?: Array<AuthUser>;
'oauthProvider'?: ShareRequest.OauthProviderEnum;
'oauthEmailDomains'?: Array<string>;
'oauthAuthorizationCheckInterval'?: string;
'reserved'?: boolean;
'permissionMode'?: ShareRequest.PermissionModeEnum;
'accessGrants'?: Array<string>;
'uniqueName'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shareMode",
"baseName": "shareMode",
"type": "ShareRequest.ShareModeEnum"
},
{
"name": "frontendSelection",
"baseName": "frontendSelection",
"type": "Array<string>"
},
{
"name": "backendMode",
"baseName": "backendMode",
"type": "ShareRequest.BackendModeEnum"
},
{
"name": "backendProxyEndpoint",
"baseName": "backendProxyEndpoint",
"type": "string"
},
{
"name": "authScheme",
"baseName": "authScheme",
"type": "string"
},
{
"name": "authUsers",
"baseName": "authUsers",
"type": "Array<AuthUser>"
},
{
"name": "oauthProvider",
"baseName": "oauthProvider",
"type": "ShareRequest.OauthProviderEnum"
},
{
"name": "oauthEmailDomains",
"baseName": "oauthEmailDomains",
"type": "Array<string>"
},
{
"name": "oauthAuthorizationCheckInterval",
"baseName": "oauthAuthorizationCheckInterval",
"type": "string"
},
{
"name": "reserved",
"baseName": "reserved",
"type": "boolean"
},
{
"name": "permissionMode",
"baseName": "permissionMode",
"type": "ShareRequest.PermissionModeEnum"
},
{
"name": "accessGrants",
"baseName": "accessGrants",
"type": "Array<string>"
},
{
"name": "uniqueName",
"baseName": "uniqueName",
"type": "string"
} ];
static getAttributeTypeMap() {
return ShareRequest.attributeTypeMap;
}
}
export namespace ShareRequest {
export enum ShareModeEnum {
Public = <any> 'public',
Private = <any> 'private'
}
export enum BackendModeEnum {
Proxy = <any> 'proxy',
Web = <any> 'web',
TcpTunnel = <any> 'tcpTunnel',
UdpTunnel = <any> 'udpTunnel',
Caddy = <any> 'caddy',
Drive = <any> 'drive',
Socks = <any> 'socks'
}
export enum OauthProviderEnum {
Github = <any> 'github',
Google = <any> 'google'
}
export enum PermissionModeEnum {
Open = <any> 'open',
Closed = <any> 'closed'
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class ShareResponse {
'frontendProxyEndpoints'?: Array<string>;
'shrToken'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendProxyEndpoints",
"baseName": "frontendProxyEndpoints",
"type": "Array<string>"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
} ];
static getAttributeTypeMap() {
return ShareResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,37 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class SparkDataSample {
'rx'?: number;
'tx'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "rx",
"baseName": "rx",
"type": "number"
},
{
"name": "tx",
"baseName": "tx",
"type": "number"
} ];
static getAttributeTypeMap() {
return SparkDataSample.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class UnaccessRequest {
'frontendToken'?: string;
'envZId'?: string;
'shrToken'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
} ];
static getAttributeTypeMap() {
return UnaccessRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class UnshareRequest {
'envZId'?: string;
'shrToken'?: string;
'reserved'?: boolean;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
},
{
"name": "reserved",
"baseName": "reserved",
"type": "boolean"
} ];
static getAttributeTypeMap() {
return UnshareRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,43 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class UpdateFrontendRequest {
'frontendToken'?: string;
'publicName'?: string;
'urlTemplate'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
"name": "publicName",
"baseName": "publicName",
"type": "string"
},
{
"name": "urlTemplate",
"baseName": "urlTemplate",
"type": "string"
} ];
static getAttributeTypeMap() {
return UpdateFrontendRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,49 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class UpdateShareRequest {
'shrToken'?: string;
'backendProxyEndpoint'?: string;
'addAccessGrants'?: Array<string>;
'removeAccessGrants'?: Array<string>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
},
{
"name": "backendProxyEndpoint",
"baseName": "backendProxyEndpoint",
"type": "string"
},
{
"name": "addAccessGrants",
"baseName": "addAccessGrants",
"type": "Array<string>"
},
{
"name": "removeAccessGrants",
"baseName": "removeAccessGrants",
"type": "Array<string>"
} ];
static getAttributeTypeMap() {
return UpdateShareRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class VerifyRequest {
'token'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"type": "string"
} ];
static getAttributeTypeMap() {
return VerifyRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class VerifyResponse {
'email'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
} ];
static getAttributeTypeMap() {
return VerifyResponse.attributeTypeMap;
}
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface AccessRequest
*/
export interface AccessRequest {
/**
*
* @type {string}
* @memberof AccessRequest
*/
envZId?: string;
/**
*
* @type {string}
* @memberof AccessRequest
*/
shrToken?: string;
}
/**
* Check if a given object implements the AccessRequest interface.
*/
export function instanceOfAccessRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AccessRequestFromJSON(json: any): AccessRequest {
return AccessRequestFromJSONTyped(json, false);
}
export function AccessRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccessRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'envZId': !exists(json, 'envZId') ? undefined : json['envZId'],
'shrToken': !exists(json, 'shrToken') ? undefined : json['shrToken'],
};
}
export function AccessRequestToJSON(value?: AccessRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'envZId': value.envZId,
'shrToken': value.shrToken,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface AccessResponse
*/
export interface AccessResponse {
/**
*
* @type {string}
* @memberof AccessResponse
*/
frontendToken?: string;
/**
*
* @type {string}
* @memberof AccessResponse
*/
backendMode?: string;
}
/**
* Check if a given object implements the AccessResponse interface.
*/
export function instanceOfAccessResponse(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AccessResponseFromJSON(json: any): AccessResponse {
return AccessResponseFromJSONTyped(json, false);
}
export function AccessResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccessResponse {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'frontendToken': !exists(json, 'frontendToken') ? undefined : json['frontendToken'],
'backendMode': !exists(json, 'backendMode') ? undefined : json['backendMode'],
};
}
export function AccessResponseToJSON(value?: AccessResponse | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'frontendToken': value.frontendToken,
'backendMode': value.backendMode,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface AuthUser
*/
export interface AuthUser {
/**
*
* @type {string}
* @memberof AuthUser
*/
username?: string;
/**
*
* @type {string}
* @memberof AuthUser
*/
password?: string;
}
/**
* Check if a given object implements the AuthUser interface.
*/
export function instanceOfAuthUser(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function AuthUserFromJSON(json: any): AuthUser {
return AuthUserFromJSONTyped(json, false);
}
export function AuthUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthUser {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'username': !exists(json, 'username') ? undefined : json['username'],
'password': !exists(json, 'password') ? undefined : json['password'],
};
}
export function AuthUserToJSON(value?: AuthUser | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'username': value.username,
'password': value.password,
};
}

View File

@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateFrontendRequest
*/
export interface CreateFrontendRequest {
/**
*
* @type {string}
* @memberof CreateFrontendRequest
*/
zId?: string;
/**
*
* @type {string}
* @memberof CreateFrontendRequest
*/
urlTemplate?: string;
/**
*
* @type {string}
* @memberof CreateFrontendRequest
*/
publicName?: string;
}
/**
* Check if a given object implements the CreateFrontendRequest interface.
*/
export function instanceOfCreateFrontendRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function CreateFrontendRequestFromJSON(json: any): CreateFrontendRequest {
return CreateFrontendRequestFromJSONTyped(json, false);
}
export function CreateFrontendRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFrontendRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'zId': !exists(json, 'zId') ? undefined : json['zId'],
'urlTemplate': !exists(json, 'url_template') ? undefined : json['url_template'],
'publicName': !exists(json, 'public_name') ? undefined : json['public_name'],
};
}
export function CreateFrontendRequestToJSON(value?: CreateFrontendRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'zId': value.zId,
'url_template': value.urlTemplate,
'public_name': value.publicName,
};
}

View File

@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateFrontendResponse
*/
export interface CreateFrontendResponse {
/**
*
* @type {string}
* @memberof CreateFrontendResponse
*/
token?: string;
}
/**
* Check if a given object implements the CreateFrontendResponse interface.
*/
export function instanceOfCreateFrontendResponse(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function CreateFrontendResponseFromJSON(json: any): CreateFrontendResponse {
return CreateFrontendResponseFromJSONTyped(json, false);
}
export function CreateFrontendResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFrontendResponse {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'token': !exists(json, 'token') ? undefined : json['token'],
};
}
export function CreateFrontendResponseToJSON(value?: CreateFrontendResponse | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'token': value.token,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateIdentity201Response
*/
export interface CreateIdentity201Response {
/**
*
* @type {string}
* @memberof CreateIdentity201Response
*/
identity?: string;
/**
*
* @type {string}
* @memberof CreateIdentity201Response
*/
cfg?: string;
}
/**
* Check if a given object implements the CreateIdentity201Response interface.
*/
export function instanceOfCreateIdentity201Response(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function CreateIdentity201ResponseFromJSON(json: any): CreateIdentity201Response {
return CreateIdentity201ResponseFromJSONTyped(json, false);
}
export function CreateIdentity201ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateIdentity201Response {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'identity': !exists(json, 'identity') ? undefined : json['identity'],
'cfg': !exists(json, 'cfg') ? undefined : json['cfg'],
};
}
export function CreateIdentity201ResponseToJSON(value?: CreateIdentity201Response | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'identity': value.identity,
'cfg': value.cfg,
};
}

View File

@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface CreateIdentityRequest
*/
export interface CreateIdentityRequest {
/**
*
* @type {string}
* @memberof CreateIdentityRequest
*/
name?: string;
}
/**
* Check if a given object implements the CreateIdentityRequest interface.
*/
export function instanceOfCreateIdentityRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function CreateIdentityRequestFromJSON(json: any): CreateIdentityRequest {
return CreateIdentityRequestFromJSONTyped(json, false);
}
export function CreateIdentityRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateIdentityRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'name': !exists(json, 'name') ? undefined : json['name'],
};
}
export function CreateIdentityRequestToJSON(value?: CreateIdentityRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'name': value.name,
};
}

View File

@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface DeleteFrontendRequest
*/
export interface DeleteFrontendRequest {
/**
*
* @type {string}
* @memberof DeleteFrontendRequest
*/
frontendToken?: string;
}
/**
* Check if a given object implements the DeleteFrontendRequest interface.
*/
export function instanceOfDeleteFrontendRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function DeleteFrontendRequestFromJSON(json: any): DeleteFrontendRequest {
return DeleteFrontendRequestFromJSONTyped(json, false);
}
export function DeleteFrontendRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteFrontendRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'frontendToken': !exists(json, 'frontendToken') ? undefined : json['frontendToken'],
};
}
export function DeleteFrontendRequestToJSON(value?: DeleteFrontendRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'frontendToken': value.frontendToken,
};
}

View File

@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface DisableRequest
*/
export interface DisableRequest {
/**
*
* @type {string}
* @memberof DisableRequest
*/
identity?: string;
}
/**
* Check if a given object implements the DisableRequest interface.
*/
export function instanceOfDisableRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function DisableRequestFromJSON(json: any): DisableRequest {
return DisableRequestFromJSONTyped(json, false);
}
export function DisableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DisableRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'identity': !exists(json, 'identity') ? undefined : json['identity'],
};
}
export function DisableRequestToJSON(value?: DisableRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'identity': value.identity,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface EnableRequest
*/
export interface EnableRequest {
/**
*
* @type {string}
* @memberof EnableRequest
*/
description?: string;
/**
*
* @type {string}
* @memberof EnableRequest
*/
host?: string;
}
/**
* Check if a given object implements the EnableRequest interface.
*/
export function instanceOfEnableRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function EnableRequestFromJSON(json: any): EnableRequest {
return EnableRequestFromJSONTyped(json, false);
}
export function EnableRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnableRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'description': !exists(json, 'description') ? undefined : json['description'],
'host': !exists(json, 'host') ? undefined : json['host'],
};
}
export function EnableRequestToJSON(value?: EnableRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'description': value.description,
'host': value.host,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface EnableResponse
*/
export interface EnableResponse {
/**
*
* @type {string}
* @memberof EnableResponse
*/
identity?: string;
/**
*
* @type {string}
* @memberof EnableResponse
*/
cfg?: string;
}
/**
* Check if a given object implements the EnableResponse interface.
*/
export function instanceOfEnableResponse(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function EnableResponseFromJSON(json: any): EnableResponse {
return EnableResponseFromJSONTyped(json, false);
}
export function EnableResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnableResponse {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'identity': !exists(json, 'identity') ? undefined : json['identity'],
'cfg': !exists(json, 'cfg') ? undefined : json['cfg'],
};
}
export function EnableResponseToJSON(value?: EnableResponse | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'identity': value.identity,
'cfg': value.cfg,
};
}

View File

@ -0,0 +1,128 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { SparkDataSample } from './SparkDataSample';
import {
SparkDataSampleFromJSON,
SparkDataSampleFromJSONTyped,
SparkDataSampleToJSON,
} from './SparkDataSample';
/**
*
* @export
* @interface Environment
*/
export interface Environment {
/**
*
* @type {string}
* @memberof Environment
*/
description?: string;
/**
*
* @type {string}
* @memberof Environment
*/
host?: string;
/**
*
* @type {string}
* @memberof Environment
*/
address?: string;
/**
*
* @type {string}
* @memberof Environment
*/
zId?: string;
/**
*
* @type {Array<SparkDataSample>}
* @memberof Environment
*/
activity?: Array<SparkDataSample>;
/**
*
* @type {boolean}
* @memberof Environment
*/
limited?: boolean;
/**
*
* @type {number}
* @memberof Environment
*/
createdAt?: number;
/**
*
* @type {number}
* @memberof Environment
*/
updatedAt?: number;
}
/**
* Check if a given object implements the Environment interface.
*/
export function instanceOfEnvironment(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function EnvironmentFromJSON(json: any): Environment {
return EnvironmentFromJSONTyped(json, false);
}
export function EnvironmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Environment {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'description': !exists(json, 'description') ? undefined : json['description'],
'host': !exists(json, 'host') ? undefined : json['host'],
'address': !exists(json, 'address') ? undefined : json['address'],
'zId': !exists(json, 'zId') ? undefined : json['zId'],
'activity': !exists(json, 'activity') ? undefined : ((json['activity'] as Array<any>).map(SparkDataSampleFromJSON)),
'limited': !exists(json, 'limited') ? undefined : json['limited'],
'createdAt': !exists(json, 'createdAt') ? undefined : json['createdAt'],
'updatedAt': !exists(json, 'updatedAt') ? undefined : json['updatedAt'],
};
}
export function EnvironmentToJSON(value?: Environment | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'description': value.description,
'host': value.host,
'address': value.address,
'zId': value.zId,
'activity': value.activity === undefined ? undefined : ((value.activity as Array<any>).map(SparkDataSampleToJSON)),
'limited': value.limited,
'createdAt': value.createdAt,
'updatedAt': value.updatedAt,
};
}

View File

@ -0,0 +1,100 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { Environment } from './Environment';
import {
EnvironmentFromJSON,
EnvironmentFromJSONTyped,
EnvironmentToJSON,
} from './Environment';
import type { Frontend } from './Frontend';
import {
FrontendFromJSON,
FrontendFromJSONTyped,
FrontendToJSON,
} from './Frontend';
import type { Share } from './Share';
import {
ShareFromJSON,
ShareFromJSONTyped,
ShareToJSON,
} from './Share';
/**
*
* @export
* @interface EnvironmentAndResources
*/
export interface EnvironmentAndResources {
/**
*
* @type {Environment}
* @memberof EnvironmentAndResources
*/
environment?: Environment;
/**
*
* @type {Array<Frontend>}
* @memberof EnvironmentAndResources
*/
frontends?: Array<Frontend>;
/**
*
* @type {Array<Share>}
* @memberof EnvironmentAndResources
*/
shares?: Array<Share>;
}
/**
* Check if a given object implements the EnvironmentAndResources interface.
*/
export function instanceOfEnvironmentAndResources(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function EnvironmentAndResourcesFromJSON(json: any): EnvironmentAndResources {
return EnvironmentAndResourcesFromJSONTyped(json, false);
}
export function EnvironmentAndResourcesFromJSONTyped(json: any, ignoreDiscriminator: boolean): EnvironmentAndResources {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'environment': !exists(json, 'environment') ? undefined : EnvironmentFromJSON(json['environment']),
'frontends': !exists(json, 'frontends') ? undefined : ((json['frontends'] as Array<any>).map(FrontendFromJSON)),
'shares': !exists(json, 'shares') ? undefined : ((json['shares'] as Array<any>).map(ShareFromJSON)),
};
}
export function EnvironmentAndResourcesToJSON(value?: EnvironmentAndResources | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'environment': EnvironmentToJSON(value.environment),
'frontends': value.frontends === undefined ? undefined : ((value.frontends as Array<any>).map(FrontendToJSON)),
'shares': value.shares === undefined ? undefined : ((value.shares as Array<any>).map(ShareToJSON)),
};
}

View File

@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface Frontend
*/
export interface Frontend {
/**
*
* @type {number}
* @memberof Frontend
*/
id?: number;
/**
*
* @type {string}
* @memberof Frontend
*/
shrToken?: string;
/**
*
* @type {string}
* @memberof Frontend
*/
zId?: string;
/**
*
* @type {number}
* @memberof Frontend
*/
createdAt?: number;
/**
*
* @type {number}
* @memberof Frontend
*/
updatedAt?: number;
}
/**
* Check if a given object implements the Frontend interface.
*/
export function instanceOfFrontend(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function FrontendFromJSON(json: any): Frontend {
return FrontendFromJSONTyped(json, false);
}
export function FrontendFromJSONTyped(json: any, ignoreDiscriminator: boolean): Frontend {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'shrToken': !exists(json, 'shrToken') ? undefined : json['shrToken'],
'zId': !exists(json, 'zId') ? undefined : json['zId'],
'createdAt': !exists(json, 'createdAt') ? undefined : json['createdAt'],
'updatedAt': !exists(json, 'updatedAt') ? undefined : json['updatedAt'],
};
}
export function FrontendToJSON(value?: Frontend | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'shrToken': value.shrToken,
'zId': value.zId,
'createdAt': value.createdAt,
'updatedAt': value.updatedAt,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface InviteRequest
*/
export interface InviteRequest {
/**
*
* @type {string}
* @memberof InviteRequest
*/
email?: string;
/**
*
* @type {string}
* @memberof InviteRequest
*/
token?: string;
}
/**
* Check if a given object implements the InviteRequest interface.
*/
export function instanceOfInviteRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function InviteRequestFromJSON(json: any): InviteRequest {
return InviteRequestFromJSONTyped(json, false);
}
export function InviteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InviteRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'email': !exists(json, 'email') ? undefined : json['email'],
'token': !exists(json, 'token') ? undefined : json['token'],
};
}
export function InviteRequestToJSON(value?: InviteRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'email': value.email,
'token': value.token,
};
}

View File

@ -0,0 +1,65 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface InviteTokenGenerateRequest
*/
export interface InviteTokenGenerateRequest {
/**
*
* @type {Array<string>}
* @memberof InviteTokenGenerateRequest
*/
tokens?: Array<string>;
}
/**
* Check if a given object implements the InviteTokenGenerateRequest interface.
*/
export function instanceOfInviteTokenGenerateRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function InviteTokenGenerateRequestFromJSON(json: any): InviteTokenGenerateRequest {
return InviteTokenGenerateRequestFromJSONTyped(json, false);
}
export function InviteTokenGenerateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InviteTokenGenerateRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'tokens': !exists(json, 'tokens') ? undefined : json['tokens'],
};
}
export function InviteTokenGenerateRequestToJSON(value?: InviteTokenGenerateRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'tokens': value.tokens,
};
}

View File

@ -0,0 +1,73 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface LoginRequest
*/
export interface LoginRequest {
/**
*
* @type {string}
* @memberof LoginRequest
*/
email?: string;
/**
*
* @type {string}
* @memberof LoginRequest
*/
password?: string;
}
/**
* Check if a given object implements the LoginRequest interface.
*/
export function instanceOfLoginRequest(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function LoginRequestFromJSON(json: any): LoginRequest {
return LoginRequestFromJSONTyped(json, false);
}
export function LoginRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): LoginRequest {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'email': !exists(json, 'email') ? undefined : json['email'],
'password': !exists(json, 'password') ? undefined : json['password'],
};
}
export function LoginRequestToJSON(value?: LoginRequest | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'email': value.email,
'password': value.password,
};
}

View File

@ -0,0 +1,96 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { MetricsSample } from './MetricsSample';
import {
MetricsSampleFromJSON,
MetricsSampleFromJSONTyped,
MetricsSampleToJSON,
} from './MetricsSample';
/**
*
* @export
* @interface Metrics
*/
export interface Metrics {
/**
*
* @type {string}
* @memberof Metrics
*/
scope?: string;
/**
*
* @type {string}
* @memberof Metrics
*/
id?: string;
/**
*
* @type {number}
* @memberof Metrics
*/
period?: number;
/**
*
* @type {Array<MetricsSample>}
* @memberof Metrics
*/
samples?: Array<MetricsSample>;
}
/**
* Check if a given object implements the Metrics interface.
*/
export function instanceOfMetrics(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function MetricsFromJSON(json: any): Metrics {
return MetricsFromJSONTyped(json, false);
}
export function MetricsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Metrics {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'scope': !exists(json, 'scope') ? undefined : json['scope'],
'id': !exists(json, 'id') ? undefined : json['id'],
'period': !exists(json, 'period') ? undefined : json['period'],
'samples': !exists(json, 'samples') ? undefined : ((json['samples'] as Array<any>).map(MetricsSampleFromJSON)),
};
}
export function MetricsToJSON(value?: Metrics | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'scope': value.scope,
'id': value.id,
'period': value.period,
'samples': value.samples === undefined ? undefined : ((value.samples as Array<any>).map(MetricsSampleToJSON)),
};
}

View File

@ -0,0 +1,81 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface MetricsSample
*/
export interface MetricsSample {
/**
*
* @type {number}
* @memberof MetricsSample
*/
rx?: number;
/**
*
* @type {number}
* @memberof MetricsSample
*/
tx?: number;
/**
*
* @type {number}
* @memberof MetricsSample
*/
timestamp?: number;
}
/**
* Check if a given object implements the MetricsSample interface.
*/
export function instanceOfMetricsSample(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function MetricsSampleFromJSON(json: any): MetricsSample {
return MetricsSampleFromJSONTyped(json, false);
}
export function MetricsSampleFromJSONTyped(json: any, ignoreDiscriminator: boolean): MetricsSample {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'rx': !exists(json, 'rx') ? undefined : json['rx'],
'tx': !exists(json, 'tx') ? undefined : json['tx'],
'timestamp': !exists(json, 'timestamp') ? undefined : json['timestamp'],
};
}
export function MetricsSampleToJSON(value?: MetricsSample | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'rx': value.rx,
'tx': value.tx,
'timestamp': value.timestamp,
};
}

View File

@ -0,0 +1,112 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { PasswordRequirements } from './PasswordRequirements';
import {
PasswordRequirementsFromJSON,
PasswordRequirementsFromJSONTyped,
PasswordRequirementsToJSON,
} from './PasswordRequirements';
/**
*
* @export
* @interface ModelConfiguration
*/
export interface ModelConfiguration {
/**
*
* @type {string}
* @memberof ModelConfiguration
*/
version?: string;
/**
*
* @type {string}
* @memberof ModelConfiguration
*/
touLink?: string;
/**
*
* @type {boolean}
* @memberof ModelConfiguration
*/
invitesOpen?: boolean;
/**
*
* @type {boolean}
* @memberof ModelConfiguration
*/
requiresInviteToken?: boolean;
/**
*
* @type {string}
* @memberof ModelConfiguration
*/
inviteTokenContact?: string;
/**
*
* @type {PasswordRequirements}
* @memberof ModelConfiguration
*/
passwordRequirements?: PasswordRequirements;
}
/**
* Check if a given object implements the ModelConfiguration interface.
*/
export function instanceOfModelConfiguration(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function ModelConfigurationFromJSON(json: any): ModelConfiguration {
return ModelConfigurationFromJSONTyped(json, false);
}
export function ModelConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelConfiguration {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'version': !exists(json, 'version') ? undefined : json['version'],
'touLink': !exists(json, 'touLink') ? undefined : json['touLink'],
'invitesOpen': !exists(json, 'invitesOpen') ? undefined : json['invitesOpen'],
'requiresInviteToken': !exists(json, 'requiresInviteToken') ? undefined : json['requiresInviteToken'],
'inviteTokenContact': !exists(json, 'inviteTokenContact') ? undefined : json['inviteTokenContact'],
'passwordRequirements': !exists(json, 'passwordRequirements') ? undefined : PasswordRequirementsFromJSON(json['passwordRequirements']),
};
}
export function ModelConfigurationToJSON(value?: ModelConfiguration | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'version': value.version,
'touLink': value.touLink,
'invitesOpen': value.invitesOpen,
'requiresInviteToken': value.requiresInviteToken,
'inviteTokenContact': value.inviteTokenContact,
'passwordRequirements': PasswordRequirementsToJSON(value.passwordRequirements),
};
}

View File

@ -0,0 +1,80 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { EnvironmentAndResources } from './EnvironmentAndResources';
import {
EnvironmentAndResourcesFromJSON,
EnvironmentAndResourcesFromJSONTyped,
EnvironmentAndResourcesToJSON,
} from './EnvironmentAndResources';
/**
*
* @export
* @interface Overview
*/
export interface Overview {
/**
*
* @type {boolean}
* @memberof Overview
*/
accountLimited?: boolean;
/**
*
* @type {Array<EnvironmentAndResources>}
* @memberof Overview
*/
environments?: Array<EnvironmentAndResources>;
}
/**
* Check if a given object implements the Overview interface.
*/
export function instanceOfOverview(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function OverviewFromJSON(json: any): Overview {
return OverviewFromJSONTyped(json, false);
}
export function OverviewFromJSONTyped(json: any, ignoreDiscriminator: boolean): Overview {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'accountLimited': !exists(json, 'accountLimited') ? undefined : json['accountLimited'],
'environments': !exists(json, 'environments') ? undefined : ((json['environments'] as Array<any>).map(EnvironmentAndResourcesFromJSON)),
};
}
export function OverviewToJSON(value?: Overview | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'accountLimited': value.accountLimited,
'environments': value.environments === undefined ? undefined : ((value.environments as Array<any>).map(EnvironmentAndResourcesToJSON)),
};
}

View File

@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface PasswordRequirements
*/
export interface PasswordRequirements {
/**
*
* @type {number}
* @memberof PasswordRequirements
*/
length?: number;
/**
*
* @type {boolean}
* @memberof PasswordRequirements
*/
requireCapital?: boolean;
/**
*
* @type {boolean}
* @memberof PasswordRequirements
*/
requireNumeric?: boolean;
/**
*
* @type {boolean}
* @memberof PasswordRequirements
*/
requireSpecial?: boolean;
/**
*
* @type {string}
* @memberof PasswordRequirements
*/
validSpecialCharacters?: string;
}
/**
* Check if a given object implements the PasswordRequirements interface.
*/
export function instanceOfPasswordRequirements(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PasswordRequirementsFromJSON(json: any): PasswordRequirements {
return PasswordRequirementsFromJSONTyped(json, false);
}
export function PasswordRequirementsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PasswordRequirements {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'length': !exists(json, 'length') ? undefined : json['length'],
'requireCapital': !exists(json, 'requireCapital') ? undefined : json['requireCapital'],
'requireNumeric': !exists(json, 'requireNumeric') ? undefined : json['requireNumeric'],
'requireSpecial': !exists(json, 'requireSpecial') ? undefined : json['requireSpecial'],
'validSpecialCharacters': !exists(json, 'validSpecialCharacters') ? undefined : json['validSpecialCharacters'],
};
}
export function PasswordRequirementsToJSON(value?: PasswordRequirements | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'length': value.length,
'requireCapital': value.requireCapital,
'requireNumeric': value.requireNumeric,
'requireSpecial': value.requireSpecial,
'validSpecialCharacters': value.validSpecialCharacters,
};
}

View File

@ -0,0 +1,97 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
/**
*
* @export
* @interface Principal
*/
export interface Principal {
/**
*
* @type {number}
* @memberof Principal
*/
id?: number;
/**
*
* @type {string}
* @memberof Principal
*/
email?: string;
/**
*
* @type {string}
* @memberof Principal
*/
token?: string;
/**
*
* @type {boolean}
* @memberof Principal
*/
limitless?: boolean;
/**
*
* @type {boolean}
* @memberof Principal
*/
admin?: boolean;
}
/**
* Check if a given object implements the Principal interface.
*/
export function instanceOfPrincipal(value: object): boolean {
let isInstance = true;
return isInstance;
}
export function PrincipalFromJSON(json: any): Principal {
return PrincipalFromJSONTyped(json, false);
}
export function PrincipalFromJSONTyped(json: any, ignoreDiscriminator: boolean): Principal {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'email': !exists(json, 'email') ? undefined : json['email'],
'token': !exists(json, 'token') ? undefined : json['token'],
'limitless': !exists(json, 'limitless') ? undefined : json['limitless'],
'admin': !exists(json, 'admin') ? undefined : json['admin'],
};
}
export function PrincipalToJSON(value?: Principal | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'email': value.email,
'token': value.token,
'limitless': value.limitless,
'admin': value.admin,
};
}

Some files were not shown because too many files have changed in this diff Show More