@credal/actions 0.1.69 → 0.1.71

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.
@@ -10,7 +10,6 @@ const validateAddress_1 = __importDefault(require("./providers/googlemaps/valida
10
10
  const add_1 = __importDefault(require("./providers/math/add"));
11
11
  const fillTemplate_1 = __importDefault(require("./providers/generic/fillTemplate"));
12
12
  const insertMongoDoc_1 = __importDefault(require("./providers/mongodb/insertMongoDoc"));
13
- const listConversations_1 = __importDefault(require("./providers/slack/listConversations"));
14
13
  const sendMessage_1 = __importDefault(require("./providers/slack/sendMessage"));
15
14
  const getChannelMessages_1 = __importDefault(require("./providers/slack/getChannelMessages"));
16
15
  const getRowByFieldValue_1 = __importDefault(require("./providers/snowflake/getRowByFieldValue"));
@@ -114,11 +113,6 @@ exports.ActionMapper = {
114
113
  },
115
114
  },
116
115
  slack: {
117
- listConversations: {
118
- fn: listConversations_1.default,
119
- paramsSchema: types_1.slackListConversationsParamsSchema,
120
- outputSchema: types_1.slackListConversationsOutputSchema,
121
- },
122
116
  sendMessage: {
123
117
  fn: sendMessage_1.default,
124
118
  paramsSchema: types_1.slackSendMessageParamsSchema,
@@ -4,7 +4,6 @@ export declare const asanaCommentTaskDefinition: ActionTemplate;
4
4
  export declare const asanaCreateTaskDefinition: ActionTemplate;
5
5
  export declare const asanaUpdateTaskDefinition: ActionTemplate;
6
6
  export declare const slackSendMessageDefinition: ActionTemplate;
7
- export declare const slackListConversationsDefinition: ActionTemplate;
8
7
  export declare const slackGetChannelMessagesDefinition: ActionTemplate;
9
8
  export declare const mathAddDefinition: ActionTemplate;
10
9
  export declare const confluenceOverwritePageDefinition: ActionTemplate;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.gongGetGongTranscriptsDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = exports.googleOauthScheduleCalendarMeetingDefinition = exports.googleOauthUpdateDocDefinition = exports.googleOauthCreateNewGoogleDocDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeTweetDataWithNitterDefinition = exports.firecrawlScrapeUrlDefinition = exports.firecrawlDeepResearchDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeRunSnowflakeQueryDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = exports.zendeskAssignTicketDefinition = exports.zendeskAddCommentToTicketDefinition = exports.zendeskUpdateTicketStatusDefinition = exports.zendeskGetTicketDetailsDefinition = exports.zendeskListZendeskTicketsDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.bingGetTopNSearchResultUrlsDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraGetJiraIssuesByQueryDefinition = exports.jiraUpdateJiraTicketStatusDefinition = exports.jiraUpdateJiraTicketDetailsDefinition = exports.jiraGetJiraTicketHistoryDefinition = exports.jiraGetJiraTicketDetailsDefinition = exports.jiraCreateJiraTicketDefinition = exports.jiraCommentJiraTicketDefinition = exports.jiraAssignJiraTicketDefinition = exports.confluenceFetchPageContentDefinition = exports.confluenceOverwritePageDefinition = exports.mathAddDefinition = exports.slackGetChannelMessagesDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = exports.asanaUpdateTaskDefinition = exports.asanaCreateTaskDefinition = exports.asanaCommentTaskDefinition = exports.genericFillTemplateDefinition = void 0;
4
- exports.githubListPullRequestsDefinition = exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftGetDocumentDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.microsoftUpdateSpreadsheetDefinition = exports.microsoftUpdateDocumentDefinition = exports.microsoftCreateDocumentDefinition = exports.salesforceFetchSalesforceSchemaByObjectDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceCreateRecordDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = exports.ashbyCreateNoteDefinition = void 0;
3
+ exports.ashbyCreateNoteDefinition = exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.gongGetGongTranscriptsDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = exports.googleOauthScheduleCalendarMeetingDefinition = exports.googleOauthUpdateDocDefinition = exports.googleOauthCreateNewGoogleDocDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeTweetDataWithNitterDefinition = exports.firecrawlScrapeUrlDefinition = exports.firecrawlDeepResearchDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeRunSnowflakeQueryDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = exports.zendeskAssignTicketDefinition = exports.zendeskAddCommentToTicketDefinition = exports.zendeskUpdateTicketStatusDefinition = exports.zendeskGetTicketDetailsDefinition = exports.zendeskListZendeskTicketsDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.bingGetTopNSearchResultUrlsDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.jiraGetJiraIssuesByQueryDefinition = exports.jiraUpdateJiraTicketStatusDefinition = exports.jiraUpdateJiraTicketDetailsDefinition = exports.jiraGetJiraTicketHistoryDefinition = exports.jiraGetJiraTicketDetailsDefinition = exports.jiraCreateJiraTicketDefinition = exports.jiraCommentJiraTicketDefinition = exports.jiraAssignJiraTicketDefinition = exports.confluenceFetchPageContentDefinition = exports.confluenceOverwritePageDefinition = exports.mathAddDefinition = exports.slackGetChannelMessagesDefinition = exports.slackSendMessageDefinition = exports.asanaUpdateTaskDefinition = exports.asanaCreateTaskDefinition = exports.asanaCommentTaskDefinition = exports.genericFillTemplateDefinition = void 0;
4
+ exports.githubListPullRequestsDefinition = exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftGetDocumentDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.microsoftUpdateSpreadsheetDefinition = exports.microsoftUpdateDocumentDefinition = exports.microsoftCreateDocumentDefinition = exports.salesforceFetchSalesforceSchemaByObjectDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceCreateRecordDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = void 0;
5
5
  exports.genericFillTemplateDefinition = {
6
6
  description: "Simple utility that takes a template and returns it filled in",
7
7
  scopes: [],
@@ -230,45 +230,6 @@ exports.slackSendMessageDefinition = {
230
230
  name: "sendMessage",
231
231
  provider: "slack",
232
232
  };
233
- exports.slackListConversationsDefinition = {
234
- description: "Lists all conversations in a Slack workspace",
235
- scopes: ["channels:read", "groups:read", "im:read", "mpim:read"],
236
- output: {
237
- type: "object",
238
- required: ["channels"],
239
- properties: {
240
- channels: {
241
- type: "array",
242
- description: "A list of channels in Slack",
243
- items: {
244
- type: "object",
245
- description: "A channel in Slack",
246
- required: ["id", "name", "topic", "purpose"],
247
- properties: {
248
- id: {
249
- type: "string",
250
- description: "The ID of the channel",
251
- },
252
- name: {
253
- type: "string",
254
- description: "The name of the channel",
255
- },
256
- topic: {
257
- type: "string",
258
- description: "The topic of the channel",
259
- },
260
- purpose: {
261
- type: "string",
262
- description: "The purpose of the channel",
263
- },
264
- },
265
- },
266
- },
267
- },
268
- },
269
- name: "listConversations",
270
- provider: "slack",
271
- };
272
233
  exports.slackGetChannelMessagesDefinition = {
273
234
  description: "Gets messages from a Slack channel",
274
235
  scopes: ["channels:history"],
@@ -219,42 +219,6 @@ export declare const slackSendMessageOutputSchema: z.ZodObject<{
219
219
  }>;
220
220
  export type slackSendMessageOutputType = z.infer<typeof slackSendMessageOutputSchema>;
221
221
  export type slackSendMessageFunction = ActionFunction<slackSendMessageParamsType, AuthParamsType, slackSendMessageOutputType>;
222
- export declare const slackListConversationsParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
223
- export type slackListConversationsParamsType = z.infer<typeof slackListConversationsParamsSchema>;
224
- export declare const slackListConversationsOutputSchema: z.ZodObject<{
225
- channels: z.ZodArray<z.ZodObject<{
226
- id: z.ZodString;
227
- name: z.ZodString;
228
- topic: z.ZodString;
229
- purpose: z.ZodString;
230
- }, "strip", z.ZodTypeAny, {
231
- name: string;
232
- id: string;
233
- topic: string;
234
- purpose: string;
235
- }, {
236
- name: string;
237
- id: string;
238
- topic: string;
239
- purpose: string;
240
- }>, "many">;
241
- }, "strip", z.ZodTypeAny, {
242
- channels: {
243
- name: string;
244
- id: string;
245
- topic: string;
246
- purpose: string;
247
- }[];
248
- }, {
249
- channels: {
250
- name: string;
251
- id: string;
252
- topic: string;
253
- purpose: string;
254
- }[];
255
- }>;
256
- export type slackListConversationsOutputType = z.infer<typeof slackListConversationsOutputSchema>;
257
- export type slackListConversationsFunction = ActionFunction<slackListConversationsParamsType, AuthParamsType, slackListConversationsOutputType>;
258
222
  export declare const slackGetChannelMessagesParamsSchema: z.ZodObject<{
259
223
  channelName: z.ZodString;
260
224
  oldest: z.ZodString;
@@ -2009,16 +1973,16 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
2009
1973
  end?: number | undefined;
2010
1974
  }>, "many">>;
2011
1975
  }, "strip", z.ZodTypeAny, {
2012
- topic?: string | undefined;
2013
1976
  speakerName?: string | undefined;
1977
+ topic?: string | undefined;
2014
1978
  sentences?: {
2015
1979
  text?: string | undefined;
2016
1980
  start?: number | undefined;
2017
1981
  end?: number | undefined;
2018
1982
  }[] | undefined;
2019
1983
  }, {
2020
- topic?: string | undefined;
2021
1984
  speakerName?: string | undefined;
1985
+ topic?: string | undefined;
2022
1986
  sentences?: {
2023
1987
  text?: string | undefined;
2024
1988
  start?: number | undefined;
@@ -2028,8 +1992,8 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
2028
1992
  }, "strip", z.ZodTypeAny, {
2029
1993
  callId?: string | undefined;
2030
1994
  transcript?: {
2031
- topic?: string | undefined;
2032
1995
  speakerName?: string | undefined;
1996
+ topic?: string | undefined;
2033
1997
  sentences?: {
2034
1998
  text?: string | undefined;
2035
1999
  start?: number | undefined;
@@ -2039,8 +2003,8 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
2039
2003
  }, {
2040
2004
  callId?: string | undefined;
2041
2005
  transcript?: {
2042
- topic?: string | undefined;
2043
2006
  speakerName?: string | undefined;
2007
+ topic?: string | undefined;
2044
2008
  sentences?: {
2045
2009
  text?: string | undefined;
2046
2010
  start?: number | undefined;
@@ -2055,8 +2019,8 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
2055
2019
  callTranscripts?: {
2056
2020
  callId?: string | undefined;
2057
2021
  transcript?: {
2058
- topic?: string | undefined;
2059
2022
  speakerName?: string | undefined;
2023
+ topic?: string | undefined;
2060
2024
  sentences?: {
2061
2025
  text?: string | undefined;
2062
2026
  start?: number | undefined;
@@ -2070,8 +2034,8 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
2070
2034
  callTranscripts?: {
2071
2035
  callId?: string | undefined;
2072
2036
  transcript?: {
2073
- topic?: string | undefined;
2074
2037
  speakerName?: string | undefined;
2038
+ topic?: string | undefined;
2075
2039
  sentences?: {
2076
2040
  text?: string | undefined;
2077
2041
  start?: number | undefined;
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
4
- exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.firecrawlDeepResearchOutputSchema = exports.firecrawlDeepResearchParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = void 0;
5
- exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = void 0;
6
- exports.githubListPullRequestsOutputSchema = void 0;
3
+ exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
4
+ exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.firecrawlDeepResearchOutputSchema = exports.firecrawlDeepResearchParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = void 0;
5
+ exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = void 0;
7
6
  const zod_1 = require("zod");
8
7
  exports.AuthParamsSchema = zod_1.z.object({
9
8
  authToken: zod_1.z.string().optional(),
@@ -83,19 +82,6 @@ exports.slackSendMessageOutputSchema = zod_1.z.object({
83
82
  success: zod_1.z.boolean().describe("Whether the email was sent successfully"),
84
83
  error: zod_1.z.string().describe("The error that occurred if the email was not sent successfully").optional(),
85
84
  });
86
- exports.slackListConversationsParamsSchema = zod_1.z.object({});
87
- exports.slackListConversationsOutputSchema = zod_1.z.object({
88
- channels: zod_1.z
89
- .array(zod_1.z
90
- .object({
91
- id: zod_1.z.string().describe("The ID of the channel"),
92
- name: zod_1.z.string().describe("The name of the channel"),
93
- topic: zod_1.z.string().describe("The topic of the channel"),
94
- purpose: zod_1.z.string().describe("The purpose of the channel"),
95
- })
96
- .describe("A channel in Slack"))
97
- .describe("A list of channels in Slack"),
98
- });
99
85
  exports.slackGetChannelMessagesParamsSchema = zod_1.z.object({
100
86
  channelName: zod_1.z.string().describe("Name of the channel to summarize"),
101
87
  oldest: zod_1.z.string().describe("Only messages after this Unix timestamp will be included in results"),
@@ -315,7 +301,7 @@ exports.bingGetTopNSearchResultUrlsOutputSchema = zod_1.z.object({
315
301
  name: zod_1.z.string().describe("The name or title of the search result").optional(),
316
302
  url: zod_1.z.string().describe("The URL of the search result").optional(),
317
303
  }))
318
- .describe("The top N search result objects"),
304
+ .describe("The top five search result objects"),
319
305
  });
320
306
  exports.credalCallCopilotParamsSchema = zod_1.z.object({
321
307
  agentId: zod_1.z.string().describe("The ID of the copilot to call"),
@@ -13,7 +13,7 @@ exports.ACTION_GROUPS = {
13
13
  },
14
14
  SLACK_LIST_CONVERSATIONS: {
15
15
  description: "Actions for interacting with Slack",
16
- actions: [templates_1.slackListConversationsDefinition, templates_1.slackSendMessageDefinition, templates_1.slackGetChannelMessagesDefinition],
16
+ actions: [templates_1.slackSendMessageDefinition, templates_1.slackGetChannelMessagesDefinition],
17
17
  },
18
18
  CONFLUENCE: {
19
19
  description: "Action for interacting with Confluence",
@@ -8,28 +8,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
13
- function getConfluenceRequestConfig(baseUrl, username, apiToken) {
14
- return {
15
+ const axios_1 = __importDefault(require("axios"));
16
+ function getConfluenceApi(baseUrl, username, apiToken) {
17
+ const api = axios_1.default.create({
15
18
  baseURL: baseUrl,
16
19
  headers: {
17
20
  Accept: "application/json",
21
+ // Tokens are associated with a specific user.
18
22
  Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
19
23
  },
20
- };
24
+ });
25
+ return api;
21
26
  }
22
27
  const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
23
- const { pageId, content, title } = params;
24
- const { baseUrl, authToken, username } = authParams;
25
- if (!baseUrl || !authToken || !username) {
26
- throw new Error("Missing required authentication information");
27
- }
28
- const config = getConfluenceRequestConfig(baseUrl, username, authToken);
28
+ const { pageId, username, content, title } = params;
29
+ const { baseUrl, authToken } = authParams;
30
+ const api = getConfluenceApi(baseUrl, username, authToken);
29
31
  // Get current version number
30
- const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
32
+ const response = yield api.get(`/api/v2/pages/${pageId}`);
31
33
  const currVersion = response.data.version.number;
32
- const payload = {
34
+ yield api.put(`/api/v2/pages/${pageId}`, {
33
35
  id: pageId,
34
36
  status: "current",
35
37
  title,
@@ -40,7 +42,6 @@ const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* (
40
42
  version: {
41
43
  number: currVersion + 1,
42
44
  },
43
- };
44
- yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
45
+ });
45
46
  });
46
47
  exports.default = confluenceUpdatePage;
@@ -41,13 +41,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
41
41
  step((generator = generator.apply(thisArg, _arguments || [])).next());
42
42
  });
43
43
  };
44
- var __importDefault = (this && this.__importDefault) || function (mod) {
45
- return (mod && mod.__esModule) ? mod : { "default": mod };
46
- };
47
44
  Object.defineProperty(exports, "__esModule", { value: true });
48
45
  exports.getSnowflakeConnection = getSnowflakeConnection;
49
46
  exports.connectToSnowflakeAndWarehouse = connectToSnowflakeAndWarehouse;
50
- const snowflake_sdk_1 = __importDefault(require("snowflake-sdk"));
47
+ const snowflake = __importStar(require("snowflake-sdk"));
51
48
  const forge = __importStar(require("node-forge"));
52
49
  const getPrivateKeyCorrectFormat = (privateKey) => {
53
50
  try {
@@ -66,7 +63,7 @@ function getSnowflakeConnection(snowflakeData, authParams) {
66
63
  const { account, username, warehouse, database } = snowflakeData;
67
64
  if (authToken) {
68
65
  // Always try to use Nango-Snowflake OAuth (unused for now)
69
- return snowflake_sdk_1.default.createConnection({
66
+ return snowflake.createConnection({
70
67
  account: account,
71
68
  username: username,
72
69
  authenticator: "OAUTH",
@@ -78,7 +75,7 @@ function getSnowflakeConnection(snowflakeData, authParams) {
78
75
  }
79
76
  else if (apiKey) {
80
77
  const privateKeyCorrectFormatString = getPrivateKeyCorrectFormat(apiKey);
81
- return snowflake_sdk_1.default.createConnection({
78
+ return snowflake.createConnection({
82
79
  account: account,
83
80
  username: username,
84
81
  privateKey: privateKeyCorrectFormatString,
package/dist/index.d.ts CHANGED
@@ -3,5 +3,3 @@ export { ACTION_GROUPS, type ActionGroups } from "./actions/groups";
3
3
  export { ActionMapper } from "./actions/actionMapper";
4
4
  export * from "./actions/autogen/templates";
5
5
  export * from "./actions/autogen/types";
6
- export * from "./actions/providers/math/index";
7
- export * from "./actions/providers/slack/index";
package/dist/index.js CHANGED
@@ -25,5 +25,3 @@ var actionMapper_1 = require("./actions/actionMapper");
25
25
  Object.defineProperty(exports, "ActionMapper", { enumerable: true, get: function () { return actionMapper_1.ActionMapper; } });
26
26
  __exportStar(require("./actions/autogen/templates"), exports);
27
27
  __exportStar(require("./actions/autogen/types"), exports);
28
- __exportStar(require("./actions/providers/math/index"), exports);
29
- __exportStar(require("./actions/providers/slack/index"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +0,0 @@
1
- import type { ActionFunction } from "../../autogen/types";
2
- declare const fillTemplateAction: ActionFunction<{
3
- template: string;
4
- }, {
5
- result: string;
6
- }, unknown>;
7
- export default fillTemplateAction;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const fillTemplateAction = (_a) => __awaiter(void 0, [_a], void 0, function* ({ template }) {
13
- // Simply return the template without any modification
14
- return {
15
- result: template,
16
- };
17
- });
18
- exports.default = fillTemplateAction;
@@ -1,3 +0,0 @@
1
- import type { genericUniversalTestActionFunction } from "../../autogen/types";
2
- declare const genericApiCall: genericUniversalTestActionFunction;
3
- export default genericApiCall;
@@ -1,38 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const genericApiCall = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, }) {
17
- try {
18
- const { endpoint, method, headers, body } = params;
19
- const response = yield (0, axios_1.default)({
20
- url: endpoint,
21
- method,
22
- headers,
23
- data: method !== "GET" ? body : undefined,
24
- });
25
- return {
26
- statusCode: response.status,
27
- headers: response.headers,
28
- data: response.data,
29
- };
30
- }
31
- catch (error) {
32
- if (axios_1.default.isAxiosError(error)) {
33
- throw Error("Axios Error: " + (error.message || "Failed to make API call"));
34
- }
35
- throw Error("Error: " + (error || "Failed to make API call"));
36
- }
37
- });
38
- exports.default = genericApiCall;
@@ -1,3 +0,0 @@
1
- import { googlemapsNearbysearchFunction } from "../../autogen/types";
2
- declare const nearbysearch: googlemapsNearbysearchFunction;
3
- export default nearbysearch;
@@ -1,96 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const axios_1 = __importDefault(require("axios"));
16
- const types_1 = require("../../autogen/types");
17
- const INCLUDED_TYPES = [
18
- "monument",
19
- "museum",
20
- "art_gallery",
21
- "sculpture",
22
- "cultural_landmark",
23
- "historical_place",
24
- "performing_arts_theater",
25
- "university",
26
- "aquarium",
27
- "botanical_garden",
28
- "comedy_club",
29
- "park",
30
- "movie_theater",
31
- "national_park",
32
- "garden",
33
- "night_club",
34
- "tourist_attraction",
35
- "water_park",
36
- "zoo",
37
- "bar",
38
- "restaurant",
39
- "food_court",
40
- "bakery",
41
- "cafe",
42
- "coffee_shop",
43
- "pub",
44
- "wine_bar",
45
- "spa",
46
- "beach",
47
- "market",
48
- "shopping_mall",
49
- "stadium",
50
- ];
51
- const nearbysearch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
52
- const url = `https://places.googleapis.com/v1/places:searchNearby`;
53
- const fieldMask = [
54
- "places.displayName",
55
- "places.formattedAddress",
56
- "places.priceLevel",
57
- "places.rating",
58
- "places.primaryTypeDisplayName",
59
- "places.editorialSummary",
60
- "places.regularOpeningHours",
61
- ].join(",");
62
- const response = yield axios_1.default.post(url, {
63
- maxResultCount: 20,
64
- includedTypes: INCLUDED_TYPES,
65
- locationRestriction: {
66
- circle: {
67
- center: {
68
- latitude: params.latitude,
69
- longitude: params.longitude,
70
- },
71
- radius: 10000,
72
- },
73
- },
74
- }, {
75
- headers: {
76
- "X-Goog-Api-Key": authParams.apiKey,
77
- "X-Goog-FieldMask": fieldMask,
78
- "Content-Type": "application/json",
79
- },
80
- });
81
- return types_1.googlemapsNearbysearchOutputSchema.parse({
82
- results: response.data.places.map((place) => {
83
- var _a, _b;
84
- return ({
85
- name: place.displayName.text,
86
- address: place.formattedAddress,
87
- priceLevel: place.priceLevel,
88
- rating: place.rating,
89
- primaryType: place.primaryTypeDisplayName.text,
90
- editorialSummary: ((_a = place.editorialSummary) === null || _a === void 0 ? void 0 : _a.text) || "",
91
- openingHours: ((_b = place.regularOpeningHours) === null || _b === void 0 ? void 0 : _b.weekdayDescriptions.join("\n")) || "",
92
- });
93
- }),
94
- });
95
- });
96
- exports.default = nearbysearch;
@@ -1,3 +0,0 @@
1
- import { snowflakeRunSnowflakeQueryWriteResultsToS3Function } from "../../autogen/types";
2
- declare const runSnowflakeQueryWriteResultsToS3: snowflakeRunSnowflakeQueryWriteResultsToS3Function;
3
- export default runSnowflakeQueryWriteResultsToS3;
@@ -1,154 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const snowflake_sdk_1 = __importDefault(require("snowflake-sdk"));
16
- const crypto_1 = __importDefault(require("crypto"));
17
- const client_s3_1 = require("@aws-sdk/client-s3");
18
- const s3_request_presigner_1 = require("@aws-sdk/s3-request-presigner");
19
- const uuid_1 = require("uuid");
20
- // Only log errors.
21
- snowflake_sdk_1.default.configure({ logLevel: "ERROR" });
22
- const runSnowflakeQueryWriteResultsToS3 = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
23
- const { databaseName, warehouse, query, user, accountName, s3BucketName, s3Region, outputFormat = "json" } = params;
24
- const { apiKey: privateKey, awsAccessKeyId, awsSecretAccessKey } = authParams;
25
- if (!privateKey) {
26
- throw new Error("Snowflake private key is required");
27
- }
28
- if (!awsAccessKeyId || !awsSecretAccessKey) {
29
- throw new Error("AWS credentials are required");
30
- }
31
- if (!accountName || !user || !databaseName || !warehouse || !query || !s3BucketName) {
32
- throw new Error("Missing required parameters for Snowflake query or S3 destination");
33
- }
34
- const getPrivateKeyCorrectFormat = (privateKey) => {
35
- const buffer = Buffer.from(privateKey);
36
- const privateKeyObject = crypto_1.default.createPrivateKey({
37
- key: buffer,
38
- format: "pem",
39
- passphrase: "password",
40
- });
41
- const privateKeyCorrectFormat = privateKeyObject.export({
42
- format: "pem",
43
- type: "pkcs8",
44
- });
45
- return privateKeyCorrectFormat.toString();
46
- };
47
- const executeQueryAndFormatData = () => __awaiter(void 0, void 0, void 0, function* () {
48
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
- const queryResults = yield new Promise((resolve, reject) => {
50
- connection.execute({
51
- sqlText: query,
52
- complete: (err, stmt, rows) => {
53
- if (err) {
54
- return reject(err);
55
- }
56
- return resolve(rows || []);
57
- },
58
- });
59
- });
60
- // Format the results based on the output format
61
- let formattedData;
62
- if (outputFormat.toLowerCase() === "csv") {
63
- if (queryResults.length === 0) {
64
- formattedData = "";
65
- }
66
- else {
67
- const headers = Object.keys(queryResults[0]).join(",");
68
- const rows = queryResults.map(row => Object.values(row)
69
- .map(value => (typeof value === "object" && value !== null ? JSON.stringify(value) : value))
70
- .join(","));
71
- formattedData = [headers, ...rows].join("\n");
72
- }
73
- }
74
- else {
75
- // Default to JSON
76
- formattedData = JSON.stringify(queryResults, null, 2);
77
- }
78
- return { formattedData, resultsLength: queryResults.length };
79
- });
80
- const uploadToS3AndGetURL = (formattedData) => __awaiter(void 0, void 0, void 0, function* () {
81
- // Create S3 client
82
- const s3Client = new client_s3_1.S3Client({
83
- region: s3Region,
84
- credentials: {
85
- accessKeyId: awsAccessKeyId,
86
- secretAccessKey: awsSecretAccessKey,
87
- },
88
- });
89
- const contentType = outputFormat.toLowerCase() === "csv" ? "text/csv" : "application/json";
90
- const fileExtension = outputFormat.toLowerCase() === "csv" ? "csv" : "json";
91
- const finalKey = `${databaseName}/${(0, uuid_1.v4)()}.${fileExtension}`;
92
- // Upload to S3 without ACL
93
- const uploadCommand = new client_s3_1.PutObjectCommand({
94
- Bucket: s3BucketName,
95
- Key: finalKey,
96
- Body: formattedData,
97
- ContentType: contentType,
98
- });
99
- yield s3Client.send(uploadCommand);
100
- // Generate a presigned URL (valid for an hour)
101
- const getObjectCommand = new client_s3_1.GetObjectCommand({
102
- Bucket: s3BucketName,
103
- Key: finalKey,
104
- });
105
- const presignedUrl = yield (0, s3_request_presigner_1.getSignedUrl)(s3Client, getObjectCommand, { expiresIn: 3600 });
106
- return presignedUrl;
107
- });
108
- // Process the private key
109
- const privateKeyCorrectFormatString = getPrivateKeyCorrectFormat(privateKey);
110
- // Set up a connection using snowflake-sdk
111
- const connection = snowflake_sdk_1.default.createConnection({
112
- account: accountName,
113
- username: user,
114
- privateKey: privateKeyCorrectFormatString,
115
- authenticator: "SNOWFLAKE_JWT",
116
- role: "ACCOUNTADMIN",
117
- warehouse: warehouse,
118
- database: databaseName,
119
- });
120
- try {
121
- // Connect to Snowflake
122
- yield new Promise((resolve, reject) => {
123
- connection.connect((err, conn) => {
124
- if (err) {
125
- console.error("Unable to connect to Snowflake:", err.message);
126
- return reject(err);
127
- }
128
- resolve(conn);
129
- });
130
- });
131
- const { formattedData, resultsLength } = yield executeQueryAndFormatData();
132
- const presignedUrl = yield uploadToS3AndGetURL(formattedData);
133
- // Return fields to match schema definition
134
- connection.destroy(err => {
135
- if (err) {
136
- console.log("Failed to disconnect from Snowflake:", err);
137
- }
138
- });
139
- return {
140
- bucketUrl: presignedUrl,
141
- message: `Query results successfully written to S3. URL valid for 1 hour.`,
142
- rowCount: resultsLength,
143
- };
144
- }
145
- catch (error) {
146
- connection.destroy(err => {
147
- if (err) {
148
- console.log("Failed to disconnect from Snowflake:", err);
149
- }
150
- });
151
- throw Error(`An error occurred: ${error}`);
152
- }
153
- });
154
- exports.default = runSnowflakeQueryWriteResultsToS3;
@@ -1,3 +0,0 @@
1
- import { xScrapePostDataWithNitterFunction } from "../../autogen/types";
2
- declare const scrapeTweetDataWithNitter: xScrapePostDataWithNitterFunction;
3
- export default scrapeTweetDataWithNitter;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const firecrawl_js_1 = __importDefault(require("@mendable/firecrawl-js"));
16
- const scrapeTweetDataWithNitter = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
17
- const tweetUrlRegex = /^(?:https?:\/\/)?(?:www\.)?(?:twitter\.com|x\.com)\/([a-zA-Z0-9_]+)\/status\/(\d+)(?:\?.*)?$/;
18
- if (!tweetUrlRegex.test(params.tweetUrl)) {
19
- throw new Error("Invalid tweet URL. Expected format: https://twitter.com/username/status/id or https://x.com/username/status/id");
20
- }
21
- const nitterUrl = params.tweetUrl.replace(/^(?:https?:\/\/)?(?:www\.)?(?:twitter\.com|x\.com)/i, "https://nitter.net");
22
- // Initialize Firecrawl
23
- if (!authParams.apiKey) {
24
- throw new Error("API key is required for X+Nitter+Firecrawl");
25
- }
26
- const firecrawl = new firecrawl_js_1.default({
27
- apiKey: authParams.apiKey,
28
- });
29
- try {
30
- // Scrape the Nitter URL
31
- const result = yield firecrawl.scrapeUrl(nitterUrl);
32
- if (!result.success) {
33
- throw new Error(`Failed to scrape tweet: ${result.error || "Unknown error"}`);
34
- }
35
- // Extract the tweet text from the scraped content - simple approach - in practice, you might need more robust parsing based on nitter html structure
36
- const tweetContent = result.markdown;
37
- return {
38
- text: tweetContent || "Error scraping with firecrawl",
39
- };
40
- }
41
- catch (error) {
42
- throw new Error(`Error scraping tweet: ${error instanceof Error ? error.message : error}`);
43
- }
44
- });
45
- exports.default = scrapeTweetDataWithNitter;