@composio/client 0.1.0-alpha.1 → 0.1.0-alpha.6

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 (206) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +1 -1
  3. package/README.md +29 -29
  4. package/client.d.mts +16 -13
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +16 -13
  7. package/client.d.ts.map +1 -1
  8. package/client.js +54 -61
  9. package/client.js.map +1 -1
  10. package/client.mjs +52 -59
  11. package/client.mjs.map +1 -1
  12. package/core/api-promise.d.mts +2 -2
  13. package/core/api-promise.d.mts.map +1 -1
  14. package/core/api-promise.d.ts +2 -2
  15. package/core/api-promise.d.ts.map +1 -1
  16. package/core/api-promise.js.map +1 -1
  17. package/core/api-promise.mjs.map +1 -1
  18. package/core/error.d.mts +2 -2
  19. package/core/error.d.mts.map +1 -1
  20. package/core/error.d.ts +2 -2
  21. package/core/error.d.ts.map +1 -1
  22. package/core/error.js +4 -4
  23. package/core/error.js.map +1 -1
  24. package/core/error.mjs +2 -2
  25. package/core/error.mjs.map +1 -1
  26. package/core/resource.d.mts +3 -3
  27. package/core/resource.d.mts.map +1 -1
  28. package/core/resource.d.ts +3 -3
  29. package/core/resource.d.ts.map +1 -1
  30. package/core/resource.js.map +1 -1
  31. package/core/resource.mjs.map +1 -1
  32. package/index.d.mts +3 -3
  33. package/index.d.mts.map +1 -1
  34. package/index.d.ts +3 -3
  35. package/index.d.ts.map +1 -1
  36. package/index.js +4 -4
  37. package/index.js.map +1 -1
  38. package/index.mjs +3 -3
  39. package/index.mjs.map +1 -1
  40. package/internal/parse.d.mts +2 -2
  41. package/internal/parse.d.mts.map +1 -1
  42. package/internal/parse.d.ts +2 -2
  43. package/internal/parse.d.ts.map +1 -1
  44. package/internal/parse.js.map +1 -1
  45. package/internal/parse.mjs.map +1 -1
  46. package/internal/qs/formats.d.mts +6 -0
  47. package/internal/qs/formats.d.mts.map +1 -0
  48. package/internal/qs/formats.d.ts +6 -0
  49. package/internal/qs/formats.d.ts.map +1 -0
  50. package/internal/qs/formats.js +11 -0
  51. package/internal/qs/formats.js.map +1 -0
  52. package/internal/qs/formats.mjs +8 -0
  53. package/internal/qs/formats.mjs.map +1 -0
  54. package/internal/qs/index.d.mts +10 -0
  55. package/internal/qs/index.d.mts.map +1 -0
  56. package/internal/qs/index.d.ts +10 -0
  57. package/internal/qs/index.d.ts.map +1 -0
  58. package/internal/qs/index.js +14 -0
  59. package/internal/qs/index.js.map +1 -0
  60. package/internal/qs/index.mjs +10 -0
  61. package/internal/qs/index.mjs.map +1 -0
  62. package/internal/qs/stringify.d.mts +3 -0
  63. package/internal/qs/stringify.d.mts.map +1 -0
  64. package/internal/qs/stringify.d.ts +3 -0
  65. package/internal/qs/stringify.d.ts.map +1 -0
  66. package/internal/qs/stringify.js +280 -0
  67. package/internal/qs/stringify.js.map +1 -0
  68. package/internal/qs/stringify.mjs +276 -0
  69. package/internal/qs/stringify.mjs.map +1 -0
  70. package/internal/qs/types.d.mts +57 -0
  71. package/internal/qs/types.d.mts.map +1 -0
  72. package/internal/qs/types.d.ts +57 -0
  73. package/internal/qs/types.d.ts.map +1 -0
  74. package/internal/qs/types.js +3 -0
  75. package/internal/qs/types.js.map +1 -0
  76. package/internal/qs/types.mjs +2 -0
  77. package/internal/qs/types.mjs.map +1 -0
  78. package/internal/qs/utils.d.mts +14 -0
  79. package/internal/qs/utils.d.mts.map +1 -0
  80. package/internal/qs/utils.d.ts +14 -0
  81. package/internal/qs/utils.d.ts.map +1 -0
  82. package/internal/qs/utils.js +229 -0
  83. package/internal/qs/utils.js.map +1 -0
  84. package/internal/qs/utils.mjs +217 -0
  85. package/internal/qs/utils.mjs.map +1 -0
  86. package/internal/shims/getBuiltinModule.d.mts.map +1 -1
  87. package/internal/shims/getBuiltinModule.d.ts.map +1 -1
  88. package/internal/shims/getBuiltinModule.js +5 -2
  89. package/internal/shims/getBuiltinModule.js.map +1 -1
  90. package/internal/shims/getBuiltinModule.mjs +5 -2
  91. package/internal/shims/getBuiltinModule.mjs.map +1 -1
  92. package/internal/shims.js +1 -1
  93. package/internal/shims.js.map +1 -1
  94. package/internal/shims.mjs +1 -1
  95. package/internal/shims.mjs.map +1 -1
  96. package/internal/uploads.d.mts +4 -4
  97. package/internal/uploads.d.mts.map +1 -1
  98. package/internal/uploads.d.ts +4 -4
  99. package/internal/uploads.d.ts.map +1 -1
  100. package/internal/uploads.js.map +1 -1
  101. package/internal/uploads.mjs.map +1 -1
  102. package/internal/utils/base64.js +2 -2
  103. package/internal/utils/base64.js.map +1 -1
  104. package/internal/utils/base64.mjs +3 -3
  105. package/internal/utils/base64.mjs.map +1 -1
  106. package/internal/utils/log.d.mts +3 -3
  107. package/internal/utils/log.d.mts.map +1 -1
  108. package/internal/utils/log.d.ts +3 -3
  109. package/internal/utils/log.d.ts.map +1 -1
  110. package/internal/utils/log.js.map +1 -1
  111. package/internal/utils/log.mjs.map +1 -1
  112. package/internal/utils/path.d.mts.map +1 -1
  113. package/internal/utils/path.d.ts.map +1 -1
  114. package/internal/utils/path.js +1 -1
  115. package/internal/utils/path.js.map +1 -1
  116. package/internal/utils/path.mjs +2 -2
  117. package/internal/utils/path.mjs.map +1 -1
  118. package/internal/utils/values.js +5 -5
  119. package/internal/utils/values.js.map +1 -1
  120. package/internal/utils/values.mjs +6 -6
  121. package/internal/utils/values.mjs.map +1 -1
  122. package/package.json +4 -4
  123. package/resources/action-execution.d.mts +1 -1
  124. package/resources/action-execution.d.mts.map +1 -1
  125. package/resources/action-execution.d.ts +1 -1
  126. package/resources/action-execution.d.ts.map +1 -1
  127. package/resources/cli.d.mts +124 -0
  128. package/resources/cli.d.mts.map +1 -0
  129. package/resources/cli.d.ts +124 -0
  130. package/resources/cli.d.ts.map +1 -0
  131. package/resources/cli.js +18 -0
  132. package/resources/cli.js.map +1 -0
  133. package/resources/cli.mjs +14 -0
  134. package/resources/cli.mjs.map +1 -0
  135. package/resources/index.d.mts +2 -0
  136. package/resources/index.d.mts.map +1 -1
  137. package/resources/index.d.ts +2 -0
  138. package/resources/index.d.ts.map +1 -1
  139. package/resources/index.js +5 -1
  140. package/resources/index.js.map +1 -1
  141. package/resources/index.mjs +2 -0
  142. package/resources/index.mjs.map +1 -1
  143. package/resources/mcp/command.d.mts +34 -0
  144. package/resources/mcp/command.d.mts.map +1 -0
  145. package/resources/mcp/command.d.ts +34 -0
  146. package/resources/mcp/command.d.ts.map +1 -0
  147. package/resources/mcp/command.js +12 -0
  148. package/resources/mcp/command.js.map +1 -0
  149. package/resources/mcp/command.mjs +8 -0
  150. package/resources/mcp/command.mjs.map +1 -0
  151. package/resources/mcp/index.d.mts +3 -0
  152. package/resources/mcp/index.d.mts.map +1 -0
  153. package/resources/mcp/index.d.ts +3 -0
  154. package/resources/mcp/index.d.ts.map +1 -0
  155. package/resources/mcp/index.js +9 -0
  156. package/resources/mcp/index.js.map +1 -0
  157. package/resources/mcp/index.mjs +4 -0
  158. package/resources/mcp/index.mjs.map +1 -0
  159. package/resources/mcp/mcp.d.mts +378 -0
  160. package/resources/mcp/mcp.d.mts.map +1 -0
  161. package/resources/mcp/mcp.d.ts +378 -0
  162. package/resources/mcp/mcp.d.ts.map +1 -0
  163. package/resources/mcp/mcp.js +66 -0
  164. package/resources/mcp/mcp.js.map +1 -0
  165. package/resources/mcp/mcp.mjs +39 -0
  166. package/resources/mcp/mcp.mjs.map +1 -0
  167. package/resources/mcp.d.mts +2 -0
  168. package/resources/mcp.d.mts.map +1 -0
  169. package/resources/mcp.d.ts +2 -0
  170. package/resources/mcp.d.ts.map +1 -0
  171. package/resources/mcp.js +19 -0
  172. package/resources/mcp.js.map +1 -0
  173. package/resources/mcp.mjs +3 -0
  174. package/resources/mcp.mjs.map +1 -0
  175. package/src/client.ts +82 -47
  176. package/src/core/api-promise.ts +4 -4
  177. package/src/core/error.ts +2 -2
  178. package/src/core/resource.ts +3 -3
  179. package/src/index.ts +3 -3
  180. package/src/internal/parse.ts +2 -2
  181. package/src/internal/qs/LICENSE.md +13 -0
  182. package/src/internal/qs/README.md +3 -0
  183. package/src/internal/qs/formats.ts +9 -0
  184. package/src/internal/qs/index.ts +13 -0
  185. package/src/internal/qs/stringify.ts +388 -0
  186. package/src/internal/qs/types.ts +71 -0
  187. package/src/internal/qs/utils.ts +265 -0
  188. package/src/internal/shims/getBuiltinModule.ts +4 -2
  189. package/src/internal/shims.ts +1 -1
  190. package/src/internal/uploads.ts +5 -5
  191. package/src/internal/utils/base64.ts +3 -3
  192. package/src/internal/utils/log.ts +3 -3
  193. package/src/internal/utils/path.ts +2 -4
  194. package/src/internal/utils/values.ts +6 -6
  195. package/src/resources/action-execution.ts +1 -1
  196. package/src/resources/cli.ts +166 -0
  197. package/src/resources/index.ts +22 -0
  198. package/src/resources/mcp/command.ts +47 -0
  199. package/src/resources/mcp/index.ts +17 -0
  200. package/src/resources/mcp/mcp.ts +519 -0
  201. package/src/resources/mcp.ts +3 -0
  202. package/src/version.ts +1 -1
  203. package/version.d.mts +1 -1
  204. package/version.d.ts +1 -1
  205. package/version.js +1 -1
  206. package/version.mjs +1 -1
