@credal/actions 0.2.0 → 0.2.3

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.
Files changed (127) hide show
  1. package/dist/actions/actionMapper.js +374 -380
  2. package/dist/actions/autogen/templates.js +94 -98
  3. package/dist/actions/autogen/types.d.ts +2 -33
  4. package/dist/actions/autogen/types.js +1621 -1659
  5. package/dist/actions/groups.js +88 -91
  6. package/dist/actions/invoke.js +5 -8
  7. package/dist/actions/parse.js +38 -43
  8. package/dist/actions/providers/asana/commentAsanaTask.js +5 -7
  9. package/dist/actions/providers/asana/createAsanaTask.js +9 -11
  10. package/dist/actions/providers/asana/getTasksDetails.js +9 -11
  11. package/dist/actions/providers/asana/listAsanaTasksByProject.js +46 -51
  12. package/dist/actions/providers/asana/searchAsanaTasks.js +6 -8
  13. package/dist/actions/providers/asana/updateAsanaTask.js +8 -10
  14. package/dist/actions/providers/asana/utils.js +7 -12
  15. package/dist/actions/providers/ashby/addCandidateToProject.js +5 -7
  16. package/dist/actions/providers/ashby/createCandidate.js +5 -7
  17. package/dist/actions/providers/ashby/createNote.js +5 -7
  18. package/dist/actions/providers/ashby/getCandidateInfo.js +5 -7
  19. package/dist/actions/providers/ashby/listCandidateNotes.js +5 -7
  20. package/dist/actions/providers/ashby/listCandidates.js +5 -7
  21. package/dist/actions/providers/ashby/searchCandidates.js +5 -7
  22. package/dist/actions/providers/ashby/updateCandidate.js +5 -7
  23. package/dist/actions/providers/bing/getTopNSearchResultUrls.js +5 -7
  24. package/dist/actions/providers/confluence/fetchPageContent.js +8 -10
  25. package/dist/actions/providers/confluence/helpers.js +1 -4
  26. package/dist/actions/providers/confluence/overwritePage.js +9 -11
  27. package/dist/actions/providers/finnhub/getBasicFinancials.js +6 -8
  28. package/dist/actions/providers/finnhub/symbolLookup.js +6 -8
  29. package/dist/actions/providers/firecrawl/deepResearch.js +5 -10
  30. package/dist/actions/providers/firecrawl/scrapeTweetDataWithNitter.js +5 -10
  31. package/dist/actions/providers/firecrawl/scrapeUrl.js +5 -10
  32. package/dist/actions/providers/generic/fillTemplate.js +1 -3
  33. package/dist/actions/providers/github/createBranch.js +4 -39
  34. package/dist/actions/providers/github/createOrUpdateFile.js +6 -41
  35. package/dist/actions/providers/github/createPullRequest.js +4 -39
  36. package/dist/actions/providers/github/listPullRequests.js +7 -12
  37. package/dist/actions/providers/gong/getGongTranscripts.js +49 -84
  38. package/dist/actions/providers/google-oauth/addGroupMember.js +5 -7
  39. package/dist/actions/providers/google-oauth/createNewGoogleDoc.js +6 -8
  40. package/dist/actions/providers/google-oauth/createPresentation.js +5 -7
  41. package/dist/actions/providers/google-oauth/createSpreadsheet.js +5 -10
  42. package/dist/actions/providers/google-oauth/deleteCalendarEvent.js +5 -7
  43. package/dist/actions/providers/google-oauth/deleteGroupMember.js +5 -7
  44. package/dist/actions/providers/google-oauth/getGroup.js +5 -7
  45. package/dist/actions/providers/google-oauth/hasGroupMember.js +5 -7
  46. package/dist/actions/providers/google-oauth/listCalendarEvents.js +5 -7
  47. package/dist/actions/providers/google-oauth/listCalendars.js +5 -7
  48. package/dist/actions/providers/google-oauth/listGroupMembers.js +5 -7
  49. package/dist/actions/providers/google-oauth/listGroups.js +5 -7
  50. package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +7 -9
  51. package/dist/actions/providers/google-oauth/searchDriveByKeywords.js +5 -7
  52. package/dist/actions/providers/google-oauth/updateCalendarEvent.js +5 -7
  53. package/dist/actions/providers/google-oauth/updateDoc.js +5 -10
  54. package/dist/actions/providers/google-oauth/updatePresentation.js +5 -7
  55. package/dist/actions/providers/google-oauth/updateSpreadsheet.js +5 -7
  56. package/dist/actions/providers/google-oauth/utils/decodeMessage.js +2 -6
  57. package/dist/actions/providers/googlemail/listGmailThreads.js +8 -10
  58. package/dist/actions/providers/googlemail/searchGmailMessages.js +8 -10
  59. package/dist/actions/providers/googlemaps/nearbysearchRestaurants.js +5 -7
  60. package/dist/actions/providers/googlemaps/validateAddress.js +3 -5
  61. package/dist/actions/providers/jamf/getJamfComputerInventory.js +8 -26
  62. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +7 -26
  63. package/dist/actions/providers/jira/assignJiraTicket.js +5 -10
  64. package/dist/actions/providers/jira/commentJiraTicket.js +3 -5
  65. package/dist/actions/providers/jira/createJiraTicket.js +6 -8
  66. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +4 -6
  67. package/dist/actions/providers/jira/getJiraTicketDetails.js +3 -5
  68. package/dist/actions/providers/jira/getJiraTicketHistory.js +3 -5
  69. package/dist/actions/providers/jira/updateJiraTicketDetails.js +3 -5
  70. package/dist/actions/providers/jira/updateJiraTicketStatus.js +4 -6
  71. package/dist/actions/providers/jira/utils.js +3 -6
  72. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +4 -6
  73. package/dist/actions/providers/linkedin/createSharePostLinkedinUrl.js +1 -3
  74. package/dist/actions/providers/looker/enableUserByEmail.js +5 -7
  75. package/dist/actions/providers/math/add.js +1 -3
  76. package/dist/actions/providers/microsoft/createDocument.js +5 -7
  77. package/dist/actions/providers/microsoft/getDocument.js +3 -5
  78. package/dist/actions/providers/microsoft/messageTeamsChannel.js +4 -6
  79. package/dist/actions/providers/microsoft/messageTeamsChat.js +4 -6
  80. package/dist/actions/providers/microsoft/updateDocument.js +4 -6
  81. package/dist/actions/providers/microsoft/updateSpreadsheet.js +4 -6
  82. package/dist/actions/providers/microsoft/utils.js +6 -10
  83. package/dist/actions/providers/mongodb/insertMongoDoc.js +3 -5
  84. package/dist/actions/providers/notion/searchByTitle.js +5 -10
  85. package/dist/actions/providers/nws/getForecastForLocation.js +7 -9
  86. package/dist/actions/providers/openstreetmap/getLatitudeLongitudeFromLocation.js +3 -5
  87. package/dist/actions/providers/resend/sendEmail.js +6 -8
  88. package/dist/actions/providers/salesforce/createCase.js +3 -5
  89. package/dist/actions/providers/salesforce/createRecord.js +4 -6
  90. package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +3 -5
  91. package/dist/actions/providers/salesforce/generateSalesReport.js +3 -5
  92. package/dist/actions/providers/salesforce/getRecord.js +3 -5
  93. package/dist/actions/providers/salesforce/getSalesforceRecordsByQuery.js +4 -6
  94. package/dist/actions/providers/salesforce/updateRecord.js +3 -5
  95. package/dist/actions/providers/slack/getChannelMessages.js +7 -9
  96. package/dist/actions/providers/slack/helpers.js +1 -4
  97. package/dist/actions/providers/slack/sendMessage.js +10 -12
  98. package/dist/actions/providers/snowflake/auth/getSnowflakeConnection.js +4 -41
  99. package/dist/actions/providers/snowflake/getRowByFieldValue.js +3 -5
  100. package/dist/actions/providers/snowflake/runSnowflakeQuery.js +8 -13
  101. package/dist/actions/providers/x/createXSharePostUrl.js +1 -3
  102. package/dist/actions/providers/zendesk/addCommentToTicket.js +5 -7
  103. package/dist/actions/providers/zendesk/assignTicket.js +5 -7
  104. package/dist/actions/providers/zendesk/createZendeskTicket.js +5 -7
  105. package/dist/actions/providers/zendesk/getTicketDetails.js +5 -7
  106. package/dist/actions/providers/zendesk/listTickets.js +5 -7
  107. package/dist/actions/providers/zendesk/updateTicketStatus.js +5 -7
  108. package/dist/actions/util/axiosClient.js +4 -11
  109. package/dist/actions/util/formatDataForCodeInterpreter.js +1 -4
  110. package/dist/actions/util/missingAuthConstants.js +2 -5
  111. package/dist/app.js +5 -42
  112. package/dist/index.js +4 -24
  113. package/dist/server.d.ts +2 -0
  114. package/dist/server.js +8 -0
  115. package/dist/utils/datetime.js +4 -8
  116. package/dist/utils/string.js +1 -4
  117. package/package.json +2 -1
  118. package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
  119. package/dist/actions/providers/confluence/updatePage.js +0 -47
  120. package/dist/actions/providers/credal/callCopilot.d.ts +0 -3
  121. package/dist/actions/providers/credal/callCopilot.js +0 -36
  122. package/dist/actions/providers/math/index.d.ts +0 -1
  123. package/dist/actions/providers/math/index.js +0 -37
  124. package/dist/actions/providers/slack/index.d.ts +0 -1
  125. package/dist/actions/providers/slack/index.js +0 -37
  126. package/dist/actions/providers/slack/listConversations.d.ts +0 -3
  127. package/dist/actions/providers/slack/listConversations.js +0 -41
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const commentJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { authToken, cloudId, baseUrl } = authParams;
15
13
  if (!cloudId || !authToken) {
@@ -17,7 +15,7 @@ const commentJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
17
15
  }
