@umbraco-cms/mcp-dev 17.6.10 → 17.6.11

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.
@@ -4726,6 +4726,7 @@ var UmbracoManagementClient3 = (_class = class {
4726
4726
  }, _class.__initStatic(), _class);
4727
4727
 
4728
4728
  // src/umbraco-api/runtime-context.ts
4729
+
4729
4730
  var umbracoVersion = null;
4730
4731
  var allowFilePathUploads = false;
4731
4732
  function setAllowFilePathUploads(allow) {
@@ -4737,9 +4738,10 @@ function isFilePathUploadAllowed() {
4737
4738
  function setUmbracoVersion(version) {
4738
4739
  umbracoVersion = _nullishCoalesce(version, () => ( null));
4739
4740
  }
4740
- function isUmbracoAtLeast(major, minor) {
4741
- if (!umbracoVersion) return false;
4742
- const [maj, min] = umbracoVersion.split(".").map((n) => parseInt(n, 10));
4741
+ function isUmbracoAtLeast(major, minor, requestVersion) {
4742
+ const version = _nullishCoalesce(_nullishCoalesce(requestVersion, () => ( _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _9 => _9[_mcpserversdk.UMBRACO_VERSION_CONTEXT_KEY]]))), () => ( umbracoVersion));
4743
+ if (!version) return false;
4744
+ const [maj, min] = version.split(".").map((n) => parseInt(n, 10));
4743
4745
  if (Number.isNaN(maj) || Number.isNaN(min)) return false;
4744
4746
  if (maj > major) return true;
4745
4747
  if (maj < major) return false;
@@ -12940,7 +12942,7 @@ async function synthesizeDataTypeSchema(id) {
12940
12942
  const client = UmbracoManagementClient3.getClient();
12941
12943
  const dataType = await client.getDataTypeById(id);
12942
12944
  const template = findTemplateByEditorAlias(dataType.editorAlias);
12943
- const valueTypeName = _nullishCoalesce(VALUE_TYPE_BY_EDITOR_ALIAS[dataType.editorAlias], () => ( (_optionalChain([template, 'optionalAccess', _9 => _9.value]) !== void 0 ? "JSON" : null)));
12945
+ const valueTypeName = _nullishCoalesce(VALUE_TYPE_BY_EDITOR_ALIAS[dataType.editorAlias], () => ( (_optionalChain([template, 'optionalAccess', _10 => _10.value]) !== void 0 ? "JSON" : null)));
12944
12946
  const jsonSchema = {
12945
12947
  $schema: "https://json-schema.org/draft/2020-12/schema",
12946
12948
  title: dataType.name,
@@ -12948,8 +12950,8 @@ async function synthesizeDataTypeSchema(id) {
12948
12950
  dataTypeId: dataType.id,
12949
12951
  editorAlias: dataType.editorAlias,
12950
12952
  editorUiAlias: dataType.editorUiAlias,
12951
- example: _optionalChain([template, 'optionalAccess', _10 => _10.value]),
12952
- notes: _optionalChain([template, 'optionalAccess', _11 => _11._notes])
12953
+ example: _optionalChain([template, 'optionalAccess', _11 => _11.value]),
12954
+ notes: _optionalChain([template, 'optionalAccess', _12 => _12._notes])
12953
12955
  };
12954
12956
  return { valueTypeName, jsonSchema };
12955
12957
  }
@@ -13070,7 +13072,7 @@ var CopyDataTypeTool = {
13070
13072
  validateStatus: () => true
13071
13073
  });
13072
13074
  if (response.status === 201) {
13073
- const location = _optionalChain([response, 'access', _12 => _12.headers, 'optionalAccess', _13 => _13.location]) || "";
13075
+ const location = _optionalChain([response, 'access', _13 => _13.headers, 'optionalAccess', _14 => _14.location]) || "";
13074
13076
  const newId = location.split("/").pop() || "";
13075
13077
  const output = {
13076
13078
  message: "Data type copied successfully",
@@ -13542,7 +13544,7 @@ var DataTypeCollection = {
13542
13544
  description: "Data type definitions and management",
13543
13545
  dependencies: []
13544
13546
  },
13545
- tools: (user) => {
13547
+ tools: (user, options) => {
13546
13548
  const tools = [get_search_default];
13547
13549
  if (AuthorizationPolicies.TreeAccessDocumentsOrMediaOrMembersOrContentTypes(user)) {
13548
13550
  tools.push(get_references_data_type_default);
@@ -13552,7 +13554,7 @@ var DataTypeCollection = {
13552
13554
  tools.push(get_data_type_batch_default);
13553
13555
  tools.push(get_data_type_configuration_default);
13554
13556
  tools.push(get_data_type_schema_default);
13555
- if (isUmbracoAtLeast(17, 4)) {
13557
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _15 => _15.umbracoVersion]))) {
13556
13558
  tools.push(get_data_type_schemas_default);
13557
13559
  }
13558
13560
  }
@@ -13711,7 +13713,7 @@ var CreateDictionaryItemTool = {
13711
13713
  validateStatus: () => true
13712
13714
  });
13713
13715
  if (response.status === 201) {
13714
- const locationHeader = _optionalChain([response, 'access', _14 => _14.headers, 'optionalAccess', _15 => _15["location"]]) || _optionalChain([response, 'access', _16 => _16.headers, 'optionalAccess', _17 => _17["Location"]]);
13716
+ const locationHeader = _optionalChain([response, 'access', _16 => _16.headers, 'optionalAccess', _17 => _17["location"]]) || _optionalChain([response, 'access', _18 => _18.headers, 'optionalAccess', _19 => _19["Location"]]);
13715
13717
  let createdId = model.id || "";
13716
13718
  if (locationHeader) {
13717
13719
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -14671,8 +14673,8 @@ function buildPropertyEntry(prop, dataType, template) {
14671
14673
  editorAlias: dataType.editorAlias,
14672
14674
  dataTypeId: dataType.id,
14673
14675
  dataTypeName: dataType.name,
14674
- example: _optionalChain([template, 'optionalAccess', _18 => _18.value]),
14675
- notes: _optionalChain([template, 'optionalAccess', _19 => _19._notes])
14676
+ example: _optionalChain([template, 'optionalAccess', _20 => _20.value]),
14677
+ notes: _optionalChain([template, 'optionalAccess', _21 => _21._notes])
14676
14678
  };
14677
14679
  }
14678
14680
  async function synthesizeDocumentTypeSchema(id) {
@@ -15074,7 +15076,7 @@ var CopyDocumentTool = {
15074
15076
  validateStatus: () => true
15075
15077
  });
15076
15078
  if (response.status === 201) {
15077
- const location = _optionalChain([response, 'access', _20 => _20.headers, 'optionalAccess', _21 => _21.location]) || "";
15079
+ const location = _optionalChain([response, 'access', _22 => _22.headers, 'optionalAccess', _23 => _23.location]) || "";
15078
15080
  const newId = location.split("/").pop() || "";
15079
15081
  const output = { id: newId };
15080
15082
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -15218,7 +15220,7 @@ var CreateDocumentTool = {
15218
15220
  template = { id: model.templateId };
15219
15221
  } else {
15220
15222
  const docType = await client.getDocumentTypeById(model.documentTypeId);
15221
- template = _optionalChain([docType, 'access', _22 => _22.defaultTemplate, 'optionalAccess', _23 => _23.id]) ? { id: docType.defaultTemplate.id } : null;
15223
+ template = _optionalChain([docType, 'access', _24 => _24.defaultTemplate, 'optionalAccess', _25 => _25.id]) ? { id: docType.defaultTemplate.id } : null;
15222
15224
  }
15223
15225
  const payload = {
15224
15226
  id: documentId,
@@ -15396,7 +15398,7 @@ var CreateAndPublishDocumentTool = {
15396
15398
  template = { id: model.templateId };
15397
15399
  } else {
15398
15400
  const docType = await client.getDocumentTypeById(model.documentTypeId);
15399
- template = _optionalChain([docType, 'access', _24 => _24.defaultTemplate, 'optionalAccess', _25 => _25.id]) ? { id: docType.defaultTemplate.id } : null;
15401
+ template = _optionalChain([docType, 'access', _26 => _26.defaultTemplate, 'optionalAccess', _27 => _27.id]) ? { id: docType.defaultTemplate.id } : null;
15400
15402
  }
15401
15403
  const payload = {
15402
15404
  id: documentId,
@@ -15864,14 +15866,14 @@ var UpdateDocumentTool = {
15864
15866
  slices: ["update"],
15865
15867
  enabled: (user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Update),
15866
15868
  handler: (async (model) => {
15867
- const incomingValues = _optionalChain([model, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.values]);
15869
+ const incomingValues = _optionalChain([model, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.values]);
15868
15870
  if (Array.isArray(incomingValues) && incomingValues.length === 0 && !model.confirmClearValues) {
15869
15871
  const client = UmbracoManagementClient3.getClient();
15870
15872
  let currentDocument;
15871
15873
  try {
15872
15874
  currentDocument = await client.getDocumentById(model.id);
15873
15875
  } catch (error) {
15874
- const status = _optionalChain([error, 'optionalAccess', _28 => _28.response, 'optionalAccess', _29 => _29.status]);
15876
+ const status = _optionalChain([error, 'optionalAccess', _30 => _30.response, 'optionalAccess', _31 => _31.status]);
15875
15877
  if (status !== 404) {
15876
15878
  throw error;
15877
15879
  }
@@ -16301,7 +16303,7 @@ var UpdateDocumentPropertiesTool = {
16301
16303
  const docTypeProps = await getDocumentTypeProperties();
16302
16304
  const propsToValidate = allPropertiesToValidate.map((p) => {
16303
16305
  const def = docTypeProps.find((d) => d.alias === p.alias);
16304
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _30 => _30.dataTypeId]), () => ( "")) };
16306
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _32 => _32.dataTypeId]), () => ( "")) };
16305
16307
  }).filter((p) => p.dataTypeId);
16306
16308
  if (propsToValidate.length > 0) {
16307
16309
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -16703,7 +16705,7 @@ var UpdateBlockPropertyTool = {
16703
16705
  if (!isUmbracoAtLeast(17, 4) && elementTypeProperties.length > 0) {
16704
16706
  const propsToValidate = update.properties.map((p) => {
16705
16707
  const def = elementTypeProperties.find((d) => d.alias === p.alias);
16706
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _31 => _31.dataTypeId]), () => ( "")) };
16708
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _33 => _33.dataTypeId]), () => ( "")) };
16707
16709
  }).filter((p) => p.dataTypeId);
