@credal/actions 0.1.52 → 0.1.54

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.
@@ -74,6 +74,7 @@ const createDocument_1 = __importDefault(require("./providers/microsoft/createDo
74
74
  const getDocument_1 = __importDefault(require("./providers/microsoft/getDocument"));
75
75
  const fetchSalesforceSchema_1 = __importDefault(require("./providers/salesforce/fetchSalesforceSchema"));
76
76
  const deepResearch_1 = __importDefault(require("./providers/firecrawl/deepResearch"));
77
+ const listPullRequests_1 = __importDefault(require("./providers/github/listPullRequests"));
77
78
  const getJiraIssuesByQuery_1 = __importDefault(require("./providers/jira/getJiraIssuesByQuery"));
78
79
  exports.ActionMapper = {
79
80
  generic: {
@@ -473,5 +474,10 @@ exports.ActionMapper = {
473
474
  paramsSchema: types_1.githubCreatePullRequestParamsSchema,
474
475
  outputSchema: types_1.githubCreatePullRequestOutputSchema,
475
476
  },
477
+ listPullRequests: {
478
+ fn: listPullRequests_1.default,
479
+ paramsSchema: types_1.githubListPullRequestsParamsSchema,
480
+ outputSchema: types_1.githubListPullRequestsOutputSchema,
481
+ },
476
482
  },
477
483
  };
@@ -69,3 +69,4 @@ export declare const microsoftGetDocumentDefinition: ActionTemplate;
69
69
  export declare const githubCreateOrUpdateFileDefinition: ActionTemplate;
70
70
  export declare const githubCreateBranchDefinition: ActionTemplate;
71
71
  export declare const githubCreatePullRequestDefinition: ActionTemplate;
72
+ export declare const githubListPullRequestsDefinition: ActionTemplate;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = exports.ashbyCreateNoteDefinition = exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = 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.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = 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.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.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = 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.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = void 0;
5
5
  exports.genericFillTemplateDefinition = {
6
6
  description: "Simple utility that takes a template and returns it filled in",
7
7
  scopes: [],
@@ -213,6 +213,20 @@ exports.slackSendMessageDefinition = {
213
213
  },
214
214
  },
215
215
  },
216
+ output: {
217
+ type: "object",
218
+ required: ["success"],
219
+ properties: {
220
+ success: {
221
+ type: "boolean",
222
+ description: "Whether the email was sent successfully",
223
+ },
224
+ error: {
225
+ type: "string",
226
+ description: "The error that occurred if the email was not sent successfully",
227
+ },
228
+ },
229
+ },
216
230
  name: "sendMessage",
217
231
  provider: "slack",
218
232
  };
@@ -5976,3 +5990,79 @@ exports.githubCreatePullRequestDefinition = {
5976
5990
  name: "createPullRequest",
5977
5991
  provider: "github",
5978
5992
  };
5993
+ exports.githubListPullRequestsDefinition = {
5994
+ description: "List pull requests in a GitHub repository",
5995
+ scopes: [],
5996
+ parameters: {
5997
+ type: "object",
5998
+ required: ["repositoryOwner", "repositoryName"],
5999
+ properties: {
6000
+ repositoryOwner: {
6001
+ type: "string",
6002
+ description: "The owner of the repository",
6003
+ },
6004
+ repositoryName: {
6005
+ type: "string",
6006
+ description: "The name of the repository",
6007
+ },
6008
+ state: {
6009
+ type: "string",
6010
+ description: "The state of the pull requests to list (e.g., open, closed)",
6011
+ },
6012
+ },
6013
+ },
6014
+ output: {
6015
+ type: "object",
6016
+ required: ["pullRequests"],
6017
+ properties: {
6018
+ pullRequests: {
6019
+ type: "array",
6020
+ description: "A list of pull requests in the repository",
6021
+ items: {
6022
+ type: "object",
6023
+ properties: {
6024
+ number: {
6025
+ type: "number",
6026
+ description: "The number of the pull request",
6027
+ },
6028
+ title: {
6029
+ type: "string",
6030
+ description: "The title of the pull request",
6031
+ },
6032
+ state: {
6033
+ type: "string",
6034
+ description: "The state of the pull request (e.g., open, closed)",
6035
+ },
6036
+ url: {
6037
+ type: "string",
6038
+ description: "The URL of the pull request",
6039
+ },
6040
+ createdAt: {
6041
+ type: "string",
6042
+ description: "The date and time when the pull request was created",
6043
+ },
6044
+ updatedAt: {
6045
+ type: "string",
6046
+ description: "The date and time when the pull request was last updated",
6047
+ },
6048
+ user: {
6049
+ type: "object",
6050
+ properties: {
6051
+ login: {
6052
+ type: "string",
6053
+ description: "The username of the user who created the pull request",
6054
+ },
6055
+ },
6056
+ },
6057
+ description: {
6058
+ type: "string",
6059
+ description: "The description of the pull request",
6060
+ },
6061
+ },
6062
+ },
6063
+ },
6064
+ },
6065
+ },
6066
+ name: "listPullRequests",
6067
+ provider: "github",
6068
+ };
@@ -207,7 +207,16 @@ export declare const slackSendMessageParamsSchema: z.ZodObject<{
207
207
  channelName: string;
208
208
  }>;
