@composio/client 0.1.0-alpha.35 → 0.1.0-alpha.37

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 (223) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +11 -14
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +11 -14
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -6
  7. package/client.js.map +1 -1
  8. package/client.mjs +5 -8
  9. package/client.mjs.map +1 -1
  10. package/internal/utils/values.js +3 -3
  11. package/internal/utils/values.js.map +1 -1
  12. package/internal/utils/values.mjs +3 -3
  13. package/internal/utils/values.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/auth-configs.d.mts +3 -3
  16. package/resources/auth-configs.d.mts.map +1 -1
  17. package/resources/auth-configs.d.ts +3 -3
  18. package/resources/auth-configs.d.ts.map +1 -1
  19. package/resources/cli.d.mts +1 -76
  20. package/resources/cli.d.mts.map +1 -1
  21. package/resources/cli.d.ts +1 -76
  22. package/resources/cli.d.ts.map +1 -1
  23. package/resources/cli.js +0 -28
  24. package/resources/cli.js.map +1 -1
  25. package/resources/cli.mjs +0 -28
  26. package/resources/cli.mjs.map +1 -1
  27. package/resources/connected-accounts.d.mts +476 -12
  28. package/resources/connected-accounts.d.mts.map +1 -1
  29. package/resources/connected-accounts.d.ts +476 -12
  30. package/resources/connected-accounts.d.ts.map +1 -1
  31. package/resources/index.d.mts +5 -6
  32. package/resources/index.d.mts.map +1 -1
  33. package/resources/index.d.ts +5 -6
  34. package/resources/index.d.ts.map +1 -1
  35. package/resources/index.js +3 -5
  36. package/resources/index.js.map +1 -1
  37. package/resources/index.mjs +2 -3
  38. package/resources/index.mjs.map +1 -1
  39. package/resources/link.d.mts +1 -86
  40. package/resources/link.d.mts.map +1 -1
  41. package/resources/link.d.ts +1 -86
  42. package/resources/link.d.ts.map +1 -1
  43. package/resources/link.js +0 -13
  44. package/resources/link.js.map +1 -1
  45. package/resources/link.mjs +0 -13
  46. package/resources/link.mjs.map +1 -1
  47. package/resources/mcp/index.d.mts +1 -1
  48. package/resources/mcp/index.d.mts.map +1 -1
  49. package/resources/mcp/index.d.ts +1 -1
  50. package/resources/mcp/index.d.ts.map +1 -1
  51. package/resources/mcp/index.js.map +1 -1
  52. package/resources/mcp/index.mjs.map +1 -1
  53. package/resources/mcp/mcp.d.mts +1 -95
  54. package/resources/mcp/mcp.d.mts.map +1 -1
  55. package/resources/mcp/mcp.d.ts +1 -95
  56. package/resources/mcp/mcp.d.ts.map +1 -1
  57. package/resources/mcp/mcp.js +0 -22
  58. package/resources/mcp/mcp.js.map +1 -1
  59. package/resources/mcp/mcp.mjs +0 -22
  60. package/resources/mcp/mcp.mjs.map +1 -1
  61. package/resources/tool-router.d.mts +77 -0
  62. package/resources/tool-router.d.mts.map +1 -0
  63. package/resources/tool-router.d.ts +77 -0
  64. package/resources/tool-router.d.ts.map +1 -0
  65. package/resources/tool-router.js +32 -0
  66. package/resources/tool-router.js.map +1 -0
  67. package/resources/tool-router.mjs +28 -0
  68. package/resources/tool-router.mjs.map +1 -0
  69. package/resources/toolkits.d.mts +16 -2
  70. package/resources/toolkits.d.mts.map +1 -1
  71. package/resources/toolkits.d.ts +16 -2
  72. package/resources/toolkits.d.ts.map +1 -1
  73. package/resources/toolkits.js +2 -2
  74. package/resources/toolkits.js.map +1 -1
  75. package/resources/toolkits.mjs +2 -2
  76. package/resources/toolkits.mjs.map +1 -1
  77. package/resources/tools.d.mts +80 -4
  78. package/resources/tools.d.mts.map +1 -1
  79. package/resources/tools.d.ts +80 -4
  80. package/resources/tools.d.ts.map +1 -1
  81. package/resources/trigger-instances/index.d.mts +0 -1
  82. package/resources/trigger-instances/index.d.mts.map +1 -1
  83. package/resources/trigger-instances/index.d.ts +0 -1
  84. package/resources/trigger-instances/index.d.ts.map +1 -1
  85. package/resources/trigger-instances/index.js +1 -3
  86. package/resources/trigger-instances/index.js.map +1 -1
  87. package/resources/trigger-instances/index.mjs +0 -1
  88. package/resources/trigger-instances/index.mjs.map +1 -1
  89. package/resources/trigger-instances/trigger-instances.d.mts +0 -4
  90. package/resources/trigger-instances/trigger-instances.d.mts.map +1 -1
  91. package/resources/trigger-instances/trigger-instances.d.ts +0 -4
  92. package/resources/trigger-instances/trigger-instances.d.ts.map +1 -1
  93. package/resources/trigger-instances/trigger-instances.js +0 -4
  94. package/resources/trigger-instances/trigger-instances.js.map +1 -1
  95. package/resources/trigger-instances/trigger-instances.mjs +0 -4
  96. package/resources/trigger-instances/trigger-instances.mjs.map +1 -1
  97. package/src/client.ts +16 -46
  98. package/src/internal/utils/values.ts +3 -3
  99. package/src/resources/auth-configs.ts +6 -3
  100. package/src/resources/cli.ts +0 -89
  101. package/src/resources/connected-accounts.ts +967 -67
  102. package/src/resources/index.ts +6 -19
  103. package/src/resources/link.ts +1 -131
  104. package/src/resources/mcp/index.ts +0 -2
  105. package/src/resources/mcp/mcp.ts +0 -123
  106. package/src/resources/tool-router.ts +96 -0
  107. package/src/resources/toolkits.ts +24 -2
  108. package/src/resources/tools.ts +141 -6
  109. package/src/resources/trigger-instances/index.ts +0 -7
  110. package/src/resources/trigger-instances/trigger-instances.ts +0 -18
  111. package/src/version.ts +1 -1
  112. package/version.d.mts +1 -1
  113. package/version.d.ts +1 -1
  114. package/version.js +1 -1
  115. package/version.mjs +1 -1
  116. package/resources/org/api-key.d.mts +0 -44
  117. package/resources/org/api-key.d.mts.map +0 -1
  118. package/resources/org/api-key.d.ts +0 -44
  119. package/resources/org/api-key.d.ts.map +0 -1
  120. package/resources/org/api-key.js +0 -34
  121. package/resources/org/api-key.js.map +0 -1
  122. package/resources/org/api-key.mjs +0 -30
  123. package/resources/org/api-key.mjs.map +0 -1
  124. package/resources/org/index.d.mts +0 -4
  125. package/resources/org/index.d.mts.map +0 -1
  126. package/resources/org/index.d.ts +0 -4
  127. package/resources/org/index.d.ts.map +0 -1
  128. package/resources/org/index.js +0 -11
  129. package/resources/org/index.js.map +0 -1
  130. package/resources/org/index.mjs +0 -5
  131. package/resources/org/index.mjs.map +0 -1
  132. package/resources/org/org.d.mts +0 -14
  133. package/resources/org/org.d.mts.map +0 -1
  134. package/resources/org/org.d.ts +0 -14
  135. package/resources/org/org.d.ts.map +0 -1
  136. package/resources/org/org.js +0 -21
  137. package/resources/org/org.js.map +0 -1
  138. package/resources/org/org.mjs +0 -16
  139. package/resources/org/org.mjs.map +0 -1
  140. package/resources/org/project/api-keys.d.mts +0 -142
  141. package/resources/org/project/api-keys.d.mts.map +0 -1
  142. package/resources/org/project/api-keys.d.ts +0 -142
  143. package/resources/org/project/api-keys.d.ts.map +0 -1
  144. package/resources/org/project/api-keys.js +0 -62
  145. package/resources/org/project/api-keys.js.map +0 -1
  146. package/resources/org/project/api-keys.mjs +0 -58
  147. package/resources/org/project/api-keys.mjs.map +0 -1
  148. package/resources/org/project/index.d.mts +0 -5
  149. package/resources/org/project/index.d.mts.map +0 -1
  150. package/resources/org/project/index.d.ts +0 -5
  151. package/resources/org/project/index.d.ts.map +0 -1
  152. package/resources/org/project/index.js +0 -13
  153. package/resources/org/project/index.js.map +0 -1
  154. package/resources/org/project/index.mjs +0 -6
  155. package/resources/org/project/index.mjs.map +0 -1
  156. package/resources/org/project/project.d.mts +0 -268
  157. package/resources/org/project/project.d.mts.map +0 -1
  158. package/resources/org/project/project.d.ts +0 -268
  159. package/resources/org/project/project.d.ts.map +0 -1
  160. package/resources/org/project/project.js +0 -90
  161. package/resources/org/project/project.js.map +0 -1
  162. package/resources/org/project/project.mjs +0 -85
  163. package/resources/org/project/project.mjs.map +0 -1
  164. package/resources/org/project/trigger.d.mts +0 -145
  165. package/resources/org/project/trigger.d.mts.map +0 -1
  166. package/resources/org/project/trigger.d.ts +0 -145
  167. package/resources/org/project/trigger.d.ts.map +0 -1
  168. package/resources/org/project/trigger.js +0 -35
  169. package/resources/org/project/trigger.js.map +0 -1
  170. package/resources/org/project/trigger.mjs +0 -31
  171. package/resources/org/project/trigger.mjs.map +0 -1
  172. package/resources/org/project/webhook.d.mts +0 -166
  173. package/resources/org/project/webhook.d.mts.map +0 -1
  174. package/resources/org/project/webhook.d.ts +0 -166
  175. package/resources/org/project/webhook.d.ts.map +0 -1
  176. package/resources/org/project/webhook.js +0 -74
  177. package/resources/org/project/webhook.js.map +0 -1
  178. package/resources/org/project/webhook.mjs +0 -70
  179. package/resources/org/project/webhook.mjs.map +0 -1
  180. package/resources/org/project.d.mts +0 -2
  181. package/resources/org/project.d.mts.map +0 -1
  182. package/resources/org/project.d.ts +0 -2
  183. package/resources/org/project.d.ts.map +0 -1
  184. package/resources/org/project.js +0 -6
  185. package/resources/org/project.js.map +0 -1
  186. package/resources/org/project.mjs +0 -3
  187. package/resources/org/project.mjs.map +0 -1
  188. package/resources/org.d.mts +0 -2
  189. package/resources/org.d.mts.map +0 -1
  190. package/resources/org.d.ts +0 -2
  191. package/resources/org.d.ts.map +0 -1
  192. package/resources/org.js +0 -6
  193. package/resources/org.js.map +0 -1
  194. package/resources/org.mjs +0 -3
  195. package/resources/org.mjs.map +0 -1
  196. package/resources/team-members.d.mts +0 -55
  197. package/resources/team-members.d.mts.map +0 -1
  198. package/resources/team-members.d.ts +0 -55
  199. package/resources/team-members.d.ts.map +0 -1
  200. package/resources/team-members.js +0 -38
  201. package/resources/team-members.js.map +0 -1
  202. package/resources/team-members.mjs +0 -34
  203. package/resources/team-members.mjs.map +0 -1
  204. package/resources/trigger-instances/handle.d.mts +0 -25
  205. package/resources/trigger-instances/handle.d.mts.map +0 -1
  206. package/resources/trigger-instances/handle.d.ts +0 -25
  207. package/resources/trigger-instances/handle.d.ts.map +0 -1
  208. package/resources/trigger-instances/handle.js +0 -18
  209. package/resources/trigger-instances/handle.js.map +0 -1
  210. package/resources/trigger-instances/handle.mjs +0 -14
  211. package/resources/trigger-instances/handle.mjs.map +0 -1
  212. package/src/resources/org/api-key.ts +0 -57
  213. package/src/resources/org/index.ts +0 -13
  214. package/src/resources/org/org.ts +0 -41
  215. package/src/resources/org/project/api-keys.ts +0 -180
  216. package/src/resources/org/project/index.ts +0 -35
  217. package/src/resources/org/project/project.ts +0 -381
  218. package/src/resources/org/project/trigger.ts +0 -188
  219. package/src/resources/org/project/webhook.ts +0 -205
  220. package/src/resources/org/project.ts +0 -3
  221. package/src/resources/org.ts +0 -3
  222. package/src/resources/team-members.ts +0 -101
  223. package/src/resources/trigger-instances/handle.ts +0 -53