16708
16710
  if (propsToValidate.length > 0) {
16709
16711
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -17035,14 +17037,14 @@ function removeRteBlockElement(markup, contentKey) {
17035
17037
  return markup.slice(0, start) + markup.slice(end);
17036
17038
  }
17037
17039
  function getBlockTypeConfigurations(dataTypeValues) {
17038
- const blocks = _optionalChain([dataTypeValues, 'optionalAccess', _32 => _32.find, 'call', _33 => _33((v) => v.alias === "blocks"), 'optionalAccess', _34 => _34.value]);
17040
+ const blocks = _optionalChain([dataTypeValues, 'optionalAccess', _34 => _34.find, 'call', _35 => _35((v) => v.alias === "blocks"), 'optionalAccess', _36 => _36.value]);
17039
17041
  return Array.isArray(blocks) ? blocks : [];
17040
17042
  }
17041
17043
  function findBlockTypeConfiguration(configs, contentElementTypeKey) {
17042
17044
  return configs.find((c) => c.contentElementTypeKey === contentElementTypeKey);
17043
17045
  }
17044
17046
  function findAreaConfiguration(configs, parentContentTypeKey, areaKey) {
17045
- return _optionalChain([findBlockTypeConfiguration, 'call', _35 => _35(configs, parentContentTypeKey), 'optionalAccess', _36 => _36.areas, 'optionalAccess', _37 => _37.find, 'call', _38 => _38((a) => a.key === areaKey)]);
17047
+ return _optionalChain([findBlockTypeConfiguration, 'call', _37 => _37(configs, parentContentTypeKey), 'optionalAccess', _38 => _38.areas, 'optionalAccess', _39 => _39.find, 'call', _40 => _40((a) => a.key === areaKey)]);
17046
17048
  }
17047
17049
  function checkAllowedInArea(blockConfig, area) {
17048
17050
  if (blockConfig.allowInAreas === false) {
@@ -17208,7 +17210,7 @@ async function validateBlockProperties(elementTypeKey, properties, label) {
17208
17210
  if (!isUmbracoAtLeast(17, 4) && definitions.length > 0) {
17209
17211
  const propsToValidate = properties.map((p) => {
17210
17212
  const def = definitions.find((d) => d.alias === p.alias);
17211
- return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _39 => _39.dataTypeId]), () => ( "")) };
17213
+ return { alias: p.alias, value: p.value, dataTypeId: _nullishCoalesce(_optionalChain([def, 'optionalAccess', _41 => _41.dataTypeId]), () => ( "")) };
17212
17214
  }).filter((p) => p.dataTypeId);
17213
17215
  if (propsToValidate.length > 0) {
17214
17216
  const valueValidation = await validatePropertiesBeforeSave(propsToValidate);
@@ -17251,15 +17253,15 @@ var CreateDocumentBlockTool = {
17251
17253
  const { kind, container, blockConfigs } = ctx;
17252
17254
  const placement = _nullishCoalesce(model.placement, () => ( { position: "append" }));
17253
17255
  const contentProperties = _nullishCoalesce(model.properties, () => ( []));
17254
- const settingsProperties = _nullishCoalesce(_optionalChain([model, 'access', _40 => _40.settings, 'optionalAccess', _41 => _41.properties]), () => ( []));
17256
+ const settingsProperties = _nullishCoalesce(_optionalChain([model, 'access', _42 => _42.settings, 'optionalAccess', _43 => _43.properties]), () => ( []));
17255
17257
  if (model.grid && kind !== "BlockGrid") {
17256
17258
  throw new (0, _mcpserversdk.ToolValidationError)({
17257
17259
  title: "grid options not supported",
17258
17260
  detail: `'grid' only applies to BlockGrid properties; '${model.propertyAlias}' is a ${kind} property`
17259
17261
  });
17260
17262
  }
17261
- const areaKey = _optionalChain([model, 'access', _42 => _42.grid, 'optionalAccess', _43 => _43.areaKey]);
17262
- const parentContentKey = _optionalChain([model, 'access', _44 => _44.grid, 'optionalAccess', _45 => _45.parentContentKey]);
17263
+ const areaKey = _optionalChain([model, 'access', _44 => _44.grid, 'optionalAccess', _45 => _45.areaKey]);
17264
+ const parentContentKey = _optionalChain([model, 'access', _46 => _46.grid, 'optionalAccess', _47 => _47.parentContentKey]);
17263
17265
  if (!!areaKey !== !!parentContentKey) {
17264
17266
  throw new (0, _mcpserversdk.ToolValidationError)({
17265
17267
  title: "Incomplete area target",
@@ -17309,7 +17311,7 @@ var CreateDocumentBlockTool = {
17309
17311
  title: "Area not found",
17310
17312
  detail: `Area '${key}' is not configured for block type '${parentBlock.contentTypeKey}'`,
17311
17313
  extensions: {
17312
- availableAreas: (_nullishCoalesce(_optionalChain([findBlockTypeConfiguration, 'call', _46 => _46(blockConfigs, parentBlock.contentTypeKey), 'optionalAccess', _47 => _47.areas]), () => ( []))).map((a) => ({ key: a.key, alias: _nullishCoalesce(a.alias, () => ( null)) }))
17314
+ availableAreas: (_nullishCoalesce(_optionalChain([findBlockTypeConfiguration, 'call', _48 => _48(blockConfigs, parentBlock.contentTypeKey), 'optionalAccess', _49 => _49.areas]), () => ( []))).map((a) => ({ key: a.key, alias: _nullishCoalesce(a.alias, () => ( null)) }))
17313
17315
  }
17314
17316
  });
17315
17317
  }
@@ -17331,7 +17333,7 @@ var CreateDocumentBlockTool = {
17331
17333
  detail: `No block with contentKey '${placement.contentKey}' exists in property '${model.propertyAlias}'`
17332
17334
  });
17333
17335
  }
17334
- if (areaKey && (sibling.areaKey !== areaKey || _optionalChain([sibling, 'access', _48 => _48.parent, 'optionalAccess', _49 => _49.contentKey]) !== parentContentKey)) {
17336
+ if (areaKey && (sibling.areaKey !== areaKey || _optionalChain([sibling, 'access', _50 => _50.parent, 'optionalAccess', _51 => _51.contentKey]) !== parentContentKey)) {
17335
17337
  throw new (0, _mcpserversdk.ToolValidationError)({
17336
17338
  title: "Sibling not in target area",
17337
17339
  detail: `Block '${placement.contentKey}' is not in area '${areaKey}' of block '${parentContentKey}'`
@@ -17376,8 +17378,8 @@ var CreateDocumentBlockTool = {
17376
17378
  const layoutEntry = buildLayoutEntry(kind, {
17377
17379
  contentKey,
17378
17380
  settingsKey,
17379
- columnSpan: _optionalChain([model, 'access', _50 => _50.grid, 'optionalAccess', _51 => _51.columnSpan]),
17380
- rowSpan: _optionalChain([model, 'access', _52 => _52.grid, 'optionalAccess', _53 => _53.rowSpan]),
17381
+ columnSpan: _optionalChain([model, 'access', _52 => _52.grid, 'optionalAccess', _53 => _53.columnSpan]),
17382
+ rowSpan: _optionalChain([model, 'access', _54 => _54.grid, 'optionalAccess', _55 => _55.rowSpan]),
17381
17383
  areaKeys: (_nullishCoalesce(blockConfig.areas, () => ( []))).map((a) => a.key)
17382
17384
  });
17383
17385
  const elementType = await client.getDocumentTypeById(model.contentTypeKey);
@@ -17728,7 +17730,7 @@ var DocumentCollection = {
17728
17730
  description: "Document content management and publishing",
17729
17731
  dependencies: []
17730
17732
  },
17731
- tools: (user) => {
17733
+ tools: (user, options) => {
17732
17734
  const tools = [];
17733
17735
  if (AuthorizationPolicies.TreeAccessDocuments(user)) {
17734
17736
  tools.push(get_document_by_id_default);
@@ -17737,7 +17739,7 @@ var DocumentCollection = {
17737
17739
  tools.push(get_document_type_schema_default);
17738
17740
  tools.push(copy_document_default);
17739
17741
  tools.push(create_document_default);
17740
- if (isUmbracoAtLeast(17, 6)) {
17742
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _56 => _56.umbracoVersion]))) {
17741
17743
  tools.push(create_and_publish_document_default);
17742
17744
  }
17743
17745
  tools.push(post_document_public_access_default);
@@ -17754,13 +17756,13 @@ var DocumentCollection = {
17754
17756
  tools.push(publish_document_default);
17755
17757
  tools.push(publish_document_with_descendants_default);
17756
17758
  tools.push(sort_document_default);
17757
- if (isUmbracoAtLeast(17, 6)) {
17759
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _57 => _57.umbracoVersion]))) {
17758
17760
  tools.push(sort_document_children_default);
17759
17761
  tools.push(sort_document_root_children_default);
17760
17762
  }
17761
17763
  tools.push(unpublish_document_default);
17762
17764
  tools.push(update_document_default);
17763
- if (isUmbracoAtLeast(17, 6)) {
17765
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _58 => _58.umbracoVersion]))) {
17764
17766
  tools.push(update_and_publish_document_default);
17765
17767
  }
17766
17768
  tools.push(update_document_properties_default);
@@ -18096,7 +18098,7 @@ var CopyDocumentTypeTool = {
18096
18098
  validateStatus: () => true
18097
18099
  });
18098
18100
  if (response.status === 201) {
18099
- const location = _optionalChain([response, 'access', _54 => _54.headers, 'optionalAccess', _55 => _55.location]) || "";
18101
+ const location = _optionalChain([response, 'access', _59 => _59.headers, 'optionalAccess', _60 => _60.location]) || "";
18100
18102
  const newId = location.split("/").pop() || "";
18101
18103
  const output = { id: newId };
18102
18104
  return _mcpserversdk.createToolResult.call(void 0, output);
@@ -20302,7 +20304,7 @@ function getExtensionFromMimeType(mimeType) {
20302
20304
  return extension ? `.${extension}` : void 0;
20303
20305
  }
20304
20306
  function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
20305
- const isSvg = _optionalChain([filePath, 'optionalAccess', _56 => _56.toLowerCase, 'call', _57 => _57(), 'access', _58 => _58.endsWith, 'call', _59 => _59(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _60 => _60.toLowerCase, 'call', _61 => _61(), 'access', _62 => _62.endsWith, 'call', _63 => _63(".svg")]) || fileName.toLowerCase().endsWith(".svg");
20307
+ const isSvg = _optionalChain([filePath, 'optionalAccess', _61 => _61.toLowerCase, 'call', _62 => _62(), 'access', _63 => _63.endsWith, 'call', _64 => _64(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _65 => _65.toLowerCase, 'call', _66 => _66(), 'access', _67 => _67.endsWith, 'call', _68 => _68(".svg")]) || fileName.toLowerCase().endsWith(".svg");
20306
20308
  if (isSvg && mediaTypeName === _mcpserversdk.MEDIA_TYPE_IMAGE) {
20307
20309
  console.warn(`SVG detected - using ${_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS} media type instead of ${_mcpserversdk.MEDIA_TYPE_IMAGE}`);
20308
20310
  return _mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS;
@@ -20456,8 +20458,8 @@ async function uploadMediaFile(client, params) {
20456
20458
  });
20457
20459
  } catch (error) {
20458
20460
  const err = error;
20459
- const errorData = _optionalChain([err, 'access', _64 => _64.response, 'optionalAccess', _65 => _65.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
20460
- throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _66 => _66.response, 'optionalAccess', _67 => _67.status]) || "Unknown error"} - ${errorData}`);
20461
+ const errorData = _optionalChain([err, 'access', _69 => _69.response, 'optionalAccess', _70 => _70.data]) ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
20462
+ throw new Error(`Failed to upload temporary file: ${_optionalChain([err, 'access', _71 => _71.response, 'optionalAccess', _72 => _72.status]) || "Unknown error"} - ${errorData}`);
20461
20463
  }
20462
20464
  const valueStructure = buildValueStructure(validatedMediaTypeName, params.temporaryFileId);
20463
20465
  let response;
@@ -20477,12 +20479,12 @@ async function uploadMediaFile(client, params) {
20477
20479
  }, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE);
20478
20480
  } catch (error) {
20479
20481
  const err = error;
20480
- throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _68 => _68.response, 'optionalAccess', _69 => _69.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _70 => _70.response, 'optionalAccess', _71 => _71.data])) || err.message}`);
20482
+ throw new Error(`Failed to create media item: ${_optionalChain([err, 'access', _73 => _73.response, 'optionalAccess', _74 => _74.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _75 => _75.response, 'optionalAccess', _76 => _76.data])) || err.message}`);
20481
20483
  }
20482
20484
  if (response.status < 200 || response.status >= 300) {
20483
20485
  throw new Error(`Request failed with status code ${response.status}`);
20484
20486
  }
20485
- const locationHeader = _optionalChain([response, 'access', _72 => _72.headers, 'optionalAccess', _73 => _73.location]) || _optionalChain([response, 'access', _74 => _74.headers, 'optionalAccess', _75 => _75.Location]);
20487
+ const locationHeader = _optionalChain([response, 'access', _77 => _77.headers, 'optionalAccess', _78 => _78.location]) || _optionalChain([response, 'access', _79 => _79.headers, 'optionalAccess', _80 => _80.Location]);
20486
20488
  if (!locationHeader) {
20487
20489
  throw new Error("No Location header in response - cannot determine created media ID");
20488
20490
  }
@@ -20507,32 +20509,18 @@ function buildSourceTypeSection(allowFilePath, otherSources) {
20507
20509
  // src/umbraco-api/tools/media/post/helpers/streaming-upload.ts
20508
20510
 
20509
20511
 
20510
- var _mcphosted = require('@umbraco-cms/mcp-hosted');
20511
20512
 
20512
20513
 
20513
20514
 
20514
20515
 
20515
20516
 
20516
20517
 
20517
- var authContext = null;
20518
- function isStreamingAuthContextConfigured() {
20519
- return authContext !== null;
20518
+ function isStreamingUploadAvailable() {
20519
+ return _optionalChain([_mcpserversdk.getActiveRequestContext.call(void 0, ), 'optionalAccess', _81 => _81.umbracoAuth]) !== void 0;
20520
20520
  }
20521
20521
  async function resolveAuth() {
20522
- if (!authContext) {
20523
- throw new Error(
20524
- "Streaming auth context not configured. setStreamingAuthContext() must be called in worker init()."
20525
- );
20526
- }
20527
- const entry = await _mcphosted.getStoredUmbracoToken.call(void 0, authContext.env.OAUTH_KV, authContext.tokenKey);
20528
- if (!_optionalChain([entry, 'optionalAccess', _76 => _76.tokens, 'optionalAccess', _77 => _77.access_token])) {
20529
- throw new Error("No Umbraco access token in KV. Reconnect the MCP connector.");
20530
- }
20531
- const baseUrl = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([entry, 'access', _78 => _78.site, 'optionalAccess', _79 => _79.serverUrl]), () => ( _optionalChain([entry, 'access', _80 => _80.site, 'optionalAccess', _81 => _81.baseUrl]))), () => ( authContext.env.UMBRACO_SERVER_URL)), () => ( authContext.env.UMBRACO_BASE_URL));
20532
- if (!baseUrl) {
20533
- throw new Error("No Umbraco base URL resolvable from site or env.");
20534
- }
20535
- return { accessToken: entry.tokens.access_token, baseUrl: _mcpserversdk.normalizeBaseUrl.call(void 0, baseUrl) };
20522
+ const { accessToken, baseUrl } = await _mcpserversdk.getSessionUmbracoAuth.call(void 0, );
20523
+ return { accessToken, baseUrl: _mcpserversdk.normalizeBaseUrl.call(void 0, baseUrl) };
20536
20524
  }
20537
20525
  function ensureExtension(name, contentType, urlPath) {
20538
20526
  if (name.includes(".")) return name;
@@ -20556,10 +20544,7 @@ async function streamingUploadFromUrl(params) {
20556
20544
  );
20557
20545
  const [mediaTypeId, auth] = await Promise.all([
20558
20546
  fetchMediaTypeId(client, validatedMediaTypeName),
20559
- (async () => {
20560
- await client.getTemporaryFileConfiguration().catch(() => void 0);
20561
- return resolveAuth();
20562
- })()
20547
+ resolveAuth()
20563
20548
  ]);
20564
20549
  const { accessToken, baseUrl } = auth;
20565
20550
  const ctl = new AbortController();
@@ -20761,7 +20746,7 @@ ${filePathSection}
20761
20746
  } else {
20762
20747
  effectiveSourceType = model.sourceType;
20763
20748
  }
20764
- if (effectiveSourceType === "url" && isStreamingAuthContextConfigured()) {
20749
+ if (effectiveSourceType === "url" && isStreamingUploadAvailable()) {
20765
20750
  if (!effectiveFileUrl) {
20766
20751
  return _mcpserversdk.createToolResultError.call(void 0, {
20767
20752
  detail: "Error creating media: fileUrl is required when sourceType is 'url'"
@@ -20890,7 +20875,7 @@ ${filePathSection}
20890
20875
  });
20891
20876
  }
20892
20877
  const client = UmbracoManagementClient3.getClient();
20893
- const streamingAvailable = isStreamingAuthContextConfigured();
20878
+ const streamingAvailable = isStreamingUploadAvailable();
20894
20879
  const results = await mapWithConcurrency(
20895
20880
  model.files,
20896
20881
  UPLOAD_CONCURRENCY,
@@ -21812,7 +21797,7 @@ var MediaCollection = {
21812
21797
  description: "Media asset management and organization",
21813
21798
  dependencies: ["temporary-file"]
21814
21799
  },
21815
- tools: (user) => {
21800
+ tools: (user, options) => {
21816
21801
  const tools = [];
21817
21802
  tools.push(get_media_by_id_default);
21818
21803
  if (AuthorizationPolicies.SectionAccessForMediaTree(user)) {
@@ -21834,7 +21819,7 @@ var MediaCollection = {
21834
21819
  tools.push(validate_media_default);
21835
21820
  tools.push(validate_media_default2);
21836
21821
  tools.push(sort_media_default);
21837
- if (isUmbracoAtLeast(17, 6)) {
21822
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _99 => _99.umbracoVersion]))) {
21838
21823
  tools.push(sort_media_children_default);
21839
21824
  tools.push(sort_media_root_children_default);
21840
21825
  }
@@ -21855,7 +21840,7 @@ var MediaCollection = {
21855
21840
  tools.push(get_collection_media_default);
21856
21841
  tools.push(get_recycle_bin_media_referenced_by_default);
21857
21842
  tools.push(get_recycle_bin_media_original_parent_default);
21858
- if (isUmbracoAtLeast(17, 4)) {
21843
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _100 => _100.umbracoVersion]))) {
21859
21844
  tools.push(get_media_type_schema_default);
21860
21845
  }
21861
21846
  }
@@ -22289,7 +22274,7 @@ var CreateMediaTypeFolderTool = {
22289
22274
  validateStatus: () => true
22290
22275
  });
22291
22276
  if (response.status === 201) {
22292
- const locationHeader = _optionalChain([response, 'access', _99 => _99.headers, 'optionalAccess', _100 => _100["location"]]) || _optionalChain([response, 'access', _101 => _101.headers, 'optionalAccess', _102 => _102["Location"]]);
22277
+ const locationHeader = _optionalChain([response, 'access', _101 => _101.headers, 'optionalAccess', _102 => _102["location"]]) || _optionalChain([response, 'access', _103 => _103.headers, 'optionalAccess', _104 => _104["Location"]]);
22293
22278
  let createdId = model.id || "";
22294
22279
  if (locationHeader) {
22295
22280
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22423,7 +22408,7 @@ var CreateMediaTypeTool = {
22423
22408
  validateStatus: () => true
22424
22409
  });
22425
22410
  if (response.status === 201) {
22426
- const locationHeader = _optionalChain([response, 'access', _103 => _103.headers, 'optionalAccess', _104 => _104["location"]]) || _optionalChain([response, 'access', _105 => _105.headers, 'optionalAccess', _106 => _106["Location"]]);
22411
+ const locationHeader = _optionalChain([response, 'access', _105 => _105.headers, 'optionalAccess', _106 => _106["location"]]) || _optionalChain([response, 'access', _107 => _107.headers, 'optionalAccess', _108 => _108["Location"]]);
22427
22412
  let createdId = model.id || "";
22428
22413
  if (locationHeader) {
22429
22414
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22474,7 +22459,7 @@ var CopyMediaTypeTool = {
22474
22459
  validateStatus: () => true
22475
22460
  });
22476
22461
  if (response.status === 201) {
22477
- const locationHeader = _optionalChain([response, 'access', _107 => _107.headers, 'optionalAccess', _108 => _108["location"]]) || _optionalChain([response, 'access', _109 => _109.headers, 'optionalAccess', _110 => _110["Location"]]);
22462
+ const locationHeader = _optionalChain([response, 'access', _109 => _109.headers, 'optionalAccess', _110 => _110["location"]]) || _optionalChain([response, 'access', _111 => _111.headers, 'optionalAccess', _112 => _112["Location"]]);
22478
22463
  let createdId = "";
22479
22464
  if (locationHeader) {
22480
22465
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22684,7 +22669,7 @@ var CreateMemberTool = {
22684
22669
  validateStatus: () => true
22685
22670
  });
22686
22671
  if (response.status === 201) {
22687
- const locationHeader = _optionalChain([response, 'access', _111 => _111.headers, 'optionalAccess', _112 => _112["location"]]) || _optionalChain([response, 'access', _113 => _113.headers, 'optionalAccess', _114 => _114["Location"]]);
22672
+ const locationHeader = _optionalChain([response, 'access', _113 => _113.headers, 'optionalAccess', _114 => _114["location"]]) || _optionalChain([response, 'access', _115 => _115.headers, 'optionalAccess', _116 => _116["Location"]]);
22688
22673
  let createdId = model.id || "";
22689
22674
  if (locationHeader) {
22690
22675
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -22979,7 +22964,7 @@ var MemberCollection = {
22979
22964
  description: "Member account management and administration",
22980
22965
  dependencies: []
22981
22966
  },
22982
- tools: (user) => {
22967
+ tools: (user, options) => {
22983
22968
  const tools = [];
22984
22969
  if (AuthorizationPolicies.SectionAccessMembers(user)) {
22985
22970
  tools.push(get_member_default);
@@ -22991,7 +22976,7 @@ var MemberCollection = {
22991
22976
  tools.push(get_member_are_referenced_default);
22992
22977
  tools.push(get_member_by_id_referenced_by_default);
22993
22978
  tools.push(get_member_by_id_referenced_descendants_default);
22994
- if (isUmbracoAtLeast(17, 4)) {
22979
+ if (isUmbracoAtLeast(17, 4, _optionalChain([options, 'optionalAccess', _117 => _117.umbracoVersion]))) {
22995
22980
  tools.push(get_member_type_schema_default);
22996
22981
  }
22997
22982
  }
@@ -23235,7 +23220,7 @@ var CreateMemberTypeTool = {
23235
23220
  validateStatus: () => true
23236
23221
  });
23237
23222
  if (response.status === 201) {
23238
- const locationHeader = _optionalChain([response, 'access', _115 => _115.headers, 'optionalAccess', _116 => _116["location"]]) || _optionalChain([response, 'access', _117 => _117.headers, 'optionalAccess', _118 => _118["Location"]]);
23223
+ const locationHeader = _optionalChain([response, 'access', _118 => _118.headers, 'optionalAccess', _119 => _119["location"]]) || _optionalChain([response, 'access', _120 => _120.headers, 'optionalAccess', _121 => _121["Location"]]);
23239
23224
  let createdId = model.id || "";
23240
23225
  if (locationHeader) {
23241
23226
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -23405,7 +23390,7 @@ var CopyMemberTypeTool = {
23405
23390
  validateStatus: () => true
23406
23391
  });
23407
23392
  if (response.status === 201) {
23408
- const locationHeader = _optionalChain([response, 'access', _119 => _119.headers, 'optionalAccess', _120 => _120["location"]]) || _optionalChain([response, 'access', _121 => _121.headers, 'optionalAccess', _122 => _122["Location"]]);
23393
+ const locationHeader = _optionalChain([response, 'access', _122 => _122.headers, 'optionalAccess', _123 => _123["location"]]) || _optionalChain([response, 'access', _124 => _124.headers, 'optionalAccess', _125 => _125["Location"]]);
23409
23394
  let createdId = "";
23410
23395
  if (locationHeader) {
23411
23396
  const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
@@ -23765,7 +23750,7 @@ var CreatePartialViewTool = {
23765
23750
  validateStatus: () => true
23766
23751
  });
23767
23752
  if (response.status === 201) {
23768
- const locationHeader = _optionalChain([response, 'access', _123 => _123.headers, 'optionalAccess', _124 => _124["location"]]) || _optionalChain([response, 'access', _125 => _125.headers, 'optionalAccess', _126 => _126["Location"]]);
23753
+ const locationHeader = _optionalChain([response, 'access', _126 => _126.headers, 'optionalAccess', _127 => _127["location"]]) || _optionalChain([response, 'access', _128 => _128.headers, 'optionalAccess', _129 => _129["Location"]]);
23769
23754
  let createdPath = "";
23770
23755
  if (locationHeader) {
23771
23756
  const pathMatch = locationHeader.match(/partial-view\/(.+)$/);
@@ -23812,7 +23797,7 @@ var CreatePartialViewFolderTool = {
23812
23797
  validateStatus: () => true
23813
23798
  });
23814
23799
  if (response.status === 201) {
23815
- const locationHeader = _optionalChain([response, 'access', _127 => _127.headers, 'optionalAccess', _128 => _128["location"]]) || _optionalChain([response, 'access', _129 => _129.headers, 'optionalAccess', _130 => _130["Location"]]);
23800
+ const locationHeader = _optionalChain([response, 'access', _130 => _130.headers, 'optionalAccess', _131 => _131["location"]]) || _optionalChain([response, 'access', _132 => _132.headers, 'optionalAccess', _133 => _133["Location"]]);
23816
23801
  let createdPath = "";
23817
23802
  if (locationHeader) {
23818
23803
  const pathMatch = locationHeader.match(/partial-view\/folder\/(.+)$/);
@@ -24639,7 +24624,7 @@ var CreateScriptTool = {
24639
24624
  validateStatus: () => true
24640
24625
  });
24641
24626
  if (response.status === 201) {
24642
- const locationHeader = _optionalChain([response, 'access', _131 => _131.headers, 'optionalAccess', _132 => _132["location"]]) || _optionalChain([response, 'access', _133 => _133.headers, 'optionalAccess', _134 => _134["Location"]]);
24627
+ const locationHeader = _optionalChain([response, 'access', _134 => _134.headers, 'optionalAccess', _135 => _135["location"]]) || _optionalChain([response, 'access', _136 => _136.headers, 'optionalAccess', _137 => _137["Location"]]);
24643
24628
  let createdPath = "";
24644
24629
  if (locationHeader) {
24645
24630
  const pathMatch = locationHeader.match(/script\/(.+)$/);
@@ -24686,7 +24671,7 @@ var CreateScriptFolderTool = {
24686
24671
  validateStatus: () => true
24687
24672
  });
24688
24673
  if (response.status === 201) {
24689
- const locationHeader = _optionalChain([response, 'access', _135 => _135.headers, 'optionalAccess', _136 => _136["location"]]) || _optionalChain([response, 'access', _137 => _137.headers, 'optionalAccess', _138 => _138["Location"]]);
24674
+ const locationHeader = _optionalChain([response, 'access', _138 => _138.headers, 'optionalAccess', _139 => _139["location"]]) || _optionalChain([response, 'access', _140 => _140.headers, 'optionalAccess', _141 => _141["Location"]]);
24690
24675
  let createdPath = "";
24691
24676
  if (locationHeader) {
24692
24677
  const pathMatch = locationHeader.match(/script\/folder\/(.+)$/);
@@ -25283,7 +25268,7 @@ var CreateStylesheetTool = {
25283
25268
  validateStatus: () => true
25284
25269
  });
25285
25270
  if (response.status === 201) {
25286
- const locationHeader = _optionalChain([response, 'access', _139 => _139.headers, 'optionalAccess', _140 => _140["location"]]) || _optionalChain([response, 'access', _141 => _141.headers, 'optionalAccess', _142 => _142["Location"]]);
25271
+ const locationHeader = _optionalChain([response, 'access', _142 => _142.headers, 'optionalAccess', _143 => _143["location"]]) || _optionalChain([response, 'access', _144 => _144.headers, 'optionalAccess', _145 => _145["Location"]]);
25287
25272
  let createdPath = "";
25288
25273
  if (locationHeader) {
25289
25274
  const pathMatch = locationHeader.match(/stylesheet\/(.+)$/);
@@ -25330,7 +25315,7 @@ var CreateStylesheetFolderTool = {
25330
25315
  validateStatus: () => true
25331
25316
  });
25332
25317
  if (response.status === 201) {
25333
- const locationHeader = _optionalChain([response, 'access', _143 => _143.headers, 'optionalAccess', _144 => _144["location"]]) || _optionalChain([response, 'access', _145 => _145.headers, 'optionalAccess', _146 => _146["Location"]]);
25318
+ const locationHeader = _optionalChain([response, 'access', _146 => _146.headers, 'optionalAccess', _147 => _147["location"]]) || _optionalChain([response, 'access', _148 => _148.headers, 'optionalAccess', _149 => _149["Location"]]);
25334
25319
  let createdPath = "";
25335
25320
  if (locationHeader) {
25336
25321
  const pathMatch = locationHeader.match(/stylesheet\/folder\/(.+)$/);
@@ -25694,7 +25679,7 @@ var CreateTemplateTool = {
25694
25679
  validateStatus: () => true
25695
25680
  });
25696
25681
  if (response.status === 201) {
25697
- const locationHeader = _optionalChain([response, 'access', _147 => _147.headers, 'optionalAccess', _148 => _148["location"]]) || _optionalChain([response, 'access', _149 => _149.headers, 'optionalAccess', _150 => _150["Location"]]);
25682
+ const locationHeader = _optionalChain([response, 'access', _150 => _150.headers, 'optionalAccess', _151 => _151["location"]]) || _optionalChain([response, 'access', _152 => _152.headers, 'optionalAccess', _153 => _153["Location"]]);
25698
25683
  let createdId = "";
25699
25684
  if (locationHeader) {
25700
25685
  const idMatch = locationHeader.match(/template\/([a-f0-9-]+)$/i);
@@ -26423,15 +26408,11 @@ var get_user_current_permissions_default = _mcpserversdk.withStandardDecorators.
26423
26408
 
26424
26409
 
26425
26410
 
26426
-
26427
- var outputSchema62 = _zod.z.object({
26428
- items: getUserCurrentPermissionsDocumentResponse
26429
- });
26430
26411
  var GetUserCurrentPermissionsDocumentTool = {
26431
26412
  name: "get-user-current-permissions-document",
26432
26413
  description: "Gets the current user's document permissions for specific documents",
26433
26414
  inputSchema: getUserCurrentPermissionsDocumentQueryParams.shape,
26434
- outputSchema: outputSchema62.shape,
26415
+ outputSchema: getUserCurrentPermissionsDocumentResponse.shape,
26435
26416
  annotations: { readOnlyHint: true },
26436
26417
  slices: ["permissions"],
26437
26418
  handler: (async (params) => {
@@ -26622,7 +26603,7 @@ var UserCollection = {
26622
26603
  description: "User account management and administration",
26623
26604
  dependencies: ["temporary-file"]
26624
26605
  },
26625
- tools: (user) => {
26606
+ tools: (user, options) => {
26626
26607
  const tools = [];
26627
26608
  tools.push(get_user_current_default);
26628
26609
  tools.push(get_user_current_configuration_default);
@@ -26640,7 +26621,7 @@ var UserCollection = {
26640
26621
  tools.push(get_item_user_default);
26641
26622
  tools.push(get_user_configuration_default);
26642
26623
  tools.push(get_user_by_id_calculate_start_nodes_default);
26643
- if (isUmbracoAtLeast(17, 6)) {
26624
+ if (isUmbracoAtLeast(17, 6, _optionalChain([options, 'optionalAccess', _154 => _154.umbracoVersion]))) {
26644
26625
  tools.push(get_user_batch_default);
26645
26626
  }
26646
26627
  tools.push(upload_user_avatar_by_id_default);
@@ -26674,7 +26655,7 @@ var CreateUserDataTool = {
26674
26655
  validateStatus: () => true
26675
26656
  });
26676
26657
  if (response.status === 201) {
26677
- const locationHeader = _optionalChain([response, 'access', _151 => _151.headers, 'optionalAccess', _152 => _152["location"]]) || _optionalChain([response, 'access', _153 => _153.headers, 'optionalAccess', _154 => _154["Location"]]);
26658
+ const locationHeader = _optionalChain([response, 'access', _155 => _155.headers, 'optionalAccess', _156 => _156["location"]]) || _optionalChain([response, 'access', _157 => _157.headers, 'optionalAccess', _158 => _158["Location"]]);
26678
26659
  let createdId = "";
26679
26660
  if (locationHeader) {
26680
26661
  const idMatch = locationHeader.match(/user-data\/([a-f0-9-]+)$/i);
@@ -26828,14 +26809,14 @@ var get_user_group_default = _mcpserversdk.withStandardDecorators.call(void 0, G
26828
26809
 
26829
26810
 
26830
26811
 
26831
- var outputSchema63 = _zod.z.object({
26812
+ var outputSchema62 = _zod.z.object({
26832
26813
  items: getItemUserGroupResponse
26833
26814
  });
26834
26815
  var GetUserGroupByIdArrayTool = {
26835
26816
  name: "get-user-group-by-id-array",
26836
26817
  description: "Gets user groups by an array of IDs",
26837
26818
  inputSchema: getItemUserGroupQueryParams.shape,
26838
- outputSchema: outputSchema63.shape,
26819
+ outputSchema: outputSchema62.shape,
26839
26820
  annotations: { readOnlyHint: true },
26840
26821
  slices: ["list"],
26841
26822
  handler: (async (params) => {
@@ -26912,7 +26893,7 @@ var CreateUserGroupTool = {
26912
26893
  validateStatus: () => true
26913
26894
  });
26914
26895
  if (response.status === 201) {
26915
- const locationHeader = _optionalChain([response, 'access', _155 => _155.headers, 'optionalAccess', _156 => _156["location"]]) || _optionalChain([response, 'access', _157 => _157.headers, 'optionalAccess', _158 => _158["Location"]]);
26896
+ const locationHeader = _optionalChain([response, 'access', _159 => _159.headers, 'optionalAccess', _160 => _160["location"]]) || _optionalChain([response, 'access', _161 => _161.headers, 'optionalAccess', _162 => _162["Location"]]);
26916
26897
  let createdId = "";
26917
26898
  if (locationHeader) {
26918
26899
  const idMatch = locationHeader.match(/user-group\/([a-f0-9-]+)$/i);
@@ -27056,14 +27037,14 @@ var get_webhook_by_id_default = _mcpserversdk.withStandardDecorators.call(void 0
27056
27037
 
27057
27038
 
27058
27039
 
27059
- var outputSchema64 = _zod.z.object({
27040
+ var outputSchema63 = _zod.z.object({
27060
27041
  items: getItemWebhookResponse
27061
27042
  });
27062
27043
  var GetWebhookItemTool = {
27063
27044
  name: "get-webhook-item",
27064
27045
  description: "Gets webhooks by IDs (or empty array if no IDs are provided)",
27065
27046
  inputSchema: getItemWebhookQueryParams.shape,
27066
- outputSchema: outputSchema64.shape,
27047
+ outputSchema: outputSchema63.shape,
27067
27048
  annotations: { readOnlyHint: true },
27068
27049
  slices: ["list"],
27069
27050
  handler: (async (params) => {
@@ -27210,7 +27191,7 @@ var CreateWebhookTool = {
27210
27191
  validateStatus: () => true
27211
27192
  });
27212
27193
  if (response.status === 201) {
27213
- const locationHeader = _optionalChain([response, 'access', _159 => _159.headers, 'optionalAccess', _160 => _160["location"]]) || _optionalChain([response, 'access', _161 => _161.headers, 'optionalAccess', _162 => _162["Location"]]);
27194
+ const locationHeader = _optionalChain([response, 'access', _163 => _163.headers, 'optionalAccess', _164 => _164["location"]]) || _optionalChain([response, 'access', _165 => _165.headers, 'optionalAccess', _166 => _166["Location"]]);
27214
27195
  let createdId = "";
27215
27196
  if (locationHeader) {
27216
27197
  const idMatch = locationHeader.match(/webhook\/([a-f0-9-]+)$/i);
@@ -27446,4 +27427,4 @@ var allSliceNames = [...toolSliceNames, "other"];
27446
27427
 
27447
27428
 
27448
27429
  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;
27449
- //# sourceMappingURL=chunk-3FBX4NTJ.cjs.map
27430
+ //# sourceMappingURL=chunk-WAZSHKMB.cjs.map