209
209
  export type slackSendMessageParamsType = z.infer<typeof slackSendMessageParamsSchema>;
210
- export declare const slackSendMessageOutputSchema: z.ZodVoid;
210
+ export declare const slackSendMessageOutputSchema: z.ZodObject<{
211
+ success: z.ZodBoolean;
212
+ error: z.ZodOptional<z.ZodString>;
213
+ }, "strip", z.ZodTypeAny, {
214
+ success: boolean;
215
+ error?: string | undefined;
216
+ }, {
217
+ success: boolean;
218
+ error?: string | undefined;
219
+ }>;
211
220
  export type slackSendMessageOutputType = z.infer<typeof slackSendMessageOutputSchema>;
212
221
  export type slackSendMessageFunction = ActionFunction<slackSendMessageParamsType, AuthParamsType, slackSendMessageOutputType>;
213
222
  export declare const slackListConversationsParamsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
@@ -2813,3 +2822,85 @@ export declare const githubCreatePullRequestOutputSchema: z.ZodObject<{
2813
2822
  }>;
2814
2823
  export type githubCreatePullRequestOutputType = z.infer<typeof githubCreatePullRequestOutputSchema>;
2815
2824
  export type githubCreatePullRequestFunction = ActionFunction<githubCreatePullRequestParamsType, AuthParamsType, githubCreatePullRequestOutputType>;
2825
+ export declare const githubListPullRequestsParamsSchema: z.ZodObject<{
2826
+ repositoryOwner: z.ZodString;
2827
+ repositoryName: z.ZodString;
2828
+ state: z.ZodOptional<z.ZodString>;
2829
+ }, "strip", z.ZodTypeAny, {
2830
+ repositoryOwner: string;
2831
+ repositoryName: string;
2832
+ state?: string | undefined;
2833
+ }, {
2834
+ repositoryOwner: string;
2835
+ repositoryName: string;
2836
+ state?: string | undefined;
2837
+ }>;
2838
+ export type githubListPullRequestsParamsType = z.infer<typeof githubListPullRequestsParamsSchema>;
2839
+ export declare const githubListPullRequestsOutputSchema: z.ZodObject<{
2840
+ pullRequests: z.ZodArray<z.ZodObject<{
2841
+ number: z.ZodOptional<z.ZodNumber>;
2842
+ title: z.ZodOptional<z.ZodString>;
2843
+ state: z.ZodOptional<z.ZodString>;
2844
+ url: z.ZodOptional<z.ZodString>;
2845
+ createdAt: z.ZodOptional<z.ZodString>;
2846
+ updatedAt: z.ZodOptional<z.ZodString>;
2847
+ user: z.ZodOptional<z.ZodObject<{
2848
+ login: z.ZodOptional<z.ZodString>;
2849
+ }, "strip", z.ZodTypeAny, {
2850
+ login?: string | undefined;
2851
+ }, {
2852
+ login?: string | undefined;
2853
+ }>>;
2854
+ description: z.ZodOptional<z.ZodString>;
2855
+ }, "strip", z.ZodTypeAny, {
2856
+ number?: number | undefined;
2857
+ description?: string | undefined;
2858
+ user?: {
2859
+ login?: string | undefined;
2860
+ } | undefined;
2861
+ title?: string | undefined;
2862
+ url?: string | undefined;
2863
+ createdAt?: string | undefined;
2864
+ state?: string | undefined;
2865
+ updatedAt?: string | undefined;
2866
+ }, {
2867
+ number?: number | undefined;
2868
+ description?: string | undefined;
2869
+ user?: {
2870
+ login?: string | undefined;
2871
+ } | undefined;
2872
+ title?: string | undefined;
2873
+ url?: string | undefined;
2874
+ createdAt?: string | undefined;
2875
+ state?: string | undefined;
2876
+ updatedAt?: string | undefined;
2877
+ }>, "many">;
2878
+ }, "strip", z.ZodTypeAny, {
2879
+ pullRequests: {
2880
+ number?: number | undefined;
2881
+ description?: string | undefined;
2882
+ user?: {
2883
+ login?: string | undefined;
2884
+ } | undefined;
2885
+ title?: string | undefined;
2886
+ url?: string | undefined;
2887
+ createdAt?: string | undefined;
2888
+ state?: string | undefined;
2889
+ updatedAt?: string | undefined;
2890
+ }[];
2891
+ }, {
2892
+ pullRequests: {
2893
+ number?: number | undefined;
2894
+ description?: string | undefined;
2895
+ user?: {
2896
+ login?: string | undefined;
2897
+ } | undefined;
2898
+ title?: string | undefined;
2899
+ url?: string | undefined;
2900
+ createdAt?: string | undefined;
2901
+ state?: string | undefined;
2902
+ updatedAt?: string | undefined;
2903
+ }[];
2904
+ }>;
2905
+ export type githubListPullRequestsOutputType = z.infer<typeof githubListPullRequestsOutputSchema>;
2906
+ export type githubListPullRequestsFunction = ActionFunction<githubListPullRequestsParamsType, AuthParamsType, githubListPullRequestsOutputType>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = 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
4
  exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = 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 = void 0;
