@umbraco-cms/mcp-dev 18.3.0 → 18.3.1

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.
@@ -17344,6 +17344,34 @@ var UpdateDocumentTool = {
17344
17344
  };
17345
17345
  var update_document_default = _mcpserversdk.withStandardDecorators.call(void 0, UpdateDocumentTool);
17346
17346
 
17347
+ // src/umbraco-api/tools/document/put/validate-document-update.ts
17348
+
17349
+
17350
+
17351
+
17352
+
17353
+
17354
+ var validateDocumentUpdateSchema = {
17355
+ id: _zod.z.string().uuid(),
17356
+ data: _zod.z.object(putDocumentByIdValidateBody.shape)
17357
+ };
17358
+ var ValidateDocumentUpdateTool = {
17359
+ name: "validate-document-update",
17360
+ description: "Validates changes to an existing document, using the Umbraco API (PUT, does not persist changes). Use this instead of validate-document when validating an update to a document that already exists - it only requires Update permission on the document, not Create permission on its parent.",
17361
+ inputSchema: validateDocumentUpdateSchema,
17362
+ annotations: {
17363
+ readOnlyHint: true
17364
+ },
17365
+ slices: ["validate"],
17366
+ enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Update),
17367
+ handler: (async (model) => {
17368
+ return _mcpserversdk.executeVoidApiCall.call(void 0,
17369
+ (client) => client.putDocumentByIdValidate(model.id, model.data, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
17370
+ );
17371
+ })
17372
+ };
17373
+ var validate_document_update_default = _mcpserversdk.withStandardDecorators.call(void 0, ValidateDocumentUpdateTool);
17374
+
17347
17375
  // src/umbraco-api/tools/document/put/update-and-publish-document.ts
17348
17376
 
17349
17377
 
