@vertesia/client 0.81.1 → 1.0.0-dev.20260203.130115Z

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.
Files changed (266) hide show
  1. package/package.json +7 -7
  2. package/src/InteractionsApi.ts +21 -1
  3. package/src/MCPOAuthApi.ts +67 -0
  4. package/src/ProjectsApi.ts +23 -2
  5. package/src/client.ts +19 -5
  6. package/src/index.ts +2 -2
  7. package/src/store/CollectionsApi.ts +4 -4
  8. package/src/store/DashboardApi.ts +216 -0
  9. package/src/store/DataApi.ts +516 -0
  10. package/src/store/EmailApi.ts +211 -0
  11. package/src/store/FilesApi.ts +13 -0
  12. package/src/store/HiveMemoryApi.ts +231 -0
  13. package/src/store/IndexingAdminApi.ts +336 -0
  14. package/src/store/IndexingApi.ts +62 -0
  15. package/src/store/ObjectsApi.ts +40 -0
  16. package/src/store/PendingAsksApi.ts +98 -0
  17. package/src/store/QueryApi.ts +110 -0
  18. package/src/store/SchedulesApi.ts +114 -0
  19. package/src/store/ToolsApi.ts +19 -0
  20. package/src/store/WorkflowsApi.ts +310 -48
  21. package/src/store/client.ts +18 -0
  22. package/src/store/index.ts +9 -0
  23. package/lib/cjs/AccountApi.js +0 -85
  24. package/lib/cjs/AccountApi.js.map +0 -1
  25. package/lib/cjs/AccountsApi.js +0 -16
  26. package/lib/cjs/AccountsApi.js.map +0 -1
  27. package/lib/cjs/AnalyticsApi.js +0 -41
  28. package/lib/cjs/AnalyticsApi.js.map +0 -1
  29. package/lib/cjs/ApiKeysApi.js +0 -63
  30. package/lib/cjs/ApiKeysApi.js.map +0 -1
  31. package/lib/cjs/AppsApi.js +0 -119
  32. package/lib/cjs/AppsApi.js.map +0 -1
  33. package/lib/cjs/CommandsApi.js +0 -19
  34. package/lib/cjs/CommandsApi.js.map +0 -1
  35. package/lib/cjs/EnvironmentsApi.js +0 -72
  36. package/lib/cjs/EnvironmentsApi.js.map +0 -1
  37. package/lib/cjs/GroupsApi.js +0 -78
  38. package/lib/cjs/GroupsApi.js.map +0 -1
  39. package/lib/cjs/IamApi.js +0 -53
  40. package/lib/cjs/IamApi.js.map +0 -1
  41. package/lib/cjs/InteractionBase.js +0 -44
  42. package/lib/cjs/InteractionBase.js.map +0 -1
  43. package/lib/cjs/InteractionCatalogApi.js +0 -64
  44. package/lib/cjs/InteractionCatalogApi.js.map +0 -1
  45. package/lib/cjs/InteractionOutput.js +0 -300
  46. package/lib/cjs/InteractionOutput.js.map +0 -1
  47. package/lib/cjs/InteractionResult.example.js +0 -57
  48. package/lib/cjs/InteractionResult.example.js.map +0 -1
  49. package/lib/cjs/InteractionsApi.js +0 -243
  50. package/lib/cjs/InteractionsApi.js.map +0 -1
  51. package/lib/cjs/ProjectsApi.js +0 -53
  52. package/lib/cjs/ProjectsApi.js.map +0 -1
  53. package/lib/cjs/PromptsApi.js +0 -133
  54. package/lib/cjs/PromptsApi.js.map +0 -1
  55. package/lib/cjs/RefsApi.js +0 -14
  56. package/lib/cjs/RefsApi.js.map +0 -1
  57. package/lib/cjs/RunsApi.js +0 -113
  58. package/lib/cjs/RunsApi.js.map +0 -1
  59. package/lib/cjs/SkillsApi.js +0 -39
  60. package/lib/cjs/SkillsApi.js.map +0 -1
  61. package/lib/cjs/StreamSource.js +0 -17
  62. package/lib/cjs/StreamSource.js.map +0 -1
  63. package/lib/cjs/TrainingApi.js +0 -54
  64. package/lib/cjs/TrainingApi.js.map +0 -1
  65. package/lib/cjs/UsersApi.js +0 -13
  66. package/lib/cjs/UsersApi.js.map +0 -1
  67. package/lib/cjs/client.js +0 -351
  68. package/lib/cjs/client.js.map +0 -1
  69. package/lib/cjs/execute.js +0 -158
  70. package/lib/cjs/execute.js.map +0 -1
  71. package/lib/cjs/index.js +0 -22
  72. package/lib/cjs/index.js.map +0 -1
  73. package/lib/cjs/nodejs/NodeStreamSource.js +0 -45
  74. package/lib/cjs/nodejs/NodeStreamSource.js.map +0 -1
  75. package/lib/cjs/nodejs/index.js +0 -18
  76. package/lib/cjs/nodejs/index.js.map +0 -1
  77. package/lib/cjs/package.json +0 -3
  78. package/lib/cjs/store/AnalyzeDocApi.js +0 -56
  79. package/lib/cjs/store/AnalyzeDocApi.js.map +0 -1
  80. package/lib/cjs/store/CollectionsApi.js +0 -131
  81. package/lib/cjs/store/CollectionsApi.js.map +0 -1
  82. package/lib/cjs/store/CommandsApi.js +0 -17
  83. package/lib/cjs/store/CommandsApi.js.map +0 -1
  84. package/lib/cjs/store/EmbeddingsApi.js +0 -29
  85. package/lib/cjs/store/EmbeddingsApi.js.map +0 -1
  86. package/lib/cjs/store/FilesApi.js +0 -225
  87. package/lib/cjs/store/FilesApi.js.map +0 -1
  88. package/lib/cjs/store/ObjectsApi.js +0 -283
  89. package/lib/cjs/store/ObjectsApi.js.map +0 -1
  90. package/lib/cjs/store/TypesApi.js +0 -57
  91. package/lib/cjs/store/TypesApi.js.map +0 -1
  92. package/lib/cjs/store/WorkersApi.js +0 -16
  93. package/lib/cjs/store/WorkersApi.js.map +0 -1
  94. package/lib/cjs/store/WorkflowsApi.js +0 -425
  95. package/lib/cjs/store/WorkflowsApi.js.map +0 -1
  96. package/lib/cjs/store/client.js +0 -71
  97. package/lib/cjs/store/client.js.map +0 -1
  98. package/lib/cjs/store/errors.js +0 -11
  99. package/lib/cjs/store/errors.js.map +0 -1
  100. package/lib/cjs/store/index.js +0 -23
  101. package/lib/cjs/store/index.js.map +0 -1
  102. package/lib/cjs/store/version.js +0 -6
  103. package/lib/cjs/store/version.js.map +0 -1
  104. package/lib/esm/AccountApi.js +0 -82
  105. package/lib/esm/AccountApi.js.map +0 -1
  106. package/lib/esm/AccountsApi.js +0 -13
  107. package/lib/esm/AccountsApi.js.map +0 -1
  108. package/lib/esm/AnalyticsApi.js +0 -38
  109. package/lib/esm/AnalyticsApi.js.map +0 -1
  110. package/lib/esm/ApiKeysApi.js +0 -59
  111. package/lib/esm/ApiKeysApi.js.map +0 -1
  112. package/lib/esm/AppsApi.js +0 -116
  113. package/lib/esm/AppsApi.js.map +0 -1
  114. package/lib/esm/CommandsApi.js +0 -16
  115. package/lib/esm/CommandsApi.js.map +0 -1
  116. package/lib/esm/EnvironmentsApi.js +0 -69
  117. package/lib/esm/EnvironmentsApi.js.map +0 -1
  118. package/lib/esm/GroupsApi.js +0 -74
  119. package/lib/esm/GroupsApi.js.map +0 -1
  120. package/lib/esm/IamApi.js +0 -47
  121. package/lib/esm/IamApi.js.map +0 -1
  122. package/lib/esm/InteractionBase.js +0 -40
  123. package/lib/esm/InteractionBase.js.map +0 -1
  124. package/lib/esm/InteractionCatalogApi.js +0 -60
  125. package/lib/esm/InteractionCatalogApi.js.map +0 -1
  126. package/lib/esm/InteractionOutput.js +0 -293
  127. package/lib/esm/InteractionOutput.js.map +0 -1
  128. package/lib/esm/InteractionResult.example.js +0 -55
  129. package/lib/esm/InteractionResult.example.js.map +0 -1
  130. package/lib/esm/InteractionsApi.js +0 -240
  131. package/lib/esm/InteractionsApi.js.map +0 -1
  132. package/lib/esm/ProjectsApi.js +0 -50
  133. package/lib/esm/ProjectsApi.js.map +0 -1
  134. package/lib/esm/PromptsApi.js +0 -130
  135. package/lib/esm/PromptsApi.js.map +0 -1
  136. package/lib/esm/RefsApi.js +0 -10
  137. package/lib/esm/RefsApi.js.map +0 -1
  138. package/lib/esm/RunsApi.js +0 -109
  139. package/lib/esm/RunsApi.js.map +0 -1
  140. package/lib/esm/SkillsApi.js +0 -36
  141. package/lib/esm/SkillsApi.js.map +0 -1
  142. package/lib/esm/StreamSource.js +0 -13
  143. package/lib/esm/StreamSource.js.map +0 -1
  144. package/lib/esm/TrainingApi.js +0 -51
  145. package/lib/esm/TrainingApi.js.map +0 -1
  146. package/lib/esm/UsersApi.js +0 -10
  147. package/lib/esm/UsersApi.js.map +0 -1
  148. package/lib/esm/client.js +0 -342
  149. package/lib/esm/client.js.map +0 -1
  150. package/lib/esm/execute.js +0 -118
  151. package/lib/esm/execute.js.map +0 -1
  152. package/lib/esm/index.js +0 -6
  153. package/lib/esm/index.js.map +0 -1
  154. package/lib/esm/nodejs/NodeStreamSource.js +0 -41
  155. package/lib/esm/nodejs/NodeStreamSource.js.map +0 -1
  156. package/lib/esm/nodejs/index.js +0 -2
  157. package/lib/esm/nodejs/index.js.map +0 -1
  158. package/lib/esm/store/AnalyzeDocApi.js +0 -52
  159. package/lib/esm/store/AnalyzeDocApi.js.map +0 -1
  160. package/lib/esm/store/CollectionsApi.js +0 -127
  161. package/lib/esm/store/CollectionsApi.js.map +0 -1
  162. package/lib/esm/store/CommandsApi.js +0 -13
  163. package/lib/esm/store/CommandsApi.js.map +0 -1
  164. package/lib/esm/store/EmbeddingsApi.js +0 -25
  165. package/lib/esm/store/EmbeddingsApi.js.map +0 -1
  166. package/lib/esm/store/FilesApi.js +0 -219
  167. package/lib/esm/store/FilesApi.js.map +0 -1
  168. package/lib/esm/store/ObjectsApi.js +0 -279
  169. package/lib/esm/store/ObjectsApi.js.map +0 -1
  170. package/lib/esm/store/TypesApi.js +0 -53
  171. package/lib/esm/store/TypesApi.js.map +0 -1
  172. package/lib/esm/store/WorkersApi.js +0 -12
  173. package/lib/esm/store/WorkersApi.js.map +0 -1
  174. package/lib/esm/store/WorkflowsApi.js +0 -419
  175. package/lib/esm/store/WorkflowsApi.js.map +0 -1
  176. package/lib/esm/store/client.js +0 -67
  177. package/lib/esm/store/client.js.map +0 -1
  178. package/lib/esm/store/errors.js +0 -7
  179. package/lib/esm/store/errors.js.map +0 -1
  180. package/lib/esm/store/index.js +0 -7
  181. package/lib/esm/store/index.js.map +0 -1
  182. package/lib/esm/store/version.js +0 -3
  183. package/lib/esm/store/version.js.map +0 -1
  184. package/lib/tsconfig.tsbuildinfo +0 -1
  185. package/lib/types/AccountApi.d.ts +0 -59
  186. package/lib/types/AccountApi.d.ts.map +0 -1
  187. package/lib/types/AccountsApi.d.ts +0 -7
  188. package/lib/types/AccountsApi.d.ts.map +0 -1
  189. package/lib/types/AnalyticsApi.d.ts +0 -11
  190. package/lib/types/AnalyticsApi.d.ts.map +0 -1
  191. package/lib/types/ApiKeysApi.d.ts +0 -42
  192. package/lib/types/ApiKeysApi.d.ts.map +0 -1
  193. package/lib/types/AppsApi.d.ts +0 -65
  194. package/lib/types/AppsApi.d.ts.map +0 -1
  195. package/lib/types/CommandsApi.d.ts +0 -10
  196. package/lib/types/CommandsApi.d.ts.map +0 -1
  197. package/lib/types/EnvironmentsApi.d.ts +0 -40
  198. package/lib/types/EnvironmentsApi.d.ts.map +0 -1
  199. package/lib/types/GroupsApi.d.ts +0 -65
  200. package/lib/types/GroupsApi.d.ts.map +0 -1
  201. package/lib/types/IamApi.d.ts +0 -41
  202. package/lib/types/IamApi.d.ts.map +0 -1
  203. package/lib/types/InteractionBase.d.ts +0 -22
  204. package/lib/types/InteractionBase.d.ts.map +0 -1
  205. package/lib/types/InteractionCatalogApi.d.ts +0 -36
  206. package/lib/types/InteractionCatalogApi.d.ts.map +0 -1
  207. package/lib/types/InteractionOutput.d.ts +0 -174
  208. package/lib/types/InteractionOutput.d.ts.map +0 -1
  209. package/lib/types/InteractionResult.example.d.ts +0 -6
  210. package/lib/types/InteractionResult.example.d.ts.map +0 -1
  211. package/lib/types/InteractionsApi.d.ts +0 -165
  212. package/lib/types/InteractionsApi.d.ts.map +0 -1
  213. package/lib/types/ProjectsApi.d.ts +0 -18
  214. package/lib/types/ProjectsApi.d.ts.map +0 -1
  215. package/lib/types/PromptsApi.d.ts +0 -106
  216. package/lib/types/PromptsApi.d.ts.map +0 -1
  217. package/lib/types/RefsApi.d.ts +0 -6
  218. package/lib/types/RefsApi.d.ts.map +0 -1
  219. package/lib/types/RunsApi.d.ts +0 -79
  220. package/lib/types/RunsApi.d.ts.map +0 -1
  221. package/lib/types/SkillsApi.d.ts +0 -26
  222. package/lib/types/SkillsApi.d.ts.map +0 -1
  223. package/lib/types/StreamSource.d.ts +0 -7
  224. package/lib/types/StreamSource.d.ts.map +0 -1
  225. package/lib/types/TrainingApi.d.ts +0 -27
  226. package/lib/types/TrainingApi.d.ts.map +0 -1
  227. package/lib/types/UsersApi.d.ts +0 -6
  228. package/lib/types/UsersApi.d.ts.map +0 -1
  229. package/lib/types/client.d.ts +0 -125
  230. package/lib/types/client.d.ts.map +0 -1
  231. package/lib/types/execute.d.ts +0 -37
  232. package/lib/types/execute.d.ts.map +0 -1
  233. package/lib/types/index.d.ts +0 -10
  234. package/lib/types/index.d.ts.map +0 -1
  235. package/lib/types/nodejs/NodeStreamSource.d.ts +0 -9
  236. package/lib/types/nodejs/NodeStreamSource.d.ts.map +0 -1
  237. package/lib/types/nodejs/index.d.ts +0 -1
  238. package/lib/types/nodejs/index.d.ts.map +0 -1
  239. package/lib/types/store/AnalyzeDocApi.d.ts +0 -17
  240. package/lib/types/store/AnalyzeDocApi.d.ts.map +0 -1
  241. package/lib/types/store/CollectionsApi.d.ts +0 -82
  242. package/lib/types/store/CollectionsApi.d.ts.map +0 -1
  243. package/lib/types/store/CommandsApi.d.ts +0 -10
  244. package/lib/types/store/CommandsApi.d.ts.map +0 -1
  245. package/lib/types/store/EmbeddingsApi.d.ts +0 -12
  246. package/lib/types/store/EmbeddingsApi.d.ts.map +0 -1
  247. package/lib/types/store/FilesApi.d.ts +0 -103
  248. package/lib/types/store/FilesApi.d.ts.map +0 -1
  249. package/lib/types/store/ObjectsApi.d.ts +0 -117
  250. package/lib/types/store/ObjectsApi.d.ts.map +0 -1
  251. package/lib/types/store/TypesApi.d.ts +0 -23
  252. package/lib/types/store/TypesApi.d.ts.map +0 -1
  253. package/lib/types/store/WorkersApi.d.ts +0 -6
  254. package/lib/types/store/WorkersApi.d.ts.map +0 -1
  255. package/lib/types/store/WorkflowsApi.d.ts +0 -71
  256. package/lib/types/store/WorkflowsApi.d.ts.map +0 -1
  257. package/lib/types/store/client.d.ts +0 -35
  258. package/lib/types/store/client.d.ts.map +0 -1
  259. package/lib/types/store/errors.d.ts +0 -4
  260. package/lib/types/store/errors.d.ts.map +0 -1
  261. package/lib/types/store/index.d.ts +0 -6
  262. package/lib/types/store/index.d.ts.map +0 -1
  263. package/lib/types/store/version.d.ts +0 -2
  264. package/lib/types/store/version.d.ts.map +0 -1
  265. package/lib/vertesia-client.js +0 -2
  266. package/lib/vertesia-client.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertesia/client",