5
- 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.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 = 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.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 = void 0;
6
6
  const zod_1 = require("zod");
7
7
  exports.AuthParamsSchema = zod_1.z.object({
8
8
  authToken: zod_1.z.string().optional(),
@@ -78,7 +78,10 @@ exports.slackSendMessageParamsSchema = zod_1.z.object({
78
78
  channelName: zod_1.z.string().describe("The name of the Slack channel to send the message to (e.g. general, alerts)"),
79
79
  message: zod_1.z.string().describe("The message content to send to Slack. Can include markdown formatting."),
80
80
  });
81
- exports.slackSendMessageOutputSchema = zod_1.z.void();
81
+ exports.slackSendMessageOutputSchema = zod_1.z.object({
82
+ success: zod_1.z.boolean().describe("Whether the email was sent successfully"),
83
+ error: zod_1.z.string().describe("The error that occurred if the email was not sent successfully").optional(),
84
+ });
82
85
  exports.slackListConversationsParamsSchema = zod_1.z.object({});
83
86
  exports.slackListConversationsOutputSchema = zod_1.z.object({
84
87
  channels: zod_1.z
@@ -2283,3 +2286,24 @@ exports.githubCreatePullRequestOutputSchema = zod_1.z.object({
2283
2286
  pullRequestUrl: zod_1.z.string().describe("The URL of the created pull request").optional(),
2284
2287
  pullRequestNumber: zod_1.z.number().describe("The number of the created pull request").optional(),
2285
2288
  });
2289
+ exports.githubListPullRequestsParamsSchema = zod_1.z.object({
2290
+ repositoryOwner: zod_1.z.string().describe("The owner of the repository"),
2291
+ repositoryName: zod_1.z.string().describe("The name of the repository"),
2292
+ state: zod_1.z.string().describe("The state of the pull requests to list (e.g., open, closed)").optional(),
2293
+ });
2294
+ exports.githubListPullRequestsOutputSchema = zod_1.z.object({
2295
+ pullRequests: zod_1.z
2296
+ .array(zod_1.z.object({
2297
+ number: zod_1.z.number().describe("The number of the pull request").optional(),
2298
+ title: zod_1.z.string().describe("The title of the pull request").optional(),
2299
+ state: zod_1.z.string().describe("The state of the pull request (e.g., open, closed)").optional(),
2300
+ url: zod_1.z.string().describe("The URL of the pull request").optional(),
2301
+ createdAt: zod_1.z.string().describe("The date and time when the pull request was created").optional(),
2302
+ updatedAt: zod_1.z.string().describe("The date and time when the pull request was last updated").optional(),
2303
+ user: zod_1.z
2304
+ .object({ login: zod_1.z.string().describe("The username of the user who created the pull request").optional() })
2305
+ .optional(),
2306
+ description: zod_1.z.string().describe("The description of the pull request").optional(),
2307
+ }))
2308
+ .describe("A list of pull requests in the repository"),
2309
+ });
@@ -131,6 +131,11 @@ exports.ACTION_GROUPS = {
131
131
  },
132
132
  GITHUB: {
133
133
  description: "Actions for interacting with GitHub",
134
- actions: [templates_1.githubCreateOrUpdateFileDefinition, templates_1.githubCreateBranchDefinition, templates_1.githubCreatePullRequestDefinition],
134
+ actions: [
135
+ templates_1.githubCreateOrUpdateFileDefinition,
136
+ templates_1.githubCreateBranchDefinition,
137
+ templates_1.githubCreatePullRequestDefinition,
138
+ templates_1.githubListPullRequestsDefinition,
139
+ ],
135
140
  },
136
141
  };
@@ -0,0 +1,3 @@
1
+ import { type githubListPullRequestsFunction } from "../../autogen/types";
2
+ declare const listPullRequests: githubListPullRequestsFunction;
3
+ export default listPullRequests;
@@ -0,0 +1,56 @@
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 listPullRequests = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
18
+ const { authToken } = authParams;
19
+ const { repositoryName, repositoryOwner } = params;
20
+ const url = `https://api.github.com/repos/${repositoryOwner}/${repositoryName}/pulls`;
21
+ const oneYearAgo = new Date();
22
+ oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1);
23
+ const allPulls = [];
24
+ let page = 1;
25
+ const perPage = 100;
26
+ while (true) {
27
+ const response = yield axios_1.default.get(url, {
28
+ headers: {
29
+ Authorization: `Bearer ${authToken}`,
30
+ Accept: "application/vnd.github+json",
31
+ "X-GitHub-Api-Version": "2022-11-28",
32
+ },
33
+ params: {
34
+ state: "all",
35
+ sort: "created",
36
+ direction: "desc",
37
+ per_page: perPage,
38
+ page,
39
+ },
40
+ });
41
+ const pulls = response.data;
42
+ if (pulls.length === 0)
43
+ break;
44
+ // Filter by date
45
+ const recentPulls = pulls.filter(pr => pr.createdAt && new Date(pr.createdAt) >= oneYearAgo);
46
+ allPulls.push(...recentPulls);
47
+ // Stop if the rest are older than one year
48
+ if (recentPulls.length < pulls.length)
49
+ break;
50
+ page++;
51
+ }
52
+ return types_1.githubListPullRequestsOutputSchema.parse({
53
+ pullRequests: allPulls,
54
+ });
55
+ });
56
+ exports.default = listPullRequests;
@@ -1,3 +1,3 @@
1
- import type { slackSendMessageFunction } from "../../autogen/types";
1
+ import { type slackSendMessageFunction } from "../../autogen/types";
2
2
  declare const sendMessage: slackSendMessageFunction;
