@credal/actions 0.2.0 → 0.2.2
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/types.d.ts +2 -33
- package/dist/actions/autogen/types.js +4 -36
- package/dist/actions/parse.js +10 -10
- 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.js +5 -21
- package/dist/actions/providers/jamf/getJamfFileVaultRecoveryKey.js +4 -21
- package/package.json +1 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
- package/dist/actions/providers/confluence/updatePage.js +0 -47
@@ -1,35 +1,4 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
-
export declare enum ProviderName {
|
3
|
-
GENERIC = "generic",
|
4
|
-
ASANA = "asana",
|
5
|
-
SLACK = "slack",
|
6
|
-
MATH = "math",
|
7
|
-
CONFLUENCE = "confluence",
|
8
|
-
JIRA = "jira",
|
9
|
-
KANDJI = "kandji",
|
10
|
-
GOOGLEMAPS = "googlemaps",
|
11
|
-
BING = "bing",
|
12
|
-
ZENDESK = "zendesk",
|
13
|
-
LINKEDIN = "linkedin",
|
14
|
-
X = "x",
|
15
|
-
MONGO = "mongo",
|
16
|
-
SNOWFLAKE = "snowflake",
|
17
|
-
OPENSTREETMAP = "openstreetmap",
|
18
|
-
NWS = "nws",
|
19
|
-
FIRECRAWL = "firecrawl",
|
20
|
-
RESEND = "resend",
|
21
|
-
GOOGLEOAUTH = "googleOauth",
|
22
|
-
GOOGLEMAIL = "googlemail",
|
23
|
-
GONG = "gong",
|
24
|
-
FINNHUB = "finnhub",
|
25
|
-
LOOKER = "looker",
|
26
|
-
ASHBY = "ashby",
|
27
|
-
SALESFORCE = "salesforce",
|
28
|
-
MICROSOFT = "microsoft",
|
29
|
-
GITHUB = "github",
|
30
|
-
NOTION = "notion",
|
31
|
-
JAMF = "jamf"
|
32
|
-
}
|
33
2
|
export type ActionFunction<P, A, O> = (input: {
|
34
3
|
params: P;
|
35
4
|
authParams: A;
|
@@ -2848,22 +2817,22 @@ export declare const googleOauthListGroupMembersOutputSchema: z.ZodObject<{
|
|
2848
2817
|
}>, "many">;
|
2849
2818
|
error: z.ZodOptional<z.ZodString>;
|
2850
2819
|
}, "strip", z.ZodTypeAny, {
|
2820
|
+
success: boolean;
|
2851
2821
|
members: {
|
2852
2822
|
type: string;
|
2853
2823
|
id: string;
|
2854
2824
|
email: string;
|
2855
2825
|
role: string;
|
2856
2826
|
}[];
|
2857
|
-
success: boolean;
|
2858
2827
|
error?: string | undefined;
|
2859
2828
|
}, {
|
2829
|
+
success: boolean;
|
2860
2830
|
members: {
|
2861
2831
|
type: string;
|
2862
2832
|
id: string;
|
2863
2833
|
email: string;
|
2864
2834
|
role: string;
|
2865
2835
|
}[];
|
2866
|
-
success: boolean;
|
2867
2836
|
error?: string | undefined;
|
2868
2837
|
}>;
|
2869
2838
|
export type googleOauthListGroupMembersOutputType = z.infer<typeof googleOauthListGroupMembersOutputSchema>;
|
@@ -1,42 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
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 =
|
4
|
-
exports.googleOauthDeleteCalendarEventOutputSchema = 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 =
|
5
|
-
exports.ashbyUpdateCandidateOutputSchema = 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 =
|
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 =
|
3
|
+
exports.zendeskCreateZendeskTicketParamsSchema = 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
|
+
exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthDeleteCalendarEventOutputSchema = 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 = void 0;
|
5
|
+
exports.salesforceUpdateRecordParamsSchema = exports.ashbyUpdateCandidateOutputSchema = 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 = 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 = void 0;
|
7
7
|
const zod_1 = require("zod");
|
8
|
-
var ProviderName;
|
9
|
-
(function (ProviderName) {
|
10
|
-
ProviderName["GENERIC"] = "generic";
|
11
|
-
ProviderName["ASANA"] = "asana";
|
12
|
-
ProviderName["SLACK"] = "slack";
|
13
|
-
ProviderName["MATH"] = "math";
|
14
|
-
ProviderName["CONFLUENCE"] = "confluence";
|
15
|
-
ProviderName["JIRA"] = "jira";
|
16
|
-
ProviderName["KANDJI"] = "kandji";
|
17
|
-
ProviderName["GOOGLEMAPS"] = "googlemaps";
|
18
|
-
ProviderName["BING"] = "bing";
|
19
|
-
ProviderName["ZENDESK"] = "zendesk";
|
20
|
-
ProviderName["LINKEDIN"] = "linkedin";
|
21
|
-
ProviderName["X"] = "x";
|
22
|
-
ProviderName["MONGO"] = "mongo";
|
23
|
-
ProviderName["SNOWFLAKE"] = "snowflake";
|
24
|
-
ProviderName["OPENSTREETMAP"] = "openstreetmap";
|
25
|
-
ProviderName["NWS"] = "nws";
|
26
|
-
ProviderName["FIRECRAWL"] = "firecrawl";
|
27
|
-
ProviderName["RESEND"] = "resend";
|
28
|
-
ProviderName["GOOGLEOAUTH"] = "googleOauth";
|
29
|
-
ProviderName["GOOGLEMAIL"] = "googlemail";
|
30
|
-
ProviderName["GONG"] = "gong";
|
31
|
-
ProviderName["FINNHUB"] = "finnhub";
|
32
|
-
ProviderName["LOOKER"] = "looker";
|
33
|
-
ProviderName["ASHBY"] = "ashby";
|
34
|
-
ProviderName["SALESFORCE"] = "salesforce";
|
35
|
-
ProviderName["MICROSOFT"] = "microsoft";
|
36
|
-
ProviderName["GITHUB"] = "github";
|
37
|
-
ProviderName["NOTION"] = "notion";
|
38
|
-
ProviderName["JAMF"] = "jamf";
|
39
|
-
})(ProviderName || (exports.ProviderName = ProviderName = {}));
|
40
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
41
9
|
authToken: zod_1.z.string().optional(),
|
42
10
|
baseUrl: zod_1.z.string().optional(),
|
package/dist/actions/parse.js
CHANGED
@@ -142,16 +142,16 @@ function generateTypes(_a) {
|
|
142
142
|
const project = new ts_morph_1.Project();
|
143
143
|
const templatesFile = project.createSourceFile(outputPath, "", { overwrite: true });
|
144
144
|
const typesFile = project.createSourceFile(templatesOutputPath, "", { overwrite: true });
|
145
|
-
// Set the ProviderName enum based on the schema providers
|
146
|
-
typesFile
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
})
|
154
|
-
|
145
|
+
// // Set the ProviderName enum based on the schema providers
|
146
|
+
// typesFile
|
147
|
+
// .addEnum({
|
148
|
+
// name: "ProviderName",
|
149
|
+
// members: Object.keys(parsedConfig.actions).map(providerName => ({
|
150
|
+
// name: providerName.toUpperCase().replace(/-/g, "_"),
|
151
|
+
// value: providerName,
|
152
|
+
// })),
|
153
|
+
// })
|
154
|
+
// .setIsExported(true);
|
155
155
|
// Add imports
|
156
156
|
templatesFile.addImportDeclaration({
|
157
157
|
moduleSpecifier: "../../actions/parse",
|
@@ -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;
|
@@ -10,42 +10,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
-
const types_1 = require("./types");
|
14
13
|
const getJamfComputerInventory = (_a) => __awaiter(void 0, [_a], void 0, function* ({ authParams, }) {
|
15
|
-
const {
|
16
|
-
if (!subdomain || !
|
17
|
-
throw new Error("
|
14
|
+
const { authToken, subdomain } = authParams;
|
15
|
+
if (!subdomain || !authToken) {
|
16
|
+
throw new Error("Instance and authToken are required to fetch Jamf computer inventory");
|
18
17
|
}
|
19
18
|
const url = `https://${subdomain}.jamfcloud.com`;
|
20
|
-
const auth = "Basic " + Buffer.from(`${username}:${password}`).toString("base64");
|
21
19
|
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
20
|
const computers = yield axiosClient_1.axiosClient.get(`${url}/api/v1/computers-inventory`, {
|
30
21
|
headers: {
|
31
|
-
Authorization: `Bearer ${
|
22
|
+
Authorization: `Bearer ${authToken}`,
|
32
23
|
Accept: "application/json",
|
33
24
|
},
|
34
25
|
});
|
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
26
|
return {
|
43
27
|
success: true,
|
44
28
|
data: computers.data,
|
45
29
|
};
|
46
30
|
}
|
47
31
|
catch (error) {
|
48
|
-
console.error("Error retrieving
|
32
|
+
console.error("Error retrieving Jamf computer inventory: ", error);
|
49
33
|
return {
|
50
34
|
success: false,
|
51
35
|
error: error instanceof Error ? error.message : "Unknown error",
|
@@ -10,38 +10,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
-
const types_1 = require("./types");
|
14
13
|
const getJamfFileVaultRecoveryKey = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
15
|
-
const {
|
14
|
+
const { authToken, subdomain } = authParams;
|
16
15
|
const { computerId } = params;
|
17
|
-
if (!subdomain || !
|
18
|
-
throw new Error("
|
16
|
+
if (!subdomain || !authToken) {
|
17
|
+
throw new Error("Instance and authToken are required to fetch FileVault2 recovery key");
|
19
18
|
}
|
20
19
|
// const apiUrl = `${baseUrl}/api/v1/computers-inventory/${computerId}/filevault`;
|
21
20
|
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
21
|
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
22
|
const fileVaultResponse = yield axiosClient_1.axiosClient.get(`${url}/api/v1/computers-inventory/${computerId}/filevault`, {
|
33
23
|
headers: {
|
34
|
-
Authorization: `Bearer ${
|
24
|
+
Authorization: `Bearer ${authToken}`,
|
35
25
|
Accept: "application/json",
|
36
26
|
},
|
37
27
|
});
|
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
28
|
return {
|
46
29
|
success: true,
|
47
30
|
data: fileVaultResponse.data,
|
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;
|