asteroid-odyssey 1.0.7
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/README.md +54 -0
- package/dist/generated/agents/core/ApiError.d.ts +10 -0
- package/dist/generated/agents/core/ApiError.js +20 -0
- package/dist/generated/agents/core/ApiRequestOptions.d.ts +13 -0
- package/dist/generated/agents/core/ApiRequestOptions.js +2 -0
- package/dist/generated/agents/core/ApiResult.d.ts +7 -0
- package/dist/generated/agents/core/ApiResult.js +2 -0
- package/dist/generated/agents/core/CancelablePromise.d.ts +20 -0
- package/dist/generated/agents/core/CancelablePromise.js +104 -0
- package/dist/generated/agents/core/OpenAPI.d.ts +16 -0
- package/dist/generated/agents/core/OpenAPI.js +14 -0
- package/dist/generated/agents/core/request.d.ts +30 -0
- package/dist/generated/agents/core/request.js +294 -0
- package/dist/generated/agents/index.d.ts +16 -0
- package/dist/generated/agents/index.js +24 -0
- package/dist/generated/agents/models/Agent.d.ts +22 -0
- package/dist/generated/agents/models/Agent.js +2 -0
- package/dist/generated/agents/models/CreateWorkflowRequest.d.ts +27 -0
- package/dist/generated/agents/models/CreateWorkflowRequest.js +14 -0
- package/dist/generated/agents/models/Execution.d.ts +18 -0
- package/dist/generated/agents/models/Execution.js +2 -0
- package/dist/generated/agents/models/OptimisationRequest.d.ts +6 -0
- package/dist/generated/agents/models/OptimisationRequest.js +2 -0
- package/dist/generated/agents/models/Workflow.d.ts +26 -0
- package/dist/generated/agents/models/Workflow.js +2 -0
- package/dist/generated/agents/models/WorkflowExecution.d.ts +6 -0
- package/dist/generated/agents/models/WorkflowExecution.js +2 -0
- package/dist/generated/agents/models/WorkflowExecutionRequest.d.ts +4 -0
- package/dist/generated/agents/models/WorkflowExecutionRequest.js +2 -0
- package/dist/generated/agents/services/AgentService.d.ts +10 -0
- package/dist/generated/agents/services/AgentService.js +19 -0
- package/dist/generated/agents/services/ApiService.d.ts +9 -0
- package/dist/generated/agents/services/ApiService.js +19 -0
- package/dist/generated/agents/services/DefaultService.d.ts +23 -0
- package/dist/generated/agents/services/DefaultService.js +43 -0
- package/dist/generated/agents/services/OptimiserService.d.ts +11 -0
- package/dist/generated/agents/services/OptimiserService.js +22 -0
- package/dist/generated/agents/services/WorkflowService.d.ts +19 -0
- package/dist/generated/agents/services/WorkflowService.js +40 -0
- package/dist/generated/platform/core/ApiError.d.ts +10 -0
- package/dist/generated/platform/core/ApiError.js +20 -0
- package/dist/generated/platform/core/ApiRequestOptions.d.ts +13 -0
- package/dist/generated/platform/core/ApiRequestOptions.js +2 -0
- package/dist/generated/platform/core/ApiResult.d.ts +7 -0
- package/dist/generated/platform/core/ApiResult.js +2 -0
- package/dist/generated/platform/core/CancelablePromise.d.ts +20 -0
- package/dist/generated/platform/core/CancelablePromise.js +104 -0
- package/dist/generated/platform/core/OpenAPI.d.ts +16 -0
- package/dist/generated/platform/core/OpenAPI.js +14 -0
- package/dist/generated/platform/core/request.d.ts +30 -0
- package/dist/generated/platform/core/request.js +294 -0
- package/dist/generated/platform/index.d.ts +56 -0
- package/dist/generated/platform/index.js +58 -0
- package/dist/generated/platform/models/APIKey.d.ts +9 -0
- package/dist/generated/platform/models/APIKey.js +2 -0
- package/dist/generated/platform/models/AgentReport.d.ts +45 -0
- package/dist/generated/platform/models/AgentReport.js +2 -0
- package/dist/generated/platform/models/AsteroidChat.d.ts +9 -0
- package/dist/generated/platform/models/AsteroidChat.js +2 -0
- package/dist/generated/platform/models/AsteroidChoice.d.ts +16 -0
- package/dist/generated/platform/models/AsteroidChoice.js +14 -0
- package/dist/generated/platform/models/AsteroidMessage.d.ts +27 -0
- package/dist/generated/platform/models/AsteroidMessage.js +15 -0
- package/dist/generated/platform/models/AsteroidToolCall.d.ts +11 -0
- package/dist/generated/platform/models/AsteroidToolCall.js +2 -0
- package/dist/generated/platform/models/ChainExecution.d.ts +6 -0
- package/dist/generated/platform/models/ChainExecution.js +2 -0
- package/dist/generated/platform/models/ChainExecutionState.d.ts +8 -0
- package/dist/generated/platform/models/ChainExecutionState.js +2 -0
- package/dist/generated/platform/models/ChainRequest.d.ts +6 -0
- package/dist/generated/platform/models/ChainRequest.js +2 -0
- package/dist/generated/platform/models/ChatFormat.d.ts +5 -0
- package/dist/generated/platform/models/ChatFormat.js +13 -0
- package/dist/generated/platform/models/ChatIds.d.ts +5 -0
- package/dist/generated/platform/models/ChatIds.js +2 -0
- package/dist/generated/platform/models/ChoiceIds.d.ts +6 -0
- package/dist/generated/platform/models/ChoiceIds.js +2 -0
- package/dist/generated/platform/models/Decision.d.ts +7 -0
- package/dist/generated/platform/models/Decision.js +15 -0
- package/dist/generated/platform/models/ErrorResponse.d.ts +4 -0
- package/dist/generated/platform/models/ErrorResponse.js +2 -0
- package/dist/generated/platform/models/FailureCategory.d.ts +12 -0
- package/dist/generated/platform/models/FailureCategory.js +20 -0
- package/dist/generated/platform/models/FailureReport.d.ts +33 -0
- package/dist/generated/platform/models/FailureReport.js +13 -0
- package/dist/generated/platform/models/Feedback.d.ts +13 -0
- package/dist/generated/platform/models/Feedback.js +2 -0
- package/dist/generated/platform/models/FeedbackRequest.d.ts +6 -0
- package/dist/generated/platform/models/FeedbackRequest.js +2 -0
- package/dist/generated/platform/models/HubStats.d.ts +10 -0
- package/dist/generated/platform/models/HubStats.js +2 -0
- package/dist/generated/platform/models/MessageRole.d.ts +5 -0
- package/dist/generated/platform/models/MessageRole.js +13 -0
- package/dist/generated/platform/models/MessageType.d.ts +6 -0
- package/dist/generated/platform/models/MessageType.js +14 -0
- package/dist/generated/platform/models/Permission.d.ts +5 -0
- package/dist/generated/platform/models/Permission.js +13 -0
- package/dist/generated/platform/models/Project.d.ts +8 -0
- package/dist/generated/platform/models/Project.js +2 -0
- package/dist/generated/platform/models/ReviewPayload.d.ts +29 -0
- package/dist/generated/platform/models/ReviewPayload.js +2 -0
- package/dist/generated/platform/models/Run.d.ts +9 -0
- package/dist/generated/platform/models/Run.js +2 -0
- package/dist/generated/platform/models/RunExecution.d.ts +8 -0
- package/dist/generated/platform/models/RunExecution.js +2 -0
- package/dist/generated/platform/models/RunState.d.ts +2 -0
- package/dist/generated/platform/models/RunState.js +2 -0
- package/dist/generated/platform/models/Status.d.ts +8 -0
- package/dist/generated/platform/models/Status.js +16 -0
- package/dist/generated/platform/models/SupervisionRequest.d.ts +9 -0
- package/dist/generated/platform/models/SupervisionRequest.js +2 -0
- package/dist/generated/platform/models/SupervisionRequestState.d.ts +8 -0
- package/dist/generated/platform/models/SupervisionRequestState.js +2 -0
- package/dist/generated/platform/models/SupervisionResult.d.ts +9 -0
- package/dist/generated/platform/models/SupervisionResult.js +2 -0
- package/dist/generated/platform/models/SupervisionStatus.d.ts +7 -0
- package/dist/generated/platform/models/SupervisionStatus.js +2 -0
- package/dist/generated/platform/models/Supervisor.d.ts +10 -0
- package/dist/generated/platform/models/Supervisor.js +2 -0
- package/dist/generated/platform/models/SupervisorChain.d.ts +5 -0
- package/dist/generated/platform/models/SupervisorChain.js +2 -0
- package/dist/generated/platform/models/SupervisorStats.d.ts +21 -0
- package/dist/generated/platform/models/SupervisorStats.js +2 -0
- package/dist/generated/platform/models/SupervisorType.d.ts +8 -0
- package/dist/generated/platform/models/SupervisorType.js +16 -0
- package/dist/generated/platform/models/Task.d.ts +7 -0
- package/dist/generated/platform/models/Task.js +2 -0
- package/dist/generated/platform/models/Tool.d.ts +9 -0
- package/dist/generated/platform/models/Tool.js +2 -0
- package/dist/generated/platform/models/ToolCallIds.d.ts +4 -0
- package/dist/generated/platform/models/ToolCallIds.js +2 -0
- package/dist/generated/platform/models/ToolSupervisionResult.d.ts +36 -0
- package/dist/generated/platform/models/ToolSupervisionResult.js +2 -0
- package/dist/generated/platform/models/User.d.ts +4 -0
- package/dist/generated/platform/models/User.js +2 -0
- package/dist/generated/platform/services/ApiKeyService.d.ts +33 -0
- package/dist/generated/platform/services/ApiKeyService.js +64 -0
- package/dist/generated/platform/services/ApiService.d.ts +9 -0
- package/dist/generated/platform/services/ApiService.js +19 -0
- package/dist/generated/platform/services/ImproveService.d.ts +20 -0
- package/dist/generated/platform/services/ImproveService.js +47 -0
- package/dist/generated/platform/services/ProjectService.d.ts +34 -0
- package/dist/generated/platform/services/ProjectService.js +72 -0
- package/dist/generated/platform/services/RunService.d.ts +103 -0
- package/dist/generated/platform/services/RunService.js +227 -0
- package/dist/generated/platform/services/StatsService.d.ts +10 -0
- package/dist/generated/platform/services/StatsService.js +22 -0
- package/dist/generated/platform/services/SupervisionService.d.ts +46 -0
- package/dist/generated/platform/services/SupervisionService.js +100 -0
- package/dist/generated/platform/services/SupervisorService.d.ts +43 -0
- package/dist/generated/platform/services/SupervisorService.js +92 -0
- package/dist/generated/platform/services/TaskService.d.ts +29 -0
- package/dist/generated/platform/services/TaskService.js +59 -0
- package/dist/generated/platform/services/ToolCallService.d.ts +42 -0
- package/dist/generated/platform/services/ToolCallService.js +92 -0
- package/dist/generated/platform/services/ToolService.d.ts +47 -0
- package/dist/generated/platform/services/ToolService.js +92 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +102 -0
- package/package.json +30 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type CreateWorkflowRequest = {
|
|
2
|
+
/**
|
|
3
|
+
* The name of the workflow.
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* JSON object containing static workflow configuration (e.g. a prompt_template).
|
|
8
|
+
*/
|
|
9
|
+
fields: Record<string, any>;
|
|
10
|
+
/**
|
|
11
|
+
* The prompts for the workflow. They can have variables in them. They will be merged with the dynamic data passed when the workflow is executed.
|
|
12
|
+
*/
|
|
13
|
+
prompts: Array<string>;
|
|
14
|
+
/**
|
|
15
|
+
* The Language Model Provider for the Workflow
|
|
16
|
+
*/
|
|
17
|
+
provider: CreateWorkflowRequest.provider;
|
|
18
|
+
};
|
|
19
|
+
export declare namespace CreateWorkflowRequest {
|
|
20
|
+
/**
|
|
21
|
+
* The Language Model Provider for the Workflow
|
|
22
|
+
*/
|
|
23
|
+
enum provider {
|
|
24
|
+
OPENAI = "openai",
|
|
25
|
+
ANTHROPIC = "anthropic"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateWorkflowRequest = void 0;
|
|
4
|
+
var CreateWorkflowRequest;
|
|
5
|
+
(function (CreateWorkflowRequest) {
|
|
6
|
+
/**
|
|
7
|
+
* The Language Model Provider for the Workflow
|
|
8
|
+
*/
|
|
9
|
+
let provider;
|
|
10
|
+
(function (provider) {
|
|
11
|
+
provider["OPENAI"] = "openai";
|
|
12
|
+
provider["ANTHROPIC"] = "anthropic";
|
|
13
|
+
})(provider = CreateWorkflowRequest.provider || (CreateWorkflowRequest.provider = {}));
|
|
14
|
+
})(CreateWorkflowRequest || (exports.CreateWorkflowRequest = CreateWorkflowRequest = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type Execution = {
|
|
2
|
+
/**
|
|
3
|
+
* Execution identifier.
|
|
4
|
+
*/
|
|
5
|
+
id?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Run ID.
|
|
8
|
+
*/
|
|
9
|
+
run_id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Dynamic data to be merged into the saved workflow configuration.
|
|
12
|
+
*/
|
|
13
|
+
dynamic_data?: Record<string, any>;
|
|
14
|
+
/**
|
|
15
|
+
* Workflow ID.
|
|
16
|
+
*/
|
|
17
|
+
workflow_id?: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type Workflow = {
|
|
2
|
+
/**
|
|
3
|
+
* Workflow identifier.
|
|
4
|
+
*/
|
|
5
|
+
id?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Identifier of the associated agent.
|
|
8
|
+
*/
|
|
9
|
+
agent_id?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Workflow name.
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Workflow configuration.
|
|
16
|
+
*/
|
|
17
|
+
fields?: Record<string, any>;
|
|
18
|
+
/**
|
|
19
|
+
* The prompts for the workflow. They can have variables in them. They will be merged with the dynamic data passed when the workflow is executed.
|
|
20
|
+
*/
|
|
21
|
+
prompts?: Array<string>;
|
|
22
|
+
/**
|
|
23
|
+
* The variables in the prompts.
|
|
24
|
+
*/
|
|
25
|
+
prompt_variables?: Array<string>;
|
|
26
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Agent } from '../models/Agent';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
+
export declare class AgentService {
|
|
4
|
+
/**
|
|
5
|
+
* Get all agents
|
|
6
|
+
* @returns Agent List of agents
|
|
7
|
+
* @throws ApiError
|
|
8
|
+
*/
|
|
9
|
+
static getAgents(): CancelablePromise<Array<Agent>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AgentService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class AgentService {
|
|
7
|
+
/**
|
|
8
|
+
* Get all agents
|
|
9
|
+
* @returns Agent List of agents
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static getAgents() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/agents',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.AgentService = AgentService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class ApiService {
|
|
7
|
+
/**
|
|
8
|
+
* Get the OpenAPI schema
|
|
9
|
+
* @returns any OpenAPI schema
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static getOpenApi() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/openapi.yaml',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ApiService = ApiService;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CreateWorkflowRequest } from '../models/CreateWorkflowRequest';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
+
export declare class DefaultService {
|
|
4
|
+
/**
|
|
5
|
+
* Check the health of the API
|
|
6
|
+
* @returns any API is healthy
|
|
7
|
+
* @throws ApiError
|
|
8
|
+
*/
|
|
9
|
+
static healthCheck(): CancelablePromise<{
|
|
10
|
+
/**
|
|
11
|
+
* The health status of the API
|
|
12
|
+
*/
|
|
13
|
+
status?: string;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new workflow for an agent
|
|
17
|
+
* @param agentName
|
|
18
|
+
* @param requestBody
|
|
19
|
+
* @returns string Workflow created successfully
|
|
20
|
+
* @throws ApiError
|
|
21
|
+
*/
|
|
22
|
+
static createWorkflow(agentName: string, requestBody: CreateWorkflowRequest): CancelablePromise<string>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DefaultService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class DefaultService {
|
|
7
|
+
/**
|
|
8
|
+
* Check the health of the API
|
|
9
|
+
* @returns any API is healthy
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static healthCheck() {
|
|
13
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
14
|
+
method: 'GET',
|
|
15
|
+
url: '/health',
|
|
16
|
+
errors: {
|
|
17
|
+
500: `API is unhealthy`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Create a new workflow for an agent
|
|
23
|
+
* @param agentName
|
|
24
|
+
* @param requestBody
|
|
25
|
+
* @returns string Workflow created successfully
|
|
26
|
+
* @throws ApiError
|
|
27
|
+
*/
|
|
28
|
+
static createWorkflow(agentName, requestBody) {
|
|
29
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
url: '/workflow/{agent_name}/create',
|
|
32
|
+
path: {
|
|
33
|
+
'agent_name': agentName,
|
|
34
|
+
},
|
|
35
|
+
body: requestBody,
|
|
36
|
+
mediaType: 'application/json',
|
|
37
|
+
errors: {
|
|
38
|
+
400: `Invalid input`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.DefaultService = DefaultService;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OptimisationRequest } from '../models/OptimisationRequest';
|
|
2
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
3
|
+
export declare class OptimiserService {
|
|
4
|
+
/**
|
|
5
|
+
* Queue an optimisation job
|
|
6
|
+
* @param requestBody
|
|
7
|
+
* @returns any Optimiser job created
|
|
8
|
+
* @throws ApiError
|
|
9
|
+
*/
|
|
10
|
+
static queueOptimisationJob(requestBody?: OptimisationRequest): CancelablePromise<any>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OptimiserService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class OptimiserService {
|
|
7
|
+
/**
|
|
8
|
+
* Queue an optimisation job
|
|
9
|
+
* @param requestBody
|
|
10
|
+
* @returns any Optimiser job created
|
|
11
|
+
* @throws ApiError
|
|
12
|
+
*/
|
|
13
|
+
static queueOptimisationJob(requestBody) {
|
|
14
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
15
|
+
method: 'POST',
|
|
16
|
+
url: '/optimiser',
|
|
17
|
+
body: requestBody,
|
|
18
|
+
mediaType: 'application/json',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.OptimiserService = OptimiserService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { WorkflowExecution } from '../models/WorkflowExecution';
|
|
2
|
+
import type { WorkflowExecutionRequest } from '../models/WorkflowExecutionRequest';
|
|
3
|
+
import type { CancelablePromise } from '../core/CancelablePromise';
|
|
4
|
+
export declare class WorkflowService {
|
|
5
|
+
/**
|
|
6
|
+
* Execute a saved workflow for an agent
|
|
7
|
+
* @param workflowId
|
|
8
|
+
* @param requestBody
|
|
9
|
+
* @returns string Workflow executed successfully, job queued
|
|
10
|
+
* @throws ApiError
|
|
11
|
+
*/
|
|
12
|
+
static executeWorkflow(workflowId: string, requestBody: WorkflowExecutionRequest): CancelablePromise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Get all workflows and their executions
|
|
15
|
+
* @returns WorkflowExecution List of workflow executions
|
|
16
|
+
* @throws ApiError
|
|
17
|
+
*/
|
|
18
|
+
static getWorkflowExecutions(): CancelablePromise<Array<WorkflowExecution>>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkflowService = void 0;
|
|
4
|
+
const OpenAPI_1 = require("../core/OpenAPI");
|
|
5
|
+
const request_1 = require("../core/request");
|
|
6
|
+
class WorkflowService {
|
|
7
|
+
/**
|
|
8
|
+
* Execute a saved workflow for an agent
|
|
9
|
+
* @param workflowId
|
|
10
|
+
* @param requestBody
|
|
11
|
+
* @returns string Workflow executed successfully, job queued
|
|
12
|
+
* @throws ApiError
|
|
13
|
+
*/
|
|
14
|
+
static executeWorkflow(workflowId, requestBody) {
|
|
15
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
16
|
+
method: 'POST',
|
|
17
|
+
url: '/workflow/{workflow_id}',
|
|
18
|
+
path: {
|
|
19
|
+
'workflow_id': workflowId,
|
|
20
|
+
},
|
|
21
|
+
body: requestBody,
|
|
22
|
+
mediaType: 'application/json',
|
|
23
|
+
errors: {
|
|
24
|
+
400: `Invalid input or missing required fields`,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get all workflows and their executions
|
|
30
|
+
* @returns WorkflowExecution List of workflow executions
|
|
31
|
+
* @throws ApiError
|
|
32
|
+
*/
|
|
33
|
+
static getWorkflowExecutions() {
|
|
34
|
+
return (0, request_1.request)(OpenAPI_1.OpenAPI, {
|
|
35
|
+
method: 'GET',
|
|
36
|
+
url: '/workflow_executions',
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.WorkflowService = WorkflowService;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
+
import type { ApiResult } from './ApiResult';
|
|
3
|
+
export declare class ApiError extends Error {
|
|
4
|
+
readonly url: string;
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly statusText: string;
|
|
7
|
+
readonly body: any;
|
|
8
|
+
readonly request: ApiRequestOptions;
|
|
9
|
+
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
10
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ApiError = void 0;
|
|
4
|
+
class ApiError extends Error {
|
|
5
|
+
url;
|
|
6
|
+
status;
|
|
7
|
+
statusText;
|
|
8
|
+
body;
|
|
9
|
+
request;
|
|
10
|
+
constructor(request, response, message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = 'ApiError';
|
|
13
|
+
this.url = response.url;
|
|
14
|
+
this.status = response.status;
|
|
15
|
+
this.statusText = response.statusText;
|
|
16
|
+
this.body = response.body;
|
|
17
|
+
this.request = request;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.ApiError = ApiError;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ApiRequestOptions = {
|
|
2
|
+
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
|
|
3
|
+
readonly url: string;
|
|
4
|
+
readonly path?: Record<string, any>;
|
|
5
|
+
readonly cookies?: Record<string, any>;
|
|
6
|
+
readonly headers?: Record<string, any>;
|
|
7
|
+
readonly query?: Record<string, any>;
|
|
8
|
+
readonly formData?: Record<string, any>;
|
|
9
|
+
readonly body?: any;
|
|
10
|
+
readonly mediaType?: string;
|
|
11
|
+
readonly responseHeader?: string;
|
|
12
|
+
readonly errors?: Record<number, string>;
|
|
13
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class CancelError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
get isCancelled(): boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface OnCancel {
|
|
6
|
+
readonly isResolved: boolean;
|
|
7
|
+
readonly isRejected: boolean;
|
|
8
|
+
readonly isCancelled: boolean;
|
|
9
|
+
(cancelHandler: () => void): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class CancelablePromise<T> implements Promise<T> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
14
|
+
get [Symbol.toStringTag](): string;
|
|
15
|
+
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
16
|
+
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
17
|
+
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
18
|
+
cancel(): void;
|
|
19
|
+
get isCancelled(): boolean;
|
|
20
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CancelablePromise = exports.CancelError = void 0;
|
|
4
|
+
/* generated using openapi-typescript-codegen -- do not edit */
|
|
5
|
+
/* istanbul ignore file */
|
|
6
|
+
/* tslint:disable */
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
class CancelError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
this.name = 'CancelError';
|
|
12
|
+
}
|
|
13
|
+
get isCancelled() {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CancelError = CancelError;
|
|
18
|
+
class CancelablePromise {
|
|
19
|
+
#isResolved;
|
|
20
|
+
#isRejected;
|
|
21
|
+
#isCancelled;
|
|
22
|
+
#cancelHandlers;
|
|
23
|
+
#promise;
|
|
24
|
+
#resolve;
|
|
25
|
+
#reject;
|
|
26
|
+
constructor(executor) {
|
|
27
|
+
this.#isResolved = false;
|
|
28
|
+
this.#isRejected = false;
|
|
29
|
+
this.#isCancelled = false;
|
|
30
|
+
this.#cancelHandlers = [];
|
|
31
|
+
this.#promise = new Promise((resolve, reject) => {
|
|
32
|
+
this.#resolve = resolve;
|
|
33
|
+
this.#reject = reject;
|
|
34
|
+
const onResolve = (value) => {
|
|
35
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
this.#isResolved = true;
|
|
39
|
+
if (this.#resolve)
|
|
40
|
+
this.#resolve(value);
|
|
41
|
+
};
|
|
42
|
+
const onReject = (reason) => {
|
|
43
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.#isRejected = true;
|
|
47
|
+
if (this.#reject)
|
|
48
|
+
this.#reject(reason);
|
|
49
|
+
};
|
|
50
|
+
const onCancel = (cancelHandler) => {
|
|
51
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.#cancelHandlers.push(cancelHandler);
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(onCancel, 'isResolved', {
|
|
57
|
+
get: () => this.#isResolved,
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(onCancel, 'isRejected', {
|
|
60
|
+
get: () => this.#isRejected,
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(onCancel, 'isCancelled', {
|
|
63
|
+
get: () => this.#isCancelled,
|
|
64
|
+
});
|
|
65
|
+
return executor(onResolve, onReject, onCancel);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
get [Symbol.toStringTag]() {
|
|
69
|
+
return "Cancellable Promise";
|
|
70
|
+
}
|
|
71
|
+
then(onFulfilled, onRejected) {
|
|
72
|
+
return this.#promise.then(onFulfilled, onRejected);
|
|
73
|
+
}
|
|
74
|
+
catch(onRejected) {
|
|
75
|
+
return this.#promise.catch(onRejected);
|
|
76
|
+
}
|
|
77
|
+
finally(onFinally) {
|
|
78
|
+
return this.#promise.finally(onFinally);
|
|
79
|
+
}
|
|
80
|
+
cancel() {
|
|
81
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.#isCancelled = true;
|
|
85
|
+
if (this.#cancelHandlers.length) {
|
|
86
|
+
try {
|
|
87
|
+
for (const cancelHandler of this.#cancelHandlers) {
|
|
88
|
+
cancelHandler();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
console.warn('Cancellation threw an error', error);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this.#cancelHandlers.length = 0;
|
|
97
|
+
if (this.#reject)
|
|
98
|
+
this.#reject(new CancelError('Request aborted'));
|
|
99
|
+
}
|
|
100
|
+
get isCancelled() {
|
|
101
|
+
return this.#isCancelled;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.CancelablePromise = CancelablePromise;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
+
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
3
|
+
type Headers = Record<string, string>;
|
|
4
|
+
export type OpenAPIConfig = {
|
|
5
|
+
BASE: string;
|
|
6
|
+
VERSION: string;
|
|
7
|
+
WITH_CREDENTIALS: boolean;
|
|
8
|
+
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
9
|
+
TOKEN?: string | Resolver<string> | undefined;
|
|
10
|
+
USERNAME?: string | Resolver<string> | undefined;
|
|
11
|
+
PASSWORD?: string | Resolver<string> | undefined;
|
|
12
|
+
HEADERS?: Headers | Resolver<Headers> | undefined;
|
|
13
|
+
ENCODE_PATH?: ((path: string) => string) | undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare const OpenAPI: OpenAPIConfig;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OpenAPI = void 0;
|
|
4
|
+
exports.OpenAPI = {
|
|
5
|
+
BASE: 'https://api.asteroid.ai/api/v1',
|
|
6
|
+
VERSION: '1.0.0',
|
|
7
|
+
WITH_CREDENTIALS: false,
|
|
8
|
+
CREDENTIALS: 'include',
|
|
9
|
+
TOKEN: undefined,
|
|
10
|
+
USERNAME: undefined,
|
|
11
|
+
PASSWORD: undefined,
|
|
12
|
+
HEADERS: undefined,
|
|
13
|
+
ENCODE_PATH: undefined,
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ApiRequestOptions } from './ApiRequestOptions';
|
|
2
|
+
import type { ApiResult } from './ApiResult';
|
|
3
|
+
import { CancelablePromise } from './CancelablePromise';
|
|
4
|
+
import type { OnCancel } from './CancelablePromise';
|
|
5
|
+
import type { OpenAPIConfig } from './OpenAPI';
|
|
6
|
+
export declare const isDefined: <T>(value: T | null | undefined) => value is Exclude<T, null | undefined>;
|
|
7
|
+
export declare const isString: (value: any) => value is string;
|
|
8
|
+
export declare const isStringWithValue: (value: any) => value is string;
|
|
9
|
+
export declare const isBlob: (value: any) => value is Blob;
|
|
10
|
+
export declare const isFormData: (value: any) => value is FormData;
|
|
11
|
+
export declare const base64: (str: string) => string;
|
|
12
|
+
export declare const getQueryString: (params: Record<string, any>) => string;
|
|
13
|
+
export declare const getFormData: (options: ApiRequestOptions) => FormData | undefined;
|
|
14
|
+
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
|
|
15
|
+
export declare const resolve: <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>) => Promise<T | undefined>;
|
|
16
|
+
export declare const getHeaders: (config: OpenAPIConfig, options: ApiRequestOptions) => Promise<Headers>;
|
|
17
|
+
export declare const getRequestBody: (options: ApiRequestOptions) => any;
|
|
18
|
+
export declare const sendRequest: (config: OpenAPIConfig, options: ApiRequestOptions, url: string, body: any, formData: FormData | undefined, headers: Headers, onCancel: OnCancel) => Promise<Response>;
|
|
19
|
+
export declare const getResponseHeader: (response: Response, responseHeader?: string) => string | undefined;
|
|
20
|
+
export declare const getResponseBody: (response: Response) => Promise<any>;
|
|
21
|
+
export declare const catchErrorCodes: (options: ApiRequestOptions, result: ApiResult) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Request method
|
|
24
|
+
* @param config The OpenAPI configuration object
|
|
25
|
+
* @param options The request options from the service
|
|
26
|
+
* @returns CancelablePromise<T>
|
|
27
|
+
* @throws ApiError
|
|
28
|
+
*/
|
|
29
|
+
export declare const request: <T>(config: OpenAPIConfig, options: ApiRequestOptions) => CancelablePromise<T>;
|
|
30
|
+
export {};
|