@contentful/mcp-tools 0.7.0 → 0.12.0
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 +83 -0
- package/dist/index.js +752 -453
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1180,10 +1180,47 @@ function createEntitiesCollection(entities) {
|
|
|
1180
1180
|
};
|
|
1181
1181
|
}
|
|
1182
1182
|
|
|
1183
|
+
// src/utils/bulkLimits.ts
|
|
1184
|
+
var DEFAULT_MAX_BULK_SIZE = 10;
|
|
1185
|
+
function resolveMaxBulkSize(configured) {
|
|
1186
|
+
if (configured === void 0 || !Number.isInteger(configured) || configured <= 0) {
|
|
1187
|
+
return DEFAULT_MAX_BULK_SIZE;
|
|
1188
|
+
}
|
|
1189
|
+
return configured;
|
|
1190
|
+
}
|
|
1191
|
+
function assertBulkSizeAllowed(count, configured) {
|
|
1192
|
+
const limit = resolveMaxBulkSize(configured);
|
|
1193
|
+
if (count > limit) {
|
|
1194
|
+
throw new Error(
|
|
1195
|
+
`Bulk operation rejected: ${count} IDs exceeds MAX_BULK_SIZE of ${limit}. Reduce batch size or increase the limit.`
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
var PLURAL_BY_ENTITY = {
|
|
1200
|
+
entry: "entries",
|
|
1201
|
+
asset: "assets"
|
|
1202
|
+
};
|
|
1203
|
+
function buildDryRunPreview(input) {
|
|
1204
|
+
const { operation, entityType, ids, spaceId, environmentId } = input;
|
|
1205
|
+
const noun = ids.length === 1 ? entityType : PLURAL_BY_ENTITY[entityType];
|
|
1206
|
+
return {
|
|
1207
|
+
dryRun: true,
|
|
1208
|
+
operation,
|
|
1209
|
+
entityType,
|
|
1210
|
+
count: ids.length,
|
|
1211
|
+
ids,
|
|
1212
|
+
target: { spaceId, environmentId },
|
|
1213
|
+
message: `Dry run: would ${operation} ${ids.length} ${noun} in ${spaceId}/${environmentId}. No changes were made. Re-run without dryRun to execute.`
|
|
1214
|
+
};
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1183
1217
|
// src/tools/assets/publishAsset.ts
|
|
1184
1218
|
var PublishAssetToolParams = BaseToolSchema.extend({
|
|
1185
1219
|
assetId: z19.union([z19.string(), z19.array(z19.string()).max(100)]).describe(
|
|
1186
|
-
"
|
|
1220
|
+
"A single asset ID (string) or an array of asset IDs to publish (up to MAX_BULK_SIZE per call; default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
1221
|
+
),
|
|
1222
|
+
dryRun: z19.boolean().optional().describe(
|
|
1223
|
+
"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."
|
|
1187
1224
|
)
|
|
1188
1225
|
});
|
|
1189
1226
|
function publishAssetTool(config) {
|
|
@@ -1192,12 +1229,25 @@ function publishAssetTool(config) {
|
|
|
1192
1229
|
args.environmentId,
|
|
1193
1230
|
config.protectedEnvironments
|
|
1194
1231
|
);
|
|
1232
|
+
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1233
|
+
assertBulkSizeAllowed(assetIds.length, config.maxBulkSize);
|
|
1234
|
+
if (args.dryRun) {
|
|
1235
|
+
return createSuccessResponse(
|
|
1236
|
+
"Dry run: no changes were made",
|
|
1237
|
+
buildDryRunPreview({
|
|
1238
|
+
operation: "publish",
|
|
1239
|
+
entityType: "asset",
|
|
1240
|
+
ids: assetIds,
|
|
1241
|
+
spaceId: args.spaceId,
|
|
1242
|
+
environmentId: args.environmentId
|
|
1243
|
+
})
|
|
1244
|
+
);
|
|
1245
|
+
}
|
|
1195
1246
|
const baseParams = {
|
|
1196
1247
|
spaceId: args.spaceId,
|
|
1197
1248
|
environmentId: args.environmentId
|
|
1198
1249
|
};
|
|
1199
1250
|
const contentfulClient = createToolClient(config, args);
|
|
1200
|
-
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1201
1251
|
if (assetIds.length === 1) {
|
|
1202
1252
|
try {
|
|
1203
1253
|
const assetId = assetIds[0];
|
|
@@ -1247,7 +1297,10 @@ function publishAssetTool(config) {
|
|
|
1247
1297
|
import { z as z20 } from "zod";
|
|
1248
1298
|
var UnpublishAssetToolParams = BaseToolSchema.extend({
|
|
1249
1299
|
assetId: z20.union([z20.string(), z20.array(z20.string()).max(100)]).describe(
|
|
1250
|
-
"
|
|
1300
|
+
"A single asset ID (string) or an array of asset IDs to unpublish (up to MAX_BULK_SIZE per call; default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
1301
|
+
),
|
|
1302
|
+
dryRun: z20.boolean().optional().describe(
|
|
1303
|
+
"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."
|
|
1251
1304
|
)
|
|
1252
1305
|
});
|
|
1253
1306
|
function unpublishAssetTool(config) {
|
|
@@ -1256,12 +1309,25 @@ function unpublishAssetTool(config) {
|
|
|
1256
1309
|
args.environmentId,
|
|
1257
1310
|
config.protectedEnvironments
|
|
1258
1311
|
);
|
|
1312
|
+
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1313
|
+
assertBulkSizeAllowed(assetIds.length, config.maxBulkSize);
|
|
1314
|
+
if (args.dryRun) {
|
|
1315
|
+
return createSuccessResponse(
|
|
1316
|
+
"Dry run: no changes were made",
|
|
1317
|
+
buildDryRunPreview({
|
|
1318
|
+
operation: "unpublish",
|
|
1319
|
+
entityType: "asset",
|
|
1320
|
+
ids: assetIds,
|
|
1321
|
+
spaceId: args.spaceId,
|
|
1322
|
+
environmentId: args.environmentId
|
|
1323
|
+
})
|
|
1324
|
+
);
|
|
1325
|
+
}
|
|
1259
1326
|
const baseParams = {
|
|
1260
1327
|
spaceId: args.spaceId,
|
|
1261
1328
|
environmentId: args.environmentId
|
|
1262
1329
|
};
|
|
1263
1330
|
const contentfulClient = createToolClient(config, args);
|
|
1264
|
-
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1265
1331
|
if (assetIds.length === 1) {
|
|
1266
1332
|
try {
|
|
1267
1333
|
const assetId = assetIds[0];
|
|
@@ -1311,7 +1377,10 @@ function unpublishAssetTool(config) {
|
|
|
1311
1377
|
import { z as z21 } from "zod";
|
|
1312
1378
|
var ArchiveAssetToolParams = BaseToolSchema.extend({
|
|
1313
1379
|
assetId: z21.union([z21.string(), z21.array(z21.string()).max(100)]).describe(
|
|
1314
|
-
"
|
|
1380
|
+
"A single asset ID (string) or an array of asset IDs to archive (up to MAX_BULK_SIZE per call; default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
1381
|
+
),
|
|
1382
|
+
dryRun: z21.boolean().optional().describe(
|
|
1383
|
+
"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."
|
|
1315
1384
|
)
|
|
1316
1385
|
});
|
|
1317
1386
|
function archiveAssetTool(config) {
|
|
@@ -1320,12 +1389,25 @@ function archiveAssetTool(config) {
|
|
|
1320
1389
|
args.environmentId,
|
|
1321
1390
|
config.protectedEnvironments
|
|
1322
1391
|
);
|
|
1392
|
+
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1393
|
+
assertBulkSizeAllowed(assetIds.length, config.maxBulkSize);
|
|
1394
|
+
if (args.dryRun) {
|
|
1395
|
+
return createSuccessResponse(
|
|
1396
|
+
"Dry run: no changes were made",
|
|
1397
|
+
buildDryRunPreview({
|
|
1398
|
+
operation: "archive",
|
|
1399
|
+
entityType: "asset",
|
|
1400
|
+
ids: assetIds,
|
|
1401
|
+
spaceId: args.spaceId,
|
|
1402
|
+
environmentId: args.environmentId
|
|
1403
|
+
})
|
|
1404
|
+
);
|
|
1405
|
+
}
|
|
1323
1406
|
const baseParams = {
|
|
1324
1407
|
spaceId: args.spaceId,
|
|
1325
1408
|
environmentId: args.environmentId
|
|
1326
1409
|
};
|
|
1327
1410
|
const contentfulClient = createToolClient(config, args);
|
|
1328
|
-
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1329
1411
|
const successfullyArchived = [];
|
|
1330
1412
|
for (const assetId of assetIds) {
|
|
1331
1413
|
try {
|
|
@@ -1361,7 +1443,10 @@ function archiveAssetTool(config) {
|
|
|
1361
1443
|
import { z as z22 } from "zod";
|
|
1362
1444
|
var UnarchiveAssetToolParams = BaseToolSchema.extend({
|
|
1363
1445
|
assetId: z22.union([z22.string(), z22.array(z22.string()).max(100)]).describe(
|
|
1364
|
-
"
|
|
1446
|
+
"A single asset ID (string) or an array of asset IDs to unarchive (up to MAX_BULK_SIZE per call; default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
1447
|
+
),
|
|
1448
|
+
dryRun: z22.boolean().optional().describe(
|
|
1449
|
+
"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."
|
|
1365
1450
|
)
|
|
1366
1451
|
});
|
|
1367
1452
|
function unarchiveAssetTool(config) {
|
|
@@ -1370,12 +1455,25 @@ function unarchiveAssetTool(config) {
|
|
|
1370
1455
|
args.environmentId,
|
|
1371
1456
|
config.protectedEnvironments
|
|
1372
1457
|
);
|
|
1458
|
+
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1459
|
+
assertBulkSizeAllowed(assetIds.length, config.maxBulkSize);
|
|
1460
|
+
if (args.dryRun) {
|
|
1461
|
+
return createSuccessResponse(
|
|
1462
|
+
"Dry run: no changes were made",
|
|
1463
|
+
buildDryRunPreview({
|
|
1464
|
+
operation: "unarchive",
|
|
1465
|
+
entityType: "asset",
|
|
1466
|
+
ids: assetIds,
|
|
1467
|
+
spaceId: args.spaceId,
|
|
1468
|
+
environmentId: args.environmentId
|
|
1469
|
+
})
|
|
1470
|
+
);
|
|
1471
|
+
}
|
|
1373
1472
|
const baseParams = {
|
|
1374
1473
|
spaceId: args.spaceId,
|
|
1375
1474
|
environmentId: args.environmentId
|
|
1376
1475
|
};
|
|
1377
1476
|
const contentfulClient = createToolClient(config, args);
|
|
1378
|
-
const assetIds = Array.isArray(args.assetId) ? args.assetId : [args.assetId];
|
|
1379
1477
|
const successfullyUnarchived = [];
|
|
1380
1478
|
for (const assetId of assetIds) {
|
|
1381
1479
|
try {
|
|
@@ -2248,7 +2346,7 @@ var MCP_INSTRUCTIONS = `You are a helpful assistant integrated with Contentful t
|
|
|
2248
2346
|
## Entry Management:
|
|
2249
2347
|
- For entry creation, use create_entry with clear instructions
|
|
2250
2348
|
- Use entry_action for operations like publishing, unpublishing, deleting, or discarding entries
|
|
2251
|
-
- Use update_entry for content modifications with AI assistance
|
|
2349
|
+
- Use update_entry for content modifications with AI assistance. Always call get_entry first and pass the returned sys.version to update_entry; this is required and prevents overwriting concurrent changes.
|
|
2252
2350
|
- Use patch_entry for precise, direct modifications without AI generation (one operation at a time)
|
|
2253
2351
|
- Use transform_entry when preserving rich text formatting is crucial
|
|
2254
2352
|
- Use translate_entry specifically for language translation tasks
|
|
@@ -2626,111 +2724,147 @@ function searchEntriesTool(config) {
|
|
|
2626
2724
|
return withErrorHandling(tool2, "Error searching entries");
|
|
2627
2725
|
}
|
|
2628
2726
|
|
|
2727
|
+
// src/tools/entries/semanticSearch.ts
|
|
2728
|
+
import { z as z39 } from "zod";
|
|
2729
|
+
var SemanticSearchToolParams = BaseToolSchema.extend({
|
|
2730
|
+
query: z39.string().describe(
|
|
2731
|
+
"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."
|
|
2732
|
+
),
|
|
2733
|
+
contentTypeIds: z39.array(z39.string()).min(1).optional().describe("Restrict the search to entries of these content type IDs")
|
|
2734
|
+
});
|
|
2735
|
+
function semanticSearchTool(config) {
|
|
2736
|
+
async function tool2(args) {
|
|
2737
|
+
const contentfulClient = createToolClient(config, args);
|
|
2738
|
+
const filter = args.contentTypeIds && args.contentTypeIds.length > 0 ? { entityType: "Entry", contentTypeIds: args.contentTypeIds } : void 0;
|
|
2739
|
+
const results = await contentfulClient.semanticSearch.get(
|
|
2740
|
+
{
|
|
2741
|
+
spaceId: args.spaceId,
|
|
2742
|
+
environmentId: args.environmentId
|
|
2743
|
+
},
|
|
2744
|
+
{
|
|
2745
|
+
query: args.query,
|
|
2746
|
+
...filter ? { filter } : {}
|
|
2747
|
+
}
|
|
2748
|
+
);
|
|
2749
|
+
const entries = results.items.map((item) => ({
|
|
2750
|
+
id: item.sys.entity.sys.id
|
|
2751
|
+
}));
|
|
2752
|
+
return createSuccessResponse(
|
|
2753
|
+
"Semantic search results retrieved successfully",
|
|
2754
|
+
{
|
|
2755
|
+
entries,
|
|
2756
|
+
...results.sys.correlationId !== void 0 ? { correlationId: results.sys.correlationId } : {}
|
|
2757
|
+
}
|
|
2758
|
+
);
|
|
2759
|
+
}
|
|
2760
|
+
return withErrorHandling(tool2, "Error performing semantic search");
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2629
2763
|
// src/tools/entries/createEntry.ts
|
|
2630
|
-
import { z as
|
|
2764
|
+
import { z as z42 } from "zod";
|
|
2631
2765
|
|
|
2632
2766
|
// src/types/entryFieldSchema.ts
|
|
2633
|
-
import { z as
|
|
2767
|
+
import { z as z41 } from "zod";
|
|
2634
2768
|
|
|
2635
2769
|
// src/types/richTextSchema.ts
|
|
2636
2770
|
import { BLOCKS as BLOCKS2, INLINES as INLINES2, MARKS } from "@contentful/rich-text-types";
|
|
2637
|
-
import { z as
|
|
2638
|
-
var emptyNodeDataSchema =
|
|
2639
|
-
var entryLinkTargetSchema =
|
|
2640
|
-
sys:
|
|
2641
|
-
id:
|
|
2642
|
-
type:
|
|
2643
|
-
linkType:
|
|
2771
|
+
import { z as z40 } from "zod";
|
|
2772
|
+
var emptyNodeDataSchema = z40.object({});
|
|
2773
|
+
var entryLinkTargetSchema = z40.object({
|
|
2774
|
+
sys: z40.object({
|
|
2775
|
+
id: z40.string(),
|
|
2776
|
+
type: z40.literal("Link"),
|
|
2777
|
+
linkType: z40.literal("Entry")
|
|
2644
2778
|
})
|
|
2645
2779
|
});
|
|
2646
|
-
var assetLinkTargetSchema =
|
|
2647
|
-
sys:
|
|
2648
|
-
id:
|
|
2649
|
-
type:
|
|
2650
|
-
linkType:
|
|
2780
|
+
var assetLinkTargetSchema = z40.object({
|
|
2781
|
+
sys: z40.object({
|
|
2782
|
+
id: z40.string(),
|
|
2783
|
+
type: z40.literal("Link"),
|
|
2784
|
+
linkType: z40.literal("Asset")
|
|
2651
2785
|
})
|
|
2652
2786
|
});
|
|
2653
|
-
var resourceLinkTargetSchema =
|
|
2654
|
-
sys:
|
|
2655
|
-
type:
|
|
2656
|
-
linkType:
|
|
2657
|
-
urn:
|
|
2787
|
+
var resourceLinkTargetSchema = z40.object({
|
|
2788
|
+
sys: z40.object({
|
|
2789
|
+
type: z40.literal("ResourceLink"),
|
|
2790
|
+
linkType: z40.string(),
|
|
2791
|
+
urn: z40.string()
|
|
2658
2792
|
})
|
|
2659
2793
|
});
|
|
2660
|
-
var richTextMarkSchema =
|
|
2661
|
-
type:
|
|
2794
|
+
var richTextMarkSchema = z40.object({
|
|
2795
|
+
type: z40.nativeEnum(MARKS)
|
|
2662
2796
|
});
|
|
2663
|
-
var richTextTextNodeSchema =
|
|
2664
|
-
nodeType:
|
|
2665
|
-
value:
|
|
2666
|
-
marks:
|
|
2797
|
+
var richTextTextNodeSchema = z40.object({
|
|
2798
|
+
nodeType: z40.literal("text"),
|
|
2799
|
+
value: z40.string(),
|
|
2800
|
+
marks: z40.array(richTextMarkSchema),
|
|
2667
2801
|
data: emptyNodeDataSchema
|
|
2668
2802
|
});
|
|
2669
|
-
var embeddedEntryBlockNodeSchema =
|
|
2670
|
-
nodeType:
|
|
2671
|
-
data:
|
|
2803
|
+
var embeddedEntryBlockNodeSchema = z40.object({
|
|
2804
|
+
nodeType: z40.literal(BLOCKS2.EMBEDDED_ENTRY),
|
|
2805
|
+
data: z40.object({
|
|
2672
2806
|
target: entryLinkTargetSchema
|
|
2673
2807
|
}),
|
|
2674
|
-
content:
|
|
2808
|
+
content: z40.array(z40.never())
|
|
2675
2809
|
});
|
|
2676
|
-
var embeddedEntryInlineNodeSchema =
|
|
2677
|
-
nodeType:
|
|
2678
|
-
data:
|
|
2810
|
+
var embeddedEntryInlineNodeSchema = z40.object({
|
|
2811
|
+
nodeType: z40.literal(INLINES2.EMBEDDED_ENTRY),
|
|
2812
|
+
data: z40.object({
|
|
2679
2813
|
target: entryLinkTargetSchema
|
|
2680
2814
|
}),
|
|
2681
|
-
content:
|
|
2815
|
+
content: z40.array(z40.never())
|
|
2682
2816
|
});
|
|
2683
|
-
var embeddedAssetBlockNodeSchema =
|
|
2684
|
-
nodeType:
|
|
2685
|
-
data:
|
|
2817
|
+
var embeddedAssetBlockNodeSchema = z40.object({
|
|
2818
|
+
nodeType: z40.literal(BLOCKS2.EMBEDDED_ASSET),
|
|
2819
|
+
data: z40.object({
|
|
2686
2820
|
target: assetLinkTargetSchema
|
|
2687
2821
|
}),
|
|
2688
|
-
content:
|
|
2822
|
+
content: z40.array(z40.never())
|
|
2689
2823
|
});
|
|
2690
|
-
var hyperlinkInlineNodeSchema =
|
|
2691
|
-
nodeType:
|
|
2692
|
-
data:
|
|
2693
|
-
uri:
|
|
2824
|
+
var hyperlinkInlineNodeSchema = z40.object({
|
|
2825
|
+
nodeType: z40.literal(INLINES2.HYPERLINK),
|
|
2826
|
+
data: z40.object({
|
|
2827
|
+
uri: z40.string().url()
|
|
2694
2828
|
}),
|
|
2695
|
-
content:
|
|
2829
|
+
content: z40.array(richTextTextNodeSchema)
|
|
2696
2830
|
});
|
|
2697
|
-
var entryHyperlinkInlineNodeSchema =
|
|
2698
|
-
nodeType:
|
|
2699
|
-
data:
|
|
2831
|
+
var entryHyperlinkInlineNodeSchema = z40.object({
|
|
2832
|
+
nodeType: z40.literal(INLINES2.ENTRY_HYPERLINK),
|
|
2833
|
+
data: z40.object({
|
|
2700
2834
|
target: entryLinkTargetSchema
|
|
2701
2835
|
}),
|
|
2702
|
-
content:
|
|
2836
|
+
content: z40.array(richTextTextNodeSchema)
|
|
2703
2837
|
});
|
|
2704
|
-
var assetHyperlinkInlineNodeSchema =
|
|
2705
|
-
nodeType:
|
|
2706
|
-
data:
|
|
2838
|
+
var assetHyperlinkInlineNodeSchema = z40.object({
|
|
2839
|
+
nodeType: z40.literal(INLINES2.ASSET_HYPERLINK),
|
|
2840
|
+
data: z40.object({
|
|
2707
2841
|
target: assetLinkTargetSchema
|
|
2708
2842
|
}),
|
|
2709
|
-
content:
|
|
2843
|
+
content: z40.array(richTextTextNodeSchema)
|
|
2710
2844
|
});
|
|
2711
|
-
var embeddedResourceBlockNodeSchema =
|
|
2712
|
-
nodeType:
|
|
2713
|
-
data:
|
|
2845
|
+
var embeddedResourceBlockNodeSchema = z40.object({
|
|
2846
|
+
nodeType: z40.literal(BLOCKS2.EMBEDDED_RESOURCE),
|
|
2847
|
+
data: z40.object({
|
|
2714
2848
|
target: resourceLinkTargetSchema
|
|
2715
2849
|
}),
|
|
2716
|
-
content:
|
|
2850
|
+
content: z40.array(z40.never())
|
|
2717
2851
|
});
|
|
2718
|
-
var embeddedResourceInlineNodeSchema =
|
|
2719
|
-
nodeType:
|
|
2720
|
-
data:
|
|
2852
|
+
var embeddedResourceInlineNodeSchema = z40.object({
|
|
2853
|
+
nodeType: z40.literal(INLINES2.EMBEDDED_RESOURCE),
|
|
2854
|
+
data: z40.object({
|
|
2721
2855
|
target: resourceLinkTargetSchema
|
|
2722
2856
|
}),
|
|
2723
|
-
content:
|
|
2857
|
+
content: z40.array(z40.never())
|
|
2724
2858
|
});
|
|
2725
|
-
var resourceHyperlinkInlineNodeSchema =
|
|
2726
|
-
nodeType:
|
|
2727
|
-
data:
|
|
2859
|
+
var resourceHyperlinkInlineNodeSchema = z40.object({
|
|
2860
|
+
nodeType: z40.literal(INLINES2.RESOURCE_HYPERLINK),
|
|
2861
|
+
data: z40.object({
|
|
2728
2862
|
target: resourceLinkTargetSchema
|
|
2729
2863
|
}),
|
|
2730
|
-
content:
|
|
2864
|
+
content: z40.array(richTextTextNodeSchema)
|
|
2731
2865
|
});
|
|
2732
|
-
var richTextInlineNodeSchema =
|
|
2733
|
-
() =>
|
|
2866
|
+
var richTextInlineNodeSchema = z40.lazy(
|
|
2867
|
+
() => z40.union([
|
|
2734
2868
|
richTextTextNodeSchema,
|
|
2735
2869
|
embeddedEntryInlineNodeSchema,
|
|
2736
2870
|
hyperlinkInlineNodeSchema,
|
|
@@ -2740,17 +2874,17 @@ var richTextInlineNodeSchema = z39.lazy(
|
|
|
2740
2874
|
resourceHyperlinkInlineNodeSchema
|
|
2741
2875
|
])
|
|
2742
2876
|
);
|
|
2743
|
-
var paragraphNodeSchema =
|
|
2744
|
-
() =>
|
|
2745
|
-
nodeType:
|
|
2877
|
+
var paragraphNodeSchema = z40.lazy(
|
|
2878
|
+
() => z40.object({
|
|
2879
|
+
nodeType: z40.literal(BLOCKS2.PARAGRAPH),
|
|
2746
2880
|
data: emptyNodeDataSchema,
|
|
2747
|
-
content:
|
|
2881
|
+
content: z40.array(richTextInlineNodeSchema)
|
|
2748
2882
|
})
|
|
2749
2883
|
);
|
|
2750
|
-
var headingNodeSchema = (headingNodeType) =>
|
|
2751
|
-
nodeType:
|
|
2884
|
+
var headingNodeSchema = (headingNodeType) => z40.object({
|
|
2885
|
+
nodeType: z40.literal(headingNodeType),
|
|
2752
2886
|
data: emptyNodeDataSchema,
|
|
2753
|
-
content:
|
|
2887
|
+
content: z40.array(richTextInlineNodeSchema)
|
|
2754
2888
|
});
|
|
2755
2889
|
var heading1NodeSchema = headingNodeSchema(BLOCKS2.HEADING_1);
|
|
2756
2890
|
var heading2NodeSchema = headingNodeSchema(BLOCKS2.HEADING_2);
|
|
@@ -2758,56 +2892,56 @@ var heading3NodeSchema = headingNodeSchema(BLOCKS2.HEADING_3);
|
|
|
2758
2892
|
var heading4NodeSchema = headingNodeSchema(BLOCKS2.HEADING_4);
|
|
2759
2893
|
var heading5NodeSchema = headingNodeSchema(BLOCKS2.HEADING_5);
|
|
2760
2894
|
var heading6NodeSchema = headingNodeSchema(BLOCKS2.HEADING_6);
|
|
2761
|
-
var hrNodeSchema =
|
|
2762
|
-
nodeType:
|
|
2895
|
+
var hrNodeSchema = z40.object({
|
|
2896
|
+
nodeType: z40.literal(BLOCKS2.HR),
|
|
2763
2897
|
data: emptyNodeDataSchema,
|
|
2764
|
-
content:
|
|
2898
|
+
content: z40.array(z40.never())
|
|
2765
2899
|
});
|
|
2766
|
-
var quoteNodeSchema =
|
|
2767
|
-
nodeType:
|
|
2900
|
+
var quoteNodeSchema = z40.object({
|
|
2901
|
+
nodeType: z40.literal(BLOCKS2.QUOTE),
|
|
2768
2902
|
data: emptyNodeDataSchema,
|
|
2769
|
-
content:
|
|
2903
|
+
content: z40.array(paragraphNodeSchema)
|
|
2770
2904
|
});
|
|
2771
|
-
var tableHeaderCellNodeSchema =
|
|
2772
|
-
nodeType:
|
|
2905
|
+
var tableHeaderCellNodeSchema = z40.object({
|
|
2906
|
+
nodeType: z40.literal(BLOCKS2.TABLE_HEADER_CELL),
|
|
2773
2907
|
data: emptyNodeDataSchema,
|
|
2774
|
-
content:
|
|
2908
|
+
content: z40.array(paragraphNodeSchema)
|
|
2775
2909
|
});
|
|
2776
|
-
var tableCellNodeSchema =
|
|
2777
|
-
nodeType:
|
|
2910
|
+
var tableCellNodeSchema = z40.object({
|
|
2911
|
+
nodeType: z40.literal(BLOCKS2.TABLE_CELL),
|
|
2778
2912
|
data: emptyNodeDataSchema,
|
|
2779
|
-
content:
|
|
2913
|
+
content: z40.array(paragraphNodeSchema)
|
|
2780
2914
|
});
|
|
2781
|
-
var tableRowNodeSchema =
|
|
2782
|
-
nodeType:
|
|
2915
|
+
var tableRowNodeSchema = z40.object({
|
|
2916
|
+
nodeType: z40.literal(BLOCKS2.TABLE_ROW),
|
|
2783
2917
|
data: emptyNodeDataSchema,
|
|
2784
|
-
content:
|
|
2918
|
+
content: z40.array(z40.union([tableHeaderCellNodeSchema, tableCellNodeSchema]))
|
|
2785
2919
|
});
|
|
2786
|
-
var tableNodeSchema =
|
|
2787
|
-
nodeType:
|
|
2920
|
+
var tableNodeSchema = z40.object({
|
|
2921
|
+
nodeType: z40.literal(BLOCKS2.TABLE),
|
|
2788
2922
|
data: emptyNodeDataSchema,
|
|
2789
|
-
content:
|
|
2923
|
+
content: z40.array(tableRowNodeSchema)
|
|
2790
2924
|
});
|
|
2791
|
-
var orderedListNodeSchema =
|
|
2792
|
-
() =>
|
|
2793
|
-
nodeType:
|
|
2925
|
+
var orderedListNodeSchema = z40.lazy(
|
|
2926
|
+
() => z40.object({
|
|
2927
|
+
nodeType: z40.literal(BLOCKS2.OL_LIST),
|
|
2794
2928
|
data: emptyNodeDataSchema,
|
|
2795
|
-
content:
|
|
2929
|
+
content: z40.array(listItemNodeSchema)
|
|
2796
2930
|
})
|
|
2797
2931
|
);
|
|
2798
|
-
var unorderedListNodeSchema =
|
|
2799
|
-
() =>
|
|
2800
|
-
nodeType:
|
|
2932
|
+
var unorderedListNodeSchema = z40.lazy(
|
|
2933
|
+
() => z40.object({
|
|
2934
|
+
nodeType: z40.literal(BLOCKS2.UL_LIST),
|
|
2801
2935
|
data: emptyNodeDataSchema,
|
|
2802
|
-
content:
|
|
2936
|
+
content: z40.array(listItemNodeSchema)
|
|
2803
2937
|
})
|
|
2804
2938
|
);
|
|
2805
|
-
var listItemNodeSchema =
|
|
2806
|
-
() =>
|
|
2807
|
-
nodeType:
|
|
2939
|
+
var listItemNodeSchema = z40.lazy(
|
|
2940
|
+
() => z40.object({
|
|
2941
|
+
nodeType: z40.literal(BLOCKS2.LIST_ITEM),
|
|
2808
2942
|
data: emptyNodeDataSchema,
|
|
2809
|
-
content:
|
|
2810
|
-
|
|
2943
|
+
content: z40.array(
|
|
2944
|
+
z40.union([
|
|
2811
2945
|
paragraphNodeSchema,
|
|
2812
2946
|
orderedListNodeSchema,
|
|
2813
2947
|
unorderedListNodeSchema
|
|
@@ -2815,8 +2949,8 @@ var listItemNodeSchema = z39.lazy(
|
|
|
2815
2949
|
)
|
|
2816
2950
|
})
|
|
2817
2951
|
);
|
|
2818
|
-
var topLevelBlockNodeSchema =
|
|
2819
|
-
() =>
|
|
2952
|
+
var topLevelBlockNodeSchema = z40.lazy(
|
|
2953
|
+
() => z40.union([
|
|
2820
2954
|
paragraphNodeSchema,
|
|
2821
2955
|
heading1NodeSchema,
|
|
2822
2956
|
heading2NodeSchema,
|
|
@@ -2834,56 +2968,56 @@ var topLevelBlockNodeSchema = z39.lazy(
|
|
|
2834
2968
|
tableNodeSchema
|
|
2835
2969
|
])
|
|
2836
2970
|
);
|
|
2837
|
-
var richTextDocumentSchema =
|
|
2838
|
-
nodeType:
|
|
2971
|
+
var richTextDocumentSchema = z40.object({
|
|
2972
|
+
nodeType: z40.literal(BLOCKS2.DOCUMENT),
|
|
2839
2973
|
data: emptyNodeDataSchema,
|
|
2840
|
-
content:
|
|
2974
|
+
content: z40.array(topLevelBlockNodeSchema)
|
|
2841
2975
|
}).describe("Contentful Rich Text document");
|
|
2842
2976
|
|
|
2843
2977
|
// src/types/entryFieldSchema.ts
|
|
2844
|
-
var linkSchema =
|
|
2845
|
-
sys:
|
|
2846
|
-
type:
|
|
2847
|
-
linkType:
|
|
2848
|
-
id:
|
|
2978
|
+
var linkSchema = z41.object({
|
|
2979
|
+
sys: z41.object({
|
|
2980
|
+
type: z41.literal("Link"),
|
|
2981
|
+
linkType: z41.enum(["Entry", "Asset"]),
|
|
2982
|
+
id: z41.string()
|
|
2849
2983
|
})
|
|
2850
2984
|
});
|
|
2851
|
-
var resourceLinkSchema =
|
|
2852
|
-
sys:
|
|
2853
|
-
type:
|
|
2854
|
-
linkType:
|
|
2855
|
-
urn:
|
|
2985
|
+
var resourceLinkSchema = z41.object({
|
|
2986
|
+
sys: z41.object({
|
|
2987
|
+
type: z41.literal("ResourceLink"),
|
|
2988
|
+
linkType: z41.string(),
|
|
2989
|
+
urn: z41.string()
|
|
2856
2990
|
})
|
|
2857
2991
|
});
|
|
2858
|
-
var locationSchema =
|
|
2859
|
-
lat:
|
|
2860
|
-
lon:
|
|
2992
|
+
var locationSchema = z41.object({
|
|
2993
|
+
lat: z41.number(),
|
|
2994
|
+
lon: z41.number()
|
|
2861
2995
|
});
|
|
2862
|
-
var jsonPrimitive =
|
|
2863
|
-
var jsonValueSchema =
|
|
2864
|
-
() =>
|
|
2996
|
+
var jsonPrimitive = z41.union([z41.string(), z41.number(), z41.boolean(), z41.null()]);
|
|
2997
|
+
var jsonValueSchema = z41.lazy(
|
|
2998
|
+
() => z41.union([jsonPrimitive, z41.array(jsonValueSchema), z41.record(jsonValueSchema)]).describe("Freeform JSON value (not for Rich Text)")
|
|
2865
2999
|
);
|
|
2866
|
-
var fieldValueSchema =
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
3000
|
+
var fieldValueSchema = z41.union([
|
|
3001
|
+
z41.string().describe("Symbol, Text, or Date field"),
|
|
3002
|
+
z41.number().describe("Integer or Number field"),
|
|
3003
|
+
z41.boolean().describe("Boolean field"),
|
|
2870
3004
|
richTextDocumentSchema,
|
|
2871
3005
|
linkSchema.describe("Link field (Entry or Asset reference)"),
|
|
2872
3006
|
resourceLinkSchema.describe("ResourceLink field"),
|
|
2873
3007
|
locationSchema.describe("Location field"),
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
3008
|
+
z41.array(z41.string()).describe("Array field of Symbols"),
|
|
3009
|
+
z41.array(linkSchema).describe("Array field of Links"),
|
|
3010
|
+
z41.array(resourceLinkSchema).describe("Array field of ResourceLinks"),
|
|
2877
3011
|
jsonValueSchema
|
|
2878
3012
|
]);
|
|
2879
|
-
var localizedFieldSchema =
|
|
2880
|
-
var entryFieldsSchema =
|
|
3013
|
+
var localizedFieldSchema = z41.record(fieldValueSchema);
|
|
3014
|
+
var entryFieldsSchema = z41.record(localizedFieldSchema).describe(
|
|
2881
3015
|
"Field values to update. Keys are field IDs, values are locale-keyed objects. Will be merged with existing fields."
|
|
2882
3016
|
);
|
|
2883
3017
|
|
|
2884
3018
|
// src/tools/entries/createEntry.ts
|
|
2885
3019
|
var CreateEntryToolParams = BaseToolSchema.extend({
|
|
2886
|
-
contentTypeId:
|
|
3020
|
+
contentTypeId: z42.string().describe("The ID of the content type to create an entry for"),
|
|
2887
3021
|
fields: entryFieldsSchema.describe(
|
|
2888
3022
|
"The field values for the new entry. Keys should be field IDs and values should be the field content."
|
|
2889
3023
|
),
|
|
@@ -2916,13 +3050,13 @@ function createEntryTool(config) {
|
|
|
2916
3050
|
}
|
|
2917
3051
|
|
|
2918
3052
|
// src/tools/entries/deleteEntry.ts
|
|
2919
|
-
import { z as
|
|
3053
|
+
import { z as z43 } from "zod";
|
|
2920
3054
|
var DeleteEntryToolParams = BaseToolSchema.extend({
|
|
2921
|
-
entryId:
|
|
2922
|
-
confirm:
|
|
3055
|
+
entryId: z43.string().describe("The ID of the entry to delete"),
|
|
3056
|
+
confirm: z43.boolean().optional().describe(
|
|
2923
3057
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
2924
3058
|
),
|
|
2925
|
-
confirmToken:
|
|
3059
|
+
confirmToken: z43.string().optional().describe(
|
|
2926
3060
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
2927
3061
|
)
|
|
2928
3062
|
});
|
|
@@ -2962,9 +3096,12 @@ function deleteEntryTool(config) {
|
|
|
2962
3096
|
}
|
|
2963
3097
|
|
|
2964
3098
|
// src/tools/entries/updateEntry.ts
|
|
2965
|
-
import { z as
|
|
3099
|
+
import { z as z44 } from "zod";
|
|
2966
3100
|
var UpdateEntryToolParams = BaseToolSchema.extend({
|
|
2967
|
-
entryId:
|
|
3101
|
+
entryId: z44.string().describe("The ID of the entry to update"),
|
|
3102
|
+
version: z44.number().describe(
|
|
3103
|
+
"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."
|
|
3104
|
+
),
|
|
2968
3105
|
fields: entryFieldsSchema.describe(
|
|
2969
3106
|
"The field values to update. Keys should be field IDs and values should be the field content. Will be merged with existing fields."
|
|
2970
3107
|
),
|
|
@@ -2983,6 +3120,11 @@ function updateEntryTool(config) {
|
|
|
2983
3120
|
};
|
|
2984
3121
|
const contentfulClient = createToolClient(config, args);
|
|
2985
3122
|
const existingEntry = await contentfulClient.entry.get(params);
|
|
3123
|
+
if (args.version !== existingEntry.sys.version) {
|
|
3124
|
+
throw new Error(
|
|
3125
|
+
`Version conflict: the entry has changed since you read it (your version: ${args.version}, current version: ${existingEntry.sys.version}). Re-fetch the entry with get_entry and retry the update with the latest version.`
|
|
3126
|
+
);
|
|
3127
|
+
}
|
|
2986
3128
|
const mergedFields = {
|
|
2987
3129
|
...existingEntry.fields,
|
|
2988
3130
|
...args.fields
|
|
@@ -3011,9 +3153,9 @@ function updateEntryTool(config) {
|
|
|
3011
3153
|
}
|
|
3012
3154
|
|
|
3013
3155
|
// src/tools/entries/getEntry.ts
|
|
3014
|
-
import { z as
|
|
3156
|
+
import { z as z45 } from "zod";
|
|
3015
3157
|
var GetEntryToolParams = BaseToolSchema.extend({
|
|
3016
|
-
entryId:
|
|
3158
|
+
entryId: z45.string().describe("The ID of the entry to retrieve")
|
|
3017
3159
|
});
|
|
3018
3160
|
function getEntryTool(config) {
|
|
3019
3161
|
async function tool2(args) {
|
|
@@ -3029,11 +3171,74 @@ function getEntryTool(config) {
|
|
|
3029
3171
|
return withErrorHandling(tool2, "Error retrieving entry");
|
|
3030
3172
|
}
|
|
3031
3173
|
|
|
3174
|
+
// src/tools/entries/resolveEntryReferences.ts
|
|
3175
|
+
import { z as z46 } from "zod";
|
|
3176
|
+
var ResolveEntryReferencesToolParams = BaseToolSchema.extend({
|
|
3177
|
+
entryId: z46.string().describe("The ID of the entry whose references should be resolved"),
|
|
3178
|
+
include: z46.number().int().min(1).max(10).optional().default(2).describe(
|
|
3179
|
+
"How many levels of linked entries to walk (1-10, default: 2). The CMA caps this at 10."
|
|
3180
|
+
)
|
|
3181
|
+
});
|
|
3182
|
+
function resolveEntryReferencesTool(config) {
|
|
3183
|
+
async function tool2(args) {
|
|
3184
|
+
const { include = 2 } = args;
|
|
3185
|
+
const params = {
|
|
3186
|
+
spaceId: args.spaceId,
|
|
3187
|
+
environmentId: args.environmentId,
|
|
3188
|
+
entryId: args.entryId,
|
|
3189
|
+
include
|
|
3190
|
+
};
|
|
3191
|
+
const contentfulClient = createToolClient(config, args);
|
|
3192
|
+
const references = await contentfulClient.entry.references(params);
|
|
3193
|
+
return createSuccessResponse("Entry references retrieved successfully", {
|
|
3194
|
+
references
|
|
3195
|
+
});
|
|
3196
|
+
}
|
|
3197
|
+
return withErrorHandling(tool2, "Error resolving entry references");
|
|
3198
|
+
}
|
|
3199
|
+
|
|
3200
|
+
// src/tools/entries/getEntrySnapshot.ts
|
|
3201
|
+
import { z as z47 } from "zod";
|
|
3202
|
+
var GetEntrySnapshotToolParams = BaseToolSchema.extend({
|
|
3203
|
+
entryId: z47.string().describe("The ID of the entry to retrieve snapshots for"),
|
|
3204
|
+
snapshotId: z47.string().optional().describe(
|
|
3205
|
+
"Optional snapshot ID. When provided, returns the full content of that single snapshot. When omitted, lists all available snapshots for the entry."
|
|
3206
|
+
)
|
|
3207
|
+
});
|
|
3208
|
+
function getEntrySnapshotTool(config) {
|
|
3209
|
+
async function tool2(args) {
|
|
3210
|
+
const contentfulClient = createToolClient(config, args);
|
|
3211
|
+
if (args.snapshotId) {
|
|
3212
|
+
const snapshot = await contentfulClient.snapshot.getForEntry({
|
|
3213
|
+
spaceId: args.spaceId,
|
|
3214
|
+
environmentId: args.environmentId,
|
|
3215
|
+
entryId: args.entryId,
|
|
3216
|
+
snapshotId: args.snapshotId
|
|
3217
|
+
});
|
|
3218
|
+
return createSuccessResponse("Entry snapshot retrieved successfully", {
|
|
3219
|
+
snapshot
|
|
3220
|
+
});
|
|
3221
|
+
}
|
|
3222
|
+
const snapshots = await contentfulClient.snapshot.getManyForEntry({
|
|
3223
|
+
spaceId: args.spaceId,
|
|
3224
|
+
environmentId: args.environmentId,
|
|
3225
|
+
entryId: args.entryId
|
|
3226
|
+
});
|
|
3227
|
+
return createSuccessResponse("Entry snapshots retrieved successfully", {
|
|
3228
|
+
snapshots
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
return withErrorHandling(tool2, "Error retrieving entry snapshot");
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3032
3234
|
// src/tools/entries/publishEntry.ts
|
|
3033
|
-
import { z as
|
|
3235
|
+
import { z as z48 } from "zod";
|
|
3034
3236
|
var PublishEntryToolParams = BaseToolSchema.extend({
|
|
3035
|
-
entryId:
|
|
3036
|
-
"Array of entry IDs to publish.
|
|
3237
|
+
entryId: z48.array(z48.string()).min(1).max(100).describe(
|
|
3238
|
+
"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)."
|
|
3239
|
+
),
|
|
3240
|
+
dryRun: z48.boolean().optional().describe(
|
|
3241
|
+
"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."
|
|
3037
3242
|
)
|
|
3038
3243
|
});
|
|
3039
3244
|
function publishEntryTool(config) {
|
|
@@ -3042,12 +3247,25 @@ function publishEntryTool(config) {
|
|
|
3042
3247
|
args.environmentId,
|
|
3043
3248
|
config.protectedEnvironments
|
|
3044
3249
|
);
|
|
3250
|
+
const entryIds = args.entryId;
|
|
3251
|
+
assertBulkSizeAllowed(entryIds.length, config.maxBulkSize);
|
|
3252
|
+
if (args.dryRun) {
|
|
3253
|
+
return createSuccessResponse(
|
|
3254
|
+
"Dry run: no changes were made",
|
|
3255
|
+
buildDryRunPreview({
|
|
3256
|
+
operation: "publish",
|
|
3257
|
+
entityType: "entry",
|
|
3258
|
+
ids: entryIds,
|
|
3259
|
+
spaceId: args.spaceId,
|
|
3260
|
+
environmentId: args.environmentId
|
|
3261
|
+
})
|
|
3262
|
+
);
|
|
3263
|
+
}
|
|
3045
3264
|
const baseParams = {
|
|
3046
3265
|
spaceId: args.spaceId,
|
|
3047
3266
|
environmentId: args.environmentId
|
|
3048
3267
|
};
|
|
3049
3268
|
const contentfulClient = createToolClient(config, args);
|
|
3050
|
-
const entryIds = args.entryId;
|
|
3051
3269
|
if (entryIds.length === 1) {
|
|
3052
3270
|
const entryId = entryIds[0];
|
|
3053
3271
|
const params = {
|
|
@@ -3087,10 +3305,13 @@ function publishEntryTool(config) {
|
|
|
3087
3305
|
}
|
|
3088
3306
|
|
|
3089
3307
|
// src/tools/entries/unpublishEntry.ts
|
|
3090
|
-
import { z as
|
|
3308
|
+
import { z as z49 } from "zod";
|
|
3091
3309
|
var UnpublishEntryToolParams = BaseToolSchema.extend({
|
|
3092
|
-
entryId:
|
|
3093
|
-
"Array of entry IDs to unpublish.
|
|
3310
|
+
entryId: z49.array(z49.string()).min(1).max(100).describe(
|
|
3311
|
+
"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)."
|
|
3312
|
+
),
|
|
3313
|
+
dryRun: z49.boolean().optional().describe(
|
|
3314
|
+
"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."
|
|
3094
3315
|
)
|
|
3095
3316
|
});
|
|
3096
3317
|
function unpublishEntryTool(config) {
|
|
@@ -3099,12 +3320,25 @@ function unpublishEntryTool(config) {
|
|
|
3099
3320
|
args.environmentId,
|
|
3100
3321
|
config.protectedEnvironments
|
|
3101
3322
|
);
|
|
3323
|
+
const entryIds = args.entryId;
|
|
3324
|
+
assertBulkSizeAllowed(entryIds.length, config.maxBulkSize);
|
|
3325
|
+
if (args.dryRun) {
|
|
3326
|
+
return createSuccessResponse(
|
|
3327
|
+
"Dry run: no changes were made",
|
|
3328
|
+
buildDryRunPreview({
|
|
3329
|
+
operation: "unpublish",
|
|
3330
|
+
entityType: "entry",
|
|
3331
|
+
ids: entryIds,
|
|
3332
|
+
spaceId: args.spaceId,
|
|
3333
|
+
environmentId: args.environmentId
|
|
3334
|
+
})
|
|
3335
|
+
);
|
|
3336
|
+
}
|
|
3102
3337
|
const baseParams = {
|
|
3103
3338
|
spaceId: args.spaceId,
|
|
3104
3339
|
environmentId: args.environmentId
|
|
3105
3340
|
};
|
|
3106
3341
|
const contentfulClient = createToolClient(config, args);
|
|
3107
|
-
const entryIds = args.entryId;
|
|
3108
3342
|
if (entryIds.length === 1) {
|
|
3109
3343
|
const entryId = entryIds[0];
|
|
3110
3344
|
const params = {
|
|
@@ -3144,10 +3378,13 @@ function unpublishEntryTool(config) {
|
|
|
3144
3378
|
}
|
|
3145
3379
|
|
|
3146
3380
|
// src/tools/entries/archiveEntry.ts
|
|
3147
|
-
import { z as
|
|
3381
|
+
import { z as z50 } from "zod";
|
|
3148
3382
|
var ArchiveEntryToolParams = BaseToolSchema.extend({
|
|
3149
|
-
entryId:
|
|
3150
|
-
"Array of entry IDs to archive.
|
|
3383
|
+
entryId: z50.array(z50.string()).min(1).max(100).describe(
|
|
3384
|
+
"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)."
|
|
3385
|
+
),
|
|
3386
|
+
dryRun: z50.boolean().optional().describe(
|
|
3387
|
+
"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."
|
|
3151
3388
|
)
|
|
3152
3389
|
});
|
|
3153
3390
|
function archiveEntryTool(config) {
|
|
@@ -3156,12 +3393,25 @@ function archiveEntryTool(config) {
|
|
|
3156
3393
|
args.environmentId,
|
|
3157
3394
|
config.protectedEnvironments
|
|
3158
3395
|
);
|
|
3396
|
+
const entryIds = args.entryId;
|
|
3397
|
+
assertBulkSizeAllowed(entryIds.length, config.maxBulkSize);
|
|
3398
|
+
if (args.dryRun) {
|
|
3399
|
+
return createSuccessResponse(
|
|
3400
|
+
"Dry run: no changes were made",
|
|
3401
|
+
buildDryRunPreview({
|
|
3402
|
+
operation: "archive",
|
|
3403
|
+
entityType: "entry",
|
|
3404
|
+
ids: entryIds,
|
|
3405
|
+
spaceId: args.spaceId,
|
|
3406
|
+
environmentId: args.environmentId
|
|
3407
|
+
})
|
|
3408
|
+
);
|
|
3409
|
+
}
|
|
3159
3410
|
const baseParams = {
|
|
3160
3411
|
spaceId: args.spaceId,
|
|
3161
3412
|
environmentId: args.environmentId
|
|
3162
3413
|
};
|
|
3163
3414
|
const contentfulClient = createToolClient(config, args);
|
|
3164
|
-
const entryIds = args.entryId;
|
|
3165
3415
|
const successfullyArchived = [];
|
|
3166
3416
|
for (const entryId of entryIds) {
|
|
3167
3417
|
try {
|
|
@@ -3194,10 +3444,13 @@ function archiveEntryTool(config) {
|
|
|
3194
3444
|
}
|
|
3195
3445
|
|
|
3196
3446
|
// src/tools/entries/unarchiveEntry.ts
|
|
3197
|
-
import { z as
|
|
3447
|
+
import { z as z51 } from "zod";
|
|
3198
3448
|
var UnarchiveEntryToolParams = BaseToolSchema.extend({
|
|
3199
|
-
entryId:
|
|
3200
|
-
"Array of entry IDs to unarchive.
|
|
3449
|
+
entryId: z51.array(z51.string()).min(1).max(100).describe(
|
|
3450
|
+
"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)."
|
|
3451
|
+
),
|
|
3452
|
+
dryRun: z51.boolean().optional().describe(
|
|
3453
|
+
"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."
|
|
3201
3454
|
)
|
|
3202
3455
|
});
|
|
3203
3456
|
function unarchiveEntryTool(config) {
|
|
@@ -3206,12 +3459,25 @@ function unarchiveEntryTool(config) {
|
|
|
3206
3459
|
args.environmentId,
|
|
3207
3460
|
config.protectedEnvironments
|
|
3208
3461
|
);
|
|
3462
|
+
const entryIds = args.entryId;
|
|
3463
|
+
assertBulkSizeAllowed(entryIds.length, config.maxBulkSize);
|
|
3464
|
+
if (args.dryRun) {
|
|
3465
|
+
return createSuccessResponse(
|
|
3466
|
+
"Dry run: no changes were made",
|
|
3467
|
+
buildDryRunPreview({
|
|
3468
|
+
operation: "unarchive",
|
|
3469
|
+
entityType: "entry",
|
|
3470
|
+
ids: entryIds,
|
|
3471
|
+
spaceId: args.spaceId,
|
|
3472
|
+
environmentId: args.environmentId
|
|
3473
|
+
})
|
|
3474
|
+
);
|
|
3475
|
+
}
|
|
3209
3476
|
const baseParams = {
|
|
3210
3477
|
spaceId: args.spaceId,
|
|
3211
3478
|
environmentId: args.environmentId
|
|
3212
3479
|
};
|
|
3213
3480
|
const contentfulClient = createToolClient(config, args);
|
|
3214
|
-
const entryIds = args.entryId;
|
|
3215
3481
|
const successfullyUnarchived = [];
|
|
3216
3482
|
for (const entryId of entryIds) {
|
|
3217
3483
|
try {
|
|
@@ -3246,10 +3512,13 @@ function unarchiveEntryTool(config) {
|
|
|
3246
3512
|
// src/tools/entries/register.ts
|
|
3247
3513
|
function createEntryTools(config) {
|
|
3248
3514
|
const searchEntries = searchEntriesTool(config);
|
|
3515
|
+
const semanticSearch = semanticSearchTool(config);
|
|
3249
3516
|
const createEntry = createEntryTool(config);
|
|
3250
3517
|
const deleteEntry = deleteEntryTool(config);
|
|
3251
3518
|
const updateEntry = updateEntryTool(config);
|
|
3252
3519
|
const getEntry = getEntryTool(config);
|
|
3520
|
+
const resolveEntryReferences = resolveEntryReferencesTool(config);
|
|
3521
|
+
const getEntrySnapshot = getEntrySnapshotTool(config);
|
|
3253
3522
|
const publishEntry = publishEntryTool(config);
|
|
3254
3523
|
const unpublishEntry = unpublishEntryTool(config);
|
|
3255
3524
|
const archiveEntry = archiveEntryTool(config);
|
|
@@ -3265,6 +3534,16 @@ function createEntryTools(config) {
|
|
|
3265
3534
|
},
|
|
3266
3535
|
tool: searchEntries
|
|
3267
3536
|
},
|
|
3537
|
+
semanticSearch: {
|
|
3538
|
+
title: "semantic_search",
|
|
3539
|
+
description: "Find entries by meaning using semantic (vector) search. Provide a descriptive natural-language query of what you're looking for \u2014 phrases resembling entry content work best (not questions or JSON). Optionally restrict to specific content types. Returns up to 10 matching entry references (unranked); use get_entry to fetch full content. Requires semantic search to be enabled for the environment.",
|
|
3540
|
+
inputParams: SemanticSearchToolParams.shape,
|
|
3541
|
+
annotations: {
|
|
3542
|
+
readOnlyHint: true,
|
|
3543
|
+
openWorldHint: false
|
|
3544
|
+
},
|
|
3545
|
+
tool: semanticSearch
|
|
3546
|
+
},
|
|
3268
3547
|
createEntry: {
|
|
3269
3548
|
title: "create_entry",
|
|
3270
3549
|
description: "Create a new entry in Contentful. Before executing this function, you need to know the contentTypeId (not the content type NAME) and the fields of that contentType. You can get the fields definition by using the GET_CONTENT_TYPE tool. TAGS: To add tags to an entry, include a metadata object with a tags array. Each tag should be an object with sys.type='Link', sys.linkType='Tag', and sys.id='tagId'. Example: { metadata: { tags: [{ sys: { type: 'Link', linkType: 'Tag', id: 'myTagId' } }] } }.",
|
|
@@ -3287,9 +3566,29 @@ function createEntryTools(config) {
|
|
|
3287
3566
|
},
|
|
3288
3567
|
tool: getEntry
|
|
3289
3568
|
},
|
|
3569
|
+
resolveEntryReferences: {
|
|
3570
|
+
title: "resolve_entry_references",
|
|
3571
|
+
description: "Recursively resolve an entry's references and return the entry plus its descendant entries and linked assets. Useful for verifying the structure of a page or any entry that links to other entries before or after edits, without issuing one fetch per descendant. Set `include` (1-10, default 2) to control how many levels deep to walk; the CMA caps this at 10.",
|
|
3572
|
+
inputParams: ResolveEntryReferencesToolParams.shape,
|
|
3573
|
+
annotations: {
|
|
3574
|
+
readOnlyHint: true,
|
|
3575
|
+
openWorldHint: false
|
|
3576
|
+
},
|
|
3577
|
+
tool: resolveEntryReferences
|
|
3578
|
+
},
|
|
3579
|
+
getEntrySnapshot: {
|
|
3580
|
+
title: "get_entry_snapshot",
|
|
3581
|
+
description: "Retrieve version history (snapshots) of an entry for safe rollback. Call with only an entryId to list all available snapshots (each has a snapshot ID and metadata). Call with both entryId and snapshotId to retrieve the full field content of that specific snapshot, which can then be used to restore a previous version.",
|
|
3582
|
+
inputParams: GetEntrySnapshotToolParams.shape,
|
|
3583
|
+
annotations: {
|
|
3584
|
+
readOnlyHint: true,
|
|
3585
|
+
openWorldHint: false
|
|
3586
|
+
},
|
|
3587
|
+
tool: getEntrySnapshot
|
|
3588
|
+
},
|
|
3290
3589
|
updateEntry: {
|
|
3291
3590
|
title: "update_entry",
|
|
3292
|
-
description: "Update an existing entry. The handler
|
|
3591
|
+
description: "Update an existing entry. You MUST call get_entry first to read the current state, then pass the sys.version you received as the version parameter. The handler merges your field updates with the existing entry fields, so you only need to provide the fields you want to change. However, for multiple-locale fields, all existing locales must be included in the update. If the version is stale (the entry changed since you read it), the update is rejected and you must re-fetch with get_entry.",
|
|
3293
3592
|
inputParams: UpdateEntryToolParams.shape,
|
|
3294
3593
|
annotations: {
|
|
3295
3594
|
readOnlyHint: false,
|
|
@@ -3363,11 +3662,11 @@ function createEntryTools(config) {
|
|
|
3363
3662
|
}
|
|
3364
3663
|
|
|
3365
3664
|
// src/tools/environments/createEnvironment.ts
|
|
3366
|
-
import { z as
|
|
3665
|
+
import { z as z52 } from "zod";
|
|
3367
3666
|
var CreateEnvironmentToolParams = BaseToolSchema.extend({
|
|
3368
|
-
environmentId:
|
|
3369
|
-
name:
|
|
3370
|
-
sourceEnvironmentId:
|
|
3667
|
+
environmentId: z52.string().describe("The ID of the environment to create"),
|
|
3668
|
+
name: z52.string().describe("The name of the environment to create"),
|
|
3669
|
+
sourceEnvironmentId: z52.string().describe(
|
|
3371
3670
|
"The ID of the source environment to clone from (defaults to master)"
|
|
3372
3671
|
).optional()
|
|
3373
3672
|
});
|
|
@@ -3398,15 +3697,15 @@ function createEnvironmentTool(config) {
|
|
|
3398
3697
|
}
|
|
3399
3698
|
|
|
3400
3699
|
// src/tools/environments/listEnvironments.ts
|
|
3401
|
-
import { z as
|
|
3700
|
+
import { z as z53 } from "zod";
|
|
3402
3701
|
var ListEnvironmentsToolParams = BaseToolSchema.extend({
|
|
3403
|
-
environmentId:
|
|
3702
|
+
environmentId: z53.string().optional().describe(
|
|
3404
3703
|
"The ID of the Contentful environment (not required for listing)"
|
|
3405
3704
|
),
|
|
3406
|
-
limit:
|
|
3407
|
-
skip:
|
|
3408
|
-
select:
|
|
3409
|
-
order:
|
|
3705
|
+
limit: z53.number().optional().describe("Maximum number of environments to return (max 10)"),
|
|
3706
|
+
skip: z53.number().optional().describe("Skip this many environments for pagination"),
|
|
3707
|
+
select: z53.string().optional().describe("Comma-separated list of fields to return"),
|
|
3708
|
+
order: z53.string().optional().describe("Order environments by this field")
|
|
3410
3709
|
});
|
|
3411
3710
|
function listEnvironmentsTool(config) {
|
|
3412
3711
|
async function tool2(args) {
|
|
@@ -3452,13 +3751,13 @@ function listEnvironmentsTool(config) {
|
|
|
3452
3751
|
}
|
|
3453
3752
|
|
|
3454
3753
|
// src/tools/environments/deleteEnvironment.ts
|
|
3455
|
-
import { z as
|
|
3754
|
+
import { z as z54 } from "zod";
|
|
3456
3755
|
var DeleteEnvironmentToolParams = BaseToolSchema.extend({
|
|
3457
|
-
environmentId:
|
|
3458
|
-
confirm:
|
|
3756
|
+
environmentId: z54.string().describe("The ID of the environment to delete"),
|
|
3757
|
+
confirm: z54.boolean().optional().describe(
|
|
3459
3758
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
3460
3759
|
),
|
|
3461
|
-
confirmToken:
|
|
3760
|
+
confirmToken: z54.string().optional().describe(
|
|
3462
3761
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
3463
3762
|
)
|
|
3464
3763
|
});
|
|
@@ -3542,9 +3841,9 @@ function createEnvironmentTools(config) {
|
|
|
3542
3841
|
}
|
|
3543
3842
|
|
|
3544
3843
|
// src/tools/locales/getLocale.ts
|
|
3545
|
-
import { z as
|
|
3844
|
+
import { z as z55 } from "zod";
|
|
3546
3845
|
var GetLocaleToolParams = BaseToolSchema.extend({
|
|
3547
|
-
localeId:
|
|
3846
|
+
localeId: z55.string().describe("The ID of the locale to retrieve")
|
|
3548
3847
|
});
|
|
3549
3848
|
function getLocaleTool(config) {
|
|
3550
3849
|
async function tool2(args) {
|
|
@@ -3561,21 +3860,21 @@ function getLocaleTool(config) {
|
|
|
3561
3860
|
}
|
|
3562
3861
|
|
|
3563
3862
|
// src/tools/locales/createLocale.ts
|
|
3564
|
-
import { z as
|
|
3863
|
+
import { z as z56 } from "zod";
|
|
3565
3864
|
var CreateLocaleToolParams = BaseToolSchema.extend({
|
|
3566
|
-
name:
|
|
3567
|
-
code:
|
|
3568
|
-
fallbackCode:
|
|
3865
|
+
name: z56.string().describe("The name of the locale"),
|
|
3866
|
+
code: z56.string().describe('The locale code (e.g., "en-US")'),
|
|
3867
|
+
fallbackCode: z56.string().nullable().describe(
|
|
3569
3868
|
"The locale code to fallback to when there is no content for the current locale"
|
|
3570
3869
|
),
|
|
3571
|
-
contentDeliveryApi:
|
|
3870
|
+
contentDeliveryApi: z56.boolean().optional().default(true).describe(
|
|
3572
3871
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
3573
3872
|
),
|
|
3574
|
-
contentManagementApi:
|
|
3873
|
+
contentManagementApi: z56.boolean().optional().default(true).describe(
|
|
3575
3874
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
3576
3875
|
),
|
|
3577
|
-
default:
|
|
3578
|
-
optional:
|
|
3876
|
+
default: z56.boolean().optional().default(false).describe("If this is the default locale"),
|
|
3877
|
+
optional: z56.boolean().optional().default(false).describe("If the locale needs to be filled in on entries or not")
|
|
3579
3878
|
});
|
|
3580
3879
|
function createLocaleTool(config) {
|
|
3581
3880
|
async function tool2(args) {
|
|
@@ -3602,13 +3901,13 @@ function createLocaleTool(config) {
|
|
|
3602
3901
|
}
|
|
3603
3902
|
|
|
3604
3903
|
// src/tools/locales/listLocales.ts
|
|
3605
|
-
import { z as
|
|
3904
|
+
import { z as z57 } from "zod";
|
|
3606
3905
|
var ListLocaleToolParams = BaseToolSchema.extend({
|
|
3607
|
-
limit:
|
|
3608
|
-
skip:
|
|
3609
|
-
select:
|
|
3610
|
-
include:
|
|
3611
|
-
order:
|
|
3906
|
+
limit: z57.number().optional().describe("Maximum number of locales to return"),
|
|
3907
|
+
skip: z57.number().optional().describe("Skip this many locales for pagination"),
|
|
3908
|
+
select: z57.string().optional().describe("Comma-separated list of fields to return"),
|
|
3909
|
+
include: z57.number().optional().describe("Include this many levels of linked entries"),
|
|
3910
|
+
order: z57.string().optional().describe("Order locales by this field")
|
|
3612
3911
|
});
|
|
3613
3912
|
function listLocaleTool(config) {
|
|
3614
3913
|
async function tool2(args) {
|
|
@@ -3661,23 +3960,23 @@ function listLocaleTool(config) {
|
|
|
3661
3960
|
}
|
|
3662
3961
|
|
|
3663
3962
|
// src/tools/locales/updateLocale.ts
|
|
3664
|
-
import { z as
|
|
3963
|
+
import { z as z58 } from "zod";
|
|
3665
3964
|
var UpdateLocaleToolParams = BaseToolSchema.extend({
|
|
3666
|
-
localeId:
|
|
3667
|
-
fields:
|
|
3668
|
-
name:
|
|
3965
|
+
localeId: z58.string().describe("The ID of the locale to update"),
|
|
3966
|
+
fields: z58.object({
|
|
3967
|
+
name: z58.string().optional().describe("The name of the locale"),
|
|
3669
3968
|
// NOTE: internal_code changes are not allowed
|
|
3670
|
-
code:
|
|
3671
|
-
fallbackCode:
|
|
3969
|
+
code: z58.string().optional().describe("The code of the locale"),
|
|
3970
|
+
fallbackCode: z58.string().optional().describe(
|
|
3672
3971
|
"The locale code to fallback to when there is no content for the current locale"
|
|
3673
3972
|
),
|
|
3674
|
-
contentDeliveryApi:
|
|
3973
|
+
contentDeliveryApi: z58.boolean().optional().describe(
|
|
3675
3974
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
3676
3975
|
),
|
|
3677
|
-
contentManagementApi:
|
|
3976
|
+
contentManagementApi: z58.boolean().optional().describe(
|
|
3678
3977
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
3679
3978
|
),
|
|
3680
|
-
optional:
|
|
3979
|
+
optional: z58.boolean().optional().describe("If the locale needs to be filled in on entries or not")
|
|
3681
3980
|
})
|
|
3682
3981
|
});
|
|
3683
3982
|
function updateLocaleTool(config) {
|
|
@@ -3707,13 +4006,13 @@ function updateLocaleTool(config) {
|
|
|
3707
4006
|
}
|
|
3708
4007
|
|
|
3709
4008
|
// src/tools/locales/deleteLocale.ts
|
|
3710
|
-
import { z as
|
|
4009
|
+
import { z as z59 } from "zod";
|
|
3711
4010
|
var DeleteLocaleToolParams = BaseToolSchema.extend({
|
|
3712
|
-
localeId:
|
|
3713
|
-
confirm:
|
|
4011
|
+
localeId: z59.string().describe("The ID of the locale to delete"),
|
|
4012
|
+
confirm: z59.boolean().optional().describe(
|
|
3714
4013
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
3715
4014
|
),
|
|
3716
|
-
confirmToken:
|
|
4015
|
+
confirmToken: z59.string().optional().describe(
|
|
3717
4016
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
3718
4017
|
)
|
|
3719
4018
|
});
|
|
@@ -3820,13 +4119,13 @@ function createLocaleTools(config) {
|
|
|
3820
4119
|
}
|
|
3821
4120
|
|
|
3822
4121
|
// src/tools/orgs/listOrgs.ts
|
|
3823
|
-
import { z as
|
|
4122
|
+
import { z as z60 } from "zod";
|
|
3824
4123
|
import { createClient as createClient2 } from "contentful-management";
|
|
3825
|
-
var ListOrgsToolParams =
|
|
3826
|
-
limit:
|
|
3827
|
-
skip:
|
|
3828
|
-
select:
|
|
3829
|
-
order:
|
|
4124
|
+
var ListOrgsToolParams = z60.object({
|
|
4125
|
+
limit: z60.number().optional().describe("Maximum number of organizations to return (max 10)"),
|
|
4126
|
+
skip: z60.number().optional().describe("Skip this many organizations for pagination"),
|
|
4127
|
+
select: z60.string().optional().describe("Comma-separated list of fields to return"),
|
|
4128
|
+
order: z60.string().optional().describe("Order organizations by this field")
|
|
3830
4129
|
});
|
|
3831
4130
|
function listOrgsTool(config) {
|
|
3832
4131
|
async function tool2(args) {
|
|
@@ -3868,10 +4167,10 @@ function listOrgsTool(config) {
|
|
|
3868
4167
|
}
|
|
3869
4168
|
|
|
3870
4169
|
// src/tools/orgs/getOrg.ts
|
|
3871
|
-
import { z as
|
|
4170
|
+
import { z as z61 } from "zod";
|
|
3872
4171
|
import { createClient as createClient3 } from "contentful-management";
|
|
3873
|
-
var GetOrgToolParams =
|
|
3874
|
-
organizationId:
|
|
4172
|
+
var GetOrgToolParams = z61.object({
|
|
4173
|
+
organizationId: z61.string().describe("The ID of the organization to retrieve")
|
|
3875
4174
|
});
|
|
3876
4175
|
function getOrgTool(config) {
|
|
3877
4176
|
async function tool2(args) {
|
|
@@ -3917,13 +4216,13 @@ function createOrgTools(config) {
|
|
|
3917
4216
|
}
|
|
3918
4217
|
|
|
3919
4218
|
// src/tools/spaces/listSpaces.ts
|
|
3920
|
-
import { z as
|
|
4219
|
+
import { z as z62 } from "zod";
|
|
3921
4220
|
import { createClient as createClient4 } from "contentful-management";
|
|
3922
|
-
var ListSpacesToolParams =
|
|
3923
|
-
limit:
|
|
3924
|
-
skip:
|
|
3925
|
-
select:
|
|
3926
|
-
order:
|
|
4221
|
+
var ListSpacesToolParams = z62.object({
|
|
4222
|
+
limit: z62.number().optional().describe("Maximum number of spaces to return (max 10)"),
|
|
4223
|
+
skip: z62.number().optional().describe("Skip this many spaces for pagination"),
|
|
4224
|
+
select: z62.string().optional().describe("Comma-separated list of fields to return"),
|
|
4225
|
+
order: z62.string().optional().describe("Order spaces by this field")
|
|
3927
4226
|
});
|
|
3928
4227
|
function listSpacesTool(config) {
|
|
3929
4228
|
async function tool2(args) {
|
|
@@ -3965,10 +4264,10 @@ function listSpacesTool(config) {
|
|
|
3965
4264
|
}
|
|
3966
4265
|
|
|
3967
4266
|
// src/tools/spaces/getSpace.ts
|
|
3968
|
-
import { z as
|
|
4267
|
+
import { z as z63 } from "zod";
|
|
3969
4268
|
import { createClient as createClient5 } from "contentful-management";
|
|
3970
|
-
var GetSpaceToolParams =
|
|
3971
|
-
spaceId:
|
|
4269
|
+
var GetSpaceToolParams = z63.object({
|
|
4270
|
+
spaceId: z63.string().describe("The ID of the space to retrieve")
|
|
3972
4271
|
});
|
|
3973
4272
|
function getSpaceTool(config) {
|
|
3974
4273
|
async function tool2(args) {
|
|
@@ -4012,12 +4311,12 @@ function createSpaceTools(config) {
|
|
|
4012
4311
|
}
|
|
4013
4312
|
|
|
4014
4313
|
// src/tools/tags/listTags.ts
|
|
4015
|
-
import { z as
|
|
4314
|
+
import { z as z64 } from "zod";
|
|
4016
4315
|
var ListTagsToolParams = BaseToolSchema.extend({
|
|
4017
|
-
limit:
|
|
4018
|
-
skip:
|
|
4019
|
-
select:
|
|
4020
|
-
order:
|
|
4316
|
+
limit: z64.number().optional().describe("Maximum number of tags to return"),
|
|
4317
|
+
skip: z64.number().optional().describe("Skip this many tags for pagination"),
|
|
4318
|
+
select: z64.string().optional().describe("Comma-separated list of fields to return"),
|
|
4319
|
+
order: z64.string().optional().describe("Order tags by this field")
|
|
4021
4320
|
});
|
|
4022
4321
|
function listTagsTool(config) {
|
|
4023
4322
|
async function tool2(args) {
|
|
@@ -4063,11 +4362,11 @@ function listTagsTool(config) {
|
|
|
4063
4362
|
}
|
|
4064
4363
|
|
|
4065
4364
|
// src/tools/tags/createTag.ts
|
|
4066
|
-
import { z as
|
|
4365
|
+
import { z as z65 } from "zod";
|
|
4067
4366
|
var CreateTagToolParams = BaseToolSchema.extend({
|
|
4068
|
-
name:
|
|
4069
|
-
id:
|
|
4070
|
-
visibility:
|
|
4367
|
+
name: z65.string().describe("The name of the tag"),
|
|
4368
|
+
id: z65.string().describe("The ID of the tag"),
|
|
4369
|
+
visibility: z65.enum(["public", "private"]).describe("The visibility of the tag. Default to private if not specified")
|
|
4071
4370
|
});
|
|
4072
4371
|
function createTagTool(config) {
|
|
4073
4372
|
async function tool2(args) {
|
|
@@ -4121,34 +4420,34 @@ function createTagTools(config) {
|
|
|
4121
4420
|
}
|
|
4122
4421
|
|
|
4123
4422
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4124
|
-
import { z as
|
|
4423
|
+
import { z as z67 } from "zod";
|
|
4125
4424
|
import { createClient as createClient6 } from "contentful-management";
|
|
4126
4425
|
|
|
4127
4426
|
// src/types/conceptPayloadTypes.ts
|
|
4128
|
-
import { z as
|
|
4129
|
-
var TaxonomyConceptLinkSchema =
|
|
4130
|
-
sys:
|
|
4131
|
-
type:
|
|
4132
|
-
linkType:
|
|
4133
|
-
id:
|
|
4427
|
+
import { z as z66 } from "zod";
|
|
4428
|
+
var TaxonomyConceptLinkSchema = z66.object({
|
|
4429
|
+
sys: z66.object({
|
|
4430
|
+
type: z66.literal("Link"),
|
|
4431
|
+
linkType: z66.literal("TaxonomyConcept"),
|
|
4432
|
+
id: z66.string()
|
|
4134
4433
|
})
|
|
4135
4434
|
});
|
|
4136
4435
|
|
|
4137
4436
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4138
|
-
var CreateConceptSchemeToolParams =
|
|
4139
|
-
organizationId:
|
|
4140
|
-
conceptSchemeId:
|
|
4437
|
+
var CreateConceptSchemeToolParams = z67.object({
|
|
4438
|
+
organizationId: z67.string().describe("The ID of the Contentful organization"),
|
|
4439
|
+
conceptSchemeId: z67.string().optional().describe(
|
|
4141
4440
|
"Optional user-defined ID for the concept scheme. If not provided, Contentful will generate one automatically."
|
|
4142
4441
|
),
|
|
4143
|
-
prefLabel:
|
|
4144
|
-
uri:
|
|
4145
|
-
definition:
|
|
4146
|
-
editorialNote:
|
|
4147
|
-
historyNote:
|
|
4148
|
-
example:
|
|
4149
|
-
note:
|
|
4150
|
-
scopeNote:
|
|
4151
|
-
topConcepts:
|
|
4442
|
+
prefLabel: z67.record(z67.string()).describe("The preferred label for the concept scheme (localized)"),
|
|
4443
|
+
uri: z67.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
4444
|
+
definition: z67.record(z67.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
4445
|
+
editorialNote: z67.record(z67.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
4446
|
+
historyNote: z67.record(z67.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
4447
|
+
example: z67.record(z67.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
4448
|
+
note: z67.record(z67.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
4449
|
+
scopeNote: z67.record(z67.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
4450
|
+
topConcepts: z67.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme")
|
|
4152
4451
|
});
|
|
4153
4452
|
function createConceptSchemeTool(config) {
|
|
4154
4453
|
async function tool2(args) {
|
|
@@ -4188,11 +4487,11 @@ function createConceptSchemeTool(config) {
|
|
|
4188
4487
|
}
|
|
4189
4488
|
|
|
4190
4489
|
// src/tools/taxonomies/concept-schemes/getConceptScheme.ts
|
|
4191
|
-
import { z as
|
|
4490
|
+
import { z as z68 } from "zod";
|
|
4192
4491
|
import { createClient as createClient7 } from "contentful-management";
|
|
4193
|
-
var GetConceptSchemeToolParams =
|
|
4194
|
-
organizationId:
|
|
4195
|
-
conceptSchemeId:
|
|
4492
|
+
var GetConceptSchemeToolParams = z68.object({
|
|
4493
|
+
organizationId: z68.string().describe("The ID of the Contentful organization"),
|
|
4494
|
+
conceptSchemeId: z68.string().describe("The ID of the concept scheme to retrieve")
|
|
4196
4495
|
});
|
|
4197
4496
|
function getConceptSchemeTool(config) {
|
|
4198
4497
|
async function tool2(args) {
|
|
@@ -4212,25 +4511,25 @@ function getConceptSchemeTool(config) {
|
|
|
4212
4511
|
}
|
|
4213
4512
|
|
|
4214
4513
|
// src/tools/taxonomies/concept-schemes/listConceptSchemes.ts
|
|
4215
|
-
import { z as
|
|
4514
|
+
import { z as z69 } from "zod";
|
|
4216
4515
|
import { createClient as createClient8 } from "contentful-management";
|
|
4217
4516
|
import { cloneDeep } from "lodash-es";
|
|
4218
|
-
var ListConceptSchemesToolParams =
|
|
4219
|
-
organizationId:
|
|
4220
|
-
query:
|
|
4221
|
-
|
|
4222
|
-
query:
|
|
4223
|
-
pageNext:
|
|
4224
|
-
pagePrev:
|
|
4517
|
+
var ListConceptSchemesToolParams = z69.object({
|
|
4518
|
+
organizationId: z69.string(),
|
|
4519
|
+
query: z69.union([
|
|
4520
|
+
z69.object({
|
|
4521
|
+
query: z69.string().optional(),
|
|
4522
|
+
pageNext: z69.string().optional().describe("Cursor token for the next page of concept schemes"),
|
|
4523
|
+
pagePrev: z69.string().optional().describe(
|
|
4225
4524
|
"Cursor token for the previous page of concept schemes"
|
|
4226
4525
|
),
|
|
4227
|
-
limit:
|
|
4228
|
-
order:
|
|
4229
|
-
skip:
|
|
4526
|
+
limit: z69.number().optional().describe("Maximum number of concept schemes to return"),
|
|
4527
|
+
order: z69.string().optional().describe("Order concept schemes by this field"),
|
|
4528
|
+
skip: z69.never().optional()
|
|
4230
4529
|
}).passthrough(),
|
|
4231
4530
|
// handles [key: string]: any from BasicQueryOptions
|
|
4232
|
-
|
|
4233
|
-
pageUrl:
|
|
4531
|
+
z69.object({
|
|
4532
|
+
pageUrl: z69.string().optional()
|
|
4234
4533
|
})
|
|
4235
4534
|
]).optional().describe(
|
|
4236
4535
|
'Query parameters for listing concept schemes, supports either pageUrl for cursor-based pagination. Offset "skip" pagination is not supported.'
|
|
@@ -4300,22 +4599,22 @@ function listConceptSchemesTool(config) {
|
|
|
4300
4599
|
}
|
|
4301
4600
|
|
|
4302
4601
|
// src/tools/taxonomies/concept-schemes/updateConceptScheme.ts
|
|
4303
|
-
import { z as
|
|
4602
|
+
import { z as z70 } from "zod";
|
|
4304
4603
|
import { createClient as createClient9 } from "contentful-management";
|
|
4305
|
-
var UpdateConceptSchemeToolParams =
|
|
4306
|
-
organizationId:
|
|
4307
|
-
conceptSchemeId:
|
|
4308
|
-
version:
|
|
4309
|
-
prefLabel:
|
|
4310
|
-
uri:
|
|
4311
|
-
definition:
|
|
4312
|
-
editorialNote:
|
|
4313
|
-
historyNote:
|
|
4314
|
-
example:
|
|
4315
|
-
note:
|
|
4316
|
-
scopeNote:
|
|
4317
|
-
topConcepts:
|
|
4318
|
-
addConcept:
|
|
4604
|
+
var UpdateConceptSchemeToolParams = z70.object({
|
|
4605
|
+
organizationId: z70.string().describe("The ID of the Contentful organization"),
|
|
4606
|
+
conceptSchemeId: z70.string().describe("The ID of the concept scheme to update"),
|
|
4607
|
+
version: z70.number().describe("The current version of the concept scheme"),
|
|
4608
|
+
prefLabel: z70.record(z70.string()).optional().describe("The preferred label for the concept scheme (localized)"),
|
|
4609
|
+
uri: z70.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
4610
|
+
definition: z70.record(z70.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
4611
|
+
editorialNote: z70.record(z70.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
4612
|
+
historyNote: z70.record(z70.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
4613
|
+
example: z70.record(z70.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
4614
|
+
note: z70.record(z70.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
4615
|
+
scopeNote: z70.record(z70.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
4616
|
+
topConcepts: z70.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme"),
|
|
4617
|
+
addConcept: z70.string().optional().describe(
|
|
4319
4618
|
"ID of a concept to add to this scheme (adds to both concepts and topConcepts)"
|
|
4320
4619
|
)
|
|
4321
4620
|
});
|
|
@@ -4390,15 +4689,15 @@ function updateConceptSchemeTool(config) {
|
|
|
4390
4689
|
}
|
|
4391
4690
|
|
|
4392
4691
|
// src/tools/taxonomies/concept-schemes/deleteConceptScheme.ts
|
|
4393
|
-
import { z as
|
|
4692
|
+
import { z as z71 } from "zod";
|
|
4394
4693
|
import { createClient as createClient10 } from "contentful-management";
|
|
4395
|
-
var DeleteConceptSchemeToolParams =
|
|
4396
|
-
organizationId:
|
|
4397
|
-
conceptSchemeId:
|
|
4398
|
-
confirm:
|
|
4694
|
+
var DeleteConceptSchemeToolParams = z71.object({
|
|
4695
|
+
organizationId: z71.string().describe("The ID of the Contentful organization"),
|
|
4696
|
+
conceptSchemeId: z71.string().describe("The ID of the concept scheme to delete"),
|
|
4697
|
+
confirm: z71.boolean().optional().describe(
|
|
4399
4698
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4400
4699
|
),
|
|
4401
|
-
confirmToken:
|
|
4700
|
+
confirmToken: z71.string().optional().describe(
|
|
4402
4701
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4403
4702
|
)
|
|
4404
4703
|
});
|
|
@@ -4507,26 +4806,26 @@ function createConceptSchemeTools(config) {
|
|
|
4507
4806
|
}
|
|
4508
4807
|
|
|
4509
4808
|
// src/tools/taxonomies/concepts/createConcept.ts
|
|
4510
|
-
import { z as
|
|
4809
|
+
import { z as z72 } from "zod";
|
|
4511
4810
|
import { createClient as createClient11 } from "contentful-management";
|
|
4512
|
-
var CreateConceptToolParams =
|
|
4513
|
-
organizationId:
|
|
4514
|
-
conceptId:
|
|
4811
|
+
var CreateConceptToolParams = z72.object({
|
|
4812
|
+
organizationId: z72.string().describe("The ID of the Contentful organization"),
|
|
4813
|
+
conceptId: z72.string().optional().describe(
|
|
4515
4814
|
"Optional user-defined ID for the concept. If not provided, Contentful will generate one automatically."
|
|
4516
4815
|
),
|
|
4517
|
-
prefLabel:
|
|
4518
|
-
uri:
|
|
4519
|
-
altLabels:
|
|
4520
|
-
hiddenLabels:
|
|
4521
|
-
definition:
|
|
4522
|
-
editorialNote:
|
|
4523
|
-
historyNote:
|
|
4524
|
-
example:
|
|
4525
|
-
note:
|
|
4526
|
-
scopeNote:
|
|
4527
|
-
notations:
|
|
4528
|
-
broader:
|
|
4529
|
-
related:
|
|
4816
|
+
prefLabel: z72.record(z72.string()).describe("The preferred label for the concept (localized)"),
|
|
4817
|
+
uri: z72.string().nullable().optional().describe("The URI for the concept"),
|
|
4818
|
+
altLabels: z72.record(z72.array(z72.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
4819
|
+
hiddenLabels: z72.record(z72.array(z72.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
4820
|
+
definition: z72.record(z72.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
4821
|
+
editorialNote: z72.record(z72.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
4822
|
+
historyNote: z72.record(z72.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
4823
|
+
example: z72.record(z72.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
4824
|
+
note: z72.record(z72.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
4825
|
+
scopeNote: z72.record(z72.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
4826
|
+
notations: z72.array(z72.string()).optional().describe("Notations for the concept"),
|
|
4827
|
+
broader: z72.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
4828
|
+
related: z72.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4530
4829
|
});
|
|
4531
4830
|
function createConceptTool(config) {
|
|
4532
4831
|
async function tool2(args) {
|
|
@@ -4561,15 +4860,15 @@ function createConceptTool(config) {
|
|
|
4561
4860
|
}
|
|
4562
4861
|
|
|
4563
4862
|
// src/tools/taxonomies/concepts/deleteConcept.ts
|
|
4564
|
-
import { z as
|
|
4863
|
+
import { z as z73 } from "zod";
|
|
4565
4864
|
import { createClient as createClient12 } from "contentful-management";
|
|
4566
|
-
var DeleteConceptToolParams =
|
|
4567
|
-
organizationId:
|
|
4568
|
-
conceptId:
|
|
4569
|
-
confirm:
|
|
4865
|
+
var DeleteConceptToolParams = z73.object({
|
|
4866
|
+
organizationId: z73.string().describe("The ID of the Contentful organization"),
|
|
4867
|
+
conceptId: z73.string().describe("The ID of the concept to delete"),
|
|
4868
|
+
confirm: z73.boolean().optional().describe(
|
|
4570
4869
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4571
4870
|
),
|
|
4572
|
-
confirmToken:
|
|
4871
|
+
confirmToken: z73.string().optional().describe(
|
|
4573
4872
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4574
4873
|
)
|
|
4575
4874
|
});
|
|
@@ -4606,25 +4905,25 @@ function deleteConceptTool(config) {
|
|
|
4606
4905
|
}
|
|
4607
4906
|
|
|
4608
4907
|
// src/tools/taxonomies/concepts/updateConcept.ts
|
|
4609
|
-
import { z as
|
|
4908
|
+
import { z as z74 } from "zod";
|
|
4610
4909
|
import { createClient as createClient13 } from "contentful-management";
|
|
4611
|
-
var UpdateConceptToolParams =
|
|
4612
|
-
organizationId:
|
|
4613
|
-
conceptId:
|
|
4614
|
-
version:
|
|
4615
|
-
prefLabel:
|
|
4616
|
-
uri:
|
|
4617
|
-
altLabels:
|
|
4618
|
-
hiddenLabels:
|
|
4619
|
-
definition:
|
|
4620
|
-
editorialNote:
|
|
4621
|
-
historyNote:
|
|
4622
|
-
example:
|
|
4623
|
-
note:
|
|
4624
|
-
scopeNote:
|
|
4625
|
-
notations:
|
|
4626
|
-
broader:
|
|
4627
|
-
related:
|
|
4910
|
+
var UpdateConceptToolParams = z74.object({
|
|
4911
|
+
organizationId: z74.string().describe("The ID of the Contentful organization"),
|
|
4912
|
+
conceptId: z74.string().describe("The ID of the concept to update"),
|
|
4913
|
+
version: z74.number().describe("The current version of the concept"),
|
|
4914
|
+
prefLabel: z74.record(z74.string()).optional().describe("The preferred label for the concept (localized)"),
|
|
4915
|
+
uri: z74.string().nullable().optional().describe("The URI for the concept"),
|
|
4916
|
+
altLabels: z74.record(z74.array(z74.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
4917
|
+
hiddenLabels: z74.record(z74.array(z74.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
4918
|
+
definition: z74.record(z74.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
4919
|
+
editorialNote: z74.record(z74.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
4920
|
+
historyNote: z74.record(z74.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
4921
|
+
example: z74.record(z74.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
4922
|
+
note: z74.record(z74.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
4923
|
+
scopeNote: z74.record(z74.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
4924
|
+
notations: z74.array(z74.string()).optional().describe("Notations for the concept"),
|
|
4925
|
+
broader: z74.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
4926
|
+
related: z74.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4628
4927
|
});
|
|
4629
4928
|
function updateConceptTool(config) {
|
|
4630
4929
|
async function tool2(args) {
|
|
@@ -4666,11 +4965,11 @@ function updateConceptTool(config) {
|
|
|
4666
4965
|
}
|
|
4667
4966
|
|
|
4668
4967
|
// src/tools/taxonomies/concepts/getConcept.ts
|
|
4669
|
-
import { z as
|
|
4968
|
+
import { z as z75 } from "zod";
|
|
4670
4969
|
import { createClient as createClient14 } from "contentful-management";
|
|
4671
|
-
var GetConceptToolParams =
|
|
4672
|
-
organizationId:
|
|
4673
|
-
conceptId:
|
|
4970
|
+
var GetConceptToolParams = z75.object({
|
|
4971
|
+
organizationId: z75.string().describe("The ID of the Contentful organization"),
|
|
4972
|
+
conceptId: z75.string().describe("The ID of the concept to retrieve")
|
|
4674
4973
|
});
|
|
4675
4974
|
function getConceptTool(config) {
|
|
4676
4975
|
async function tool2(args) {
|
|
@@ -4687,18 +4986,18 @@ function getConceptTool(config) {
|
|
|
4687
4986
|
}
|
|
4688
4987
|
|
|
4689
4988
|
// src/tools/taxonomies/concepts/listConcepts.ts
|
|
4690
|
-
import { z as
|
|
4989
|
+
import { z as z76 } from "zod";
|
|
4691
4990
|
import { createClient as createClient15 } from "contentful-management";
|
|
4692
|
-
var ListConceptsToolParams =
|
|
4693
|
-
organizationId:
|
|
4694
|
-
conceptId:
|
|
4695
|
-
limit:
|
|
4696
|
-
select:
|
|
4697
|
-
include:
|
|
4698
|
-
order:
|
|
4699
|
-
getDescendants:
|
|
4700
|
-
getAncestors:
|
|
4701
|
-
getTotalOnly:
|
|
4991
|
+
var ListConceptsToolParams = z76.object({
|
|
4992
|
+
organizationId: z76.string().describe("The ID of the Contentful organization"),
|
|
4993
|
+
conceptId: z76.string().optional().describe("The ID of the concept (required for descendants/ancestors)"),
|
|
4994
|
+
limit: z76.number().optional().describe("Maximum number of concepts to return"),
|
|
4995
|
+
select: z76.string().optional().describe("Comma-separated list of fields to return"),
|
|
4996
|
+
include: z76.number().optional().describe("Include this many levels of linked entries"),
|
|
4997
|
+
order: z76.string().optional().describe("Order concepts by this field"),
|
|
4998
|
+
getDescendants: z76.boolean().optional().describe("Get descendants of the specified concept (requires conceptId)"),
|
|
4999
|
+
getAncestors: z76.boolean().optional().describe("Get ancestors of the specified concept (requires conceptId)"),
|
|
5000
|
+
getTotalOnly: z76.boolean().optional().describe("Get only the total number of concepts without full data")
|
|
4702
5001
|
});
|
|
4703
5002
|
function listConceptsTool(config) {
|
|
4704
5003
|
async function tool2(args) {
|
|
@@ -4874,54 +5173,54 @@ function createTaxonomyTools(config) {
|
|
|
4874
5173
|
}
|
|
4875
5174
|
|
|
4876
5175
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
4877
|
-
import { z as
|
|
5176
|
+
import { z as z78 } from "zod";
|
|
4878
5177
|
|
|
4879
5178
|
// src/types/querySchema.ts
|
|
4880
|
-
import { z as
|
|
4881
|
-
var EntryQuerySchema =
|
|
4882
|
-
content_type:
|
|
4883
|
-
include:
|
|
4884
|
-
select:
|
|
4885
|
-
links_to_entry:
|
|
4886
|
-
limit:
|
|
4887
|
-
skip:
|
|
4888
|
-
order:
|
|
5179
|
+
import { z as z77 } from "zod";
|
|
5180
|
+
var EntryQuerySchema = z77.object({
|
|
5181
|
+
content_type: z77.string().optional().describe("Filter by content type"),
|
|
5182
|
+
include: z77.number().optional().describe("Include this many levels of linked entries"),
|
|
5183
|
+
select: z77.string().optional().describe("Comma-separated list of fields to return"),
|
|
5184
|
+
links_to_entry: z77.string().optional().describe("Find entries that link to the specified entry ID"),
|
|
5185
|
+
limit: z77.number().optional().describe("Maximum number of entries to return"),
|
|
5186
|
+
skip: z77.number().optional().describe("Skip this many entries"),
|
|
5187
|
+
order: z77.string().optional().describe("Order entries by this field")
|
|
4889
5188
|
});
|
|
4890
|
-
var AssetQuerySchema =
|
|
4891
|
-
mimetype_group:
|
|
4892
|
-
select:
|
|
4893
|
-
limit:
|
|
4894
|
-
skip:
|
|
4895
|
-
order:
|
|
5189
|
+
var AssetQuerySchema = z77.object({
|
|
5190
|
+
mimetype_group: z77.string().optional().describe("Filter by MIME type group"),
|
|
5191
|
+
select: z77.string().optional().describe("Comma-separated list of fields to return"),
|
|
5192
|
+
limit: z77.number().optional().describe("Maximum number of assets to return"),
|
|
5193
|
+
skip: z77.number().optional().describe("Skip this many assets"),
|
|
5194
|
+
order: z77.string().optional().describe("Order assets by this field")
|
|
4896
5195
|
});
|
|
4897
5196
|
|
|
4898
5197
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
4899
5198
|
var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
4900
|
-
exportDir:
|
|
5199
|
+
exportDir: z78.string().optional().describe(
|
|
4901
5200
|
"Directory to save the exported space data (optional, defaults to current directory)"
|
|
4902
5201
|
),
|
|
4903
|
-
saveFile:
|
|
4904
|
-
contentFile:
|
|
4905
|
-
includeDrafts:
|
|
4906
|
-
includeArchived:
|
|
4907
|
-
skipContentModel:
|
|
4908
|
-
skipEditorInterfaces:
|
|
4909
|
-
skipContent:
|
|
4910
|
-
skipRoles:
|
|
4911
|
-
skipTags:
|
|
4912
|
-
skipWebhooks:
|
|
4913
|
-
stripTags:
|
|
4914
|
-
contentOnly:
|
|
5202
|
+
saveFile: z78.boolean().optional().default(true).describe("Save the exported space data to a file"),
|
|
5203
|
+
contentFile: z78.string().optional().describe("Custom filename for the exported space data (optional)"),
|
|
5204
|
+
includeDrafts: z78.boolean().optional().default(false).describe("Include draft entries in the export"),
|
|
5205
|
+
includeArchived: z78.boolean().optional().default(false).describe("Include archived entries in the export"),
|
|
5206
|
+
skipContentModel: z78.boolean().optional().default(false).describe("Skip exporting content types"),
|
|
5207
|
+
skipEditorInterfaces: z78.boolean().optional().default(false).describe("Skip exporting editor interfaces"),
|
|
5208
|
+
skipContent: z78.boolean().optional().default(false).describe("Skip exporting entries and assets"),
|
|
5209
|
+
skipRoles: z78.boolean().optional().default(false).describe("Skip exporting roles and permissions"),
|
|
5210
|
+
skipTags: z78.boolean().optional().default(false).describe("Skip exporting tags"),
|
|
5211
|
+
skipWebhooks: z78.boolean().optional().default(false).describe("Skip exporting webhooks"),
|
|
5212
|
+
stripTags: z78.boolean().optional().default(false).describe("Untag assets and entries"),
|
|
5213
|
+
contentOnly: z78.boolean().optional().default(false).describe("Only export assets and entries"),
|
|
4915
5214
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
4916
5215
|
"Export only entries that match query parameters"
|
|
4917
5216
|
),
|
|
4918
5217
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
4919
5218
|
"Export only assets that match query parameters"
|
|
4920
5219
|
),
|
|
4921
|
-
downloadAssets:
|
|
4922
|
-
maxAllowedLimit:
|
|
4923
|
-
errorLogFile:
|
|
4924
|
-
useVerboseRenderer:
|
|
5220
|
+
downloadAssets: z78.boolean().optional().default(false).describe("Download actual asset files"),
|
|
5221
|
+
maxAllowedLimit: z78.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
5222
|
+
errorLogFile: z78.string().optional().describe("Path to error log output file"),
|
|
5223
|
+
useVerboseRenderer: z78.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
4925
5224
|
});
|
|
4926
5225
|
function createExportSpaceTool(config) {
|
|
4927
5226
|
async function tool2(args) {
|
|
@@ -4971,70 +5270,70 @@ function createExportSpaceTool(config) {
|
|
|
4971
5270
|
}
|
|
4972
5271
|
|
|
4973
5272
|
// src/tools/jobs/space-to-space-migration/paramCollection.ts
|
|
4974
|
-
import { z as
|
|
5273
|
+
import { z as z79 } from "zod";
|
|
4975
5274
|
var ParamCollectionToolParams = BaseToolSchema.extend({
|
|
4976
|
-
confirmation:
|
|
5275
|
+
confirmation: z79.boolean().optional().describe(
|
|
4977
5276
|
"User confirmation that they are ready to proceed with the workflow"
|
|
4978
5277
|
),
|
|
4979
|
-
export:
|
|
4980
|
-
spaceId:
|
|
4981
|
-
environmentId:
|
|
4982
|
-
deliveryToken:
|
|
4983
|
-
exportDir:
|
|
4984
|
-
saveFile:
|
|
4985
|
-
contentFile:
|
|
4986
|
-
includeDrafts:
|
|
4987
|
-
includeArchived:
|
|
4988
|
-
skipContentModel:
|
|
4989
|
-
skipEditorInterfaces:
|
|
4990
|
-
skipContent:
|
|
4991
|
-
skipRoles:
|
|
4992
|
-
skipTags:
|
|
4993
|
-
skipWebhooks:
|
|
4994
|
-
stripTags:
|
|
4995
|
-
contentOnly:
|
|
5278
|
+
export: z79.object({
|
|
5279
|
+
spaceId: z79.string().optional().describe("ID of the space with source data"),
|
|
5280
|
+
environmentId: z79.string().optional().describe("ID of the environment in the source space"),
|
|
5281
|
+
deliveryToken: z79.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
5282
|
+
exportDir: z79.string().optional().describe("Path to export JSON output"),
|
|
5283
|
+
saveFile: z79.boolean().optional().describe("Save the export as a JSON file"),
|
|
5284
|
+
contentFile: z79.string().optional().describe("Filename for exported data"),
|
|
5285
|
+
includeDrafts: z79.boolean().optional().describe("Include drafts in exported entries"),
|
|
5286
|
+
includeArchived: z79.boolean().optional().describe("Include archived entries"),
|
|
5287
|
+
skipContentModel: z79.boolean().optional().describe("Skip exporting content models"),
|
|
5288
|
+
skipEditorInterfaces: z79.boolean().optional().describe("Skip exporting editor interfaces"),
|
|
5289
|
+
skipContent: z79.boolean().optional().describe("Skip exporting entries and assets"),
|
|
5290
|
+
skipRoles: z79.boolean().optional().describe("Skip exporting roles and permissions"),
|
|
5291
|
+
skipTags: z79.boolean().optional().describe("Skip exporting tags"),
|
|
5292
|
+
skipWebhooks: z79.boolean().optional().describe("Skip exporting webhooks"),
|
|
5293
|
+
stripTags: z79.boolean().optional().describe("Remove tags from entries and assets"),
|
|
5294
|
+
contentOnly: z79.boolean().optional().describe("Export only entries and assets"),
|
|
4996
5295
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
4997
5296
|
"Export only entries that match query parameters"
|
|
4998
5297
|
),
|
|
4999
5298
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
5000
5299
|
"Export only assets that match query parameters"
|
|
5001
5300
|
),
|
|
5002
|
-
downloadAssets:
|
|
5003
|
-
host:
|
|
5004
|
-
hostDelivery:
|
|
5005
|
-
proxy:
|
|
5006
|
-
rawProxy:
|
|
5007
|
-
maxAllowedLimit:
|
|
5008
|
-
headers:
|
|
5009
|
-
errorLogFile:
|
|
5010
|
-
useVerboseRenderer:
|
|
5011
|
-
config:
|
|
5301
|
+
downloadAssets: z79.boolean().optional().describe("Download asset files to disk"),
|
|
5302
|
+
host: z79.string().optional().describe("Management API host"),
|
|
5303
|
+
hostDelivery: z79.string().optional().describe("Delivery API host"),
|
|
5304
|
+
proxy: z79.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
5305
|
+
rawProxy: z79.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
5306
|
+
maxAllowedLimit: z79.number().optional().describe("Page size for requests"),
|
|
5307
|
+
headers: z79.record(z79.any()).optional().describe("Additional headers to include in requests"),
|
|
5308
|
+
errorLogFile: z79.string().optional().describe("Path to error log output file"),
|
|
5309
|
+
useVerboseRenderer: z79.boolean().optional().describe("Line-by-line logging, useful for CI"),
|
|
5310
|
+
config: z79.string().optional().describe("Path to a JSON config file with all options")
|
|
5012
5311
|
}).optional(),
|
|
5013
|
-
import:
|
|
5014
|
-
spaceId:
|
|
5015
|
-
environmentId:
|
|
5016
|
-
contentFile:
|
|
5017
|
-
content:
|
|
5312
|
+
import: z79.object({
|
|
5313
|
+
spaceId: z79.string().optional().describe("ID of the space to import into"),
|
|
5314
|
+
environmentId: z79.string().optional().describe("Target environment in destination space"),
|
|
5315
|
+
contentFile: z79.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5316
|
+
content: z79.record(z79.any()).optional().describe(
|
|
5018
5317
|
"JS object containing import content (must match expected structure)"
|
|
5019
5318
|
),
|
|
5020
|
-
contentModelOnly:
|
|
5021
|
-
skipContentModel:
|
|
5022
|
-
skipLocales:
|
|
5023
|
-
skipContentUpdates:
|
|
5024
|
-
skipContentPublishing:
|
|
5025
|
-
uploadAssets:
|
|
5026
|
-
skipAssetUpdates:
|
|
5027
|
-
assetsDirectory:
|
|
5028
|
-
timeout:
|
|
5029
|
-
retryLimit:
|
|
5030
|
-
host:
|
|
5031
|
-
proxy:
|
|
5032
|
-
rawProxy:
|
|
5033
|
-
rateLimit:
|
|
5034
|
-
headers:
|
|
5035
|
-
errorLogFile:
|
|
5036
|
-
useVerboseRenderer:
|
|
5037
|
-
config:
|
|
5319
|
+
contentModelOnly: z79.boolean().optional().describe("Import only content types"),
|
|
5320
|
+
skipContentModel: z79.boolean().optional().describe("Skip importing content types and locales"),
|
|
5321
|
+
skipLocales: z79.boolean().optional().describe("Skip importing locales"),
|
|
5322
|
+
skipContentUpdates: z79.boolean().optional().describe("Do not update existing content"),
|
|
5323
|
+
skipContentPublishing: z79.boolean().optional().describe("Create but do not publish content"),
|
|
5324
|
+
uploadAssets: z79.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
|
|
5325
|
+
skipAssetUpdates: z79.boolean().optional().describe("Do not update existing assets"),
|
|
5326
|
+
assetsDirectory: z79.string().optional().describe("Path to directory containing exported asset files"),
|
|
5327
|
+
timeout: z79.number().optional().describe("Time between retries during asset processing (ms)"),
|
|
5328
|
+
retryLimit: z79.number().optional().describe("Max retries for asset processing"),
|
|
5329
|
+
host: z79.string().optional().describe("Management API host"),
|
|
5330
|
+
proxy: z79.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
5331
|
+
rawProxy: z79.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
5332
|
+
rateLimit: z79.number().optional().describe("Max requests per second to the API"),
|
|
5333
|
+
headers: z79.record(z79.any()).optional().describe("Additional headers to attach to requests"),
|
|
5334
|
+
errorLogFile: z79.string().optional().describe("Path to error log file"),
|
|
5335
|
+
useVerboseRenderer: z79.boolean().optional().describe("Line-by-line progress output (good for CI)"),
|
|
5336
|
+
config: z79.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
5038
5337
|
}).optional()
|
|
5039
5338
|
});
|
|
5040
5339
|
var paramCollectionConfig = {
|
|
@@ -5150,25 +5449,25 @@ var createParamCollectionTool = withErrorHandling(
|
|
|
5150
5449
|
);
|
|
5151
5450
|
|
|
5152
5451
|
// src/tools/jobs/space-to-space-migration/importSpace.ts
|
|
5153
|
-
import { z as
|
|
5452
|
+
import { z as z80 } from "zod";
|
|
5154
5453
|
var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
5155
|
-
contentFile:
|
|
5156
|
-
content:
|
|
5454
|
+
contentFile: z80.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5455
|
+
content: z80.record(z80.any()).optional().describe(
|
|
5157
5456
|
"JS object containing import content (must match expected structure)"
|
|
5158
5457
|
),
|
|
5159
|
-
contentModelOnly:
|
|
5160
|
-
skipContentModel:
|
|
5161
|
-
skipLocales:
|
|
5162
|
-
skipContentUpdates:
|
|
5163
|
-
skipContentPublishing:
|
|
5164
|
-
uploadAssets:
|
|
5165
|
-
skipAssetUpdates:
|
|
5166
|
-
assetsDirectory:
|
|
5167
|
-
timeout:
|
|
5168
|
-
retryLimit:
|
|
5169
|
-
rateLimit:
|
|
5170
|
-
errorLogFile:
|
|
5171
|
-
useVerboseRenderer:
|
|
5458
|
+
contentModelOnly: z80.boolean().optional().default(false).describe("Import only content types"),
|
|
5459
|
+
skipContentModel: z80.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
5460
|
+
skipLocales: z80.boolean().optional().default(false).describe("Skip importing locales"),
|
|
5461
|
+
skipContentUpdates: z80.boolean().optional().default(false).describe("Do not update existing content"),
|
|
5462
|
+
skipContentPublishing: z80.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
5463
|
+
uploadAssets: z80.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
5464
|
+
skipAssetUpdates: z80.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
5465
|
+
assetsDirectory: z80.string().optional().describe("Path to directory containing exported asset files"),
|
|
5466
|
+
timeout: z80.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
5467
|
+
retryLimit: z80.number().optional().default(10).describe("Max retries for asset processing"),
|
|
5468
|
+
rateLimit: z80.number().optional().default(7).describe("Max requests per second to the API"),
|
|
5469
|
+
errorLogFile: z80.string().optional().describe("Path to error log file"),
|
|
5470
|
+
useVerboseRenderer: z80.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
5172
5471
|
});
|
|
5173
5472
|
function createImportSpaceTool(config) {
|
|
5174
5473
|
async function tool2(args) {
|
|
@@ -5213,7 +5512,7 @@ function createImportSpaceTool(config) {
|
|
|
5213
5512
|
}
|
|
5214
5513
|
|
|
5215
5514
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
5216
|
-
import { z as
|
|
5515
|
+
import { z as z81 } from "zod";
|
|
5217
5516
|
|
|
5218
5517
|
// src/tools/jobs/space-to-space-migration/instructions.ts
|
|
5219
5518
|
var S2S_MIGRATION_INSTRUCTIONS = `
|
|
@@ -5256,7 +5555,7 @@ The space to space migration workflow has been concluded and all related tools h
|
|
|
5256
5555
|
The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
|
|
5257
5556
|
`;
|
|
5258
5557
|
var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
|
|
5259
|
-
enableWorkflow:
|
|
5558
|
+
enableWorkflow: z81.boolean().describe(
|
|
5260
5559
|
"Set to true to enable the workflow tools, false to disable them and conclude the workflow"
|
|
5261
5560
|
)
|
|
5262
5561
|
});
|