@credal/actions 0.2.196 → 0.2.198

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 (216) hide show
  1. package/dist/actions/autogen/templates.js +8 -12
  2. package/dist/actions/autogen/types.js +26 -8
  3. package/dist/actions/groups.d.ts +6 -0
  4. package/dist/actions/groups.js +251 -0
  5. package/dist/actions/invoke.js +11 -22
  6. package/dist/actions/parse.js +231 -244
  7. package/dist/actions/providers/asana/commentAsanaTask.js +8 -15
  8. package/dist/actions/providers/asana/createAsanaTask.js +20 -21
  9. package/dist/actions/providers/asana/getTasksDetails.js +18 -34
  10. package/dist/actions/providers/asana/listAsanaTasksByProject.js +62 -79
  11. package/dist/actions/providers/asana/searchAsanaTasks.js +6 -16
  12. package/dist/actions/providers/asana/updateAsanaTask.js +16 -15
  13. package/dist/actions/providers/asana/utils.js +47 -64
  14. package/dist/actions/providers/ashby/addCandidateToProject.d.ts +3 -0
  15. package/dist/actions/providers/ashby/addCandidateToProject.js +31 -0
  16. package/dist/actions/providers/ashby/createCandidate.d.ts +3 -0
  17. package/dist/actions/providers/ashby/createCandidate.js +38 -0
  18. package/dist/actions/providers/ashby/createNote.d.ts +3 -0
  19. package/dist/actions/providers/ashby/createNote.js +31 -0
  20. package/dist/actions/providers/ashby/getCandidateInfo.d.ts +3 -0
  21. package/dist/actions/providers/ashby/getCandidateInfo.js +33 -0
  22. package/dist/actions/providers/ashby/listCandidateNotes.d.ts +3 -0
  23. package/dist/actions/providers/ashby/listCandidateNotes.js +33 -0
  24. package/dist/actions/providers/ashby/listCandidates.d.ts +3 -0
  25. package/dist/actions/providers/ashby/listCandidates.js +30 -0
  26. package/dist/actions/providers/ashby/searchCandidates.d.ts +3 -0
  27. package/dist/actions/providers/ashby/searchCandidates.js +34 -0
  28. package/dist/actions/providers/ashby/updateCandidate.d.ts +3 -0
  29. package/dist/actions/providers/ashby/updateCandidate.js +56 -0
  30. package/dist/actions/providers/bing/getTopNSearchResultUrls.js +4 -14
  31. package/dist/actions/providers/confluence/fetchPageContent.js +5 -15
  32. package/dist/actions/providers/confluence/overwritePage.js +5 -14
  33. package/dist/actions/providers/finnhub/getBasicFinancials.js +7 -19
  34. package/dist/actions/providers/finnhub/symbolLookup.js +3 -12
  35. package/dist/actions/providers/firecrawl/deepResearch.js +11 -21
  36. package/dist/actions/providers/firecrawl/getTopNSearchResultUrls.js +8 -21
  37. package/dist/actions/providers/firecrawl/scrapeTweetDataWithNitter.js +4 -13
  38. package/dist/actions/providers/firecrawl/scrapeUrl.js +16 -21
  39. package/dist/actions/providers/firecrawl/searchAndScrape.js +6 -17
  40. package/dist/actions/providers/generic/fillTemplate.js +2 -11
  41. package/dist/actions/providers/github/createBranch.js +9 -18
  42. package/dist/actions/providers/github/createOrUpdateFile.js +6 -15
  43. package/dist/actions/providers/github/createPullRequest.js +5 -14
  44. package/dist/actions/providers/github/fetchFile.d.ts +3 -0
  45. package/dist/actions/providers/github/fetchFile.js +131 -0
  46. package/dist/actions/providers/github/getBranch.js +4 -13
  47. package/dist/actions/providers/github/getContents.d.ts +3 -0
  48. package/dist/actions/providers/github/getContents.js +41 -0
  49. package/dist/actions/providers/github/getFileContent.js +6 -16
  50. package/dist/actions/providers/github/getPullRequestDetails.js +39 -18
  51. package/dist/actions/providers/github/listCommits.js +17 -15
  52. package/dist/actions/providers/github/listDirectory.js +13 -25
  53. package/dist/actions/providers/github/listPullRequests.js +4 -13
  54. package/dist/actions/providers/github/searchOrganization.js +29 -49
  55. package/dist/actions/providers/github/utils.js +5 -16
  56. package/dist/actions/providers/gitlab/getFileContent.js +13 -24
  57. package/dist/actions/providers/gitlab/getMergeRequest.js +18 -30
  58. package/dist/actions/providers/gitlab/listDirectory.js +15 -27
  59. package/dist/actions/providers/gitlab/searchGroup.js +45 -52
  60. package/dist/actions/providers/gitlab/utils.js +19 -32
  61. package/dist/actions/providers/gong/getGongTranscripts.d.ts +3 -0
  62. package/dist/actions/providers/gong/getGongTranscripts.js +315 -0
  63. package/dist/actions/providers/google-oauth/addGroupMember.js +3 -12
  64. package/dist/actions/providers/google-oauth/addTextToTopOfDoc.js +3 -12
  65. package/dist/actions/providers/google-oauth/appendRowsToSpreadsheet.js +4 -13
  66. package/dist/actions/providers/google-oauth/createNewGoogleDoc.js +7 -17
  67. package/dist/actions/providers/google-oauth/createPresentation.js +7 -13
  68. package/dist/actions/providers/google-oauth/createSpreadsheet.js +7 -13
  69. package/dist/actions/providers/google-oauth/deleteCalendarEvent.js +3 -12
  70. package/dist/actions/providers/google-oauth/deleteGroupMember.js +3 -12
  71. package/dist/actions/providers/google-oauth/deleteRowFromSpreadsheet.js +3 -12
  72. package/dist/actions/providers/google-oauth/editAGoogleCalendarEvent.js +4 -14
  73. package/dist/actions/providers/google-oauth/getDriveFileContentById.js +23 -33
  74. package/dist/actions/providers/google-oauth/getGroup.js +3 -12
  75. package/dist/actions/providers/google-oauth/getPresentation.js +23 -37
  76. package/dist/actions/providers/google-oauth/hasGroupMember.js +3 -12
  77. package/dist/actions/providers/google-oauth/listCalendarEvents.js +27 -21
  78. package/dist/actions/providers/google-oauth/listCalendars.js +4 -14
  79. package/dist/actions/providers/google-oauth/listGroupMembers.js +4 -13
  80. package/dist/actions/providers/google-oauth/listGroups.js +4 -14
  81. package/dist/actions/providers/google-oauth/queryGoogleBigQuery.js +10 -21
  82. package/dist/actions/providers/google-oauth/scheduleCalendarMeeting.js +11 -14
  83. package/dist/actions/providers/google-oauth/searchDriveByKeywords.js +3 -12
  84. package/dist/actions/providers/google-oauth/searchDriveByKeywordsAndGetFileContent.js +12 -23
  85. package/dist/actions/providers/google-oauth/searchDriveByQuery.js +30 -42
  86. package/dist/actions/providers/google-oauth/searchDriveByQueryAndGetFileContent.js +9 -20
  87. package/dist/actions/providers/google-oauth/updateCalendarEvent.js +3 -12
  88. package/dist/actions/providers/google-oauth/updateDoc.js +3 -12
  89. package/dist/actions/providers/google-oauth/updatePresentation.js +3 -12
  90. package/dist/actions/providers/google-oauth/updateRowsInSpreadsheet.js +4 -13
  91. package/dist/actions/providers/google-oauth/updateSpreadsheet.js +3 -12
  92. package/dist/actions/providers/google-oauth/utils/decodeMessage.js +7 -8
  93. package/dist/actions/providers/googleSearch/customSearch.js +18 -36
  94. package/dist/actions/providers/googlemail/listGmailThreads.js +7 -16
  95. package/dist/actions/providers/googlemail/searchGmailMessages.js +10 -20
  96. package/dist/actions/providers/googlemail/sendGmail.js +7 -17
  97. package/dist/actions/providers/googlemaps/nearbysearchRestaurants.js +13 -25
  98. package/dist/actions/providers/googlemaps/validateAddress.js +3 -12
  99. package/dist/actions/providers/hubspot/getCompanies.js +4 -14
  100. package/dist/actions/providers/hubspot/getCompanyDetails.js +3 -12
  101. package/dist/actions/providers/hubspot/getContactDetails.js +3 -12
  102. package/dist/actions/providers/hubspot/getContacts.js +4 -14
  103. package/dist/actions/providers/hubspot/getDealDetails.js +3 -12
  104. package/dist/actions/providers/hubspot/getDeals.js +3 -12
  105. package/dist/actions/providers/hubspot/getTicketDetails.js +3 -12
  106. package/dist/actions/providers/hubspot/getTickets.js +3 -12
  107. package/dist/actions/providers/jamf/getJamfComputerInventory.d.ts +3 -0
  108. package/dist/actions/providers/jamf/getJamfComputerInventory.js +37 -0
  109. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.d.ts +3 -0
  110. package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +39 -0
  111. package/dist/actions/providers/jamf/getJamfUserComputerId.d.ts +3 -0
  112. package/dist/actions/providers/jamf/getJamfUserComputerId.js +45 -0
  113. package/dist/actions/providers/jamf/lockJamfComputerById.d.ts +3 -0
  114. package/dist/actions/providers/jamf/lockJamfComputerById.js +39 -0
  115. package/dist/actions/providers/jira/assignJiraTicket.js +4 -13
  116. package/dist/actions/providers/jira/commentJiraTicket.js +3 -12
  117. package/dist/actions/providers/jira/createJiraTicket.js +22 -18
  118. package/dist/actions/providers/jira/createServiceDeskRequest.js +3 -12
  119. package/dist/actions/providers/jira/getJiraDCIssuesByQuery.js +5 -14
  120. package/dist/actions/providers/jira/getJiraIssuesByQuery.js +19 -29
  121. package/dist/actions/providers/jira/getJiraTicketDetails.js +3 -12
  122. package/dist/actions/providers/jira/getJiraTicketHistory.js +3 -12
  123. package/dist/actions/providers/jira/moveJiraTicketToProject.js +11 -21
  124. package/dist/actions/providers/jira/publicCommentOnServiceDeskRequest.js +3 -12
  125. package/dist/actions/providers/jira/updateJiraTicketDetails.js +15 -15
  126. package/dist/actions/providers/jira/updateJiraTicketStatus.js +4 -13
  127. package/dist/actions/providers/jira/utils.js +104 -126
  128. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.d.ts +3 -0
  129. package/dist/actions/providers/kandji/getFVRecoveryKeyForDevice.js +85 -0
  130. package/dist/actions/providers/linear/getIssueDetails.js +10 -20
  131. package/dist/actions/providers/linear/getIssues.js +11 -21
  132. package/dist/actions/providers/linear/getProjectDetails.js +10 -20
  133. package/dist/actions/providers/linear/getProjects.js +6 -16
  134. package/dist/actions/providers/linear/getTeamDetails.js +7 -17
  135. package/dist/actions/providers/linear/getTeams.js +5 -15
  136. package/dist/actions/providers/looker/enableUserByEmail.js +5 -14
  137. package/dist/actions/providers/math/add.js +2 -11
  138. package/dist/actions/providers/microsoft/createDocument.js +4 -13
  139. package/dist/actions/providers/microsoft/getDocument.js +4 -13
  140. package/dist/actions/providers/microsoft/messageTeamsChannel.js +4 -13
  141. package/dist/actions/providers/microsoft/messageTeamsChat.js +4 -13
  142. package/dist/actions/providers/microsoft/updateDocument.js +4 -13
  143. package/dist/actions/providers/microsoft/updateSpreadsheet.js +4 -13
  144. package/dist/actions/providers/microsoft/utils.js +9 -20
  145. package/dist/actions/providers/mongodb/insertMongoDoc.js +5 -14
  146. package/dist/actions/providers/notion/searchByTitle.js +3 -12
  147. package/dist/actions/providers/nws/getForecastForLocation.js +4 -13
  148. package/dist/actions/providers/okta/addUserToGroup.d.ts +3 -0
  149. package/dist/actions/providers/okta/addUserToGroup.js +56 -0
  150. package/dist/actions/providers/okta/getOktaGroup.d.ts +3 -0
  151. package/dist/actions/providers/okta/getOktaGroup.js +73 -0
  152. package/dist/actions/providers/okta/getOktaUser.d.ts +3 -0
  153. package/dist/actions/providers/okta/getOktaUser.js +40 -0
  154. package/dist/actions/providers/okta/listMFA.d.ts +3 -0
  155. package/dist/actions/providers/okta/listMFA.js +52 -0
  156. package/dist/actions/providers/okta/listOktaGroupMembers.d.ts +3 -0
  157. package/dist/actions/providers/okta/listOktaGroupMembers.js +99 -0
  158. package/dist/actions/providers/okta/listOktaGroups.d.ts +3 -0
  159. package/dist/actions/providers/okta/listOktaGroups.js +92 -0
  160. package/dist/actions/providers/okta/listOktaUserGroups.d.ts +3 -0
  161. package/dist/actions/providers/okta/listOktaUserGroups.js +83 -0
  162. package/dist/actions/providers/okta/listOktaUsers.d.ts +3 -0
  163. package/dist/actions/providers/okta/listOktaUsers.js +100 -0
  164. package/dist/actions/providers/okta/removeUserFromGroup.d.ts +3 -0
  165. package/dist/actions/providers/okta/removeUserFromGroup.js +56 -0
  166. package/dist/actions/providers/okta/resetMFA.d.ts +3 -0
  167. package/dist/actions/providers/okta/resetMFA.js +62 -0
  168. package/dist/actions/providers/okta/resetPassword.d.ts +3 -0
  169. package/dist/actions/providers/okta/resetPassword.js +57 -0
  170. package/dist/actions/providers/okta/triggerOktaWorkflow.d.ts +3 -0
  171. package/dist/actions/providers/okta/triggerOktaWorkflow.js +44 -0
  172. package/dist/actions/providers/oktaOrg/getOktaUserByName.js +3 -12
  173. package/dist/actions/providers/openstreetmap/getLatitudeLongitudeFromLocation.js +3 -12
  174. package/dist/actions/providers/perplexity/perplexityDeepResearch.js +11 -21
  175. package/dist/actions/providers/resend/sendEmail.js +3 -12
  176. package/dist/actions/providers/resend/sendEmailHtml.js +3 -12
  177. package/dist/actions/providers/salesforce/createCase.js +10 -13
  178. package/dist/actions/providers/salesforce/createRecord.js +3 -12
  179. package/dist/actions/providers/salesforce/executeReport.js +3 -12
  180. package/dist/actions/providers/salesforce/fetchSalesforceSchema.d.ts +3 -0
  181. package/dist/actions/providers/salesforce/fetchSalesforceSchema.js +40 -0
  182. package/dist/actions/providers/salesforce/generateSalesReport.js +3 -12
  183. package/dist/actions/providers/salesforce/getRecord.js +3 -12
  184. package/dist/actions/providers/salesforce/getReportMetadata.js +11 -21
  185. package/dist/actions/providers/salesforce/getSalesforceRecordsByQuery.js +7 -17
  186. package/dist/actions/providers/salesforce/listReports.js +3 -12
  187. package/dist/actions/providers/salesforce/searchAllSalesforceRecords.js +3 -12
  188. package/dist/actions/providers/salesforce/searchSalesforceRecords.js +3 -12
  189. package/dist/actions/providers/salesforce/updateRecord.js +3 -12
  190. package/dist/actions/providers/slack/archiveChannel.d.ts +3 -0
  191. package/dist/actions/providers/slack/archiveChannel.js +42 -0
  192. package/dist/actions/providers/slack/createChannel.js +7 -17
  193. package/dist/actions/providers/slack/getChannelMembers.js +8 -18
  194. package/dist/actions/providers/slack/getChannelMessages.js +8 -18
  195. package/dist/actions/providers/slack/helpers.js +16 -47
  196. package/dist/actions/providers/slack/messageTransformers.js +10 -13
  197. package/dist/actions/providers/slack/sendDmFromBot.js +9 -19
  198. package/dist/actions/providers/slack/sendMessage.js +7 -17
  199. package/dist/actions/providers/slackUser/searchSlack.js +179 -212
  200. package/dist/actions/providers/slackUser/searchSlackRTS.js +41 -38
  201. package/dist/actions/providers/slackUser/utils.js +1 -1
  202. package/dist/actions/providers/snowflake/auth/getSnowflakeConnection.js +23 -34
  203. package/dist/actions/providers/snowflake/getRowByFieldValue.js +4 -13
  204. package/dist/actions/providers/snowflake/runSnowflakeQuery.js +9 -19
  205. package/dist/actions/providers/zendesk/addCommentToTicket.js +5 -14
  206. package/dist/actions/providers/zendesk/assignTicket.js +3 -12
  207. package/dist/actions/providers/zendesk/createZendeskTicket.js +3 -12
  208. package/dist/actions/providers/zendesk/getTicketDetails.js +3 -12
  209. package/dist/actions/providers/zendesk/listTickets.js +3 -12
  210. package/dist/actions/providers/zendesk/searchZendeskByQuery.js +3 -12
  211. package/dist/actions/providers/zendesk/updateTicketStatus.js +3 -12
  212. package/dist/actions/util/axiosClient.js +5 -5
  213. package/dist/app.js +14 -25
  214. package/dist/utils/google.js +122 -143
  215. package/dist/utils/pdf.js +10 -21
  216. package/package.json +10 -9