18
16
  const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${params.issueId}/comment`;
19
17
  try {
20
- const response = yield axiosClient_1.axiosClient.post(apiUrl, {
18
+ const response = yield axiosClient.post(apiUrl, {
21
19
  body: {
22
20
  type: "doc",
23
21
  version: 1,
@@ -53,4 +51,4 @@ const commentJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
53
51
  };
54
52
  }
55
53
  });
56
- exports.default = commentJiraTicket;
54
+ export default commentJiraTicket;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,9 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
13
- const utils_1 = require("./utils");
10
+ import { axiosClient } from "../../util/axiosClient";
11
+ import { getUserAccountIdFromEmail } from "./utils";
14
12
  const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { authToken, cloudId, baseUrl } = authParams;
16
14
  const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/`;
@@ -20,12 +18,12 @@ const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
20
18
  // If assignee is an email, look up the account ID
21
19
  let reporterId = null;
22
20
  if (params.reporter && typeof params.reporter === "string" && params.reporter.includes("@") && authToken) {
23
- reporterId = yield (0, utils_1.getUserAccountIdFromEmail)(params.reporter, apiUrl, authToken);
21
+ reporterId = yield getUserAccountIdFromEmail(params.reporter, apiUrl, authToken);
24
22
  }
25
23
  // If assignee is an email, look up the account ID
