@contentful/mcp-tools 0.12.6 → 0.12.8
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/index.d.ts +86 -34
- package/dist/index.js +1473 -1089
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,12 +34,52 @@ function createSuccessResponse(message, data) {
|
|
|
34
34
|
]
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
+
function isRecord(value) {
|
|
38
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
function formatErrorMessage(error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
42
|
+
if (!/^\s*[[{]/.test(message)) return message;
|
|
43
|
+
let data;
|
|
44
|
+
try {
|
|
45
|
+
data = JSON.parse(message);
|
|
46
|
+
} catch {
|
|
47
|
+
return "Request failed.";
|
|
48
|
+
}
|
|
49
|
+
if (!isRecord(data)) return "Request failed.";
|
|
50
|
+
const diagnostics = {};
|
|
51
|
+
if (error instanceof Error && error.name !== "Error" && /^[A-Za-z]\w*$/.test(error.name)) {
|
|
52
|
+
diagnostics["name"] = error.name;
|
|
53
|
+
}
|
|
54
|
+
if (typeof data["status"] === "number" && Number.isInteger(data["status"]) && data["status"] >= 100 && data["status"] <= 599) {
|
|
55
|
+
diagnostics["status"] = data["status"];
|
|
56
|
+
}
|
|
57
|
+
for (const key of ["statusText", "message", "requestId"]) {
|
|
58
|
+
if (typeof data[key] === "string" && !/^\s*[[{]/.test(data[key])) {
|
|
59
|
+
diagnostics[key] = data[key];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (isRecord(data["details"]) && Array.isArray(data["details"]["errors"])) {
|
|
63
|
+
const errors = data["details"]["errors"].filter(isRecord).map((item) => {
|
|
64
|
+
const diagnostic = {};
|
|
65
|
+
if (typeof item["name"] === "string") diagnostic["name"] = item["name"];
|
|
66
|
+
if (Array.isArray(item["path"]) && item["path"].every(
|
|
67
|
+
(part) => typeof part === "string" || typeof part === "number"
|
|
68
|
+
)) {
|
|
69
|
+
diagnostic["path"] = item["path"];
|
|
70
|
+
}
|
|
71
|
+
return diagnostic;
|
|
72
|
+
}).filter((item) => Object.keys(item).length > 0);
|
|
73
|
+
if (errors.length > 0) diagnostics["details"] = { errors };
|
|
74
|
+
}
|
|
75
|
+
return Object.keys(diagnostics).length > 0 ? JSON.stringify(diagnostics, null, " ") : "Request failed.";
|
|
76
|
+
}
|
|
37
77
|
function withErrorHandling(handler, errorPrefix = "Error") {
|
|
38
78
|
return async (params, extra) => {
|
|
39
79
|
try {
|
|
40
80
|
return await handler(params, extra);
|
|
41
81
|
} catch (error) {
|
|
42
|
-
const errorMessage =
|
|
82
|
+
const errorMessage = formatErrorMessage(error);
|
|
43
83
|
return {
|
|
44
84
|
isError: true,
|
|
45
85
|
content: [
|
|
@@ -60,23 +100,34 @@ var BaseToolSchema = z.object({
|
|
|
60
100
|
spaceId: z.string().describe("The ID of the Contentful space"),
|
|
61
101
|
environmentId: z.string().describe("The ID of the Contentful environment")
|
|
62
102
|
});
|
|
63
|
-
function
|
|
103
|
+
function buildUserAgentToolValue(config, options) {
|
|
104
|
+
const source = config.mcpSource ?? "local";
|
|
105
|
+
return `contentful-mcp${options?.exo ? "-exo" : ""}/${source}-${config.mcpVersion}`;
|
|
106
|
+
}
|
|
107
|
+
function createToolClient(config, params, options) {
|
|
108
|
+
const userAgentTool = buildUserAgentToolValue(config, options);
|
|
64
109
|
const clientConfig = {
|
|
65
110
|
accessToken: config.accessToken,
|
|
66
111
|
host: config.host ?? "api.contentful.com",
|
|
67
112
|
space: params.spaceId ?? config.spaceId,
|
|
68
113
|
headers: {
|
|
69
|
-
"X-Contentful-User-Agent-Tool":
|
|
114
|
+
"X-Contentful-User-Agent-Tool": userAgentTool,
|
|
115
|
+
"User-Agent": userAgentTool
|
|
70
116
|
}
|
|
71
117
|
};
|
|
72
118
|
return createClient(clientConfig);
|
|
73
119
|
}
|
|
120
|
+
function createExoToolClient(config, params) {
|
|
121
|
+
return createToolClient(config, params, { exo: true });
|
|
122
|
+
}
|
|
74
123
|
function createClientConfig(config) {
|
|
124
|
+
const userAgentTool = buildUserAgentToolValue(config);
|
|
75
125
|
const clientConfig = {
|
|
76
126
|
accessToken: config.accessToken,
|
|
77
127
|
host: config.host ?? "api.contentful.com",
|
|
78
128
|
headers: {
|
|
79
|
-
"X-Contentful-User-Agent-Tool":
|
|
129
|
+
"X-Contentful-User-Agent-Tool": userAgentTool,
|
|
130
|
+
"User-Agent": userAgentTool
|
|
80
131
|
}
|
|
81
132
|
};
|
|
82
133
|
return clientConfig;
|
|
@@ -552,7 +603,7 @@ function publishAiActionTool(config) {
|
|
|
552
603
|
});
|
|
553
604
|
} catch (error) {
|
|
554
605
|
return createSuccessResponse("AI action publish failed", {
|
|
555
|
-
status: error,
|
|
606
|
+
status: formatErrorMessage(error),
|
|
556
607
|
aiActionId: args.aiActionId
|
|
557
608
|
});
|
|
558
609
|
}
|
|
@@ -584,7 +635,7 @@ function unpublishAiActionTool(config) {
|
|
|
584
635
|
});
|
|
585
636
|
} catch (error) {
|
|
586
637
|
return createSuccessResponse("AI action unpublish failed", {
|
|
587
|
-
status: error,
|
|
638
|
+
status: formatErrorMessage(error),
|
|
588
639
|
aiActionId: args.aiActionId
|
|
589
640
|
});
|
|
590
641
|
}
|
|
@@ -1274,7 +1325,7 @@ function publishAssetTool(config) {
|
|
|
1274
1325
|
});
|
|
1275
1326
|
} catch (error) {
|
|
1276
1327
|
return createSuccessResponse("Asset publish failed", {
|
|
1277
|
-
status: error,
|
|
1328
|
+
status: formatErrorMessage(error),
|
|
1278
1329
|
assetId: assetIds[0]
|
|
1279
1330
|
});
|
|
1280
1331
|
}
|
|
@@ -1354,7 +1405,7 @@ function unpublishAssetTool(config) {
|
|
|
1354
1405
|
});
|
|
1355
1406
|
} catch (error) {
|
|
1356
1407
|
return createSuccessResponse("Asset unpublish failed", {
|
|
1357
|
-
status: error,
|
|
1408
|
+
status: formatErrorMessage(error),
|
|
1358
1409
|
assetId: assetIds[0]
|
|
1359
1410
|
});
|
|
1360
1411
|
}
|
|
@@ -1426,7 +1477,7 @@ function archiveAssetTool(config) {
|
|
|
1426
1477
|
await contentfulClient.asset.archive(params);
|
|
1427
1478
|
successfullyArchived.push(assetId);
|
|
1428
1479
|
} catch (error) {
|
|
1429
|
-
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive asset '${assetId}' after successfully archiving ${successfullyArchived.length} asset(s): [${successfullyArchived.join(", ")}]. Original error: ${
|
|
1480
|
+
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive asset '${assetId}' after successfully archiving ${successfullyArchived.length} asset(s): [${successfullyArchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to archive asset '${assetId}': ${formatErrorMessage(error)}`;
|
|
1430
1481
|
throw new Error(errorMessage);
|
|
1431
1482
|
}
|
|
1432
1483
|
}
|
|
@@ -1492,7 +1543,7 @@ function unarchiveAssetTool(config) {
|
|
|
1492
1543
|
await contentfulClient.asset.unarchive(params);
|
|
1493
1544
|
successfullyUnarchived.push(assetId);
|
|
1494
1545
|
} catch (error) {
|
|
1495
|
-
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive asset '${assetId}' after successfully unarchiving ${successfullyUnarchived.length} asset(s): [${successfullyUnarchived.join(", ")}]. Original error: ${
|
|
1546
|
+
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive asset '${assetId}' after successfully unarchiving ${successfullyUnarchived.length} asset(s): [${successfullyUnarchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to unarchive asset '${assetId}': ${formatErrorMessage(error)}`;
|
|
1496
1547
|
throw new Error(errorMessage);
|
|
1497
1548
|
}
|
|
1498
1549
|
}
|
|
@@ -1634,10 +1685,341 @@ function createAssetTools(config) {
|
|
|
1634
1685
|
};
|
|
1635
1686
|
}
|
|
1636
1687
|
|
|
1637
|
-
// src/tools/content-
|
|
1688
|
+
// src/tools/content-previews/listContentPreviews.ts
|
|
1638
1689
|
import { z as z23 } from "zod";
|
|
1690
|
+
import { createClient as createClient2 } from "contentful-management";
|
|
1691
|
+
|
|
1692
|
+
// src/tools/content-previews/types.ts
|
|
1693
|
+
function configurationContentTypeId(configuration) {
|
|
1694
|
+
if (configuration.entityType && configuration.entityType !== "ContentType") {
|
|
1695
|
+
return void 0;
|
|
1696
|
+
}
|
|
1697
|
+
return configuration.entityId ?? configuration.contentType ?? void 0;
|
|
1698
|
+
}
|
|
1699
|
+
function findEnabledConfiguration(previewEnvironment, contentTypeId) {
|
|
1700
|
+
return previewEnvironment.configurations.find(
|
|
1701
|
+
(configuration) => configuration.enabled && configurationContentTypeId(configuration) === contentTypeId
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// src/tools/content-previews/client.ts
|
|
1706
|
+
function previewEnvironmentsPath(spaceId) {
|
|
1707
|
+
return `/spaces/${spaceId}/preview_environments`;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
// src/tools/content-previews/listContentPreviews.ts
|
|
1711
|
+
var ListContentPreviewsToolParams = z23.object({
|
|
1712
|
+
spaceId: z23.string().describe("The ID of the Contentful space"),
|
|
1713
|
+
contentTypeId: z23.string().optional().describe(
|
|
1714
|
+
"Only return previews that have an enabled configuration for this content type"
|
|
1715
|
+
),
|
|
1716
|
+
limit: z23.number().optional().describe("Maximum number of content previews to return (default 100)"),
|
|
1717
|
+
skip: z23.number().optional().describe("Skip this many content previews for pagination")
|
|
1718
|
+
});
|
|
1719
|
+
function listContentPreviewsTool(config) {
|
|
1720
|
+
async function tool2(args) {
|
|
1721
|
+
const contentfulClient = createClient2(createClientConfig(config));
|
|
1722
|
+
const previews = await contentfulClient.raw.get(previewEnvironmentsPath(args.spaceId), {
|
|
1723
|
+
params: {
|
|
1724
|
+
limit: args.limit ?? 100,
|
|
1725
|
+
...args.skip ? { skip: args.skip } : {}
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
const summarized = previews.items.map((preview) => ({
|
|
1729
|
+
id: preview.sys.id,
|
|
1730
|
+
name: preview.name,
|
|
1731
|
+
description: preview.description ?? null,
|
|
1732
|
+
configurations: preview.configurations.filter(
|
|
1733
|
+
(configuration) => !args.contentTypeId || configuration.enabled && configurationContentTypeId(configuration) === args.contentTypeId
|
|
1734
|
+
).map((configuration) => ({
|
|
1735
|
+
contentTypeId: configurationContentTypeId(configuration) ?? null,
|
|
1736
|
+
entityType: configuration.entityType ?? "ContentType",
|
|
1737
|
+
urlTemplate: configuration.url,
|
|
1738
|
+
enabled: configuration.enabled
|
|
1739
|
+
}))
|
|
1740
|
+
})).filter(
|
|
1741
|
+
(preview) => !args.contentTypeId || preview.configurations.length > 0
|
|
1742
|
+
);
|
|
1743
|
+
return createSuccessResponse("Content previews retrieved successfully", {
|
|
1744
|
+
contentPreviews: summarized,
|
|
1745
|
+
total: previews.total
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
return withErrorHandling(tool2, "Error listing content previews");
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
// src/tools/content-previews/getEntryPreviewUrl.ts
|
|
1752
|
+
import { z as z24 } from "zod";
|
|
1753
|
+
|
|
1754
|
+
// src/tools/content-previews/previewUrl.ts
|
|
1755
|
+
import { cloneDeep, get } from "lodash-es";
|
|
1756
|
+
var LOCALE_TOKEN = /{\s*locale\s*}/g;
|
|
1757
|
+
var TOKEN = /{(\s*([\S]+?)\s*)}/g;
|
|
1758
|
+
var PLACEHOLDER = /\{.*?\}/g;
|
|
1759
|
+
var LINKED_BY = /linkedBy/g;
|
|
1760
|
+
var NESTED_REFERENCE = /^entry\.fields\.\w+\.[a-zA-Z-]+\.(fields|sys)/;
|
|
1761
|
+
var NESTED_REFERENCE_PREFIX = /^entry\.fields\.\w+\.[a-zA-Z-]+\./;
|
|
1762
|
+
var SECOND_REFERENCE_HOP = /fields\.[a-zA-Z]+\.fields/;
|
|
1763
|
+
function addLocale(path, locale) {
|
|
1764
|
+
const fieldsIndex = path.indexOf("fields");
|
|
1765
|
+
if (fieldsIndex === -1) {
|
|
1766
|
+
return path;
|
|
1767
|
+
}
|
|
1768
|
+
const separatorIndex = path.indexOf(".", fieldsIndex + "fields".length + 1);
|
|
1769
|
+
if (separatorIndex === -1) {
|
|
1770
|
+
return path;
|
|
1771
|
+
}
|
|
1772
|
+
return `${path.slice(0, separatorIndex + 1)}${locale}.${path.slice(separatorIndex + 1)}`;
|
|
1773
|
+
}
|
|
1774
|
+
function countIncomingLinkHops(template) {
|
|
1775
|
+
const placeholders = template.match(PLACEHOLDER) ?? [];
|
|
1776
|
+
if (placeholders.length === 0) {
|
|
1777
|
+
return 0;
|
|
1778
|
+
}
|
|
1779
|
+
return Math.max(
|
|
1780
|
+
...placeholders.map(
|
|
1781
|
+
(placeholder) => (placeholder.match(LINKED_BY) ?? []).length
|
|
1782
|
+
)
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
function isEntryLink(value) {
|
|
1786
|
+
const sys = value?.sys;
|
|
1787
|
+
return sys?.type === "Link" && sys?.linkType === "Entry";
|
|
1788
|
+
}
|
|
1789
|
+
function asTokenValue(value) {
|
|
1790
|
+
if (typeof value === "string") {
|
|
1791
|
+
return value;
|
|
1792
|
+
}
|
|
1793
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
1794
|
+
return String(value);
|
|
1795
|
+
}
|
|
1796
|
+
return void 0;
|
|
1797
|
+
}
|
|
1798
|
+
function unwrapValue(value, defaultLocaleCode) {
|
|
1799
|
+
if (value !== null && typeof value === "object") {
|
|
1800
|
+
return asTokenValue(value[defaultLocaleCode]);
|
|
1801
|
+
}
|
|
1802
|
+
return asTokenValue(value);
|
|
1803
|
+
}
|
|
1804
|
+
async function readContextPath(path, context, getEntry) {
|
|
1805
|
+
if (getEntry && NESTED_REFERENCE.test(path)) {
|
|
1806
|
+
const prefix = NESTED_REFERENCE_PREFIX.exec(path)?.[0];
|
|
1807
|
+
const referencePath = prefix?.slice(0, -1);
|
|
1808
|
+
if (referencePath) {
|
|
1809
|
+
const nestedPath = path.slice(referencePath.length + 1);
|
|
1810
|
+
if (SECOND_REFERENCE_HOP.test(nestedPath)) {
|
|
1811
|
+
return void 0;
|
|
1812
|
+
}
|
|
1813
|
+
const link = get(context, referencePath);
|
|
1814
|
+
if (isEntryLink(link)) {
|
|
1815
|
+
const nestedEntry = await getEntry(link.sys.id);
|
|
1816
|
+
return nestedEntry ? get(nestedEntry, nestedPath) : void 0;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
return get(context, path);
|
|
1821
|
+
}
|
|
1822
|
+
async function attachIncomingLinks(entry, template, getIncomingLink) {
|
|
1823
|
+
const hops = countIncomingLinkHops(template);
|
|
1824
|
+
if (hops === 0 || !getIncomingLink) {
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
const seen = /* @__PURE__ */ new Map();
|
|
1828
|
+
let current = entry;
|
|
1829
|
+
for (let hop = 0; hop < hops; hop += 1) {
|
|
1830
|
+
const entryId = current.sys.id;
|
|
1831
|
+
if (!seen.has(entryId)) {
|
|
1832
|
+
seen.set(entryId, await getIncomingLink(entryId));
|
|
1833
|
+
}
|
|
1834
|
+
const linkedBy = seen.get(entryId);
|
|
1835
|
+
if (!linkedBy) {
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
current.linkedBy = cloneDeep(linkedBy);
|
|
1839
|
+
current = current.linkedBy;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
async function resolvePreviewUrl(options) {
|
|
1843
|
+
const {
|
|
1844
|
+
template,
|
|
1845
|
+
environmentId,
|
|
1846
|
+
defaultLocaleCode,
|
|
1847
|
+
currentLocaleCode,
|
|
1848
|
+
getEntry,
|
|
1849
|
+
getIncomingLink
|
|
1850
|
+
} = options;
|
|
1851
|
+
const entry = cloneDeep(options.entry);
|
|
1852
|
+
await attachIncomingLinks(entry, template, getIncomingLink);
|
|
1853
|
+
const context = {
|
|
1854
|
+
entry,
|
|
1855
|
+
env_id: environmentId,
|
|
1856
|
+
entry_id: entry.sys.id,
|
|
1857
|
+
entry_field: entry.fields
|
|
1858
|
+
};
|
|
1859
|
+
let url = template.replace(
|
|
1860
|
+
LOCALE_TOKEN,
|
|
1861
|
+
currentLocaleCode ?? defaultLocaleCode
|
|
1862
|
+
);
|
|
1863
|
+
const unresolvedTokens = [];
|
|
1864
|
+
for (const [token, rawPath] of [...url.matchAll(TOKEN)]) {
|
|
1865
|
+
const path = rawPath?.trim() || token;
|
|
1866
|
+
const raw = await readContextPath(
|
|
1867
|
+
addLocale(path, defaultLocaleCode),
|
|
1868
|
+
context,
|
|
1869
|
+
getEntry
|
|
1870
|
+
);
|
|
1871
|
+
const value = unwrapValue(raw, defaultLocaleCode);
|
|
1872
|
+
if (value === void 0) {
|
|
1873
|
+
if (!unresolvedTokens.includes(path)) {
|
|
1874
|
+
unresolvedTokens.push(path);
|
|
1875
|
+
}
|
|
1876
|
+
continue;
|
|
1877
|
+
}
|
|
1878
|
+
url = url.replace(token, () => value);
|
|
1879
|
+
}
|
|
1880
|
+
return { url, unresolvedTokens };
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
// src/tools/content-previews/getEntryPreviewUrl.ts
|
|
1884
|
+
var GetEntryPreviewUrlToolParams = BaseToolSchema.extend({
|
|
1885
|
+
entryId: z24.string().describe("The ID of the entry to build a preview URL for"),
|
|
1886
|
+
previewId: z24.string().optional().describe(
|
|
1887
|
+
"ID of the content preview to use. Defaults to the first preview with an enabled configuration for the entry content type. Use list_content_previews to see the options."
|
|
1888
|
+
),
|
|
1889
|
+
locale: z24.string().optional().describe(
|
|
1890
|
+
"Locale code substituted into the {locale} token. Defaults to the space default locale."
|
|
1891
|
+
)
|
|
1892
|
+
});
|
|
1893
|
+
function toEntryContext(entry) {
|
|
1894
|
+
return {
|
|
1895
|
+
sys: entry.sys,
|
|
1896
|
+
fields: entry.fields
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
function getEntryPreviewUrlTool(config) {
|
|
1900
|
+
async function tool2(args) {
|
|
1901
|
+
const scope = {
|
|
1902
|
+
spaceId: args.spaceId,
|
|
1903
|
+
environmentId: args.environmentId
|
|
1904
|
+
};
|
|
1905
|
+
const contentfulClient = createToolClient(config, args);
|
|
1906
|
+
const entry = await contentfulClient.entry.get({
|
|
1907
|
+
...scope,
|
|
1908
|
+
entryId: args.entryId
|
|
1909
|
+
});
|
|
1910
|
+
const contentTypeId = entry.sys.contentType?.sys.id;
|
|
1911
|
+
if (!contentTypeId) {
|
|
1912
|
+
throw new Error(
|
|
1913
|
+
`Entry "${args.entryId}" has no content type, so no preview configuration can be matched.`
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
const previews = await contentfulClient.raw.get(previewEnvironmentsPath(args.spaceId), { params: { limit: 100 } });
|
|
1917
|
+
const candidates = previews.items.flatMap((preview2) => {
|
|
1918
|
+
const configuration2 = findEnabledConfiguration(preview2, contentTypeId);
|
|
1919
|
+
return configuration2 ? [{ preview: preview2, configuration: configuration2 }] : [];
|
|
1920
|
+
});
|
|
1921
|
+
if (candidates.length === 0) {
|
|
1922
|
+
throw new Error(
|
|
1923
|
+
`No content preview with an enabled configuration for content type "${contentTypeId}" exists in space "${args.spaceId}". Add one under Settings \u2192 Content Preview, or call list_content_previews to see what is configured.`
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
const selected = args.previewId ? candidates.find(
|
|
1927
|
+
(candidate) => candidate.preview.sys.id === args.previewId
|
|
1928
|
+
) : candidates[0];
|
|
1929
|
+
if (!selected) {
|
|
1930
|
+
throw new Error(
|
|
1931
|
+
`Content preview "${args.previewId}" has no enabled configuration for content type "${contentTypeId}". Available previews for this content type: ${candidates.map(({ preview: preview2 }) => `${preview2.name} (${preview2.sys.id})`).join(", ")}.`
|
|
1932
|
+
);
|
|
1933
|
+
}
|
|
1934
|
+
const { preview, configuration } = selected;
|
|
1935
|
+
const locales = await contentfulClient.locale.getMany({
|
|
1936
|
+
...scope,
|
|
1937
|
+
query: { limit: 100 }
|
|
1938
|
+
});
|
|
1939
|
+
const defaultLocaleCode = locales.items.find((locale) => locale.default)?.code ?? locales.items[0]?.code;
|
|
1940
|
+
if (!defaultLocaleCode) {
|
|
1941
|
+
throw new Error(
|
|
1942
|
+
`No locales found for ${args.spaceId}/${args.environmentId}, so localized preview tokens cannot be resolved.`
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
const { url, unresolvedTokens } = await resolvePreviewUrl({
|
|
1946
|
+
template: configuration.url,
|
|
1947
|
+
entry: toEntryContext(entry),
|
|
1948
|
+
environmentId: args.environmentId,
|
|
1949
|
+
defaultLocaleCode,
|
|
1950
|
+
currentLocaleCode: args.locale,
|
|
1951
|
+
getEntry: async (entryId) => {
|
|
1952
|
+
try {
|
|
1953
|
+
return toEntryContext(
|
|
1954
|
+
await contentfulClient.entry.get({ ...scope, entryId })
|
|
1955
|
+
);
|
|
1956
|
+
} catch {
|
|
1957
|
+
return void 0;
|
|
1958
|
+
}
|
|
1959
|
+
},
|
|
1960
|
+
getIncomingLink: async (entryId) => {
|
|
1961
|
+
try {
|
|
1962
|
+
const linking = await contentfulClient.entry.getMany({
|
|
1963
|
+
...scope,
|
|
1964
|
+
query: { links_to_entry: entryId, limit: 1 }
|
|
1965
|
+
});
|
|
1966
|
+
const first = linking.items[0];
|
|
1967
|
+
return first ? toEntryContext(first) : void 0;
|
|
1968
|
+
} catch {
|
|
1969
|
+
return void 0;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
return createSuccessResponse("Entry preview URL resolved successfully", {
|
|
1974
|
+
previewUrl: url,
|
|
1975
|
+
previewId: preview.sys.id,
|
|
1976
|
+
previewName: preview.name,
|
|
1977
|
+
contentTypeId,
|
|
1978
|
+
urlTemplate: configuration.url,
|
|
1979
|
+
locale: args.locale ?? defaultLocaleCode,
|
|
1980
|
+
...unresolvedTokens.length > 0 ? {
|
|
1981
|
+
unresolvedTokens,
|
|
1982
|
+
warning: "The URL still contains the tokens listed above because no value could be resolved for them. Verify the link before sharing it."
|
|
1983
|
+
} : {}
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
return withErrorHandling(tool2, "Error resolving entry preview URL");
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// src/tools/content-previews/register.ts
|
|
1990
|
+
function createContentPreviewTools(config) {
|
|
1991
|
+
const listContentPreviews = listContentPreviewsTool(config);
|
|
1992
|
+
const getEntryPreviewUrl = getEntryPreviewUrlTool(config);
|
|
1993
|
+
return {
|
|
1994
|
+
listContentPreviews: {
|
|
1995
|
+
title: "list_content_previews",
|
|
1996
|
+
description: "List the content previews (Settings \u2192 Content Preview) configured for a space, including the URL template for each content type. URL templates can contain secret tokens, so treat the output as sensitive.",
|
|
1997
|
+
inputParams: ListContentPreviewsToolParams.shape,
|
|
1998
|
+
annotations: {
|
|
1999
|
+
readOnlyHint: true,
|
|
2000
|
+
destructiveHint: false,
|
|
2001
|
+
openWorldHint: false
|
|
2002
|
+
},
|
|
2003
|
+
tool: listContentPreviews
|
|
2004
|
+
},
|
|
2005
|
+
getEntryPreviewUrl: {
|
|
2006
|
+
title: "get_entry_preview_url",
|
|
2007
|
+
description: "Resolve the draft-preview URL for an entry by substituting the entry's data into the content preview URL template configured for its content type. Returns the same link an editor would get from the Content Preview dropdown in the entry editor, plus any tokens that could not be resolved.",
|
|
2008
|
+
inputParams: GetEntryPreviewUrlToolParams.shape,
|
|
2009
|
+
annotations: {
|
|
2010
|
+
readOnlyHint: true,
|
|
2011
|
+
destructiveHint: false,
|
|
2012
|
+
openWorldHint: false
|
|
2013
|
+
},
|
|
2014
|
+
tool: getEntryPreviewUrl
|
|
2015
|
+
}
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
// src/tools/content-types/getContentType.ts
|
|
2020
|
+
import { z as z25 } from "zod";
|
|
1639
2021
|
var GetContentTypeToolParams = BaseToolSchema.extend({
|
|
1640
|
-
contentTypeId:
|
|
2022
|
+
contentTypeId: z25.string().describe("The ID of the content type to retrieve details for")
|
|
1641
2023
|
});
|
|
1642
2024
|
function getContentTypeTool(config) {
|
|
1643
2025
|
async function tool2(args) {
|
|
@@ -1658,13 +2040,13 @@ function getContentTypeTool(config) {
|
|
|
1658
2040
|
}
|
|
1659
2041
|
|
|
1660
2042
|
// src/tools/content-types/listContentTypes.ts
|
|
1661
|
-
import { z as
|
|
2043
|
+
import { z as z26 } from "zod";
|
|
1662
2044
|
var ListContentTypesToolParams = BaseToolSchema.extend({
|
|
1663
|
-
limit:
|
|
1664
|
-
skip:
|
|
1665
|
-
select:
|
|
1666
|
-
include:
|
|
1667
|
-
order:
|
|
2045
|
+
limit: z26.number().optional().describe("Maximum number of content types to return (max 10)"),
|
|
2046
|
+
skip: z26.number().optional().describe("Skip this many content types for pagination"),
|
|
2047
|
+
select: z26.string().optional().describe("Comma-separated list of fields to return"),
|
|
2048
|
+
include: z26.number().optional().describe("Include this many levels of linked entries"),
|
|
2049
|
+
order: z26.string().optional().describe("Order content types by this field")
|
|
1668
2050
|
});
|
|
1669
2051
|
function listContentTypesTool(config) {
|
|
1670
2052
|
async function tool2(args) {
|
|
@@ -1709,74 +2091,74 @@ function listContentTypesTool(config) {
|
|
|
1709
2091
|
}
|
|
1710
2092
|
|
|
1711
2093
|
// src/tools/content-types/createContentType.ts
|
|
1712
|
-
import { z as
|
|
2094
|
+
import { z as z29 } from "zod";
|
|
1713
2095
|
|
|
1714
2096
|
// src/types/fieldSchema.ts
|
|
1715
|
-
import { z as
|
|
2097
|
+
import { z as z28 } from "zod";
|
|
1716
2098
|
|
|
1717
2099
|
// src/types/contentTypeFieldValidationSchema.ts
|
|
1718
|
-
import { z as
|
|
2100
|
+
import { z as z27 } from "zod";
|
|
1719
2101
|
import { INLINES, BLOCKS } from "@contentful/rich-text-types";
|
|
1720
|
-
var NumRange =
|
|
1721
|
-
min:
|
|
1722
|
-
max:
|
|
2102
|
+
var NumRange = z27.object({
|
|
2103
|
+
min: z27.number().optional(),
|
|
2104
|
+
max: z27.number().optional()
|
|
1723
2105
|
});
|
|
1724
|
-
var DateRange =
|
|
1725
|
-
min:
|
|
1726
|
-
max:
|
|
2106
|
+
var DateRange = z27.object({
|
|
2107
|
+
min: z27.string().optional(),
|
|
2108
|
+
max: z27.string().optional()
|
|
1727
2109
|
});
|
|
1728
|
-
var RegExpSchema =
|
|
1729
|
-
pattern:
|
|
1730
|
-
flags:
|
|
2110
|
+
var RegExpSchema = z27.object({
|
|
2111
|
+
pattern: z27.string(),
|
|
2112
|
+
flags: z27.string()
|
|
1731
2113
|
});
|
|
1732
|
-
var AssetImageDimensions =
|
|
2114
|
+
var AssetImageDimensions = z27.object({
|
|
1733
2115
|
width: NumRange.optional(),
|
|
1734
2116
|
height: NumRange.optional()
|
|
1735
2117
|
});
|
|
1736
|
-
var ExternalResource =
|
|
1737
|
-
type:
|
|
2118
|
+
var ExternalResource = z27.object({
|
|
2119
|
+
type: z27.string()
|
|
1738
2120
|
});
|
|
1739
|
-
var ContentfulEntryResource =
|
|
1740
|
-
type:
|
|
1741
|
-
source:
|
|
1742
|
-
contentTypes:
|
|
2121
|
+
var ContentfulEntryResource = z27.object({
|
|
2122
|
+
type: z27.literal("Contentful:Entry"),
|
|
2123
|
+
source: z27.string(),
|
|
2124
|
+
contentTypes: z27.array(z27.string())
|
|
1743
2125
|
});
|
|
1744
|
-
var ContentTypeAllowedResources =
|
|
2126
|
+
var ContentTypeAllowedResources = z27.union([
|
|
1745
2127
|
ContentfulEntryResource,
|
|
1746
2128
|
ExternalResource
|
|
1747
2129
|
]);
|
|
1748
|
-
var NodesValidation =
|
|
1749
|
-
|
|
1750
|
-
|
|
2130
|
+
var NodesValidation = z27.record(
|
|
2131
|
+
z27.array(
|
|
2132
|
+
z27.object({
|
|
1751
2133
|
// subset of ContentTypeFieldValidation used for node validations
|
|
1752
2134
|
size: NumRange.optional(),
|
|
1753
|
-
linkContentType:
|
|
1754
|
-
message:
|
|
2135
|
+
linkContentType: z27.array(z27.string()).optional(),
|
|
2136
|
+
message: z27.string().nullable().optional()
|
|
1755
2137
|
})
|
|
1756
2138
|
).or(
|
|
1757
|
-
|
|
1758
|
-
validations:
|
|
1759
|
-
|
|
2139
|
+
z27.object({
|
|
2140
|
+
validations: z27.array(
|
|
2141
|
+
z27.object({
|
|
1760
2142
|
size: NumRange.optional(),
|
|
1761
|
-
message:
|
|
2143
|
+
message: z27.string().nullable().optional()
|
|
1762
2144
|
})
|
|
1763
2145
|
),
|
|
1764
|
-
allowedResources:
|
|
2146
|
+
allowedResources: z27.array(ContentTypeAllowedResources)
|
|
1765
2147
|
})
|
|
1766
2148
|
)
|
|
1767
2149
|
);
|
|
1768
|
-
var ContentTypeFieldValidationSchema =
|
|
1769
|
-
linkContentType:
|
|
1770
|
-
in:
|
|
1771
|
-
linkMimetypeGroup:
|
|
1772
|
-
enabledNodeTypes:
|
|
1773
|
-
enabledMarks:
|
|
1774
|
-
unique:
|
|
2150
|
+
var ContentTypeFieldValidationSchema = z27.object({
|
|
2151
|
+
linkContentType: z27.array(z27.string()).optional(),
|
|
2152
|
+
in: z27.array(z27.union([z27.string(), z27.number()])).optional(),
|
|
2153
|
+
linkMimetypeGroup: z27.array(z27.string()).optional(),
|
|
2154
|
+
enabledNodeTypes: z27.array(z27.union([z27.nativeEnum(BLOCKS), z27.nativeEnum(INLINES)])).optional(),
|
|
2155
|
+
enabledMarks: z27.array(z27.string()).optional(),
|
|
2156
|
+
unique: z27.boolean().optional(),
|
|
1775
2157
|
size: NumRange.optional(),
|
|
1776
2158
|
range: NumRange.optional(),
|
|
1777
2159
|
dateRange: DateRange.optional(),
|
|
1778
2160
|
regexp: RegExpSchema.optional(),
|
|
1779
|
-
message:
|
|
2161
|
+
message: z27.string().nullable().optional(),
|
|
1780
2162
|
prohibitRegexp: RegExpSchema.optional(),
|
|
1781
2163
|
assetImageDimensions: AssetImageDimensions.optional(),
|
|
1782
2164
|
assetFileSize: NumRange.optional(),
|
|
@@ -1784,36 +2166,36 @@ var ContentTypeFieldValidationSchema = z25.object({
|
|
|
1784
2166
|
});
|
|
1785
2167
|
|
|
1786
2168
|
// src/types/fieldSchema.ts
|
|
1787
|
-
var FieldSchema =
|
|
1788
|
-
id:
|
|
1789
|
-
name:
|
|
1790
|
-
type:
|
|
2169
|
+
var FieldSchema = z28.object({
|
|
2170
|
+
id: z28.string().describe("The field ID"),
|
|
2171
|
+
name: z28.string().describe("The field name"),
|
|
2172
|
+
type: z28.string().describe(
|
|
1791
2173
|
'The field type (e.g., "Symbol", "Text", "Integer", "Boolean", "Date", "Location", "Link", "Array", "Object")'
|
|
1792
2174
|
),
|
|
1793
|
-
required:
|
|
1794
|
-
localized:
|
|
1795
|
-
disabled:
|
|
1796
|
-
omitted:
|
|
1797
|
-
validations:
|
|
1798
|
-
settings:
|
|
1799
|
-
defaultValue:
|
|
1800
|
-
linkType:
|
|
1801
|
-
items:
|
|
1802
|
-
type:
|
|
1803
|
-
linkType:
|
|
1804
|
-
validations:
|
|
2175
|
+
required: z28.boolean().describe("Whether the field is required"),
|
|
2176
|
+
localized: z28.boolean().describe("Whether the field is localized"),
|
|
2177
|
+
disabled: z28.boolean().optional().describe("Whether the field is disabled"),
|
|
2178
|
+
omitted: z28.boolean().optional().describe("Whether the field is omitted from the API response"),
|
|
2179
|
+
validations: z28.array(ContentTypeFieldValidationSchema).optional().describe("Field validations"),
|
|
2180
|
+
settings: z28.record(z28.any()).optional().describe("Field-specific settings"),
|
|
2181
|
+
defaultValue: z28.any().optional().describe("Default value for the field"),
|
|
2182
|
+
linkType: z28.string().optional().describe('Link type for Link fields (e.g., "Entry", "Asset")'),
|
|
2183
|
+
items: z28.object({
|
|
2184
|
+
type: z28.string(),
|
|
2185
|
+
linkType: z28.string().optional(),
|
|
2186
|
+
validations: z28.array(ContentTypeFieldValidationSchema).optional()
|
|
1805
2187
|
}).optional().describe("Items configuration for Array fields")
|
|
1806
2188
|
});
|
|
1807
2189
|
|
|
1808
2190
|
// src/tools/content-types/createContentType.ts
|
|
1809
2191
|
var CreateContentTypeToolParams = BaseToolSchema.extend({
|
|
1810
|
-
name:
|
|
1811
|
-
displayField:
|
|
1812
|
-
description:
|
|
1813
|
-
contentTypeId:
|
|
2192
|
+
name: z29.string().describe("The name of the content type"),
|
|
2193
|
+
displayField: z29.string().describe("The field ID to use as the display field"),
|
|
2194
|
+
description: z29.string().optional().describe("Description of the content type"),
|
|
2195
|
+
contentTypeId: z29.string().optional().describe(
|
|
1814
2196
|
"Optional ID for the content type. If provided, will use createWithId method"
|
|
1815
2197
|
),
|
|
1816
|
-
fields:
|
|
2198
|
+
fields: z29.array(FieldSchema).describe("Array of field definitions for the content type"),
|
|
1817
2199
|
metadata: ContentTypeMetadataSchema
|
|
1818
2200
|
});
|
|
1819
2201
|
function createContentTypeTool(config) {
|
|
@@ -1846,13 +2228,13 @@ function createContentTypeTool(config) {
|
|
|
1846
2228
|
}
|
|
1847
2229
|
|
|
1848
2230
|
// src/tools/content-types/updateContentType.ts
|
|
1849
|
-
import { z as
|
|
2231
|
+
import { z as z30 } from "zod";
|
|
1850
2232
|
var UpdateContentTypeToolParams = BaseToolSchema.extend({
|
|
1851
|
-
contentTypeId:
|
|
1852
|
-
name:
|
|
1853
|
-
displayField:
|
|
1854
|
-
description:
|
|
1855
|
-
fields:
|
|
2233
|
+
contentTypeId: z30.string().describe("The ID of the content type to update"),
|
|
2234
|
+
name: z30.string().optional().describe("The name of the content type"),
|
|
2235
|
+
displayField: z30.string().optional().describe("The field ID to use as the display field"),
|
|
2236
|
+
description: z30.string().optional().describe("Description of the content type"),
|
|
2237
|
+
fields: z30.array(FieldSchema).optional().describe(
|
|
1856
2238
|
"Array of field definitions for the content type. Will be merged with existing fields."
|
|
1857
2239
|
),
|
|
1858
2240
|
metadata: ContentTypeMetadataSchema
|
|
@@ -1911,13 +2293,13 @@ function updateContentTypeTool(config) {
|
|
|
1911
2293
|
}
|
|
1912
2294
|
|
|
1913
2295
|
// src/tools/content-types/deleteContentType.ts
|
|
1914
|
-
import { z as
|
|
2296
|
+
import { z as z31 } from "zod";
|
|
1915
2297
|
var DeleteContentTypeToolParams = BaseToolSchema.extend({
|
|
1916
|
-
contentTypeId:
|
|
1917
|
-
confirm:
|
|
2298
|
+
contentTypeId: z31.string().describe("The ID of the content type to delete"),
|
|
2299
|
+
confirm: z31.boolean().optional().describe(
|
|
1918
2300
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
1919
2301
|
),
|
|
1920
|
-
confirmToken:
|
|
2302
|
+
confirmToken: z31.string().optional().describe(
|
|
1921
2303
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
1922
2304
|
)
|
|
1923
2305
|
});
|
|
@@ -1959,9 +2341,9 @@ function deleteContentTypeTool(config) {
|
|
|
1959
2341
|
}
|
|
1960
2342
|
|
|
1961
2343
|
// src/tools/content-types/publishContentType.ts
|
|
1962
|
-
import { z as
|
|
2344
|
+
import { z as z32 } from "zod";
|
|
1963
2345
|
var PublishContentTypeToolParams = BaseToolSchema.extend({
|
|
1964
|
-
contentTypeId:
|
|
2346
|
+
contentTypeId: z32.string().describe("The ID of the content type to publish")
|
|
1965
2347
|
});
|
|
1966
2348
|
function publishContentTypeTool(config) {
|
|
1967
2349
|
async function tool2(args) {
|
|
@@ -1988,9 +2370,9 @@ function publishContentTypeTool(config) {
|
|
|
1988
2370
|
}
|
|
1989
2371
|
|
|
1990
2372
|
// src/tools/content-types/unpublishContentType.ts
|
|
1991
|
-
import { z as
|
|
2373
|
+
import { z as z33 } from "zod";
|
|
1992
2374
|
var UnpublishContentTypeToolParams = BaseToolSchema.extend({
|
|
1993
|
-
contentTypeId:
|
|
2375
|
+
contentTypeId: z33.string().describe("The ID of the content type to unpublish")
|
|
1994
2376
|
});
|
|
1995
2377
|
function unpublishContentTypeTool(config) {
|
|
1996
2378
|
async function tool2(args) {
|
|
@@ -2013,11 +2395,11 @@ function unpublishContentTypeTool(config) {
|
|
|
2013
2395
|
}
|
|
2014
2396
|
|
|
2015
2397
|
// src/tools/content-types/omitContentTypeField.ts
|
|
2016
|
-
import { z as
|
|
2398
|
+
import { z as z34 } from "zod";
|
|
2017
2399
|
var OmitContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2018
|
-
contentTypeId:
|
|
2019
|
-
fieldId:
|
|
2020
|
-
omitted:
|
|
2400
|
+
contentTypeId: z34.string().describe("The ID of the content type containing the field"),
|
|
2401
|
+
fieldId: z34.string().describe("The ID of the field to omit"),
|
|
2402
|
+
omitted: z34.boolean().default(true).describe(
|
|
2021
2403
|
"Whether the field should be omitted. Defaults to true. Set to false to un-omit a field."
|
|
2022
2404
|
)
|
|
2023
2405
|
});
|
|
@@ -2052,10 +2434,10 @@ function omitContentTypeFieldTool(config) {
|
|
|
2052
2434
|
}
|
|
2053
2435
|
|
|
2054
2436
|
// src/tools/content-types/deleteContentTypeField.ts
|
|
2055
|
-
import { z as
|
|
2437
|
+
import { z as z35 } from "zod";
|
|
2056
2438
|
var DeleteContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2057
|
-
contentTypeId:
|
|
2058
|
-
fieldId:
|
|
2439
|
+
contentTypeId: z35.string().describe("The ID of the content type containing the field"),
|
|
2440
|
+
fieldId: z35.string().describe("The ID of the field to delete")
|
|
2059
2441
|
});
|
|
2060
2442
|
function deleteContentTypeFieldTool(config) {
|
|
2061
2443
|
async function tool2(args) {
|
|
@@ -2098,14 +2480,14 @@ function deleteContentTypeFieldTool(config) {
|
|
|
2098
2480
|
}
|
|
2099
2481
|
|
|
2100
2482
|
// src/tools/content-types/disableContentTypeField.ts
|
|
2101
|
-
import { z as
|
|
2483
|
+
import { z as z36 } from "zod";
|
|
2102
2484
|
var DisableContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2103
|
-
contentTypeId:
|
|
2104
|
-
fieldId:
|
|
2105
|
-
disabled:
|
|
2485
|
+
contentTypeId: z36.string().describe("The ID of the content type containing the field"),
|
|
2486
|
+
fieldId: z36.string().describe("The ID of the field to update"),
|
|
2487
|
+
disabled: z36.boolean().optional().describe(
|
|
2106
2488
|
"Set to true to disable the field in the editor UI (editors cannot edit it), false to re-enable. Takes effect once the content type is published."
|
|
2107
2489
|
),
|
|
2108
|
-
omitted:
|
|
2490
|
+
omitted: z36.boolean().optional().describe(
|
|
2109
2491
|
"Set to true to omit the field from API responses, false to include it again. Takes effect once the content type is published. Prefer omit_content_type_field when only changing the omitted flag."
|
|
2110
2492
|
)
|
|
2111
2493
|
});
|
|
@@ -2287,7 +2669,7 @@ function createContentTypeTools(config) {
|
|
|
2287
2669
|
}
|
|
2288
2670
|
|
|
2289
2671
|
// src/tools/context/getInitialContextTool.ts
|
|
2290
|
-
import { z as
|
|
2672
|
+
import { z as z37 } from "zod";
|
|
2291
2673
|
import { outdent } from "outdent";
|
|
2292
2674
|
|
|
2293
2675
|
// src/tools/context/store.ts
|
|
@@ -2332,7 +2714,7 @@ var EXO_DISPOSITION = `# Tool disposition: Experience Orchestration by default
|
|
|
2332
2714
|
Experience Orchestration (ExO) tools are enabled. Use ExO primitives \u2014 Components, Experiences, Experience Templates, Experience Fragments, and Data Assemblies \u2014 for all content modeling and authoring. Do not create classic content types or entries unless the user explicitly instructs you to. If you are unsure how to model something with ExO, inspect the tool schemas and proceed with ExO.`;
|
|
2333
2715
|
|
|
2334
2716
|
// src/tools/context/getInitialContextTool.ts
|
|
2335
|
-
var GetInitialContextToolParams =
|
|
2717
|
+
var GetInitialContextToolParams = z37.object({});
|
|
2336
2718
|
function getInitialContextTool(config) {
|
|
2337
2719
|
async function tool2(_params) {
|
|
2338
2720
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
@@ -2432,9 +2814,9 @@ function listEditorInterfacesTool(config) {
|
|
|
2432
2814
|
}
|
|
2433
2815
|
|
|
2434
2816
|
// src/tools/editor-interfaces/getEditorInterface.ts
|
|
2435
|
-
import { z as
|
|
2817
|
+
import { z as z38 } from "zod";
|
|
2436
2818
|
var GetEditorInterfaceToolParams = BaseToolSchema.extend({
|
|
2437
|
-
contentTypeId:
|
|
2819
|
+
contentTypeId: z38.string().describe(
|
|
2438
2820
|
"The ID of the content type to retrieve the editor interface for"
|
|
2439
2821
|
)
|
|
2440
2822
|
});
|
|
@@ -2455,42 +2837,42 @@ function getEditorInterfaceTool(config) {
|
|
|
2455
2837
|
}
|
|
2456
2838
|
|
|
2457
2839
|
// src/tools/editor-interfaces/updateEditorInterface.ts
|
|
2458
|
-
import { z as
|
|
2459
|
-
var ControlSchema =
|
|
2460
|
-
fieldId:
|
|
2461
|
-
widgetId:
|
|
2462
|
-
widgetNamespace:
|
|
2840
|
+
import { z as z39 } from "zod";
|
|
2841
|
+
var ControlSchema = z39.object({
|
|
2842
|
+
fieldId: z39.string().describe("The field ID this control applies to"),
|
|
2843
|
+
widgetId: z39.string().describe("The widget ID to use for this field"),
|
|
2844
|
+
widgetNamespace: z39.enum(["builtin", "extension", "app", "editor-builtin"]).optional().describe(
|
|
2463
2845
|
"The namespace of the widget (builtin, extension, app, or editor-builtin)"
|
|
2464
2846
|
),
|
|
2465
|
-
settings:
|
|
2847
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the widget")
|
|
2466
2848
|
});
|
|
2467
|
-
var SidebarItemSchema =
|
|
2468
|
-
widgetId:
|
|
2469
|
-
widgetNamespace:
|
|
2470
|
-
settings:
|
|
2471
|
-
disabled:
|
|
2849
|
+
var SidebarItemSchema = z39.object({
|
|
2850
|
+
widgetId: z39.string().describe("The widget ID for the sidebar item"),
|
|
2851
|
+
widgetNamespace: z39.enum(["sidebar-builtin", "extension", "app"]).describe("The namespace of the sidebar widget"),
|
|
2852
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the sidebar widget"),
|
|
2853
|
+
disabled: z39.boolean().optional().describe("Whether the sidebar item is disabled")
|
|
2472
2854
|
});
|
|
2473
|
-
var EditorLayoutItemSchema =
|
|
2474
|
-
fieldId:
|
|
2475
|
-
settings:
|
|
2855
|
+
var EditorLayoutItemSchema = z39.object({
|
|
2856
|
+
fieldId: z39.string().describe("The field ID"),
|
|
2857
|
+
settings: z39.record(z39.any()).optional().describe("Layout settings for the field")
|
|
2476
2858
|
});
|
|
2477
|
-
var EditorLayoutSchema =
|
|
2478
|
-
items:
|
|
2859
|
+
var EditorLayoutSchema = z39.object({
|
|
2860
|
+
items: z39.array(EditorLayoutItemSchema).optional().describe("Array of editor layout items")
|
|
2479
2861
|
});
|
|
2480
|
-
var GroupControlSchema =
|
|
2481
|
-
groupId:
|
|
2482
|
-
widgetId:
|
|
2483
|
-
widgetNamespace:
|
|
2484
|
-
settings:
|
|
2862
|
+
var GroupControlSchema = z39.object({
|
|
2863
|
+
groupId: z39.string().describe("The group ID"),
|
|
2864
|
+
widgetId: z39.string().describe("The widget ID for the group control"),
|
|
2865
|
+
widgetNamespace: z39.enum(["builtin", "extension", "app"]).optional().describe("The namespace of the group control widget"),
|
|
2866
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the group control")
|
|
2485
2867
|
});
|
|
2486
2868
|
var UpdateEditorInterfaceToolParams = BaseToolSchema.extend({
|
|
2487
|
-
contentTypeId:
|
|
2488
|
-
controls:
|
|
2869
|
+
contentTypeId: z39.string().describe("The ID of the content type to update the editor interface for"),
|
|
2870
|
+
controls: z39.array(ControlSchema).optional().describe(
|
|
2489
2871
|
"Array of control definitions for fields in the content type. Each control defines which widget to use for a field."
|
|
2490
2872
|
),
|
|
2491
|
-
sidebar:
|
|
2492
|
-
editorLayout:
|
|
2493
|
-
groupControls:
|
|
2873
|
+
sidebar: z39.array(SidebarItemSchema).optional().describe("Array of sidebar widget configurations"),
|
|
2874
|
+
editorLayout: z39.array(EditorLayoutSchema).optional().describe("Editor layout configuration for organizing fields"),
|
|
2875
|
+
groupControls: z39.array(GroupControlSchema).optional().describe("Array of group control definitions for field groups")
|
|
2494
2876
|
});
|
|
2495
2877
|
function updateEditorInterfaceTool(config) {
|
|
2496
2878
|
async function tool2(args) {
|
|
@@ -2575,7 +2957,7 @@ function createEditorInterfaceTools(config) {
|
|
|
2575
2957
|
}
|
|
2576
2958
|
|
|
2577
2959
|
// src/tools/entries/searchEntries.ts
|
|
2578
|
-
import { z as
|
|
2960
|
+
import { z as z40 } from "zod";
|
|
2579
2961
|
|
|
2580
2962
|
// src/utils/limits.ts
|
|
2581
2963
|
function searchLimit(userLimit) {
|
|
@@ -2598,38 +2980,38 @@ function normalizeArrayFilters(query) {
|
|
|
2598
2980
|
|
|
2599
2981
|
// src/tools/entries/searchEntries.ts
|
|
2600
2982
|
var SearchEntriesToolParams = BaseToolSchema.extend({
|
|
2601
|
-
query:
|
|
2983
|
+
query: z40.object({
|
|
2602
2984
|
// Core parameters (maintain backward compatibility)
|
|
2603
|
-
content_type:
|
|
2604
|
-
include:
|
|
2605
|
-
select:
|
|
2606
|
-
links_to_entry:
|
|
2607
|
-
limit:
|
|
2985
|
+
content_type: z40.string().optional().describe("Filter by content type"),
|
|
2986
|
+
include: z40.number().optional().describe("Include this many levels of linked entries"),
|
|
2987
|
+
select: z40.string().optional().describe("Comma-separated list of fields to return"),
|
|
2988
|
+
links_to_entry: z40.string().optional().describe("Find entries that link to the specified entry ID"),
|
|
2989
|
+
limit: z40.number().optional().describe(
|
|
2608
2990
|
"Maximum number of entries to return (default: 10, max: 100)"
|
|
2609
2991
|
),
|
|
2610
|
-
skip:
|
|
2611
|
-
order:
|
|
2992
|
+
skip: z40.number().optional().describe("Skip this many entries for pagination"),
|
|
2993
|
+
order: z40.string().optional().describe("Order entries by this field"),
|
|
2612
2994
|
// Full-text search
|
|
2613
|
-
query:
|
|
2995
|
+
query: z40.string().optional().describe("Full-text search across all fields"),
|
|
2614
2996
|
// Common field-based searches (examples - any field is supported via catchall)
|
|
2615
|
-
"fields.title":
|
|
2616
|
-
"fields.slug":
|
|
2617
|
-
"fields.internalName":
|
|
2618
|
-
"fields.text":
|
|
2619
|
-
"fields.title[match]":
|
|
2620
|
-
"fields.slug[match]":
|
|
2621
|
-
"fields.title[exists]":
|
|
2622
|
-
"fields.slug[exists]":
|
|
2997
|
+
"fields.title": z40.string().optional().describe("Search by title field"),
|
|
2998
|
+
"fields.slug": z40.string().optional().describe("Search by slug field"),
|
|
2999
|
+
"fields.internalName": z40.string().optional().describe("Search by internal name field"),
|
|
3000
|
+
"fields.text": z40.string().optional().describe("Search by text field (useful for testimonials)"),
|
|
3001
|
+
"fields.title[match]": z40.string().optional().describe("Pattern match on title field"),
|
|
3002
|
+
"fields.slug[match]": z40.string().optional().describe("Pattern match on slug field"),
|
|
3003
|
+
"fields.title[exists]": z40.boolean().optional().describe("Check if title field exists"),
|
|
3004
|
+
"fields.slug[exists]": z40.boolean().optional().describe("Check if slug field exists"),
|
|
2623
3005
|
// System field searches
|
|
2624
|
-
"sys.id[in]":
|
|
2625
|
-
"sys.contentType.sys.id":
|
|
2626
|
-
"sys.createdAt[gte]":
|
|
2627
|
-
"sys.createdAt[lte]":
|
|
2628
|
-
"sys.updatedAt[gte]":
|
|
2629
|
-
"sys.updatedAt[lte]":
|
|
3006
|
+
"sys.id[in]": z40.array(z40.string()).optional().describe("Search by multiple entry IDs"),
|
|
3007
|
+
"sys.contentType.sys.id": z40.string().optional().describe("Filter by content type ID"),
|
|
3008
|
+
"sys.createdAt[gte]": z40.string().optional().describe("Created after date (ISO format)"),
|
|
3009
|
+
"sys.createdAt[lte]": z40.string().optional().describe("Created before date (ISO format)"),
|
|
3010
|
+
"sys.updatedAt[gte]": z40.string().optional().describe("Updated after date (ISO format)"),
|
|
3011
|
+
"sys.updatedAt[lte]": z40.string().optional().describe("Updated before date (ISO format)"),
|
|
2630
3012
|
// Metadata searches
|
|
2631
|
-
"metadata.tags.sys.id[in]":
|
|
2632
|
-
}).catchall(
|
|
3013
|
+
"metadata.tags.sys.id[in]": z40.array(z40.string()).optional().describe("Filter by tag IDs")
|
|
3014
|
+
}).catchall(z40.any()).describe(
|
|
2633
3015
|
"Flexible search parameters supporting ANY Contentful API query parameter. Use fields.* for field searches, sys.* for system fields, and any other Contentful API parameter."
|
|
2634
3016
|
)
|
|
2635
3017
|
});
|
|
@@ -2660,12 +3042,12 @@ function searchEntriesTool(config) {
|
|
|
2660
3042
|
}
|
|
2661
3043
|
|
|
2662
3044
|
// src/tools/entries/semanticSearch.ts
|
|
2663
|
-
import { z as
|
|
3045
|
+
import { z as z41 } from "zod";
|
|
2664
3046
|
var SemanticSearchToolParams = BaseToolSchema.extend({
|
|
2665
|
-
query:
|
|
3047
|
+
query: z41.string().describe(
|
|
2666
3048
|
"Natural-language description of what you are looking for. Phrases that resemble the content of the entries you want match best \u2014 avoid questions or JSON."
|
|
2667
3049
|
),
|
|
2668
|
-
contentTypeIds:
|
|
3050
|
+
contentTypeIds: z41.array(z41.string()).min(1).optional().describe("Restrict the search to entries of these content type IDs")
|
|
2669
3051
|
});
|
|
2670
3052
|
function semanticSearchTool(config) {
|
|
2671
3053
|
async function tool2(args) {
|
|
@@ -2696,110 +3078,110 @@ function semanticSearchTool(config) {
|
|
|
2696
3078
|
}
|
|
2697
3079
|
|
|
2698
3080
|
// src/tools/entries/createEntry.ts
|
|
2699
|
-
import { z as
|
|
3081
|
+
import { z as z44 } from "zod";
|
|
2700
3082
|
|
|
2701
3083
|
// src/types/entryFieldSchema.ts
|
|
2702
|
-
import { z as
|
|
3084
|
+
import { z as z43 } from "zod";
|
|
2703
3085
|
|
|
2704
3086
|
// src/types/richTextSchema.ts
|
|
2705
3087
|
import { BLOCKS as BLOCKS2, INLINES as INLINES2, MARKS } from "@contentful/rich-text-types";
|
|
2706
|
-
import { z as
|
|
2707
|
-
var emptyNodeDataSchema =
|
|
2708
|
-
var entryLinkTargetSchema =
|
|
2709
|
-
sys:
|
|
2710
|
-
id:
|
|
2711
|
-
type:
|
|
2712
|
-
linkType:
|
|
3088
|
+
import { z as z42 } from "zod";
|
|
3089
|
+
var emptyNodeDataSchema = z42.object({});
|
|
3090
|
+
var entryLinkTargetSchema = z42.object({
|
|
3091
|
+
sys: z42.object({
|
|
3092
|
+
id: z42.string(),
|
|
3093
|
+
type: z42.literal("Link"),
|
|
3094
|
+
linkType: z42.literal("Entry")
|
|
2713
3095
|
})
|
|
2714
3096
|
});
|
|
2715
|
-
var assetLinkTargetSchema =
|
|
2716
|
-
sys:
|
|
2717
|
-
id:
|
|
2718
|
-
type:
|
|
2719
|
-
linkType:
|
|
3097
|
+
var assetLinkTargetSchema = z42.object({
|
|
3098
|
+
sys: z42.object({
|
|
3099
|
+
id: z42.string(),
|
|
3100
|
+
type: z42.literal("Link"),
|
|
3101
|
+
linkType: z42.literal("Asset")
|
|
2720
3102
|
})
|
|
2721
3103
|
});
|
|
2722
|
-
var resourceLinkTargetSchema =
|
|
2723
|
-
sys:
|
|
2724
|
-
type:
|
|
2725
|
-
linkType:
|
|
2726
|
-
urn:
|
|
3104
|
+
var resourceLinkTargetSchema = z42.object({
|
|
3105
|
+
sys: z42.object({
|
|
3106
|
+
type: z42.literal("ResourceLink"),
|
|
3107
|
+
linkType: z42.string(),
|
|
3108
|
+
urn: z42.string()
|
|
2727
3109
|
})
|
|
2728
3110
|
});
|
|
2729
|
-
var richTextMarkSchema =
|
|
2730
|
-
type:
|
|
3111
|
+
var richTextMarkSchema = z42.object({
|
|
3112
|
+
type: z42.nativeEnum(MARKS)
|
|
2731
3113
|
});
|
|
2732
|
-
var richTextTextNodeSchema =
|
|
2733
|
-
nodeType:
|
|
2734
|
-
value:
|
|
2735
|
-
marks:
|
|
3114
|
+
var richTextTextNodeSchema = z42.object({
|
|
3115
|
+
nodeType: z42.literal("text"),
|
|
3116
|
+
value: z42.string(),
|
|
3117
|
+
marks: z42.array(richTextMarkSchema),
|
|
2736
3118
|
data: emptyNodeDataSchema
|
|
2737
3119
|
});
|
|
2738
|
-
var embeddedEntryBlockNodeSchema =
|
|
2739
|
-
nodeType:
|
|
2740
|
-
data:
|
|
3120
|
+
var embeddedEntryBlockNodeSchema = z42.object({
|
|
3121
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_ENTRY),
|
|
3122
|
+
data: z42.object({
|
|
2741
3123
|
target: entryLinkTargetSchema
|
|
2742
3124
|
}),
|
|
2743
|
-
content:
|
|
3125
|
+
content: z42.array(z42.never())
|
|
2744
3126
|
});
|
|
2745
|
-
var embeddedEntryInlineNodeSchema =
|
|
2746
|
-
nodeType:
|
|
2747
|
-
data:
|
|
3127
|
+
var embeddedEntryInlineNodeSchema = z42.object({
|
|
3128
|
+
nodeType: z42.literal(INLINES2.EMBEDDED_ENTRY),
|
|
3129
|
+
data: z42.object({
|
|
2748
3130
|
target: entryLinkTargetSchema
|
|
2749
3131
|
}),
|
|
2750
|
-
content:
|
|
3132
|
+
content: z42.array(z42.never())
|
|
2751
3133
|
});
|
|
2752
|
-
var embeddedAssetBlockNodeSchema =
|
|
2753
|
-
nodeType:
|
|
2754
|
-
data:
|
|
3134
|
+
var embeddedAssetBlockNodeSchema = z42.object({
|
|
3135
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_ASSET),
|
|
3136
|
+
data: z42.object({
|
|
2755
3137
|
target: assetLinkTargetSchema
|
|
2756
3138
|
}),
|
|
2757
|
-
content:
|
|
3139
|
+
content: z42.array(z42.never())
|
|
2758
3140
|
});
|
|
2759
|
-
var hyperlinkInlineNodeSchema =
|
|
2760
|
-
nodeType:
|
|
2761
|
-
data:
|
|
2762
|
-
uri:
|
|
3141
|
+
var hyperlinkInlineNodeSchema = z42.object({
|
|
3142
|
+
nodeType: z42.literal(INLINES2.HYPERLINK),
|
|
3143
|
+
data: z42.object({
|
|
3144
|
+
uri: z42.string().url()
|
|
2763
3145
|
}),
|
|
2764
|
-
content:
|
|
3146
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2765
3147
|
});
|
|
2766
|
-
var entryHyperlinkInlineNodeSchema =
|
|
2767
|
-
nodeType:
|
|
2768
|
-
data:
|
|
3148
|
+
var entryHyperlinkInlineNodeSchema = z42.object({
|
|
3149
|
+
nodeType: z42.literal(INLINES2.ENTRY_HYPERLINK),
|
|
3150
|
+
data: z42.object({
|
|
2769
3151
|
target: entryLinkTargetSchema
|
|
2770
3152
|
}),
|
|
2771
|
-
content:
|
|
3153
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2772
3154
|
});
|
|
2773
|
-
var assetHyperlinkInlineNodeSchema =
|
|
2774
|
-
nodeType:
|
|
2775
|
-
data:
|
|
3155
|
+
var assetHyperlinkInlineNodeSchema = z42.object({
|
|
3156
|
+
nodeType: z42.literal(INLINES2.ASSET_HYPERLINK),
|
|
3157
|
+
data: z42.object({
|
|
2776
3158
|
target: assetLinkTargetSchema
|
|
2777
3159
|
}),
|
|
2778
|
-
content:
|
|
3160
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2779
3161
|
});
|
|
2780
|
-
var embeddedResourceBlockNodeSchema =
|
|
2781
|
-
nodeType:
|
|
2782
|
-
data:
|
|
3162
|
+
var embeddedResourceBlockNodeSchema = z42.object({
|
|
3163
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_RESOURCE),
|
|
3164
|
+
data: z42.object({
|
|
2783
3165
|
target: resourceLinkTargetSchema
|
|
2784
3166
|
}),
|
|
2785
|
-
content:
|
|
3167
|
+
content: z42.array(z42.never())
|
|
2786
3168
|
});
|
|
2787
|
-
var embeddedResourceInlineNodeSchema =
|
|
2788
|
-
nodeType:
|
|
2789
|
-
data:
|
|
3169
|
+
var embeddedResourceInlineNodeSchema = z42.object({
|
|
3170
|
+
nodeType: z42.literal(INLINES2.EMBEDDED_RESOURCE),
|
|
3171
|
+
data: z42.object({
|
|
2790
3172
|
target: resourceLinkTargetSchema
|
|
2791
3173
|
}),
|
|
2792
|
-
content:
|
|
3174
|
+
content: z42.array(z42.never())
|
|
2793
3175
|
});
|
|
2794
|
-
var resourceHyperlinkInlineNodeSchema =
|
|
2795
|
-
nodeType:
|
|
2796
|
-
data:
|
|
3176
|
+
var resourceHyperlinkInlineNodeSchema = z42.object({
|
|
3177
|
+
nodeType: z42.literal(INLINES2.RESOURCE_HYPERLINK),
|
|
3178
|
+
data: z42.object({
|
|
2797
3179
|
target: resourceLinkTargetSchema
|
|
2798
3180
|
}),
|
|
2799
|
-
content:
|
|
3181
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2800
3182
|
});
|
|
2801
|
-
var richTextInlineNodeSchema =
|
|
2802
|
-
() =>
|
|
3183
|
+
var richTextInlineNodeSchema = z42.lazy(
|
|
3184
|
+
() => z42.union([
|
|
2803
3185
|
richTextTextNodeSchema,
|
|
2804
3186
|
embeddedEntryInlineNodeSchema,
|
|
2805
3187
|
hyperlinkInlineNodeSchema,
|
|
@@ -2809,17 +3191,17 @@ var richTextInlineNodeSchema = z40.lazy(
|
|
|
2809
3191
|
resourceHyperlinkInlineNodeSchema
|
|
2810
3192
|
])
|
|
2811
3193
|
);
|
|
2812
|
-
var paragraphNodeSchema =
|
|
2813
|
-
() =>
|
|
2814
|
-
nodeType:
|
|
3194
|
+
var paragraphNodeSchema = z42.lazy(
|
|
3195
|
+
() => z42.object({
|
|
3196
|
+
nodeType: z42.literal(BLOCKS2.PARAGRAPH),
|
|
2815
3197
|
data: emptyNodeDataSchema,
|
|
2816
|
-
content:
|
|
3198
|
+
content: z42.array(richTextInlineNodeSchema)
|
|
2817
3199
|
})
|
|
2818
3200
|
);
|
|
2819
|
-
var headingNodeSchema = (headingNodeType) =>
|
|
2820
|
-
nodeType:
|
|
3201
|
+
var headingNodeSchema = (headingNodeType) => z42.object({
|
|
3202
|
+
nodeType: z42.literal(headingNodeType),
|
|
2821
3203
|
data: emptyNodeDataSchema,
|
|
2822
|
-
content:
|
|
3204
|
+
content: z42.array(richTextInlineNodeSchema)
|
|
2823
3205
|
});
|
|
2824
3206
|
var heading1NodeSchema = headingNodeSchema(BLOCKS2.HEADING_1);
|
|
2825
3207
|
var heading2NodeSchema = headingNodeSchema(BLOCKS2.HEADING_2);
|
|
@@ -2827,56 +3209,56 @@ var heading3NodeSchema = headingNodeSchema(BLOCKS2.HEADING_3);
|
|
|
2827
3209
|
var heading4NodeSchema = headingNodeSchema(BLOCKS2.HEADING_4);
|
|
2828
3210
|
var heading5NodeSchema = headingNodeSchema(BLOCKS2.HEADING_5);
|
|
2829
3211
|
var heading6NodeSchema = headingNodeSchema(BLOCKS2.HEADING_6);
|
|
2830
|
-
var hrNodeSchema =
|
|
2831
|
-
nodeType:
|
|
3212
|
+
var hrNodeSchema = z42.object({
|
|
3213
|
+
nodeType: z42.literal(BLOCKS2.HR),
|
|
2832
3214
|
data: emptyNodeDataSchema,
|
|
2833
|
-
content:
|
|
3215
|
+
content: z42.array(z42.never())
|
|
2834
3216
|
});
|
|
2835
|
-
var quoteNodeSchema =
|
|
2836
|
-
nodeType:
|
|
3217
|
+
var quoteNodeSchema = z42.object({
|
|
3218
|
+
nodeType: z42.literal(BLOCKS2.QUOTE),
|
|
2837
3219
|
data: emptyNodeDataSchema,
|
|
2838
|
-
content:
|
|
3220
|
+
content: z42.array(paragraphNodeSchema)
|
|
2839
3221
|
});
|
|
2840
|
-
var tableHeaderCellNodeSchema =
|
|
2841
|
-
nodeType:
|
|
3222
|
+
var tableHeaderCellNodeSchema = z42.object({
|
|
3223
|
+
nodeType: z42.literal(BLOCKS2.TABLE_HEADER_CELL),
|
|
2842
3224
|
data: emptyNodeDataSchema,
|
|
2843
|
-
content:
|
|
3225
|
+
content: z42.array(paragraphNodeSchema)
|
|
2844
3226
|
});
|
|
2845
|
-
var tableCellNodeSchema =
|
|
2846
|
-
nodeType:
|
|
3227
|
+
var tableCellNodeSchema = z42.object({
|
|
3228
|
+
nodeType: z42.literal(BLOCKS2.TABLE_CELL),
|
|
2847
3229
|
data: emptyNodeDataSchema,
|
|
2848
|
-
content:
|
|
3230
|
+
content: z42.array(paragraphNodeSchema)
|
|
2849
3231
|
});
|
|
2850
|
-
var tableRowNodeSchema =
|
|
2851
|
-
nodeType:
|
|
3232
|
+
var tableRowNodeSchema = z42.object({
|
|
3233
|
+
nodeType: z42.literal(BLOCKS2.TABLE_ROW),
|
|
2852
3234
|
data: emptyNodeDataSchema,
|
|
2853
|
-
content:
|
|
3235
|
+
content: z42.array(z42.union([tableHeaderCellNodeSchema, tableCellNodeSchema]))
|
|
2854
3236
|
});
|
|
2855
|
-
var tableNodeSchema =
|
|
2856
|
-
nodeType:
|
|
3237
|
+
var tableNodeSchema = z42.object({
|
|
3238
|
+
nodeType: z42.literal(BLOCKS2.TABLE),
|
|
2857
3239
|
data: emptyNodeDataSchema,
|
|
2858
|
-
content:
|
|
3240
|
+
content: z42.array(tableRowNodeSchema)
|
|
2859
3241
|
});
|
|
2860
|
-
var orderedListNodeSchema =
|
|
2861
|
-
() =>
|
|
2862
|
-
nodeType:
|
|
3242
|
+
var orderedListNodeSchema = z42.lazy(
|
|
3243
|
+
() => z42.object({
|
|
3244
|
+
nodeType: z42.literal(BLOCKS2.OL_LIST),
|
|
2863
3245
|
data: emptyNodeDataSchema,
|
|
2864
|
-
content:
|
|
3246
|
+
content: z42.array(listItemNodeSchema)
|
|
2865
3247
|
})
|
|
2866
3248
|
);
|
|
2867
|
-
var unorderedListNodeSchema =
|
|
2868
|
-
() =>
|
|
2869
|
-
nodeType:
|
|
3249
|
+
var unorderedListNodeSchema = z42.lazy(
|
|
3250
|
+
() => z42.object({
|
|
3251
|
+
nodeType: z42.literal(BLOCKS2.UL_LIST),
|
|
2870
3252
|
data: emptyNodeDataSchema,
|
|
2871
|
-
content:
|
|
3253
|
+
content: z42.array(listItemNodeSchema)
|
|
2872
3254
|
})
|
|
2873
3255
|
);
|
|
2874
|
-
var listItemNodeSchema =
|
|
2875
|
-
() =>
|
|
2876
|
-
nodeType:
|
|
3256
|
+
var listItemNodeSchema = z42.lazy(
|
|
3257
|
+
() => z42.object({
|
|
3258
|
+
nodeType: z42.literal(BLOCKS2.LIST_ITEM),
|
|
2877
3259
|
data: emptyNodeDataSchema,
|
|
2878
|
-
content:
|
|
2879
|
-
|
|
3260
|
+
content: z42.array(
|
|
3261
|
+
z42.union([
|
|
2880
3262
|
paragraphNodeSchema,
|
|
2881
3263
|
orderedListNodeSchema,
|
|
2882
3264
|
unorderedListNodeSchema
|
|
@@ -2884,8 +3266,8 @@ var listItemNodeSchema = z40.lazy(
|
|
|
2884
3266
|
)
|
|
2885
3267
|
})
|
|
2886
3268
|
);
|
|
2887
|
-
var topLevelBlockNodeSchema =
|
|
2888
|
-
() =>
|
|
3269
|
+
var topLevelBlockNodeSchema = z42.lazy(
|
|
3270
|
+
() => z42.union([
|
|
2889
3271
|
paragraphNodeSchema,
|
|
2890
3272
|
heading1NodeSchema,
|
|
2891
3273
|
heading2NodeSchema,
|
|
@@ -2903,56 +3285,56 @@ var topLevelBlockNodeSchema = z40.lazy(
|
|
|
2903
3285
|
tableNodeSchema
|
|
2904
3286
|
])
|
|
2905
3287
|
);
|
|
2906
|
-
var richTextDocumentSchema =
|
|
2907
|
-
nodeType:
|
|
3288
|
+
var richTextDocumentSchema = z42.object({
|
|
3289
|
+
nodeType: z42.literal(BLOCKS2.DOCUMENT),
|
|
2908
3290
|
data: emptyNodeDataSchema,
|
|
2909
|
-
content:
|
|
3291
|
+
content: z42.array(topLevelBlockNodeSchema)
|
|
2910
3292
|
}).describe("Contentful Rich Text document");
|
|
2911
3293
|
|
|
2912
3294
|
// src/types/entryFieldSchema.ts
|
|
2913
|
-
var linkSchema =
|
|
2914
|
-
sys:
|
|
2915
|
-
type:
|
|
2916
|
-
linkType:
|
|
2917
|
-
id:
|
|
3295
|
+
var linkSchema = z43.object({
|
|
3296
|
+
sys: z43.object({
|
|
3297
|
+
type: z43.literal("Link"),
|
|
3298
|
+
linkType: z43.enum(["Entry", "Asset"]),
|
|
3299
|
+
id: z43.string()
|
|
2918
3300
|
})
|
|
2919
3301
|
});
|
|
2920
|
-
var resourceLinkSchema =
|
|
2921
|
-
sys:
|
|
2922
|
-
type:
|
|
2923
|
-
linkType:
|
|
2924
|
-
urn:
|
|
3302
|
+
var resourceLinkSchema = z43.object({
|
|
3303
|
+
sys: z43.object({
|
|
3304
|
+
type: z43.literal("ResourceLink"),
|
|
3305
|
+
linkType: z43.string(),
|
|
3306
|
+
urn: z43.string()
|
|
2925
3307
|
})
|
|
2926
3308
|
});
|
|
2927
|
-
var locationSchema =
|
|
2928
|
-
lat:
|
|
2929
|
-
lon:
|
|
3309
|
+
var locationSchema = z43.object({
|
|
3310
|
+
lat: z43.number(),
|
|
3311
|
+
lon: z43.number()
|
|
2930
3312
|
});
|
|
2931
|
-
var jsonPrimitive =
|
|
2932
|
-
var jsonValueSchema =
|
|
2933
|
-
() =>
|
|
3313
|
+
var jsonPrimitive = z43.union([z43.string(), z43.number(), z43.boolean(), z43.null()]);
|
|
3314
|
+
var jsonValueSchema = z43.lazy(
|
|
3315
|
+
() => z43.union([jsonPrimitive, z43.array(jsonValueSchema), z43.record(jsonValueSchema)]).describe("Freeform JSON value (not for Rich Text)")
|
|
2934
3316
|
);
|
|
2935
|
-
var fieldValueSchema =
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
3317
|
+
var fieldValueSchema = z43.union([
|
|
3318
|
+
z43.string().describe("Symbol, Text, or Date field"),
|
|
3319
|
+
z43.number().describe("Integer or Number field"),
|
|
3320
|
+
z43.boolean().describe("Boolean field"),
|
|
2939
3321
|
richTextDocumentSchema,
|
|
2940
3322
|
linkSchema.describe("Link field (Entry or Asset reference)"),
|
|
2941
3323
|
resourceLinkSchema.describe("ResourceLink field"),
|
|
2942
3324
|
locationSchema.describe("Location field"),
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
3325
|
+
z43.array(z43.string()).describe("Array field of Symbols"),
|
|
3326
|
+
z43.array(linkSchema).describe("Array field of Links"),
|
|
3327
|
+
z43.array(resourceLinkSchema).describe("Array field of ResourceLinks"),
|
|
2946
3328
|
jsonValueSchema
|
|
2947
3329
|
]);
|
|
2948
|
-
var localizedFieldSchema =
|
|
2949
|
-
var entryFieldsSchema =
|
|
3330
|
+
var localizedFieldSchema = z43.record(fieldValueSchema);
|
|
3331
|
+
var entryFieldsSchema = z43.record(localizedFieldSchema).describe(
|
|
2950
3332
|
"Field values to update. Keys are field IDs, values are locale-keyed objects. Will be merged with existing fields."
|
|
2951
3333
|
);
|
|
2952
3334
|
|
|
2953
3335
|
// src/tools/entries/createEntry.ts
|
|
2954
3336
|
var CreateEntryToolParams = BaseToolSchema.extend({
|
|
2955
|
-
contentTypeId:
|
|
3337
|
+
contentTypeId: z44.string().describe("The ID of the content type to create an entry for"),
|
|
2956
3338
|
fields: entryFieldsSchema.describe(
|
|
2957
3339
|
"The field values for the new entry. Keys should be field IDs and values should be the field content."
|
|
2958
3340
|
),
|
|
@@ -2985,13 +3367,13 @@ function createEntryTool(config) {
|
|
|
2985
3367
|
}
|
|
2986
3368
|
|
|
2987
3369
|
// src/tools/entries/deleteEntry.ts
|
|
2988
|
-
import { z as
|
|
3370
|
+
import { z as z45 } from "zod";
|
|
2989
3371
|
var DeleteEntryToolParams = BaseToolSchema.extend({
|
|
2990
|
-
entryId:
|
|
2991
|
-
confirm:
|
|
3372
|
+
entryId: z45.string().describe("The ID of the entry to delete"),
|
|
3373
|
+
confirm: z45.boolean().optional().describe(
|
|
2992
3374
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
2993
3375
|
),
|
|
2994
|
-
confirmToken:
|
|
3376
|
+
confirmToken: z45.string().optional().describe(
|
|
2995
3377
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
2996
3378
|
)
|
|
2997
3379
|
});
|
|
@@ -3031,10 +3413,10 @@ function deleteEntryTool(config) {
|
|
|
3031
3413
|
}
|
|
3032
3414
|
|
|
3033
3415
|
// src/tools/entries/updateEntry.ts
|
|
3034
|
-
import { z as
|
|
3416
|
+
import { z as z46 } from "zod";
|
|
3035
3417
|
var UpdateEntryToolParams = BaseToolSchema.extend({
|
|
3036
|
-
entryId:
|
|
3037
|
-
version:
|
|
3418
|
+
entryId: z46.string().describe("The ID of the entry to update"),
|
|
3419
|
+
version: z46.number().describe(
|
|
3038
3420
|
"REQUIRED. The entry's sys.version as returned by get_entry. You must call get_entry first to read the current state and version. The update is rejected if this does not match the entry's current version, which means the entry changed since you read it."
|
|
3039
3421
|
),
|
|
3040
3422
|
fields: entryFieldsSchema.describe(
|
|
@@ -3088,9 +3470,9 @@ function updateEntryTool(config) {
|
|
|
3088
3470
|
}
|
|
3089
3471
|
|
|
3090
3472
|
// src/tools/entries/getEntry.ts
|
|
3091
|
-
import { z as
|
|
3473
|
+
import { z as z47 } from "zod";
|
|
3092
3474
|
var GetEntryToolParams = BaseToolSchema.extend({
|
|
3093
|
-
entryId:
|
|
3475
|
+
entryId: z47.string().describe("The ID of the entry to retrieve")
|
|
3094
3476
|
});
|
|
3095
3477
|
function getEntryTool(config) {
|
|
3096
3478
|
async function tool2(args) {
|
|
@@ -3107,10 +3489,10 @@ function getEntryTool(config) {
|
|
|
3107
3489
|
}
|
|
3108
3490
|
|
|
3109
3491
|
// src/tools/entries/resolveEntryReferences.ts
|
|
3110
|
-
import { z as
|
|
3492
|
+
import { z as z48 } from "zod";
|
|
3111
3493
|
var ResolveEntryReferencesToolParams = BaseToolSchema.extend({
|
|
3112
|
-
entryId:
|
|
3113
|
-
include:
|
|
3494
|
+
entryId: z48.string().describe("The ID of the entry whose references should be resolved"),
|
|
3495
|
+
include: z48.number().int().min(1).max(10).optional().default(2).describe(
|
|
3114
3496
|
"How many levels of linked entries to walk (1-10, default: 2). The CMA caps this at 10."
|
|
3115
3497
|
)
|
|
3116
3498
|
});
|
|
@@ -3133,10 +3515,10 @@ function resolveEntryReferencesTool(config) {
|
|
|
3133
3515
|
}
|
|
3134
3516
|
|
|
3135
3517
|
// src/tools/entries/getEntrySnapshot.ts
|
|
3136
|
-
import { z as
|
|
3518
|
+
import { z as z49 } from "zod";
|
|
3137
3519
|
var GetEntrySnapshotToolParams = BaseToolSchema.extend({
|
|
3138
|
-
entryId:
|
|
3139
|
-
snapshotId:
|
|
3520
|
+
entryId: z49.string().describe("The ID of the entry to retrieve snapshots for"),
|
|
3521
|
+
snapshotId: z49.string().optional().describe(
|
|
3140
3522
|
"Optional snapshot ID. When provided, returns the full content of that single snapshot. When omitted, lists all available snapshots for the entry."
|
|
3141
3523
|
)
|
|
3142
3524
|
});
|
|
@@ -3167,12 +3549,12 @@ function getEntrySnapshotTool(config) {
|
|
|
3167
3549
|
}
|
|
3168
3550
|
|
|
3169
3551
|
// src/tools/entries/publishEntry.ts
|
|
3170
|
-
import { z as
|
|
3552
|
+
import { z as z50 } from "zod";
|
|
3171
3553
|
var PublishEntryToolParams = BaseToolSchema.extend({
|
|
3172
|
-
entryId:
|
|
3554
|
+
entryId: z50.array(z50.string()).min(1).max(100).describe(
|
|
3173
3555
|
"Array of entry IDs to publish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3174
3556
|
),
|
|
3175
|
-
dryRun:
|
|
3557
|
+
dryRun: z50.boolean().optional().describe(
|
|
3176
3558
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3177
3559
|
)
|
|
3178
3560
|
});
|
|
@@ -3240,12 +3622,12 @@ function publishEntryTool(config) {
|
|
|
3240
3622
|
}
|
|
3241
3623
|
|
|
3242
3624
|
// src/tools/entries/unpublishEntry.ts
|
|
3243
|
-
import { z as
|
|
3625
|
+
import { z as z51 } from "zod";
|
|
3244
3626
|
var UnpublishEntryToolParams = BaseToolSchema.extend({
|
|
3245
|
-
entryId:
|
|
3627
|
+
entryId: z51.array(z51.string()).min(1).max(100).describe(
|
|
3246
3628
|
"Array of entry IDs to unpublish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3247
3629
|
),
|
|
3248
|
-
dryRun:
|
|
3630
|
+
dryRun: z51.boolean().optional().describe(
|
|
3249
3631
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3250
3632
|
)
|
|
3251
3633
|
});
|
|
@@ -3313,12 +3695,12 @@ function unpublishEntryTool(config) {
|
|
|
3313
3695
|
}
|
|
3314
3696
|
|
|
3315
3697
|
// src/tools/entries/archiveEntry.ts
|
|
3316
|
-
import { z as
|
|
3698
|
+
import { z as z52 } from "zod";
|
|
3317
3699
|
var ArchiveEntryToolParams = BaseToolSchema.extend({
|
|
3318
|
-
entryId:
|
|
3700
|
+
entryId: z52.array(z52.string()).min(1).max(100).describe(
|
|
3319
3701
|
"Array of entry IDs to archive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3320
3702
|
),
|
|
3321
|
-
dryRun:
|
|
3703
|
+
dryRun: z52.boolean().optional().describe(
|
|
3322
3704
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3323
3705
|
)
|
|
3324
3706
|
});
|
|
@@ -3357,7 +3739,7 @@ function archiveEntryTool(config) {
|
|
|
3357
3739
|
await contentfulClient.entry.archive(params);
|
|
3358
3740
|
successfullyArchived.push(entryId);
|
|
3359
3741
|
} catch (error) {
|
|
3360
|
-
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive entry '${entryId}' after successfully archiving ${successfullyArchived.length} entry(s): [${successfullyArchived.join(", ")}]. Original error: ${
|
|
3742
|
+
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive entry '${entryId}' after successfully archiving ${successfullyArchived.length} entry(s): [${successfullyArchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to archive entry '${entryId}': ${formatErrorMessage(error)}`;
|
|
3361
3743
|
throw new Error(errorMessage);
|
|
3362
3744
|
}
|
|
3363
3745
|
}
|
|
@@ -3379,12 +3761,12 @@ function archiveEntryTool(config) {
|
|
|
3379
3761
|
}
|
|
3380
3762
|
|
|
3381
3763
|
// src/tools/entries/unarchiveEntry.ts
|
|
3382
|
-
import { z as
|
|
3764
|
+
import { z as z53 } from "zod";
|
|
3383
3765
|
var UnarchiveEntryToolParams = BaseToolSchema.extend({
|
|
3384
|
-
entryId:
|
|
3766
|
+
entryId: z53.array(z53.string()).min(1).max(100).describe(
|
|
3385
3767
|
"Array of entry IDs to unarchive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3386
3768
|
),
|
|
3387
|
-
dryRun:
|
|
3769
|
+
dryRun: z53.boolean().optional().describe(
|
|
3388
3770
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3389
3771
|
)
|
|
3390
3772
|
});
|
|
@@ -3423,7 +3805,7 @@ function unarchiveEntryTool(config) {
|
|
|
3423
3805
|
await contentfulClient.entry.unarchive(params);
|
|
3424
3806
|
successfullyUnarchived.push(entryId);
|
|
3425
3807
|
} catch (error) {
|
|
3426
|
-
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive entry '${entryId}' after successfully unarchiving ${successfullyUnarchived.length} entry(s): [${successfullyUnarchived.join(", ")}]. Original error: ${
|
|
3808
|
+
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive entry '${entryId}' after successfully unarchiving ${successfullyUnarchived.length} entry(s): [${successfullyUnarchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to unarchive entry '${entryId}': ${formatErrorMessage(error)}`;
|
|
3427
3809
|
throw new Error(errorMessage);
|
|
3428
3810
|
}
|
|
3429
3811
|
}
|
|
@@ -3445,17 +3827,17 @@ function unarchiveEntryTool(config) {
|
|
|
3445
3827
|
}
|
|
3446
3828
|
|
|
3447
3829
|
// src/tools/entries/appendEntryField.ts
|
|
3448
|
-
import { z as
|
|
3830
|
+
import { z as z54 } from "zod";
|
|
3449
3831
|
var AppendEntryFieldToolParams = BaseToolSchema.extend({
|
|
3450
|
-
entryId:
|
|
3451
|
-
fieldId:
|
|
3452
|
-
locale:
|
|
3832
|
+
entryId: z54.string().describe("The ID of the entry to modify"),
|
|
3833
|
+
fieldId: z54.string().describe("The ID of the array field to append to"),
|
|
3834
|
+
locale: z54.string().describe(
|
|
3453
3835
|
'The locale key to target (e.g. "en-US"). Fields are locale-keyed; you must supply the exact locale string.'
|
|
3454
3836
|
),
|
|
3455
|
-
values:
|
|
3837
|
+
values: z54.array(z54.unknown()).min(1).describe(
|
|
3456
3838
|
'One or more items to append. Each item must match the element shape of the target array field: a plain string for Array of Symbols, { sys: { type: "Link", linkType: "Entry"|"Asset", id: "..." } } for Array of Links, or { sys: { type: "ResourceLink", linkType: "...", urn: "..." } } for Array of ResourceLinks.'
|
|
3457
3839
|
),
|
|
3458
|
-
version:
|
|
3840
|
+
version: z54.number().optional().describe(
|
|
3459
3841
|
"Optional. The entry's sys.version as returned by get_entry. If provided, the append is rejected when the entry has changed since you read it (same conflict check as update_entry). If omitted, the append targets the current server state without a version check \u2014 safe for additive operations."
|
|
3460
3842
|
)
|
|
3461
3843
|
});
|
|
@@ -3709,11 +4091,11 @@ function createEntryTools(config) {
|
|
|
3709
4091
|
}
|
|
3710
4092
|
|
|
3711
4093
|
// src/tools/environments/createEnvironment.ts
|
|
3712
|
-
import { z as
|
|
4094
|
+
import { z as z55 } from "zod";
|
|
3713
4095
|
var CreateEnvironmentToolParams = BaseToolSchema.extend({
|
|
3714
|
-
environmentId:
|
|
3715
|
-
name:
|
|
3716
|
-
sourceEnvironmentId:
|
|
4096
|
+
environmentId: z55.string().describe("The ID of the environment to create"),
|
|
4097
|
+
name: z55.string().describe("The name of the environment to create"),
|
|
4098
|
+
sourceEnvironmentId: z55.string().describe(
|
|
3717
4099
|
"The ID of the source environment to clone from (defaults to master)"
|
|
3718
4100
|
).optional()
|
|
3719
4101
|
});
|
|
@@ -3744,15 +4126,15 @@ function createEnvironmentTool(config) {
|
|
|
3744
4126
|
}
|
|
3745
4127
|
|
|
3746
4128
|
// src/tools/environments/listEnvironments.ts
|
|
3747
|
-
import { z as
|
|
4129
|
+
import { z as z56 } from "zod";
|
|
3748
4130
|
var ListEnvironmentsToolParams = BaseToolSchema.extend({
|
|
3749
|
-
environmentId:
|
|
4131
|
+
environmentId: z56.string().optional().describe(
|
|
3750
4132
|
"The ID of the Contentful environment (not required for listing)"
|
|
3751
4133
|
),
|
|
3752
|
-
limit:
|
|
3753
|
-
skip:
|
|
3754
|
-
select:
|
|
3755
|
-
order:
|
|
4134
|
+
limit: z56.number().optional().describe("Maximum number of environments to return (max 10)"),
|
|
4135
|
+
skip: z56.number().optional().describe("Skip this many environments for pagination"),
|
|
4136
|
+
select: z56.string().optional().describe("Comma-separated list of fields to return"),
|
|
4137
|
+
order: z56.string().optional().describe("Order environments by this field")
|
|
3756
4138
|
});
|
|
3757
4139
|
function listEnvironmentsTool(config) {
|
|
3758
4140
|
async function tool2(args) {
|
|
@@ -3798,13 +4180,13 @@ function listEnvironmentsTool(config) {
|
|
|
3798
4180
|
}
|
|
3799
4181
|
|
|
3800
4182
|
// src/tools/environments/deleteEnvironment.ts
|
|
3801
|
-
import { z as
|
|
4183
|
+
import { z as z57 } from "zod";
|
|
3802
4184
|
var DeleteEnvironmentToolParams = BaseToolSchema.extend({
|
|
3803
|
-
environmentId:
|
|
3804
|
-
confirm:
|
|
4185
|
+
environmentId: z57.string().describe("The ID of the environment to delete"),
|
|
4186
|
+
confirm: z57.boolean().optional().describe(
|
|
3805
4187
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
3806
4188
|
),
|
|
3807
|
-
confirmToken:
|
|
4189
|
+
confirmToken: z57.string().optional().describe(
|
|
3808
4190
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
3809
4191
|
)
|
|
3810
4192
|
});
|
|
@@ -3889,9 +4271,9 @@ function createEnvironmentTools(config) {
|
|
|
3889
4271
|
}
|
|
3890
4272
|
|
|
3891
4273
|
// src/tools/locales/getLocale.ts
|
|
3892
|
-
import { z as
|
|
4274
|
+
import { z as z58 } from "zod";
|
|
3893
4275
|
var GetLocaleToolParams = BaseToolSchema.extend({
|
|
3894
|
-
localeId:
|
|
4276
|
+
localeId: z58.string().describe("The ID of the locale to retrieve")
|
|
3895
4277
|
});
|
|
3896
4278
|
function getLocaleTool(config) {
|
|
3897
4279
|
async function tool2(args) {
|
|
@@ -3908,21 +4290,21 @@ function getLocaleTool(config) {
|
|
|
3908
4290
|
}
|
|
3909
4291
|
|
|
3910
4292
|
// src/tools/locales/createLocale.ts
|
|
3911
|
-
import { z as
|
|
4293
|
+
import { z as z59 } from "zod";
|
|
3912
4294
|
var CreateLocaleToolParams = BaseToolSchema.extend({
|
|
3913
|
-
name:
|
|
3914
|
-
code:
|
|
3915
|
-
fallbackCode:
|
|
4295
|
+
name: z59.string().describe("The name of the locale"),
|
|
4296
|
+
code: z59.string().describe('The locale code (e.g., "en-US")'),
|
|
4297
|
+
fallbackCode: z59.string().nullable().describe(
|
|
3916
4298
|
"The locale code to fallback to when there is no content for the current locale"
|
|
3917
4299
|
),
|
|
3918
|
-
contentDeliveryApi:
|
|
4300
|
+
contentDeliveryApi: z59.boolean().optional().default(true).describe(
|
|
3919
4301
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
3920
4302
|
),
|
|
3921
|
-
contentManagementApi:
|
|
4303
|
+
contentManagementApi: z59.boolean().optional().default(true).describe(
|
|
3922
4304
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
3923
4305
|
),
|
|
3924
|
-
default:
|
|
3925
|
-
optional:
|
|
4306
|
+
default: z59.boolean().optional().default(false).describe("If this is the default locale"),
|
|
4307
|
+
optional: z59.boolean().optional().default(false).describe("If the locale needs to be filled in on entries or not")
|
|
3926
4308
|
});
|
|
3927
4309
|
function createLocaleTool(config) {
|
|
3928
4310
|
async function tool2(args) {
|
|
@@ -3949,13 +4331,13 @@ function createLocaleTool(config) {
|
|
|
3949
4331
|
}
|
|
3950
4332
|
|
|
3951
4333
|
// src/tools/locales/listLocales.ts
|
|
3952
|
-
import { z as
|
|
4334
|
+
import { z as z60 } from "zod";
|
|
3953
4335
|
var ListLocaleToolParams = BaseToolSchema.extend({
|
|
3954
|
-
limit:
|
|
3955
|
-
skip:
|
|
3956
|
-
select:
|
|
3957
|
-
include:
|
|
3958
|
-
order:
|
|
4336
|
+
limit: z60.number().optional().describe("Maximum number of locales to return"),
|
|
4337
|
+
skip: z60.number().optional().describe("Skip this many locales for pagination"),
|
|
4338
|
+
select: z60.string().optional().describe("Comma-separated list of fields to return"),
|
|
4339
|
+
include: z60.number().optional().describe("Include this many levels of linked entries"),
|
|
4340
|
+
order: z60.string().optional().describe("Order locales by this field")
|
|
3959
4341
|
});
|
|
3960
4342
|
function listLocaleTool(config) {
|
|
3961
4343
|
async function tool2(args) {
|
|
@@ -4008,23 +4390,23 @@ function listLocaleTool(config) {
|
|
|
4008
4390
|
}
|
|
4009
4391
|
|
|
4010
4392
|
// src/tools/locales/updateLocale.ts
|
|
4011
|
-
import { z as
|
|
4393
|
+
import { z as z61 } from "zod";
|
|
4012
4394
|
var UpdateLocaleToolParams = BaseToolSchema.extend({
|
|
4013
|
-
localeId:
|
|
4014
|
-
fields:
|
|
4015
|
-
name:
|
|
4395
|
+
localeId: z61.string().describe("The ID of the locale to update"),
|
|
4396
|
+
fields: z61.object({
|
|
4397
|
+
name: z61.string().optional().describe("The name of the locale"),
|
|
4016
4398
|
// NOTE: internal_code changes are not allowed
|
|
4017
|
-
code:
|
|
4018
|
-
fallbackCode:
|
|
4399
|
+
code: z61.string().optional().describe("The code of the locale"),
|
|
4400
|
+
fallbackCode: z61.string().optional().describe(
|
|
4019
4401
|
"The locale code to fallback to when there is no content for the current locale"
|
|
4020
4402
|
),
|
|
4021
|
-
contentDeliveryApi:
|
|
4403
|
+
contentDeliveryApi: z61.boolean().optional().describe(
|
|
4022
4404
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
4023
4405
|
),
|
|
4024
|
-
contentManagementApi:
|
|
4406
|
+
contentManagementApi: z61.boolean().optional().describe(
|
|
4025
4407
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
4026
4408
|
),
|
|
4027
|
-
optional:
|
|
4409
|
+
optional: z61.boolean().optional().describe("If the locale needs to be filled in on entries or not")
|
|
4028
4410
|
})
|
|
4029
4411
|
});
|
|
4030
4412
|
function updateLocaleTool(config) {
|
|
@@ -4054,13 +4436,13 @@ function updateLocaleTool(config) {
|
|
|
4054
4436
|
}
|
|
4055
4437
|
|
|
4056
4438
|
// src/tools/locales/deleteLocale.ts
|
|
4057
|
-
import { z as
|
|
4439
|
+
import { z as z62 } from "zod";
|
|
4058
4440
|
var DeleteLocaleToolParams = BaseToolSchema.extend({
|
|
4059
|
-
localeId:
|
|
4060
|
-
confirm:
|
|
4441
|
+
localeId: z62.string().describe("The ID of the locale to delete"),
|
|
4442
|
+
confirm: z62.boolean().optional().describe(
|
|
4061
4443
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4062
4444
|
),
|
|
4063
|
-
confirmToken:
|
|
4445
|
+
confirmToken: z62.string().optional().describe(
|
|
4064
4446
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4065
4447
|
)
|
|
4066
4448
|
});
|
|
@@ -4169,19 +4551,19 @@ function createLocaleTools(config) {
|
|
|
4169
4551
|
}
|
|
4170
4552
|
|
|
4171
4553
|
// src/tools/orgs/listOrgs.ts
|
|
4172
|
-
import { z as
|
|
4173
|
-
import { createClient as
|
|
4174
|
-
var ListOrgsToolParams =
|
|
4175
|
-
limit:
|
|
4176
|
-
skip:
|
|
4177
|
-
select:
|
|
4178
|
-
order:
|
|
4554
|
+
import { z as z63 } from "zod";
|
|
4555
|
+
import { createClient as createClient3 } from "contentful-management";
|
|
4556
|
+
var ListOrgsToolParams = z63.object({
|
|
4557
|
+
limit: z63.number().optional().describe("Maximum number of organizations to return (max 10)"),
|
|
4558
|
+
skip: z63.number().optional().describe("Skip this many organizations for pagination"),
|
|
4559
|
+
select: z63.string().optional().describe("Comma-separated list of fields to return"),
|
|
4560
|
+
order: z63.string().optional().describe("Order organizations by this field")
|
|
4179
4561
|
});
|
|
4180
4562
|
function listOrgsTool(config) {
|
|
4181
4563
|
async function tool2(args) {
|
|
4182
4564
|
const clientConfig = createClientConfig(config);
|
|
4183
4565
|
delete clientConfig.space;
|
|
4184
|
-
const contentfulClient =
|
|
4566
|
+
const contentfulClient = createClient3(clientConfig);
|
|
4185
4567
|
const organizations = await contentfulClient.organization.getAll({
|
|
4186
4568
|
query: {
|
|
4187
4569
|
limit: Math.min(args.limit || 10, 10),
|
|
@@ -4217,16 +4599,16 @@ function listOrgsTool(config) {
|
|
|
4217
4599
|
}
|
|
4218
4600
|
|
|
4219
4601
|
// src/tools/orgs/getOrg.ts
|
|
4220
|
-
import { z as
|
|
4221
|
-
import { createClient as
|
|
4222
|
-
var GetOrgToolParams =
|
|
4223
|
-
organizationId:
|
|
4602
|
+
import { z as z64 } from "zod";
|
|
4603
|
+
import { createClient as createClient4 } from "contentful-management";
|
|
4604
|
+
var GetOrgToolParams = z64.object({
|
|
4605
|
+
organizationId: z64.string().describe("The ID of the organization to retrieve")
|
|
4224
4606
|
});
|
|
4225
4607
|
function getOrgTool(config) {
|
|
4226
4608
|
async function tool2(args) {
|
|
4227
4609
|
const clientConfig = createClientConfig(config);
|
|
4228
4610
|
delete clientConfig.space;
|
|
4229
|
-
const contentfulClient =
|
|
4611
|
+
const contentfulClient = createClient4(clientConfig);
|
|
4230
4612
|
const organization = await contentfulClient.organization.get({
|
|
4231
4613
|
organizationId: args.organizationId
|
|
4232
4614
|
});
|
|
@@ -4268,19 +4650,19 @@ function createOrgTools(config) {
|
|
|
4268
4650
|
}
|
|
4269
4651
|
|
|
4270
4652
|
// src/tools/spaces/listSpaces.ts
|
|
4271
|
-
import { z as
|
|
4272
|
-
import { createClient as
|
|
4273
|
-
var ListSpacesToolParams =
|
|
4274
|
-
limit:
|
|
4275
|
-
skip:
|
|
4276
|
-
select:
|
|
4277
|
-
order:
|
|
4653
|
+
import { z as z65 } from "zod";
|
|
4654
|
+
import { createClient as createClient5 } from "contentful-management";
|
|
4655
|
+
var ListSpacesToolParams = z65.object({
|
|
4656
|
+
limit: z65.number().optional().describe("Maximum number of spaces to return (max 10)"),
|
|
4657
|
+
skip: z65.number().optional().describe("Skip this many spaces for pagination"),
|
|
4658
|
+
select: z65.string().optional().describe("Comma-separated list of fields to return"),
|
|
4659
|
+
order: z65.string().optional().describe("Order spaces by this field")
|
|
4278
4660
|
});
|
|
4279
4661
|
function listSpacesTool(config) {
|
|
4280
4662
|
async function tool2(args) {
|
|
4281
4663
|
const clientConfig = createClientConfig(config);
|
|
4282
4664
|
delete clientConfig.space;
|
|
4283
|
-
const contentfulClient =
|
|
4665
|
+
const contentfulClient = createClient5(clientConfig);
|
|
4284
4666
|
const spaces = await contentfulClient.space.getMany({
|
|
4285
4667
|
query: {
|
|
4286
4668
|
limit: Math.min(args.limit || 10, 10),
|
|
@@ -4316,16 +4698,16 @@ function listSpacesTool(config) {
|
|
|
4316
4698
|
}
|
|
4317
4699
|
|
|
4318
4700
|
// src/tools/spaces/getSpace.ts
|
|
4319
|
-
import { z as
|
|
4320
|
-
import { createClient as
|
|
4321
|
-
var GetSpaceToolParams =
|
|
4322
|
-
spaceId:
|
|
4701
|
+
import { z as z66 } from "zod";
|
|
4702
|
+
import { createClient as createClient6 } from "contentful-management";
|
|
4703
|
+
var GetSpaceToolParams = z66.object({
|
|
4704
|
+
spaceId: z66.string().describe("The ID of the space to retrieve")
|
|
4323
4705
|
});
|
|
4324
4706
|
function getSpaceTool(config) {
|
|
4325
4707
|
async function tool2(args) {
|
|
4326
4708
|
const clientConfig = createClientConfig(config);
|
|
4327
4709
|
delete clientConfig.space;
|
|
4328
|
-
const contentfulClient =
|
|
4710
|
+
const contentfulClient = createClient6(clientConfig);
|
|
4329
4711
|
const space = await contentfulClient.space.get({
|
|
4330
4712
|
spaceId: args.spaceId
|
|
4331
4713
|
});
|
|
@@ -4365,12 +4747,12 @@ function createSpaceTools(config) {
|
|
|
4365
4747
|
}
|
|
4366
4748
|
|
|
4367
4749
|
// src/tools/tags/listTags.ts
|
|
4368
|
-
import { z as
|
|
4750
|
+
import { z as z67 } from "zod";
|
|
4369
4751
|
var ListTagsToolParams = BaseToolSchema.extend({
|
|
4370
|
-
limit:
|
|
4371
|
-
skip:
|
|
4372
|
-
select:
|
|
4373
|
-
order:
|
|
4752
|
+
limit: z67.number().optional().describe("Maximum number of tags to return"),
|
|
4753
|
+
skip: z67.number().optional().describe("Skip this many tags for pagination"),
|
|
4754
|
+
select: z67.string().optional().describe("Comma-separated list of fields to return"),
|
|
4755
|
+
order: z67.string().optional().describe("Order tags by this field")
|
|
4374
4756
|
});
|
|
4375
4757
|
function listTagsTool(config) {
|
|
4376
4758
|
async function tool2(args) {
|
|
@@ -4416,11 +4798,11 @@ function listTagsTool(config) {
|
|
|
4416
4798
|
}
|
|
4417
4799
|
|
|
4418
4800
|
// src/tools/tags/createTag.ts
|
|
4419
|
-
import { z as
|
|
4801
|
+
import { z as z68 } from "zod";
|
|
4420
4802
|
var CreateTagToolParams = BaseToolSchema.extend({
|
|
4421
|
-
name:
|
|
4422
|
-
id:
|
|
4423
|
-
visibility:
|
|
4803
|
+
name: z68.string().describe("The name of the tag"),
|
|
4804
|
+
id: z68.string().describe("The ID of the tag"),
|
|
4805
|
+
visibility: z68.enum(["public", "private"]).describe("The visibility of the tag. Default to private if not specified")
|
|
4424
4806
|
});
|
|
4425
4807
|
function createTagTool(config) {
|
|
4426
4808
|
async function tool2(args) {
|
|
@@ -4475,40 +4857,40 @@ function createTagTools(config) {
|
|
|
4475
4857
|
}
|
|
4476
4858
|
|
|
4477
4859
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4478
|
-
import { z as
|
|
4479
|
-
import { createClient as
|
|
4860
|
+
import { z as z70 } from "zod";
|
|
4861
|
+
import { createClient as createClient7 } from "contentful-management";
|
|
4480
4862
|
|
|
4481
4863
|
// src/types/conceptPayloadTypes.ts
|
|
4482
|
-
import { z as
|
|
4483
|
-
var TaxonomyConceptLinkSchema =
|
|
4484
|
-
sys:
|
|
4485
|
-
type:
|
|
4486
|
-
linkType:
|
|
4487
|
-
id:
|
|
4864
|
+
import { z as z69 } from "zod";
|
|
4865
|
+
var TaxonomyConceptLinkSchema = z69.object({
|
|
4866
|
+
sys: z69.object({
|
|
4867
|
+
type: z69.literal("Link"),
|
|
4868
|
+
linkType: z69.literal("TaxonomyConcept"),
|
|
4869
|
+
id: z69.string()
|
|
4488
4870
|
})
|
|
4489
4871
|
});
|
|
4490
4872
|
|
|
4491
4873
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4492
|
-
var CreateConceptSchemeToolParams =
|
|
4493
|
-
organizationId:
|
|
4494
|
-
conceptSchemeId:
|
|
4874
|
+
var CreateConceptSchemeToolParams = z70.object({
|
|
4875
|
+
organizationId: z70.string().describe("The ID of the Contentful organization"),
|
|
4876
|
+
conceptSchemeId: z70.string().optional().describe(
|
|
4495
4877
|
"Optional user-defined ID for the concept scheme. If not provided, Contentful will generate one automatically."
|
|
4496
4878
|
),
|
|
4497
|
-
prefLabel:
|
|
4498
|
-
uri:
|
|
4499
|
-
definition:
|
|
4500
|
-
editorialNote:
|
|
4501
|
-
historyNote:
|
|
4502
|
-
example:
|
|
4503
|
-
note:
|
|
4504
|
-
scopeNote:
|
|
4505
|
-
topConcepts:
|
|
4879
|
+
prefLabel: z70.record(z70.string()).describe("The preferred label for the concept scheme (localized)"),
|
|
4880
|
+
uri: z70.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
4881
|
+
definition: z70.record(z70.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
4882
|
+
editorialNote: z70.record(z70.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
4883
|
+
historyNote: z70.record(z70.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
4884
|
+
example: z70.record(z70.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
4885
|
+
note: z70.record(z70.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
4886
|
+
scopeNote: z70.record(z70.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
4887
|
+
topConcepts: z70.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme")
|
|
4506
4888
|
});
|
|
4507
4889
|
function createConceptSchemeTool(config) {
|
|
4508
4890
|
async function tool2(args) {
|
|
4509
4891
|
const clientConfig = createClientConfig(config);
|
|
4510
4892
|
delete clientConfig.space;
|
|
4511
|
-
const contentfulClient =
|
|
4893
|
+
const contentfulClient = createClient7(clientConfig);
|
|
4512
4894
|
const conceptSchemePayload = {
|
|
4513
4895
|
prefLabel: args.prefLabel,
|
|
4514
4896
|
...Object.fromEntries(
|
|
@@ -4542,17 +4924,17 @@ function createConceptSchemeTool(config) {
|
|
|
4542
4924
|
}
|
|
4543
4925
|
|
|
4544
4926
|
// src/tools/taxonomies/concept-schemes/getConceptScheme.ts
|
|
4545
|
-
import { z as
|
|
4546
|
-
import { createClient as
|
|
4547
|
-
var GetConceptSchemeToolParams =
|
|
4548
|
-
organizationId:
|
|
4549
|
-
conceptSchemeId:
|
|
4927
|
+
import { z as z71 } from "zod";
|
|
4928
|
+
import { createClient as createClient8 } from "contentful-management";
|
|
4929
|
+
var GetConceptSchemeToolParams = z71.object({
|
|
4930
|
+
organizationId: z71.string().describe("The ID of the Contentful organization"),
|
|
4931
|
+
conceptSchemeId: z71.string().describe("The ID of the concept scheme to retrieve")
|
|
4550
4932
|
});
|
|
4551
4933
|
function getConceptSchemeTool(config) {
|
|
4552
4934
|
async function tool2(args) {
|
|
4553
4935
|
const clientConfig = createClientConfig(config);
|
|
4554
4936
|
delete clientConfig.space;
|
|
4555
|
-
const contentfulClient =
|
|
4937
|
+
const contentfulClient = createClient8(clientConfig);
|
|
4556
4938
|
const params = {
|
|
4557
4939
|
organizationId: args.organizationId,
|
|
4558
4940
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4566,25 +4948,25 @@ function getConceptSchemeTool(config) {
|
|
|
4566
4948
|
}
|
|
4567
4949
|
|
|
4568
4950
|
// src/tools/taxonomies/concept-schemes/listConceptSchemes.ts
|
|
4569
|
-
import { z as
|
|
4570
|
-
import { createClient as
|
|
4571
|
-
import { cloneDeep } from "lodash-es";
|
|
4572
|
-
var ListConceptSchemesToolParams =
|
|
4573
|
-
organizationId:
|
|
4574
|
-
query:
|
|
4575
|
-
|
|
4576
|
-
query:
|
|
4577
|
-
pageNext:
|
|
4578
|
-
pagePrev:
|
|
4951
|
+
import { z as z72 } from "zod";
|
|
4952
|
+
import { createClient as createClient9 } from "contentful-management";
|
|
4953
|
+
import { cloneDeep as cloneDeep2 } from "lodash-es";
|
|
4954
|
+
var ListConceptSchemesToolParams = z72.object({
|
|
4955
|
+
organizationId: z72.string(),
|
|
4956
|
+
query: z72.union([
|
|
4957
|
+
z72.object({
|
|
4958
|
+
query: z72.string().optional(),
|
|
4959
|
+
pageNext: z72.string().optional().describe("Cursor token for the next page of concept schemes"),
|
|
4960
|
+
pagePrev: z72.string().optional().describe(
|
|
4579
4961
|
"Cursor token for the previous page of concept schemes"
|
|
4580
4962
|
),
|
|
4581
|
-
limit:
|
|
4582
|
-
order:
|
|
4583
|
-
skip:
|
|
4963
|
+
limit: z72.number().optional().describe("Maximum number of concept schemes to return"),
|
|
4964
|
+
order: z72.string().optional().describe("Order concept schemes by this field"),
|
|
4965
|
+
skip: z72.never().optional()
|
|
4584
4966
|
}).passthrough(),
|
|
4585
4967
|
// handles [key: string]: any from BasicQueryOptions
|
|
4586
|
-
|
|
4587
|
-
pageUrl:
|
|
4968
|
+
z72.object({
|
|
4969
|
+
pageUrl: z72.string().optional()
|
|
4588
4970
|
})
|
|
4589
4971
|
]).optional().describe(
|
|
4590
4972
|
'Query parameters for listing concept schemes, supports either pageUrl for cursor-based pagination. Offset "skip" pagination is not supported.'
|
|
@@ -4596,13 +4978,13 @@ function listConceptSchemesTool(config) {
|
|
|
4596
4978
|
async function tool2(args) {
|
|
4597
4979
|
const clientConfig = createClientConfig(config);
|
|
4598
4980
|
delete clientConfig.space;
|
|
4599
|
-
const contentfulClient =
|
|
4981
|
+
const contentfulClient = createClient9(clientConfig);
|
|
4600
4982
|
const query = {};
|
|
4601
4983
|
if (args.query) {
|
|
4602
4984
|
if ("pageUrl" in args.query && args.query.pageUrl) {
|
|
4603
4985
|
query["pageUrl"] = args.query.pageUrl;
|
|
4604
4986
|
} else {
|
|
4605
|
-
const complexQuery =
|
|
4987
|
+
const complexQuery = cloneDeep2(args.query);
|
|
4606
4988
|
if (complexQuery["query"]) query["query"] = complexQuery["query"];
|
|
4607
4989
|
if (complexQuery["pageNext"])
|
|
4608
4990
|
query["pageNext"] = complexQuery["pageNext"];
|
|
@@ -4654,22 +5036,22 @@ function listConceptSchemesTool(config) {
|
|
|
4654
5036
|
}
|
|
4655
5037
|
|
|
4656
5038
|
// src/tools/taxonomies/concept-schemes/updateConceptScheme.ts
|
|
4657
|
-
import { z as
|
|
4658
|
-
import { createClient as
|
|
4659
|
-
var UpdateConceptSchemeToolParams =
|
|
4660
|
-
organizationId:
|
|
4661
|
-
conceptSchemeId:
|
|
4662
|
-
version:
|
|
4663
|
-
prefLabel:
|
|
4664
|
-
uri:
|
|
4665
|
-
definition:
|
|
4666
|
-
editorialNote:
|
|
4667
|
-
historyNote:
|
|
4668
|
-
example:
|
|
4669
|
-
note:
|
|
4670
|
-
scopeNote:
|
|
4671
|
-
topConcepts:
|
|
4672
|
-
addConcept:
|
|
5039
|
+
import { z as z73 } from "zod";
|
|
5040
|
+
import { createClient as createClient10 } from "contentful-management";
|
|
5041
|
+
var UpdateConceptSchemeToolParams = z73.object({
|
|
5042
|
+
organizationId: z73.string().describe("The ID of the Contentful organization"),
|
|
5043
|
+
conceptSchemeId: z73.string().describe("The ID of the concept scheme to update"),
|
|
5044
|
+
version: z73.number().describe("The current version of the concept scheme"),
|
|
5045
|
+
prefLabel: z73.record(z73.string()).optional().describe("The preferred label for the concept scheme (localized)"),
|
|
5046
|
+
uri: z73.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
5047
|
+
definition: z73.record(z73.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
5048
|
+
editorialNote: z73.record(z73.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
5049
|
+
historyNote: z73.record(z73.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
5050
|
+
example: z73.record(z73.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
5051
|
+
note: z73.record(z73.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
5052
|
+
scopeNote: z73.record(z73.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
5053
|
+
topConcepts: z73.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme"),
|
|
5054
|
+
addConcept: z73.string().optional().describe(
|
|
4673
5055
|
"ID of a concept to add to this scheme (adds to both concepts and topConcepts)"
|
|
4674
5056
|
)
|
|
4675
5057
|
});
|
|
@@ -4677,7 +5059,7 @@ function updateConceptSchemeTool(config) {
|
|
|
4677
5059
|
async function tool2(args) {
|
|
4678
5060
|
const clientConfig = createClientConfig(config);
|
|
4679
5061
|
delete clientConfig.space;
|
|
4680
|
-
const contentfulClient =
|
|
5062
|
+
const contentfulClient = createClient10(clientConfig);
|
|
4681
5063
|
const params = {
|
|
4682
5064
|
organizationId: args.organizationId,
|
|
4683
5065
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4744,15 +5126,15 @@ function updateConceptSchemeTool(config) {
|
|
|
4744
5126
|
}
|
|
4745
5127
|
|
|
4746
5128
|
// src/tools/taxonomies/concept-schemes/deleteConceptScheme.ts
|
|
4747
|
-
import { z as
|
|
4748
|
-
import { createClient as
|
|
4749
|
-
var DeleteConceptSchemeToolParams =
|
|
4750
|
-
organizationId:
|
|
4751
|
-
conceptSchemeId:
|
|
4752
|
-
confirm:
|
|
5129
|
+
import { z as z74 } from "zod";
|
|
5130
|
+
import { createClient as createClient11 } from "contentful-management";
|
|
5131
|
+
var DeleteConceptSchemeToolParams = z74.object({
|
|
5132
|
+
organizationId: z74.string().describe("The ID of the Contentful organization"),
|
|
5133
|
+
conceptSchemeId: z74.string().describe("The ID of the concept scheme to delete"),
|
|
5134
|
+
confirm: z74.boolean().optional().describe(
|
|
4753
5135
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4754
5136
|
),
|
|
4755
|
-
confirmToken:
|
|
5137
|
+
confirmToken: z74.string().optional().describe(
|
|
4756
5138
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4757
5139
|
)
|
|
4758
5140
|
});
|
|
@@ -4760,7 +5142,7 @@ function deleteConceptSchemeTool(config) {
|
|
|
4760
5142
|
async function tool2(args) {
|
|
4761
5143
|
const clientConfig = createClientConfig(config);
|
|
4762
5144
|
delete clientConfig.space;
|
|
4763
|
-
const contentfulClient =
|
|
5145
|
+
const contentfulClient = createClient11(clientConfig);
|
|
4764
5146
|
const conceptScheme = await contentfulClient.conceptScheme.get({
|
|
4765
5147
|
organizationId: args.organizationId,
|
|
4766
5148
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4863,32 +5245,32 @@ function createConceptSchemeTools(config) {
|
|
|
4863
5245
|
}
|
|
4864
5246
|
|
|
4865
5247
|
// src/tools/taxonomies/concepts/createConcept.ts
|
|
4866
|
-
import { z as
|
|
4867
|
-
import { createClient as
|
|
4868
|
-
var CreateConceptToolParams =
|
|
4869
|
-
organizationId:
|
|
4870
|
-
conceptId:
|
|
5248
|
+
import { z as z75 } from "zod";
|
|
5249
|
+
import { createClient as createClient12 } from "contentful-management";
|
|
5250
|
+
var CreateConceptToolParams = z75.object({
|
|
5251
|
+
organizationId: z75.string().describe("The ID of the Contentful organization"),
|
|
5252
|
+
conceptId: z75.string().optional().describe(
|
|
4871
5253
|
"Optional user-defined ID for the concept. If not provided, Contentful will generate one automatically."
|
|
4872
5254
|
),
|
|
4873
|
-
prefLabel:
|
|
4874
|
-
uri:
|
|
4875
|
-
altLabels:
|
|
4876
|
-
hiddenLabels:
|
|
4877
|
-
definition:
|
|
4878
|
-
editorialNote:
|
|
4879
|
-
historyNote:
|
|
4880
|
-
example:
|
|
4881
|
-
note:
|
|
4882
|
-
scopeNote:
|
|
4883
|
-
notations:
|
|
4884
|
-
broader:
|
|
4885
|
-
related:
|
|
5255
|
+
prefLabel: z75.record(z75.string()).describe("The preferred label for the concept (localized)"),
|
|
5256
|
+
uri: z75.string().nullable().optional().describe("The URI for the concept"),
|
|
5257
|
+
altLabels: z75.record(z75.array(z75.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
5258
|
+
hiddenLabels: z75.record(z75.array(z75.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
5259
|
+
definition: z75.record(z75.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
5260
|
+
editorialNote: z75.record(z75.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
5261
|
+
historyNote: z75.record(z75.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
5262
|
+
example: z75.record(z75.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
5263
|
+
note: z75.record(z75.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
5264
|
+
scopeNote: z75.record(z75.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
5265
|
+
notations: z75.array(z75.string()).optional().describe("Notations for the concept"),
|
|
5266
|
+
broader: z75.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
5267
|
+
related: z75.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4886
5268
|
});
|
|
4887
5269
|
function createConceptTool(config) {
|
|
4888
5270
|
async function tool2(args) {
|
|
4889
5271
|
const clientConfig = createClientConfig(config);
|
|
4890
5272
|
delete clientConfig.space;
|
|
4891
|
-
const contentfulClient =
|
|
5273
|
+
const contentfulClient = createClient12(clientConfig);
|
|
4892
5274
|
const conceptPayload = {
|
|
4893
5275
|
prefLabel: args.prefLabel,
|
|
4894
5276
|
...args.uri !== void 0 && { uri: args.uri },
|
|
@@ -4917,15 +5299,15 @@ function createConceptTool(config) {
|
|
|
4917
5299
|
}
|
|
4918
5300
|
|
|
4919
5301
|
// src/tools/taxonomies/concepts/deleteConcept.ts
|
|
4920
|
-
import { z as
|
|
4921
|
-
import { createClient as
|
|
4922
|
-
var DeleteConceptToolParams =
|
|
4923
|
-
organizationId:
|
|
4924
|
-
conceptId:
|
|
4925
|
-
confirm:
|
|
5302
|
+
import { z as z76 } from "zod";
|
|
5303
|
+
import { createClient as createClient13 } from "contentful-management";
|
|
5304
|
+
var DeleteConceptToolParams = z76.object({
|
|
5305
|
+
organizationId: z76.string().describe("The ID of the Contentful organization"),
|
|
5306
|
+
conceptId: z76.string().describe("The ID of the concept to delete"),
|
|
5307
|
+
confirm: z76.boolean().optional().describe(
|
|
4926
5308
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4927
5309
|
),
|
|
4928
|
-
confirmToken:
|
|
5310
|
+
confirmToken: z76.string().optional().describe(
|
|
4929
5311
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4930
5312
|
)
|
|
4931
5313
|
});
|
|
@@ -4933,7 +5315,7 @@ function deleteConceptTool(config) {
|
|
|
4933
5315
|
async function tool2(args) {
|
|
4934
5316
|
const clientConfig = createClientConfig(config);
|
|
4935
5317
|
delete clientConfig.space;
|
|
4936
|
-
const contentfulClient =
|
|
5318
|
+
const contentfulClient = createClient13(clientConfig);
|
|
4937
5319
|
const concept = await contentfulClient.concept.get({
|
|
4938
5320
|
organizationId: args.organizationId,
|
|
4939
5321
|
conceptId: args.conceptId
|
|
@@ -4962,31 +5344,31 @@ function deleteConceptTool(config) {
|
|
|
4962
5344
|
}
|
|
4963
5345
|
|
|
4964
5346
|
// src/tools/taxonomies/concepts/updateConcept.ts
|
|
4965
|
-
import { z as
|
|
4966
|
-
import { createClient as
|
|
4967
|
-
var UpdateConceptToolParams =
|
|
4968
|
-
organizationId:
|
|
4969
|
-
conceptId:
|
|
4970
|
-
version:
|
|
4971
|
-
prefLabel:
|
|
4972
|
-
uri:
|
|
4973
|
-
altLabels:
|
|
4974
|
-
hiddenLabels:
|
|
4975
|
-
definition:
|
|
4976
|
-
editorialNote:
|
|
4977
|
-
historyNote:
|
|
4978
|
-
example:
|
|
4979
|
-
note:
|
|
4980
|
-
scopeNote:
|
|
4981
|
-
notations:
|
|
4982
|
-
broader:
|
|
4983
|
-
related:
|
|
5347
|
+
import { z as z77 } from "zod";
|
|
5348
|
+
import { createClient as createClient14 } from "contentful-management";
|
|
5349
|
+
var UpdateConceptToolParams = z77.object({
|
|
5350
|
+
organizationId: z77.string().describe("The ID of the Contentful organization"),
|
|
5351
|
+
conceptId: z77.string().describe("The ID of the concept to update"),
|
|
5352
|
+
version: z77.number().describe("The current version of the concept"),
|
|
5353
|
+
prefLabel: z77.record(z77.string()).optional().describe("The preferred label for the concept (localized)"),
|
|
5354
|
+
uri: z77.string().nullable().optional().describe("The URI for the concept"),
|
|
5355
|
+
altLabels: z77.record(z77.array(z77.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
5356
|
+
hiddenLabels: z77.record(z77.array(z77.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
5357
|
+
definition: z77.record(z77.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
5358
|
+
editorialNote: z77.record(z77.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
5359
|
+
historyNote: z77.record(z77.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
5360
|
+
example: z77.record(z77.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
5361
|
+
note: z77.record(z77.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
5362
|
+
scopeNote: z77.record(z77.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
5363
|
+
notations: z77.array(z77.string()).optional().describe("Notations for the concept"),
|
|
5364
|
+
broader: z77.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
5365
|
+
related: z77.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4984
5366
|
});
|
|
4985
5367
|
function updateConceptTool(config) {
|
|
4986
5368
|
async function tool2(args) {
|
|
4987
5369
|
const clientConfig = createClientConfig(config);
|
|
4988
5370
|
delete clientConfig.space;
|
|
4989
|
-
const contentfulClient =
|
|
5371
|
+
const contentfulClient = createClient14(clientConfig);
|
|
4990
5372
|
const existingConcept = await contentfulClient.concept.get({
|
|
4991
5373
|
organizationId: args.organizationId,
|
|
4992
5374
|
conceptId: args.conceptId
|
|
@@ -5022,17 +5404,17 @@ function updateConceptTool(config) {
|
|
|
5022
5404
|
}
|
|
5023
5405
|
|
|
5024
5406
|
// src/tools/taxonomies/concepts/getConcept.ts
|
|
5025
|
-
import { z as
|
|
5026
|
-
import { createClient as
|
|
5027
|
-
var GetConceptToolParams =
|
|
5028
|
-
organizationId:
|
|
5029
|
-
conceptId:
|
|
5407
|
+
import { z as z78 } from "zod";
|
|
5408
|
+
import { createClient as createClient15 } from "contentful-management";
|
|
5409
|
+
var GetConceptToolParams = z78.object({
|
|
5410
|
+
organizationId: z78.string().describe("The ID of the Contentful organization"),
|
|
5411
|
+
conceptId: z78.string().describe("The ID of the concept to retrieve")
|
|
5030
5412
|
});
|
|
5031
5413
|
function getConceptTool(config) {
|
|
5032
5414
|
async function tool2(args) {
|
|
5033
5415
|
const clientConfig = createClientConfig(config);
|
|
5034
5416
|
delete clientConfig.space;
|
|
5035
|
-
const contentfulClient =
|
|
5417
|
+
const contentfulClient = createClient15(clientConfig);
|
|
5036
5418
|
const concept = await contentfulClient.concept.get({
|
|
5037
5419
|
organizationId: args.organizationId,
|
|
5038
5420
|
conceptId: args.conceptId
|
|
@@ -5043,24 +5425,24 @@ function getConceptTool(config) {
|
|
|
5043
5425
|
}
|
|
5044
5426
|
|
|
5045
5427
|
// src/tools/taxonomies/concepts/listConcepts.ts
|
|
5046
|
-
import { z as
|
|
5047
|
-
import { createClient as
|
|
5048
|
-
var ListConceptsToolParams =
|
|
5049
|
-
organizationId:
|
|
5050
|
-
conceptId:
|
|
5051
|
-
limit:
|
|
5052
|
-
select:
|
|
5053
|
-
include:
|
|
5054
|
-
order:
|
|
5055
|
-
getDescendants:
|
|
5056
|
-
getAncestors:
|
|
5057
|
-
getTotalOnly:
|
|
5428
|
+
import { z as z79 } from "zod";
|
|
5429
|
+
import { createClient as createClient16 } from "contentful-management";
|
|
5430
|
+
var ListConceptsToolParams = z79.object({
|
|
5431
|
+
organizationId: z79.string().describe("The ID of the Contentful organization"),
|
|
5432
|
+
conceptId: z79.string().optional().describe("The ID of the concept (required for descendants/ancestors)"),
|
|
5433
|
+
limit: z79.number().optional().describe("Maximum number of concepts to return"),
|
|
5434
|
+
select: z79.string().optional().describe("Comma-separated list of fields to return"),
|
|
5435
|
+
include: z79.number().optional().describe("Include this many levels of linked entries"),
|
|
5436
|
+
order: z79.string().optional().describe("Order concepts by this field"),
|
|
5437
|
+
getDescendants: z79.boolean().optional().describe("Get descendants of the specified concept (requires conceptId)"),
|
|
5438
|
+
getAncestors: z79.boolean().optional().describe("Get ancestors of the specified concept (requires conceptId)"),
|
|
5439
|
+
getTotalOnly: z79.boolean().optional().describe("Get only the total number of concepts without full data")
|
|
5058
5440
|
});
|
|
5059
5441
|
function listConceptsTool(config) {
|
|
5060
5442
|
async function tool2(args) {
|
|
5061
5443
|
const clientConfig = createClientConfig(config);
|
|
5062
5444
|
delete clientConfig.space;
|
|
5063
|
-
const contentfulClient =
|
|
5445
|
+
const contentfulClient = createClient16(clientConfig);
|
|
5064
5446
|
if ((args.getDescendants || args.getAncestors) && !args.conceptId) {
|
|
5065
5447
|
throw new Error(
|
|
5066
5448
|
"conceptId is required when getting descendants or ancestors"
|
|
@@ -5232,8 +5614,8 @@ function createTaxonomyTools(config) {
|
|
|
5232
5614
|
}
|
|
5233
5615
|
|
|
5234
5616
|
// src/tools/usage/getUsages.ts
|
|
5235
|
-
import { z as
|
|
5236
|
-
import { createClient as
|
|
5617
|
+
import { z as z80 } from "zod";
|
|
5618
|
+
import { createClient as createClient17 } from "contentful-management";
|
|
5237
5619
|
var AGGREGATED_USAGE_METRIC_KEYS = [
|
|
5238
5620
|
"api_call_cma",
|
|
5239
5621
|
"api_call_cpa",
|
|
@@ -5245,35 +5627,35 @@ var AGGREGATED_USAGE_METRIC_KEYS = [
|
|
|
5245
5627
|
"ai_action_word_count",
|
|
5246
5628
|
"ai_consumption_unit"
|
|
5247
5629
|
];
|
|
5248
|
-
var FilterValueSchema =
|
|
5249
|
-
|
|
5250
|
-
|
|
5630
|
+
var FilterValueSchema = z80.union([
|
|
5631
|
+
z80.string().min(1),
|
|
5632
|
+
z80.array(z80.string().min(1)).min(1).max(10)
|
|
5251
5633
|
]);
|
|
5252
|
-
var GetUsagesToolParams =
|
|
5253
|
-
organizationId:
|
|
5634
|
+
var GetUsagesToolParams = z80.object({
|
|
5635
|
+
organizationId: z80.string().optional().describe(
|
|
5254
5636
|
"Organization ID. If omitted, falls back to the ORGANIZATION_ID configured on the server."
|
|
5255
5637
|
),
|
|
5256
|
-
metricKey:
|
|
5638
|
+
metricKey: z80.enum(AGGREGATED_USAGE_METRIC_KEYS).describe(
|
|
5257
5639
|
'Metric to aggregate. Availability depends on the products enabled for the organization. Allowed dimensions per metric (used by "group", "filter", and "order", all in the form sys.dimensions.<name>.sys.<suffix>): api_call_cma / api_call_cpa / api_call_cda / api_call_graphql \u2192 sys.dimensions.space.sys.id. asset_bandwidth \u2192 sys.dimensions.space.sys.id, sys.dimensions.asset.sys.id. functions_invocations \u2192 sys.dimensions.space.sys.id, sys.dimensions.app.sys.id, sys.dimensions.function.sys.id. ai_action_invocation / ai_action_word_count / ai_consumption_unit \u2192 sys.dimensions.space.sys.id, sys.dimensions.ai_action.sys.id, sys.dimensions.model.sys.provider, sys.dimensions.model.sys.id.'
|
|
5258
5640
|
),
|
|
5259
|
-
dateGte:
|
|
5641
|
+
dateGte: z80.string().describe(
|
|
5260
5642
|
"Start date (inclusive) in ISO-8601 format (YYYY-MM-DD or full date-time). Sent as query param date[gte]. Max lookback: 12 months from now."
|
|
5261
5643
|
),
|
|
5262
|
-
dateLte:
|
|
5644
|
+
dateLte: z80.string().describe(
|
|
5263
5645
|
"End date (inclusive) in ISO-8601 format (YYYY-MM-DD or full date-time). Sent as query param date[lte]."
|
|
5264
5646
|
),
|
|
5265
|
-
granularity:
|
|
5647
|
+
granularity: z80.enum(["P1D", "P1M"]).optional().describe(
|
|
5266
5648
|
'Bucket size as an ISO-8601 duration: "P1D" (daily, max 31-day range) or "P1M" (monthly, max 12 calendar months including current). Default P1D.'
|
|
5267
5649
|
),
|
|
5268
|
-
group:
|
|
5650
|
+
group: z80.string().optional().describe(
|
|
5269
5651
|
'Comma-separated dimension keys (in the form sys.dimensions.<name>.sys.<suffix>) to group results by. Values must come from the allowed dimensions for the chosen metricKey (see metricKey description), e.g. "sys.dimensions.space.sys.id" or "sys.dimensions.space.sys.id,sys.dimensions.function.sys.id".'
|
|
5270
5652
|
),
|
|
5271
|
-
filter:
|
|
5653
|
+
filter: z80.record(z80.string(), FilterValueSchema).optional().describe(
|
|
5272
5654
|
'Filter by dimension values. Keys use the shape "sys.dimensions.<dimension>.sys.<attribute>", for example "sys.dimensions.space.sys.id" for the space_id dimension. Pass a string for a single-value filter or an array of up to 10 strings to filter by multiple values (uses the [in] operator). Available dimensions per metric are listed in the metricKey description.'
|
|
5273
5655
|
),
|
|
5274
|
-
limit:
|
|
5275
|
-
skip:
|
|
5276
|
-
order:
|
|
5656
|
+
limit: z80.number().int().positive().max(1e3).optional().describe("Maximum number of items to return (1\u20131000, default 1000)."),
|
|
5657
|
+
skip: z80.number().int().min(0).max(1e4).optional().describe("Number of items to skip for pagination (0\u201310000, default 0)."),
|
|
5658
|
+
order: z80.string().optional().describe(
|
|
5277
5659
|
'Column to sort by, in the form sys.dimensions.<name>.sys.<suffix>; prefix with "-" for descending (e.g. "-sys.dimensions.space.sys.id"). Allowed dimension columns match the metricKey (see metricKey description). The synthetic column "total_usage" is a bare token (e.g. "total_usage" or "-total_usage") and sums usage per group across the requested date range. When "group" is set, non-synthetic order columns must be a subset of grouped columns. Legacy underscore-form tokens (e.g. "space_id") return a 422.'
|
|
5278
5660
|
)
|
|
5279
5661
|
});
|
|
@@ -5305,7 +5687,7 @@ function getUsagesTool(config) {
|
|
|
5305
5687
|
"organizationId is required (either as a tool argument or via the ORGANIZATION_ID env var)."
|
|
5306
5688
|
);
|
|
5307
5689
|
}
|
|
5308
|
-
const client =
|
|
5690
|
+
const client = createClient17(createClientConfig(config), { type: "plain" });
|
|
5309
5691
|
const metricKey = args.metricKey;
|
|
5310
5692
|
const collection = await client.raw.get(
|
|
5311
5693
|
`/organizations/${organizationId}/usages/${metricKey}`,
|
|
@@ -5346,54 +5728,54 @@ function createUsageTools(config) {
|
|
|
5346
5728
|
}
|
|
5347
5729
|
|
|
5348
5730
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5349
|
-
import { z as
|
|
5731
|
+
import { z as z82 } from "zod";
|
|
5350
5732
|
|
|
5351
5733
|
// src/types/querySchema.ts
|
|
5352
|
-
import { z as
|
|
5353
|
-
var EntryQuerySchema =
|
|
5354
|
-
content_type:
|
|
5355
|
-
include:
|
|
5356
|
-
select:
|
|
5357
|
-
links_to_entry:
|
|
5358
|
-
limit:
|
|
5359
|
-
skip:
|
|
5360
|
-
order:
|
|
5361
|
-
});
|
|
5362
|
-
var AssetQuerySchema =
|
|
5363
|
-
mimetype_group:
|
|
5364
|
-
select:
|
|
5365
|
-
limit:
|
|
5366
|
-
skip:
|
|
5367
|
-
order:
|
|
5734
|
+
import { z as z81 } from "zod";
|
|
5735
|
+
var EntryQuerySchema = z81.object({
|
|
5736
|
+
content_type: z81.string().optional().describe("Filter by content type"),
|
|
5737
|
+
include: z81.number().optional().describe("Include this many levels of linked entries"),
|
|
5738
|
+
select: z81.string().optional().describe("Comma-separated list of fields to return"),
|
|
5739
|
+
links_to_entry: z81.string().optional().describe("Find entries that link to the specified entry ID"),
|
|
5740
|
+
limit: z81.number().optional().describe("Maximum number of entries to return"),
|
|
5741
|
+
skip: z81.number().optional().describe("Skip this many entries"),
|
|
5742
|
+
order: z81.string().optional().describe("Order entries by this field")
|
|
5743
|
+
});
|
|
5744
|
+
var AssetQuerySchema = z81.object({
|
|
5745
|
+
mimetype_group: z81.string().optional().describe("Filter by MIME type group"),
|
|
5746
|
+
select: z81.string().optional().describe("Comma-separated list of fields to return"),
|
|
5747
|
+
limit: z81.number().optional().describe("Maximum number of assets to return"),
|
|
5748
|
+
skip: z81.number().optional().describe("Skip this many assets"),
|
|
5749
|
+
order: z81.string().optional().describe("Order assets by this field")
|
|
5368
5750
|
});
|
|
5369
5751
|
|
|
5370
5752
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5371
5753
|
var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
5372
|
-
exportDir:
|
|
5754
|
+
exportDir: z82.string().optional().describe(
|
|
5373
5755
|
"Directory to save the exported space data (optional, defaults to current directory)"
|
|
5374
5756
|
),
|
|
5375
|
-
saveFile:
|
|
5376
|
-
contentFile:
|
|
5377
|
-
includeDrafts:
|
|
5378
|
-
includeArchived:
|
|
5379
|
-
skipContentModel:
|
|
5380
|
-
skipEditorInterfaces:
|
|
5381
|
-
skipContent:
|
|
5382
|
-
skipRoles:
|
|
5383
|
-
skipTags:
|
|
5384
|
-
skipWebhooks:
|
|
5385
|
-
stripTags:
|
|
5386
|
-
contentOnly:
|
|
5757
|
+
saveFile: z82.boolean().optional().default(true).describe("Save the exported space data to a file"),
|
|
5758
|
+
contentFile: z82.string().optional().describe("Custom filename for the exported space data (optional)"),
|
|
5759
|
+
includeDrafts: z82.boolean().optional().default(false).describe("Include draft entries in the export"),
|
|
5760
|
+
includeArchived: z82.boolean().optional().default(false).describe("Include archived entries in the export"),
|
|
5761
|
+
skipContentModel: z82.boolean().optional().default(false).describe("Skip exporting content types"),
|
|
5762
|
+
skipEditorInterfaces: z82.boolean().optional().default(false).describe("Skip exporting editor interfaces"),
|
|
5763
|
+
skipContent: z82.boolean().optional().default(false).describe("Skip exporting entries and assets"),
|
|
5764
|
+
skipRoles: z82.boolean().optional().default(false).describe("Skip exporting roles and permissions"),
|
|
5765
|
+
skipTags: z82.boolean().optional().default(false).describe("Skip exporting tags"),
|
|
5766
|
+
skipWebhooks: z82.boolean().optional().default(false).describe("Skip exporting webhooks"),
|
|
5767
|
+
stripTags: z82.boolean().optional().default(false).describe("Untag assets and entries"),
|
|
5768
|
+
contentOnly: z82.boolean().optional().default(false).describe("Only export assets and entries"),
|
|
5387
5769
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
5388
5770
|
"Export only entries that match query parameters"
|
|
5389
5771
|
),
|
|
5390
5772
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
5391
5773
|
"Export only assets that match query parameters"
|
|
5392
5774
|
),
|
|
5393
|
-
downloadAssets:
|
|
5394
|
-
maxAllowedLimit:
|
|
5395
|
-
errorLogFile:
|
|
5396
|
-
useVerboseRenderer:
|
|
5775
|
+
downloadAssets: z82.boolean().optional().default(false).describe("Download actual asset files"),
|
|
5776
|
+
maxAllowedLimit: z82.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
5777
|
+
errorLogFile: z82.string().optional().describe("Path to error log output file"),
|
|
5778
|
+
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
5397
5779
|
});
|
|
5398
5780
|
function createExportSpaceTool(config) {
|
|
5399
5781
|
async function tool2(args) {
|
|
@@ -5434,79 +5816,77 @@ function createExportSpaceTool(config) {
|
|
|
5434
5816
|
editorInterfaces: result.editorInterfaces?.length || 0
|
|
5435
5817
|
});
|
|
5436
5818
|
} catch (error) {
|
|
5437
|
-
throw new Error(
|
|
5438
|
-
`Failed to export space: ${error instanceof Error ? error.message : String(error)}`
|
|
5439
|
-
);
|
|
5819
|
+
throw new Error(`Failed to export space: ${formatErrorMessage(error)}`);
|
|
5440
5820
|
}
|
|
5441
5821
|
}
|
|
5442
5822
|
return withErrorHandling(tool2, "Error exporting space");
|
|
5443
5823
|
}
|
|
5444
5824
|
|
|
5445
5825
|
// src/tools/jobs/space-to-space-migration/paramCollection.ts
|
|
5446
|
-
import { z as
|
|
5826
|
+
import { z as z83 } from "zod";
|
|
5447
5827
|
var ParamCollectionToolParams = BaseToolSchema.extend({
|
|
5448
|
-
confirmation:
|
|
5828
|
+
confirmation: z83.boolean().optional().describe(
|
|
5449
5829
|
"User confirmation that they are ready to proceed with the workflow"
|
|
5450
5830
|
),
|
|
5451
|
-
export:
|
|
5452
|
-
spaceId:
|
|
5453
|
-
environmentId:
|
|
5454
|
-
deliveryToken:
|
|
5455
|
-
exportDir:
|
|
5456
|
-
saveFile:
|
|
5457
|
-
contentFile:
|
|
5458
|
-
includeDrafts:
|
|
5459
|
-
includeArchived:
|
|
5460
|
-
skipContentModel:
|
|
5461
|
-
skipEditorInterfaces:
|
|
5462
|
-
skipContent:
|
|
5463
|
-
skipRoles:
|
|
5464
|
-
skipTags:
|
|
5465
|
-
skipWebhooks:
|
|
5466
|
-
stripTags:
|
|
5467
|
-
contentOnly:
|
|
5831
|
+
export: z83.object({
|
|
5832
|
+
spaceId: z83.string().optional().describe("ID of the space with source data"),
|
|
5833
|
+
environmentId: z83.string().optional().describe("ID of the environment in the source space"),
|
|
5834
|
+
deliveryToken: z83.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
5835
|
+
exportDir: z83.string().optional().describe("Path to export JSON output"),
|
|
5836
|
+
saveFile: z83.boolean().optional().describe("Save the export as a JSON file"),
|
|
5837
|
+
contentFile: z83.string().optional().describe("Filename for exported data"),
|
|
5838
|
+
includeDrafts: z83.boolean().optional().describe("Include drafts in exported entries"),
|
|
5839
|
+
includeArchived: z83.boolean().optional().describe("Include archived entries"),
|
|
5840
|
+
skipContentModel: z83.boolean().optional().describe("Skip exporting content models"),
|
|
5841
|
+
skipEditorInterfaces: z83.boolean().optional().describe("Skip exporting editor interfaces"),
|
|
5842
|
+
skipContent: z83.boolean().optional().describe("Skip exporting entries and assets"),
|
|
5843
|
+
skipRoles: z83.boolean().optional().describe("Skip exporting roles and permissions"),
|
|
5844
|
+
skipTags: z83.boolean().optional().describe("Skip exporting tags"),
|
|
5845
|
+
skipWebhooks: z83.boolean().optional().describe("Skip exporting webhooks"),
|
|
5846
|
+
stripTags: z83.boolean().optional().describe("Remove tags from entries and assets"),
|
|
5847
|
+
contentOnly: z83.boolean().optional().describe("Export only entries and assets"),
|
|
5468
5848
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
5469
5849
|
"Export only entries that match query parameters"
|
|
5470
5850
|
),
|
|
5471
5851
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
5472
5852
|
"Export only assets that match query parameters"
|
|
5473
5853
|
),
|
|
5474
|
-
downloadAssets:
|
|
5475
|
-
host:
|
|
5476
|
-
hostDelivery:
|
|
5477
|
-
proxy:
|
|
5478
|
-
rawProxy:
|
|
5479
|
-
maxAllowedLimit:
|
|
5480
|
-
headers:
|
|
5481
|
-
errorLogFile:
|
|
5482
|
-
useVerboseRenderer:
|
|
5483
|
-
config:
|
|
5854
|
+
downloadAssets: z83.boolean().optional().describe("Download asset files to disk"),
|
|
5855
|
+
host: z83.string().optional().describe("Management API host"),
|
|
5856
|
+
hostDelivery: z83.string().optional().describe("Delivery API host"),
|
|
5857
|
+
proxy: z83.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
5858
|
+
rawProxy: z83.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
5859
|
+
maxAllowedLimit: z83.number().optional().describe("Page size for requests"),
|
|
5860
|
+
headers: z83.record(z83.any()).optional().describe("Additional headers to include in requests"),
|
|
5861
|
+
errorLogFile: z83.string().optional().describe("Path to error log output file"),
|
|
5862
|
+
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line logging, useful for CI"),
|
|
5863
|
+
config: z83.string().optional().describe("Path to a JSON config file with all options")
|
|
5484
5864
|
}).optional(),
|
|
5485
|
-
import:
|
|
5486
|
-
spaceId:
|
|
5487
|
-
environmentId:
|
|
5488
|
-
contentFile:
|
|
5489
|
-
content:
|
|
5865
|
+
import: z83.object({
|
|
5866
|
+
spaceId: z83.string().optional().describe("ID of the space to import into"),
|
|
5867
|
+
environmentId: z83.string().optional().describe("Target environment in destination space"),
|
|
5868
|
+
contentFile: z83.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5869
|
+
content: z83.record(z83.any()).optional().describe(
|
|
5490
5870
|
"JS object containing import content (must match expected structure)"
|
|
5491
5871
|
),
|
|
5492
|
-
contentModelOnly:
|
|
5493
|
-
skipContentModel:
|
|
5494
|
-
skipLocales:
|
|
5495
|
-
skipContentUpdates:
|
|
5496
|
-
skipContentPublishing:
|
|
5497
|
-
uploadAssets:
|
|
5498
|
-
skipAssetUpdates:
|
|
5499
|
-
assetsDirectory:
|
|
5500
|
-
timeout:
|
|
5501
|
-
retryLimit:
|
|
5502
|
-
host:
|
|
5503
|
-
proxy:
|
|
5504
|
-
rawProxy:
|
|
5505
|
-
rateLimit:
|
|
5506
|
-
headers:
|
|
5507
|
-
errorLogFile:
|
|
5508
|
-
useVerboseRenderer:
|
|
5509
|
-
config:
|
|
5872
|
+
contentModelOnly: z83.boolean().optional().describe("Import only content types"),
|
|
5873
|
+
skipContentModel: z83.boolean().optional().describe("Skip importing content types and locales"),
|
|
5874
|
+
skipLocales: z83.boolean().optional().describe("Skip importing locales"),
|
|
5875
|
+
skipContentUpdates: z83.boolean().optional().describe("Do not update existing content"),
|
|
5876
|
+
skipContentPublishing: z83.boolean().optional().describe("Create but do not publish content"),
|
|
5877
|
+
uploadAssets: z83.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
|
|
5878
|
+
skipAssetUpdates: z83.boolean().optional().describe("Do not update existing assets"),
|
|
5879
|
+
assetsDirectory: z83.string().optional().describe("Path to directory containing exported asset files"),
|
|
5880
|
+
timeout: z83.number().optional().describe("Time between retries during asset processing (ms)"),
|
|
5881
|
+
retryLimit: z83.number().optional().describe("Max retries for asset processing"),
|
|
5882
|
+
host: z83.string().optional().describe("Management API host"),
|
|
5883
|
+
proxy: z83.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
5884
|
+
rawProxy: z83.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
5885
|
+
rateLimit: z83.number().optional().describe("Max requests per second to the API"),
|
|
5886
|
+
headers: z83.record(z83.any()).optional().describe("Additional headers to attach to requests"),
|
|
5887
|
+
errorLogFile: z83.string().optional().describe("Path to error log file"),
|
|
5888
|
+
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line progress output (good for CI)"),
|
|
5889
|
+
config: z83.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
5510
5890
|
}).optional()
|
|
5511
5891
|
});
|
|
5512
5892
|
var paramCollectionConfig = {
|
|
@@ -5622,25 +6002,25 @@ var createParamCollectionTool = withErrorHandling(
|
|
|
5622
6002
|
);
|
|
5623
6003
|
|
|
5624
6004
|
// src/tools/jobs/space-to-space-migration/importSpace.ts
|
|
5625
|
-
import { z as
|
|
6005
|
+
import { z as z84 } from "zod";
|
|
5626
6006
|
var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
5627
|
-
contentFile:
|
|
5628
|
-
content:
|
|
6007
|
+
contentFile: z84.string().optional().describe("Path to JSON file containing the content to import"),
|
|
6008
|
+
content: z84.record(z84.any()).optional().describe(
|
|
5629
6009
|
"JS object containing import content (must match expected structure)"
|
|
5630
6010
|
),
|
|
5631
|
-
contentModelOnly:
|
|
5632
|
-
skipContentModel:
|
|
5633
|
-
skipLocales:
|
|
5634
|
-
skipContentUpdates:
|
|
5635
|
-
skipContentPublishing:
|
|
5636
|
-
uploadAssets:
|
|
5637
|
-
skipAssetUpdates:
|
|
5638
|
-
assetsDirectory:
|
|
5639
|
-
timeout:
|
|
5640
|
-
retryLimit:
|
|
5641
|
-
rateLimit:
|
|
5642
|
-
errorLogFile:
|
|
5643
|
-
useVerboseRenderer:
|
|
6011
|
+
contentModelOnly: z84.boolean().optional().default(false).describe("Import only content types"),
|
|
6012
|
+
skipContentModel: z84.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
6013
|
+
skipLocales: z84.boolean().optional().default(false).describe("Skip importing locales"),
|
|
6014
|
+
skipContentUpdates: z84.boolean().optional().default(false).describe("Do not update existing content"),
|
|
6015
|
+
skipContentPublishing: z84.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
6016
|
+
uploadAssets: z84.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
6017
|
+
skipAssetUpdates: z84.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
6018
|
+
assetsDirectory: z84.string().optional().describe("Path to directory containing exported asset files"),
|
|
6019
|
+
timeout: z84.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
6020
|
+
retryLimit: z84.number().optional().default(10).describe("Max retries for asset processing"),
|
|
6021
|
+
rateLimit: z84.number().optional().default(7).describe("Max requests per second to the API"),
|
|
6022
|
+
errorLogFile: z84.string().optional().describe("Path to error log file"),
|
|
6023
|
+
useVerboseRenderer: z84.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
5644
6024
|
});
|
|
5645
6025
|
function createImportSpaceTool(config) {
|
|
5646
6026
|
async function tool2(args) {
|
|
@@ -5676,16 +6056,14 @@ function createImportSpaceTool(config) {
|
|
|
5676
6056
|
editorInterfaces: result.editorInterfaces?.length || 0
|
|
5677
6057
|
});
|
|
5678
6058
|
} catch (error) {
|
|
5679
|
-
throw new Error(
|
|
5680
|
-
`Failed to import space: ${error instanceof Error ? error.message : String(error)}`
|
|
5681
|
-
);
|
|
6059
|
+
throw new Error(`Failed to import space: ${formatErrorMessage(error)}`);
|
|
5682
6060
|
}
|
|
5683
6061
|
}
|
|
5684
6062
|
return withErrorHandling(tool2, "Error importing space");
|
|
5685
6063
|
}
|
|
5686
6064
|
|
|
5687
6065
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
5688
|
-
import { z as
|
|
6066
|
+
import { z as z85 } from "zod";
|
|
5689
6067
|
|
|
5690
6068
|
// src/tools/jobs/space-to-space-migration/instructions.ts
|
|
5691
6069
|
var S2S_MIGRATION_INSTRUCTIONS = `
|
|
@@ -5728,7 +6106,7 @@ The space to space migration workflow has been concluded and all related tools h
|
|
|
5728
6106
|
The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
|
|
5729
6107
|
`;
|
|
5730
6108
|
var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
|
|
5731
|
-
enableWorkflow:
|
|
6109
|
+
enableWorkflow: z85.boolean().describe(
|
|
5732
6110
|
"Set to true to enable the workflow tools, false to disable them and conclude the workflow"
|
|
5733
6111
|
)
|
|
5734
6112
|
});
|
|
@@ -5826,13 +6204,13 @@ function createJobTools(config) {
|
|
|
5826
6204
|
}
|
|
5827
6205
|
|
|
5828
6206
|
// src/tools/exo/components/getComponent.ts
|
|
5829
|
-
import { z as
|
|
6207
|
+
import { z as z86 } from "zod";
|
|
5830
6208
|
var GetComponentToolParams = BaseToolSchema.extend({
|
|
5831
|
-
componentId:
|
|
6209
|
+
componentId: z86.string().describe("The ID of the component to retrieve details for")
|
|
5832
6210
|
});
|
|
5833
6211
|
function getComponentTool(config) {
|
|
5834
6212
|
async function tool2(args) {
|
|
5835
|
-
const contentfulClient =
|
|
6213
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
5836
6214
|
const component = await contentfulClient.component.get({
|
|
5837
6215
|
spaceId: args.spaceId,
|
|
5838
6216
|
environmentId: args.environmentId,
|
|
@@ -5846,16 +6224,16 @@ function getComponentTool(config) {
|
|
|
5846
6224
|
}
|
|
5847
6225
|
|
|
5848
6226
|
// src/tools/exo/components/listComponents.ts
|
|
5849
|
-
import { z as
|
|
6227
|
+
import { z as z87 } from "zod";
|
|
5850
6228
|
var ListComponentsToolParams = BaseToolSchema.extend({
|
|
5851
|
-
limit:
|
|
5852
|
-
pageNext:
|
|
5853
|
-
pagePrev:
|
|
5854
|
-
order:
|
|
6229
|
+
limit: z87.number().optional().describe("Maximum number of components to return (max 10)"),
|
|
6230
|
+
pageNext: z87.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6231
|
+
pagePrev: z87.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6232
|
+
order: z87.string().optional().describe("Order components by this field (e.g. sys.createdAt)")
|
|
5855
6233
|
});
|
|
5856
6234
|
function listComponentsTool(config) {
|
|
5857
6235
|
async function tool2(args) {
|
|
5858
|
-
const contentfulClient =
|
|
6236
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
5859
6237
|
const cursorParam = args.pageNext ? { pageNext: args.pageNext } : args.pagePrev ? { pagePrev: args.pagePrev } : {};
|
|
5860
6238
|
const components = await contentfulClient.component.getMany({
|
|
5861
6239
|
spaceId: args.spaceId,
|
|
@@ -5881,10 +6259,10 @@ function listComponentsTool(config) {
|
|
|
5881
6259
|
}
|
|
5882
6260
|
|
|
5883
6261
|
// src/tools/exo/components/createComponent.ts
|
|
5884
|
-
import { z as
|
|
6262
|
+
import { z as z89 } from "zod";
|
|
5885
6263
|
|
|
5886
6264
|
// src/types/exoSchemas.ts
|
|
5887
|
-
import { z as
|
|
6265
|
+
import { z as z88 } from "zod";
|
|
5888
6266
|
var URN_EXAMPLES = {
|
|
5889
6267
|
"Contentful:Component": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/components/{id}",
|
|
5890
6268
|
"Contentful:ExperienceFragment": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/experienceFragments/{id}",
|
|
@@ -5894,19 +6272,19 @@ var URN_EXAMPLES = {
|
|
|
5894
6272
|
var resourceLinkSchema2 = (linkType) => {
|
|
5895
6273
|
const example = URN_EXAMPLES[linkType];
|
|
5896
6274
|
const urnDesc = example ? `URN of the linked resource (e.g. "${example}")` : "URN of the linked resource";
|
|
5897
|
-
return
|
|
5898
|
-
sys:
|
|
5899
|
-
type:
|
|
5900
|
-
linkType:
|
|
5901
|
-
urn:
|
|
6275
|
+
return z88.object({
|
|
6276
|
+
sys: z88.object({
|
|
6277
|
+
type: z88.literal("ResourceLink"),
|
|
6278
|
+
linkType: z88.literal(linkType),
|
|
6279
|
+
urn: z88.string().describe(urnDesc)
|
|
5902
6280
|
})
|
|
5903
6281
|
});
|
|
5904
6282
|
};
|
|
5905
|
-
var linkSchema2 = (linkType) =>
|
|
5906
|
-
sys:
|
|
5907
|
-
type:
|
|
5908
|
-
linkType:
|
|
5909
|
-
id:
|
|
6283
|
+
var linkSchema2 = (linkType) => z88.object({
|
|
6284
|
+
sys: z88.object({
|
|
6285
|
+
type: z88.literal("Link"),
|
|
6286
|
+
linkType: z88.literal(linkType),
|
|
6287
|
+
id: z88.string()
|
|
5910
6288
|
})
|
|
5911
6289
|
});
|
|
5912
6290
|
var ComponentResourceLinkSchema = resourceLinkSchema2(
|
|
@@ -5918,71 +6296,71 @@ var ExperienceFragmentResourceLinkSchema = resourceLinkSchema2(
|
|
|
5918
6296
|
var ExperienceTemplateResourceLinkSchema = resourceLinkSchema2(
|
|
5919
6297
|
"Contentful:ExperienceTemplate"
|
|
5920
6298
|
);
|
|
5921
|
-
var ViewportSchema =
|
|
5922
|
-
id:
|
|
5923
|
-
query:
|
|
5924
|
-
displayName:
|
|
5925
|
-
previewSize:
|
|
5926
|
-
});
|
|
5927
|
-
var DataTypeDefinitionSchema =
|
|
5928
|
-
() =>
|
|
5929
|
-
|
|
5930
|
-
type:
|
|
5931
|
-
name:
|
|
5932
|
-
required:
|
|
6299
|
+
var ViewportSchema = z88.object({
|
|
6300
|
+
id: z88.string().describe("Viewport identifier"),
|
|
6301
|
+
query: z88.string().describe("CSS media query string"),
|
|
6302
|
+
displayName: z88.string().describe("Human-readable viewport name"),
|
|
6303
|
+
previewSize: z88.string().describe('Preview size (e.g. "1024px")')
|
|
6304
|
+
});
|
|
6305
|
+
var DataTypeDefinitionSchema = z88.lazy(
|
|
6306
|
+
() => z88.discriminatedUnion("type", [
|
|
6307
|
+
z88.object({
|
|
6308
|
+
type: z88.enum(["String", "Number", "Integer", "Boolean"]),
|
|
6309
|
+
name: z88.string().optional(),
|
|
6310
|
+
required: z88.boolean().optional()
|
|
5933
6311
|
}),
|
|
5934
|
-
|
|
5935
|
-
type:
|
|
5936
|
-
name:
|
|
5937
|
-
required:
|
|
6312
|
+
z88.object({
|
|
6313
|
+
type: z88.literal("RichText"),
|
|
6314
|
+
name: z88.string().optional(),
|
|
6315
|
+
required: z88.boolean().optional()
|
|
5938
6316
|
}),
|
|
5939
|
-
|
|
5940
|
-
type:
|
|
5941
|
-
name:
|
|
5942
|
-
required:
|
|
6317
|
+
z88.object({
|
|
6318
|
+
type: z88.literal("Array"),
|
|
6319
|
+
name: z88.string().optional(),
|
|
6320
|
+
required: z88.boolean().optional(),
|
|
5943
6321
|
items: DataTypeDefinitionSchema
|
|
5944
6322
|
}),
|
|
5945
|
-
|
|
5946
|
-
type:
|
|
5947
|
-
name:
|
|
5948
|
-
required:
|
|
5949
|
-
fields:
|
|
6323
|
+
z88.object({
|
|
6324
|
+
type: z88.literal("Record"),
|
|
6325
|
+
name: z88.string().optional(),
|
|
6326
|
+
required: z88.boolean().optional(),
|
|
6327
|
+
fields: z88.record(z88.string(), DataTypeDefinitionSchema)
|
|
5950
6328
|
}),
|
|
5951
|
-
|
|
5952
|
-
type:
|
|
5953
|
-
name:
|
|
5954
|
-
required:
|
|
5955
|
-
ref:
|
|
5956
|
-
sys:
|
|
5957
|
-
type:
|
|
5958
|
-
linkType:
|
|
5959
|
-
urn:
|
|
6329
|
+
z88.object({
|
|
6330
|
+
type: z88.literal("TypeRef"),
|
|
6331
|
+
name: z88.string().optional(),
|
|
6332
|
+
required: z88.boolean().optional(),
|
|
6333
|
+
ref: z88.object({
|
|
6334
|
+
sys: z88.object({
|
|
6335
|
+
type: z88.literal("ResourceLink"),
|
|
6336
|
+
linkType: z88.string(),
|
|
6337
|
+
urn: z88.string()
|
|
5960
6338
|
})
|
|
5961
6339
|
})
|
|
5962
6340
|
}),
|
|
5963
|
-
|
|
5964
|
-
type:
|
|
5965
|
-
name:
|
|
5966
|
-
required:
|
|
5967
|
-
value:
|
|
6341
|
+
z88.object({
|
|
6342
|
+
type: z88.literal("Literal"),
|
|
6343
|
+
name: z88.string().optional(),
|
|
6344
|
+
required: z88.boolean().optional(),
|
|
6345
|
+
value: z88.custom().describe("JSON literal value"),
|
|
5968
6346
|
valueType: DataTypeDefinitionSchema
|
|
5969
6347
|
}),
|
|
5970
|
-
|
|
5971
|
-
type:
|
|
5972
|
-
name:
|
|
5973
|
-
required:
|
|
5974
|
-
discriminator:
|
|
5975
|
-
members:
|
|
6348
|
+
z88.object({
|
|
6349
|
+
type: z88.literal("DiscriminatedUnion"),
|
|
6350
|
+
name: z88.string().optional(),
|
|
6351
|
+
required: z88.boolean().optional(),
|
|
6352
|
+
discriminator: z88.string(),
|
|
6353
|
+
members: z88.array(DataTypeDefinitionSchema)
|
|
5976
6354
|
})
|
|
5977
6355
|
])
|
|
5978
6356
|
);
|
|
5979
|
-
var ContentPropertySchema =
|
|
6357
|
+
var ContentPropertySchema = z88.intersection(
|
|
5980
6358
|
DataTypeDefinitionSchema,
|
|
5981
|
-
|
|
5982
|
-
id:
|
|
5983
|
-
name:
|
|
5984
|
-
required:
|
|
5985
|
-
defaultValue:
|
|
6359
|
+
z88.object({
|
|
6360
|
+
id: z88.string().describe("Content property identifier"),
|
|
6361
|
+
name: z88.string().describe("Human-readable name"),
|
|
6362
|
+
required: z88.boolean().describe("Whether the property is required"),
|
|
6363
|
+
defaultValue: z88.unknown().optional().describe("Default value")
|
|
5986
6364
|
})
|
|
5987
6365
|
);
|
|
5988
6366
|
var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
@@ -6000,186 +6378,186 @@ var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
|
6000
6378
|
"DTCG.Gradient",
|
|
6001
6379
|
"DTCG.Typography"
|
|
6002
6380
|
];
|
|
6003
|
-
var DesignPropertyCommonFieldsSchema =
|
|
6004
|
-
id:
|
|
6005
|
-
name:
|
|
6006
|
-
description:
|
|
6381
|
+
var DesignPropertyCommonFieldsSchema = z88.object({
|
|
6382
|
+
id: z88.string().describe("Design property identifier"),
|
|
6383
|
+
name: z88.string().describe("Human-readable name"),
|
|
6384
|
+
description: z88.string().optional().describe("Optional description")
|
|
6007
6385
|
});
|
|
6008
6386
|
var StringDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6009
|
-
type:
|
|
6010
|
-
fallbackValue:
|
|
6011
|
-
type:
|
|
6012
|
-
value:
|
|
6387
|
+
type: z88.literal("String"),
|
|
6388
|
+
fallbackValue: z88.object({
|
|
6389
|
+
type: z88.literal("ManualDesignValue"),
|
|
6390
|
+
value: z88.string()
|
|
6013
6391
|
}).optional().describe("Manual fallback value for this design property"),
|
|
6014
|
-
validations:
|
|
6015
|
-
|
|
6016
|
-
regexp:
|
|
6017
|
-
pattern:
|
|
6392
|
+
validations: z88.array(
|
|
6393
|
+
z88.object({
|
|
6394
|
+
regexp: z88.object({
|
|
6395
|
+
pattern: z88.string().describe("Regular expression pattern")
|
|
6018
6396
|
})
|
|
6019
6397
|
})
|
|
6020
6398
|
).optional().describe("Regexp validations constraining allowed string values")
|
|
6021
6399
|
});
|
|
6022
6400
|
var BooleanDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6023
|
-
type:
|
|
6024
|
-
fallbackValue:
|
|
6025
|
-
type:
|
|
6026
|
-
value:
|
|
6401
|
+
type: z88.literal("Boolean"),
|
|
6402
|
+
fallbackValue: z88.object({
|
|
6403
|
+
type: z88.literal("ManualDesignValue"),
|
|
6404
|
+
value: z88.boolean()
|
|
6027
6405
|
}).optional().describe("Manual fallback value for this design property")
|
|
6028
6406
|
});
|
|
6029
|
-
var DesignTokenValueSchema =
|
|
6030
|
-
type:
|
|
6031
|
-
value:
|
|
6407
|
+
var DesignTokenValueSchema = z88.object({
|
|
6408
|
+
type: z88.literal("DesignToken"),
|
|
6409
|
+
value: z88.string().min(1).describe("Design token reference (non-empty)")
|
|
6032
6410
|
});
|
|
6033
6411
|
var TokenBackedDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend(
|
|
6034
6412
|
{
|
|
6035
|
-
type:
|
|
6413
|
+
type: z88.enum(DTCG_DESIGN_PROPERTY_TYPES),
|
|
6036
6414
|
fallbackValue: DesignTokenValueSchema.optional().describe(
|
|
6037
6415
|
"Design-token-backed fallback value for this design property"
|
|
6038
6416
|
),
|
|
6039
|
-
allowedResources:
|
|
6040
|
-
|
|
6041
|
-
type:
|
|
6042
|
-
value:
|
|
6043
|
-
name:
|
|
6417
|
+
allowedResources: z88.array(
|
|
6418
|
+
z88.object({
|
|
6419
|
+
type: z88.literal("DesignToken"),
|
|
6420
|
+
value: z88.string(),
|
|
6421
|
+
name: z88.string().optional()
|
|
6044
6422
|
})
|
|
6045
6423
|
).optional().describe("Allowed design token resources")
|
|
6046
6424
|
}
|
|
6047
6425
|
);
|
|
6048
|
-
var DesignPropertySchema =
|
|
6426
|
+
var DesignPropertySchema = z88.union([
|
|
6049
6427
|
StringDesignPropertySchema,
|
|
6050
6428
|
BooleanDesignPropertySchema,
|
|
6051
6429
|
TokenBackedDesignPropertySchema
|
|
6052
6430
|
]);
|
|
6053
|
-
var ManualDesignValueSchema =
|
|
6054
|
-
type:
|
|
6055
|
-
value:
|
|
6431
|
+
var ManualDesignValueSchema = z88.object({
|
|
6432
|
+
type: z88.literal("ManualDesignValue"),
|
|
6433
|
+
value: z88.union([z88.string(), z88.number(), z88.boolean()])
|
|
6056
6434
|
});
|
|
6057
|
-
var DesignPropertyValueSchema =
|
|
6435
|
+
var DesignPropertyValueSchema = z88.union([
|
|
6058
6436
|
ManualDesignValueSchema,
|
|
6059
6437
|
DesignTokenValueSchema
|
|
6060
6438
|
]);
|
|
6061
|
-
var DesignPropertyPointerValueSchema =
|
|
6439
|
+
var DesignPropertyPointerValueSchema = z88.custom(
|
|
6062
6440
|
(val) => typeof val === "string" && /^\$designProperties\//.test(val),
|
|
6063
6441
|
{ message: 'Must be a "$designProperties/..." pointer' }
|
|
6064
6442
|
);
|
|
6065
|
-
var DimensionedDesignPropertyValueSchema =
|
|
6066
|
-
|
|
6443
|
+
var DimensionedDesignPropertyValueSchema = z88.record(
|
|
6444
|
+
z88.string(),
|
|
6067
6445
|
DesignPropertyValueSchema
|
|
6068
6446
|
);
|
|
6069
|
-
var ComponentTreeDesignPropertyValueSchema =
|
|
6447
|
+
var ComponentTreeDesignPropertyValueSchema = z88.union([
|
|
6070
6448
|
DesignPropertyValueSchema,
|
|
6071
6449
|
DesignPropertyPointerValueSchema,
|
|
6072
6450
|
DimensionedDesignPropertyValueSchema
|
|
6073
6451
|
]);
|
|
6074
6452
|
var COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE = "crn:contentful:::experience:spaces/$self/environments/$self";
|
|
6075
|
-
var SlotDefinitionSchema =
|
|
6076
|
-
id:
|
|
6077
|
-
name:
|
|
6078
|
-
required:
|
|
6079
|
-
validations:
|
|
6080
|
-
|
|
6081
|
-
size:
|
|
6082
|
-
min:
|
|
6083
|
-
max:
|
|
6453
|
+
var SlotDefinitionSchema = z88.object({
|
|
6454
|
+
id: z88.string().describe("Slot identifier"),
|
|
6455
|
+
name: z88.string().describe("Human-readable name"),
|
|
6456
|
+
required: z88.boolean().describe("Whether the slot must be filled"),
|
|
6457
|
+
validations: z88.array(
|
|
6458
|
+
z88.object({
|
|
6459
|
+
size: z88.object({
|
|
6460
|
+
min: z88.number().optional(),
|
|
6461
|
+
max: z88.number().optional()
|
|
6084
6462
|
}).optional()
|
|
6085
6463
|
})
|
|
6086
6464
|
).describe("Slot cardinality validations"),
|
|
6087
|
-
allowedResources:
|
|
6088
|
-
|
|
6089
|
-
type:
|
|
6090
|
-
source:
|
|
6091
|
-
allowedTypes:
|
|
6465
|
+
allowedResources: z88.array(
|
|
6466
|
+
z88.object({
|
|
6467
|
+
type: z88.literal("Contentful:Component"),
|
|
6468
|
+
source: z88.literal(COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE),
|
|
6469
|
+
allowedTypes: z88.array(z88.string()).describe("IDs of components allowed in this slot")
|
|
6092
6470
|
})
|
|
6093
6471
|
).optional().describe("Constrains which components may be placed in this slot")
|
|
6094
6472
|
});
|
|
6095
|
-
var ExperienceFragmentNodeSchema =
|
|
6096
|
-
id:
|
|
6097
|
-
name:
|
|
6098
|
-
nodeType:
|
|
6473
|
+
var ExperienceFragmentNodeSchema = z88.object({
|
|
6474
|
+
id: z88.string().describe("Node identifier"),
|
|
6475
|
+
name: z88.string().optional().describe("Optional display name"),
|
|
6476
|
+
nodeType: z88.literal("ExperienceFragment").describe('Must be "ExperienceFragment"'),
|
|
6099
6477
|
experienceFragment: ExperienceFragmentResourceLinkSchema.describe(
|
|
6100
6478
|
"Resource link to the referenced experience fragment"
|
|
6101
6479
|
)
|
|
6102
6480
|
});
|
|
6103
|
-
var SlotNodeSchema =
|
|
6104
|
-
id:
|
|
6105
|
-
nodeType:
|
|
6106
|
-
slotId:
|
|
6481
|
+
var SlotNodeSchema = z88.object({
|
|
6482
|
+
id: z88.string().describe("Node identifier"),
|
|
6483
|
+
nodeType: z88.literal("Slot").describe('Must be "Slot"'),
|
|
6484
|
+
slotId: z88.string().describe("ID of the slot definition to render")
|
|
6107
6485
|
});
|
|
6108
|
-
var TreeNodeSchema =
|
|
6109
|
-
() =>
|
|
6486
|
+
var TreeNodeSchema = z88.lazy(
|
|
6487
|
+
() => z88.union([ComponentNodeSchema, ExperienceFragmentNodeSchema, SlotNodeSchema])
|
|
6110
6488
|
);
|
|
6111
|
-
var ComponentNodeSchema =
|
|
6112
|
-
() =>
|
|
6113
|
-
id:
|
|
6114
|
-
name:
|
|
6115
|
-
nodeType:
|
|
6489
|
+
var ComponentNodeSchema = z88.lazy(
|
|
6490
|
+
() => z88.object({
|
|
6491
|
+
id: z88.string().describe("Node identifier"),
|
|
6492
|
+
name: z88.string().optional().describe("Optional display name"),
|
|
6493
|
+
nodeType: z88.literal("Component").describe('Must be "Component"'),
|
|
6116
6494
|
component: ComponentResourceLinkSchema.describe(
|
|
6117
6495
|
"Resource link to the component to render"
|
|
6118
6496
|
),
|
|
6119
|
-
contentProperties:
|
|
6120
|
-
|
|
6121
|
-
|
|
6497
|
+
contentProperties: z88.union([
|
|
6498
|
+
z88.record(z88.string(), z88.unknown()),
|
|
6499
|
+
z88.string().describe('"$contentProperties/..." pointer')
|
|
6122
6500
|
]).describe(
|
|
6123
6501
|
'Content property bindings \u2014 values or "$contentProperties/..." pointers'
|
|
6124
6502
|
),
|
|
6125
|
-
designProperties:
|
|
6503
|
+
designProperties: z88.record(z88.string(), ComponentTreeDesignPropertyValueSchema).describe(
|
|
6126
6504
|
'Design property values \u2014 ManualDesignValue, DesignTokenValue, or "$designProperties/..." pointers'
|
|
6127
6505
|
),
|
|
6128
|
-
slots:
|
|
6506
|
+
slots: z88.record(z88.string(), z88.array(TreeNodeSchema)).describe("Child tree nodes keyed by slot ID")
|
|
6129
6507
|
})
|
|
6130
6508
|
);
|
|
6131
6509
|
var TagLinkSchema = linkSchema2("Tag");
|
|
6132
6510
|
var ConceptLinkSchema = linkSchema2("TaxonomyConcept");
|
|
6133
|
-
var ExoMetadataSchema =
|
|
6134
|
-
tags:
|
|
6135
|
-
concepts:
|
|
6511
|
+
var ExoMetadataSchema = z88.object({
|
|
6512
|
+
tags: z88.array(TagLinkSchema).optional().describe("Tags attached to this entity"),
|
|
6513
|
+
concepts: z88.array(ConceptLinkSchema).optional().describe("Taxonomy concepts attached to this entity")
|
|
6136
6514
|
});
|
|
6137
6515
|
var ExperienceMetadataSchema = ExoMetadataSchema.extend({
|
|
6138
|
-
name:
|
|
6516
|
+
name: z88.string().optional().describe("Variant label for this metadata entry")
|
|
6139
6517
|
});
|
|
6140
6518
|
var DataAssemblyResourceLinkSchema = resourceLinkSchema2(
|
|
6141
6519
|
"Contentful:DataAssembly"
|
|
6142
6520
|
);
|
|
6143
|
-
var ExperienceContentBindingsSchema =
|
|
6521
|
+
var ExperienceContentBindingsSchema = z88.object({
|
|
6144
6522
|
sys: DataAssemblyResourceLinkSchema.shape.sys,
|
|
6145
|
-
parameters:
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
sys:
|
|
6149
|
-
type:
|
|
6150
|
-
linkType:
|
|
6151
|
-
urn:
|
|
6523
|
+
parameters: z88.record(
|
|
6524
|
+
z88.string(),
|
|
6525
|
+
z88.object({
|
|
6526
|
+
sys: z88.object({
|
|
6527
|
+
type: z88.literal("ResourceLink"),
|
|
6528
|
+
linkType: z88.string(),
|
|
6529
|
+
urn: z88.string()
|
|
6152
6530
|
})
|
|
6153
6531
|
})
|
|
6154
6532
|
).describe("Parameter bindings keyed by parameter ID")
|
|
6155
6533
|
});
|
|
6156
|
-
var InlineExperienceFragmentNodeSchema =
|
|
6157
|
-
() =>
|
|
6158
|
-
id:
|
|
6159
|
-
nodeType:
|
|
6534
|
+
var InlineExperienceFragmentNodeSchema = z88.lazy(
|
|
6535
|
+
() => z88.object({
|
|
6536
|
+
id: z88.string().describe("Node identifier"),
|
|
6537
|
+
nodeType: z88.literal("InlineExperienceFragment").describe('Must be "InlineExperienceFragment"'),
|
|
6160
6538
|
component: ComponentResourceLinkSchema.describe(
|
|
6161
6539
|
"Resource link to the component this inline experience fragment renders"
|
|
6162
6540
|
),
|
|
6163
|
-
designProperties:
|
|
6541
|
+
designProperties: z88.record(z88.string(), DimensionedDesignPropertyValueSchema).describe("Design property values for this inline experience fragment"),
|
|
6164
6542
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6165
6543
|
"Optional content bindings linking this inline experience fragment to a data assembly"
|
|
6166
6544
|
),
|
|
6167
|
-
slots:
|
|
6545
|
+
slots: z88.record(z88.string(), z88.array(ExperienceSlotNodeSchema)).optional().describe("Child slot contents keyed by slot ID")
|
|
6168
6546
|
})
|
|
6169
6547
|
);
|
|
6170
|
-
var ExperienceSlotNodeSchema =
|
|
6171
|
-
() =>
|
|
6548
|
+
var ExperienceSlotNodeSchema = z88.lazy(
|
|
6549
|
+
() => z88.union([ExperienceFragmentNodeSchema, InlineExperienceFragmentNodeSchema])
|
|
6172
6550
|
);
|
|
6173
6551
|
|
|
6174
6552
|
// src/tools/exo/components/createComponent.ts
|
|
6175
6553
|
var CreateComponentToolParams = BaseToolSchema.extend({
|
|
6176
|
-
name:
|
|
6177
|
-
description:
|
|
6178
|
-
viewports:
|
|
6179
|
-
contentProperties:
|
|
6180
|
-
designProperties:
|
|
6181
|
-
componentTree:
|
|
6182
|
-
slots:
|
|
6554
|
+
name: z89.string().describe("The name of the component"),
|
|
6555
|
+
description: z89.string().describe("Description of the component"),
|
|
6556
|
+
viewports: z89.array(ViewportSchema).describe("Viewport definitions for the component (may be empty)"),
|
|
6557
|
+
contentProperties: z89.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
6558
|
+
designProperties: z89.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
6559
|
+
componentTree: z89.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
6560
|
+
slots: z89.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6183
6561
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6184
6562
|
"Optional ExO metadata (tags, concepts)"
|
|
6185
6563
|
)
|
|
@@ -6190,7 +6568,7 @@ function createComponentTool(config) {
|
|
|
6190
6568
|
args.environmentId,
|
|
6191
6569
|
config.protectedEnvironments
|
|
6192
6570
|
);
|
|
6193
|
-
const contentfulClient =
|
|
6571
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6194
6572
|
const component = await contentfulClient.component.create(
|
|
6195
6573
|
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
6196
6574
|
{
|
|
@@ -6212,19 +6590,19 @@ function createComponentTool(config) {
|
|
|
6212
6590
|
}
|
|
6213
6591
|
|
|
6214
6592
|
// src/tools/exo/components/upsertComponent.ts
|
|
6215
|
-
import { z as
|
|
6593
|
+
import { z as z90 } from "zod";
|
|
6216
6594
|
var UpsertComponentToolParams = BaseToolSchema.extend({
|
|
6217
|
-
componentId:
|
|
6218
|
-
version:
|
|
6595
|
+
componentId: z90.string().describe("The ID of the component to update"),
|
|
6596
|
+
version: z90.number().describe(
|
|
6219
6597
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The update is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6220
6598
|
),
|
|
6221
|
-
name:
|
|
6222
|
-
description:
|
|
6223
|
-
viewports:
|
|
6224
|
-
contentProperties:
|
|
6225
|
-
designProperties:
|
|
6226
|
-
componentTree:
|
|
6227
|
-
slots:
|
|
6599
|
+
name: z90.string().optional().describe("The name of the component"),
|
|
6600
|
+
description: z90.string().optional().describe("Description of the component"),
|
|
6601
|
+
viewports: z90.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6602
|
+
contentProperties: z90.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
6603
|
+
designProperties: z90.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
6604
|
+
componentTree: z90.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
6605
|
+
slots: z90.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6228
6606
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6229
6607
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6230
6608
|
)
|
|
@@ -6240,7 +6618,7 @@ function upsertComponentTool(config) {
|
|
|
6240
6618
|
environmentId: args.environmentId,
|
|
6241
6619
|
componentId: args.componentId
|
|
6242
6620
|
};
|
|
6243
|
-
const contentfulClient =
|
|
6621
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6244
6622
|
const current = await contentfulClient.component.get(params);
|
|
6245
6623
|
if (args.version !== current.sys.version) {
|
|
6246
6624
|
throw new Error(
|
|
@@ -6271,13 +6649,13 @@ function upsertComponentTool(config) {
|
|
|
6271
6649
|
}
|
|
6272
6650
|
|
|
6273
6651
|
// src/tools/exo/components/deleteComponent.ts
|
|
6274
|
-
import { z as
|
|
6652
|
+
import { z as z91 } from "zod";
|
|
6275
6653
|
var DeleteComponentToolParams = BaseToolSchema.extend({
|
|
6276
|
-
componentId:
|
|
6277
|
-
confirm:
|
|
6654
|
+
componentId: z91.string().describe("The ID of the component to delete"),
|
|
6655
|
+
confirm: z91.boolean().optional().describe(
|
|
6278
6656
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6279
6657
|
),
|
|
6280
|
-
confirmToken:
|
|
6658
|
+
confirmToken: z91.string().optional().describe(
|
|
6281
6659
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6282
6660
|
)
|
|
6283
6661
|
});
|
|
@@ -6292,7 +6670,7 @@ function deleteComponentTool(config) {
|
|
|
6292
6670
|
environmentId: args.environmentId,
|
|
6293
6671
|
componentId: args.componentId
|
|
6294
6672
|
};
|
|
6295
|
-
const contentfulClient =
|
|
6673
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6296
6674
|
const component = await contentfulClient.component.get(params);
|
|
6297
6675
|
const expectedToken = buildConfirmToken(
|
|
6298
6676
|
"component",
|
|
@@ -6319,10 +6697,10 @@ function deleteComponentTool(config) {
|
|
|
6319
6697
|
}
|
|
6320
6698
|
|
|
6321
6699
|
// src/tools/exo/components/publishComponent.ts
|
|
6322
|
-
import { z as
|
|
6700
|
+
import { z as z92 } from "zod";
|
|
6323
6701
|
var PublishComponentToolParams = BaseToolSchema.extend({
|
|
6324
|
-
componentId:
|
|
6325
|
-
version:
|
|
6702
|
+
componentId: z92.string().describe("The ID of the component to publish"),
|
|
6703
|
+
version: z92.number().describe(
|
|
6326
6704
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The publish is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6327
6705
|
)
|
|
6328
6706
|
});
|
|
@@ -6337,7 +6715,7 @@ function publishComponentTool(config) {
|
|
|
6337
6715
|
environmentId: args.environmentId,
|
|
6338
6716
|
componentId: args.componentId
|
|
6339
6717
|
};
|
|
6340
|
-
const contentfulClient =
|
|
6718
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6341
6719
|
const current = await contentfulClient.component.get(params);
|
|
6342
6720
|
if (args.version !== current.sys.version) {
|
|
6343
6721
|
throw new Error(
|
|
@@ -6356,10 +6734,10 @@ function publishComponentTool(config) {
|
|
|
6356
6734
|
}
|
|
6357
6735
|
|
|
6358
6736
|
// src/tools/exo/components/unpublishComponent.ts
|
|
6359
|
-
import { z as
|
|
6737
|
+
import { z as z93 } from "zod";
|
|
6360
6738
|
var UnpublishComponentToolParams = BaseToolSchema.extend({
|
|
6361
|
-
componentId:
|
|
6362
|
-
version:
|
|
6739
|
+
componentId: z93.string().describe("The ID of the component to unpublish"),
|
|
6740
|
+
version: z93.number().describe(
|
|
6363
6741
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6364
6742
|
)
|
|
6365
6743
|
});
|
|
@@ -6374,7 +6752,7 @@ function unpublishComponentTool(config) {
|
|
|
6374
6752
|
environmentId: args.environmentId,
|
|
6375
6753
|
componentId: args.componentId
|
|
6376
6754
|
};
|
|
6377
|
-
const contentfulClient =
|
|
6755
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6378
6756
|
const current = await contentfulClient.component.get(params);
|
|
6379
6757
|
if (args.version !== current.sys.version) {
|
|
6380
6758
|
throw new Error(
|
|
@@ -6488,13 +6866,13 @@ function createComponentTools(config) {
|
|
|
6488
6866
|
}
|
|
6489
6867
|
|
|
6490
6868
|
// src/tools/exo/experience-fragments/getExperienceFragment.ts
|
|
6491
|
-
import { z as
|
|
6869
|
+
import { z as z94 } from "zod";
|
|
6492
6870
|
var GetExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6493
|
-
experienceFragmentId:
|
|
6871
|
+
experienceFragmentId: z94.string().describe("The ID of the experience fragment to retrieve details for")
|
|
6494
6872
|
});
|
|
6495
6873
|
function getExperienceFragmentTool(config) {
|
|
6496
6874
|
async function tool2(args) {
|
|
6497
|
-
const contentfulClient =
|
|
6875
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6498
6876
|
const experienceFragment = await contentfulClient.experienceFragment.get({
|
|
6499
6877
|
spaceId: args.spaceId,
|
|
6500
6878
|
environmentId: args.environmentId,
|
|
@@ -6508,16 +6886,16 @@ function getExperienceFragmentTool(config) {
|
|
|
6508
6886
|
}
|
|
6509
6887
|
|
|
6510
6888
|
// src/tools/exo/experience-fragments/listExperienceFragments.ts
|
|
6511
|
-
import { z as
|
|
6889
|
+
import { z as z95 } from "zod";
|
|
6512
6890
|
var ListExperienceFragmentsToolParams = BaseToolSchema.extend({
|
|
6513
|
-
limit:
|
|
6514
|
-
pageNext:
|
|
6515
|
-
pagePrev:
|
|
6516
|
-
order:
|
|
6891
|
+
limit: z95.number().optional().describe("Maximum number of experience fragments to return (max 10)"),
|
|
6892
|
+
pageNext: z95.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6893
|
+
pagePrev: z95.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6894
|
+
order: z95.string().optional().describe("Order experience fragments by this field (e.g. sys.createdAt)")
|
|
6517
6895
|
});
|
|
6518
6896
|
function listExperienceFragmentsTool(config) {
|
|
6519
6897
|
async function tool2(args) {
|
|
6520
|
-
const contentfulClient =
|
|
6898
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6521
6899
|
const experienceFragments = await contentfulClient.experienceFragment.getMany({
|
|
6522
6900
|
spaceId: args.spaceId,
|
|
6523
6901
|
environmentId: args.environmentId,
|
|
@@ -6543,21 +6921,21 @@ function listExperienceFragmentsTool(config) {
|
|
|
6543
6921
|
}
|
|
6544
6922
|
|
|
6545
6923
|
// src/tools/exo/experience-fragments/createExperienceFragment.ts
|
|
6546
|
-
import { z as
|
|
6924
|
+
import { z as z96 } from "zod";
|
|
6547
6925
|
var CreateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6548
|
-
name:
|
|
6549
|
-
description:
|
|
6926
|
+
name: z96.string().describe("The name of the experience fragment"),
|
|
6927
|
+
description: z96.string().describe("Description of the experience fragment"),
|
|
6550
6928
|
component: ComponentResourceLinkSchema.describe(
|
|
6551
6929
|
"Resource link to the component this experience fragment is based on"
|
|
6552
6930
|
),
|
|
6553
|
-
viewports:
|
|
6554
|
-
designProperties:
|
|
6931
|
+
viewports: z96.array(ViewportSchema).describe("Viewport definitions (may be empty)"),
|
|
6932
|
+
designProperties: z96.record(z96.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
6555
6933
|
"Design property values keyed by property ID (may be empty object)"
|
|
6556
6934
|
),
|
|
6557
6935
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6558
6936
|
"Optional content bindings for the experience fragment"
|
|
6559
6937
|
),
|
|
6560
|
-
slots:
|
|
6938
|
+
slots: z96.record(z96.string(), z96.array(ExperienceSlotNodeSchema)).optional().describe("Optional slot node definitions keyed by slot ID"),
|
|
6561
6939
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6562
6940
|
"Optional ExO metadata (tags, concepts)"
|
|
6563
6941
|
)
|
|
@@ -6568,7 +6946,7 @@ function createExperienceFragmentTool(config) {
|
|
|
6568
6946
|
args.environmentId,
|
|
6569
6947
|
config.protectedEnvironments
|
|
6570
6948
|
);
|
|
6571
|
-
const contentfulClient =
|
|
6949
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6572
6950
|
const experienceFragment = await contentfulClient.experienceFragment.create(
|
|
6573
6951
|
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
6574
6952
|
{
|
|
@@ -6590,20 +6968,20 @@ function createExperienceFragmentTool(config) {
|
|
|
6590
6968
|
}
|
|
6591
6969
|
|
|
6592
6970
|
// src/tools/exo/experience-fragments/updateExperienceFragment.ts
|
|
6593
|
-
import { z as
|
|
6971
|
+
import { z as z97 } from "zod";
|
|
6594
6972
|
var UpdateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6595
|
-
experienceFragmentId:
|
|
6596
|
-
version:
|
|
6973
|
+
experienceFragmentId: z97.string().describe("The ID of the experience fragment to update"),
|
|
6974
|
+
version: z97.number().describe(
|
|
6597
6975
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The update is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
6598
6976
|
),
|
|
6599
|
-
name:
|
|
6600
|
-
description:
|
|
6601
|
-
viewports:
|
|
6602
|
-
designProperties:
|
|
6977
|
+
name: z97.string().optional().describe("The name of the experience fragment"),
|
|
6978
|
+
description: z97.string().optional().describe("Description of the experience fragment"),
|
|
6979
|
+
viewports: z97.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6980
|
+
designProperties: z97.record(z97.string(), DimensionedDesignPropertyValueSchema).optional().describe("Design property values; replaces existing if provided"),
|
|
6603
6981
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6604
6982
|
"Content bindings; replaces existing if provided"
|
|
6605
6983
|
),
|
|
6606
|
-
slots:
|
|
6984
|
+
slots: z97.record(z97.string(), z97.array(ExperienceSlotNodeSchema)).optional().describe("Slot node definitions; replaces existing if provided"),
|
|
6607
6985
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6608
6986
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6609
6987
|
)
|
|
@@ -6619,7 +6997,7 @@ function updateExperienceFragmentTool(config) {
|
|
|
6619
6997
|
environmentId: args.environmentId,
|
|
6620
6998
|
experienceFragmentId: args.experienceFragmentId
|
|
6621
6999
|
};
|
|
6622
|
-
const contentfulClient =
|
|
7000
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6623
7001
|
const current = await contentfulClient.experienceFragment.get(params);
|
|
6624
7002
|
if (args.version !== current.sys.version) {
|
|
6625
7003
|
throw new Error(
|
|
@@ -6651,13 +7029,13 @@ function updateExperienceFragmentTool(config) {
|
|
|
6651
7029
|
}
|
|
6652
7030
|
|
|
6653
7031
|
// src/tools/exo/experience-fragments/deleteExperienceFragment.ts
|
|
6654
|
-
import { z as
|
|
7032
|
+
import { z as z98 } from "zod";
|
|
6655
7033
|
var DeleteExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6656
|
-
experienceFragmentId:
|
|
6657
|
-
confirm:
|
|
7034
|
+
experienceFragmentId: z98.string().describe("The ID of the experience fragment to delete"),
|
|
7035
|
+
confirm: z98.boolean().optional().describe(
|
|
6658
7036
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6659
7037
|
),
|
|
6660
|
-
confirmToken:
|
|
7038
|
+
confirmToken: z98.string().optional().describe(
|
|
6661
7039
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6662
7040
|
)
|
|
6663
7041
|
});
|
|
@@ -6672,7 +7050,7 @@ function deleteExperienceFragmentTool(config) {
|
|
|
6672
7050
|
environmentId: args.environmentId,
|
|
6673
7051
|
experienceFragmentId: args.experienceFragmentId
|
|
6674
7052
|
};
|
|
6675
|
-
const contentfulClient =
|
|
7053
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6676
7054
|
const experienceFragment = await contentfulClient.experienceFragment.get(params);
|
|
6677
7055
|
const expectedToken = buildConfirmToken(
|
|
6678
7056
|
"experienceFragment",
|
|
@@ -6699,10 +7077,10 @@ function deleteExperienceFragmentTool(config) {
|
|
|
6699
7077
|
}
|
|
6700
7078
|
|
|
6701
7079
|
// src/tools/exo/experience-fragments/publishExperienceFragment.ts
|
|
6702
|
-
import { z as
|
|
7080
|
+
import { z as z99 } from "zod";
|
|
6703
7081
|
var PublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6704
|
-
experienceFragmentId:
|
|
6705
|
-
version:
|
|
7082
|
+
experienceFragmentId: z99.string().describe("The ID of the experience fragment to publish"),
|
|
7083
|
+
version: z99.number().describe(
|
|
6706
7084
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
6707
7085
|
)
|
|
6708
7086
|
});
|
|
@@ -6717,7 +7095,7 @@ function publishExperienceFragmentTool(config) {
|
|
|
6717
7095
|
environmentId: args.environmentId,
|
|
6718
7096
|
experienceFragmentId: args.experienceFragmentId
|
|
6719
7097
|
};
|
|
6720
|
-
const contentfulClient =
|
|
7098
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6721
7099
|
const current = await contentfulClient.experienceFragment.get(params);
|
|
6722
7100
|
if (args.version !== current.sys.version) {
|
|
6723
7101
|
throw new Error(
|
|
@@ -6736,10 +7114,10 @@ function publishExperienceFragmentTool(config) {
|
|
|
6736
7114
|
}
|
|
6737
7115
|
|
|
6738
7116
|
// src/tools/exo/experience-fragments/unpublishExperienceFragment.ts
|
|
6739
|
-
import { z as
|
|
7117
|
+
import { z as z100 } from "zod";
|
|
6740
7118
|
var UnpublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6741
|
-
experienceFragmentId:
|
|
6742
|
-
version:
|
|
7119
|
+
experienceFragmentId: z100.string().describe("The ID of the experience fragment to unpublish"),
|
|
7120
|
+
version: z100.number().describe(
|
|
6743
7121
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
6744
7122
|
)
|
|
6745
7123
|
});
|
|
@@ -6754,7 +7132,7 @@ function unpublishExperienceFragmentTool(config) {
|
|
|
6754
7132
|
environmentId: args.environmentId,
|
|
6755
7133
|
experienceFragmentId: args.experienceFragmentId
|
|
6756
7134
|
};
|
|
6757
|
-
const contentfulClient =
|
|
7135
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6758
7136
|
const current = await contentfulClient.experienceFragment.get(params);
|
|
6759
7137
|
if (args.version !== current.sys.version) {
|
|
6760
7138
|
throw new Error(
|
|
@@ -6871,13 +7249,13 @@ function createExperienceFragmentTools(config) {
|
|
|
6871
7249
|
}
|
|
6872
7250
|
|
|
6873
7251
|
// src/tools/exo/experience-templates/getExperienceTemplate.ts
|
|
6874
|
-
import { z as
|
|
7252
|
+
import { z as z101 } from "zod";
|
|
6875
7253
|
var GetExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6876
|
-
experienceTemplateId:
|
|
7254
|
+
experienceTemplateId: z101.string().describe("The ID of the experience template to retrieve details for")
|
|
6877
7255
|
});
|
|
6878
7256
|
function getExperienceTemplateTool(config) {
|
|
6879
7257
|
async function tool2(args) {
|
|
6880
|
-
const contentfulClient =
|
|
7258
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6881
7259
|
const experienceTemplate = await contentfulClient.experienceTemplate.get({
|
|
6882
7260
|
spaceId: args.spaceId,
|
|
6883
7261
|
environmentId: args.environmentId,
|
|
@@ -6891,16 +7269,16 @@ function getExperienceTemplateTool(config) {
|
|
|
6891
7269
|
}
|
|
6892
7270
|
|
|
6893
7271
|
// src/tools/exo/experience-templates/listExperienceTemplates.ts
|
|
6894
|
-
import { z as
|
|
7272
|
+
import { z as z102 } from "zod";
|
|
6895
7273
|
var ListExperienceTemplatesToolParams = BaseToolSchema.extend({
|
|
6896
|
-
limit:
|
|
6897
|
-
pageNext:
|
|
6898
|
-
pagePrev:
|
|
6899
|
-
order:
|
|
7274
|
+
limit: z102.number().optional().describe("Maximum number of experience templates to return (max 10)"),
|
|
7275
|
+
pageNext: z102.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7276
|
+
pagePrev: z102.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7277
|
+
order: z102.string().optional().describe("Order experience templates by this field (e.g. sys.createdAt)")
|
|
6900
7278
|
});
|
|
6901
7279
|
function listExperienceTemplatesTool(config) {
|
|
6902
7280
|
async function tool2(args) {
|
|
6903
|
-
const contentfulClient =
|
|
7281
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6904
7282
|
const experienceTemplates = await contentfulClient.experienceTemplate.getMany({
|
|
6905
7283
|
spaceId: args.spaceId,
|
|
6906
7284
|
environmentId: args.environmentId,
|
|
@@ -6926,17 +7304,17 @@ function listExperienceTemplatesTool(config) {
|
|
|
6926
7304
|
}
|
|
6927
7305
|
|
|
6928
7306
|
// src/tools/exo/experience-templates/createExperienceTemplate.ts
|
|
6929
|
-
import { z as
|
|
7307
|
+
import { z as z103 } from "zod";
|
|
6930
7308
|
var CreateExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6931
|
-
name:
|
|
6932
|
-
description:
|
|
6933
|
-
viewports:
|
|
7309
|
+
name: z103.string().describe("The name of the experience template"),
|
|
7310
|
+
description: z103.string().describe("Description of the experience template"),
|
|
7311
|
+
viewports: z103.array(ViewportSchema).describe(
|
|
6934
7312
|
"Viewport definitions for the experience template (may be empty)"
|
|
6935
7313
|
),
|
|
6936
|
-
contentProperties:
|
|
6937
|
-
designProperties:
|
|
6938
|
-
componentTree:
|
|
6939
|
-
slots:
|
|
7314
|
+
contentProperties: z103.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
7315
|
+
designProperties: z103.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
7316
|
+
componentTree: z103.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
7317
|
+
slots: z103.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6940
7318
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6941
7319
|
"Optional ExO metadata (tags, concepts)"
|
|
6942
7320
|
)
|
|
@@ -6947,7 +7325,7 @@ function createExperienceTemplateTool(config) {
|
|
|
6947
7325
|
args.environmentId,
|
|
6948
7326
|
config.protectedEnvironments
|
|
6949
7327
|
);
|
|
6950
|
-
const contentfulClient =
|
|
7328
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
6951
7329
|
const experienceTemplate = await contentfulClient.experienceTemplate.create(
|
|
6952
7330
|
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
6953
7331
|
{
|
|
@@ -6969,19 +7347,19 @@ function createExperienceTemplateTool(config) {
|
|
|
6969
7347
|
}
|
|
6970
7348
|
|
|
6971
7349
|
// src/tools/exo/experience-templates/upsertExperienceTemplate.ts
|
|
6972
|
-
import { z as
|
|
7350
|
+
import { z as z104 } from "zod";
|
|
6973
7351
|
var UpsertExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6974
|
-
experienceTemplateId:
|
|
6975
|
-
version:
|
|
7352
|
+
experienceTemplateId: z104.string().describe("The ID of the experience template to update"),
|
|
7353
|
+
version: z104.number().describe(
|
|
6976
7354
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The update is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
6977
7355
|
),
|
|
6978
|
-
name:
|
|
6979
|
-
description:
|
|
6980
|
-
viewports:
|
|
6981
|
-
contentProperties:
|
|
6982
|
-
designProperties:
|
|
6983
|
-
componentTree:
|
|
6984
|
-
slots:
|
|
7356
|
+
name: z104.string().optional().describe("The name of the experience template"),
|
|
7357
|
+
description: z104.string().optional().describe("Description of the experience template"),
|
|
7358
|
+
viewports: z104.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7359
|
+
contentProperties: z104.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
7360
|
+
designProperties: z104.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
7361
|
+
componentTree: z104.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
7362
|
+
slots: z104.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6985
7363
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6986
7364
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6987
7365
|
)
|
|
@@ -6997,7 +7375,7 @@ function upsertExperienceTemplateTool(config) {
|
|
|
6997
7375
|
environmentId: args.environmentId,
|
|
6998
7376
|
experienceTemplateId: args.experienceTemplateId
|
|
6999
7377
|
};
|
|
7000
|
-
const contentfulClient =
|
|
7378
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7001
7379
|
const current = await contentfulClient.experienceTemplate.get(params);
|
|
7002
7380
|
if (args.version !== current.sys.version) {
|
|
7003
7381
|
throw new Error(
|
|
@@ -7031,13 +7409,13 @@ function upsertExperienceTemplateTool(config) {
|
|
|
7031
7409
|
}
|
|
7032
7410
|
|
|
7033
7411
|
// src/tools/exo/experience-templates/deleteExperienceTemplate.ts
|
|
7034
|
-
import { z as
|
|
7412
|
+
import { z as z105 } from "zod";
|
|
7035
7413
|
var DeleteExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7036
|
-
experienceTemplateId:
|
|
7037
|
-
confirm:
|
|
7414
|
+
experienceTemplateId: z105.string().describe("The ID of the experience template to delete"),
|
|
7415
|
+
confirm: z105.boolean().optional().describe(
|
|
7038
7416
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7039
7417
|
),
|
|
7040
|
-
confirmToken:
|
|
7418
|
+
confirmToken: z105.string().optional().describe(
|
|
7041
7419
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7042
7420
|
)
|
|
7043
7421
|
});
|
|
@@ -7052,7 +7430,7 @@ function deleteExperienceTemplateTool(config) {
|
|
|
7052
7430
|
environmentId: args.environmentId,
|
|
7053
7431
|
experienceTemplateId: args.experienceTemplateId
|
|
7054
7432
|
};
|
|
7055
|
-
const contentfulClient =
|
|
7433
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7056
7434
|
const experienceTemplate = await contentfulClient.experienceTemplate.get(params);
|
|
7057
7435
|
const expectedToken = buildConfirmToken(
|
|
7058
7436
|
"experienceTemplate",
|
|
@@ -7079,10 +7457,10 @@ function deleteExperienceTemplateTool(config) {
|
|
|
7079
7457
|
}
|
|
7080
7458
|
|
|
7081
7459
|
// src/tools/exo/experience-templates/publishExperienceTemplate.ts
|
|
7082
|
-
import { z as
|
|
7460
|
+
import { z as z106 } from "zod";
|
|
7083
7461
|
var PublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7084
|
-
experienceTemplateId:
|
|
7085
|
-
version:
|
|
7462
|
+
experienceTemplateId: z106.string().describe("The ID of the experience template to publish"),
|
|
7463
|
+
version: z106.number().describe(
|
|
7086
7464
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
7087
7465
|
)
|
|
7088
7466
|
});
|
|
@@ -7097,7 +7475,7 @@ function publishExperienceTemplateTool(config) {
|
|
|
7097
7475
|
environmentId: args.environmentId,
|
|
7098
7476
|
experienceTemplateId: args.experienceTemplateId
|
|
7099
7477
|
};
|
|
7100
|
-
const contentfulClient =
|
|
7478
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7101
7479
|
const current = await contentfulClient.experienceTemplate.get(params);
|
|
7102
7480
|
if (args.version !== current.sys.version) {
|
|
7103
7481
|
throw new Error(
|
|
@@ -7116,10 +7494,10 @@ function publishExperienceTemplateTool(config) {
|
|
|
7116
7494
|
}
|
|
7117
7495
|
|
|
7118
7496
|
// src/tools/exo/experience-templates/unpublishExperienceTemplate.ts
|
|
7119
|
-
import { z as
|
|
7497
|
+
import { z as z107 } from "zod";
|
|
7120
7498
|
var UnpublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7121
|
-
experienceTemplateId:
|
|
7122
|
-
version:
|
|
7499
|
+
experienceTemplateId: z107.string().describe("The ID of the experience template to unpublish"),
|
|
7500
|
+
version: z107.number().describe(
|
|
7123
7501
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
7124
7502
|
)
|
|
7125
7503
|
});
|
|
@@ -7134,7 +7512,7 @@ function unpublishExperienceTemplateTool(config) {
|
|
|
7134
7512
|
environmentId: args.environmentId,
|
|
7135
7513
|
experienceTemplateId: args.experienceTemplateId
|
|
7136
7514
|
};
|
|
7137
|
-
const contentfulClient =
|
|
7515
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7138
7516
|
const current = await contentfulClient.experienceTemplate.get(params);
|
|
7139
7517
|
if (args.version !== current.sys.version) {
|
|
7140
7518
|
throw new Error(
|
|
@@ -7251,13 +7629,13 @@ function createExperienceTemplateTools(config) {
|
|
|
7251
7629
|
}
|
|
7252
7630
|
|
|
7253
7631
|
// src/tools/exo/experiences/getExperience.ts
|
|
7254
|
-
import { z as
|
|
7632
|
+
import { z as z108 } from "zod";
|
|
7255
7633
|
var GetExperienceToolParams = BaseToolSchema.extend({
|
|
7256
|
-
experienceId:
|
|
7634
|
+
experienceId: z108.string().describe("The ID of the experience to retrieve")
|
|
7257
7635
|
});
|
|
7258
7636
|
function getExperienceTool(config) {
|
|
7259
7637
|
async function tool2(args) {
|
|
7260
|
-
const contentfulClient =
|
|
7638
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7261
7639
|
const experience = await contentfulClient.experience.get({
|
|
7262
7640
|
spaceId: args.spaceId,
|
|
7263
7641
|
environmentId: args.environmentId,
|
|
@@ -7271,16 +7649,16 @@ function getExperienceTool(config) {
|
|
|
7271
7649
|
}
|
|
7272
7650
|
|
|
7273
7651
|
// src/tools/exo/experiences/listExperiences.ts
|
|
7274
|
-
import { z as
|
|
7652
|
+
import { z as z109 } from "zod";
|
|
7275
7653
|
var ListExperiencesToolParams = BaseToolSchema.extend({
|
|
7276
|
-
limit:
|
|
7277
|
-
pageNext:
|
|
7278
|
-
pagePrev:
|
|
7279
|
-
order:
|
|
7654
|
+
limit: z109.number().optional().describe("Maximum number of experiences to return (max 10)"),
|
|
7655
|
+
pageNext: z109.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7656
|
+
pagePrev: z109.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7657
|
+
order: z109.string().optional().describe("Order experiences by this field (e.g. sys.createdAt)")
|
|
7280
7658
|
});
|
|
7281
7659
|
function listExperiencesTool(config) {
|
|
7282
7660
|
async function tool2(args) {
|
|
7283
|
-
const contentfulClient =
|
|
7661
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7284
7662
|
const experiences = await contentfulClient.experience.getMany({
|
|
7285
7663
|
spaceId: args.spaceId,
|
|
7286
7664
|
environmentId: args.environmentId,
|
|
@@ -7306,21 +7684,21 @@ function listExperiencesTool(config) {
|
|
|
7306
7684
|
}
|
|
7307
7685
|
|
|
7308
7686
|
// src/tools/exo/experiences/createExperience.ts
|
|
7309
|
-
import { z as
|
|
7687
|
+
import { z as z110 } from "zod";
|
|
7310
7688
|
var CreateExperienceToolParams = BaseToolSchema.extend({
|
|
7311
|
-
name:
|
|
7312
|
-
description:
|
|
7689
|
+
name: z110.string().describe("The name of the experience"),
|
|
7690
|
+
description: z110.string().describe("Description of the experience"),
|
|
7313
7691
|
experienceTemplate: ExperienceTemplateResourceLinkSchema.describe(
|
|
7314
7692
|
"Resource link to the ExperienceTemplate this experience is backed by"
|
|
7315
7693
|
),
|
|
7316
|
-
viewports:
|
|
7317
|
-
designProperties:
|
|
7694
|
+
viewports: z110.array(ViewportSchema).describe("Viewport definitions for the experience (may be empty)"),
|
|
7695
|
+
designProperties: z110.record(z110.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
7318
7696
|
"Design property values keyed by property ID. Each value is a dimensioned map (viewport ID \u2192 design value). May be an empty object."
|
|
7319
7697
|
),
|
|
7320
7698
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7321
7699
|
"Optional content bindings linking this experience to a data assembly"
|
|
7322
7700
|
),
|
|
7323
|
-
slots:
|
|
7701
|
+
slots: z110.record(z110.string(), z110.array(ExperienceSlotNodeSchema)).optional().describe(
|
|
7324
7702
|
"Optional slot contents keyed by slot ID. Each value is an array of ExperienceFragmentNode or InlineExperienceFragmentNode."
|
|
7325
7703
|
),
|
|
7326
7704
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
@@ -7333,7 +7711,7 @@ function createExperienceTool(config) {
|
|
|
7333
7711
|
args.environmentId,
|
|
7334
7712
|
config.protectedEnvironments
|
|
7335
7713
|
);
|
|
7336
|
-
const contentfulClient =
|
|
7714
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7337
7715
|
const experience = await contentfulClient.experience.create(
|
|
7338
7716
|
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
7339
7717
|
{
|
|
@@ -7355,22 +7733,22 @@ function createExperienceTool(config) {
|
|
|
7355
7733
|
}
|
|
7356
7734
|
|
|
7357
7735
|
// src/tools/exo/experiences/upsertExperience.ts
|
|
7358
|
-
import { z as
|
|
7736
|
+
import { z as z111 } from "zod";
|
|
7359
7737
|
var UpsertExperienceToolParams = BaseToolSchema.extend({
|
|
7360
|
-
experienceId:
|
|
7361
|
-
version:
|
|
7738
|
+
experienceId: z111.string().describe("The ID of the experience to update"),
|
|
7739
|
+
version: z111.number().describe(
|
|
7362
7740
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The update is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7363
7741
|
),
|
|
7364
|
-
name:
|
|
7365
|
-
description:
|
|
7366
|
-
viewports:
|
|
7367
|
-
designProperties:
|
|
7742
|
+
name: z111.string().optional().describe("The name of the experience"),
|
|
7743
|
+
description: z111.string().optional().describe("Description of the experience"),
|
|
7744
|
+
viewports: z111.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7745
|
+
designProperties: z111.record(z111.string(), DimensionedDesignPropertyValueSchema).optional().describe(
|
|
7368
7746
|
"Design property values keyed by property ID; replaces existing if provided"
|
|
7369
7747
|
),
|
|
7370
7748
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7371
7749
|
"Content bindings linking this experience to a data assembly; replaces existing if provided"
|
|
7372
7750
|
),
|
|
7373
|
-
slots:
|
|
7751
|
+
slots: z111.record(z111.string(), z111.array(ExperienceSlotNodeSchema)).optional().describe("Slot contents keyed by slot ID; replaces existing if provided"),
|
|
7374
7752
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
7375
7753
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7376
7754
|
)
|
|
@@ -7386,7 +7764,7 @@ function upsertExperienceTool(config) {
|
|
|
7386
7764
|
environmentId: args.environmentId,
|
|
7387
7765
|
experienceId: args.experienceId
|
|
7388
7766
|
};
|
|
7389
|
-
const contentfulClient =
|
|
7767
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7390
7768
|
const current = await contentfulClient.experience.get(params);
|
|
7391
7769
|
if (args.version !== current.sys.version) {
|
|
7392
7770
|
throw new Error(
|
|
@@ -7415,13 +7793,13 @@ function upsertExperienceTool(config) {
|
|
|
7415
7793
|
}
|
|
7416
7794
|
|
|
7417
7795
|
// src/tools/exo/experiences/deleteExperience.ts
|
|
7418
|
-
import { z as
|
|
7796
|
+
import { z as z112 } from "zod";
|
|
7419
7797
|
var DeleteExperienceToolParams = BaseToolSchema.extend({
|
|
7420
|
-
experienceId:
|
|
7421
|
-
confirm:
|
|
7798
|
+
experienceId: z112.string().describe("The ID of the experience to delete"),
|
|
7799
|
+
confirm: z112.boolean().optional().describe(
|
|
7422
7800
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7423
7801
|
),
|
|
7424
|
-
confirmToken:
|
|
7802
|
+
confirmToken: z112.string().optional().describe(
|
|
7425
7803
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7426
7804
|
)
|
|
7427
7805
|
});
|
|
@@ -7436,7 +7814,7 @@ function deleteExperienceTool(config) {
|
|
|
7436
7814
|
environmentId: args.environmentId,
|
|
7437
7815
|
experienceId: args.experienceId
|
|
7438
7816
|
};
|
|
7439
|
-
const contentfulClient =
|
|
7817
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7440
7818
|
const experience = await contentfulClient.experience.get(params);
|
|
7441
7819
|
const expectedToken = buildConfirmToken(
|
|
7442
7820
|
"experience",
|
|
@@ -7463,10 +7841,10 @@ function deleteExperienceTool(config) {
|
|
|
7463
7841
|
}
|
|
7464
7842
|
|
|
7465
7843
|
// src/tools/exo/experiences/publishExperience.ts
|
|
7466
|
-
import { z as
|
|
7844
|
+
import { z as z113 } from "zod";
|
|
7467
7845
|
var PublishExperienceToolParams = BaseToolSchema.extend({
|
|
7468
|
-
experienceId:
|
|
7469
|
-
version:
|
|
7846
|
+
experienceId: z113.string().describe("The ID of the experience to publish"),
|
|
7847
|
+
version: z113.number().describe(
|
|
7470
7848
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7471
7849
|
)
|
|
7472
7850
|
});
|
|
@@ -7481,7 +7859,7 @@ function publishExperienceTool(config) {
|
|
|
7481
7859
|
environmentId: args.environmentId,
|
|
7482
7860
|
experienceId: args.experienceId
|
|
7483
7861
|
};
|
|
7484
|
-
const contentfulClient =
|
|
7862
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7485
7863
|
const current = await contentfulClient.experience.get(params);
|
|
7486
7864
|
if (args.version !== current.sys.version) {
|
|
7487
7865
|
throw new Error(
|
|
@@ -7500,10 +7878,10 @@ function publishExperienceTool(config) {
|
|
|
7500
7878
|
}
|
|
7501
7879
|
|
|
7502
7880
|
// src/tools/exo/experiences/unpublishExperience.ts
|
|
7503
|
-
import { z as
|
|
7881
|
+
import { z as z114 } from "zod";
|
|
7504
7882
|
var UnpublishExperienceToolParams = BaseToolSchema.extend({
|
|
7505
|
-
experienceId:
|
|
7506
|
-
version:
|
|
7883
|
+
experienceId: z114.string().describe("The ID of the experience to unpublish"),
|
|
7884
|
+
version: z114.number().describe(
|
|
7507
7885
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7508
7886
|
)
|
|
7509
7887
|
});
|
|
@@ -7518,7 +7896,7 @@ function unpublishExperienceTool(config) {
|
|
|
7518
7896
|
environmentId: args.environmentId,
|
|
7519
7897
|
experienceId: args.experienceId
|
|
7520
7898
|
};
|
|
7521
|
-
const contentfulClient =
|
|
7899
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7522
7900
|
const current = await contentfulClient.experience.get(params);
|
|
7523
7901
|
if (args.version !== current.sys.version) {
|
|
7524
7902
|
throw new Error(
|
|
@@ -7632,13 +8010,13 @@ function createExperienceTools(config) {
|
|
|
7632
8010
|
}
|
|
7633
8011
|
|
|
7634
8012
|
// src/tools/exo/data-assemblies/getDataAssembly.ts
|
|
7635
|
-
import { z as
|
|
8013
|
+
import { z as z115 } from "zod";
|
|
7636
8014
|
var GetDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7637
|
-
dataAssemblyId:
|
|
8015
|
+
dataAssemblyId: z115.string().describe("The ID of the data assembly to retrieve")
|
|
7638
8016
|
});
|
|
7639
8017
|
function getDataAssemblyTool(config) {
|
|
7640
8018
|
async function tool2(args) {
|
|
7641
|
-
const contentfulClient =
|
|
8019
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7642
8020
|
const dataAssembly = await contentfulClient.dataAssembly.get({
|
|
7643
8021
|
spaceId: args.spaceId,
|
|
7644
8022
|
environmentId: args.environmentId,
|
|
@@ -7652,13 +8030,13 @@ function getDataAssemblyTool(config) {
|
|
|
7652
8030
|
}
|
|
7653
8031
|
|
|
7654
8032
|
// src/tools/exo/data-assemblies/getPublishedDataAssembly.ts
|
|
7655
|
-
import { z as
|
|
8033
|
+
import { z as z116 } from "zod";
|
|
7656
8034
|
var GetPublishedDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7657
|
-
dataAssemblyId:
|
|
8035
|
+
dataAssemblyId: z116.string().describe("The ID of the published data assembly to retrieve")
|
|
7658
8036
|
});
|
|
7659
8037
|
function getPublishedDataAssemblyTool(config) {
|
|
7660
8038
|
async function tool2(args) {
|
|
7661
|
-
const contentfulClient =
|
|
8039
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7662
8040
|
const dataAssembly = await contentfulClient.dataAssembly.getPublished({
|
|
7663
8041
|
spaceId: args.spaceId,
|
|
7664
8042
|
environmentId: args.environmentId,
|
|
@@ -7672,16 +8050,16 @@ function getPublishedDataAssemblyTool(config) {
|
|
|
7672
8050
|
}
|
|
7673
8051
|
|
|
7674
8052
|
// src/tools/exo/data-assemblies/listDataAssemblies.ts
|
|
7675
|
-
import { z as
|
|
8053
|
+
import { z as z117 } from "zod";
|
|
7676
8054
|
var ListDataAssembliesToolParams = BaseToolSchema.extend({
|
|
7677
|
-
limit:
|
|
7678
|
-
pageNext:
|
|
7679
|
-
pagePrev:
|
|
7680
|
-
sysIdIn:
|
|
8055
|
+
limit: z117.number().optional().describe("Maximum number of data assemblies to return (max 10)"),
|
|
8056
|
+
pageNext: z117.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8057
|
+
pagePrev: z117.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8058
|
+
sysIdIn: z117.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
7681
8059
|
});
|
|
7682
8060
|
function listDataAssembliesTool(config) {
|
|
7683
8061
|
async function tool2(args) {
|
|
7684
|
-
const contentfulClient =
|
|
8062
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7685
8063
|
const dataAssemblies = await contentfulClient.dataAssembly.getMany({
|
|
7686
8064
|
spaceId: args.spaceId,
|
|
7687
8065
|
environmentId: args.environmentId,
|
|
@@ -7706,16 +8084,16 @@ function listDataAssembliesTool(config) {
|
|
|
7706
8084
|
}
|
|
7707
8085
|
|
|
7708
8086
|
// src/tools/exo/data-assemblies/listPublishedDataAssemblies.ts
|
|
7709
|
-
import { z as
|
|
8087
|
+
import { z as z118 } from "zod";
|
|
7710
8088
|
var ListPublishedDataAssembliesToolParams = BaseToolSchema.extend({
|
|
7711
|
-
limit:
|
|
7712
|
-
pageNext:
|
|
7713
|
-
pagePrev:
|
|
7714
|
-
sysIdIn:
|
|
8089
|
+
limit: z118.number().optional().describe("Maximum number of published data assemblies to return (max 10)"),
|
|
8090
|
+
pageNext: z118.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8091
|
+
pagePrev: z118.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8092
|
+
sysIdIn: z118.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
7715
8093
|
});
|
|
7716
8094
|
function listPublishedDataAssembliesTool(config) {
|
|
7717
8095
|
async function tool2(args) {
|
|
7718
|
-
const contentfulClient =
|
|
8096
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7719
8097
|
const dataAssemblies = await contentfulClient.dataAssembly.getManyPublished({
|
|
7720
8098
|
spaceId: args.spaceId,
|
|
7721
8099
|
environmentId: args.environmentId,
|
|
@@ -7740,35 +8118,35 @@ function listPublishedDataAssembliesTool(config) {
|
|
|
7740
8118
|
}
|
|
7741
8119
|
|
|
7742
8120
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
7743
|
-
import { z as
|
|
8121
|
+
import { z as z120 } from "zod";
|
|
7744
8122
|
|
|
7745
8123
|
// src/types/dataAssemblySchemas.ts
|
|
7746
|
-
import { z as
|
|
7747
|
-
var PointerExpressionValueSchema =
|
|
7748
|
-
() =>
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
$from:
|
|
7752
|
-
|
|
7753
|
-
|
|
7754
|
-
source:
|
|
8124
|
+
import { z as z119 } from "zod";
|
|
8125
|
+
var PointerExpressionValueSchema = z119.lazy(
|
|
8126
|
+
() => z119.union([
|
|
8127
|
+
z119.string(),
|
|
8128
|
+
z119.object({
|
|
8129
|
+
$from: z119.union([
|
|
8130
|
+
z119.string(),
|
|
8131
|
+
z119.object({
|
|
8132
|
+
source: z119.string(),
|
|
7755
8133
|
select: PointerExpressionValueSchema.optional()
|
|
7756
8134
|
})
|
|
7757
8135
|
])
|
|
7758
8136
|
}),
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
$on:
|
|
7763
|
-
type:
|
|
8137
|
+
z119.object({ $literal: z119.custom() }),
|
|
8138
|
+
z119.object({ $object: z119.record(z119.string(), PointerExpressionValueSchema) }),
|
|
8139
|
+
z119.object({
|
|
8140
|
+
$on: z119.object({
|
|
8141
|
+
type: z119.record(z119.string(), PointerExpressionValueSchema),
|
|
7764
8142
|
default: PointerExpressionValueSchema.optional()
|
|
7765
8143
|
})
|
|
7766
8144
|
}),
|
|
7767
|
-
|
|
8145
|
+
z119.record(z119.string(), PointerExpressionValueSchema)
|
|
7768
8146
|
])
|
|
7769
8147
|
);
|
|
7770
|
-
var CanonicalDataTypeArmSchema =
|
|
7771
|
-
type:
|
|
8148
|
+
var CanonicalDataTypeArmSchema = z119.object({
|
|
8149
|
+
type: z119.enum([
|
|
7772
8150
|
"String",
|
|
7773
8151
|
"Number",
|
|
7774
8152
|
"Integer",
|
|
@@ -7780,72 +8158,72 @@ var CanonicalDataTypeArmSchema = z117.object({
|
|
|
7780
8158
|
"Literal",
|
|
7781
8159
|
"DiscriminatedUnion"
|
|
7782
8160
|
]),
|
|
7783
|
-
id:
|
|
7784
|
-
name:
|
|
7785
|
-
required:
|
|
7786
|
-
}).catchall(
|
|
7787
|
-
var LegacyDataTypeArmSchema =
|
|
7788
|
-
id:
|
|
7789
|
-
name:
|
|
7790
|
-
type:
|
|
7791
|
-
required:
|
|
7792
|
-
source:
|
|
7793
|
-
ref:
|
|
7794
|
-
});
|
|
7795
|
-
var DataAssemblyDataTypeFieldSchema =
|
|
8161
|
+
id: z119.string().describe("Data type field identifier"),
|
|
8162
|
+
name: z119.string().describe("Human-readable name"),
|
|
8163
|
+
required: z119.boolean().optional()
|
|
8164
|
+
}).catchall(z119.unknown());
|
|
8165
|
+
var LegacyDataTypeArmSchema = z119.object({
|
|
8166
|
+
id: z119.string().describe("Data type field identifier"),
|
|
8167
|
+
name: z119.string().describe("Human-readable name"),
|
|
8168
|
+
type: z119.string(),
|
|
8169
|
+
required: z119.boolean().optional(),
|
|
8170
|
+
source: z119.string().optional(),
|
|
8171
|
+
ref: z119.unknown().optional()
|
|
8172
|
+
});
|
|
8173
|
+
var DataAssemblyDataTypeFieldSchema = z119.union([
|
|
7796
8174
|
CanonicalDataTypeArmSchema,
|
|
7797
8175
|
LegacyDataTypeArmSchema
|
|
7798
8176
|
]);
|
|
7799
8177
|
var SAME_SPACE_CONTENT_SOURCE = "crn:contentful:::content:spaces/$self/environments/$self";
|
|
7800
|
-
var DataAssemblyResourceLinkParameterSchema =
|
|
7801
|
-
name:
|
|
7802
|
-
description:
|
|
7803
|
-
type:
|
|
7804
|
-
linkType:
|
|
7805
|
-
allowedResources:
|
|
7806
|
-
|
|
7807
|
-
type:
|
|
7808
|
-
source:
|
|
7809
|
-
allowedTypes:
|
|
8178
|
+
var DataAssemblyResourceLinkParameterSchema = z119.object({
|
|
8179
|
+
name: z119.string().optional(),
|
|
8180
|
+
description: z119.string().optional(),
|
|
8181
|
+
type: z119.literal("ResourceLink"),
|
|
8182
|
+
linkType: z119.literal("Contentful:Entry"),
|
|
8183
|
+
allowedResources: z119.array(
|
|
8184
|
+
z119.object({
|
|
8185
|
+
type: z119.literal("Contentful:Entry"),
|
|
8186
|
+
source: z119.literal(SAME_SPACE_CONTENT_SOURCE),
|
|
8187
|
+
allowedTypes: z119.array(z119.string())
|
|
7810
8188
|
})
|
|
7811
8189
|
)
|
|
7812
8190
|
});
|
|
7813
|
-
var DataAssemblyParameterConfigSchema =
|
|
7814
|
-
|
|
8191
|
+
var DataAssemblyParameterConfigSchema = z119.record(
|
|
8192
|
+
z119.string(),
|
|
7815
8193
|
DataAssemblyResourceLinkParameterSchema
|
|
7816
8194
|
);
|
|
7817
|
-
var DataAssemblyGraphQLResolverSchema =
|
|
7818
|
-
source:
|
|
7819
|
-
query:
|
|
8195
|
+
var DataAssemblyGraphQLResolverSchema = z119.object({
|
|
8196
|
+
source: z119.literal("Contentful:GraphQL"),
|
|
8197
|
+
query: z119.string().describe("GraphQL query string"),
|
|
7820
8198
|
parameters: PointerExpressionValueSchema.optional()
|
|
7821
8199
|
});
|
|
7822
|
-
var DataAssemblyNestedResolverSchema =
|
|
7823
|
-
source:
|
|
7824
|
-
dataAssembly:
|
|
7825
|
-
sys:
|
|
7826
|
-
type:
|
|
7827
|
-
linkType:
|
|
7828
|
-
urn:
|
|
8200
|
+
var DataAssemblyNestedResolverSchema = z119.object({
|
|
8201
|
+
source: z119.literal("Contentful:DataAssembly"),
|
|
8202
|
+
dataAssembly: z119.object({
|
|
8203
|
+
sys: z119.object({
|
|
8204
|
+
type: z119.literal("ResourceLink"),
|
|
8205
|
+
linkType: z119.literal("Contentful:DataAssembly"),
|
|
8206
|
+
urn: z119.string()
|
|
7829
8207
|
})
|
|
7830
8208
|
}),
|
|
7831
8209
|
parameters: PointerExpressionValueSchema.optional()
|
|
7832
8210
|
});
|
|
7833
|
-
var DataAssemblyResolverDefinitionSchema =
|
|
8211
|
+
var DataAssemblyResolverDefinitionSchema = z119.union([
|
|
7834
8212
|
DataAssemblyGraphQLResolverSchema,
|
|
7835
8213
|
DataAssemblyNestedResolverSchema
|
|
7836
8214
|
]);
|
|
7837
|
-
var DataAssemblyResolverConfigSchema =
|
|
7838
|
-
|
|
8215
|
+
var DataAssemblyResolverConfigSchema = z119.record(
|
|
8216
|
+
z119.string(),
|
|
7839
8217
|
DataAssemblyResolverDefinitionSchema
|
|
7840
8218
|
);
|
|
7841
8219
|
var DataAssemblyReturnMappingConfigSchema = PointerExpressionValueSchema;
|
|
7842
|
-
var DataAssemblyMetadataSchema =
|
|
7843
|
-
tags:
|
|
7844
|
-
|
|
7845
|
-
sys:
|
|
7846
|
-
type:
|
|
7847
|
-
linkType:
|
|
7848
|
-
id:
|
|
8220
|
+
var DataAssemblyMetadataSchema = z119.object({
|
|
8221
|
+
tags: z119.array(
|
|
8222
|
+
z119.object({
|
|
8223
|
+
sys: z119.object({
|
|
8224
|
+
type: z119.literal("Link"),
|
|
8225
|
+
linkType: z119.literal("Tag"),
|
|
8226
|
+
id: z119.string()
|
|
7849
8227
|
})
|
|
7850
8228
|
})
|
|
7851
8229
|
)
|
|
@@ -7853,8 +8231,8 @@ var DataAssemblyMetadataSchema = z117.object({
|
|
|
7853
8231
|
|
|
7854
8232
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
7855
8233
|
var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7856
|
-
name:
|
|
7857
|
-
description:
|
|
8234
|
+
name: z120.string().describe("The name of the data assembly"),
|
|
8235
|
+
description: z120.string().describe("Description of the data assembly"),
|
|
7858
8236
|
parameters: DataAssemblyParameterConfigSchema.describe(
|
|
7859
8237
|
"Parameter definitions keyed by parameter name (may be empty object)"
|
|
7860
8238
|
),
|
|
@@ -7864,8 +8242,8 @@ var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
7864
8242
|
return: DataAssemblyReturnMappingConfigSchema.describe(
|
|
7865
8243
|
"Return mapping configuration specifying how to map resolved data"
|
|
7866
8244
|
),
|
|
7867
|
-
dataType:
|
|
7868
|
-
variant:
|
|
8245
|
+
dataType: z120.array(DataAssemblyDataTypeFieldSchema).describe("Data type field definitions for this data assembly (may be empty array)"),
|
|
8246
|
+
variant: z120.string().optional().describe("Optional variant identifier for this data assembly"),
|
|
7869
8247
|
metadata: DataAssemblyMetadataSchema.optional().describe("Optional metadata (tags)")
|
|
7870
8248
|
});
|
|
7871
8249
|
function createDataAssemblyTool(config) {
|
|
@@ -7874,7 +8252,7 @@ function createDataAssemblyTool(config) {
|
|
|
7874
8252
|
args.environmentId,
|
|
7875
8253
|
config.protectedEnvironments
|
|
7876
8254
|
);
|
|
7877
|
-
const contentfulClient =
|
|
8255
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7878
8256
|
const dataAssembly = await contentfulClient.dataAssembly.create(
|
|
7879
8257
|
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
7880
8258
|
{
|
|
@@ -7899,14 +8277,14 @@ function createDataAssemblyTool(config) {
|
|
|
7899
8277
|
}
|
|
7900
8278
|
|
|
7901
8279
|
// src/tools/exo/data-assemblies/updateDataAssembly.ts
|
|
7902
|
-
import { z as
|
|
8280
|
+
import { z as z121 } from "zod";
|
|
7903
8281
|
var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7904
|
-
dataAssemblyId:
|
|
7905
|
-
version:
|
|
8282
|
+
dataAssemblyId: z121.string().describe("The ID of the data assembly to update"),
|
|
8283
|
+
version: z121.number().describe(
|
|
7906
8284
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The update is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
7907
8285
|
),
|
|
7908
|
-
name:
|
|
7909
|
-
description:
|
|
8286
|
+
name: z121.string().optional().describe("The name of the data assembly"),
|
|
8287
|
+
description: z121.string().optional().describe("Description of the data assembly"),
|
|
7910
8288
|
parameters: DataAssemblyParameterConfigSchema.optional().describe(
|
|
7911
8289
|
"Parameter definitions; replaces existing if provided"
|
|
7912
8290
|
),
|
|
@@ -7916,8 +8294,8 @@ var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
7916
8294
|
return: DataAssemblyReturnMappingConfigSchema.optional().describe(
|
|
7917
8295
|
"Return mapping configuration; replaces existing if provided"
|
|
7918
8296
|
),
|
|
7919
|
-
dataType:
|
|
7920
|
-
variant:
|
|
8297
|
+
dataType: z121.array(DataAssemblyDataTypeFieldSchema).optional().describe("Data type field definitions; replaces existing if provided"),
|
|
8298
|
+
variant: z121.string().optional().describe("Optional variant identifier; replaces existing if provided"),
|
|
7921
8299
|
metadata: DataAssemblyMetadataSchema.optional().describe(
|
|
7922
8300
|
"Metadata (tags); replaces existing if provided"
|
|
7923
8301
|
)
|
|
@@ -7933,7 +8311,7 @@ function updateDataAssemblyTool(config) {
|
|
|
7933
8311
|
environmentId: args.environmentId,
|
|
7934
8312
|
dataAssemblyId: args.dataAssemblyId
|
|
7935
8313
|
};
|
|
7936
|
-
const contentfulClient =
|
|
8314
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7937
8315
|
const current = await contentfulClient.dataAssembly.get(params);
|
|
7938
8316
|
if (args.version !== current.sys.version) {
|
|
7939
8317
|
throw new Error(
|
|
@@ -7963,13 +8341,13 @@ function updateDataAssemblyTool(config) {
|
|
|
7963
8341
|
}
|
|
7964
8342
|
|
|
7965
8343
|
// src/tools/exo/data-assemblies/deleteDataAssembly.ts
|
|
7966
|
-
import { z as
|
|
8344
|
+
import { z as z122 } from "zod";
|
|
7967
8345
|
var DeleteDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7968
|
-
dataAssemblyId:
|
|
7969
|
-
confirm:
|
|
8346
|
+
dataAssemblyId: z122.string().describe("The ID of the data assembly to delete"),
|
|
8347
|
+
confirm: z122.boolean().optional().describe(
|
|
7970
8348
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7971
8349
|
),
|
|
7972
|
-
confirmToken:
|
|
8350
|
+
confirmToken: z122.string().optional().describe(
|
|
7973
8351
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7974
8352
|
)
|
|
7975
8353
|
});
|
|
@@ -7984,7 +8362,7 @@ function deleteDataAssemblyTool(config) {
|
|
|
7984
8362
|
environmentId: args.environmentId,
|
|
7985
8363
|
dataAssemblyId: args.dataAssemblyId
|
|
7986
8364
|
};
|
|
7987
|
-
const contentfulClient =
|
|
8365
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
7988
8366
|
const dataAssembly = await contentfulClient.dataAssembly.get(params);
|
|
7989
8367
|
const expectedToken = buildConfirmToken(
|
|
7990
8368
|
"dataAssembly",
|
|
@@ -8011,10 +8389,10 @@ function deleteDataAssemblyTool(config) {
|
|
|
8011
8389
|
}
|
|
8012
8390
|
|
|
8013
8391
|
// src/tools/exo/data-assemblies/publishDataAssembly.ts
|
|
8014
|
-
import { z as
|
|
8392
|
+
import { z as z123 } from "zod";
|
|
8015
8393
|
var PublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8016
|
-
dataAssemblyId:
|
|
8017
|
-
version:
|
|
8394
|
+
dataAssemblyId: z123.string().describe("The ID of the data assembly to publish"),
|
|
8395
|
+
version: z123.number().describe(
|
|
8018
8396
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The publish is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
8019
8397
|
)
|
|
8020
8398
|
});
|
|
@@ -8029,7 +8407,7 @@ function publishDataAssemblyTool(config) {
|
|
|
8029
8407
|
environmentId: args.environmentId,
|
|
8030
8408
|
dataAssemblyId: args.dataAssemblyId
|
|
8031
8409
|
};
|
|
8032
|
-
const contentfulClient =
|
|
8410
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8033
8411
|
const current = await contentfulClient.dataAssembly.get(params);
|
|
8034
8412
|
if (args.version !== current.sys.version) {
|
|
8035
8413
|
throw new Error(
|
|
@@ -8048,10 +8426,10 @@ function publishDataAssemblyTool(config) {
|
|
|
8048
8426
|
}
|
|
8049
8427
|
|
|
8050
8428
|
// src/tools/exo/data-assemblies/unpublishDataAssembly.ts
|
|
8051
|
-
import { z as
|
|
8429
|
+
import { z as z124 } from "zod";
|
|
8052
8430
|
var UnpublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8053
|
-
dataAssemblyId:
|
|
8054
|
-
version:
|
|
8431
|
+
dataAssemblyId: z124.string().describe("The ID of the data assembly to unpublish"),
|
|
8432
|
+
version: z124.number().describe(
|
|
8055
8433
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
8056
8434
|
)
|
|
8057
8435
|
});
|
|
@@ -8066,7 +8444,7 @@ function unpublishDataAssemblyTool(config) {
|
|
|
8066
8444
|
environmentId: args.environmentId,
|
|
8067
8445
|
dataAssemblyId: args.dataAssemblyId
|
|
8068
8446
|
};
|
|
8069
|
-
const contentfulClient =
|
|
8447
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8070
8448
|
const current = await contentfulClient.dataAssembly.get(params);
|
|
8071
8449
|
if (args.version !== current.sys.version) {
|
|
8072
8450
|
throw new Error(
|
|
@@ -8233,6 +8611,12 @@ var ContentfulMcpTools = class {
|
|
|
8233
8611
|
getAssetTools() {
|
|
8234
8612
|
return createAssetTools(this.config);
|
|
8235
8613
|
}
|
|
8614
|
+
/**
|
|
8615
|
+
* Get content preview tools
|
|
8616
|
+
*/
|
|
8617
|
+
getContentPreviewTools() {
|
|
8618
|
+
return createContentPreviewTools(this.config);
|
|
8619
|
+
}
|
|
8236
8620
|
/**
|
|
8237
8621
|
* Get content type tools
|
|
8238
8622
|
*/
|
|
@@ -8338,10 +8722,10 @@ var ContentfulMcpTools = class {
|
|
|
8338
8722
|
};
|
|
8339
8723
|
|
|
8340
8724
|
// src/utils/entitlements.ts
|
|
8341
|
-
import { createClient as
|
|
8725
|
+
import { createClient as createClient18 } from "contentful-management";
|
|
8342
8726
|
var EXO_M1_FEATURE = "exoM1";
|
|
8343
8727
|
function createPlainClient(config) {
|
|
8344
|
-
return
|
|
8728
|
+
return createClient18(createClientConfig(config), { type: "plain" });
|
|
8345
8729
|
}
|
|
8346
8730
|
async function orgHasExoM1(client, organizationId) {
|
|
8347
8731
|
try {
|