@credal/actions 0.2.172 → 0.2.173
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/definitions.d.ts +5 -0
- package/dist/actions/autogen/definitions.js +132 -0
- package/dist/actions/autogen/templates.js +176 -0
- package/dist/actions/autogen/types.d.ts +6 -0
- package/dist/actions/autogen/types.js +14 -23
- package/dist/actions/definitions.js +35 -0
- package/dist/actions/groups.js +14 -1
- package/dist/actions/invokeMapper.d.ts +9 -0
- package/dist/actions/invokeMapper.js +33 -0
- package/dist/actions/parse.d.ts +3 -0
- package/dist/actions/parse.js +94 -1
- package/dist/actions/providers/confluence/updatePage.d.ts +3 -0
- package/dist/actions/providers/confluence/updatePage.js +43 -0
- package/dist/actions/providers/google-oauth/getSheetValue.d.ts +3 -0
- package/dist/actions/providers/google-oauth/getSheetValue.js +50 -0
- package/dist/actions/providers/google-oauth/getSheetValues.d.ts +3 -0
- package/dist/actions/providers/google-oauth/getSheetValues.js +50 -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/googlemaps/nearbysearch.d.ts +3 -0
- package/dist/actions/providers/googlemaps/nearbysearch.js +96 -0
- package/dist/actions/providers/jamf/types.d.ts +8 -0
- package/dist/actions/providers/jamf/types.js +7 -0
- package/dist/actions/providers/jira/createTicket.d.ts +3 -0
- package/dist/actions/providers/jira/createTicket.js +34 -0
- package/dist/actions/providers/slack/archiveChannel.js +9 -2
- package/dist/actions/providers/slack/listConversations.d.ts +1 -1
- package/dist/actions/providers/slack/list_conversations.d.ts +3 -0
- package/dist/actions/providers/slack/list_conversations.js +60 -0
- package/dist/actions/providers/slack/summarizeChannel.d.ts +3 -0
- package/dist/actions/providers/slack/summarizeChannel.js +51 -0
- package/dist/actions/schema.js +6 -0
- package/dist/actions/types.js +2 -0
- package/dist/main.js +11 -0
- package/package.json +1 -1
|
@@ -101,6 +101,12 @@ export declare const AuthParamsSchema: z.ZodObject<{
|
|
|
101
101
|
redirectUri?: string | undefined;
|
|
102
102
|
}>;
|
|
103
103
|
export type AuthParamsType = z.infer<typeof AuthParamsSchema>;
|
|
104
|
+
export declare const ActionTagSchema: z.ZodEnum<["read", "write"]>;
|
|
105
|
+
export type ActionTag = z.infer<typeof ActionTagSchema>;
|
|
106
|
+
export declare const ACTION_TAGS: readonly ["read", "write"];
|
|
107
|
+
export declare const ParameterTagSchema: z.ZodEnum<["recommend-predefined"]>;
|
|
108
|
+
export type ParameterTag = z.infer<typeof ParameterTagSchema>;
|
|
109
|
+
export declare const PARAMETER_TAGS: readonly ["recommend-predefined"];
|
|
104
110
|
export declare const genericFillTemplateParamsSchema: z.ZodObject<{
|
|
105
111
|
template: z.ZodString;
|
|
106
112
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -57,6 +57,10 @@ export const AuthParamsSchema = z.object({
|
|
|
57
57
|
redirectUri: z.string().optional(),
|
|
58
58
|
userEmail: z.string().optional(),
|
|
59
59
|
});
|
|
60
|
+
export const ActionTagSchema = z.enum(["read", "write"]);
|
|
61
|
+
export const ACTION_TAGS = ["read", "write"];
|
|
62
|
+
export const ParameterTagSchema = z.enum(["recommend-predefined"]);
|
|
63
|
+
export const PARAMETER_TAGS = ["recommend-predefined"];
|
|
60
64
|
export const genericFillTemplateParamsSchema = z.object({
|
|
61
65
|
template: z.string().describe("The template string to be processed and returned"),
|
|
62
66
|
});
|
|
@@ -2185,8 +2189,7 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2185
2189
|
const schemas = [
|
|
2186
2190
|
z
|
|
2187
2191
|
.object({
|
|
2188
|
-
addSheet: z
|
|
2189
|
-
.object({
|
|
2192
|
+
addSheet: z.object({
|
|
2190
2193
|
properties: z
|
|
2191
2194
|
.object({
|
|
2192
2195
|
title: z.string().describe("The title of the new sheet").optional(),
|
|
@@ -2198,21 +2201,17 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2198
2201
|
.optional(),
|
|
2199
2202
|
})
|
|
2200
2203
|
.optional(),
|
|
2201
|
-
})
|
|
2202
|
-
.optional(),
|
|
2204
|
+
}),
|
|
2203
2205
|
})
|
|
2204
2206
|
.describe("Add or update a sheet"),
|
|
2205
2207
|
z
|
|
2206
2208
|
.object({
|
|
2207
|
-
deleteSheet: z
|
|
2208
|
-
.object({ sheetId: z.number().describe("The ID of the sheet to delete").optional() })
|
|
2209
|
-
.optional(),
|
|
2209
|
+
deleteSheet: z.object({ sheetId: z.number().describe("The ID of the sheet to delete").optional() }),
|
|
2210
2210
|
})
|
|
2211
2211
|
.describe("Delete a sheet"),
|
|
2212
2212
|
z
|
|
2213
2213
|
.object({
|
|
2214
|
-
updateCells: z
|
|
2215
|
-
.object({
|
|
2214
|
+
updateCells: z.object({
|
|
2216
2215
|
range: z
|
|
2217
2216
|
.object({
|
|
2218
2217
|
sheetId: z.number().describe("The ID of the sheet").optional(),
|
|
@@ -2238,14 +2237,12 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2238
2237
|
.optional(),
|
|
2239
2238
|
}))
|
|
2240
2239
|
.optional(),
|
|
2241
|
-
})
|
|
2242
|
-
.optional(),
|
|
2240
|
+
}),
|
|
2243
2241
|
})
|
|
2244
2242
|
.describe("Update cells in a range"),
|
|
2245
2243
|
z
|
|
2246
2244
|
.object({
|
|
2247
|
-
updateSheetProperties: z
|
|
2248
|
-
.object({
|
|
2245
|
+
updateSheetProperties: z.object({
|
|
2249
2246
|
properties: z
|
|
2250
2247
|
.object({
|
|
2251
2248
|
sheetId: z.number().describe("The ID of the sheet to update").optional(),
|
|
@@ -2264,14 +2261,12 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2264
2261
|
.string()
|
|
2265
2262
|
.describe("The fields to update (comma-separated list using JSON field paths)")
|
|
2266
2263
|
.optional(),
|
|
2267
|
-
})
|
|
2268
|
-
.optional(),
|
|
2264
|
+
}),
|
|
2269
2265
|
})
|
|
2270
2266
|
.describe("Update sheet properties"),
|
|
2271
2267
|
z
|
|
2272
2268
|
.object({
|
|
2273
|
-
updateSpreadsheetProperties: z
|
|
2274
|
-
.object({
|
|
2269
|
+
updateSpreadsheetProperties: z.object({
|
|
2275
2270
|
properties: z
|
|
2276
2271
|
.object({
|
|
2277
2272
|
title: z.string().describe("The title of the spreadsheet").optional(),
|
|
@@ -2326,10 +2321,7 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2326
2321
|
fontSize: z.number().describe("The size of the font in points").optional(),
|
|
2327
2322
|
bold: z.boolean().describe("Whether the text is bold").optional(),
|
|
2328
2323
|
italic: z.boolean().describe("Whether the text is italic").optional(),
|
|
2329
|
-
strikethrough: z
|
|
2330
|
-
.boolean()
|
|
2331
|
-
.describe("Whether the text has a strikethrough")
|
|
2332
|
-
.optional(),
|
|
2324
|
+
strikethrough: z.boolean().describe("Whether the text has a strikethrough").optional(),
|
|
2333
2325
|
underline: z.boolean().describe("Whether the text is underlined").optional(),
|
|
2334
2326
|
})
|
|
2335
2327
|
.optional(),
|
|
@@ -2341,8 +2333,7 @@ export const googleOauthUpdateSpreadsheetParamsSchema = z.object({
|
|
|
2341
2333
|
.string()
|
|
2342
2334
|
.describe("The fields to update (comma-separated list using JSON field paths)")
|
|
2343
2335
|
.optional(),
|
|
2344
|
-
})
|
|
2345
|
-
.optional(),
|
|
2336
|
+
}),
|
|
2346
2337
|
})
|
|
2347
2338
|
.describe("Update spreadsheet properties"),
|
|
2348
2339
|
];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mathAddDefinition = exports.slackSendMessageDefinition = void 0;
|
|
4
|
+
exports.slackSendMessageDefinition = {
|
|
5
|
+
name: "send_message",
|
|
6
|
+
description: "Sends a message to a Slack channel",
|
|
7
|
+
parameters: {
|
|
8
|
+
"channel": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The Slack channel to send the message to (e.g., \\#general, \\#alerts)",
|
|
11
|
+
"required": true
|
|
12
|
+
},
|
|
13
|
+
"message": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The message content to send to Slack. Can include markdown formatting.",
|
|
16
|
+
"required": true
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.mathAddDefinition = {
|
|
21
|
+
name: "add",
|
|
22
|
+
description: "Adds two numbers together",
|
|
23
|
+
parameters: {
|
|
24
|
+
"a": {
|
|
25
|
+
"type": "number",
|
|
26
|
+
"description": "The first number to add",
|
|
27
|
+
"required": true
|
|
28
|
+
},
|
|
29
|
+
"b": {
|
|
30
|
+
"type": "number",
|
|
31
|
+
"description": "The second number to add",
|
|
32
|
+
"required": true
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
package/dist/actions/groups.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, } from "./autogen/templates.js";
|
|
1
|
+
import { genericFillTemplateDefinition, confluenceOverwritePageDefinition, googlemapsValidateAddressDefinition, mathAddDefinition, mongoInsertMongoDocDefinition, slackSendMessageDefinition, slackGetChannelMessagesDefinition, slackCreateChannelDefinition, slackArchiveChannelDefinition, snowflakeGetRowByFieldValueDefinition, zendeskCreateZendeskTicketDefinition, zendeskListZendeskTicketsDefinition, zendeskGetTicketDetailsDefinition, zendeskUpdateTicketStatusDefinition, zendeskAddCommentToTicketDefinition, zendeskAssignTicketDefinition, openstreetmapGetLatitudeLongitudeFromLocationDefinition, nwsGetForecastForLocationDefinition, jiraAssignJiraTicketDefinition, jiraCommentJiraTicketDefinition, jiraCreateJiraTicketDefinition, jiraGetJiraTicketDetailsDefinition, jiraGetJiraTicketHistoryDefinition, jiraUpdateJiraTicketDetailsDefinition, jiraUpdateJiraTicketStatusDefinition, jiraGetServiceDesksDefinition, jiraCreateServiceDeskRequestDefinition, googlemapsNearbysearchRestaurantsDefinition, firecrawlScrapeUrlDefinition, resendSendEmailDefinition, linkedinCreateShareLinkedinPostUrlDefinition, googleOauthCreateNewGoogleDocDefinition, xCreateShareXPostUrlDefinition, firecrawlScrapeTweetDataWithNitterDefinition, finnhubSymbolLookupDefinition, finnhubGetBasicFinancialsDefinition, confluenceFetchPageContentDefinition, snowflakeRunSnowflakeQueryDefinition, lookerEnableUserByEmailDefinition, googleOauthUpdateDocDefinition, googleOauthScheduleCalendarMeetingDefinition, googleOauthListCalendarsDefinition, googleOauthListCalendarEventsDefinition, googleOauthUpdateCalendarEventDefinition, googleOauthDeleteCalendarEventDefinition, googleOauthCreateSpreadsheetDefinition, googleOauthUpdateSpreadsheetDefinition, googleOauthCreatePresentationDefinition, googleOauthUpdatePresentationDefinition, googleOauthSearchDriveByKeywordsDefinition, googlemailSearchGmailMessagesDefinition, googlemailListGmailThreadsDefinition, googleOauthListGroupsDefinition, googleOauthGetGroupDefinition, googleOauthListGroupMembersDefinition, googleOauthHasGroupMemberDefinition, googleOauthAddGroupMemberDefinition, googleOauthDeleteGroupMemberDefinition, salesforceUpdateRecordDefinition, salesforceCreateCaseDefinition, salesforceGenerateSalesReportDefinition, salesforceGetRecordDefinition, salesforceGetSalesforceRecordsByQueryDefinition, microsoftMessageTeamsChatDefinition, microsoftMessageTeamsChannelDefinition, asanaCommentTaskDefinition, asanaCreateTaskDefinition, asanaUpdateTaskDefinition, asanaSearchTasksDefinition, githubCreateOrUpdateFileDefinition, githubCreateBranchDefinition, githubCreatePullRequestDefinition, microsoftUpdateSpreadsheetDefinition, microsoftUpdateDocumentDefinition, microsoftCreateDocumentDefinition, microsoftGetDocumentDefinition, salesforceFetchSalesforceSchemaByObjectDefinition, firecrawlDeepResearchDefinition, jiraGetJiraIssuesByQueryDefinition, githubListPullRequestsDefinition, salesforceCreateRecordDefinition, ashbyCreateNoteDefinition, ashbyGetCandidateInfoDefinition, ashbyListCandidatesDefinition, ashbyListCandidateNotesDefinition, ashbySearchCandidatesDefinition, ashbyCreateCandidateDefinition, ashbyUpdateCandidateDefinition, ashbyAddCandidateToProjectDefinition, bingGetTopNSearchResultUrlsDefinition, gongGetGongTranscriptsDefinition, kandjiGetFVRecoveryKeyForDeviceDefinition, asanaListAsanaTasksByProjectDefinition, notionSearchByTitleDefinition, asanaGetTasksDetailsDefinition, linearGetIssueDetailsDefinition, linearGetProjectsDefinition, linearGetProjectDetailsDefinition, linearGetTeamDetailsDefinition, linearGetTeamsDefinition, jamfGetJamfComputerInventoryDefinition, jamfGetJamfFileVaultRecoveryKeyDefinition, oktaListOktaUsersDefinition, oktaGetOktaUserDefinition, oktaListOktaUserGroupsDefinition, oktaListOktaGroupsDefinition, oktaGetOktaGroupDefinition, oktaListOktaGroupMembersDefinition, oktaRemoveUserFromGroupDefinition, oktaAddUserToGroupDefinition, oktaResetPasswordDefinition, oktaResetMFADefinition, oktaListMFADefinition, jamfGetJamfUserComputerIdDefinition, jamfLockJamfComputerByIdDefinition, oktaTriggerOktaWorkflowDefinition, jiraOrgAssignJiraTicketDefinition, jiraOrgCreateJiraTicketDefinition, jiraOrgCommentJiraTicketDefinition, jiraOrgGetJiraTicketDetailsDefinition, jiraOrgGetJiraTicketHistoryDefinition, jiraOrgUpdateJiraTicketDetailsDefinition, jiraOrgUpdateJiraTicketStatusDefinition, jiraOrgGetJiraIssuesByQueryDefinition, googleOauthGetDriveFileContentByIdDefinition, googleOauthSearchDriveByQueryDefinition, googleOauthSearchDriveByQueryAndGetFileContentDefinition, githubGetFileContentDefinition, githubListDirectoryDefinition, } from "./autogen/templates.js";
|
|
2
2
|
export const ACTION_GROUPS = {
|
|
3
3
|
GENERIC: {
|
|
4
4
|
description: "Generic utility actions",
|
|
@@ -47,6 +47,7 @@ export const ACTION_GROUPS = {
|
|
|
47
47
|
googleOauthUpdatePresentationDefinition,
|
|
48
48
|
googleOauthSearchDriveByKeywordsDefinition,
|
|
49
49
|
googleOauthSearchDriveByQueryDefinition,
|
|
50
|
+
googleOauthSearchDriveByQueryAndGetFileContentDefinition,
|
|
50
51
|
googleOauthGetDriveFileContentByIdDefinition,
|
|
51
52
|
],
|
|
52
53
|
},
|
|
@@ -198,6 +199,8 @@ export const ACTION_GROUPS = {
|
|
|
198
199
|
githubCreateBranchDefinition,
|
|
199
200
|
githubCreatePullRequestDefinition,
|
|
200
201
|
githubListPullRequestsDefinition,
|
|
202
|
+
githubGetFileContentDefinition,
|
|
203
|
+
githubListDirectoryDefinition,
|
|
201
204
|
],
|
|
202
205
|
},
|
|
203
206
|
ASHBY: {
|
|
@@ -245,4 +248,14 @@ export const ACTION_GROUPS = {
|
|
|
245
248
|
oktaTriggerOktaWorkflowDefinition,
|
|
246
249
|
],
|
|
247
250
|
},
|
|
251
|
+
LINEAR: {
|
|
252
|
+
description: "Actions for interacting with Linear",
|
|
253
|
+
actions: [
|
|
254
|
+
linearGetIssueDetailsDefinition,
|
|
255
|
+
linearGetProjectsDefinition,
|
|
256
|
+
linearGetProjectDetailsDefinition,
|
|
257
|
+
linearGetTeamDetailsDefinition,
|
|
258
|
+
linearGetTeamsDefinition,
|
|
259
|
+
],
|
|
260
|
+
},
|
|
248
261
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ActionFunction } from "./autogen/types";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
interface ActionFunctionComponents {
|
|
4
|
+
fn: ActionFunction<any, any, any>;
|
|
5
|
+
paramsSchema: z.ZodSchema;
|
|
6
|
+
outputSchema: z.ZodSchema;
|
|
7
|
+
}
|
|
8
|
+
export declare const FunctionMapper: Record<string, Record<string, ActionFunctionComponents>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.FunctionMapper = void 0;
|
|
7
|
+
const add_1 = __importDefault(require("./providers/math/add"));
|
|
8
|
+
const list_conversations_1 = __importDefault(require("./providers/slack/list_conversations"));
|
|
9
|
+
const updatePage_1 = __importDefault(require("./providers/confluence/updatePage"));
|
|
10
|
+
const types_1 = require("./autogen/types");
|
|
11
|
+
exports.FunctionMapper = {
|
|
12
|
+
math: {
|
|
13
|
+
add: {
|
|
14
|
+
fn: add_1.default,
|
|
15
|
+
paramsSchema: types_1.mathAddParamsSchema,
|
|
16
|
+
outputSchema: types_1.mathAddOutputSchema,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
slack: {
|
|
20
|
+
listConversations: {
|
|
21
|
+
fn: list_conversations_1.default,
|
|
22
|
+
paramsSchema: types_1.slackListConversationsParamsSchema,
|
|
23
|
+
outputSchema: types_1.slackListConversationsOutputSchema,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
confluence: {
|
|
27
|
+
updatePage: {
|
|
28
|
+
fn: updatePage_1.default,
|
|
29
|
+
paramsSchema: types_1.confluenceUpdatePageParamsSchema,
|
|
30
|
+
outputSchema: types_1.confluenceUpdatePageOutputSchema,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
};
|
package/dist/actions/parse.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
declare const actionTemplateSchema: z.ZodObject<{
|
|
3
3
|
description: z.ZodString;
|
|
4
4
|
scopes: z.ZodArray<z.ZodString, "many">;
|
|
5
|
+
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<["read", "write"]>, "many">>>;
|
|
5
6
|
parameters: z.ZodOptional<z.ZodObject<{
|
|
6
7
|
type: z.ZodString;
|
|
7
8
|
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -34,6 +35,7 @@ declare const actionTemplateSchema: z.ZodObject<{
|
|
|
34
35
|
}, "strip", z.ZodTypeAny, {
|
|
35
36
|
description: string;
|
|
36
37
|
scopes: string[];
|
|
38
|
+
tags: ("read" | "write")[];
|
|
37
39
|
name: string;
|
|
38
40
|
provider: string;
|
|
39
41
|
parameters?: {
|
|
@@ -51,6 +53,7 @@ declare const actionTemplateSchema: z.ZodObject<{
|
|
|
51
53
|
scopes: string[];
|
|
52
54
|
name: string;
|
|
53
55
|
provider: string;
|
|
56
|
+
tags?: ("read" | "write")[] | undefined;
|
|
54
57
|
parameters?: {
|
|
55
58
|
type: string;
|
|
56
59
|
required?: string[] | undefined;
|
package/dist/actions/parse.js
CHANGED
|
@@ -15,14 +15,25 @@ import { Project, VariableDeclarationKind } from "ts-morph";
|
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { snakeToPascal } from "../utils/string.js";
|
|
17
17
|
// TODO support oneOf correctly
|
|
18
|
+
// Tag enum definitions - must be defined before schemas for validation
|
|
19
|
+
const actionTagValues = [
|
|
20
|
+
"read", // this action is read-only in the source system
|
|
21
|
+
"write", // this action executes writes in the source system
|
|
22
|
+
];
|
|
23
|
+
const parameterTagValues = [
|
|
24
|
+
"recommend-predefined", // we recommend that this parameter is predefined by the user versus AI generated at runtime
|
|
25
|
+
];
|
|
18
26
|
const jsonObjectSchema = z.object({
|
|
19
27
|
type: z.string(),
|
|
20
28
|
required: z.array(z.string()).optional(),
|
|
21
29
|
properties: z.record(z.string(), z.any()).optional(), // Permissive for now, validate using JSON schema later
|
|
22
30
|
});
|
|
31
|
+
const parameterTagEnum = z.enum([...parameterTagValues]);
|
|
32
|
+
const actionTagEnum = z.enum([...actionTagValues]);
|
|
23
33
|
const actionSchema = z.object({
|
|
24
34
|
description: z.string(),
|
|
25
35
|
scopes: z.array(z.string()),
|
|
36
|
+
tags: z.array(actionTagEnum).optional().default([]),
|
|
26
37
|
parameters: jsonObjectSchema.optional(),
|
|
27
38
|
output: jsonObjectSchema.optional(),
|
|
28
39
|
});
|
|
@@ -65,6 +76,8 @@ function validateObject(object) {
|
|
|
65
76
|
strictTuples: true,
|
|
66
77
|
strictRequired: true,
|
|
67
78
|
});
|
|
79
|
+
// Add custom keyword - just allow it, we'll validate manually
|
|
80
|
+
ajv.addKeyword("tags");
|
|
68
81
|
// validate schema and check required fields
|
|
69
82
|
const validParameters = ajv.validateSchema(object);
|
|
70
83
|
if (!validParameters) {
|
|
@@ -79,6 +92,20 @@ function validateObject(object) {
|
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
}
|
|
95
|
+
// Validate tags in property schemas using Zod
|
|
96
|
+
if (object.properties) {
|
|
97
|
+
for (const [propName, propSchema] of Object.entries(object.properties)) {
|
|
98
|
+
if (propSchema && typeof propSchema === "object" && "tags" in propSchema) {
|
|
99
|
+
const tags = propSchema.tags;
|
|
100
|
+
if (tags !== undefined) {
|
|
101
|
+
const result = z.array(parameterTagEnum).safeParse(tags);
|
|
102
|
+
if (!result.success) {
|
|
103
|
+
throw new Error(`Property "${propName}" has invalid tags: ${result.error.errors.map(e => e.message).join(", ")}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
82
109
|
});
|
|
83
110
|
}
|
|
84
111
|
function addActionTypes(_a) {
|
|
@@ -183,8 +210,67 @@ function generateTypes(_a) {
|
|
|
183
210
|
type: "z.infer<typeof AuthParamsSchema>",
|
|
184
211
|
isExported: true,
|
|
185
212
|
});
|
|
213
|
+
// ActionTag enum for action-level tags (using values defined at top of file)
|
|
214
|
+
typesFile.addVariableStatement({
|
|
215
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
216
|
+
isExported: true,
|
|
217
|
+
declarations: [
|
|
218
|
+
{
|
|
219
|
+
name: "ActionTagSchema",
|
|
220
|
+
initializer: `z.enum([${actionTagValues.map(t => `"${t}"`).join(", ")}])`,
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
});
|
|
224
|
+
typesFile.addTypeAlias({
|
|
225
|
+
name: "ActionTag",
|
|
226
|
+
type: "z.infer<typeof ActionTagSchema>",
|
|
227
|
+
isExported: true,
|
|
228
|
+
});
|
|
229
|
+
typesFile.addVariableStatement({
|
|
230
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
231
|
+
isExported: true,
|
|
232
|
+
declarations: [
|
|
233
|
+
{
|
|
234
|
+
name: "ACTION_TAGS",
|
|
235
|
+
initializer: `[${actionTagValues.map(t => `"${t}"`).join(", ")}] as const`,
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
});
|
|
239
|
+
// ParameterTag enum for parameter property tags (using values defined at top of file)
|
|
240
|
+
typesFile.addVariableStatement({
|
|
241
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
242
|
+
isExported: true,
|
|
243
|
+
declarations: [
|
|
244
|
+
{
|
|
245
|
+
name: "ParameterTagSchema",
|
|
246
|
+
initializer: `z.enum([${parameterTagValues.map(t => `"${t}"`).join(", ")}])`,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
});
|
|
250
|
+
typesFile.addTypeAlias({
|
|
251
|
+
name: "ParameterTag",
|
|
252
|
+
type: "z.infer<typeof ParameterTagSchema>",
|
|
253
|
+
isExported: true,
|
|
254
|
+
});
|
|
255
|
+
typesFile.addVariableStatement({
|
|
256
|
+
declarationKind: VariableDeclarationKind.Const,
|
|
257
|
+
isExported: true,
|
|
258
|
+
declarations: [
|
|
259
|
+
{
|
|
260
|
+
name: "PARAMETER_TAGS",
|
|
261
|
+
initializer: `[${parameterTagValues.map(t => `"${t}"`).join(", ")}] as const`,
|
|
262
|
+
},
|
|
263
|
+
],
|
|
264
|
+
});
|
|
186
265
|
for (const [categoryName, category] of Object.entries(parsedConfig.actions)) {
|
|
187
266
|
for (const [actionName, action] of Object.entries(category)) {
|
|
267
|
+
// Validate action-level tags
|
|
268
|
+
if (action.tags && action.tags.length > 0) {
|
|
269
|
+
const invalidTags = action.tags.filter(tag => !actionTagValues.includes(tag));
|
|
270
|
+
if (invalidTags.length > 0) {
|
|
271
|
+
throw new Error(`Action "${categoryName}.${actionName}" has invalid tag values: ${invalidTags.join(", ")}. Valid values are: ${actionTagValues.join(", ")}`);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
188
274
|
if (action.parameters) {
|
|
189
275
|
yield validateObject(action.parameters);
|
|
190
276
|
}
|
|
@@ -223,4 +309,11 @@ function generateTypes(_a) {
|
|
|
223
309
|
yield typesFile.save();
|
|
224
310
|
});
|
|
225
311
|
}
|
|
226
|
-
generateTypes({})
|
|
312
|
+
generateTypes({}).catch(error => {
|
|
313
|
+
console.error("Error generating types:", error);
|
|
314
|
+
if (error instanceof Error) {
|
|
315
|
+
console.error(error.message);
|
|
316
|
+
console.error(error.stack);
|
|
317
|
+
}
|
|
318
|
+
process.exit(1);
|
|
319
|
+
});
|
|
@@ -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
|
+
function getConfluenceRequestConfig(baseUrl, username, apiToken) {
|
|
14
|
+
return {
|
|
15
|
+
baseURL: baseUrl,
|
|
16
|
+
headers: {
|
|
17
|
+
Accept: "application/json",
|
|
18
|
+
Authorization: `Basic ${Buffer.from(`${username}:${apiToken}`).toString("base64")}`,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const confluenceUpdatePage = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
23
|
+
const { pageId, username, content, title } = params;
|
|
24
|
+
const { baseUrl, authToken } = authParams;
|
|
25
|
+
const config = getConfluenceRequestConfig(baseUrl, username, authToken);
|
|
26
|
+
// Get current version number
|
|
27
|
+
const response = yield axiosClient_1.axiosClient.get(`/api/v2/pages/${pageId}`, config);
|
|
28
|
+
const currVersion = response.data.version.number;
|
|
29
|
+
const payload = {
|
|
30
|
+
id: pageId,
|
|
31
|
+
status: "current",
|
|
32
|
+
title,
|
|
33
|
+
body: {
|
|
34
|
+
representation: "storage",
|
|
35
|
+
value: content,
|
|
36
|
+
},
|
|
37
|
+
version: {
|
|
38
|
+
number: currVersion + 1,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
yield axiosClient_1.axiosClient.put(`/api/v2/pages/${pageId}`, payload, config);
|
|
42
|
+
});
|
|
43
|
+
exports.default = confluenceUpdatePage;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
const getSheetValues = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
|
+
const { authToken } = authParams;
|
|
14
|
+
const { spreadsheetId, ranges } = params;
|
|
15
|
+
if (!authToken) {
|
|
16
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const url = new URL(`https://sheets.googleapis.com/v4/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchGet`);
|
|
20
|
+
// Add ranges as query parameters if provided
|
|
21
|
+
if (ranges && ranges.length > 0) {
|
|
22
|
+
ranges.forEach(range => {
|
|
23
|
+
url.searchParams.append("ranges", range);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const response = yield axiosClient.get(url.toString(), {
|
|
27
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
|
28
|
+
});
|
|
29
|
+
const { valueRanges } = response.data;
|
|
30
|
+
// Transform the response to match our schema
|
|
31
|
+
const transformedValueRanges = valueRanges === null || valueRanges === void 0 ? void 0 : valueRanges.map((vr) => {
|
|
32
|
+
var _a;
|
|
33
|
+
return ({
|
|
34
|
+
range: vr.range,
|
|
35
|
+
values: ((_a = vr.values) === null || _a === void 0 ? void 0 : _a.flatMap(row => row.map(cell => ({ value: cell != null ? String(cell) : undefined })))) || [],
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
success: true,
|
|
40
|
+
valueRanges: transformedValueRanges,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return {
|
|
45
|
+
success: false,
|
|
46
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export default getSheetValues;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { axiosClient } from "../../util/axiosClient.js";
|
|
11
|
+
import { MISSING_AUTH_TOKEN } from "../../util/missingAuthConstants.js";
|
|
12
|
+
const getSheetValues = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
|
13
|
+
const { authToken } = authParams;
|
|
14
|
+
const { spreadsheetId, ranges } = params;
|
|
15
|
+
if (!authToken) {
|
|
16
|
+
return { success: false, error: MISSING_AUTH_TOKEN };
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const url = new URL(`https://sheets.googleapis.com/v4/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchGet`);
|
|
20
|
+
// Add ranges as query parameters if provided
|
|
21
|
+
if (ranges && ranges.length > 0) {
|
|
22
|
+
ranges.forEach(range => {
|
|
23
|
+
url.searchParams.append("ranges", range);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const response = yield axiosClient.get(url.toString(), {
|
|
27
|
+
headers: { Authorization: `Bearer ${authToken}` },
|
|
28
|
+
});
|
|
29
|
+
const { valueRanges } = response.data;
|
|
30
|
+
// Transform the response to match our schema
|
|
31
|
+
const transformedValueRanges = valueRanges === null || valueRanges === void 0 ? void 0 : valueRanges.map((vr) => {
|
|
32
|
+
var _a;
|
|
33
|
+
return ({
|
|
34
|
+
range: vr.range,
|
|
35
|
+
values: ((_a = vr.values) === null || _a === void 0 ? void 0 : _a.flatMap(row => row.map(cell => ({ value: cell != null ? String(cell) : undefined })))) || [],
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
success: true,
|
|
40
|
+
valueRanges: transformedValueRanges,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
return {
|
|
45
|
+
success: false,
|
|
46
|
+
error: error instanceof Error ? error.message : "Unknown error",
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
export default getSheetValues;
|