@credal/actions 0.2.60 → 0.2.62
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.
- package/dist/actions/autogen/templates.js +64 -2
- package/dist/actions/autogen/types.d.ts +87 -0
- package/dist/actions/autogen/types.js +20 -0
- package/dist/actions/groups.js +14 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +47 -0
- package/dist/actions/providers/gitlab/searchGroup.d.ts +0 -3
- package/dist/actions/providers/gitlab/searchGroup.js +73 -45
- package/package.json +1 -1
- package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +0 -3
- package/dist/actions/providers/google-oauth/listGmailThreads.js +0 -98
- package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +0 -3
- package/dist/actions/providers/google-oauth/searchGmailMessages.js +0 -91
- package/dist/actions/providers/jamf/getComputerInventory.d.ts +0 -3
- package/dist/actions/providers/jamf/getComputerInventory.js +0 -45
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.d.ts +0 -3
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.js +0 -40
- package/dist/actions/providers/jamf/restartJamfComputerById.d.ts +0 -3
- package/dist/actions/providers/jamf/restartJamfComputerById.js +0 -37
|
@@ -815,7 +815,7 @@ export const jiraAssignJiraTicketDefinition = {
|
|
|
815
815
|
provider: "jira",
|
|
816
816
|
};
|
|
817
817
|
export const jiraPublicCommentOnServiceDeskRequestDefinition = {
|
|
818
|
-
description: "Comments
|
|
818
|
+
description: "Comments publicly on a Jira service desk request with specified content",
|
|
819
819
|
scopes: ["write:comment:jira"],
|
|
820
820
|
parameters: {
|
|
821
821
|
type: "object",
|
|
@@ -1349,7 +1349,7 @@ export const jiraOrgAssignJiraTicketDefinition = {
|
|
|
1349
1349
|
provider: "jiraOrg",
|
|
1350
1350
|
};
|
|
1351
1351
|
export const jiraOrgPublicCommentOnServiceDeskRequestDefinition = {
|
|
1352
|
-
description: "Comments
|
|
1352
|
+
description: "Comments publicly on a Jira service desk request with specified content",
|
|
1353
1353
|
scopes: ["write:comment:jira"],
|
|
1354
1354
|
parameters: {
|
|
1355
1355
|
type: "object",
|
|
@@ -10289,6 +10289,68 @@ export const gitlabSearchGroupDefinition = {
|
|
|
10289
10289
|
},
|
|
10290
10290
|
},
|
|
10291
10291
|
},
|
|
10292
|
+
commits: {
|
|
10293
|
+
type: "array",
|
|
10294
|
+
description: "A list of commits that match the query",
|
|
10295
|
+
items: {
|
|
10296
|
+
type: "object",
|
|
10297
|
+
required: ["sha", "web_url", "message", "author", "created_at", "files"],
|
|
10298
|
+
properties: {
|
|
10299
|
+
sha: {
|
|
10300
|
+
type: "string",
|
|
10301
|
+
description: "The commit SHA",
|
|
10302
|
+
},
|
|
10303
|
+
web_url: {
|
|
10304
|
+
type: "string",
|
|
10305
|
+
description: "The URL to view the commit in GitLab",
|
|
10306
|
+
},
|
|
10307
|
+
message: {
|
|
10308
|
+
type: "string",
|
|
10309
|
+
description: "The full commit message",
|
|
10310
|
+
},
|
|
10311
|
+
author: {
|
|
10312
|
+
type: "object",
|
|
10313
|
+
required: ["name", "email"],
|
|
10314
|
+
properties: {
|
|
10315
|
+
name: {
|
|
10316
|
+
type: "string",
|
|
10317
|
+
description: "The name of the commit author",
|
|
10318
|
+
},
|
|
10319
|
+
email: {
|
|
10320
|
+
type: "string",
|
|
10321
|
+
description: "The email of the commit author",
|
|
10322
|
+
},
|
|
10323
|
+
},
|
|
10324
|
+
},
|
|
10325
|
+
created_at: {
|
|
10326
|
+
type: "string",
|
|
10327
|
+
description: "The date/time the commit was created",
|
|
10328
|
+
},
|
|
10329
|
+
files: {
|
|
10330
|
+
type: "array",
|
|
10331
|
+
description: "A list of files changed in the commit",
|
|
10332
|
+
items: {
|
|
10333
|
+
type: "object",
|
|
10334
|
+
required: ["old_path", "new_path", "diff"],
|
|
10335
|
+
properties: {
|
|
10336
|
+
old_path: {
|
|
10337
|
+
type: "string",
|
|
10338
|
+
description: "The old path of the file",
|
|
10339
|
+
},
|
|
10340
|
+
new_path: {
|
|
10341
|
+
type: "string",
|
|
10342
|
+
description: "The new path of the file",
|
|
10343
|
+
},
|
|
10344
|
+
diff: {
|
|
10345
|
+
type: "string",
|
|
10346
|
+
description: "The diff contents for the file",
|
|
10347
|
+
},
|
|
10348
|
+
},
|
|
10349
|
+
},
|
|
10350
|
+
},
|
|
10351
|
+
},
|
|
10352
|
+
},
|
|
10353
|
+
},
|
|
10292
10354
|
},
|
|
10293
10355
|
},
|
|
10294
10356
|
name: "searchGroup",
|
|
@@ -7115,6 +7115,63 @@ export declare const gitlabSearchGroupOutputSchema: z.ZodObject<{
|
|
|
7115
7115
|
merged_at?: string | undefined;
|
|
7116
7116
|
}[] | undefined;
|
|
7117
7117
|
}>, "many">;
|
|
7118
|
+
commits: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
7119
|
+
sha: z.ZodString;
|
|
7120
|
+
web_url: z.ZodString;
|
|
7121
|
+
message: z.ZodString;
|
|
7122
|
+
author: z.ZodObject<{
|
|
7123
|
+
name: z.ZodString;
|
|
7124
|
+
email: z.ZodString;
|
|
7125
|
+
}, "strip", z.ZodTypeAny, {
|
|
7126
|
+
name: string;
|
|
7127
|
+
email: string;
|
|
7128
|
+
}, {
|
|
7129
|
+
name: string;
|
|
7130
|
+
email: string;
|
|
7131
|
+
}>;
|
|
7132
|
+
created_at: z.ZodString;
|
|
7133
|
+
files: z.ZodArray<z.ZodObject<{
|
|
7134
|
+
old_path: z.ZodString;
|
|
7135
|
+
new_path: z.ZodString;
|
|
7136
|
+
diff: z.ZodString;
|
|
7137
|
+
}, "strip", z.ZodTypeAny, {
|
|
7138
|
+
old_path: string;
|
|
7139
|
+
new_path: string;
|
|
7140
|
+
diff: string;
|
|
7141
|
+
}, {
|
|
7142
|
+
old_path: string;
|
|
7143
|
+
new_path: string;
|
|
7144
|
+
diff: string;
|
|
7145
|
+
}>, "many">;
|
|
7146
|
+
}, "strip", z.ZodTypeAny, {
|
|
7147
|
+
message: string;
|
|
7148
|
+
created_at: string;
|
|
7149
|
+
files: {
|
|
7150
|
+
old_path: string;
|
|
7151
|
+
new_path: string;
|
|
7152
|
+
diff: string;
|
|
7153
|
+
}[];
|
|
7154
|
+
sha: string;
|
|
7155
|
+
author: {
|
|
7156
|
+
name: string;
|
|
7157
|
+
email: string;
|
|
7158
|
+
};
|
|
7159
|
+
web_url: string;
|
|
7160
|
+
}, {
|
|
7161
|
+
message: string;
|
|
7162
|
+
created_at: string;
|
|
7163
|
+
files: {
|
|
7164
|
+
old_path: string;
|
|
7165
|
+
new_path: string;
|
|
7166
|
+
diff: string;
|
|
7167
|
+
}[];
|
|
7168
|
+
sha: string;
|
|
7169
|
+
author: {
|
|
7170
|
+
name: string;
|
|
7171
|
+
email: string;
|
|
7172
|
+
};
|
|
7173
|
+
web_url: string;
|
|
7174
|
+
}>, "many">>;
|
|
7118
7175
|
}, "strip", z.ZodTypeAny, {
|
|
7119
7176
|
mergeRequests: {
|
|
7120
7177
|
metadata: {
|
|
@@ -7157,6 +7214,21 @@ export declare const gitlabSearchGroupOutputSchema: z.ZodObject<{
|
|
|
7157
7214
|
merged_at?: string | undefined;
|
|
7158
7215
|
}[] | undefined;
|
|
7159
7216
|
}[];
|
|
7217
|
+
commits?: {
|
|
7218
|
+
message: string;
|
|
7219
|
+
created_at: string;
|
|
7220
|
+
files: {
|
|
7221
|
+
old_path: string;
|
|
7222
|
+
new_path: string;
|
|
7223
|
+
diff: string;
|
|
7224
|
+
}[];
|
|
7225
|
+
sha: string;
|
|
7226
|
+
author: {
|
|
7227
|
+
name: string;
|
|
7228
|
+
email: string;
|
|
7229
|
+
};
|
|
7230
|
+
web_url: string;
|
|
7231
|
+
}[] | undefined;
|
|
7160
7232
|
}, {
|
|
7161
7233
|
mergeRequests: {
|
|
7162
7234
|
metadata: {
|
|
@@ -7199,6 +7271,21 @@ export declare const gitlabSearchGroupOutputSchema: z.ZodObject<{
|
|
|
7199
7271
|
merged_at?: string | undefined;
|
|
7200
7272
|
}[] | undefined;
|
|
7201
7273
|
}[];
|
|
7274
|
+
commits?: {
|
|
7275
|
+
message: string;
|
|
7276
|
+
created_at: string;
|
|
7277
|
+
files: {
|
|
7278
|
+
old_path: string;
|
|
7279
|
+
new_path: string;
|
|
7280
|
+
diff: string;
|
|
7281
|
+
}[];
|
|
7282
|
+
sha: string;
|
|
7283
|
+
author: {
|
|
7284
|
+
name: string;
|
|
7285
|
+
email: string;
|
|
7286
|
+
};
|
|
7287
|
+
web_url: string;
|
|
7288
|
+
}[] | undefined;
|
|
7202
7289
|
}>;
|
|
7203
7290
|
export type gitlabSearchGroupOutputType = z.infer<typeof gitlabSearchGroupOutputSchema>;
|
|
7204
7291
|
export type gitlabSearchGroupFunction = ActionFunction<gitlabSearchGroupParamsType, AuthParamsType, gitlabSearchGroupOutputType>;
|
|
@@ -3570,6 +3570,26 @@ export const gitlabSearchGroupOutputSchema = z.object({
|
|
|
3570
3570
|
.optional(),
|
|
3571
3571
|
}))
|
|
3572
3572
|
.describe("A list of blobs that match the query"),
|
|
3573
|
+
commits: z
|
|
3574
|
+
.array(z.object({
|
|
3575
|
+
sha: z.string().describe("The commit SHA"),
|
|
3576
|
+
web_url: z.string().describe("The URL to view the commit in GitLab"),
|
|
3577
|
+
message: z.string().describe("The full commit message"),
|
|
3578
|
+
author: z.object({
|
|
3579
|
+
name: z.string().describe("The name of the commit author"),
|
|
3580
|
+
email: z.string().describe("The email of the commit author"),
|
|
3581
|
+
}),
|
|
3582
|
+
created_at: z.string().describe("The date/time the commit was created"),
|
|
3583
|
+
files: z
|
|
3584
|
+
.array(z.object({
|
|
3585
|
+
old_path: z.string().describe("The old path of the file"),
|
|
3586
|
+
new_path: z.string().describe("The new path of the file"),
|
|
3587
|
+
diff: z.string().describe("The diff contents for the file"),
|
|
3588
|
+
}))
|
|
3589
|
+
.describe("A list of files changed in the commit"),
|
|
3590
|
+
}))
|
|
3591
|
+
.describe("A list of commits that match the query")
|
|
3592
|
+
.optional(),
|
|
3573
3593
|
});
|
|
3574
3594
|
export const gitlabGetFileContentParamsSchema = z.object({
|
|
3575
3595
|
project_id: z.number().int().describe("Numeric project ID in GitLab (unique per project)"),
|
package/dist/actions/groups.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
|
|
1
|
+
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, linearGetIssueDetailsDefinition, linearGetProjectsDefinition, linearGetProjectDetailsDefinition, linearGetTeamDetailsDefinition, linearGetTeamsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } from "./autogen/templates.js";
|
|
2
2
|
export const ACTION_GROUPS = {
|
|
3
3
|
GENERIC: {
|
|
4
4
|
description: "Generic utility actions",
|
|
@@ -47,6 +47,7 @@ export const ACTION_GROUPS = {
|
|
|
47
47
|
googleOauthUpdatePresentationDefinition,
|
|
48
48
|
googleOauthSearchDriveByKeywordsDefinition,
|
|
49
49
|
googleOauthSearchDriveByQueryDefinition,
|
|
50
|
+
googleOauthSearchDriveByQueryAndGetFileContentDefinition,
|
|
50
51
|
googleOauthGetDriveFileContentByIdDefinition,
|
|
51
52
|
],
|
|
52
53
|
},
|
|
@@ -198,6 +199,8 @@ export const ACTION_GROUPS = {
|
|
|
198
199
|
githubCreateBranchDefinition,
|
|
199
200
|
githubCreatePullRequestDefinition,
|
|
200
201
|
githubListPullRequestsDefinition,
|
|
202
|
+
githubGetFileContentDefinition,
|
|
203
|
+
githubListDirectoryDefinition,
|
|
201
204
|
],
|
|
202
205
|
},
|
|
203
206
|
ASHBY: {
|
|
@@ -245,4 +248,14 @@ export const ACTION_GROUPS = {
|
|
|
245
248
|
oktaTriggerOktaWorkflowDefinition,
|
|
246
249
|
],
|
|
247
250
|
},
|
|
251
|
+
LINEAR: {
|
|
252
|
+
description: "Actions for interacting with Linear",
|
|
253
|
+
actions: [
|
|
254
|
+
linearGetIssueDetailsDefinition,
|
|
255
|
+
linearGetProjectsDefinition,
|
|
256
|
+
linearGetProjectDetailsDefinition,
|
|
257
|
+
linearGetTeamDetailsDefinition,
|
|
258
|
+
linearGetTeamsDefinition,
|
|
259
|
+
],
|
|
260
|
+
},
|
|
248
261
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
|
16
|
+
function getConfluenceApi(baseUrl, username, apiToken) {
|
|
17
|
+
const api = axios_1.default.create({
|
|
18
|
+
baseURL: baseUrl,
|
|
19
|
+
headers: {
|
|
20
|
+
Accept: "application/json",
|
|
21
|
+
// Tokens are associated with a specific user.
|
|
22
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
return api;
|
|
26
|
+
}
|
|
27
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
28
|
+
const { pageId, username, content, title } = params;
|
|
29
|
+
const { baseUrl, authToken } = authParams;
|
|
30
|
+
const api = getConfluenceApi(baseUrl, username, authToken);
|
|
31
|
+
// Get current version number
|
|
32
|
+
const response = yield api.get(`/api/v2/pages/${pageId}`);
|
|
33
|
+
const currVersion = response.data.version.number;
|
|
34
|
+
yield api.put(`/api/v2/pages/${pageId}`, {
|
|
35
|
+
id: pageId,
|
|
36
|
+
status: "current",
|
|
37
|
+
title,
|
|
38
|
+
body: {
|
|
39
|
+
representation: "storage",
|
|
40
|
+
value: content,
|
|
41
|
+
},
|
|
42
|
+
version: {
|
|
43
|
+
number: currVersion + 1,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
exports.default = confluenceUpdatePage;
|
|
@@ -9,26 +9,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
11
11
|
const GITLAB_API_URL = "https://gitlab.com";
|
|
12
|
-
|
|
13
|
-
const
|
|
12
|
+
const MAX_CODE_RESULTS = 15;
|
|
13
|
+
const MAX_COMMITS = 10;
|
|
14
|
+
const MAX_FILES_PER_COMMIT = 5;
|
|
15
|
+
const MAX_ISSUES_OR_PRS = 10;
|
|
16
|
+
const MAX_FILES_PER_PR = 5;
|
|
17
|
+
const MAX_PATCH_LINES = 20;
|
|
18
|
+
const MAX_FRAGMENT_LINES = 20;
|
|
19
|
+
function createProjectPathCache() {
|
|
20
|
+
return new Map();
|
|
21
|
+
}
|
|
14
22
|
function gitlabFetch(endpoint, authToken) {
|
|
15
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16
24
|
const res = yield fetch(endpoint, {
|
|
17
|
-
headers: {
|
|
18
|
-
Authorization: `Bearer ${authToken}`,
|
|
19
|
-
},
|
|
25
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
|
20
26
|
});
|
|
21
27
|
if (!res.ok)
|
|
22
28
|
throw new Error(`GitLab API error: ${res.status} ${res.statusText}`);
|
|
23
29
|
return res.json();
|
|
24
30
|
});
|
|
25
31
|
}
|
|
26
|
-
function getProjectPath(projectId, authToken, baseUrl) {
|
|
32
|
+
function getProjectPath(projectId, authToken, baseUrl, projectPathCache) {
|
|
27
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
|
|
29
|
-
if (projectPathCache.has(projectId)) {
|
|
34
|
+
if (projectPathCache.has(projectId))
|
|
30
35
|
return projectPathCache.get(projectId);
|
|
31
|
-
}
|
|
32
36
|
try {
|
|
33
37
|
const project = yield gitlabFetch(`${baseUrl}/projects/${projectId}`, authToken);
|
|
34
38
|
const path = project.path_with_namespace;
|
|
@@ -37,7 +41,6 @@ function getProjectPath(projectId, authToken, baseUrl) {
|
|
|
37
41
|
}
|
|
38
42
|
catch (error) {
|
|
39
43
|
console.warn(`Failed to fetch project path for project ${projectId}:`, error);
|
|
40
|
-
// Fallback to project ID if we can't get the path
|
|
41
44
|
return `project-${projectId}`;
|
|
42
45
|
}
|
|
43
46
|
});
|
|
@@ -45,16 +48,14 @@ function getProjectPath(projectId, authToken, baseUrl) {
|
|
|
45
48
|
function constructBlobUrl(input) {
|
|
46
49
|
const { baseUrl, projectPath, ref, path, startline } = input;
|
|
47
50
|
let url = `${baseUrl}/${projectPath}/-/blob/${ref}/${path}`;
|
|
48
|
-
|
|
49
|
-
if (startline && startline > 0) {
|
|
51
|
+
if (startline && startline > 0)
|
|
50
52
|
url += `#L${startline}`;
|
|
51
|
-
}
|
|
52
53
|
return url;
|
|
53
54
|
}
|
|
54
|
-
function enhanceBlobWithUrl(blob, authToken, baseUrl, gitlabWebBaseUrl) {
|
|
55
|
+
function enhanceBlobWithUrl(blob, authToken, baseUrl, gitlabWebBaseUrl, projectPathCache) {
|
|
55
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
57
|
try {
|
|
57
|
-
const projectPath = yield getProjectPath(blob.project_id, authToken, baseUrl);
|
|
58
|
+
const projectPath = yield getProjectPath(blob.project_id, authToken, baseUrl, projectPathCache);
|
|
58
59
|
const web_url = constructBlobUrl({
|
|
59
60
|
baseUrl: gitlabWebBaseUrl,
|
|
60
61
|
projectPath,
|
|
@@ -66,7 +67,6 @@ function enhanceBlobWithUrl(blob, authToken, baseUrl, gitlabWebBaseUrl) {
|
|
|
66
67
|
}
|
|
67
68
|
catch (error) {
|
|
68
69
|
console.warn(`Failed to construct URL for blob in project ${blob.project_id}:`, error);
|
|
69
|
-
// Fallback URL construction
|
|
70
70
|
const fallbackUrl = constructBlobUrl({
|
|
71
71
|
baseUrl: gitlabWebBaseUrl,
|
|
72
72
|
projectPath: `project-${blob.project_id}`,
|
|
@@ -85,25 +85,39 @@ function globalSearch(input) {
|
|
|
85
85
|
return gitlabFetch(endpoint, authToken);
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function getCommitDetails(input) {
|
|
89
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
const { projectId,
|
|
91
|
-
const
|
|
92
|
-
|
|
90
|
+
const { projectId, sha, authToken, baseUrl, webBaseUrl, projectPathCache } = input;
|
|
91
|
+
const projectPath = yield getProjectPath(projectId, authToken, baseUrl, projectPathCache);
|
|
92
|
+
const commit = yield gitlabFetch(`${baseUrl}/projects/${projectId}/repository/commits/${sha}`, authToken);
|
|
93
|
+
const diffs = yield gitlabFetch(`${baseUrl}/projects/${projectId}/repository/commits/${sha}/diff`, authToken);
|
|
94
|
+
return {
|
|
95
|
+
sha: commit.id,
|
|
96
|
+
web_url: `${webBaseUrl}/${projectPath}/-/commit/${commit.id}`,
|
|
97
|
+
message: commit.message,
|
|
98
|
+
author: {
|
|
99
|
+
name: commit.author_name,
|
|
100
|
+
email: commit.author_email,
|
|
101
|
+
},
|
|
102
|
+
created_at: commit.created_at,
|
|
103
|
+
files: (diffs || []).slice(0, MAX_FILES_PER_COMMIT).map(diff => ({
|
|
104
|
+
old_path: diff.old_path,
|
|
105
|
+
new_path: diff.new_path,
|
|
106
|
+
diff: diff.diff ? diff.diff.split("\n").slice(0, MAX_PATCH_LINES).join("\n") : "",
|
|
107
|
+
})),
|
|
108
|
+
};
|
|
93
109
|
});
|
|
94
110
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Searches for merge requests and blobs in a GitLab group
|
|
97
|
-
*/
|
|
98
111
|
const searchGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
99
112
|
const { authToken, baseUrl } = authParams;
|
|
100
113
|
const gitlabBaseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : GITLAB_API_URL;
|
|
101
114
|
const gitlabBaseApiUrl = `${gitlabBaseUrl}/api/v4`;
|
|
102
|
-
if (!authToken)
|
|
115
|
+
if (!authToken)
|
|
103
116
|
throw new Error(MISSING_AUTH_TOKEN);
|
|
104
|
-
}
|
|
105
117
|
const { query, groupId } = params;
|
|
106
|
-
const
|
|
118
|
+
const projectPathCache = createProjectPathCache();
|
|
119
|
+
// --- Top-level: run all searches in parallel
|
|
120
|
+
const [mrResults, blobResults, commitResults] = yield Promise.all([
|
|
107
121
|
globalSearch({
|
|
108
122
|
scope: "merge_requests",
|
|
109
123
|
query,
|
|
@@ -118,38 +132,52 @@ const searchGroup = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
|
|
|
118
132
|
authToken,
|
|
119
133
|
baseUrl: gitlabBaseApiUrl,
|
|
120
134
|
}),
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
mrIid: metadata.iid,
|
|
135
|
+
globalSearch({
|
|
136
|
+
scope: "commits",
|
|
137
|
+
query,
|
|
138
|
+
groupId,
|
|
126
139
|
authToken,
|
|
127
140
|
baseUrl: gitlabBaseApiUrl,
|
|
128
|
-
})
|
|
141
|
+
}),
|
|
142
|
+
]);
|
|
143
|
+
// --- Merge Requests: diffs in parallel
|
|
144
|
+
const limitedMRResults = mrResults.slice(0, MAX_ISSUES_OR_PRS);
|
|
145
|
+
const mergeRequests = yield Promise.all(limitedMRResults.map((metadata) => __awaiter(void 0, void 0, void 0, function* () {
|
|
146
|
+
let diffs = yield gitlabFetch(`${gitlabBaseApiUrl}/projects/${metadata.project_id}/merge_requests/${metadata.iid}/diffs`, authToken);
|
|
147
|
+
diffs = (diffs || []).slice(0, MAX_FILES_PER_PR).map(diff => (Object.assign(Object.assign({}, diff), { diff: diff.diff ? diff.diff.split("\n").slice(0, MAX_PATCH_LINES).join("\n") : diff.diff })));
|
|
129
148
|
return { metadata, diffs };
|
|
130
149
|
})));
|
|
131
|
-
//
|
|
132
|
-
const
|
|
150
|
+
// --- Blobs: enhance with URL in parallel
|
|
151
|
+
const limitedBlobResults = blobResults.slice(0, MAX_CODE_RESULTS);
|
|
152
|
+
const blobsWithUrls = yield Promise.all(limitedBlobResults.map(blob => enhanceBlobWithUrl(blob, authToken, gitlabBaseApiUrl, gitlabBaseUrl, projectPathCache)));
|
|
133
153
|
const blobs = blobsWithUrls.map(blob => {
|
|
134
154
|
const matches = mergeRequests
|
|
135
155
|
.filter(mr => mr.metadata.project_id === blob.project_id && mr.diffs.some(diff => diff.new_path === blob.path))
|
|
136
|
-
.map(mr => {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
merged_at: mr.metadata.merged_at,
|
|
143
|
-
});
|
|
144
|
-
});
|
|
156
|
+
.map(mr => ({
|
|
157
|
+
title: mr.metadata.title,
|
|
158
|
+
web_url: mr.metadata.web_url,
|
|
159
|
+
author: mr.metadata.author ? { name: mr.metadata.author.name } : undefined,
|
|
160
|
+
merged_at: mr.metadata.merged_at,
|
|
161
|
+
}));
|
|
145
162
|
return {
|
|
146
|
-
metadata: blob,
|
|
147
|
-
|
|
163
|
+
metadata: Object.assign(Object.assign({}, blob), { data: blob.data.split("\n").slice(0, MAX_FRAGMENT_LINES).join("\n") }),
|
|
164
|
+
matchedMergeRequests: matches,
|
|
148
165
|
};
|
|
149
166
|
});
|
|
167
|
+
// --- Commits: details in parallel
|
|
168
|
+
const limitedCommitResults = commitResults.slice(0, MAX_COMMITS);
|
|
169
|
+
const commits = yield Promise.all(limitedCommitResults.map(commit => getCommitDetails({
|
|
170
|
+
projectId: commit.project_id,
|
|
171
|
+
sha: commit.id,
|
|
172
|
+
authToken,
|
|
173
|
+
baseUrl: gitlabBaseApiUrl,
|
|
174
|
+
webBaseUrl: gitlabBaseUrl,
|
|
175
|
+
projectPathCache,
|
|
176
|
+
})));
|
|
150
177
|
return {
|
|
151
178
|
mergeRequests,
|
|
152
179
|
blobs,
|
|
180
|
+
commits,
|
|
153
181
|
};
|
|
154
182
|
});
|
|
155
183
|
export default searchGroup;
|
package/package.json
CHANGED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const axiosClient_1 = require("../../util/axiosClient");
|
|
13
|
-
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
|
14
|
-
const decodeMessage_1 = require("./utils/decodeMessage");
|
|
15
|
-
const listGmailThreads = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
16
|
-
if (!authParams.authToken) {
|
|
17
|
-
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN, threads: [] };
|
|
18
|
-
}
|
|
19
|
-
const { query, maxResults } = params;
|
|
20
|
-
const allThreads = [];
|
|
21
|
-
const errorMessages = [];
|
|
22
|
-
const max = maxResults !== null && maxResults !== void 0 ? maxResults : 100;
|
|
23
|
-
let fetched = 0;
|
|
24
|
-
let pageToken = undefined;
|
|
25
|
-
try {
|
|
26
|
-
while (fetched < max) {
|
|
27
|
-
const url = `https://gmail.googleapis.com/gmail/v1/users/me/threads?q=${encodeURIComponent(query)}` +
|
|
28
|
-
(pageToken ? `&pageToken=${encodeURIComponent(pageToken)}` : "") +
|
|
29
|
-
`&maxResults=${Math.min(100, max - fetched)}`;
|
|
30
|
-
const listRes = yield axiosClient_1.axiosClient.get(url, {
|
|
31
|
-
headers: {
|
|
32
|
-
Authorization: `Bearer ${authParams.authToken}`,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
const { threads: threadList = [], nextPageToken } = listRes.data;
|
|
36
|
-
if (!Array.isArray(threadList) || threadList.length === 0)
|
|
37
|
-
break;
|
|
38
|
-
const remaining = max - allThreads.length;
|
|
39
|
-
const batch = threadList.slice(0, remaining);
|
|
40
|
-
const results = yield Promise.all(batch.map((thread) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
try {
|
|
42
|
-
const threadRes = yield axiosClient_1.axiosClient.get(`https://gmail.googleapis.com/gmail/v1/users/me/threads/${thread.id}?format=full`, {
|
|
43
|
-
headers: {
|
|
44
|
-
Authorization: `Bearer ${authParams.authToken}`,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
const { id, historyId, messages } = threadRes.data;
|
|
48
|
-
return {
|
|
49
|
-
id,
|
|
50
|
-
historyId,
|
|
51
|
-
messages: Array.isArray(messages)
|
|
52
|
-
? messages.map(msg => {
|
|
53
|
-
const { id, threadId, snippet, labelIds, internalDate } = msg;
|
|
54
|
-
const emailBody = (0, decodeMessage_1.getEmailContent)(msg) || "";
|
|
55
|
-
return {
|
|
56
|
-
id,
|
|
57
|
-
threadId,
|
|
58
|
-
snippet,
|
|
59
|
-
labelIds,
|
|
60
|
-
internalDate,
|
|
61
|
-
emailBody,
|
|
62
|
-
};
|
|
63
|
-
})
|
|
64
|
-
: [],
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
catch (err) {
|
|
68
|
-
errorMessages.push(err instanceof Error ? err.message : "Failed to fetch thread details");
|
|
69
|
-
return {
|
|
70
|
-
id: thread.id,
|
|
71
|
-
snippet: "",
|
|
72
|
-
historyId: "",
|
|
73
|
-
messages: [],
|
|
74
|
-
error: err instanceof Error ? err.message : "Failed to fetch thread details",
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
})));
|
|
78
|
-
allThreads.push(...results);
|
|
79
|
-
fetched = allThreads.length;
|
|
80
|
-
if (!nextPageToken || allThreads.length >= max)
|
|
81
|
-
break;
|
|
82
|
-
pageToken = nextPageToken;
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
success: errorMessages.length === 0,
|
|
86
|
-
threads: allThreads,
|
|
87
|
-
error: errorMessages.join("; "),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
return {
|
|
92
|
-
success: false,
|
|
93
|
-
error: error instanceof Error ? error.message : "Unknown error listing Gmail threads",
|
|
94
|
-
threads: [],
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
exports.default = listGmailThreads;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const axiosClient_1 = require("../../util/axiosClient");
|
|
13
|
-
const missingAuthConstants_1 = require("../../util/missingAuthConstants");
|
|
14
|
-
const decodeMessage_1 = require("./utils/decodeMessage");
|
|
15
|
-
const searchGmailMessages = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
16
|
-
if (!authParams.authToken) {
|
|
17
|
-
return { success: false, error: missingAuthConstants_1.MISSING_AUTH_TOKEN, messages: [] };
|
|
18
|
-
}
|
|
19
|
-
const { query, maxResults } = params;
|
|
20
|
-
const allMessages = [];
|
|
21
|
-
const max = maxResults !== null && maxResults !== void 0 ? maxResults : 100;
|
|
22
|
-
const errorMessages = [];
|
|
23
|
-
let pageToken = undefined;
|
|
24
|
-
let fetched = 0;
|
|
25
|
-
try {
|
|
26
|
-
while (fetched < max) {
|
|
27
|
-
const url = `https://gmail.googleapis.com/gmail/v1/users/me/messages?q=${encodeURIComponent(query)}` +
|
|
28
|
-
(pageToken ? `&pageToken=${encodeURIComponent(pageToken)}` : "") +
|
|
29
|
-
`&maxResults=${Math.min(100, max - fetched)}`;
|
|
30
|
-
const listRes = yield axiosClient_1.axiosClient.get(url, {
|
|
31
|
-
headers: {
|
|
32
|
-
Authorization: `Bearer ${authParams.authToken}`,
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
const { messages: messageList = [], nextPageToken } = listRes.data;
|
|
36
|
-
if (!Array.isArray(messageList) || messageList.length === 0)
|
|
37
|
-
break;
|
|
38
|
-
const remaining = max - allMessages.length;
|
|
39
|
-
const batch = messageList.slice(0, remaining);
|
|
40
|
-
const results = yield Promise.all(batch.map((msg) => __awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
-
try {
|
|
42
|
-
const msgRes = yield axiosClient_1.axiosClient.get(`https://gmail.googleapis.com/gmail/v1/users/me/messages/${msg.id}?format=full`, {
|
|
43
|
-
headers: {
|
|
44
|
-
Authorization: `Bearer ${authParams.authToken}`,
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
const { id, threadId, snippet, labelIds, internalDate } = msgRes.data;
|
|
48
|
-
const emailBody = (0, decodeMessage_1.getEmailContent)(msgRes.data) || "";
|
|
49
|
-
return {
|
|
50
|
-
id,
|
|
51
|
-
threadId,
|
|
52
|
-
snippet,
|
|
53
|
-
labelIds,
|
|
54
|
-
internalDate,
|
|
55
|
-
emailBody,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
catch (err) {
|
|
59
|
-
errorMessages.push(err instanceof Error ? err.message : "Failed to fetch message details");
|
|
60
|
-
return {
|
|
61
|
-
id: msg.id,
|
|
62
|
-
threadId: "",
|
|
63
|
-
snippet: "",
|
|
64
|
-
labelIds: [],
|
|
65
|
-
internalDate: "",
|
|
66
|
-
payload: {},
|
|
67
|
-
error: err instanceof Error ? err.message : "Failed to fetch message details",
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
})));
|
|
71
|
-
allMessages.push(...results);
|
|
72
|
-
fetched = allMessages.length;
|
|
73
|
-
if (!nextPageToken || allMessages.length >= max)
|
|
74
|
-
break;
|
|
75
|
-
pageToken = nextPageToken;
|
|
76
|
-
}
|
|
77
|
-
return {
|
|
78
|
-
success: errorMessages.length === 0,
|
|
79
|
-
messages: allMessages,
|
|
80
|
-
error: errorMessages.join("; "),
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
return {
|
|
85
|
-
success: false,
|
|
86
|
-
error: error instanceof Error ? error.message : "Unknown error searching Gmail",
|
|
87
|
-
messages: [],
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
exports.default = searchGmailMessages;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const axiosClient_1 = require("../../util/axiosClient");
|
|
13
|
-
const getComputerInventory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
14
|
-
const { authToken, baseUrl } = authParams;
|
|
15
|
-
const { section } = params;
|
|
16
|
-
if (!baseUrl) {
|
|
17
|
-
throw new Error("Base URL is required to fetch computer inventory");
|
|
18
|
-
}
|
|
19
|
-
const apiUrl = `${baseUrl}/v1/computer-inventory`;
|
|
20
|
-
const queryParams = {};
|
|
21
|
-
if (section) {
|
|
22
|
-
queryParams.section = section;
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
const response = yield axiosClient_1.axiosClient.get(apiUrl, {
|
|
26
|
-
headers: {
|
|
27
|
-
Authorization: `Bearer ${authToken}`,
|
|
28
|
-
Accept: "application/json",
|
|
29
|
-
},
|
|
30
|
-
params: queryParams,
|
|
31
|
-
});
|
|
32
|
-
return {
|
|
33
|
-
success: true,
|
|
34
|
-
data: response.data,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
console.error("Error retrieving computer inventory: ", error);
|
|
39
|
-
return {
|
|
40
|
-
success: false,
|
|
41
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
exports.default = getComputerInventory;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const axiosClient_1 = require("../../util/axiosClient");
|
|
13
|
-
const getFileVaultRecoveryKey = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
14
|
-
const { authToken, baseUrl } = authParams;
|
|
15
|
-
const { computerId } = params;
|
|
16
|
-
if (!baseUrl || !computerId) {
|
|
17
|
-
throw new Error("Base URL and Computer ID are required to fetch FileVault2 recovery key");
|
|
18
|
-
}
|
|
19
|
-
const apiUrl = `${baseUrl}/JSSResource/computers/${computerId}/FileVault2RecoveryKey`;
|
|
20
|
-
try {
|
|
21
|
-
const response = yield axiosClient_1.axiosClient.get(apiUrl, {
|
|
22
|
-
headers: {
|
|
23
|
-
Authorization: `Bearer ${authToken}`,
|
|
24
|
-
Accept: "application/json",
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
return {
|
|
28
|
-
success: true,
|
|
29
|
-
data: response.data,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.error("Error retrieving FileVault2 recovery key: ", error);
|
|
34
|
-
return {
|
|
35
|
-
success: false,
|
|
36
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
exports.default = getFileVaultRecoveryKey;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
-
const restartJamfComputerById = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
12
|
-
const { authToken, subdomain } = authParams;
|
|
13
|
-
const { computerId } = params;
|
|
14
|
-
if (!subdomain || !authToken) {
|
|
15
|
-
throw new Error("Instance and authToken are required to fetch Jamf user computer ID");
|
|
16
|
-
}
|
|
17
|
-
const url = `https://${subdomain}.jamfcloud.com`;
|
|
18
|
-
try {
|
|
19
|
-
yield axiosClient.post(`${url}/api/command/v1/computers/${computerId}/restart`, {
|
|
20
|
-
headers: {
|
|
21
|
-
Authorization: `Bearer ${authToken}`,
|
|
22
|
-
Accept: "application/json",
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
return {
|
|
26
|
-
success: true,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
console.error("Error restarting Jamf computer: ", error);
|
|
31
|
-
return {
|
|
32
|
-
success: false,
|
|
33
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
export default restartJamfComputerById;
|