agent-ui rest client generation; initial version endpoint call (#221)

This commit is contained in:
Michael Quigley 2024-10-02 11:11:30 -04:00
parent f7746bbca2
commit 433290d74d
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
50 changed files with 3712 additions and 12 deletions

View File

@ -9,14 +9,16 @@
"lint": "next lint"
},
"dependencies": {
"next": "14.2.13",
"react": "^18",
"react-dom": "^18",
"next": "14.2.13"
"superagent": "^10.1.0"
},
"devDependencies": {
"postcss": "^8",
"tailwindcss": "^3.4.1",
"eslint": "^8",
"eslint-config-next": "14.2.13"
}
"eslint-config-next": "14.2.13",
"postcss": "^8",
"tailwindcss": "^3.4.1"
},
"proxy": "http://127.0.0.1:8888"
}

View File

@ -17,6 +17,9 @@ importers:
react-dom:
specifier: ^18
version: 18.3.1(react@18.3.1)
superagent:
specifier: ^10.1.0
version: 10.1.0
devDependencies:
eslint:
specifier: ^8
@ -322,9 +325,15 @@ packages:
resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==}
engines: {node: '>= 0.4'}
asap@2.0.6:
resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==}
ast-types-flow@0.0.8:
resolution: {integrity: sha512-OH/2E5Fg20h2aPrbe+QL8JZQFko0YZaF+j4mnQ7BGhfavO7OpSLa8a0y9sBwomHdSbkhTS8TQNayBfnW5DwbvQ==}
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
available-typed-arrays@1.0.7:
resolution: {integrity: sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==}
engines: {node: '>= 0.4'}
@ -391,13 +400,23 @@ packages:
color-name@1.1.4:
resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
engines: {node: '>= 6'}
component-emitter@1.3.1:
resolution: {integrity: sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==}
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
cookiejar@2.1.4:
resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==}
cross-spawn@7.0.3:
resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==}
engines: {node: '>= 8'}
@ -454,6 +473,13 @@ packages:
resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==}
engines: {node: '>= 0.4'}
delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
dezalgo@1.0.4:
resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==}
didyoumean@1.2.2:
resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==}
@ -639,6 +665,9 @@ packages:
fast-levenshtein@2.0.6:
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
fast-safe-stringify@2.1.1:
resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}
fastq@1.17.1:
resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==}
@ -668,6 +697,13 @@ packages:
resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==}
engines: {node: '>=14'}
form-data@4.0.0:
resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==}
engines: {node: '>= 6'}
formidable@3.5.1:
resolution: {integrity: sha512-WJWKelbRHN41m5dumb0/k8TeAx7Id/y3a+Z7QfhxP/htI9Js5zYaEDtG8uMgG0vM0lOlqnmjE99/kfpOYi/0Og==}
fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
@ -761,6 +797,10 @@ packages:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
hexoid@1.0.0:
resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==}
engines: {node: '>=8'}
ignore@5.3.2:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
@ -987,10 +1027,27 @@ packages:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
engines: {node: '>= 8'}
methods@1.1.2:
resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==}
engines: {node: '>= 0.6'}
micromatch@4.0.8:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'}
mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
mime@2.6.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
engines: {node: '>=4.0.0'}
hasBin: true
minimatch@3.1.2:
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
@ -1197,6 +1254,10 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
qs@6.13.0:
resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==}
engines: {node: '>=0.6'}
queue-microtask@1.2.3:
resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==}
@ -1373,6 +1434,10 @@ packages:
engines: {node: '>=16 || 14 >=14.17'}
hasBin: true
superagent@10.1.0:
resolution: {integrity: sha512-JMmik7PbnXGlq7g528Gi6apHbVbTz2vrE3du6fuG4kIPSb2PnLoSOPvfjKn8aQYuJcBWAKW6ZG90qPPsE5jZxQ==}
engines: {node: '>=14.18.0'}
supports-color@7.2.0:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'}
@ -1815,8 +1880,12 @@ snapshots:
is-array-buffer: 3.0.4
is-shared-array-buffer: 1.0.3
asap@2.0.6: {}
ast-types-flow@0.0.8: {}
asynckit@0.4.0: {}
available-typed-arrays@1.0.7:
dependencies:
possible-typed-array-names: 1.0.0
@ -1885,10 +1954,18 @@ snapshots:
color-name@1.1.4: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
commander@4.1.1: {}
component-emitter@1.3.1: {}
concat-map@0.0.1: {}
cookiejar@2.1.4: {}
cross-spawn@7.0.3:
dependencies:
path-key: 3.1.1
@ -1960,6 +2037,13 @@ snapshots:
has-property-descriptors: 1.0.2
object-keys: 1.1.1
delayed-stream@1.0.0: {}
dezalgo@1.0.4:
dependencies:
asap: 2.0.6
wrappy: 1.0.2
didyoumean@1.2.2: {}
dlv@1.1.3: {}
@ -2303,6 +2387,8 @@ snapshots:
fast-levenshtein@2.0.6: {}
fast-safe-stringify@2.1.1: {}
fastq@1.17.1:
dependencies:
reusify: 1.0.4
@ -2337,6 +2423,18 @@ snapshots:
cross-spawn: 7.0.3
signal-exit: 4.1.0
form-data@4.0.0:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
formidable@3.5.1:
dependencies:
dezalgo: 1.0.4
hexoid: 1.0.0
once: 1.4.0
fs.realpath@1.0.0: {}
fsevents@2.3.3:
@ -2442,6 +2540,8 @@ snapshots:
dependencies:
function-bind: 1.1.2
hexoid@1.0.0: {}
ignore@5.3.2: {}
import-fresh@3.3.0:
@ -2655,11 +2755,21 @@ snapshots:
merge2@1.4.1: {}
methods@1.1.2: {}
micromatch@4.0.8:
dependencies:
braces: 3.0.3
picomatch: 2.3.1
mime-db@1.52.0: {}
mime-types@2.1.35:
dependencies:
mime-db: 1.52.0
mime@2.6.0: {}
minimatch@3.1.2:
dependencies:
brace-expansion: 1.1.11
@ -2859,6 +2969,10 @@ snapshots:
punycode@2.3.1: {}
qs@6.13.0:
dependencies:
side-channel: 1.0.6
queue-microtask@1.2.3: {}
react-dom@18.3.1(react@18.3.1):
@ -3067,6 +3181,20 @@ snapshots:
pirates: 4.0.6
ts-interface-checker: 0.1.13
superagent@10.1.0:
dependencies:
component-emitter: 1.3.1
cookiejar: 2.1.4
debug: 4.3.7
fast-safe-stringify: 2.1.1
form-data: 4.0.0
formidable: 3.5.1
methods: 1.1.2
mime: 2.6.0
qs: 6.13.0
transitivePeerDependencies:
- supports-color
supports-color@7.2.0:
dependencies:
has-flag: 4.0.0

View File

@ -0,0 +1,33 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}

130
agent/agent-ui/src/api/.gitignore vendored Normal file
View File

@ -0,0 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
.cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

View File

@ -0,0 +1,23 @@
# 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

View File

@ -0,0 +1,43 @@
.babelrc
.gitignore
.openapi-generator-ignore
.travis.yml
README.md
docs/AccessDetail.md
docs/AccessPrivateResponse.md
docs/AgentApi.md
docs/ProtobufAny.md
docs/RpcStatus.md
docs/ShareDetail.md
docs/SharePrivateResponse.md
docs/SharePublicResponse.md
docs/ShareReservedResponse.md
docs/StatusResponse.md
docs/VersionResponse.md
git_push.sh
mocha.opts
package.json
src/ApiClient.js
src/api/AgentApi.js
src/index.js
src/model/AccessDetail.js
src/model/AccessPrivateResponse.js
src/model/ProtobufAny.js
src/model/RpcStatus.js
src/model/ShareDetail.js
src/model/SharePrivateResponse.js
src/model/SharePublicResponse.js
src/model/ShareReservedResponse.js
src/model/StatusResponse.js
src/model/VersionResponse.js
test/api/AgentApi.spec.js
test/model/AccessDetail.spec.js
test/model/AccessPrivateResponse.spec.js
test/model/ProtobufAny.spec.js
test/model/RpcStatus.spec.js
test/model/ShareDetail.spec.js
test/model/SharePrivateResponse.spec.js
test/model/SharePublicResponse.spec.js
test/model/ShareReservedResponse.spec.js
test/model/StatusResponse.spec.js
test/model/VersionResponse.spec.js