3
- "version": "0.81.1",
3
+ "version": "1.0.0-dev.20260203.130115Z",
4
4
  "type": "module",
5
5
  "types": "./lib/types/index.d.ts",
6
6
  "files": [
@@ -13,18 +13,18 @@
13
13
  "@rollup/plugin-commonjs": "^28.0.3",
14
14
  "@rollup/plugin-node-resolve": "^16.0.1",
15
15
  "@rollup/plugin-typescript": "^12.1.2",
16
- "@types/node": "^22.13.5",
16
+ "@types/node": "^22.19.2",
17
17
  "rollup": "^4.40.2",
18
18
  "rollup-plugin-terser": "^7.0.2",
19
19
  "ts-dual-module": "^0.6.3",
20
- "typescript": "^5.0.2",
21
- "vitest": "^3.0.9"
20
+ "typescript": "^5.9.3",
21
+ "vitest": "^4.0.16"
22
22
  },
23
23
  "dependencies": {
24
24
  "eventsource": "^3.0.6",
25
- "@llumiverse/common": "0.24.0",
26
- "@vertesia/api-fetch-client": "0.81.1",
27
- "@vertesia/common": "0.81.1"
25
+ "@vertesia/api-fetch-client": "1.0.0-dev.20260203.130115Z",
26
+ "@llumiverse/common": "1.0.0-dev.20260202.145450Z",
27
+ "@vertesia/common": "1.0.0-dev.20260203.130115Z"
28
28
  },
