@composio/client 0.1.0-alpha.10 → 0.1.0-alpha.11
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 +20 -0
- 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 +163 -24
- package/resources/auth-configs.d.mts.map +1 -1
- package/resources/auth-configs.d.ts +163 -24
- 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 +56 -23
- package/resources/files.d.mts.map +1 -1
- package/resources/files.d.ts +56 -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/command.d.mts +0 -33
- package/resources/mcp/command.d.mts.map +1 -1
- package/resources/mcp/command.d.ts +0 -33
- package/resources/mcp/command.d.ts.map +1 -1
- package/resources/mcp/command.js +0 -6
- package/resources/mcp/command.js.map +1 -1
- package/resources/mcp/command.mjs +0 -6
- package/resources/mcp/command.mjs.map +1 -1
- 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.map +1 -1
- package/resources/mcp/index.mjs.map +1 -1
- package/resources/mcp/mcp.d.mts +232 -235
- package/resources/mcp/mcp.d.mts.map +1 -1
- package/resources/mcp/mcp.d.ts +232 -235
- package/resources/mcp/mcp.d.ts.map +1 -1
- package/resources/mcp/mcp.js +55 -19
- package/resources/mcp/mcp.js.map +1 -1
- package/resources/mcp/mcp.mjs +55 -19
- 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 +97 -20
- package/resources/org/project/api-keys.d.mts.map +1 -1
- package/resources/org/project/api-keys.d.ts +97 -20
- 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/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 +207 -40
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +207 -40
- package/resources/tools.d.ts.map +1 -1
- package/resources/tools.js +58 -5
- package/resources/tools.js.map +1 -1
- package/resources/tools.mjs +58 -5
- 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/index.js.map +1 -1
- package/resources/trigger-instances/index.mjs.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.mts +21 -24
- package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
- package/resources/trigger-instances/trigger-instances.d.ts +21 -24
- package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
- package/resources/trigger-instances/trigger-instances.js +1 -8
- package/resources/trigger-instances/trigger-instances.js.map +1 -1
- package/resources/trigger-instances/trigger-instances.mjs +1 -8
- 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 +4 -14
- package/src/resources/auth-configs.ts +164 -24
- package/src/resources/connected-accounts.ts +80 -17
- package/src/resources/files.ts +56 -23
- package/src/resources/index.ts +2 -7
- package/src/resources/mcp/command.ts +1 -46
- package/src/resources/mcp/index.ts +2 -5
- package/src/resources/mcp/mcp.ts +240 -280
- package/src/resources/migration.ts +11 -2
- package/src/resources/org/api-key.ts +23 -2
- package/src/resources/org/project/api-keys.ts +97 -20
- 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/toolkits.ts +200 -7
- package/src/resources/tools.ts +207 -40
- package/src/resources/trigger-instances/index.ts +0 -3
- package/src/resources/trigger-instances/trigger-instances.ts +22 -38
- 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
|
@@ -6,7 +6,9 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class Migration extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Convert a legacy UUID to its corresponding NanoId for migration purposes
|
|
9
|
+
* Convert a legacy UUID to its corresponding NanoId for migration purposes. This
|
|
10
|
+
* endpoint facilitates the transition from UUID-based identifiers to the more
|
|
11
|
+
* compact NanoId format used in the v3 API.
|
|
10
12
|
*/
|
|
11
13
|
retrieveNanoid(
|
|
12
14
|
query: MigrationRetrieveNanoidParams,
|
|
@@ -18,14 +20,21 @@ export class Migration extends APIResource {
|
|
|
18
20
|
|
|
19
21
|
export interface MigrationRetrieveNanoidResponse {
|
|
20
22
|
/**
|
|
21
|
-
* The NanoId corresponding to the provided UUID.
|
|
23
|
+
* The NanoId corresponding to the provided UUID. This is the new identifier that
|
|
24
|
+
* should be used in place of the legacy UUID.
|
|
22
25
|
*/
|
|
23
26
|
nanoid: string;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export interface MigrationRetrieveNanoidParams {
|
|
30
|
+
/**
|
|
31
|
+
* The type of resource that the UUID belongs to
|
|
32
|
+
*/
|
|
27
33
|
type: 'CONNECTED_ACCOUNT' | 'AUTH_CONFIG' | 'TRIGGER_INSTANCE';
|
|
28
34
|
|
|
35
|
+
/**
|
|
36
|
+
* The legacy UUID that needs to be converted to a NanoId
|
|
37
|
+
*/
|
|
29
38
|
uuid: string;
|
|
30
39
|
}
|
|
31
40
|
|
|
@@ -6,7 +6,14 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
6
6
|
|
|
7
7
|
export class APIKey extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Retrieve the API key for the current organization
|
|
9
|
+
* Retrieve the API key for the current organization. This endpoint is restricted
|
|
10
|
+
* to organization administrators only. The returned API key can be used for
|
|
11
|
+
* authenticating organization-level API requests.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const apiKey = await client.org.apiKey.retrieve();
|
|
16
|
+
* ```
|
|
10
17
|
*/
|
|
11
18
|
retrieve(options?: RequestOptions): APIPromise<APIKeyRetrieveResponse> {
|
|
12
19
|
return this._client.get('/api/v3/org/api_key', options);
|
|
@@ -14,7 +21,13 @@ export class APIKey extends APIResource {
|
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* Generate a new API key for the organization, invalidating the previous one
|
|
17
|
-
* (admin only)
|
|
24
|
+
* (admin only). This operation cannot be undone and will immediately invalidate
|
|
25
|
+
* the previous API key.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const response = await client.org.apiKey.regenerate();
|
|
30
|
+
* ```
|
|
18
31
|
*/
|
|
19
32
|
regenerate(options?: RequestOptions): APIPromise<APIKeyRegenerateResponse> {
|
|
20
33
|
return this._client.post('/api/v3/org/api_key/regenerate', options);
|
|
@@ -22,10 +35,18 @@ export class APIKey extends APIResource {
|
|
|
22
35
|
}
|
|
23
36
|
|
|
24
37
|
export interface APIKeyRetrieveResponse {
|
|
38
|
+
/**
|
|
39
|
+
* The API key for the organization that can be used for authentication. Format:
|
|
40
|
+
* org_xxx
|
|
41
|
+
*/
|
|
25
42
|
org_api_key: string;
|
|
26
43
|
}
|
|
27
44
|
|
|
28
45
|
export interface APIKeyRegenerateResponse {
|
|
46
|
+
/**
|
|
47
|
+
* The newly generated API key for the organization that can be used for
|
|
48
|
+
* authentication. Format: org_xxx
|
|
49
|
+
*/
|
|
29
50
|
org_api_key: string;
|
|
30
51
|
}
|
|
31
52
|
|
|
@@ -6,6 +6,21 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
6
6
|
import { path } from '../../../internal/utils/path';
|
|
7
7
|
|
|
8
8
|
export class APIKeys extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new API key for the specified project. API keys are used for
|
|
11
|
+
* authenticating requests to the API. This endpoint generates a new key with the
|
|
12
|
+
* provided name and returns the complete key details including the actual key
|
|
13
|
+
* value. Note that the full API key value is only returned once at creation time
|
|
14
|
+
* and cannot be retrieved later, so it should be securely stored immediately.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const apiKey = await client.org.project.apiKeys.create(
|
|
19
|
+
* 'proj_abc123xyz456',
|
|
20
|
+
* { name: 'Production API Key' },
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
9
24
|
create(
|
|
10
25
|
projectID: string,
|
|
11
26
|
body: APIKeyCreateParams,
|
|
@@ -14,50 +29,101 @@ export class APIKeys extends APIResource {
|
|
|
14
29
|
return this._client.post(path`/api/v3/org/project/${projectID}/api_keys/create`, { body, ...options });
|
|
15
30
|
}
|
|
16
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves all API keys associated with the specified project. This endpoint
|
|
34
|
+
* returns details about each API key including its name, creation date, and last
|
|
35
|
+
* used information. Use this endpoint to audit which keys exist for a project or
|
|
36
|
+
* to manage key rotation policies.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const apiKeys = await client.org.project.apiKeys.list(
|
|
41
|
+
* 'proj_abc123xyz456',
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
17
45
|
list(projectID: string, options?: RequestOptions): APIPromise<APIKeyListResponse> {
|
|
18
46
|
return this._client.get(path`/api/v3/org/project/${projectID}/api_keys/list`, options);
|
|
19
47
|
}
|
|
20
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Permanently deletes an API key from the specified project. Once deleted, the API
|
|
51
|
+
* key can no longer be used for authentication and any services using it will need
|
|
52
|
+
* to be updated with a new key. This operation cannot be undone, so it should be
|
|
53
|
+
* used with caution.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const apiKey = await client.org.project.apiKeys.delete(
|
|
58
|
+
* '01H4DKRF5SMP7NQCA3BWT0JYB6',
|
|
59
|
+
* { projectId: 'proj_abc123xyz456' },
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
21
63
|
delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse> {
|
|
22
64
|
const { projectId } = params;
|
|
23
65
|
return this._client.delete(path`/api/v3/org/project/${projectId}/api_keys/remove/${id}`, options);
|
|
24
66
|
}
|
|
25
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves an existing API key for the project or creates a new one if none
|
|
70
|
+
* exists. This endpoint is useful for ensuring a project always has at least one
|
|
71
|
+
* API key without the risk of creating duplicates. If an API key already exists,
|
|
72
|
+
* it returns the existing key. If no API keys exist for the project, it creates a
|
|
73
|
+
* new one with an automatically generated name.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const response =
|
|
78
|
+
* await client.org.project.apiKeys.createAPIKey(
|
|
79
|
+
* 'proj_abc123xyz456',
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
26
83
|
createAPIKey(projectID: string, options?: RequestOptions): APIPromise<APIKeyCreateAPIKeyResponse> {
|
|
27
84
|
return this._client.post(path`/api/v3/org/project/${projectID}/api_keys/create-api-key`, options);
|
|
28
85
|
}
|
|
29
86
|
}
|
|
30
87
|
|
|
88
|
+
/**
|
|
89
|
+
* API key object containing the key details
|
|
90
|
+
*/
|
|
31
91
|
export interface APIKeyCreateResponse {
|
|
32
92
|
/**
|
|
33
|
-
* API key
|
|
93
|
+
* Database record identifier for the API key
|
|
34
94
|
*/
|
|
35
95
|
id: string;
|
|
36
96
|
|
|
37
97
|
/**
|
|
38
|
-
*
|
|
98
|
+
* UTC timestamp indicating when the API key was created
|
|
39
99
|
*/
|
|
40
100
|
createdAt: string;
|
|
41
101
|
|
|
42
102
|
/**
|
|
43
|
-
* API key value
|
|
103
|
+
* The API key string value that should be included in API requests. This value is
|
|
104
|
+
* only shown once at creation time.
|
|
44
105
|
*/
|
|
45
106
|
key: string;
|
|
46
107
|
|
|
47
108
|
/**
|
|
48
|
-
*
|
|
109
|
+
* Descriptive name assigned to help identify the key's purpose
|
|
49
110
|
*/
|
|
50
111
|
name: string;
|
|
51
112
|
|
|
52
113
|
/**
|
|
53
|
-
*
|
|
114
|
+
* UTC timestamp indicating when the API key was last used for authentication. Will
|
|
115
|
+
* be null for newly created keys.
|
|
54
116
|
*/
|
|
55
117
|
lastUsed?: string;
|
|
56
118
|
}
|
|
57
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Response containing the list of API keys for a project
|
|
122
|
+
*/
|
|
58
123
|
export interface APIKeyListResponse {
|
|
59
124
|
/**
|
|
60
|
-
* List of API keys
|
|
125
|
+
* List of all API keys for the specified project, including their properties and
|
|
126
|
+
* usage information
|
|
61
127
|
*/
|
|
62
128
|
items: Array<APIKeyListResponse.Item>;
|
|
63
129
|
}
|
|
@@ -65,81 +131,92 @@ export interface APIKeyListResponse {
|
|
|
65
131
|
export namespace APIKeyListResponse {
|
|
66
132
|
export interface Item {
|
|
67
133
|
/**
|
|
68
|
-
* API key
|
|
134
|
+
* Unique identifier for the API key record
|
|
69
135
|
*/
|
|
70
136
|
id: string;
|
|
71
137
|
|
|
72
138
|
/**
|
|
73
|
-
*
|
|
139
|
+
* UTC timestamp indicating when the API key was created
|
|
74
140
|
*/
|
|
75
141
|
created_at: string;
|
|
76
142
|
|
|
77
143
|
/**
|
|
78
|
-
* API key
|
|
144
|
+
* The API key string that should be included in API requests for authentication
|
|
79
145
|
*/
|
|
80
146
|
key: string;
|
|
81
147
|
|
|
82
148
|
/**
|
|
83
|
-
* API key
|
|
149
|
+
* Descriptive name assigned to the API key for identification purposes
|
|
84
150
|
*/
|
|
85
151
|
name: string;
|
|
86
152
|
|
|
87
153
|
/**
|
|
88
|
-
*
|
|
154
|
+
* UTC timestamp indicating when the API key was last used for authentication. Will
|
|
155
|
+
* be null if the key has never been used.
|
|
89
156
|
*/
|
|
90
157
|
last_used?: string;
|
|
91
158
|
}
|
|
92
159
|
}
|
|
93
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Response indicating the status of the API key deletion operation
|
|
163
|
+
*/
|
|
94
164
|
export interface APIKeyDeleteResponse {
|
|
95
165
|
/**
|
|
96
|
-
* Status message
|
|
166
|
+
* Status message providing details about the deletion operation
|
|
97
167
|
*/
|
|
98
168
|
message: string;
|
|
99
169
|
|
|
100
170
|
/**
|
|
101
|
-
*
|
|
171
|
+
* Boolean flag indicating if the deletion operation was successful
|
|
102
172
|
*/
|
|
103
173
|
success: boolean;
|
|
104
174
|
}
|
|
105
175
|
|
|
176
|
+
/**
|
|
177
|
+
* API key object containing the key details
|
|
178
|
+
*/
|
|
106
179
|
export interface APIKeyCreateAPIKeyResponse {
|
|
107
180
|
/**
|
|
108
|
-
* API key
|
|
181
|
+
* Database record identifier for the API key
|
|
109
182
|
*/
|
|
110
183
|
id: string;
|
|
111
184
|
|
|
112
185
|
/**
|
|
113
|
-
*
|
|
186
|
+
* UTC timestamp indicating when the API key was created
|
|
114
187
|
*/
|
|
115
188
|
createdAt: string;
|
|
116
189
|
|
|
117
190
|
/**
|
|
118
|
-
* API key value
|
|
191
|
+
* The API key string value that should be included in API requests. This value is
|
|
192
|
+
* only shown once.
|
|
119
193
|
*/
|
|
120
194
|
key: string;
|
|
121
195
|
|
|
122
196
|
/**
|
|
123
|
-
*
|
|
197
|
+
* Name assigned to help identify the key's purpose. For auto-generated keys, this
|
|
198
|
+
* will be a random name.
|
|
124
199
|
*/
|
|
125
200
|
name: string;
|
|
126
201
|
|
|
127
202
|
/**
|
|
128
|
-
*
|
|
203
|
+
* UTC timestamp indicating when the API key was last used for authentication. Will
|
|
204
|
+
* be null for newly created keys.
|
|
129
205
|
*/
|
|
130
206
|
lastUsed?: string;
|
|
131
207
|
}
|
|
132
208
|
|
|
133
209
|
export interface APIKeyCreateParams {
|
|
134
210
|
/**
|
|
135
|
-
* API key
|
|
211
|
+
* A user-friendly name to identify the API key's purpose (e.g., "Production
|
|
212
|
+
* Server", "Test Environment")
|
|
136
213
|
*/
|
|
137
214
|
name: string;
|
|
138
215
|
}
|
|
139
216
|
|
|
140
217
|
export interface APIKeyDeleteParams {
|
|
141
218
|
/**
|
|
142
|
-
*
|
|
219
|
+
* The project Nano ID that owns the API key to be deleted
|
|
143
220
|
*/
|
|
144
221
|
projectId: string;
|
|
145
222
|
}
|
|
@@ -34,128 +34,300 @@ export class Project extends APIResource {
|
|
|
34
34
|
trigger: TriggerAPI.Trigger = new TriggerAPI.Trigger(this._client);
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
*
|
|
37
|
+
* Creates a new project within the authenticated user's organization using the
|
|
38
|
+
* specified name. Projects are isolated environments within your organization,
|
|
39
|
+
* each with their own API keys, webhook configurations, and resources. Use this
|
|
40
|
+
* endpoint to create additional projects for different environments (e.g.,
|
|
41
|
+
* development, staging, production) or for separate applications.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const project = await client.org.project.create({
|
|
46
|
+
* name: 'my-production-api',
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
38
49
|
*/
|
|
39
50
|
create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<ProjectCreateResponse> {
|
|
40
51
|
return this._client.post('/api/v3/org/project/new', { body, ...options });
|
|
41
52
|
}
|
|
42
53
|
|
|
43
54
|
/**
|
|
44
|
-
*
|
|
55
|
+
* Retrieves detailed information about a specific project using its unique
|
|
56
|
+
* identifier. This endpoint provides complete project configuration including
|
|
57
|
+
* webhook URLs, creation and update timestamps, and webhook secrets. Use this
|
|
58
|
+
* endpoint to inspect project settings or verify project configuration.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const project = await client.org.project.retrieve(
|
|
63
|
+
* 'proj_abc123xyz456',
|
|
64
|
+
* );
|
|
65
|
+
* ```
|
|
45
66
|
*/
|
|
46
67
|
retrieve(projectID: string, options?: RequestOptions): APIPromise<ProjectRetrieveResponse> {
|
|
47
68
|
return this._client.get(path`/api/v3/org/project/${projectID}`, options);
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
/**
|
|
51
|
-
*
|
|
72
|
+
* Retrieves all projects belonging to the authenticated user's organization.
|
|
73
|
+
* Projects are returned in descending order of creation date (newest first). This
|
|
74
|
+
* endpoint is useful for displaying project selection in dashboards or for
|
|
75
|
+
* integrations that need to list all available projects.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const projects = await client.org.project.list();
|
|
80
|
+
* ```
|
|
52
81
|
*/
|
|
53
82
|
list(options?: RequestOptions): APIPromise<ProjectListResponse> {
|
|
54
83
|
return this._client.get('/api/v3/org/project/list', options);
|
|
55
84
|
}
|
|
56
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Soft-deletes a project within the organization by its unique identifier. When a
|
|
88
|
+
* project is deleted, it is marked as deleted but not immediately removed from the
|
|
89
|
+
* database. This operation affects all resources associated with the project
|
|
90
|
+
* including API keys, webhook configurations, and connected services. This action
|
|
91
|
+
* cannot be undone through the API.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const project = await client.org.project.delete(
|
|
96
|
+
* 'proj_abc123xyz456',
|
|
97
|
+
* );
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
57
100
|
delete(projectID: string, options?: RequestOptions): APIPromise<ProjectDeleteResponse> {
|
|
58
101
|
return this._client.delete(path`/api/v3/org/project/delete/${projectID}`, options);
|
|
59
102
|
}
|
|
60
103
|
}
|
|
61
104
|
|
|
62
105
|
export interface ProjectCreateResponse {
|
|
106
|
+
/**
|
|
107
|
+
* Unique identifier for the project
|
|
108
|
+
*/
|
|
63
109
|
id: string;
|
|
64
110
|
|
|
111
|
+
/**
|
|
112
|
+
* ISO timestamp when the project was created
|
|
113
|
+
*/
|
|
65
114
|
created_at: string;
|
|
66
115
|
|
|
116
|
+
/**
|
|
117
|
+
* Whether this project has been soft-deleted
|
|
118
|
+
*/
|
|
67
119
|
deleted: boolean;
|
|
68
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Email address associated with the project
|
|
123
|
+
*/
|
|
69
124
|
email: string;
|
|
70
125
|
|
|
126
|
+
/**
|
|
127
|
+
* URL where event webhook notifications will be sent (can be null)
|
|
128
|
+
*/
|
|
71
129
|
event_webhook_url: string | null;
|
|
72
130
|
|
|
131
|
+
/**
|
|
132
|
+
* Name of the project
|
|
133
|
+
*/
|
|
73
134
|
name: string;
|
|
74
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Identifier of the organization that owns this project
|
|
138
|
+
*/
|
|
75
139
|
org_id: string;
|
|
76
140
|
|
|
141
|
+
/**
|
|
142
|
+
* ISO timestamp when the project was last updated
|
|
143
|
+
*/
|
|
77
144
|
updated_at: string;
|
|
78
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Secret key used to sign webhook payloads for verification
|
|
148
|
+
*/
|
|
79
149
|
webhook_secret: string | null;
|
|
80
150
|
|
|
151
|
+
/**
|
|
152
|
+
* URL where webhook events will be sent (can be null)
|
|
153
|
+
*/
|
|
81
154
|
webhook_url: string | null;
|
|
82
155
|
|
|
156
|
+
/**
|
|
157
|
+
* Indicates if the webhook configuration is using the new format
|
|
158
|
+
*/
|
|
83
159
|
is_new_webhook?: boolean;
|
|
84
160
|
|
|
161
|
+
/**
|
|
162
|
+
* ISO timestamp when the project last subscribed to updates
|
|
163
|
+
*/
|
|
85
164
|
last_subscribed_at?: string | null;
|
|
86
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Whether triggers are enabled for this project
|
|
168
|
+
*/
|
|
87
169
|
triggers_enabled?: boolean;
|
|
88
170
|
}
|
|
89
171
|
|
|
90
172
|
export interface ProjectRetrieveResponse {
|
|
173
|
+
/**
|
|
174
|
+
* Unique identifier for the project
|
|
175
|
+
*/
|
|
91
176
|
id: string;
|
|
92
177
|
|
|
178
|
+
/**
|
|
179
|
+
* ISO timestamp when the project was created
|
|
180
|
+
*/
|
|
93
181
|
created_at: string;
|
|
94
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Whether this project has been soft-deleted
|
|
185
|
+
*/
|
|
95
186
|
deleted: boolean;
|
|
96
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Email address associated with the project
|
|
190
|
+
*/
|
|
97
191
|
email: string;
|
|
98
192
|
|
|
193
|
+
/**
|
|
194
|
+
* URL where event webhook notifications will be sent (can be null)
|
|
195
|
+
*/
|
|
99
196
|
event_webhook_url: string | null;
|
|
100
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Name of the project
|
|
200
|
+
*/
|
|
101
201
|
name: string;
|
|
102
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Identifier of the organization that owns this project
|
|
205
|
+
*/
|
|
103
206
|
org_id: string;
|
|
104
207
|
|
|
208
|
+
/**
|
|
209
|
+
* ISO timestamp when the project was last updated
|
|
210
|
+
*/
|
|
105
211
|
updated_at: string;
|
|
106
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Secret key used to sign webhook payloads for verification
|
|
215
|
+
*/
|
|
107
216
|
webhook_secret: string | null;
|
|
108
217
|
|
|
218
|
+
/**
|
|
219
|
+
* URL where webhook events will be sent (can be null)
|
|
220
|
+
*/
|
|
109
221
|
webhook_url: string | null;
|
|
110
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Indicates if the webhook configuration is using the new format
|
|
225
|
+
*/
|
|
111
226
|
is_new_webhook?: boolean;
|
|
112
227
|
|
|
228
|
+
/**
|
|
229
|
+
* ISO timestamp when the project last subscribed to updates
|
|
230
|
+
*/
|
|
113
231
|
last_subscribed_at?: string | null;
|
|
114
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Whether triggers are enabled for this project
|
|
235
|
+
*/
|
|
115
236
|
triggers_enabled?: boolean;
|
|
116
237
|
}
|
|
117
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Response containing a list of projects
|
|
241
|
+
*/
|
|
118
242
|
export interface ProjectListResponse {
|
|
243
|
+
/**
|
|
244
|
+
* Array of projects belonging to the organization
|
|
245
|
+
*/
|
|
119
246
|
data: Array<ProjectListResponse.Data>;
|
|
120
247
|
}
|
|
121
248
|
|
|
122
249
|
export namespace ProjectListResponse {
|
|
123
250
|
export interface Data {
|
|
251
|
+
/**
|
|
252
|
+
* Unique identifier for the project
|
|
253
|
+
*/
|
|
124
254
|
id: string;
|
|
125
255
|
|
|
256
|
+
/**
|
|
257
|
+
* ISO timestamp when the project was created
|
|
258
|
+
*/
|
|
126
259
|
created_at: string;
|
|
127
260
|
|
|
261
|
+
/**
|
|
262
|
+
* Whether this project has been soft-deleted
|
|
263
|
+
*/
|
|
128
264
|
deleted: boolean;
|
|
129
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Email address associated with the project
|
|
268
|
+
*/
|
|
130
269
|
email: string;
|
|
131
270
|
|
|
271
|
+
/**
|
|
272
|
+
* URL where event webhook notifications will be sent (can be null)
|
|
273
|
+
*/
|
|
132
274
|
event_webhook_url: string | null;
|
|
133
275
|
|
|
276
|
+
/**
|
|
277
|
+
* Name of the project
|
|
278
|
+
*/
|
|
134
279
|
name: string;
|
|
135
280
|
|
|
281
|
+
/**
|
|
282
|
+
* Identifier of the organization that owns this project
|
|
283
|
+
*/
|
|
136
284
|
org_id: string;
|
|
137
285
|
|
|
286
|
+
/**
|
|
287
|
+
* ISO timestamp when the project was last updated
|
|
288
|
+
*/
|
|
138
289
|
updated_at: string;
|
|
139
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Secret key used to sign webhook payloads for verification
|
|
293
|
+
*/
|
|
140
294
|
webhook_secret: string | null;
|
|
141
295
|
|
|
296
|
+
/**
|
|
297
|
+
* URL where webhook events will be sent (can be null)
|
|
298
|
+
*/
|
|
142
299
|
webhook_url: string | null;
|
|
143
300
|
|
|
301
|
+
/**
|
|
302
|
+
* Indicates if the webhook configuration is using the new format
|
|
303
|
+
*/
|
|
144
304
|
is_new_webhook?: boolean;
|
|
145
305
|
|
|
306
|
+
/**
|
|
307
|
+
* ISO timestamp when the project last subscribed to updates
|
|
308
|
+
*/
|
|
146
309
|
last_subscribed_at?: string | null;
|
|
147
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Whether triggers are enabled for this project
|
|
313
|
+
*/
|
|
148
314
|
triggers_enabled?: boolean;
|
|
149
315
|
}
|
|
150
316
|
}
|
|
151
317
|
|
|
318
|
+
/**
|
|
319
|
+
* Response indicating the result of a project deletion operation
|
|
320
|
+
*/
|
|
152
321
|
export interface ProjectDeleteResponse {
|
|
322
|
+
/**
|
|
323
|
+
* Status of the delete operation
|
|
324
|
+
*/
|
|
153
325
|
status: string;
|
|
154
326
|
}
|
|
155
327
|
|
|
156
328
|
export interface ProjectCreateParams {
|
|
157
329
|
/**
|
|
158
|
-
*
|
|
330
|
+
* A unique name for your project that follows the required format rules
|
|
159
331
|
*/
|
|
160
332
|
name: string;
|
|
161
333
|
}
|