3
3
  export default sendMessage;
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const web_api_1 = require("@slack/web-api");
13
+ const types_1 = require("../../autogen/types");
13
14
  const helpers_1 = require("./helpers");
14
15
  const sendMessage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
16
  const client = new web_api_1.WebClient(authParams.authToken);
@@ -19,18 +20,28 @@ const sendMessage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
19
20
  if (!channel || !channel.id) {
20
21
  throw Error(`Channel with name ${channelName} not found`);
21
22
  }
22
- yield client.chat.postMessage({
23
- channel: channel.id,
24
- blocks: [
25
- {
26
- type: "section",
27
- text: {
28
- type: "mrkdwn",
29
- text: message,
23
+ try {
24
+ yield client.chat.postMessage({
25
+ channel: channel.id,
26
+ blocks: [
27
+ {
28
+ type: "section",
29
+ text: {
30
+ type: "mrkdwn",
31
+ text: message,
32
+ },
30
33
  },
31
- },
32
- ],
33
- });
34
- return;
34
+ ],
35
+ });
36
+ return types_1.slackSendMessageOutputSchema.parse({
37
+ success: true,
38
+ });
39
+ }
40
+ catch (error) {
41
+ return types_1.slackSendMessageOutputSchema.parse({
42
+ success: false,
43
+ error: error instanceof Error ? error.message : "Unknown error",
44
+ });
45
+ }
35
46
  });
36
47
  exports.default = sendMessage;
