@umbraco-engage/mcp 19.0.0-beta.1 → 19.0.0-beta.2
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/collections.js +20 -3
- package/dist/collections.js.map +1 -1
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/tool-types.d.ts +4 -0
- package/package.json +3 -3
package/dist/collections.js
CHANGED
|
@@ -8690,6 +8690,15 @@ var tool95 = {
|
|
|
8690
8690
|
}
|
|
8691
8691
|
};
|
|
8692
8692
|
var get_profile_details_default = withStandardDecorators(tool95);
|
|
8693
|
+
|
|
8694
|
+
// src/umbraco-api/tools/profile/get/to-export-page.ts
|
|
8695
|
+
function toExportPage(rows, skip, take) {
|
|
8696
|
+
const hasMore = rows.length > take;
|
|
8697
|
+
const items = hasMore ? rows.slice(0, take) : [...rows];
|
|
8698
|
+
return { items, total: skip + items.length + (hasMore ? 1 : 0) };
|
|
8699
|
+
}
|
|
8700
|
+
|
|
8701
|
+
// src/umbraco-api/tools/profile/get/get-profile-export.ts
|
|
8693
8702
|
var inputSchema96 = z.object({
|
|
8694
8703
|
skip: z.number().default(0),
|
|
8695
8704
|
take: z.number().default(25),
|
|
@@ -8705,7 +8714,12 @@ var inputSchema96 = z.object({
|
|
|
8705
8714
|
activeTo: z.iso.datetime().nullish(),
|
|
8706
8715
|
identifiedName: getProfileExportQueryParams.shape.IdentifiedName
|
|
8707
8716
|
});
|
|
8708
|
-
var outputSchema81 = z.object({
|
|
8717
|
+
var outputSchema81 = z.object({
|
|
8718
|
+
items: getProfileExportResponse,
|
|
8719
|
+
total: z.number().describe(
|
|
8720
|
+
"Lower bound on the number of matching profiles, not an exact count (the endpoint reports none): skip + the rows returned, plus 1 when more rows exist beyond this page. It only drives `nextCursor` - use `nextCursor` to page, not this number."
|
|
8721
|
+
)
|
|
8722
|
+
});
|
|
8709
8723
|
var tool96 = {
|
|
8710
8724
|
name: "get-profile-export",
|
|
8711
8725
|
description: "Search visitor profiles with the same filters as post-profile-overview (segment, goal thresholds, identification status, active date range), one row per visitor - but with a different, smaller field set (adds `type`/`url`, omits member/personalization detail). Prefer post-profile-overview unless you specifically need this tool's fields. Paginated via `cursor` (pass the previous response's `nextCursor` for the next page; omit for the first page).",
|
|
@@ -8716,7 +8730,9 @@ var tool96 = {
|
|
|
8716
8730
|
handler: async (params) => {
|
|
8717
8731
|
const apiParams = {
|
|
8718
8732
|
Skip: params.skip,
|
|
8719
|
-
|
|
8733
|
+
// One extra row tells us whether another page exists: the endpoint returns a
|
|
8734
|
+
// bare array with no total, and the SDK's cursor pagination needs a total.
|
|
8735
|
+
Take: params.take + 1,
|
|
8720
8736
|
Order: params.order,
|
|
8721
8737
|
Ascending: params.ascending,
|
|
8722
8738
|
SegmentId: params.segmentId,
|
|
@@ -8733,7 +8749,8 @@ var tool96 = {
|
|
|
8733
8749
|
(client) => client.getProfileExport(apiParams, CAPTURE_RAW_HTTP_RESPONSE)
|
|
8734
8750
|
);
|
|
8735
8751
|
if (!result.isError && Array.isArray(result.structuredContent)) {
|
|
8736
|
-
|
|
8752
|
+
const structuredContent = toExportPage(result.structuredContent, params.skip, params.take);
|
|
8753
|
+
return { ...result, structuredContent, content: [{ type: "text", text: JSON.stringify(structuredContent) }] };
|
|
8737
8754
|
}
|
|
8738
8755
|
return result;
|
|
8739
8756
|
}
|