@credal/actions 0.1.84 → 0.1.87
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.d.ts +1 -2
- package/dist/actions/actionMapper.js +66 -65
- package/dist/actions/autogen/templates.js +76 -76
- package/dist/actions/autogen/types.d.ts +85 -87
- package/dist/actions/autogen/types.js +1 -108
- package/dist/actions/invoke.d.ts +2 -3
- package/dist/actions/invoke.js +2 -6
- package/dist/actions/parse.d.ts +14 -17
- package/dist/actions/parse.js +2 -28
- package/dist/actions/providers/gong/getGongTranscripts.js +8 -3
- package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.zendeskListZendeskTicketsParamsSchema = exports.zendeskCreateZendeskTicketOutputSchema = exports.zendeskCreateZendeskTicketParamsSchema = exports.credalCallCopilotOutputSchema = exports.credalCallCopilotParamsSchema = exports.bingGetTopNSearchResultUrlsOutputSchema = exports.bingGetTopNSearchResultUrlsParamsSchema = exports.googlemapsNearbysearchRestaurantsOutputSchema = exports.googlemapsNearbysearchRestaurantsParamsSchema = exports.googlemapsValidateAddressOutputSchema = exports.googlemapsValidateAddressParamsSchema = exports.kandjiGetFVRecoveryKeyForDeviceOutputSchema = exports.kandjiGetFVRecoveryKeyForDeviceParamsSchema = exports.jiraGetJiraIssuesByQueryOutputSchema = exports.jiraGetJiraIssuesByQueryParamsSchema = exports.jiraUpdateJiraTicketStatusOutputSchema = exports.jiraUpdateJiraTicketStatusParamsSchema = exports.jiraUpdateJiraTicketDetailsOutputSchema = exports.jiraUpdateJiraTicketDetailsParamsSchema = exports.jiraGetJiraTicketHistoryOutputSchema = exports.jiraGetJiraTicketHistoryParamsSchema = exports.jiraGetJiraTicketDetailsOutputSchema = exports.jiraGetJiraTicketDetailsParamsSchema = exports.jiraCreateJiraTicketOutputSchema = exports.jiraCreateJiraTicketParamsSchema = exports.jiraCommentJiraTicketOutputSchema = exports.jiraCommentJiraTicketParamsSchema = exports.jiraAssignJiraTicketOutputSchema = exports.jiraAssignJiraTicketParamsSchema = exports.confluenceFetchPageContentOutputSchema = exports.confluenceFetchPageContentParamsSchema = exports.confluenceOverwritePageOutputSchema = exports.confluenceOverwritePageParamsSchema = exports.mathAddOutputSchema = exports.mathAddParamsSchema = exports.slackGetChannelMessagesOutputSchema = exports.slackGetChannelMessagesParamsSchema = exports.slackSendMessageOutputSchema = exports.slackSendMessageParamsSchema = exports.asanaUpdateTaskOutputSchema = exports.asanaUpdateTaskParamsSchema = exports.asanaCreateTaskOutputSchema = exports.asanaCreateTaskParamsSchema = exports.asanaListAsanaTasksByProjectOutputSchema = exports.asanaListAsanaTasksByProjectParamsSchema = exports.asanaCommentTaskOutputSchema = exports.asanaCommentTaskParamsSchema = exports.genericFillTemplateOutputSchema = exports.genericFillTemplateParamsSchema = exports.AuthParamsSchema = void 0;
|
4
4
|
exports.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 = exports.zendeskGetTicketDetailsParamsSchema = exports.zendeskListZendeskTicketsOutputSchema = void 0;
|
5
5
|
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 = exports.lookerEnableUserByEmailParamsSchema = exports.finnhubGetBasicFinancialsOutputSchema = void 0;
|
6
|
-
exports.
|
6
|
+
exports.githubListPullRequestsOutputSchema = exports.githubListPullRequestsParamsSchema = exports.githubCreatePullRequestOutputSchema = void 0;
|
7
7
|
const zod_1 = require("zod");
|
8
8
|
exports.AuthParamsSchema = zod_1.z.object({
|
9
9
|
authToken: zod_1.z.string().optional(),
|
@@ -2456,110 +2456,3 @@ exports.githubListPullRequestsOutputSchema = zod_1.z.object({
|
|
2456
2456
|
}))
|
2457
2457
|
.describe("A list of pull requests in the repository"),
|
2458
2458
|
});
|
2459
|
-
exports.ActionProviderNames = [
|
2460
|
-
"generic",
|
2461
|
-
"asana",
|
2462
|
-
"slack",
|
2463
|
-
"math",
|
2464
|
-
"confluence",
|
2465
|
-
"jira",
|
2466
|
-
"kandji",
|
2467
|
-
"googlemaps",
|
2468
|
-
"bing",
|
2469
|
-
"credal",
|
2470
|
-
"zendesk",
|
2471
|
-
"linkedin",
|
2472
|
-
"x",
|
2473
|
-
"mongo",
|
2474
|
-
"snowflake",
|
2475
|
-
"openstreetmap",
|
2476
|
-
"nws",
|
2477
|
-
"firecrawl",
|
2478
|
-
"resend",
|
2479
|
-
"googleOauth",
|
2480
|
-
"gong",
|
2481
|
-
"finnhub",
|
2482
|
-
"looker",
|
2483
|
-
"ashby",
|
2484
|
-
"salesforce",
|
2485
|
-
"microsoft",
|
2486
|
-
"github",
|
2487
|
-
];
|
2488
|
-
exports.ActionNames = [
|
2489
|
-
"fillTemplate",
|
2490
|
-
"commentTask",
|
2491
|
-
"listAsanaTasksByProject",
|
2492
|
-
"createTask",
|
2493
|
-
"updateTask",
|
2494
|
-
"sendMessage",
|
2495
|
-
"getChannelMessages",
|
2496
|
-
"add",
|
2497
|
-
"overwritePage",
|
2498
|
-
"fetchPageContent",
|
2499
|
-
"assignJiraTicket",
|
2500
|
-
"commentJiraTicket",
|
2501
|
-
"createJiraTicket",
|
2502
|
-
"getJiraTicketDetails",
|
2503
|
-
"getJiraTicketHistory",
|
2504
|
-
"updateJiraTicketDetails",
|
2505
|
-
"updateJiraTicketStatus",
|
2506
|
-
"getJiraIssuesByQuery",
|
2507
|
-
"getFVRecoveryKeyForDevice",
|
2508
|
-
"validateAddress",
|
2509
|
-
"nearbysearchRestaurants",
|
2510
|
-
"getTopNSearchResultUrls",
|
2511
|
-
"callCopilot",
|
2512
|
-
"createZendeskTicket",
|
2513
|
-
"listZendeskTickets",
|
2514
|
-
"getTicketDetails",
|
2515
|
-
"updateTicketStatus",
|
2516
|
-
"addCommentToTicket",
|
2517
|
-
"assignTicket",
|
2518
|
-
"createShareLinkedinPostUrl",
|
2519
|
-
"createShareXPostUrl",
|
2520
|
-
"insertMongoDoc",
|
2521
|
-
"getRowByFieldValue",
|
2522
|
-
"runSnowflakeQuery",
|
2523
|
-
"getLatitudeLongitudeFromLocation",
|
2524
|
-
"getForecastForLocation",
|
2525
|
-
"deepResearch",
|
2526
|
-
"scrapeUrl",
|
2527
|
-
"scrapeTweetDataWithNitter",
|
2528
|
-
"sendEmail",
|
2529
|
-
"createNewGoogleDoc",
|
2530
|
-
"updateDoc",
|
2531
|
-
"scheduleCalendarMeeting",
|
2532
|
-
"createSpreadsheet",
|
2533
|
-
"updateSpreadsheet",
|
2534
|
-
"createPresentation",
|
2535
|
-
"updatePresentation",
|
2536
|
-
"getGongTranscripts",
|
2537
|
-
"symbolLookup",
|
2538
|
-
"getBasicFinancials",
|
2539
|
-
"enableUserByEmail",
|
2540
|
-
"createNote",
|
2541
|
-
"getCandidateInfo",
|
2542
|
-
"addCandidateToProject",
|
2543
|
-
"listCandidates",
|
2544
|
-
"searchCandidates",
|
2545
|
-
"listCandidateNotes",
|
2546
|
-
"createCandidate",
|
2547
|
-
"updateCandidate",
|
2548
|
-
"updateRecord",
|
2549
|
-
"createRecord",
|
2550
|
-
"createCase",
|
2551
|
-
"generateSalesReport",
|
2552
|
-
"getSalesforceRecordsByQuery",
|
2553
|
-
"getRecord",
|
2554
|
-
"fetchSalesforceSchemaByObject",
|
2555
|
-
"createDocument",
|
2556
|
-
"updateDocument",
|
2557
|
-
"updateSpreadsheet",
|
2558
|
-
"messageTeamsChat",
|
2559
|
-
"messageTeamsChannel",
|
2560
|
-
"getDocument",
|
2561
|
-
"createOrUpdateFile",
|
2562
|
-
"createBranch",
|
2563
|
-
"createPullRequest",
|
2564
|
-
"listPullRequests",
|
2565
|
-
];
|
package/dist/actions/invoke.d.ts
CHANGED
package/dist/actions/invoke.js
CHANGED
@@ -17,12 +17,8 @@ function invokeAction(input) {
|
|
17
17
|
if (!actionMapper_1.ActionMapper[provider]) {
|
18
18
|
throw new Error(`Provider '${provider}' not found`);
|
19
19
|
}
|
20
|
-
const
|
21
|
-
|
22
|
-
throw new Error(`Action '${name}' not found for provider '${provider}'`);
|
23
|
-
}
|
24
|
-
const providerFunction = action.fn;
|
25
|
-
const safeParseParams = action.paramsSchema.safeParse(parameters);
|
20
|
+
const providerFunction = actionMapper_1.ActionMapper[provider][name].fn;
|
21
|
+
const safeParseParams = actionMapper_1.ActionMapper[provider][name].paramsSchema.safeParse(parameters);
|
26
22
|
if (!safeParseParams.success) {
|
27
23
|
throw new Error(`Invalid parameters for action '${name}': ${safeParseParams.error}`);
|
28
24
|
}
|
package/dist/actions/parse.d.ts
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
import { z } from "zod";
|
2
|
-
import { ActionNames, ActionProviderNames } from "./autogen/types";
|
3
|
-
export type ActionProviderName = (typeof ActionProviderNames)[number];
|
4
|
-
export type ActionName = (typeof ActionNames)[number];
|
5
2
|
declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
6
3
|
description: z.ZodString;
|
7
4
|
scopes: z.ZodArray<z.ZodString, "many">;
|
@@ -11,12 +8,12 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
11
8
|
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
12
9
|
}, "strip", z.ZodTypeAny, {
|
13
10
|
type: string;
|
14
|
-
properties: Record<string, any>;
|
15
11
|
required: string[];
|
12
|
+
properties: Record<string, any>;
|
16
13
|
}, {
|
17
14
|
type: string;
|
18
|
-
properties: Record<string, any>;
|
19
15
|
required: string[];
|
16
|
+
properties: Record<string, any>;
|
20
17
|
}>>;
|
21
18
|
output: z.ZodOptional<z.ZodObject<{
|
22
19
|
type: z.ZodString;
|
@@ -24,45 +21,45 @@ declare const actionTemplateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
24
21
|
properties: z.ZodRecord<z.ZodString, z.ZodAny>;
|
25
22
|
}, "strip", z.ZodTypeAny, {
|
26
23
|
type: string;
|
27
|
-
properties: Record<string, any>;
|
28
24
|
required: string[];
|
25
|
+
properties: Record<string, any>;
|
29
26
|
}, {
|
30
27
|
type: string;
|
31
|
-
properties: Record<string, any>;
|
32
28
|
required: string[];
|
29
|
+
properties: Record<string, any>;
|
33
30
|
}>>;
|
34
31
|
}, {
|
35
|
-
|
36
|
-
|
32
|
+
name: z.ZodString;
|
33
|
+
provider: z.ZodString;
|
37
34
|
}>, "strip", z.ZodTypeAny, {
|
38
|
-
name: "fillTemplate" | "commentTask" | "listAsanaTasksByProject" | "createTask" | "updateTask" | "sendMessage" | "getChannelMessages" | "add" | "overwritePage" | "fetchPageContent" | "assignJiraTicket" | "commentJiraTicket" | "createJiraTicket" | "getJiraTicketDetails" | "getJiraTicketHistory" | "updateJiraTicketDetails" | "updateJiraTicketStatus" | "getJiraIssuesByQuery" | "getFVRecoveryKeyForDevice" | "validateAddress" | "nearbysearchRestaurants" | "getTopNSearchResultUrls" | "callCopilot" | "createZendeskTicket" | "listZendeskTickets" | "getTicketDetails" | "updateTicketStatus" | "addCommentToTicket" | "assignTicket" | "createShareLinkedinPostUrl" | "createShareXPostUrl" | "insertMongoDoc" | "getRowByFieldValue" | "runSnowflakeQuery" | "getLatitudeLongitudeFromLocation" | "getForecastForLocation" | "deepResearch" | "scrapeUrl" | "scrapeTweetDataWithNitter" | "sendEmail" | "createNewGoogleDoc" | "updateDoc" | "scheduleCalendarMeeting" | "createSpreadsheet" | "updateSpreadsheet" | "createPresentation" | "updatePresentation" | "getGongTranscripts" | "symbolLookup" | "getBasicFinancials" | "enableUserByEmail" | "createNote" | "getCandidateInfo" | "addCandidateToProject" | "listCandidates" | "searchCandidates" | "listCandidateNotes" | "createCandidate" | "updateCandidate" | "updateRecord" | "createRecord" | "createCase" | "generateSalesReport" | "getSalesforceRecordsByQuery" | "getRecord" | "fetchSalesforceSchemaByObject" | "createDocument" | "updateDocument" | "messageTeamsChat" | "messageTeamsChannel" | "getDocument" | "createOrUpdateFile" | "createBranch" | "createPullRequest" | "listPullRequests";
|
39
35
|
description: string;
|
40
36
|
scopes: string[];
|
41
|
-
|
37
|
+
name: string;
|
38
|
+
provider: string;
|
42
39
|
parameters?: {
|
43
40
|
type: string;
|
44
|
-
properties: Record<string, any>;
|
45
41
|
required: string[];
|
42
|
+
properties: Record<string, any>;
|
46
43
|
} | undefined;
|
47
44
|
output?: {
|
48
45
|
type: string;
|
49
|
-
properties: Record<string, any>;
|
50
46
|
required: string[];
|
47
|
+
properties: Record<string, any>;
|
51
48
|
} | undefined;
|
52
49
|
}, {
|
53
|
-
name: "fillTemplate" | "commentTask" | "listAsanaTasksByProject" | "createTask" | "updateTask" | "sendMessage" | "getChannelMessages" | "add" | "overwritePage" | "fetchPageContent" | "assignJiraTicket" | "commentJiraTicket" | "createJiraTicket" | "getJiraTicketDetails" | "getJiraTicketHistory" | "updateJiraTicketDetails" | "updateJiraTicketStatus" | "getJiraIssuesByQuery" | "getFVRecoveryKeyForDevice" | "validateAddress" | "nearbysearchRestaurants" | "getTopNSearchResultUrls" | "callCopilot" | "createZendeskTicket" | "listZendeskTickets" | "getTicketDetails" | "updateTicketStatus" | "addCommentToTicket" | "assignTicket" | "createShareLinkedinPostUrl" | "createShareXPostUrl" | "insertMongoDoc" | "getRowByFieldValue" | "runSnowflakeQuery" | "getLatitudeLongitudeFromLocation" | "getForecastForLocation" | "deepResearch" | "scrapeUrl" | "scrapeTweetDataWithNitter" | "sendEmail" | "createNewGoogleDoc" | "updateDoc" | "scheduleCalendarMeeting" | "createSpreadsheet" | "updateSpreadsheet" | "createPresentation" | "updatePresentation" | "getGongTranscripts" | "symbolLookup" | "getBasicFinancials" | "enableUserByEmail" | "createNote" | "getCandidateInfo" | "addCandidateToProject" | "listCandidates" | "searchCandidates" | "listCandidateNotes" | "createCandidate" | "updateCandidate" | "updateRecord" | "createRecord" | "createCase" | "generateSalesReport" | "getSalesforceRecordsByQuery" | "getRecord" | "fetchSalesforceSchemaByObject" | "createDocument" | "updateDocument" | "messageTeamsChat" | "messageTeamsChannel" | "getDocument" | "createOrUpdateFile" | "createBranch" | "createPullRequest" | "listPullRequests";
|
54
50
|
description: string;
|
55
51
|
scopes: string[];
|
56
|
-
|
52
|
+
name: string;
|
53
|
+
provider: string;
|
57
54
|
parameters?: {
|
58
55
|
type: string;
|
59
|
-
properties: Record<string, any>;
|
60
56
|
required: string[];
|
57
|
+
properties: Record<string, any>;
|
61
58
|
} | undefined;
|
62
59
|
output?: {
|
63
60
|
type: string;
|
64
|
-
properties: Record<string, any>;
|
65
61
|
required: string[];
|
62
|
+
properties: Record<string, any>;
|
66
63
|
} | undefined;
|
67
64
|
}>;
|
68
65
|
export type ActionTemplate = z.infer<typeof actionTemplateSchema>;
|
package/dist/actions/parse.js
CHANGED
@@ -19,7 +19,6 @@ const json_schema_to_zod_1 = __importDefault(require("json-schema-to-zod"));
|
|
19
19
|
const ts_morph_1 = require("ts-morph");
|
20
20
|
const zod_1 = require("zod");
|
21
21
|
const string_1 = require("../utils/string");
|
22
|
-
const types_1 = require("./autogen/types");
|
23
22
|
const jsonObjectSchema = zod_1.z.object({
|
24
23
|
type: zod_1.z.string(),
|
25
24
|
required: zod_1.z.array(zod_1.z.string()),
|
@@ -31,11 +30,9 @@ const actionSchema = zod_1.z.object({
|
|
31
30
|
parameters: jsonObjectSchema.optional(),
|
32
31
|
output: jsonObjectSchema.optional(),
|
33
32
|
});
|
34
|
-
const actionProviderSchema = zod_1.z.enum(types_1.ActionProviderNames);
|
35
|
-
const actionNameSchema = zod_1.z.enum(types_1.ActionNames);
|
36
33
|
const actionTemplateSchema = actionSchema.extend({
|
37
|
-
|
38
|
-
|
34
|
+
name: zod_1.z.string(),
|
35
|
+
provider: zod_1.z.string(),
|
39
36
|
});
|
40
37
|
const providerSchema = zod_1.z.record(zod_1.z.string(), actionSchema);
|
41
38
|
const configSchema = zod_1.z.object({
|
@@ -212,29 +209,6 @@ function generateTypes(_a) {
|
|
212
209
|
});
|
213
210
|
}
|
214
211
|
}
|
215
|
-
// Add the ActionProviderName and ActionName schemas and types
|
216
|
-
const actionProviderNames = Object.keys(parsedConfig.actions);
|
217
|
-
typesFile.addVariableStatement({
|
218
|
-
declarationKind: ts_morph_1.VariableDeclarationKind.Const,
|
219
|
-
isExported: true,
|
220
|
-
declarations: [
|
221
|
-
{
|
222
|
-
name: "ActionProviderNames",
|
223
|
-
initializer: ts_morph_1.Writers.assertion(JSON.stringify(actionProviderNames), "const"),
|
224
|
-
},
|
225
|
-
],
|
226
|
-
});
|
227
|
-
const actionNames = Object.values(parsedConfig.actions).flatMap(category => Object.keys(category));
|
228
|
-
typesFile.addVariableStatement({
|
229
|
-
declarationKind: ts_morph_1.VariableDeclarationKind.Const,
|
230
|
-
isExported: true,
|
231
|
-
declarations: [
|
232
|
-
{
|
233
|
-
name: "ActionNames",
|
234
|
-
initializer: ts_morph_1.Writers.assertion(JSON.stringify(actionNames), "const"),
|
235
|
-
},
|
236
|
-
],
|
237
|
-
});
|
238
212
|
// Save the generated TypeScript file
|
239
213
|
yield templatesFile.save();
|
240
214
|
yield typesFile.save();
|
@@ -263,14 +263,19 @@ const getGongTranscripts = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
263
263
|
};
|
264
264
|
}
|
265
265
|
const filteredGongUsers = gongUsers.filter(user => user.title === params.userRole);
|
266
|
+
const filteredPrimaryIds = filteredGongUsers.map(user => user.id).filter((id) => id !== undefined);
|
267
|
+
if (filteredPrimaryIds.length === 0) {
|
268
|
+
return {
|
269
|
+
success: false,
|
270
|
+
error: "No Gong users found with the specified role",
|
271
|
+
};
|
272
|
+
}
|
266
273
|
const trackers = yield getTrackers(authParams.authToken);
|
267
274
|
const filteredTrackers = trackers.filter(tracker => { var _a, _b; return (_a = params.trackers) === null || _a === void 0 ? void 0 : _a.includes((_b = tracker.trackerName) !== null && _b !== void 0 ? _b : ""); });
|
268
275
|
const calls = yield getCalls(authParams.authToken, {
|
269
276
|
fromDateTime: (_b = params.startDate) !== null && _b !== void 0 ? _b : "",
|
270
277
|
toDateTime: (_c = params.endDate) !== null && _c !== void 0 ? _c : "",
|
271
|
-
primaryUserIds:
|
272
|
-
? filteredGongUsers.map(user => user.id).filter((id) => id !== undefined)
|
273
|
-
: undefined,
|
278
|
+
primaryUserIds: filteredPrimaryIds,
|
274
279
|
trackerIds: filteredTrackers.length > 0
|
275
280
|
? filteredTrackers.map(tracker => tracker.trackerId).filter((id) => id !== undefined)
|
276
281
|
: undefined,
|