@@ -1,12 +1,3 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  /**
@@ -44,7 +35,6 @@ function parseHtmlToDocRequests(htmlContent) {
44
35
  * Basic HTML parser that extracts text and formatting
45
36
  */
46
37
  function parseHtmlContent(html) {
47
- var _a;
48
38
  const result = [];
49
39
  // Handle line breaks
50
40
  html = html.replace(/<br\s*\/?>/gi, "\n");
@@ -76,7 +66,7 @@ function parseHtmlContent(html) {
76
66
  delete currentFormatting.underline;
77
67
  }
78
68
  else if (segment.match(/<\s*h[1-6]\s*>/i)) {
79
- const headingLevel = (_a = segment.match(/<\s*h([1-6])\s*>/i)) === null || _a === void 0 ? void 0 : _a[1];
69
+ const headingLevel = segment.match(/<\s*h([1-6])\s*>/i)?.[1];
80
70
  currentFormatting.fontSize = { magnitude: 18 - (parseInt(headingLevel || "1") - 1) * 2, unit: "PT" };
81
71
  currentFormatting.bold = true;
82
72
  }
@@ -89,7 +79,7 @@ function parseHtmlContent(html) {
89
79
  // This is text content
90
80
  result.push({
91
81
  text: segment,
92
- formatting: Object.keys(currentFormatting).length > 0 ? Object.assign({}, currentFormatting) : undefined,
82
+ formatting: Object.keys(currentFormatting).length > 0 ? { ...currentFormatting } : undefined,
93
83
  });
94
84
  }
95
85
  }
