@credal/actions 0.1.67 → 0.1.68
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 +9 -0
- package/dist/actions/autogen/templates.d.ts +1 -0
- package/dist/actions/autogen/templates.js +102 -2
- package/dist/actions/autogen/types.d.ts +111 -0
- package/dist/actions/autogen/types.js +43 -2
- package/dist/actions/groups.js +4 -0
- package/dist/actions/providers/gong/getGongTranscripts.d.ts +3 -0
- package/dist/actions/providers/gong/getGongTranscripts.js +237 -0
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +3 -0
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.js +43 -0
- package/package.json +4 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +0 -3
- package/dist/actions/providers/confluence/updatePage.js +0 -47
@@ -79,6 +79,8 @@ const listPullRequests_1 = __importDefault(require("./providers/github/listPullR
|
|
79
79
|
const getJiraIssuesByQuery_1 = __importDefault(require("./providers/jira/getJiraIssuesByQuery"));
|
80
80
|
const createRecord_1 = __importDefault(require("./providers/salesforce/createRecord"));
|
81
81
|
const getTopNSearchResultUrls_1 = __importDefault(require("./providers/bing/getTopNSearchResultUrls"));
|
82
|
+
const getGongTranscripts_1 = __importDefault(require("./providers/gong/getGongTranscripts"));
|
83
|
+
const types_2 = require("./autogen/types");
|
82
84
|
exports.ActionMapper = {
|
83
85
|
generic: {
|
84
86
|
fillTemplate: {
|
@@ -348,6 +350,13 @@ exports.ActionMapper = {
|
|
348
350
|
outputSchema: types_1.xCreateShareXPostUrlOutputSchema,
|
349
351
|
},
|
350
352
|
},
|
353
|
+
gong: {
|
354
|
+
getGongTranscripts: {
|
355
|
+
fn: getGongTranscripts_1.default,
|
356
|
+
paramsSchema: types_2.gongGetGongTranscriptsParamsSchema,
|
357
|
+
outputSchema: types_2.gongGetGongTranscriptsOutputSchema,
|
358
|
+
},
|
359
|
+
},
|
351
360
|
finnhub: {
|
352
361
|
symbolLookup: {
|
353
362
|
fn: symbolLookup_1.default,
|
@@ -45,6 +45,7 @@ export declare const googleOauthCreateSpreadsheetDefinition: ActionTemplate;
|
|
45
45
|
export declare const googleOauthUpdateSpreadsheetDefinition: ActionTemplate;
|
46
46
|
export declare const googleOauthCreatePresentationDefinition: ActionTemplate;
|
47
47
|
export declare const googleOauthUpdatePresentationDefinition: ActionTemplate;
|
48
|
+
export declare const gongGetGongTranscriptsDefinition: ActionTemplate;
|
48
49
|
export declare const finnhubSymbolLookupDefinition: ActionTemplate;
|
49
50
|
export declare const finnhubGetBasicFinancialsDefinition: ActionTemplate;
|
50
51
|
export declare const lookerEnableUserByEmailDefinition: ActionTemplate;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
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 = void 0;
|
3
|
+
exports.lookerEnableUserByEmailDefinition = exports.finnhubGetBasicFinancialsDefinition = exports.finnhubSymbolLookupDefinition = exports.gongGetGongTranscriptsDefinition = exports.googleOauthUpdatePresentationDefinition = exports.googleOauthCreatePresentationDefinition = exports.googleOauthUpdateSpreadsheetDefinition = exports.googleOauthCreateSpreadsheetDefinition = exports.googleOauthScheduleCalendarMeetingDefinition = exports.googleOauthUpdateDocDefinition = exports.googleOauthCreateNewGoogleDocDefinition = 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.jiraGetJiraIssuesByQueryDefinition = exports.jiraUpdateJiraTicketStatusDefinition = exports.jiraUpdateJiraTicketDetailsDefinition = exports.jiraGetJiraTicketHistoryDefinition = exports.jiraGetJiraTicketDetailsDefinition = exports.jiraCreateJiraTicketDefinition = exports.jiraCommentJiraTicketDefinition = exports.jiraAssignJiraTicketDefinition = exports.confluenceFetchPageContentDefinition = exports.confluenceOverwritePageDefinition = exports.mathAddDefinition = exports.slackGetChannelMessagesDefinition = exports.slackListConversationsDefinition = exports.slackSendMessageDefinition = exports.asanaUpdateTaskDefinition = exports.asanaCreateTaskDefinition = exports.asanaCommentTaskDefinition = exports.genericFillTemplateDefinition = void 0;
|
4
|
+
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 = void 0;
|
5
5
|
exports.genericFillTemplateDefinition = {
|
6
6
|
description: "Simple utility that takes a template and returns it filled in",
|
7
7
|
scopes: [],
|
@@ -4884,6 +4884,106 @@ exports.googleOauthUpdatePresentationDefinition = {
|
|
4884
4884
|
name: "updatePresentation",
|
4885
4885
|
provider: "googleOauth",
|
4886
4886
|
};
|
4887
|
+
exports.gongGetGongTranscriptsDefinition = {
|
4888
|
+
description: "Get sales call transcripts from Gong",
|
4889
|
+
scopes: [],
|
4890
|
+
parameters: {
|
4891
|
+
type: "object",
|
4892
|
+
required: ["userRole"],
|
4893
|
+
properties: {
|
4894
|
+
userRole: {
|
4895
|
+
type: "string",
|
4896
|
+
description: "The role of users whose transcripts are being fetched",
|
4897
|
+
},
|
4898
|
+
trackers: {
|
4899
|
+
type: "array",
|
4900
|
+
description: "The trackers to fetch transcripts for",
|
4901
|
+
items: {
|
4902
|
+
type: "string",
|
4903
|
+
description: "The names of the trackers to fetch transcripts for",
|
4904
|
+
},
|
4905
|
+
},
|
4906
|
+
startDate: {
|
4907
|
+
type: "string",
|
4908
|
+
description: "The start date of the transcripts to fetch in ISO 8601 format",
|
4909
|
+
},
|
4910
|
+
endDate: {
|
4911
|
+
type: "string",
|
4912
|
+
description: "The end date of the transcripts to fetch in ISO 8601 format",
|
4913
|
+
},
|
4914
|
+
},
|
4915
|
+
},
|
4916
|
+
output: {
|
4917
|
+
type: "object",
|
4918
|
+
required: ["success"],
|
4919
|
+
properties: {
|
4920
|
+
success: {
|
4921
|
+
type: "boolean",
|
4922
|
+
description: "Whether the transcripts were fetched successfully",
|
4923
|
+
},
|
4924
|
+
callTranscripts: {
|
4925
|
+
type: "array",
|
4926
|
+
description: "The transcripts fetched",
|
4927
|
+
items: {
|
4928
|
+
type: "object",
|
4929
|
+
description: "A transcript",
|
4930
|
+
properties: {
|
4931
|
+
callId: {
|
4932
|
+
type: "string",
|
4933
|
+
description: "The ID of the transcript",
|
4934
|
+
},
|
4935
|
+
transcript: {
|
4936
|
+
type: "array",
|
4937
|
+
description: "The transcript",
|
4938
|
+
items: {
|
4939
|
+
type: "object",
|
4940
|
+
description: "A transcript",
|
4941
|
+
properties: {
|
4942
|
+
speakerName: {
|
4943
|
+
type: "string",
|
4944
|
+
description: "The name of the speaker",
|
4945
|
+
},
|
4946
|
+
topic: {
|
4947
|
+
type: "string",
|
4948
|
+
description: "The topic of the transcript",
|
4949
|
+
},
|
4950
|
+
sentences: {
|
4951
|
+
type: "array",
|
4952
|
+
description: "The sentences in the transcript",
|
4953
|
+
items: {
|
4954
|
+
type: "object",
|
4955
|
+
description: "A sentence",
|
4956
|
+
properties: {
|
4957
|
+
start: {
|
4958
|
+
type: "number",
|
4959
|
+
description: "The start time of the sentence in seconds",
|
4960
|
+
},
|
4961
|
+
end: {
|
4962
|
+
type: "number",
|
4963
|
+
description: "The end time of the sentence in seconds",
|
4964
|
+
},
|
4965
|
+
text: {
|
4966
|
+
type: "string",
|
4967
|
+
description: "The text of the sentence",
|
4968
|
+
},
|
4969
|
+
},
|
4970
|
+
},
|
4971
|
+
},
|
4972
|
+
},
|
4973
|
+
},
|
4974
|
+
},
|
4975
|
+
},
|
4976
|
+
},
|
4977
|
+
},
|
4978
|
+
error: {
|
4979
|
+
type: "string",
|
4980
|
+
description: "The error that occurred if the transcripts weren't fetched successfully",
|
4981
|
+
},
|
4982
|
+
},
|
4983
|
+
},
|
4984
|
+
name: "getGongTranscripts",
|
4985
|
+
provider: "gong",
|
4986
|
+
};
|
4887
4987
|
exports.finnhubSymbolLookupDefinition = {
|
4888
4988
|
description: "Look up a stock symbol by name",
|
4889
4989
|
scopes: [],
|
@@ -1971,6 +1971,117 @@ export declare const googleOauthUpdatePresentationOutputSchema: z.ZodObject<{
|
|
1971
1971
|
}>;
|
1972
1972
|
export type googleOauthUpdatePresentationOutputType = z.infer<typeof googleOauthUpdatePresentationOutputSchema>;
|
1973
1973
|
export type googleOauthUpdatePresentationFunction = ActionFunction<googleOauthUpdatePresentationParamsType, AuthParamsType, googleOauthUpdatePresentationOutputType>;
|
1974
|
+
export declare const gongGetGongTranscriptsParamsSchema: z.ZodObject<{
|
1975
|
+
userRole: z.ZodString;
|
1976
|
+
trackers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
1977
|
+
startDate: z.ZodOptional<z.ZodString>;
|
1978
|
+
endDate: z.ZodOptional<z.ZodString>;
|
1979
|
+
}, "strip", z.ZodTypeAny, {
|
1980
|
+
userRole: string;
|
1981
|
+
trackers?: string[] | undefined;
|
1982
|
+
startDate?: string | undefined;
|
1983
|
+
endDate?: string | undefined;
|
1984
|
+
}, {
|
1985
|
+
userRole: string;
|
1986
|
+
trackers?: string[] | undefined;
|
1987
|
+
startDate?: string | undefined;
|
1988
|
+
endDate?: string | undefined;
|
1989
|
+
}>;
|
1990
|
+
export type gongGetGongTranscriptsParamsType = z.infer<typeof gongGetGongTranscriptsParamsSchema>;
|
1991
|
+
export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
1992
|
+
success: z.ZodBoolean;
|
1993
|
+
callTranscripts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
1994
|
+
callId: z.ZodOptional<z.ZodString>;
|
1995
|
+
transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
1996
|
+
speakerName: z.ZodOptional<z.ZodString>;
|
1997
|
+
topic: z.ZodOptional<z.ZodString>;
|
1998
|
+
sentences: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
1999
|
+
start: z.ZodOptional<z.ZodNumber>;
|
2000
|
+
end: z.ZodOptional<z.ZodNumber>;
|
2001
|
+
text: z.ZodOptional<z.ZodString>;
|
2002
|
+
}, "strip", z.ZodTypeAny, {
|
2003
|
+
text?: string | undefined;
|
2004
|
+
start?: number | undefined;
|
2005
|
+
end?: number | undefined;
|
2006
|
+
}, {
|
2007
|
+
text?: string | undefined;
|
2008
|
+
start?: number | undefined;
|
2009
|
+
end?: number | undefined;
|
2010
|
+
}>, "many">>;
|
2011
|
+
}, "strip", z.ZodTypeAny, {
|
2012
|
+
topic?: string | undefined;
|
2013
|
+
speakerName?: string | undefined;
|
2014
|
+
sentences?: {
|
2015
|
+
text?: string | undefined;
|
2016
|
+
start?: number | undefined;
|
2017
|
+
end?: number | undefined;
|
2018
|
+
}[] | undefined;
|
2019
|
+
}, {
|
2020
|
+
topic?: string | undefined;
|
2021
|
+
speakerName?: string | undefined;
|
2022
|
+
sentences?: {
|
2023
|
+
text?: string | undefined;
|
2024
|
+
start?: number | undefined;
|
2025
|
+
end?: number | undefined;
|
2026
|
+
}[] | undefined;
|
2027
|
+
}>, "many">>;
|
2028
|
+
}, "strip", z.ZodTypeAny, {
|
2029
|
+
callId?: string | undefined;
|
2030
|
+
transcript?: {
|
2031
|
+
topic?: string | undefined;
|
2032
|
+
speakerName?: string | undefined;
|
2033
|
+
sentences?: {
|
2034
|
+
text?: string | undefined;
|
2035
|
+
start?: number | undefined;
|
2036
|
+
end?: number | undefined;
|
2037
|
+
}[] | undefined;
|
2038
|
+
}[] | undefined;
|
2039
|
+
}, {
|
2040
|
+
callId?: string | undefined;
|
2041
|
+
transcript?: {
|
2042
|
+
topic?: string | undefined;
|
2043
|
+
speakerName?: string | undefined;
|
2044
|
+
sentences?: {
|
2045
|
+
text?: string | undefined;
|
2046
|
+
start?: number | undefined;
|
2047
|
+
end?: number | undefined;
|
2048
|
+
}[] | undefined;
|
2049
|
+
}[] | undefined;
|
2050
|
+
}>, "many">>;
|
2051
|
+
error: z.ZodOptional<z.ZodString>;
|
2052
|
+
}, "strip", z.ZodTypeAny, {
|
2053
|
+
success: boolean;
|
2054
|
+
error?: string | undefined;
|
2055
|
+
callTranscripts?: {
|
2056
|
+
callId?: string | undefined;
|
2057
|
+
transcript?: {
|
2058
|
+
topic?: string | undefined;
|
2059
|
+
speakerName?: string | undefined;
|
2060
|
+
sentences?: {
|
2061
|
+
text?: string | undefined;
|
2062
|
+
start?: number | undefined;
|
2063
|
+
end?: number | undefined;
|
2064
|
+
}[] | undefined;
|
2065
|
+
}[] | undefined;
|
2066
|
+
}[] | undefined;
|
2067
|
+
}, {
|
2068
|
+
success: boolean;
|
2069
|
+
error?: string | undefined;
|
2070
|
+
callTranscripts?: {
|
2071
|
+
callId?: string | undefined;
|
2072
|
+
transcript?: {
|
2073
|
+
topic?: string | undefined;
|
2074
|
+
speakerName?: string | undefined;
|
2075
|
+
sentences?: {
|
2076
|
+
text?: string | undefined;
|
2077
|
+
start?: number | undefined;
|
2078
|
+
end?: number | undefined;
|
2079
|
+
}[] | undefined;
|
2080
|
+
}[] | undefined;
|
2081
|
+
}[] | undefined;
|
2082
|
+
}>;
|
2083
|
+
export type gongGetGongTranscriptsOutputType = z.infer<typeof gongGetGongTranscriptsOutputSchema>;
|
2084
|
+
export type gongGetGongTranscriptsFunction = ActionFunction<gongGetGongTranscriptsParamsType, AuthParamsType, gongGetGongTranscriptsOutputType>;
|
1974
2085
|
export declare const finnhubSymbolLookupParamsSchema: z.ZodObject<{
|
1975
2086
|
query: z.ZodString;
|
1976
2087
|
}, "strip", z.ZodTypeAny, {
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = 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.slackListConversationsOutputSchema = exports.slackListConversationsParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
|
4
|
-
exports.
|
5
|
-
exports.
|
4
|
+
exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = exports.finnhubGetBasicFinancialsParamsSchema = exports.finnhubSymbolLookupOutputSchema = exports.finnhubSymbolLookupParamsSchema = exports.gongGetGongTranscriptsOutputSchema = exports.gongGetGongTranscriptsParamsSchema = exports.googleOauthUpdatePresentationOutputSchema = exports.googleOauthUpdatePresentationParamsSchema = exports.googleOauthCreatePresentationOutputSchema = exports.googleOauthCreatePresentationParamsSchema = exports.googleOauthUpdateSpreadsheetOutputSchema = exports.googleOauthUpdateSpreadsheetParamsSchema = exports.googleOauthCreateSpreadsheetOutputSchema = exports.googleOauthCreateSpreadsheetParamsSchema = exports.googleOauthScheduleCalendarMeetingOutputSchema = exports.googleOauthScheduleCalendarMeetingParamsSchema = exports.googleOauthUpdateDocOutputSchema = exports.googleOauthUpdateDocParamsSchema = exports.googleOauthCreateNewGoogleDocOutputSchema = exports.googleOauthCreateNewGoogleDocParamsSchema = 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 = void 0;
|
5
|
+
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 = 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 = void 0;
|
6
|
+
exports.githubListPullRequestsOutputSchema = void 0;
|
6
7
|
const zod_1 = require("zod");
|
7
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
8
9
|
authToken: zod_1.z.string().optional(),
|
@@ -1981,6 +1982,46 @@ exports.googleOauthUpdatePresentationOutputSchema = zod_1.z.object({
|
|
1981
1982
|
error: zod_1.z.string().describe("The error that occurred if the presentation was not created successfully").optional(),
|
1982
1983
|
presentationUrl: zod_1.z.string().describe("The URL of the created presentation").optional(),
|
1983
1984
|
});
|
1985
|
+
exports.gongGetGongTranscriptsParamsSchema = zod_1.z.object({
|
1986
|
+
userRole: zod_1.z.string().describe("The role of users whose transcripts are being fetched"),
|
1987
|
+
trackers: zod_1.z
|
1988
|
+
.array(zod_1.z.string().describe("The names of the trackers to fetch transcripts for"))
|
1989
|
+
.describe("The trackers to fetch transcripts for")
|
1990
|
+
.optional(),
|
1991
|
+
startDate: zod_1.z.string().describe("The start date of the transcripts to fetch in ISO 8601 format").optional(),
|
1992
|
+
endDate: zod_1.z.string().describe("The end date of the transcripts to fetch in ISO 8601 format").optional(),
|
1993
|
+
});
|
1994
|
+
exports.gongGetGongTranscriptsOutputSchema = zod_1.z.object({
|
1995
|
+
success: zod_1.z.boolean().describe("Whether the transcripts were fetched successfully"),
|
1996
|
+
callTranscripts: zod_1.z
|
1997
|
+
.array(zod_1.z
|
1998
|
+
.object({
|
1999
|
+
callId: zod_1.z.string().describe("The ID of the transcript").optional(),
|
2000
|
+
transcript: zod_1.z
|
2001
|
+
.array(zod_1.z
|
2002
|
+
.object({
|
2003
|
+
speakerName: zod_1.z.string().describe("The name of the speaker").optional(),
|
2004
|
+
topic: zod_1.z.string().describe("The topic of the transcript").optional(),
|
2005
|
+
sentences: zod_1.z
|
2006
|
+
.array(zod_1.z
|
2007
|
+
.object({
|
2008
|
+
start: zod_1.z.number().describe("The start time of the sentence in seconds").optional(),
|
2009
|
+
end: zod_1.z.number().describe("The end time of the sentence in seconds").optional(),
|
2010
|
+
text: zod_1.z.string().describe("The text of the sentence").optional(),
|
2011
|
+
})
|
2012
|
+
.describe("A sentence"))
|
2013
|
+
.describe("The sentences in the transcript")
|
2014
|
+
.optional(),
|
2015
|
+
})
|
2016
|
+
.describe("A transcript"))
|
2017
|
+
.describe("The transcript")
|
2018
|
+
.optional(),
|
2019
|
+
})
|
2020
|
+
.describe("A transcript"))
|
2021
|
+
.describe("The transcripts fetched")
|
2022
|
+
.optional(),
|
2023
|
+
error: zod_1.z.string().describe("The error that occurred if the transcripts weren't fetched successfully").optional(),
|
2024
|
+
});
|
1984
2025
|
exports.finnhubSymbolLookupParamsSchema = zod_1.z.object({
|
1985
2026
|
query: zod_1.z.string().describe("The symbol or colloquial name of the company to look up"),
|
1986
2027
|
});
|
package/dist/actions/groups.js
CHANGED
@@ -110,6 +110,10 @@ exports.ACTION_GROUPS = {
|
|
110
110
|
description: "Actions for interacting with X(formerly twitter)",
|
111
111
|
actions: [templates_1.xCreateShareXPostUrlDefinition],
|
112
112
|
},
|
113
|
+
GONG: {
|
114
|
+
description: "Actions for interacting with Gong",
|
115
|
+
actions: [templates_1.gongGetGongTranscriptsDefinition],
|
116
|
+
},
|
113
117
|
FINNHUB: {
|
114
118
|
description: "Action for interacting with Finnhub for stock market data",
|
115
119
|
actions: [templates_1.finnhubSymbolLookupDefinition, templates_1.finnhubGetBasicFinancialsDefinition],
|
@@ -0,0 +1,237 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
19
|
+
var ownKeys = function(o) {
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
21
|
+
var ar = [];
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
23
|
+
return ar;
|
24
|
+
};
|
25
|
+
return ownKeys(o);
|
26
|
+
};
|
27
|
+
return function (mod) {
|
28
|
+
if (mod && mod.__esModule) return mod;
|
29
|
+
var result = {};
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
31
|
+
__setModuleDefault(result, mod);
|
32
|
+
return result;
|
33
|
+
};
|
34
|
+
})();
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
42
|
+
});
|
43
|
+
};
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
45
|
+
const axios_1 = __importStar(require("axios"));
|
46
|
+
const zod_1 = require("zod");
|
47
|
+
const UserSchema = zod_1.z.object({
|
48
|
+
id: zod_1.z.string(),
|
49
|
+
name: zod_1.z.string(),
|
50
|
+
title: zod_1.z.string(),
|
51
|
+
});
|
52
|
+
const TrackerSchema = zod_1.z.object({
|
53
|
+
id: zod_1.z.string(),
|
54
|
+
name: zod_1.z.string(),
|
55
|
+
});
|
56
|
+
const CallSchema = zod_1.z.object({
|
57
|
+
id: zod_1.z.string(),
|
58
|
+
primaryUserId: zod_1.z.string().optional(),
|
59
|
+
started: zod_1.z.string().optional(),
|
60
|
+
});
|
61
|
+
const SentenceSchema = zod_1.z.object({
|
62
|
+
start: zod_1.z.number(),
|
63
|
+
end: zod_1.z.number(),
|
64
|
+
text: zod_1.z.string(),
|
65
|
+
});
|
66
|
+
const TranscriptSchema = zod_1.z.object({
|
67
|
+
callId: zod_1.z.string(),
|
68
|
+
transcript: zod_1.z.array(zod_1.z.object({
|
69
|
+
speakerId: zod_1.z.string(),
|
70
|
+
topic: zod_1.z.string(),
|
71
|
+
sentences: zod_1.z.array(SentenceSchema),
|
72
|
+
})),
|
73
|
+
});
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
75
|
+
const GongResponseSchema = zod_1.z.object({
|
76
|
+
users: zod_1.z.array(UserSchema).optional(),
|
77
|
+
trackers: zod_1.z.array(TrackerSchema).optional(),
|
78
|
+
calls: zod_1.z.array(CallSchema).optional(),
|
79
|
+
callTranscripts: zod_1.z.array(TranscriptSchema).optional(),
|
80
|
+
cursor: zod_1.z.string().optional(),
|
81
|
+
});
|
82
|
+
function getUsers(authToken_1) {
|
83
|
+
return __awaiter(this, arguments, void 0, function* (authToken, params = {}) {
|
84
|
+
let results = [];
|
85
|
+
let cursor = undefined;
|
86
|
+
do {
|
87
|
+
const response = yield axios_1.default.post(`https://api.gong.io/v2/users/extensive` + (cursor ? `?cursor=${cursor}` : ""), {
|
88
|
+
filter: Object.assign({}, params),
|
89
|
+
}, {
|
90
|
+
headers: {
|
91
|
+
Authorization: `Bearer ${authToken}`,
|
92
|
+
"Content-Type": "application/json",
|
93
|
+
},
|
94
|
+
});
|
95
|
+
if (!response) {
|
96
|
+
return results;
|
97
|
+
}
|
98
|
+
const parsedItems = zod_1.z.array(UserSchema).safeParse(response.data.users);
|
99
|
+
if (parsedItems.success) {
|
100
|
+
results = [...results, ...parsedItems.data];
|
101
|
+
}
|
102
|
+
else {
|
103
|
+
return results;
|
104
|
+
}
|
105
|
+
cursor = response.data.cursor;
|
106
|
+
} while (cursor);
|
107
|
+
return results;
|
108
|
+
});
|
109
|
+
}
|
110
|
+
function getTrackers(authToken_1) {
|
111
|
+
return __awaiter(this, arguments, void 0, function* (authToken, params = {}) {
|
112
|
+
let results = [];
|
113
|
+
let cursor = undefined;
|
114
|
+
do {
|
115
|
+
const response = yield axios_1.default.get(`https://api.gong.io/v2/settings/trackers` + (cursor ? `?cursor=${cursor}` : ""), {
|
116
|
+
headers: {
|
117
|
+
Authorization: `Bearer ${authToken}`,
|
118
|
+
"Content-Type": "application/json",
|
119
|
+
},
|
120
|
+
params: {
|
121
|
+
filter: Object.assign({}, params),
|
122
|
+
},
|
123
|
+
});
|
124
|
+
if (!response) {
|
125
|
+
return results;
|
126
|
+
}
|
127
|
+
const parsedItems = zod_1.z.array(TrackerSchema).safeParse(response.data.trackers);
|
128
|
+
if (parsedItems.success) {
|
129
|
+
results = [...results, ...parsedItems.data];
|
130
|
+
}
|
131
|
+
else {
|
132
|
+
return results;
|
133
|
+
}
|
134
|
+
cursor = response.data.cursor;
|
135
|
+
} while (cursor);
|
136
|
+
return results;
|
137
|
+
});
|
138
|
+
}
|
139
|
+
function getCalls(authToken_1) {
|
140
|
+
return __awaiter(this, arguments, void 0, function* (authToken, params = {}) {
|
141
|
+
let results = [];
|
142
|
+
let cursor = undefined;
|
143
|
+
do {
|
144
|
+
const response = yield axios_1.default.post(`https://api.gong.io/v2/calls/extensive` + (cursor ? `?cursor=${cursor}` : ""), {
|
145
|
+
filter: Object.assign({}, params),
|
146
|
+
}, {
|
147
|
+
headers: {
|
148
|
+
Authorization: `Bearer ${authToken}`,
|
149
|
+
"Content-Type": "application/json",
|
150
|
+
},
|
151
|
+
});
|
152
|
+
if (!response) {
|
153
|
+
return results;
|
154
|
+
}
|
155
|
+
const parsedItems = zod_1.z.array(CallSchema).safeParse(response.data.calls);
|
156
|
+
if (parsedItems.success) {
|
157
|
+
results = [...results, ...parsedItems.data];
|
158
|
+
}
|
159
|
+
else {
|
160
|
+
return results;
|
161
|
+
}
|
162
|
+
cursor = response.data.cursor;
|
163
|
+
} while (cursor);
|
164
|
+
return results;
|
165
|
+
});
|
166
|
+
}
|
167
|
+
function getTranscripts(authToken_1) {
|
168
|
+
return __awaiter(this, arguments, void 0, function* (authToken, params = {}) {
|
169
|
+
let results = [];
|
170
|
+
let cursor = undefined;
|
171
|
+
do {
|
172
|
+
const response = yield axios_1.default.post(`https://api.gong.io/v2/transcript/calls/transcripts` + (cursor ? `?cursor=${cursor}` : ""), {
|
173
|
+
filter: Object.assign({}, params),
|
174
|
+
}, {
|
175
|
+
headers: {
|
176
|
+
Authorization: `Bearer ${authToken}`,
|
177
|
+
"Content-Type": "application/json",
|
178
|
+
},
|
179
|
+
});
|
180
|
+
if (!response) {
|
181
|
+
return results;
|
182
|
+
}
|
183
|
+
const parsedItems = zod_1.z.array(TranscriptSchema).safeParse(response.data.callTranscripts);
|
184
|
+
if (parsedItems.success) {
|
185
|
+
results = [...results, ...parsedItems.data];
|
186
|
+
}
|
187
|
+
else {
|
188
|
+
return results;
|
189
|
+
}
|
190
|
+
cursor = response.data.cursor;
|
191
|
+
} while (cursor);
|
192
|
+
return results;
|
193
|
+
});
|
194
|
+
}
|
195
|
+
// Retrieves transcripts from Gong based on the provided parameters
|
196
|
+
const getGongTranscripts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
197
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
198
|
+
if (!authParams.authToken) {
|
199
|
+
return {
|
200
|
+
success: false,
|
201
|
+
error: "No auth token provided",
|
202
|
+
};
|
203
|
+
}
|
204
|
+
try {
|
205
|
+
const gongUsers = yield getUsers(authParams.authToken, { userRole: params.userRole });
|
206
|
+
const filteredGongUsers = gongUsers.filter(user => user.title === params.userRole);
|
207
|
+
const trackers = yield getTrackers(authParams.authToken, {});
|
208
|
+
const filteredTrackers = trackers.filter(tracker => { var _a; return ((_a = params.trackers) !== null && _a !== void 0 ? _a : []).includes(tracker.name); });
|
209
|
+
// Get calls owned by the users and filtered by the trackers
|
210
|
+
const calls = yield getCalls(authParams.authToken, {
|
211
|
+
fromDateTime: (_b = params.startDate) !== null && _b !== void 0 ? _b : "",
|
212
|
+
toDateTime: (_c = params.endDate) !== null && _c !== void 0 ? _c : "",
|
213
|
+
primaryUserIds: filteredGongUsers.length > 0 ? filteredGongUsers.map(user => user.id) : undefined,
|
214
|
+
trackerIds: filteredTrackers.length > 0 ? filteredTrackers.map(tracker => tracker.id) : undefined,
|
215
|
+
});
|
216
|
+
// Get transcripts for the calls we found
|
217
|
+
const callTranscripts = yield getTranscripts(authParams.authToken, {
|
218
|
+
fromDateTime: (_d = params.startDate) !== null && _d !== void 0 ? _d : "",
|
219
|
+
toDateTime: (_e = params.endDate) !== null && _e !== void 0 ? _e : "",
|
220
|
+
callIds: calls.map(call => call.id),
|
221
|
+
});
|
222
|
+
// Map speaker IDs to names in the transcripts
|
223
|
+
const userIdToNameMap = Object.fromEntries(filteredGongUsers.map(user => [user.id, user.name]));
|
224
|
+
const callTranscriptsWithNames = callTranscripts.map(callTranscript => (Object.assign(Object.assign({}, callTranscript), { transcript: callTranscript.transcript.map((transcript) => (Object.assign(Object.assign({}, transcript), { speakerName: userIdToNameMap[transcript.speakerId] || transcript.speakerId }))) })));
|
225
|
+
return {
|
226
|
+
success: true,
|
227
|
+
callTranscripts: callTranscriptsWithNames,
|
228
|
+
};
|
229
|
+
}
|
230
|
+
catch (error) {
|
231
|
+
return {
|
232
|
+
success: false,
|
233
|
+
error: error instanceof axios_1.AxiosError ? ((_h = (_g = (_f = error.response) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.errors) !== null && _h !== void 0 ? _h : error.message) : error,
|
234
|
+
};
|
235
|
+
}
|
236
|
+
});
|
237
|
+
exports.default = getGongTranscripts;
|
@@ -0,0 +1,43 @@
|
|
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 getSalesforceRecordByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
+
const { authToken, baseUrl } = authParams;
|
15
|
+
const { query, limit } = params;
|
16
|
+
if (!authToken || !baseUrl) {
|
17
|
+
return {
|
18
|
+
success: false,
|
19
|
+
error: "authToken and baseUrl are required for Salesforce API",
|
20
|
+
};
|
21
|
+
}
|
22
|
+
// The API limits the maximum number of records returned to 2000, the limit lets the user set a smaller custom limit
|
23
|
+
const url = `${baseUrl}/services/data/v56.0/query/?q=${encodeURIComponent(query + " LIMIT " + (limit != undefined && limit <= 2000 ? limit : 2000))}`;
|
24
|
+
try {
|
25
|
+
const response = yield axiosClient_1.axiosClient.get(url, {
|
26
|
+
headers: {
|
27
|
+
Authorization: `Bearer ${authToken}`,
|
28
|
+
},
|
29
|
+
});
|
30
|
+
return {
|
31
|
+
success: true,
|
32
|
+
records: response.data,
|
33
|
+
};
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
console.error("Error retrieving Salesforce record:", error);
|
37
|
+
return {
|
38
|
+
success: false,
|
39
|
+
error: error instanceof Error ? error.message : "An unknown error occurred",
|
40
|
+
};
|
41
|
+
}
|
42
|
+
});
|
43
|
+
exports.default = getSalesforceRecordByQuery;
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@credal/actions",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.68",
|
4
4
|
"description": "AI Actions by Credal AI",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"scripts": {
|
8
8
|
"test": "npx ts-node -r tsconfig-paths/register --project tsconfig.json ",
|
9
|
+
"jest-test": "jest",
|
9
10
|
"build": "tsc",
|
10
11
|
"dev": "ts-node-dev -r tsconfig-paths/register src/app.ts",
|
11
12
|
"generate:types": "ts-node -r tsconfig-paths/register src/actions/parse.ts",
|
@@ -24,6 +25,7 @@
|
|
24
25
|
"license": "ISC",
|
25
26
|
"devDependencies": {
|
26
27
|
"@eslint/js": "^9.16.0",
|
28
|
+
"@jest/globals": "^29.7.0",
|
27
29
|
"@types/js-yaml": "^4.0.9",
|
28
30
|
"@types/jsonwebtoken": "^9.0.9",
|
29
31
|
"@types/node": "^22.10.1",
|
@@ -34,6 +36,7 @@
|
|
34
36
|
"globals": "^15.13.0",
|
35
37
|
"js-yaml": "^4.1.0",
|
36
38
|
"prettier": "^3.4.2",
|
39
|
+
"ts-jest": "^29.3.2",
|
37
40
|
"ts-morph": "^24.0.0",
|
38
41
|
"ts-node-dev": "^2.0.0",
|
39
42
|
"tsconfig-paths": "^4.2.0",
|
@@ -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;
|