@credal/actions 0.2.193 → 0.2.195

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.
@@ -738,7 +738,7 @@ export const slackSendMessageDefinition = {
738
738
  provider: "slack",
739
739
  };
740
740
  export const slackGetChannelMessagesDefinition = {
741
- displayName: "Get messages in a channel",
741
+ displayName: "List messages in a channel",
742
742
  description: "Gets messages from a Slack channel",
743
743
  scopes: ["channels:history"],
744
744
  tags: [],
@@ -818,7 +818,7 @@ export const slackGetChannelMessagesDefinition = {
818
818
  provider: "slack",
819
819
  };
820
820
  export const slackGetChannelMembersDefinition = {
821
- displayName: "Get members of a channel",
821
+ displayName: "List members of a channel",
822
822
  description: "Gets the members of a Slack channel",
823
823
  scopes: ["channels:read"],
824
824
  tags: [],
@@ -8421,7 +8421,7 @@ export const googleOauthUpdatePresentationDefinition = {
8421
8421
  provider: "googleOauth",
8422
8422
  };
8423
8423
  export const googleOauthGetPresentationDefinition = {
8424
- displayName: "Get a presentation",
8424
+ displayName: "Fetch a presentation",
8425
8425
  description: "Get a presentation by ID",
8426
8426
  scopes: ["slides.readonly"],
8427
8427
  tags: [],
@@ -8622,7 +8622,7 @@ export const googleOauthSearchDriveByQueryDefinition = {
8622
8622
  provider: "googleOauth",
8623
8623
  };
8624
8624
  export const googleOauthSearchDriveByKeywordsAndGetFileContentDefinition = {
8625
- displayName: "Search Drive by keyword",
8625
+ displayName: "Search all of Google Drive",
8626
8626
  description: "Search Google Drive with keywords and get resulting content",
8627
8627
  scopes: ["drive.readonly"],
8628
8628
  tags: [],
@@ -8645,7 +8645,6 @@ export const googleOauthSearchDriveByKeywordsAndGetFileContentDefinition = {
8645
8645
  searchDriveByDrive: {
8646
8646
  type: "boolean",
8647
8647
  description: "Search drive by drive or run a general search",
8648
- tags: ["recommend-predefined"],
8649
8648
  },
8650
8649
  orderByQuery: {
8651
8650
  type: "string",
@@ -8805,7 +8804,7 @@ export const googleOauthSearchDriveByQueryAndGetFileContentDefinition = {
8805
8804
  provider: "googleOauth",
8806
8805
  };
8807
8806
  export const googleOauthGetDriveFileContentByIdDefinition = {
8808
- displayName: "Fetch file contents",
8807
+ displayName: "Fetch full file contents",
8809
8808
  description: "Get text content of a Google Drive file by its ID.",
8810
8809
  scopes: ["drive.readonly"],
8811
8810
  tags: [],
@@ -8943,7 +8942,7 @@ export const googleOauthListGroupsDefinition = {
8943
8942
  provider: "googleOauth",
8944
8943
  };
8945
8944
  export const googleOauthGetGroupDefinition = {
8946
- displayName: "Get a Group",
8945
+ displayName: "Get Group details",
8947
8946
  description: "Get details for a specific Google Group by group email or ID.",
8948
8947
  scopes: ["https://www.googleapis.com/auth/admin.directory.group.readonly"],
8949
8948
  tags: [],
@@ -10097,7 +10096,7 @@ export const salesforceSearchAllSalesforceRecordsDefinition = {
10097
10096
  },
10098
10097
  usesLightningKnowledge: {
10099
10098
  type: "boolean",
10100
- description: "Whether your Salesforce instance uses lightning knowledge articles",
10099
+ description: 'Whether your Salesforce instance uses lightning knowledge articles ("true" or "false")',
10101
10100
  tags: ["recommend-predefined"],
10102
10101
  },
10103
10102
  limit: {
@@ -10762,7 +10761,7 @@ export const microsoftMessageTeamsChannelDefinition = {
10762
10761
  provider: "microsoft",
10763
10762
  };
10764
10763
  export const microsoftGetDocumentDefinition = {
10765
- displayName: "Get a document",
10764
+ displayName: "Fetch a document",
10766
10765
  description: "Retrieves the content of a Microsoft Office document",
10767
10766
  scopes: ["Files.ReadWrite", "Sites.ReadWrite.All"],
10768
10767
  tags: [],
@@ -10812,7 +10811,7 @@ export const githubCreateOrUpdateFileDefinition = {
10812
10811
  properties: {
10813
10812
  repositoryOwner: {
10814
10813
  type: "string",
10815
- description: "The owner of the repository",
10814
+ description: "The owner of the repository, this is a GitHub username",
10816
10815
  tags: ["recommend-predefined"],
10817
10816
  },
10818
10817
  repositoryName: {
@@ -10879,7 +10878,7 @@ export const githubCreateBranchDefinition = {
10879
10878
  properties: {
10880
10879
  repositoryOwner: {
10881
10880
  type: "string",
10882
- description: "The owner of the repository",
10881
+ description: "The owner of the repository, this is a GitHub username",
10883
10882
  tags: ["recommend-predefined"],
10884
10883
  },
10885
10884
  repositoryName: {
@@ -10925,7 +10924,7 @@ export const githubCreatePullRequestDefinition = {
10925
10924
  properties: {
10926
10925
  repositoryOwner: {
10927
10926
  type: "string",
10928
- description: "The owner of the repository",
10927
+ description: "The owner of the repository, this is a GitHub username",
10929
10928
  tags: ["recommend-predefined"],
10930
10929
  },
10931
10930
  repositoryName: {
@@ -10987,7 +10986,7 @@ export const githubListPullRequestsDefinition = {
10987
10986
  properties: {
10988
10987
  repositoryOwner: {
10989
10988
  type: "string",
10990
- description: "The owner of the repository",
10989
+ description: "The owner of the repository, this is a GitHub username",
10991
10990
  tags: ["recommend-predefined"],
10992
10991
  },
10993
10992
  repositoryName: {
@@ -11078,7 +11077,7 @@ export const githubListPullRequestsDefinition = {
11078
11077
  provider: "github",
11079
11078
  };
11080
11079
  export const githubGetPullRequestDetailsDefinition = {
11081
- displayName: "Fetch pull request",
11080
+ displayName: "Fetch pull request details",
11082
11081
  description: "Get detailed information about a specific pull request including description, files, reviews, and status",
11083
11082
  scopes: [],
11084
11083
  tags: [],
@@ -11088,7 +11087,7 @@ export const githubGetPullRequestDetailsDefinition = {
11088
11087
  properties: {
11089
11088
  repositoryOwner: {
11090
11089
  type: "string",
11091
- description: "The owner of the repository",
11090
+ description: "The owner of the repository, this is a GitHub username",
11092
11091
  tags: ["recommend-predefined"],
11093
11092
  },
11094
11093
  repositoryName: {
@@ -11811,7 +11810,7 @@ export const githubSearchOrganizationDefinition = {
11811
11810
  provider: "github",
11812
11811
  };
11813
11812
  export const githubGetBranchDefinition = {
11814
- displayName: "Get a branch",
11813
+ displayName: "Get branch details",
11815
11814
  description: "Get a branch in a GitHub repository",
11816
11815
  scopes: [],
11817
11816
  tags: [],
@@ -11821,7 +11820,7 @@ export const githubGetBranchDefinition = {
11821
11820
  properties: {
11822
11821
  repositoryOwner: {
11823
11822
  type: "string",
11824
- description: "The owner of the repository",
11823
+ description: "The owner of the repository, this is a GitHub username",
11825
11824
  tags: ["recommend-predefined"],
11826
11825
  },
11827
11826
  repositoryName: {
@@ -12081,7 +12080,7 @@ export const githubListCommitsDefinition = {
12081
12080
  properties: {
12082
12081
  repositoryOwner: {
12083
12082
  type: "string",
12084
- description: "The owner of the repository",
12083
+ description: "The owner of the repository, this is a GitHub username",
12085
12084
  tags: ["recommend-predefined"],
12086
12085
  },
12087
12086
  repositoryName: {
@@ -12684,7 +12683,7 @@ export const gitlabGetFileContentDefinition = {
12684
12683
  provider: "gitlab",
12685
12684
  };
12686
12685
  export const gitlabGetMergeRequestDefinition = {
12687
- displayName: "Get merge request",
12686
+ displayName: "Get merge request details",
12688
12687
  description: "Get specified merge request from a GitLab repository",
12689
12688
  scopes: [],
12690
12689
  tags: [],
@@ -13130,7 +13129,7 @@ export const linearGetIssuesDefinition = {
13130
13129
  provider: "linear",
13131
13130
  };
13132
13131
  export const linearGetIssueDetailsDefinition = {
13133
- displayName: "Fetch issue",
13132
+ displayName: "Fetch issue details",
13134
13133
  description: "Get detailed information about a Linear issue",
13135
13134
  scopes: [],
13136
13135
  tags: [],
@@ -13292,7 +13291,7 @@ export const linearGetIssueDetailsDefinition = {
13292
13291
  provider: "linear",
13293
13292
  };
13294
13293
  export const linearGetProjectsDefinition = {
13295
- displayName: "Fetch projects",
13294
+ displayName: "List all projects",
13296
13295
  description: "Get all Linear projects",
13297
13296
  scopes: [],
13298
13297
  tags: [],
@@ -13607,7 +13606,7 @@ export const linearGetTeamDetailsDefinition = {
13607
13606
  provider: "linear",
13608
13607
  };
13609
13608
  export const linearGetTeamsDefinition = {
13610
- displayName: "Get teams",
13609
+ displayName: "List all teams",
13611
13610
  description: "Get all teams in Linear",
13612
13611
  scopes: [],
13613
13612
  tags: [],
@@ -13651,7 +13650,7 @@ export const linearGetTeamsDefinition = {
13651
13650
  provider: "linear",
13652
13651
  };
13653
13652
  export const hubspotGetContactsDefinition = {
13654
- displayName: "Get contacts",
13653
+ displayName: "List all contacts",
13655
13654
  description: "List or search HubSpot contacts by optional query",
13656
13655
  scopes: ["oauth crm.objects.contacts.read"],
13657
13656
  tags: [],
@@ -13716,7 +13715,7 @@ export const hubspotGetContactsDefinition = {
13716
13715
  provider: "hubspot",
13717
13716
  };
13718
13717
  export const hubspotGetContactDetailsDefinition = {
13719
- displayName: "Get details of a contact",
13718
+ displayName: "Get contact details",
13720
13719
  description: "Get detailed information about a specific HubSpot contact",
13721
13720
  scopes: ["oauth crm.objects.contacts.read"],
13722
13721
  tags: [],
@@ -13818,7 +13817,7 @@ export const hubspotGetContactDetailsDefinition = {
13818
13817
  provider: "hubspot",
13819
13818
  };
13820
13819
  export const hubspotGetCompaniesDefinition = {
13821
- displayName: "Get companies",
13820
+ displayName: "List all companies",
13822
13821
  description: "List or search HubSpot companies by optional query",
13823
13822
  scopes: ["oauth crm.objects.companies.read"],
13824
13823
  tags: [],
@@ -13879,7 +13878,7 @@ export const hubspotGetCompaniesDefinition = {
13879
13878
  provider: "hubspot",
13880
13879
  };
13881
13880
  export const hubspotGetCompanyDetailsDefinition = {
13882
- displayName: "Get details of a company",
13881
+ displayName: "Get company details",
13883
13882
  description: "Get detailed information about a specific HubSpot company",
13884
13883
  scopes: ["oauth crm.objects.companies.read"],
13885
13884
  tags: [],
@@ -13973,7 +13972,7 @@ export const hubspotGetCompanyDetailsDefinition = {
13973
13972
  provider: "hubspot",
13974
13973
  };
13975
13974
  export const hubspotGetDealsDefinition = {
13976
- displayName: "Get deals",
13975
+ displayName: "List all deals",
13977
13976
  description: "List or search HubSpot deals by optional query",
13978
13977
  scopes: ["oauth crm.objects.deals.read"],
13979
13978
  tags: [],
@@ -14038,7 +14037,7 @@ export const hubspotGetDealsDefinition = {
14038
14037
  provider: "hubspot",
14039
14038
  };
14040
14039
  export const hubspotGetDealDetailsDefinition = {
14041
- displayName: "Get details of a deal",
14040
+ displayName: "Get deal details",
14042
14041
  description: "Get detailed information about a specific HubSpot deal",
14043
14042
  scopes: ["oauth crm.objects.deals.read"],
14044
14043
  tags: [],
@@ -14124,7 +14123,7 @@ export const hubspotGetDealDetailsDefinition = {
14124
14123
  provider: "hubspot",
14125
14124
  };
14126
14125
  export const hubspotGetTicketsDefinition = {
14127
- displayName: "Get tickets",
14126
+ displayName: "List all tickets",
14128
14127
  description: "List or search HubSpot tickets by optional query",
14129
14128
  scopes: ["oauth crm.objects.tickets.read"],
14130
14129
  tags: [],
@@ -14185,7 +14184,7 @@ export const hubspotGetTicketsDefinition = {
14185
14184
  provider: "hubspot",
14186
14185
  };
14187
14186
  export const hubspotGetTicketDetailsDefinition = {
14188
- displayName: "Get details of a ticket",
14187
+ displayName: "Get ticket details",
14189
14188
  description: "Get detailed information about a specific HubSpot ticket",
14190
14189
  scopes: ["oauth crm.objects.tickets.read"],
14191
14190
  tags: [],
@@ -3699,7 +3699,7 @@ export const salesforceSearchAllSalesforceRecordsParamsSchema = z.object({
3699
3699
  keyword: z.string().describe("The keyword to search for"),
3700
3700
  usesLightningKnowledge: z
3701
3701
  .boolean()
3702
- .describe("Whether your Salesforce instance uses lightning knowledge articles")
3702
+ .describe('Whether your Salesforce instance uses lightning knowledge articles ("true" or "false")')
3703
3703
  .optional(),
3704
3704
  limit: z.number().describe("The maximum number of records to return").optional(),
3705
3705
  maxLimit: z.number().describe("The absolute maximum limit for records that can be returned").optional(),
@@ -3894,7 +3894,7 @@ export const microsoftGetDocumentOutputSchema = z.object({
3894
3894
  error: z.string().describe("The error that occurred if the document was not successfully retrieved").optional(),
3895
3895
  });
3896
3896
  export const githubCreateOrUpdateFileParamsSchema = z.object({
3897
- repositoryOwner: z.string().describe("The owner of the repository"),
3897
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
3898
3898
  repositoryName: z.string().describe("The name of the repository"),
3899
3899
  filePath: z.string().describe("The path of the file to create or update"),
3900
3900
  branch: z.string().describe("The branch where the file will be created or updated"),
@@ -3909,7 +3909,7 @@ export const githubCreateOrUpdateFileOutputSchema = z.object({
3909
3909
  operation: z.enum(["created", "updated"]).describe("Indicates whether the file was created or updated").optional(),
3910
3910
  });
3911
3911
  export const githubCreateBranchParamsSchema = z.object({
3912
- repositoryOwner: z.string().describe("The owner of the repository"),
3912
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
3913
3913
  repositoryName: z.string().describe("The name of the repository"),
3914
3914
  branchName: z.string().describe("The name of the new branch to create"),
3915
3915
  baseRefOrHash: z.string().describe("The ref or hash of the base commit to create the new branch from"),
@@ -3919,7 +3919,7 @@ export const githubCreateBranchOutputSchema = z.object({
3919
3919
  error: z.string().describe("The error that occurred if the branch was not created successfully").optional(),
3920
3920
  });
3921
3921
  export const githubCreatePullRequestParamsSchema = z.object({
3922
- repositoryOwner: z.string().describe("The owner of the repository"),
3922
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
3923
3923
  repositoryName: z.string().describe("The name of the repository"),
3924
3924
  head: z
3925
3925
  .string()
@@ -3935,7 +3935,7 @@ export const githubCreatePullRequestOutputSchema = z.object({
3935
3935
  pullRequestNumber: z.number().describe("The number of the created pull request").optional(),
3936
3936
  });
3937
3937
  export const githubListPullRequestsParamsSchema = z.object({
3938
- repositoryOwner: z.string().describe("The owner of the repository"),
3938
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
3939
3939
  repositoryName: z.string().describe("The name of the repository"),
3940
3940
  state: z.string().describe("The state of the pull requests to list (e.g., open, closed)").optional(),
3941
3941
  });
@@ -3967,7 +3967,7 @@ export const githubListPullRequestsOutputSchema = z.object({
3967
3967
  .optional(),
3968
3968
  });
3969
3969
  export const githubGetPullRequestDetailsParamsSchema = z.object({
3970
- repositoryOwner: z.string().describe("The owner of the repository"),
3970
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
3971
3971
  repositoryName: z.string().describe("The name of the repository"),
3972
3972
  pullRequestNumber: z.number().describe("The number of the pull request to get details for"),
3973
3973
  });
@@ -4218,7 +4218,7 @@ export const githubSearchOrganizationOutputSchema = z.object({
4218
4218
  .optional(),
4219
4219
  });
4220
4220
  export const githubGetBranchParamsSchema = z.object({
4221
- repositoryOwner: z.string().describe("The owner of the repository"),
4221
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
4222
4222
  repositoryName: z.string().describe("The name of the repository"),
4223
4223
  branchName: z.string().describe("The name of the branch to retrieve"),
4224
4224
  });
@@ -4318,7 +4318,7 @@ export const githubGetBranchOutputSchema = z.object({
4318
4318
  .optional(),
4319
4319
  });
4320
4320
  export const githubListCommitsParamsSchema = z.object({
4321
- repositoryOwner: z.string().describe("The owner of the repository"),
4321
+ repositoryOwner: z.string().describe("The owner of the repository, this is a GitHub username"),
4322
4322
  repositoryName: z.string().describe("The name of the repository"),
4323
4323
  branch: z.string().describe("The branch to list commits from (defaults to default branch)").optional(),
4324
4324
  since: z
@@ -47,7 +47,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
47
47
  name: item.name,
48
48
  path: item.path,
49
49
  sha: item.sha.slice(0, 7),
50
- url: item.html_url,
50
+ url: item.url,
51
51
  score: item.score,
52
52
  textMatches: item.text_matches
53
53
  ? item.text_matches.map(match => {
@@ -68,7 +68,7 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
68
68
  const full = commitDetails.find(c => c.data.sha === item.sha);
69
69
  return {
70
70
  sha: item.sha,
71
- url: item.html_url,
71
+ url: item.url,
72
72
  commit: {
73
73
  message: item.commit.message,
74
74
  author: item.commit.author,
@@ -76,11 +76,11 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
76
76
  score: item.score,
77
77
  author: (_a = item.author) !== null && _a !== void 0 ? _a : undefined,
78
78
  files: ((_b = full === null || full === void 0 ? void 0 : full.data.files) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_FILES_PER_COMMIT).map(f => {
79
- var _a, _b, _c;
79
+ var _a;
80
80
  return ({
81
81
  filename: f.filename,
82
82
  status: f.status,
83
- patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
83
+ patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
84
84
  });
85
85
  })) || [],
86
86
  };
@@ -104,18 +104,18 @@ const searchRepository = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
104
104
  const prIndex = prNumbers.indexOf(item.number);
105
105
  const files = isPR && prIndex !== -1
106
106
  ? prFiles[prIndex].data.slice(0, MAX_FILES_PER_PR).map(f => {
107
- var _a, _b, _c;
107
+ var _a;
108
108
  return ({
109
109
  filename: f.filename,
110
110
  status: f.status,
111
- patch: (_c = (_b = (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n")) === null || _b === void 0 ? void 0 : _b.slice(0, MAX_PATCH_LINES)) === null || _c === void 0 ? void 0 : _c.join("\n"),
111
+ patch: (_a = f.patch) === null || _a === void 0 ? void 0 : _a.split("\n").slice(0, MAX_PATCH_LINES).join("\n"),
112
112
  });
113
113
  })
114
114
  : undefined;
115
115
  return {
116
116
  number: item.number,
117
117
  title: item.title,
118
- url: item.html_url,
118
+ html_url: item.html_url,
119
119
  state: item.state,
120
120
  isPullRequest: isPR,
121
121
  body: item.body,
@@ -0,0 +1,3 @@
1
+ import type { jiraUpdateServiceDeskRequestFunction } from "../../autogen/types.js";
2
+ declare const updateServiceDeskRequest: jiraUpdateServiceDeskRequestFunction;
3
+ export default updateServiceDeskRequest;
@@ -0,0 +1,72 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { axiosClient } from "../../util/axiosClient.js";
11
+ const updateServiceDeskRequest = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
12
+ const { issueId, requestTypeId, summary, description, priority, customFields } = params;
13
+ const { authToken, cloudId, baseUrl } = authParams;
14
+ if (!cloudId || !authToken) {
15
+ throw new Error("Valid Cloud ID and auth token are required to update service desk request");
16
+ }
17
+ // Use the regular Jira API for updating service desk requests as they are still Jira issues
18
+ const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${issueId}`;
19
+ const formattedDescription = description
20
+ ? {
21
+ type: "doc",
22
+ version: 1,
23
+ content: [
24
+ {
25
+ type: "paragraph",
26
+ content: [
27
+ {
28
+ type: "text",
29
+ text: description,
30
+ },
31
+ ],
32
+ },
33
+ ],
34
+ }
35
+ : undefined;
36
+ const payload = {
37
+ fields: Object.assign(Object.assign(Object.assign(Object.assign({}, (summary && { summary })), (formattedDescription && { description: formattedDescription })), (priority && { priority: { name: priority } })), (customFields && Object.assign({}, customFields))),
38
+ };
39
+ try {
40
+ yield axiosClient.put(apiUrl, payload, {
41
+ headers: {
42
+ Authorization: `Bearer ${authToken}`,
43
+ Accept: "application/json",
44
+ "Content-Type": "application/json",
45
+ },
46
+ });
47
+ // Get the updated issue details to return current status and web link
48
+ const getResponse = yield axiosClient.get(apiUrl, {
49
+ headers: {
50
+ Authorization: `Bearer ${authToken}`,
51
+ Accept: "application/json",
52
+ },
53
+ });
54
+ const issueKey = getResponse.data.key;
55
+ const currentStatus = getResponse.data.fields.status.name;
56
+ const webLink = `${baseUrl}/browse/${issueKey}`;
57
+ return {
58
+ success: true,
59
+ issueKey,
60
+ webLink,
61
+ currentStatus,
62
+ };
63
+ }
64
+ catch (error) {
65
+ console.error("Error updating service desk request:", error);
66
+ return {
67
+ success: false,
68
+ error: error instanceof Error ? error.message : "Unknown error",
69
+ };
70
+ }
71
+ });
72
+ export default updateServiceDeskRequest;
@@ -0,0 +1,3 @@
1
+ import type { microsoftSendOutlookEmailFunction } from "../../autogen/types.js";
2
+ declare const sendEmail: microsoftSendOutlookEmailFunction;
3
+ export default sendEmail;
@@ -0,0 +1,48 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { getGraphClient } from "./utils.js";
11
+ const sendEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
12
+ const { toRecipients, subject, body, ccRecipients, bccRecipients } = params;
13
+ let client = undefined;
14
+ try {
15
+ client = yield getGraphClient(authParams);
16
+ }
17
+ catch (error) {
18
+ return {
19
+ success: false,
20
+ error: "Error while authorizing: " + (error instanceof Error ? error.message : "Unknown error"),
21
+ };
22
+ }
23
+ try {
24
+ const message = {
25
+ message: Object.assign(Object.assign({ subject, body: {
26
+ contentType: "HTML",
27
+ content: body,
28
+ }, toRecipients: toRecipients.map(email => ({ emailAddress: { address: email } })) }, (ccRecipients && ccRecipients.length > 0
29
+ ? { ccRecipients: ccRecipients.map(email => ({ emailAddress: { address: email } })) }
30
+ : {})), (bccRecipients && bccRecipients.length > 0
31
+ ? { bccRecipients: bccRecipients.map(email => ({ emailAddress: { address: email } })) }
32
+ : {})),
33
+ saveToSentItems: true,
34
+ };
35
+ yield client.api("/me/sendMail").post(message);
36
+ return {
37
+ success: true,
38
+ };
39
+ }
40
+ catch (error) {
41
+ console.error(error);
42
+ return {
43
+ success: false,
44
+ error: "Error sending email: " + (error instanceof Error ? error.message : "Unknown error"),
45
+ };
46
+ }
47
+ });
48
+ export default sendEmail;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.193",
3
+ "version": "0.2.195",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,
@@ -1,6 +0,0 @@
1
- import type { ActionTemplate } from "./parse.js";
2
- export type ActionGroups = Record<string, {
3
- description: string;
4
- actions: ActionTemplate[];
5
- }>;
6
- export declare const ACTION_GROUPS: ActionGroups;
@@ -1,248 +0,0 @@
1
- import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
2
- export const ACTION_GROUPS = {
3
- GENERIC: {
4
- description: "Generic utility actions",
5
- actions: [genericFillTemplateDefinition],
6
- },
7
- ASANA: {
8
- description: "Actions for interacting with Asana",
9
- actions: [
10
- asanaCommentTaskDefinition,
11
- asanaCreateTaskDefinition,
12
- asanaUpdateTaskDefinition,
13
- asanaSearchTasksDefinition,
14
- asanaListAsanaTasksByProjectDefinition,
15
- asanaGetTasksDetailsDefinition,
16
- ],
17
- },
18
- SLACK_LIST_CONVERSATIONS: {
19
- description: "Actions for interacting with Slack",
20
- actions: [
21
- slackSendMessageDefinition,
22
- slackGetChannelMessagesDefinition,
23
- slackCreateChannelDefinition,
24
- slackArchiveChannelDefinition,
25
- ],
26
- },
27
- CONFLUENCE: {
28
- description: "Action for interacting with Confluence",
29
- actions: [confluenceOverwritePageDefinition, confluenceFetchPageContentDefinition],
30
- },
31
- MATH_ADD: {
32
- description: "Action for adding two numbers",
33
- actions: [mathAddDefinition],
34
- },
35
- GOOGLE_MAPS: {
36
- description: "Action for interacting with Google Maps",
37
- actions: [googlemapsValidateAddressDefinition, googlemapsNearbysearchRestaurantsDefinition],
38
- },
39
- GOOGLE_DRIVE: {
40
- description: "Action for interacting with Google Drive",
41
- actions: [
42
- googleOauthCreateNewGoogleDocDefinition,
43
- googleOauthUpdateDocDefinition,
44
- googleOauthCreateSpreadsheetDefinition,
45
- googleOauthUpdateSpreadsheetDefinition,
46
- googleOauthCreatePresentationDefinition,
47
- googleOauthUpdatePresentationDefinition,
48
- googleOauthSearchDriveByKeywordsDefinition,
49
- googleOauthSearchDriveByQueryDefinition,
50
- googleOauthGetDriveFileContentByIdDefinition,
51
- ],
52
- },
53
- GOOGLE_CALENDAR: {
54
- description: "Actions for interacting with Google Calendar",
55
- actions: [
56
- googleOauthScheduleCalendarMeetingDefinition,
57
- googleOauthListCalendarsDefinition,
58
- googleOauthListCalendarEventsDefinition,
59
- googleOauthUpdateCalendarEventDefinition,
60
- googleOauthDeleteCalendarEventDefinition,
61
- ],
62
- },
63
- GMAIL: {
64
- description: "Actions for interacting with Gmail",
65
- actions: [googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition],
66
- },
67
- LINKEDIN_SHARE_POST: {
68
- description: "Action for creating a share post url on linkedin",
69
- actions: [linkedinCreateShareLinkedinPostUrlDefinition],
70
- },
71
- ZENDESK_ACTIONS: {
72
- description: "Actions for interacting with Zendesk",
73
- actions: [
74
- zendeskCreateZendeskTicketDefinition,
75
- zendeskListZendeskTicketsDefinition,
76
- zendeskGetTicketDetailsDefinition,
77
- zendeskUpdateTicketStatusDefinition,
78
- zendeskAddCommentToTicketDefinition,
79
- zendeskAssignTicketDefinition,
80
- ],
81
- },
82
- BING_SEARCH: {
83
- description: "Action for searching Bing",
84
- actions: [bingGetTopNSearchResultUrlsDefinition],
85
- },
86
- MONGO_INSERT_DOC: {
87
- description: "Action for inserting a document into a MongoDB collection",
88
- actions: [mongoInsertMongoDocDefinition],
89
- },
90
- SNOWFLAKE_ACTIONS: {
91
- description: "Action for getting content from a Snowflake table",
92
- actions: [snowflakeGetRowByFieldValueDefinition, snowflakeRunSnowflakeQueryDefinition],
93
- },
94
- JIRA_ACTIONS: {
95
- description: "Action for interacting with Jira tickets",
96
- actions: [
97
- jiraAssignJiraTicketDefinition,
98
- jiraCreateJiraTicketDefinition,
99
- jiraCommentJiraTicketDefinition,
100
- jiraGetJiraTicketDetailsDefinition,
101
- jiraGetJiraTicketHistoryDefinition,
102
- jiraUpdateJiraTicketDetailsDefinition,
103
- jiraUpdateJiraTicketStatusDefinition,
104
- jiraGetJiraIssuesByQueryDefinition,
105
- jiraGetServiceDesksDefinition,
106
- jiraCreateServiceDeskRequestDefinition,
107
- ],
108
- },
109
- JIRA_ORG_ACTIONS: {
110
- description: "Action for interacting with Jira tickets",
111
- actions: [
112
- jiraOrgAssignJiraTicketDefinition,
113
- jiraOrgCreateJiraTicketDefinition,
114
- jiraOrgCommentJiraTicketDefinition,
115
- jiraOrgGetJiraTicketDetailsDefinition,
116
- jiraOrgGetJiraTicketHistoryDefinition,
117
- jiraOrgUpdateJiraTicketDetailsDefinition,
118
- jiraOrgUpdateJiraTicketStatusDefinition,
119
- jiraOrgGetJiraIssuesByQueryDefinition,
120
- ],
121
- },
122
- OPENSTREETMAP_GET_LATITUDE_LONGITUDE_FROM_LOCATION: {
123
- description: "Action for getting the latitude and longitude of a location",
124
- actions: [openstreetmapGetLatitudeLongitudeFromLocationDefinition],
125
- },
126
- NWS_GET_FORECAST_FOR_LOCATION: {
127
- description: "Action for getting the weather forecast for a location",
128
- actions: [nwsGetForecastForLocationDefinition],
129
- },
130
- FIRECRAWL: {
131
- description: "Actions for interacting with Firecrawl",
132
- actions: [
133
- firecrawlScrapeUrlDefinition,
134
- firecrawlScrapeTweetDataWithNitterDefinition,
135
- firecrawlDeepResearchDefinition,
136
- ],
137
- },
138
- RESEND: {
139
- description: "Action for sending an email",
140
- actions: [resendSendEmailDefinition],
141
- },
142
- X: {
143
- description: "Actions for interacting with X(formerly twitter)",
144
- actions: [xCreateShareXPostUrlDefinition],
145
- },
146
- GONG: {
147
- description: "Actions for interacting with Gong",
148
- actions: [gongGetGongTranscriptsDefinition],
149
- },
150
- FINNHUB: {
151
- description: "Action for interacting with Finnhub for stock market data",
152
- actions: [finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition],
153
- },
154
- JAMF: {
155
- description: "Actions for interacting with Jamf",
156
- actions: [
157
- jamfGetJamfComputerInventoryDefinition,
158
- jamfGetJamfFileVaultRecoveryKeyDefinition,
159
- jamfGetJamfUserComputerIdDefinition,
160
- jamfLockJamfComputerByIdDefinition,
161
- ],
162
- },
163
- LOOKER: {
164
- description: "Actions for interacting with Looker",
165
- actions: [lookerEnableUserByEmailDefinition],
166
- },
167
- SALESFORCE: {
168
- description: "Actions for interacting with Salesforce",
169
- actions: [
170
- salesforceUpdateRecordDefinition,
171
- salesforceCreateRecordDefinition,
172
- salesforceCreateCaseDefinition,
173
- salesforceGenerateSalesReportDefinition,
174
- salesforceGetRecordDefinition,
175
- salesforceGetSalesforceRecordsByQueryDefinition,
176
- salesforceFetchSalesforceSchemaByObjectDefinition,
177
- ],
178
- },
179
- MICROSOFT: {
180
- description: "Actions for interacting with Microsoft 365",
181
- actions: [
182
- microsoftMessageTeamsChatDefinition,
183
- microsoftMessageTeamsChannelDefinition,
184
- microsoftUpdateSpreadsheetDefinition,
185
- microsoftUpdateDocumentDefinition,
186
- microsoftCreateDocumentDefinition,
187
- microsoftGetDocumentDefinition,
188
- ],
189
- },
190
- KANDJI: {
191
- description: "Actions for interacting with Kandji",
192
- actions: [kandjiGetFVRecoveryKeyForDeviceDefinition],
193
- },
194
- GITHUB: {
195
- description: "Actions for interacting with GitHub",
196
- actions: [
197
- githubCreateOrUpdateFileDefinition,
198
- githubCreateBranchDefinition,
199
- githubCreatePullRequestDefinition,
200
- githubListPullRequestsDefinition,
201
- ],
202
- },
203
- ASHBY: {
204
- description: "Actions for interacting with Ashby",
205
- actions: [
206
- ashbyCreateNoteDefinition,
207
- ashbyGetCandidateInfoDefinition,
208
- ashbyListCandidatesDefinition,
209
- ashbyListCandidateNotesDefinition,
210
- ashbySearchCandidatesDefinition,
211
- ashbyCreateCandidateDefinition,
212
- ashbyUpdateCandidateDefinition,
213
- ashbyAddCandidateToProjectDefinition,
214
- ],
215
- },
216
- NOTION: {
217
- description: "Actions for interacting with Notion",
218
- actions: [notionSearchByTitleDefinition],
219
- },
220
- GOOGLE_GROUPS: {
221
- description: "Google Workspace Groups management actions",
222
- actions: [
223
- googleOauthListGroupsDefinition,
224
- googleOauthGetGroupDefinition,
225
- googleOauthListGroupMembersDefinition,
226
- googleOauthHasGroupMemberDefinition,
227
- googleOauthAddGroupMemberDefinition,
228
- googleOauthDeleteGroupMemberDefinition,
229
- ],
230
- },
231
- OKTA: {
232
- description: "Actions for interacting with Okta",
233
- actions: [
234
- oktaListOktaUsersDefinition,
235
- oktaGetOktaUserDefinition,
236
- oktaListOktaUserGroupsDefinition,
237
- oktaListOktaGroupsDefinition,
238
- oktaGetOktaGroupDefinition,
239
- oktaListOktaGroupMembersDefinition,
240
- oktaRemoveUserFromGroupDefinition,
241
- oktaAddUserToGroupDefinition,
242
- oktaResetPasswordDefinition,
243
- oktaResetMFADefinition,
244
- oktaListMFADefinition,
245
- oktaTriggerOktaWorkflowDefinition,
246
- ],
247
- },
248
- };
@@ -1,3 +0,0 @@
1
- import type { credalCallCopilotFunction } from "../../autogen/types";
2
- declare const callCopilot: credalCallCopilotFunction;
3
- export default callCopilot;
@@ -1,36 +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 sdk_1 = require("@credal/sdk");
13
- const callCopilot = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
- var _b;
15
- const requestBody = {
16
- agentId: params.agentId,
17
- query: params.query,
18
- userEmail: params.userEmail,
19
- };
20
- const baseUrl = (_b = authParams.baseUrl) !== null && _b !== void 0 ? _b : "https://app.credal.ai/api";
21
- const client = new sdk_1.CredalClient({ environment: baseUrl, apiKey: authParams.apiKey });
22
- const response = yield client.copilots.sendMessage({
23
- agentId: requestBody.agentId,
24
- message: requestBody.query,
25
- userEmail: requestBody.userEmail,
26
- });
27
- return {
28
- response: response.sendChatResult.type === "ai_response_result"
29
- ? response.sendChatResult.response.message
30
- : "Error getting response",
31
- referencedSources: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.referencedSources : [],
32
- sourcesInDataContext: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.sourcesInDataContext : [],
33
- webSearchResults: response.sendChatResult.type === "ai_response_result" ? response.sendChatResult.webSearchResults : [],
34
- };
35
- });
36
- exports.default = callCopilot;
@@ -1 +0,0 @@
1
- export * as add from "./add";
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.add = void 0;
37
- exports.add = __importStar(require("./add"));
@@ -1,3 +0,0 @@
1
- import { salesforceGetSalesforceRecordsByQueryFunction } from "../../autogen/types";
2
- declare const getSalesforceRecordByQuery: salesforceGetSalesforceRecordsByQueryFunction;
3
- export default getSalesforceRecordByQuery;
@@ -1,43 +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 axiosClient_1 = require("../../util/axiosClient");
13
- const getSalesforceRecordByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
- const { authToken, baseUrl } = authParams;
15
- const { query, limit } = params;
16
- if (!authToken || !baseUrl) {
17
- return {
18
- success: false,
19
- error: "authToken and baseUrl are required for Salesforce API",
20
- };
21
- }
22
- // The API limits the maximum number of records returned to 2000, the limit lets the user set a smaller custom limit
23
- const url = `${baseUrl}/services/data/v56.0/query/?q=${encodeURIComponent(query + " LIMIT " + (limit != undefined && limit <= 2000 ? limit : 2000))}`;
24
- try {
25
- const response = yield axiosClient_1.axiosClient.get(url, {
26
- headers: {
27
- Authorization: `Bearer ${authToken}`,
28
- },
29
- });
30
- return {
31
- success: true,
32
- records: response.data,
33
- };
34
- }
35
- catch (error) {
36
- console.error("Error retrieving Salesforce record:", error);
37
- return {
38
- success: false,
39
- error: error instanceof Error ? error.message : "An unknown error occurred",
40
- };
41
- }
42
- });
43
- exports.default = getSalesforceRecordByQuery;
@@ -1,3 +0,0 @@
1
- import type { slackArchiveChannelFunction } from "../../autogen/types.js";
2
- declare const archiveChannel: slackArchiveChannelFunction;
3
- export default archiveChannel;
@@ -1,35 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { WebClient } from "@slack/web-api";
11
- import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const archiveChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
13
- if (!authParams.authToken) {
14
- throw new Error(MISSING_AUTH_TOKEN);
15
- }
16
- try {
17
- const client = new WebClient(authParams.authToken);
18
- const { channelId } = params;
19
- const result = yield client.conversations.archive({ channel: channelId });
20
- if (!result.ok) {
21
- return {
22
- success: false,
23
- error: result.error || "Unknown error archiving channel",
24
- };
25
- }
26
- return { success: true };
27
- }
28
- catch (error) {
29
- return {
30
- success: false,
31
- error: error instanceof Error ? error.message : "Unknown error archiving channel",
32
- };
33
- }
34
- });
35
- export default archiveChannel;
@@ -1 +0,0 @@
1
- export * as listConversations from "./listConversations";
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.listConversations = void 0;
37
- exports.listConversations = __importStar(require("./listConversations"));
@@ -1,3 +0,0 @@
1
- import type { slackListConversationsFunction } from "../../autogen/types";
2
- declare const slackListConversations: slackListConversationsFunction;
3
- export default slackListConversations;
@@ -1,41 +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 web_api_1 = require("@slack/web-api");
13
- const helpers_1 = require("./helpers");
14
- const slackListConversations = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
15
- const client = new web_api_1.WebClient(authParams.authToken);
16
- try {
17
- const allChannels = yield (0, helpers_1.getSlackChannels)(client);
18
- const filteredChannels = [];
19
- for (const channel of allChannels) {
20
- if (channel.name && channel.topic && channel.topic.value && channel.purpose && channel.purpose.value) {
21
- const purpose = channel.purpose.value;
22
- const topic = channel.topic.value;
23
- const name = channel.name;
24
- filteredChannels.push(Object.assign(Object.assign({}, channel), { purpose, topic, name }));
25
- }
26
- }
27
- return {
28
- channels: filteredChannels,
29
- };
30
- }
31
- catch (error) {
32
- if (error instanceof Error) {
33
- // Enhance error with more context
34
- throw new Error(`Failed to list Slack conversations: ${error.message}`);
35
- }
36
- else {
37
- throw error;
38
- }
39
- }
40
- });
41
- exports.default = slackListConversations;