@credal/actions 0.1.100 → 0.1.101
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/actionMapper.js +24 -12
- package/dist/actions/autogen/templates.d.ts +2 -0
- package/dist/actions/autogen/templates.js +69 -1
- package/dist/actions/autogen/types.d.ts +46 -0
- package/dist/actions/autogen/types.js +17 -1
- package/dist/actions/groups.js +4 -0
- package/dist/actions/providers/google-oauth/listGmailThreads.d.ts +3 -0
- package/dist/actions/providers/google-oauth/listGmailThreads.js +98 -0
- package/dist/actions/providers/google-oauth/searchGmailMessages.d.ts +3 -0
- package/dist/actions/providers/google-oauth/searchGmailMessages.js +91 -0
- package/dist/actions/providers/jamf/getComputerInventory.d.ts +3 -0
- package/dist/actions/providers/jamf/getComputerInventory.js +45 -0
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.d.ts +3 -0
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.js +40 -0
- package/dist/actions/providers/jamf/getJamfComputerInventory.d.ts +3 -0
- package/dist/actions/providers/jamf/getJamfComputerInventory.js +55 -0
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.d.ts +3 -0
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +58 -0
- package/dist/actions/providers/jamf/types.d.ts +8 -0
- package/dist/actions/providers/jamf/types.js +7 -0
- package/package.json +1 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
- package/dist/actions/providers/confluence/updatePage.js +0 -47
@@ -100,6 +100,8 @@ const listGroupMembers_1 = __importDefault(require("./providers/google-oauth/lis
|
|
100
100
|
const hasGroupMember_1 = __importDefault(require("./providers/google-oauth/hasGroupMember"));
|
101
101
|
const addGroupMember_1 = __importDefault(require("./providers/google-oauth/addGroupMember"));
|
102
102
|
const deleteGroupMember_1 = __importDefault(require("./providers/google-oauth/deleteGroupMember"));
|
103
|
+
const getJamfComputerInventory_1 = __importDefault(require("./providers/jamf/getJamfComputerInventory"));
|
104
|
+
const getJamfFileVaultRecoveryKey_1 = __importDefault(require("./providers/jamf/getJamfFileVaultRecoveryKey"));
|
103
105
|
exports.ActionMapper = {
|
104
106
|
generic: {
|
105
107
|
fillTemplate: {
|
@@ -140,6 +142,18 @@ exports.ActionMapper = {
|
|
140
142
|
outputSchema: types_1.asanaGetTasksDetailsOutputSchema,
|
141
143
|
},
|
142
144
|
},
|
145
|
+
jamf: {
|
146
|
+
getJamfComputerInventory: {
|
147
|
+
fn: getJamfComputerInventory_1.default,
|
148
|
+
paramsSchema: types_1.jamfGetJamfComputerInventoryParamsSchema,
|
149
|
+
outputSchema: types_1.jamfGetJamfComputerInventoryOutputSchema,
|
150
|
+
},
|
151
|
+
getJamfFileVaultRecoveryKey: {
|
152
|
+
fn: getJamfFileVaultRecoveryKey_1.default,
|
153
|
+
paramsSchema: types_1.jamfGetJamfFileVaultRecoveryKeyParamsSchema,
|
154
|
+
outputSchema: types_1.jamfGetJamfFileVaultRecoveryKeyOutputSchema,
|
155
|
+
},
|
156
|
+
},
|
143
157
|
math: {
|
144
158
|
add: {
|
145
159
|
fn: add_1.default,
|
@@ -383,6 +397,16 @@ exports.ActionMapper = {
|
|
383
397
|
paramsSchema: types_1.googleOauthSearchDriveByKeywordsParamsSchema,
|
384
398
|
outputSchema: types_1.googleOauthSearchDriveByKeywordsOutputSchema,
|
385
399
|
},
|
400
|
+
searchGmailMessages: {
|
401
|
+
fn: searchGmailMessages_1.default,
|
402
|
+
paramsSchema: types_1.googlemailSearchGmailMessagesParamsSchema,
|
403
|
+
outputSchema: types_1.googlemailSearchGmailMessagesOutputSchema,
|
404
|
+
},
|
405
|
+
listGmailThreads: {
|
406
|
+
fn: listGmailThreads_1.default,
|
407
|
+
paramsSchema: types_1.googlemailListGmailThreadsParamsSchema,
|
408
|
+
outputSchema: types_1.googlemailListGmailThreadsOutputSchema,
|
409
|
+
},
|
386
410
|
listCalendars: {
|
387
411
|
fn: listCalendars_1.default,
|
388
412
|
paramsSchema: types_1.googleOauthListCalendarsParamsSchema,
|
@@ -434,18 +458,6 @@ exports.ActionMapper = {
|
|
434
458
|
outputSchema: types_1.googleOauthDeleteGroupMemberOutputSchema,
|
435
459
|
},
|
436
460
|
},
|
437
|
-
googlemail: {
|
438
|
-
searchGmailMessages: {
|
439
|
-
fn: searchGmailMessages_1.default,
|
440
|
-
paramsSchema: types_1.googlemailSearchGmailMessagesParamsSchema,
|
441
|
-
outputSchema: types_1.googlemailSearchGmailMessagesOutputSchema,
|
442
|
-
},
|
443
|
-
listGmailThreads: {
|
444
|
-
fn: listGmailThreads_1.default,
|
445
|
-
paramsSchema: types_1.googlemailListGmailThreadsParamsSchema,
|
446
|
-
outputSchema: types_1.googlemailListGmailThreadsOutputSchema,
|
447
|
-
},
|
448
|
-
},
|
449
461
|
x: {
|
450
462
|
createShareXPostUrl: {
|
451
463
|
fn: createXSharePostUrl_1.default,
|
@@ -92,3 +92,5 @@ export declare const githubCreateBranchDefinition: ActionTemplate;
|
|
92
92
|
export declare const githubCreatePullRequestDefinition: ActionTemplate;
|
93
93
|
export declare const githubListPullRequestsDefinition: ActionTemplate;
|
94
94
|
export declare const notionSearchByTitleDefinition: ActionTemplate;
|
95
|
+
export declare const jamfGetJamfFileVaultRecoveryKeyDefinition: ActionTemplate;
|
96
|
+
export declare const jamfGetJamfComputerInventoryDefinition: ActionTemplate;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.googleOauthDeleteCalendarEventDefinition = exports.googleOauthUpdateCalendarEventDefinition = exports.googleOauthListCalendarEventsDefinition = exports.googleOauthListCalendarsDefinition = exports.googleOauthScheduleCalendarMeetingDefinition = exports.googleOauthUpdateDocDefinition = exports.googleOauthCreateNewGoogleDocDefinition = exports.googleOauthSearchFilesByKeywordsDefinition = exports.resendSendEmailDefinition = exports.firecrawlScrapeTweetDataWithNitterDefinition = exports.firecrawlScrapeUrlDefinition = exports.firecrawlDeepResearchDefinition = exports.nwsGetForecastForLocationDefinition = exports.openstreetmapGetLatitudeLongitudeFromLocationDefinition = exports.snowflakeRunSnowflakeQueryDefinition = exports.snowflakeGetRowByFieldValueDefinition = exports.mongoInsertMongoDocDefinition = exports.xCreateShareXPostUrlDefinition = exports.linkedinCreateShareLinkedinPostUrlDefinition = exports.zendeskAssignTicketDefinition = exports.zendeskAddCommentToTicketDefinition = exports.zendeskUpdateTicketStatusDefinition = exports.zendeskGetTicketDetailsDefinition = exports.zendeskListZendeskTicketsDefinition = exports.zendeskCreateZendeskTicketDefinition = exports.credalCallCopilotDefinition = exports.bingGetTopNSearchResultUrlsDefinition = exports.googlemapsNearbysearchRestaurantsDefinition = exports.googlemapsValidateAddressDefinition = exports.kandjiGetFVRecoveryKeyForDeviceDefinition = exports.jiraGetJiraIssuesByQueryDefinition = exports.jiraUpdateJiraTicketStatusDefinition = exports.jiraUpdateJiraTicketDetailsDefinition = exports.jiraGetJiraTicketHistoryDefinition = exports.jiraGetJiraTicketDetailsDefinition = exports.jiraCreateJiraTicketDefinition = exports.jiraCommentJiraTicketDefinition = exports.jiraAssignJiraTicketDefinition = exports.confluenceFetchPageContentDefinition = exports.confluenceOverwritePageDefinition = exports.mathAddDefinition = exports.slackGetChannelMessagesDefinition = exports.slackSendMessageDefinition = exports.asanaGetTasksDetailsDefinition = exports.asanaSearchTasksDefinition = exports.asanaUpdateTaskDefinition = exports.asanaCreateTaskDefinition = exports.asanaListAsanaTasksByProjectDefinition = exports.asanaCommentTaskDefinition = exports.genericFillTemplateDefinition = void 0;
|
4
|
-
exports.notionSearchByTitleDefinition = exports.githubListPullRequestsDefinition = exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftGetDocumentDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.microsoftUpdateSpreadsheetDefinition = exports.microsoftUpdateDocumentDefinition = exports.microsoftCreateDocumentDefinition = exports.salesforceFetchSalesforceSchemaByObjectDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceCreateRecordDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = exports.ashbyCreateNoteDefinition = exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.gongGetGongTranscriptsDefinition = exports.googlemailListGmailThreadsDefinition = exports.googlemailSearchGmailMessagesDefinition = exports.googleOauthDeleteGroupMemberDefinition = exports.googleOauthAddGroupMemberDefinition = exports.googleOauthHasGroupMemberDefinition = exports.googleOauthListGroupMembersDefinition = exports.googleOauthGetGroupDefinition = exports.googleOauthListGroupsDefinition = exports.googleOauthSearchDriveByKeywordsDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = void 0;
|
4
|
+
exports.jamfGetJamfComputerInventoryDefinition = exports.jamfGetJamfFileVaultRecoveryKeyDefinition = exports.notionSearchByTitleDefinition = exports.githubListPullRequestsDefinition = exports.githubCreatePullRequestDefinition = exports.githubCreateBranchDefinition = exports.githubCreateOrUpdateFileDefinition = exports.microsoftGetDocumentDefinition = exports.microsoftMessageTeamsChannelDefinition = exports.microsoftMessageTeamsChatDefinition = exports.microsoftUpdateSpreadsheetDefinition = exports.microsoftUpdateDocumentDefinition = exports.microsoftCreateDocumentDefinition = exports.salesforceFetchSalesforceSchemaByObjectDefinition = exports.salesforceGetRecordDefinition = exports.salesforceGetSalesforceRecordsByQueryDefinition = exports.salesforceGenerateSalesReportDefinition = exports.salesforceCreateCaseDefinition = exports.salesforceCreateRecordDefinition = exports.salesforceUpdateRecordDefinition = exports.ashbyUpdateCandidateDefinition = exports.ashbyCreateCandidateDefinition = exports.ashbyListCandidateNotesDefinition = exports.ashbySearchCandidatesDefinition = exports.ashbyListCandidatesDefinition = exports.ashbyAddCandidateToProjectDefinition = exports.ashbyGetCandidateInfoDefinition = exports.ashbyCreateNoteDefinition = exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.gongGetGongTranscriptsDefinition = exports.googlemailListGmailThreadsDefinition = exports.googlemailSearchGmailMessagesDefinition = exports.googleOauthDeleteGroupMemberDefinition = exports.googleOauthAddGroupMemberDefinition = exports.googleOauthHasGroupMemberDefinition = exports.googleOauthListGroupMembersDefinition = exports.googleOauthGetGroupDefinition = exports.googleOauthListGroupsDefinition = exports.googleOauthSearchDriveByKeywordsDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = void 0;
|
5
5
|
exports.genericFillTemplateDefinition = {
|
6
6
|
description: "Simple utility that takes a template and returns it filled in",
|
7
7
|
scopes: [],
|
@@ -7537,3 +7537,71 @@ exports.notionSearchByTitleDefinition = {
|
|
7537
7537
|
name: "searchByTitle",
|
7538
7538
|
provider: "notion",
|
7539
7539
|
};
|
7540
|
+
exports.jamfGetJamfFileVaultRecoveryKeyDefinition = {
|
7541
|
+
description: "Retrieves the FileVault2 recovery key for a specified computer",
|
7542
|
+
scopes: [],
|
7543
|
+
parameters: {
|
7544
|
+
type: "object",
|
7545
|
+
required: ["computerId"],
|
7546
|
+
properties: {
|
7547
|
+
computerId: {
|
7548
|
+
type: "string",
|
7549
|
+
description: "The computerId of the device to get the FileVault2 recovery key for",
|
7550
|
+
},
|
7551
|
+
},
|
7552
|
+
},
|
7553
|
+
output: {
|
7554
|
+
type: "object",
|
7555
|
+
required: ["success"],
|
7556
|
+
properties: {
|
7557
|
+
success: {
|
7558
|
+
type: "boolean",
|
7559
|
+
description: "Whether the request was successful",
|
7560
|
+
},
|
7561
|
+
data: {
|
7562
|
+
type: "string",
|
7563
|
+
description: "The FileVault2 recovery key data",
|
7564
|
+
},
|
7565
|
+
error: {
|
7566
|
+
type: "string",
|
7567
|
+
description: "Error message if the request failed",
|
7568
|
+
},
|
7569
|
+
},
|
7570
|
+
},
|
7571
|
+
name: "getJamfFileVaultRecoveryKey",
|
7572
|
+
provider: "jamf",
|
7573
|
+
};
|
7574
|
+
exports.jamfGetJamfComputerInventoryDefinition = {
|
7575
|
+
description: "Retrieves computer inventory information from Jamf",
|
7576
|
+
scopes: [],
|
7577
|
+
parameters: {
|
7578
|
+
type: "object",
|
7579
|
+
required: [],
|
7580
|
+
properties: {
|
7581
|
+
section: {
|
7582
|
+
type: "string",
|
7583
|
+
description: "Optional section parameter to filter inventory data",
|
7584
|
+
},
|
7585
|
+
},
|
7586
|
+
},
|
7587
|
+
output: {
|
7588
|
+
type: "object",
|
7589
|
+
required: ["success"],
|
7590
|
+
properties: {
|
7591
|
+
success: {
|
7592
|
+
type: "boolean",
|
7593
|
+
description: "Whether the request was successful",
|
7594
|
+
},
|
7595
|
+
data: {
|
7596
|
+
type: "array",
|
7597
|
+
description: "The computer inventory data",
|
7598
|
+
},
|
7599
|
+
error: {
|
7600
|
+
type: "string",
|
7601
|
+
description: "Error message if the request failed",
|
7602
|
+
},
|
7603
|
+
},
|
7604
|
+
},
|
7605
|
+
name: "getJamfComputerInventory",
|
7606
|
+
provider: "jamf",
|
7607
|
+
};
|
@@ -4409,3 +4409,49 @@ export declare const notionSearchByTitleOutputSchema: z.ZodObject<{
|
|
4409
4409
|
}>;
|
4410
4410
|
export type notionSearchByTitleOutputType = z.infer<typeof notionSearchByTitleOutputSchema>;
|
4411
4411
|
export type notionSearchByTitleFunction = ActionFunction<notionSearchByTitleParamsType, AuthParamsType, notionSearchByTitleOutputType>;
|
4412
|
+
export declare const jamfGetJamfFileVaultRecoveryKeyParamsSchema: z.ZodObject<{
|
4413
|
+
computerId: z.ZodString;
|
4414
|
+
}, "strip", z.ZodTypeAny, {
|
4415
|
+
computerId: string;
|
4416
|
+
}, {
|
4417
|
+
computerId: string;
|
4418
|
+
}>;
|
4419
|
+
export type jamfGetJamfFileVaultRecoveryKeyParamsType = z.infer<typeof jamfGetJamfFileVaultRecoveryKeyParamsSchema>;
|
4420
|
+
export declare const jamfGetJamfFileVaultRecoveryKeyOutputSchema: z.ZodObject<{
|
4421
|
+
success: z.ZodBoolean;
|
4422
|
+
data: z.ZodOptional<z.ZodString>;
|
4423
|
+
error: z.ZodOptional<z.ZodString>;
|
4424
|
+
}, "strip", z.ZodTypeAny, {
|
4425
|
+
success: boolean;
|
4426
|
+
error?: string | undefined;
|
4427
|
+
data?: string | undefined;
|
4428
|
+
}, {
|
4429
|
+
success: boolean;
|
4430
|
+
error?: string | undefined;
|
4431
|
+
data?: string | undefined;
|
4432
|
+
}>;
|
4433
|
+
export type jamfGetJamfFileVaultRecoveryKeyOutputType = z.infer<typeof jamfGetJamfFileVaultRecoveryKeyOutputSchema>;
|
4434
|
+
export type jamfGetJamfFileVaultRecoveryKeyFunction = ActionFunction<jamfGetJamfFileVaultRecoveryKeyParamsType, AuthParamsType, jamfGetJamfFileVaultRecoveryKeyOutputType>;
|
4435
|
+
export declare const jamfGetJamfComputerInventoryParamsSchema: z.ZodObject<{
|
4436
|
+
section: z.ZodOptional<z.ZodString>;
|
4437
|
+
}, "strip", z.ZodTypeAny, {
|
4438
|
+
section?: string | undefined;
|
4439
|
+
}, {
|
4440
|
+
section?: string | undefined;
|
4441
|
+
}>;
|
4442
|
+
export type jamfGetJamfComputerInventoryParamsType = z.infer<typeof jamfGetJamfComputerInventoryParamsSchema>;
|
4443
|
+
export declare const jamfGetJamfComputerInventoryOutputSchema: z.ZodObject<{
|
4444
|
+
success: z.ZodBoolean;
|
4445
|
+
data: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
4446
|
+
error: z.ZodOptional<z.ZodString>;
|
4447
|
+
}, "strip", z.ZodTypeAny, {
|
4448
|
+
success: boolean;
|
4449
|
+
error?: string | undefined;
|
4450
|
+
data?: any[] | undefined;
|
4451
|
+
}, {
|
4452
|
+
success: boolean;
|
4453
|
+
error?: string | undefined;
|
4454
|
+
data?: any[] | undefined;
|
4455
|
+
}>;
|
4456
|
+
export type jamfGetJamfComputerInventoryOutputType = z.infer<typeof jamfGetJamfComputerInventoryOutputSchema>;
|
4457
|
+
export type jamfGetJamfComputerInventoryFunction = ActionFunction<jamfGetJamfComputerInventoryParamsType, AuthParamsType, jamfGetJamfComputerInventoryOutputType>;
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.kandjiGetFVRecoveryKeyForDeviceOutputSchema = exports.kandjiGetFVRecoveryKeyForDeviceParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaGetTasksDetailsOutputSchema = exports.asanaGetTasksDetailsParamsSchema = exports.asanaSearchTasksOutputSchema = exports.asanaSearchTasksParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaListAsanaTasksByProjectOutputSchema = exports.asanaListAsanaTasksByProjectParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
|
4
4
|
exports.googleOauthDeleteCalendarEventParamsSchema = exports.googleOauthUpdateCalendarEventOutputSchema = exports.googleOauthUpdateCalendarEventParamsSchema = exports.googleOauthListCalendarEventsOutputSchema = exports.googleOauthListCalendarEventsParamsSchema = exports.googleOauthListCalendarsOutputSchema = exports.googleOauthListCalendarsParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = exports.googleOauthSearchFilesByKeywordsOutputSchema = exports.googleOauthSearchFilesByKeywordsParamsSchema = exports.resendSendEmailOutputSchema = exports.resendSendEmailParamsSchema = exports.firecrawlScrapeTweetDataWithNitterOutputSchema = exports.firecrawlScrapeTweetDataWithNitterParamsSchema = exports.firecrawlScrapeUrlOutputSchema = exports.firecrawlScrapeUrlParamsSchema = exports.firecrawlDeepResearchOutputSchema = exports.firecrawlDeepResearchParamsSchema = exports.nwsGetForecastForLocationOutputSchema = exports.nwsGetForecastForLocationParamsSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationOutputSchema = exports.openstreetmapGetLatitudeLongitudeFromLocationParamsSchema = exports.snowflakeRunSnowflakeQueryOutputSchema = exports.snowflakeRunSnowflakeQueryParamsSchema = exports.snowflakeGetRowByFieldValueOutputSchema = exports.snowflakeGetRowByFieldValueParamsSchema = exports.mongoInsertMongoDocOutputSchema = exports.mongoInsertMongoDocParamsSchema = exports.xCreateShareXPostUrlOutputSchema = exports.xCreateShareXPostUrlParamsSchema = exports.linkedinCreateShareLinkedinPostUrlOutputSchema = exports.linkedinCreateShareLinkedinPostUrlParamsSchema = exports.zendeskAssignTicketOutputSchema = exports.zendeskAssignTicketParamsSchema = exports.zendeskAddCommentToTicketOutputSchema = exports.zendeskAddCommentToTicketParamsSchema = exports.zendeskUpdateTicketStatusOutputSchema = exports.zendeskUpdateTicketStatusParamsSchema = exports.zendeskGetTicketDetailsOutputSchema = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = void 0;
|
5
5
|
exports.ashbyUpdateCandidateParamsSchema = exports.ashbyCreateCandidateOutputSchema = exports.ashbyCreateCandidateParamsSchema = exports.ashbyListCandidateNotesOutputSchema = exports.ashbyListCandidateNotesParamsSchema = exports.ashbySearchCandidatesOutputSchema = exports.ashbySearchCandidatesParamsSchema = exports.ashbyListCandidatesOutputSchema = exports.ashbyListCandidatesParamsSchema = exports.ashbyAddCandidateToProjectOutputSchema = exports.ashbyAddCandidateToProjectParamsSchema = exports.ashbyGetCandidateInfoOutputSchema = exports.ashbyGetCandidateInfoParamsSchema = exports.ashbyCreateNoteOutputSchema = exports.ashbyCreateNoteParamsSchema = exports.lookerEnableUserByEmailOutputSchema = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googlemailListGmailThreadsOutputSchema = exports.googlemailListGmailThreadsParamsSchema = exports.googlemailSearchGmailMessagesOutputSchema = exports.googlemailSearchGmailMessagesParamsSchema = exports.googleOauthDeleteGroupMemberOutputSchema = exports.googleOauthDeleteGroupMemberParamsSchema = exports.googleOauthAddGroupMemberOutputSchema = exports.googleOauthAddGroupMemberParamsSchema = exports.googleOauthHasGroupMemberOutputSchema = exports.googleOauthHasGroupMemberParamsSchema = exports.googleOauthListGroupMembersOutputSchema = exports.googleOauthListGroupMembersParamsSchema = exports.googleOauthGetGroupOutputSchema = exports.googleOauthGetGroupParamsSchema = exports.googleOauthListGroupsOutputSchema = exports.googleOauthListGroupsParamsSchema = exports.googleOauthSearchDriveByKeywordsOutputSchema = exports.googleOauthSearchDriveByKeywordsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthDeleteCalendarEventOutputSchema = void 0;
|
6
|
-
exports.notionSearchByTitleOutputSchema = exports.notionSearchByTitleParamsSchema = exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = void 0;
|
6
|
+
exports.jamfGetJamfComputerInventoryOutputSchema = exports.jamfGetJamfComputerInventoryParamsSchema = exports.jamfGetJamfFileVaultRecoveryKeyOutputSchema = exports.jamfGetJamfFileVaultRecoveryKeyParamsSchema = exports.notionSearchByTitleOutputSchema = exports.notionSearchByTitleParamsSchema = exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = exports.githubCreatePullRequestParamsSchema = exports.githubCreateBranchOutputSchema = exports.githubCreateBranchParamsSchema = exports.githubCreateOrUpdateFileOutputSchema = exports.githubCreateOrUpdateFileParamsSchema = exports.microsoftGetDocumentOutputSchema = exports.microsoftGetDocumentParamsSchema = exports.microsoftMessageTeamsChannelOutputSchema = exports.microsoftMessageTeamsChannelParamsSchema = exports.microsoftMessageTeamsChatOutputSchema = exports.microsoftMessageTeamsChatParamsSchema = exports.microsoftUpdateSpreadsheetOutputSchema = exports.microsoftUpdateSpreadsheetParamsSchema = exports.microsoftUpdateDocumentOutputSchema = exports.microsoftUpdateDocumentParamsSchema = exports.microsoftCreateDocumentOutputSchema = exports.microsoftCreateDocumentParamsSchema = exports.salesforceFetchSalesforceSchemaByObjectOutputSchema = exports.salesforceFetchSalesforceSchemaByObjectParamsSchema = exports.salesforceGetRecordOutputSchema = exports.salesforceGetRecordParamsSchema = exports.salesforceGetSalesforceRecordsByQueryOutputSchema = exports.salesforceGetSalesforceRecordsByQueryParamsSchema = exports.salesforceGenerateSalesReportOutputSchema = exports.salesforceGenerateSalesReportParamsSchema = exports.salesforceCreateCaseOutputSchema = exports.salesforceCreateCaseParamsSchema = exports.salesforceCreateRecordOutputSchema = exports.salesforceCreateRecordParamsSchema = exports.salesforceUpdateRecordOutputSchema = exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = void 0;
|
7
7
|
const zod_1 = require("zod");
|
8
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
9
9
|
authToken: zod_1.z.string().optional(),
|
@@ -2745,3 +2745,19 @@ exports.notionSearchByTitleOutputSchema = zod_1.z.object({
|
|
2745
2745
|
.optional(),
|
2746
2746
|
error: zod_1.z.string().describe("Error message if search failed").optional(),
|
2747
2747
|
});
|
2748
|
+
exports.jamfGetJamfFileVaultRecoveryKeyParamsSchema = zod_1.z.object({
|
2749
|
+
computerId: zod_1.z.string().describe("The computerId of the device to get the FileVault2 recovery key for"),
|
2750
|
+
});
|
2751
|
+
exports.jamfGetJamfFileVaultRecoveryKeyOutputSchema = zod_1.z.object({
|
2752
|
+
success: zod_1.z.boolean().describe("Whether the request was successful"),
|
2753
|
+
data: zod_1.z.string().describe("The FileVault2 recovery key data").optional(),
|
2754
|
+
error: zod_1.z.string().describe("Error message if the request failed").optional(),
|
2755
|
+
});
|
2756
|
+
exports.jamfGetJamfComputerInventoryParamsSchema = zod_1.z.object({
|
2757
|
+
section: zod_1.z.string().describe("Optional section parameter to filter inventory data").optional(),
|
2758
|
+
});
|
2759
|
+
exports.jamfGetJamfComputerInventoryOutputSchema = zod_1.z.object({
|
2760
|
+
success: zod_1.z.boolean().describe("Whether the request was successful"),
|
2761
|
+
data: zod_1.z.array(zod_1.z.any()).describe("The computer inventory data").optional(),
|
2762
|
+
error: zod_1.z.string().describe("Error message if the request failed").optional(),
|
2763
|
+
});
|
package/dist/actions/groups.js
CHANGED
@@ -136,6 +136,10 @@ exports.ACTION_GROUPS = {
|
|
136
136
|
description: "Action for interacting with Finnhub for stock market data",
|
137
137
|
actions: [templates_1.finnhubSymbolLookupDefinition, templates_1.finnhubGetBasicFinancialsDefinition],
|
138
138
|
},
|
139
|
+
JAMF: {
|
140
|
+
description: "Actions for interacting with Jamf",
|
141
|
+
actions: [templates_1.jamfGetJamfComputerInventoryDefinition, templates_1.jamfGetJamfFileVaultRecoveryKeyDefinition],
|
142
|
+
},
|
139
143
|
LOOKER: {
|
140
144
|
description: "Actions for interacting with Looker",
|
141
145
|
actions: [templates_1.lookerEnableUserByEmailDefinition],
|
@@ -0,0 +1,98 @@
|
|
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;
|
@@ -0,0 +1,91 @@
|
|
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;
|
@@ -0,0 +1,45 @@
|
|
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;
|
@@ -0,0 +1,40 @@
|
|
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;
|
@@ -0,0 +1,55 @@
|
|
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 types_1 = require("./types");
|
14
|
+
const getJamfComputerInventory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
|
15
|
+
const { username, password, subdomain } = authParams;
|
16
|
+
if (!subdomain || !username || !password) {
|
17
|
+
throw new Error("Base URL, username, and password are required to fetch FileVault2 recovery key");
|
18
|
+
}
|
19
|
+
const url = `https://${subdomain}.jamfcloud.com`;
|
20
|
+
const auth = "Basic " + Buffer.from(`${username}:${password}`).toString("base64");
|
21
|
+
try {
|
22
|
+
const response = yield axiosClient_1.axiosClient.post(`${url}/api/v1/auth/token`, {}, {
|
23
|
+
headers: {
|
24
|
+
Authorization: auth,
|
25
|
+
Accept: "application/json",
|
26
|
+
},
|
27
|
+
});
|
28
|
+
const token = types_1.TokenResponseSchema.parse(response.data).token;
|
29
|
+
const computers = yield axiosClient_1.axiosClient.get(`${url}/api/v1/computers-inventory`, {
|
30
|
+
headers: {
|
31
|
+
Authorization: `Bearer ${token}`,
|
32
|
+
Accept: "application/json",
|
33
|
+
},
|
34
|
+
});
|
35
|
+
yield axiosClient_1.axiosClient.post(`${url}/api/v1/auth/invalidate-token`, {}, {
|
36
|
+
headers: {
|
37
|
+
Authorization: `Bearer ${token}`,
|
38
|
+
},
|
39
|
+
// Accept all status codes so we can handle them manually
|
40
|
+
validateStatus: () => true,
|
41
|
+
});
|
42
|
+
return {
|
43
|
+
success: true,
|
44
|
+
data: computers.data,
|
45
|
+
};
|
46
|
+
}
|
47
|
+
catch (error) {
|
48
|
+
console.error("Error retrieving FileVault2 recovery key: ", error);
|
49
|
+
return {
|
50
|
+
success: false,
|
51
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
52
|
+
};
|
53
|
+
}
|
54
|
+
});
|
55
|
+
exports.default = getJamfComputerInventory;
|
@@ -0,0 +1,58 @@
|
|
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 types_1 = require("./types");
|
14
|
+
const getJamfFileVaultRecoveryKey = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
+
const { username, password, subdomain } = authParams;
|
16
|
+
const { computerId } = params;
|
17
|
+
if (!subdomain || !username || !password) {
|
18
|
+
throw new Error("Base URL, username, and password are required to fetch FileVault2 recovery key");
|
19
|
+
}
|
20
|
+
// const apiUrl = `${baseUrl}/api/v1/computers-inventory/${computerId}/filevault`;
|
21
|
+
const url = `https://${subdomain}.jamfcloud.com`;
|
22
|
+
const auth = "Basic " + Buffer.from(`${username}:${password}`).toString("base64");
|
23
|
+
console.log("Fetching FileVault2 recovery key for computer ID:", computerId, auth, url);
|
24
|
+
try {
|
25
|
+
const response = yield axiosClient_1.axiosClient.post(`${url}/api/v1/auth/token`, {}, {
|
26
|
+
headers: {
|
27
|
+
Authorization: auth,
|
28
|
+
Accept: "application/json",
|
29
|
+
},
|
30
|
+
});
|
31
|
+
const token = types_1.TokenResponseSchema.parse(response.data).token;
|
32
|
+
const fileVaultResponse = yield axiosClient_1.axiosClient.get(`${url}/api/v1/computers-inventory/${computerId}/filevault`, {
|
33
|
+
headers: {
|
34
|
+
Authorization: `Bearer ${token}`,
|
35
|
+
Accept: "application/json",
|
36
|
+
},
|
37
|
+
});
|
38
|
+
yield axiosClient_1.axiosClient.post(`${url}/api/v1/auth/invalidate-token`, {}, {
|
39
|
+
headers: {
|
40
|
+
Authorization: `Bearer ${token}`,
|
41
|
+
},
|
42
|
+
// Accept all status codes so we can handle them manually
|
43
|
+
validateStatus: () => true,
|
44
|
+
});
|
45
|
+
return {
|
46
|
+
success: true,
|
47
|
+
data: fileVaultResponse.data,
|
48
|
+
};
|
49
|
+
}
|
50
|
+
catch (error) {
|
51
|
+
console.error("Error retrieving FileVault2 recovery key: ", error);
|
52
|
+
return {
|
53
|
+
success: false,
|
54
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
55
|
+
};
|
56
|
+
}
|
57
|
+
});
|
58
|
+
exports.default = getJamfFileVaultRecoveryKey;
|
package/package.json
CHANGED
@@ -1,47 +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
|
-
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;
|