26
24
  let assigneeId = null;
27
25
  if (params.assignee && typeof params.assignee === "string" && params.assignee.includes("@") && authToken) {
28
- assigneeId = yield (0, utils_1.getUserAccountIdFromEmail)(params.assignee, apiUrl, authToken);
26
+ assigneeId = yield getUserAccountIdFromEmail(params.assignee, apiUrl, authToken);
29
27
  }
30
28
  const description = {
31
29
  type: "doc",
@@ -49,7 +47,7 @@ const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
49
47
  name: params.issueType,
50
48
  } }, (reporterId ? { reporter: { id: reporterId } } : {})), (assigneeId ? { assignee: { id: assigneeId } } : {})), (params.customFields ? params.customFields : {})),
51
49
  };
52
- const response = yield axiosClient_1.axiosClient.post(`${apiUrl}/issue`, payload, {
50
+ const response = yield axiosClient.post(`${apiUrl}/issue`, payload, {
53
51
  headers: {
54
52
  Authorization: `Bearer ${authToken}`,
55
53
  Accept: "application/json",
@@ -59,4 +57,4 @@ const createJiraTicket = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pa
59
57
  ticketUrl: `${baseUrl}/browse/${response.data.key}`,
60
58
  };
61
59
  });
62
- exports.default = createJiraTicket;
60
+ export default createJiraTicket;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { ApiError, axiosClient } from "../../util/axiosClient";
13
11
  const DEFAULT_LIMIT = 1000;
14
12
  const getJiraIssuesByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { authToken, cloudId } = authParams;
@@ -42,7 +40,7 @@ const getJiraIssuesByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* (
42
40
  queryParams.set("fields", fields.join(","));
43
41
  const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/search/jql?${queryParams.toString()}`;
44
42
  try {
45
- const response = yield axiosClient_1.axiosClient.get(apiUrl, {
43
+ const response = yield axiosClient.get(apiUrl, {
46
44
  headers: {
47
45
  Authorization: `Bearer ${authToken}`,
48
46
  Accept: "application/json",
@@ -57,7 +55,7 @@ const getJiraIssuesByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* (
57
55
  console.error("Error retrieving Jira issues:", error);
58
56
  return {
59
57
  success: false,
60
- error: error instanceof axiosClient_1.ApiError
58
+ error: error instanceof ApiError
61
59
  ? error.data.length > 0
62
60
  ? error.data[0].message
63
61
  : error.message
@@ -65,4 +63,4 @@ const getJiraIssuesByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* (
65
63
  };
66
64
  }
67
65
  });
68
- exports.default = getJiraIssuesByQuery;
66
+ export default getJiraIssuesByQuery;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const getJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { authToken, cloudId } = authParams;
15
13
  const { issueId } = params;
@@ -18,7 +16,7 @@ const getJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function* (
18
16
  }
19
17
  const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${issueId}`;
20
18
  try {
21
- const response = yield axiosClient_1.axiosClient.get(apiUrl, {
19
+ const response = yield axiosClient.get(apiUrl, {
22
20
  headers: {
23
21
  Authorization: `Bearer ${authToken}`,
24
22
  Accept: "application/json",
@@ -37,4 +35,4 @@ const getJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function* (
37
35
  };
38
36
  }
39
37
  });
40
- exports.default = getJiraTicketDetails;
38
+ export default getJiraTicketDetails;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const getJiraTicketHistory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  var _b;
15
13
  const { authToken, cloudId } = authParams;
@@ -19,7 +17,7 @@ const getJiraTicketHistory = (_a) => __awaiter(void 0, [_a], void 0, function* (
19
17
  }
20
18
  const apiUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${issueId}/changelog`;
21
19
  try {
22
- const response = yield axiosClient_1.axiosClient.get(apiUrl, {
20
+ const response = yield axiosClient.get(apiUrl, {
23
21
  headers: {
24
22
  Authorization: `Bearer ${authToken}`,
25
23
  Accept: "application/json",
@@ -38,4 +36,4 @@ const getJiraTicketHistory = (_a) => __awaiter(void 0, [_a], void 0, function* (
38
36
  };
39
37
  }
40
38
  });
41
- exports.default = getJiraTicketHistory;
39
+ export default getJiraTicketHistory;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const updateJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { authToken, cloudId, baseUrl } = authParams;
15
13
  const { issueId, summary, description, customFields } = params;
@@ -38,7 +36,7 @@ const updateJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function
38
36
  fields: Object.assign(Object.assign(Object.assign({}, (summary && { summary })), (formattedDescription && { description: formattedDescription })), (customFields && Object.assign({}, customFields))),
39
37
  };
40
38
  try {
41
- yield axiosClient_1.axiosClient.put(apiUrl, payload, {
39
+ yield axiosClient.put(apiUrl, payload, {
42
40
  headers: {
43
41
  Authorization: `Bearer ${authToken}`,
44
42
  Accept: "application/json",
@@ -53,4 +51,4 @@ const updateJiraTicketDetails = (_a) => __awaiter(void 0, [_a], void 0, function
53
51
  throw new Error(error instanceof Error ? error.message : "Unknown error");
54
52
  }
55
53
  });
56
- exports.default = updateJiraTicketDetails;
54
+ export default updateJiraTicketDetails;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const updateJiraTicketStatus = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { authToken, cloudId, baseUrl } = authParams;
15
13
  if (!cloudId || !authToken) {
@@ -19,7 +17,7 @@ const updateJiraTicketStatus = (_a) => __awaiter(void 0, [_a], void 0, function*
19
17
  const transitionsUrl = `https://api.atlassian.com/ex/jira/${cloudId}/rest/api/3/issue/${issueId}/transitions`;
20
18
  try {
21
19
  // API takes transition ID, so fetch available transitions the find ID of transition that matches given status name
22
- const transitionsResponse = yield axiosClient_1.axiosClient.get(transitionsUrl, {
20
+ const transitionsResponse = yield axiosClient.get(transitionsUrl, {
23
21
  headers: {
24
22
  Authorization: `Bearer ${authToken}`,
25
23
  Accept: "application/json",
@@ -34,7 +32,7 @@ const updateJiraTicketStatus = (_a) => __awaiter(void 0, [_a], void 0, function*
34
32
  throw new Error(`Status '${status}' not found for this issue. Available statuses: ${transitions.map((t) => t.name).join(", ")}`);
35
33
  }
36
34
  // update status with transition ID
37
- yield axiosClient_1.axiosClient.post(transitionsUrl, { transition: { id: transition.id } }, {
35
+ yield axiosClient.post(transitionsUrl, { transition: { id: transition.id } }, {
38
36
  headers: {
39
37
  Authorization: `Bearer ${authToken}`,
40
38
  Accept: "application/json",
@@ -54,4 +52,4 @@ const updateJiraTicketStatus = (_a) => __awaiter(void 0, [_a], void 0, function*
54
52
  };
55
53
  }
56
54
  });
57
- exports.default = updateJiraTicketStatus;
55
+ export default updateJiraTicketStatus;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,13 +7,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getUserAccountIdFromEmail = getUserAccountIdFromEmail;
13
- const axiosClient_1 = require("../../util/axiosClient");
14
- function getUserAccountIdFromEmail(email, apiUrl, authToken) {
10
+ import { axiosClient } from "../../util/axiosClient";
11
+ export function getUserAccountIdFromEmail(email, apiUrl, authToken) {
15
12
  return __awaiter(this, void 0, void 0, function* () {
16
13
  try {
17
- const response = yield axiosClient_1.axiosClient.get(`${apiUrl}/user/search?query=${encodeURIComponent(email)}`, {
14
+ const response = yield axiosClient.get(`${apiUrl}/user/search?query=${encodeURIComponent(email)}`, {
18
15
  headers: {
19
16
  Authorization: `Bearer ${authToken}`,
20
17
  Accept: "application/json",
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const getFVRecoveryKeyForDevice = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { userEmail, subdomain } = params;
15
13
  const { apiKey } = authParams;
@@ -30,7 +28,7 @@ const getFVRecoveryKeyForDevice = (_a) => __awaiter(void 0, [_a], void 0, functi
30
28
  };
31
29
  }
32
30
  // Then get the FV recovery key for that device
33
- const fvRecoveryKey = yield axiosClient_1.axiosClient.get(`https://${subdomain}.api.kandji.io/api/v1/devices/${device.device_id}/secrets/filevaultkey`, {
31
+ const fvRecoveryKey = yield axiosClient.get(`https://${subdomain}.api.kandji.io/api/v1/devices/${device.device_id}/secrets/filevaultkey`, {
34
32
  headers: {
35
33
  "Content-Type": "application/json",
36
34
  Authorization: `Bearer ${apiKey}`,
@@ -63,7 +61,7 @@ function getDeviceByEmail(input) {
63
61
  // Update params
64
62
  const params = { limit, offset };
65
63
  const endpoint = `https://${subdomain}.api.kandji.io/api/v1/devices`;
66
- const response = yield axiosClient_1.axiosClient.get(endpoint, {
64
+ const response = yield axiosClient.get(endpoint, {
67
65
  params: Object.assign({}, params),
68
66
  headers: {
69
67
  "Content-Type": "application/json",
@@ -84,4 +82,4 @@ function getDeviceByEmail(input) {
84
82
  return null;
85
83
  });
86
84
  }
87
- exports.default = getFVRecoveryKeyForDevice;
85
+ export default getFVRecoveryKeyForDevice;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const createShareLinkedinPostUrl = ({ params, }) => {
4
2
  const baseUrl = "https://www.linkedin.com/feed/?shareActive=true";
5
3
  let shareUrl = baseUrl;
@@ -17,4 +15,4 @@ const createShareLinkedinPostUrl = ({ params, }) => {
17
15
  linkedinUrl: shareUrl,
18
16
  });
19
17
  };
20
- exports.default = createShareLinkedinPostUrl;
18
+ export default createShareLinkedinPostUrl;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,8 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const axiosClient_1 = require("../../util/axiosClient");
10
+ import { axiosClient } from "../../util/axiosClient";
13
11
  const enableUserByEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { userEmail } = params;
15
13
  const { baseUrl, clientId, clientSecret, authToken } = authParams;
@@ -27,7 +25,7 @@ const enableUserByEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
27
25
  try {
28
26
  // Use client_id and client_secret as URL query parameters
29
27
  const loginUrl = `${baseUrl}/api/4.0/login?client_id=${encodeURIComponent(clientId)}&client_secret=${encodeURIComponent(clientSecret)}`;
30
- const loginResponse = yield axiosClient_1.axiosClient.post(loginUrl, {});
28
+ const loginResponse = yield axiosClient.post(loginUrl, {});
31
29
  accessToken = loginResponse.data.access_token;
32
30
  if (!accessToken) {
33
31
  throw new Error("Failed to obtain authentication token from Looker API");
@@ -49,7 +47,7 @@ const enableUserByEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
49
47
  // Step 2: Search for the user by email
50
48
  const searchUrl = `${baseUrl}/api/4.0/users/search?email=${encodeURIComponent(userEmail)}`;
51
49
  console.log("Searching for user:", searchUrl);
52
- const searchResponse = yield axiosClient_1.axiosClient.get(searchUrl, { headers });
50
+ const searchResponse = yield axiosClient.get(searchUrl, { headers });
53
51
  console.log("Search response:", searchResponse.data);
54
52
  const users = searchResponse.data;
55
53
  if (!users || users.length === 0) {
@@ -77,7 +75,7 @@ const enableUserByEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
77
75
  // Step 4: Enable the user (no confirmation check, automatically enable)
78
76
  const updateUrl = `${baseUrl}/api/4.0/users/${user.id}`;
79
77
  console.log("Enabling user:", updateUrl);
80
- const updateResponse = yield axiosClient_1.axiosClient.patch(updateUrl, {
78
+ const updateResponse = yield axiosClient.patch(updateUrl, {
81
79
  is_disabled: false,
82
80
  }, { headers });
83
81
  console.log("Update response:", updateResponse.data);
@@ -103,4 +101,4 @@ const enableUserByEmail = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
103
101
  };
104
102
  }
105
103
  });
106
- exports.default = enableUserByEmail;
104
+ export default enableUserByEmail;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,10 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
10
  const mathAdd = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params }) {
13
11
  return {
14
12
  result: params.a + params.b,
15
13
  };
16
14
  });
17
- exports.default = mathAdd;
15
+ export default mathAdd;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const templates_1 = require("../../autogen/templates");
13
- const utils_1 = require("./utils");
10
+ import { microsoftCreateDocumentDefinition } from "../../autogen/templates";
11
+ import { getGraphClient, validateAndSanitizeFileName } from "./utils";
14
12
  const createDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { folderId, name, content, siteId } = params;
16
14
  let client = undefined;
17
15
  try {
18
- client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftCreateDocumentDefinition.scopes.join(" "));
16
+ client = yield getGraphClient(authParams, microsoftCreateDocumentDefinition.scopes.join(" "));
19
17
  }
20
18
  catch (error) {
21
19
  return {
@@ -24,7 +22,7 @@ const createDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
24
22
  };
25
23
  }
26
24
  const apiEndpointPrefix = siteId ? `/sites/${siteId}` : "/me";
27
- const sanitizedFileName = (0, utils_1.validateAndSanitizeFileName)(name);
25
+ const sanitizedFileName = validateAndSanitizeFileName(name);
28
26
  const endpoint = `${apiEndpointPrefix}/drive/items/${folderId || "root"}:/${sanitizedFileName}:/content`;
29
27
  try {
30
28
  // Create or update the document
@@ -44,4 +42,4 @@ const createDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
44
42
  };
45
43
  }
46
44
  });
47
- exports.default = createDocument;
45
+ export default createDocument;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,13 +7,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const utils_1 = require("./utils");
10
+ import { getGraphClient } from "./utils";
13
11
  const getDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { siteId, documentId } = params;
15
13
  let client;
16
14
  try {
17
- client = yield (0, utils_1.getGraphClient)(authParams, "Files.ReadWrite Sites.ReadWrite.All");
15
+ client = yield getGraphClient(authParams, "Files.ReadWrite Sites.ReadWrite.All");
18
16
  }
19
17
  catch (error) {
20
18
  return {
@@ -42,4 +40,4 @@ const getDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
42
40
  };
43
41
  }
44
42
  });
45
- exports.default = getDocument;
43
+ export default getDocument;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const templates_1 = require("../../autogen/templates");
13
- const utils_1 = require("./utils");
10
+ import { microsoftMessageTeamsChannelDefinition } from "../../autogen/templates";
11
+ import { getGraphClient } from "./utils";
14
12
  const sendMessageToTeamsChannel = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { channelId, teamId, message } = params;
16
14
  let client = undefined;
17
15
  try {
18
- client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftMessageTeamsChannelDefinition.scopes.join(" "));
16
+ client = yield getGraphClient(authParams, microsoftMessageTeamsChannelDefinition.scopes.join(" "));
19
17
  }
20
18
  catch (error) {
21
19
  return {
@@ -42,4 +40,4 @@ const sendMessageToTeamsChannel = (_a) => __awaiter(void 0, [_a], void 0, functi
42
40
  };
43
41
  }
44
42
  });
45
- exports.default = sendMessageToTeamsChannel;
43
+ export default sendMessageToTeamsChannel;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const templates_1 = require("../../autogen/templates");
13
- const utils_1 = require("./utils");
10
+ import { microsoftMessageTeamsChatDefinition } from "../../autogen/templates";
11
+ import { getGraphClient } from "./utils";
14
12
  const sendMessageToTeamsChat = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { chatId, message } = params;
16
14
  let client = undefined;
17
15
  try {
18
- client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftMessageTeamsChatDefinition.scopes.join(" "));
16
+ client = yield getGraphClient(authParams, microsoftMessageTeamsChatDefinition.scopes.join(" "));
19
17
  }
20
18
  catch (error) {
21
19
  return {
@@ -42,4 +40,4 @@ const sendMessageToTeamsChat = (_a) => __awaiter(void 0, [_a], void 0, function*
42
40
  };
43
41
  }
44
42
  });
45
- exports.default = sendMessageToTeamsChat;
43
+ export default sendMessageToTeamsChat;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const templates_1 = require("../../autogen/templates");
13
- const utils_1 = require("./utils");
10
+ import { microsoftUpdateDocumentDefinition } from "../../autogen/templates";
11
+ import { getGraphClient } from "./utils";
14
12
  const updateDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { documentId, content, siteId } = params;
16
14
  let client = undefined;
17
15
  try {
18
- client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftUpdateDocumentDefinition.scopes.join(" "));
16
+ client = yield getGraphClient(authParams, microsoftUpdateDocumentDefinition.scopes.join(" "));
19
17
  }
20
18
  catch (error) {
21
19
  return {
@@ -42,4 +40,4 @@ const updateDocument = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
42
40
  };
43
41
  }
44
42
  });
45
- exports.default = updateDocument;
43
+ export default updateDocument;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const templates_1 = require("../../autogen/templates");
13
- const utils_1 = require("./utils");
10
+ import { microsoftUpdateSpreadsheetDefinition } from "../../autogen/templates";
11
+ import { getGraphClient } from "./utils";
14
12
  const updateSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
15
13
  const { spreadsheetId, range, values, siteId } = params; // Added siteId to destructured params
16
14
  let client = undefined;
17
15
  try {
18
- client = yield (0, utils_1.getGraphClient)(authParams, templates_1.microsoftUpdateSpreadsheetDefinition.scopes.join(" "));
16
+ client = yield getGraphClient(authParams, microsoftUpdateSpreadsheetDefinition.scopes.join(" "));
19
17
  }
20
18
  catch (error) {
21
19
  return {
@@ -53,4 +51,4 @@ const updateSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
53
51
  };
54
52
  }
55
53
  });
56
- exports.default = updateSpreadsheet;
54
+ export default updateSpreadsheet;
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,12 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.getGraphClient = getGraphClient;
13
- exports.validateAndSanitizeFileName = validateAndSanitizeFileName;
14
- const microsoft_graph_client_1 = require("@microsoft/microsoft-graph-client");
15
- const axiosClient_1 = require("../../util/axiosClient");
16
- function getGraphClient(authParams, scope) {
10
+ import { Client } from "@microsoft/microsoft-graph-client";
11
+ import { axiosClient } from "../../util/axiosClient";
12
+ export function getGraphClient(authParams, scope) {
17
13
  return __awaiter(this, void 0, void 0, function* () {
18
14
  if (!authParams.clientId ||
19
15
  !authParams.clientSecret ||
@@ -31,11 +27,11 @@ function getGraphClient(authParams, scope) {
31
27
  refresh_token: authParams.refreshToken,
32
28
  redirect_uri: authParams.redirectUri,
33
29
  });
34
- const response = yield axiosClient_1.axiosClient.post(url, params, {
30
+ const response = yield axiosClient.post(url, params, {
35
31
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
36
32
  });
37
33
  const accessToken = response.data.access_token;
38
- return microsoft_graph_client_1.Client.init({
34
+ return Client.init({
39
35
  authProvider: done => {
40
36
  done(null, accessToken);
41
37
  },
@@ -47,7 +43,7 @@ function getGraphClient(authParams, scope) {
47
43
  * @param fileName The original filename to validate and sanitize.
48
44
  * @returns A sanitized filename that is safe to use.
49
45
  */
50
- function validateAndSanitizeFileName(fileName) {
46
+ export function validateAndSanitizeFileName(fileName) {
51
47
  // Define invalid characters for SharePoint and OneDrive
52
48
  const invalidCharacters = /[~"#%&*:<>?/{|}\\]/g;
53
49
  // Replace invalid characters with an underscore
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
2
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
3
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -8,14 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
8
  });
10
9
  };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const mongodb_1 = require("mongodb");
10
+ import { MongoClient } from "mongodb";
13
11
  const insertMongoDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
12
  const { baseUrl } = authParams;
15
13
  const { collectionName, databaseName, document } = params;
16
14
  if (!baseUrl)
17
15
  throw new Error("baseUrl is required to connect to the mongodb cluster");
18
- const client = new mongodb_1.MongoClient(baseUrl);
16
+ const client = new MongoClient(baseUrl);
19
17
  try {
20
18
  yield client.connect();
21
19
  console.log("Connected successfully to MongoDB");
@@ -33,4 +31,4 @@ const insertMongoDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
33
31
  yield client.close();
34
32
  }
35
33
  });
36
- exports.default = insertMongoDoc;
34
+ export default insertMongoDoc;