@credal/actions 0.1.94 → 0.1.95
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/templates.js +4 -0
- package/dist/actions/autogen/types.d.ts +7 -0
- package/dist/actions/autogen/types.js +1 -0
- package/dist/actions/providers/gong/getGongTranscripts.js +11 -4
- package/dist/actions/providers/salesforce/getSalesforceRecordByQuery.d.ts +3 -0
- package/dist/actions/providers/{jamf/getComputerInventory.js → salesforce/getSalesforceRecordByQuery.js} +14 -16
- package/package.json +1 -1
- package/dist/actions/providers/jamf/getComputerInventory.d.ts +0 -3
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.d.ts +0 -3
- package/dist/actions/providers/jamf/getFileVaultRecoveryKey.js +0 -40
@@ -5390,6 +5390,10 @@ exports.gongGetGongTranscriptsDefinition = {
|
|
5390
5390
|
type: "string",
|
5391
5391
|
description: "The name of the speaker",
|
5392
5392
|
},
|
5393
|
+
speakerEmail: {
|
5394
|
+
type: "string",
|
5395
|
+
description: "The email of the speaker",
|
5396
|
+
},
|
5393
5397
|
topic: {
|
5394
5398
|
type: "string",
|
5395
5399
|
nullable: true,
|
@@ -2552,6 +2552,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2552
2552
|
startTime: z.ZodOptional<z.ZodString>;
|
2553
2553
|
transcript: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
2554
2554
|
speakerName: z.ZodOptional<z.ZodString>;
|
2555
|
+
speakerEmail: z.ZodOptional<z.ZodString>;
|
2555
2556
|
topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
2556
2557
|
sentences: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
2557
2558
|
start: z.ZodOptional<z.ZodNumber>;
|
@@ -2568,6 +2569,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2568
2569
|
}>, "many">>;
|
2569
2570
|
}, "strip", z.ZodTypeAny, {
|
2570
2571
|
speakerName?: string | undefined;
|
2572
|
+
speakerEmail?: string | undefined;
|
2571
2573
|
topic?: string | null | undefined;
|
2572
2574
|
sentences?: {
|
2573
2575
|
text?: string | undefined;
|
@@ -2576,6 +2578,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2576
2578
|
}[] | undefined;
|
2577
2579
|
}, {
|
2578
2580
|
speakerName?: string | undefined;
|
2581
|
+
speakerEmail?: string | undefined;
|
2579
2582
|
topic?: string | null | undefined;
|
2580
2583
|
sentences?: {
|
2581
2584
|
text?: string | undefined;
|
@@ -2589,6 +2592,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2589
2592
|
startTime?: string | undefined;
|
2590
2593
|
transcript?: {
|
2591
2594
|
speakerName?: string | undefined;
|
2595
|
+
speakerEmail?: string | undefined;
|
2592
2596
|
topic?: string | null | undefined;
|
2593
2597
|
sentences?: {
|
2594
2598
|
text?: string | undefined;
|
@@ -2602,6 +2606,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2602
2606
|
startTime?: string | undefined;
|
2603
2607
|
transcript?: {
|
2604
2608
|
speakerName?: string | undefined;
|
2609
|
+
speakerEmail?: string | undefined;
|
2605
2610
|
topic?: string | null | undefined;
|
2606
2611
|
sentences?: {
|
2607
2612
|
text?: string | undefined;
|
@@ -2620,6 +2625,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2620
2625
|
startTime?: string | undefined;
|
2621
2626
|
transcript?: {
|
2622
2627
|
speakerName?: string | undefined;
|
2628
|
+
speakerEmail?: string | undefined;
|
2623
2629
|
topic?: string | null | undefined;
|
2624
2630
|
sentences?: {
|
2625
2631
|
text?: string | undefined;
|
@@ -2637,6 +2643,7 @@ export declare const gongGetGongTranscriptsOutputSchema: z.ZodObject<{
|
|
2637
2643
|
startTime?: string | undefined;
|
2638
2644
|
transcript?: {
|
2639
2645
|
speakerName?: string | undefined;
|
2646
|
+
speakerEmail?: string | undefined;
|
2640
2647
|
topic?: string | null | undefined;
|
2641
2648
|
sentences?: {
|
2642
2649
|
text?: string | undefined;
|
@@ -2139,6 +2139,7 @@ exports.gongGetGongTranscriptsOutputSchema = zod_1.z.object({
|
|
2139
2139
|
.array(zod_1.z
|
2140
2140
|
.object({
|
2141
2141
|
speakerName: zod_1.z.string().describe("The name of the speaker").optional(),
|
2142
|
+
speakerEmail: zod_1.z.string().describe("The email of the speaker").optional(),
|
2142
2143
|
topic: zod_1.z.string().nullable().describe("The topic of the transcript").optional(),
|
2143
2144
|
sentences: zod_1.z
|
2144
2145
|
.array(zod_1.z
|
@@ -80,6 +80,7 @@ const CallSchema = zod_1.z
|
|
80
80
|
id: zod_1.z.string(),
|
81
81
|
name: zod_1.z.string(),
|
82
82
|
userId: zod_1.z.string(),
|
83
|
+
emailAddress: zod_1.z.string(),
|
83
84
|
speakerId: zod_1.z.string().nullable(),
|
84
85
|
})
|
85
86
|
.partial()
|
@@ -282,14 +283,20 @@ const getGongTranscripts = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
282
283
|
});
|
283
284
|
// Map speaker IDs to names in the transcripts
|
284
285
|
const userIdToNameMap = {};
|
286
|
+
const userIdToEmailMap = {};
|
285
287
|
publicCalls.forEach(call => {
|
286
288
|
// Check if call has parties array
|
287
289
|
if (call.parties && Array.isArray(call.parties)) {
|
288
290
|
// Iterate through each party in the call
|
289
291
|
call.parties.forEach(party => {
|
290
292
|
// Add the mapping of speakerId to name
|
291
|
-
if (party.speakerId
|
292
|
-
|
293
|
+
if (party.speakerId) {
|
294
|
+
if (party.name) {
|
295
|
+
userIdToNameMap[party.speakerId] = party.name;
|
296
|
+
}
|
297
|
+
if (party.emailAddress) {
|
298
|
+
userIdToEmailMap[party.speakerId] = party.emailAddress;
|
299
|
+
}
|
293
300
|
}
|
294
301
|
});
|
295
302
|
}
|
@@ -298,9 +305,9 @@ const getGongTranscripts = (_a) => __awaiter(void 0, [_a], void 0, function* ({
|
|
298
305
|
var _a, _b, _c, _d, _e, _f, _g;
|
299
306
|
const currTranscript = Object.assign({}, callTranscript);
|
300
307
|
currTranscript.transcript = (_a = callTranscript.transcript) === null || _a === void 0 ? void 0 : _a.map(transcript => {
|
301
|
-
var _a;
|
308
|
+
var _a, _b;
|
302
309
|
const { speakerId } = transcript, rest = __rest(transcript, ["speakerId"]);
|
303
|
-
return Object.assign(Object.assign({}, rest), { speakerName: (_a = userIdToNameMap[speakerId !== null && speakerId !== void 0 ? speakerId : ""]) !== null && _a !== void 0 ? _a : "Unknown" });
|
310
|
+
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" });
|
304
311
|
});
|
305
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: (_g = (_f = (_e = publicCalls.find(call => { var _a; return ((_a = call.metaData) === null || _a === void 0 ? void 0 : _a.id) === callTranscript.callId; })) === null || _e === void 0 ? void 0 : _e.metaData) === null || _f === void 0 ? void 0 : _f.started) !== null && _g !== void 0 ? _g : "" }, currTranscript);
|
306
313
|
});
|
@@ -10,36 +10,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
-
const
|
13
|
+
const getSalesforceRecordByQuery = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
14
|
const { authToken, baseUrl } = authParams;
|
15
|
-
const {
|
16
|
-
if (!baseUrl) {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
if (section) {
|
22
|
-
queryParams.section = section;
|
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
|
+
};
|
23
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
24
|
try {
|
25
|
-
const response = yield axiosClient_1.axiosClient.get(
|
25
|
+
const response = yield axiosClient_1.axiosClient.get(url, {
|
26
26
|
headers: {
|
27
27
|
Authorization: `Bearer ${authToken}`,
|
28
|
-
Accept: "application/json",
|
29
28
|
},
|
30
|
-
params: queryParams,
|
31
29
|
});
|
32
30
|
return {
|
33
31
|
success: true,
|
34
|
-
|
32
|
+
records: response.data,
|
35
33
|
};
|
36
34
|
}
|
37
35
|
catch (error) {
|
38
|
-
console.error("Error retrieving
|
36
|
+
console.error("Error retrieving Salesforce record:", error);
|
39
37
|
return {
|
40
38
|
success: false,
|
41
|
-
error: error instanceof Error ? error.message : "
|
39
|
+
error: error instanceof Error ? error.message : "An unknown error occurred",
|
42
40
|
};
|
43
41
|
}
|
44
42
|
});
|
45
|
-
exports.default =
|
43
|
+
exports.default = getSalesforceRecordByQuery;
|
package/package.json
CHANGED
@@ -1,40 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
const axiosClient_1 = require("../../util/axiosClient");
|
13
|
-
const getFileVaultRecoveryKey = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params, authParams, }) {
|
14
|
-
const { authToken, baseUrl } = authParams;
|
15
|
-
const { computerId } = params;
|
16
|
-
if (!baseUrl || !computerId) {
|
17
|
-
throw new Error("Base URL and Computer ID are required to fetch FileVault2 recovery key");
|
18
|
-
}
|
19
|
-
const apiUrl = `${baseUrl}/JSSResource/computers/${computerId}/FileVault2RecoveryKey`;
|
20
|
-
try {
|
21
|
-
const response = yield axiosClient_1.axiosClient.get(apiUrl, {
|
22
|
-
headers: {
|
23
|
-
Authorization: `Bearer ${authToken}`,
|
24
|
-
Accept: "application/json",
|
25
|
-
},
|
26
|
-
});
|
27
|
-
return {
|
28
|
-
success: true,
|
29
|
-
data: response.data,
|
30
|
-
};
|
31
|
-
}
|
32
|
-
catch (error) {
|
33
|
-
console.error("Error retrieving FileVault2 recovery key: ", error);
|
34
|
-
return {
|
35
|
-
success: false,
|
36
|
-
error: error instanceof Error ? error.message : "Unknown error",
|
37
|
-
};
|
38
|
-
}
|
39
|
-
});
|
40
|
-
exports.default = getFileVaultRecoveryKey;
|