29
29
  "ts_dual_module": {
30
30
  "outDir": "lib"
@@ -6,7 +6,7 @@ import {
6
6
  InteractionExecutionPayload, InteractionForkPayload,
7
7
  InteractionPublishPayload, InteractionRef, InteractionRefWithSchema, InteractionSearchPayload, InteractionSearchQuery,
8
8
  InteractionsExportPayload, InteractionTags, InteractionUpdatePayload,
9
- RateLimitRequestPayload, RateLimitRequestResponse
9
+ RateLimitRequestPayload, RateLimitRequestResponse, ResolvedInteractionExecutionInfo
10
10
  } from "@vertesia/common";
11
11
  import { VertesiaClient } from "./client.js";
12
12
  import { checkRateLimit, executeInteraction, executeInteractionAsync, executeInteractionByName } from "./execute.js";
@@ -285,4 +285,24 @@ export default class InteractionsApi extends ApiTopic {
285
285
  return checkRateLimit(this.client as VertesiaClient, payload);
286
286
  }
287
287
 
288
+ /**
289
+ * Resolve an interaction by ID or name and return the resolved execution info.
290
+ * This includes the interaction ID, name, version, tags, and the resolved
291
+ * environment/model that would be used at execution time.
292
+ *
293
+ * The nameOrId parameter can be:
294
+ * - A MongoDB ObjectId (e.g., "66b9149c26dc74d6b5187d27")
295
+ * - An endpoint name (e.g., "ReviewContract")
296
+ * - An endpoint name with version/tag (e.g., "ReviewContract@1", "ReviewContract@draft")
297
+ *
298
+ * @param nameOrId The interaction ID or name (with optional @version/@tag)
299
+ * @param options Optional environment and/or model to resolve with
300
+ * @returns ResolvedInteractionExecutionInfo with the resolved environment and model
301
+ */
302
+ resolve(nameOrId: string, options?: { environment?: string; model?: string }): Promise<ResolvedInteractionExecutionInfo> {
303
+ return this.get(`/resolve/${encodeURIComponent(nameOrId)}`, {
304
+ query: options
305
+ });
306
+ }
307
+
288
308
  }