@@ -1,25 +0,0 @@
1
- import { APIResource } from "../../core/resource.js";
2
- import { APIPromise } from "../../core/api-promise.js";
3
- import { RequestOptions } from "../../internal/request-options.js";
4
- export declare class Handle extends APIResource {
5
- retrieve(projectID: (string & {}) | 'default', params: HandleRetrieveParams, options?: RequestOptions): APIPromise<string>;
6
- execute(projectID: (string & {}) | 'default', params: HandleExecuteParams, options?: RequestOptions): APIPromise<string>;
7
- }
8
- export type HandleRetrieveResponse = string;
9
- export type HandleExecuteResponse = string;
10
- export interface HandleRetrieveParams {
11
- /**
12
- * The slug of the trigger instance
13
- */
14
- slug: string;
15
- }
16
- export interface HandleExecuteParams {
17
- /**
18
- * The slug of the trigger instance
19
- */
20
- slug: string;
21
- }
22
- export declare namespace Handle {
23
- export { type HandleRetrieveResponse as HandleRetrieveResponse, type HandleExecuteResponse as HandleExecuteResponse, type HandleRetrieveParams as HandleRetrieveParams, type HandleExecuteParams as HandleExecuteParams, };
24
- }
25
- //# sourceMappingURL=handle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handle.d.ts","sourceRoot":"","sources":["../../src/resources/trigger-instances/handle.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,MAAO,SAAQ,WAAW;IACrC,QAAQ,CACN,SAAS,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,SAAS,EACpC,MAAM,EAAE,oBAAoB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;IAKrB,OAAO,CACL,SAAS,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,SAAS,EACpC,MAAM,EAAE,mBAAmB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,MAAM,CAAC;CAItB;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAE5C,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,mBAAmB,IAAI,mBAAmB,GAChD,CAAC;CACH"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Handle = void 0;
5
- const resource_1 = require("../../core/resource.js");
6
- const path_1 = require("../../internal/utils/path.js");
7
- class Handle extends resource_1.APIResource {
8
- retrieve(projectID, params, options) {
9
- const { slug } = params;
10
- return this._client.get((0, path_1.path) `/api/v3/trigger_instances/${slug}/${projectID}/handle`, options);
11
- }
12
- execute(projectID, params, options) {
13
- const { slug } = params;
14
- return this._client.post((0, path_1.path) `/api/v3/trigger_instances/${slug}/${projectID}/handle`, options);
15
- }
16
- }
17
- exports.Handle = Handle;
18
- //# sourceMappingURL=handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handle.js","sourceRoot":"","sources":["../../src/resources/trigger-instances/handle.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,MAAO,SAAQ,sBAAW;IACrC,QAAQ,CACN,SAAoC,EACpC,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,6BAA6B,IAAI,IAAI,SAAS,SAAS,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED,OAAO,CACL,SAAoC,EACpC,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,6BAA6B,IAAI,IAAI,SAAS,SAAS,EAAE,OAAO,CAAC,CAAC;IACjG,CAAC;CACF;AAlBD,wBAkBC"}
@@ -1,14 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../core/resource.mjs";
3
- import { path } from "../../internal/utils/path.mjs";
4
- export class Handle extends APIResource {
5
- retrieve(projectID, params, options) {
6
- const { slug } = params;
7
- return this._client.get(path `/api/v3/trigger_instances/${slug}/${projectID}/handle`, options);
8
- }
9
- execute(projectID, params, options) {
10
- const { slug } = params;
11
- return this._client.post(path `/api/v3/trigger_instances/${slug}/${projectID}/handle`, options);
12
- }
13
- }
14
- //# sourceMappingURL=handle.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handle.mjs","sourceRoot":"","sources":["../../src/resources/trigger-instances/handle.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC,QAAQ,CACN,SAAoC,EACpC,MAA4B,EAC5B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,6BAA6B,IAAI,IAAI,SAAS,SAAS,EAAE,OAAO,CAAC,CAAC;IAChG,CAAC;IAED,OAAO,CACL,SAAoC,EACpC,MAA2B,EAC3B,OAAwB;QAExB,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,6BAA6B,IAAI,IAAI,SAAS,SAAS,EAAE,OAAO,CAAC,CAAC;IACjG,CAAC;CACF"}
@@ -1,57 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import { APIPromise } from '../../core/api-promise';
5
- import { RequestOptions } from '../../internal/request-options';
6
-
7
- export class APIKey extends APIResource {
8
- /**
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
- * ```
17
- */
18
- retrieve(options?: RequestOptions): APIPromise<APIKeyRetrieveResponse> {
19
- return this._client.get('/api/v3/org/api_key', options);
20
- }
21
-
22
- /**
23
- * Generate a new API key for the organization, invalidating the previous one
24
- * (admin only).
25
- *
26
- * @example
27
- * ```ts
28
- * const response = await client.org.apiKey.regenerate();
29
- * ```
30
- */
31
- regenerate(options?: RequestOptions): APIPromise<APIKeyRegenerateResponse> {
32
- return this._client.post('/api/v3/org/api_key/regenerate', options);
33
- }
34
- }
35
-
36
- export interface APIKeyRetrieveResponse {
37
- /**
38
- * The API key for the organization that can be used for authentication. Format:
39
- * org_xxx
40
- */
41
- org_api_key: string;
42
- }
43
-
44
- export interface APIKeyRegenerateResponse {
45
- /**
46
- * The newly generated API key for the organization that can be used for
47
- * authentication. Format: org_xxx
48
- */
49
- org_api_key: string;
50
- }
51
-
52
- export declare namespace APIKey {
53
- export {
54
- type APIKeyRetrieveResponse as APIKeyRetrieveResponse,
55
- type APIKeyRegenerateResponse as APIKeyRegenerateResponse,
56
- };
57
- }
@@ -1,13 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- export { APIKey, type APIKeyRetrieveResponse, type APIKeyRegenerateResponse } from './api-key';
4
- export { Org } from './org';
5
- export {
6
- Project,
7
- type ProjectCreateResponse,
8
- type ProjectRetrieveResponse,
9
- type ProjectListResponse,
10
- type ProjectDeleteResponse,
11
- type ProjectCreateParams,
12
- type ProjectListParams,
13
- } from './project/index';
@@ -1,41 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../core/resource';
4
- import * as APIKeyAPI from './api-key';
5
- import { APIKey, APIKeyRegenerateResponse, APIKeyRetrieveResponse } from './api-key';
6
- import * as ProjectAPI from './project/project';
7
- import {
8
- Project,
9
- ProjectCreateParams,
10
- ProjectCreateResponse,
11
- ProjectDeleteResponse,
12
- ProjectListParams,
13
- ProjectListResponse,
14
- ProjectRetrieveResponse,
15
- } from './project/project';
16
-
17
- export class Org extends APIResource {
18
- apiKey: APIKeyAPI.APIKey = new APIKeyAPI.APIKey(this._client);
19
- project: ProjectAPI.Project = new ProjectAPI.Project(this._client);
20
- }
21
-
22
- Org.APIKey = APIKey;
23
- Org.Project = Project;
24
-
25
- export declare namespace Org {
26
- export {
27
- APIKey as APIKey,
28
- type APIKeyRetrieveResponse as APIKeyRetrieveResponse,
29
- type APIKeyRegenerateResponse as APIKeyRegenerateResponse,
30
- };
31
-
32
- export {
33
- Project as Project,
34
- type ProjectCreateResponse as ProjectCreateResponse,
35
- type ProjectRetrieveResponse as ProjectRetrieveResponse,
36
- type ProjectListResponse as ProjectListResponse,
37
- type ProjectDeleteResponse as ProjectDeleteResponse,
38
- type ProjectCreateParams as ProjectCreateParams,
39
- type ProjectListParams as ProjectListParams,
40
- };
41
- }
@@ -1,180 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../../../core/resource';
4
- import { APIPromise } from '../../../core/api-promise';
5
- import { RequestOptions } from '../../../internal/request-options';
6
- import { path } from '../../../internal/utils/path';
7
-
8
- export class 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
- */
24
- create(
25
- projectID: string,
26
- body: APIKeyCreateParams,
27
- options?: RequestOptions,
28
- ): APIPromise<APIKeyCreateResponse> {
29
- return this._client.post(path`/api/v3/org/project/${projectID}/api_keys/create`, { body, ...options });
30
- }
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
- */
45
- list(projectID: string, options?: RequestOptions): APIPromise<APIKeyListResponse> {
46
- return this._client.get(path`/api/v3/org/project/${projectID}/api_keys/list`, options);
47
- }
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
- */
63
- delete(id: string, params: APIKeyDeleteParams, options?: RequestOptions): APIPromise<APIKeyDeleteResponse> {
64
- const { projectId } = params;
65
- return this._client.delete(path`/api/v3/org/project/${projectId}/api_keys/remove/${id}`, options);
66
- }
67
- }
68
-
69
- /**
70
- * API key object containing the key details
71
- */
72
- export interface APIKeyCreateResponse {
73
- /**
74
- * Database record identifier for the API key
75
- */
76
- id: string;
77
-
78
- /**
79
- * UTC timestamp indicating when the API key was created
80
- */
81
- created_at: string;
82
-
83
- /**
84
- * The API key string value that should be included in API requests. This value is
85
- * only shown once at creation time.
86
- */
87
- key: string;
88
-
89
- /**
90
- * Descriptive name assigned to help identify the key's purpose
91
- */
92
- name: string;
93
-
94
- /**
95
- * UTC timestamp indicating when the API key was last used for authentication. Will
96
- * be null for newly created keys.
97
- */
98
- last_used_at?: string;
99
- }
100
-
101
- /**
102
- * Response containing the list of API keys for a project
103
- */
104
- export interface APIKeyListResponse {
105
- /**
106
- * List of all API keys for the specified project, including their properties and
107
- * usage information
108
- */
109
- items: Array<APIKeyListResponse.Item>;
110
- }
111
-
112
- export namespace APIKeyListResponse {
113
- export interface Item {
114
- /**
115
- * Unique identifier for the API key record
116
- */
117
- id: string;
118
-
119
- /**
120
- * UTC timestamp indicating when the API key was created
121
- */
122
- created_at: string;
123
-
124
- /**
125
- * The API key string that should be included in API requests for authentication
126
- */
127
- key: string;
128
-
129
- /**
130
- * Descriptive name assigned to the API key for identification purposes
131
- */
132
- name: string;
133
-
134
- /**
135
- * UTC timestamp indicating when the API key was last used for authentication. Will
136
- * be null if the key has never been used.
137
- */
138
- last_used?: string;
139
- }
140
- }
141
-
142
- /**
143
- * Response indicating the status of the API key deletion operation
144
- */
145
- export interface APIKeyDeleteResponse {
146
- /**
147
- * Status message providing details about the deletion operation
148
- */
149
- message: string;
150
-
151
- /**
152
- * Boolean flag indicating if the deletion operation was successful
153
- */
154
- success: boolean;
155
- }
156
-
157
- export interface APIKeyCreateParams {
158
- /**
159
- * A user-friendly name to identify the API key's purpose (e.g., "Production
160
- * Server", "Test Environment")
161
- */
162
- name: string;
163
- }
164
-
165
- export interface APIKeyDeleteParams {
166
- /**
167
- * The project Nano ID that owns the API key to be deleted
168
- */
169
- projectId: string;
170
- }
171
-
172
- export declare namespace APIKeys {
173
- export {
174
- type APIKeyCreateResponse as APIKeyCreateResponse,
175
- type APIKeyListResponse as APIKeyListResponse,
176
- type APIKeyDeleteResponse as APIKeyDeleteResponse,
177
- type APIKeyCreateParams as APIKeyCreateParams,
178
- type APIKeyDeleteParams as APIKeyDeleteParams,
179
- };
180
- }
@@ -1,35 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- export {
4
- APIKeys,
5
- type APIKeyCreateResponse,
6
- type APIKeyListResponse,
7
- type APIKeyDeleteResponse,
8
- type APIKeyCreateParams,
9
- type APIKeyDeleteParams,
10
- } from './api-keys';
11
- export {
12
- Project,
13
- type ProjectCreateResponse,
14
- type ProjectRetrieveResponse,
15
- type ProjectListResponse,
16
- type ProjectDeleteResponse,
17
- type ProjectCreateParams,
18
- type ProjectListParams,
19
- } from './project';
20
- export {
21
- Trigger,
22
- type TriggerUpdateResponse,
23
- type TriggerListResponse,
24
- type TriggerUpdateParams,
25
- } from './trigger';
26
- export {
27
- Webhook,
28
- type WebhookRetrieveResponse,
29
- type WebhookUpdateResponse,
30
- type WebhookDeleteResponse,
31
- type WebhookRefreshResponse,
32
- type WebhookRetrieveParams,
33
- type WebhookUpdateParams,
34
- type WebhookDeleteParams,
35
- } from './webhook';