@credal/actions 0.1.96 → 0.1.97
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.
@@ -5342,6 +5342,10 @@ exports.gongGetGongTranscriptsDefinition = {
|
|
5342
5342
|
description: "The names of the trackers to fetch transcripts for",
|
5343
5343
|
},
|
5344
5344
|
},
|
5345
|
+
company: {
|
5346
|
+
type: "string",
|
5347
|
+
description: "The company to get calls with",
|
5348
|
+
},
|
5345
5349
|
startDate: {
|
5346
5350
|
type: "string",
|
5347
5351
|
description: "The start date of the transcripts to fetch in ISO 8601 format",
|
@@ -2530,16 +2530,19 @@ export type googleOauthSearchDriveByKeywordsFunction = ActionFunction<googleOaut
|
|
2530
2530
|
export declare const gongGetGongTranscriptsParamsSchema: z.ZodObject<{
|
2531
2531
|
userRole: z.ZodString;
|
2532
2532
|
trackers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
2533
|
+
company: z.ZodOptional<z.ZodString>;
|
2533
2534
|
startDate: z.ZodOptional<z.ZodString>;
|
2534
2535
|
endDate: z.ZodOptional<z.ZodString>;
|
2535
2536
|
}, "strip", z.ZodTypeAny, {
|
2536
2537
|
userRole: string;
|
2537
2538
|
trackers?: string[] | undefined;
|
2539
|
+
company?: string | undefined;
|
2538
2540
|
startDate?: string | undefined;
|
2539
2541
|
endDate?: string | undefined;
|
2540
2542
|
}, {
|
2541
2543
|
userRole: string;
|
2542
2544
|
trackers?: string[] | undefined;
|
2545
|
+
company?: string | undefined;
|
2543
2546
|
startDate?: string | undefined;
|
2544
2547
|
endDate?: string | undefined;
|
2545
2548
|
}>;
|
@@ -2124,6 +2124,7 @@ exports.gongGetGongTranscriptsParamsSchema = zod_1.z.object({
|
|
2124
2124
|
.array(zod_1.z.string().describe("The names of the trackers to fetch transcripts for"))
|
2125
2125
|
.describe("The trackers to fetch transcripts for")
|
2126
2126
|
.optional(),
|
2127
|
+
company: zod_1.z.string().describe("The company to get calls with").optional(),
|
2127
2128
|
startDate: zod_1.z.string().describe("The start date of the transcripts to fetch in ISO 8601 format").optional(),
|
2128
2129
|
endDate: zod_1.z.string().describe("The end date of the transcripts to fetch in ISO 8601 format").optional(),
|
2129
2130
|
});
|
@@ -284,32 +284,56 @@ const getGongTranscripts = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
284
284
|
// Map speaker IDs to names in the transcripts
|
285
285
|
const userIdToNameMap = {};
|
286
286
|
const userIdToEmailMap = {};
|
287
|
+
const callIdToEmails = {};
|
287
288
|
publicCalls.forEach(call => {
|
289
|
+
var _a;
|
288
290
|
// Check if call has parties array
|
289
291
|
if (call.parties && Array.isArray(call.parties)) {
|
290
292
|
// Iterate through each party in the call
|
291
|
-
call.
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
293
|
+
if ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) {
|
294
|
+
callIdToEmails[call.metaData.id] = [];
|
295
|
+
call.parties.forEach(party => {
|
296
|
+
var _a;
|
297
|
+
// Add the mapping of speakerId to name
|
298
|
+
if (party.speakerId) {
|
299
|
+
if (party.name) {
|
300
|
+
userIdToNameMap[party.speakerId] = party.name;
|
301
|
+
}
|
302
|
+
if (party.emailAddress) {
|
303
|
+
userIdToEmailMap[party.speakerId] = party.emailAddress;
|
304
|
+
if ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) {
|
305
|
+
callIdToEmails[call.metaData.id].push(party.emailAddress);
|
306
|
+
}
|
307
|
+
}
|
296
308
|
}
|
297
|
-
|
298
|
-
|
299
|
-
}
|
300
|
-
}
|
301
|
-
});
|
309
|
+
});
|
310
|
+
}
|
302
311
|
}
|
303
312
|
});
|
304
|
-
const callTranscriptsWithNames = callTranscripts
|
305
|
-
|
313
|
+
const callTranscriptsWithNames = callTranscripts
|
314
|
+
.map(callTranscript => {
|
315
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
306
316
|
const currTranscript = Object.assign({}, callTranscript);
|
317
|
+
const callId = callTranscript.callId;
|
307
318
|
currTranscript.transcript = (_a = callTranscript.transcript) === null || _a === void 0 ? void 0 : _a.map(transcript => {
|
308
319
|
var _a, _b;
|
309
320
|
const { speakerId } = transcript, rest = __rest(transcript, ["speakerId"]);
|
310
321
|
return Object.assign(Object.assign({}, rest), { speakerName: (_a = userIdToNameMap[speakerId !== null && speakerId !== void 0 ? speakerId : ""]) !== null && _a !== void 0 ? _a : "Unknown", speakerEmail: (_b = userIdToEmailMap[speakerId !== null && speakerId !== void 0 ? speakerId : ""]) !== null && _b !== void 0 ? _b : "Unknown" });
|
311
322
|
});
|
312
|
-
return Object.assign({ callName: (_d = (_c = (_b = publicCalls.find(call => { var _a; return ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) === callTranscript.callId; })) === null || _b === void 0 ? void 0 : _b.metaData) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : "", startTime: (
|
323
|
+
return Object.assign({ callName: (_d = (_c = (_b = publicCalls.find(call => { var _a; return ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) === callTranscript.callId; })) === null || _b === void 0 ? void 0 : _b.metaData) === null || _c === void 0 ? void 0 : _c.title) !== null && _d !== void 0 ? _d : "", userEmails: (_e = callIdToEmails[callId]) !== null && _e !== void 0 ? _e : [], startTime: (_h = (_g = (_f = publicCalls.find(call => { var _a; return ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) === callTranscript.callId; })) === null || _f === void 0 ? void 0 : _f.metaData) === null || _g === void 0 ? void 0 : _g.started) !== null && _h !== void 0 ? _h : "" }, currTranscript);
|
324
|
+
})
|
325
|
+
.filter(callTranscript => {
|
326
|
+
var _a;
|
327
|
+
if (!params.company || params.company === "") {
|
328
|
+
return true; // If no company filter is provided, include all transcripts
|
329
|
+
}
|
330
|
+
for (const email of callIdToEmails[callTranscript.callId]) {
|
331
|
+
const companyName = (_a = params.company) === null || _a === void 0 ? void 0 : _a.toLowerCase().replace(/ /g, "");
|
332
|
+
if (email.includes(companyName)) {
|
333
|
+
return true;
|
334
|
+
}
|
335
|
+
}
|
336
|
+
return false;
|
313
337
|
});
|
314
338
|
return {
|
315
339
|
success: true,
|