@composio/core 0.1.14 → 0.1.16
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 +632 -493
- package/dist/index.d.cts +9923 -148
- package/dist/index.d.ts +9923 -148
- package/dist/index.js +298 -222
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -30,12 +30,22 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
+
AUTH_MODES_ENUM: () => AUTH_MODES_ENUM,
|
|
33
34
|
AuthConfigErrorCodes: () => AuthConfigErrorCodes,
|
|
35
|
+
AuthConfigListParamsSchema: () => AuthConfigListParamsSchema,
|
|
36
|
+
AuthConfigListResponseSchema: () => AuthConfigListResponseSchema,
|
|
37
|
+
AuthConfigRetrieveResponseSchema: () => AuthConfigRetrieveResponseSchema,
|
|
34
38
|
AuthConfigTypes: () => AuthConfigTypes,
|
|
39
|
+
AuthConfigUpdateParamsSchema: () => AuthConfigUpdateParamsSchema,
|
|
40
|
+
AuthCustomConfigUpdateParamsSchema: () => AuthCustomConfigUpdateParamsSchema,
|
|
41
|
+
AuthDefaultConfigUpdateParamsSchema: () => AuthDefaultConfigUpdateParamsSchema,
|
|
42
|
+
AuthSchemeEnum: () => AuthSchemeEnum,
|
|
35
43
|
AuthSchemeTypes: () => AuthSchemeTypes,
|
|
36
44
|
BaseAgenticProvider: () => BaseAgenticProvider,
|
|
37
45
|
BaseNonAgenticProvider: () => BaseNonAgenticProvider,
|
|
38
46
|
BaseTelemetryTransport: () => BaseTelemetryTransport,
|
|
47
|
+
BasicWithJwtConnectionDataSchema: () => BasicWithJwtConnectionDataSchema,
|
|
48
|
+
BillcomAuthConnectionDataSchema: () => BillcomAuthConnectionDataSchema,
|
|
39
49
|
Composio: () => Composio,
|
|
40
50
|
ComposioAuthConfigNotFoundError: () => ComposioAuthConfigNotFoundError,
|
|
41
51
|
ComposioConnectedAccountNotFoundError: () => ComposioConnectedAccountNotFoundError,
|
|
@@ -44,6 +54,7 @@ __export(index_exports, {
|
|
|
44
54
|
ComposioGlobalExecuteToolFnNotSetError: () => ComposioGlobalExecuteToolFnNotSetError,
|
|
45
55
|
ComposioInvalidExecuteFunctionError: () => ComposioInvalidExecuteFunctionError,
|
|
46
56
|
ComposioInvalidModifierError: () => ComposioInvalidModifierError,
|
|
57
|
+
ComposioLinkConnectionDataSchema: () => ComposioLinkConnectionDataSchema,
|
|
47
58
|
ComposioNoAPIKeyError: () => ComposioNoAPIKeyError,
|
|
48
59
|
ComposioProvider: () => ComposioProvider,
|
|
49
60
|
ComposioProviderNotDefinedError: () => ComposioProviderNotDefinedError,
|
|
@@ -52,16 +63,68 @@ __export(index_exports, {
|
|
|
52
63
|
ComposioToolkitFetchError: () => ComposioToolkitFetchError,
|
|
53
64
|
ComposioToolkitNotFoundError: () => ComposioToolkitNotFoundError,
|
|
54
65
|
ConnectedAccountErrorCodes: () => ConnectedAccountErrorCodes,
|
|
66
|
+
ConnectionDataSchema: () => ConnectionDataSchema,
|
|
55
67
|
ConnectionRequestErrorCodes: () => ConnectionRequestErrorCodes,
|
|
56
68
|
ConnectionRequestFailedError: () => ConnectionRequestFailedError,
|
|
57
69
|
ConnectionRequestTimeoutError: () => ConnectionRequestTimeoutError,
|
|
70
|
+
ConnectionStatusEnum: () => ConnectionStatusEnum,
|
|
58
71
|
ConsoleTelemetryTransport: () => ConsoleTelemetryTransport,
|
|
72
|
+
CreateAuthConfigParamsSchema: () => CreateAuthConfigParamsSchema,
|
|
73
|
+
CreateAuthConfigResponseSchema: () => CreateAuthConfigResponseSchema,
|
|
74
|
+
CreateComposioManagedAuthConfigParamsSchema: () => CreateComposioManagedAuthConfigParamsSchema,
|
|
75
|
+
CreateCustomAuthConfigParamsSchema: () => CreateCustomAuthConfigParamsSchema,
|
|
76
|
+
CustomAuthParamsSchema: () => CustomAuthParamsSchema,
|
|
77
|
+
IncomingTriggerPayloadSchema: () => IncomingTriggerPayloadSchema,
|
|
59
78
|
JsonSchemaToZodError: () => JsonSchemaToZodError,
|
|
79
|
+
Oauth1ActiveConnectionDataSchema: () => Oauth1ActiveConnectionDataSchema,
|
|
80
|
+
Oauth1ConnectionDataSchema: () => Oauth1ConnectionDataSchema,
|
|
81
|
+
Oauth1ExpiredConnectionDataSchema: () => Oauth1ExpiredConnectionDataSchema,
|
|
82
|
+
Oauth1FailedConnectionDataSchema: () => Oauth1FailedConnectionDataSchema,
|
|
83
|
+
Oauth1InitiatedConnectionDataSchema: () => Oauth1InitiatedConnectionDataSchema,
|
|
84
|
+
Oauth1InitiatingConnectionDataSchema: () => Oauth1InitiatingConnectionDataSchema,
|
|
85
|
+
Oauth2ActiveConnectionDataSchema: () => Oauth2ActiveConnectionDataSchema,
|
|
86
|
+
Oauth2ConnectionDataSchema: () => Oauth2ConnectionDataSchema,
|
|
87
|
+
Oauth2ExpiredConnectionDataSchema: () => Oauth2ExpiredConnectionDataSchema,
|
|
88
|
+
Oauth2FailedConnectionDataSchema: () => Oauth2FailedConnectionDataSchema,
|
|
89
|
+
Oauth2InitiatedConnectionDataSchema: () => Oauth2InitiatedConnectionDataSchema,
|
|
90
|
+
Oauth2InitiatingConnectionDataSchema: () => Oauth2InitiatingConnectionDataSchema,
|
|
60
91
|
OpenAIProvider: () => OpenAIProvider,
|
|
92
|
+
RedirectableAuthSchemeSchema: () => RedirectableAuthSchemeSchema,
|
|
61
93
|
SDKErrorCodes: () => SDKErrorCodes,
|
|
62
94
|
ToolErrorCodes: () => ToolErrorCodes,
|
|
95
|
+
ToolExecuteParamsSchema: () => ToolExecuteParamsSchema,
|
|
96
|
+
ToolExecuteResponseSchema: () => ToolExecuteResponseSchema,
|
|
97
|
+
ToolKitItemSchema: () => ToolKitItemSchema,
|
|
98
|
+
ToolKitListResponseSchema: () => ToolKitListResponseSchema,
|
|
99
|
+
ToolKitMetaSchema: () => ToolKitMetaSchema,
|
|
100
|
+
ToolListFilterBySearchSchema: () => ToolListFilterBySearchSchema,
|
|
101
|
+
ToolListFilterByToolkitsSchema: () => ToolListFilterByToolkitsSchema,
|
|
102
|
+
ToolListFilterByToolsSchema: () => ToolListFilterByToolsSchema,
|
|
63
103
|
ToolListParamsSchema: () => ToolListParamsSchema,
|
|
104
|
+
ToolListResponseSchema: () => ToolListResponseSchema,
|
|
105
|
+
ToolProxyParamsSchema: () => ToolProxyParamsSchema,
|
|
106
|
+
ToolSchema: () => ToolSchema,
|
|
107
|
+
ToolkitAuthConfigDetailsSchema: () => ToolkitAuthConfigDetailsSchema,
|
|
108
|
+
ToolkitAuthFieldSchema: () => ToolkitAuthFieldSchema,
|
|
109
|
+
ToolkitCategorySchema: () => ToolkitCategorySchema,
|
|
64
110
|
ToolkitErrorCodes: () => ToolkitErrorCodes,
|
|
111
|
+
ToolkitMangedByEnumSchema: () => ToolkitMangedByEnumSchema,
|
|
112
|
+
ToolkitRetrieveCategoriesResponseSchema: () => ToolkitRetrieveCategoriesResponseSchema,
|
|
113
|
+
ToolkitRetrieveResponseSchema: () => ToolkitRetrieveResponseSchema,
|
|
114
|
+
ToolkitSchema: () => ToolkitSchema,
|
|
115
|
+
ToolkitSortByEnumSchema: () => ToolkitSortByEnumSchema,
|
|
116
|
+
ToolkitsListParamsSchema: () => ToolkitsListParamsSchema,
|
|
117
|
+
TriggerInstanceListActiveParamsSchema: () => TriggerInstanceListActiveParamsSchema,
|
|
118
|
+
TriggerInstanceListActiveResponseItemSchema: () => TriggerInstanceListActiveResponseItemSchema,
|
|
119
|
+
TriggerInstanceListActiveResponseSchema: () => TriggerInstanceListActiveResponseSchema,
|
|
120
|
+
TriggerInstanceManageDeleteResponseSchema: () => TriggerInstanceManageDeleteResponseSchema,
|
|
121
|
+
TriggerInstanceManageUpdateParamsSchema: () => TriggerInstanceManageUpdateParamsSchema,
|
|
122
|
+
TriggerInstanceManageUpdateResponseSchema: () => TriggerInstanceManageUpdateResponseSchema,
|
|
123
|
+
TriggerInstanceUpsertParamsSchema: () => TriggerInstanceUpsertParamsSchema,
|
|
124
|
+
TriggerInstanceUpsertResponseSchema: () => TriggerInstanceUpsertResponseSchema,
|
|
125
|
+
TriggerStatusEnum: () => TriggerStatusEnum,
|
|
126
|
+
TriggerStatuses: () => TriggerStatuses,
|
|
127
|
+
TriggerSubscribeParamSchema: () => TriggerSubscribeParamSchema,
|
|
65
128
|
ValidationError: () => ValidationError,
|
|
66
129
|
ValidationErrorCodes: () => ValidationErrorCodes,
|
|
67
130
|
jsonSchemaToZodSchema: () => jsonSchemaToZodSchema,
|
|
@@ -128,13 +191,19 @@ var ToolListFilterByToolkitsSchema = import_zod.z.object({
|
|
|
128
191
|
important: import_zod.z.boolean().optional(),
|
|
129
192
|
cursor: import_zod.z.string().optional(),
|
|
130
193
|
limit: import_zod.z.number().optional(),
|
|
131
|
-
search: import_zod.z.string().optional()
|
|
194
|
+
search: import_zod.z.string().optional(),
|
|
195
|
+
strict: import_zod.z.boolean().optional().describe(
|
|
196
|
+
"If true, all the non-required fields will be removed from the input/output params of the tool"
|
|
197
|
+
)
|
|
132
198
|
});
|
|
133
199
|
var ToolListFilterBySearchSchema = import_zod.z.object({
|
|
134
200
|
search: import_zod.z.string(),
|
|
135
201
|
toolkits: import_zod.z.array(import_zod.z.string()).optional(),
|
|
136
202
|
cursor: import_zod.z.string().optional(),
|
|
137
|
-
limit: import_zod.z.number().optional()
|
|
203
|
+
limit: import_zod.z.number().optional(),
|
|
204
|
+
strict: import_zod.z.boolean().optional().describe(
|
|
205
|
+
"If true, all the non-required fields will be removed from the input/output params of the tool"
|
|
206
|
+
)
|
|
138
207
|
});
|
|
139
208
|
var ToolListParamsSchema = import_zod.z.union([
|
|
140
209
|
ToolListFilterByToolsSchema,
|
|
@@ -936,11 +1005,171 @@ var TelemetryService = class {
|
|
|
936
1005
|
};
|
|
937
1006
|
var telemetry = new TelemetryService();
|
|
938
1007
|
|
|
1008
|
+
// src/errors/AuthConfigErrors.ts
|
|
1009
|
+
var AuthConfigErrorCodes = {
|
|
1010
|
+
AUTH_CONFIG_NOT_FOUND: "AUTH_CONFIG_NOT_FOUND"
|
|
1011
|
+
};
|
|
1012
|
+
var ComposioAuthConfigNotFoundError = class extends ComposioError {
|
|
1013
|
+
constructor(message = "Auth config not found", options = {}) {
|
|
1014
|
+
super(message, {
|
|
1015
|
+
...options,
|
|
1016
|
+
code: AuthConfigErrorCodes.AUTH_CONFIG_NOT_FOUND,
|
|
1017
|
+
possibleFixes: options.possibleFixes || [
|
|
1018
|
+
"Check if the auth config exists",
|
|
1019
|
+
"Check if the auth config id is correct",
|
|
1020
|
+
"Check if the auth config is enabled"
|
|
1021
|
+
]
|
|
1022
|
+
});
|
|
1023
|
+
this.name = "ComposioAuthConfigNotFoundError";
|
|
1024
|
+
}
|
|
1025
|
+
};
|
|
1026
|
+
|
|
1027
|
+
// src/errors/ConnectionRequestErrors.ts
|
|
1028
|
+
var ConnectionRequestErrorCodes = {
|
|
1029
|
+
CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT",
|
|
1030
|
+
CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED"
|
|
1031
|
+
};
|
|
1032
|
+
var ConnectionRequestTimeoutError = class extends ComposioError {
|
|
1033
|
+
constructor(message = "Connection request timed out", options = {}) {
|
|
1034
|
+
super(message, {
|
|
1035
|
+
...options,
|
|
1036
|
+
code: ConnectionRequestErrorCodes.CONNECTION_REQUEST_TIMEOUT
|
|
1037
|
+
});
|
|
1038
|
+
this.name = "ConnectionRequestTimeoutError";
|
|
1039
|
+
}
|
|
1040
|
+
};
|
|
1041
|
+
var ConnectionRequestFailedError = class extends ComposioError {
|
|
1042
|
+
constructor(message = "Connection request failed", options = {}) {
|
|
1043
|
+
super(message, {
|
|
1044
|
+
...options,
|
|
1045
|
+
code: ConnectionRequestErrorCodes.CONNECTION_REQUEST_FAILED
|
|
1046
|
+
});
|
|
1047
|
+
this.name = "ConnectionRequestFailedError";
|
|
1048
|
+
}
|
|
1049
|
+
};
|
|
1050
|
+
|
|
1051
|
+
// src/errors/ToolkitErrors.ts
|
|
1052
|
+
var ToolkitErrorCodes = {
|
|
1053
|
+
TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND"
|
|
1054
|
+
};
|
|
1055
|
+
var ComposioToolkitNotFoundError = class extends ComposioError {
|
|
1056
|
+
constructor(message = "Toolkit not found", options = {}) {
|
|
1057
|
+
super(message, {
|
|
1058
|
+
...options,
|
|
1059
|
+
code: "TOOLKIT_NOT_FOUND",
|
|
1060
|
+
possibleFixes: options.possibleFixes || [
|
|
1061
|
+
"Ensure the toolkit is correctly configured and the slug is valid"
|
|
1062
|
+
]
|
|
1063
|
+
});
|
|
1064
|
+
this.name = "ComposioToolkitNotFoundError";
|
|
1065
|
+
}
|
|
1066
|
+
};
|
|
1067
|
+
var ComposioToolkitFetchError = class extends ComposioError {
|
|
1068
|
+
constructor(message = "Failed to fetch toolkit", options = {}) {
|
|
1069
|
+
super(message, {
|
|
1070
|
+
...options,
|
|
1071
|
+
code: "TOOLKIT_FETCH_ERROR",
|
|
1072
|
+
possibleFixes: options.possibleFixes || [
|
|
1073
|
+
"Ensure the toolkit slug is valid",
|
|
1074
|
+
"Ensure you are using the correct API key",
|
|
1075
|
+
"Ensure you are using the correct API endpoint / Base URL and it is working"
|
|
1076
|
+
]
|
|
1077
|
+
});
|
|
1078
|
+
this.name = "ComposioToolkitFetchError";
|
|
1079
|
+
}
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
// src/errors/ValidationErrors.ts
|
|
1083
|
+
var import_zod3 = require("zod");
|
|
1084
|
+
var ValidationErrorCodes = {
|
|
1085
|
+
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
1086
|
+
JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR"
|
|
1087
|
+
};
|
|
1088
|
+
var ValidationError = class extends ComposioError {
|
|
1089
|
+
constructor(message = "Input validation failed", options = {}) {
|
|
1090
|
+
const { cause: providedZodError, ...restOptions } = options;
|
|
1091
|
+
let zodErrorInstance;
|
|
1092
|
+
if (providedZodError instanceof import_zod3.ZodError) {
|
|
1093
|
+
zodErrorInstance = providedZodError;
|
|
1094
|
+
} else {
|
|
1095
|
+
zodErrorInstance = new import_zod3.ZodError([
|
|
1096
|
+
{
|
|
1097
|
+
path: [],
|
|
1098
|
+
message: "Invalid input",
|
|
1099
|
+
code: "custom"
|
|
1100
|
+
}
|
|
1101
|
+
]);
|
|
1102
|
+
}
|
|
1103
|
+
const issues = zodErrorInstance.issues.map(
|
|
1104
|
+
(issue) => `[${issue.code}] ${issue.path.join(".")} - ${issue.message}`
|
|
1105
|
+
);
|
|
1106
|
+
super(message, {
|
|
1107
|
+
...restOptions,
|
|
1108
|
+
code: options.code || ValidationErrorCodes.VALIDATION_ERROR,
|
|
1109
|
+
possibleFixes: issues,
|
|
1110
|
+
cause: zodErrorInstance
|
|
1111
|
+
});
|
|
1112
|
+
this.name = "ValidationError";
|
|
1113
|
+
const userFriendlyMessage = this.generateUserFriendlyMessage();
|
|
1114
|
+
this.message = `${message}: ${userFriendlyMessage}`;
|
|
1115
|
+
}
|
|
1116
|
+
generateUserFriendlyMessage() {
|
|
1117
|
+
if (this.cause instanceof import_zod3.ZodError && this.cause.issues.length > 0) {
|
|
1118
|
+
const issue = this.cause.issues[0];
|
|
1119
|
+
const path = issue.path.join(".");
|
|
1120
|
+
const param = path || "parameter";
|
|
1121
|
+
if (issue.code === "invalid_type") {
|
|
1122
|
+
return `The ${param} should be a ${issue.expected}, but you provided a ${issue.received}`;
|
|
1123
|
+
}
|
|
1124
|
+
return issue.message;
|
|
1125
|
+
}
|
|
1126
|
+
return "Please check your input parameters";
|
|
1127
|
+
}
|
|
1128
|
+
};
|
|
1129
|
+
var JsonSchemaToZodError = class extends ComposioError {
|
|
1130
|
+
constructor(message = "Failed to convert JSON schema to Zod schema", options = {}) {
|
|
1131
|
+
super(message, {
|
|
1132
|
+
...options,
|
|
1133
|
+
code: options.code || ValidationErrorCodes.JSON_SCHEMA_TO_ZOD_ERROR
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1136
|
+
};
|
|
1137
|
+
|
|
1138
|
+
// src/errors/SDKErrors.ts
|
|
1139
|
+
var SDKErrorCodes = {
|
|
1140
|
+
NO_API_KEY_PROVIDED: "NO_API_KEY_PROVIDED"
|
|
1141
|
+
};
|
|
1142
|
+
var ComposioNoAPIKeyError = class extends ComposioError {
|
|
1143
|
+
constructor(message = "No Composio API key provided", options = {}) {
|
|
1144
|
+
const defaultCause = "Couldn't find an API key in the params, environment variables or in the user config file";
|
|
1145
|
+
super(message, {
|
|
1146
|
+
...options,
|
|
1147
|
+
code: "NO_API_KEY",
|
|
1148
|
+
cause: options.cause || defaultCause,
|
|
1149
|
+
possibleFixes: options.possibleFixes || [
|
|
1150
|
+
"Ensure you have an API key passed in the params, or in environment variable (COMPOSIO_API_KEY) or in the user config file",
|
|
1151
|
+
"To get an API key, please sign up at https://composio.dev/signup",
|
|
1152
|
+
"You can also use the Composio CLI to create a project and get an API key"
|
|
1153
|
+
],
|
|
1154
|
+
statusCode: 401
|
|
1155
|
+
});
|
|
1156
|
+
this.name = "ComposioNoAPIKeyError";
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
|
|
939
1160
|
// src/types/connectedAccounts.types.ts
|
|
940
|
-
var
|
|
1161
|
+
var import_zod5 = require("zod");
|
|
941
1162
|
|
|
942
1163
|
// src/types/connectedAccountAuthStates.types.ts
|
|
943
|
-
var
|
|
1164
|
+
var import_zod4 = require("zod");
|
|
1165
|
+
var ConnectionStatusEnum = /* @__PURE__ */ ((ConnectionStatusEnum2) => {
|
|
1166
|
+
ConnectionStatusEnum2["INITIALIZING"] = "INITIALIZING";
|
|
1167
|
+
ConnectionStatusEnum2["INITIATED"] = "INITIATED";
|
|
1168
|
+
ConnectionStatusEnum2["ACTIVE"] = "ACTIVE";
|
|
1169
|
+
ConnectionStatusEnum2["FAILED"] = "FAILED";
|
|
1170
|
+
ConnectionStatusEnum2["EXPIRED"] = "EXPIRED";
|
|
1171
|
+
return ConnectionStatusEnum2;
|
|
1172
|
+
})(ConnectionStatusEnum || {});
|
|
944
1173
|
var AUTH_MODES_ENUM = {
|
|
945
1174
|
OAUTH2: "OAUTH2",
|
|
946
1175
|
OAUTH1: "OAUTH1",
|
|
@@ -955,92 +1184,92 @@ var AUTH_MODES_ENUM = {
|
|
|
955
1184
|
CALCOM_AUTH: "CALCOM_AUTH",
|
|
956
1185
|
SNOWFLAKE: "SNOWFLAKE"
|
|
957
1186
|
};
|
|
958
|
-
var RedirectableAuthSchemeSchema =
|
|
1187
|
+
var RedirectableAuthSchemeSchema = import_zod4.z.enum([
|
|
959
1188
|
AUTH_MODES_ENUM.OAUTH1,
|
|
960
1189
|
AUTH_MODES_ENUM.OAUTH2,
|
|
961
1190
|
AUTH_MODES_ENUM.COMPOSIO_LINK_AUTH
|
|
962
1191
|
]);
|
|
963
|
-
var BaseSchemeRaw =
|
|
1192
|
+
var BaseSchemeRaw = import_zod4.z.object({
|
|
964
1193
|
// for posthog, freshdesk, zendesk, clickup and others
|
|
965
|
-
subdomain:
|
|
1194
|
+
subdomain: import_zod4.z.string().optional(),
|
|
966
1195
|
// for atlassian
|
|
967
|
-
["your-domain"]:
|
|
1196
|
+
["your-domain"]: import_zod4.z.string().optional(),
|
|
968
1197
|
// for mixpanel
|
|
969
|
-
region:
|
|
1198
|
+
region: import_zod4.z.string().optional(),
|
|
970
1199
|
// for shopify
|
|
971
|
-
shop:
|
|
1200
|
+
shop: import_zod4.z.string().optional(),
|
|
972
1201
|
// for snowflake
|
|
973
|
-
account_url:
|
|
1202
|
+
account_url: import_zod4.z.string().optional(),
|
|
974
1203
|
// likely pipedrive
|
|
975
|
-
COMPANYDOMAIN:
|
|
1204
|
+
COMPANYDOMAIN: import_zod4.z.string().optional(),
|
|
976
1205
|
// likely zoho
|
|
977
|
-
extension:
|
|
1206
|
+
extension: import_zod4.z.string().optional(),
|
|
978
1207
|
// likely formsite
|
|
979
|
-
form_api_base_url:
|
|
1208
|
+
form_api_base_url: import_zod4.z.string().optional(),
|
|
980
1209
|
// likely salesforce
|
|
981
|
-
instanceEndpoint:
|
|
1210
|
+
instanceEndpoint: import_zod4.z.string().optional(),
|
|
982
1211
|
// likely active campaign
|
|
983
|
-
api_url:
|
|
1212
|
+
api_url: import_zod4.z.string().optional(),
|
|
984
1213
|
// for borneo
|
|
985
|
-
borneo_dashboard_url:
|
|
1214
|
+
borneo_dashboard_url: import_zod4.z.string().optional(),
|
|
986
1215
|
// for zenrows proxy
|
|
987
|
-
proxy_username:
|
|
988
|
-
proxy_password:
|
|
1216
|
+
proxy_username: import_zod4.z.string().optional(),
|
|
1217
|
+
proxy_password: import_zod4.z.string().optional(),
|
|
989
1218
|
// for d2l
|
|
990
|
-
domain:
|
|
991
|
-
version:
|
|
1219
|
+
domain: import_zod4.z.string().optional(),
|
|
1220
|
+
version: import_zod4.z.string().optional(),
|
|
992
1221
|
// for mailchimp
|
|
993
|
-
dc:
|
|
1222
|
+
dc: import_zod4.z.string().optional(),
|
|
994
1223
|
// for sharepoint
|
|
995
|
-
site_name:
|
|
1224
|
+
site_name: import_zod4.z.string().optional(),
|
|
996
1225
|
// for servicenow
|
|
997
|
-
instanceName:
|
|
1226
|
+
instanceName: import_zod4.z.string().optional(),
|
|
998
1227
|
// for netsuite
|
|
999
|
-
account_id:
|
|
1228
|
+
account_id: import_zod4.z.string().optional(),
|
|
1000
1229
|
// for custom servers
|
|
1001
|
-
your_server:
|
|
1230
|
+
your_server: import_zod4.z.string().optional(),
|
|
1002
1231
|
// for ragic
|
|
1003
|
-
server_location:
|
|
1232
|
+
server_location: import_zod4.z.string().optional(),
|
|
1004
1233
|
// base_url only
|
|
1005
|
-
base_url:
|
|
1234
|
+
base_url: import_zod4.z.string().optional()
|
|
1006
1235
|
});
|
|
1007
1236
|
var Oauth2InitiatingConnectionDataSchema = BaseSchemeRaw.extend({
|
|
1008
|
-
status:
|
|
1009
|
-
}).catchall(
|
|
1237
|
+
status: import_zod4.z.literal("INITIALIZING" /* INITIALIZING */)
|
|
1238
|
+
}).catchall(import_zod4.z.unknown());
|
|
1010
1239
|
var Oauth2InitiatedConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
1011
|
-
status:
|
|
1012
|
-
code_verifier:
|
|
1013
|
-
redirectUrl:
|
|
1014
|
-
callback_url:
|
|
1015
|
-
finalRedirectUri:
|
|
1240
|
+
status: import_zod4.z.literal("INITIATED" /* INITIATED */),
|
|
1241
|
+
code_verifier: import_zod4.z.string().optional(),
|
|
1242
|
+
redirectUrl: import_zod4.z.string(),
|
|
1243
|
+
callback_url: import_zod4.z.string().optional(),
|
|
1244
|
+
finalRedirectUri: import_zod4.z.string().optional(),
|
|
1016
1245
|
// previously verification_token, will be sent as verification_token to slack
|
|
1017
|
-
webhook_signature:
|
|
1018
|
-
}).catchall(
|
|
1246
|
+
webhook_signature: import_zod4.z.string().optional()
|
|
1247
|
+
}).catchall(import_zod4.z.unknown());
|
|
1019
1248
|
var Oauth2ActiveConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
1020
|
-
status:
|
|
1021
|
-
access_token:
|
|
1022
|
-
id_token:
|
|
1023
|
-
token_type:
|
|
1024
|
-
refresh_token:
|
|
1025
|
-
expires_in:
|
|
1026
|
-
scope:
|
|
1249
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1250
|
+
access_token: import_zod4.z.string(),
|
|
1251
|
+
id_token: import_zod4.z.string().optional(),
|
|
1252
|
+
token_type: import_zod4.z.string(),
|
|
1253
|
+
refresh_token: import_zod4.z.string().optional(),
|
|
1254
|
+
expires_in: import_zod4.z.number().optional(),
|
|
1255
|
+
scope: import_zod4.z.string().optional(),
|
|
1027
1256
|
// previously verification_token, will be sent as verification_token to slack
|
|
1028
|
-
webhook_signature:
|
|
1029
|
-
authed_user:
|
|
1030
|
-
access_token:
|
|
1031
|
-
scope:
|
|
1257
|
+
webhook_signature: import_zod4.z.string().optional(),
|
|
1258
|
+
authed_user: import_zod4.z.object({
|
|
1259
|
+
access_token: import_zod4.z.string().optional(),
|
|
1260
|
+
scope: import_zod4.z.string().optional()
|
|
1032
1261
|
}).optional().describe("for slack user scopes")
|
|
1033
|
-
}).catchall(
|
|
1262
|
+
}).catchall(import_zod4.z.unknown());
|
|
1034
1263
|
var Oauth2FailedConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
1035
|
-
status:
|
|
1036
|
-
error:
|
|
1037
|
-
error_description:
|
|
1038
|
-
}).catchall(
|
|
1264
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1265
|
+
error: import_zod4.z.string().optional(),
|
|
1266
|
+
error_description: import_zod4.z.string().optional()
|
|
1267
|
+
}).catchall(import_zod4.z.unknown());
|
|
1039
1268
|
var Oauth2ExpiredConnectionDataSchema = Oauth2InitiatingConnectionDataSchema.extend({
|
|
1040
|
-
status:
|
|
1041
|
-
expired_at:
|
|
1042
|
-
}).catchall(
|
|
1043
|
-
var Oauth2ConnectionDataSchema =
|
|
1269
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1270
|
+
expired_at: import_zod4.z.string().optional()
|
|
1271
|
+
}).catchall(import_zod4.z.unknown());
|
|
1272
|
+
var Oauth2ConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1044
1273
|
Oauth2InitiatingConnectionDataSchema,
|
|
1045
1274
|
Oauth2InitiatedConnectionDataSchema,
|
|
1046
1275
|
Oauth2ActiveConnectionDataSchema,
|
|
@@ -1048,33 +1277,33 @@ var Oauth2ConnectionDataSchema = import_zod3.z.discriminatedUnion("status", [
|
|
|
1048
1277
|
Oauth2ExpiredConnectionDataSchema
|
|
1049
1278
|
]);
|
|
1050
1279
|
var Oauth1InitiatingConnectionDataSchema = BaseSchemeRaw.extend({
|
|
1051
|
-
status:
|
|
1052
|
-
}).catchall(
|
|
1280
|
+
status: import_zod4.z.literal("INITIALIZING" /* INITIALIZING */)
|
|
1281
|
+
}).catchall(import_zod4.z.unknown());
|
|
1053
1282
|
var Oauth1InitiatedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
1054
|
-
status:
|
|
1055
|
-
oauth_token:
|
|
1056
|
-
authUri:
|
|
1057
|
-
oauth_token_secret:
|
|
1058
|
-
redirectUrl:
|
|
1059
|
-
callbackUrl:
|
|
1060
|
-
}).catchall(
|
|
1283
|
+
status: import_zod4.z.literal("INITIATED" /* INITIATED */),
|
|
1284
|
+
oauth_token: import_zod4.z.string(),
|
|
1285
|
+
authUri: import_zod4.z.string(),
|
|
1286
|
+
oauth_token_secret: import_zod4.z.string(),
|
|
1287
|
+
redirectUrl: import_zod4.z.string(),
|
|
1288
|
+
callbackUrl: import_zod4.z.string().optional()
|
|
1289
|
+
}).catchall(import_zod4.z.unknown());
|
|
1061
1290
|
var Oauth1ActiveConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
1062
|
-
status:
|
|
1063
|
-
oauth_token:
|
|
1064
|
-
consumer_key:
|
|
1065
|
-
redirectUrl:
|
|
1066
|
-
callback_url:
|
|
1067
|
-
}).catchall(
|
|
1291
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1292
|
+
oauth_token: import_zod4.z.string(),
|
|
1293
|
+
consumer_key: import_zod4.z.string().optional(),
|
|
1294
|
+
redirectUrl: import_zod4.z.string().optional(),
|
|
1295
|
+
callback_url: import_zod4.z.string().optional()
|
|
1296
|
+
}).catchall(import_zod4.z.unknown());
|
|
1068
1297
|
var Oauth1FailedConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
1069
|
-
status:
|
|
1070
|
-
error:
|
|
1071
|
-
error_description:
|
|
1072
|
-
}).catchall(
|
|
1298
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1299
|
+
error: import_zod4.z.string().optional(),
|
|
1300
|
+
error_description: import_zod4.z.string().optional()
|
|
1301
|
+
}).catchall(import_zod4.z.unknown());
|
|
1073
1302
|
var Oauth1ExpiredConnectionDataSchema = Oauth1InitiatingConnectionDataSchema.extend({
|
|
1074
|
-
status:
|
|
1075
|
-
expired_at:
|
|
1076
|
-
}).catchall(
|
|
1077
|
-
var Oauth1ConnectionDataSchema =
|
|
1303
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1304
|
+
expired_at: import_zod4.z.string().optional()
|
|
1305
|
+
}).catchall(import_zod4.z.unknown());
|
|
1306
|
+
var Oauth1ConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1078
1307
|
Oauth1InitiatingConnectionDataSchema,
|
|
1079
1308
|
Oauth1InitiatedConnectionDataSchema,
|
|
1080
1309
|
Oauth1ActiveConnectionDataSchema,
|
|
@@ -1082,258 +1311,258 @@ var Oauth1ConnectionDataSchema = import_zod3.z.discriminatedUnion("status", [
|
|
|
1082
1311
|
Oauth1ExpiredConnectionDataSchema
|
|
1083
1312
|
]);
|
|
1084
1313
|
var ComposioLinkInitiatingSchema = BaseSchemeRaw.extend({
|
|
1085
|
-
status:
|
|
1086
|
-
}).catchall(
|
|
1087
|
-
var ComposioLinkConnectionDataSchema =
|
|
1314
|
+
status: import_zod4.z.literal("INITIALIZING" /* INITIALIZING */)
|
|
1315
|
+
}).catchall(import_zod4.z.unknown());
|
|
1316
|
+
var ComposioLinkConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1088
1317
|
ComposioLinkInitiatingSchema,
|
|
1089
1318
|
ComposioLinkInitiatingSchema.extend({
|
|
1090
|
-
status:
|
|
1091
|
-
redirectUrl:
|
|
1092
|
-
}).catchall(
|
|
1319
|
+
status: import_zod4.z.literal("INITIATED" /* INITIATED */),
|
|
1320
|
+
redirectUrl: import_zod4.z.string()
|
|
1321
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1093
1322
|
ComposioLinkInitiatingSchema.extend({
|
|
1094
|
-
status:
|
|
1095
|
-
}).catchall(
|
|
1323
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */)
|
|
1324
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1096
1325
|
ComposioLinkInitiatingSchema.extend({
|
|
1097
|
-
status:
|
|
1098
|
-
error:
|
|
1099
|
-
error_description:
|
|
1100
|
-
}).catchall(
|
|
1326
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1327
|
+
error: import_zod4.z.string().optional(),
|
|
1328
|
+
error_description: import_zod4.z.string().optional()
|
|
1329
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1101
1330
|
ComposioLinkInitiatingSchema.extend({
|
|
1102
|
-
status:
|
|
1103
|
-
expired_at:
|
|
1104
|
-
}).catchall(
|
|
1331
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1332
|
+
expired_at: import_zod4.z.string().optional()
|
|
1333
|
+
}).catchall(import_zod4.z.unknown())
|
|
1105
1334
|
]);
|
|
1106
1335
|
var BillcomAuthInitiatingSchema = BaseSchemeRaw.extend({
|
|
1107
|
-
status:
|
|
1108
|
-
}).catchall(
|
|
1109
|
-
var BillcomAuthConnectionDataSchema =
|
|
1336
|
+
status: import_zod4.z.literal("INITIALIZING" /* INITIALIZING */)
|
|
1337
|
+
}).catchall(import_zod4.z.unknown());
|
|
1338
|
+
var BillcomAuthConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1110
1339
|
BillcomAuthInitiatingSchema,
|
|
1111
1340
|
BillcomAuthInitiatingSchema.extend({
|
|
1112
|
-
status:
|
|
1113
|
-
redirectUrl:
|
|
1114
|
-
}).catchall(
|
|
1341
|
+
status: import_zod4.z.literal("INITIATED" /* INITIATED */),
|
|
1342
|
+
redirectUrl: import_zod4.z.string()
|
|
1343
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1115
1344
|
BillcomAuthInitiatingSchema.extend({
|
|
1116
|
-
status:
|
|
1117
|
-
sessionId:
|
|
1118
|
-
devKey:
|
|
1119
|
-
}).catchall(
|
|
1345
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1346
|
+
sessionId: import_zod4.z.string(),
|
|
1347
|
+
devKey: import_zod4.z.string()
|
|
1348
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1120
1349
|
BillcomAuthInitiatingSchema.extend({
|
|
1121
|
-
status:
|
|
1122
|
-
error:
|
|
1123
|
-
error_description:
|
|
1124
|
-
}).catchall(
|
|
1350
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1351
|
+
error: import_zod4.z.string().optional(),
|
|
1352
|
+
error_description: import_zod4.z.string().optional()
|
|
1353
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1125
1354
|
BillcomAuthInitiatingSchema.extend({
|
|
1126
|
-
status:
|
|
1127
|
-
expired_at:
|
|
1128
|
-
}).catchall(
|
|
1355
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1356
|
+
expired_at: import_zod4.z.string().optional()
|
|
1357
|
+
}).catchall(import_zod4.z.unknown())
|
|
1129
1358
|
]);
|
|
1130
1359
|
var BasicWithJwtInitiatingSchema = BaseSchemeRaw.extend({
|
|
1131
|
-
status:
|
|
1132
|
-
username:
|
|
1133
|
-
password:
|
|
1134
|
-
}).catchall(
|
|
1135
|
-
var BasicWithJwtConnectionDataSchema =
|
|
1360
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1361
|
+
username: import_zod4.z.string(),
|
|
1362
|
+
password: import_zod4.z.string()
|
|
1363
|
+
}).catchall(import_zod4.z.unknown());
|
|
1364
|
+
var BasicWithJwtConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1136
1365
|
BasicWithJwtInitiatingSchema,
|
|
1137
1366
|
BasicWithJwtInitiatingSchema.extend({
|
|
1138
|
-
status:
|
|
1139
|
-
error:
|
|
1140
|
-
error_description:
|
|
1141
|
-
}).catchall(
|
|
1367
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1368
|
+
error: import_zod4.z.string().optional(),
|
|
1369
|
+
error_description: import_zod4.z.string().optional()
|
|
1370
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1142
1371
|
BasicWithJwtInitiatingSchema.extend({
|
|
1143
|
-
status:
|
|
1144
|
-
expired_at:
|
|
1145
|
-
}).catchall(
|
|
1372
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1373
|
+
expired_at: import_zod4.z.string().optional()
|
|
1374
|
+
}).catchall(import_zod4.z.unknown())
|
|
1146
1375
|
]);
|
|
1147
1376
|
var ApiKeyInitiatingSchema = BaseSchemeRaw.extend({
|
|
1148
|
-
status:
|
|
1149
|
-
api_key:
|
|
1150
|
-
}).catchall(
|
|
1151
|
-
var ApiKeyConnectionDataSchema =
|
|
1377
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1378
|
+
api_key: import_zod4.z.string()
|
|
1379
|
+
}).catchall(import_zod4.z.unknown());
|
|
1380
|
+
var ApiKeyConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1152
1381
|
ApiKeyInitiatingSchema,
|
|
1153
1382
|
ApiKeyInitiatingSchema.extend({
|
|
1154
|
-
status:
|
|
1155
|
-
error:
|
|
1156
|
-
error_description:
|
|
1157
|
-
}).catchall(
|
|
1383
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1384
|
+
error: import_zod4.z.string().optional(),
|
|
1385
|
+
error_description: import_zod4.z.string().optional()
|
|
1386
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1158
1387
|
ApiKeyInitiatingSchema.extend({
|
|
1159
|
-
status:
|
|
1160
|
-
expired_at:
|
|
1161
|
-
}).catchall(
|
|
1388
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1389
|
+
expired_at: import_zod4.z.string().optional()
|
|
1390
|
+
}).catchall(import_zod4.z.unknown())
|
|
1162
1391
|
]);
|
|
1163
1392
|
var BasicInitiatingSchema = BaseSchemeRaw.extend({
|
|
1164
|
-
status:
|
|
1165
|
-
username:
|
|
1166
|
-
password:
|
|
1167
|
-
}).catchall(
|
|
1168
|
-
var BasicConnectionDataSchema =
|
|
1393
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1394
|
+
username: import_zod4.z.string(),
|
|
1395
|
+
password: import_zod4.z.string()
|
|
1396
|
+
}).catchall(import_zod4.z.unknown());
|
|
1397
|
+
var BasicConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1169
1398
|
BasicInitiatingSchema,
|
|
1170
1399
|
BasicInitiatingSchema.extend({
|
|
1171
|
-
status:
|
|
1172
|
-
error:
|
|
1173
|
-
error_description:
|
|
1174
|
-
}).catchall(
|
|
1400
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1401
|
+
error: import_zod4.z.string().optional(),
|
|
1402
|
+
error_description: import_zod4.z.string().optional()
|
|
1403
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1175
1404
|
BasicInitiatingSchema.extend({
|
|
1176
|
-
status:
|
|
1177
|
-
expired_at:
|
|
1178
|
-
}).catchall(
|
|
1405
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1406
|
+
expired_at: import_zod4.z.string().optional()
|
|
1407
|
+
}).catchall(import_zod4.z.unknown())
|
|
1179
1408
|
]);
|
|
1180
1409
|
var BearerTokenInitiatingSchema = BaseSchemeRaw.extend({
|
|
1181
|
-
status:
|
|
1182
|
-
token:
|
|
1183
|
-
}).catchall(
|
|
1184
|
-
var BearerTokenConnectionDataSchema =
|
|
1410
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1411
|
+
token: import_zod4.z.string()
|
|
1412
|
+
}).catchall(import_zod4.z.unknown());
|
|
1413
|
+
var BearerTokenConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1185
1414
|
BearerTokenInitiatingSchema,
|
|
1186
1415
|
BearerTokenInitiatingSchema.extend({
|
|
1187
|
-
status:
|
|
1188
|
-
error:
|
|
1189
|
-
error_description:
|
|
1190
|
-
}).catchall(
|
|
1416
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1417
|
+
error: import_zod4.z.string().optional(),
|
|
1418
|
+
error_description: import_zod4.z.string().optional()
|
|
1419
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1191
1420
|
BearerTokenInitiatingSchema.extend({
|
|
1192
|
-
status:
|
|
1193
|
-
expired_at:
|
|
1194
|
-
}).catchall(
|
|
1421
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1422
|
+
expired_at: import_zod4.z.string().optional()
|
|
1423
|
+
}).catchall(import_zod4.z.unknown())
|
|
1195
1424
|
]);
|
|
1196
1425
|
var GoogleServiceAccountInitiatingSchema = BaseSchemeRaw.extend({
|
|
1197
|
-
status:
|
|
1198
|
-
credentials_json:
|
|
1199
|
-
}).catchall(
|
|
1200
|
-
var GoogleServiceAccountConnectionDataSchema =
|
|
1426
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */),
|
|
1427
|
+
credentials_json: import_zod4.z.string()
|
|
1428
|
+
}).catchall(import_zod4.z.unknown());
|
|
1429
|
+
var GoogleServiceAccountConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1201
1430
|
GoogleServiceAccountInitiatingSchema,
|
|
1202
1431
|
GoogleServiceAccountInitiatingSchema.extend({
|
|
1203
|
-
status:
|
|
1204
|
-
error:
|
|
1205
|
-
error_description:
|
|
1206
|
-
}).catchall(
|
|
1432
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1433
|
+
error: import_zod4.z.string().optional(),
|
|
1434
|
+
error_description: import_zod4.z.string().optional()
|
|
1435
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1207
1436
|
GoogleServiceAccountInitiatingSchema.extend({
|
|
1208
|
-
status:
|
|
1209
|
-
expired_at:
|
|
1210
|
-
}).catchall(
|
|
1437
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1438
|
+
expired_at: import_zod4.z.string().optional()
|
|
1439
|
+
}).catchall(import_zod4.z.unknown())
|
|
1211
1440
|
]);
|
|
1212
1441
|
var NoAuthInitiatingSchema = BaseSchemeRaw.extend({
|
|
1213
|
-
status:
|
|
1214
|
-
}).catchall(
|
|
1215
|
-
var NoAuthConnectionDataSchema =
|
|
1442
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */)
|
|
1443
|
+
}).catchall(import_zod4.z.unknown());
|
|
1444
|
+
var NoAuthConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1216
1445
|
NoAuthInitiatingSchema,
|
|
1217
1446
|
NoAuthInitiatingSchema.extend({
|
|
1218
|
-
status:
|
|
1219
|
-
error:
|
|
1220
|
-
error_description:
|
|
1221
|
-
}).catchall(
|
|
1447
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1448
|
+
error: import_zod4.z.string().optional(),
|
|
1449
|
+
error_description: import_zod4.z.string().optional()
|
|
1450
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1222
1451
|
NoAuthInitiatingSchema.extend({
|
|
1223
|
-
status:
|
|
1224
|
-
expired_at:
|
|
1225
|
-
}).catchall(
|
|
1452
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1453
|
+
expired_at: import_zod4.z.string().optional()
|
|
1454
|
+
}).catchall(import_zod4.z.unknown())
|
|
1226
1455
|
]);
|
|
1227
1456
|
var CalcomAuthInitiatingSchema = BaseSchemeRaw.extend({
|
|
1228
|
-
status:
|
|
1229
|
-
}).catchall(
|
|
1230
|
-
var CalcomAuthConnectionDataSchema =
|
|
1457
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */)
|
|
1458
|
+
}).catchall(import_zod4.z.unknown());
|
|
1459
|
+
var CalcomAuthConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1231
1460
|
CalcomAuthInitiatingSchema,
|
|
1232
1461
|
CalcomAuthInitiatingSchema.extend({
|
|
1233
|
-
status:
|
|
1234
|
-
error:
|
|
1235
|
-
error_description:
|
|
1236
|
-
}).catchall(
|
|
1462
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1463
|
+
error: import_zod4.z.string().optional(),
|
|
1464
|
+
error_description: import_zod4.z.string().optional()
|
|
1465
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1237
1466
|
CalcomAuthInitiatingSchema.extend({
|
|
1238
|
-
status:
|
|
1239
|
-
expired_at:
|
|
1240
|
-
}).catchall(
|
|
1467
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1468
|
+
expired_at: import_zod4.z.string().optional()
|
|
1469
|
+
}).catchall(import_zod4.z.unknown())
|
|
1241
1470
|
]);
|
|
1242
1471
|
var SnowflakeInitiatingSchema = BaseSchemeRaw.extend({
|
|
1243
|
-
status:
|
|
1244
|
-
}).catchall(
|
|
1245
|
-
var SnowflakeConnectionDataSchema =
|
|
1472
|
+
status: import_zod4.z.literal("ACTIVE" /* ACTIVE */)
|
|
1473
|
+
}).catchall(import_zod4.z.unknown());
|
|
1474
|
+
var SnowflakeConnectionDataSchema = import_zod4.z.discriminatedUnion("status", [
|
|
1246
1475
|
SnowflakeInitiatingSchema,
|
|
1247
1476
|
SnowflakeInitiatingSchema.extend({
|
|
1248
|
-
status:
|
|
1249
|
-
error:
|
|
1250
|
-
error_description:
|
|
1251
|
-
}).catchall(
|
|
1477
|
+
status: import_zod4.z.literal("FAILED" /* FAILED */),
|
|
1478
|
+
error: import_zod4.z.string().optional(),
|
|
1479
|
+
error_description: import_zod4.z.string().optional()
|
|
1480
|
+
}).catchall(import_zod4.z.unknown()),
|
|
1252
1481
|
SnowflakeInitiatingSchema.extend({
|
|
1253
|
-
status:
|
|
1254
|
-
expired_at:
|
|
1255
|
-
}).catchall(
|
|
1482
|
+
status: import_zod4.z.literal("EXPIRED" /* EXPIRED */),
|
|
1483
|
+
expired_at: import_zod4.z.string().optional()
|
|
1484
|
+
}).catchall(import_zod4.z.unknown())
|
|
1256
1485
|
]);
|
|
1257
|
-
var ConnectionDataSchema =
|
|
1258
|
-
|
|
1259
|
-
authScheme:
|
|
1486
|
+
var ConnectionDataSchema = import_zod4.z.discriminatedUnion("authScheme", [
|
|
1487
|
+
import_zod4.z.object({
|
|
1488
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.OAUTH1),
|
|
1260
1489
|
/**
|
|
1261
1490
|
* the main connection data discriminated by auth scheme
|
|
1262
1491
|
*/
|
|
1263
1492
|
val: Oauth1ConnectionDataSchema
|
|
1264
1493
|
}),
|
|
1265
|
-
|
|
1266
|
-
authScheme:
|
|
1494
|
+
import_zod4.z.object({
|
|
1495
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.OAUTH2),
|
|
1267
1496
|
/**
|
|
1268
1497
|
* the main connection data discriminated by auth scheme
|
|
1269
1498
|
*/
|
|
1270
1499
|
val: Oauth2ConnectionDataSchema
|
|
1271
1500
|
}),
|
|
1272
|
-
|
|
1273
|
-
authScheme:
|
|
1501
|
+
import_zod4.z.object({
|
|
1502
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.COMPOSIO_LINK_AUTH),
|
|
1274
1503
|
/**
|
|
1275
1504
|
* the main connection data discriminated by auth scheme
|
|
1276
1505
|
*/
|
|
1277
1506
|
val: ComposioLinkConnectionDataSchema
|
|
1278
1507
|
}),
|
|
1279
|
-
|
|
1280
|
-
authScheme:
|
|
1508
|
+
import_zod4.z.object({
|
|
1509
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.API_KEY),
|
|
1281
1510
|
/**
|
|
1282
1511
|
* the main connection data discriminated by auth scheme
|
|
1283
1512
|
*/
|
|
1284
1513
|
val: ApiKeyConnectionDataSchema
|
|
1285
1514
|
}),
|
|
1286
|
-
|
|
1287
|
-
authScheme:
|
|
1515
|
+
import_zod4.z.object({
|
|
1516
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.BASIC),
|
|
1288
1517
|
/**
|
|
1289
1518
|
* the main connection data discriminated by auth scheme
|
|
1290
1519
|
*/
|
|
1291
1520
|
val: BasicConnectionDataSchema
|
|
1292
1521
|
}),
|
|
1293
|
-
|
|
1294
|
-
authScheme:
|
|
1522
|
+
import_zod4.z.object({
|
|
1523
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.BEARER_TOKEN),
|
|
1295
1524
|
/**
|
|
1296
1525
|
* the main connection data discriminated by auth scheme
|
|
1297
1526
|
*/
|
|
1298
1527
|
val: BearerTokenConnectionDataSchema
|
|
1299
1528
|
}),
|
|
1300
|
-
|
|
1301
|
-
authScheme:
|
|
1529
|
+
import_zod4.z.object({
|
|
1530
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.GOOGLE_SERVICE_ACCOUNT),
|
|
1302
1531
|
/**
|
|
1303
1532
|
* the main connection data discriminated by auth scheme
|
|
1304
1533
|
*/
|
|
1305
1534
|
val: GoogleServiceAccountConnectionDataSchema
|
|
1306
1535
|
}),
|
|
1307
|
-
|
|
1308
|
-
authScheme:
|
|
1536
|
+
import_zod4.z.object({
|
|
1537
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.NO_AUTH),
|
|
1309
1538
|
/**
|
|
1310
1539
|
* the main connection data discriminated by auth scheme
|
|
1311
1540
|
*/
|
|
1312
1541
|
val: NoAuthConnectionDataSchema
|
|
1313
1542
|
}),
|
|
1314
|
-
|
|
1315
|
-
authScheme:
|
|
1543
|
+
import_zod4.z.object({
|
|
1544
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.CALCOM_AUTH),
|
|
1316
1545
|
/**
|
|
1317
1546
|
* the main connection data discriminated by auth scheme
|
|
1318
1547
|
*/
|
|
1319
1548
|
val: CalcomAuthConnectionDataSchema
|
|
1320
1549
|
}),
|
|
1321
|
-
|
|
1322
|
-
authScheme:
|
|
1550
|
+
import_zod4.z.object({
|
|
1551
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.SNOWFLAKE),
|
|
1323
1552
|
/**
|
|
1324
1553
|
* the main connection data discriminated by auth scheme
|
|
1325
1554
|
*/
|
|
1326
1555
|
val: SnowflakeConnectionDataSchema
|
|
1327
1556
|
}),
|
|
1328
|
-
|
|
1329
|
-
authScheme:
|
|
1557
|
+
import_zod4.z.object({
|
|
1558
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.BILLCOM_AUTH),
|
|
1330
1559
|
/**
|
|
1331
1560
|
* the main connection data discriminated by auth scheme
|
|
1332
1561
|
*/
|
|
1333
1562
|
val: BillcomAuthConnectionDataSchema
|
|
1334
1563
|
}),
|
|
1335
|
-
|
|
1336
|
-
authScheme:
|
|
1564
|
+
import_zod4.z.object({
|
|
1565
|
+
authScheme: import_zod4.z.literal(AUTH_MODES_ENUM.BASIC_WITH_JWT),
|
|
1337
1566
|
/**
|
|
1338
1567
|
* the main connection data discriminated by auth scheme
|
|
1339
1568
|
*/
|
|
@@ -1349,42 +1578,42 @@ var ConnectedAccountStatuses = {
|
|
|
1349
1578
|
FAILED: "FAILED",
|
|
1350
1579
|
EXPIRED: "EXPIRED"
|
|
1351
1580
|
};
|
|
1352
|
-
var ConnectedAccountStatusSchema =
|
|
1581
|
+
var ConnectedAccountStatusSchema = import_zod5.z.enum([
|
|
1353
1582
|
ConnectedAccountStatuses.INITIALIZING,
|
|
1354
1583
|
ConnectedAccountStatuses.INITIATED,
|
|
1355
1584
|
ConnectedAccountStatuses.ACTIVE,
|
|
1356
1585
|
ConnectedAccountStatuses.FAILED,
|
|
1357
1586
|
ConnectedAccountStatuses.EXPIRED
|
|
1358
1587
|
]);
|
|
1359
|
-
var CreateConnectedAccountParamsSchema =
|
|
1360
|
-
authConfig:
|
|
1361
|
-
id:
|
|
1588
|
+
var CreateConnectedAccountParamsSchema = import_zod5.z.object({
|
|
1589
|
+
authConfig: import_zod5.z.object({
|
|
1590
|
+
id: import_zod5.z.string()
|
|
1362
1591
|
}),
|
|
1363
|
-
connection:
|
|
1364
|
-
data:
|
|
1365
|
-
callbackUrl:
|
|
1366
|
-
userId:
|
|
1592
|
+
connection: import_zod5.z.object({
|
|
1593
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).optional(),
|
|
1594
|
+
callbackUrl: import_zod5.z.string().optional(),
|
|
1595
|
+
userId: import_zod5.z.string().optional()
|
|
1367
1596
|
})
|
|
1368
1597
|
});
|
|
1369
|
-
var DefaultCreateConnectedAccountParamsSchema =
|
|
1370
|
-
auth_config:
|
|
1371
|
-
id:
|
|
1598
|
+
var DefaultCreateConnectedAccountParamsSchema = import_zod5.z.object({
|
|
1599
|
+
auth_config: import_zod5.z.object({
|
|
1600
|
+
id: import_zod5.z.string()
|
|
1372
1601
|
}),
|
|
1373
|
-
connection:
|
|
1602
|
+
connection: import_zod5.z.object({
|
|
1374
1603
|
state: ConnectionDataSchema.optional(),
|
|
1375
|
-
data:
|
|
1376
|
-
callback_url:
|
|
1377
|
-
user_id:
|
|
1604
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).optional(),
|
|
1605
|
+
callback_url: import_zod5.z.string().optional(),
|
|
1606
|
+
user_id: import_zod5.z.string().optional()
|
|
1378
1607
|
})
|
|
1379
1608
|
});
|
|
1380
|
-
var CreateConnectedAccountOptionsSchema =
|
|
1381
|
-
callbackUrl:
|
|
1609
|
+
var CreateConnectedAccountOptionsSchema = import_zod5.z.object({
|
|
1610
|
+
callbackUrl: import_zod5.z.string().optional(),
|
|
1382
1611
|
state: ConnectionDataSchema.optional()
|
|
1383
1612
|
});
|
|
1384
|
-
var CreateConnectedAccountResponseSchema =
|
|
1385
|
-
id:
|
|
1613
|
+
var CreateConnectedAccountResponseSchema = import_zod5.z.object({
|
|
1614
|
+
id: import_zod5.z.string(),
|
|
1386
1615
|
status: ConnectedAccountStatusSchema,
|
|
1387
|
-
redirectUrl:
|
|
1616
|
+
redirectUrl: import_zod5.z.string().nullable()
|
|
1388
1617
|
});
|
|
1389
1618
|
var ConnectedAccountAuthSchemes = {
|
|
1390
1619
|
OAUTH2: "OAUTH2",
|
|
@@ -1401,7 +1630,7 @@ var ConnectedAccountAuthSchemes = {
|
|
|
1401
1630
|
CALCOM_AUTH: "CALCOM_AUTH",
|
|
1402
1631
|
SNOWFLAKE: "SNOWFLAKE"
|
|
1403
1632
|
};
|
|
1404
|
-
var ConnectedAccountAuthSchemesSchema =
|
|
1633
|
+
var ConnectedAccountAuthSchemesSchema = import_zod5.z.enum([
|
|
1405
1634
|
ConnectedAccountAuthSchemes.OAUTH2,
|
|
1406
1635
|
ConnectedAccountAuthSchemes.OAUTH1,
|
|
1407
1636
|
ConnectedAccountAuthSchemes.OAUTH1A,
|
|
@@ -1416,194 +1645,68 @@ var ConnectedAccountAuthSchemesSchema = import_zod4.z.enum([
|
|
|
1416
1645
|
ConnectedAccountAuthSchemes.CALCOM_AUTH,
|
|
1417
1646
|
ConnectedAccountAuthSchemes.SNOWFLAKE
|
|
1418
1647
|
]);
|
|
1419
|
-
var ConnectedAccountAuthConfigSchema =
|
|
1420
|
-
id:
|
|
1421
|
-
isComposioManaged:
|
|
1422
|
-
isDisabled:
|
|
1648
|
+
var ConnectedAccountAuthConfigSchema = import_zod5.z.object({
|
|
1649
|
+
id: import_zod5.z.string(),
|
|
1650
|
+
isComposioManaged: import_zod5.z.boolean(),
|
|
1651
|
+
isDisabled: import_zod5.z.boolean()
|
|
1423
1652
|
});
|
|
1424
|
-
var ConnectedAccountRetrieveResponseSchema =
|
|
1425
|
-
id:
|
|
1653
|
+
var ConnectedAccountRetrieveResponseSchema = import_zod5.z.object({
|
|
1654
|
+
id: import_zod5.z.string(),
|
|
1426
1655
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1427
|
-
data:
|
|
1428
|
-
params:
|
|
1656
|
+
data: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()),
|
|
1657
|
+
params: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.unknown()).optional(),
|
|
1429
1658
|
status: ConnectedAccountStatusSchema,
|
|
1430
|
-
statusReason:
|
|
1431
|
-
toolkit:
|
|
1432
|
-
slug:
|
|
1659
|
+
statusReason: import_zod5.z.string().nullable(),
|
|
1660
|
+
toolkit: import_zod5.z.object({
|
|
1661
|
+
slug: import_zod5.z.string()
|
|
1433
1662
|
}),
|
|
1434
1663
|
state: ConnectionDataSchema.optional(),
|
|
1435
|
-
testRequestEndpoint:
|
|
1436
|
-
isDisabled:
|
|
1437
|
-
createdAt:
|
|
1438
|
-
updatedAt:
|
|
1664
|
+
testRequestEndpoint: import_zod5.z.string().optional(),
|
|
1665
|
+
isDisabled: import_zod5.z.boolean(),
|
|
1666
|
+
createdAt: import_zod5.z.string(),
|
|
1667
|
+
updatedAt: import_zod5.z.string()
|
|
1439
1668
|
});
|
|
1440
|
-
var ConnectedAccountListParamsSchema =
|
|
1441
|
-
authConfigIds:
|
|
1442
|
-
cursor:
|
|
1443
|
-
labels:
|
|
1444
|
-
limit:
|
|
1445
|
-
orderBy:
|
|
1446
|
-
statuses:
|
|
1447
|
-
toolkitSlugs:
|
|
1448
|
-
userIds:
|
|
1669
|
+
var ConnectedAccountListParamsSchema = import_zod5.z.object({
|
|
1670
|
+
authConfigIds: import_zod5.z.array(import_zod5.z.string()).nullable().optional().describe("The auth config ids of the connected accounts"),
|
|
1671
|
+
cursor: import_zod5.z.number().nullable().optional().describe("The cursor to paginate through the connected accounts"),
|
|
1672
|
+
labels: import_zod5.z.array(import_zod5.z.string()).nullable().optional().describe("The labels of the connected accounts"),
|
|
1673
|
+
limit: import_zod5.z.number().nullable().optional().describe("The limit of the connected accounts to return"),
|
|
1674
|
+
orderBy: import_zod5.z.enum(["created_at", "updated_at"]).optional().describe("The order by of the connected accounts"),
|
|
1675
|
+
statuses: import_zod5.z.array(ConnectedAccountStatusSchema).nullable().optional().describe("The statuses of the connected accounts"),
|
|
1676
|
+
toolkitSlugs: import_zod5.z.array(import_zod5.z.string()).nullable().optional().describe("The toolkit slugs of the connected accounts"),
|
|
1677
|
+
userIds: import_zod5.z.array(import_zod5.z.string()).nullable().optional().describe("The user ids of the connected accounts")
|
|
1449
1678
|
});
|
|
1450
|
-
var ConnectedAccountListResponseSchema =
|
|
1451
|
-
items:
|
|
1452
|
-
nextCursor:
|
|
1453
|
-
totalPages:
|
|
1679
|
+
var ConnectedAccountListResponseSchema = import_zod5.z.object({
|
|
1680
|
+
items: import_zod5.z.array(ConnectedAccountRetrieveResponseSchema).describe("The list of connected accounts"),
|
|
1681
|
+
nextCursor: import_zod5.z.string().nullable().describe("The next cursor to paginate through the connected accounts"),
|
|
1682
|
+
totalPages: import_zod5.z.number().describe("The total number of pages of connected accounts")
|
|
1454
1683
|
});
|
|
1455
1684
|
|
|
1456
|
-
// src/
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
};
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
CONNECTION_REQUEST_TIMEOUT: "CONNECTION_REQUEST_TIMEOUT",
|
|
1478
|
-
CONNECTION_REQUEST_FAILED: "CONNECTION_REQUEST_FAILED"
|
|
1479
|
-
};
|
|
1480
|
-
var ConnectionRequestTimeoutError = class extends ComposioError {
|
|
1481
|
-
constructor(message = "Connection request timed out", options = {}) {
|
|
1482
|
-
super(message, {
|
|
1483
|
-
...options,
|
|
1484
|
-
code: ConnectionRequestErrorCodes.CONNECTION_REQUEST_TIMEOUT
|
|
1485
|
-
});
|
|
1486
|
-
this.name = "ConnectionRequestTimeoutError";
|
|
1487
|
-
}
|
|
1488
|
-
};
|
|
1489
|
-
var ConnectionRequestFailedError = class extends ComposioError {
|
|
1490
|
-
constructor(message = "Connection request failed", options = {}) {
|
|
1491
|
-
super(message, {
|
|
1492
|
-
...options,
|
|
1493
|
-
code: ConnectionRequestErrorCodes.CONNECTION_REQUEST_FAILED
|
|
1494
|
-
});
|
|
1495
|
-
this.name = "ConnectionRequestFailedError";
|
|
1496
|
-
}
|
|
1497
|
-
};
|
|
1498
|
-
|
|
1499
|
-
// src/errors/ToolkitErrors.ts
|
|
1500
|
-
var ToolkitErrorCodes = {
|
|
1501
|
-
TOOLKIT_NOT_FOUND: "TOOLKIT_NOT_FOUND"
|
|
1502
|
-
};
|
|
1503
|
-
var ComposioToolkitNotFoundError = class extends ComposioError {
|
|
1504
|
-
constructor(message = "Toolkit not found", options = {}) {
|
|
1505
|
-
super(message, {
|
|
1506
|
-
...options,
|
|
1507
|
-
code: "TOOLKIT_NOT_FOUND",
|
|
1508
|
-
possibleFixes: options.possibleFixes || [
|
|
1509
|
-
"Ensure the toolkit is correctly configured and the slug is valid"
|
|
1510
|
-
]
|
|
1511
|
-
});
|
|
1512
|
-
this.name = "ComposioToolkitNotFoundError";
|
|
1513
|
-
}
|
|
1514
|
-
};
|
|
1515
|
-
var ComposioToolkitFetchError = class extends ComposioError {
|
|
1516
|
-
constructor(message = "Failed to fetch toolkit", options = {}) {
|
|
1517
|
-
super(message, {
|
|
1518
|
-
...options,
|
|
1519
|
-
code: "TOOLKIT_FETCH_ERROR",
|
|
1520
|
-
possibleFixes: options.possibleFixes || [
|
|
1521
|
-
"Ensure the toolkit slug is valid",
|
|
1522
|
-
"Ensure you are using the correct API key",
|
|
1523
|
-
"Ensure you are using the correct API endpoint / Base URL and it is working"
|
|
1524
|
-
]
|
|
1525
|
-
});
|
|
1526
|
-
this.name = "ComposioToolkitFetchError";
|
|
1527
|
-
}
|
|
1528
|
-
};
|
|
1529
|
-
|
|
1530
|
-
// src/errors/ValidationErrors.ts
|
|
1531
|
-
var import_zod5 = require("zod");
|
|
1532
|
-
var ValidationErrorCodes = {
|
|
1533
|
-
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
1534
|
-
JSON_SCHEMA_TO_ZOD_ERROR: "JSON_SCHEMA_TO_ZOD_ERROR"
|
|
1535
|
-
};
|
|
1536
|
-
var ValidationError = class extends ComposioError {
|
|
1537
|
-
constructor(message = "Input validation failed", options = {}) {
|
|
1538
|
-
const { cause: providedZodError, ...restOptions } = options;
|
|
1539
|
-
let zodErrorInstance;
|
|
1540
|
-
if (providedZodError instanceof import_zod5.ZodError) {
|
|
1541
|
-
zodErrorInstance = providedZodError;
|
|
1542
|
-
} else {
|
|
1543
|
-
zodErrorInstance = new import_zod5.ZodError([
|
|
1544
|
-
{
|
|
1545
|
-
path: [],
|
|
1546
|
-
message: "Invalid input",
|
|
1547
|
-
code: "custom"
|
|
1548
|
-
}
|
|
1549
|
-
]);
|
|
1550
|
-
}
|
|
1551
|
-
const issues = zodErrorInstance.issues.map(
|
|
1552
|
-
(issue) => `[${issue.code}] ${issue.path.join(".")} - ${issue.message}`
|
|
1553
|
-
);
|
|
1554
|
-
super(message, {
|
|
1555
|
-
...restOptions,
|
|
1556
|
-
code: options.code || ValidationErrorCodes.VALIDATION_ERROR,
|
|
1557
|
-
possibleFixes: issues,
|
|
1558
|
-
cause: zodErrorInstance
|
|
1559
|
-
});
|
|
1560
|
-
this.name = "ValidationError";
|
|
1561
|
-
const userFriendlyMessage = this.generateUserFriendlyMessage();
|
|
1562
|
-
this.message = `${message}: ${userFriendlyMessage}`;
|
|
1563
|
-
}
|
|
1564
|
-
generateUserFriendlyMessage() {
|
|
1565
|
-
if (this.cause instanceof import_zod5.ZodError && this.cause.issues.length > 0) {
|
|
1566
|
-
const issue = this.cause.issues[0];
|
|
1567
|
-
const path = issue.path.join(".");
|
|
1568
|
-
const param = path || "parameter";
|
|
1569
|
-
if (issue.code === "invalid_type") {
|
|
1570
|
-
return `The ${param} should be a ${issue.expected}, but you provided a ${issue.received}`;
|
|
1571
|
-
}
|
|
1572
|
-
return issue.message;
|
|
1573
|
-
}
|
|
1574
|
-
return "Please check your input parameters";
|
|
1575
|
-
}
|
|
1576
|
-
};
|
|
1577
|
-
var JsonSchemaToZodError = class extends ComposioError {
|
|
1578
|
-
constructor(message = "Failed to convert JSON schema to Zod schema", options = {}) {
|
|
1579
|
-
super(message, {
|
|
1580
|
-
...options,
|
|
1581
|
-
code: options.code || ValidationErrorCodes.JSON_SCHEMA_TO_ZOD_ERROR
|
|
1582
|
-
});
|
|
1583
|
-
}
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
// src/errors/SDKErrors.ts
|
|
1587
|
-
var SDKErrorCodes = {
|
|
1588
|
-
NO_API_KEY_PROVIDED: "NO_API_KEY_PROVIDED"
|
|
1589
|
-
};
|
|
1590
|
-
var ComposioNoAPIKeyError = class extends ComposioError {
|
|
1591
|
-
constructor(message = "No Composio API key provided", options = {}) {
|
|
1592
|
-
const defaultCause = "Couldn't find an API key in the params, environment variables or in the user config file";
|
|
1593
|
-
super(message, {
|
|
1594
|
-
...options,
|
|
1595
|
-
code: "NO_API_KEY",
|
|
1596
|
-
cause: options.cause || defaultCause,
|
|
1597
|
-
possibleFixes: options.possibleFixes || [
|
|
1598
|
-
"Ensure you have an API key passed in the params, or in environment variable (COMPOSIO_API_KEY) or in the user config file",
|
|
1599
|
-
"To get an API key, please sign up at https://composio.dev/signup",
|
|
1600
|
-
"You can also use the Composio CLI to create a project and get an API key"
|
|
1601
|
-
],
|
|
1602
|
-
statusCode: 401
|
|
1685
|
+
// src/utils/transformers/connectedAccounts.ts
|
|
1686
|
+
function transformConnectedAccountResponse(response) {
|
|
1687
|
+
const result = ConnectedAccountRetrieveResponseSchema.safeParse({
|
|
1688
|
+
...response,
|
|
1689
|
+
authConfig: {
|
|
1690
|
+
...response.auth_config,
|
|
1691
|
+
id: response.auth_config.id,
|
|
1692
|
+
isComposioManaged: response.auth_config.is_composio_managed,
|
|
1693
|
+
isDisabled: response.auth_config.is_disabled
|
|
1694
|
+
},
|
|
1695
|
+
state: response.state,
|
|
1696
|
+
status: response.status,
|
|
1697
|
+
statusReason: response.status_reason,
|
|
1698
|
+
isDisabled: response.is_disabled,
|
|
1699
|
+
createdAt: response.created_at,
|
|
1700
|
+
updatedAt: response.updated_at,
|
|
1701
|
+
testRequestEndpoint: response.test_request_endpoint
|
|
1702
|
+
});
|
|
1703
|
+
if (!result.success) {
|
|
1704
|
+
throw new ValidationError("Failed to parse connected account retrieve response", {
|
|
1705
|
+
cause: result.error
|
|
1603
1706
|
});
|
|
1604
|
-
this.name = "ComposioNoAPIKeyError";
|
|
1605
1707
|
}
|
|
1606
|
-
|
|
1708
|
+
return result.data;
|
|
1709
|
+
}
|
|
1607
1710
|
|
|
1608
1711
|
// src/models/CustomTools.ts
|
|
1609
1712
|
var CustomTools = class {
|
|
@@ -1767,35 +1870,7 @@ var CustomTools = class {
|
|
|
1767
1870
|
`Connected account not found for toolkit ${toolkitSlug} for user ${userId}`
|
|
1768
1871
|
);
|
|
1769
1872
|
}
|
|
1770
|
-
|
|
1771
|
-
id: connectedAccount.id,
|
|
1772
|
-
authConfig: {
|
|
1773
|
-
id: connectedAccount.auth_config.id,
|
|
1774
|
-
authScheme: connectedAccount.auth_config.auth_scheme,
|
|
1775
|
-
isComposioManaged: connectedAccount.auth_config.is_composio_managed,
|
|
1776
|
-
isDisabled: connectedAccount.auth_config.is_disabled
|
|
1777
|
-
},
|
|
1778
|
-
userId: connectedAccount.user_id,
|
|
1779
|
-
data: connectedAccount.data || {},
|
|
1780
|
-
status: connectedAccount.status,
|
|
1781
|
-
statusReason: connectedAccount.status_reason,
|
|
1782
|
-
toolkit: {
|
|
1783
|
-
slug: connectedAccount.toolkit.slug
|
|
1784
|
-
},
|
|
1785
|
-
testRequestEndpoint: connectedAccount.test_request_endpoint,
|
|
1786
|
-
isDisabled: connectedAccount.is_disabled,
|
|
1787
|
-
createdAt: connectedAccount.created_at,
|
|
1788
|
-
updatedAt: connectedAccount.updated_at
|
|
1789
|
-
});
|
|
1790
|
-
if (!connectedAccountResponse.success) {
|
|
1791
|
-
throw new ValidationError(
|
|
1792
|
-
`Validation error for connected account of ${toolkitSlug} for user ${userId}`,
|
|
1793
|
-
{
|
|
1794
|
-
cause: connectedAccountResponse.error
|
|
1795
|
-
}
|
|
1796
|
-
);
|
|
1797
|
-
}
|
|
1798
|
-
return connectedAccountResponse.data;
|
|
1873
|
+
return transformConnectedAccountResponse(connectedAccount);
|
|
1799
1874
|
}
|
|
1800
1875
|
/**
|
|
1801
1876
|
* Execute a custom tool
|
|
@@ -1890,6 +1965,36 @@ var CustomTools = class {
|
|
|
1890
1965
|
}
|
|
1891
1966
|
};
|
|
1892
1967
|
|
|
1968
|
+
// src/utils/jsonSchema.ts
|
|
1969
|
+
var import_json_schema_to_zod = require("@composio/json-schema-to-zod");
|
|
1970
|
+
var removeNonRequiredProperties = (schema) => {
|
|
1971
|
+
if (schema && schema.type === "object" && schema.required?.length) {
|
|
1972
|
+
schema.properties = Object.fromEntries(
|
|
1973
|
+
Object.entries(schema.properties || {}).filter(
|
|
1974
|
+
([key]) => schema.required.includes(key)
|
|
1975
|
+
)
|
|
1976
|
+
);
|
|
1977
|
+
}
|
|
1978
|
+
return schema;
|
|
1979
|
+
};
|
|
1980
|
+
function jsonSchemaToZodSchema(jsonSchema, { strict } = {
|
|
1981
|
+
strict: false
|
|
1982
|
+
}) {
|
|
1983
|
+
try {
|
|
1984
|
+
let schema = jsonSchema;
|
|
1985
|
+
if (strict && schema) {
|
|
1986
|
+
schema = removeNonRequiredProperties(
|
|
1987
|
+
schema
|
|
1988
|
+
);
|
|
1989
|
+
}
|
|
1990
|
+
return (0, import_json_schema_to_zod.jsonSchemaToZod)(schema);
|
|
1991
|
+
} catch (error) {
|
|
1992
|
+
throw new JsonSchemaToZodError("Failed to convert JSON Schema to Zod Schema", {
|
|
1993
|
+
cause: error
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1893
1998
|
// src/models/Tools.ts
|
|
1894
1999
|
var Tools = class {
|
|
1895
2000
|
client;
|
|
@@ -2150,7 +2255,14 @@ var Tools = class {
|
|
|
2150
2255
|
const tool = await this.getRawComposioToolBySlug(userId, arg2, options?.modifySchema);
|
|
2151
2256
|
return this.provider.wrapTools([tool], executeToolFn);
|
|
2152
2257
|
} else {
|
|
2153
|
-
|
|
2258
|
+
let tools = await this.getRawComposioTools(userId, arg2, options?.modifySchema);
|
|
2259
|
+
if (arg2?.strict) {
|
|
2260
|
+
tools = tools.map((tool) => ({
|
|
2261
|
+
...tool,
|
|
2262
|
+
inputParameters: tool.inputParameters ? removeNonRequiredProperties(tool.inputParameters) : void 0,
|
|
2263
|
+
outputParameters: tool.outputParameters ? removeNonRequiredProperties(tool.outputParameters) : void 0
|
|
2264
|
+
}));
|
|
2265
|
+
}
|
|
2154
2266
|
return this.provider.wrapTools(tools, executeToolFn);
|
|
2155
2267
|
}
|
|
2156
2268
|
}
|
|
@@ -2946,34 +3058,6 @@ var AuthConfigs = class {
|
|
|
2946
3058
|
|
|
2947
3059
|
// src/models/ConnectionRequest.ts
|
|
2948
3060
|
var import_client3 = __toESM(require("@composio/client"), 1);
|
|
2949
|
-
|
|
2950
|
-
// src/utils/transformers/connectedAccounts.ts
|
|
2951
|
-
function transformConnectedAccountResponse(response) {
|
|
2952
|
-
const result = ConnectedAccountRetrieveResponseSchema.safeParse({
|
|
2953
|
-
...response,
|
|
2954
|
-
authConfig: {
|
|
2955
|
-
...response.auth_config,
|
|
2956
|
-
id: response.auth_config.id,
|
|
2957
|
-
isComposioManaged: response.auth_config.is_composio_managed,
|
|
2958
|
-
isDisabled: response.auth_config.is_disabled
|
|
2959
|
-
},
|
|
2960
|
-
state: response.state,
|
|
2961
|
-
status: response.status,
|
|
2962
|
-
statusReason: response.status_reason,
|
|
2963
|
-
isDisabled: response.is_disabled,
|
|
2964
|
-
createdAt: response.created_at,
|
|
2965
|
-
updatedAt: response.updated_at,
|
|
2966
|
-
testRequestEndpoint: response.test_request_endpoint
|
|
2967
|
-
});
|
|
2968
|
-
if (!result.success) {
|
|
2969
|
-
throw new ValidationError("Failed to parse connected account retrieve response", {
|
|
2970
|
-
cause: result.error
|
|
2971
|
-
});
|
|
2972
|
-
}
|
|
2973
|
-
return result.data;
|
|
2974
|
-
}
|
|
2975
|
-
|
|
2976
|
-
// src/models/ConnectionRequest.ts
|
|
2977
3061
|
var ConnectionRequest = class {
|
|
2978
3062
|
client;
|
|
2979
3063
|
id;
|
|
@@ -3541,6 +3625,10 @@ var Toolkits = class {
|
|
|
3541
3625
|
|
|
3542
3626
|
// src/types/triggers.types.ts
|
|
3543
3627
|
var import_zod8 = require("zod");
|
|
3628
|
+
var TriggerStatuses = {
|
|
3629
|
+
ENABLE: "enable",
|
|
3630
|
+
DISABLE: "disable"
|
|
3631
|
+
};
|
|
3544
3632
|
var TriggerStatusEnum = import_zod8.z.enum(["enable", "disable"]);
|
|
3545
3633
|
var TriggerSubscribeParamSchema = import_zod8.z.object({
|
|
3546
3634
|
toolkits: import_zod8.z.array(import_zod8.z.string()).optional(),
|
|
@@ -4714,7 +4802,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
4714
4802
|
};
|
|
4715
4803
|
|
|
4716
4804
|
// package.json
|
|
4717
|
-
var version = "0.1.
|
|
4805
|
+
var version = "0.1.16";
|
|
4718
4806
|
|
|
4719
4807
|
// src/composio.ts
|
|
4720
4808
|
var Composio = class _Composio {
|
|
@@ -4892,26 +4980,24 @@ var ConsoleTelemetryTransport = class {
|
|
|
4892
4980
|
return Promise.resolve();
|
|
4893
4981
|
}
|
|
4894
4982
|
};
|
|
4895
|
-
|
|
4896
|
-
// src/utils/jsonSchema.ts
|
|
4897
|
-
var import_json_schema_to_zod = require("@composio/json-schema-to-zod");
|
|
4898
|
-
function jsonSchemaToZodSchema(jsonSchema) {
|
|
4899
|
-
try {
|
|
4900
|
-
return (0, import_json_schema_to_zod.jsonSchemaToZod)(jsonSchema);
|
|
4901
|
-
} catch (error) {
|
|
4902
|
-
throw new JsonSchemaToZodError("Failed to convert JSON Schema to Zod Schema", {
|
|
4903
|
-
cause: error
|
|
4904
|
-
});
|
|
4905
|
-
}
|
|
4906
|
-
}
|
|
4907
4983
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4908
4984
|
0 && (module.exports = {
|
|
4985
|
+
AUTH_MODES_ENUM,
|
|
4909
4986
|
AuthConfigErrorCodes,
|
|
4987
|
+
AuthConfigListParamsSchema,
|
|
4988
|
+
AuthConfigListResponseSchema,
|
|
4989
|
+
AuthConfigRetrieveResponseSchema,
|
|
4910
4990
|
AuthConfigTypes,
|
|
4991
|
+
AuthConfigUpdateParamsSchema,
|
|
4992
|
+
AuthCustomConfigUpdateParamsSchema,
|
|
4993
|
+
AuthDefaultConfigUpdateParamsSchema,
|
|
4994
|
+
AuthSchemeEnum,
|
|
4911
4995
|
AuthSchemeTypes,
|
|
4912
4996
|
BaseAgenticProvider,
|
|
4913
4997
|
BaseNonAgenticProvider,
|
|
4914
4998
|
BaseTelemetryTransport,
|
|
4999
|
+
BasicWithJwtConnectionDataSchema,
|
|
5000
|
+
BillcomAuthConnectionDataSchema,
|
|
4915
5001
|
Composio,
|
|
4916
5002
|
ComposioAuthConfigNotFoundError,
|
|
4917
5003
|
ComposioConnectedAccountNotFoundError,
|
|
@@ -4920,6 +5006,7 @@ function jsonSchemaToZodSchema(jsonSchema) {
|
|
|
4920
5006
|
ComposioGlobalExecuteToolFnNotSetError,
|
|
4921
5007
|
ComposioInvalidExecuteFunctionError,
|
|
4922
5008
|
ComposioInvalidModifierError,
|
|
5009
|
+
ComposioLinkConnectionDataSchema,
|
|
4923
5010
|
ComposioNoAPIKeyError,
|
|
4924
5011
|
ComposioProvider,
|
|
4925
5012
|
ComposioProviderNotDefinedError,
|
|
@@ -4928,16 +5015,68 @@ function jsonSchemaToZodSchema(jsonSchema) {
|
|
|
4928
5015
|
ComposioToolkitFetchError,
|
|
4929
5016
|
ComposioToolkitNotFoundError,
|
|
4930
5017
|
ConnectedAccountErrorCodes,
|
|
5018
|
+
ConnectionDataSchema,
|
|
4931
5019
|
ConnectionRequestErrorCodes,
|
|
4932
5020
|
ConnectionRequestFailedError,
|
|
4933
5021
|
ConnectionRequestTimeoutError,
|
|
5022
|
+
ConnectionStatusEnum,
|
|
4934
5023
|
ConsoleTelemetryTransport,
|
|
5024
|
+
CreateAuthConfigParamsSchema,
|
|
5025
|
+
CreateAuthConfigResponseSchema,
|
|
5026
|
+
CreateComposioManagedAuthConfigParamsSchema,
|
|
5027
|
+
CreateCustomAuthConfigParamsSchema,
|
|
5028
|
+
CustomAuthParamsSchema,
|
|
5029
|
+
IncomingTriggerPayloadSchema,
|
|
4935
5030
|
JsonSchemaToZodError,
|
|
5031
|
+
Oauth1ActiveConnectionDataSchema,
|
|
5032
|
+
Oauth1ConnectionDataSchema,
|
|
5033
|
+
Oauth1ExpiredConnectionDataSchema,
|
|
5034
|
+
Oauth1FailedConnectionDataSchema,
|
|
5035
|
+
Oauth1InitiatedConnectionDataSchema,
|
|
5036
|
+
Oauth1InitiatingConnectionDataSchema,
|
|
5037
|
+
Oauth2ActiveConnectionDataSchema,
|
|
5038
|
+
Oauth2ConnectionDataSchema,
|
|
5039
|
+
Oauth2ExpiredConnectionDataSchema,
|
|
5040
|
+
Oauth2FailedConnectionDataSchema,
|
|
5041
|
+
Oauth2InitiatedConnectionDataSchema,
|
|
5042
|
+
Oauth2InitiatingConnectionDataSchema,
|
|
4936
5043
|
OpenAIProvider,
|
|
5044
|
+
RedirectableAuthSchemeSchema,
|
|
4937
5045
|
SDKErrorCodes,
|
|
4938
5046
|
ToolErrorCodes,
|
|
5047
|
+
ToolExecuteParamsSchema,
|
|
5048
|
+
ToolExecuteResponseSchema,
|
|
5049
|
+
ToolKitItemSchema,
|
|
5050
|
+
ToolKitListResponseSchema,
|
|
5051
|
+
ToolKitMetaSchema,
|
|
5052
|
+
ToolListFilterBySearchSchema,
|
|
5053
|
+
ToolListFilterByToolkitsSchema,
|
|
5054
|
+
ToolListFilterByToolsSchema,
|
|
4939
5055
|
ToolListParamsSchema,
|
|
5056
|
+
ToolListResponseSchema,
|
|
5057
|
+
ToolProxyParamsSchema,
|
|
5058
|
+
ToolSchema,
|
|
5059
|
+
ToolkitAuthConfigDetailsSchema,
|
|
5060
|
+
ToolkitAuthFieldSchema,
|
|
5061
|
+
ToolkitCategorySchema,
|
|
4940
5062
|
ToolkitErrorCodes,
|
|
5063
|
+
ToolkitMangedByEnumSchema,
|
|
5064
|
+
ToolkitRetrieveCategoriesResponseSchema,
|
|
5065
|
+
ToolkitRetrieveResponseSchema,
|
|
5066
|
+
ToolkitSchema,
|
|
5067
|
+
ToolkitSortByEnumSchema,
|
|
5068
|
+
ToolkitsListParamsSchema,
|
|
5069
|
+
TriggerInstanceListActiveParamsSchema,
|
|
5070
|
+
TriggerInstanceListActiveResponseItemSchema,
|
|
5071
|
+
TriggerInstanceListActiveResponseSchema,
|
|
5072
|
+
TriggerInstanceManageDeleteResponseSchema,
|
|
5073
|
+
TriggerInstanceManageUpdateParamsSchema,
|
|
5074
|
+
TriggerInstanceManageUpdateResponseSchema,
|
|
5075
|
+
TriggerInstanceUpsertParamsSchema,
|
|
5076
|
+
TriggerInstanceUpsertResponseSchema,
|
|
5077
|
+
TriggerStatusEnum,
|
|
5078
|
+
TriggerStatuses,
|
|
5079
|
+
TriggerSubscribeParamSchema,
|
|
4941
5080
|
ValidationError,
|
|
4942
5081
|
ValidationErrorCodes,
|
|
4943
5082
|
jsonSchemaToZodSchema,
|