@stack-spot/portal-network 0.139.1-beta.0 → 0.140.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/CHANGELOG.md +7 -0
- package/dist/api/agent-tools.d.ts +4 -178
- package/dist/api/agent-tools.d.ts.map +1 -1
- package/dist/api/agent-tools.js +2 -98
- package/dist/api/agent-tools.js.map +1 -1
- package/dist/api/discovery.d.ts +17 -11
- package/dist/api/discovery.d.ts.map +1 -1
- package/dist/api/discovery.js +15 -25
- package/dist/api/discovery.js.map +1 -1
- package/dist/client/agent-tools.d.ts +0 -77
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +1 -134
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/agent.d.ts +49 -2
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +63 -0
- package/dist/client/agent.js.map +1 -1
- package/dist/client/ai.d.ts +0 -7
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +1 -10
- package/dist/client/ai.js.map +1 -1
- package/dist/client/discovery.d.ts +19 -3
- package/dist/client/discovery.d.ts.map +1 -1
- package/dist/client/discovery.js +28 -1
- package/dist/client/discovery.js.map +1 -1
- package/dist/client/types.d.ts +3 -5
- package/dist/client/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/api/agent-tools.ts +4 -306
- package/src/api/discovery.ts +29 -31
- package/src/client/agent-tools.ts +1 -103
- package/src/client/agent.ts +67 -1
- package/src/client/ai.ts +0 -5
- package/src/client/discovery.ts +13 -1
- package/src/client/types.ts +4 -7
|
@@ -1,87 +1,10 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
-
import { VisibilityLevelEnum } from '../api/agent-tools.js';
|
|
3
2
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
3
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
-
import { AgentResponseWithBuiltIn, AgentVisibilityLevel } from './types.js';
|
|
6
4
|
declare class AgentToolsClient extends ReactQueryNetworkClient {
|
|
7
5
|
constructor();
|
|
8
6
|
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
9
7
|
tools: import("../network/types.js").QueryObject<void, import("../api/agent-tools.js").BuiltinToolkitResponse[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Create agent
|
|
12
|
-
*/
|
|
13
|
-
createAgent: import("../network/types.js").MutationObject<Omit<{
|
|
14
|
-
isPublic?: boolean | undefined;
|
|
15
|
-
xAccountId?: string | null | undefined;
|
|
16
|
-
authorization: string;
|
|
17
|
-
newAgentRequest: import("../api/agent-tools.js").NewAgentRequest;
|
|
18
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").NewAgentResponse>;
|
|
19
|
-
/**
|
|
20
|
-
* Delete agent
|
|
21
|
-
*/
|
|
22
|
-
deleteAgent: import("../network/types.js").MutationObject<{
|
|
23
|
-
agentId: string;
|
|
24
|
-
}, any>;
|
|
25
|
-
/**
|
|
26
|
-
* Updates an agent
|
|
27
|
-
*/
|
|
28
|
-
updateAgent: import("../network/types.js").MutationObject<{
|
|
29
|
-
agentId: string;
|
|
30
|
-
}, any>;
|
|
31
|
-
/**
|
|
32
|
-
* Favorite an agent
|
|
33
|
-
*/
|
|
34
|
-
favoriteAgent: import("../network/types.js").MutationObject<{
|
|
35
|
-
agentId: string;
|
|
36
|
-
}, any>;
|
|
37
|
-
/**
|
|
38
|
-
* Publish an agent
|
|
39
|
-
*/
|
|
40
|
-
publishAgent: import("../network/types.js").MutationObject<{
|
|
41
|
-
agentId: string;
|
|
42
|
-
}, any>;
|
|
43
|
-
/**
|
|
44
|
-
* List agents
|
|
45
|
-
*/
|
|
46
|
-
agents: import("../network/types.js").InfiniteQueryObject<Omit<{
|
|
47
|
-
name?: string | null | undefined;
|
|
48
|
-
slug?: string | null | undefined;
|
|
49
|
-
visibility?: VisibilityLevelEnum | "built_in" | undefined;
|
|
50
|
-
size?: number | undefined;
|
|
51
|
-
page?: number | undefined;
|
|
52
|
-
xAccountId?: string | null | undefined;
|
|
53
|
-
authorization: string;
|
|
54
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").ListAgentResponse[], "">;
|
|
55
|
-
/**
|
|
56
|
-
* Gets agent by id
|
|
57
|
-
*/
|
|
58
|
-
agent: import("../network/types.js").QueryObject<Omit<{
|
|
59
|
-
agentId: string;
|
|
60
|
-
xAccountId?: string | null | undefined;
|
|
61
|
-
authorization: string;
|
|
62
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").AgentModel>;
|
|
63
|
-
/**
|
|
64
|
-
* Gets agents by ids
|
|
65
|
-
*/
|
|
66
|
-
agentsByIds: import("../network/types.js").QueryObject<Omit<{
|
|
67
|
-
xAccountId?: string | null | undefined;
|
|
68
|
-
authorization: string;
|
|
69
|
-
searchAgentsRequest: import("../api/agent-tools.js").SearchAgentsRequest;
|
|
70
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/agent-tools.js").ListAgentResponse[]>;
|
|
71
|
-
/**
|
|
72
|
-
* Gets the default agent slug
|
|
73
|
-
*/
|
|
74
|
-
agentDefaultSlug: string;
|
|
75
|
-
/**
|
|
76
|
-
* Gets the default agent
|
|
77
|
-
*/
|
|
78
|
-
agentDefault: Omit<import("../network/types.js").QueryObject<void, import("../api/agent-tools.js").AgentModel | undefined>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
79
|
-
/**
|
|
80
|
-
* List agents filtered by visibility.
|
|
81
|
-
*/
|
|
82
|
-
allAgents: Omit<import("../network/types.js").QueryObject<{
|
|
83
|
-
visibilities: (AgentVisibilityLevel | 'all')[];
|
|
84
|
-
}, AgentResponseWithBuiltIn[]>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
85
8
|
}
|
|
86
9
|
export declare const agentToolsClient: AgentToolsClient;
|
|
87
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAG7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,gBAAiB,SAAQ,uBAAuB;;IAKpD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IASlE,KAAK,sGAAmD;CACzD;AAED,eAAO,MAAM,gBAAgB,kBAAyB,CAAA"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaults, getPublicToolKitsV1BuiltinToolkitGet } from '../api/agent-tools.js';
|
|
2
2
|
import apis from '../apis.json';
|
|
3
3
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
4
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
-
import { removeAuthorizationParam } from '../utils/remove-authorization-param.js';
|
|
6
|
-
import { workspaceAiClient } from './workspace-ai.js';
|
|
7
|
-
const AGENT_DEFAULT_SLUG = 'stk_code_buddy';
|
|
8
5
|
class AgentToolsClient extends ReactQueryNetworkClient {
|
|
9
6
|
constructor() {
|
|
10
7
|
super(apis['agent-tools'].url, defaults);
|
|
@@ -14,136 +11,6 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
14
11
|
writable: true,
|
|
15
12
|
value: this.query(getPublicToolKitsV1BuiltinToolkitGet)
|
|
16
13
|
});
|
|
17
|
-
/**
|
|
18
|
-
* Create agent
|
|
19
|
-
*/
|
|
20
|
-
Object.defineProperty(this, "createAgent", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: this.mutation(removeAuthorizationParam(createAgentV1AgentsPost))
|
|
25
|
-
});
|
|
26
|
-
/**
|
|
27
|
-
* Delete agent
|
|
28
|
-
*/
|
|
29
|
-
Object.defineProperty(this, "deleteAgent", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: this.mutation(deleteAgentV1AgentsAgentIdDelete)
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Updates an agent
|
|
37
|
-
*/
|
|
38
|
-
Object.defineProperty(this, "updateAgent", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
value: this.mutation(updateAgentV1AgentsAgentIdPut)
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* Favorite an agent
|
|
46
|
-
*/
|
|
47
|
-
Object.defineProperty(this, "favoriteAgent", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true,
|
|
51
|
-
value: this.mutation(addFavoriteV1AgentsAgentIdFavoritePost)
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* Publish an agent
|
|
55
|
-
*/
|
|
56
|
-
Object.defineProperty(this, "publishAgent", {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
configurable: true,
|
|
59
|
-
writable: true,
|
|
60
|
-
value: this.mutation(publishAgentV1AgentsAgentIdPublishPost)
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* List agents
|
|
64
|
-
*/
|
|
65
|
-
Object.defineProperty(this, "agents", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
configurable: true,
|
|
68
|
-
writable: true,
|
|
69
|
-
value: this.infiniteQuery(removeAuthorizationParam(listAgentsV1AgentsGet))
|
|
70
|
-
});
|
|
71
|
-
/**
|
|
72
|
-
* Gets agent by id
|
|
73
|
-
*/
|
|
74
|
-
Object.defineProperty(this, "agent", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
configurable: true,
|
|
77
|
-
writable: true,
|
|
78
|
-
value: this.query(removeAuthorizationParam(getAgentV1AgentsAgentIdGet))
|
|
79
|
-
});
|
|
80
|
-
/**
|
|
81
|
-
* Gets agents by ids
|
|
82
|
-
*/
|
|
83
|
-
Object.defineProperty(this, "agentsByIds", {
|
|
84
|
-
enumerable: true,
|
|
85
|
-
configurable: true,
|
|
86
|
-
writable: true,
|
|
87
|
-
value: this.query(removeAuthorizationParam(searchAgentsV1AgentsSearchPost))
|
|
88
|
-
});
|
|
89
|
-
/**
|
|
90
|
-
* Gets the default agent slug
|
|
91
|
-
*/
|
|
92
|
-
Object.defineProperty(this, "agentDefaultSlug", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
configurable: true,
|
|
95
|
-
writable: true,
|
|
96
|
-
value: AGENT_DEFAULT_SLUG
|
|
97
|
-
});
|
|
98
|
-
/**
|
|
99
|
-
* Gets the default agent
|
|
100
|
-
*/
|
|
101
|
-
Object.defineProperty(this, "agentDefault", {
|
|
102
|
-
enumerable: true,
|
|
103
|
-
configurable: true,
|
|
104
|
-
writable: true,
|
|
105
|
-
value: this.query({
|
|
106
|
-
name: 'agentDefault',
|
|
107
|
-
request: async (signal) => {
|
|
108
|
-
const agentDefault = await listAgentsV1AgentsGet({ visibility: 'built_in', slug: this.agentDefaultSlug, authorization: '' }, { signal });
|
|
109
|
-
const agentId = agentDefault.at(0)?.id;
|
|
110
|
-
const agent = agentId ? await this.agent.query({ agentId }) : undefined;
|
|
111
|
-
return agent;
|
|
112
|
-
},
|
|
113
|
-
})
|
|
114
|
-
});
|
|
115
|
-
/**
|
|
116
|
-
* List agents filtered by visibility.
|
|
117
|
-
*/
|
|
118
|
-
Object.defineProperty(this, "allAgents", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
configurable: true,
|
|
121
|
-
writable: true,
|
|
122
|
-
value: this.query({
|
|
123
|
-
name: 'allAgents',
|
|
124
|
-
request: async (signal, variables) => {
|
|
125
|
-
const allVisibilities = ['account', 'built_in', 'favorite', 'personal', 'shared', 'workspace'];
|
|
126
|
-
const visibilities = variables.visibilities.includes('all')
|
|
127
|
-
? allVisibilities
|
|
128
|
-
: variables.visibilities;
|
|
129
|
-
const shouldFetchWorkspaceAgents = visibilities.includes('workspace');
|
|
130
|
-
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
131
|
-
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
132
|
-
: Promise.resolve([]);
|
|
133
|
-
const [workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
134
|
-
workspaceAgentsPromise,
|
|
135
|
-
...visibilities.map((visibility) => listAgentsV1AgentsGet({ visibility, authorization: '' }, { signal })),
|
|
136
|
-
]);
|
|
137
|
-
const workspaceAgentsWithSpaceName = workspaceAgents.flatMap(({ agents, space_name }) => agents?.map((agent) => ({ ...agent, spaceName: space_name, builtIn: false })));
|
|
138
|
-
const allAgents = workspaceAgentsWithSpaceName ?? [];
|
|
139
|
-
agentsByVisibility.forEach(agents => allAgents.push(...agents.map(agent => ({
|
|
140
|
-
...agent,
|
|
141
|
-
builtIn: agent?.visibility_level === 'built_in',
|
|
142
|
-
}))));
|
|
143
|
-
return allAgents;
|
|
144
|
-
},
|
|
145
|
-
})
|
|
146
|
-
});
|
|
147
14
|
}
|
|
148
15
|
buildStackSpotError(error) {
|
|
149
16
|
return new StackspotAPIError({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agent-tools.js","sourceRoot":"","sources":["../../src/client/agent-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,oCAAoC,EAAuB,MAAM,oBAAoB,CAAA;AACxG,OAAO,IAAI,MAAM,cAAc,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,MAAM,gBAAiB,SAAQ,uBAAuB;IACpD;QACE,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QAY1C;;;;mBAAQ,IAAI,CAAC,KAAK,CAAC,oCAAoC,CAAC;WAAA;IAXxD,CAAC;IAES,mBAAmB,CAAC,KAAgB;QAC5C,OAAO,IAAI,iBAAiB,CAAC;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAG,KAAK,CAAC,IAAwC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;SAC9F,CAAC,CAAA;IACJ,CAAC;CAGF;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,gBAAgB,EAAE,CAAA"}
|
package/dist/client/agent.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime';
|
|
2
|
+
import { VisibilityLevel } from '../api/agent.js';
|
|
2
3
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
3
4
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
+
import { AgentResponseWithBuiltIn, AgentVisibilityLevel } from './types.js';
|
|
6
|
+
export declare const isAgentDefault: (agentSlug?: string) => boolean;
|
|
4
7
|
declare class AgentClient extends ReactQueryNetworkClient {
|
|
5
8
|
constructor();
|
|
6
9
|
protected buildStackSpotError(error: HttpError): StackspotAPIError;
|
|
10
|
+
/**
|
|
11
|
+
* List agents filtered by visibility.
|
|
12
|
+
*/
|
|
13
|
+
allAgents: Omit<import("../network/types.js").QueryObject<{
|
|
14
|
+
visibilities: AgentVisibilityLevel[];
|
|
15
|
+
}, AgentResponseWithBuiltIn[]>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
7
16
|
/**
|
|
8
17
|
* Gets an agent by id
|
|
9
18
|
*/
|
|
@@ -39,11 +48,49 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
39
48
|
[key: string]: any;
|
|
40
49
|
} | null | undefined;
|
|
41
50
|
}>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
51
|
+
/**
|
|
52
|
+
* Gets the default agent
|
|
53
|
+
*/
|
|
54
|
+
agentDefault: Omit<import("../network/types.js").QueryObject<void, {
|
|
55
|
+
builtIn: boolean;
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
slug: string;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
avatar?: string | undefined;
|
|
61
|
+
system_prompt: string;
|
|
62
|
+
type: string;
|
|
63
|
+
llm_config?: import("../api/agent.js").LlmConfigResponse | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Gets a common agent by id
|
|
66
|
+
*/
|
|
67
|
+
suggested_prompts?: string[] | undefined;
|
|
68
|
+
knowledge_sources_config?: import("../api/agent.js").KnowledgeSourceResponse | undefined; /**
|
|
69
|
+
* List all public agents (built-in)
|
|
70
|
+
*/
|
|
71
|
+
visibility_level: string;
|
|
72
|
+
use_only: boolean;
|
|
73
|
+
creator_name: string;
|
|
74
|
+
created_by: string;
|
|
75
|
+
created_at: string;
|
|
76
|
+
updated_by?: string | undefined;
|
|
77
|
+
updated_at?: string | undefined;
|
|
78
|
+
toolkits?: import("../api/agent.js").ToolkitsInAgentResponse | undefined;
|
|
79
|
+
detail_mode?: boolean | undefined;
|
|
80
|
+
model_id?: string | undefined;
|
|
81
|
+
model_name?: string | undefined;
|
|
82
|
+
structured_output?: {
|
|
83
|
+
[key: string]: any;
|
|
84
|
+
} | null | undefined;
|
|
85
|
+
llm_settings?: {
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
} | null | undefined;
|
|
88
|
+
} | undefined>, "isAllowed" | "useAllowed" | "getPermissionKey">;
|
|
42
89
|
/**
|
|
43
90
|
* List commons agents
|
|
44
91
|
*/
|
|
45
92
|
agents: import("../network/types.js").QueryObject<{
|
|
46
|
-
visibility?:
|
|
93
|
+
visibility?: VisibilityLevel | undefined;
|
|
47
94
|
}, import("../api/agent.js").AgentResponse[]>;
|
|
48
95
|
/**
|
|
49
96
|
* Gets a common agent by id
|
|
@@ -83,7 +130,7 @@ declare class AgentClient extends ReactQueryNetworkClient {
|
|
|
83
130
|
* List all public agents (built-in)
|
|
84
131
|
*/
|
|
85
132
|
publicAgents: import("../network/types.js").QueryObject<{
|
|
86
|
-
visibility?:
|
|
133
|
+
visibility?: VisibilityLevel | undefined;
|
|
87
134
|
}, import("../api/agent.js").AgentResponse[]>;
|
|
88
135
|
/**
|
|
89
136
|
* Gets a public agent by id (built-in)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC7C,OAAO,EAAkM,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9O,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAC5E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGxE,eAAO,MAAM,cAAc,eAAgB,MAAM,YAAmC,CAAA;AAQpF,cAAM,WAAY,SAAQ,uBAAuB;;IAK/C,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAalE;;OAEG;IACH,SAAS;sBAE4C,oBAAoB,EAAE;qFA2CzE;IAEF;;OAEG;IACH,SAAS;iBAEiC,MAAM;iBAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAGhE;IAEF;;OAEG;IACH,YAAY;;;;;;;;;;QAcZ;;WAEG;;+FAGH;;WAEG;;;;;;;;;;;;;;;;;;qEAdD;IAEF;;OAEG;IACH,MAAM;;+CAA0B;IAEhC;;OAEG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAkC;IAEvC;;OAEG;IACH,YAAY;;+CAAgC;IAE5C;;OAEG;IACH,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAwC;IAEnD;;OAEG;IACH,gBAAgB;;aAA8C;IAE9D;;OAEG;IACH,mBAAmB;;aAAgD;IAEnE;;OAEG;IACH,iBAAiB,2DAAmC;IACpD;;OAEG;IACH,WAAW;;;gBAAqC;CACjD;AAED,eAAO,MAAM,WAAW,aAAoB,CAAA"}
|
package/dist/client/agent.js
CHANGED
|
@@ -2,9 +2,56 @@ import { defaults, deleteV1AgentByAgentIdFavorite, getV1AgentByAgentId, getV1Age
|
|
|
2
2
|
import apis from '../apis.json';
|
|
3
3
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
4
4
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
5
|
+
import { workspaceAiClient } from './workspace-ai.js';
|
|
6
|
+
export const isAgentDefault = (agentSlug) => agentSlug === 'stk_code_buddy';
|
|
5
7
|
class AgentClient extends ReactQueryNetworkClient {
|
|
6
8
|
constructor() {
|
|
7
9
|
super(apis.agent.url, defaults);
|
|
10
|
+
/**
|
|
11
|
+
* List agents filtered by visibility.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(this, "allAgents", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
configurable: true,
|
|
16
|
+
writable: true,
|
|
17
|
+
value: this.query({
|
|
18
|
+
name: 'allAgents',
|
|
19
|
+
request: async (signal, variables) => {
|
|
20
|
+
const visibilities = variables.visibilities.includes('ALL')
|
|
21
|
+
? ['PERSONAL', 'SHARED', 'WORKSPACE', 'ACCOUNT', 'FAVORITE']
|
|
22
|
+
: variables.visibilities.filter((visibility) => visibility !== 'BUILT-IN' && visibility !== 'ALL');
|
|
23
|
+
const shouldIncludeBuiltInAgent = variables.visibilities.includes('ALL') || variables.visibilities.includes('BUILT-IN');
|
|
24
|
+
const shouldFetchBuiltInAgent = shouldIncludeBuiltInAgent || variables.visibilities.includes('FAVORITE');
|
|
25
|
+
const shouldFetchWorkspaceAgents = variables.visibilities.includes('ALL') || variables.visibilities.includes('WORKSPACE');
|
|
26
|
+
const publicAgentsPromise = shouldFetchBuiltInAgent ? getV1PublicAgents({}, { signal }) : Promise.resolve([]);
|
|
27
|
+
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
28
|
+
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
29
|
+
: Promise.resolve([]);
|
|
30
|
+
const [publicAgents, workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
31
|
+
publicAgentsPromise,
|
|
32
|
+
workspaceAgentsPromise,
|
|
33
|
+
...visibilities.map((visibility) => getV1Agents({ visibility }, { signal })),
|
|
34
|
+
]);
|
|
35
|
+
const workspaceAgentsWithSpaceName = workspaceAgents?.flatMap(({ agents, space_name }) => agents?.map((agent) => ({
|
|
36
|
+
...agent,
|
|
37
|
+
spaceName: space_name,
|
|
38
|
+
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
39
|
+
})));
|
|
40
|
+
const allAgents = workspaceAgentsWithSpaceName || [];
|
|
41
|
+
if (shouldIncludeBuiltInAgent) {
|
|
42
|
+
const builtInsAgents = publicAgents?.map((agent) => ({ ...agent, builtIn: true, visibility_level: 'BUILT-IN' }));
|
|
43
|
+
allAgents.push(...builtInsAgents);
|
|
44
|
+
}
|
|
45
|
+
agentsByVisibility.forEach(agents => {
|
|
46
|
+
allAgents.push(...agents.map(agent => ({
|
|
47
|
+
...agent,
|
|
48
|
+
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
49
|
+
})));
|
|
50
|
+
});
|
|
51
|
+
return allAgents;
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
});
|
|
8
55
|
/**
|
|
9
56
|
* Gets an agent by id
|
|
10
57
|
*/
|
|
@@ -19,6 +66,22 @@ class AgentClient extends ReactQueryNetworkClient {
|
|
|
19
66
|
: getV1AgentByAgentId({ ...variables }, { signal }),
|
|
20
67
|
})
|
|
21
68
|
});
|
|
69
|
+
/**
|
|
70
|
+
* Gets the default agent
|
|
71
|
+
*/
|
|
72
|
+
Object.defineProperty(this, "agentDefault", {
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true,
|
|
75
|
+
writable: true,
|
|
76
|
+
value: this.query({
|
|
77
|
+
name: 'agentDefault',
|
|
78
|
+
request: async (signal) => {
|
|
79
|
+
const publicAgents = await getV1PublicAgents({}, { signal });
|
|
80
|
+
const agentDefault = publicAgents.find((agent) => isAgentDefault(agent.slug));
|
|
81
|
+
return agentDefault ? { ...agentDefault, builtIn: true } : undefined;
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
});
|
|
22
85
|
/**
|
|
23
86
|
* List commons agents
|
|
24
87
|
*/
|
package/dist/client/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/client/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,8BAA8B,EAAE,mBAAmB,EAAE,WAAW,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,mBAAmB,
|
|
1
|
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CAAC,KAAK,SAAS,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACpI,OAAO,IAAI,iBAAiB,CAAC;YAC3B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,IAAI;YACtB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;SAC5B,CAAC,CAAA;IACJ,CAAC;CAgHF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA"}
|
package/dist/client/ai.d.ts
CHANGED
|
@@ -124,13 +124,6 @@ declare class AIClient extends ReactQueryNetworkClient {
|
|
|
124
124
|
customId: string;
|
|
125
125
|
authorization: string;
|
|
126
126
|
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/ai.js").DocumentResponse>;
|
|
127
|
-
/**
|
|
128
|
-
* Lists knowledge sources matching the provided IDs.
|
|
129
|
-
*/
|
|
130
|
-
searchKnowledgeSources: import("../network/types.js").QueryObject<Omit<{
|
|
131
|
-
authorization: string;
|
|
132
|
-
searchKnowledgeSourcesRequest: import("../api/ai.js").SearchKnowledgeSourcesRequest;
|
|
133
|
-
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, any>;
|
|
134
127
|
/**
|
|
135
128
|
* Gets the chat history. This is a paginated resource.
|
|
136
129
|
*/
|
package/dist/client/ai.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/client/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C,OAAO,EA2BL,2BAA2B,EAC3B,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../../src/client/ai.ts"],"names":[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4EAAiE;IAC5E;;OAEG;IACH,uBAAuB;;;;;;sHAA0G;IACjI;;;;OAIG;IACH,qBAAqB;;;;;;yGAAqG;IAC1H;;OAEG;IACH,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,6BAA6B,EAAE,6BAA6B,EACtH,mBAAmB,CAAC,EAAE,MAAM,GAC5B,YAAY,CAAC,2BAA2B,CAAC;IAiB3C;;OAEG;IACH,0BAA0B;;;;;wHAA2F;IACrH;;MAEE;IACF,kBAAkB;;;;4EAAoF;IACtG;;MAEE;IACF,qBAAqB;;;;4EAAyF;IAC9G;;MAEE;IACF,kBAAkB;;;;;4EAAsF;IACxG;;OAEG;IACH,uBAAuB;;;;4EAAsF;IAC7G;;MAEE;IACF,0BAA0B;;;;4EAA2F;mBAEhG,YAAY;IAcjC,eAAe,CAAC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC,qBAAqB,CAAC;IAgH7G,mBAAmB;;;;;4FAKjB;CACH;AAED,eAAO,MAAM,QAAQ,UAAiB,CAAA"}
|
package/dist/client/ai.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { findLast, last } from 'lodash';
|
|
2
|
-
import { addFavoriteV1AiStacksStackIdFavoritePost, addFavoriteV1QuickCommandsSlugFavoritePost, conversationHistoryV1ConversationsConversationIdGet, currentV1TokensUsageCurrentGet, currentV1TokensUsageTotalGet, defaults, deleteConversationV1ConversationsConversationIdDelete, deleteFavoriteV1AiStacksStackIdFavoriteDelete, deleteFavoriteV1QuickCommandsSlugFavoriteDelete, deleteKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdDelete, downloadConversationV1ConversationsConversationIdDownloadGet, findKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdGet, findKnowledgeSourceV1KnowledgeSourcesSlugGet, formatFetchStepV1QuickCommandsSlugStepsStepSlugFetchFormatPost, formatResultV1QuickCommandsSlugResultFormatPost, getContentDependenciesV1ContentContentTypeContentIdDependenciesGet, getQuickCommandV1QuickCommandsSlugGet, getUploadFormV1FileUploadFormPost, listAiStacksV1AiStacksGet, listAllV1QuickCommandsAllGet, listAssociationV1WorkspaceWorkspaceIdGet, listConversationsV1ConversationsGet, listKnowledgeSourcesV1KnowledgeSourcesGet, postEventV1EventsPost, quickActionsV1QuickActionsPost, quickCommandsRunV2V2QuickCommandsSlugStepsStepSlugRunPost, resetKnowledgeObjectsV1KnowledgeSourcesSlugObjectsDelete,
|
|
2
|
+
import { addFavoriteV1AiStacksStackIdFavoritePost, addFavoriteV1QuickCommandsSlugFavoritePost, conversationHistoryV1ConversationsConversationIdGet, currentV1TokensUsageCurrentGet, currentV1TokensUsageTotalGet, defaults, deleteConversationV1ConversationsConversationIdDelete, deleteFavoriteV1AiStacksStackIdFavoriteDelete, deleteFavoriteV1QuickCommandsSlugFavoriteDelete, deleteKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdDelete, downloadConversationV1ConversationsConversationIdDownloadGet, findKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdGet, findKnowledgeSourceV1KnowledgeSourcesSlugGet, formatFetchStepV1QuickCommandsSlugStepsStepSlugFetchFormatPost, formatResultV1QuickCommandsSlugResultFormatPost, getContentDependenciesV1ContentContentTypeContentIdDependenciesGet, getQuickCommandV1QuickCommandsSlugGet, getUploadFormV1FileUploadFormPost, listAiStacksV1AiStacksGet, listAllV1QuickCommandsAllGet, listAssociationV1WorkspaceWorkspaceIdGet, listConversationsV1ConversationsGet, listKnowledgeSourcesV1KnowledgeSourcesGet, postEventV1EventsPost, quickActionsV1QuickActionsPost, quickCommandsRunV2V2QuickCommandsSlugStepsStepSlugRunPost, resetKnowledgeObjectsV1KnowledgeSourcesSlugObjectsDelete, updateQuickCommandV1QuickCommandsSlugPatch, updateTitleV1ConversationsConversationIdPatch, vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost, } from '../api/ai.js';
|
|
3
3
|
import apis from '../apis.json';
|
|
4
4
|
import { StackspotAPIError } from '../error/StackspotAPIError.js';
|
|
5
5
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient.js';
|
|
@@ -136,15 +136,6 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
136
136
|
writable: true,
|
|
137
137
|
value: this.query(removeAuthorizationParam(findKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdGet))
|
|
138
138
|
});
|
|
139
|
-
/**
|
|
140
|
-
* Lists knowledge sources matching the provided IDs.
|
|
141
|
-
*/
|
|
142
|
-
Object.defineProperty(this, "searchKnowledgeSources", {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
configurable: true,
|
|
145
|
-
writable: true,
|
|
146
|
-
value: this.query(removeAuthorizationParam(searchKnowledgeSourcesV1KnowledgeSourcesSearchPost))
|
|
147
|
-
});
|
|
148
139
|
/**
|
|
149
140
|
* Gets the chat history. This is a paginated resource.
|
|
150
141
|
*/
|
package/dist/client/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/client/ai.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EACL,wCAAwC,EACxC,0CAA0C,EAC1C,mDAAmD,EACnD,8BAA8B,EAC9B,4BAA4B,EAC5B,QAAQ,EACR,qDAAqD,EACrD,6CAA6C,EAC7C,+CAA+C,EAC/C,0EAA0E,EAC1E,4DAA4D,EAC5D,qEAAqE,EACrE,4CAA4C,EAC5C,8DAA8D,EAC9D,+CAA+C,EAC/C,kEAAkE,EAClE,qCAAqC,EACrC,iCAAiC,EAEjC,yBAAyB,EACzB,4BAA4B,EAC5B,wCAAwC,EACxC,mCAAmC,EACnC,yCAAyC,EACzC,qBAAqB,EACrB,8BAA8B,EAG9B,yDAAyD,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B,aAAa,EAAE,MAAM;YACrB,eAAe;YACf,mBAAmB;YACnB,UAAU,EAAE,CAAC,YAAY,CAAC;YAC1B,SAAS;SACV,CAAC,CAAA;IACJ,CAAC;CAQF;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAA"}
|
|
@@ -66,7 +66,6 @@ declare class DiscoveryClient extends ReactQueryNetworkClient {
|
|
|
66
66
|
* Create an hypothesis
|
|
67
67
|
*/
|
|
68
68
|
createHypothesis: import("../network/types.js").MutationObject<Omit<{
|
|
69
|
-
authorization: string;
|
|
70
69
|
hypothesisCreateRequest: import("../api/discovery.js").HypothesisCreateRequest;
|
|
71
70
|
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, import("../api/discovery.js").HypothesisResponse>;
|
|
72
71
|
/**
|
|
@@ -74,7 +73,6 @@ declare class DiscoveryClient extends ReactQueryNetworkClient {
|
|
|
74
73
|
*/
|
|
75
74
|
createDocument: import("../network/types.js").MutationObject<Omit<{
|
|
76
75
|
hypothesisId: string;
|
|
77
|
-
authorization: string;
|
|
78
76
|
documentUploadRequest?: import("../api/discovery.js").DocumentUploadRequest | undefined;
|
|
79
77
|
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, never>;
|
|
80
78
|
/**
|
|
@@ -82,9 +80,27 @@ declare class DiscoveryClient extends ReactQueryNetworkClient {
|
|
|
82
80
|
*/
|
|
83
81
|
attachExistingDocument: import("../network/types.js").MutationObject<Omit<{
|
|
84
82
|
hypothesisId: string;
|
|
85
|
-
authorization: string;
|
|
86
83
|
documentAttachRequest: import("../api/discovery.js").DocumentAttachRequest;
|
|
87
84
|
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, never>;
|
|
85
|
+
/**
|
|
86
|
+
* Delete an hypothesis
|
|
87
|
+
*/
|
|
88
|
+
deleteHypothesis: import("../network/types.js").MutationObject<Omit<{
|
|
89
|
+
hypothesisId: string;
|
|
90
|
+
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, never>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete an document
|
|
93
|
+
*/
|
|
94
|
+
deleteDocument: import("../network/types.js").MutationObject<Omit<{
|
|
95
|
+
hypothesisId: string;
|
|
96
|
+
documentId: string;
|
|
97
|
+
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, never>;
|
|
98
|
+
/**
|
|
99
|
+
* Download an document
|
|
100
|
+
*/
|
|
101
|
+
downloadDocument: import("../network/types.js").QueryObject<Omit<{
|
|
102
|
+
documentId: string;
|
|
103
|
+
}, "authorization" | "jwtToken" | "authorizationHeader"> & {}, Blob>;
|
|
88
104
|
}
|
|
89
105
|
export declare const discoveryClient: DiscoveryClient;
|
|
90
106
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/client/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAG5E,cAAM,eAAgB,SAAQ,uBAAuB;;IAMnD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,cAAc;;;;;;;kEAA6B;IAC3C;;OAEG;IACH,iBAAiB;;sDAAiC;IAClD;;OAEG;IACH,yBAAyB;;;;;;;uEAAoB;IAC7C;;OAEG;IACH,gBAAgB;;;;;;8EAA6C;IAC7D;;OAEG;IACH,eAAe;;0DAAsB;IACrC;;OAEG;IACH,iBAAiB;;;;;;mEAAmB;IACpC;;OAEG;IACH,iBAAiB,kGAAqB;IACtC;;OAEG;IACH,gBAAgB
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/client/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAG5E,cAAM,eAAgB,SAAQ,uBAAuB;;IAMnD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,cAAc;;;;;;;kEAA6B;IAC3C;;OAEG;IACH,iBAAiB;;sDAAiC;IAClD;;OAEG;IACH,yBAAyB;;;;;;;uEAAoB;IAC7C;;OAEG;IACH,gBAAgB;;;;;;8EAA6C;IAC7D;;OAEG;IACH,eAAe;;0DAAsB;IACrC;;OAEG;IACH,iBAAiB;;;;;;mEAAmB;IACpC;;OAEG;IACH,iBAAiB,kGAAqB;IACtC;;OAEG;IACH,gBAAgB;;kHAA4D;IAC5E;;OAEG;IACH,cAAc;;;0EAAkD;IAChE;;OAEG;IACH,sBAAsB;;;0EAAkD;IACxE;;OAEG;IACH,gBAAgB;;0EAAgE;IAChF;;OAEG;IACH,cAAc;;;0EAAkG;IAChH;;OAEG;IACH,gBAAgB;;yEAAiD;CAClE;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
|
package/dist/client/discovery.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { attach, createHypothesis, defaults, findHypothesisById, getAll, getById, list, list1, listAllDocumentsWithHypotheses, listHypothesis, upload } from '../api/discovery.js';
|
|
1
|
+
import { attach, createHypothesis, defaults, deleteHypothesisById, deleteV1DocumentsByDocumentIdHypothesesAndHypothesisId, download, findHypothesisById, getAll, getById, list, list1, listAllDocumentsWithHypotheses, listHypothesis, upload } from '../api/discovery.js';
|
|
2
2
|
import apis from '../apis.json';
|
|
3
3
|
import { DefaultAPIError } from '../error/DefaultAPIError.js';
|
|
4
4
|
import { baseDictionary } from '../error/dictionary/base.js';
|
|
@@ -97,6 +97,33 @@ class DiscoveryClient extends ReactQueryNetworkClient {
|
|
|
97
97
|
writable: true,
|
|
98
98
|
value: this.mutation(removeAuthorizationParam(attach))
|
|
99
99
|
});
|
|
100
|
+
/**
|
|
101
|
+
* Delete an hypothesis
|
|
102
|
+
*/
|
|
103
|
+
Object.defineProperty(this, "deleteHypothesis", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
configurable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
value: this.mutation(removeAuthorizationParam(deleteHypothesisById))
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Delete an document
|
|
111
|
+
*/
|
|
112
|
+
Object.defineProperty(this, "deleteDocument", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
configurable: true,
|
|
115
|
+
writable: true,
|
|
116
|
+
value: this.mutation(removeAuthorizationParam(deleteV1DocumentsByDocumentIdHypothesesAndHypothesisId))
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Download an document
|
|
120
|
+
*/
|
|
121
|
+
Object.defineProperty(this, "downloadDocument", {
|
|
122
|
+
enumerable: true,
|
|
123
|
+
configurable: true,
|
|
124
|
+
writable: true,
|
|
125
|
+
value: this.query(removeAuthorizationParam(download))
|
|
126
|
+
});
|
|
100
127
|
}
|
|
101
128
|
buildStackSpotError(error) {
|
|
102
129
|
return new DefaultAPIError(error.data, error.status, baseDictionary, error.headers);
|