@@ -0,0 +1,67 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import type { OAuthAuthStatus, OAuthAuthorizeResponse, OAuthMetadataResponse } from "@vertesia/common";
3
+
4
+ export default class MCPOAuthApi extends ApiTopic {
5
+
6
+ constructor(parent: ClientBase) {
7
+ super(parent, "/api/v1/mcp/oauth")
8
+ }
9
+
10
+ /**
11
+ * Get OAuth authentication status for all collections in an app installation
12
+ * @param appInstallId - The app installation ID
13
+ * @returns Array of OAuth authentication statuses
14
+ */
15
+ getStatus(appInstallId: string): Promise<OAuthAuthStatus[]> {
16
+ return this.get(`/status/${appInstallId}`);
17
+ }
18
+
19
+ /**
20
+ * Get OAuth authentication status for a specific collection
21
+ * @param appInstallId - The app installation ID
22
+ * @param collectionName - The collection name
23
+ * @returns OAuth authentication status for the collection
24
+ */
25
+ getCollectionStatus(appInstallId: string, collectionName: string): Promise<OAuthAuthStatus> {
26
+ return this.get(`/status/${appInstallId}/${collectionName}`);
27
+ }
28
+
29
+ /**
30
+ * Get OAuth metadata for a specific collection
31
+ * @param appInstallId - The app installation ID
32
+ * @param collectionName - The collection name
33
+ * @returns OAuth metadata
34
+ */
35
+ getMetadata(appInstallId: string, collectionName: string): Promise<OAuthMetadataResponse> {
36
+ return this.get(`/metadata/${appInstallId}/${collectionName}`);
37
+ }
38
+
39
+ /**
40
+ * Initiate OAuth authorization flow for a specific collection
41
+ * @param appInstallId - The app installation ID
42
+ * @param collectionName - The collection name
43
+ * @returns Authorization URL to open for user authentication
44
+ */
45
+ authorize(appInstallId: string, collectionName: string): Promise<OAuthAuthorizeResponse> {
46
+ return this.get(`/authorize/${appInstallId}/${collectionName}`);
47
+ }
48
+
49
+ /**
50
+ * Disconnect OAuth authentication for an MCP server
51
+ * @param mcpServerUrl - The MCP server URL
52
+ */
53
+ disconnect(mcpServerUrl: string): Promise<void> {
54
+ return this.del(`/disconnect/${encodeURIComponent(mcpServerUrl)}`);
55
+ }
56
+
57
+ /**
58
+ * Get or refresh OAuth token for an MCP server (internal use by workflows)
59
+ * @param mcpServerUrl - The MCP server URL
60
+ * @returns Access token
61
+ */
62
+ getToken(mcpServerUrl: string): Promise<{ access_token: string }> {
63
+ return this.post('/token', {
64
+ payload: { mcp_server_url: mcpServerUrl }
65
+ });
66
+ }
67
+ }
@@ -1,5 +1,5 @@
1
- import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
- import { AwsConfiguration, GithubConfiguration, GladiaConfiguration, ICreateProjectPayload, MagicPdfConfiguration, Project, ProjectConfiguration, ProjectIntegrationListEntry, ProjectRef, SupportedIntegrations } from "@vertesia/common";
1
+ import { ApiTopic, ClientBase, ServerError } from "@vertesia/api-fetch-client";
2
+ import { AwsConfiguration, GithubConfiguration, GladiaConfiguration, ICreateProjectPayload, MagicPdfConfiguration, Project, ProjectConfiguration, ProjectIntegrationListEntry, ProjectRef, ProjectToolInfo, SupportedIntegrations } from "@vertesia/common";
3
3
 