package/src/client.ts CHANGED
@@ -12,6 +12,7 @@ import type { APIResponseProps } from './internal/parse';
12
12
  import { getPlatformHeaders } from './internal/detect-platform';
13
13
  import * as Shims from './internal/shims';
14
14
  import * as Opts from './internal/request-options';
15
+ import * as qs from './internal/qs';
15
16
  import { VERSION } from './version';
16
17
  import * as Errors from './core/error';
17
18
  import * as Uploads from './core/uploads';
@@ -40,6 +41,14 @@ import {
40
41
  AuthConfigUpdateStatusResponse,
41
42
  AuthConfigs,
42
43
  } from './resources/auth-configs';
44
+ import {
45
+ Cli,
46
+ CliCreateSessionResponse,
47
+ CliLinkSessionParams,
48
+ CliLinkSessionResponse,
49
+ CliRetrieveSessionParams,
50
+ CliRetrieveSessionResponse,
51
+ } from './resources/cli';
43
52
  import {
44
53
  ConnectedAccountCreateParams,
45
54
  ConnectedAccountCreateResponse,
@@ -92,6 +101,20 @@ import {
92
101
  import { readEnv } from './internal/utils/env';
93
102
  import { formatRequestDetails, loggerFor } from './internal/utils/log';
94
103
  import { isEmptyObj } from './internal/utils/values';
104
+ import {
105
+ Mcp,
106
+ McpCreateParams,
107
+ McpCreateResponse,
108
+ McpDeleteResponse,
109
+ McpListParams,
110
+ McpListResponse,
111
+ McpRetrieveAppResponse,
112
+ McpRetrieveResponse,
113
+ McpUpdateParams,
114
+ McpUpdateResponse,
115
+ McpValidateParams,
116
+ McpValidateResponse,
117
+ } from './resources/mcp/mcp';
95
118
  import { Org } from './resources/org/org';
96
119
  import {
97
120
  TriggerInstanceListActiveParams,
@@ -130,7 +153,7 @@ export interface ClientOptions {
130
153
  /**
131
154
  * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
132
155
  *
133
- * Defaults to process.env['COMPOSIO_SDK_BASE_URL'].
156
+ * Defaults to process.env['COMPOSIO_BASE_URL'].
134
157
  */
135
158
  baseURL?: string | null | undefined;
136
159
 
@@ -182,7 +205,7 @@ export interface ClientOptions {
182
205
  /**
183
206
  * Set the log level.
184
207
  *
185
- * Defaults to process.env['COMPOSIO_SDK_LOG'] or 'warn' if it isn't set.
208
+ * Defaults to process.env['COMPOSIO_LOG'] or 'warn' if it isn't set.
186
209
  */
187
210
  logLevel?: LogLevel | undefined;
188
211
 
@@ -195,9 +218,9 @@ export interface ClientOptions {
195
218
  }
196
219
 
197
220
  /**
198
- * API Client for interfacing with the Composio SDK API.
221
+ * API Client for interfacing with the Composio API.
199
222
  */
200
- export class ComposioSDK {
223
+ export class Composio {
201
224
  apiKey: string;
202
225
 
203
226
  baseURL: string;
@@ -213,11 +236,11 @@ export class ComposioSDK {
213
236
  private _options: ClientOptions;
214
237
 
215
238
  /**
216
- * API Client for interfacing with the Composio SDK API.
239
+ * API Client for interfacing with the Composio API.
217
240
  *
218
241
  * @param {string | undefined} [opts.apiKey=process.env['COMPOSIO_API_KEY'] ?? undefined]
219
242
  * @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
220
- * @param {string} [opts.baseURL=process.env['COMPOSIO_SDK_BASE_URL'] ?? https://backend.composio.dev] - Override the default base URL for the API.
243
+ * @param {string} [opts.baseURL=process.env['COMPOSIO_BASE_URL'] ?? https://backend.composio.dev] - Override the default base URL for the API.
221
244
  * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
222
245
  * @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
223
246
  * @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
@@ -226,13 +249,13 @@ export class ComposioSDK {
226
249
  * @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
227
250
  */
228
251
  constructor({
229
- baseURL = readEnv('COMPOSIO_SDK_BASE_URL'),
252
+ baseURL = readEnv('COMPOSIO_BASE_URL'),
230
253
  apiKey = readEnv('COMPOSIO_API_KEY'),
231
254
  ...opts
232
255
  }: ClientOptions = {}) {
233
256
  if (apiKey === undefined) {
234
- throw new Errors.ComposioSDKError(
235
- "The COMPOSIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the ComposioSDK client with an apiKey option, like new ComposioSDK({ apiKey: 'My API Key' }).",
257
+ throw new Errors.ComposioError(
258
+ "The COMPOSIO_API_KEY environment variable is missing or empty; either provide it, or instantiate the Composio client with an apiKey option, like new Composio({ apiKey: 'My API Key' }).",
236
259
  );
237
260
  }
238
261
 
@@ -244,20 +267,20 @@ export class ComposioSDK {
244
267
  };
245
268
 
246
269
  if (baseURL && opts.environment) {
247
- throw new Errors.ComposioSDKError(
248
- 'Ambiguous URL; The `baseURL` option (or COMPOSIO_SDK_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
270
+ throw new Errors.ComposioError(
271
+ 'Ambiguous URL; The `baseURL` option (or COMPOSIO_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
249
272
  );
250
273
  }
251
274
 
252
275
  this.baseURL = options.baseURL || environments[options.environment || 'production'];
253
- this.timeout = options.timeout ?? ComposioSDK.DEFAULT_TIMEOUT /* 1 minute */;
276
+ this.timeout = options.timeout ?? Composio.DEFAULT_TIMEOUT /* 1 minute */;
254
277
  this.logger = options.logger ?? console;
255
278
  const defaultLogLevel = 'warn';
256
279
  // Set default logLevel early so that we can log a warning in parseLogLevel.
257
280
  this.logLevel = defaultLogLevel;
258
281
  this.logLevel =
259
282
  parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
260
- parseLogLevel(readEnv('COMPOSIO_SDK_LOG'), "process.env['COMPOSIO_SDK_LOG']", this) ??
283
+ parseLogLevel(readEnv('COMPOSIO_LOG'), "process.env['COMPOSIO_LOG']", this) ??
261
284
  defaultLogLevel;
262
285
  this.fetchOptions = options.fetchOptions;
263
286
  this.maxRetries = options.maxRetries ?? 2;
@@ -278,27 +301,11 @@ export class ComposioSDK {
278
301
  }
279
302
 
280
303
  protected authHeaders(opts: FinalRequestOptions): NullableHeaders | undefined {
281
- return buildHeaders([{ 'X-Api-Key': this.apiKey }]);
304
+ return buildHeaders([{ 'x-api-key': this.apiKey }]);
282
305
  }
283
306
 
284
- /**
285
- * Basic re-implementation of `qs.stringify` for primitive types.
286
- */
287
307
  protected stringifyQuery(query: Record<string, unknown>): string {
288
- return Object.entries(query)
289
- .filter(([_, value]) => typeof value !== 'undefined')
290
- .map(([key, value]) => {
291
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
292
- return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
293
- }
294
- if (value === null) {
295
- return `${encodeURIComponent(key)}=`;
296
- }
297
- throw new Errors.ComposioSDKError(
298
- `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
299
- );
300
- })
301
- .join('&');
308
+ return qs.stringify(query, { arrayFormat: 'comma' });
302
309
  }
303
310
 
304
311
  private getUserAgent(): string {
@@ -659,17 +666,17 @@ export class ComposioSDK {
659
666
  }
660
667
 
661
668
  buildRequest(
662
- options: FinalRequestOptions,
669
+ inputOptions: FinalRequestOptions,
663
670
  { retryCount = 0 }: { retryCount?: number } = {},
664
671
  ): { req: FinalizedRequestInit; url: string; timeout: number } {
665
- options = { ...options };
672
+ const options = { ...inputOptions };
666
673
  const { method, path, query } = options;
667
674
 
668
675
  const url = this.buildURL(path!, query as Record<string, unknown>);
669
676
  if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
670
677
  options.timeout = options.timeout ?? this.timeout;
671
678
  const { bodyHeaders, body } = this.buildBody({ options });
672
- const reqHeaders = this.buildHeaders({ options, method, bodyHeaders, retryCount });
679
+ const reqHeaders = this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });
673
680
 
674
681
  const req: FinalizedRequestInit = {
675
682
  method,
@@ -759,10 +766,10 @@ export class ComposioSDK {
759
766
  }
760
767
  }
761
768
 
762
- static ComposioSDK = this;
769
+ static Composio = this;
763
770
  static DEFAULT_TIMEOUT = 60000; // 1 minute
764
771
 
765
- static ComposioSDKError = Errors.ComposioSDKError;
772
+ static ComposioError = Errors.ComposioError;
766
773
  static APIError = Errors.APIError;
767
774
  static APIConnectionError = Errors.APIConnectionError;
768
775
  static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
@@ -788,18 +795,22 @@ export class ComposioSDK {
788
795
  tools: API.Tools = new API.Tools(this);
789
796
  triggerInstances: API.TriggerInstances = new API.TriggerInstances(this);
790
797
  triggersTypes: API.TriggersTypes = new API.TriggersTypes(this);
798
+ cli: API.Cli = new API.Cli(this);
799
+ mcp: API.Mcp = new API.Mcp(this);
791
800
  }
792
- ComposioSDK.AuthConfigs = AuthConfigs;
793
- ComposioSDK.ConnectedAccounts = ConnectedAccounts;
794
- ComposioSDK.Trigger = Trigger;
795
- ComposioSDK.ActionExecution = ActionExecution;
796
- ComposioSDK.Org = Org;
797
- ComposioSDK.TeamMembers = TeamMembers;
798
- ComposioSDK.Toolkits = Toolkits;
799
- ComposioSDK.Tools = Tools;
800
- ComposioSDK.TriggerInstances = TriggerInstances;
801
- ComposioSDK.TriggersTypes = TriggersTypes;
802
- export declare namespace ComposioSDK {
801
+ Composio.AuthConfigs = AuthConfigs;
802
+ Composio.ConnectedAccounts = ConnectedAccounts;
803
+ Composio.Trigger = Trigger;
804
+ Composio.ActionExecution = ActionExecution;
805
+ Composio.Org = Org;
806
+ Composio.TeamMembers = TeamMembers;
807
+ Composio.Toolkits = Toolkits;
808
+ Composio.Tools = Tools;
809
+ Composio.TriggerInstances = TriggerInstances;
810
+ Composio.TriggersTypes = TriggersTypes;
811
+ Composio.Cli = Cli;
812
+ Composio.Mcp = Mcp;
813
+ export declare namespace Composio {
803
814
  export type RequestOptions = Opts.RequestOptions;
804
815
 
805
816
  export {
@@ -895,4 +906,28 @@ export declare namespace ComposioSDK {
895
906
  type TriggersTypeRetrieveEnumResponse as TriggersTypeRetrieveEnumResponse,
896
907
  type TriggersTypeListParams as TriggersTypeListParams,
897
908
  };
909
+
910
+ export {
911
+ Cli as Cli,
912
+ type CliCreateSessionResponse as CliCreateSessionResponse,
913
+ type CliLinkSessionResponse as CliLinkSessionResponse,
914
+ type CliRetrieveSessionResponse as CliRetrieveSessionResponse,
915
+ type CliLinkSessionParams as CliLinkSessionParams,
916
+ type CliRetrieveSessionParams as CliRetrieveSessionParams,
917
+ };
918
+
919
+ export {
920
+ Mcp as Mcp,
921
+ type McpCreateResponse as McpCreateResponse,
922
+ type McpRetrieveResponse as McpRetrieveResponse,
923
+ type McpUpdateResponse as McpUpdateResponse,
924
+ type McpListResponse as McpListResponse,
925
+ type McpDeleteResponse as McpDeleteResponse,
926
+ type McpRetrieveAppResponse as McpRetrieveAppResponse,
927
+ type McpValidateResponse as McpValidateResponse,
928
+ type McpCreateParams as McpCreateParams,
929
+ type McpUpdateParams as McpUpdateParams,
930
+ type McpListParams as McpListParams,
931
+ type McpValidateParams as McpValidateParams,
932
+ };
898
933
  }
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import { type ComposioSDK } from '../client';
3
+ import { type Composio } from '../client';
4
4
 
5
5
  import { type PromiseOrValue } from '../internal/types';
6
6
  import { APIResponseProps, defaultParseResponse } from '../internal/parse';
@@ -11,13 +11,13 @@ import { APIResponseProps, defaultParseResponse } from '../internal/parse';
11
11
  */
12
12
  export class APIPromise<T> extends Promise<T> {
13
13
  private parsedPromise: Promise<T> | undefined;
14
- #client: ComposioSDK;
14
+ #client: Composio;
15
15
 
16
16
  constructor(
17
- client: ComposioSDK,
17
+ client: Composio,
18
18
  private responsePromise: Promise<APIResponseProps>,
19
19
  private parseResponse: (
20
- client: ComposioSDK,
20
+ client: Composio,
21
21
  props: APIResponseProps,
22
22
  ) => PromiseOrValue<T> = defaultParseResponse,
23
23
  ) {
package/src/core/error.ts CHANGED
@@ -2,13 +2,13 @@
2
2
 
3
3
  import { castToError } from '../internal/errors';
4
4
 
5
- export class ComposioSDKError extends Error {}
5
+ export class ComposioError extends Error {}
6
6
 
7
7
  export class APIError<
8
8
  TStatus extends number | undefined = number | undefined,
9
9
  THeaders extends Headers | undefined = Headers | undefined,
10
10
  TError extends Object | undefined = Object | undefined,
11
- > extends ComposioSDKError {
11
+ > extends ComposioError {
12
12
  /** HTTP status for the response that caused the error */
13
13
  readonly status: TStatus;
14
14
  /** HTTP headers for the response that caused the error */
@@ -1,11 +1,11 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- import type { ComposioSDK } from '../client';
3
+ import type { Composio } from '../client';
4
4
 
5
5
  export class APIResource {
6
- protected _client: ComposioSDK;
6
+ protected _client: Composio;
7
7
 
8
- constructor(client: ComposioSDK) {
8
+ constructor(client: Composio) {
9
9
  this._client = client;
10
10
  }
11
11
  }
package/src/index.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { ComposioSDK as default } from './client';
3
+ export { Composio as default } from './client';
4
4
 
5
5
  export { type Uploadable, toFile } from './core/uploads';
6
6
  export { APIPromise } from './core/api-promise';
7
- export { ComposioSDK, type ClientOptions } from './client';
7
+ export { Composio, type ClientOptions } from './client';
8
8
  export {
9
- ComposioSDKError,
9
+ ComposioError,
10
10
  APIError,
11
11
  APIConnectionError,
12
12
  APIConnectionTimeoutError,
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import type { FinalRequestOptions } from './request-options';
4
- import { type ComposioSDK } from '../client';
4
+ import { type Composio } from '../client';
5
5
  import { formatRequestDetails, loggerFor } from './utils/log';
6
6
 
7
7
  export type APIResponseProps = {
@@ -13,7 +13,7 @@ export type APIResponseProps = {
13
13
  startTime: number;
14
14
  };
15
15
 
16
- export async function defaultParseResponse<T>(client: ComposioSDK, props: APIResponseProps): Promise<T> {
16
+ export async function defaultParseResponse<T>(client: Composio, props: APIResponseProps): Promise<T> {
17
17
  const { response, requestLogID, retryOfRequestLogID, startTime } = props;
18
18
  const body = await (async () => {
19
19
  // fetch refuses to read the body when the status code is 204.
@@ -0,0 +1,13 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ # qs
2
+
3
+ This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library.
@@ -0,0 +1,9 @@
1
+ import type { Format } from './types';
2
+
3
+ export const default_format: Format = 'RFC3986';
4
+ export const formatters: Record<Format, (str: PropertyKey) => string> = {
5
+ RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'),
6
+ RFC3986: (v: PropertyKey) => String(v),
7
+ };
8
+ export const RFC1738 = 'RFC1738';
9
+ export const RFC3986 = 'RFC3986';
@@ -0,0 +1,13 @@
1
+ import { default_format, formatters, RFC1738, RFC3986 } from './formats';
2
+
3
+ const formats = {
4
+ formatters,
5
+ RFC1738,
6
+ RFC3986,
7
+ default: default_format,
8
+ };
9
+
10
+ export { stringify } from './stringify';
11
+ export { formats };
12
+
13
+ export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types';