@credal/actions 0.2.206 → 0.2.208
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.
|
@@ -10873,6 +10873,10 @@ export const salesforceExecuteReportDefinition = {
|
|
|
10873
10873
|
type: "boolean",
|
|
10874
10874
|
description: "Whether to include detailed report metadata in the response",
|
|
10875
10875
|
},
|
|
10876
|
+
includeSummary: {
|
|
10877
|
+
type: "boolean",
|
|
10878
|
+
description: "Whether to include summary/aggregate data (totals, counts, etc.)",
|
|
10879
|
+
},
|
|
10876
10880
|
},
|
|
10877
10881
|
},
|
|
10878
10882
|
output: {
|
|
@@ -10883,6 +10887,11 @@ export const salesforceExecuteReportDefinition = {
|
|
|
10883
10887
|
type: "boolean",
|
|
10884
10888
|
description: "Whether the report was successfully executed",
|
|
10885
10889
|
},
|
|
10890
|
+
summary: {
|
|
10891
|
+
type: "object",
|
|
10892
|
+
description: "Summary/aggregate data from the report (totals, counts, averages, etc.)",
|
|
10893
|
+
additionalProperties: true,
|
|
10894
|
+
},
|
|
10886
10895
|
reportData: {
|
|
10887
10896
|
type: "object",
|
|
10888
10897
|
description: "The report data returned by Salesforce, including factMap with aggregates and row-level details",
|
|
@@ -7685,25 +7685,31 @@ export type salesforceListReportsFunction = ActionFunction<salesforceListReports
|
|
|
7685
7685
|
export declare const salesforceExecuteReportParamsSchema: z.ZodObject<{
|
|
7686
7686
|
reportId: z.ZodString;
|
|
7687
7687
|
includeDetails: z.ZodOptional<z.ZodBoolean>;
|
|
7688
|
+
includeSummary: z.ZodOptional<z.ZodBoolean>;
|
|
7688
7689
|
}, "strip", z.ZodTypeAny, {
|
|
7689
7690
|
reportId: string;
|
|
7690
7691
|
includeDetails?: boolean | undefined;
|
|
7692
|
+
includeSummary?: boolean | undefined;
|
|
7691
7693
|
}, {
|
|
7692
7694
|
reportId: string;
|
|
7693
7695
|
includeDetails?: boolean | undefined;
|
|
7696
|
+
includeSummary?: boolean | undefined;
|
|
7694
7697
|
}>;
|
|
7695
7698
|
export type salesforceExecuteReportParamsType = z.infer<typeof salesforceExecuteReportParamsSchema>;
|
|
7696
7699
|
export declare const salesforceExecuteReportOutputSchema: z.ZodObject<{
|
|
7697
7700
|
success: z.ZodBoolean;
|
|
7701
|
+
summary: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodAny, z.objectOutputType<{}, z.ZodAny, "strip">, z.objectInputType<{}, z.ZodAny, "strip">>>;
|
|
7698
7702
|
reportData: z.ZodOptional<z.ZodObject<{}, "strip", z.ZodAny, z.objectOutputType<{}, z.ZodAny, "strip">, z.objectInputType<{}, z.ZodAny, "strip">>>;
|
|
7699
7703
|
error: z.ZodOptional<z.ZodString>;
|
|
7700
7704
|
}, "strip", z.ZodTypeAny, {
|
|
7701
7705
|
success: boolean;
|
|
7702
7706
|
error?: string | undefined;
|
|
7707
|
+
summary?: z.objectOutputType<{}, z.ZodAny, "strip"> | undefined;
|
|
7703
7708
|
reportData?: z.objectOutputType<{}, z.ZodAny, "strip"> | undefined;
|
|
7704
7709
|
}, {
|
|
7705
7710
|
success: boolean;
|
|
7706
7711
|
error?: string | undefined;
|
|
7712
|
+
summary?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
|
|
7707
7713
|
reportData?: z.objectInputType<{}, z.ZodAny, "strip"> | undefined;
|
|
7708
7714
|
}>;
|
|
7709
7715
|
export type salesforceExecuteReportOutputType = z.infer<typeof salesforceExecuteReportOutputSchema>;
|
|
@@ -3996,9 +3996,15 @@ export const salesforceListReportsOutputSchema = z.object({
|
|
|
3996
3996
|
export const salesforceExecuteReportParamsSchema = z.object({
|
|
3997
3997
|
reportId: z.string().describe("Id for the report to execute"),
|
|
3998
3998
|
includeDetails: z.boolean().describe("Whether to include detailed report metadata in the response").optional(),
|
|
3999
|
+
includeSummary: z.boolean().describe("Whether to include summary/aggregate data (totals, counts, etc.)").optional(),
|
|
3999
4000
|
});
|
|
4000
4001
|
export const salesforceExecuteReportOutputSchema = z.object({
|
|
4001
4002
|
success: z.boolean().describe("Whether the report was successfully executed"),
|
|
4003
|
+
summary: z
|
|
4004
|
+
.object({})
|
|
4005
|
+
.catchall(z.any())
|
|
4006
|
+
.describe("Summary/aggregate data from the report (totals, counts, averages, etc.)")
|
|
4007
|
+
.optional(),
|
|
4002
4008
|
reportData: z
|
|
4003
4009
|
.object({})
|
|
4004
4010
|
.catchall(z.any())
|
|
@@ -1,15 +1,36 @@
|
|
|
1
1
|
import { ApiError, axiosClient } from "../../util/axiosClient.js";
|
|
2
2
|
const executeReport = async ({ params, authParams, }) => {
|
|
3
3
|
const { authToken, baseUrl } = authParams;
|
|
4
|
-
const { reportId, includeDetails } = params;
|
|
4
|
+
const { reportId, includeDetails, includeSummary } = params;
|
|
5
5
|
if (!authToken || !baseUrl) {
|
|
6
6
|
return { success: false, error: "authToken and baseUrl are required for Salesforce API" };
|
|
7
7
|
}
|
|
8
8
|
const url = `${baseUrl}/services/data/v65.0/analytics/reports/${reportId}${includeDetails ? "?includeDetails=true" : ""}`;
|
|
9
9
|
try {
|
|
10
10
|
const response = await axiosClient.get(url, { headers: { Authorization: `Bearer ${authToken}` } });
|
|
11
|
+
let summary;
|
|
12
|
+
if (includeSummary && response.data) {
|
|
13
|
+
summary = {
|
|
14
|
+
aggregates: response.data.factMap?.aggregates || response.data.factMap?.["T!T"]?.aggregates,
|
|
15
|
+
groupingsDown: response.data.groupingsDown?.groupings?.map((g) => ({
|
|
16
|
+
label: g.label,
|
|
17
|
+
value: g.value,
|
|
18
|
+
aggregates: g.aggregates,
|
|
19
|
+
})),
|
|
20
|
+
groupingsAcross: response.data.groupingsAcross?.groupings?.map((g) => ({
|
|
21
|
+
label: g.label,
|
|
22
|
+
value: g.value,
|
|
23
|
+
aggregates: g.aggregates,
|
|
24
|
+
})),
|
|
25
|
+
reportMetadata: {
|
|
26
|
+
name: response.data.reportMetadata?.name,
|
|
27
|
+
reportType: response.data.reportMetadata?.reportType?.type,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
11
31
|
return {
|
|
12
32
|
success: true,
|
|
33
|
+
summary,
|
|
13
34
|
reportData: includeDetails ? response.data : undefined,
|
|
14
35
|
};
|
|
15
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credal/actions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.208",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AI Actions by Credal AI",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
},
|
|
88
88
|
"overrides": {
|
|
89
89
|
"fast-xml-parser": "^5.3.3",
|
|
90
|
-
"minimatch": "^10.2.1"
|
|
90
|
+
"minimatch": "^10.2.1",
|
|
91
|
+
"file-type": "^22.0.0"
|
|
91
92
|
}
|
|
92
93
|
}
|