@umbraco-cms/mcp-dev 17.4.1 → 17.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-H5ZIS43M.cjs → chunk-BKIMD4NU.cjs} +412 -68
- package/dist/chunk-BKIMD4NU.cjs.map +1 -0
- package/dist/{chunk-XVBYRUFE.js → chunk-ZDGU5P5E.js} +928 -584
- package/dist/chunk-ZDGU5P5E.js.map +1 -0
- package/dist/collections.cjs +2 -2
- package/dist/collections.js +1 -1
- package/dist/index.cjs +90 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/tool-types.d.ts +8272 -24
- package/package.json +3 -3
- package/dist/chunk-H5ZIS43M.cjs.map +0 -1
- package/dist/chunk-XVBYRUFE.js.map +0 -1
|
@@ -4293,6 +4293,15 @@ var getUmbracoManagementAPI = () => {
|
|
|
4293
4293
|
options
|
|
4294
4294
|
);
|
|
4295
4295
|
};
|
|
4296
|
+
const deleteUserCurrentAvatar = (options) => {
|
|
4297
|
+
return UmbracoManagementClient(
|
|
4298
|
+
{
|
|
4299
|
+
url: `/umbraco/management/api/v1/user/current/avatar`,
|
|
4300
|
+
method: "DELETE"
|
|
4301
|
+
},
|
|
4302
|
+
options
|
|
4303
|
+
);
|
|
4304
|
+
};
|
|
4296
4305
|
const postUserCurrentAvatar = (setAvatarRequestModel, options) => {
|
|
4297
4306
|
return UmbracoManagementClient(
|
|
4298
4307
|
{
|
|
@@ -4363,6 +4372,17 @@ var getUmbracoManagementAPI = () => {
|
|
|
4363
4372
|
options
|
|
4364
4373
|
);
|
|
4365
4374
|
};
|
|
4375
|
+
const putUserCurrentProfile = (updateCurrentUserRequestModel, options) => {
|
|
4376
|
+
return UmbracoManagementClient(
|
|
4377
|
+
{
|
|
4378
|
+
url: `/umbraco/management/api/v1/user/current/profile`,
|
|
4379
|
+
method: "PUT",
|
|
4380
|
+
headers: { "Content-Type": "application/json" },
|
|
4381
|
+
data: updateCurrentUserRequestModel
|
|
4382
|
+
},
|
|
4383
|
+
options
|
|
4384
|
+
);
|
|
4385
|
+
};
|
|
4366
4386
|
const postUserDisable = (disableUserRequestModel, options) => {
|
|
4367
4387
|
return UmbracoManagementClient(
|
|
4368
4388
|
{
|
|
@@ -4541,7 +4561,7 @@ var getUmbracoManagementAPI = () => {
|
|
|
4541
4561
|
options
|
|
4542
4562
|
);
|
|
4543
4563
|
};
|
|
4544
|
-
return { getCulture, postDataType, getDataTypeById, deleteDataTypeById, putDataTypeById, postDataTypeByIdCopy, getDataTypeByIdIsUsed, putDataTypeByIdMove, getDataTypeByIdReferencedBy, getDataTypeByIdSchema, getDataTypeBatch, getDataTypeConfiguration, postDataTypeFolder, getDataTypeFolderById, deleteDataTypeFolderById, putDataTypeFolderById, getDataTypeSchemasBatch, getFilterDataType, getItemDataType, getItemDataTypeAncestors, getItemDataTypeSearch, getTreeDataTypeAncestors, getTreeDataTypeChildren, getTreeDataTypeRoot, getTreeDataTypeSearch, getTreeDataTypeSiblings, getDictionary, postDictionary, getDictionaryById, deleteDictionaryById, putDictionaryById, getDictionaryByIdExport, putDictionaryByIdMove, postDictionaryImport, getItemDictionary, getTreeDictionaryAncestors, getTreeDictionaryChildren, getTreeDictionaryRoot, postDocumentBlueprint, getDocumentBlueprintById, deleteDocumentBlueprintById, putDocumentBlueprintById, getDocumentBlueprintByIdAuditLog, putDocumentBlueprintByIdMove, getDocumentBlueprintByIdScaffold, postDocumentBlueprintFolder, getDocumentBlueprintFolderById, deleteDocumentBlueprintFolderById, putDocumentBlueprintFolderById, postDocumentBlueprintFromDocument, getItemDocumentBlueprint, getTreeDocumentBlueprintAncestors, getTreeDocumentBlueprintChildren, getTreeDocumentBlueprintRoot, getTreeDocumentBlueprintSiblings, postDocumentType, getDocumentTypeById, deleteDocumentTypeById, putDocumentTypeById, getDocumentTypeByIdAllowedChildren, getDocumentTypeByIdAllowedParents, getDocumentTypeByIdBlueprint, getDocumentTypeByIdCompositionReferences, postDocumentTypeByIdCopy, getDocumentTypeByIdExport, putDocumentTypeByIdImport, putDocumentTypeByIdMove, getDocumentTypeByIdSchema, postDocumentTypeByIdTemplate, getDocumentTypeAllowedAtRoot, postDocumentTypeAvailableCompositions, getDocumentTypeBatch, getDocumentTypeConfiguration, postDocumentTypeFolder, getDocumentTypeFolderById, deleteDocumentTypeFolderById, putDocumentTypeFolderById, postDocumentTypeImport, getItemDocumentType, getItemDocumentTypeAncestors, getItemDocumentTypeSearch, getTreeDocumentTypeAncestors, getTreeDocumentTypeChildren, getTreeDocumentTypeRoot, getTreeDocumentTypeSearch, getTreeDocumentTypeSiblings, getDocumentVersion, getDocumentVersionById, putDocumentVersionByIdPreventCleanup, postDocumentVersionByIdRollback, getCollectionDocumentById, postDocument, getDocumentById, deleteDocumentById, putDocumentById, getDocumentByIdAuditLog, getDocumentByIdAvailableSegmentOptions, postDocumentByIdCopy, getDocumentByIdDomains, putDocumentByIdDomains, putDocumentByIdMove, putDocumentByIdMoveToRecycleBin, getDocumentByIdNotifications, putDocumentByIdNotifications, patchDocumentByIdPatch, getDocumentByIdPreviewUrl, postDocumentByIdPublicAccess, deleteDocumentByIdPublicAccess, getDocumentByIdPublicAccess, putDocumentByIdPublicAccess, putDocumentByIdPublish, putDocumentByIdPublishWithDescendants, getDocumentByIdPublishWithDescendantsResultByTaskId, getDocumentByIdPublished, getDocumentByIdReferencedBy, getDocumentByIdReferencedDescendants, putDocumentByIdUnpublish, putUmbracoManagementApiV11DocumentByIdValidate11, getDocumentAreReferenced, getDocumentConfiguration, putDocumentSort, getDocumentUrls, postDocumentValidate, getItemDocument, getItemDocumentAncestors, getItemDocumentSearch, deleteRecycleBinDocument, deleteRecycleBinDocumentById, getRecycleBinDocumentByIdOriginalParent, putRecycleBinDocumentByIdRestore, getRecycleBinDocumentChildren, getRecycleBinDocumentReferencedBy, getRecycleBinDocumentRoot, getRecycleBinDocumentSiblings, getTreeDocumentAncestors, getTreeDocumentChildren, getTreeDocumentRoot, getTreeDocumentSiblings, postDynamicRootQuery, getDynamicRootSteps, getHealthCheckGroup, getHealthCheckGroupByName, postHealthCheckGroupByNameCheck, postHealthCheckExecuteAction, getHelp, getImagingResizeUrls, getImportAnalyze, getIndexer, getIndexerByIndexName, postIndexerByIndexNameRebuild, getInstallSettings, postInstallSetup, postInstallValidateDatabase, getItemLanguage, getItemLanguageDefault, getLanguage, postLanguage, getLanguageByIsoCode, deleteLanguageByIsoCode, putLanguageByIsoCode, getLogViewerLevel, getLogViewerLevelCount, getLogViewerLog, getLogViewerMessageTemplate, getLogViewerSavedSearch, postLogViewerSavedSearch, getLogViewerSavedSearchByName, deleteLogViewerSavedSearchByName, getLogViewerValidateLogsSize, getManifestManifest, getManifestManifestPrivate, getManifestManifestPublic, getItemMediaType, getItemMediaTypeAllowed, getItemMediaTypeAncestors, getItemMediaTypeFolders, getItemMediaTypeSearch, postMediaType, getMediaTypeById, deleteMediaTypeById, putMediaTypeById, getMediaTypeByIdAllowedChildren, getMediaTypeByIdAllowedParents, getMediaTypeByIdCompositionReferences, postMediaTypeByIdCopy, getMediaTypeByIdExport, putMediaTypeByIdImport, putMediaTypeByIdMove, getMediaTypeByIdSchema, getMediaTypeAllowedAtRoot, postMediaTypeAvailableCompositions, getMediaTypeBatch, getMediaTypeConfiguration, postMediaTypeFolder, getMediaTypeFolderById, deleteMediaTypeFolderById, putMediaTypeFolderById, postMediaTypeImport, getTreeMediaTypeAncestors, getTreeMediaTypeChildren, getTreeMediaTypeRoot, getTreeMediaTypeSiblings, getCollectionMedia, getItemMedia, getItemMediaAncestors, getItemMediaSearch, postMedia, getMediaById, deleteMediaById, putMediaById, getMediaByIdAuditLog, putMediaByIdMove, putMediaByIdMoveToRecycleBin, getMediaByIdReferencedBy, getMediaByIdReferencedDescendants, putMediaByIdValidate, getMediaAreReferenced, getMediaConfiguration, putMediaSort, getMediaUrls, postMediaValidate, deleteRecycleBinMedia, deleteRecycleBinMediaById, getRecycleBinMediaByIdOriginalParent, putRecycleBinMediaByIdRestore, getRecycleBinMediaChildren, getRecycleBinMediaReferencedBy, getRecycleBinMediaRoot, getRecycleBinMediaSiblings, getTreeMediaAncestors, getTreeMediaChildren, getTreeMediaRoot, getTreeMediaSiblings, getItemMemberGroup, getMemberGroup, postMemberGroup, getMemberGroupById, deleteMemberGroupById, putMemberGroupById, getTreeMemberGroupRoot, getItemMemberType, getItemMemberTypeAncestors, getItemMemberTypeSearch, postMemberType, getMemberTypeById, deleteMemberTypeById, putMemberTypeById, getMemberTypeByIdCompositionReferences, postMemberTypeByIdCopy, getMemberTypeByIdExport, putMemberTypeByIdImport, putMemberTypeByIdMove, getMemberTypeByIdSchema, getMemberTypeAllowedAtRoot, postMemberTypeAvailableCompositions, getMemberTypeBatch, getMemberTypeConfiguration, postMemberTypeFolder, getMemberTypeFolderById, deleteMemberTypeFolderById, putMemberTypeFolderById, postMemberTypeImport, getTreeMemberTypeAncestors, getTreeMemberTypeChildren, getTreeMemberTypeRoot, getTreeMemberTypeSiblings, getFilterMember, getItemMember, getItemMemberAncestors, getItemMemberSearch, postMember, getMemberById, deleteMemberById, putMemberById, getMemberByIdReferencedBy, getMemberByIdReferencedDescendants, putMemberByIdValidate, getMemberAreReferenced, getMemberConfiguration, postMemberValidate, postModelsBuilderBuild, getModelsBuilderDashboard, getModelsBuilderStatus, getNewsDashboard, getObjectTypes, getOembedQuery, postPackageByNameRunMigration, getPackageConfiguration, getPackageCreated, postPackageCreated, getPackageCreatedById, deletePackageCreatedById, putPackageCreatedById, getPackageCreatedByIdDownload, getPackageMigrationStatus, getItemPartialView, postPartialView, getPartialViewByPath, deletePartialViewByPath, putPartialViewByPath, putPartialViewByPathRename, postPartialViewFolder, getPartialViewFolderByPath, deletePartialViewFolderByPath, getPartialViewSnippet, getPartialViewSnippetById, getTreePartialViewAncestors, getTreePartialViewChildren, getTreePartialViewRoot, getTreePartialViewSiblings, deletePreview, postPreview, getProfilingStatus, putProfilingStatus, getPropertyTypeIsUsed, postPublishedCacheRebuild, getPublishedCacheRebuildStatus, postPublishedCacheReload, getRedirectManagement, getRedirectManagementById, deleteRedirectManagementById, getRedirectManagementStatus, postRedirectManagementStatus, getItemRelationType, getRelationType, getRelationTypeById, getRelationByRelationTypeId, getItemScript, postScript, getScriptByPath, deleteScriptByPath, putScriptByPath, putScriptByPathRename, postScriptFolder, getScriptFolderByPath, deleteScriptFolderByPath, getTreeScriptAncestors, getTreeScriptChildren, getTreeScriptRoot, getTreeScriptSiblings, getSearcher, getSearcherBySearcherNameQuery, getSecurityConfiguration, postSecurityForgotPassword, postSecurityForgotPasswordReset, postSecurityForgotPasswordVerify, getSegment, getServerConfiguration, getServerInformation, getServerStatus, getServerTroubleshooting, getServerUpgradeCheck, getItemStaticFile, getTreeStaticFileAncestors, getTreeStaticFileChildren, getTreeStaticFileRoot, getItemStylesheet, postStylesheet, getStylesheetByPath, deleteStylesheetByPath, putStylesheetByPath, putStylesheetByPathRename, postStylesheetFolder, getStylesheetFolderByPath, deleteStylesheetFolderByPath, getTreeStylesheetAncestors, getTreeStylesheetChildren, getTreeStylesheetRoot, getTreeStylesheetSiblings, getTag, getTelemetry, getTelemetryLevel, postTelemetryLevel, getItemTemplate, getItemTemplateAncestors, getItemTemplateSearch, postTemplate, getTemplateById, deleteTemplateById, putTemplateById, getTemplateConfiguration, postTemplateQueryExecute, getTemplateQuerySettings, getTreeTemplateAncestors, getTreeTemplateChildren, getTreeTemplateRoot, getTreeTemplateSiblings, postUpgradeAuthorize, getUpgradeSettings, postUserData, getUserData, putUserData, getUserDataById, deleteUserDataById, getFilterUserGroup, getItemUserGroup, deleteUserGroup, postUserGroup, getUserGroup, getUserGroupById, deleteUserGroupById, putUserGroupById, deleteUserGroupByIdUsers, postUserGroupByIdUsers, getFilterUser, getItemUser, postUser, deleteUser, getUser, getUserById, deleteUserById, putUserById, getUserById2fa, deleteUserById2faByProviderName, getUserByIdCalculateStartNodes, postUserByIdChangePassword, postUserByIdClientCredentials, getUserByIdClientCredentials, deleteUserByIdClientCredentialsByClientId, postUserByIdResetPassword, deleteUserAvatarById, postUserAvatarById, getUserConfiguration, getUserCurrent, getUserCurrent2fa, deleteUserCurrent2faByProviderName, postUserCurrent2faByProviderName, getUserCurrent2faByProviderName, postUserCurrentAvatar, postUserCurrentChangePassword, getUserCurrentConfiguration, getUserCurrentLoginProviders, getUserCurrentPermissions, getUserCurrentPermissionsDocument, getUserCurrentPermissionsMedia, postUserDisable, postUserEnable, postUserInvite, postUserInviteCreatePassword, postUserInviteResend, postUserInviteVerify, postUserSetUserGroups, postUserUnlock, getItemWebhook, getWebhook, postWebhook, getWebhookById, deleteWebhookById, putWebhookById, getWebhookByIdLogs, getWebhookEvents, getWebhookLogs };
|
|
4564
|
+
return { getCulture, postDataType, getDataTypeById, deleteDataTypeById, putDataTypeById, postDataTypeByIdCopy, getDataTypeByIdIsUsed, putDataTypeByIdMove, getDataTypeByIdReferencedBy, getDataTypeByIdSchema, getDataTypeBatch, getDataTypeConfiguration, postDataTypeFolder, getDataTypeFolderById, deleteDataTypeFolderById, putDataTypeFolderById, getDataTypeSchemasBatch, getFilterDataType, getItemDataType, getItemDataTypeAncestors, getItemDataTypeSearch, getTreeDataTypeAncestors, getTreeDataTypeChildren, getTreeDataTypeRoot, getTreeDataTypeSearch, getTreeDataTypeSiblings, getDictionary, postDictionary, getDictionaryById, deleteDictionaryById, putDictionaryById, getDictionaryByIdExport, putDictionaryByIdMove, postDictionaryImport, getItemDictionary, getTreeDictionaryAncestors, getTreeDictionaryChildren, getTreeDictionaryRoot, postDocumentBlueprint, getDocumentBlueprintById, deleteDocumentBlueprintById, putDocumentBlueprintById, getDocumentBlueprintByIdAuditLog, putDocumentBlueprintByIdMove, getDocumentBlueprintByIdScaffold, postDocumentBlueprintFolder, getDocumentBlueprintFolderById, deleteDocumentBlueprintFolderById, putDocumentBlueprintFolderById, postDocumentBlueprintFromDocument, getItemDocumentBlueprint, getTreeDocumentBlueprintAncestors, getTreeDocumentBlueprintChildren, getTreeDocumentBlueprintRoot, getTreeDocumentBlueprintSiblings, postDocumentType, getDocumentTypeById, deleteDocumentTypeById, putDocumentTypeById, getDocumentTypeByIdAllowedChildren, getDocumentTypeByIdAllowedParents, getDocumentTypeByIdBlueprint, getDocumentTypeByIdCompositionReferences, postDocumentTypeByIdCopy, getDocumentTypeByIdExport, putDocumentTypeByIdImport, putDocumentTypeByIdMove, getDocumentTypeByIdSchema, postDocumentTypeByIdTemplate, getDocumentTypeAllowedAtRoot, postDocumentTypeAvailableCompositions, getDocumentTypeBatch, getDocumentTypeConfiguration, postDocumentTypeFolder, getDocumentTypeFolderById, deleteDocumentTypeFolderById, putDocumentTypeFolderById, postDocumentTypeImport, getItemDocumentType, getItemDocumentTypeAncestors, getItemDocumentTypeSearch, getTreeDocumentTypeAncestors, getTreeDocumentTypeChildren, getTreeDocumentTypeRoot, getTreeDocumentTypeSearch, getTreeDocumentTypeSiblings, getDocumentVersion, getDocumentVersionById, putDocumentVersionByIdPreventCleanup, postDocumentVersionByIdRollback, getCollectionDocumentById, postDocument, getDocumentById, deleteDocumentById, putDocumentById, getDocumentByIdAuditLog, getDocumentByIdAvailableSegmentOptions, postDocumentByIdCopy, getDocumentByIdDomains, putDocumentByIdDomains, putDocumentByIdMove, putDocumentByIdMoveToRecycleBin, getDocumentByIdNotifications, putDocumentByIdNotifications, patchDocumentByIdPatch, getDocumentByIdPreviewUrl, postDocumentByIdPublicAccess, deleteDocumentByIdPublicAccess, getDocumentByIdPublicAccess, putDocumentByIdPublicAccess, putDocumentByIdPublish, putDocumentByIdPublishWithDescendants, getDocumentByIdPublishWithDescendantsResultByTaskId, getDocumentByIdPublished, getDocumentByIdReferencedBy, getDocumentByIdReferencedDescendants, putDocumentByIdUnpublish, putUmbracoManagementApiV11DocumentByIdValidate11, getDocumentAreReferenced, getDocumentConfiguration, putDocumentSort, getDocumentUrls, postDocumentValidate, getItemDocument, getItemDocumentAncestors, getItemDocumentSearch, deleteRecycleBinDocument, deleteRecycleBinDocumentById, getRecycleBinDocumentByIdOriginalParent, putRecycleBinDocumentByIdRestore, getRecycleBinDocumentChildren, getRecycleBinDocumentReferencedBy, getRecycleBinDocumentRoot, getRecycleBinDocumentSiblings, getTreeDocumentAncestors, getTreeDocumentChildren, getTreeDocumentRoot, getTreeDocumentSiblings, postDynamicRootQuery, getDynamicRootSteps, getHealthCheckGroup, getHealthCheckGroupByName, postHealthCheckGroupByNameCheck, postHealthCheckExecuteAction, getHelp, getImagingResizeUrls, getImportAnalyze, getIndexer, getIndexerByIndexName, postIndexerByIndexNameRebuild, getInstallSettings, postInstallSetup, postInstallValidateDatabase, getItemLanguage, getItemLanguageDefault, getLanguage, postLanguage, getLanguageByIsoCode, deleteLanguageByIsoCode, putLanguageByIsoCode, getLogViewerLevel, getLogViewerLevelCount, getLogViewerLog, getLogViewerMessageTemplate, getLogViewerSavedSearch, postLogViewerSavedSearch, getLogViewerSavedSearchByName, deleteLogViewerSavedSearchByName, getLogViewerValidateLogsSize, getManifestManifest, getManifestManifestPrivate, getManifestManifestPublic, getItemMediaType, getItemMediaTypeAllowed, getItemMediaTypeAncestors, getItemMediaTypeFolders, getItemMediaTypeSearch, postMediaType, getMediaTypeById, deleteMediaTypeById, putMediaTypeById, getMediaTypeByIdAllowedChildren, getMediaTypeByIdAllowedParents, getMediaTypeByIdCompositionReferences, postMediaTypeByIdCopy, getMediaTypeByIdExport, putMediaTypeByIdImport, putMediaTypeByIdMove, getMediaTypeByIdSchema, getMediaTypeAllowedAtRoot, postMediaTypeAvailableCompositions, getMediaTypeBatch, getMediaTypeConfiguration, postMediaTypeFolder, getMediaTypeFolderById, deleteMediaTypeFolderById, putMediaTypeFolderById, postMediaTypeImport, getTreeMediaTypeAncestors, getTreeMediaTypeChildren, getTreeMediaTypeRoot, getTreeMediaTypeSiblings, getCollectionMedia, getItemMedia, getItemMediaAncestors, getItemMediaSearch, postMedia, getMediaById, deleteMediaById, putMediaById, getMediaByIdAuditLog, putMediaByIdMove, putMediaByIdMoveToRecycleBin, getMediaByIdReferencedBy, getMediaByIdReferencedDescendants, putMediaByIdValidate, getMediaAreReferenced, getMediaConfiguration, putMediaSort, getMediaUrls, postMediaValidate, deleteRecycleBinMedia, deleteRecycleBinMediaById, getRecycleBinMediaByIdOriginalParent, putRecycleBinMediaByIdRestore, getRecycleBinMediaChildren, getRecycleBinMediaReferencedBy, getRecycleBinMediaRoot, getRecycleBinMediaSiblings, getTreeMediaAncestors, getTreeMediaChildren, getTreeMediaRoot, getTreeMediaSiblings, getItemMemberGroup, getMemberGroup, postMemberGroup, getMemberGroupById, deleteMemberGroupById, putMemberGroupById, getTreeMemberGroupRoot, getItemMemberType, getItemMemberTypeAncestors, getItemMemberTypeSearch, postMemberType, getMemberTypeById, deleteMemberTypeById, putMemberTypeById, getMemberTypeByIdCompositionReferences, postMemberTypeByIdCopy, getMemberTypeByIdExport, putMemberTypeByIdImport, putMemberTypeByIdMove, getMemberTypeByIdSchema, getMemberTypeAllowedAtRoot, postMemberTypeAvailableCompositions, getMemberTypeBatch, getMemberTypeConfiguration, postMemberTypeFolder, getMemberTypeFolderById, deleteMemberTypeFolderById, putMemberTypeFolderById, postMemberTypeImport, getTreeMemberTypeAncestors, getTreeMemberTypeChildren, getTreeMemberTypeRoot, getTreeMemberTypeSiblings, getFilterMember, getItemMember, getItemMemberAncestors, getItemMemberSearch, postMember, getMemberById, deleteMemberById, putMemberById, getMemberByIdReferencedBy, getMemberByIdReferencedDescendants, putMemberByIdValidate, getMemberAreReferenced, getMemberConfiguration, postMemberValidate, postModelsBuilderBuild, getModelsBuilderDashboard, getModelsBuilderStatus, getNewsDashboard, getObjectTypes, getOembedQuery, postPackageByNameRunMigration, getPackageConfiguration, getPackageCreated, postPackageCreated, getPackageCreatedById, deletePackageCreatedById, putPackageCreatedById, getPackageCreatedByIdDownload, getPackageMigrationStatus, getItemPartialView, postPartialView, getPartialViewByPath, deletePartialViewByPath, putPartialViewByPath, putPartialViewByPathRename, postPartialViewFolder, getPartialViewFolderByPath, deletePartialViewFolderByPath, getPartialViewSnippet, getPartialViewSnippetById, getTreePartialViewAncestors, getTreePartialViewChildren, getTreePartialViewRoot, getTreePartialViewSiblings, deletePreview, postPreview, getProfilingStatus, putProfilingStatus, getPropertyTypeIsUsed, postPublishedCacheRebuild, getPublishedCacheRebuildStatus, postPublishedCacheReload, getRedirectManagement, getRedirectManagementById, deleteRedirectManagementById, getRedirectManagementStatus, postRedirectManagementStatus, getItemRelationType, getRelationType, getRelationTypeById, getRelationByRelationTypeId, getItemScript, postScript, getScriptByPath, deleteScriptByPath, putScriptByPath, putScriptByPathRename, postScriptFolder, getScriptFolderByPath, deleteScriptFolderByPath, getTreeScriptAncestors, getTreeScriptChildren, getTreeScriptRoot, getTreeScriptSiblings, getSearcher, getSearcherBySearcherNameQuery, getSecurityConfiguration, postSecurityForgotPassword, postSecurityForgotPasswordReset, postSecurityForgotPasswordVerify, getSegment, getServerConfiguration, getServerInformation, getServerStatus, getServerTroubleshooting, getServerUpgradeCheck, getItemStaticFile, getTreeStaticFileAncestors, getTreeStaticFileChildren, getTreeStaticFileRoot, getItemStylesheet, postStylesheet, getStylesheetByPath, deleteStylesheetByPath, putStylesheetByPath, putStylesheetByPathRename, postStylesheetFolder, getStylesheetFolderByPath, deleteStylesheetFolderByPath, getTreeStylesheetAncestors, getTreeStylesheetChildren, getTreeStylesheetRoot, getTreeStylesheetSiblings, getTag, getTelemetry, getTelemetryLevel, postTelemetryLevel, getItemTemplate, getItemTemplateAncestors, getItemTemplateSearch, postTemplate, getTemplateById, deleteTemplateById, putTemplateById, getTemplateConfiguration, postTemplateQueryExecute, getTemplateQuerySettings, getTreeTemplateAncestors, getTreeTemplateChildren, getTreeTemplateRoot, getTreeTemplateSiblings, postUpgradeAuthorize, getUpgradeSettings, postUserData, getUserData, putUserData, getUserDataById, deleteUserDataById, getFilterUserGroup, getItemUserGroup, deleteUserGroup, postUserGroup, getUserGroup, getUserGroupById, deleteUserGroupById, putUserGroupById, deleteUserGroupByIdUsers, postUserGroupByIdUsers, getFilterUser, getItemUser, postUser, deleteUser, getUser, getUserById, deleteUserById, putUserById, getUserById2fa, deleteUserById2faByProviderName, getUserByIdCalculateStartNodes, postUserByIdChangePassword, postUserByIdClientCredentials, getUserByIdClientCredentials, deleteUserByIdClientCredentialsByClientId, postUserByIdResetPassword, deleteUserAvatarById, postUserAvatarById, getUserConfiguration, getUserCurrent, getUserCurrent2fa, deleteUserCurrent2faByProviderName, postUserCurrent2faByProviderName, getUserCurrent2faByProviderName, deleteUserCurrentAvatar, postUserCurrentAvatar, postUserCurrentChangePassword, getUserCurrentConfiguration, getUserCurrentLoginProviders, getUserCurrentPermissions, getUserCurrentPermissionsDocument, getUserCurrentPermissionsMedia, putUserCurrentProfile, postUserDisable, postUserEnable, postUserInvite, postUserInviteCreatePassword, postUserInviteResend, postUserInviteVerify, postUserSetUserGroups, postUserUnlock, getItemWebhook, getWebhook, postWebhook, getWebhookById, deleteWebhookById, putWebhookById, getWebhookByIdLogs, getWebhookEvents, getWebhookLogs };
|
|
4545
4565
|
};
|
|
4546
4566
|
|
|
4547
4567
|
// src/umb-management-api/api/temporary-file/index.ts
|
|
@@ -10584,7 +10604,10 @@ var getServerConfigurationResponse = zod.object({
|
|
|
10584
10604
|
"allowPasswordReset": zod.boolean(),
|
|
10585
10605
|
"versionCheckPeriod": zod.number(),
|
|
10586
10606
|
"allowLocalLogin": zod.boolean(),
|
|
10587
|
-
"umbracoCssPath": zod.string()
|
|
10607
|
+
"umbracoCssPath": zod.string(),
|
|
10608
|
+
"signalR": zod.object({
|
|
10609
|
+
"skipNegotiation": zod.boolean()
|
|
10610
|
+
})
|
|
10588
10611
|
});
|
|
10589
10612
|
var getServerInformationResponse = zod.object({
|
|
10590
10613
|
"version": zod.string(),
|
|
@@ -11680,6 +11703,9 @@ var getUserCurrentPermissionsMediaResponse = zod.object({
|
|
|
11680
11703
|
"permissions": zod.array(zod.string())
|
|
11681
11704
|
}))
|
|
11682
11705
|
});
|
|
11706
|
+
var putUserCurrentProfileBody = zod.object({
|
|
11707
|
+
"languageIsoCode": zod.string()
|
|
11708
|
+
});
|
|
11683
11709
|
var postUserDisableBody = zod.object({
|
|
11684
11710
|
"userIds": zod.array(zod.object({
|
|
11685
11711
|
"id": zod.guid()
|
|
@@ -18711,7 +18737,7 @@ async function validateFilePath(filePath, allowedPaths) {
|
|
|
18711
18737
|
try {
|
|
18712
18738
|
const realAllowedPath = fs.realpathSync(allowedPath);
|
|
18713
18739
|
return normalizedPath.startsWith(realAllowedPath);
|
|
18714
|
-
} catch (
|
|
18740
|
+
} catch (e2) {
|
|
18715
18741
|
return false;
|
|
18716
18742
|
}
|
|
18717
18743
|
});
|
|
@@ -18729,7 +18755,7 @@ async function validateFilePath(filePath, allowedPaths) {
|
|
|
18729
18755
|
try {
|
|
18730
18756
|
const realAllowedPath = fs.realpathSync(allowedPath);
|
|
18731
18757
|
return realPath.startsWith(realAllowedPath);
|
|
18732
|
-
} catch (
|
|
18758
|
+
} catch (e3) {
|
|
18733
18759
|
return false;
|
|
18734
18760
|
}
|
|
18735
18761
|
});
|
|
@@ -18756,6 +18782,7 @@ async function validateFilePath(filePath, allowedPaths) {
|
|
|
18756
18782
|
|
|
18757
18783
|
|
|
18758
18784
|
|
|
18785
|
+
var BASE64_MAX_BYTES = 10 * 1024;
|
|
18759
18786
|
function getExtensionFromMimeType(mimeType) {
|
|
18760
18787
|
if (!mimeType) return void 0;
|
|
18761
18788
|
const baseMimeType = mimeType.split(";")[0].trim();
|
|
@@ -18877,6 +18904,13 @@ async function createFilePayload(sourceType, filePath, fileUrl, fileAsBase64, fi
|
|
|
18877
18904
|
if (!fileAsBase64) {
|
|
18878
18905
|
throw new Error("fileAsBase64 is required when sourceType is 'base64'");
|
|
18879
18906
|
}
|
|
18907
|
+
const padding = fileAsBase64.endsWith("==") ? 2 : fileAsBase64.endsWith("=") ? 1 : 0;
|
|
18908
|
+
const estimatedBytes = Math.floor(fileAsBase64.length * 3 / 4) - padding;
|
|
18909
|
+
if (estimatedBytes > BASE64_MAX_BYTES) {
|
|
18910
|
+
throw new Error(
|
|
18911
|
+
`base64 upload rejected: decoded payload is ~${estimatedBytes.toLocaleString()} bytes (limit is ${BASE64_MAX_BYTES.toLocaleString()} bytes). Use sourceType="url" with a public direct-download URL, or sourceType="file" if the file is attached to the chat.`
|
|
18912
|
+
);
|
|
18913
|
+
}
|
|
18880
18914
|
const buffer = Buffer.from(fileAsBase64, "base64");
|
|
18881
18915
|
let filename = fileName;
|
|
18882
18916
|
if (!fileName.includes(".")) {
|
|
@@ -18958,6 +18992,174 @@ function buildSourceTypeSection(allowFilePath, otherSources) {
|
|
|
18958
18992
|
return sources.map((s, i) => ` ${i + 1}. ${s}`).join("\n");
|
|
18959
18993
|
}
|
|
18960
18994
|
|
|
18995
|
+
// src/umb-management-api/tools/media/post/helpers/streaming-upload.ts
|
|
18996
|
+
|
|
18997
|
+
|
|
18998
|
+
var _mcphosted = require('@umbraco-cms/mcp-hosted');
|
|
18999
|
+
|
|
19000
|
+
|
|
19001
|
+
|
|
19002
|
+
|
|
19003
|
+
|
|
19004
|
+
|
|
19005
|
+
var authContext = null;
|
|
19006
|
+
function isStreamingAuthContextConfigured() {
|
|
19007
|
+
return authContext !== null;
|
|
19008
|
+
}
|
|
19009
|
+
async function resolveAuth() {
|
|
19010
|
+
if (!authContext) {
|
|
19011
|
+
throw new Error(
|
|
19012
|
+
"Streaming auth context not configured. setStreamingAuthContext() must be called in worker init()."
|
|
19013
|
+
);
|
|
19014
|
+
}
|
|
19015
|
+
const entry = await _mcphosted.getStoredUmbracoToken.call(void 0, authContext.env.OAUTH_KV, authContext.tokenKey);
|
|
19016
|
+
if (!_optionalChain([entry, 'optionalAccess', _48 => _48.tokens, 'optionalAccess', _49 => _49.access_token])) {
|
|
19017
|
+
throw new Error("No Umbraco access token in KV. Reconnect the MCP connector.");
|
|
19018
|
+
}
|
|
19019
|
+
const baseUrl = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([entry, 'access', _50 => _50.site, 'optionalAccess', _51 => _51.serverUrl]), () => ( _optionalChain([entry, 'access', _52 => _52.site, 'optionalAccess', _53 => _53.baseUrl]))), () => ( authContext.env.UMBRACO_SERVER_URL)), () => ( authContext.env.UMBRACO_BASE_URL));
|
|
19020
|
+
if (!baseUrl) {
|
|
19021
|
+
throw new Error("No Umbraco base URL resolvable from site or env.");
|
|
19022
|
+
}
|
|
19023
|
+
return { accessToken: entry.tokens.access_token, baseUrl: _mcpserversdk.normalizeBaseUrl.call(void 0, baseUrl) };
|
|
19024
|
+
}
|
|
19025
|
+
function ensureExtension(name, contentType, urlPath) {
|
|
19026
|
+
if (name.includes(".")) return name;
|
|
19027
|
+
const fromUrl = _optionalChain([urlPath, 'access', _54 => _54.match, 'call', _55 => _55(/\.([a-z0-9]{1,8})$/i), 'optionalAccess', _56 => _56[0]]);
|
|
19028
|
+
if (fromUrl) return `${name}${fromUrl}`;
|
|
19029
|
+
if (contentType) {
|
|
19030
|
+
const subtype = contentType.split(";")[0].split("/")[1];
|
|
19031
|
+
if (subtype && /^[a-z0-9]{1,8}$/i.test(subtype)) {
|
|
19032
|
+
return `${name}.${subtype === "jpeg" ? "jpg" : subtype}`;
|
|
19033
|
+
}
|
|
19034
|
+
}
|
|
19035
|
+
return `${name}.bin`;
|
|
19036
|
+
}
|
|
19037
|
+
async function streamingUploadFromUrl(params) {
|
|
19038
|
+
const client = UmbracoManagementClient3.getClient();
|
|
19039
|
+
const validatedMediaTypeName = validateMediaTypeForSvg(
|
|
19040
|
+
void 0,
|
|
19041
|
+
params.sourceUrl,
|
|
19042
|
+
params.name,
|
|
19043
|
+
params.mediaTypeName
|
|
19044
|
+
);
|
|
19045
|
+
const [mediaTypeId, auth] = await Promise.all([
|
|
19046
|
+
fetchMediaTypeId(client, validatedMediaTypeName),
|
|
19047
|
+
(async () => {
|
|
19048
|
+
await client.getTemporaryFileConfiguration().catch(() => void 0);
|
|
19049
|
+
return resolveAuth();
|
|
19050
|
+
})()
|
|
19051
|
+
]);
|
|
19052
|
+
const { accessToken, baseUrl } = auth;
|
|
19053
|
+
const ctl = new AbortController();
|
|
19054
|
+
const overallTimeout = setTimeout(() => ctl.abort(), 6e4);
|
|
19055
|
+
try {
|
|
19056
|
+
const sourceResp = await fetch(params.sourceUrl, { signal: ctl.signal });
|
|
19057
|
+
if (!sourceResp.ok || !sourceResp.body) {
|
|
19058
|
+
throw new Error(
|
|
19059
|
+
`Failed to fetch source URL: HTTP ${sourceResp.status} ${sourceResp.statusText}`
|
|
19060
|
+
);
|
|
19061
|
+
}
|
|
19062
|
+
const sourceContentType = _nullishCoalesce(sourceResp.headers.get("content-type"), () => ( "application/octet-stream"));
|
|
19063
|
+
const sourceUrl = new URL(params.sourceUrl);
|
|
19064
|
+
const filename = ensureExtension(params.name, sourceContentType, sourceUrl.pathname);
|
|
19065
|
+
const temporaryFileId = crypto.randomUUID();
|
|
19066
|
+
const boundary = `----mcp-stream-${crypto.randomUUID()}`;
|
|
19067
|
+
const encoder = new TextEncoder();
|
|
19068
|
+
const prefix = encoder.encode(
|
|
19069
|
+
`--${boundary}\r
|
|
19070
|
+
Content-Disposition: form-data; name="Id"\r
|
|
19071
|
+
\r
|
|
19072
|
+
${temporaryFileId}\r
|
|
19073
|
+
--${boundary}\r
|
|
19074
|
+
Content-Disposition: form-data; name="File"; filename="${filename}"\r
|
|
19075
|
+
Content-Type: ${sourceContentType}\r
|
|
19076
|
+
\r
|
|
19077
|
+
`
|
|
19078
|
+
);
|
|
19079
|
+
const suffix = encoder.encode(`\r
|
|
19080
|
+
--${boundary}--\r
|
|
19081
|
+
`);
|
|
19082
|
+
const sourceBody = sourceResp.body;
|
|
19083
|
+
const multipartBody = new ReadableStream({
|
|
19084
|
+
async start(controller) {
|
|
19085
|
+
const reader = sourceBody.getReader();
|
|
19086
|
+
try {
|
|
19087
|
+
controller.enqueue(prefix);
|
|
19088
|
+
while (true) {
|
|
19089
|
+
const { done, value } = await reader.read();
|
|
19090
|
+
if (done) break;
|
|
19091
|
+
if (value) controller.enqueue(value);
|
|
19092
|
+
}
|
|
19093
|
+
controller.enqueue(suffix);
|
|
19094
|
+
controller.close();
|
|
19095
|
+
} catch (e) {
|
|
19096
|
+
controller.error(e);
|
|
19097
|
+
} finally {
|
|
19098
|
+
reader.releaseLock();
|
|
19099
|
+
}
|
|
19100
|
+
},
|
|
19101
|
+
cancel(reason) {
|
|
19102
|
+
sourceBody.cancel(reason).catch(() => void 0);
|
|
19103
|
+
}
|
|
19104
|
+
});
|
|
19105
|
+
const tempResp = await fetch(`${baseUrl}/umbraco/management/api/v1/temporary-file`, {
|
|
19106
|
+
method: "POST",
|
|
19107
|
+
body: multipartBody,
|
|
19108
|
+
// @ts-expect-error — `duplex` is required by Workers/undici for streaming bodies
|
|
19109
|
+
duplex: "half",
|
|
19110
|
+
signal: ctl.signal,
|
|
19111
|
+
headers: {
|
|
19112
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`,
|
|
19113
|
+
Authorization: `Bearer ${accessToken}`,
|
|
19114
|
+
Accept: "application/json"
|
|
19115
|
+
}
|
|
19116
|
+
});
|
|
19117
|
+
if (!tempResp.ok) {
|
|
19118
|
+
const errBody = await tempResp.text().catch(() => "");
|
|
19119
|
+
throw new Error(
|
|
19120
|
+
`Umbraco temporary-file POST failed: HTTP ${tempResp.status} ${tempResp.statusText} - ${errBody}`
|
|
19121
|
+
);
|
|
19122
|
+
}
|
|
19123
|
+
const valueStructure = buildValueStructure(validatedMediaTypeName, temporaryFileId);
|
|
19124
|
+
const response = await client.postMedia(
|
|
19125
|
+
{
|
|
19126
|
+
mediaType: { id: mediaTypeId },
|
|
19127
|
+
variants: [{ culture: null, segment: null, name: params.name }],
|
|
19128
|
+
values: [valueStructure],
|
|
19129
|
+
parent: params.parentId ? { id: params.parentId } : null
|
|
19130
|
+
},
|
|
19131
|
+
_mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE
|
|
19132
|
+
);
|
|
19133
|
+
if (response.status < 200 || response.status >= 300) {
|
|
19134
|
+
throw new Error(`postMedia failed with status ${response.status}`);
|
|
19135
|
+
}
|
|
19136
|
+
const locationHeader = _nullishCoalesce(_optionalChain([response, 'access', _57 => _57.headers, 'optionalAccess', _58 => _58.location]), () => ( _optionalChain([response, 'access', _59 => _59.headers, 'optionalAccess', _60 => _60.Location])));
|
|
19137
|
+
const idMatch = _optionalChain([locationHeader, 'optionalAccess', _61 => _61.match, 'call', _62 => _62(/\/([a-f0-9-]{36})$/i)]);
|
|
19138
|
+
if (!idMatch) {
|
|
19139
|
+
throw new Error(
|
|
19140
|
+
`Could not extract media id from Location header: ${_nullishCoalesce(locationHeader, () => ( "(missing)"))}`
|
|
19141
|
+
);
|
|
19142
|
+
}
|
|
19143
|
+
return { name: params.name, id: idMatch[1] };
|
|
19144
|
+
} finally {
|
|
19145
|
+
clearTimeout(overallTimeout);
|
|
19146
|
+
}
|
|
19147
|
+
}
|
|
19148
|
+
async function streamingUploadToToolResult(params) {
|
|
19149
|
+
try {
|
|
19150
|
+
const { name, id } = await streamingUploadFromUrl(params);
|
|
19151
|
+
return _mcpserversdk.createToolResult.call(void 0, {
|
|
19152
|
+
message: `Media "${name}" created successfully`,
|
|
19153
|
+
name,
|
|
19154
|
+
id
|
|
19155
|
+
});
|
|
19156
|
+
} catch (error) {
|
|
19157
|
+
return _mcpserversdk.createToolResultError.call(void 0, {
|
|
19158
|
+
detail: `Error creating media: ${error.message}`
|
|
19159
|
+
});
|
|
19160
|
+
}
|
|
19161
|
+
}
|
|
19162
|
+
|
|
18961
19163
|
// src/umb-management-api/tools/media/post/create-media.ts
|
|
18962
19164
|
|
|
18963
19165
|
|
|
@@ -18970,31 +19172,48 @@ function buildSourceTypeSection(allowFilePath, otherSources) {
|
|
|
18970
19172
|
|
|
18971
19173
|
|
|
18972
19174
|
|
|
19175
|
+
var fileObjectSchema = _zod.z.object({
|
|
19176
|
+
download_url: _zod.z.string().describe("Temporary URL the host provides to fetch the file bytes"),
|
|
19177
|
+
file_id: _zod.z.string().describe("Persistent file identifier from the host"),
|
|
19178
|
+
mime_type: _zod.z.string().optional().describe("MIME type if the host knows it"),
|
|
19179
|
+
file_name: _zod.z.string().optional().describe("Original file name if the host knows it")
|
|
19180
|
+
});
|
|
18973
19181
|
var createMediaOutputSchema = _zod.z.object({
|
|
18974
19182
|
message: _zod.z.string(),
|
|
18975
19183
|
name: _zod.z.string(),
|
|
18976
19184
|
id: _zod.z.string().guid()
|
|
18977
19185
|
});
|
|
18978
19186
|
function createCreateMediaTool(options) {
|
|
18979
|
-
const sourceTypeValues = options.allowFilePath ? ["filePath", "url", "base64"] : ["url", "base64"];
|
|
18980
|
-
const
|
|
19187
|
+
const sourceTypeValues = options.allowFilePath ? ["filePath", "url", "file", "base64"] : ["url", "file", "base64"];
|
|
19188
|
+
const base64Kib = BASE64_MAX_BYTES / 1024;
|
|
19189
|
+
const filePathPrefix = options.allowFilePath ? "'filePath' for local files (Node stdio only), " : "";
|
|
19190
|
+
const sourceTypeDescription = `Media source type: ${filePathPrefix}'url' for public direct-download URLs (streamed; preferred for everything not already attached to the chat), 'file' for host-injected attachments \u2014 the connector populates the 'file' object automatically when the user attached a file or you generated one in this chat, 'base64' for TINY inline payloads only \u2014 the server rejects base64 above ${base64Kib} KiB decoded to stop LLM-truncated or thumbnail-preview base64 from persisting as corrupt files`;
|
|
18981
19191
|
const schema = _zod.z.object({
|
|
18982
19192
|
sourceType: _zod.z.enum(sourceTypeValues).describe(sourceTypeDescription),
|
|
18983
19193
|
name: _zod.z.string().describe("The name of the media item"),
|
|
18984
19194
|
mediaTypeName: _zod.z.string().describe(`Media type: '${_mcpserversdk.MEDIA_TYPE_IMAGE}', '${_mcpserversdk.MEDIA_TYPE_ARTICLE}', '${_mcpserversdk.MEDIA_TYPE_AUDIO}', '${_mcpserversdk.MEDIA_TYPE_VIDEO}', '${_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS}', '${_mcpserversdk.MEDIA_TYPE_FILE}', or custom media type name`),
|
|
18985
19195
|
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
18986
|
-
fileUrl: _zod.z.string().url().optional().describe("[raw] URL to fetch the file from (required if sourceType is 'url')"),
|
|
18987
|
-
|
|
19196
|
+
fileUrl: _zod.z.string().url().optional().describe("[raw] Public, direct-download URL to fetch the file from (required if sourceType is 'url'). Must be reachable without authentication. Share/viewer links (e.g. drive.google.com/file/d/<id>/view, Dropbox ?dl=0, OneDrive view URLs) must be converted to their direct-download equivalent first \u2014 Google Drive: drive.google.com/uc?export=download&id=<id>. Uploads are streamed, so multi-MB files round-trip without timing out."),
|
|
19197
|
+
file: fileObjectSchema.optional().describe(
|
|
19198
|
+
"[raw] Host-injected file object (required if sourceType is 'file'). ChatGPT's connector populates this automatically when the user attached a file or you generated one in this chat \u2014 leave it for the host to fill, do not synthesise it yourself."
|
|
19199
|
+
),
|
|
19200
|
+
fileAsBase64: _zod.z.string().optional().describe(`Base64-encoded file data (required if sourceType is 'base64'). HARD LIMIT: decoded payload must be \u2264${base64Kib} KiB; the server rejects anything larger because LLMs reliably truncate big base64 strings or substitute thumbnail previews, both producing corrupt files. Use sourceType='url' or 'file' for everything bigger.`),
|
|
18988
19201
|
parentId: _zod.z.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
18989
19202
|
});
|
|
18990
19203
|
const filePathSection = buildSourceTypeSection(options.allowFilePath, [
|
|
18991
|
-
|
|
18992
|
-
|
|
19204
|
+
`url - Stream from any public direct-download URL (Drive / Dropbox / etc.). Use this for anything above ${base64Kib} KiB that isn't already attached to the chat.`,
|
|
19205
|
+
`file - Stream a host-attached file. The connector injects { download_url, file_id, mime_type, file_name } on the 'file' field automatically when the user attached a file or you generated one in this chat \u2014 prefer this over url for chat-bound files.`,
|
|
19206
|
+
`base64 - ONLY for tiny inline payloads; server hard-rejects decoded base64 over ${base64Kib} KiB to prevent LLM-truncated corrupt files.`
|
|
18993
19207
|
]);
|
|
18994
19208
|
const tool = {
|
|
18995
19209
|
name: "create-media",
|
|
18996
19210
|
description: `Upload any media file to Umbraco (images, documents, audio, video, SVG, or custom types).
|
|
18997
19211
|
|
|
19212
|
+
Pick the sourceType that matches where the file lives:
|
|
19213
|
+
- If the file is attached to this chat or you just generated it \u2192 sourceType="file" (the host fills in the file reference automatically).
|
|
19214
|
+
- If you have a public direct-download URL \u2192 sourceType="url".
|
|
19215
|
+
- For tiny inline payloads (\u2264${base64Kib} KiB decoded) \u2192 sourceType="base64".
|
|
19216
|
+
|
|
18998
19217
|
Media Types:
|
|
18999
19218
|
- ${_mcpserversdk.MEDIA_TYPE_IMAGE}: jpg, png, gif, webp, etc. (supports cropping)
|
|
19000
19219
|
- ${_mcpserversdk.MEDIA_TYPE_ARTICLE}: pdf, docx, doc (documents)
|
|
@@ -19015,16 +19234,43 @@ ${filePathSection}
|
|
|
19015
19234
|
inputSchema: schema.shape,
|
|
19016
19235
|
outputSchema: createMediaOutputSchema.shape,
|
|
19017
19236
|
slices: ["create"],
|
|
19237
|
+
_meta: { "openai/fileParams": ["file"] },
|
|
19018
19238
|
handler: (async (model) => {
|
|
19239
|
+
let effectiveSourceType;
|
|
19240
|
+
let effectiveFileUrl = model.fileUrl;
|
|
19241
|
+
if (model.sourceType === "file") {
|
|
19242
|
+
if (!_optionalChain([model, 'access', _63 => _63.file, 'optionalAccess', _64 => _64.download_url])) {
|
|
19243
|
+
return _mcpserversdk.createToolResultError.call(void 0, {
|
|
19244
|
+
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."
|
|
19245
|
+
});
|
|
19246
|
+
}
|
|
19247
|
+
effectiveSourceType = "url";
|
|
19248
|
+
effectiveFileUrl = model.file.download_url;
|
|
19249
|
+
} else {
|
|
19250
|
+
effectiveSourceType = model.sourceType;
|
|
19251
|
+
}
|
|
19252
|
+
if (effectiveSourceType === "url" && isStreamingAuthContextConfigured()) {
|
|
19253
|
+
if (!effectiveFileUrl) {
|
|
19254
|
+
return _mcpserversdk.createToolResultError.call(void 0, {
|
|
19255
|
+
detail: "Error creating media: fileUrl is required when sourceType is 'url'"
|
|
19256
|
+
});
|
|
19257
|
+
}
|
|
19258
|
+
return streamingUploadToToolResult({
|
|
19259
|
+
sourceUrl: effectiveFileUrl,
|
|
19260
|
+
name: model.name,
|
|
19261
|
+
mediaTypeName: model.mediaTypeName,
|
|
19262
|
+
parentId: model.parentId
|
|
19263
|
+
});
|
|
19264
|
+
}
|
|
19019
19265
|
try {
|
|
19020
19266
|
const client = UmbracoManagementClient3.getClient();
|
|
19021
19267
|
const temporaryFileId = _uuid.v4.call(void 0, );
|
|
19022
19268
|
const { name: actualName, id } = await uploadMediaFile(client, {
|
|
19023
|
-
sourceType:
|
|
19269
|
+
sourceType: effectiveSourceType,
|
|
19024
19270
|
name: model.name,
|
|
19025
19271
|
mediaTypeName: model.mediaTypeName,
|
|
19026
19272
|
filePath: model.filePath,
|
|
19027
|
-
fileUrl:
|
|
19273
|
+
fileUrl: effectiveFileUrl,
|
|
19028
19274
|
fileAsBase64: model.fileAsBase64,
|
|
19029
19275
|
parentId: model.parentId,
|
|
19030
19276
|
temporaryFileId
|
|
@@ -19068,73 +19314,125 @@ var createMediaMultipleOutputSchema = _zod.z.object({
|
|
|
19068
19314
|
error: _zod.z.string().optional()
|
|
19069
19315
|
}))
|
|
19070
19316
|
});
|
|
19317
|
+
var fileObjectSchema2 = _zod.z.object({
|
|
19318
|
+
download_url: _zod.z.string().describe("Temporary URL the host provides to fetch the file bytes"),
|
|
19319
|
+
file_id: _zod.z.string().describe("Persistent file identifier from the host"),
|
|
19320
|
+
mime_type: _zod.z.string().optional().describe("MIME type if the host knows it"),
|
|
19321
|
+
file_name: _zod.z.string().optional().describe("Original file name if the host knows it")
|
|
19322
|
+
});
|
|
19323
|
+
var UPLOAD_CONCURRENCY = 4;
|
|
19324
|
+
var MAX_BATCH_SIZE = 20;
|
|
19325
|
+
async function mapWithConcurrency(items, concurrency, producer) {
|
|
19326
|
+
const results = new Array(items.length);
|
|
19327
|
+
let nextIndex = 0;
|
|
19328
|
+
async function worker() {
|
|
19329
|
+
while (true) {
|
|
19330
|
+
const current = nextIndex++;
|
|
19331
|
+
if (current >= items.length) return;
|
|
19332
|
+
results[current] = await producer(items[current], current);
|
|
19333
|
+
}
|
|
19334
|
+
}
|
|
19335
|
+
const workers = Array.from({ length: Math.min(concurrency, items.length) }, () => worker());
|
|
19336
|
+
await Promise.all(workers);
|
|
19337
|
+
return results;
|
|
19338
|
+
}
|
|
19071
19339
|
function createCreateMediaMultipleTool(options) {
|
|
19072
|
-
const sourceTypeValues = options.allowFilePath ? ["filePath", "url"] : ["url"];
|
|
19073
|
-
const
|
|
19340
|
+
const sourceTypeValues = options.allowFilePath ? ["filePath", "url", "file"] : ["url", "file"];
|
|
19341
|
+
const filePathPrefix = options.allowFilePath ? "'filePath' for local files (most efficient, Node stdio only), " : "";
|
|
19342
|
+
const sourceTypeDescription = `Media source type: ${filePathPrefix}'url' for public direct-download URLs (streamed), 'file' for host-injected attachments \u2014 the connector populates each entry's 'file' object automatically when the user attached or generated files in this chat. Base64 is not supported for batch uploads due to token usage \u2014 use single-file create-media for tiny inline payloads.`;
|
|
19074
19343
|
const schema = _zod.z.object({
|
|
19075
19344
|
sourceType: _zod.z.enum(sourceTypeValues).describe(sourceTypeDescription),
|
|
19076
19345
|
files: _zod.z.array(_zod.z.object({
|
|
19077
19346
|
name: _zod.z.string().describe("The name of the media item"),
|
|
19078
19347
|
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
19079
|
-
fileUrl: _zod.z.string().url().optional().describe("
|
|
19348
|
+
fileUrl: _zod.z.string().url().optional().describe("[raw] Public direct-download URL (required if sourceType is 'url'). Drive / Dropbox share links must be converted to their direct-download equivalent first \u2014 see the create-media tool description for the format. Streamed, so multi-MB files round-trip without timing out."),
|
|
19349
|
+
file: fileObjectSchema2.optional().describe("[raw] Host-injected file reference (required if sourceType is 'file'). ChatGPT's connector populates this per entry automatically when files are attached."),
|
|
19080
19350
|
mediaTypeName: _zod.z.string().optional().describe(`Optional override: '${_mcpserversdk.MEDIA_TYPE_IMAGE}', '${_mcpserversdk.MEDIA_TYPE_ARTICLE}', '${_mcpserversdk.MEDIA_TYPE_AUDIO}', '${_mcpserversdk.MEDIA_TYPE_VIDEO}', '${_mcpserversdk.MEDIA_TYPE_VECTOR_GRAPHICS}', '${_mcpserversdk.MEDIA_TYPE_FILE}', or custom media type name. If not specified, defaults to '${_mcpserversdk.MEDIA_TYPE_FILE}'`)
|
|
19081
|
-
})).describe(
|
|
19351
|
+
})).max(MAX_BATCH_SIZE).describe(`Array of files to upload (maximum ${MAX_BATCH_SIZE} files per batch)`),
|
|
19082
19352
|
parentId: _zod.z.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
19083
19353
|
});
|
|
19084
19354
|
const filePathSection = buildSourceTypeSection(options.allowFilePath, [
|
|
19085
|
-
"url -
|
|
19355
|
+
"url - Stream from any public direct-download URL (Drive / Dropbox / etc.).",
|
|
19356
|
+
"file - Stream a host-attached file. The connector injects { download_url, file_id, ... } per entry automatically when the user attached or generated files in this chat \u2014 prefer this over 'url' for chat-bound files."
|
|
19086
19357
|
]);
|
|
19087
19358
|
const tool = {
|
|
19088
19359
|
name: "create-media-multiple",
|
|
19089
|
-
description: `Batch upload multiple media files to Umbraco (maximum
|
|
19360
|
+
description: `Batch upload multiple media files to Umbraco (maximum ${MAX_BATCH_SIZE} files per batch).
|
|
19090
19361
|
|
|
19091
|
-
|
|
19362
|
+
Use this \u2014 not several separate create-media calls \u2014 when the user attached or generated multiple files in this chat (sourceType="file"), or has a list of public URLs to upload (sourceType="url"). ChatGPT's connector populates each entry's 'file' field automatically.
|
|
19092
19363
|
|
|
19093
19364
|
Source Types:
|
|
19094
19365
|
${filePathSection}
|
|
19095
19366
|
|
|
19096
19367
|
Note: base64 is not supported for batch uploads due to token usage.
|
|
19097
19368
|
|
|
19098
|
-
The tool processes
|
|
19099
|
-
If some files fail, others will continue processing (continue-on-error strategy).`,
|
|
19369
|
+
The tool processes up to ${UPLOAD_CONCURRENCY} uploads in parallel and returns detailed results for each file in input order. If some files fail, others continue processing (continue-on-error strategy).`,
|
|
19100
19370
|
inputSchema: schema.shape,
|
|
19101
19371
|
outputSchema: createMediaMultipleOutputSchema.shape,
|
|
19102
19372
|
slices: ["create"],
|
|
19373
|
+
_meta: { "openai/fileParams": ["files"] },
|
|
19103
19374
|
handler: (async (model) => {
|
|
19104
|
-
if (model.files.length >
|
|
19375
|
+
if (model.files.length > MAX_BATCH_SIZE) {
|
|
19105
19376
|
return _mcpserversdk.createToolResultError.call(void 0, {
|
|
19106
|
-
detail: `Batch upload limited to
|
|
19377
|
+
detail: `Batch upload limited to ${MAX_BATCH_SIZE} files per call. You provided ${model.files.length} files. Please split into multiple batches.`
|
|
19107
19378
|
});
|
|
19108
19379
|
}
|
|
19109
|
-
const results = [];
|
|
19110
19380
|
const client = UmbracoManagementClient3.getClient();
|
|
19111
|
-
|
|
19112
|
-
|
|
19113
|
-
|
|
19114
|
-
|
|
19115
|
-
|
|
19116
|
-
|
|
19117
|
-
|
|
19118
|
-
|
|
19119
|
-
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19123
|
-
|
|
19124
|
-
|
|
19125
|
-
|
|
19126
|
-
|
|
19127
|
-
|
|
19128
|
-
|
|
19129
|
-
|
|
19130
|
-
|
|
19131
|
-
|
|
19132
|
-
|
|
19133
|
-
|
|
19134
|
-
|
|
19135
|
-
|
|
19381
|
+
const streamingAvailable = isStreamingAuthContextConfigured();
|
|
19382
|
+
const results = await mapWithConcurrency(
|
|
19383
|
+
model.files,
|
|
19384
|
+
UPLOAD_CONCURRENCY,
|
|
19385
|
+
async (file) => {
|
|
19386
|
+
try {
|
|
19387
|
+
const mediaTypeName = file.mediaTypeName || _mcpserversdk.MEDIA_TYPE_FILE;
|
|
19388
|
+
let effectiveSourceType;
|
|
19389
|
+
let effectiveFileUrl = file.fileUrl;
|
|
19390
|
+
if (model.sourceType === "file") {
|
|
19391
|
+
if (!_optionalChain([file, 'access', _65 => _65.file, 'optionalAccess', _66 => _66.download_url])) {
|
|
19392
|
+
return {
|
|
19393
|
+
success: false,
|
|
19394
|
+
name: file.name,
|
|
19395
|
+
error: "sourceType is 'file' but no file object was provided for this entry. The host connector should inject this automatically when a file is attached."
|
|
19396
|
+
};
|
|
19397
|
+
}
|
|
19398
|
+
effectiveSourceType = "url";
|
|
19399
|
+
effectiveFileUrl = file.file.download_url;
|
|
19400
|
+
} else {
|
|
19401
|
+
effectiveSourceType = model.sourceType;
|
|
19402
|
+
}
|
|
19403
|
+
if (effectiveSourceType === "url" && streamingAvailable) {
|
|
19404
|
+
if (!effectiveFileUrl) {
|
|
19405
|
+
return {
|
|
19406
|
+
success: false,
|
|
19407
|
+
name: file.name,
|
|
19408
|
+
error: "fileUrl is required when sourceType is 'url'."
|
|
19409
|
+
};
|
|
19410
|
+
}
|
|
19411
|
+
const { name: actualName2, id: mediaId2 } = await streamingUploadFromUrl({
|
|
19412
|
+
sourceUrl: effectiveFileUrl,
|
|
19413
|
+
name: file.name,
|
|
19414
|
+
mediaTypeName,
|
|
19415
|
+
parentId: model.parentId
|
|
19416
|
+
});
|
|
19417
|
+
return { success: true, name: actualName2, id: mediaId2 };
|
|
19418
|
+
}
|
|
19419
|
+
const temporaryFileId = _uuid.v4.call(void 0, );
|
|
19420
|
+
const { name: actualName, id: mediaId } = await uploadMediaFile(client, {
|
|
19421
|
+
sourceType: effectiveSourceType,
|
|
19422
|
+
name: file.name,
|
|
19423
|
+
mediaTypeName,
|
|
19424
|
+
filePath: file.filePath,
|
|
19425
|
+
fileUrl: effectiveFileUrl,
|
|
19426
|
+
fileAsBase64: void 0,
|
|
19427
|
+
parentId: model.parentId,
|
|
19428
|
+
temporaryFileId
|
|
19429
|
+
});
|
|
19430
|
+
return { success: true, name: actualName, id: mediaId };
|
|
19431
|
+
} catch (error) {
|
|
19432
|
+
return { success: false, name: file.name, error: error.message };
|
|
19433
|
+
}
|
|
19136
19434
|
}
|
|
19137
|
-
|
|
19435
|
+
);
|
|
19138
19436
|
const successCount = results.filter((r) => r.success).length;
|
|
19139
19437
|
const failureCount = results.filter((r) => !r.success).length;
|
|
19140
19438
|
return _mcpserversdk.createToolResult.call(void 0, {
|
|
@@ -19189,7 +19487,7 @@ var CreateMediaFolderTool = {
|
|
|
19189
19487
|
if (response.status < 200 || response.status >= 300) {
|
|
19190
19488
|
throw new Error(`Request failed with status code ${response.status}`);
|
|
19191
19489
|
}
|
|
19192
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
19490
|
+
const locationHeader = _optionalChain([response, 'access', _67 => _67.headers, 'optionalAccess', _68 => _68.location]) || _optionalChain([response, 'access', _69 => _69.headers, 'optionalAccess', _70 => _70.Location]);
|
|
19193
19491
|
if (!locationHeader) {
|
|
19194
19492
|
throw new Error("No Location header in response - cannot determine created folder ID");
|
|
19195
19493
|
}
|
|
@@ -20426,7 +20724,7 @@ var CreateMediaTypeFolderTool = {
|
|
|
20426
20724
|
validateStatus: () => true
|
|
20427
20725
|
});
|
|
20428
20726
|
if (response.status === 201) {
|
|
20429
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
20727
|
+
const locationHeader = _optionalChain([response, 'access', _71 => _71.headers, 'optionalAccess', _72 => _72["location"]]) || _optionalChain([response, 'access', _73 => _73.headers, 'optionalAccess', _74 => _74["Location"]]);
|
|
20430
20728
|
let createdId = model.id || "";
|
|
20431
20729
|
if (locationHeader) {
|
|
20432
20730
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -20560,7 +20858,7 @@ var CreateMediaTypeTool = {
|
|
|
20560
20858
|
validateStatus: () => true
|
|
20561
20859
|
});
|
|
20562
20860
|
if (response.status === 201) {
|
|
20563
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
20861
|
+
const locationHeader = _optionalChain([response, 'access', _75 => _75.headers, 'optionalAccess', _76 => _76["location"]]) || _optionalChain([response, 'access', _77 => _77.headers, 'optionalAccess', _78 => _78["Location"]]);
|
|
20564
20862
|
let createdId = model.id || "";
|
|
20565
20863
|
if (locationHeader) {
|
|
20566
20864
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -20611,7 +20909,7 @@ var CopyMediaTypeTool = {
|
|
|
20611
20909
|
validateStatus: () => true
|
|
20612
20910
|
});
|
|
20613
20911
|
if (response.status === 201) {
|
|
20614
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
20912
|
+
const locationHeader = _optionalChain([response, 'access', _79 => _79.headers, 'optionalAccess', _80 => _80["location"]]) || _optionalChain([response, 'access', _81 => _81.headers, 'optionalAccess', _82 => _82["Location"]]);
|
|
20615
20913
|
let createdId = "";
|
|
20616
20914
|
if (locationHeader) {
|
|
20617
20915
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -20821,7 +21119,7 @@ var CreateMemberTool = {
|
|
|
20821
21119
|
validateStatus: () => true
|
|
20822
21120
|
});
|
|
20823
21121
|
if (response.status === 201) {
|
|
20824
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
21122
|
+
const locationHeader = _optionalChain([response, 'access', _83 => _83.headers, 'optionalAccess', _84 => _84["location"]]) || _optionalChain([response, 'access', _85 => _85.headers, 'optionalAccess', _86 => _86["Location"]]);
|
|
20825
21123
|
let createdId = model.id || "";
|
|
20826
21124
|
if (locationHeader) {
|
|
20827
21125
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -21372,7 +21670,7 @@ var CreateMemberTypeTool = {
|
|
|
21372
21670
|
validateStatus: () => true
|
|
21373
21671
|
});
|
|
21374
21672
|
if (response.status === 201) {
|
|
21375
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
21673
|
+
const locationHeader = _optionalChain([response, 'access', _87 => _87.headers, 'optionalAccess', _88 => _88["location"]]) || _optionalChain([response, 'access', _89 => _89.headers, 'optionalAccess', _90 => _90["Location"]]);
|
|
21376
21674
|
let createdId = model.id || "";
|
|
21377
21675
|
if (locationHeader) {
|
|
21378
21676
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -21542,7 +21840,7 @@ var CopyMemberTypeTool = {
|
|
|
21542
21840
|
validateStatus: () => true
|
|
21543
21841
|
});
|
|
21544
21842
|
if (response.status === 201) {
|
|
21545
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
21843
|
+
const locationHeader = _optionalChain([response, 'access', _91 => _91.headers, 'optionalAccess', _92 => _92["location"]]) || _optionalChain([response, 'access', _93 => _93.headers, 'optionalAccess', _94 => _94["Location"]]);
|
|
21546
21844
|
let createdId = "";
|
|
21547
21845
|
if (locationHeader) {
|
|
21548
21846
|
const idMatch = locationHeader.match(/([0-9a-f-]{36})$/i);
|
|
@@ -21902,7 +22200,7 @@ var CreatePartialViewTool = {
|
|
|
21902
22200
|
validateStatus: () => true
|
|
21903
22201
|
});
|
|
21904
22202
|
if (response.status === 201) {
|
|
21905
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
22203
|
+
const locationHeader = _optionalChain([response, 'access', _95 => _95.headers, 'optionalAccess', _96 => _96["location"]]) || _optionalChain([response, 'access', _97 => _97.headers, 'optionalAccess', _98 => _98["Location"]]);
|
|
21906
22204
|
let createdPath = "";
|
|
21907
22205
|
if (locationHeader) {
|
|
21908
22206
|
const pathMatch = locationHeader.match(/partial-view\/(.+)$/);
|
|
@@ -21949,7 +22247,7 @@ var CreatePartialViewFolderTool = {
|
|
|
21949
22247
|
validateStatus: () => true
|
|
21950
22248
|
});
|
|
21951
22249
|
if (response.status === 201) {
|
|
21952
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
22250
|
+
const locationHeader = _optionalChain([response, 'access', _99 => _99.headers, 'optionalAccess', _100 => _100["location"]]) || _optionalChain([response, 'access', _101 => _101.headers, 'optionalAccess', _102 => _102["Location"]]);
|
|
21953
22251
|
let createdPath = "";
|
|
21954
22252
|
if (locationHeader) {
|
|
21955
22253
|
const pathMatch = locationHeader.match(/partial-view\/folder\/(.+)$/);
|
|
@@ -22771,7 +23069,7 @@ var CreateScriptTool = {
|
|
|
22771
23069
|
validateStatus: () => true
|
|
22772
23070
|
});
|
|
22773
23071
|
if (response.status === 201) {
|
|
22774
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
23072
|
+
const locationHeader = _optionalChain([response, 'access', _103 => _103.headers, 'optionalAccess', _104 => _104["location"]]) || _optionalChain([response, 'access', _105 => _105.headers, 'optionalAccess', _106 => _106["Location"]]);
|
|
22775
23073
|
let createdPath = "";
|
|
22776
23074
|
if (locationHeader) {
|
|
22777
23075
|
const pathMatch = locationHeader.match(/script\/(.+)$/);
|
|
@@ -22818,7 +23116,7 @@ var CreateScriptFolderTool = {
|
|
|
22818
23116
|
validateStatus: () => true
|
|
22819
23117
|
});
|
|
22820
23118
|
if (response.status === 201) {
|
|
22821
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
23119
|
+
const locationHeader = _optionalChain([response, 'access', _107 => _107.headers, 'optionalAccess', _108 => _108["location"]]) || _optionalChain([response, 'access', _109 => _109.headers, 'optionalAccess', _110 => _110["Location"]]);
|
|
22822
23120
|
let createdPath = "";
|
|
22823
23121
|
if (locationHeader) {
|
|
22824
23122
|
const pathMatch = locationHeader.match(/script\/folder\/(.+)$/);
|
|
@@ -23415,7 +23713,7 @@ var CreateStylesheetTool = {
|
|
|
23415
23713
|
validateStatus: () => true
|
|
23416
23714
|
});
|
|
23417
23715
|
if (response.status === 201) {
|
|
23418
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
23716
|
+
const locationHeader = _optionalChain([response, 'access', _111 => _111.headers, 'optionalAccess', _112 => _112["location"]]) || _optionalChain([response, 'access', _113 => _113.headers, 'optionalAccess', _114 => _114["Location"]]);
|
|
23419
23717
|
let createdPath = "";
|
|
23420
23718
|
if (locationHeader) {
|
|
23421
23719
|
const pathMatch = locationHeader.match(/stylesheet\/(.+)$/);
|
|
@@ -23462,7 +23760,7 @@ var CreateStylesheetFolderTool = {
|
|
|
23462
23760
|
validateStatus: () => true
|
|
23463
23761
|
});
|
|
23464
23762
|
if (response.status === 201) {
|
|
23465
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
23763
|
+
const locationHeader = _optionalChain([response, 'access', _115 => _115.headers, 'optionalAccess', _116 => _116["location"]]) || _optionalChain([response, 'access', _117 => _117.headers, 'optionalAccess', _118 => _118["Location"]]);
|
|
23466
23764
|
let createdPath = "";
|
|
23467
23765
|
if (locationHeader) {
|
|
23468
23766
|
const pathMatch = locationHeader.match(/stylesheet\/folder\/(.+)$/);
|
|
@@ -23826,7 +24124,7 @@ var CreateTemplateTool = {
|
|
|
23826
24124
|
validateStatus: () => true
|
|
23827
24125
|
});
|
|
23828
24126
|
if (response.status === 201) {
|
|
23829
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
24127
|
+
const locationHeader = _optionalChain([response, 'access', _119 => _119.headers, 'optionalAccess', _120 => _120["location"]]) || _optionalChain([response, 'access', _121 => _121.headers, 'optionalAccess', _122 => _122["Location"]]);
|
|
23830
24128
|
let createdId = "";
|
|
23831
24129
|
if (locationHeader) {
|
|
23832
24130
|
const idMatch = locationHeader.match(/template\/([a-f0-9-]+)$/i);
|
|
@@ -24681,6 +24979,50 @@ var DeleteUserAvatarByIdTool = {
|
|
|
24681
24979
|
};
|
|
24682
24980
|
var delete_user_avatar_by_id_default = _mcpserversdk.withStandardDecorators.call(void 0, DeleteUserAvatarByIdTool);
|
|
24683
24981
|
|
|
24982
|
+
// src/umb-management-api/tools/user/delete/delete-user-current-avatar.ts
|
|
24983
|
+
|
|
24984
|
+
|
|
24985
|
+
|
|
24986
|
+
|
|
24987
|
+
|
|
24988
|
+
var DeleteUserCurrentAvatarTool = {
|
|
24989
|
+
name: "delete-user-current-avatar",
|
|
24990
|
+
description: "Deletes the avatar for the current authenticated user",
|
|
24991
|
+
inputSchema: {},
|
|
24992
|
+
annotations: {
|
|
24993
|
+
destructiveHint: true
|
|
24994
|
+
},
|
|
24995
|
+
slices: ["current-user"],
|
|
24996
|
+
handler: (async () => {
|
|
24997
|
+
return _mcpserversdk.executeVoidApiCall.call(void 0,
|
|
24998
|
+
(client) => client.deleteUserCurrentAvatar(_mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
|
|
24999
|
+
);
|
|
25000
|
+
})
|
|
25001
|
+
};
|
|
25002
|
+
var delete_user_current_avatar_default = _mcpserversdk.withStandardDecorators.call(void 0, DeleteUserCurrentAvatarTool);
|
|
25003
|
+
|
|
25004
|
+
// src/umb-management-api/tools/user/put/update-user-current-profile.ts
|
|
25005
|
+
|
|
25006
|
+
|
|
25007
|
+
|
|
25008
|
+
|
|
25009
|
+
|
|
25010
|
+
var UpdateUserCurrentProfileTool = {
|
|
25011
|
+
name: "update-user-current-profile",
|
|
25012
|
+
description: "Updates the profile of the current authenticated user (e.g. the preferred UI language)",
|
|
25013
|
+
inputSchema: putUserCurrentProfileBody.shape,
|
|
25014
|
+
annotations: {
|
|
25015
|
+
idempotentHint: true
|
|
25016
|
+
},
|
|
25017
|
+
slices: ["current-user"],
|
|
25018
|
+
handler: (async (model) => {
|
|
25019
|
+
return _mcpserversdk.executeVoidApiCall.call(void 0,
|
|
25020
|
+
(client) => client.putUserCurrentProfile(model, _mcpserversdk.CAPTURE_RAW_HTTP_RESPONSE)
|
|
25021
|
+
);
|
|
25022
|
+
})
|
|
25023
|
+
};
|
|
25024
|
+
var update_user_current_profile_default = _mcpserversdk.withStandardDecorators.call(void 0, UpdateUserCurrentProfileTool);
|
|
25025
|
+
|
|
24684
25026
|
// src/umb-management-api/tools/user/index.ts
|
|
24685
25027
|
var UserCollection = {
|
|
24686
25028
|
metadata: {
|
|
@@ -24698,6 +25040,8 @@ var UserCollection = {
|
|
|
24698
25040
|
tools.push(get_user_current_permissions_document_default);
|
|
24699
25041
|
tools.push(get_user_current_permissions_media_default);
|
|
24700
25042
|
tools.push(upload_user_current_avatar_default);
|
|
25043
|
+
tools.push(delete_user_current_avatar_default);
|
|
25044
|
+
tools.push(update_user_current_profile_default);
|
|
24701
25045
|
if (AuthorizationPolicies.SectionAccessUsers(user)) {
|
|
24702
25046
|
tools.push(get_user_default);
|
|
24703
25047
|
tools.push(get_user_by_id_default);
|
|
@@ -24736,7 +25080,7 @@ var CreateUserDataTool = {
|
|
|
24736
25080
|
validateStatus: () => true
|
|
24737
25081
|
});
|
|
24738
25082
|
if (response.status === 201) {
|
|
24739
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
25083
|
+
const locationHeader = _optionalChain([response, 'access', _123 => _123.headers, 'optionalAccess', _124 => _124["location"]]) || _optionalChain([response, 'access', _125 => _125.headers, 'optionalAccess', _126 => _126["Location"]]);
|
|
24740
25084
|
let createdId = "";
|
|
24741
25085
|
if (locationHeader) {
|
|
24742
25086
|
const idMatch = locationHeader.match(/user-data\/([a-f0-9-]+)$/i);
|
|
@@ -24974,7 +25318,7 @@ var CreateUserGroupTool = {
|
|
|
24974
25318
|
validateStatus: () => true
|
|
24975
25319
|
});
|
|
24976
25320
|
if (response.status === 201) {
|
|
24977
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
25321
|
+
const locationHeader = _optionalChain([response, 'access', _127 => _127.headers, 'optionalAccess', _128 => _128["location"]]) || _optionalChain([response, 'access', _129 => _129.headers, 'optionalAccess', _130 => _130["Location"]]);
|
|
24978
25322
|
let createdId = "";
|
|
24979
25323
|
if (locationHeader) {
|
|
24980
25324
|
const idMatch = locationHeader.match(/user-group\/([a-f0-9-]+)$/i);
|
|
@@ -25272,7 +25616,7 @@ var CreateWebhookTool = {
|
|
|
25272
25616
|
validateStatus: () => true
|
|
25273
25617
|
});
|
|
25274
25618
|
if (response.status === 201) {
|
|
25275
|
-
const locationHeader = _optionalChain([response, 'access',
|
|
25619
|
+
const locationHeader = _optionalChain([response, 'access', _131 => _131.headers, 'optionalAccess', _132 => _132["location"]]) || _optionalChain([response, 'access', _133 => _133.headers, 'optionalAccess', _134 => _134["Location"]]);
|
|
25276
25620
|
let createdId = "";
|
|
25277
25621
|
if (locationHeader) {
|
|
25278
25622
|
const idMatch = locationHeader.match(/webhook\/([a-f0-9-]+)$/i);
|
|
@@ -25508,4 +25852,4 @@ var allSliceNames = [...toolSliceNames, "other"];
|
|
|
25508
25852
|
|
|
25509
25853
|
|
|
25510
25854
|
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;
|
|
25511
|
-
//# sourceMappingURL=chunk-
|
|
25855
|
+
//# sourceMappingURL=chunk-BKIMD4NU.cjs.map
|