@@ -0,0 +1,23 @@
1
+ declare const axios: any;
2
+ declare const WORKDAY_BASE_URL = "https://your-workday-url/ccx/service/YOUR_TENANT/Absence_Management/v43.2";
3
+ declare const TOKEN_URL = "https://your-workday-url/oauth2/YOUR_TENANT/token";
4
+ declare const CLIENT_ID = "your-client-id";
5
+ declare const CLIENT_SECRET = "your-client-secret";
6
+ /**
7
+ * Fetches an OAuth 2.0 access token from Workday.
8
+ */
9
+ declare function getAccessToken(): Promise<any>;
10
+ /**
11
+ * Submits a time-off request to Workday.
12
+ * @param {Object} params - Time-off details.
13
+ * @param {string} params.workerId - Worker's ID in Workday.
14
+ * @param {string} params.startDate - Start date (YYYY-MM-DD).
15
+ * @param {string} params.endDate - End date (YYYY-MM-DD).
16
+ * @param {string} params.timeOffType - Time-off type (e.g., "SICK_LEAVE").
17
+ */
18
+ declare function submitTimeOff({ workerId, startDate, endDate, timeOffType }: {
19
+ workerId: any;
20
+ startDate: any;
21
+ endDate: any;
22
+ timeOffType: any;
23
+ }): Promise<any>;
@@ -0,0 +1,88 @@
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
+ const axios = require("axios");
12
+ const WORKDAY_BASE_URL = "https://your-workday-url/ccx/service/YOUR_TENANT/Absence_Management/v43.2";
13
+ const TOKEN_URL = "https://your-workday-url/oauth2/YOUR_TENANT/token"; // OAuth token endpoint
14
+ const CLIENT_ID = "your-client-id";
15
+ const CLIENT_SECRET = "your-client-secret";
16
+ /**
17
+ * Fetches an OAuth 2.0 access token from Workday.
18
+ */
19
+ function getAccessToken() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a;
22
+ try {
23
+ const response = yield axios.post(TOKEN_URL, new URLSearchParams({ grant_type: "client_credentials" }), {
24
+ auth: {
25
+ username: CLIENT_ID,
26
+ password: CLIENT_SECRET
27
+ },
28
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
29
+ });
30
+ return response.data.access_token;
31
+ }
32
+ catch (error) {
33
+ console.error("Error fetching access token:", ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || error.message);
34
+ throw error;
35
+ }
36
+ });
37
+ }
38
+ /**
39
+ * Submits a time-off request to Workday.
40
+ * @param {Object} params - Time-off details.
41
+ * @param {string} params.workerId - Worker's ID in Workday.
42
+ * @param {string} params.startDate - Start date (YYYY-MM-DD).
43
+ * @param {string} params.endDate - End date (YYYY-MM-DD).
44
+ * @param {string} params.timeOffType - Time-off type (e.g., "SICK_LEAVE").
45
+ */
46
+ function submitTimeOff(_a) {
47
+ return __awaiter(this, arguments, void 0, function* ({ workerId, startDate, endDate, timeOffType }) {
48
+ var _b;
49
+ try {
50
+ const token = yield getAccessToken(); // Get OAuth token
51
+ const requestBody = {
52
+ "wd:Enter_Time_Off_Request": {
53
+ "wd:Worker_Reference": {
54
+ "wd:ID": [{ "_": workerId, "$": { "wd:type": "WID" } }]
55
+ },
56
+ "wd:Time_Off_Entries": [
57
+ {
58
+ "wd:Start_Date": startDate,
59
+ "wd:End_Date": endDate,
60
+ "wd:Time_Off_Type_Reference": {
61
+ "wd:ID": [{ "_": timeOffType, "$": { "wd:type": "Time_Off_Type_ID" } }]
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ };
67
+ const response = yield axios.post(`${WORKDAY_BASE_URL}/Enter_Time_Off`, requestBody, {
68
+ headers: {
69
+ "Authorization": `Bearer ${token}`,
70
+ "Content-Type": "application/json"
71
+ }
72
+ });
73
+ console.log("Time-off request submitted successfully:", response.data);
74
+ return response.data;
75
+ }
76
+ catch (error) {
77
+ console.error("Error submitting time-off request:", ((_b = error.response) === null || _b === void 0 ? void 0 : _b.data) || error.message);
78
+ throw error;
79
+ }
80
+ });
81
+ }
82
+ // Example Usage:
83
+ submitTimeOff({
84
+ workerId: "12345",
85
+ startDate: "2025-03-10",
86
+ endDate: "2025-03-12",
87
+ timeOffType: "SICK_LEAVE"
88
+ }).then(console.log).catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "description": "AI Actions by Credal AI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",