@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.
Files changed (185) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +7 -7
  3. package/client.d.mts +6 -6
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -6
  6. package/client.d.ts.map +1 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resources/auth-configs.d.mts +168 -29
  11. package/resources/auth-configs.d.mts.map +1 -1
  12. package/resources/auth-configs.d.ts +168 -29
  13. package/resources/auth-configs.d.ts.map +1 -1
  14. package/resources/auth-configs.js +50 -4
  15. package/resources/auth-configs.js.map +1 -1
  16. package/resources/auth-configs.mjs +50 -4
  17. package/resources/auth-configs.mjs.map +1 -1
  18. package/resources/connected-accounts.d.mts +80 -17
  19. package/resources/connected-accounts.d.mts.map +1 -1
  20. package/resources/connected-accounts.d.ts +80 -17
  21. package/resources/connected-accounts.d.ts.map +1 -1
  22. package/resources/connected-accounts.js +56 -4
  23. package/resources/connected-accounts.js.map +1 -1
  24. package/resources/connected-accounts.mjs +56 -4
  25. package/resources/connected-accounts.mjs.map +1 -1
  26. package/resources/files.d.mts +72 -23
  27. package/resources/files.d.mts.map +1 -1
  28. package/resources/files.d.ts +72 -23
  29. package/resources/files.d.ts.map +1 -1
  30. package/resources/files.js +20 -2
  31. package/resources/files.js.map +1 -1
  32. package/resources/files.mjs +20 -2
  33. package/resources/files.mjs.map +1 -1
  34. package/resources/index.d.mts +3 -3
  35. package/resources/index.d.mts.map +1 -1
  36. package/resources/index.d.ts +3 -3
  37. package/resources/index.d.ts.map +1 -1
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs.map +1 -1
  40. package/resources/mcp/custom.d.mts +87 -0
  41. package/resources/mcp/custom.d.mts.map +1 -0
  42. package/resources/mcp/custom.d.ts +87 -0
  43. package/resources/mcp/custom.d.ts.map +1 -0
  44. package/resources/mcp/custom.js +26 -0
  45. package/resources/mcp/custom.js.map +1 -0
  46. package/resources/mcp/custom.mjs +22 -0
  47. package/resources/mcp/custom.mjs.map +1 -0
  48. package/resources/mcp/index.d.mts +2 -2
  49. package/resources/mcp/index.d.mts.map +1 -1
  50. package/resources/mcp/index.d.ts +2 -2
  51. package/resources/mcp/index.d.ts.map +1 -1
  52. package/resources/mcp/index.js +3 -3
  53. package/resources/mcp/index.js.map +1 -1
  54. package/resources/mcp/index.mjs +1 -1
  55. package/resources/mcp/index.mjs.map +1 -1
  56. package/resources/mcp/mcp.d.mts +322 -217
  57. package/resources/mcp/mcp.d.mts.map +1 -1
  58. package/resources/mcp/mcp.d.ts +322 -217
  59. package/resources/mcp/mcp.d.ts.map +1 -1
  60. package/resources/mcp/mcp.js +72 -25
  61. package/resources/mcp/mcp.js.map +1 -1
  62. package/resources/mcp/mcp.mjs +72 -25
  63. package/resources/mcp/mcp.mjs.map +1 -1
  64. package/resources/migration.d.mts +11 -2
  65. package/resources/migration.d.mts.map +1 -1
  66. package/resources/migration.d.ts +11 -2
  67. package/resources/migration.d.ts.map +1 -1
  68. package/resources/migration.js +3 -1
  69. package/resources/migration.js.map +1 -1
  70. package/resources/migration.mjs +3 -1
  71. package/resources/migration.mjs.map +1 -1
  72. package/resources/org/api-key.d.mts +23 -2
  73. package/resources/org/api-key.d.mts.map +1 -1
  74. package/resources/org/api-key.d.ts +23 -2
  75. package/resources/org/api-key.d.ts.map +1 -1
  76. package/resources/org/api-key.js +15 -2
  77. package/resources/org/api-key.js.map +1 -1
  78. package/resources/org/api-key.mjs +15 -2
  79. package/resources/org/api-key.mjs.map +1 -1
  80. package/resources/org/project/api-keys.d.mts +114 -22
  81. package/resources/org/project/api-keys.d.mts.map +1 -1
  82. package/resources/org/project/api-keys.d.ts +114 -22
  83. package/resources/org/project/api-keys.d.ts.map +1 -1
  84. package/resources/org/project/api-keys.js +57 -0
  85. package/resources/org/project/api-keys.js.map +1 -1
  86. package/resources/org/project/api-keys.mjs +57 -0
  87. package/resources/org/project/api-keys.mjs.map +1 -1
  88. package/resources/org/project/project.d.mts +176 -4
  89. package/resources/org/project/project.d.mts.map +1 -1
  90. package/resources/org/project/project.d.ts +176 -4
  91. package/resources/org/project/project.d.ts.map +1 -1
  92. package/resources/org/project/project.js +46 -3
  93. package/resources/org/project/project.js.map +1 -1
  94. package/resources/org/project/project.mjs +46 -3
  95. package/resources/org/project/project.mjs.map +1 -1
  96. package/resources/org/project/trigger.d.mts +101 -1
  97. package/resources/org/project/trigger.d.mts.map +1 -1
  98. package/resources/org/project/trigger.d.ts +101 -1
  99. package/resources/org/project/trigger.d.ts.map +1 -1
  100. package/resources/org/project/trigger.js +21 -0
  101. package/resources/org/project/trigger.js.map +1 -1
  102. package/resources/org/project/trigger.mjs +21 -0
  103. package/resources/org/project/trigger.mjs.map +1 -1
  104. package/resources/org/project/webhook.d.mts +86 -15
  105. package/resources/org/project/webhook.d.mts.map +1 -1
  106. package/resources/org/project/webhook.d.ts +86 -15
  107. package/resources/org/project/webhook.d.ts.map +1 -1
  108. package/resources/org/project/webhook.js +49 -2
  109. package/resources/org/project/webhook.js.map +1 -1
  110. package/resources/org/project/webhook.mjs +49 -2
  111. package/resources/org/project/webhook.mjs.map +1 -1
  112. package/resources/team-members.d.mts +7 -7
  113. package/resources/team-members.d.mts.map +1 -1
  114. package/resources/team-members.d.ts +7 -7
  115. package/resources/team-members.d.ts.map +1 -1
  116. package/resources/toolkits.d.mts +195 -7
  117. package/resources/toolkits.d.mts.map +1 -1
  118. package/resources/toolkits.d.ts +195 -7
  119. package/resources/toolkits.d.ts.map +1 -1
  120. package/resources/toolkits.js +14 -6
  121. package/resources/toolkits.js.map +1 -1
  122. package/resources/toolkits.mjs +14 -6
  123. package/resources/toolkits.mjs.map +1 -1
  124. package/resources/tools.d.mts +211 -44
  125. package/resources/tools.d.mts.map +1 -1
  126. package/resources/tools.d.ts +211 -44
  127. package/resources/tools.d.ts.map +1 -1
  128. package/resources/tools.js +62 -9
  129. package/resources/tools.js.map +1 -1
  130. package/resources/tools.mjs +62 -9
  131. package/resources/tools.mjs.map +1 -1
  132. package/resources/trigger-instances/index.d.mts +1 -1
  133. package/resources/trigger-instances/index.d.mts.map +1 -1
  134. package/resources/trigger-instances/index.d.ts +1 -1
  135. package/resources/trigger-instances/index.d.ts.map +1 -1
  136. package/resources/trigger-instances/trigger-instances.d.mts +86 -19
  137. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  138. package/resources/trigger-instances/trigger-instances.d.ts +86 -19
  139. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  140. package/resources/trigger-instances/trigger-instances.js +6 -6
  141. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  142. package/resources/trigger-instances/trigger-instances.mjs +6 -6
  143. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  144. package/resources/triggers-types.d.mts +96 -2
  145. package/resources/triggers-types.d.mts.map +1 -1
  146. package/resources/triggers-types.d.ts +96 -2
  147. package/resources/triggers-types.d.ts.map +1 -1
  148. package/resources/triggers-types.js +23 -1
  149. package/resources/triggers-types.js.map +1 -1
  150. package/resources/triggers-types.mjs +23 -1
  151. package/resources/triggers-types.mjs.map +1 -1
  152. package/src/client.ts +6 -6
  153. package/src/resources/auth-configs.ts +169 -29
  154. package/src/resources/connected-accounts.ts +80 -17
  155. package/src/resources/files.ts +75 -23
  156. package/src/resources/index.ts +3 -3
  157. package/src/resources/mcp/custom.ts +103 -0
  158. package/src/resources/mcp/index.ts +2 -3
  159. package/src/resources/mcp/mcp.ts +342 -256
  160. package/src/resources/migration.ts +11 -2
  161. package/src/resources/org/api-key.ts +23 -2
  162. package/src/resources/org/project/api-keys.ts +117 -22
  163. package/src/resources/org/project/project.ts +176 -4
  164. package/src/resources/org/project/trigger.ts +101 -1
  165. package/src/resources/org/project/webhook.ts +86 -15
  166. package/src/resources/team-members.ts +7 -7
  167. package/src/resources/toolkits.ts +200 -7
  168. package/src/resources/tools.ts +213 -46
  169. package/src/resources/trigger-instances/index.ts +1 -1
  170. package/src/resources/trigger-instances/trigger-instances.ts +106 -25
  171. package/src/resources/triggers-types.ts +96 -2
  172. package/src/version.ts +1 -1
  173. package/version.d.mts +1 -1
  174. package/version.d.ts +1 -1
  175. package/version.js +1 -1
  176. package/version.mjs +1 -1
  177. package/resources/mcp/command.d.mts +0 -37
  178. package/resources/mcp/command.d.mts.map +0 -1
  179. package/resources/mcp/command.d.ts +0 -37
  180. package/resources/mcp/command.d.ts.map +0 -1
  181. package/resources/mcp/command.js +0 -15
  182. package/resources/mcp/command.js.map +0 -1
  183. package/resources/mcp/command.mjs +0 -11
  184. package/resources/mcp/command.mjs.map +0 -1
  185. package/src/resources/mcp/command.ts +0 -50
