@mlhub/agents-ts-sdk 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +37 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +45 -0
- package/dist/apis/AgentsApi.d.ts +79 -0
- package/dist/apis/AgentsApi.js +281 -0
- package/dist/apis/HealthApi.d.ts +25 -0
- package/dist/apis/HealthApi.js +118 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +20 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Agent.d.ts +130 -0
- package/dist/models/Agent.js +76 -0
- package/dist/models/AgentArtifactType.d.ts +27 -0
- package/dist/models/AgentArtifactType.js +42 -0
- package/dist/models/AgentDeploymentModality.d.ts +23 -0
- package/dist/models/AgentDeploymentModality.js +38 -0
- package/dist/models/AgentLiveness.d.ts +23 -0
- package/dist/models/AgentLiveness.js +38 -0
- package/dist/models/AgentProvider.d.ts +33 -0
- package/dist/models/AgentProvider.js +42 -0
- package/dist/models/AgentRecord.d.ts +124 -0
- package/dist/models/AgentRecord.js +74 -0
- package/dist/models/AgentSkill.d.ts +51 -0
- package/dist/models/AgentSkill.js +48 -0
- package/dist/models/ArtifactLocator.d.ts +34 -0
- package/dist/models/ArtifactLocator.js +43 -0
- package/dist/models/Capabilities.d.ts +33 -0
- package/dist/models/Capabilities.js +42 -0
- package/dist/models/CreateAgentBody.d.ts +76 -0
- package/dist/models/CreateAgentBody.js +58 -0
- package/dist/models/CreateAgentRecordBody.d.ts +106 -0
- package/dist/models/CreateAgentRecordBody.js +68 -0
- package/dist/models/CreateAgentRecordResponse.d.ts +52 -0
- package/dist/models/CreateAgentRecordResponse.js +49 -0
- package/dist/models/CreateAgentResponse.d.ts +52 -0
- package/dist/models/CreateAgentResponse.js +49 -0
- package/dist/models/Endpoint.d.ts +57 -0
- package/dist/models/Endpoint.js +50 -0
- package/dist/models/ListAgentRecordsResponse.d.ts +52 -0
- package/dist/models/ListAgentRecordsResponse.js +49 -0
- package/dist/models/ListAgentsResponse.d.ts +52 -0
- package/dist/models/ListAgentsResponse.js +49 -0
- package/dist/models/MessageBinding.d.ts +24 -0
- package/dist/models/MessageBinding.js +39 -0
- package/dist/models/RestHttpAgentEndpoint.d.ts +46 -0
- package/dist/models/RestHttpAgentEndpoint.js +48 -0
- package/dist/models/RestHttpAgentInterface.d.ts +46 -0
- package/dist/models/RestHttpAgentInterface.js +48 -0
- package/dist/models/RestHttpLivenessProbe.d.ts +51 -0
- package/dist/models/RestHttpLivenessProbe.js +48 -0
- package/dist/models/RpcAgentEndpoint.d.ts +40 -0
- package/dist/models/RpcAgentEndpoint.js +46 -0
- package/dist/models/RpcAgentInterface.d.ts +40 -0
- package/dist/models/RpcAgentInterface.js +46 -0
- package/dist/models/StdioAgentEndpoint.d.ts +40 -0
- package/dist/models/StdioAgentEndpoint.js +46 -0
- package/dist/models/StdioAgentInterface.d.ts +40 -0
- package/dist/models/StdioAgentInterface.js +46 -0
- package/dist/models/Visibility.d.ts +23 -0
- package/dist/models/Visibility.js +38 -0
- package/dist/models/index.d.ts +25 -0
- package/dist/models/index.js +43 -0
- package/dist/runtime.d.ts +140 -0
- package/dist/runtime.js +430 -0
- package/package.json +15 -0
- package/src/apis/AgentsApi.ts +207 -0
- package/src/apis/HealthApi.ts +48 -0
- package/src/apis/index.ts +4 -0
- package/src/index.ts +5 -0
- package/src/models/Agent.ts +223 -0
- package/src/models/AgentArtifactType.ts +40 -0
- package/src/models/AgentDeploymentModality.ts +36 -0
- package/src/models/AgentLiveness.ts +36 -0
- package/src/models/AgentProvider.ts +64 -0
- package/src/models/AgentRecord.ts +219 -0
- package/src/models/AgentSkill.ts +88 -0
- package/src/models/ArtifactLocator.ts +71 -0
- package/src/models/Capabilities.ts +64 -0
- package/src/models/CreateAgentBody.ts +143 -0
- package/src/models/CreateAgentRecordBody.ts +195 -0
- package/src/models/CreateAgentRecordResponse.ts +95 -0
- package/src/models/CreateAgentResponse.ts +95 -0
- package/src/models/Endpoint.ts +96 -0
- package/src/models/ListAgentRecordsResponse.ts +95 -0
- package/src/models/ListAgentsResponse.ts +95 -0
- package/src/models/MessageBinding.ts +37 -0
- package/src/models/RestHttpAgentEndpoint.ts +91 -0
- package/src/models/RestHttpAgentInterface.ts +91 -0
- package/src/models/RestHttpLivenessProbe.ts +88 -0
- package/src/models/RpcAgentEndpoint.ts +79 -0
- package/src/models/RpcAgentInterface.ts +79 -0
- package/src/models/StdioAgentEndpoint.ts +79 -0
- package/src/models/StdioAgentInterface.ts +79 -0
- package/src/models/Visibility.ts +36 -0
- package/src/models/index.ts +27 -0
- package/src/runtime.ts +320 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
.openapi-generator-ignore
|
|
4
|
+
README.md
|
|
5
|
+
package.json
|
|
6
|
+
src/apis/AgentsApi.ts
|
|
7
|
+
src/apis/HealthApi.ts
|
|
8
|
+
src/apis/index.ts
|
|
9
|
+
src/index.ts
|
|
10
|
+
src/models/Agent.ts
|
|
11
|
+
src/models/AgentArtifactType.ts
|
|
12
|
+
src/models/AgentDeploymentModality.ts
|
|
13
|
+
src/models/AgentLiveness.ts
|
|
14
|
+
src/models/AgentProvider.ts
|
|
15
|
+
src/models/AgentRecord.ts
|
|
16
|
+
src/models/AgentSkill.ts
|
|
17
|
+
src/models/ArtifactLocator.ts
|
|
18
|
+
src/models/Capabilities.ts
|
|
19
|
+
src/models/CreateAgentBody.ts
|
|
20
|
+
src/models/CreateAgentRecordBody.ts
|
|
21
|
+
src/models/CreateAgentRecordResponse.ts
|
|
22
|
+
src/models/CreateAgentResponse.ts
|
|
23
|
+
src/models/Endpoint.ts
|
|
24
|
+
src/models/ListAgentRecordsResponse.ts
|
|
25
|
+
src/models/ListAgentsResponse.ts
|
|
26
|
+
src/models/MessageBinding.ts
|
|
27
|
+
src/models/RestHttpAgentEndpoint.ts
|
|
28
|
+
src/models/RestHttpAgentInterface.ts
|
|
29
|
+
src/models/RestHttpLivenessProbe.ts
|
|
30
|
+
src/models/RpcAgentEndpoint.ts
|
|
31
|
+
src/models/RpcAgentInterface.ts
|
|
32
|
+
src/models/StdioAgentEndpoint.ts
|
|
33
|
+
src/models/StdioAgentInterface.ts
|
|
34
|
+
src/models/Visibility.ts
|
|
35
|
+
src/models/index.ts
|
|
36
|
+
src/runtime.ts
|
|
37
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5.3.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## @mlhub/agents-ts-sdk@0.18.0
|
|
2
|
+
|
|
3
|
+
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
|
19
|
+
|
|
20
|
+
### Building
|
|
21
|
+
|
|
22
|
+
To build and compile the typescript sources to javascript use:
|
|
23
|
+
```
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Publishing
|
|
29
|
+
|
|
30
|
+
First build the package then run ```npm publish```
|
|
31
|
+
|
|
32
|
+
### Consuming
|
|
33
|
+
|
|
34
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
35
|
+
|
|
36
|
+
_published:_
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
npm install @mlhub/agents-ts-sdk@0.18.0 --save
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
_unPublished (not recommended):_
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MLHub Agents API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import { CreateAgentBody, CreateAgentRecordBody, CreateAgentRecordResponse, CreateAgentResponse, ListAgentRecordsResponse, ListAgentsResponse } from '../models';
|
|
14
|
+
export interface CreateAgentRequest {
|
|
15
|
+
createAgentBody: CreateAgentBody;
|
|
16
|
+
}
|
|
17
|
+
export interface CreateAgentRecordRequest {
|
|
18
|
+
createAgentRecordBody: CreateAgentRecordBody;
|
|
19
|
+
}
|
|
20
|
+
export interface ListAgentRecordsRequest {
|
|
21
|
+
scope: ListAgentRecordsScopeEnum;
|
|
22
|
+
}
|
|
23
|
+
export interface ListAgentsRequest {
|
|
24
|
+
scope: ListAgentsScopeEnum;
|
|
25
|
+
includeEndpoints: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare class AgentsApi extends runtime.BaseAPI {
|
|
31
|
+
/**
|
|
32
|
+
* Register an agent
|
|
33
|
+
*/
|
|
34
|
+
createAgentRaw(requestParameters: CreateAgentRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<CreateAgentResponse>>;
|
|
35
|
+
/**
|
|
36
|
+
* Register an agent
|
|
37
|
+
*/
|
|
38
|
+
createAgent(requestParameters: CreateAgentRequest, initOverrides?: RequestInit): Promise<CreateAgentResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* Create an agent record
|
|
41
|
+
*/
|
|
42
|
+
createAgentRecordRaw(requestParameters: CreateAgentRecordRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<CreateAgentRecordResponse>>;
|
|
43
|
+
/**
|
|
44
|
+
* Create an agent record
|
|
45
|
+
*/
|
|
46
|
+
createAgentRecord(requestParameters: CreateAgentRecordRequest, initOverrides?: RequestInit): Promise<CreateAgentRecordResponse>;
|
|
47
|
+
/**
|
|
48
|
+
* List agent records
|
|
49
|
+
*/
|
|
50
|
+
listAgentRecordsRaw(requestParameters: ListAgentRecordsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListAgentRecordsResponse>>;
|
|
51
|
+
/**
|
|
52
|
+
* List agent records
|
|
53
|
+
*/
|
|
54
|
+
listAgentRecords(requestParameters: ListAgentRecordsRequest, initOverrides?: RequestInit): Promise<ListAgentRecordsResponse>;
|
|
55
|
+
/**
|
|
56
|
+
* List agents
|
|
57
|
+
*/
|
|
58
|
+
listAgentsRaw(requestParameters: ListAgentsRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<ListAgentsResponse>>;
|
|
59
|
+
/**
|
|
60
|
+
* List agents
|
|
61
|
+
*/
|
|
62
|
+
listAgents(requestParameters: ListAgentsRequest, initOverrides?: RequestInit): Promise<ListAgentsResponse>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @export
|
|
66
|
+
* @enum {string}
|
|
67
|
+
*/
|
|
68
|
+
export declare enum ListAgentRecordsScopeEnum {
|
|
69
|
+
Owned = "Owned",
|
|
70
|
+
Shared = "Shared"
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @export
|
|
74
|
+
* @enum {string}
|
|
75
|
+
*/
|
|
76
|
+
export declare enum ListAgentsScopeEnum {
|
|
77
|
+
Owned = "Owned",
|
|
78
|
+
Shared = "Shared"
|
|
79
|
+
}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* MLHub Agents API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.ListAgentsScopeEnum = exports.ListAgentRecordsScopeEnum = exports.AgentsApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
var models_1 = require("../models");
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
*/
|
|
73
|
+
var AgentsApi = /** @class */ (function (_super) {
|
|
74
|
+
__extends(AgentsApi, _super);
|
|
75
|
+
function AgentsApi() {
|
|
76
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Register an agent
|
|
80
|
+
*/
|
|
81
|
+
AgentsApi.prototype.createAgentRaw = function (requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var queryParameters, headerParameters, response;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
if (requestParameters.createAgentBody === null || requestParameters.createAgentBody === undefined) {
|
|
88
|
+
throw new runtime.RequiredError('createAgentBody', 'Required parameter requestParameters.createAgentBody was null or undefined when calling createAgent.');
|
|
89
|
+
}
|
|
90
|
+
queryParameters = {};
|
|
91
|
+
headerParameters = {};
|
|
92
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
93
|
+
return [4 /*yield*/, this.request({
|
|
94
|
+
path: "/agents-api/agents",
|
|
95
|
+
method: 'POST',
|
|
96
|
+
headers: headerParameters,
|
|
97
|
+
query: queryParameters,
|
|
98
|
+
body: (0, models_1.CreateAgentBodyToJSON)(requestParameters.createAgentBody),
|
|
99
|
+
}, initOverrides)];
|
|
100
|
+
case 1:
|
|
101
|
+
response = _a.sent();
|
|
102
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.CreateAgentResponseFromJSON)(jsonValue); })];
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Register an agent
|
|
109
|
+
*/
|
|
110
|
+
AgentsApi.prototype.createAgent = function (requestParameters, initOverrides) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
112
|
+
var response;
|
|
113
|
+
return __generator(this, function (_a) {
|
|
114
|
+
switch (_a.label) {
|
|
115
|
+
case 0: return [4 /*yield*/, this.createAgentRaw(requestParameters, initOverrides)];
|
|
116
|
+
case 1:
|
|
117
|
+
response = _a.sent();
|
|
118
|
+
return [4 /*yield*/, response.value()];
|
|
119
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Create an agent record
|
|
126
|
+
*/
|
|
127
|
+
AgentsApi.prototype.createAgentRecordRaw = function (requestParameters, initOverrides) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
129
|
+
var queryParameters, headerParameters, response;
|
|
130
|
+
return __generator(this, function (_a) {
|
|
131
|
+
switch (_a.label) {
|
|
132
|
+
case 0:
|
|
133
|
+
if (requestParameters.createAgentRecordBody === null || requestParameters.createAgentRecordBody === undefined) {
|
|
134
|
+
throw new runtime.RequiredError('createAgentRecordBody', 'Required parameter requestParameters.createAgentRecordBody was null or undefined when calling createAgentRecord.');
|
|
135
|
+
}
|
|
136
|
+
queryParameters = {};
|
|
137
|
+
headerParameters = {};
|
|
138
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
139
|
+
return [4 /*yield*/, this.request({
|
|
140
|
+
path: "/agents-api/agent-records",
|
|
141
|
+
method: 'POST',
|
|
142
|
+
headers: headerParameters,
|
|
143
|
+
query: queryParameters,
|
|
144
|
+
body: (0, models_1.CreateAgentRecordBodyToJSON)(requestParameters.createAgentRecordBody),
|
|
145
|
+
}, initOverrides)];
|
|
146
|
+
case 1:
|
|
147
|
+
response = _a.sent();
|
|
148
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.CreateAgentRecordResponseFromJSON)(jsonValue); })];
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Create an agent record
|
|
155
|
+
*/
|
|
156
|
+
AgentsApi.prototype.createAgentRecord = function (requestParameters, initOverrides) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
158
|
+
var response;
|
|
159
|
+
return __generator(this, function (_a) {
|
|
160
|
+
switch (_a.label) {
|
|
161
|
+
case 0: return [4 /*yield*/, this.createAgentRecordRaw(requestParameters, initOverrides)];
|
|
162
|
+
case 1:
|
|
163
|
+
response = _a.sent();
|
|
164
|
+
return [4 /*yield*/, response.value()];
|
|
165
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* List agent records
|
|
172
|
+
*/
|
|
173
|
+
AgentsApi.prototype.listAgentRecordsRaw = function (requestParameters, initOverrides) {
|
|
174
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
175
|
+
var queryParameters, headerParameters, response;
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
if (requestParameters.scope === null || requestParameters.scope === undefined) {
|
|
180
|
+
throw new runtime.RequiredError('scope', 'Required parameter requestParameters.scope was null or undefined when calling listAgentRecords.');
|
|
181
|
+
}
|
|
182
|
+
queryParameters = {};
|
|
183
|
+
headerParameters = {};
|
|
184
|
+
return [4 /*yield*/, this.request({
|
|
185
|
+
path: "/agents-api/agent-records".replace("{".concat("scope", "}"), encodeURIComponent(String(requestParameters.scope))),
|
|
186
|
+
method: 'GET',
|
|
187
|
+
headers: headerParameters,
|
|
188
|
+
query: queryParameters,
|
|
189
|
+
}, initOverrides)];
|
|
190
|
+
case 1:
|
|
191
|
+
response = _a.sent();
|
|
192
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ListAgentRecordsResponseFromJSON)(jsonValue); })];
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* List agent records
|
|
199
|
+
*/
|
|
200
|
+
AgentsApi.prototype.listAgentRecords = function (requestParameters, initOverrides) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
+
var response;
|
|
203
|
+
return __generator(this, function (_a) {
|
|
204
|
+
switch (_a.label) {
|
|
205
|
+
case 0: return [4 /*yield*/, this.listAgentRecordsRaw(requestParameters, initOverrides)];
|
|
206
|
+
case 1:
|
|
207
|
+
response = _a.sent();
|
|
208
|
+
return [4 /*yield*/, response.value()];
|
|
209
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* List agents
|
|
216
|
+
*/
|
|
217
|
+
AgentsApi.prototype.listAgentsRaw = function (requestParameters, initOverrides) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
219
|
+
var queryParameters, headerParameters, response;
|
|
220
|
+
return __generator(this, function (_a) {
|
|
221
|
+
switch (_a.label) {
|
|
222
|
+
case 0:
|
|
223
|
+
if (requestParameters.scope === null || requestParameters.scope === undefined) {
|
|
224
|
+
throw new runtime.RequiredError('scope', 'Required parameter requestParameters.scope was null or undefined when calling listAgents.');
|
|
225
|
+
}
|
|
226
|
+
if (requestParameters.includeEndpoints === null || requestParameters.includeEndpoints === undefined) {
|
|
227
|
+
throw new runtime.RequiredError('includeEndpoints', 'Required parameter requestParameters.includeEndpoints was null or undefined when calling listAgents.');
|
|
228
|
+
}
|
|
229
|
+
queryParameters = {};
|
|
230
|
+
headerParameters = {};
|
|
231
|
+
return [4 /*yield*/, this.request({
|
|
232
|
+
path: "/agents-api/agents".replace("{".concat("scope", "}"), encodeURIComponent(String(requestParameters.scope))).replace("{".concat("include_endpoints", "}"), encodeURIComponent(String(requestParameters.includeEndpoints))),
|
|
233
|
+
method: 'GET',
|
|
234
|
+
headers: headerParameters,
|
|
235
|
+
query: queryParameters,
|
|
236
|
+
}, initOverrides)];
|
|
237
|
+
case 1:
|
|
238
|
+
response = _a.sent();
|
|
239
|
+
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.ListAgentsResponseFromJSON)(jsonValue); })];
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* List agents
|
|
246
|
+
*/
|
|
247
|
+
AgentsApi.prototype.listAgents = function (requestParameters, initOverrides) {
|
|
248
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
249
|
+
var response;
|
|
250
|
+
return __generator(this, function (_a) {
|
|
251
|
+
switch (_a.label) {
|
|
252
|
+
case 0: return [4 /*yield*/, this.listAgentsRaw(requestParameters, initOverrides)];
|
|
253
|
+
case 1:
|
|
254
|
+
response = _a.sent();
|
|
255
|
+
return [4 /*yield*/, response.value()];
|
|
256
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
};
|
|
261
|
+
return AgentsApi;
|
|
262
|
+
}(runtime.BaseAPI));
|
|
263
|
+
exports.AgentsApi = AgentsApi;
|
|
264
|
+
/**
|
|
265
|
+
* @export
|
|
266
|
+
* @enum {string}
|
|
267
|
+
*/
|
|
268
|
+
var ListAgentRecordsScopeEnum;
|
|
269
|
+
(function (ListAgentRecordsScopeEnum) {
|
|
270
|
+
ListAgentRecordsScopeEnum["Owned"] = "Owned";
|
|
271
|
+
ListAgentRecordsScopeEnum["Shared"] = "Shared";
|
|
272
|
+
})(ListAgentRecordsScopeEnum || (exports.ListAgentRecordsScopeEnum = ListAgentRecordsScopeEnum = {}));
|
|
273
|
+
/**
|
|
274
|
+
* @export
|
|
275
|
+
* @enum {string}
|
|
276
|
+
*/
|
|
277
|
+
var ListAgentsScopeEnum;
|
|
278
|
+
(function (ListAgentsScopeEnum) {
|
|
279
|
+
ListAgentsScopeEnum["Owned"] = "Owned";
|
|
280
|
+
ListAgentsScopeEnum["Shared"] = "Shared";
|
|
281
|
+
})(ListAgentsScopeEnum || (exports.ListAgentsScopeEnum = ListAgentsScopeEnum = {}));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MLHub Agents API
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class HealthApi extends runtime.BaseAPI {
|
|
17
|
+
/**
|
|
18
|
+
* Check service health
|
|
19
|
+
*/
|
|
20
|
+
healthcheckRaw(initOverrides?: RequestInit): Promise<runtime.ApiResponse<void>>;
|
|
21
|
+
/**
|
|
22
|
+
* Check service health
|
|
23
|
+
*/
|
|
24
|
+
healthcheck(initOverrides?: RequestInit): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* MLHub Agents API
|
|
6
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 0.1.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __extends = (this && this.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
+
function step(op) {
|
|
44
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
+
switch (op[0]) {
|
|
49
|
+
case 0: case 1: t = op; break;
|
|
50
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
+
default:
|
|
54
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
+
if (t[2]) _.ops.pop();
|
|
59
|
+
_.trys.pop(); continue;
|
|
60
|
+
}
|
|
61
|
+
op = body.call(thisArg, _);
|
|
62
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.HealthApi = void 0;
|
|
68
|
+
var runtime = require("../runtime");
|
|
69
|
+
/**
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
var HealthApi = /** @class */ (function (_super) {
|
|
73
|
+
__extends(HealthApi, _super);
|
|
74
|
+
function HealthApi() {
|
|
75
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check service health
|
|
79
|
+
*/
|
|
80
|
+
HealthApi.prototype.healthcheckRaw = function (initOverrides) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var queryParameters, headerParameters, response;
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
switch (_a.label) {
|
|
85
|
+
case 0:
|
|
86
|
+
queryParameters = {};
|
|
87
|
+
headerParameters = {};
|
|
88
|
+
return [4 /*yield*/, this.request({
|
|
89
|
+
path: "/agents-api/healthcheck",
|
|
90
|
+
method: 'GET',
|
|
91
|
+
headers: headerParameters,
|
|
92
|
+
query: queryParameters,
|
|
93
|
+
}, initOverrides)];
|
|
94
|
+
case 1:
|
|
95
|
+
response = _a.sent();
|
|
96
|
+
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Check service health
|
|
103
|
+
*/
|
|
104
|
+
HealthApi.prototype.healthcheck = function (initOverrides) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
switch (_a.label) {
|
|
108
|
+
case 0: return [4 /*yield*/, this.healthcheckRaw(initOverrides)];
|
|
109
|
+
case 1:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
return HealthApi;
|
|
117
|
+
}(runtime.BaseAPI));
|
|
118
|
+
exports.HealthApi = HealthApi;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./AgentsApi"), exports);
|
|
20
|
+
__exportStar(require("./HealthApi"), exports);
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/* tslint:disable */
|
|
18
|
+
/* eslint-disable */
|
|
19
|
+
__exportStar(require("./runtime"), exports);
|
|
20
|
+
__exportStar(require("./apis"), exports);
|
|
21
|
+
__exportStar(require("./models"), exports);
|