opensink 0.2.0 → 0.2.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import
|
|
2
|
+
import AgentSessionData, { CreateAgentSessionData, UpdateAgentSessionData } from '../../types/agent-session-data.js';
|
|
3
3
|
import APIResource from '../shared/api-resource.js';
|
|
4
|
-
export default class AgentSessionsResource extends APIResource<
|
|
4
|
+
export default class AgentSessionsResource extends APIResource<AgentSessionData, CreateAgentSessionData, UpdateAgentSessionData> {
|
|
5
5
|
constructor(axios: AxiosInstance);
|
|
6
6
|
}
|
|
@@ -3,13 +3,13 @@ export interface PaginatedResponse<T> {
|
|
|
3
3
|
items: T[];
|
|
4
4
|
trail: string | null;
|
|
5
5
|
}
|
|
6
|
-
export default class APIResource<T, D = T
|
|
6
|
+
export default class APIResource<T, D = T, U = Partial<D>> {
|
|
7
7
|
readonly axios: AxiosInstance;
|
|
8
8
|
readonly path: string;
|
|
9
9
|
constructor(axios: AxiosInstance, path: string);
|
|
10
10
|
create(data: D): Promise<AxiosResponse<T>>;
|
|
11
11
|
list<P>(params?: P): Promise<AxiosResponse<PaginatedResponse<T>>>;
|
|
12
12
|
get(id: string): Promise<AxiosResponse<T>>;
|
|
13
|
-
update(id: string, data:
|
|
13
|
+
update(id: string, data: U): Promise<AxiosResponse<T>>;
|
|
14
14
|
delete(id: string): Promise<AxiosResponse<void>>;
|
|
15
15
|
}
|
|
@@ -5,7 +5,7 @@ export declare enum AgentSessionStatus {
|
|
|
5
5
|
COMPLETED = "completed",
|
|
6
6
|
FAILED = "failed"
|
|
7
7
|
}
|
|
8
|
-
export default interface
|
|
8
|
+
export default interface AgentSessionData {
|
|
9
9
|
id: string;
|
|
10
10
|
agent_id: string;
|
|
11
11
|
workspace_id: string;
|
|
@@ -16,4 +16,5 @@ export default interface AgentSession {
|
|
|
16
16
|
created_at: string;
|
|
17
17
|
updated_at: string;
|
|
18
18
|
}
|
|
19
|
-
export type
|
|
19
|
+
export type CreateAgentSessionData = Omit<AgentSessionData, 'id' | 'created_at' | 'updated_at' | 'workspace_id' | 'state' | 'metadata'> & Partial<Pick<AgentSessionData, 'state' | 'metadata'>>;
|
|
20
|
+
export type UpdateAgentSessionData = Omit<CreateAgentSessionData, 'agent_id'>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opensink",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Official JavaScript/TypeScript client for the OpenSink API",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@types/node": "24.1.0",
|
|
45
45
|
"eslint": "9.32.0",
|
|
46
46
|
"globals": "16.3.0",
|
|
47
|
-
"typescript": "5.8.3",
|
|
48
47
|
"tsc-alias": "1.8.16",
|
|
48
|
+
"typescript": "5.8.3",
|
|
49
49
|
"typescript-eslint": "8.38.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|