View File

@ -0,0 +1 @@
7.7.0

View File

@ -0,0 +1,5 @@
language: node_js
cache: npm
node_js:
- "6"
- "6.1"

View File

@ -0,0 +1,144 @@
# agent_agent_grpc_agent_proto
AgentAgentGrpcAgentProto - JavaScript client for agent_agent_grpc_agent_proto
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: version not set
- Package version: version not set
- Generator version: 7.7.0
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
## Installation
### For [Node.js](https://nodejs.org/)
#### npm
To publish the library as a [npm](https://www.npmjs.com/), please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages).
Then install it via:
```shell
npm install agent_agent_grpc_agent_proto --save
```
Finally, you need to build the module:
```shell
npm run build
```
##### Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run:
```shell
npm install
```
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`:
```shell
npm link
```
To use the link you just defined in your project, switch to the directory you want to use your agent_agent_grpc_agent_proto from, and run:
```shell
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
```
Finally, you need to build the module:
```shell
npm run build
```
#### git
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID
then install it via:
```shell
npm install GIT_USER_ID/GIT_REPO_ID --save
```
### For browser
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following
the above steps with Node.js and installing browserify with `npm install -g browserify`,
perform the following (assuming *main.js* is your entry file):
```shell
browserify main.js > bundle.js
```
Then include *bundle.js* in the HTML pages.
### Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error:
Cannot resolve module", most certainly you should disable AMD loader. Add/merge
the following section to your webpack config:
```javascript
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
```
## Getting Started
Please follow the [installation](#installation) instruction and execute the following JS code:
```javascript
var AgentAgentGrpcAgentProto = require('agent_agent_grpc_agent_proto');
var api = new AgentAgentGrpcAgentProto.AgentApi()
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.agentStatus(callback);
```
## Documentation for API Endpoints
All URIs are relative to *http://localhost*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AgentAgentGrpcAgentProto.AgentApi* | [**agentStatus**](docs/AgentApi.md#agentStatus) | **GET** /v1/agent/status |
*AgentAgentGrpcAgentProto.AgentApi* | [**agentVersion**](docs/AgentApi.md#agentVersion) | **GET** /v1/agent/version |
## Documentation for Models
- [AgentAgentGrpcAgentProto.AccessDetail](docs/AccessDetail.md)
- [AgentAgentGrpcAgentProto.AccessPrivateResponse](docs/AccessPrivateResponse.md)
- [AgentAgentGrpcAgentProto.ProtobufAny](docs/ProtobufAny.md)
- [AgentAgentGrpcAgentProto.RpcStatus](docs/RpcStatus.md)
- [AgentAgentGrpcAgentProto.ShareDetail](docs/ShareDetail.md)
- [AgentAgentGrpcAgentProto.SharePrivateResponse](docs/SharePrivateResponse.md)
- [AgentAgentGrpcAgentProto.SharePublicResponse](docs/SharePublicResponse.md)
- [AgentAgentGrpcAgentProto.ShareReservedResponse](docs/ShareReservedResponse.md)
- [AgentAgentGrpcAgentProto.StatusResponse](docs/StatusResponse.md)
- [AgentAgentGrpcAgentProto.VersionResponse](docs/VersionResponse.md)
## Documentation for Authorization
Endpoints do not require authorization.

View File

@ -0,0 +1,12 @@
# AgentAgentGrpcAgentProto.AccessDetail
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontendToken** | **String** | | [optional]
**token** | **String** | | [optional]
**bindAddress** | **String** | | [optional]
**responseHeaders** | **[String]** | | [optional]

View File

@ -0,0 +1,9 @@
# AgentAgentGrpcAgentProto.AccessPrivateResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontendToken** | **String** | | [optional]

View File

@ -0,0 +1,88 @@
# AgentAgentGrpcAgentProto.AgentApi
All URIs are relative to *http://localhost*
Method | HTTP request | Description
------------- | ------------- | -------------
[**agentStatus**](AgentApi.md#agentStatus) | **GET** /v1/agent/status |
[**agentVersion**](AgentApi.md#agentVersion) | **GET** /v1/agent/version |
## agentStatus
> StatusResponse agentStatus()
### Example
```javascript
import AgentAgentGrpcAgentProto from 'agent_agent_grpc_agent_proto';
let apiInstance = new AgentAgentGrpcAgentProto.AgentApi();
apiInstance.agentStatus((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**StatusResponse**](StatusResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
## agentVersion
> VersionResponse agentVersion()
### Example
```javascript
import AgentAgentGrpcAgentProto from 'agent_agent_grpc_agent_proto';
let apiInstance = new AgentAgentGrpcAgentProto.AgentApi();
apiInstance.agentVersion((error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
});
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**VersionResponse**](VersionResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json

View File

@ -0,0 +1,9 @@
# AgentAgentGrpcAgentProto.ProtobufAny
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**type** | **String** | | [optional]

View File

@ -0,0 +1,11 @@
# AgentAgentGrpcAgentProto.RpcStatus
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **Number** | | [optional]
**message** | **String** | | [optional]
**details** | [**[ProtobufAny]**](ProtobufAny.md) | | [optional]

View File

@ -0,0 +1,16 @@
# AgentAgentGrpcAgentProto.ShareDetail
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional]
**shareMode** | **String** | | [optional]
**backendMode** | **String** | | [optional]
**reserved** | **Boolean** | | [optional]
**frontendEndpoint** | **[String]** | | [optional]
**backendEndpoint** | **String** | | [optional]
**closed** | **Boolean** | | [optional]
**status** | **String** | | [optional]

View File

@ -0,0 +1,9 @@
# AgentAgentGrpcAgentProto.SharePrivateResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# AgentAgentGrpcAgentProto.SharePublicResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional]
**frontendEndpoints** | **[String]** | | [optional]

View File

@ -0,0 +1,13 @@
# AgentAgentGrpcAgentProto.ShareReservedResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **String** | | [optional]
**backendMode** | **String** | | [optional]
**shareMode** | **String** | | [optional]
**frontendEndpoints** | **[String]** | | [optional]
**target** | **String** | | [optional]

View File

@ -0,0 +1,10 @@
# AgentAgentGrpcAgentProto.StatusResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accesses** | [**[AccessDetail]**](AccessDetail.md) | | [optional]
**shares** | [**[ShareDetail]**](ShareDetail.md) | | [optional]

View File

@ -0,0 +1,9 @@
# AgentAgentGrpcAgentProto.VersionResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**v** | **String** | | [optional]

View File

@ -0,0 +1,57 @@
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'

View File

@ -0,0 +1 @@
--timeout 10000

View File

@ -0,0 +1,46 @@
{
"name": "agent_agent_grpc_agent_proto",
"version": "version not set",
"description": "JS API client generated by OpenAPI Generator",
"license": "Unlicense",
"main": "dist/index.js",
"scripts": {
"build": "babel src -d dist",
"prepare": "npm run build",
"test": "mocha --require @babel/register --recursive"
},
"browser": {
"fs": false
},
"dependencies": {
"@babel/cli": "^7.0.0",
"superagent": "^5.3.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-bind": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"expect.js": "^0.3.1",
"mocha": "^8.0.1",
"sinon": "^7.2.0"
},
"files": [
"dist"
]
}

View File

@ -0,0 +1,691 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import superagent from "superagent";
import querystring from "querystring";
/**
* @module ApiClient
* @version version not set
*/
/**
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
* application to use this class directly - the *Api and model classes provide the public API for the service. The
* contents of this file should be regarded as internal but are documented for completeness.
* @alias module:ApiClient
* @class
*/
class ApiClient {
/**
* The base URL against which to resolve every API call's (relative) path.
* Overrides the default value set in spec file if present
* @param {String} basePath
*/
constructor(basePath = 'http://localhost') {
/**
* The base URL against which to resolve every API call's (relative) path.
* @type {String}
* @default http://localhost
*/
this.basePath = basePath.replace(/\/+$/, '');
/**
* The authentication methods to be included for all API calls.
* @type {Array.<String>}
*/
this.authentications = {
}
/**
* The default HTTP headers to be included for all API calls.
* @type {Array.<String>}
* @default {}
*/
this.defaultHeaders = {
'User-Agent': 'OpenAPI-Generator/version not set/Javascript'
};
/**
* The default HTTP timeout for all API calls.
* @type {Number}
* @default 60000
*/
this.timeout = 60000;
/**
* If set to false an additional timestamp parameter is added to all API GET calls to
* prevent browser caching
* @type {Boolean}
* @default true
*/
this.cache = true;
/**
* If set to true, the client will save the cookies from each server
* response, and return them in the next request.
* @default false
*/
this.enableCookies = false;
/*
* Used to save and return cookies in a node.js (non-browser) setting,
* if this.enableCookies is set to true.
*/
if (typeof window === 'undefined') {
this.agent = new superagent.agent();
}
/*
* Allow user to override superagent agent
*/
this.requestAgent = null;
/*
* Allow user to add superagent plugins
*/
this.plugins = null;
}
/**
* Returns a string representation for an actual parameter.
* @param param The actual parameter.
* @returns {String} The string representation of <code>param</code>.
*/
paramToString(param) {
if (param == undefined || param == null) {
return '';
}
if (param instanceof Date) {
return param.toJSON();
}
if (ApiClient.canBeJsonified(param)) {
return JSON.stringify(param);
}
return param.toString();
}
/**
* Returns a boolean indicating if the parameter could be JSON.stringified
* @param param The actual parameter
* @returns {Boolean} Flag indicating if <code>param</code> can be JSON.stringified
*/
static canBeJsonified(str) {
if (typeof str !== 'string' && typeof str !== 'object') return false;
try {
const type = str.toString();
return type === '[object Object]'
|| type === '[object Array]';
} catch (err) {
return false;
}
};
/**
* Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
* NOTE: query parameters are not handled here.
* @param {String} path The path to append to the base URL.
* @param {Object} pathParams The parameter values to append.
* @param {String} apiBasePath Base path defined in the path, operation level to override the default one
* @returns {String} The encoded path with parameter values substituted.
*/
buildUrl(path, pathParams, apiBasePath) {
if (!path.match(/^\//)) {
path = '/' + path;
}
var url = this.basePath + path;
// use API (operation, path) base path if defined
if (apiBasePath !== null && apiBasePath !== undefined) {
url = apiBasePath + path;
}
url = url.replace(/\{([\w-\.#]+)\}/g, (fullMatch, key) => {
var value;
if (pathParams.hasOwnProperty(key)) {
value = this.paramToString(pathParams[key]);
} else {
value = fullMatch;
}
return encodeURIComponent(value);
});
return url;
}
/**
* Checks whether the given content type represents JSON.<br>
* JSON content type examples:<br>
* <ul>
* <li>application/json</li>
* <li>application/json; charset=UTF8</li>
* <li>APPLICATION/JSON</li>
* </ul>
* @param {String} contentType The MIME content type to check.
* @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
*/
isJsonMime(contentType) {
return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
}
/**
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
* @param {Array.<String>} contentTypes
* @returns {String} The chosen content type, preferring JSON.
*/
jsonPreferredMime(contentTypes) {
for (var i = 0; i < contentTypes.length; i++) {
if (this.isJsonMime(contentTypes[i])) {
return contentTypes[i];
}
}
return contentTypes[0];
}
/**
* Checks whether the given parameter value represents file-like content.
* @param param The parameter to check.
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
*/
isFileParam(param) {
// fs.ReadStream in Node.js and Electron (but not in runtime like browserify)
if (typeof require === 'function') {
let fs;
try {
fs = require('fs');
} catch (err) {}
if (fs && fs.ReadStream && param instanceof fs.ReadStream) {
return true;
}
}
// Buffer in Node.js
if (typeof Buffer === 'function' && param instanceof Buffer) {
return true;
}
// Blob in browser
if (typeof Blob === 'function' && param instanceof Blob) {
return true;
}
// File in browser (it seems File object is also instance of Blob, but keep this for safe)
if (typeof File === 'function' && param instanceof File) {
return true;
}
return false;
}
/**
* Normalizes parameter values:
* <ul>
* <li>remove nils</li>
* <li>keep files and arrays</li>
* <li>format to string with `paramToString` for other cases</li>
* </ul>
* @param {Object.<String, Object>} params The parameters as object properties.
* @returns {Object.<String, Object>} normalized parameters.
*/
normalizeParams(params) {
var newParams = {};
for (var key in params) {
if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
var value = params[key];
if (this.isFileParam(value) || Array.isArray(value)) {
newParams[key] = value;
} else {
newParams[key] = this.paramToString(value);
}
}
}
return newParams;
}
/**
* Builds a string representation of an array-type actual parameter, according to the given collection format.
* @param {Array} param An array parameter.
* @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
* @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
* <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
*/
buildCollectionParam(param, collectionFormat) {
if (param == null) {
return null;
}
switch (collectionFormat) {
case 'csv':
return param.map(this.paramToString, this).join(',');
case 'ssv':
return param.map(this.paramToString, this).join(' ');
case 'tsv':
return param.map(this.paramToString, this).join('\t');
case 'pipes':
return param.map(this.paramToString, this).join('|');
case 'multi':
//return the array directly as SuperAgent will handle it as expected
return param.map(this.paramToString, this);
case 'passthrough':
return param;
default:
throw new Error('Unknown collection format: ' + collectionFormat);
}
}
/**
* Applies authentication headers to the request.
* @param {Object} request The request object created by a <code>superagent()</code> call.
* @param {Array.<String>} authNames An array of authentication method names.
*/
applyAuthToRequest(request, authNames) {
authNames.forEach((authName) => {
var auth = this.authentications[authName];
switch (auth.type) {
case 'basic':
if (auth.username || auth.password) {
request.auth(auth.username || '', auth.password || '');
}
break;
case 'bearer':
if (auth.accessToken) {
var localVarBearerToken = typeof auth.accessToken === 'function'
? auth.accessToken()
: auth.accessToken
request.set({'Authorization': 'Bearer ' + localVarBearerToken});
}
break;
case 'apiKey':
if (auth.apiKey) {
var data = {};
if (auth.apiKeyPrefix) {
data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey;
} else {
data[auth.name] = auth.apiKey;
}
if (auth['in'] === 'header') {
request.set(data);
} else {
request.query(data);
}
}
break;
case 'oauth2':
if (auth.accessToken) {
request.set({'Authorization': 'Bearer ' + auth.accessToken});
}
break;
default:
throw new Error('Unknown authentication type: ' + auth.type);
}
});
}
/**
* Deserializes an HTTP response body into a value of the specified type.
* @param {Object} response A SuperAgent response object.
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
* all properties on <code>data<code> will be converted to this type.
* @returns A value of the specified type.
*/
deserialize(response, returnType) {
if (response == null || returnType == null || response.status == 204) {
return null;
}
// Rely on SuperAgent for parsing response body.
// See http://visionmedia.github.io/superagent/#parsing-response-bodies
var data = response.body;
if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
// SuperAgent does not always produce a body; use the unparsed response as a fallback
data = response.text;
}
return ApiClient.convertToType(data, returnType);
}
/**
* Callback function to receive the result of the operation.
* @callback module:ApiClient~callApiCallback
* @param {String} error Error message, if any.
* @param data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Invokes the REST service using the supplied settings and parameters.
* @param {String} path The base URL to invoke.
* @param {String} httpMethod The HTTP method to use.
* @param {Object.<String, String>} pathParams A map of path parameters and their values.
* @param {Object.<String, Object>} queryParams A map of query parameters and their values.
* @param {Object.<String, Object>} headerParams A map of header parameters and their values.
* @param {Object.<String, Object>} formParams A map of form parameters and their values.
* @param {Object} bodyParam The value to pass as the request body.
* @param {Array.<String>} authNames An array of authentication type names.
* @param {Array.<String>} contentTypes An array of request MIME types.
* @param {Array.<String>} accepts An array of acceptable response MIME types.
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
* constructor for a complex type.
* @param {String} apiBasePath base path defined in the operation/path level to override the default one
* @param {module:ApiClient~callApiCallback} callback The callback function.
* @returns {Object} The SuperAgent request object.
*/
callApi(path, httpMethod, pathParams,
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
returnType, apiBasePath, callback) {
var url = this.buildUrl(path, pathParams, apiBasePath);
var request = superagent(httpMethod, url);
if (this.plugins !== null) {
for (var index in this.plugins) {
if (this.plugins.hasOwnProperty(index)) {
request.use(this.plugins[index])
}
}
}
// apply authentications
this.applyAuthToRequest(request, authNames);
// set query parameters
if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
queryParams['_'] = new Date().getTime();
}
request.query(this.normalizeParams(queryParams));
// set header parameters
request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
// set requestAgent if it is set by user
if (this.requestAgent) {
request.agent(this.requestAgent);
}
// set request timeout
request.timeout(this.timeout);
var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) {
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
if(contentType != 'multipart/form-data') {
request.type(contentType);
}
}
if (contentType === 'application/x-www-form-urlencoded') {
request.send(querystring.stringify(this.normalizeParams(formParams)));
} else if (contentType == 'multipart/form-data') {
var _formParams = this.normalizeParams(formParams);
for (var key in _formParams) {
if (_formParams.hasOwnProperty(key)) {
let _formParamsValue = _formParams[key];
if (this.isFileParam(_formParamsValue)) {
// file field
request.attach(key, _formParamsValue);
} else if (Array.isArray(_formParamsValue) && _formParamsValue.length
&& this.isFileParam(_formParamsValue[0])) {
// multiple files
_formParamsValue.forEach(file => request.attach(key, file));
} else {
request.field(key, _formParamsValue);
}
}
}
} else if (bodyParam !== null && bodyParam !== undefined) {
if (!request.header['Content-Type']) {
request.type('application/json');
}
request.send(bodyParam);
}
var accept = this.jsonPreferredMime(accepts);
if (accept) {
request.accept(accept);
}
if (returnType === 'Blob') {
request.responseType('blob');
} else if (returnType === 'String') {
request.responseType('text');
}
// Attach previously saved cookies, if enabled
if (this.enableCookies){
if (typeof window === 'undefined') {
this.agent._attachCookies(request);
}
else {
request.withCredentials();
}
}
request.end((error, response) => {
if (callback) {
var data = null;
if (!error) {
try {
data = this.deserialize(response, returnType);
if (this.enableCookies && typeof window === 'undefined'){
this.agent._saveCookies(response);
}
} catch (err) {
error = err;
}
}
callback(error, data, response);
}
});
return request;
}
/**
* Parses an ISO-8601 string representation or epoch representation of a date value.
* @param {String} str The date value as a string.
* @returns {Date} The parsed date object.
*/
static parseDate(str) {
if (isNaN(str)) {
return new Date(str.replace(/(\d)(T)(\d)/i, '$1 $3'));
}
return new Date(+str);
}
/**
* Converts a value to the specified type.
* @param {(String|Object)} data The data to convert, as a string or object.
* @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
* all properties on <code>data<code> will be converted to this type.
* @returns An instance of the specified type or null or undefined if data is null or undefined.
*/
static convertToType(data, type) {
if (data === null || data === undefined)
return data
switch (type) {
case 'Boolean':
return Boolean(data);
case 'Integer':
return parseInt(data, 10);
case 'Number':
return parseFloat(data);
case 'String':
return String(data);
case 'Date':
return ApiClient.parseDate(String(data));
case 'Blob':
return data;
default:
if (type === Object) {
// generic object, return directly
return data;
} else if (typeof type.constructFromObject === 'function') {
// for model type like User and enum class
return type.constructFromObject(data);
} else if (Array.isArray(type)) {
// for array type like: ['String']
var itemType = type[0];
return data.map((item) => {
return ApiClient.convertToType(item, itemType);
});
} else if (typeof type === 'object') {
// for plain object type like: {'String': 'Integer'}
var keyType, valueType;
for (var k in type) {
if (type.hasOwnProperty(k)) {
keyType = k;
valueType = type[k];
break;
}
}
var result = {};
for (var k in data) {
if (data.hasOwnProperty(k)) {
var key = ApiClient.convertToType(k, keyType);
var value = ApiClient.convertToType(data[k], valueType);
result[key] = value;
}
}
return result;
} else {
// for unknown type, return the data directly
return data;
}
}
}
/**
* Gets an array of host settings
* @returns An array of host settings
*/
hostSettings() {
return [
{
'url': "",
'description': "No description provided",
}
];
}
getBasePathFromSettings(index, variables={}) {
var servers = this.hostSettings();
// check array index out of bound
if (index < 0 || index >= servers.length) {
throw new Error("Invalid index " + index + " when selecting the host settings. Must be less than " + servers.length);
}
var server = servers[index];
var url = server['url'];
// go through variable and assign a value
for (var variable_name in server['variables']) {
if (variable_name in variables) {
let variable = server['variables'][variable_name];
if ( !('enum_values' in variable) || variable['enum_values'].includes(variables[variable_name]) ) {
url = url.replace("{" + variable_name + "}", variables[variable_name]);
} else {
throw new Error("The variable `" + variable_name + "` in the host URL has invalid value " + variables[variable_name] + ". Must be " + server['variables'][variable_name]['enum_values'] + ".");
}
} else {
// use default value
url = url.replace("{" + variable_name + "}", server['variables'][variable_name]['default_value'])
}
}
return url;
}
/**
* Constructs a new map or array model from REST data.
* @param data {Object|Array} The REST data.
* @param obj {Object|Array} The target object or array.
*/
static constructFromObject(data, obj, itemType) {
if (Array.isArray(data)) {
for (var i = 0; i < data.length; i++) {
if (data.hasOwnProperty(i))
obj[i] = ApiClient.convertToType(data[i], itemType);
}
} else {
for (var k in data) {
if (data.hasOwnProperty(k))
obj[k] = ApiClient.convertToType(data[k], itemType);
}
}
};
}
/**
* Enumeration of collection format separator strategies.
* @enum {String}
* @readonly
*/
ApiClient.CollectionFormatEnum = {
/**
* Comma-separated values. Value: <code>csv</code>
* @const
*/
CSV: ',',
/**
* Space-separated values. Value: <code>ssv</code>
* @const
*/
SSV: ' ',
/**
* Tab-separated values. Value: <code>tsv</code>
* @const
*/
TSV: '\t',
/**
* Pipe(|)-separated values. Value: <code>pipes</code>
* @const
*/
PIPES: '|',
/**
* Native array. Value: <code>multi</code>
* @const
*/
MULTI: 'multi'
};
/**
* The default API client implementation.
* @type {module:ApiClient}
*/
ApiClient.instance = new ApiClient();
export default ApiClient;

View File

@ -0,0 +1,110 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from "../ApiClient";
import RpcStatus from '../model/RpcStatus';
import StatusResponse from '../model/StatusResponse';
import VersionResponse from '../model/VersionResponse';
/**
* Agent service.
* @module api/AgentApi
* @version version not set
*/
export default class AgentApi {
/**
* Constructs a new AgentApi.
* @alias module:api/AgentApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
/**
* Callback function to receive the result of the agentStatus operation.
* @callback module:api/AgentApi~agentStatusCallback
* @param {String} error Error message, if any.
* @param {module:model/StatusResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* @param {module:api/AgentApi~agentStatusCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/StatusResponse}
*/
agentStatus(callback) {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = StatusResponse;
return this.apiClient.callApi(
'/v1/agent/status', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
/**
* Callback function to receive the result of the agentVersion operation.
* @callback module:api/AgentApi~agentVersionCallback
* @param {String} error Error message, if any.
* @param {module:model/VersionResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* @param {module:api/AgentApi~agentVersionCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/VersionResponse}
*/
agentVersion(callback) {
let postBody = null;
let pathParams = {
};
let queryParams = {
};
let headerParams = {
};
let formParams = {
};
let authNames = [];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = VersionResponse;
return this.apiClient.callApi(
'/v1/agent/version', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, null, callback
);
}
}

View File

@ -0,0 +1,132 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from './ApiClient';
import AccessDetail from './model/AccessDetail';
import AccessPrivateResponse from './model/AccessPrivateResponse';
import ProtobufAny from './model/ProtobufAny';
import RpcStatus from './model/RpcStatus';
import ShareDetail from './model/ShareDetail';
import SharePrivateResponse from './model/SharePrivateResponse';
import SharePublicResponse from './model/SharePublicResponse';
import ShareReservedResponse from './model/ShareReservedResponse';
import StatusResponse from './model/StatusResponse';
import VersionResponse from './model/VersionResponse';
import AgentApi from './api/AgentApi';
/**
* JS API client generated by OpenAPI Generator.<br>
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
* <p>
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
* <pre>
* var AgentAgentGrpcAgentProto = require('index'); // See note below*.
* var xxxSvc = new AgentAgentGrpcAgentProto.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new AgentAgentGrpcAgentProto.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* <em>*NOTE: For a top-level AMD script, use require(['index'], function(){...})
* and put the application logic within the callback function.</em>
* </p>
* <p>
* A non-AMD browser application (discouraged) might do something like this:
* <pre>
* var xxxSvc = new AgentAgentGrpcAgentProto.XxxApi(); // Allocate the API class we're going to use.
* var yyy = new AgentAgentGrpcAgentProto.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* </p>
* @module index
* @version version not set
*/
export {
/**
* The ApiClient constructor.
* @property {module:ApiClient}
*/
ApiClient,
/**
* The AccessDetail model constructor.
* @property {module:model/AccessDetail}
*/
AccessDetail,
/**
* The AccessPrivateResponse model constructor.
* @property {module:model/AccessPrivateResponse}
*/
AccessPrivateResponse,
/**
* The ProtobufAny model constructor.
* @property {module:model/ProtobufAny}
*/
ProtobufAny,
/**
* The RpcStatus model constructor.
* @property {module:model/RpcStatus}
*/
RpcStatus,
/**
* The ShareDetail model constructor.
* @property {module:model/ShareDetail}
*/
ShareDetail,
/**
* The SharePrivateResponse model constructor.
* @property {module:model/SharePrivateResponse}
*/
SharePrivateResponse,
/**
* The SharePublicResponse model constructor.
* @property {module:model/SharePublicResponse}
*/
SharePublicResponse,
/**
* The ShareReservedResponse model constructor.
* @property {module:model/ShareReservedResponse}
*/
ShareReservedResponse,
/**
* The StatusResponse model constructor.
* @property {module:model/StatusResponse}
*/
StatusResponse,
/**
* The VersionResponse model constructor.
* @property {module:model/VersionResponse}
*/
VersionResponse,
/**
* The AgentApi service constructor.
* @property {module:api/AgentApi}
*/
AgentApi
};

View File

@ -0,0 +1,123 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The AccessDetail model module.
* @module model/AccessDetail
* @version version not set
*/
class AccessDetail {
/**
* Constructs a new <code>AccessDetail</code>.
* @alias module:model/AccessDetail
*/
constructor() {
AccessDetail.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>AccessDetail</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AccessDetail} obj Optional instance to populate.
* @return {module:model/AccessDetail} The populated <code>AccessDetail</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new AccessDetail();
if (data.hasOwnProperty('frontendToken')) {
obj['frontendToken'] = ApiClient.convertToType(data['frontendToken'], 'String');
}
if (data.hasOwnProperty('token')) {
obj['token'] = ApiClient.convertToType(data['token'], 'String');
}
if (data.hasOwnProperty('bindAddress')) {
obj['bindAddress'] = ApiClient.convertToType(data['bindAddress'], 'String');
}
if (data.hasOwnProperty('responseHeaders')) {
obj['responseHeaders'] = ApiClient.convertToType(data['responseHeaders'], ['String']);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>AccessDetail</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>AccessDetail</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['frontendToken'] && !(typeof data['frontendToken'] === 'string' || data['frontendToken'] instanceof String)) {
throw new Error("Expected the field `frontendToken` to be a primitive type in the JSON string but got " + data['frontendToken']);
}
// ensure the json data is a string
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
}
// ensure the json data is a string
if (data['bindAddress'] && !(typeof data['bindAddress'] === 'string' || data['bindAddress'] instanceof String)) {
throw new Error("Expected the field `bindAddress` to be a primitive type in the JSON string but got " + data['bindAddress']);
}
// ensure the json data is an array
if (!Array.isArray(data['responseHeaders'])) {
throw new Error("Expected the field `responseHeaders` to be an array in the JSON data but got " + data['responseHeaders']);
}
return true;
}
}
/**
* @member {String} frontendToken
*/
AccessDetail.prototype['frontendToken'] = undefined;
/**
* @member {String} token
*/
AccessDetail.prototype['token'] = undefined;
/**
* @member {String} bindAddress
*/
AccessDetail.prototype['bindAddress'] = undefined;
/**
* @member {Array.<String>} responseHeaders
*/
AccessDetail.prototype['responseHeaders'] = undefined;
export default AccessDetail;

View File

@ -0,0 +1,87 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The AccessPrivateResponse model module.
* @module model/AccessPrivateResponse
* @version version not set
*/
class AccessPrivateResponse {
/**
* Constructs a new <code>AccessPrivateResponse</code>.
* @alias module:model/AccessPrivateResponse
*/
constructor() {
AccessPrivateResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>AccessPrivateResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AccessPrivateResponse} obj Optional instance to populate.
* @return {module:model/AccessPrivateResponse} The populated <code>AccessPrivateResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new AccessPrivateResponse();
if (data.hasOwnProperty('frontendToken')) {
obj['frontendToken'] = ApiClient.convertToType(data['frontendToken'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>AccessPrivateResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>AccessPrivateResponse</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['frontendToken'] && !(typeof data['frontendToken'] === 'string' || data['frontendToken'] instanceof String)) {
throw new Error("Expected the field `frontendToken` to be a primitive type in the JSON string but got " + data['frontendToken']);
}
return true;
}
}
/**
* @member {String} frontendToken
*/
AccessPrivateResponse.prototype['frontendToken'] = undefined;
export default AccessPrivateResponse;

View File

@ -0,0 +1,91 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The ProtobufAny model module.
* @module model/ProtobufAny
* @version version not set
*/
class ProtobufAny {
/**
* Constructs a new <code>ProtobufAny</code>.
* @alias module:model/ProtobufAny
* @extends Object
*/
constructor() {
ProtobufAny.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>ProtobufAny</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ProtobufAny} obj Optional instance to populate.
* @return {module:model/ProtobufAny} The populated <code>ProtobufAny</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ProtobufAny();
ApiClient.constructFromObject(data, obj, 'Object');
if (data.hasOwnProperty('@type')) {
obj['@type'] = ApiClient.convertToType(data['@type'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>ProtobufAny</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ProtobufAny</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['@type'] && !(typeof data['@type'] === 'string' || data['@type'] instanceof String)) {
throw new Error("Expected the field `@type` to be a primitive type in the JSON string but got " + data['@type']);
}
return true;
}
}
/**
* @member {String} @type
*/
ProtobufAny.prototype['@type'] = undefined;
export default ProtobufAny;

View File

@ -0,0 +1,108 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import ProtobufAny from './ProtobufAny';
/**
* The RpcStatus model module.
* @module model/RpcStatus
* @version version not set
*/
class RpcStatus {
/**
* Constructs a new <code>RpcStatus</code>.
* @alias module:model/RpcStatus
*/
constructor() {
RpcStatus.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>RpcStatus</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/RpcStatus} obj Optional instance to populate.
* @return {module:model/RpcStatus} The populated <code>RpcStatus</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new RpcStatus();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Number');
}
if (data.hasOwnProperty('message')) {
obj['message'] = ApiClient.convertToType(data['message'], 'String');
}
if (data.hasOwnProperty('details')) {
obj['details'] = ApiClient.convertToType(data['details'], [ProtobufAny]);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>RpcStatus</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>RpcStatus</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['message'] && !(typeof data['message'] === 'string' || data['message'] instanceof String)) {
throw new Error("Expected the field `message` to be a primitive type in the JSON string but got " + data['message']);
}
// ensure the json data is an array
if (!Array.isArray(data['details'])) {
throw new Error("Expected the field `details` to be an array in the JSON data but got " + data['details']);
}
return true;
}
}
/**
* @member {Number} code
*/
RpcStatus.prototype['code'] = undefined;
/**
* @member {String} message
*/
RpcStatus.prototype['message'] = undefined;
/**
* @member {Array.<module:model/ProtobufAny>} details
*/
RpcStatus.prototype['details'] = undefined;
export default RpcStatus;

View File

@ -0,0 +1,163 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The ShareDetail model module.
* @module model/ShareDetail
* @version version not set
*/
class ShareDetail {
/**
* Constructs a new <code>ShareDetail</code>.
* @alias module:model/ShareDetail
*/
constructor() {
ShareDetail.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>ShareDetail</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ShareDetail} obj Optional instance to populate.
* @return {module:model/ShareDetail} The populated <code>ShareDetail</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ShareDetail();
if (data.hasOwnProperty('token')) {
obj['token'] = ApiClient.convertToType(data['token'], 'String');
}
if (data.hasOwnProperty('shareMode')) {
obj['shareMode'] = ApiClient.convertToType(data['shareMode'], 'String');
}
if (data.hasOwnProperty('backendMode')) {
obj['backendMode'] = ApiClient.convertToType(data['backendMode'], 'String');
}
if (data.hasOwnProperty('reserved')) {
obj['reserved'] = ApiClient.convertToType(data['reserved'], 'Boolean');
}
if (data.hasOwnProperty('frontendEndpoint')) {
obj['frontendEndpoint'] = ApiClient.convertToType(data['frontendEndpoint'], ['String']);
}
if (data.hasOwnProperty('backendEndpoint')) {
obj['backendEndpoint'] = ApiClient.convertToType(data['backendEndpoint'], 'String');
}
if (data.hasOwnProperty('closed')) {
obj['closed'] = ApiClient.convertToType(data['closed'], 'Boolean');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>ShareDetail</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ShareDetail</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
}
// ensure the json data is a string
if (data['shareMode'] && !(typeof data['shareMode'] === 'string' || data['shareMode'] instanceof String)) {
throw new Error("Expected the field `shareMode` to be a primitive type in the JSON string but got " + data['shareMode']);
}
// ensure the json data is a string
if (data['backendMode'] && !(typeof data['backendMode'] === 'string' || data['backendMode'] instanceof String)) {
throw new Error("Expected the field `backendMode` to be a primitive type in the JSON string but got " + data['backendMode']);
}
// ensure the json data is an array
if (!Array.isArray(data['frontendEndpoint'])) {
throw new Error("Expected the field `frontendEndpoint` to be an array in the JSON data but got " + data['frontendEndpoint']);
}
// ensure the json data is a string
if (data['backendEndpoint'] && !(typeof data['backendEndpoint'] === 'string' || data['backendEndpoint'] instanceof String)) {
throw new Error("Expected the field `backendEndpoint` to be a primitive type in the JSON string but got " + data['backendEndpoint']);
}
// ensure the json data is a string
if (data['status'] && !(typeof data['status'] === 'string' || data['status'] instanceof String)) {
throw new Error("Expected the field `status` to be a primitive type in the JSON string but got " + data['status']);
}
return true;
}
}
/**
* @member {String} token
*/
ShareDetail.prototype['token'] = undefined;
/**
* @member {String} shareMode
*/
ShareDetail.prototype['shareMode'] = undefined;
/**
* @member {String} backendMode
*/
ShareDetail.prototype['backendMode'] = undefined;
/**
* @member {Boolean} reserved
*/
ShareDetail.prototype['reserved'] = undefined;
/**
* @member {Array.<String>} frontendEndpoint
*/
ShareDetail.prototype['frontendEndpoint'] = undefined;
/**
* @member {String} backendEndpoint
*/
ShareDetail.prototype['backendEndpoint'] = undefined;
/**
* @member {Boolean} closed
*/
ShareDetail.prototype['closed'] = undefined;
/**
* @member {String} status
*/
ShareDetail.prototype['status'] = undefined;
export default ShareDetail;

View File

@ -0,0 +1,87 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The SharePrivateResponse model module.
* @module model/SharePrivateResponse
* @version version not set
*/
class SharePrivateResponse {
/**
* Constructs a new <code>SharePrivateResponse</code>.
* @alias module:model/SharePrivateResponse
*/
constructor() {
SharePrivateResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>SharePrivateResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/SharePrivateResponse} obj Optional instance to populate.
* @return {module:model/SharePrivateResponse} The populated <code>SharePrivateResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new SharePrivateResponse();
if (data.hasOwnProperty('token')) {
obj['token'] = ApiClient.convertToType(data['token'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>SharePrivateResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SharePrivateResponse</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
}
return true;
}
}
/**
* @member {String} token
*/
SharePrivateResponse.prototype['token'] = undefined;
export default SharePrivateResponse;

View File

@ -0,0 +1,99 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The SharePublicResponse model module.
* @module model/SharePublicResponse
* @version version not set
*/
class SharePublicResponse {
/**
* Constructs a new <code>SharePublicResponse</code>.
* @alias module:model/SharePublicResponse
*/
constructor() {
SharePublicResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>SharePublicResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/SharePublicResponse} obj Optional instance to populate.
* @return {module:model/SharePublicResponse} The populated <code>SharePublicResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new SharePublicResponse();
if (data.hasOwnProperty('token')) {
obj['token'] = ApiClient.convertToType(data['token'], 'String');
}
if (data.hasOwnProperty('frontendEndpoints')) {
obj['frontendEndpoints'] = ApiClient.convertToType(data['frontendEndpoints'], ['String']);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>SharePublicResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>SharePublicResponse</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
}
// ensure the json data is an array
if (!Array.isArray(data['frontendEndpoints'])) {
throw new Error("Expected the field `frontendEndpoints` to be an array in the JSON data but got " + data['frontendEndpoints']);
}
return true;
}
}
/**
* @member {String} token
*/
SharePublicResponse.prototype['token'] = undefined;
/**
* @member {Array.<String>} frontendEndpoints
*/
SharePublicResponse.prototype['frontendEndpoints'] = undefined;
export default SharePublicResponse;

View File

@ -0,0 +1,135 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The ShareReservedResponse model module.
* @module model/ShareReservedResponse
* @version version not set
*/
class ShareReservedResponse {
/**
* Constructs a new <code>ShareReservedResponse</code>.
* @alias module:model/ShareReservedResponse
*/
constructor() {
ShareReservedResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>ShareReservedResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ShareReservedResponse} obj Optional instance to populate.
* @return {module:model/ShareReservedResponse} The populated <code>ShareReservedResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ShareReservedResponse();
if (data.hasOwnProperty('token')) {
obj['token'] = ApiClient.convertToType(data['token'], 'String');
}
if (data.hasOwnProperty('backendMode')) {
obj['backendMode'] = ApiClient.convertToType(data['backendMode'], 'String');
}
if (data.hasOwnProperty('shareMode')) {
obj['shareMode'] = ApiClient.convertToType(data['shareMode'], 'String');
}
if (data.hasOwnProperty('frontendEndpoints')) {
obj['frontendEndpoints'] = ApiClient.convertToType(data['frontendEndpoints'], ['String']);
}
if (data.hasOwnProperty('target')) {
obj['target'] = ApiClient.convertToType(data['target'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>ShareReservedResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>ShareReservedResponse</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['token'] && !(typeof data['token'] === 'string' || data['token'] instanceof String)) {
throw new Error("Expected the field `token` to be a primitive type in the JSON string but got " + data['token']);
}
// ensure the json data is a string
if (data['backendMode'] && !(typeof data['backendMode'] === 'string' || data['backendMode'] instanceof String)) {
throw new Error("Expected the field `backendMode` to be a primitive type in the JSON string but got " + data['backendMode']);
}
// ensure the json data is a string
if (data['shareMode'] && !(typeof data['shareMode'] === 'string' || data['shareMode'] instanceof String)) {
throw new Error("Expected the field `shareMode` to be a primitive type in the JSON string but got " + data['shareMode']);
}
// ensure the json data is an array
if (!Array.isArray(data['frontendEndpoints'])) {
throw new Error("Expected the field `frontendEndpoints` to be an array in the JSON data but got " + data['frontendEndpoints']);
}
// ensure the json data is a string
if (data['target'] && !(typeof data['target'] === 'string' || data['target'] instanceof String)) {
throw new Error("Expected the field `target` to be a primitive type in the JSON string but got " + data['target']);
}
return true;
}
}
/**
* @member {String} token
*/
ShareReservedResponse.prototype['token'] = undefined;
/**
* @member {String} backendMode
*/
ShareReservedResponse.prototype['backendMode'] = undefined;
/**
* @member {String} shareMode
*/
ShareReservedResponse.prototype['shareMode'] = undefined;
/**
* @member {Array.<String>} frontendEndpoints
*/
ShareReservedResponse.prototype['frontendEndpoints'] = undefined;
/**
* @member {String} target
*/
ShareReservedResponse.prototype['target'] = undefined;
export default ShareReservedResponse;

View File

@ -0,0 +1,113 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import AccessDetail from './AccessDetail';
import ShareDetail from './ShareDetail';
/**
* The StatusResponse model module.
* @module model/StatusResponse
* @version version not set
*/
class StatusResponse {
/**
* Constructs a new <code>StatusResponse</code>.
* @alias module:model/StatusResponse
*/
constructor() {
StatusResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>StatusResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/StatusResponse} obj Optional instance to populate.
* @return {module:model/StatusResponse} The populated <code>StatusResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new StatusResponse();
if (data.hasOwnProperty('accesses')) {
obj['accesses'] = ApiClient.convertToType(data['accesses'], [AccessDetail]);
}
if (data.hasOwnProperty('shares')) {
obj['shares'] = ApiClient.convertToType(data['shares'], [ShareDetail]);
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>StatusResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>StatusResponse</code>.
*/
static validateJSON(data) {
if (data['accesses']) { // data not null
// ensure the json data is an array
if (!Array.isArray(data['accesses'])) {
throw new Error("Expected the field `accesses` to be an array in the JSON data but got " + data['accesses']);
}
// validate the optional field `accesses` (array)
for (const item of data['accesses']) {
AccessDetail.validateJSON(item);
};
}
if (data['shares']) { // data not null
// ensure the json data is an array
if (!Array.isArray(data['shares'])) {
throw new Error("Expected the field `shares` to be an array in the JSON data but got " + data['shares']);
}
// validate the optional field `shares` (array)
for (const item of data['shares']) {
ShareDetail.validateJSON(item);
};
}
return true;
}
}
/**
* @member {Array.<module:model/AccessDetail>} accesses
*/
StatusResponse.prototype['accesses'] = undefined;
/**
* @member {Array.<module:model/ShareDetail>} shares
*/
StatusResponse.prototype['shares'] = undefined;
export default StatusResponse;

View File

@ -0,0 +1,87 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The VersionResponse model module.
* @module model/VersionResponse
* @version version not set
*/
class VersionResponse {
/**
* Constructs a new <code>VersionResponse</code>.
* @alias module:model/VersionResponse
*/
constructor() {
VersionResponse.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>VersionResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/VersionResponse} obj Optional instance to populate.
* @return {module:model/VersionResponse} The populated <code>VersionResponse</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new VersionResponse();
if (data.hasOwnProperty('v')) {
obj['v'] = ApiClient.convertToType(data['v'], 'String');
}
}
return obj;
}
/**
* Validates the JSON data with respect to <code>VersionResponse</code>.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>VersionResponse</code>.
*/
static validateJSON(data) {
// ensure the json data is a string
if (data['v'] && !(typeof data['v'] === 'string' || data['v'] instanceof String)) {
throw new Error("Expected the field `v` to be a primitive type in the JSON string but got " + data['v']);
}
return true;
}
}
/**
* @member {String} v
*/
VersionResponse.prototype['v'] = undefined;
export default VersionResponse;

View File

@ -0,0 +1,73 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.AgentApi();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('AgentApi', function() {
describe('agentStatus', function() {
it('should call agentStatus successfully', function(done) {
//uncomment below and update the code to test agentStatus
//instance.agentStatus(function(error) {
// if (error) throw error;
//expect().to.be();
//});
done();
});
});
describe('agentVersion', function() {
it('should call agentVersion successfully', function(done) {
//uncomment below and update the code to test agentVersion
//instance.agentVersion(function(error) {
// if (error) throw error;
//expect().to.be();
//});
done();
});
});
});
}));

View File

@ -0,0 +1,83 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.AccessDetail();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('AccessDetail', function() {
it('should create an instance of AccessDetail', function() {
// uncomment below and update the code to test AccessDetail
//var instance = new AgentAgentGrpcAgentProto.AccessDetail();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.AccessDetail);
});
it('should have the property frontendToken (base name: "frontendToken")', function() {
// uncomment below and update the code to test the property frontendToken
//var instance = new AgentAgentGrpcAgentProto.AccessDetail();
//expect(instance).to.be();
});
it('should have the property token (base name: "token")', function() {
// uncomment below and update the code to test the property token
//var instance = new AgentAgentGrpcAgentProto.AccessDetail();
//expect(instance).to.be();
});
it('should have the property bindAddress (base name: "bindAddress")', function() {
// uncomment below and update the code to test the property bindAddress
//var instance = new AgentAgentGrpcAgentProto.AccessDetail();
//expect(instance).to.be();
});
it('should have the property responseHeaders (base name: "responseHeaders")', function() {
// uncomment below and update the code to test the property responseHeaders
//var instance = new AgentAgentGrpcAgentProto.AccessDetail();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,65 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.AccessPrivateResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('AccessPrivateResponse', function() {
it('should create an instance of AccessPrivateResponse', function() {
// uncomment below and update the code to test AccessPrivateResponse
//var instance = new AgentAgentGrpcAgentProto.AccessPrivateResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.AccessPrivateResponse);
});
it('should have the property frontendToken (base name: "frontendToken")', function() {
// uncomment below and update the code to test the property frontendToken
//var instance = new AgentAgentGrpcAgentProto.AccessPrivateResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,65 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.ProtobufAny();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('ProtobufAny', function() {
it('should create an instance of ProtobufAny', function() {
// uncomment below and update the code to test ProtobufAny
//var instance = new AgentAgentGrpcAgentProto.ProtobufAny();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.ProtobufAny);
});
it('should have the property type (base name: "@type")', function() {
// uncomment below and update the code to test the property type
//var instance = new AgentAgentGrpcAgentProto.ProtobufAny();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,77 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.RpcStatus();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('RpcStatus', function() {
it('should create an instance of RpcStatus', function() {
// uncomment below and update the code to test RpcStatus
//var instance = new AgentAgentGrpcAgentProto.RpcStatus();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.RpcStatus);
});
it('should have the property code (base name: "code")', function() {
// uncomment below and update the code to test the property code
//var instance = new AgentAgentGrpcAgentProto.RpcStatus();
//expect(instance).to.be();
});
it('should have the property message (base name: "message")', function() {
// uncomment below and update the code to test the property message
//var instance = new AgentAgentGrpcAgentProto.RpcStatus();
//expect(instance).to.be();
});
it('should have the property details (base name: "details")', function() {
// uncomment below and update the code to test the property details
//var instance = new AgentAgentGrpcAgentProto.RpcStatus();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,107 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.ShareDetail();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('ShareDetail', function() {
it('should create an instance of ShareDetail', function() {
// uncomment below and update the code to test ShareDetail
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.ShareDetail);
});
it('should have the property token (base name: "token")', function() {
// uncomment below and update the code to test the property token
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property shareMode (base name: "shareMode")', function() {
// uncomment below and update the code to test the property shareMode
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property backendMode (base name: "backendMode")', function() {
// uncomment below and update the code to test the property backendMode
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property reserved (base name: "reserved")', function() {
// uncomment below and update the code to test the property reserved
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property frontendEndpoint (base name: "frontendEndpoint")', function() {
// uncomment below and update the code to test the property frontendEndpoint
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property backendEndpoint (base name: "backendEndpoint")', function() {
// uncomment below and update the code to test the property backendEndpoint
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property closed (base name: "closed")', function() {
// uncomment below and update the code to test the property closed
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
it('should have the property status (base name: "status")', function() {
// uncomment below and update the code to test the property status
//var instance = new AgentAgentGrpcAgentProto.ShareDetail();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,65 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.SharePrivateResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('SharePrivateResponse', function() {
it('should create an instance of SharePrivateResponse', function() {
// uncomment below and update the code to test SharePrivateResponse
//var instance = new AgentAgentGrpcAgentProto.SharePrivateResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.SharePrivateResponse);
});
it('should have the property token (base name: "token")', function() {
// uncomment below and update the code to test the property token
//var instance = new AgentAgentGrpcAgentProto.SharePrivateResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,71 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.SharePublicResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('SharePublicResponse', function() {
it('should create an instance of SharePublicResponse', function() {
// uncomment below and update the code to test SharePublicResponse
//var instance = new AgentAgentGrpcAgentProto.SharePublicResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.SharePublicResponse);
});
it('should have the property token (base name: "token")', function() {
// uncomment below and update the code to test the property token
//var instance = new AgentAgentGrpcAgentProto.SharePublicResponse();
//expect(instance).to.be();
});
it('should have the property frontendEndpoints (base name: "frontendEndpoints")', function() {
// uncomment below and update the code to test the property frontendEndpoints
//var instance = new AgentAgentGrpcAgentProto.SharePublicResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,89 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('ShareReservedResponse', function() {
it('should create an instance of ShareReservedResponse', function() {
// uncomment below and update the code to test ShareReservedResponse
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.ShareReservedResponse);
});
it('should have the property token (base name: "token")', function() {
// uncomment below and update the code to test the property token
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be();
});
it('should have the property backendMode (base name: "backendMode")', function() {
// uncomment below and update the code to test the property backendMode
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be();
});
it('should have the property shareMode (base name: "shareMode")', function() {
// uncomment below and update the code to test the property shareMode
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be();
});
it('should have the property frontendEndpoints (base name: "frontendEndpoints")', function() {
// uncomment below and update the code to test the property frontendEndpoints
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be();
});
it('should have the property target (base name: "target")', function() {
// uncomment below and update the code to test the property target
//var instance = new AgentAgentGrpcAgentProto.ShareReservedResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,71 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.StatusResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('StatusResponse', function() {
it('should create an instance of StatusResponse', function() {
// uncomment below and update the code to test StatusResponse
//var instance = new AgentAgentGrpcAgentProto.StatusResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.StatusResponse);
});
it('should have the property accesses (base name: "accesses")', function() {
// uncomment below and update the code to test the property accesses
//var instance = new AgentAgentGrpcAgentProto.StatusResponse();
//expect(instance).to.be();
});
it('should have the property shares (base name: "shares")', function() {
// uncomment below and update the code to test the property shares
//var instance = new AgentAgentGrpcAgentProto.StatusResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -0,0 +1,65 @@
/**
* agent/agentGrpc/agent.proto
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: version not set
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', process.cwd()+'/src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require(process.cwd()+'/src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.AgentAgentGrpcAgentProto);
}
}(this, function(expect, AgentAgentGrpcAgentProto) {
'use strict';
var instance;
beforeEach(function() {
instance = new AgentAgentGrpcAgentProto.VersionResponse();
});
var getProperty = function(object, getter, property) {
// Use getter method if present; otherwise, get the property directly.
if (typeof object[getter] === 'function')
return object[getter]();
else
return object[property];
}
var setProperty = function(object, setter, property, value) {
// Use setter method if present; otherwise, set the property directly.
if (typeof object[setter] === 'function')
object[setter](value);
else
object[property] = value;
}
describe('VersionResponse', function() {
it('should create an instance of VersionResponse', function() {
// uncomment below and update the code to test VersionResponse
//var instance = new AgentAgentGrpcAgentProto.VersionResponse();
//expect(instance).to.be.a(AgentAgentGrpcAgentProto.VersionResponse);
});
it('should have the property v (base name: "v")', function() {
// uncomment below and update the code to test the property v
//var instance = new AgentAgentGrpcAgentProto.VersionResponse();
//expect(instance).to.be();
});
});
}));

View File

@ -1,7 +1,26 @@
"use client";
import {useEffect, useState} from "react";
import {AgentApi, ApiClient} from "@/api/src";
export default function Home() {
const [version, setVersion] = useState("");
let api = new AgentApi(new ApiClient("http://localhost:8888"));
useEffect(() => {
let mounted = true;
api.agentVersion((err, data) => {
console.log("error", err);
console.log("data", data);
if(mounted) {
setVersion(data.v);
}
});
}, []);
return (
<div className="grid grid-rows-[20px_1fr_20px] min-h-screen p-8 pb-20 gap-16 sm:p-20 font-[family-name:var(--font-geist-mono)]">
<p>Agent</p>
<p>Agent: {version}</p>
</div>
);
}

View File

@ -99,7 +99,7 @@ func (a *Agent) gateway() {
logrus.Fatalf("unable to register gateway: %v", err)
}
if err := http.ListenAndServe(":8888", mux); err != nil {
if err := http.ListenAndServe(":8888", cors(mux)); err != nil {
logrus.Error(err)
}
}
@ -177,3 +177,15 @@ type agentGrpcImpl struct {
agentGrpc.UnimplementedAgentServer
agent *Agent
}
func cors(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", r.Header.Get("Origin"))
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, ResponseType, User-Agent")
if r.Method == "OPTIONS" {
return
}
h.ServeHTTP(w, r)
})
}

View File

@ -42,7 +42,7 @@ swagger generate server -P rest_model_zrok.Principal -f "$zrokSpec" -s rest_serv
echo "...generating zrok client"
swagger generate client -P rest_model_zrok.Principal -f "$zrokSpec" -c rest_client_zrok -t "$zrokDir" -m "rest_model_zrok"
echo "...generating js client"
echo "...generating web console js client"
openapi -s specs/zrok.yml -o ui/src/api -l js
echo "...generating ts client"
@ -52,3 +52,6 @@ echo "...generating python client"
swagger-codegen generate -i specs/zrok.yml -o sdk/python/sdk/zrok -c $pythonConfig -l python
git checkout rest_server_zrok/configure_zrok.go
echo "...generating agent console js client"
openapi-generator-cli generate -i agent/agentGrpc/agent.swagger.json -o agent/agent-ui/src/api -g javascript