@composio/client 0.1.0-alpha.10 → 0.1.0-alpha.12
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 +36 -0
- package/README.md +7 -7
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/auth-configs.d.mts +168 -29
- package/resources/auth-configs.d.mts.map +1 -1
- package/resources/auth-configs.d.ts +168 -29
- package/resources/auth-configs.d.ts.map +1 -1
- package/resources/auth-configs.js +50 -4
- package/resources/auth-configs.js.map +1 -1
- package/resources/auth-configs.mjs +50 -4
- package/resources/auth-configs.mjs.map +1 -1
- package/resources/connected-accounts.d.mts +80 -17
- package/resources/connected-accounts.d.mts.map +1 -1
- package/resources/connected-accounts.d.ts +80 -17
- package/resources/connected-accounts.d.ts.map +1 -1
- package/resources/connected-accounts.js +56 -4
- package/resources/connected-accounts.js.map +1 -1
- package/resources/connected-accounts.mjs +56 -4
- package/resources/connected-accounts.mjs.map +1 -1
- package/resources/files.d.mts +72 -23
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +72 -23
- package/resources/files.d.ts.map +1 -1
- package/resources/files.js +20 -2
- package/resources/files.js.map +1 -1
- package/resources/files.mjs +20 -2
- package/resources/files.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/mcp/custom.d.mts +87 -0
- package/resources/mcp/custom.d.mts.map +1 -0
- package/resources/mcp/custom.d.ts +87 -0
- package/resources/mcp/custom.d.ts.map +1 -0
- package/resources/mcp/custom.js +26 -0
- package/resources/mcp/custom.js.map +1 -0
- package/resources/mcp/custom.mjs +22 -0
- package/resources/mcp/custom.mjs.map +1 -0
- package/resources/mcp/index.d.mts +2 -2
- package/resources/mcp/index.d.mts.map +1 -1
- package/resources/mcp/index.d.ts +2 -2
- package/resources/mcp/index.d.ts.map +1 -1
- package/resources/mcp/index.js +3 -3
- package/resources/mcp/index.js.map +1 -1
- package/resources/mcp/index.mjs +1 -1
- package/resources/mcp/index.mjs.map +1 -1
- package/resources/mcp/mcp.d.mts +322 -217
- package/resources/mcp/mcp.d.mts.map +1 -1
- package/resources/mcp/mcp.d.ts +322 -217
- package/resources/mcp/mcp.d.ts.map +1 -1
- package/resources/mcp/mcp.js +72 -25
- package/resources/mcp/mcp.js.map +1 -1
- package/resources/mcp/mcp.mjs +72 -25
- package/resources/mcp/mcp.mjs.map +1 -1
- package/resources/migration.d.mts +11 -2
- package/resources/migration.d.mts.map +1 -1
- package/resources/migration.d.ts +11 -2
- package/resources/migration.d.ts.map +1 -1
- package/resources/migration.js +3 -1
- package/resources/migration.js.map +1 -1
- package/resources/migration.mjs +3 -1
- package/resources/migration.mjs.map +1 -1
- package/resources/org/api-key.d.mts +23 -2
- package/resources/org/api-key.d.mts.map +1 -1
- package/resources/org/api-key.d.ts +23 -2
- package/resources/org/api-key.d.ts.map +1 -1
- package/resources/org/api-key.js +15 -2
- package/resources/org/api-key.js.map +1 -1
- package/resources/org/api-key.mjs +15 -2
- package/resources/org/api-key.mjs.map +1 -1
- package/resources/org/project/api-keys.d.mts +114 -22
- package/resources/org/project/api-keys.d.mts.map +1 -1
- package/resources/org/project/api-keys.d.ts +114 -22
- package/resources/org/project/api-keys.d.ts.map +1 -1
- package/resources/org/project/api-keys.js +57 -0
- package/resources/org/project/api-keys.js.map +1 -1
- package/resources/org/project/api-keys.mjs +57 -0
- package/resources/org/project/api-keys.mjs.map +1 -1
- package/resources/org/project/project.d.mts +176 -4
- package/resources/org/project/project.d.mts.map +1 -1
- package/resources/org/project/project.d.ts +176 -4
- package/resources/org/project/project.d.ts.map +1 -1
- package/resources/org/project/project.js +46 -3
- package/resources/org/project/project.js.map +1 -1
- package/resources/org/project/project.mjs +46 -3
- package/resources/org/project/project.mjs.map +1 -1
- package/resources/org/project/trigger.d.mts +101 -1
- package/resources/org/project/trigger.d.mts.map +1 -1
- package/resources/org/project/trigger.d.ts +101 -1
- package/resources/org/project/trigger.d.ts.map +1 -1
- package/resources/org/project/trigger.js +21 -0
- package/resources/org/project/trigger.js.map +1 -1
- package/resources/org/project/trigger.mjs +21 -0
- package/resources/org/project/trigger.mjs.map +1 -1
- package/resources/org/project/webhook.d.mts +86 -15
- package/resources/org/project/webhook.d.mts.map +1 -1
- package/resources/org/project/webhook.d.ts +86 -15
- package/resources/org/project/webhook.d.ts.map +1 -1
- package/resources/org/project/webhook.js +49 -2
- package/resources/org/project/webhook.js.map +1 -1
- package/resources/org/project/webhook.mjs +49 -2
- package/resources/org/project/webhook.mjs.map +1 -1
- package/resources/team-members.d.mts +7 -7
- package/resources/team-members.d.mts.map +1 -1
- package/resources/team-members.d.ts +7 -7
- package/resources/team-members.d.ts.map +1 -1
- package/resources/toolkits.d.mts +195 -7
- package/resources/toolkits.d.mts.map +1 -1
- package/resources/toolkits.d.ts +195 -7
- package/resources/toolkits.d.ts.map +1 -1
- package/resources/toolkits.js +14 -6
- package/resources/toolkits.js.map +1 -1
- package/resources/toolkits.mjs +14 -6
- package/resources/toolkits.mjs.map +1 -1
- package/resources/tools.d.mts +211 -44
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +211 -44
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +62 -9
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +62 -9
- package/resources/tools.mjs.map +1 -1
- package/resources/trigger-instances/index.d.mts +1 -1
- package/resources/trigger-instances/index.d.mts.map +1 -1
- package/resources/trigger-instances/index.d.ts +1 -1
- package/resources/trigger-instances/index.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.mts +86 -19
- package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.ts +86 -19
- package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.js +6 -6
- package/resources/trigger-instances/trigger-instances.js.map +1 -1
- package/resources/trigger-instances/trigger-instances.mjs +6 -6
- package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
- package/resources/triggers-types.d.mts +96 -2
- package/resources/triggers-types.d.mts.map +1 -1
- package/resources/triggers-types.d.ts +96 -2
- package/resources/triggers-types.d.ts.map +1 -1
- package/resources/triggers-types.js +23 -1
- package/resources/triggers-types.js.map +1 -1
- package/resources/triggers-types.mjs +23 -1
- package/resources/triggers-types.mjs.map +1 -1
- package/src/client.ts +6 -6
- package/src/resources/auth-configs.ts +169 -29
- package/src/resources/connected-accounts.ts +80 -17
- package/src/resources/files.ts +75 -23
- package/src/resources/index.ts +3 -3
- package/src/resources/mcp/custom.ts +103 -0
- package/src/resources/mcp/index.ts +2 -3
- package/src/resources/mcp/mcp.ts +342 -256
- package/src/resources/migration.ts +11 -2
- package/src/resources/org/api-key.ts +23 -2
- package/src/resources/org/project/api-keys.ts +117 -22
- package/src/resources/org/project/project.ts +176 -4
- package/src/resources/org/project/trigger.ts +101 -1
- package/src/resources/org/project/webhook.ts +86 -15
- package/src/resources/team-members.ts +7 -7
- package/src/resources/toolkits.ts +200 -7
- package/src/resources/tools.ts +213 -46
- package/src/resources/trigger-instances/index.ts +1 -1
- package/src/resources/trigger-instances/trigger-instances.ts +106 -25
- package/src/resources/triggers-types.ts +96 -2
- 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/mcp/command.d.mts +0 -37
- package/resources/mcp/command.d.mts.map +0 -1
- package/resources/mcp/command.d.ts +0 -37
- package/resources/mcp/command.d.ts.map +0 -1
- package/resources/mcp/command.js +0 -15
- package/resources/mcp/command.js.map +0 -1
- package/resources/mcp/command.mjs +0 -11
- package/resources/mcp/command.mjs.map +0 -1
- package/src/resources/mcp/command.ts +0 -50
|
@@ -4,26 +4,78 @@ import { RequestOptions } from "../internal/request-options.mjs";
|
|
|
4
4
|
export declare class ConnectedAccounts extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new connected account
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const connectedAccount =
|
|
11
|
+
* await client.connectedAccounts.create({
|
|
12
|
+
* auth_config: { id: 'id' },
|
|
13
|
+
* connection: {},
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(body: ConnectedAccountCreateParams, options?: RequestOptions): APIPromise<ConnectedAccountCreateResponse>;
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
19
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
20
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const connectedAccount =
|
|
25
|
+
* await client.connectedAccounts.retrieve(
|
|
26
|
+
* 'con_1a2b3c4d5e6f',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
11
29
|
*/
|
|
12
30
|
retrieve(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountRetrieveResponse>;
|
|
13
31
|
/**
|
|
14
32
|
* List connected accounts with optional filters
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const connectedAccounts =
|
|
37
|
+
* await client.connectedAccounts.list();
|
|
38
|
+
* ```
|
|
15
39
|
*/
|
|
16
40
|
list(query?: ConnectedAccountListParams | null | undefined, options?: RequestOptions): APIPromise<ConnectedAccountListResponse>;
|
|
17
41
|
/**
|
|
18
|
-
*
|
|
42
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
43
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
44
|
+
* audit purposes.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const connectedAccount =
|
|
49
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
50
|
+
* ```
|
|
19
51
|
*/
|
|
20
52
|
delete(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountDeleteResponse>;
|
|
21
53
|
/**
|
|
22
|
-
*
|
|
54
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
55
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
56
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await client.connectedAccounts.refresh(
|
|
61
|
+
* 'con_1a2b3c4d5e6f',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
23
64
|
*/
|
|
24
65
|
refresh(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountRefreshResponse>;
|
|
25
66
|
/**
|
|
26
|
-
*
|
|
67
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
68
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
69
|
+
* database.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const response =
|
|
74
|
+
* await client.connectedAccounts.updateStatus(
|
|
75
|
+
* 'con_1a2b3c4d5e6f',
|
|
76
|
+
* { enabled: true },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
27
79
|
*/
|
|
28
80
|
updateStatus(nanoID: string, body: ConnectedAccountUpdateStatusParams, options?: RequestOptions): APIPromise<ConnectedAccountUpdateStatusResponse>;
|
|
29
81
|
}
|
|
@@ -45,7 +97,7 @@ export interface ConnectedAccountCreateResponse {
|
|
|
45
97
|
/**
|
|
46
98
|
* The status of the connected account
|
|
47
99
|
*/
|
|
48
|
-
status: '
|
|
100
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
49
101
|
}
|
|
50
102
|
export declare namespace ConnectedAccountCreateResponse {
|
|
51
103
|
interface Deprecated {
|
|
@@ -74,19 +126,20 @@ export interface ConnectedAccountRetrieveResponse {
|
|
|
74
126
|
*/
|
|
75
127
|
data: Record<string, unknown>;
|
|
76
128
|
/**
|
|
77
|
-
* Whether the connected account is disabled
|
|
129
|
+
* Whether the connected account is disabled. When true, the account cannot be used
|
|
130
|
+
* for API calls
|
|
78
131
|
*/
|
|
79
132
|
is_disabled: boolean;
|
|
80
133
|
/**
|
|
81
|
-
* The
|
|
134
|
+
* The initialization data of the connection, including configuration parameters
|
|
82
135
|
*/
|
|
83
136
|
params: Record<string, unknown>;
|
|
84
137
|
/**
|
|
85
138
|
* The status of the connection
|
|
86
139
|
*/
|
|
87
|
-
status: '
|
|
140
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
88
141
|
/**
|
|
89
|
-
* The reason the connected account is disabled
|
|
142
|
+
* The reason why the connected account is disabled, if applicable
|
|
90
143
|
*/
|
|
91
144
|
status_reason: string | null;
|
|
92
145
|
toolkit: ConnectedAccountRetrieveResponse.Toolkit;
|
|
@@ -176,7 +229,7 @@ export declare namespace ConnectedAccountListResponse {
|
|
|
176
229
|
/**
|
|
177
230
|
* The status of the connection
|
|
178
231
|
*/
|
|
179
|
-
status: '
|
|
232
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
180
233
|
/**
|
|
181
234
|
* The reason the connection is disabled
|
|
182
235
|
*/
|
|
@@ -242,29 +295,36 @@ export declare namespace ConnectedAccountListResponse {
|
|
|
242
295
|
}
|
|
243
296
|
}
|
|
244
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Response returned after successfully deleting a connected account
|
|
300
|
+
*/
|
|
245
301
|
export interface ConnectedAccountDeleteResponse {
|
|
246
302
|
/**
|
|
247
|
-
*
|
|
303
|
+
* Indicates whether the connected account was successfully deleted
|
|
248
304
|
*/
|
|
249
305
|
success: boolean;
|
|
250
306
|
}
|
|
251
307
|
export interface ConnectedAccountRefreshResponse {
|
|
252
308
|
/**
|
|
253
|
-
* The
|
|
309
|
+
* The unique identifier of the connected account
|
|
254
310
|
*/
|
|
255
311
|
id: string;
|
|
256
312
|
/**
|
|
257
|
-
* The
|
|
313
|
+
* The URL to which the user should be redirected to complete the authentication
|
|
314
|
+
* process (null for auth schemes that do not require redirection)
|
|
258
315
|
*/
|
|
259
316
|
redirect_url: string | null;
|
|
260
317
|
/**
|
|
261
|
-
* The status of the connected account
|
|
318
|
+
* The current status of the connected account (e.g., active, pending, failed)
|
|
262
319
|
*/
|
|
263
|
-
status: '
|
|
320
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
264
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Response returned after successfully updating a connected account status
|
|
324
|
+
*/
|
|
265
325
|
export interface ConnectedAccountUpdateStatusResponse {
|
|
266
326
|
/**
|
|
267
|
-
*
|
|
327
|
+
* Indicates whether the connected account status was successfully updated
|
|
268
328
|
*/
|
|
269
329
|
success: boolean;
|
|
270
330
|
}
|
|
@@ -327,7 +387,7 @@ export interface ConnectedAccountListParams {
|
|
|
327
387
|
/**
|
|
328
388
|
* The status of the connected account
|
|
329
389
|
*/
|
|
330
|
-
statuses?: Array<'
|
|
390
|
+
statuses?: Array<'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED'> | null;
|
|
331
391
|
/**
|
|
332
392
|
* The toolkit slugs of the connected accounts
|
|
333
393
|
*/
|
|
@@ -338,6 +398,9 @@ export interface ConnectedAccountListParams {
|
|
|
338
398
|
user_ids?: Array<string> | null;
|
|
339
399
|
}
|
|
340
400
|
export interface ConnectedAccountUpdateStatusParams {
|
|
401
|
+
/**
|
|
402
|
+
* Set to true to enable the account or false to disable it
|
|
403
|
+
*/
|
|
341
404
|
enabled: boolean;
|
|
342
405
|
}
|
|
343
406
|
export declare namespace ConnectedAccounts {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.d.mts","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD
|
|
1
|
+
{"version":3,"file":"connected-accounts.d.mts","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;IAI7C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,gCAAgC,CAAC;IAIhG;;;;;;;;OAQG;IACH,IAAI,CACF,KAAK,GAAE,0BAA0B,GAAG,IAAI,GAAG,SAAc,EACzD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,4BAA4B,CAAC;IAI3C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAI5F;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,+BAA+B,CAAC;IAI9F;;;;;;;;;;;;;OAaG;IACH,YAAY,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,kCAAkC,EACxC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oCAAoC,CA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EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,kCAAkC;IACjD;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,gCAAgC,IAAI,gCAAgC,EACzE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kCAAkC,IAAI,kCAAkC,GAC9E,CAAC;CACH"}
|
|
@@ -4,26 +4,78 @@ import { RequestOptions } from "../internal/request-options.js";
|
|
|
4
4
|
export declare class ConnectedAccounts extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new connected account
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const connectedAccount =
|
|
11
|
+
* await client.connectedAccounts.create({
|
|
12
|
+
* auth_config: { id: 'id' },
|
|
13
|
+
* connection: {},
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(body: ConnectedAccountCreateParams, options?: RequestOptions): APIPromise<ConnectedAccountCreateResponse>;
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
19
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
20
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const connectedAccount =
|
|
25
|
+
* await client.connectedAccounts.retrieve(
|
|
26
|
+
* 'con_1a2b3c4d5e6f',
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
11
29
|
*/
|
|
12
30
|
retrieve(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountRetrieveResponse>;
|
|
13
31
|
/**
|
|
14
32
|
* List connected accounts with optional filters
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const connectedAccounts =
|
|
37
|
+
* await client.connectedAccounts.list();
|
|
38
|
+
* ```
|
|
15
39
|
*/
|
|
16
40
|
list(query?: ConnectedAccountListParams | null | undefined, options?: RequestOptions): APIPromise<ConnectedAccountListResponse>;
|
|
17
41
|
/**
|
|
18
|
-
*
|
|
42
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
43
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
44
|
+
* audit purposes.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const connectedAccount =
|
|
49
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
50
|
+
* ```
|
|
19
51
|
*/
|
|
20
52
|
delete(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountDeleteResponse>;
|
|
21
53
|
/**
|
|
22
|
-
*
|
|
54
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
55
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
56
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await client.connectedAccounts.refresh(
|
|
61
|
+
* 'con_1a2b3c4d5e6f',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
23
64
|
*/
|
|
24
65
|
refresh(nanoid: string, options?: RequestOptions): APIPromise<ConnectedAccountRefreshResponse>;
|
|
25
66
|
/**
|
|
26
|
-
*
|
|
67
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
68
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
69
|
+
* database.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const response =
|
|
74
|
+
* await client.connectedAccounts.updateStatus(
|
|
75
|
+
* 'con_1a2b3c4d5e6f',
|
|
76
|
+
* { enabled: true },
|
|
77
|
+
* );
|
|
78
|
+
* ```
|
|
27
79
|
*/
|
|
28
80
|
updateStatus(nanoID: string, body: ConnectedAccountUpdateStatusParams, options?: RequestOptions): APIPromise<ConnectedAccountUpdateStatusResponse>;
|
|
29
81
|
}
|
|
@@ -45,7 +97,7 @@ export interface ConnectedAccountCreateResponse {
|
|
|
45
97
|
/**
|
|
46
98
|
* The status of the connected account
|
|
47
99
|
*/
|
|
48
|
-
status: '
|
|
100
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
49
101
|
}
|
|
50
102
|
export declare namespace ConnectedAccountCreateResponse {
|
|
51
103
|
interface Deprecated {
|
|
@@ -74,19 +126,20 @@ export interface ConnectedAccountRetrieveResponse {
|
|
|
74
126
|
*/
|
|
75
127
|
data: Record<string, unknown>;
|
|
76
128
|
/**
|
|
77
|
-
* Whether the connected account is disabled
|
|
129
|
+
* Whether the connected account is disabled. When true, the account cannot be used
|
|
130
|
+
* for API calls
|
|
78
131
|
*/
|
|
79
132
|
is_disabled: boolean;
|
|
80
133
|
/**
|
|
81
|
-
* The
|
|
134
|
+
* The initialization data of the connection, including configuration parameters
|
|
82
135
|
*/
|
|
83
136
|
params: Record<string, unknown>;
|
|
84
137
|
/**
|
|
85
138
|
* The status of the connection
|
|
86
139
|
*/
|
|
87
|
-
status: '
|
|
140
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
88
141
|
/**
|
|
89
|
-
* The reason the connected account is disabled
|
|
142
|
+
* The reason why the connected account is disabled, if applicable
|
|
90
143
|
*/
|
|
91
144
|
status_reason: string | null;
|
|
92
145
|
toolkit: ConnectedAccountRetrieveResponse.Toolkit;
|
|
@@ -176,7 +229,7 @@ export declare namespace ConnectedAccountListResponse {
|
|
|
176
229
|
/**
|
|
177
230
|
* The status of the connection
|
|
178
231
|
*/
|
|
179
|
-
status: '
|
|
232
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
180
233
|
/**
|
|
181
234
|
* The reason the connection is disabled
|
|
182
235
|
*/
|
|
@@ -242,29 +295,36 @@ export declare namespace ConnectedAccountListResponse {
|
|
|
242
295
|
}
|
|
243
296
|
}
|
|
244
297
|
}
|
|
298
|
+
/**
|
|
299
|
+
* Response returned after successfully deleting a connected account
|
|
300
|
+
*/
|
|
245
301
|
export interface ConnectedAccountDeleteResponse {
|
|
246
302
|
/**
|
|
247
|
-
*
|
|
303
|
+
* Indicates whether the connected account was successfully deleted
|
|
248
304
|
*/
|
|
249
305
|
success: boolean;
|
|
250
306
|
}
|
|
251
307
|
export interface ConnectedAccountRefreshResponse {
|
|
252
308
|
/**
|
|
253
|
-
* The
|
|
309
|
+
* The unique identifier of the connected account
|
|
254
310
|
*/
|
|
255
311
|
id: string;
|
|
256
312
|
/**
|
|
257
|
-
* The
|
|
313
|
+
* The URL to which the user should be redirected to complete the authentication
|
|
314
|
+
* process (null for auth schemes that do not require redirection)
|
|
258
315
|
*/
|
|
259
316
|
redirect_url: string | null;
|
|
260
317
|
/**
|
|
261
|
-
* The status of the connected account
|
|
318
|
+
* The current status of the connected account (e.g., active, pending, failed)
|
|
262
319
|
*/
|
|
263
|
-
status: '
|
|
320
|
+
status: 'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED';
|
|
264
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Response returned after successfully updating a connected account status
|
|
324
|
+
*/
|
|
265
325
|
export interface ConnectedAccountUpdateStatusResponse {
|
|
266
326
|
/**
|
|
267
|
-
*
|
|
327
|
+
* Indicates whether the connected account status was successfully updated
|
|
268
328
|
*/
|
|
269
329
|
success: boolean;
|
|
270
330
|
}
|
|
@@ -327,7 +387,7 @@ export interface ConnectedAccountListParams {
|
|
|
327
387
|
/**
|
|
328
388
|
* The status of the connected account
|
|
329
389
|
*/
|
|
330
|
-
statuses?: Array<'
|
|
390
|
+
statuses?: Array<'INITIALIZING' | 'INITIATED' | 'ACTIVE' | 'FAILED' | 'EXPIRED'> | null;
|
|
331
391
|
/**
|
|
332
392
|
* The toolkit slugs of the connected accounts
|
|
333
393
|
*/
|
|
@@ -338,6 +398,9 @@ export interface ConnectedAccountListParams {
|
|
|
338
398
|
user_ids?: Array<string> | null;
|
|
339
399
|
}
|
|
340
400
|
export interface ConnectedAccountUpdateStatusParams {
|
|
401
|
+
/**
|
|
402
|
+
* Set to true to enable the account or false to disable it
|
|
403
|
+
*/
|
|
341
404
|
enabled: boolean;
|
|
342
405
|
}
|
|
343
406
|
export declare namespace ConnectedAccounts {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.d.ts","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD
|
|
1
|
+
{"version":3,"file":"connected-accounts.d.ts","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAI,EAAE,4BAA4B,EAClC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,8BAA8B,CAAC;IAI7C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAA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ounts extends resource_1.APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new connected account
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const connectedAccount =
|
|
14
|
+
* await client.connectedAccounts.create({
|
|
15
|
+
* auth_config: { id: 'id' },
|
|
16
|
+
* connection: {},
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
10
19
|
*/
|
|
11
20
|
create(body, options) {
|
|
12
21
|
return this._client.post('/api/v3/connected_accounts', { body, ...options });
|
|
13
22
|
}
|
|
14
23
|
/**
|
|
15
|
-
*
|
|
24
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
25
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const connectedAccount =
|
|
30
|
+
* await client.connectedAccounts.retrieve(
|
|
31
|
+
* 'con_1a2b3c4d5e6f',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
16
34
|
*/
|
|
17
35
|
retrieve(nanoid, options) {
|
|
18
36
|
return this._client.get((0, path_1.path) `/api/v3/connected_accounts/${nanoid}`, options);
|
|
19
37
|
}
|
|
20
38
|
/**
|
|
21
39
|
* List connected accounts with optional filters
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const connectedAccounts =
|
|
44
|
+
* await client.connectedAccounts.list();
|
|
45
|
+
* ```
|
|
22
46
|
*/
|
|
23
47
|
list(query = {}, options) {
|
|
24
48
|
return this._client.get('/api/v3/connected_accounts', { query, ...options });
|
|
25
49
|
}
|
|
26
50
|
/**
|
|
27
|
-
*
|
|
51
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
52
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
53
|
+
* audit purposes.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const connectedAccount =
|
|
58
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
59
|
+
* ```
|
|
28
60
|
*/
|
|
29
61
|
delete(nanoid, options) {
|
|
30
62
|
return this._client.delete((0, path_1.path) `/api/v3/connected_accounts/${nanoid}`, options);
|
|
31
63
|
}
|
|
32
64
|
/**
|
|
33
|
-
*
|
|
65
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
66
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
67
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const response = await client.connectedAccounts.refresh(
|
|
72
|
+
* 'con_1a2b3c4d5e6f',
|
|
73
|
+
* );
|
|
74
|
+
* ```
|
|
34
75
|
*/
|
|
35
76
|
refresh(nanoid, options) {
|
|
36
77
|
return this._client.post((0, path_1.path) `/api/v3/connected_accounts/${nanoid}/refresh`, options);
|
|
37
78
|
}
|
|
38
79
|
/**
|
|
39
|
-
*
|
|
80
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
81
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
82
|
+
* database.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const response =
|
|
87
|
+
* await client.connectedAccounts.updateStatus(
|
|
88
|
+
* 'con_1a2b3c4d5e6f',
|
|
89
|
+
* { enabled: true },
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
40
92
|
*/
|
|
41
93
|
updateStatus(nanoID, body, options) {
|
|
42
94
|
return this._client.patch((0, path_1.path) `/api/v3/connected_accounts/${nanoID}/status`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.js","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,iBAAkB,SAAQ,sBAAW;I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8BAA8B,MAAM,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrG,CAAC;CACF;AAxGD,8CAwGC"}
|
|
@@ -4,36 +4,88 @@ import { path } from "../internal/utils/path.mjs";
|
|
|
4
4
|
export class ConnectedAccounts extends APIResource {
|
|
5
5
|
/**
|
|
6
6
|
* Create a new connected account
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const connectedAccount =
|
|
11
|
+
* await client.connectedAccounts.create({
|
|
12
|
+
* auth_config: { id: 'id' },
|
|
13
|
+
* connection: {},
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
7
16
|
*/
|
|
8
17
|
create(body, options) {
|
|
9
18
|
return this._client.post('/api/v3/connected_accounts', { body, ...options });
|
|
10
19
|
}
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
21
|
+
* Retrieves comprehensive details of a connected account, including authentication
|
|
22
|
+
* configuration, connection status, and all parameters needed for API requests.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const connectedAccount =
|
|
27
|
+
* await client.connectedAccounts.retrieve(
|
|
28
|
+
* 'con_1a2b3c4d5e6f',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
13
31
|
*/
|
|
14
32
|
retrieve(nanoid, options) {
|
|
15
33
|
return this._client.get(path `/api/v3/connected_accounts/${nanoid}`, options);
|
|
16
34
|
}
|
|
17
35
|
/**
|
|
18
36
|
* List connected accounts with optional filters
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const connectedAccounts =
|
|
41
|
+
* await client.connectedAccounts.list();
|
|
42
|
+
* ```
|
|
19
43
|
*/
|
|
20
44
|
list(query = {}, options) {
|
|
21
45
|
return this._client.get('/api/v3/connected_accounts', { query, ...options });
|
|
22
46
|
}
|
|
23
47
|
/**
|
|
24
|
-
*
|
|
48
|
+
* Soft-deletes a connected account by marking it as deleted in the database. This
|
|
49
|
+
* prevents the account from being used for API calls but preserves the record for
|
|
50
|
+
* audit purposes.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const connectedAccount =
|
|
55
|
+
* await client.connectedAccounts.delete('con_1a2b3c4d5e6f');
|
|
56
|
+
* ```
|
|
25
57
|
*/
|
|
26
58
|
delete(nanoid, options) {
|
|
27
59
|
return this._client.delete(path `/api/v3/connected_accounts/${nanoid}`, options);
|
|
28
60
|
}
|
|
29
61
|
/**
|
|
30
|
-
*
|
|
62
|
+
* Initiates a new authentication flow for a connected account when credentials
|
|
63
|
+
* have expired or become invalid. This may generate a new authentication URL for
|
|
64
|
+
* OAuth flows or refresh tokens for other auth schemes.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const response = await client.connectedAccounts.refresh(
|
|
69
|
+
* 'con_1a2b3c4d5e6f',
|
|
70
|
+
* );
|
|
71
|
+
* ```
|
|
31
72
|
*/
|
|
32
73
|
refresh(nanoid, options) {
|
|
33
74
|
return this._client.post(path `/api/v3/connected_accounts/${nanoid}/refresh`, options);
|
|
34
75
|
}
|
|
35
76
|
/**
|
|
36
|
-
*
|
|
77
|
+
* Updates the status of a connected account to either enabled (active) or disabled
|
|
78
|
+
* (inactive). Disabled accounts cannot be used for API calls but remain in the
|
|
79
|
+
* database.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const response =
|
|
84
|
+
* await client.connectedAccounts.updateStatus(
|
|
85
|
+
* 'con_1a2b3c4d5e6f',
|
|
86
|
+
* { enabled: true },
|
|
87
|
+
* );
|
|
88
|
+
* ```
|
|
37
89
|
*/
|
|
38
90
|
updateStatus(nanoID, body, options) {
|
|
39
91
|
return this._client.patch(path `/api/v3/connected_accounts/${nanoID}/status`, { body, ...options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connected-accounts.mjs","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD
|
|
1
|
+
{"version":3,"file":"connected-accounts.mjs","sourceRoot":"","sources":["../src/resources/connected-accounts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAChD;;;;;;;;;;;OAWG;IACH,MAAM,CACJ,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAc,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,8BAA8B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;OAQG;IACH,IAAI,CACF,QAAuD,EAAE,EACzD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,MAAc,EAAE,OAAwB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,8BAA8B,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,MAAc,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,8BAA8B,MAAM,UAAU,EAAE,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