@@ -18320,17 +18348,17 @@ function checkAllowedInArea(blockConfig, area) {
18320
18348
 
18321
18349
  // src/umbraco-api/tools/document/put/helpers/document-block-context.ts
18322
18350
 
18323
- async function loadDocumentBlockContext(model) {
18351
+ async function resolveBlockPropertyContext(owner, model) {
18324
18352
  const client = UmbracoManagementClient3.getClient();
18325
- const document = await client.getDocumentById(model.documentId);
18326
- const documentTypeProperties = await getAllDocumentTypeProperties(document.documentType.id);
18327
- const propertyDefinition = documentTypeProperties.find((p) => p.alias === model.propertyAlias);
18353
+ const { values } = owner;
18354
+ const contentTypeProperties = await getAllDocumentTypeProperties(owner.contentTypeId);
18355
+ const propertyDefinition = contentTypeProperties.find((p) => p.alias === model.propertyAlias);
18328
18356
  if (!propertyDefinition) {
18329
18357
  throw new (0, _mcpserversdk.ToolValidationError)({
18330
18358
  title: "Property not found",
18331
- detail: `Property '${model.propertyAlias}' does not exist on this document's type`,
18359
+ detail: `Property '${model.propertyAlias}' does not exist on this ${owner.ownerLabel}'s type`,
18332
18360
  extensions: {
18333
- availableProperties: documentTypeProperties.map((p) => p.alias)
18361
+ availableProperties: contentTypeProperties.map((p) => p.alias)
18334
18362
  }
18335
18363
  });
18336
18364
  }
@@ -18349,7 +18377,7 @@ async function loadDocumentBlockContext(model) {
18349
18377
  detail: `Property '${model.propertyAlias}' uses editor '${dataType.editorAlias}', not a BlockList, BlockGrid, or RichText editor`
18350
18378
  });
18351
18379
  }
18352
- let valueEntry = document.values.find(
18380
+ let valueEntry = values.find(
18353
18381
  (v) => matchesProperty(v, model.propertyAlias, model.culture, model.segment)
18354
18382
  );
18355
18383
  if (!valueEntry) {
@@ -18360,7 +18388,7 @@ async function loadDocumentBlockContext(model) {
18360
18388
  editorAlias: dataType.editorAlias,
18361
18389
  value: null
18362
18390
  };
18363
- document.values.push(valueEntry);
18391
+ values.push(valueEntry);
18364
18392
  }
18365
18393
  if (valueEntry.value === null || valueEntry.value === void 0 || valueEntry.value === "") {
18366
18394
  valueEntry.value = createEmptyBlockValue(kind);
@@ -18377,7 +18405,6 @@ async function loadDocumentBlockContext(model) {
18377
18405
  });
18378
18406
  }
18379
18407
  return {
18380
- document,
18381
18408
  propertyDefinition,
18382
18409
  kind,
18383
18410
  propertyValue,
@@ -18385,6 +18412,15 @@ async function loadDocumentBlockContext(model) {
18385
18412
  blockConfigs: getBlockTypeConfigurations(dataType.values)
18386
18413
  };
18387
18414
  }
18415
+ async function loadDocumentBlockContext(model) {
18416
+ const client = UmbracoManagementClient3.getClient();
18417
+ const document = await client.getDocumentById(model.documentId);
18418
+ const context = await resolveBlockPropertyContext(
18419
+ { values: document.values, contentTypeId: document.documentType.id, ownerLabel: "document" },
18420
+ model
18421
+ );
18422
+ return { document, ...context };
18423
+ }
18388
18424
  async function saveDocumentValues(documentId, document) {
18389
18425
  const client = UmbracoManagementClient3.getClient();
18390
18426
  const values = document.values.map((v) => ({
@@ -18787,6 +18823,274 @@ var DeleteDocumentBlockTool = {
18787
18823
  };
18788
18824
  var delete_document_block_default = _mcpserversdk.withStandardDecorators.call(void 0, DeleteDocumentBlockTool);
18789
18825
 
18826
+ // src/umbraco-api/tools/document/put/move-document-block.ts
18827
+
18828
+
18829
+ // src/umbraco-api/tools/document/put/helpers/block-move.ts
18830
+
18831
+ function describeContainer(location) {
18832
+ return location.parent ? `area '${location.areaKey}' of block '${location.parent.contentKey}'` : "the root of the property";
18833
+ }
18834
+ function blockNotFoundError(contentKey, propertyKey, availableKeys) {
18835
+ return new (0, _mcpserversdk.ToolValidationError)({
18836
+ title: "Block not found",
18837
+ detail: `No block with contentKey '${contentKey}' exists in property '${propertyKey}'`,
18838
+ extensions: { availableContentKeys: availableKeys }
18839
+ });
18840
+ }
18841
+ function collectAllLayoutKeys(items) {
18842
+ const keys = [];
18843
+ for (const item of items) {
18844
+ keys.push(item.contentKey);
18845
+ for (const area of _nullishCoalesce(item.areas, () => ( []))) {
18846
+ keys.push(...collectAllLayoutKeys(_nullishCoalesce(area.items, () => ( []))));
18847
+ }
18848
+ }
18849
+ return keys;
18850
+ }
18851
+ function reorderKeys(order, contentKey, target) {
18852
+ const without = order.filter((k) => k !== contentKey);
18853
+ switch (target.position) {
18854
+ case "first":
18855
+ return [contentKey, ...without];
18856
+ case "last":
18857
+ return [...without, contentKey];
18858
+ case "before":
18859
+ case "after": {
18860
+ if (target.relativeToContentKey === contentKey) {
18861
+ return [...order];
18862
+ }
18863
+ const index = without.indexOf(target.relativeToContentKey);
18864
+ const insertAt = target.position === "before" ? index : index + 1;
18865
+ return [...without.slice(0, insertAt), contentKey, ...without.slice(insertAt)];
18866
+ }
18867
+ }
18868
+ }
18869
+ function sameOrder(a, b) {
18870
+ return a.length === b.length && a.every((k, i) => k === b[i]);
18871
+ }
18872
+ function moveLayoutBlock(layoutItems, contentKey, target, propertyKey) {
18873
+ const location = findLayoutLocation(layoutItems, contentKey);
18874
+ if (!location) {
18875
+ throw blockNotFoundError(contentKey, propertyKey, collectAllLayoutKeys(layoutItems));
18876
+ }
18877
+ const containerItems = location.items;
18878
+ const currentOrder = containerItems.map((i) => i.contentKey);
18879
+ if (target.position === "before" || target.position === "after") {
18880
+ const relativeKey = target.relativeToContentKey;
18881
+ if (!currentOrder.includes(relativeKey)) {
18882
+ const relativeLocation = findLayoutLocation(layoutItems, relativeKey);
18883
+ if (relativeLocation) {
18884
+ throw new (0, _mcpserversdk.ToolValidationError)({
18885
+ title: "Target in a different container",
18886
+ detail: `Block '${relativeKey}' is in ${describeContainer(relativeLocation)}, but block '${contentKey}' is in ${describeContainer(location)}. Blocks can only be moved within their own container; moving between BlockGrid areas, or into or out of an area, is not supported.`,
18887
+ extensions: { blocksInSameContainer: currentOrder }
18888
+ });
18889
+ }
18890
+ throw new (0, _mcpserversdk.ToolValidationError)({
18891
+ title: "Relative block not found",
18892
+ detail: `No block with contentKey '${relativeKey}' exists in property '${propertyKey}'`,
18893
+ extensions: { blocksInSameContainer: currentOrder }
18894
+ });
18895
+ }
18896
+ }
18897
+ const newOrder = reorderKeys(currentOrder, contentKey, target);
18898
+ const moved = !sameOrder(currentOrder, newOrder);
18899
+ if (moved) {
18900
+ const byKey = new Map(containerItems.map((i) => [i.contentKey, i]));
18901
+ containerItems.splice(0, containerItems.length, ...newOrder.map((k) => byKey.get(k)));
18902
+ }
18903
+ return {
18904
+ moved,
18905
+ blockOrder: newOrder,
18906
+ parentContentKey: _nullishCoalesce(_optionalChain([location, 'access', _41 => _41.parent, 'optionalAccess', _42 => _42.contentKey]), () => ( null)),
18907
+ areaKey: _nullishCoalesce(location.areaKey, () => ( null))
18908
+ };
18909
+ }
18910
+ var RTE_BLOCK_KEY_PATTERN = /<umb-rte-block(?:-inline)?\b[^>]*\bdata-content-key=["']([^"']+)["']/gi;
18911
+ function getRteMarkupBlockOrder(markup) {
18912
+ return Array.from((_nullishCoalesce(markup, () => ( ""))).matchAll(RTE_BLOCK_KEY_PATTERN), (m) => m[1]);
18913
+ }
18914
+ function findRteBlockUnit(markup, contentKey) {
18915
+ const found = findRteBlockElement(markup, contentKey);
18916
+ if (!found) {
18917
+ return null;
18918
+ }
18919
+ let { start, end } = found;
18920
+ const element = markup.slice(start, end);
18921
+ const inlineElement = /^<umb-rte-block-inline\b/i.test(element);
18922
+ const openingParagraph = /<p\b[^>]*>\s*$/i.exec(markup.slice(0, start));
18923
+ const closingParagraph = /^\s*<\/p>/i.exec(markup.slice(end));
18924
+ const wrapped = Boolean(openingParagraph && closingParagraph);
18925
+ if (openingParagraph && closingParagraph) {
18926
+ start -= openingParagraph[0].length;
18927
+ end += closingParagraph[0].length;
18928
+ }
18929
+ return { start, end, element, inlineElement, wrapped, level: inlineElement && !wrapped ? "inline" : "block" };
18930
+ }
18931
+ function markupForLevel(unit, blockMarkup, level) {
18932
+ if (level === "block") {
18933
+ return unit.level === "inline" ? `<p>${unit.element}</p>` : blockMarkup;
18934
+ }
18935
+ return unit.inlineElement ? unit.element : null;
18936
+ }
18937
+ function moveRichTextBlock(rteValue, layoutItems, contentKey, target, propertyKey) {
18938
+ const markup = _nullishCoalesce(rteValue.markup, () => ( ""));
18939
+ const currentOrder = getRteMarkupBlockOrder(markup);
18940
+ const unit = findRteBlockUnit(markup, contentKey);
18941
+ if (!unit) {
18942
+ if (layoutItems.some((i) => i.contentKey === contentKey)) {
18943
+ throw new (0, _mcpserversdk.ToolValidationError)({
18944
+ title: "Block markup not found",
18945
+ detail: `Block '${contentKey}' has a layout entry but no <umb-rte-block> element in the markup`
18946
+ });
18947
+ }
18948
+ throw blockNotFoundError(contentKey, propertyKey, currentOrder);
18949
+ }
18950
+ const relativeKey = target.position === "before" || target.position === "after" ? target.relativeToContentKey : null;
18951
+ if (relativeKey && !currentOrder.includes(relativeKey)) {
18952
+ throw new (0, _mcpserversdk.ToolValidationError)({
18953
+ title: "Relative block not found",
18954
+ detail: `No block with contentKey '${relativeKey}' exists in the markup of property '${propertyKey}'`,
18955
+ extensions: { blocksInSameContainer: currentOrder }
18956
+ });
18957
+ }
18958
+ if (relativeKey && relativeKey !== contentKey) {
18959
+ const relativeLevel = findRteBlockUnit(markup, relativeKey).level;
18960
+ if (markupForLevel(unit, markup.slice(unit.start, unit.end), relativeLevel) === null) {
18961
+ throw new (0, _mcpserversdk.ToolValidationError)({
18962
+ title: "Cannot place block inside text",
18963
+ detail: `Block '${relativeKey}' is an inline block inside a paragraph of text, and block '${contentKey}' is a block-level block, which can't be placed inside a paragraph. Move it relative to a block-level block, or to the first/last position, instead.`,
18964
+ extensions: { blocksInSameContainer: currentOrder }
18965
+ });
18966
+ }
18967
+ }
18968
+ let alreadyInPlace;
18969
+ switch (target.position) {
18970
+ case "first":
18971
+ alreadyInPlace = markup.slice(0, unit.start).trim() === "";
18972
+ break;
18973
+ case "last":
18974
+ alreadyInPlace = markup.slice(unit.end).trim() === "";
18975
+ break;
18976
+ default:
18977
+ alreadyInPlace = sameOrder(currentOrder, reorderKeys(currentOrder, contentKey, target));
18978
+ }
18979
+ if (!alreadyInPlace) {
18980
+ const blockMarkup = markup.slice(unit.start, unit.end);
18981
+ const remaining = markup.slice(0, unit.start) + markup.slice(unit.end);
18982
+ let newMarkup;
18983
+ if (target.position === "first" || target.position === "last") {
18984
+ const standalone = markupForLevel(unit, blockMarkup, "block");
18985
+ newMarkup = target.position === "first" ? standalone + remaining : remaining + standalone;
18986
+ } else {
18987
+ const relativeUnit = relativeKey ? findRteBlockUnit(remaining, relativeKey) : null;
18988
+ if (!relativeUnit) {
18989
+ throw new (0, _mcpserversdk.ToolValidationError)({
18990
+ title: "Relative block markup not found",
18991
+ detail: `Relative block '${relativeKey}' markup could not be re-located in property '${propertyKey}' after removing the markup of moved block '${contentKey}'`,
18992
+ extensions: {
18993
+ contentKey,
18994
+ relativeToContentKey: relativeKey,
18995
+ blocksInSameContainer: currentOrder
18996
+ }
18997
+ });
18998
+ }
18999
+ const insert = markupForLevel(unit, blockMarkup, relativeUnit.level);
19000
+ const at = target.position === "before" ? relativeUnit.start : relativeUnit.end;
19001
+ newMarkup = remaining.slice(0, at) + insert + remaining.slice(at);
19002
+ }
19003
+ rteValue.markup = newMarkup;
19004
+ }
19005
+ return {
19006
+ moved: !alreadyInPlace,
19007
+ blockOrder: getRteMarkupBlockOrder(_nullishCoalesce(rteValue.markup, () => ( ""))),
19008
+ parentContentKey: null,
19009
+ areaKey: null
19010
+ };
19011
+ }
19012
+ function moveBlock(context, contentKey, target, propertyKey) {
19013
+ const kind = context.kind;
19014
+ if (kind === "RichText") {
19015
+ return moveRichTextBlock(context.propertyValue, context.container.layoutItems, contentKey, target, propertyKey);
19016
+ }
19017
+ return moveLayoutBlock(context.container.layoutItems, contentKey, target, propertyKey);
19018
+ }
19019
+
19020
+ // src/umbraco-api/tools/document/put/move-document-block.ts
19021
+
19022
+
19023
+
19024
+
19025
+ var blockMoveTargetSchema = _zod.z.discriminatedUnion("position", [
19026
+ _zod.z.object({
19027
+ position: _zod.z.enum(["first", "last"]).describe("Move to the start or end of the block's container")
19028
+ }),
19029
+ _zod.z.object({
19030
+ position: _zod.z.enum(["before", "after"]).describe("Move directly before or after another block"),
19031
+ relativeToContentKey: _zod.z.string().uuid().describe("contentKey of the block to move next to; must be in the same container")
19032
+ })
19033
+ ]).describe("Where to move the block");
19034
+ var moveBlockOutputSchema = _zod.z.object({
19035
+ success: _zod.z.boolean(),
19036
+ message: _zod.z.string(),
19037
+ contentKey: _zod.z.string().guid(),
19038
+ moved: _zod.z.boolean().describe("False when the block was already at the requested position and nothing was saved"),
19039
+ blockOrder: _zod.z.array(_zod.z.string().guid()).describe("contentKeys of the block's container, in their new order"),
19040
+ parentContentKey: _zod.z.string().guid().nullable().describe("BlockGrid only: the block owning the area the block was moved within; null for the property root"),
19041
+ areaKey: _zod.z.string().guid().nullable().describe("BlockGrid only: the area the block was moved within; null for the property root")
19042
+ });
19043
+ var moveDocumentBlockSchema = {
19044
+ documentId: _zod.z.string().uuid().describe("The document containing the block"),
19045
+ propertyAlias: _zod.z.string().min(1).describe("Document property alias of the BlockList, BlockGrid, or RichText property"),
19046
+ culture: _zod.z.string().nullish().describe("Culture, only for culture-variant document properties"),
19047
+ segment: _zod.z.string().nullish().describe("Segment, only for segment-variant document properties"),
19048
+ contentKey: _zod.z.string().uuid().describe("contentKey of the block to move"),
19049
+ target: blockMoveTargetSchema
19050
+ };
19051
+ var MoveDocumentBlockTool = {
19052
+ name: "move-document-block",
19053
+ description: `Reorders one block within a document's BlockList, BlockGrid, or RichText property.
19054
+
19055
+ - BlockList: moves the block's layout entry; its settings stay paired with it.
19056
+ - BlockGrid: moves the block within its own container (the root, or one area), keeping its
19057
+ columnSpan/rowSpan and nested areas. Moving between areas, or into or out of an area, is not
19058
+ supported; a relativeToContentKey in another container is refused.
19059
+ - RichText: moves the block's <umb-rte-block> element in the markup (before/after another
19060
+ block's element, or to the start/end of the markup); the markup alone sets the block order.
19061
+ A block-level block can't be placed next to an inline block that sits inside a paragraph of
19062
+ text; an inline block moved to block level gets its own paragraph.
19063
+
19064
+ Moving a block to where it already is changes nothing and succeeds (moved: false).
19065
+ Returns the container's new block order. The document is saved, not published.
19066
+
19067
+ Examples:
19068
+ - { documentId: "...", propertyAlias: "mainContent", contentKey: "...", target: { position: "first" } }
19069
+ - { documentId: "...", propertyAlias: "mainContent", contentKey: "...", target: { position: "before", relativeToContentKey: "..." } }`,
19070
+ inputSchema: moveDocumentBlockSchema,
19071
+ outputSchema: moveBlockOutputSchema.shape,
19072
+ annotations: {
19073
+ idempotentHint: true
19074
+ },
19075
+ slices: ["update"],
19076
+ enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Update),
19077
+ handler: (async (model) => {
19078
+ const ctx = await loadDocumentBlockContext(model);
19079
+ const propertyKey = getPropertyKey(model.propertyAlias, model.culture, model.segment);
19080
+ const result = moveBlock(ctx, model.contentKey, model.target, propertyKey);
19081
+ if (result.moved) {
19082
+ await saveDocumentValues(model.documentId, ctx.document);
19083
+ }
19084
+ return _mcpserversdk.createToolResult.call(void 0, {
19085
+ success: true,
19086
+ message: result.moved ? `Moved block '${model.contentKey}' in ${ctx.kind} property '${propertyKey}'` : `Block '${model.contentKey}' is already at the requested position in ${ctx.kind} property '${propertyKey}'; nothing changed`,
19087
+ contentKey: model.contentKey,
19088
+ ...result
19089
+ });
19090
+ })
19091
+ };
19092
+ var move_document_block_default = _mcpserversdk.withStandardDecorators.call(void 0, MoveDocumentBlockTool);
19093
+
18790
19094
  // src/umbraco-api/tools/document/items/get/get-root.ts
18791
19095
 
18792
19096
 
@@ -18999,7 +19303,7 @@ var DocumentCollection = {
18999
19303
  tools.push(get_document_type_schema_default);
19000
19304
  tools.push(copy_document_default);
19001
19305
  tools.push(create_document_default);
19002
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _41 => _41.umbracoVersion]))) {
19306
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _43 => _43.umbracoVersion]))) {
19003
19307
  tools.push(create_and_publish_document_default);
19004
19308
  }