@@ -2,104 +2,196 @@ import { APIResource } from "../../../core/resource.mjs";
2
2
  import { APIPromise } from "../../../core/api-promise.mjs";
3
3
  import { RequestOptions } from "../../../internal/request-options.mjs";
4
4
  export declare class APIKeys extends APIResource {
5
+ /**
6
+ * Creates a new API key for the specified project. API keys are used for
7
+ * authenticating requests to the API. This endpoint generates a new key with the
8
+ * provided name and returns the complete key details including the actual key
9
+ * value. Note that the full API key value is only returned once at creation time
10
+ * and cannot be retrieved later, so it should be securely stored immediately.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const apiKey = await client.org.project.apiKeys.create(
15
+ * 'proj_abc123xyz456',
16
+ * { name: 'Production API Key' },
17
+ * );
18
+ * ```
19
+ */
5
20
  create(projectID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKeyCreateResponse>;
21
+ /**
22
+ * Retrieves all API keys associated with the specified project. This endpoint
23
+ * returns details about each API key including its name, creation date, and last
24
+ * used information. Use this endpoint to audit which keys exist for a project or
25
+ * to manage key rotation policies.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const apiKeys = await client.org.project.apiKeys.list(
30
+ * 'proj_abc123xyz456',
31
+ * );
32
+ * ```
33
+ */
6
34
  list(projectID: string, options?: RequestOptions): APIPromise<APIKeyListResponse>;
35
+ /**
36
+ * Permanently deletes an API key from the specified project. Once deleted, the API
37
+ * key can no longer be used for authentication and any services using it will need
38
+ * to be updated with a new key. This operation cannot be undone, so it should be
39
+ * used with caution.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const apiKey = await client.org.project.apiKeys.delete(
44
+ * '01H4DKRF5SMP7NQCA3BWT0JYB6',
45
+ * { projectId: 'proj_abc123xyz456' },
46
+ * );
47
+ * ```
48
+ */
7
49
  delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
50
+ /**
51
+ * Retrieves an existing API key for the project or creates a new one if none
52
+ * exists. This endpoint is useful for ensuring a project always has at least one
53
+ * API key without the risk of creating duplicates. If an API key already exists,
54
+ * it returns the existing key. If no API keys exist for the project, it creates a
55
+ * new one with an automatically generated name.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const response =
60
+ * await client.org.project.apiKeys.createAPIKey(
61
+ * 'proj_abc123xyz456',
62
+ * );
63
+ * ```
64
+ */
8
65
  createAPIKey(projectID: string, options?: RequestOptions): APIPromise<APIKeyCreateAPIKeyResponse>;
9
66
  }
67
+ /**
68
+ * API key object containing the key details
69
+ */
10
70
  export interface APIKeyCreateResponse {
11
71
  /**
12
- * API key ID
72
+ * Database record identifier for the API key
13
73
  */
14
74
  id: string;
15
75
  /**
16
- * Creation timestamp
76
+ * UTC timestamp indicating when the API key was created
77
+ */
78
+ created_at: string;
79
+ /**
80
+ * @deprecated UTC timestamp indicating when the API key was created. DEPRECATED:
81
+ * Use created_at instead.
17
82
  */
18
83
  createdAt: string;
19
84
  /**
20
- * API key value
85
+ * The API key string value that should be included in API requests. This value is
86
+ * only shown once at creation time.
21
87
  */
22
88
  key: string;
23
89
  /**
24
- * API key name
90
+ * Descriptive name assigned to help identify the key's purpose
25
91
  */
26
92
  name: string;
27
93
  /**
28
- * Last used timestamp
94
+ * UTC timestamp indicating when the API key was last used for authentication. Will
95
+ * be null for newly created keys.
29
96
  */
30
- lastUsed?: string;
97
+ last_used_at?: string;
31
98
  }
99
+ /**
100
+ * Response containing the list of API keys for a project
101
+ */
32
102
  export interface APIKeyListResponse {
33
103
  /**
34
- * List of API keys
104
+ * List of all API keys for the specified project, including their properties and
105
+ * usage information
35
106
  */
36
107
  items: Array<APIKeyListResponse.Item>;
37
108
  }
38
109
  export declare namespace APIKeyListResponse {
39
110
  interface Item {
40
111
  /**
41
- * API key ID
112
+ * Unique identifier for the API key record
42
113
  */
43
114
  id: string;
44
115
  /**
45
- * Creation timestamp
116
+ * UTC timestamp indicating when the API key was created
46
117
  */
47
118
  created_at: string;
48
119
  /**
49
- * API key value
120
+ * The API key string that should be included in API requests for authentication
50
121
  */
51
122
  key: string;
52
123
  /**
53
- * API key name
124
+ * Descriptive name assigned to the API key for identification purposes
54
125
  */
55
126
  name: string;
56
127
  /**
57
- * Last used timestamp
128
+ * UTC timestamp indicating when the API key was last used for authentication. Will
129
+ * be null if the key has never been used.
58
130
  */
59
131
  last_used?: string;
60
132
  }
61
133
  }
134
+ /**
135
+ * Response indicating the status of the API key deletion operation
136
+ */
62
137
  export interface APIKeyDeleteResponse {
63
138
  /**
64
- * Status message
139
+ * Status message providing details about the deletion operation
65
140
  */
66
141
  message: string;
67
142
  /**
68
- * Whether the operation was successful
143
+ * Boolean flag indicating if the deletion operation was successful
69
144
  */
70
145
  success: boolean;
71
146
  }
147
+ /**
148
+ * API key object containing the key details
149
+ */
72
150
  export interface APIKeyCreateAPIKeyResponse {
73
151
  /**
74
- * API key ID
152
+ * Database record identifier for the API key
75
153
  */
76
154
  id: string;
77
155
  /**
78
- * Creation timestamp
156
+ * UTC timestamp indicating when the API key was created
157
+ */
158
+ created_at: string;
159
+ /**
160
+ * @deprecated UTC timestamp indicating when the API key was created. Use
161
+ * created_at instead.
79
162
  */
80
163
  createdAt: string;
81
164
  /**
82
- * API key value
165
+ * The API key string value that should be included in API requests. This value is
166
+ * only shown once.
83
167
  */
84
168
  key: string;
85
169
  /**
86
- * API key name
170
+ * @deprecated UTC timestamp indicating when the API key was created. Use
171
+ * last_used_at instead.
172
+ */
173
+ lastUsedAt: string;
174
+ /**
175
+ * Name assigned to help identify the key's purpose. For auto-generated keys, this
176
+ * will be a random name.
87
177
  */
88
178
  name: string;
89
179
  /**
90
- * Last used timestamp
180
+ * UTC timestamp indicating when the API key was last used for authentication. Will
181
+ * be null for newly created keys.
91
182
  */
92
- lastUsed?: string;
183
+ last_used_at?: string;
93
184
  }
94
185
  export interface APIKeyCreateParams {
95
186
  /**
96
- * API key name
187
+ * A user-friendly name to identify the API key's purpose (e.g., "Production
188
+ * Server", "Test Environment")
97
189
  */
98
190
  name: string;
99
191
  }
100
192
  export interface APIKeyDeleteParams {
101
193
  /**
102
- * Project ID
194
+ * The project Nano ID that owns the API key to be deleted
103
195
  */
104
196
  projectId: string;
105
197
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.d.mts","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIjF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAK1G,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGlG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AI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -2,104 +2,196 @@ import { APIResource } from "../../../core/resource.js";
2
2
  import { APIPromise } from "../../../core/api-promise.js";
3
3
  import { RequestOptions } from "../../../internal/request-options.js";
4
4
  export declare class APIKeys extends APIResource {
5
+ /**
6
+ * Creates a new API key for the specified project. API keys are used for
7
+ * authenticating requests to the API. This endpoint generates a new key with the
8
+ * provided name and returns the complete key details including the actual key
9
+ * value. Note that the full API key value is only returned once at creation time
10
+ * and cannot be retrieved later, so it should be securely stored immediately.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const apiKey = await client.org.project.apiKeys.create(
15
+ * 'proj_abc123xyz456',
16
+ * { name: 'Production API Key' },
17
+ * );
18
+ * ```
19
+ */
5
20
  create(projectID: string, body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKeyCreateResponse>;
21
+ /**
22
+ * Retrieves all API keys associated with the specified project. This endpoint
23
+ * returns details about each API key including its name, creation date, and last
24
+ * used information. Use this endpoint to audit which keys exist for a project or
25
+ * to manage key rotation policies.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const apiKeys = await client.org.project.apiKeys.list(
30
+ * 'proj_abc123xyz456',
31
+ * );
32
+ * ```
33
+ */
6
34
  list(projectID: string, options?: RequestOptions): APIPromise<APIKeyListResponse>;
35
+ /**
36
+ * Permanently deletes an API key from the specified project. Once deleted, the API
37
+ * key can no longer be used for authentication and any services using it will need
38
+ * to be updated with a new key. This operation cannot be undone, so it should be
39
+ * used with caution.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * const apiKey = await client.org.project.apiKeys.delete(
44
+ * '01H4DKRF5SMP7NQCA3BWT0JYB6',
45
+ * { projectId: 'proj_abc123xyz456' },
46
+ * );
47
+ * ```
48
+ */
7
49
  delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse>;
50
+ /**
51
+ * Retrieves an existing API key for the project or creates a new one if none
52
+ * exists. This endpoint is useful for ensuring a project always has at least one
53
+ * API key without the risk of creating duplicates. If an API key already exists,
54
+ * it returns the existing key. If no API keys exist for the project, it creates a
55
+ * new one with an automatically generated name.
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const response =
60
+ * await client.org.project.apiKeys.createAPIKey(
61
+ * 'proj_abc123xyz456',
62
+ * );
63
+ * ```
64
+ */
8
65
  createAPIKey(projectID: string, options?: RequestOptions): APIPromise<APIKeyCreateAPIKeyResponse>;
9
66
  }
67
+ /**
68
+ * API key object containing the key details
69
+ */
10
70
  export interface APIKeyCreateResponse {
11
71
  /**
12
- * API key ID
72
+ * Database record identifier for the API key
13
73
  */
14
74
  id: string;
15
75
  /**
16
- * Creation timestamp
76
+ * UTC timestamp indicating when the API key was created
77
+ */
78
+ created_at: string;
79
+ /**
80
+ * @deprecated UTC timestamp indicating when the API key was created. DEPRECATED:
81
+ * Use created_at instead.
17
82
  */
18
83
  createdAt: string;
19
84
  /**
20
- * API key value
85
+ * The API key string value that should be included in API requests. This value is
86
+ * only shown once at creation time.
21
87
  */
22
88
  key: string;
23
89
  /**
24
- * API key name
90
+ * Descriptive name assigned to help identify the key's purpose
25
91
  */
26
92
  name: string;
27
93
  /**
28
- * Last used timestamp
94
+ * UTC timestamp indicating when the API key was last used for authentication. Will
95
+ * be null for newly created keys.
29
96
  */
30
- lastUsed?: string;
97
+ last_used_at?: string;
31
98
  }
99
+ /**
100
+ * Response containing the list of API keys for a project
101
+ */
32
102
  export interface APIKeyListResponse {
33
103
  /**
34
- * List of API keys
104
+ * List of all API keys for the specified project, including their properties and
105
+ * usage information
35
106
  */
36
107
  items: Array<APIKeyListResponse.Item>;
37
108
  }
38
109
  export declare namespace APIKeyListResponse {
39
110
  interface Item {
40
111
  /**
41
- * API key ID
112
+ * Unique identifier for the API key record
42
113
  */
43
114
  id: string;
44
115
  /**
45
- * Creation timestamp
116
+ * UTC timestamp indicating when the API key was created
46
117
  */
47
118
  created_at: string;
48
119
  /**
49
- * API key value
120
+ * The API key string that should be included in API requests for authentication
50
121
  */
51
122
  key: string;
52
123
  /**
53
- * API key name
124
+ * Descriptive name assigned to the API key for identification purposes
54
125
  */
55
126
  name: string;
56
127
  /**
57
- * Last used timestamp
128
+ * UTC timestamp indicating when the API key was last used for authentication. Will
129
+ * be null if the key has never been used.
58
130
  */
59
131
  last_used?: string;
60
132
  }
61
133
  }
134
+ /**
135
+ * Response indicating the status of the API key deletion operation
136
+ */
62
137
  export interface APIKeyDeleteResponse {
63
138
  /**
64
- * Status message
139
+ * Status message providing details about the deletion operation
65
140
  */
66
141
  message: string;
67
142
  /**
68
- * Whether the operation was successful
143
+ * Boolean flag indicating if the deletion operation was successful
69
144
  */
70
145
  success: boolean;
71
146
  }
147
+ /**
148
+ * API key object containing the key details
149
+ */
72
150
  export interface APIKeyCreateAPIKeyResponse {
73
151
  /**
74
- * API key ID
152
+ * Database record identifier for the API key
75
153
  */
76
154
  id: string;
77
155
  /**
78
- * Creation timestamp
156
+ * UTC timestamp indicating when the API key was created
157
+ */
158
+ created_at: string;
159
+ /**
160
+ * @deprecated UTC timestamp indicating when the API key was created. Use
161
+ * created_at instead.
79
162
  */
80
163
  createdAt: string;
81
164
  /**
82
- * API key value
165
+ * The API key string value that should be included in API requests. This value is
166
+ * only shown once.
83
167
  */
84
168
  key: string;
85
169
  /**
86
- * API key name
170
+ * @deprecated UTC timestamp indicating when the API key was created. Use
171
+ * last_used_at instead.
172
+ */
173
+ lastUsedAt: string;
174
+ /**
175
+ * Name assigned to help identify the key's purpose. For auto-generated keys, this
176
+ * will be a random name.
87
177
  */
88
178
  name: string;
89
179
  /**
90
- * Last used timestamp
180
+ * UTC timestamp indicating when the API key was last used for authentication. Will
181
+ * be null for newly created keys.
91
182
  */
92
- lastUsed?: string;
183
+ last_used_at?: string;
93
184
  }
94
185
  export interface APIKeyCreateParams {
95
186
  /**
96
- * API key name
187
+ * A user-friendly name to identify the API key's purpose (e.g., "Production
188
+ * Server", "Test Environment")
97
189
  */
98
190
  name: string;
99
191
  }
100
192
  export interface APIKeyDeleteParams {
101
193
  /**
102
- * Project ID
194
+ * The project Nano ID that owns the API key to be deleted
103
195
  */
104
196
  projectId: string;
105
197
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,CACJ,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,kBAAkB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC;IAInC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAIjF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAK1G,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGlG;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACvC;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,IAAI;QACnB;;WAEG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,IAAI,EAAE,MAAM,CAAC;QAEb;;WAEG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CACF;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;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AE,MAAM,CAAC;KACpB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,OAAO,EACL,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,kBAAkB,IAAI,kBAAkB,GAC9C,CAAC;CACH"}
@@ -5,16 +5,73 @@ exports.APIKeys = void 0;
5
5
  const resource_1 = require("../../../core/resource.js");
6
6
  const path_1 = require("../../../internal/utils/path.js");
7
7
  class APIKeys extends resource_1.APIResource {
8
+ /**
9
+ * Creates a new API key for the specified project. API keys are used for
10
+ * authenticating requests to the API. This endpoint generates a new key with the
11
+ * provided name and returns the complete key details including the actual key
12
+ * value. Note that the full API key value is only returned once at creation time
13
+ * and cannot be retrieved later, so it should be securely stored immediately.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const apiKey = await client.org.project.apiKeys.create(
18
+ * 'proj_abc123xyz456',
19
+ * { name: 'Production API Key' },
20
+ * );
21
+ * ```
22
+ */
8
23
  create(projectID, body, options) {
9
24
  return this._client.post((0, path_1.path) `/api/v3/org/project/${projectID}/api_keys/create`, { body, ...options });
10
25
  }
26
+ /**
27
+ * Retrieves all API keys associated with the specified project. This endpoint
28
+ * returns details about each API key including its name, creation date, and last
29
+ * used information. Use this endpoint to audit which keys exist for a project or
30
+ * to manage key rotation policies.
31
+ *
32
+ * @example
33
+ * ```ts
34
+ * const apiKeys = await client.org.project.apiKeys.list(
35
+ * 'proj_abc123xyz456',
36
+ * );
37
+ * ```
38
+ */
11
39
  list(projectID, options) {
12
40
  return this._client.get((0, path_1.path) `/api/v3/org/project/${projectID}/api_keys/list`, options);
13
41
  }
42
+ /**
43
+ * Permanently deletes an API key from the specified project. Once deleted, the API
44
+ * key can no longer be used for authentication and any services using it will need
45
+ * to be updated with a new key. This operation cannot be undone, so it should be
46
+ * used with caution.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const apiKey = await client.org.project.apiKeys.delete(
51
+ * '01H4DKRF5SMP7NQCA3BWT0JYB6',
52
+ * { projectId: 'proj_abc123xyz456' },
53
+ * );
54
+ * ```
55
+ */
14
56
  delete(id, params, options) {
15
57
  const { projectId } = params;
16
58
  return this._client.delete((0, path_1.path) `/api/v3/org/project/${projectId}/api_keys/remove/${id}`, options);
17
59
  }
60
+ /**
61
+ * Retrieves an existing API key for the project or creates a new one if none
62
+ * exists. This endpoint is useful for ensuring a project always has at least one
63
+ * API key without the risk of creating duplicates. If an API key already exists,
64
+ * it returns the existing key. If no API keys exist for the project, it creates a
65
+ * new one with an automatically generated name.
66
+ *
67
+ * @example
68
+ * ```ts
69
+ * const response =
70
+ * await client.org.project.apiKeys.createAPIKey(
71
+ * 'proj_abc123xyz456',
72
+ * );
73
+ * ```
74
+ */
18
75
  createAPIKey(projectID, options) {
19
76
  return this._client.post((0, path_1.path) `/api/v3/org/project/${projectID}/api_keys/create-api-key`, options);
20
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC,MAAM,CACJ,SAAiB,EACjB,IAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,IAAI,CAAC,SAAiB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAA0B,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;IAED,YAAY,CAAC,SAAiB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;CACF;AArBD,0BAqBC"}
1
+ {"version":3,"file":"api-keys.js","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,MAAa,OAAQ,SAAQ,sBAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,SAAiB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,MAA0B,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YAAY,CAAC,SAAiB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,uBAAuB,SAAS,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;CACF;AA9ED,0BA8EC"}
@@ -2,16 +2,73 @@
2
2
  import { APIResource } from "../../../core/resource.mjs";
3
3
  import { path } from "../../../internal/utils/path.mjs";
4
4
  export class APIKeys extends APIResource {
5
+ /**
6
+ * Creates a new API key for the specified project. API keys are used for
7
+ * authenticating requests to the API. This endpoint generates a new key with the
8
+ * provided name and returns the complete key details including the actual key
9
+ * value. Note that the full API key value is only returned once at creation time
10
+ * and cannot be retrieved later, so it should be securely stored immediately.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const apiKey = await client.org.project.apiKeys.create(
15
+ * 'proj_abc123xyz456',
16
+ * { name: 'Production API Key' },
17
+ * );
18
+ * ```
19
+ */
5
20
  create(projectID, body, options) {
6
21
  return this._client.post(path `/api/v3/org/project/${projectID}/api_keys/create`, { body, ...options });
7
22
  }
23
+ /**
24
+ * Retrieves all API keys associated with the specified project. This endpoint
25
+ * returns details about each API key including its name, creation date, and last
26
+ * used information. Use this endpoint to audit which keys exist for a project or
27
+ * to manage key rotation policies.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const apiKeys = await client.org.project.apiKeys.list(
32
+ * 'proj_abc123xyz456',
33
+ * );
34
+ * ```
35
+ */
8
36
  list(projectID, options) {
9
37
  return this._client.get(path `/api/v3/org/project/${projectID}/api_keys/list`, options);
10
38
  }
39
+ /**
40
+ * Permanently deletes an API key from the specified project. Once deleted, the API
41
+ * key can no longer be used for authentication and any services using it will need
42
+ * to be updated with a new key. This operation cannot be undone, so it should be
43
+ * used with caution.
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const apiKey = await client.org.project.apiKeys.delete(
48
+ * '01H4DKRF5SMP7NQCA3BWT0JYB6',
49
+ * { projectId: 'proj_abc123xyz456' },
50
+ * );
51
+ * ```
52
+ */
11
53
  delete(id, params, options) {
12
54
  const { projectId } = params;
13
55
  return this._client.delete(path `/api/v3/org/project/${projectId}/api_keys/remove/${id}`, options);
14
56
  }
57
+ /**
58
+ * Retrieves an existing API key for the project or creates a new one if none
59
+ * exists. This endpoint is useful for ensuring a project always has at least one
60
+ * API key without the risk of creating duplicates. If an API key already exists,
61
+ * it returns the existing key. If no API keys exist for the project, it creates a
62
+ * new one with an automatically generated name.
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * const response =
67
+ * await client.org.project.apiKeys.createAPIKey(
68
+ * 'proj_abc123xyz456',
69
+ * );
70
+ * ```
71
+ */
15
72
  createAPIKey(projectID, options) {
16
73
  return this._client.post(path `/api/v3/org/project/${projectID}/api_keys/create-api-key`, options);
17
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC,MAAM,CACJ,SAAiB,EACjB,IAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAuB,SAAS,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;IAED,IAAI,CAAC,SAAiB,EAAE,OAAwB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,uBAAuB,SAAS,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAA0B,EAAE,OAAwB;QACrE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,uBAAuB,SAAS,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;IAED,YAAY,CAAC,SAAiB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAuB,SAAS,0BAA0B,EAAE,OAAO,CAAC,CAAC;IACpG,CAAC;CACF"}
1
+ {"version":3,"file":"api-keys.mjs","sourceRoot":"","sources":["../../../src/resources/org/project/api-keys.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC;;;;;;;;;;;;;;OAcG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,uBAAu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