@vertesia/client 1.0.0 → 1.1.0-dev.20260427.060440Z

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 (149) hide show
  1. package/lib/cjs/AnalyticsApi.js +3 -1
  2. package/lib/cjs/AnalyticsApi.js.map +1 -1
  3. package/lib/cjs/AppsApi.js +18 -2
  4. package/lib/cjs/AppsApi.js.map +1 -1
  5. package/lib/cjs/AuditTrailApi.js +6 -2
  6. package/lib/cjs/AuditTrailApi.js.map +1 -1
  7. package/lib/cjs/GroupsApi.js +8 -0
  8. package/lib/cjs/GroupsApi.js.map +1 -1
  9. package/lib/cjs/InteractionsApi.js.map +1 -1
  10. package/lib/cjs/OAuthClientsApi.js +25 -0
  11. package/lib/cjs/OAuthClientsApi.js.map +1 -0
  12. package/lib/cjs/OAuthGrantsApi.js +30 -0
  13. package/lib/cjs/OAuthGrantsApi.js.map +1 -0
  14. package/lib/cjs/OAuthProvidersApi.js +43 -0
  15. package/lib/cjs/OAuthProvidersApi.js.map +1 -0
  16. package/lib/cjs/OAuthServerApi.js +22 -0
  17. package/lib/cjs/OAuthServerApi.js.map +1 -0
  18. package/lib/cjs/RemoteMcpConnectionsApi.js +38 -0
  19. package/lib/cjs/RemoteMcpConnectionsApi.js.map +1 -0
  20. package/lib/cjs/RunsApi.js +4 -12
  21. package/lib/cjs/RunsApi.js.map +1 -1
  22. package/lib/cjs/client.js +48 -45
  23. package/lib/cjs/client.js.map +1 -1
  24. package/lib/cjs/index.js +14 -0
  25. package/lib/cjs/index.js.map +1 -1
  26. package/lib/cjs/store/AgentsApi.js +30 -6
  27. package/lib/cjs/store/AgentsApi.js.map +1 -1
  28. package/lib/cjs/store/CostApi.js +56 -0
  29. package/lib/cjs/store/CostApi.js.map +1 -0
  30. package/lib/cjs/store/IndexingApi.js +94 -30
  31. package/lib/cjs/store/IndexingApi.js.map +1 -1
  32. package/lib/cjs/store/ObjectsApi.js +3 -2
  33. package/lib/cjs/store/ObjectsApi.js.map +1 -1
  34. package/lib/cjs/store/WorkflowsApi.js +258 -236
  35. package/lib/cjs/store/WorkflowsApi.js.map +1 -1
  36. package/lib/cjs/store/client.js +2 -0
  37. package/lib/cjs/store/client.js.map +1 -1
  38. package/lib/esm/AnalyticsApi.js +3 -1
  39. package/lib/esm/AnalyticsApi.js.map +1 -1
  40. package/lib/esm/AppsApi.js +18 -2
  41. package/lib/esm/AppsApi.js.map +1 -1
  42. package/lib/esm/AuditTrailApi.js +6 -2
  43. package/lib/esm/AuditTrailApi.js.map +1 -1
  44. package/lib/esm/GroupsApi.js +8 -0
  45. package/lib/esm/GroupsApi.js.map +1 -1
  46. package/lib/esm/InteractionsApi.js.map +1 -1
  47. package/lib/esm/OAuthClientsApi.js +22 -0
  48. package/lib/esm/OAuthClientsApi.js.map +1 -0
  49. package/lib/esm/OAuthGrantsApi.js +27 -0
  50. package/lib/esm/OAuthGrantsApi.js.map +1 -0
  51. package/lib/esm/OAuthProvidersApi.js +40 -0
  52. package/lib/esm/OAuthProvidersApi.js.map +1 -0
  53. package/lib/esm/OAuthServerApi.js +19 -0
  54. package/lib/esm/OAuthServerApi.js.map +1 -0
  55. package/lib/esm/RemoteMcpConnectionsApi.js +35 -0
  56. package/lib/esm/RemoteMcpConnectionsApi.js.map +1 -0
  57. package/lib/esm/RunsApi.js +4 -12
  58. package/lib/esm/RunsApi.js.map +1 -1
  59. package/lib/esm/client.js +48 -45
  60. package/lib/esm/client.js.map +1 -1
  61. package/lib/esm/index.js +5 -0
  62. package/lib/esm/index.js.map +1 -1
  63. package/lib/esm/store/AgentsApi.js +30 -6
  64. package/lib/esm/store/AgentsApi.js.map +1 -1
  65. package/lib/esm/store/CostApi.js +52 -0
  66. package/lib/esm/store/CostApi.js.map +1 -0
  67. package/lib/esm/store/IndexingApi.js +94 -30
  68. package/lib/esm/store/IndexingApi.js.map +1 -1
  69. package/lib/esm/store/ObjectsApi.js +3 -2
  70. package/lib/esm/store/ObjectsApi.js.map +1 -1
  71. package/lib/esm/store/WorkflowsApi.js +258 -236
  72. package/lib/esm/store/WorkflowsApi.js.map +1 -1
  73. package/lib/esm/store/client.js +2 -0
  74. package/lib/esm/store/client.js.map +1 -1
  75. package/lib/tsconfig.tsbuildinfo +1 -1
  76. package/lib/types/AnalyticsApi.d.ts +1 -1
  77. package/lib/types/AnalyticsApi.d.ts.map +1 -1
  78. package/lib/types/AppsApi.d.ts +20 -2
  79. package/lib/types/AppsApi.d.ts.map +1 -1
  80. package/lib/types/AuditTrailApi.d.ts.map +1 -1
  81. package/lib/types/GroupsApi.d.ts +6 -0
  82. package/lib/types/GroupsApi.d.ts.map +1 -1
  83. package/lib/types/InteractionsApi.d.ts +2 -0
  84. package/lib/types/InteractionsApi.d.ts.map +1 -1
  85. package/lib/types/OAuthClientsApi.d.ts +12 -0
  86. package/lib/types/OAuthClientsApi.d.ts.map +1 -0
  87. package/lib/types/OAuthGrantsApi.d.ts +11 -0
  88. package/lib/types/OAuthGrantsApi.d.ts.map +1 -0
  89. package/lib/types/OAuthProvidersApi.d.ts +22 -0
  90. package/lib/types/OAuthProvidersApi.d.ts.map +1 -0
  91. package/lib/types/OAuthServerApi.d.ts +10 -0
  92. package/lib/types/OAuthServerApi.d.ts.map +1 -0
  93. package/lib/types/RemoteMcpConnectionsApi.d.ts +13 -0
  94. package/lib/types/RemoteMcpConnectionsApi.d.ts.map +1 -0
  95. package/lib/types/RunsApi.d.ts +4 -16
  96. package/lib/types/RunsApi.d.ts.map +1 -1
  97. package/lib/types/client.d.ts +15 -9
  98. package/lib/types/client.d.ts.map +1 -1
  99. package/lib/types/index.d.ts +5 -0
  100. package/lib/types/index.d.ts.map +1 -1
  101. package/lib/types/store/AgentsApi.d.ts +27 -47
  102. package/lib/types/store/AgentsApi.d.ts.map +1 -1
  103. package/lib/types/store/CostApi.d.ts +35 -0
  104. package/lib/types/store/CostApi.d.ts.map +1 -0
  105. package/lib/types/store/IndexingApi.d.ts +48 -23
  106. package/lib/types/store/IndexingApi.d.ts.map +1 -1
  107. package/lib/types/store/ObjectsApi.d.ts +7 -2
  108. package/lib/types/store/ObjectsApi.d.ts.map +1 -1
  109. package/lib/types/store/WorkflowsApi.d.ts +84 -34
  110. package/lib/types/store/WorkflowsApi.d.ts.map +1 -1
  111. package/lib/types/store/client.d.ts +2 -0
  112. package/lib/types/store/client.d.ts.map +1 -1
  113. package/lib/vertesia-client.js +1 -1
  114. package/lib/vertesia-client.js.map +1 -1
  115. package/package.json +8 -8
  116. package/src/AnalyticsApi.ts +2 -1
  117. package/src/AppsApi.ts +26 -3
  118. package/src/AuditTrailApi.ts +3 -1
  119. package/src/GroupsApi.ts +9 -0
  120. package/src/InteractionsApi.ts +6 -1
  121. package/src/OAuthClientsApi.ts +33 -0
  122. package/src/OAuthGrantsApi.ts +42 -0
  123. package/src/OAuthProvidersApi.ts +59 -0
  124. package/src/OAuthServerApi.ts +30 -0
  125. package/src/RemoteMcpConnectionsApi.ts +53 -0
  126. package/src/RunsApi.ts +6 -13
  127. package/src/client.test.ts +9 -11
  128. package/src/client.ts +83 -55
  129. package/src/index.ts +5 -0
  130. package/src/store/AgentsApi.ts +62 -43
  131. package/src/store/CostApi.ts +67 -0
  132. package/src/store/IndexingApi.ts +124 -35
  133. package/src/store/ObjectsApi.ts +7 -3
  134. package/src/store/WorkflowsApi.ts +327 -252
  135. package/src/store/client.ts +2 -0
  136. package/lib/cjs/MCPOAuthApi.js +0 -69
  137. package/lib/cjs/MCPOAuthApi.js.map +0 -1
  138. package/lib/cjs/OAuthAppsApi.js +0 -72
  139. package/lib/cjs/OAuthAppsApi.js.map +0 -1
  140. package/lib/esm/MCPOAuthApi.js +0 -66
  141. package/lib/esm/MCPOAuthApi.js.map +0 -1
  142. package/lib/esm/OAuthAppsApi.js +0 -69
  143. package/lib/esm/OAuthAppsApi.js.map +0 -1
  144. package/lib/types/MCPOAuthApi.d.ts +0 -50
  145. package/lib/types/MCPOAuthApi.d.ts.map +0 -1
  146. package/lib/types/OAuthAppsApi.d.ts +0 -51
  147. package/lib/types/OAuthAppsApi.d.ts.map +0 -1
  148. package/src/MCPOAuthApi.ts +0 -74
  149. package/src/OAuthAppsApi.ts +0 -87