19005
19309
  tools.push(post_document_public_access_default);
@@ -19016,13 +19320,13 @@ var DocumentCollection = {
19016
19320
  tools.push(publish_document_default);
19017
19321
  tools.push(publish_document_with_descendants_default);
19018
19322
  tools.push(sort_document_default);
19019
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _42 => _42.umbracoVersion]))) {
19323
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _44 => _44.umbracoVersion]))) {
19020
19324
  tools.push(sort_document_children_default);
19021
19325
  tools.push(sort_document_root_children_default);
19022
19326
  }
19023
19327
  tools.push(unpublish_document_default);
19024
19328
  tools.push(update_document_default);
19025
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _43 => _43.umbracoVersion]))) {
19329
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _45 => _45.umbracoVersion]))) {
19026
19330
  tools.push(update_and_publish_document_default);
19027
19331
  }
19028
19332
  tools.push(update_document_properties_default);
@@ -19030,6 +19334,7 @@ var DocumentCollection = {
19030
19334
  tools.push(update_block_property_default);
19031
19335
  tools.push(create_document_block_default);
19032
19336
  tools.push(delete_document_block_default);
19337
+ tools.push(move_document_block_default);
19033
19338
  tools.push(put_document_domains_default);
19034
19339
  tools.push(put_document_notifications_default);
19035
19340
  tools.push(put_document_public_access_default);
@@ -19040,6 +19345,7 @@ var DocumentCollection = {
19040
19345
  tools.push(get_recycle_bin_children_default);
19041
19346
  tools.push(search_document_default);
19042
19347
  tools.push(validate_document_default);
19348
+ tools.push(validate_document_update_default);
19043
19349
  tools.push(get_collection_document_by_id_default);
19044
19350
  tools.push(get_item_document_default);
19045
19351
  tools.push(get_document_are_referenced_default);
@@ -19387,7 +19693,7 @@ var CopyDocumentTypeTool = {
19387
19693
  validateStatus: () => true
19388
19694
  });
19389
19695
  if (response.status === 201) {
19390
- const location = _optionalChain([response, 'access', _44 => _44.headers, 'optionalAccess', _45 => _45.location]) || "";
19696
+ const location = _optionalChain([response, 'access', _46 => _46.headers, 'optionalAccess', _47 => _47.location]) || "";
19391
19697
  const newId = location.split("/").pop() || "";
19392
19698
  const output = { id: newId };
19393
19699
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -21636,7 +21942,7 @@ var CopyElementTool = {
21636
21942
  validateStatus: () => true
21637
21943
  });
21638
21944
  if (response.status === 201) {
21639
- const location = _optionalChain([response, 'access', _46 => _46.headers, 'optionalAccess', _47 => _47.location]) || "";
21945
+ const location = _optionalChain([response, 'access', _48 => _48.headers, 'optionalAccess', _49 => _49.location]) || "";
21640
21946
  const newId = location.split("/").pop() || "";
21641
21947
  const output = { id: newId };
21642
21948
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -22200,6 +22506,81 @@ var UpdateElementBlockPropertyTool = {
22200
22506
  };
22201
22507
  var update_element_block_property_default = _mcpserversdk.withStandardDecorators.call(void 0, UpdateElementBlockPropertyTool);
22202
22508
 
22509
+ // src/umbraco-api/tools/element/put/move-element-block.ts
22510
+
22511
+
22512
+
22513
+
22514
+
22515
+ var moveElementBlockOutputSchema = moveBlockOutputSchema;
22516
+ var moveElementBlockSchema = {
22517
+ elementId: _zod.z.string().uuid().describe("The Library element containing the block"),
22518
+ propertyAlias: _zod.z.string().min(1).describe("Element property alias of the BlockList, BlockGrid, or RichText property"),
22519
+ culture: _zod.z.string().nullish().describe("Culture, only for culture-variant element properties"),
22520
+ segment: _zod.z.string().nullish().describe("Segment, only for segment-variant element properties"),
22521
+ contentKey: _zod.z.string().uuid().describe("contentKey of the block to move"),
22522
+ target: blockMoveTargetSchema
22523
+ };
22524
+ var MoveElementBlockTool = {
22525
+ name: "move-element-block",
22526
+ description: `Reorders one block within a Library element's BlockList, BlockGrid, or RichText property.
22527
+
22528
+ - BlockList: moves the block's layout entry; its settings stay paired with it.
22529
+ - BlockGrid: moves the block within its own container (the root, or one area), keeping its
22530
+ columnSpan/rowSpan and nested areas. Moving between areas, or into or out of an area, is not
22531
+ supported; a relativeToContentKey in another container is refused.
22532
+ - RichText: moves the block's <umb-rte-block> element in the markup (before/after another
22533
+ block's element, or to the start/end of the markup); the markup alone sets the block order.
22534
+ A block-level block can't be placed next to an inline block that sits inside a paragraph of
22535
+ text; an inline block moved to block level gets its own paragraph.
22536
+
22537
+ Moving a block to where it already is changes nothing and succeeds (moved: false).
22538
+ Returns the container's new block order. The element is saved, not published.
22539
+
22540
+ Examples:
22541
+ - { elementId: "...", propertyAlias: "blocks", contentKey: "...", target: { position: "last" } }
22542
+ - { elementId: "...", propertyAlias: "blocks", contentKey: "...", target: { position: "after", relativeToContentKey: "..." } }`,
22543
+ inputSchema: moveElementBlockSchema,
22544
+ outputSchema: moveElementBlockOutputSchema.shape,
22545
+ annotations: {
22546
+ idempotentHint: true
22547
+ },
22548
+ slices: ["update"],
22549
+ enabled: (user) => user.fallbackPermissions.includes(UmbracoElementPermissions.Update),
22550
+ handler: (async (model) => {
22551
+ const client = UmbracoManagementClient3.getClient();
22552
+ const element = await client.getElementById(model.elementId);
22553
+ const ctx = await resolveBlockPropertyContext(
22554
+ { values: element.values, contentTypeId: element.documentType.id, ownerLabel: "element" },
22555
+ model
22556
+ );
22557
+ const propertyKey = getPropertyKey(model.propertyAlias, model.culture, model.segment);
22558
+ const result = moveBlock(ctx, model.contentKey, model.target, propertyKey);
22559
+ if (result.moved) {
22560
+ const values = element.values.map((v) => ({
22561
+ alias: v.alias,
22562
+ culture: v.culture,
22563
+ segment: v.segment,
22564
+ value: v.value
22565
+ }));
22566
+ const variants = element.variants.map((v) => ({
22567
+ culture: v.culture,
22568
+ segment: v.segment,
22569
+ name: v.name
22570
+ }));
22571
+ const payload = { values, variants };
22572
+ await client.putElementById(model.elementId, payload);
22573
+ }
22574
+ return _mcpserversdk.createToolResult.call(void 0, {
22575
+ success: true,
22576
+ message: result.moved ? `Moved block '${model.contentKey}' in ${ctx.kind} property '${propertyKey}'` : `Block '${model.contentKey}' is already at the requested position in ${ctx.kind} property '${propertyKey}'; nothing changed`,
22577
+ contentKey: model.contentKey,
22578
+ ...result
22579
+ });
22580
+ })
22581
+ };
22582
+ var move_element_block_default = _mcpserversdk.withStandardDecorators.call(void 0, MoveElementBlockTool);
22583
+
22203
22584
  // src/umbraco-api/tools/element/put/move-element.ts
22204
22585
 
22205
22586
 
@@ -22670,7 +23051,7 @@ var ElementCollection = {
22670
23051
  const tools = [];
22671
23052
  if (AuthorizationPolicies.TreeAccessElements(user)) {
22672
23053
  tools.push(get_element_by_id_default);
22673
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _48 => _48.umbracoVersion]))) {
23054
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _50 => _50.umbracoVersion]))) {
22674
23055
  tools.push(get_element_published_default);
22675
23056
  }