4
4
  export default class ProjectsApi extends ApiTopic {
5
5
  constructor(parent: ClientBase) {
@@ -34,6 +34,27 @@ export default class ProjectsApi extends ApiTopic {
34
34
 
35
35
  integrations: IntegrationsConfigurationApi = new IntegrationsConfigurationApi(this);
36
36
 
37
+ /**
38
+ * List all tools available in the project with their app installation info.
39
+ * Settings are only included for agent tokens (security: may contain API keys).
40
+ */
41
+ getTools(projectId: string): Promise<ProjectToolInfo[]> {
42
+ return this.get(`/${projectId}/tools`);
43
+ }
44
+
45
+ /**
46
+ * Get a specific tool by name with its app installation info.
47
+ * Returns null if the tool is not found.
48
+ */
49
+ getToolByName(projectId: string, toolName: string): Promise<ProjectToolInfo | null> {
50
+ return this.get(`/${projectId}/tools/${toolName}`).catch((err: ServerError) => {
51
+ if (err.status === 404) {
52
+ return null;
53
+ }
54
+ throw err;
55
+ });
56
+ }
57
+
37
58
  }
38
59
 
39
60
  class IntegrationsConfigurationApi extends ApiTopic {
package/src/client.ts CHANGED
@@ -9,6 +9,7 @@ import CommandsApi from "./CommandsApi.js";
9
9
  import EnvironmentsApi from "./EnvironmentsApi.js";
10
10
  import { IamApi } from "./IamApi.js";
11
11
  import InteractionsApi from "./InteractionsApi.js";
12
+ import MCPOAuthApi from "./MCPOAuthApi.js";
12
13
  import ProjectsApi from "./ProjectsApi.js";
13
14
  import SkillsApi from "./SkillsApi.js";
14
15
  import PromptsApi from "./PromptsApi.js";
@@ -79,17 +80,22 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
79
80
  *
80
81
  * @param token the raw JWT token
81
82
  * @param payload the decoded JWT token as an AuthTokenPayload - optional
83
+ * @param endpoints optional endpoints to override those in the payload
82
84
  */
83
- static async fromAuthToken(token: string, payload?: AuthTokenPayload) {
85
+ static async fromAuthToken(
86
+ token: string,
87
+ payload?: AuthTokenPayload,
88
+ endpoints?: { studio: string; store: string; token?: string }
89
+ ) {
84
90
  if (!payload) {
85
91
  payload = decodeJWT(token);
86
92
  }
87
93
 
88
- const endpoints = decodeEndpoints(payload.endpoints);
94
+ const resolvedEndpoints = endpoints || decodeEndpoints(payload.endpoints);
89
95
  return await new VertesiaClient({
90
- serverUrl: endpoints.studio,
91
- storeUrl: endpoints.store,
92
- tokenServerUrl: payload.iss,
96
+ serverUrl: resolvedEndpoints.studio,
97
+ storeUrl: resolvedEndpoints.store,
98
+ tokenServerUrl: resolvedEndpoints.token || payload.iss,
93
99
  }).withApiKey(token);
94
100
  }
95
101
 
@@ -274,6 +280,13 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
274
280
  return this.store.types;
275
281
  }
276
282
 
283
+ /**
284
+ * Alias for store.data
285
+ */
286
+ get data() {
287
+ return this.store.data;
288
+ }
289
+
277
290
  get storeUrl() {
278
291
  return this.store.baseUrl;
279
292
  }
@@ -326,6 +339,7 @@ export class VertesiaClient extends AbstractFetchClient<VertesiaClient> {
326
339
  refs = new RefsApi(this);
327
340
  commands = new CommandsApi(this);
328
341
  apps = new AppsApi(this);
342
+ mcpOAuth = new MCPOAuthApi(this);
329
343
  }
330
344
 
331
345
  function isApiKey(apiKey: string) {
package/src/index.ts CHANGED
@@ -1,10 +1,10 @@
1
+ export type { OrphanedAppInstallation } from "./AppsApi.js";
1
2
  export * from './client.js';
3
+ export type { GroupsQueryOptions } from './GroupsApi.js';
2
4
  export * from './InteractionBase.js';
3
5
  export * from './InteractionOutput.js';
4
6
  export type { AsyncExecutionResult, ComputeInteractionFacetsResponse } from './InteractionsApi.js';
5
7
  export type { ComputePromptFacetsResponse, ListInteractionsResponse } from './PromptsApi.js';
6
8
  export type { ComputeRunFacetsResponse, FilterOption } from './RunsApi.js';
7
- export type { GroupsQueryOptions } from './GroupsApi.js';
8
9
  export * from "./store/index.js";
9
10
  export * from "./StreamSource.js";
10
- export type { OrphanedAppInstallation } from "./AppsApi.js";
@@ -1,5 +1,5 @@
1
1
  import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
- import { Collection, CollectionItem, ComplexCollectionSearchQuery, ComplexSearchPayload, ComputeCollectionFacetPayload, ComputeObjectFacetPayload, ContentObjectItem, ContentObjectStatus, CreateCollectionPayload, DynamicCollection } from "@vertesia/common";
2
+ import { Collection, ComplexCollectionSearchQuery, ComplexSearchPayload, ComputeCollectionFacetPayload, ComputeObjectFacetPayload, ContentObjectItem, ContentObjectStatus, CreateCollectionPayload, DynamicCollection } from "@vertesia/common";
3
3
  import { ComputeFacetsResponse, SearchResponse } from "./ObjectsApi.js";
4
4
 
5
5
 
@@ -12,9 +12,9 @@ export class CollectionsApi extends ApiTopic {
12
12
  /**
13
13
  * List collections
14
14
  * @param payload: CollectionSearchPayload
15
- * @returns CollectionItem[] list of collections
15
+ * @returns Collection[] list of collections
16
16
  **/
17
- search(payload: ComplexCollectionSearchQuery): Promise<CollectionItem[]> {
17
+ search(payload: ComplexCollectionSearchQuery): Promise<Collection[]> {
18
18
  return this.post("/search", { payload });
19
19
  }
20
20
 
@@ -109,7 +109,7 @@ export class CollectionsApi extends ApiTopic {
109
109
  });
110
110
  }
111
111
 
112
- searchChildren(collectionId: string, query: ComplexCollectionSearchQuery = {}): Promise<CollectionItem[]> {
112
+ searchChildren(collectionId: string, query: ComplexCollectionSearchQuery = {}): Promise<Collection[]> {
113
113
  return this.post(`/${collectionId}/children/search`, {
114
114
  payload: query
115
115
  });
@@ -0,0 +1,216 @@
1
+ import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
+ import {
3
+ CreateDashboardPayload,
4
+ CreateDashboardSnapshotPayload,
5
+ Dashboard,
6
+ DashboardItem,
7
+ DashboardStatus,
8
+ DashboardVersion,
9
+ DashboardVersionItem,
10
+ DataStoreApiHeaders,
11
+ PromoteDashboardVersionPayload,
12
+ UpdateDashboardPayload,
13
+ } from "@vertesia/common";
14
+
15
+ /**
16
+ * Client API for managing Vega-based dashboards linked to data stores.
17
+ *
18
+ * Dashboards provide:
19
+ * - Multi-panel Vega/Vega-Lite visualizations
20
+ * - SQL-backed data sources via named queries
21
+ *
22
+ * Note: Rendering is handled by the tools (data_preview_dashboard, data_render_dashboard).
23
+ */
24
+ export class DashboardApi extends ApiTopic {
25
+ private readonly storeId: string;
26
+
27
+ constructor(parent: ClientBase, storeId: string) {
28
+ super(parent, `/api/v1/data/${storeId}/dashboards`);
29
+ this.storeId = storeId;
30
+ }
31
+
32
+ /**
33
+ * Create headers with data store ID for Cloud Run session affinity.
34
+ */
35
+ private storeHeaders(): Record<string, string> {
36
+ return { [DataStoreApiHeaders.DATA_STORE_ID]: this.storeId };
37
+ }
38
+
39
+ // ============================================================
40
+ // Dashboard Operations
41
+ // ============================================================
42
+
43
+ /**
44
+ * List all dashboards for the data store.
45
+ *
46
+ * @param status - Filter by status (default: 'active')
47
+ * @returns List of dashboards
48
+ */
49
+ list(status?: DashboardStatus): Promise<DashboardItem[]> {
50
+ const query = status ? `?status=${status}` : '';
51
+ return this.get(`/${query}`, { headers: this.storeHeaders() });
52
+ }
53
+
54
+ /**
55
+ * Create a new dashboard.
56
+ *
57
+ * @param payload - Dashboard configuration with queries and panels
58
+ * @returns The created dashboard
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * const dashboard = await client.data.dashboards(storeId).create({
63
+ * name: 'Sales Overview',
64
+ * queries: [
65
+ * { name: 'revenue', sql: 'SELECT month, SUM(amount) FROM sales GROUP BY month' }
66
+ * ],
67
+ * panels: [
68
+ * {
69
+ * title: 'Monthly Revenue',
70
+ * dataSources: ['revenue'],
71
+ * position: { row: 0, col: 0 },
72
+ * spec: {
73
+ * mark: 'bar',
74
+ * encoding: {
75
+ * x: { field: 'month', type: 'ordinal' },
76
+ * y: { field: 'sum_amount', type: 'quantitative' }
77
+ * }
78
+ * }
79
+ * }
80
+ * ]
81
+ * });
82
+ * ```
83
+ */
84
+ create(payload: CreateDashboardPayload): Promise<Dashboard> {
85
+ return this.post("/", { payload, headers: this.storeHeaders() });
86
+ }
87
+
88
+ /**
89
+ * Get a dashboard by ID.
90
+ *
91
+ * @param id - Dashboard ID
92
+ * @returns The dashboard with all details
93
+ */
94
+ retrieve(id: string): Promise<Dashboard> {
95
+ return this.get(`/${id}`, { headers: this.storeHeaders() });
96
+ }
97
+
98
+ /**
99
+ * Update an existing dashboard.
100
+ *
101
+ * @param id - Dashboard ID
102
+ * @param payload - Fields to update
103
+ * @returns The updated dashboard
104
+ */
105
+ update(id: string, payload: UpdateDashboardPayload): Promise<Dashboard> {
106
+ return this.put(`/${id}`, { payload, headers: this.storeHeaders() });
107
+ }
108
+
109
+ /**
110
+ * Archive (soft delete) a dashboard.
111
+ *
112
+ * @param id - Dashboard ID
113
+ * @returns Object with the archived dashboard ID
114
+ */
115
+ delete(id: string): Promise<{ id: string; status: DashboardStatus }> {
116
+ return this.del(`/${id}`, { headers: this.storeHeaders() });
117
+ }
118
+
119
+ /**
120
+ * Archive (soft delete) multiple dashboards.
121
+ *
122
+ * @param ids - Array of dashboard IDs
123
+ * @returns Object with counts of archived and failed dashboards
124
+ */
125
+ bulkArchive(ids: string[]): Promise<{ archived: number; failed: number }> {
126
+ return this.post('/bulk/archive', { payload: { ids }, headers: this.storeHeaders() });
127
+ }
128
+
129
+ /**
130
+ * Permanently delete multiple dashboards.
131
+ *
132
+ * @param ids - Array of dashboard IDs
133
+ * @returns Object with counts of deleted and failed dashboards
134
+ */
135
+ bulkDelete(ids: string[]): Promise<{ deleted: number; failed: number }> {
136
+ return this.post('/bulk/delete', { payload: { ids }, headers: this.storeHeaders() });
137
+ }
138
+
139
+ // ============================================================
140
+ // Version Operations
141
+ // ============================================================
142
+
143
+ /**
144
+ * List versions for a dashboard.
145
+ *
146
+ * @param dashboardId - Dashboard ID
147
+ * @param options - Filter options
148
+ * @returns List of version summaries
149
+ */
150
+ listVersions(
151
+ dashboardId: string,
152
+ options?: { snapshotsOnly?: boolean; limit?: number }
153
+ ): Promise<DashboardVersionItem[]> {
154
+ const params = new URLSearchParams();
155
+ if (options?.snapshotsOnly) params.set('snapshots_only', 'true');
156
+ if (options?.limit) params.set('limit', String(options.limit));
157
+ const query = params.toString() ? `?${params}` : '';
158
+ return this.get(`/${dashboardId}/versions${query}`, { headers: this.storeHeaders() });
159
+ }
160
+
161
+ /**
162
+ * Get a specific version with full content.
163
+ *
164
+ * @param dashboardId - Dashboard ID
165
+ * @param versionId - Version ID
166
+ * @returns The version with full content
167
+ */
168
+ getVersion(dashboardId: string, versionId: string): Promise<DashboardVersion> {
169
+ return this.get(`/${dashboardId}/versions/${versionId}`, { headers: this.storeHeaders() });
170
+ }
171
+
172
+ /**
173
+ * Create a named snapshot from current dashboard state.
174
+ *
175
+ * @param dashboardId - Dashboard ID
176
+ * @param payload - Snapshot name and message
177
+ * @returns The created snapshot version
178
+ */
179
+ createSnapshot(
180
+ dashboardId: string,
181
+ payload: CreateDashboardSnapshotPayload
182
+ ): Promise<DashboardVersionItem> {
183
+ return this.post(`/${dashboardId}/versions`, { payload, headers: this.storeHeaders() });
184
+ }
185
+
186
+ /**
187
+ * Promote a version to be the current/active one.
188
+ * This restores the version's content to the dashboard.
189
+ *
190
+ * @param dashboardId - Dashboard ID
191
+ * @param versionId - Version ID to promote
192
+ * @param payload - Optional promotion message
193
+ * @returns The updated dashboard
194
+ */
195
+ promoteVersion(
196
+ dashboardId: string,
197
+ versionId: string,
198
+ payload?: PromoteDashboardVersionPayload
199
+ ): Promise<Dashboard> {
200
+ return this.post(`/${dashboardId}/versions/${versionId}/promote`, { payload: payload || {}, headers: this.storeHeaders() });
201
+ }
202
+
203
+ /**
204
+ * Enable or disable versioning for a dashboard.
205
+ *
206
+ * @param dashboardId - Dashboard ID
207
+ * @param enabled - Whether versioning should be enabled
208
+ * @returns The updated versioning state
209
+ */
210
+ setVersioningEnabled(
211
+ dashboardId: string,
212
+ enabled: boolean
213
+ ): Promise<{ versioning_enabled: boolean }> {
214
+ return this.put(`/${dashboardId}/versioning`, { payload: { enabled }, headers: this.storeHeaders() });
215
+ }
216
+ }