@@ -105,14 +95,14 @@ function parseHtmlContent(html) {
105
95
  /**
106
96
  * Creates a new Google Doc document using OAuth authentication
107
97
  */
108
- const createNewGoogleDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
98
+ const createNewGoogleDoc = async ({ params, authParams, }) => {
109
99
  if (!authParams.authToken) {
110
100
  throw new Error(MISSING_AUTH_TOKEN);
111
101
  }
112
102
  const { title, content, usesHtml } = params;
113
103
  const baseApiUrl = "https://docs.googleapis.com/v1/documents";
114
104
  // Create the document with the provided title
115
- const response = yield axiosClient.post(baseApiUrl, { title }, {
105
+ const response = await axiosClient.post(baseApiUrl, { title }, {
116
106
  headers: {
117
107
  Authorization: `Bearer ${authParams.authToken}`,
118
108
  "Content-Type": "application/json",
@@ -124,7 +114,7 @@ const createNewGoogleDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({
124
114
  if (usesHtml) {
125
115
  // Parse HTML content and create requests for rich text formatting
126
116
  const requests = parseHtmlToDocRequests(content);
127
- yield axiosClient.post(`${baseApiUrl}/${documentId}:batchUpdate`, { requests }, {
117
+ await axiosClient.post(`${baseApiUrl}/${documentId}:batchUpdate`, { requests }, {
128
118
  headers: {
129
119
  Authorization: `Bearer ${authParams.authToken}`,
130
120
  "Content-Type": "application/json",
@@ -133,7 +123,7 @@ const createNewGoogleDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({
133
123
  }
134
124
  else {
135
125
  // Add plain text content to the document
136
- yield axiosClient.post(`${baseApiUrl}/${documentId}:batchUpdate`, {
126
+ await axiosClient.post(`${baseApiUrl}/${documentId}:batchUpdate`, {
137
127
  requests: [
138
128
  {
139
129
  insertText: {
@@ -158,5 +148,5 @@ const createNewGoogleDoc = (_a) => __awaiter(void 0, [_a], void 0, function* ({
158
148
  ? `https://docs.google.com/document/d/${response.data.documentId}/edit`
159
149
  : undefined,
160
150
  };
161
- });
151
+ };
162
152
  export default createNewGoogleDoc;
@@ -1,26 +1,20 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  /**
13
4
  * Creates a new Google Slides presentation using OAuth authentication
14
5
  */
15
- const createPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
6
+ const createPresentation = async ({ params, authParams, }) => {
16
7
  if (!authParams.authToken) {
17
8
  throw new Error(MISSING_AUTH_TOKEN);
18
9
  }
19
10
  const { title, pageSize } = params;
20
11
  const baseApiUrl = "https://slides.googleapis.com/v1/presentations";
21
- const requestBody = Object.assign({ title }, (pageSize && { pageSize }));
12
+ const requestBody = {
13
+ title,
14
+ ...(pageSize && { pageSize }),
15
+ };
22
16
  try {
23
- const response = yield axiosClient.post(baseApiUrl, requestBody, {
17
+ const response = await axiosClient.post(baseApiUrl, requestBody, {
24
18
  headers: {
25
19
  Authorization: `Bearer ${authParams.authToken}`,
26
20
  "Content-Type": "application/json",
@@ -47,5 +41,5 @@ const createPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({
47
41
  error: error instanceof Error ? error.message : "Unknown error",
48
42
  };
49
43
  }
50
- });
44
+ };
51
45
  export default createPresentation;
@@ -1,29 +1,23 @@
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
1
  import axios from "axios";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  /**
13
4
  * Creates a new Google Spreadsheet using OAuth authentication
14
5
  */
15
- const createSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
6
+ const createSpreadsheet = async ({ params, authParams, }) => {
16
7
  if (!authParams.authToken) {
17
8
  throw new Error(MISSING_AUTH_TOKEN);
18
9
  }
19
10
  const { title, sheets = [], properties = {} } = params;
20
11
  const baseApiUrl = "https://sheets.googleapis.com/v4/spreadsheets";
21
12
  const requestBody = {
22
- properties: Object.assign({ title }, properties),
13
+ properties: {
14
+ title,
15
+ ...properties,
16
+ },
23
17
  sheets: sheets.map(sheet => ({ properties: sheet })),
24
18
  };
25
19
  try {
26
- const response = yield axios.post(baseApiUrl, requestBody, {
20
+ const response = await axios.post(baseApiUrl, requestBody, {
27
21
  headers: {
28
22
  Authorization: `Bearer ${authParams.authToken}`,
29
23
  },
@@ -54,5 +48,5 @@ const createSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
54
48
  error: error instanceof Error ? error.message : "Unknown error",
55
49
  };
56
50
  }
57
- });
51
+ };
58
52
  export default createSpreadsheet;
@@ -1,22 +1,13 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const deleteCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
3
+ const deleteCalendarEvent = async ({ params, authParams, }) => {
13
4
  if (!authParams.authToken) {
14
5
  return { success: false, error: MISSING_AUTH_TOKEN };
15
6
  }
16
7
  const { calendarId, eventId } = params;
17
8
  const url = `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(calendarId)}/events/${encodeURIComponent(eventId)}`;
18
9
  try {
19
- yield axiosClient.delete(url, {
10
+ await axiosClient.delete(url, {
20
11
  headers: {
21
12
  Authorization: `Bearer ${authParams.authToken}`,
22
13
  },
@@ -29,5 +20,5 @@ const deleteCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, function* ({
29
20
  error: error instanceof Error ? error.message : "Unknown error deleting event",
30
21
  };
31
22
  }
32
- });
23
+ };
33
24
  export default deleteCalendarEvent;
@@ -1,22 +1,13 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const deleteGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
3
+ const deleteGroupMember = async ({ params, authParams, }) => {
13
4
  const { authToken } = authParams;
14
5
  const { groupKey, memberKey } = params;
15
6
  if (!authToken) {
16
7
  return { success: false, error: MISSING_AUTH_TOKEN };
17
8
  }
18
9
  try {
19
- yield axiosClient.delete(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/members/${encodeURIComponent(memberKey)}`, {
10
+ await axiosClient.delete(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/members/${encodeURIComponent(memberKey)}`, {
20
11
  headers: { Authorization: `Bearer ${authToken}` },
21
12
  });
22
13
  return { success: true };
@@ -27,5 +18,5 @@ const deleteGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
27
18
  error: error instanceof Error ? error.message : "Unknown error",
28
19
  };
29
20
  }
30
- });
21
+ };
31
22
  export default deleteGroupMember;
@@ -1,26 +1,17 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  /**
13
4
  * Deletes a row from a Google Spreadsheet using OAuth authentication
14
5
  * https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/batchUpdate
15
6
  */
16
- const deleteRowFromSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
7
+ const deleteRowFromSpreadsheet = async ({ params, authParams, }) => {
17
8
  if (!authParams.authToken) {
18
9
  throw new Error(MISSING_AUTH_TOKEN);
19
10
  }
20
11
  const { spreadsheetId, sheetId, rowIndex } = params;
21
12
  const batchUpdateUrl = `https://sheets.googleapis.com/v4/spreadsheets/${spreadsheetId}:batchUpdate`;
22
13
  try {
23
- yield axiosClient.post(batchUpdateUrl, {
14
+ await axiosClient.post(batchUpdateUrl, {
24
15
  requests: [
25
16
  {
26
17
  deleteDimension: {
@@ -52,5 +43,5 @@ const deleteRowFromSpreadsheet = (_a) => __awaiter(void 0, [_a], void 0, functio
52
43
  error: error instanceof Error ? error.message : "Unknown error",
53
44
  };
54
45
  }
55
- });
46
+ };
56
47
  export default deleteRowFromSpreadsheet;
@@ -1,17 +1,7 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  import { getDayOfWeek } from "../../../utils/datetime.js";
13
- const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
14
- var _b, _c;
4
+ const editAGoogleCalendarEvent = async ({ params, authParams, }) => {
15
5
  if (!authParams.authToken) {
16
6
  return { success: false, error: MISSING_AUTH_TOKEN, eventId: "", eventUrl: "", eventDayOfWeek: "" };
17
7
  }
@@ -43,7 +33,7 @@ const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, functio
43
33
  if (organizer !== undefined)
44
34
  body.organizer = organizer;
45
35
  try {
46
- const res = yield axiosClient.patch(url, body, {
36
+ const res = await axiosClient.patch(url, body, {
47
37
  headers: {
48
38
  Authorization: `Bearer ${authParams.authToken}`,
49
39
  },
@@ -52,7 +42,7 @@ const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, functio
52
42
  // Get the event day of week from the start time (use provided start or fetch from response)
53
43
  const eventDayOfWeek = start
54
44
  ? getDayOfWeek(start)
55
- : getDayOfWeek(((_b = res.data.start) === null || _b === void 0 ? void 0 : _b.dateTime) || ((_c = res.data.start) === null || _c === void 0 ? void 0 : _c.date) || "");
45
+ : getDayOfWeek(res.data.start?.dateTime || res.data.start?.date || "");
56
46
  return {
57
47
  success: true,
58
48
  eventId: id,
@@ -69,5 +59,5 @@ const editAGoogleCalendarEvent = (_a) => __awaiter(void 0, [_a], void 0, functio
69
59
  eventDayOfWeek: "",
70
60
  };
71
61
  }
72
- });
62
+ };
73
63
  export default editAGoogleCalendarEvent;
@@ -1,12 +1,3 @@
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
1
  import { createAxiosClientWithTimeout } from "../../util/axiosClient.js";
11
2
  import mammoth from "mammoth";
12
3
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
@@ -18,36 +9,35 @@ const BASE_WEB_URL = "https://drive.google.com/file/d/";
18
9
  const BASE_API_URL = "https://www.googleapis.com/drive/v3/files/";
19
10
  const NEWLINE_REGEX = /\r?\n+/g;
20
11
  const WHITESPACE_REGEX = / +/g;
21
- const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
22
- var _b, _c, _d, _e;
12
+ const getDriveFileContentById = async ({ params, authParams, }) => {
23
13
  if (!authParams.authToken) {
24
14
  return { success: false, error: MISSING_AUTH_TOKEN };
25
15
  }
26
16
  const headers = { Authorization: `Bearer ${authParams.authToken}` };
27
17
  const { limit: charLimit, fileId } = params;
28
- const timeoutLimit = params.timeoutLimit !== undefined && params.timeoutLimit > 0 ? params.timeoutLimit * 1000 : 15000;
18
+ const timeoutLimit = params.timeoutLimit !== undefined && params.timeoutLimit > 0 ? params.timeoutLimit * 1000 : 15_000;
29
19
  const axiosClient = createAxiosClientWithTimeout(timeoutLimit);
30
20
  // helper to fetch drive metadata with fields we need (incl. shortcut details)
31
- const fetchMeta = (fid) => __awaiter(void 0, void 0, void 0, function* () {
21
+ const fetchMeta = async (fid) => {
32
22
  const metaUrl = `${BASE_API_URL}${encodeURIComponent(fid)}` +
33
23
  `?fields=name,mimeType,size,driveId,parents,` +
34
24
  `shortcutDetails(targetId,targetMimeType)` +
35
25
  `&supportsAllDrives=true`;
36
- const res = yield axiosClient.get(metaUrl, {
26
+ const res = await axiosClient.get(metaUrl, {
37
27
  headers,
38
28
  timeout: timeoutLimit,
39
29
  });
40
30
  return res.data;
41
- });
31
+ };
42
32
  try {
43
33
  // 1) metadata (possibly a shortcut)
44
- let meta = yield fetchMeta(fileId);
34
+ let meta = await fetchMeta(fileId);
45
35
  // 2) resolve shortcut transparently (re-point to target id + mime)
46
- if (meta.mimeType === "application/vnd.google-apps.shortcut" && ((_b = meta.shortcutDetails) === null || _b === void 0 ? void 0 : _b.targetId)) {
47
- meta = yield fetchMeta(meta.shortcutDetails.targetId);
36
+ if (meta.mimeType === "application/vnd.google-apps.shortcut" && meta.shortcutDetails?.targetId) {
37
+ meta = await fetchMeta(meta.shortcutDetails.targetId);
48
38
  }
49
- const fileName = (_c = meta.name) !== null && _c !== void 0 ? _c : "";
50
- const mimeType = (_d = meta.mimeType) !== null && _d !== void 0 ? _d : "";
39
+ const fileName = meta.name ?? "";
40
+ const mimeType = meta.mimeType ?? "";
51
41
  const size = meta.size ? parseInt(meta.size, 10) : undefined;
52
42
  const driveId = meta.driveId;
53
43
  // Check if file is too large (50MB limit for safety)
@@ -60,22 +50,22 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
60
50
  const sharedDriveParam = driveId ? "&supportsAllDrives=true" : "";
61
51
  // Google Docs - use Google Docs API instead of Drive export
62
52
  if (mimeType === "application/vnd.google-apps.document") {
63
- content = yield getGoogleDocContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
53
+ content = await getGoogleDocContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
64
54
  }
65
55
  else if (mimeType === "application/vnd.google-apps.spreadsheet") {
66
- content = yield getGoogleSheetContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
56
+ content = await getGoogleSheetContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
67
57
  }
68
58
  else if (mimeType === "application/vnd.google-apps.presentation") {
69
- content = yield getGoogleSlidesContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
59
+ content = await getGoogleSlidesContent(params.fileId, authParams.authToken, axiosClient, sharedDriveParam);
70
60
  }
71
61
  else if (mimeType === "application/pdf") {
72
62
  const downloadUrl = `${BASE_API_URL}${encodeURIComponent(params.fileId)}?alt=media${sharedDriveParam}`;
73
- const downloadRes = yield axiosClient.get(downloadUrl, {
63
+ const downloadRes = await axiosClient.get(downloadUrl, {
74
64
  headers,
75
65
  responseType: "arraybuffer",
76
66
  });
77
67
  try {
78
- content = yield extractTextFromPdf(downloadRes.data);
68
+ content = await extractTextFromPdf(downloadRes.data);
79
69
  }
80
70
  catch (e) {
81
71
  return {
@@ -87,13 +77,13 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
87
77
  else if (mimeType === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ||
88
78
  mimeType === "application/msword") {
89
79
  const downloadUrl = `${BASE_API_URL}${encodeURIComponent(params.fileId)}?alt=media${sharedDriveParam}`;
90
- const downloadRes = yield axiosClient.get(downloadUrl, {
80
+ const downloadRes = await axiosClient.get(downloadUrl, {
91
81
  headers,
92
82
  responseType: "arraybuffer",
93
83
  });
94
84
  try {
95
- const result = yield mammoth.extractRawText({ buffer: Buffer.from(downloadRes.data) });
96
- content = (_e = result.value) !== null && _e !== void 0 ? _e : "";
85
+ const result = await mammoth.extractRawText({ buffer: Buffer.from(downloadRes.data) });
86
+ content = result.value ?? "";
97
87
  }
98
88
  catch (wordError) {
99
89
  return {
@@ -109,7 +99,7 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
109
99
  mimeType === "application/rtf" ||
110
100
  mimeType === "application/json") {
111
101
  const downloadUrl = `${BASE_API_URL}${encodeURIComponent(params.fileId)}?alt=media${sharedDriveParam}`;
112
- const downloadRes = yield axiosClient.get(downloadUrl, {
102
+ const downloadRes = await axiosClient.get(downloadUrl, {
113
103
  headers,
114
104
  responseType: "text",
115
105
  });
@@ -118,7 +108,7 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
118
108
  else if (mimeType === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ||
119
109
  mimeType === "application/vnd.ms-excel") {
120
110
  const downloadUrl = `${BASE_API_URL}${encodeURIComponent(params.fileId)}?alt=media${sharedDriveParam}`;
121
- const downloadRes = yield axiosClient.get(downloadUrl, {
111
+ const downloadRes = await axiosClient.get(downloadUrl, {
122
112
  headers,
123
113
  responseType: "arraybuffer",
124
114
  });
@@ -142,14 +132,14 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
142
132
  else if (mimeType === "application/vnd.openxmlformats-officedocument.presentationml.presentation") {
143
133
  // Handle modern PowerPoint files (.pptx only)
144
134
  const downloadUrl = `${BASE_API_URL}${encodeURIComponent(params.fileId)}?alt=media${sharedDriveParam}`;
145
- const downloadRes = yield axiosClient.get(downloadUrl, {
135
+ const downloadRes = await axiosClient.get(downloadUrl, {
146
136
  headers,
147
137
  responseType: "arraybuffer",
148
138
  });
149
139
  try {
150
140
  // officeparser expects a Buffer, so convert the ArrayBuffer
151
141
  const buffer = Buffer.from(downloadRes.data);
152
- content = yield officeParser.parseOfficeAsync(buffer);
142
+ content = await officeParser.parseOfficeAsync(buffer);
153
143
  }
154
144
  catch (powerpointError) {
155
145
  return {
@@ -185,5 +175,5 @@ const getDriveFileContentById = (_a) => __awaiter(void 0, [_a], void 0, function
185
175
  error: error instanceof Error ? error.message : "Unknown error",
186
176
  };
187
177
  }
188
- });
178
+ };
189
179
  export default getDriveFileContentById;
@@ -1,22 +1,13 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const getGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
3
+ const getGroup = async ({ params, authParams, }) => {
13
4
  const { authToken } = authParams;
14
5
  const { groupKey } = params;
15
6
  if (!authToken) {
16
7
  return { success: false, group: { id: "", email: "", name: "" }, error: MISSING_AUTH_TOKEN };
17
8
  }
18
9
  try {
19
- const response = yield axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}`, {
10
+ const response = await axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}`, {
20
11
  headers: { Authorization: `Bearer ${authToken}` },
21
12
  });
22
13
  const { id, email, name, description } = response.data;
@@ -37,5 +28,5 @@ const getGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, au
37
28
  error: error instanceof Error ? error.message : "Unknown error",
38
29
  };
39
30
  }
40
- });
31
+ };
41
32
  export default getGroup;
@@ -1,12 +1,3 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
3
  import { z } from "zod";
@@ -81,14 +72,13 @@ const GoogleSlidesResponseSchema = z
81
72
  * Formats text styling information into a concatenated string
82
73
  */
83
74
  const formatStyling = (textStyle) => {
84
- var _a, _b, _c, _d;
85
75
  if (!textStyle)
86
76
  return "";
87
77
  const parts = [];
88
- if (((_a = textStyle.fontSize) === null || _a === void 0 ? void 0 : _a.magnitude) && ((_b = textStyle.fontSize) === null || _b === void 0 ? void 0 : _b.unit)) {
78
+ if (textStyle.fontSize?.magnitude && textStyle.fontSize?.unit) {
89
79
  parts.push(`size: ${textStyle.fontSize.magnitude}${textStyle.fontSize.unit}`);
90
80
  }
91
- if ((_d = (_c = textStyle.foregroundColor) === null || _c === void 0 ? void 0 : _c.opaqueColor) === null || _d === void 0 ? void 0 : _d.rgbColor) {
81
+ if (textStyle.foregroundColor?.opaqueColor?.rgbColor) {
92
82
  const { red = 0, green = 0, blue = 0 } = textStyle.foregroundColor.opaqueColor.rgbColor;
93
83
  const hexColor = "#" +
94
84
  [red, green, blue]
@@ -109,15 +99,14 @@ const formatStyling = (textStyle) => {
109
99
  /**
110
100
  * Gets a Google Slides presentation by ID using OAuth authentication
111
101
  */
112
- const getPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
113
- var _b;
102
+ const getPresentation = async ({ params, authParams, }) => {
114
103
  if (!authParams.authToken) {
115
104
  throw new Error(MISSING_AUTH_TOKEN);
116
105
  }
117
106
  const { presentationId } = params;
118
107
  const baseApiUrl = `https://slides.googleapis.com/v1/presentations/${presentationId}`;
119
108
  try {
120
- const response = yield axiosClient.get(baseApiUrl, {
109
+ const response = await axiosClient.get(baseApiUrl, {
121
110
  headers: {
122
111
  Authorization: `Bearer ${authParams.authToken}`,
123
112
  "Content-Type": "application/json",
@@ -133,27 +122,24 @@ const getPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
133
122
  const parsedData = GoogleSlidesResponseSchema.parse(response.data);
134
123
  const presentation = {
135
124
  title: parsedData.title,
136
- slides: ((_b = parsedData.slides) === null || _b === void 0 ? void 0 : _b.map(slide => {
137
- var _a;
138
- return ({
139
- objectId: slide.objectId,
140
- pageElements: ((_a = slide.pageElements) === null || _a === void 0 ? void 0 : _a.flatMap(element => {
141
- var _a, _b;
142
- const textElements = ((_b = (_a = element.shape) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.textElements) || [];
143
- return textElements
144
- .map(textElement => {
145
- var _a, _b;
146
- const content = ((_a = textElement.textRun) === null || _a === void 0 ? void 0 : _a.content) || "";
147
- const styling = formatStyling((_b = textElement.textRun) === null || _b === void 0 ? void 0 : _b.style);
148
- return {
149
- objectId: `${element.objectId}`,
150
- text: content,
151
- styling,
152
- };
153
- })
154
- .filter(textRun => textRun.text.trim());
155
- }).filter(Boolean)) || [],
156
- });
125
+ slides: parsedData.slides?.map(slide => ({
126
+ objectId: slide.objectId,
127
+ pageElements: slide.pageElements
128
+ ?.flatMap(element => {
129
+ const textElements = element.shape?.text?.textElements || [];
130
+ return textElements
131
+ .map(textElement => {
132
+ const content = textElement.textRun?.content || "";
133
+ const styling = formatStyling(textElement.textRun?.style);
134
+ return {
135
+ objectId: `${element.objectId}`,
136
+ text: content,
137
+ styling,
138
+ };
139
+ })
140
+ .filter(textRun => textRun.text.trim());
141
+ })
142
+ .filter(Boolean) || [],
157
143
  })) || [],
158
144
  };
159
145
  return {
@@ -168,5 +154,5 @@ const getPresentation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ par
168
154
  error: error instanceof Error ? error.message : "Unknown error",
169
155
  };
170
156
  }
171
- });
157
+ };
172
158
  export default getPresentation;
@@ -1,22 +1,13 @@
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
1
  import { axiosClient } from "../../util/axiosClient.js";
11
2
  import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
12
- const hasGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
3
+ const hasGroupMember = async ({ params, authParams, }) => {
13
4
  const { authToken } = authParams;
14
5
  const { groupKey, memberKey } = params;
15
6
  if (!authToken) {
16
7
  return { success: false, isMember: false, error: MISSING_AUTH_TOKEN };
17
8
  }
18
9
  try {
19
- const response = yield axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/hasMember/${encodeURIComponent(memberKey)}`, {
10
+ const response = await axiosClient.get(`https://admin.googleapis.com/admin/directory/v1/groups/${encodeURIComponent(groupKey)}/hasMember/${encodeURIComponent(memberKey)}`, {
20
11
  headers: { Authorization: `Bearer ${authToken}` },
21
12
  });
22
13
  return {
@@ -31,5 +22,5 @@ const hasGroupMember = (_a) => __awaiter(void 0, [_a], void 0, function* ({ para
31
22
  error: error instanceof Error ? error.message : "Unknown error",
32
23
  };
33
24
  }
34
- });
25
+ };
35
26
  export default hasGroupMember;