22676
23057
  tools.push(get_element_configuration_default);
@@ -22694,18 +23075,19 @@ var ElementCollection = {
22694
23075
  tools.push(get_recycle_bin_element_children_default);
22695
23076
  tools.push(get_recycle_bin_element_siblings_default);
22696
23077
  tools.push(create_element_default);
22697
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _49 => _49.umbracoVersion]))) {
23078
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _51 => _51.umbracoVersion]))) {
22698
23079
  tools.push(create_and_publish_element_default);
22699
23080
  }
22700
23081
  tools.push(copy_element_default);
22701
23082
  tools.push(validate_element_default);
22702
23083
  tools.push(rollback_element_version_default);
22703
23084
  tools.push(update_element_default);
22704
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _50 => _50.umbracoVersion]))) {
23085
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _52 => _52.umbracoVersion]))) {
22705
23086
  tools.push(update_and_publish_element_default);
22706
23087
  }
22707
23088
  tools.push(update_element_properties_default);
22708
23089
  tools.push(update_element_block_property_default);
23090
+ tools.push(move_element_block_default);
22709
23091
  tools.push(move_element_default);
22710
23092
  tools.push(move_element_to_recycle_bin_default);
22711
23093
  tools.push(publish_element_default);
@@ -23603,7 +23985,7 @@ function getExtensionFromMimeType(mimeType) {
23603
23985
  return extension ? `.${extension}` : void 0;
23604
23986
  }
