@composio/core 0.1.22 → 0.1.24
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/dist/index.cjs +114 -27
- package/dist/index.d.cts +99 -15
- package/dist/index.d.ts +99 -15
- package/dist/index.js +114 -27
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -134,7 +134,7 @@ __export(index_exports, {
|
|
|
134
134
|
module.exports = __toCommonJS(index_exports);
|
|
135
135
|
|
|
136
136
|
// src/composio.ts
|
|
137
|
-
var
|
|
137
|
+
var import_client7 = __toESM(require("@composio/client"), 1);
|
|
138
138
|
|
|
139
139
|
// src/types/tool.types.ts
|
|
140
140
|
var import_zod = require("zod");
|
|
@@ -1669,7 +1669,8 @@ var ConnectedAccountStatuses = {
|
|
|
1669
1669
|
INITIATED: "INITIATED",
|
|
1670
1670
|
ACTIVE: "ACTIVE",
|
|
1671
1671
|
FAILED: "FAILED",
|
|
1672
|
-
EXPIRED: "EXPIRED"
|
|
1672
|
+
EXPIRED: "EXPIRED",
|
|
1673
|
+
INACTIVE: "INACTIVE"
|
|
1673
1674
|
};
|
|
1674
1675
|
var ConnectedAccountStatusSchema = import_zod6.z.enum([
|
|
1675
1676
|
ConnectedAccountStatuses.INITIALIZING,
|
|
@@ -2237,12 +2238,16 @@ var Tools = class {
|
|
|
2237
2238
|
"Invalid tool list parameters, atleast one of the following parameters is required: tools, toolkits, search"
|
|
2238
2239
|
);
|
|
2239
2240
|
}
|
|
2241
|
+
let limit = "limit" in queryParams.data ? queryParams.data.limit?.toString() : void 0;
|
|
2242
|
+
if ("tools" in queryParams.data) {
|
|
2243
|
+
limit = "9999";
|
|
2244
|
+
}
|
|
2240
2245
|
const tools = await this.client.tools.list({
|
|
2241
2246
|
tool_slugs: "tools" in queryParams.data ? queryParams.data.tools?.join(",") : void 0,
|
|
2242
2247
|
toolkit_slug: "toolkits" in queryParams.data ? queryParams.data.toolkits?.join(",") : void 0,
|
|
2243
2248
|
cursor: "cursor" in queryParams.data ? queryParams.data.cursor : void 0,
|
|
2244
2249
|
important: "important" in queryParams.data ? queryParams.data.important ? "true" : "false" : void 0,
|
|
2245
|
-
limit
|
|
2250
|
+
limit,
|
|
2246
2251
|
search: "search" in queryParams.data ? queryParams.data.search : void 0
|
|
2247
2252
|
});
|
|
2248
2253
|
if (!tools) {
|
|
@@ -3730,6 +3735,9 @@ var Toolkits = class {
|
|
|
3730
3735
|
}
|
|
3731
3736
|
};
|
|
3732
3737
|
|
|
3738
|
+
// src/models/Triggers.ts
|
|
3739
|
+
var import_client6 = require("@composio/client");
|
|
3740
|
+
|
|
3733
3741
|
// src/types/triggers.types.ts
|
|
3734
3742
|
var import_zod8 = require("zod");
|
|
3735
3743
|
var TriggerStatuses = {
|
|
@@ -3860,7 +3868,8 @@ var TriggerErrorCodes = {
|
|
|
3860
3868
|
TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS: "TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS",
|
|
3861
3869
|
TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT: "TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT",
|
|
3862
3870
|
TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL",
|
|
3863
|
-
TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL"
|
|
3871
|
+
TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL",
|
|
3872
|
+
TRIGGER_TYPE_NOT_FOUND: "TRIGGER_TYPE_NOT_FOUND"
|
|
3864
3873
|
};
|
|
3865
3874
|
var ComposioFailedToGetSDKRealtimeCredentialsError = class extends import_client5.ComposioError {
|
|
3866
3875
|
name = "ComposioFailedToGetSDKRealtimeCredentialsError";
|
|
@@ -3889,6 +3898,15 @@ var ComposioFailedToSubscribeToPusherChannelError = class extends import_client5
|
|
|
3889
3898
|
super(message, options);
|
|
3890
3899
|
}
|
|
3891
3900
|
};
|
|
3901
|
+
var ComposioTriggerTypeNotFoundError = class extends import_client5.ComposioError {
|
|
3902
|
+
name = "ComposioTriggerTypeNotFoundError";
|
|
3903
|
+
code = TriggerErrorCodes.TRIGGER_TYPE_NOT_FOUND;
|
|
3904
|
+
statusCode = 404;
|
|
3905
|
+
possibleFixes = ["Please contact support."];
|
|
3906
|
+
constructor(message = "Trigger type not found", options) {
|
|
3907
|
+
super(message, options);
|
|
3908
|
+
}
|
|
3909
|
+
};
|
|
3892
3910
|
|
|
3893
3911
|
// src/services/pusher/Pusher.ts
|
|
3894
3912
|
var PusherService = class {
|
|
@@ -4154,21 +4172,89 @@ var Triggers = class {
|
|
|
4154
4172
|
return parsedResult.data;
|
|
4155
4173
|
}
|
|
4156
4174
|
/**
|
|
4157
|
-
* Create a new trigger instance
|
|
4175
|
+
* Create a new trigger instance for a user
|
|
4176
|
+
* If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
4158
4177
|
*
|
|
4178
|
+
* @param {string} userId - The user id of the trigger instance
|
|
4159
4179
|
* @param {string} slug - The slug of the trigger instance
|
|
4160
4180
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
4161
4181
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
4162
4182
|
*/
|
|
4163
|
-
async create(slug, body) {
|
|
4164
|
-
const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body);
|
|
4183
|
+
async create(userId, slug, body) {
|
|
4184
|
+
const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body ?? {});
|
|
4165
4185
|
if (!parsedBody.success) {
|
|
4166
4186
|
throw new ValidationError(`Invalid parameters passed to create trigger`, {
|
|
4167
4187
|
cause: parsedBody.error
|
|
4168
4188
|
});
|
|
4169
4189
|
}
|
|
4190
|
+
let triggerType;
|
|
4191
|
+
let toolkitSlug;
|
|
4192
|
+
try {
|
|
4193
|
+
triggerType = await this.getType(slug);
|
|
4194
|
+
toolkitSlug = triggerType.toolkit.slug;
|
|
4195
|
+
} catch (error) {
|
|
4196
|
+
if (error instanceof import_client6.APIError && (error.status === 400 || error.status === 404)) {
|
|
4197
|
+
throw new ComposioTriggerTypeNotFoundError(`Trigger type ${slug} not found`, {
|
|
4198
|
+
cause: error,
|
|
4199
|
+
possibleFixes: [
|
|
4200
|
+
`Please check the trigger slug`,
|
|
4201
|
+
`Visit the toolkit page to see the available triggers`
|
|
4202
|
+
]
|
|
4203
|
+
});
|
|
4204
|
+
} else {
|
|
4205
|
+
throw error;
|
|
4206
|
+
}
|
|
4207
|
+
}
|
|
4208
|
+
let connectedAccountId = body?.connectedAccountId;
|
|
4209
|
+
try {
|
|
4210
|
+
const { items: connectedAccounts } = await this.client.connectedAccounts.list({
|
|
4211
|
+
user_ids: [userId],
|
|
4212
|
+
toolkit_slugs: [toolkitSlug]
|
|
4213
|
+
});
|
|
4214
|
+
if (connectedAccounts.length === 0) {
|
|
4215
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4216
|
+
`No connected account found for user ${userId} for toolkit ${toolkitSlug}`,
|
|
4217
|
+
{
|
|
4218
|
+
cause: new Error(`No connected account found for user ${userId}`),
|
|
4219
|
+
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4220
|
+
}
|
|
4221
|
+
);
|
|
4222
|
+
}
|
|
4223
|
+
const accountExists = connectedAccounts.some((acc) => acc.id === connectedAccountId);
|
|
4224
|
+
if (connectedAccountId && !accountExists) {
|
|
4225
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4226
|
+
`Connected account ID ${connectedAccountId} not found for user ${userId}`,
|
|
4227
|
+
{
|
|
4228
|
+
cause: new Error(
|
|
4229
|
+
`Connected account ID ${connectedAccountId} not found for user ${userId}`
|
|
4230
|
+
),
|
|
4231
|
+
possibleFixes: [
|
|
4232
|
+
`Create a new connected account for user ${userId}`,
|
|
4233
|
+
`Verify the connected account ID`
|
|
4234
|
+
]
|
|
4235
|
+
}
|
|
4236
|
+
);
|
|
4237
|
+
}
|
|
4238
|
+
if (!connectedAccountId) {
|
|
4239
|
+
connectedAccountId = connectedAccounts[0].id;
|
|
4240
|
+
logger_default.warn(
|
|
4241
|
+
`[Warn] Multiple connected accounts found for user ${userId}, using the first one. Pass connectedAccountId to select a specific account.`
|
|
4242
|
+
);
|
|
4243
|
+
}
|
|
4244
|
+
} catch (error) {
|
|
4245
|
+
if (error instanceof import_client6.APIError && [400, 404].includes(error.status)) {
|
|
4246
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4247
|
+
`No connected account found for user ${userId} for toolkit ${toolkitSlug}`,
|
|
4248
|
+
{
|
|
4249
|
+
cause: error,
|
|
4250
|
+
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4251
|
+
}
|
|
4252
|
+
);
|
|
4253
|
+
}
|
|
4254
|
+
throw error;
|
|
4255
|
+
}
|
|
4170
4256
|
const result = await this.client.triggerInstances.upsert(slug, {
|
|
4171
|
-
connected_account_id:
|
|
4257
|
+
connected_account_id: connectedAccountId,
|
|
4172
4258
|
trigger_config: parsedBody.data.triggerConfig
|
|
4173
4259
|
});
|
|
4174
4260
|
const parsedResult = TriggerInstanceUpsertResponseSchema.safeParse({
|
|
@@ -4921,7 +5007,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
4921
5007
|
};
|
|
4922
5008
|
|
|
4923
5009
|
// package.json
|
|
4924
|
-
var version = "0.1.
|
|
5010
|
+
var version = "0.1.24";
|
|
4925
5011
|
|
|
4926
5012
|
// src/composio.ts
|
|
4927
5013
|
var Composio = class _Composio {
|
|
@@ -4985,7 +5071,7 @@ var Composio = class _Composio {
|
|
|
4985
5071
|
if (IS_DEVELOPMENT_OR_CI) {
|
|
4986
5072
|
logger_default.debug(`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}`);
|
|
4987
5073
|
}
|
|
4988
|
-
this.client = new
|
|
5074
|
+
this.client = new import_client7.default({
|
|
4989
5075
|
apiKey: apiKeyParsed,
|
|
4990
5076
|
baseURL: baseURLParsed,
|
|
4991
5077
|
defaultHeaders: config?.defaultHeaders,
|
|
@@ -5150,11 +5236,12 @@ var AuthScheme = class {
|
|
|
5150
5236
|
* Creates a ConnectionData object for Composio Link authentication
|
|
5151
5237
|
* @returns ConnectionData object
|
|
5152
5238
|
*/
|
|
5153
|
-
static ComposioLink() {
|
|
5239
|
+
static ComposioLink(params) {
|
|
5154
5240
|
return {
|
|
5155
5241
|
authScheme: AuthSchemeTypes.COMPOSIO_LINK,
|
|
5156
5242
|
val: {
|
|
5157
|
-
status: ConnectionStatuses.INITIALIZING
|
|
5243
|
+
status: ConnectionStatuses.INITIALIZING,
|
|
5244
|
+
...params
|
|
5158
5245
|
}
|
|
5159
5246
|
};
|
|
5160
5247
|
}
|
|
@@ -5168,7 +5255,7 @@ var AuthScheme = class {
|
|
|
5168
5255
|
authScheme: AuthSchemeTypes.API_KEY,
|
|
5169
5256
|
val: {
|
|
5170
5257
|
status: ConnectionStatuses.ACTIVE,
|
|
5171
|
-
|
|
5258
|
+
...params
|
|
5172
5259
|
}
|
|
5173
5260
|
};
|
|
5174
5261
|
}
|
|
@@ -5182,8 +5269,7 @@ var AuthScheme = class {
|
|
|
5182
5269
|
authScheme: AuthSchemeTypes.BASIC,
|
|
5183
5270
|
val: {
|
|
5184
5271
|
status: ConnectionStatuses.ACTIVE,
|
|
5185
|
-
|
|
5186
|
-
password: params.password
|
|
5272
|
+
...params
|
|
5187
5273
|
}
|
|
5188
5274
|
};
|
|
5189
5275
|
}
|
|
@@ -5197,7 +5283,7 @@ var AuthScheme = class {
|
|
|
5197
5283
|
authScheme: AuthSchemeTypes.BEARER_TOKEN,
|
|
5198
5284
|
val: {
|
|
5199
5285
|
status: ConnectionStatuses.ACTIVE,
|
|
5200
|
-
|
|
5286
|
+
...params
|
|
5201
5287
|
}
|
|
5202
5288
|
};
|
|
5203
5289
|
}
|
|
@@ -5211,7 +5297,7 @@ var AuthScheme = class {
|
|
|
5211
5297
|
authScheme: AuthSchemeTypes.GOOGLE_SERVICE_ACCOUNT,
|
|
5212
5298
|
val: {
|
|
5213
5299
|
status: ConnectionStatuses.ACTIVE,
|
|
5214
|
-
|
|
5300
|
+
...params
|
|
5215
5301
|
}
|
|
5216
5302
|
};
|
|
5217
5303
|
}
|
|
@@ -5219,11 +5305,12 @@ var AuthScheme = class {
|
|
|
5219
5305
|
* Creates a ConnectionData object for No Auth authentication
|
|
5220
5306
|
* @returns ConnectionData object
|
|
5221
5307
|
*/
|
|
5222
|
-
static NoAuth() {
|
|
5308
|
+
static NoAuth(params) {
|
|
5223
5309
|
return {
|
|
5224
5310
|
authScheme: AuthSchemeTypes.NO_AUTH,
|
|
5225
5311
|
val: {
|
|
5226
|
-
status: ConnectionStatuses.ACTIVE
|
|
5312
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5313
|
+
...params
|
|
5227
5314
|
}
|
|
5228
5315
|
};
|
|
5229
5316
|
}
|
|
@@ -5237,8 +5324,7 @@ var AuthScheme = class {
|
|
|
5237
5324
|
authScheme: AuthSchemeTypes.BASIC_WITH_JWT,
|
|
5238
5325
|
val: {
|
|
5239
5326
|
status: ConnectionStatuses.ACTIVE,
|
|
5240
|
-
|
|
5241
|
-
password: params.password
|
|
5327
|
+
...params
|
|
5242
5328
|
}
|
|
5243
5329
|
};
|
|
5244
5330
|
}
|
|
@@ -5246,11 +5332,12 @@ var AuthScheme = class {
|
|
|
5246
5332
|
* Creates a ConnectionData object for Cal.com authentication
|
|
5247
5333
|
* @returns ConnectionData object
|
|
5248
5334
|
*/
|
|
5249
|
-
static CalcomAuth() {
|
|
5335
|
+
static CalcomAuth(params) {
|
|
5250
5336
|
return {
|
|
5251
5337
|
authScheme: AuthSchemeTypes.CALCOM_AUTH,
|
|
5252
5338
|
val: {
|
|
5253
|
-
status: ConnectionStatuses.ACTIVE
|
|
5339
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5340
|
+
...params
|
|
5254
5341
|
}
|
|
5255
5342
|
};
|
|
5256
5343
|
}
|
|
@@ -5258,11 +5345,12 @@ var AuthScheme = class {
|
|
|
5258
5345
|
* Creates a ConnectionData object for Snowflake authentication
|
|
5259
5346
|
* @returns ConnectionData object
|
|
5260
5347
|
*/
|
|
5261
|
-
static Snowflake() {
|
|
5348
|
+
static Snowflake(params) {
|
|
5262
5349
|
return {
|
|
5263
5350
|
authScheme: AuthSchemeTypes.SNOWFLAKE,
|
|
5264
5351
|
val: {
|
|
5265
|
-
status: ConnectionStatuses.ACTIVE
|
|
5352
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5353
|
+
...params
|
|
5266
5354
|
}
|
|
5267
5355
|
};
|
|
5268
5356
|
}
|
|
@@ -5276,8 +5364,7 @@ var AuthScheme = class {
|
|
|
5276
5364
|
authScheme: AuthSchemeTypes.BILLCOM_AUTH,
|
|
5277
5365
|
val: {
|
|
5278
5366
|
status: ConnectionStatuses.ACTIVE,
|
|
5279
|
-
|
|
5280
|
-
devKey: params.devKey
|
|
5367
|
+
...params
|
|
5281
5368
|
}
|
|
5282
5369
|
};
|
|
5283
5370
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -789,6 +789,77 @@ declare const ConnectionStatuses: {
|
|
|
789
789
|
};
|
|
790
790
|
type ConnectionStatusEnum = (typeof ConnectionStatuses)[keyof typeof ConnectionStatuses];
|
|
791
791
|
declare const RedirectableAuthSchemeSchema: z.ZodEnum<["OAUTH1", "OAUTH2", "COMPOSIO_LINK"]>;
|
|
792
|
+
declare const BaseSchemeRaw: z.ZodObject<{
|
|
793
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
794
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
795
|
+
region: z.ZodOptional<z.ZodString>;
|
|
796
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
797
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
798
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
799
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
800
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
801
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
802
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
803
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
804
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
805
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
806
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
807
|
+
version: z.ZodOptional<z.ZodString>;
|
|
808
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
809
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
810
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
811
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
812
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
813
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
814
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
815
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
816
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
817
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
818
|
+
region: z.ZodOptional<z.ZodString>;
|
|
819
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
820
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
821
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
822
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
823
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
824
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
825
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
826
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
827
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
828
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
829
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
830
|
+
version: z.ZodOptional<z.ZodString>;
|
|
831
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
832
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
833
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
834
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
835
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
836
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
837
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
838
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
839
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
840
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
841
|
+
region: z.ZodOptional<z.ZodString>;
|
|
842
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
843
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
844
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
845
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
846
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
847
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
848
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
849
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
850
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
851
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
852
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
853
|
+
version: z.ZodOptional<z.ZodString>;
|
|
854
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
855
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
856
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
857
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
858
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
859
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
860
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
861
|
+
}, z.ZodUnknown, "strip">>;
|
|
862
|
+
type BaseConnectionFields = z.infer<typeof BaseSchemeRaw>;
|
|
792
863
|
declare const Oauth2InitiatingConnectionDataSchema: z.ZodObject<{
|
|
793
864
|
subdomain: z.ZodOptional<z.ZodString>;
|
|
794
865
|
"your-domain": z.ZodOptional<z.ZodString>;
|
|
@@ -11487,6 +11558,7 @@ declare const ConnectedAccountStatuses: {
|
|
|
11487
11558
|
readonly ACTIVE: "ACTIVE";
|
|
11488
11559
|
readonly FAILED: "FAILED";
|
|
11489
11560
|
readonly EXPIRED: "EXPIRED";
|
|
11561
|
+
readonly INACTIVE: "INACTIVE";
|
|
11490
11562
|
};
|
|
11491
11563
|
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
11492
11564
|
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
@@ -40651,13 +40723,15 @@ declare class Triggers {
|
|
|
40651
40723
|
*/
|
|
40652
40724
|
listActive(query?: TriggerInstanceListActiveParams): Promise<TriggerInstanceListActiveResponse>;
|
|
40653
40725
|
/**
|
|
40654
|
-
* Create a new trigger instance
|
|
40726
|
+
* Create a new trigger instance for a user
|
|
40727
|
+
* If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
40655
40728
|
*
|
|
40729
|
+
* @param {string} userId - The user id of the trigger instance
|
|
40656
40730
|
* @param {string} slug - The slug of the trigger instance
|
|
40657
40731
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
40658
40732
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
40659
40733
|
*/
|
|
40660
|
-
create(slug: string, body
|
|
40734
|
+
create(userId: string, slug: string, body?: TriggerInstanceUpsertParams): Promise<TriggerInstanceUpsertResponse>;
|
|
40661
40735
|
/**
|
|
40662
40736
|
* Update an existing trigger instance
|
|
40663
40737
|
*
|
|
@@ -41729,7 +41803,7 @@ declare class AuthScheme {
|
|
|
41729
41803
|
* @param params The OAuth2 parameters
|
|
41730
41804
|
* @returns ConnectionData object
|
|
41731
41805
|
*/
|
|
41732
|
-
static OAuth2(params: {
|
|
41806
|
+
static OAuth2(params: BaseConnectionFields & {
|
|
41733
41807
|
access_token: string;
|
|
41734
41808
|
token_type: string;
|
|
41735
41809
|
id_token?: string;
|
|
@@ -41741,29 +41815,39 @@ declare class AuthScheme {
|
|
|
41741
41815
|
access_token?: string;
|
|
41742
41816
|
scope?: string;
|
|
41743
41817
|
};
|
|
41818
|
+
code_verifier?: string;
|
|
41819
|
+
redirectUrl?: string;
|
|
41820
|
+
callback_url?: string;
|
|
41821
|
+
finalRedirectUri?: string;
|
|
41822
|
+
error?: string;
|
|
41823
|
+
error_description?: string;
|
|
41824
|
+
expired_at?: string;
|
|
41744
41825
|
}): ConnectionData;
|
|
41745
41826
|
/**
|
|
41746
41827
|
* Creates a ConnectionData object for OAuth1 authentication
|
|
41747
41828
|
* @param params The OAuth1 parameters
|
|
41748
41829
|
* @returns ConnectionData object
|
|
41749
41830
|
*/
|
|
41750
|
-
static OAuth1(params: {
|
|
41831
|
+
static OAuth1(params: BaseConnectionFields & {
|
|
41751
41832
|
oauth_token: string;
|
|
41752
41833
|
consumer_key?: string;
|
|
41753
41834
|
redirectUrl?: string;
|
|
41754
41835
|
callback_url?: string;
|
|
41836
|
+
error?: string;
|
|
41837
|
+
error_description?: string;
|
|
41838
|
+
expired_at?: string;
|
|
41755
41839
|
}): ConnectionData;
|
|
41756
41840
|
/**
|
|
41757
41841
|
* Creates a ConnectionData object for Composio Link authentication
|
|
41758
41842
|
* @returns ConnectionData object
|
|
41759
41843
|
*/
|
|
41760
|
-
static ComposioLink(): ConnectionData;
|
|
41844
|
+
static ComposioLink(params: BaseConnectionFields): ConnectionData;
|
|
41761
41845
|
/**
|
|
41762
41846
|
* Creates a ConnectionData object for API Key authentication
|
|
41763
41847
|
* @param params The API key parameters
|
|
41764
41848
|
* @returns ConnectionData object
|
|
41765
41849
|
*/
|
|
41766
|
-
static APIKey(params: {
|
|
41850
|
+
static APIKey(params: BaseConnectionFields & {
|
|
41767
41851
|
api_key: string;
|
|
41768
41852
|
}): ConnectionData;
|
|
41769
41853
|
/**
|
|
@@ -41771,7 +41855,7 @@ declare class AuthScheme {
|
|
|
41771
41855
|
* @param params The basic auth parameters
|
|
41772
41856
|
* @returns ConnectionData object
|
|
41773
41857
|
*/
|
|
41774
|
-
static Basic(params: {
|
|
41858
|
+
static Basic(params: BaseConnectionFields & {
|
|
41775
41859
|
username: string;
|
|
41776
41860
|
password: string;
|
|
41777
41861
|
}): ConnectionData;
|
|
@@ -41780,7 +41864,7 @@ declare class AuthScheme {
|
|
|
41780
41864
|
* @param params The bearer token parameters
|
|
41781
41865
|
* @returns ConnectionData object
|
|
41782
41866
|
*/
|
|
41783
|
-
static BearerToken(params: {
|
|
41867
|
+
static BearerToken(params: BaseConnectionFields & {
|
|
41784
41868
|
token: string;
|
|
41785
41869
|
}): ConnectionData;
|
|
41786
41870
|
/**
|
|
@@ -41788,20 +41872,20 @@ declare class AuthScheme {
|
|
|
41788
41872
|
* @param params The Google service account parameters
|
|
41789
41873
|
* @returns ConnectionData object
|
|
41790
41874
|
*/
|
|
41791
|
-
static GoogleServiceAccount(params: {
|
|
41875
|
+
static GoogleServiceAccount(params: BaseConnectionFields & {
|
|
41792
41876
|
credentials_json: string;
|
|
41793
41877
|
}): ConnectionData;
|
|
41794
41878
|
/**
|
|
41795
41879
|
* Creates a ConnectionData object for No Auth authentication
|
|
41796
41880
|
* @returns ConnectionData object
|
|
41797
41881
|
*/
|
|
41798
|
-
static NoAuth(): ConnectionData;
|
|
41882
|
+
static NoAuth(params: BaseConnectionFields): ConnectionData;
|
|
41799
41883
|
/**
|
|
41800
41884
|
* Creates a ConnectionData object for Basic with JWT authentication
|
|
41801
41885
|
* @param params The basic with JWT parameters
|
|
41802
41886
|
* @returns ConnectionData object
|
|
41803
41887
|
*/
|
|
41804
|
-
static BasicWithJWT(params: {
|
|
41888
|
+
static BasicWithJWT(params: BaseConnectionFields & {
|
|
41805
41889
|
username: string;
|
|
41806
41890
|
password: string;
|
|
41807
41891
|
}): ConnectionData;
|
|
@@ -41809,18 +41893,18 @@ declare class AuthScheme {
|
|
|
41809
41893
|
* Creates a ConnectionData object for Cal.com authentication
|
|
41810
41894
|
* @returns ConnectionData object
|
|
41811
41895
|
*/
|
|
41812
|
-
static CalcomAuth(): ConnectionData;
|
|
41896
|
+
static CalcomAuth(params: BaseConnectionFields): ConnectionData;
|
|
41813
41897
|
/**
|
|
41814
41898
|
* Creates a ConnectionData object for Snowflake authentication
|
|
41815
41899
|
* @returns ConnectionData object
|
|
41816
41900
|
*/
|
|
41817
|
-
static Snowflake(): ConnectionData;
|
|
41901
|
+
static Snowflake(params: BaseConnectionFields): ConnectionData;
|
|
41818
41902
|
/**
|
|
41819
41903
|
* Creates a ConnectionData object for Bill.com authentication
|
|
41820
41904
|
* @param params The Bill.com auth parameters
|
|
41821
41905
|
* @returns ConnectionData object
|
|
41822
41906
|
*/
|
|
41823
|
-
static BillcomAuth(params: {
|
|
41907
|
+
static BillcomAuth(params: BaseConnectionFields & {
|
|
41824
41908
|
sessionId: string;
|
|
41825
41909
|
devKey: string;
|
|
41826
41910
|
}): ConnectionData;
|
|
@@ -42055,4 +42139,4 @@ declare class ComposioNoAPIKeyError extends ComposioError {
|
|
|
42055
42139
|
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
42056
42140
|
}
|
|
42057
42141
|
|
|
42058
|
-
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigListParams, AuthConfigListParamsSchema, type AuthConfigListResponse, AuthConfigListResponseSchema, type AuthConfigRetrieveResponse, AuthConfigRetrieveResponseSchema, type AuthConfigType, AuthConfigTypes, type AuthConfigUpdateParams, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BasicWithJwtConnectionDataSchema, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioLinkConnectionDataSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, type ConnectionData, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, type ConnectionStatusEnum, ConnectionStatuses, type CreateAuthConfigParams, CreateAuthConfigParamsSchema, type CreateAuthConfigResponse, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateCustomAuthConfigParamsSchema, type CustomAuthParams, CustomAuthParamsSchema, type CustomToolInputParameter, type CustomToolOptions, type CustomToolRegistry, type CustomToolRegistryItem, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, type GlobalExecuteToolFn, type IncomingTriggerPayload, IncomingTriggerPayloadSchema, type InputParamsSchema, JsonSchemaToZodError, type Oauth1ActiveConnectionData, Oauth1ActiveConnectionDataSchema, type Oauth1ConnectionData, Oauth1ConnectionDataSchema, type Oauth1ExpiredConnectionData, Oauth1ExpiredConnectionDataSchema, type Oauth1FailedConnectionData, Oauth1FailedConnectionDataSchema, type Oauth1InitiatedConnectionData, Oauth1InitiatedConnectionDataSchema, type Oauth1InitiatingConnectionData, Oauth1InitiatingConnectionDataSchema, type Oauth2ActiveConnectionData, Oauth2ActiveConnectionDataSchema, type Oauth2ConnectionData, Oauth2ConnectionDataSchema, type Oauth2ExpiredConnectionData, Oauth2ExpiredConnectionDataSchema, type Oauth2FailedConnectionData, Oauth2FailedConnectionDataSchema, type Oauth2InitiatedConnectionData, Oauth2InitiatedConnectionDataSchema, type Oauth2InitiatingConnectionData, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, type Provider, type ProviderOptions, RedirectableAuthSchemeSchema, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, ToolExecuteParamsSchema, type ToolExecuteResponse, ToolExecuteResponseSchema, type ToolKitItem, ToolKitItemSchema, type ToolKitListResponse, ToolKitListResponseSchema, type ToolKitMeta, ToolKitMetaSchema, type ToolList, type ToolListFilterBySearch, ToolListFilterBySearchSchema, type ToolListFilterByToolkits, ToolListFilterByToolkitsSchema, type ToolListFilterByTools, ToolListFilterByToolsSchema, type ToolListParams, ToolListParamsSchema, type ToolListResponse, ToolListResponseSchema, type ToolOptions, type ToolProxyParams, ToolProxyParamsSchema, ToolSchema, type Toolkit, type ToolkitAuthConfigDetails, ToolkitAuthConfigDetailsSchema, type ToolkitAuthField, ToolkitAuthFieldSchema, type ToolkitAuthFieldsResponse, ToolkitAuthFieldsResponseSchema, type ToolkitCategory, ToolkitCategorySchema, ToolkitErrorCodes, type ToolkitListParams, type ToolkitMangedByEnum, ToolkitMangedByEnumSchema, type ToolkitRetrieveCategoriesResponse, ToolkitRetrieveCategoriesResponseSchema, type ToolkitRetrieveResponse, ToolkitRetrieveResponseSchema, ToolkitSchema, type ToolkitSortByEnum, ToolkitSortByEnumSchema, ToolkitsListParamsSchema, type TransformToolSchemaModifier, type TriggerData, type TriggerInstanceListActiveParams, TriggerInstanceListActiveParamsSchema, type TriggerInstanceListActiveResponse, type TriggerInstanceListActiveResponseItem, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, type TriggerInstanceManageDeleteResponse, TriggerInstanceManageDeleteResponseSchema, type TriggerInstanceManageUpdateParams, TriggerInstanceManageUpdateParamsSchema, type TriggerInstanceManageUpdateResponse, TriggerInstanceManageUpdateResponseSchema, type TriggerInstanceUpsertParams, TriggerInstanceUpsertParamsSchema, type TriggerInstanceUpsertResponse, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, type TriggerStatusType, TriggerStatuses, TriggerSubscribeParamSchema, type TriggerSubscribeParams, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger, removeNonRequiredProperties };
|
|
42142
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigListParams, AuthConfigListParamsSchema, type AuthConfigListResponse, AuthConfigListResponseSchema, type AuthConfigRetrieveResponse, AuthConfigRetrieveResponseSchema, type AuthConfigType, AuthConfigTypes, type AuthConfigUpdateParams, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, type BaseConnectionFields, BaseNonAgenticProvider, BasicWithJwtConnectionDataSchema, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioLinkConnectionDataSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, type ConnectionData, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, type ConnectionStatusEnum, ConnectionStatuses, type CreateAuthConfigParams, CreateAuthConfigParamsSchema, type CreateAuthConfigResponse, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateCustomAuthConfigParamsSchema, type CustomAuthParams, CustomAuthParamsSchema, type CustomToolInputParameter, type CustomToolOptions, type CustomToolRegistry, type CustomToolRegistryItem, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, type GlobalExecuteToolFn, type IncomingTriggerPayload, IncomingTriggerPayloadSchema, type InputParamsSchema, JsonSchemaToZodError, type Oauth1ActiveConnectionData, Oauth1ActiveConnectionDataSchema, type Oauth1ConnectionData, Oauth1ConnectionDataSchema, type Oauth1ExpiredConnectionData, Oauth1ExpiredConnectionDataSchema, type Oauth1FailedConnectionData, Oauth1FailedConnectionDataSchema, type Oauth1InitiatedConnectionData, Oauth1InitiatedConnectionDataSchema, type Oauth1InitiatingConnectionData, Oauth1InitiatingConnectionDataSchema, type Oauth2ActiveConnectionData, Oauth2ActiveConnectionDataSchema, type Oauth2ConnectionData, Oauth2ConnectionDataSchema, type Oauth2ExpiredConnectionData, Oauth2ExpiredConnectionDataSchema, type Oauth2FailedConnectionData, Oauth2FailedConnectionDataSchema, type Oauth2InitiatedConnectionData, Oauth2InitiatedConnectionDataSchema, type Oauth2InitiatingConnectionData, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, type Provider, type ProviderOptions, RedirectableAuthSchemeSchema, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, ToolExecuteParamsSchema, type ToolExecuteResponse, ToolExecuteResponseSchema, type ToolKitItem, ToolKitItemSchema, type ToolKitListResponse, ToolKitListResponseSchema, type ToolKitMeta, ToolKitMetaSchema, type ToolList, type ToolListFilterBySearch, ToolListFilterBySearchSchema, type ToolListFilterByToolkits, ToolListFilterByToolkitsSchema, type ToolListFilterByTools, ToolListFilterByToolsSchema, type ToolListParams, ToolListParamsSchema, type ToolListResponse, ToolListResponseSchema, type ToolOptions, type ToolProxyParams, ToolProxyParamsSchema, ToolSchema, type Toolkit, type ToolkitAuthConfigDetails, ToolkitAuthConfigDetailsSchema, type ToolkitAuthField, ToolkitAuthFieldSchema, type ToolkitAuthFieldsResponse, ToolkitAuthFieldsResponseSchema, type ToolkitCategory, ToolkitCategorySchema, ToolkitErrorCodes, type ToolkitListParams, type ToolkitMangedByEnum, ToolkitMangedByEnumSchema, type ToolkitRetrieveCategoriesResponse, ToolkitRetrieveCategoriesResponseSchema, type ToolkitRetrieveResponse, ToolkitRetrieveResponseSchema, ToolkitSchema, type ToolkitSortByEnum, ToolkitSortByEnumSchema, ToolkitsListParamsSchema, type TransformToolSchemaModifier, type TriggerData, type TriggerInstanceListActiveParams, TriggerInstanceListActiveParamsSchema, type TriggerInstanceListActiveResponse, type TriggerInstanceListActiveResponseItem, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, type TriggerInstanceManageDeleteResponse, TriggerInstanceManageDeleteResponseSchema, type TriggerInstanceManageUpdateParams, TriggerInstanceManageUpdateParamsSchema, type TriggerInstanceManageUpdateResponse, TriggerInstanceManageUpdateResponseSchema, type TriggerInstanceUpsertParams, TriggerInstanceUpsertParamsSchema, type TriggerInstanceUpsertResponse, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, type TriggerStatusType, TriggerStatuses, TriggerSubscribeParamSchema, type TriggerSubscribeParams, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger, removeNonRequiredProperties };
|
package/dist/index.d.ts
CHANGED
|
@@ -789,6 +789,77 @@ declare const ConnectionStatuses: {
|
|
|
789
789
|
};
|
|
790
790
|
type ConnectionStatusEnum = (typeof ConnectionStatuses)[keyof typeof ConnectionStatuses];
|
|
791
791
|
declare const RedirectableAuthSchemeSchema: z.ZodEnum<["OAUTH1", "OAUTH2", "COMPOSIO_LINK"]>;
|
|
792
|
+
declare const BaseSchemeRaw: z.ZodObject<{
|
|
793
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
794
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
795
|
+
region: z.ZodOptional<z.ZodString>;
|
|
796
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
797
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
798
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
799
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
800
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
801
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
802
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
803
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
804
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
805
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
806
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
807
|
+
version: z.ZodOptional<z.ZodString>;
|
|
808
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
809
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
810
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
811
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
812
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
813
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
814
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
815
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
816
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
817
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
818
|
+
region: z.ZodOptional<z.ZodString>;
|
|
819
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
820
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
821
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
822
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
823
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
824
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
825
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
826
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
827
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
828
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
829
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
830
|
+
version: z.ZodOptional<z.ZodString>;
|
|
831
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
832
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
833
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
834
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
835
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
836
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
837
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
838
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
839
|
+
subdomain: z.ZodOptional<z.ZodString>;
|
|
840
|
+
"your-domain": z.ZodOptional<z.ZodString>;
|
|
841
|
+
region: z.ZodOptional<z.ZodString>;
|
|
842
|
+
shop: z.ZodOptional<z.ZodString>;
|
|
843
|
+
account_url: z.ZodOptional<z.ZodString>;
|
|
844
|
+
COMPANYDOMAIN: z.ZodOptional<z.ZodString>;
|
|
845
|
+
extension: z.ZodOptional<z.ZodString>;
|
|
846
|
+
form_api_base_url: z.ZodOptional<z.ZodString>;
|
|
847
|
+
instanceEndpoint: z.ZodOptional<z.ZodString>;
|
|
848
|
+
api_url: z.ZodOptional<z.ZodString>;
|
|
849
|
+
borneo_dashboard_url: z.ZodOptional<z.ZodString>;
|
|
850
|
+
proxy_username: z.ZodOptional<z.ZodString>;
|
|
851
|
+
proxy_password: z.ZodOptional<z.ZodString>;
|
|
852
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
853
|
+
version: z.ZodOptional<z.ZodString>;
|
|
854
|
+
dc: z.ZodOptional<z.ZodString>;
|
|
855
|
+
site_name: z.ZodOptional<z.ZodString>;
|
|
856
|
+
instanceName: z.ZodOptional<z.ZodString>;
|
|
857
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
858
|
+
your_server: z.ZodOptional<z.ZodString>;
|
|
859
|
+
server_location: z.ZodOptional<z.ZodString>;
|
|
860
|
+
base_url: z.ZodOptional<z.ZodString>;
|
|
861
|
+
}, z.ZodUnknown, "strip">>;
|
|
862
|
+
type BaseConnectionFields = z.infer<typeof BaseSchemeRaw>;
|
|
792
863
|
declare const Oauth2InitiatingConnectionDataSchema: z.ZodObject<{
|
|
793
864
|
subdomain: z.ZodOptional<z.ZodString>;
|
|
794
865
|
"your-domain": z.ZodOptional<z.ZodString>;
|
|
@@ -11487,6 +11558,7 @@ declare const ConnectedAccountStatuses: {
|
|
|
11487
11558
|
readonly ACTIVE: "ACTIVE";
|
|
11488
11559
|
readonly FAILED: "FAILED";
|
|
11489
11560
|
readonly EXPIRED: "EXPIRED";
|
|
11561
|
+
readonly INACTIVE: "INACTIVE";
|
|
11490
11562
|
};
|
|
11491
11563
|
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
11492
11564
|
declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
@@ -40651,13 +40723,15 @@ declare class Triggers {
|
|
|
40651
40723
|
*/
|
|
40652
40724
|
listActive(query?: TriggerInstanceListActiveParams): Promise<TriggerInstanceListActiveResponse>;
|
|
40653
40725
|
/**
|
|
40654
|
-
* Create a new trigger instance
|
|
40726
|
+
* Create a new trigger instance for a user
|
|
40727
|
+
* If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
40655
40728
|
*
|
|
40729
|
+
* @param {string} userId - The user id of the trigger instance
|
|
40656
40730
|
* @param {string} slug - The slug of the trigger instance
|
|
40657
40731
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
40658
40732
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
40659
40733
|
*/
|
|
40660
|
-
create(slug: string, body
|
|
40734
|
+
create(userId: string, slug: string, body?: TriggerInstanceUpsertParams): Promise<TriggerInstanceUpsertResponse>;
|
|
40661
40735
|
/**
|
|
40662
40736
|
* Update an existing trigger instance
|
|
40663
40737
|
*
|
|
@@ -41729,7 +41803,7 @@ declare class AuthScheme {
|
|
|
41729
41803
|
* @param params The OAuth2 parameters
|
|
41730
41804
|
* @returns ConnectionData object
|
|
41731
41805
|
*/
|
|
41732
|
-
static OAuth2(params: {
|
|
41806
|
+
static OAuth2(params: BaseConnectionFields & {
|
|
41733
41807
|
access_token: string;
|
|
41734
41808
|
token_type: string;
|
|
41735
41809
|
id_token?: string;
|
|
@@ -41741,29 +41815,39 @@ declare class AuthScheme {
|
|
|
41741
41815
|
access_token?: string;
|
|
41742
41816
|
scope?: string;
|
|
41743
41817
|
};
|
|
41818
|
+
code_verifier?: string;
|
|
41819
|
+
redirectUrl?: string;
|
|
41820
|
+
callback_url?: string;
|
|
41821
|
+
finalRedirectUri?: string;
|
|
41822
|
+
error?: string;
|
|
41823
|
+
error_description?: string;
|
|
41824
|
+
expired_at?: string;
|
|
41744
41825
|
}): ConnectionData;
|
|
41745
41826
|
/**
|
|
41746
41827
|
* Creates a ConnectionData object for OAuth1 authentication
|
|
41747
41828
|
* @param params The OAuth1 parameters
|
|
41748
41829
|
* @returns ConnectionData object
|
|
41749
41830
|
*/
|
|
41750
|
-
static OAuth1(params: {
|
|
41831
|
+
static OAuth1(params: BaseConnectionFields & {
|
|
41751
41832
|
oauth_token: string;
|
|
41752
41833
|
consumer_key?: string;
|
|
41753
41834
|
redirectUrl?: string;
|
|
41754
41835
|
callback_url?: string;
|
|
41836
|
+
error?: string;
|
|
41837
|
+
error_description?: string;
|
|
41838
|
+
expired_at?: string;
|
|
41755
41839
|
}): ConnectionData;
|
|
41756
41840
|
/**
|
|
41757
41841
|
* Creates a ConnectionData object for Composio Link authentication
|
|
41758
41842
|
* @returns ConnectionData object
|
|
41759
41843
|
*/
|
|
41760
|
-
static ComposioLink(): ConnectionData;
|
|
41844
|
+
static ComposioLink(params: BaseConnectionFields): ConnectionData;
|
|
41761
41845
|
/**
|
|
41762
41846
|
* Creates a ConnectionData object for API Key authentication
|
|
41763
41847
|
* @param params The API key parameters
|
|
41764
41848
|
* @returns ConnectionData object
|
|
41765
41849
|
*/
|
|
41766
|
-
static APIKey(params: {
|
|
41850
|
+
static APIKey(params: BaseConnectionFields & {
|
|
41767
41851
|
api_key: string;
|
|
41768
41852
|
}): ConnectionData;
|
|
41769
41853
|
/**
|
|
@@ -41771,7 +41855,7 @@ declare class AuthScheme {
|
|
|
41771
41855
|
* @param params The basic auth parameters
|
|
41772
41856
|
* @returns ConnectionData object
|
|
41773
41857
|
*/
|
|
41774
|
-
static Basic(params: {
|
|
41858
|
+
static Basic(params: BaseConnectionFields & {
|
|
41775
41859
|
username: string;
|
|
41776
41860
|
password: string;
|
|
41777
41861
|
}): ConnectionData;
|
|
@@ -41780,7 +41864,7 @@ declare class AuthScheme {
|
|
|
41780
41864
|
* @param params The bearer token parameters
|
|
41781
41865
|
* @returns ConnectionData object
|
|
41782
41866
|
*/
|
|
41783
|
-
static BearerToken(params: {
|
|
41867
|
+
static BearerToken(params: BaseConnectionFields & {
|
|
41784
41868
|
token: string;
|
|
41785
41869
|
}): ConnectionData;
|
|
41786
41870
|
/**
|
|
@@ -41788,20 +41872,20 @@ declare class AuthScheme {
|
|
|
41788
41872
|
* @param params The Google service account parameters
|
|
41789
41873
|
* @returns ConnectionData object
|
|
41790
41874
|
*/
|
|
41791
|
-
static GoogleServiceAccount(params: {
|
|
41875
|
+
static GoogleServiceAccount(params: BaseConnectionFields & {
|
|
41792
41876
|
credentials_json: string;
|
|
41793
41877
|
}): ConnectionData;
|
|
41794
41878
|
/**
|
|
41795
41879
|
* Creates a ConnectionData object for No Auth authentication
|
|
41796
41880
|
* @returns ConnectionData object
|
|
41797
41881
|
*/
|
|
41798
|
-
static NoAuth(): ConnectionData;
|
|
41882
|
+
static NoAuth(params: BaseConnectionFields): ConnectionData;
|
|
41799
41883
|
/**
|
|
41800
41884
|
* Creates a ConnectionData object for Basic with JWT authentication
|
|
41801
41885
|
* @param params The basic with JWT parameters
|
|
41802
41886
|
* @returns ConnectionData object
|
|
41803
41887
|
*/
|
|
41804
|
-
static BasicWithJWT(params: {
|
|
41888
|
+
static BasicWithJWT(params: BaseConnectionFields & {
|
|
41805
41889
|
username: string;
|
|
41806
41890
|
password: string;
|
|
41807
41891
|
}): ConnectionData;
|
|
@@ -41809,18 +41893,18 @@ declare class AuthScheme {
|
|
|
41809
41893
|
* Creates a ConnectionData object for Cal.com authentication
|
|
41810
41894
|
* @returns ConnectionData object
|
|
41811
41895
|
*/
|
|
41812
|
-
static CalcomAuth(): ConnectionData;
|
|
41896
|
+
static CalcomAuth(params: BaseConnectionFields): ConnectionData;
|
|
41813
41897
|
/**
|
|
41814
41898
|
* Creates a ConnectionData object for Snowflake authentication
|
|
41815
41899
|
* @returns ConnectionData object
|
|
41816
41900
|
*/
|
|
41817
|
-
static Snowflake(): ConnectionData;
|
|
41901
|
+
static Snowflake(params: BaseConnectionFields): ConnectionData;
|
|
41818
41902
|
/**
|
|
41819
41903
|
* Creates a ConnectionData object for Bill.com authentication
|
|
41820
41904
|
* @param params The Bill.com auth parameters
|
|
41821
41905
|
* @returns ConnectionData object
|
|
41822
41906
|
*/
|
|
41823
|
-
static BillcomAuth(params: {
|
|
41907
|
+
static BillcomAuth(params: BaseConnectionFields & {
|
|
41824
41908
|
sessionId: string;
|
|
41825
41909
|
devKey: string;
|
|
41826
41910
|
}): ConnectionData;
|
|
@@ -42055,4 +42139,4 @@ declare class ComposioNoAPIKeyError extends ComposioError {
|
|
|
42055
42139
|
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
42056
42140
|
}
|
|
42057
42141
|
|
|
42058
|
-
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigListParams, AuthConfigListParamsSchema, type AuthConfigListResponse, AuthConfigListResponseSchema, type AuthConfigRetrieveResponse, AuthConfigRetrieveResponseSchema, type AuthConfigType, AuthConfigTypes, type AuthConfigUpdateParams, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BasicWithJwtConnectionDataSchema, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioLinkConnectionDataSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, type ConnectionData, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, type ConnectionStatusEnum, ConnectionStatuses, type CreateAuthConfigParams, CreateAuthConfigParamsSchema, type CreateAuthConfigResponse, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateCustomAuthConfigParamsSchema, type CustomAuthParams, CustomAuthParamsSchema, type CustomToolInputParameter, type CustomToolOptions, type CustomToolRegistry, type CustomToolRegistryItem, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, type GlobalExecuteToolFn, type IncomingTriggerPayload, IncomingTriggerPayloadSchema, type InputParamsSchema, JsonSchemaToZodError, type Oauth1ActiveConnectionData, Oauth1ActiveConnectionDataSchema, type Oauth1ConnectionData, Oauth1ConnectionDataSchema, type Oauth1ExpiredConnectionData, Oauth1ExpiredConnectionDataSchema, type Oauth1FailedConnectionData, Oauth1FailedConnectionDataSchema, type Oauth1InitiatedConnectionData, Oauth1InitiatedConnectionDataSchema, type Oauth1InitiatingConnectionData, Oauth1InitiatingConnectionDataSchema, type Oauth2ActiveConnectionData, Oauth2ActiveConnectionDataSchema, type Oauth2ConnectionData, Oauth2ConnectionDataSchema, type Oauth2ExpiredConnectionData, Oauth2ExpiredConnectionDataSchema, type Oauth2FailedConnectionData, Oauth2FailedConnectionDataSchema, type Oauth2InitiatedConnectionData, Oauth2InitiatedConnectionDataSchema, type Oauth2InitiatingConnectionData, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, type Provider, type ProviderOptions, RedirectableAuthSchemeSchema, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, ToolExecuteParamsSchema, type ToolExecuteResponse, ToolExecuteResponseSchema, type ToolKitItem, ToolKitItemSchema, type ToolKitListResponse, ToolKitListResponseSchema, type ToolKitMeta, ToolKitMetaSchema, type ToolList, type ToolListFilterBySearch, ToolListFilterBySearchSchema, type ToolListFilterByToolkits, ToolListFilterByToolkitsSchema, type ToolListFilterByTools, ToolListFilterByToolsSchema, type ToolListParams, ToolListParamsSchema, type ToolListResponse, ToolListResponseSchema, type ToolOptions, type ToolProxyParams, ToolProxyParamsSchema, ToolSchema, type Toolkit, type ToolkitAuthConfigDetails, ToolkitAuthConfigDetailsSchema, type ToolkitAuthField, ToolkitAuthFieldSchema, type ToolkitAuthFieldsResponse, ToolkitAuthFieldsResponseSchema, type ToolkitCategory, ToolkitCategorySchema, ToolkitErrorCodes, type ToolkitListParams, type ToolkitMangedByEnum, ToolkitMangedByEnumSchema, type ToolkitRetrieveCategoriesResponse, ToolkitRetrieveCategoriesResponseSchema, type ToolkitRetrieveResponse, ToolkitRetrieveResponseSchema, ToolkitSchema, type ToolkitSortByEnum, ToolkitSortByEnumSchema, ToolkitsListParamsSchema, type TransformToolSchemaModifier, type TriggerData, type TriggerInstanceListActiveParams, TriggerInstanceListActiveParamsSchema, type TriggerInstanceListActiveResponse, type TriggerInstanceListActiveResponseItem, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, type TriggerInstanceManageDeleteResponse, TriggerInstanceManageDeleteResponseSchema, type TriggerInstanceManageUpdateParams, TriggerInstanceManageUpdateParamsSchema, type TriggerInstanceManageUpdateResponse, TriggerInstanceManageUpdateResponseSchema, type TriggerInstanceUpsertParams, TriggerInstanceUpsertParamsSchema, type TriggerInstanceUpsertResponse, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, type TriggerStatusType, TriggerStatuses, TriggerSubscribeParamSchema, type TriggerSubscribeParams, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger, removeNonRequiredProperties };
|
|
42142
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigListParams, AuthConfigListParamsSchema, type AuthConfigListResponse, AuthConfigListResponseSchema, type AuthConfigRetrieveResponse, AuthConfigRetrieveResponseSchema, type AuthConfigType, AuthConfigTypes, type AuthConfigUpdateParams, AuthConfigUpdateParamsSchema, AuthCustomConfigUpdateParamsSchema, AuthDefaultConfigUpdateParamsSchema, AuthScheme, AuthSchemeEnum, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, type BaseConnectionFields, BaseNonAgenticProvider, BasicWithJwtConnectionDataSchema, BillcomAuthConnectionDataSchema, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioLinkConnectionDataSchema, ComposioMultipleConnectedAccountsError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, type ConnectionData, ConnectionDataSchema, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, type ConnectionStatusEnum, ConnectionStatuses, type CreateAuthConfigParams, CreateAuthConfigParamsSchema, type CreateAuthConfigResponse, CreateAuthConfigResponseSchema, CreateComposioManagedAuthConfigParamsSchema, CreateCustomAuthConfigParamsSchema, type CustomAuthParams, CustomAuthParamsSchema, type CustomToolInputParameter, type CustomToolOptions, type CustomToolRegistry, type CustomToolRegistryItem, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, type GlobalExecuteToolFn, type IncomingTriggerPayload, IncomingTriggerPayloadSchema, type InputParamsSchema, JsonSchemaToZodError, type Oauth1ActiveConnectionData, Oauth1ActiveConnectionDataSchema, type Oauth1ConnectionData, Oauth1ConnectionDataSchema, type Oauth1ExpiredConnectionData, Oauth1ExpiredConnectionDataSchema, type Oauth1FailedConnectionData, Oauth1FailedConnectionDataSchema, type Oauth1InitiatedConnectionData, Oauth1InitiatedConnectionDataSchema, type Oauth1InitiatingConnectionData, Oauth1InitiatingConnectionDataSchema, type Oauth2ActiveConnectionData, Oauth2ActiveConnectionDataSchema, type Oauth2ConnectionData, Oauth2ConnectionDataSchema, type Oauth2ExpiredConnectionData, Oauth2ExpiredConnectionDataSchema, type Oauth2FailedConnectionData, Oauth2FailedConnectionDataSchema, type Oauth2InitiatedConnectionData, Oauth2InitiatedConnectionDataSchema, type Oauth2InitiatingConnectionData, Oauth2InitiatingConnectionDataSchema, OpenAIProvider, type Provider, type ProviderOptions, RedirectableAuthSchemeSchema, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, ToolExecuteParamsSchema, type ToolExecuteResponse, ToolExecuteResponseSchema, type ToolKitItem, ToolKitItemSchema, type ToolKitListResponse, ToolKitListResponseSchema, type ToolKitMeta, ToolKitMetaSchema, type ToolList, type ToolListFilterBySearch, ToolListFilterBySearchSchema, type ToolListFilterByToolkits, ToolListFilterByToolkitsSchema, type ToolListFilterByTools, ToolListFilterByToolsSchema, type ToolListParams, ToolListParamsSchema, type ToolListResponse, ToolListResponseSchema, type ToolOptions, type ToolProxyParams, ToolProxyParamsSchema, ToolSchema, type Toolkit, type ToolkitAuthConfigDetails, ToolkitAuthConfigDetailsSchema, type ToolkitAuthField, ToolkitAuthFieldSchema, type ToolkitAuthFieldsResponse, ToolkitAuthFieldsResponseSchema, type ToolkitCategory, ToolkitCategorySchema, ToolkitErrorCodes, type ToolkitListParams, type ToolkitMangedByEnum, ToolkitMangedByEnumSchema, type ToolkitRetrieveCategoriesResponse, ToolkitRetrieveCategoriesResponseSchema, type ToolkitRetrieveResponse, ToolkitRetrieveResponseSchema, ToolkitSchema, type ToolkitSortByEnum, ToolkitSortByEnumSchema, ToolkitsListParamsSchema, type TransformToolSchemaModifier, type TriggerData, type TriggerInstanceListActiveParams, TriggerInstanceListActiveParamsSchema, type TriggerInstanceListActiveResponse, type TriggerInstanceListActiveResponseItem, TriggerInstanceListActiveResponseItemSchema, TriggerInstanceListActiveResponseSchema, type TriggerInstanceManageDeleteResponse, TriggerInstanceManageDeleteResponseSchema, type TriggerInstanceManageUpdateParams, TriggerInstanceManageUpdateParamsSchema, type TriggerInstanceManageUpdateResponse, TriggerInstanceManageUpdateResponseSchema, type TriggerInstanceUpsertParams, TriggerInstanceUpsertParamsSchema, type TriggerInstanceUpsertResponse, TriggerInstanceUpsertResponseSchema, TriggerStatusEnum, type TriggerStatusType, TriggerStatuses, TriggerSubscribeParamSchema, type TriggerSubscribeParams, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger, removeNonRequiredProperties };
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
6
6
|
});
|
|
7
7
|
|
|
8
8
|
// src/composio.ts
|
|
9
|
-
import
|
|
9
|
+
import ComposioClient4 from "@composio/client";
|
|
10
10
|
|
|
11
11
|
// src/types/tool.types.ts
|
|
12
12
|
import { z } from "zod";
|
|
@@ -1541,7 +1541,8 @@ var ConnectedAccountStatuses = {
|
|
|
1541
1541
|
INITIATED: "INITIATED",
|
|
1542
1542
|
ACTIVE: "ACTIVE",
|
|
1543
1543
|
FAILED: "FAILED",
|
|
1544
|
-
EXPIRED: "EXPIRED"
|
|
1544
|
+
EXPIRED: "EXPIRED",
|
|
1545
|
+
INACTIVE: "INACTIVE"
|
|
1545
1546
|
};
|
|
1546
1547
|
var ConnectedAccountStatusSchema = z4.enum([
|
|
1547
1548
|
ConnectedAccountStatuses.INITIALIZING,
|
|
@@ -2109,12 +2110,16 @@ var Tools = class {
|
|
|
2109
2110
|
"Invalid tool list parameters, atleast one of the following parameters is required: tools, toolkits, search"
|
|
2110
2111
|
);
|
|
2111
2112
|
}
|
|
2113
|
+
let limit = "limit" in queryParams.data ? queryParams.data.limit?.toString() : void 0;
|
|
2114
|
+
if ("tools" in queryParams.data) {
|
|
2115
|
+
limit = "9999";
|
|
2116
|
+
}
|
|
2112
2117
|
const tools = await this.client.tools.list({
|
|
2113
2118
|
tool_slugs: "tools" in queryParams.data ? queryParams.data.tools?.join(",") : void 0,
|
|
2114
2119
|
toolkit_slug: "toolkits" in queryParams.data ? queryParams.data.toolkits?.join(",") : void 0,
|
|
2115
2120
|
cursor: "cursor" in queryParams.data ? queryParams.data.cursor : void 0,
|
|
2116
2121
|
important: "important" in queryParams.data ? queryParams.data.important ? "true" : "false" : void 0,
|
|
2117
|
-
limit
|
|
2122
|
+
limit,
|
|
2118
2123
|
search: "search" in queryParams.data ? queryParams.data.search : void 0
|
|
2119
2124
|
});
|
|
2120
2125
|
if (!tools) {
|
|
@@ -3602,6 +3607,9 @@ var Toolkits = class {
|
|
|
3602
3607
|
}
|
|
3603
3608
|
};
|
|
3604
3609
|
|
|
3610
|
+
// src/models/Triggers.ts
|
|
3611
|
+
import { APIError } from "@composio/client";
|
|
3612
|
+
|
|
3605
3613
|
// src/types/triggers.types.ts
|
|
3606
3614
|
import { z as z6 } from "zod";
|
|
3607
3615
|
var TriggerStatuses = {
|
|
@@ -3732,7 +3740,8 @@ var TriggerErrorCodes = {
|
|
|
3732
3740
|
TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS: "TRIGGER_FAILED_TO_GET_SDK_REALTIME_CREDENTIALS",
|
|
3733
3741
|
TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT: "TRIGGER_FAILED_TO_CREATE_PUSHER_CLIENT",
|
|
3734
3742
|
TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_SUBSCRIBE_TO_PUSHER_CHANNEL",
|
|
3735
|
-
TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL"
|
|
3743
|
+
TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL: "TRIGGER_FAILED_TO_UNSUBSCRIBE_FROM_PUSHER_CHANNEL",
|
|
3744
|
+
TRIGGER_TYPE_NOT_FOUND: "TRIGGER_TYPE_NOT_FOUND"
|
|
3736
3745
|
};
|
|
3737
3746
|
var ComposioFailedToGetSDKRealtimeCredentialsError = class extends ComposioError2 {
|
|
3738
3747
|
name = "ComposioFailedToGetSDKRealtimeCredentialsError";
|
|
@@ -3761,6 +3770,15 @@ var ComposioFailedToSubscribeToPusherChannelError = class extends ComposioError2
|
|
|
3761
3770
|
super(message, options);
|
|
3762
3771
|
}
|
|
3763
3772
|
};
|
|
3773
|
+
var ComposioTriggerTypeNotFoundError = class extends ComposioError2 {
|
|
3774
|
+
name = "ComposioTriggerTypeNotFoundError";
|
|
3775
|
+
code = TriggerErrorCodes.TRIGGER_TYPE_NOT_FOUND;
|
|
3776
|
+
statusCode = 404;
|
|
3777
|
+
possibleFixes = ["Please contact support."];
|
|
3778
|
+
constructor(message = "Trigger type not found", options) {
|
|
3779
|
+
super(message, options);
|
|
3780
|
+
}
|
|
3781
|
+
};
|
|
3764
3782
|
|
|
3765
3783
|
// src/services/pusher/Pusher.ts
|
|
3766
3784
|
var PusherService = class {
|
|
@@ -4026,21 +4044,89 @@ var Triggers = class {
|
|
|
4026
4044
|
return parsedResult.data;
|
|
4027
4045
|
}
|
|
4028
4046
|
/**
|
|
4029
|
-
* Create a new trigger instance
|
|
4047
|
+
* Create a new trigger instance for a user
|
|
4048
|
+
* If the connected account id is not provided, the first connected account for the user and toolkit will be used
|
|
4030
4049
|
*
|
|
4050
|
+
* @param {string} userId - The user id of the trigger instance
|
|
4031
4051
|
* @param {string} slug - The slug of the trigger instance
|
|
4032
4052
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
4033
4053
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
4034
4054
|
*/
|
|
4035
|
-
async create(slug, body) {
|
|
4036
|
-
const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body);
|
|
4055
|
+
async create(userId, slug, body) {
|
|
4056
|
+
const parsedBody = TriggerInstanceUpsertParamsSchema.safeParse(body ?? {});
|
|
4037
4057
|
if (!parsedBody.success) {
|
|
4038
4058
|
throw new ValidationError(`Invalid parameters passed to create trigger`, {
|
|
4039
4059
|
cause: parsedBody.error
|
|
4040
4060
|
});
|
|
4041
4061
|
}
|
|
4062
|
+
let triggerType;
|
|
4063
|
+
let toolkitSlug;
|
|
4064
|
+
try {
|
|
4065
|
+
triggerType = await this.getType(slug);
|
|
4066
|
+
toolkitSlug = triggerType.toolkit.slug;
|
|
4067
|
+
} catch (error) {
|
|
4068
|
+
if (error instanceof APIError && (error.status === 400 || error.status === 404)) {
|
|
4069
|
+
throw new ComposioTriggerTypeNotFoundError(`Trigger type ${slug} not found`, {
|
|
4070
|
+
cause: error,
|
|
4071
|
+
possibleFixes: [
|
|
4072
|
+
`Please check the trigger slug`,
|
|
4073
|
+
`Visit the toolkit page to see the available triggers`
|
|
4074
|
+
]
|
|
4075
|
+
});
|
|
4076
|
+
} else {
|
|
4077
|
+
throw error;
|
|
4078
|
+
}
|
|
4079
|
+
}
|
|
4080
|
+
let connectedAccountId = body?.connectedAccountId;
|
|
4081
|
+
try {
|
|
4082
|
+
const { items: connectedAccounts } = await this.client.connectedAccounts.list({
|
|
4083
|
+
user_ids: [userId],
|
|
4084
|
+
toolkit_slugs: [toolkitSlug]
|
|
4085
|
+
});
|
|
4086
|
+
if (connectedAccounts.length === 0) {
|
|
4087
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4088
|
+
`No connected account found for user ${userId} for toolkit ${toolkitSlug}`,
|
|
4089
|
+
{
|
|
4090
|
+
cause: new Error(`No connected account found for user ${userId}`),
|
|
4091
|
+
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4092
|
+
}
|
|
4093
|
+
);
|
|
4094
|
+
}
|
|
4095
|
+
const accountExists = connectedAccounts.some((acc) => acc.id === connectedAccountId);
|
|
4096
|
+
if (connectedAccountId && !accountExists) {
|
|
4097
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4098
|
+
`Connected account ID ${connectedAccountId} not found for user ${userId}`,
|
|
4099
|
+
{
|
|
4100
|
+
cause: new Error(
|
|
4101
|
+
`Connected account ID ${connectedAccountId} not found for user ${userId}`
|
|
4102
|
+
),
|
|
4103
|
+
possibleFixes: [
|
|
4104
|
+
`Create a new connected account for user ${userId}`,
|
|
4105
|
+
`Verify the connected account ID`
|
|
4106
|
+
]
|
|
4107
|
+
}
|
|
4108
|
+
);
|
|
4109
|
+
}
|
|
4110
|
+
if (!connectedAccountId) {
|
|
4111
|
+
connectedAccountId = connectedAccounts[0].id;
|
|
4112
|
+
logger_default.warn(
|
|
4113
|
+
`[Warn] Multiple connected accounts found for user ${userId}, using the first one. Pass connectedAccountId to select a specific account.`
|
|
4114
|
+
);
|
|
4115
|
+
}
|
|
4116
|
+
} catch (error) {
|
|
4117
|
+
if (error instanceof APIError && [400, 404].includes(error.status)) {
|
|
4118
|
+
throw new ComposioConnectedAccountNotFoundError(
|
|
4119
|
+
`No connected account found for user ${userId} for toolkit ${toolkitSlug}`,
|
|
4120
|
+
{
|
|
4121
|
+
cause: error,
|
|
4122
|
+
possibleFixes: [`Create a new connected account for user ${userId}`]
|
|
4123
|
+
}
|
|
4124
|
+
);
|
|
4125
|
+
}
|
|
4126
|
+
throw error;
|
|
4127
|
+
}
|
|
4042
4128
|
const result = await this.client.triggerInstances.upsert(slug, {
|
|
4043
|
-
connected_account_id:
|
|
4129
|
+
connected_account_id: connectedAccountId,
|
|
4044
4130
|
trigger_config: parsedBody.data.triggerConfig
|
|
4045
4131
|
});
|
|
4046
4132
|
const parsedResult = TriggerInstanceUpsertResponseSchema.safeParse({
|
|
@@ -4793,7 +4879,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
4793
4879
|
};
|
|
4794
4880
|
|
|
4795
4881
|
// package.json
|
|
4796
|
-
var version = "0.1.
|
|
4882
|
+
var version = "0.1.24";
|
|
4797
4883
|
|
|
4798
4884
|
// src/composio.ts
|
|
4799
4885
|
var Composio = class _Composio {
|
|
@@ -4857,7 +4943,7 @@ var Composio = class _Composio {
|
|
|
4857
4943
|
if (IS_DEVELOPMENT_OR_CI) {
|
|
4858
4944
|
logger_default.debug(`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}`);
|
|
4859
4945
|
}
|
|
4860
|
-
this.client = new
|
|
4946
|
+
this.client = new ComposioClient4({
|
|
4861
4947
|
apiKey: apiKeyParsed,
|
|
4862
4948
|
baseURL: baseURLParsed,
|
|
4863
4949
|
defaultHeaders: config?.defaultHeaders,
|
|
@@ -5022,11 +5108,12 @@ var AuthScheme = class {
|
|
|
5022
5108
|
* Creates a ConnectionData object for Composio Link authentication
|
|
5023
5109
|
* @returns ConnectionData object
|
|
5024
5110
|
*/
|
|
5025
|
-
static ComposioLink() {
|
|
5111
|
+
static ComposioLink(params) {
|
|
5026
5112
|
return {
|
|
5027
5113
|
authScheme: AuthSchemeTypes.COMPOSIO_LINK,
|
|
5028
5114
|
val: {
|
|
5029
|
-
status: ConnectionStatuses.INITIALIZING
|
|
5115
|
+
status: ConnectionStatuses.INITIALIZING,
|
|
5116
|
+
...params
|
|
5030
5117
|
}
|
|
5031
5118
|
};
|
|
5032
5119
|
}
|
|
@@ -5040,7 +5127,7 @@ var AuthScheme = class {
|
|
|
5040
5127
|
authScheme: AuthSchemeTypes.API_KEY,
|
|
5041
5128
|
val: {
|
|
5042
5129
|
status: ConnectionStatuses.ACTIVE,
|
|
5043
|
-
|
|
5130
|
+
...params
|
|
5044
5131
|
}
|
|
5045
5132
|
};
|
|
5046
5133
|
}
|
|
@@ -5054,8 +5141,7 @@ var AuthScheme = class {
|
|
|
5054
5141
|
authScheme: AuthSchemeTypes.BASIC,
|
|
5055
5142
|
val: {
|
|
5056
5143
|
status: ConnectionStatuses.ACTIVE,
|
|
5057
|
-
|
|
5058
|
-
password: params.password
|
|
5144
|
+
...params
|
|
5059
5145
|
}
|
|
5060
5146
|
};
|
|
5061
5147
|
}
|
|
@@ -5069,7 +5155,7 @@ var AuthScheme = class {
|
|
|
5069
5155
|
authScheme: AuthSchemeTypes.BEARER_TOKEN,
|
|
5070
5156
|
val: {
|
|
5071
5157
|
status: ConnectionStatuses.ACTIVE,
|
|
5072
|
-
|
|
5158
|
+
...params
|
|
5073
5159
|
}
|
|
5074
5160
|
};
|
|
5075
5161
|
}
|
|
@@ -5083,7 +5169,7 @@ var AuthScheme = class {
|
|
|
5083
5169
|
authScheme: AuthSchemeTypes.GOOGLE_SERVICE_ACCOUNT,
|
|
5084
5170
|
val: {
|
|
5085
5171
|
status: ConnectionStatuses.ACTIVE,
|
|
5086
|
-
|
|
5172
|
+
...params
|
|
5087
5173
|
}
|
|
5088
5174
|
};
|
|
5089
5175
|
}
|
|
@@ -5091,11 +5177,12 @@ var AuthScheme = class {
|
|
|
5091
5177
|
* Creates a ConnectionData object for No Auth authentication
|
|
5092
5178
|
* @returns ConnectionData object
|
|
5093
5179
|
*/
|
|
5094
|
-
static NoAuth() {
|
|
5180
|
+
static NoAuth(params) {
|
|
5095
5181
|
return {
|
|
5096
5182
|
authScheme: AuthSchemeTypes.NO_AUTH,
|
|
5097
5183
|
val: {
|
|
5098
|
-
status: ConnectionStatuses.ACTIVE
|
|
5184
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5185
|
+
...params
|
|
5099
5186
|
}
|
|
5100
5187
|
};
|
|
5101
5188
|
}
|
|
@@ -5109,8 +5196,7 @@ var AuthScheme = class {
|
|
|
5109
5196
|
authScheme: AuthSchemeTypes.BASIC_WITH_JWT,
|
|
5110
5197
|
val: {
|
|
5111
5198
|
status: ConnectionStatuses.ACTIVE,
|
|
5112
|
-
|
|
5113
|
-
password: params.password
|
|
5199
|
+
...params
|
|
5114
5200
|
}
|
|
5115
5201
|
};
|
|
5116
5202
|
}
|
|
@@ -5118,11 +5204,12 @@ var AuthScheme = class {
|
|
|
5118
5204
|
* Creates a ConnectionData object for Cal.com authentication
|
|
5119
5205
|
* @returns ConnectionData object
|
|
5120
5206
|
*/
|
|
5121
|
-
static CalcomAuth() {
|
|
5207
|
+
static CalcomAuth(params) {
|
|
5122
5208
|
return {
|
|
5123
5209
|
authScheme: AuthSchemeTypes.CALCOM_AUTH,
|
|
5124
5210
|
val: {
|
|
5125
|
-
status: ConnectionStatuses.ACTIVE
|
|
5211
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5212
|
+
...params
|
|
5126
5213
|
}
|
|
5127
5214
|
};
|
|
5128
5215
|
}
|
|
@@ -5130,11 +5217,12 @@ var AuthScheme = class {
|
|
|
5130
5217
|
* Creates a ConnectionData object for Snowflake authentication
|
|
5131
5218
|
* @returns ConnectionData object
|
|
5132
5219
|
*/
|
|
5133
|
-
static Snowflake() {
|
|
5220
|
+
static Snowflake(params) {
|
|
5134
5221
|
return {
|
|
5135
5222
|
authScheme: AuthSchemeTypes.SNOWFLAKE,
|
|
5136
5223
|
val: {
|
|
5137
|
-
status: ConnectionStatuses.ACTIVE
|
|
5224
|
+
status: ConnectionStatuses.ACTIVE,
|
|
5225
|
+
...params
|
|
5138
5226
|
}
|
|
5139
5227
|
};
|
|
5140
5228
|
}
|
|
@@ -5148,8 +5236,7 @@ var AuthScheme = class {
|
|
|
5148
5236
|
authScheme: AuthSchemeTypes.BILLCOM_AUTH,
|
|
5149
5237
|
val: {
|
|
5150
5238
|
status: ConnectionStatuses.ACTIVE,
|
|
5151
|
-
|
|
5152
|
-
devKey: params.devKey
|
|
5239
|
+
...params
|
|
5153
5240
|
}
|
|
5154
5241
|
};
|
|
5155
5242
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@composio/json-schema-to-zod": "0.1.9"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@composio/client": "0.1.0-alpha.
|
|
33
|
+
"@composio/client": "0.1.0-alpha.23",
|
|
34
34
|
"@composio/json-schema-to-zod": "0.1.9",
|
|
35
35
|
"chalk": "^5.4.1",
|
|
36
36
|
"openai": "^4.94.0",
|