@composio/client 0.1.0-alpha.15 → 0.1.0-alpha.17
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 +48 -0
- package/README.md +12 -24
- package/client.d.mts +5 -5
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -5
- package/client.d.ts.map +1 -1
- package/client.js +3 -3
- package/client.js.map +1 -1
- package/client.mjs +3 -3
- package/client.mjs.map +1 -1
- package/internal/detect-platform.js +3 -3
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +3 -3
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/shim-types.d.mts +11 -22
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +11 -22
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +2 -2
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts +2 -2
- package/internal/shims.d.ts.map +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/package.json +1 -4
- package/resources/auth-configs.d.mts +3 -3
- package/resources/auth-configs.d.mts.map +1 -1
- package/resources/auth-configs.d.ts +3 -3
- package/resources/auth-configs.d.ts.map +1 -1
- package/resources/connected-accounts.d.mts +5262 -52
- package/resources/connected-accounts.d.mts.map +1 -1
- package/resources/connected-accounts.d.ts +5262 -52
- package/resources/connected-accounts.d.ts.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp/index.d.mts +1 -1
- package/resources/mcp/index.d.mts.map +1 -1
- package/resources/mcp/index.d.ts +1 -1
- package/resources/mcp/index.d.ts.map +1 -1
- package/resources/mcp/index.js.map +1 -1
- package/resources/mcp/index.mjs.map +1 -1
- package/resources/mcp/mcp.d.mts +99 -1
- package/resources/mcp/mcp.d.mts.map +1 -1
- package/resources/mcp/mcp.d.ts +99 -1
- package/resources/mcp/mcp.d.ts.map +1 -1
- package/resources/mcp/mcp.js +22 -0
- package/resources/mcp/mcp.js.map +1 -1
- package/resources/mcp/mcp.mjs +22 -0
- package/resources/mcp/mcp.mjs.map +1 -1
- package/resources/org/project/api-keys.d.mts +0 -15
- package/resources/org/project/api-keys.d.mts.map +1 -1
- package/resources/org/project/api-keys.d.ts +0 -15
- package/resources/org/project/api-keys.d.ts.map +1 -1
- package/resources/org/project/trigger.d.mts +3 -5
- package/resources/org/project/trigger.d.mts.map +1 -1
- package/resources/org/project/trigger.d.ts +3 -5
- package/resources/org/project/trigger.d.ts.map +1 -1
- package/resources/org/project/trigger.js +3 -5
- package/resources/org/project/trigger.js.map +1 -1
- package/resources/org/project/trigger.mjs +3 -5
- package/resources/org/project/trigger.mjs.map +1 -1
- package/resources/toolkits.d.mts +15 -0
- package/resources/toolkits.d.mts.map +1 -1
- package/resources/toolkits.d.ts +15 -0
- package/resources/toolkits.d.ts.map +1 -1
- package/resources/tools.d.mts +38 -10
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +38 -10
- package/resources/tools.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.mts +9 -46
- package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.ts +9 -46
- package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.js.map +1 -1
- package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
- package/resources/triggers-types.d.mts +4 -0
- package/resources/triggers-types.d.mts.map +1 -1
- package/resources/triggers-types.d.ts +4 -0
- package/resources/triggers-types.d.ts.map +1 -1
- package/resources/v3/admin.d.mts +100 -0
- package/resources/v3/admin.d.mts.map +1 -0
- package/resources/v3/admin.d.ts +100 -0
- package/resources/v3/admin.d.ts.map +1 -0
- package/resources/v3/admin.js +54 -0
- package/resources/v3/admin.js.map +1 -0
- package/resources/v3/admin.mjs +50 -0
- package/resources/v3/admin.mjs.map +1 -0
- package/resources/v3/auth/auth.d.mts +10 -0
- package/resources/v3/auth/auth.d.mts.map +1 -0
- package/resources/v3/auth/auth.d.ts +10 -0
- package/resources/v3/auth/auth.d.ts.map +1 -0
- package/resources/{auth → v3/auth}/auth.js +2 -2
- package/resources/v3/auth/auth.js.map +1 -0
- package/resources/{auth → v3/auth}/auth.mjs +1 -1
- package/resources/v3/auth/auth.mjs.map +1 -0
- package/resources/v3/auth/index.d.mts +3 -0
- package/resources/v3/auth/index.d.mts.map +1 -0
- package/resources/v3/auth/index.d.ts +3 -0
- package/resources/v3/auth/index.d.ts.map +1 -0
- package/resources/v3/auth/index.js.map +1 -0
- package/resources/v3/auth/index.mjs.map +1 -0
- package/resources/{auth → v3/auth}/session.d.mts +16 -10
- package/resources/v3/auth/session.d.mts.map +1 -0
- package/resources/{auth → v3/auth}/session.d.ts +16 -10
- package/resources/v3/auth/session.d.ts.map +1 -0
- package/resources/{auth → v3/auth}/session.js +8 -2
- package/resources/v3/auth/session.js.map +1 -0
- package/resources/{auth → v3/auth}/session.mjs +8 -2
- package/resources/v3/auth/session.mjs.map +1 -0
- package/resources/{auth.d.mts.map → v3/auth.d.mts.map} +1 -1
- package/resources/v3/auth.d.ts.map +1 -0
- package/resources/{auth.js → v3/auth.js} +1 -1
- package/resources/v3/auth.js.map +1 -0
- package/resources/v3/auth.mjs.map +1 -0
- package/resources/v3/cli.d.mts +167 -0
- package/resources/v3/cli.d.mts.map +1 -0
- package/resources/v3/cli.d.ts +167 -0
- package/resources/v3/cli.d.ts.map +1 -0
- package/resources/v3/cli.js +55 -0
- package/resources/v3/cli.js.map +1 -0
- package/resources/v3/cli.mjs +51 -0
- package/resources/v3/cli.mjs.map +1 -0
- package/resources/v3/index.d.mts +6 -0
- package/resources/v3/index.d.mts.map +1 -0
- package/resources/v3/index.d.ts +6 -0
- package/resources/v3/index.d.ts.map +1 -0
- package/resources/v3/index.js +15 -0
- package/resources/v3/index.js.map +1 -0
- package/resources/v3/index.mjs +7 -0
- package/resources/v3/index.mjs.map +1 -0
- package/resources/v3/internal/action-execution.d.mts +153 -0
- package/resources/v3/internal/action-execution.d.mts.map +1 -0
- package/resources/v3/internal/action-execution.d.ts +153 -0
- package/resources/v3/internal/action-execution.d.ts.map +1 -0
- package/resources/v3/internal/action-execution.js +38 -0
- package/resources/v3/internal/action-execution.js.map +1 -0
- package/resources/v3/internal/action-execution.mjs +34 -0
- package/resources/v3/internal/action-execution.mjs.map +1 -0
- package/resources/v3/internal/index.d.mts +4 -0
- package/resources/v3/internal/index.d.mts.map +1 -0
- package/resources/v3/internal/index.d.ts +4 -0
- package/resources/v3/internal/index.d.ts.map +1 -0
- package/resources/v3/internal/index.js +11 -0
- package/resources/v3/internal/index.js.map +1 -0
- package/resources/v3/internal/index.mjs +5 -0
- package/resources/v3/internal/index.mjs.map +1 -0
- package/resources/v3/internal/internal.d.mts +14 -0
- package/resources/v3/internal/internal.d.mts.map +1 -0
- package/resources/v3/internal/internal.d.ts +14 -0
- package/resources/v3/internal/internal.d.ts.map +1 -0
- package/resources/v3/internal/internal.js +21 -0
- package/resources/v3/internal/internal.js.map +1 -0
- package/resources/v3/internal/internal.mjs +16 -0
- package/resources/v3/internal/internal.mjs.map +1 -0
- package/resources/v3/internal/trigger.d.mts +84 -0
- package/resources/v3/internal/trigger.d.mts.map +1 -0
- package/resources/v3/internal/trigger.d.ts +84 -0
- package/resources/v3/internal/trigger.d.ts.map +1 -0
- package/resources/v3/internal/trigger.js +23 -0
- package/resources/v3/internal/trigger.js.map +1 -0
- package/resources/v3/internal/trigger.mjs +19 -0
- package/resources/v3/internal/trigger.mjs.map +1 -0
- package/resources/v3/internal.d.mts +2 -0
- package/resources/v3/internal.d.mts.map +1 -0
- package/resources/v3/internal.d.ts +2 -0
- package/resources/v3/internal.d.ts.map +1 -0
- package/resources/v3/internal.js +6 -0
- package/resources/v3/internal.js.map +1 -0
- package/resources/v3/internal.mjs +3 -0
- package/resources/v3/internal.mjs.map +1 -0
- package/resources/v3/v3.d.mts +22 -0
- package/resources/v3/v3.d.mts.map +1 -0
- package/resources/v3/v3.d.ts +22 -0
- package/resources/v3/v3.d.ts.map +1 -0
- package/resources/v3/v3.js +29 -0
- package/resources/v3/v3.js.map +1 -0
- package/resources/v3/v3.mjs +24 -0
- package/resources/v3/v3.mjs.map +1 -0
- package/resources/v3.d.mts +2 -0
- package/resources/v3.d.mts.map +1 -0
- package/resources/v3.d.ts +2 -0
- package/resources/v3.d.ts.map +1 -0
- package/resources/v3.js +6 -0
- package/resources/v3.js.map +1 -0
- package/resources/v3.mjs +3 -0
- package/resources/v3.mjs.map +1 -0
- package/src/client.ts +9 -5
- package/src/internal/detect-platform.ts +3 -3
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +2 -2
- package/src/internal/uploads.ts +1 -1
- package/src/resources/auth-configs.ts +0 -3
- package/src/resources/connected-accounts.ts +10261 -298
- package/src/resources/index.ts +3 -1
- package/src/resources/mcp/index.ts +2 -0
- package/src/resources/mcp/mcp.ts +128 -0
- package/src/resources/org/project/api-keys.ts +0 -18
- package/src/resources/org/project/trigger.ts +7 -6
- package/src/resources/toolkits.ts +20 -0
- package/src/resources/tools.ts +46 -11
- package/src/resources/trigger-instances/trigger-instances.ts +9 -49
- package/src/resources/triggers-types.ts +5 -0
- package/src/resources/v3/admin.ts +141 -0
- package/src/resources/{auth → v3/auth}/auth.ts +3 -3
- package/src/resources/{auth → v3/auth}/index.ts +1 -1
- package/src/resources/{auth → v3/auth}/session.ts +16 -10
- package/src/resources/v3/cli.ts +209 -0
- package/src/resources/v3/index.ts +20 -0
- package/src/resources/v3/internal/action-execution.ts +236 -0
- package/src/resources/v3/internal/index.ts +10 -0
- package/src/resources/v3/internal/internal.ts +35 -0
- package/src/resources/v3/internal/trigger.ts +122 -0
- package/src/resources/v3/internal.ts +3 -0
- package/src/resources/v3/v3.ts +59 -0
- package/src/resources/v3.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/resources/auth/auth.d.mts +0 -10
- package/resources/auth/auth.d.mts.map +0 -1
- package/resources/auth/auth.d.ts +0 -10
- package/resources/auth/auth.d.ts.map +0 -1
- package/resources/auth/auth.js.map +0 -1
- package/resources/auth/auth.mjs.map +0 -1
- package/resources/auth/index.d.mts +0 -3
- package/resources/auth/index.d.mts.map +0 -1
- package/resources/auth/index.d.ts +0 -3
- package/resources/auth/index.d.ts.map +0 -1
- package/resources/auth/index.js.map +0 -1
- package/resources/auth/index.mjs.map +0 -1
- package/resources/auth/session.d.mts.map +0 -1
- package/resources/auth/session.d.ts.map +0 -1
- package/resources/auth/session.js.map +0 -1
- package/resources/auth/session.mjs.map +0 -1
- package/resources/auth.d.ts.map +0 -1
- package/resources/auth.js.map +0 -1
- package/resources/auth.mjs.map +0 -1
- package/src/internal/shim-types.d.ts +0 -28
- /package/resources/{auth → v3/auth}/index.js +0 -0
- /package/resources/{auth → v3/auth}/index.mjs +0 -0
- /package/resources/{auth.d.mts → v3/auth.d.mts} +0 -0
- /package/resources/{auth.d.ts → v3/auth.d.ts} +0 -0
- /package/resources/{auth.mjs → v3/auth.mjs} +0 -0
- /package/src/resources/{auth.ts → v3/auth.ts} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
|
|
8
|
+
export class Admin extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Administrative endpoint that retrieves all active connections for a given
|
|
11
|
+
* toolkit slug. This is primarily used for token refresh operations and system
|
|
12
|
+
* maintenance. Only includes non-deleted connections with OAuth2 or JWT
|
|
13
|
+
* authentication types.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response = await client.v3.admin.listConnections({
|
|
18
|
+
* toolkit_slug: 'google-drive',
|
|
19
|
+
* 'x-composio-admin-token': 'adm_123456789abcdef',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
listConnections(
|
|
24
|
+
params: AdminListConnectionsParams,
|
|
25
|
+
options?: RequestOptions,
|
|
26
|
+
): APIPromise<AdminListConnectionsResponse> {
|
|
27
|
+
const { 'x-composio-admin-token': xComposioAdminToken, ...query } = params;
|
|
28
|
+
return this._client.get('/api/v3/admin/connections', {
|
|
29
|
+
query,
|
|
30
|
+
...options,
|
|
31
|
+
headers: buildHeaders([{ 'x-composio-admin-token': xComposioAdminToken }, options?.headers]),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Administrative endpoint that refreshes authentication tokens for multiple
|
|
37
|
+
* connected accounts in parallel. This is useful for proactive token refresh to
|
|
38
|
+
* prevent authentication failures or for recovering from authentication issues
|
|
39
|
+
* across multiple connections.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const response = await client.v3.admin.refreshAuthTokens({
|
|
44
|
+
* connectionIds: ['conn_123abc', 'conn_456def'],
|
|
45
|
+
* 'x-composio-admin-token': 'adm_123456789abcdef',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
refreshAuthTokens(
|
|
50
|
+
params: AdminRefreshAuthTokensParams,
|
|
51
|
+
options?: RequestOptions,
|
|
52
|
+
): APIPromise<AdminRefreshAuthTokensResponse> {
|
|
53
|
+
const { 'x-composio-admin-token': xComposioAdminToken, ...body } = params;
|
|
54
|
+
return this._client.post('/api/v3/admin/auth-refresh', {
|
|
55
|
+
body,
|
|
56
|
+
...options,
|
|
57
|
+
headers: buildHeaders([{ 'x-composio-admin-token': xComposioAdminToken }, options?.headers]),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface AdminListConnectionsResponse {
|
|
63
|
+
/**
|
|
64
|
+
* Collection of account connection objects, may be empty if no connections exist
|
|
65
|
+
*/
|
|
66
|
+
items: Array<AdminListConnectionsResponse.Item>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export namespace AdminListConnectionsResponse {
|
|
70
|
+
export interface Item {
|
|
71
|
+
/**
|
|
72
|
+
* Identifier that can be used with other API endpoints that operate on connections
|
|
73
|
+
*/
|
|
74
|
+
id: string;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface AdminRefreshAuthTokensResponse {
|
|
79
|
+
/**
|
|
80
|
+
* Array of connections that failed to refresh with detailed error information
|
|
81
|
+
*/
|
|
82
|
+
failures: Array<AdminRefreshAuthTokensResponse.Failure>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* List of connections where token refresh was successful or not needed
|
|
86
|
+
*/
|
|
87
|
+
success: Array<string>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export namespace AdminRefreshAuthTokensResponse {
|
|
91
|
+
export interface Failure {
|
|
92
|
+
/**
|
|
93
|
+
* Connection ID that failed during refresh
|
|
94
|
+
*/
|
|
95
|
+
connectionId: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Specific error code identifying why the refresh operation failed
|
|
99
|
+
*/
|
|
100
|
+
error: string;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface AdminListConnectionsParams {
|
|
105
|
+
/**
|
|
106
|
+
* Query param: The unique identifier slug of the toolkit to filter connections by
|
|
107
|
+
*/
|
|
108
|
+
toolkit_slug: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Header param: Admin authentication token required for administrative operations
|
|
112
|
+
*/
|
|
113
|
+
'x-composio-admin-token': string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface AdminRefreshAuthTokensParams {
|
|
117
|
+
/**
|
|
118
|
+
* Body param: List of connection identifiers that need token refresh
|
|
119
|
+
*/
|
|
120
|
+
connectionIds: Array<string>;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Header param: Admin authentication token required for administrative operations
|
|
124
|
+
*/
|
|
125
|
+
'x-composio-admin-token': string;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Body param: Controls processing speed and system load. Higher values process
|
|
129
|
+
* faster but increase load.
|
|
130
|
+
*/
|
|
131
|
+
parallelism?: number;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export declare namespace Admin {
|
|
135
|
+
export {
|
|
136
|
+
type AdminListConnectionsResponse as AdminListConnectionsResponse,
|
|
137
|
+
type AdminRefreshAuthTokensResponse as AdminRefreshAuthTokensResponse,
|
|
138
|
+
type AdminListConnectionsParams as AdminListConnectionsParams,
|
|
139
|
+
type AdminRefreshAuthTokensParams as AdminRefreshAuthTokensParams,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as SessionAPI from './session';
|
|
5
|
-
import { Session,
|
|
5
|
+
import { Session, SessionRetrieveInfoResponse } from './session';
|
|
6
6
|
|
|
7
7
|
export class Auth extends APIResource {
|
|
8
8
|
session: SessionAPI.Session = new SessionAPI.Session(this._client);
|
|
@@ -11,5 +11,5 @@ export class Auth extends APIResource {
|
|
|
11
11
|
Auth.Session = Session;
|
|
12
12
|
|
|
13
13
|
export declare namespace Auth {
|
|
14
|
-
export { Session as Session, type
|
|
14
|
+
export { Session as Session, type SessionRetrieveInfoResponse as SessionRetrieveInfoResponse };
|
|
15
15
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from '
|
|
4
|
-
import { APIPromise } from '
|
|
5
|
-
import { RequestOptions } from '
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
6
|
|
|
7
7
|
export class Session extends APIResource {
|
|
8
8
|
/**
|
|
@@ -11,8 +11,14 @@ export class Session extends APIResource {
|
|
|
11
11
|
* applicable. This endpoint is useful for verifying authentication status and
|
|
12
12
|
* retrieving contextual information about the authenticated user and their access
|
|
13
13
|
* privileges.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const response =
|
|
18
|
+
* await client.v3.auth.session.retrieveInfo();
|
|
19
|
+
* ```
|
|
14
20
|
*/
|
|
15
|
-
|
|
21
|
+
retrieveInfo(options?: RequestOptions): APIPromise<SessionRetrieveInfoResponse> {
|
|
16
22
|
return this._client.get('/api/v3/auth/session/info', options);
|
|
17
23
|
}
|
|
18
24
|
}
|
|
@@ -20,25 +26,25 @@ export class Session extends APIResource {
|
|
|
20
26
|
/**
|
|
21
27
|
* Response containing user session information
|
|
22
28
|
*/
|
|
23
|
-
export interface
|
|
29
|
+
export interface SessionRetrieveInfoResponse {
|
|
24
30
|
/**
|
|
25
31
|
* Details of the API key used for authentication (null if using session auth)
|
|
26
32
|
*/
|
|
27
|
-
api_key:
|
|
33
|
+
api_key: SessionRetrieveInfoResponse.APIKey | null;
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* Information about the authenticated user
|
|
31
37
|
*/
|
|
32
|
-
org_member:
|
|
38
|
+
org_member: SessionRetrieveInfoResponse.OrgMember;
|
|
33
39
|
|
|
34
40
|
/**
|
|
35
41
|
* Details of the current active project (null if accessing with org-level
|
|
36
42
|
* credentials)
|
|
37
43
|
*/
|
|
38
|
-
project:
|
|
44
|
+
project: SessionRetrieveInfoResponse.Project | null;
|
|
39
45
|
}
|
|
40
46
|
|
|
41
|
-
export namespace
|
|
47
|
+
export namespace SessionRetrieveInfoResponse {
|
|
42
48
|
/**
|
|
43
49
|
* Details of the API key used for authentication (null if using session auth)
|
|
44
50
|
*/
|
|
@@ -288,5 +294,5 @@ export namespace SessionRetrieveResponse {
|
|
|
288
294
|
}
|
|
289
295
|
|
|
290
296
|
export declare namespace Session {
|
|
291
|
-
export { type
|
|
297
|
+
export { type SessionRetrieveInfoResponse as SessionRetrieveInfoResponse };
|
|
292
298
|
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Cli extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Generates a new CLI session with a random 6-character code. This endpoint is the
|
|
10
|
+
* first step in the CLI authentication flow, creating a session that can later be
|
|
11
|
+
* linked to a user account. The generated code is displayed to the user in the CLI
|
|
12
|
+
* and should be entered in the web interface to complete authentication.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response = await client.v3.cli.createSession();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
createSession(options?: RequestOptions): APIPromise<CliCreateSessionResponse> {
|
|
20
|
+
return this._client.post('/api/v3/cli/create-session', options);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Links a pending CLI session to the currently authenticated user. This is the
|
|
25
|
+
* final step in the CLI authentication flow, where the user enters the code in the
|
|
26
|
+
* web interface and their account is associated with the CLI session, allowing the
|
|
27
|
+
* CLI to act on their behalf.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const response = await client.v3.cli.linkSession({
|
|
32
|
+
* id: 'ABC123',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
linkSession(body: CliLinkSessionParams, options?: RequestOptions): APIPromise<CliLinkSessionResponse> {
|
|
37
|
+
return this._client.put('/api/v3/cli/link-session', { body, ...options });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the current state of a CLI session using either the session ID (UUID)
|
|
42
|
+
* or the 6-character code. This endpoint is used by both the CLI client to check
|
|
43
|
+
* if the session has been linked, and by the web interface to display session
|
|
44
|
+
* details before linking.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const response = await client.v3.cli.retrieveSession({
|
|
49
|
+
* id: 'ABC123',
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
retrieveSession(
|
|
54
|
+
query: CliRetrieveSessionParams,
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): APIPromise<CliRetrieveSessionResponse> {
|
|
57
|
+
return this._client.get('/api/v3/cli/get-session', { query, ...options });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface CliCreateSessionResponse {
|
|
62
|
+
/**
|
|
63
|
+
* Unique identifier for the CLI session. UUID v4 format used for tracking and
|
|
64
|
+
* retrieval.
|
|
65
|
+
*/
|
|
66
|
+
id: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The 6-character hexadecimal code used for CLI login
|
|
70
|
+
*/
|
|
71
|
+
code: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The ISO timestamp when the session expires
|
|
75
|
+
*/
|
|
76
|
+
expiresAt: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The current status of the session
|
|
80
|
+
*/
|
|
81
|
+
status: 'pending' | 'linked';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface CliLinkSessionResponse {
|
|
85
|
+
/**
|
|
86
|
+
* The unique identifier for the CLI session
|
|
87
|
+
*/
|
|
88
|
+
id: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Information about the linked account. Always present for successful responses
|
|
92
|
+
* from this endpoint.
|
|
93
|
+
*/
|
|
94
|
+
account: CliLinkSessionResponse.Account;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The 6-character hexadecimal code used for CLI login
|
|
98
|
+
*/
|
|
99
|
+
code: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The ISO timestamp when the session expires
|
|
103
|
+
*/
|
|
104
|
+
expiresAt: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The current status of the session
|
|
108
|
+
*/
|
|
109
|
+
status: 'pending' | 'linked';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export namespace CliLinkSessionResponse {
|
|
113
|
+
/**
|
|
114
|
+
* Information about the linked account. Always present for successful responses
|
|
115
|
+
* from this endpoint.
|
|
116
|
+
*/
|
|
117
|
+
export interface Account {
|
|
118
|
+
/**
|
|
119
|
+
* The ID of the linked account
|
|
120
|
+
*/
|
|
121
|
+
id: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The email address of the linked account
|
|
125
|
+
*/
|
|
126
|
+
email: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The display name of the linked account
|
|
130
|
+
*/
|
|
131
|
+
name: string;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface CliRetrieveSessionResponse {
|
|
136
|
+
/**
|
|
137
|
+
* The unique identifier for the CLI session
|
|
138
|
+
*/
|
|
139
|
+
id: string;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Information about the linked account, if any. Null if the session status is
|
|
143
|
+
* "pending".
|
|
144
|
+
*/
|
|
145
|
+
account: CliRetrieveSessionResponse.Account | null;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The 6-character hexadecimal code used for CLI login
|
|
149
|
+
*/
|
|
150
|
+
code: string;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The ISO timestamp when the session expires
|
|
154
|
+
*/
|
|
155
|
+
expiresAt: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The current status of the session
|
|
159
|
+
*/
|
|
160
|
+
status: 'pending' | 'linked';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export namespace CliRetrieveSessionResponse {
|
|
164
|
+
/**
|
|
165
|
+
* Information about the linked account, if any. Null if the session status is
|
|
166
|
+
* "pending".
|
|
167
|
+
*/
|
|
168
|
+
export interface Account {
|
|
169
|
+
/**
|
|
170
|
+
* The ID of the linked account
|
|
171
|
+
*/
|
|
172
|
+
id: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The email address of the linked account
|
|
176
|
+
*/
|
|
177
|
+
email: string;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The display name of the linked account
|
|
181
|
+
*/
|
|
182
|
+
name: string;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface CliLinkSessionParams {
|
|
187
|
+
/**
|
|
188
|
+
* The CLI session ID or code to link to the current user
|
|
189
|
+
*/
|
|
190
|
+
id: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface CliRetrieveSessionParams {
|
|
194
|
+
/**
|
|
195
|
+
* CLI session ID (UUID format) or 6-character code to check. Both formats are
|
|
196
|
+
* supported for flexibility in client implementations.
|
|
197
|
+
*/
|
|
198
|
+
id: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare namespace Cli {
|
|
202
|
+
export {
|
|
203
|
+
type CliCreateSessionResponse as CliCreateSessionResponse,
|
|
204
|
+
type CliLinkSessionResponse as CliLinkSessionResponse,
|
|
205
|
+
type CliRetrieveSessionResponse as CliRetrieveSessionResponse,
|
|
206
|
+
type CliLinkSessionParams as CliLinkSessionParams,
|
|
207
|
+
type CliRetrieveSessionParams as CliRetrieveSessionParams,
|
|
208
|
+
};
|
|
209
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
Admin,
|
|
5
|
+
type AdminListConnectionsResponse,
|
|
6
|
+
type AdminRefreshAuthTokensResponse,
|
|
7
|
+
type AdminListConnectionsParams,
|
|
8
|
+
type AdminRefreshAuthTokensParams,
|
|
9
|
+
} from './admin';
|
|
10
|
+
export { Auth } from './auth/index';
|
|
11
|
+
export {
|
|
12
|
+
Cli,
|
|
13
|
+
type CliCreateSessionResponse,
|
|
14
|
+
type CliLinkSessionResponse,
|
|
15
|
+
type CliRetrieveSessionResponse,
|
|
16
|
+
type CliLinkSessionParams,
|
|
17
|
+
type CliRetrieveSessionParams,
|
|
18
|
+
} from './cli';
|
|
19
|
+
export { Internal } from './internal/index';
|
|
20
|
+
export { V3 } from './v3';
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class ActionExecution extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get detailed execution log by ID
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response =
|
|
15
|
+
* await client.v3.internal.actionExecution.retrieveLog(
|
|
16
|
+
* 'id',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieveLog(id: string, options?: RequestOptions): APIPromise<ActionExecutionRetrieveLogResponse> {
|
|
21
|
+
return this._client.get(path`/api/v3/internal/action_execution/log/${id}`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Search and retrieve action execution logs
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const response =
|
|
30
|
+
* await client.v3.internal.actionExecution.searchLogs({
|
|
31
|
+
* cursor: 0,
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
searchLogs(
|
|
36
|
+
body: ActionExecutionSearchLogsParams,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<ActionExecutionSearchLogsResponse> {
|
|
39
|
+
return this._client.post('/api/v3/internal/action_execution/logs', { body, ...options });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface ActionExecutionRetrieveLogResponse {
|
|
44
|
+
actionId: string;
|
|
45
|
+
|
|
46
|
+
actionLogId: string;
|
|
47
|
+
|
|
48
|
+
app: ActionExecutionRetrieveLogResponse.App;
|
|
49
|
+
|
|
50
|
+
connection: ActionExecutionRetrieveLogResponse.Connection;
|
|
51
|
+
|
|
52
|
+
endTime: number;
|
|
53
|
+
|
|
54
|
+
error: Record<string, unknown>;
|
|
55
|
+
|
|
56
|
+
executionMetadata: Record<string, unknown>;
|
|
57
|
+
|
|
58
|
+
payloadReceived: Record<string, unknown>;
|
|
59
|
+
|
|
60
|
+
response: Record<string, unknown>;
|
|
61
|
+
|
|
62
|
+
session: Record<string, unknown>;
|
|
63
|
+
|
|
64
|
+
startTime: number;
|
|
65
|
+
|
|
66
|
+
status: 'success' | 'error' | 'warning' | 'info';
|
|
67
|
+
|
|
68
|
+
steps: Array<ActionExecutionRetrieveLogResponse.Step>;
|
|
69
|
+
|
|
70
|
+
totalDuration: string;
|
|
71
|
+
|
|
72
|
+
version: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export namespace ActionExecutionRetrieveLogResponse {
|
|
76
|
+
export interface App {
|
|
77
|
+
icon: string;
|
|
78
|
+
|
|
79
|
+
name: string;
|
|
80
|
+
|
|
81
|
+
uniqueId: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface Connection {
|
|
85
|
+
entity: string;
|
|
86
|
+
|
|
87
|
+
id?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface Step {
|
|
91
|
+
endTime: number;
|
|
92
|
+
|
|
93
|
+
message: string;
|
|
94
|
+
|
|
95
|
+
startTime: number;
|
|
96
|
+
|
|
97
|
+
status: 'success' | 'failure' | 'error';
|
|
98
|
+
|
|
99
|
+
totalDuration: number;
|
|
100
|
+
|
|
101
|
+
type: 'tool_execution' | 'fetch_connection_details';
|
|
102
|
+
|
|
103
|
+
logs?: Array<Step.Log>;
|
|
104
|
+
|
|
105
|
+
metadata?: Step.Metadata;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export namespace Step {
|
|
109
|
+
export interface Log {
|
|
110
|
+
level: string;
|
|
111
|
+
|
|
112
|
+
message: string;
|
|
113
|
+
|
|
114
|
+
request: Log.Request;
|
|
115
|
+
|
|
116
|
+
requestId: string;
|
|
117
|
+
|
|
118
|
+
response: Log.Response;
|
|
119
|
+
|
|
120
|
+
time: number;
|
|
121
|
+
|
|
122
|
+
type: 'network' | 'system';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export namespace Log {
|
|
126
|
+
export interface Request {
|
|
127
|
+
method: string;
|
|
128
|
+
|
|
129
|
+
url: string;
|
|
130
|
+
|
|
131
|
+
headers?: Record<string, string>;
|
|
132
|
+
|
|
133
|
+
json?: Record<string, unknown>;
|
|
134
|
+
|
|
135
|
+
params?: Record<string, unknown>;
|
|
136
|
+
|
|
137
|
+
timeout?: number;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface Response {
|
|
141
|
+
status: number;
|
|
142
|
+
|
|
143
|
+
time: string;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface Metadata {
|
|
148
|
+
encryption?: string;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ActionExecutionSearchLogsResponse {
|
|
154
|
+
data: Array<ActionExecutionSearchLogsResponse.Data>;
|
|
155
|
+
|
|
156
|
+
nextCursor: number | null;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export namespace ActionExecutionSearchLogsResponse {
|
|
160
|
+
export interface Data {
|
|
161
|
+
id: string;
|
|
162
|
+
|
|
163
|
+
actionKey: string;
|
|
164
|
+
|
|
165
|
+
app: Data.App;
|
|
166
|
+
|
|
167
|
+
appKey: string;
|
|
168
|
+
|
|
169
|
+
connectedAccountId: string;
|
|
170
|
+
|
|
171
|
+
createdAt: number;
|
|
172
|
+
|
|
173
|
+
entityId: string;
|
|
174
|
+
|
|
175
|
+
executionTime: number;
|
|
176
|
+
|
|
177
|
+
minimalResponse: string;
|
|
178
|
+
|
|
179
|
+
status: 'success' | 'failed';
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export namespace Data {
|
|
183
|
+
export interface App {
|
|
184
|
+
icon: string;
|
|
185
|
+
|
|
186
|
+
name: string;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface ActionExecutionSearchLogsParams {
|
|
192
|
+
/**
|
|
193
|
+
* cursor_that_can_be_used_to_paginate_through_the_logs
|
|
194
|
+
*/
|
|
195
|
+
cursor: number | null;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* whether_the_search_is_case_sensitive_or_not
|
|
199
|
+
*/
|
|
200
|
+
case_sensitive?: boolean;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* start_time_of_the_logs_in_epoch_time
|
|
204
|
+
*/
|
|
205
|
+
from?: number;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* number_of_logs_to_return
|
|
209
|
+
*/
|
|
210
|
+
limit?: number;
|
|
211
|
+
|
|
212
|
+
search_params?: Array<ActionExecutionSearchLogsParams.SearchParam>;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* end_time_of_the_logs_in_epoch_time
|
|
216
|
+
*/
|
|
217
|
+
to?: number;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export namespace ActionExecutionSearchLogsParams {
|
|
221
|
+
export interface SearchParam {
|
|
222
|
+
field?: string;
|
|
223
|
+
|
|
224
|
+
operation?: string;
|
|
225
|
+
|
|
226
|
+
value?: string;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export declare namespace ActionExecution {
|
|
231
|
+
export {
|
|
232
|
+
type ActionExecutionRetrieveLogResponse as ActionExecutionRetrieveLogResponse,
|
|
233
|
+
type ActionExecutionSearchLogsResponse as ActionExecutionSearchLogsResponse,
|
|
234
|
+
type ActionExecutionSearchLogsParams as ActionExecutionSearchLogsParams,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
ActionExecution,
|
|
5
|
+
type ActionExecutionRetrieveLogResponse,
|
|
6
|
+
type ActionExecutionSearchLogsResponse,
|
|
7
|
+
type ActionExecutionSearchLogsParams,
|
|
8
|
+
} from './action-execution';
|
|
9
|
+
export { Internal } from './internal';
|
|
10
|
+
export { Trigger, type TriggerSearchLogsResponse, type TriggerSearchLogsParams } from './trigger';
|