23605
23987
  function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
23606
- const isSvg = _optionalChain([filePath, 'optionalAccess', _51 => _51.toLowerCase, 'call', _52 => _52(), 'access', _53 => _53.endsWith, 'call', _54 => _54(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _55 => _55.toLowerCase, 'call', _56 => _56(), 'access', _57 => _57.endsWith, 'call', _58 => _58(".svg")]) || fileName.toLowerCase().endsWith(".svg");
23988
+ const isSvg = _optionalChain([filePath, 'optionalAccess', _53 => _53.toLowerCase, 'call', _54 => _54(), 'access', _55 => _55.endsWith, 'call', _56 => _56(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _57 => _57.toLowerCase, 'call', _58 => _58(), 'access', _59 => _59.endsWith, 'call', _60 => _60(".svg")]) || fileName.toLowerCase().endsWith(".svg");
23607
23989
  if (isSvg && mediaTypeName.toLowerCase() === _mcpserversdk.MEDIA_TYPE_IMAGE.toLowerCase()) {
23608
23990
  console.warn(`SVG detected - using ${_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS} media type instead of ${_mcpserversdk.MEDIA_TYPE_IMAGE}`);
23609
23991
  return _mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS;
@@ -23785,8 +24167,8 @@ async function uploadMediaFile(client, params) {
23785
24167
  });
23786
24168
  } catch (error) {
23787
24169
  const err = error;
23788
- const errorData = _optionalChain([err, 'access', _59 => _59.response, 'optionalAccess', _60 => _60.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
23789
- throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _61 => _61.response, 'optionalAccess', _62 => _62.status]) || "Unknown error"} - ${errorData}`);
24170
+ const errorData = _optionalChain([err, 'access', _61 => _61.response, 'optionalAccess', _62 => _62.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
24171
+ throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _63 => _63.response, 'optionalAccess', _64 => _64.status]) || "Unknown error"} - ${errorData}`);
23790
24172
  }
23791
24173
  const valueStructure = buildValueStructure(mediaType.name, params.temporaryFileId);
23792
24174
  let response;
@@ -23806,12 +24188,12 @@ async function uploadMediaFile(client, params) {
23806
24188
  }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE);
23807
24189
  } catch (error) {
23808
24190
  const err = error;
23809
- throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _63 => _63.response, 'optionalAccess', _64 => _64.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _65 => _65.response, 'optionalAccess', _66 => _66.data])) || err.message}`);
24191
+ throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _65 => _65.response, 'optionalAccess', _66 => _66.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _67 => _67.response, 'optionalAccess', _68 => _68.data])) || err.message}`);
23810
24192
  }
23811
24193
  if (response.status < 200 || response.status >= 300) {
23812
24194
  throw new Error(`Request failed with status code ${response.status}`);
23813
24195
  }
23814
- const locationHeader = _optionalChain([response, 'access', _67 => _67.headers, 'optionalAccess', _68 => _68.location]) || _optionalChain([response, 'access', _69 => _69.headers, 'optionalAccess', _70 => _70.Location]);
24196
+ const locationHeader = _optionalChain([response, 'access', _69 => _69.headers, 'optionalAccess', _70 => _70.location]) || _optionalChain([response, 'access', _71 => _71.headers, 'optionalAccess', _72 => _72.Location]);
23815
24197
  if (!locationHeader) {
23816
24198
  throw new Error("No Location header in response - cannot determine created media ID");
23817
24199
  }