@@ -2,6 +2,7 @@ import { AbstractFetchClient, RequestError } from "@vertesia/api-fetch-client";
2
2
  import { BulkOperationPayload, BulkOperationResult } from "@vertesia/common";
3
3
  import { AgentsApi } from "./AgentsApi.js";
4
4
  import { CollectionsApi } from "./CollectionsApi.js";
5
+ import { CostApi } from "./CostApi.js";
5
6
  import { CommandsApi } from "./CommandsApi.js";
6
7
  import { DataApi } from "./DataApi.js";
7
8
  import { EmailApi } from "./EmailApi.js";
@@ -85,6 +86,7 @@ export class ZenoClient extends AbstractFetchClient<ZenoClient> {
85
86
  }
86
87
 
87
88
  agents = new AgentsApi(this);
89
+ cost = new CostApi(this);
88
90
  objects = new ObjectsApi(this);
89
91
  types = new TypesApi(this);
90
92
  workflows = new WorkflowsApi(this);
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
4
- class MCPOAuthApi extends api_fetch_client_1.ApiTopic {
5
- constructor(parent) {
6
- super(parent, "/api/v1/mcp/oauth");
7
- }
8
- /**
9
- * Get OAuth authentication status for all collections in an app installation
10
- * @param appInstallId - The app installation ID
11
- * @returns Array of OAuth authentication statuses
12
- */
13
- getStatus(appInstallId) {
14
- return this.get(`/status/${appInstallId}`);
15
- }
16
- /**
17
- * Get OAuth authentication status for a specific collection
18
- * @param appInstallId - The app installation ID
19
- * @param collectionName - The collection name
20
- * @returns OAuth authentication status for the collection
21
- */
22
- getCollectionStatus(appInstallId, collectionName) {
23
- return this.get(`/status/${appInstallId}/${collectionName}`);
24
- }
25
- /**
26
- * Get OAuth metadata for a specific collection
27
- * @param appInstallId - The app installation ID
28
- * @param collectionName - The collection name
29
- * @returns OAuth metadata
30
- */
31
- getMetadata(appInstallId, collectionName) {
32
- return this.get(`/metadata/${appInstallId}/${collectionName}`);
33
- }
34
- /**
35
- * Initiate OAuth authorization flow for a specific collection
36
- * @param appInstallId - The app installation ID
37
- * @param collectionName - The collection name
38
- * @returns Authorization URL to open for user authentication
39
- */
40
- authorize(appInstallId, collectionName) {
41
- return this.get(`/authorize/${appInstallId}/${collectionName}`);
42
- }
43
- /**
44
- * Disconnect OAuth authentication for a specific collection
45
- * @param appInstallId - The app installation ID
46
- * @param collectionName - The collection name
47
- */
48
- disconnect(appInstallId, collectionName) {
49
- return this.del(`/disconnect/${appInstallId}/${collectionName}`);
50
- }
51
- /**
52
- * Get or refresh OAuth token (internal use by workflows).
53
- * When oauthAppName is provided, uses the generic OAuth Application flow
54
- * (resolves by name in the caller's project).
55
- * Otherwise falls back to legacy MCP server URL-based token retrieval.
56
- * @param mcpServerUrl - The MCP server URL
57
- * @param oauthAppName - Optional OAuth Application name (from collection's oauth_app field)
58
- * @returns Access token
59
- */
60
- getToken(mcpServerUrl, oauthAppName) {
61
- return this.post('/token', {
62
- payload: oauthAppName
63
- ? { oauth_app_name: oauthAppName }
64
- : { mcp_server_url: mcpServerUrl }
65
- });
66
- }
67
- }
68
- exports.default = MCPOAuthApi;
69
- //# sourceMappingURL=MCPOAuthApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MCPOAuthApi.js","sourceRoot":"","sources":["../../src/MCPOAuthApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AAGlE,MAAqB,WAAY,SAAQ,2BAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,YAAoB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,YAAoB,EAAE,cAAsB;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,YAAoB,EAAE,cAAsB;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,YAAoB,EAAE,cAAsB;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,YAAoB,EAAE,cAAsB;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAoB,EAAE,YAAqB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACvB,OAAO,EAAE,YAAY;gBACjB,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE;gBAClC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE;SACzC,CAAC,CAAC;IACP,CAAC;CACJ;AAtED,8BAsEC"}
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const api_fetch_client_1 = require("@vertesia/api-fetch-client");
4
- class OAuthAppsApi extends api_fetch_client_1.ApiTopic {
5
- constructor(parent) {
6
- super(parent, '/api/v1/oauth-apps');
7
- }
8
- /**
9
- * List all OAuth applications in the current project.
10
- */
11
- list() {
12
- return this.get('/');
13
- }
14
- /**
15
- * Get a single OAuth application by ID (secret redacted).
16
- */
17
- retrieve(id) {
18
- return this.get(`/${id}`);
19
- }
20
- /**
21
- * Create a new OAuth application.
22
- */
23
- create(payload) {
24
- return this.post('/', { payload });
25
- }
26
- /**
27
- * Update an OAuth application.
28
- */
29
- update(id, payload) {
30
- return this.put(`/${id}`, { payload });
31
- }
32
- /**
33
- * Delete an OAuth application.
34
- */
35
- remove(id) {
36
- return this.del(`/${id}`);
37
- }
38
- /**
39
- * Initiate OAuth 2.0 authorization flow for the current user.
40
- * Returns an authorization URL to open in a popup/browser.
41
- */
42
- authorize(id) {
43
- return this.get(`/${id}/authorize`);
44
- }
45
- /**
46
- * Exchange an authorization code for tokens (called by UI callback).
47
- */
48
- exchange(code, state) {
49
- return this.post('/exchange', { payload: { code, state } });
50
- }
51
- /**
52
- * Check the current user's authentication status for an OAuth application.
53
- */
54
- getStatus(id) {
55
- return this.get(`/${id}/status`);
56
- }
57
- /**
58
- * Get a valid access token for an OAuth application (auto-refreshes).
59
- * Primarily used by workflows/activities.
60
- */
61
- getToken(id) {
62
- return this.post(`/${id}/token`, { payload: {} });
63
- }
64
- /**
65
- * Delete the current user's tokens for an OAuth application.
66
- */
67
- disconnect(id) {
68
- return this.del(`/${id}/disconnect`);
69
- }
70
- }
71
- exports.default = OAuthAppsApi;
72
- //# sourceMappingURL=OAuthAppsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OAuthAppsApi.js","sourceRoot":"","sources":["../../src/OAuthAppsApi.ts"],"names":[],"mappings":";;AAAA,iEAAkE;AASlE,MAAqB,YAAa,SAAQ,2BAAQ;IAE9C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAsC;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAsC;QACrD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAAY,EAAE,KAAa;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACzC,CAAC;CACJ;AA7ED,+BA6EC"}
@@ -1,66 +0,0 @@
1
- import { ApiTopic } from "@vertesia/api-fetch-client";
2
- export default class MCPOAuthApi extends ApiTopic {
3
- constructor(parent) {
4
- super(parent, "/api/v1/mcp/oauth");
5
- }
6
- /**
7
- * Get OAuth authentication status for all collections in an app installation
8
- * @param appInstallId - The app installation ID
9
- * @returns Array of OAuth authentication statuses
10
- */
11
- getStatus(appInstallId) {
12
- return this.get(`/status/${appInstallId}`);
13
- }
14
- /**
15
- * Get OAuth authentication status for a specific collection
16
- * @param appInstallId - The app installation ID
17
- * @param collectionName - The collection name
18
- * @returns OAuth authentication status for the collection
19
- */
20
- getCollectionStatus(appInstallId, collectionName) {
21
- return this.get(`/status/${appInstallId}/${collectionName}`);
22
- }
23
- /**
24
- * Get OAuth metadata for a specific collection
25
- * @param appInstallId - The app installation ID
26
- * @param collectionName - The collection name
27
- * @returns OAuth metadata
28
- */
29
- getMetadata(appInstallId, collectionName) {
30
- return this.get(`/metadata/${appInstallId}/${collectionName}`);
31
- }
32
- /**
33
- * Initiate OAuth authorization flow for a specific collection
34
- * @param appInstallId - The app installation ID
35
- * @param collectionName - The collection name
36
- * @returns Authorization URL to open for user authentication
37
- */
38
- authorize(appInstallId, collectionName) {
39
- return this.get(`/authorize/${appInstallId}/${collectionName}`);
40
- }
41
- /**
42
- * Disconnect OAuth authentication for a specific collection
43
- * @param appInstallId - The app installation ID
44
- * @param collectionName - The collection name
45
- */
46
- disconnect(appInstallId, collectionName) {
47
- return this.del(`/disconnect/${appInstallId}/${collectionName}`);
48
- }
49
- /**
50
- * Get or refresh OAuth token (internal use by workflows).
51
- * When oauthAppName is provided, uses the generic OAuth Application flow
52
- * (resolves by name in the caller's project).
53
- * Otherwise falls back to legacy MCP server URL-based token retrieval.
54
- * @param mcpServerUrl - The MCP server URL
55
- * @param oauthAppName - Optional OAuth Application name (from collection's oauth_app field)
56
- * @returns Access token
57
- */
58
- getToken(mcpServerUrl, oauthAppName) {
59
- return this.post('/token', {
60
- payload: oauthAppName
61
- ? { oauth_app_name: oauthAppName }
62
- : { mcp_server_url: mcpServerUrl }
63
- });
64
- }
65
- }
66
- //# sourceMappingURL=MCPOAuthApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MCPOAuthApi.js","sourceRoot":"","sources":["../../src/MCPOAuthApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AAGlE,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;IAE7C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACtC,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,YAAoB;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,YAAY,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,YAAoB,EAAE,cAAsB;QAC5D,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,YAAoB,EAAE,cAAsB;QACpD,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,YAAoB,EAAE,cAAsB;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACH,UAAU,CAAC,YAAoB,EAAE,cAAsB;QACnD,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,YAAY,IAAI,cAAc,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAoB,EAAE,YAAqB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YACvB,OAAO,EAAE,YAAY;gBACjB,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE;gBAClC,CAAC,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE;SACzC,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -1,69 +0,0 @@
1
- import { ApiTopic } from '@vertesia/api-fetch-client';
2
- export default class OAuthAppsApi extends ApiTopic {
3
- constructor(parent) {
4
- super(parent, '/api/v1/oauth-apps');
5
- }
6
- /**
7
- * List all OAuth applications in the current project.
8
- */
9
- list() {
10
- return this.get('/');
11
- }
12
- /**
13
- * Get a single OAuth application by ID (secret redacted).
14
- */
15
- retrieve(id) {
16
- return this.get(`/${id}`);
17
- }
18
- /**
19
- * Create a new OAuth application.
20
- */
21
- create(payload) {
22
- return this.post('/', { payload });
23
- }
24
- /**
25
- * Update an OAuth application.
26
- */
27
- update(id, payload) {
28
- return this.put(`/${id}`, { payload });
29
- }
30
- /**
31
- * Delete an OAuth application.
32
- */
33
- remove(id) {
34
- return this.del(`/${id}`);
35
- }
36
- /**
37
- * Initiate OAuth 2.0 authorization flow for the current user.
38
- * Returns an authorization URL to open in a popup/browser.
39
- */
40
- authorize(id) {
41
- return this.get(`/${id}/authorize`);
42
- }
43
- /**
44
- * Exchange an authorization code for tokens (called by UI callback).
45
- */
46
- exchange(code, state) {
47
- return this.post('/exchange', { payload: { code, state } });
48
- }
49
- /**
50
- * Check the current user's authentication status for an OAuth application.
51
- */
52
- getStatus(id) {
53
- return this.get(`/${id}/status`);
54
- }
55
- /**
56
- * Get a valid access token for an OAuth application (auto-refreshes).
57
- * Primarily used by workflows/activities.
58
- */
59
- getToken(id) {
60
- return this.post(`/${id}/token`, { payload: {} });
61
- }
62
- /**
63
- * Delete the current user's tokens for an OAuth application.
64
- */
65
- disconnect(id) {
66
- return this.del(`/${id}/disconnect`);
67
- }
68
- }
69
- //# sourceMappingURL=OAuthAppsApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OAuthAppsApi.js","sourceRoot":"","sources":["../../src/OAuthAppsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAc,MAAM,4BAA4B,CAAC;AASlE,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,QAAQ;IAE9C,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI;QACA,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAsC;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAsC;QACrD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,IAAY,EAAE,KAAa;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACrC,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,EAAU;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,EAAU;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IACzC,CAAC;CACJ"}
@@ -1,50 +0,0 @@
1
- import { ApiTopic, ClientBase } from "@vertesia/api-fetch-client";
2
- import type { OAuthAuthStatus, OAuthAuthorizeResponse, OAuthMetadataResponse } from "@vertesia/common";
3
- export default class MCPOAuthApi extends ApiTopic {
4
- constructor(parent: ClientBase);
5
- /**
6
- * Get OAuth authentication status for all collections in an app installation
7
- * @param appInstallId - The app installation ID
8
- * @returns Array of OAuth authentication statuses
9
- */
10
- getStatus(appInstallId: string): Promise<OAuthAuthStatus[]>;
11
- /**
12
- * Get OAuth authentication status for a specific collection
13
- * @param appInstallId - The app installation ID
14
- * @param collectionName - The collection name
15
- * @returns OAuth authentication status for the collection
16
- */
17
- getCollectionStatus(appInstallId: string, collectionName: string): Promise<OAuthAuthStatus>;
18
- /**
19
- * Get OAuth metadata for a specific collection
20
- * @param appInstallId - The app installation ID
21
- * @param collectionName - The collection name
22
- * @returns OAuth metadata
23
- */
24
- getMetadata(appInstallId: string, collectionName: string): Promise<OAuthMetadataResponse>;
25
- /**
26
- * Initiate OAuth authorization flow for a specific collection
27
- * @param appInstallId - The app installation ID
28
- * @param collectionName - The collection name
29
- * @returns Authorization URL to open for user authentication
30
- */
31
- authorize(appInstallId: string, collectionName: string): Promise<OAuthAuthorizeResponse>;
32
- /**
33
- * Disconnect OAuth authentication for a specific collection
34
- * @param appInstallId - The app installation ID
35
- * @param collectionName - The collection name
36
- */
37
- disconnect(appInstallId: string, collectionName: string): Promise<void>;
38
- /**
39
- * Get or refresh OAuth token (internal use by workflows).
40
- * When oauthAppName is provided, uses the generic OAuth Application flow
41
- * (resolves by name in the caller's project).
42
- * Otherwise falls back to legacy MCP server URL-based token retrieval.
43
- * @param mcpServerUrl - The MCP server URL
44
- * @param oauthAppName - Optional OAuth Application name (from collection's oauth_app field)
45
- * @returns Access token
46
- */
47
- getToken(mcpServerUrl: string, oauthAppName?: string): Promise<{
48
- access_token: string;
49
- }>;
50
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"MCPOAuthApi.d.ts","sourceRoot":"","sources":["../../src/MCPOAuthApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEvG,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,QAAQ;gBAEjC,MAAM,EAAE,UAAU;IAI9B;;;;OAIG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAI3D;;;;;OAKG;IACH,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAI3F;;;;;OAKG;IACH,WAAW,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIzF;;;;;OAKG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIxF;;;;OAIG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIvE;;;;;;;;OAQG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;CAO3F"}
@@ -1,51 +0,0 @@
1
- import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
2
- import type { CreateOAuthApplicationPayload, OAuthAppAuthStatus, OAuthAppAuthorizeResponse, OAuthApplication, UpdateOAuthApplicationPayload } from '@vertesia/common';
3
- export default class OAuthAppsApi extends ApiTopic {
4
- constructor(parent: ClientBase);
5
- /**
6
- * List all OAuth applications in the current project.
7
- */
8
- list(): Promise<OAuthApplication[]>;
9
- /**
10
- * Get a single OAuth application by ID (secret redacted).
11
- */
12
- retrieve(id: string): Promise<OAuthApplication>;
13
- /**
14
- * Create a new OAuth application.
15
- */
16
- create(payload: CreateOAuthApplicationPayload): Promise<OAuthApplication>;
17
- /**
18
- * Update an OAuth application.
19
- */
20
- update(id: string, payload: UpdateOAuthApplicationPayload): Promise<OAuthApplication>;
21
- /**
22
- * Delete an OAuth application.
23
- */
24
- remove(id: string): Promise<void>;
25
- /**
26
- * Initiate OAuth 2.0 authorization flow for the current user.
27
- * Returns an authorization URL to open in a popup/browser.
28
- */
29
- authorize(id: string): Promise<OAuthAppAuthorizeResponse>;
30
- /**
31
- * Exchange an authorization code for tokens (called by UI callback).
32
- */
33
- exchange(code: string, state: string): Promise<{
34
- success: boolean;
35
- }>;
36
- /**
37
- * Check the current user's authentication status for an OAuth application.
38
- */
39
- getStatus(id: string): Promise<OAuthAppAuthStatus>;
40
- /**
41
- * Get a valid access token for an OAuth application (auto-refreshes).
42
- * Primarily used by workflows/activities.
43
- */
44
- getToken(id: string): Promise<{
45
- access_token: string;
46
- }>;
47
- /**
48
- * Delete the current user's tokens for an OAuth application.
49
- */
50
- disconnect(id: string): Promise<void>;
51
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"OAuthAppsApi.d.ts","sourceRoot":"","sources":["../../src/OAuthAppsApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EACR,6BAA6B,EAC7B,kBAAkB,EAClB,yBAAyB,EACzB,gBAAgB,EAChB,6BAA6B,EAChC,MAAM,kBAAkB,CAAC;AAE1B,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,QAAQ;gBAElC,MAAM,EAAE,UAAU;IAI9B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAInC;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI/C;;OAEG;IACH,MAAM,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIzE;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIrF;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC;;;OAGG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIzD;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIpE;;OAEG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlD;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IAIvD;;OAEG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxC"}
@@ -1,74 +0,0 @@
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 a specific collection
51
- * @param appInstallId - The app installation ID
52
- * @param collectionName - The collection name
53
- */
54
- disconnect(appInstallId: string, collectionName: string): Promise<void> {
55
- return this.del(`/disconnect/${appInstallId}/${collectionName}`);
56
- }
57
-
58
- /**
59
- * Get or refresh OAuth token (internal use by workflows).
60
- * When oauthAppName is provided, uses the generic OAuth Application flow
61
- * (resolves by name in the caller's project).
62
- * Otherwise falls back to legacy MCP server URL-based token retrieval.
63
- * @param mcpServerUrl - The MCP server URL
64
- * @param oauthAppName - Optional OAuth Application name (from collection's oauth_app field)
65
- * @returns Access token
66
- */
67
- getToken(mcpServerUrl: string, oauthAppName?: string): Promise<{ access_token: string }> {
68
- return this.post('/token', {
69
- payload: oauthAppName
70
- ? { oauth_app_name: oauthAppName }
71
- : { mcp_server_url: mcpServerUrl }
72
- });
73
- }
74
- }
@@ -1,87 +0,0 @@
1
- import { ApiTopic, ClientBase } from '@vertesia/api-fetch-client';
2
- import type {
3
- CreateOAuthApplicationPayload,
4
- OAuthAppAuthStatus,
5
- OAuthAppAuthorizeResponse,
6
- OAuthApplication,
7
- UpdateOAuthApplicationPayload,
8
- } from '@vertesia/common';
9
-
10
- export default class OAuthAppsApi extends ApiTopic {
11
-
12
- constructor(parent: ClientBase) {
13
- super(parent, '/api/v1/oauth-apps');
14
- }
15
-
16
- /**
17
- * List all OAuth applications in the current project.
18
- */
19
- list(): Promise<OAuthApplication[]> {
20
- return this.get('/');
21
- }
22
-
23
- /**
24
- * Get a single OAuth application by ID (secret redacted).
25
- */
26
- retrieve(id: string): Promise<OAuthApplication> {
27
- return this.get(`/${id}`);
28
- }
29
-
30
- /**
31
- * Create a new OAuth application.
32
- */
33
- create(payload: CreateOAuthApplicationPayload): Promise<OAuthApplication> {
34
- return this.post('/', { payload });
35
- }
36
-
37
- /**
38
- * Update an OAuth application.
39
- */
40
- update(id: string, payload: UpdateOAuthApplicationPayload): Promise<OAuthApplication> {
41
- return this.put(`/${id}`, { payload });
42
- }
43
-
44
- /**
45
- * Delete an OAuth application.
46
- */
47
- remove(id: string): Promise<void> {
48
- return this.del(`/${id}`);
49
- }
50
-
51
- /**
52
- * Initiate OAuth 2.0 authorization flow for the current user.
53
- * Returns an authorization URL to open in a popup/browser.
54
- */
55
- authorize(id: string): Promise<OAuthAppAuthorizeResponse> {
56
- return this.get(`/${id}/authorize`);
57
- }
58
-
59
- /**
60
- * Exchange an authorization code for tokens (called by UI callback).
61
- */
62
- exchange(code: string, state: string): Promise<{ success: boolean }> {
63
- return this.post('/exchange', { payload: { code, state } });
64
- }
65
-
66
- /**
67
- * Check the current user's authentication status for an OAuth application.
68
- */
69
- getStatus(id: string): Promise<OAuthAppAuthStatus> {
70
- return this.get(`/${id}/status`);
71
- }
72
-
73
- /**
74
- * Get a valid access token for an OAuth application (auto-refreshes).
75
- * Primarily used by workflows/activities.
76
- */
77
- getToken(id: string): Promise<{ access_token: string }> {
78
- return this.post(`/${id}/token`, { payload: {} });
79
- }
80
-
81
- /**
82
- * Delete the current user's tokens for an OAuth application.
83
- */
84
- disconnect(id: string): Promise<void> {
85
- return this.del(`/${id}/disconnect`);
86
- }
87
- }