@@ -23848,7 +24230,7 @@ function buildSourceTypeSection(allowFilePath, otherSources) {
23848
24230
 
23849
24231
 
23850
24232
  function isStreamingUploadAvailable() {
23851
- return _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _71 => _71.umbracoAuth]) !== void 0;
24233
+ return _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _73 => _73.umbracoAuth]) !== void 0;
23852
24234
  }
23853
24235
  async function resolveAuth() {
23854
24236
  const { accessToken, baseUrl } = await _mcpserversdk.getSessionUmbracoAuth.call(void 0, );
@@ -23856,7 +24238,7 @@ async function resolveAuth() {
23856
24238
  }
23857
24239
  function ensureExtension(name, contentType, urlPath) {
23858
24240
  if (name.includes(".")) return name;
23859
- const fromUrl = _optionalChain([urlPath, 'access', _72 => _72.match, 'call', _73 => _73(/\.([a-z0-9]{1,8})$/i), 'optionalAccess', _74 => _74[0]]);
24241
+ const fromUrl = _optionalChain([urlPath, 'access', _74 => _74.match, 'call', _75 => _75(/\.([a-z0-9]{1,8})$/i), 'optionalAccess', _76 => _76[0]]);
23860
24242
  if (fromUrl) return `${name}${fromUrl}`;
23861
24243
  if (contentType) {
23862
24244
  const subtype = contentType.split(";")[0].split("/")[1];
@@ -23962,8 +24344,8 @@ Content-Type: ${sourceContentType}\r
23962
24344
  if (response.status < 200 || response.status >= 300) {
23963
24345
  throw new Error(`postMedia failed with status ${response.status}`);
23964
24346
  }
23965
- const locationHeader = _nullishCoalesce(_optionalChain([response, 'access', _75 => _75.headers, 'optionalAccess', _76 => _76.location]), () => ( _optionalChain([response, 'access', _77 => _77.headers, 'optionalAccess', _78 => _78.Location])));
23966
- const idMatch = _optionalChain([locationHeader, 'optionalAccess', _79 => _79.match, 'call', _80 => _80(/\/([a-f0-9-]{36})$/i)]);
24347
+ const locationHeader = _nullishCoalesce(_optionalChain([response, 'access', _77 => _77.headers, 'optionalAccess', _78 => _78.location]), () => ( _optionalChain([response, 'access', _79 => _79.headers, 'optionalAccess', _80 => _80.Location])));
24348
+ const idMatch = _optionalChain([locationHeader, 'optionalAccess', _81 => _81.match, 'call', _82 => _82(/\/([a-f0-9-]{36})$/i)]);
23967
24349
  if (!idMatch) {
23968
24350
  throw new Error(
23969
24351
  `Could not extract media id from Location header: ${_nullishCoalesce(locationHeader, () => ( "(missing)"))}`
@@ -24077,7 +24459,7 @@ ${filePathSection}
24077
24459
  let effectiveSourceType;
24078
24460
  let effectiveFileUrl = model.fileUrl;
24079
24461
  if (model.sourceType === "file") {
24080
- if (!_optionalChain([model, 'access', _81 => _81.file, 'optionalAccess', _82 => _82.download_url])) {
24462
+ if (!_optionalChain([model, 'access', _83 => _83.file, 'optionalAccess', _84 => _84.download_url])) {
24081
24463
  return _mcpserversdk.createToolResultError.call(void 0, {
24082
24464
  detail: "Error creating media: sourceType is 'file' but no file object was provided. ChatGPT's connector should inject this automatically when a file is attached \u2014 if it didn't, the user has nothing attached or your client doesn't support openai/fileParams."
24083
24465
  });
@@ -24234,7 +24616,7 @@ ${filePathSection}
24234
24616
  let effectiveSourceType;
24235
24617
  let effectiveFileUrl = file.fileUrl;
24236
24618
  if (model.sourceType === "file") {
24237
- if (!_optionalChain([file, 'access', _83 => _83.file, 'optionalAccess', _84 => _84.download_url])) {
24619
+ if (!_optionalChain([file, 'access', _85 => _85.file, 'optionalAccess', _86 => _86.download_url])) {
24238
24620
  return {
24239
24621
  success: false,
24240
24622
  name: file.name,
@@ -24340,7 +24722,7 @@ var CreateMediaFolderTool = {
24340
24722
  if (response.status < 200 || response.status >= 300) {
24341
24723
  throw new Error(`Request failed with status code ${response.status}`);
24342
24724
  }
24343
- const locationHeader = _optionalChain([response, 'access', _85 => _85.headers, 'optionalAccess', _86 => _86.location]) || _optionalChain([response, 'access', _87 => _87.headers, 'optionalAccess', _88 => _88.Location]);
24725
+ const locationHeader = _optionalChain([response, 'access', _87 => _87.headers, 'optionalAccess', _88 => _88.location]) || _optionalChain([response, 'access', _89 => _89.headers, 'optionalAccess', _90 => _90.Location]);
24344
24726
  if (!locationHeader) {
24345
24727
  throw new Error("No Location header in response - cannot determine created folder ID");
24346
24728
  }
@@ -25175,7 +25557,7 @@ var MediaCollection = {
25175
25557
  tools.push(validate_media_default);
25176
25558
  tools.push(validate_media_default2);
25177
25559
  tools.push(sort_media_default);
25178
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _89 => _89.umbracoVersion]))) {
25560
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _91 => _91.umbracoVersion]))) {
25179
25561
  tools.push(sort_media_children_default);
25180
25562
  tools.push(sort_media_root_children_default);
25181
25563
  }
@@ -25628,7 +26010,7 @@ var CreateMediaTypeFolderTool = {
25628
26010
  validateStatus: () => true
25629
26011
  });
25630
26012
  if (response.status === 201) {
25631
- const locationHeader = _optionalChain([response, 'access', _90 => _90.headers, 'optionalAccess', _91 => _91["location"]]) || _optionalChain([response, 'access', _92 => _92.headers, 'optionalAccess', _93 => _93["Location"]]);
26013
+ const locationHeader = _optionalChain([response, 'access', _92 => _92.headers, 'optionalAccess', _93 => _93["location"]]) || _optionalChain([response, 'access', _94 => _94.headers, 'optionalAccess', _95 => _95["Location"]]);
25632
26014
  let createdId = model.id || "";
25633
26015
  if (locationHeader) {
25634
26016
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -25763,7 +26145,7 @@ var CreateMediaTypeTool = {
25763
26145
  validateStatus: () => true
25764
26146
  });
25765
26147
  if (response.status === 201) {
25766
- const locationHeader = _optionalChain([response, 'access', _94 => _94.headers, 'optionalAccess', _95 => _95["location"]]) || _optionalChain([response, 'access', _96 => _96.headers, 'optionalAccess', _97 => _97["Location"]]);
26148
+ const locationHeader = _optionalChain([response, 'access', _96 => _96.headers, 'optionalAccess', _97 => _97["location"]]) || _optionalChain([response, 'access', _98 => _98.headers, 'optionalAccess', _99 => _99["Location"]]);
25767
26149
  let createdId = model.id || "";
25768
26150
  if (locationHeader) {
25769
26151
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -25814,7 +26196,7 @@ var CopyMediaTypeTool = {
25814
26196
  validateStatus: () => true
25815
26197
  });
25816
26198
  if (response.status === 201) {
25817
- const locationHeader = _optionalChain([response, 'access', _98 => _98.headers, 'optionalAccess', _99 => _99["location"]]) || _optionalChain([response, 'access', _100 => _100.headers, 'optionalAccess', _101 => _101["Location"]]);
26199
+ const locationHeader = _optionalChain([response, 'access', _100 => _100.headers, 'optionalAccess', _101 => _101["location"]]) || _optionalChain([response, 'access', _102 => _102.headers, 'optionalAccess', _103 => _103["Location"]]);
25818
26200
  let createdId = "";
25819
26201
  if (locationHeader) {
25820
26202
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -26025,7 +26407,7 @@ var CreateMemberTool = {
26025
26407
  validateStatus: () => true
26026
26408
  });
26027
26409
  if (response.status === 201) {
26028
- const locationHeader = _optionalChain([response, 'access', _102 => _102.headers, 'optionalAccess', _103 => _103["location"]]) || _optionalChain([response, 'access', _104 => _104.headers, 'optionalAccess', _105 => _105["Location"]]);
26410
+ const locationHeader = _optionalChain([response, 'access', _104 => _104.headers, 'optionalAccess', _105 => _105["location"]]) || _optionalChain([response, 'access', _106 => _106.headers, 'optionalAccess', _107 => _107["Location"]]);
26029
26411
  let createdId = model.id || "";
26030
26412
  if (locationHeader) {
26031
26413
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -26575,7 +26957,7 @@ var CreateMemberTypeTool = {
26575
26957
  validateStatus: () => true
26576
26958
  });
26577
26959
  if (response.status === 201) {
26578
- const locationHeader = _optionalChain([response, 'access', _106 => _106.headers, 'optionalAccess', _107 => _107["location"]]) || _optionalChain([response, 'access', _108 => _108.headers, 'optionalAccess', _109 => _109["Location"]]);
26960
+ const locationHeader = _optionalChain([response, 'access', _108 => _108.headers, 'optionalAccess', _109 => _109["location"]]) || _optionalChain([response, 'access', _110 => _110.headers, 'optionalAccess', _111 => _111["Location"]]);
26579
26961
  let createdId = model.id || "";
26580
26962
  if (locationHeader) {
26581
26963
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -26745,7 +27127,7 @@ var CopyMemberTypeTool = {
26745
27127
  validateStatus: () => true
26746
27128
  });
26747
27129
  if (response.status === 201) {
26748
- const locationHeader = _optionalChain([response, 'access', _110 => _110.headers, 'optionalAccess', _111 => _111["location"]]) || _optionalChain([response, 'access', _112 => _112.headers, 'optionalAccess', _113 => _113["Location"]]);
27130
+ const locationHeader = _optionalChain([response, 'access', _112 => _112.headers, 'optionalAccess', _113 => _113["location"]]) || _optionalChain([response, 'access', _114 => _114.headers, 'optionalAccess', _115 => _115["Location"]]);
26749
27131
  let createdId = "";
26750
27132
  if (locationHeader) {
26751
27133
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -27105,7 +27487,7 @@ var CreatePartialViewTool = {
27105
27487
  validateStatus: () => true
27106
27488
  });
27107
27489
  if (response.status === 201) {
27108
- const locationHeader = _optionalChain([response, 'access', _114 => _114.headers, 'optionalAccess', _115 => _115["location"]]) || _optionalChain([response, 'access', _116 => _116.headers, 'optionalAccess', _117 => _117["Location"]]);
27490
+ const locationHeader = _optionalChain([response, 'access', _116 => _116.headers, 'optionalAccess', _117 => _117["location"]]) || _optionalChain([response, 'access', _118 => _118.headers, 'optionalAccess', _119 => _119["Location"]]);
27109
27491
  let createdPath = "";
27110
27492
  if (locationHeader) {
27111
27493
  const pathMatch = locationHeader.match(/partial-view\/(.+)$/);
@@ -27152,7 +27534,7 @@ var CreatePartialViewFolderTool = {
27152
27534
  validateStatus: () => true
27153
27535
  });
27154
27536
  if (response.status === 201) {
27155
- const locationHeader = _optionalChain([response, 'access', _118 => _118.headers, 'optionalAccess', _119 => _119["location"]]) || _optionalChain([response, 'access', _120 => _120.headers, 'optionalAccess', _121 => _121["Location"]]);
27537
+ const locationHeader = _optionalChain([response, 'access', _120 => _120.headers, 'optionalAccess', _121 => _121["location"]]) || _optionalChain([response, 'access', _122 => _122.headers, 'optionalAccess', _123 => _123["Location"]]);
27156
27538
  let createdPath = "";
27157
27539
  if (locationHeader) {
27158
27540
  const pathMatch = locationHeader.match(/partial-view\/folder\/(.+)$/);
@@ -27955,7 +28337,7 @@ var CreateScriptTool = {
27955
28337
  validateStatus: () => true
27956
28338
  });
27957
28339
  if (response.status === 201) {
27958
- const locationHeader = _optionalChain([response, 'access', _122 => _122.headers, 'optionalAccess', _123 => _123["location"]]) || _optionalChain([response, 'access', _124 => _124.headers, 'optionalAccess', _125 => _125["Location"]]);
28340
+ const locationHeader = _optionalChain([response, 'access', _124 => _124.headers, 'optionalAccess', _125 => _125["location"]]) || _optionalChain([response, 'access', _126 => _126.headers, 'optionalAccess', _127 => _127["Location"]]);
27959
28341
  let createdPath = "";
27960
28342
  if (locationHeader) {
27961
28343
  const pathMatch = locationHeader.match(/script\/(.+)$/);
@@ -28002,7 +28384,7 @@ var CreateScriptFolderTool = {
28002
28384
  validateStatus: () => true
28003
28385
  });
28004
28386
  if (response.status === 201) {
28005
- const locationHeader = _optionalChain([response, 'access', _126 => _126.headers, 'optionalAccess', _127 => _127["location"]]) || _optionalChain([response, 'access', _128 => _128.headers, 'optionalAccess', _129 => _129["Location"]]);
28387
+ const locationHeader = _optionalChain([response, 'access', _128 => _128.headers, 'optionalAccess', _129 => _129["location"]]) || _optionalChain([response, 'access', _130 => _130.headers, 'optionalAccess', _131 => _131["Location"]]);
28006
28388
  let createdPath = "";
28007
28389
  if (locationHeader) {
28008
28390
  const pathMatch = locationHeader.match(/script\/folder\/(.+)$/);
@@ -28599,7 +28981,7 @@ var CreateStylesheetTool = {
28599
28981
  validateStatus: () => true
28600
28982
  });
28601
28983
  if (response.status === 201) {
28602
- const locationHeader = _optionalChain([response, 'access', _130 => _130.headers, 'optionalAccess', _131 => _131["location"]]) || _optionalChain([response, 'access', _132 => _132.headers, 'optionalAccess', _133 => _133["Location"]]);
28984
+ const locationHeader = _optionalChain([response, 'access', _132 => _132.headers, 'optionalAccess', _133 => _133["location"]]) || _optionalChain([response, 'access', _134 => _134.headers, 'optionalAccess', _135 => _135["Location"]]);
28603
28985
  let createdPath = "";
28604
28986
  if (locationHeader) {
28605
28987
  const pathMatch = locationHeader.match(/stylesheet\/(.+)$/);
@@ -28646,7 +29028,7 @@ var CreateStylesheetFolderTool = {
28646
29028
  validateStatus: () => true
28647
29029
  });
28648
29030
  if (response.status === 201) {
28649
- const locationHeader = _optionalChain([response, 'access', _134 => _134.headers, 'optionalAccess', _135 => _135["location"]]) || _optionalChain([response, 'access', _136 => _136.headers, 'optionalAccess', _137 => _137["Location"]]);
29031
+ const locationHeader = _optionalChain([response, 'access', _136 => _136.headers, 'optionalAccess', _137 => _137["location"]]) || _optionalChain([response, 'access', _138 => _138.headers, 'optionalAccess', _139 => _139["Location"]]);
28650
29032
  let createdPath = "";
28651
29033
  if (locationHeader) {
28652
29034
  const pathMatch = locationHeader.match(/stylesheet\/folder\/(.+)$/);
@@ -29010,7 +29392,7 @@ var CreateTemplateTool = {
29010
29392
  validateStatus: () => true
29011
29393
  });
29012
29394
  if (response.status === 201) {
29013
- const locationHeader = _optionalChain([response, 'access', _138 => _138.headers, 'optionalAccess', _139 => _139["location"]]) || _optionalChain([response, 'access', _140 => _140.headers, 'optionalAccess', _141 => _141["Location"]]);
29395
+ const locationHeader = _optionalChain([response, 'access', _140 => _140.headers, 'optionalAccess', _141 => _141["location"]]) || _optionalChain([response, 'access', _142 => _142.headers, 'optionalAccess', _143 => _143["Location"]]);
29014
29396
  let createdId = "";
29015
29397
  if (locationHeader) {
29016
29398
  const idMatch = locationHeader.match(/template\/([a-f0-9-]+)$/i);
@@ -29906,7 +30288,7 @@ var UserCollection = {
29906
30288
  tools.push(get_item_user_default);
29907
30289
  tools.push(get_user_configuration_default);
29908
30290
  tools.push(get_user_by_id_calculate_start_nodes_default);
29909
- if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _142 => _142.umbracoVersion]))) {
30291
+ if (isUmbracoAtLeast(18, 1, _optionalChain([options, 'optionalAccess', _144 => _144.umbracoVersion]))) {
29910
30292
  tools.push(get_user_batch_default);
29911
30293
  }
29912
30294
  tools.push(upload_user_avatar_by_id_default);
@@ -29940,7 +30322,7 @@ var CreateUserDataTool = {
29940
30322
  validateStatus: () => true
29941
30323
  });
29942
30324
  if (response.status === 201) {
29943
- const locationHeader = _optionalChain([response, 'access', _143 => _143.headers, 'optionalAccess', _144 => _144["location"]]) || _optionalChain([response, 'access', _145 => _145.headers, 'optionalAccess', _146 => _146["Location"]]);
30325
+ const locationHeader = _optionalChain([response, 'access', _145 => _145.headers, 'optionalAccess', _146 => _146["location"]]) || _optionalChain([response, 'access', _147 => _147.headers, 'optionalAccess', _148 => _148["Location"]]);
29944
30326
  let createdId = "";
29945
30327
  if (locationHeader) {
29946
30328
  const idMatch = locationHeader.match(/user-data\/([a-f0-9-]+)$/i);
@@ -30178,7 +30560,7 @@ var CreateUserGroupTool = {
30178
30560
  validateStatus: () => true
30179
30561
  });
30180
30562
  if (response.status === 201) {
30181
- const locationHeader = _optionalChain([response, 'access', _147 => _147.headers, 'optionalAccess', _148 => _148["location"]]) || _optionalChain([response, 'access', _149 => _149.headers, 'optionalAccess', _150 => _150["Location"]]);
30563
+ const locationHeader = _optionalChain([response, 'access', _149 => _149.headers, 'optionalAccess', _150 => _150["location"]]) || _optionalChain([response, 'access', _151 => _151.headers, 'optionalAccess', _152 => _152["Location"]]);
30182
30564
  let createdId = "";
30183
30565
  if (locationHeader) {
30184
30566
  const idMatch = locationHeader.match(/user-group\/([a-f0-9-]+)$/i);
@@ -30476,7 +30858,7 @@ var CreateWebhookTool = {
30476
30858
  validateStatus: () => true
30477
30859
  });
30478
30860
  if (response.status === 201) {
30479
- const locationHeader = _optionalChain([response, 'access', _151 => _151.headers, 'optionalAccess', _152 => _152["location"]]) || _optionalChain([response, 'access', _153 => _153.headers, 'optionalAccess', _154 => _154["Location"]]);
30861
+ const locationHeader = _optionalChain([response, 'access', _153 => _153.headers, 'optionalAccess', _154 => _154["location"]]) || _optionalChain([response, 'access', _155 => _155.headers, 'optionalAccess', _156 => _156["Location"]]);
30480
30862
  let createdId = "";
30481
30863
  if (locationHeader) {
30482
30864
  const idMatch = locationHeader.match(/webhook\/([a-f0-9-]+)$/i);
@@ -30722,4 +31104,4 @@ var allSliceNames = [...toolSliceNames, "other"];
30722
31104
 
30723
31105
 
30724
31106
  exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.UmbracoManagementClient = UmbracoManagementClient3; exports.setAllowFilePathUploads = setAllowFilePathUploads; exports.setUmbracoVersion = setUmbracoVersion; exports.availableCollections = availableCollections; exports.allModes = allModes; exports.allModeNames = allModeNames; exports.allSliceNames = allSliceNames;
30725
- //# sourceMappingURL=chunk-FG6GMHN7.cjs.map
31107
+ //# sourceMappingURL=chunk-5OCJQREU.cjs.map