@umbraco-cms/mcp-dev 16.0.0-beta.1 → 16.0.0-beta.2
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/README.md +285 -76
- package/dist/index.cjs +2642 -367
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2719 -444
- package/dist/index.js.map +1 -1
- package/package.json +10 -6
package/dist/index.js
CHANGED
|
@@ -815,12 +815,12 @@ var StdioServerTransport = class {
|
|
|
815
815
|
(_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
816
816
|
}
|
|
817
817
|
send(message) {
|
|
818
|
-
return new Promise((
|
|
818
|
+
return new Promise((resolve2) => {
|
|
819
819
|
const json = serializeMessage(message);
|
|
820
820
|
if (this._stdout.write(json)) {
|
|
821
|
-
|
|
821
|
+
resolve2();
|
|
822
822
|
} else {
|
|
823
|
-
this._stdout.once("drain",
|
|
823
|
+
this._stdout.once("drain", resolve2);
|
|
824
824
|
}
|
|
825
825
|
});
|
|
826
826
|
}
|
|
@@ -1029,7 +1029,7 @@ var Protocol = class {
|
|
|
1029
1029
|
* Do not use this method to emit notifications! Use notification() instead.
|
|
1030
1030
|
*/
|
|
1031
1031
|
request(request, resultSchema, options) {
|
|
1032
|
-
return new Promise((
|
|
1032
|
+
return new Promise((resolve2, reject) => {
|
|
1033
1033
|
var _a, _b, _c, _d, _e;
|
|
1034
1034
|
if (!this._transport) {
|
|
1035
1035
|
reject(new Error("Not connected"));
|
|
@@ -1077,7 +1077,7 @@ var Protocol = class {
|
|
|
1077
1077
|
}
|
|
1078
1078
|
try {
|
|
1079
1079
|
const result = resultSchema.parse(response.result);
|
|
1080
|
-
|
|
1080
|
+
resolve2(result);
|
|
1081
1081
|
} catch (error) {
|
|
1082
1082
|
reject(error);
|
|
1083
1083
|
}
|
|
@@ -3238,44 +3238,32 @@ import Axios2 from "axios";
|
|
|
3238
3238
|
// src/orval/client/umbraco-axios.ts
|
|
3239
3239
|
import qs from "qs";
|
|
3240
3240
|
import Axios from "axios";
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
});
|
|
3254
|
-
var env_default = envSchema.parse(process.env);
|
|
3255
|
-
|
|
3256
|
-
// src/orval/client/umbraco-axios.ts
|
|
3257
|
-
var client_id = env_default.UMBRACO_CLIENT_ID;
|
|
3258
|
-
var client_secret = env_default.UMBRACO_CLIENT_SECRET;
|
|
3241
|
+
var authConfig = null;
|
|
3242
|
+
function initializeUmbracoAxios(config) {
|
|
3243
|
+
authConfig = config;
|
|
3244
|
+
const { clientId, clientSecret, baseUrl } = config;
|
|
3245
|
+
if (!baseUrl)
|
|
3246
|
+
throw new Error("Missing required configuration: baseUrl");
|
|
3247
|
+
if (!clientId)
|
|
3248
|
+
throw new Error("Missing required configuration: clientId");
|
|
3249
|
+
if (!clientSecret && clientId !== "umbraco-swagger")
|
|
3250
|
+
throw new Error("Missing required configuration: clientSecret");
|
|
3251
|
+
UmbracoAxios.defaults.baseURL = baseUrl;
|
|
3252
|
+
}
|
|
3259
3253
|
var grant_type = "client_credentials";
|
|
3260
|
-
var baseURL = env_default.UMBRACO_BASE_URL;
|
|
3261
|
-
if (!baseURL)
|
|
3262
|
-
throw new Error("Missing required environment variable: UMBRACO_BASE_URL");
|
|
3263
|
-
if (!client_id)
|
|
3264
|
-
throw new Error("Missing required environment variable: UMBRACO_CLIENT_ID");
|
|
3265
|
-
if (!client_secret && client_id !== "umbraco-swagger")
|
|
3266
|
-
throw new Error(
|
|
3267
|
-
"Missing required environment variable: UMBRACO_CLIENT_SECRET"
|
|
3268
|
-
);
|
|
3269
3254
|
var tokenPath = "/umbraco/management/api/v1/security/back-office/token";
|
|
3270
|
-
var UmbracoAxios = Axios.create(
|
|
3255
|
+
var UmbracoAxios = Axios.create();
|
|
3271
3256
|
var accessToken = null;
|
|
3272
3257
|
var tokenExpiry = null;
|
|
3273
3258
|
var fetchAccessToken = async () => {
|
|
3259
|
+
if (!authConfig) {
|
|
3260
|
+
throw new Error("UmbracoAxios not initialized. Call initializeUmbracoAxios first.");
|
|
3261
|
+
}
|
|
3274
3262
|
const response = await Axios.post(
|
|
3275
|
-
`${
|
|
3263
|
+
`${authConfig.baseUrl}${tokenPath}`,
|
|
3276
3264
|
{
|
|
3277
|
-
client_id,
|
|
3278
|
-
client_secret:
|
|
3265
|
+
client_id: authConfig.clientId,
|
|
3266
|
+
client_secret: authConfig.clientSecret ?? "",
|
|
3279
3267
|
grant_type
|
|
3280
3268
|
},
|
|
3281
3269
|
{
|
|
@@ -5851,28 +5839,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
5851
5839
|
options
|
|
5852
5840
|
);
|
|
5853
5841
|
};
|
|
5854
|
-
const getPartialViewByPath = (
|
|
5842
|
+
const getPartialViewByPath = (path3, options) => {
|
|
5855
5843
|
return UmbracoManagementClient(
|
|
5856
5844
|
{
|
|
5857
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5845
|
+
url: `/umbraco/management/api/v1/partial-view/${path3}`,
|
|
5858
5846
|
method: "GET"
|
|
5859
5847
|
},
|
|
5860
5848
|
options
|
|
5861
5849
|
);
|
|
5862
5850
|
};
|
|
5863
|
-
const deletePartialViewByPath = (
|
|
5851
|
+
const deletePartialViewByPath = (path3, options) => {
|
|
5864
5852
|
return UmbracoManagementClient(
|
|
5865
5853
|
{
|
|
5866
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5854
|
+
url: `/umbraco/management/api/v1/partial-view/${path3}`,
|
|
5867
5855
|
method: "DELETE"
|
|
5868
5856
|
},
|
|
5869
5857
|
options
|
|
5870
5858
|
);
|
|
5871
5859
|
};
|
|
5872
|
-
const putPartialViewByPath = (
|
|
5860
|
+
const putPartialViewByPath = (path3, updatePartialViewRequestModel, options) => {
|
|
5873
5861
|
return UmbracoManagementClient(
|
|
5874
5862
|
{
|
|
5875
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5863
|
+
url: `/umbraco/management/api/v1/partial-view/${path3}`,
|
|
5876
5864
|
method: "PUT",
|
|
5877
5865
|
headers: { "Content-Type": "application/json" },
|
|
5878
5866
|
data: updatePartialViewRequestModel
|
|
@@ -5880,10 +5868,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
5880
5868
|
options
|
|
5881
5869
|
);
|
|
5882
5870
|
};
|
|
5883
|
-
const putPartialViewByPathRename = (
|
|
5871
|
+
const putPartialViewByPathRename = (path3, renamePartialViewRequestModel, options) => {
|
|
5884
5872
|
return UmbracoManagementClient(
|
|
5885
5873
|
{
|
|
5886
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5874
|
+
url: `/umbraco/management/api/v1/partial-view/${path3}/rename`,
|
|
5887
5875
|
method: "PUT",
|
|
5888
5876
|
headers: { "Content-Type": "application/json" },
|
|
5889
5877
|
data: renamePartialViewRequestModel
|
|
@@ -5902,19 +5890,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
5902
5890
|
options
|
|
5903
5891
|
);
|
|
5904
5892
|
};
|
|
5905
|
-
const getPartialViewFolderByPath = (
|
|
5893
|
+
const getPartialViewFolderByPath = (path3, options) => {
|
|
5906
5894
|
return UmbracoManagementClient(
|
|
5907
5895
|
{
|
|
5908
|
-
url: `/umbraco/management/api/v1/partial-view/folder/${
|
|
5896
|
+
url: `/umbraco/management/api/v1/partial-view/folder/${path3}`,
|
|
5909
5897
|
method: "GET"
|
|
5910
5898
|
},
|
|
5911
5899
|
options
|
|
5912
5900
|
);
|
|
5913
5901
|
};
|
|
5914
|
-
const deletePartialViewFolderByPath = (
|
|
5902
|
+
const deletePartialViewFolderByPath = (path3, options) => {
|
|
5915
5903
|
return UmbracoManagementClient(
|
|
5916
5904
|
{
|
|
5917
|
-
url: `/umbraco/management/api/v1/partial-view/folder/${
|
|
5905
|
+
url: `/umbraco/management/api/v1/partial-view/folder/${path3}`,
|
|
5918
5906
|
method: "DELETE"
|
|
5919
5907
|
},
|
|
5920
5908
|
options
|
|
@@ -6152,28 +6140,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
6152
6140
|
options
|
|
6153
6141
|
);
|
|
6154
6142
|
};
|
|
6155
|
-
const getScriptByPath = (
|
|
6143
|
+
const getScriptByPath = (path3, options) => {
|
|
6156
6144
|
return UmbracoManagementClient(
|
|
6157
6145
|
{
|
|
6158
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6146
|
+
url: `/umbraco/management/api/v1/script/${path3}`,
|
|
6159
6147
|
method: "GET"
|
|
6160
6148
|
},
|
|
6161
6149
|
options
|
|
6162
6150
|
);
|
|
6163
6151
|
};
|
|
6164
|
-
const deleteScriptByPath = (
|
|
6152
|
+
const deleteScriptByPath = (path3, options) => {
|
|
6165
6153
|
return UmbracoManagementClient(
|
|
6166
6154
|
{
|
|
6167
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6155
|
+
url: `/umbraco/management/api/v1/script/${path3}`,
|
|
6168
6156
|
method: "DELETE"
|
|
6169
6157
|
},
|
|
6170
6158
|
options
|
|
6171
6159
|
);
|
|
6172
6160
|
};
|
|
6173
|
-
const putScriptByPath = (
|
|
6161
|
+
const putScriptByPath = (path3, updateScriptRequestModel, options) => {
|
|
6174
6162
|
return UmbracoManagementClient(
|
|
6175
6163
|
{
|
|
6176
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6164
|
+
url: `/umbraco/management/api/v1/script/${path3}`,
|
|
6177
6165
|
method: "PUT",
|
|
6178
6166
|
headers: { "Content-Type": "application/json" },
|
|
6179
6167
|
data: updateScriptRequestModel
|
|
@@ -6181,10 +6169,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
6181
6169
|
options
|
|
6182
6170
|
);
|
|
6183
6171
|
};
|
|
6184
|
-
const putScriptByPathRename = (
|
|
6172
|
+
const putScriptByPathRename = (path3, renameScriptRequestModel, options) => {
|
|
6185
6173
|
return UmbracoManagementClient(
|
|
6186
6174
|
{
|
|
6187
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6175
|
+
url: `/umbraco/management/api/v1/script/${path3}/rename`,
|
|
6188
6176
|
method: "PUT",
|
|
6189
6177
|
headers: { "Content-Type": "application/json" },
|
|
6190
6178
|
data: renameScriptRequestModel
|
|
@@ -6203,19 +6191,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
6203
6191
|
options
|
|
6204
6192
|
);
|
|
6205
6193
|
};
|
|
6206
|
-
const getScriptFolderByPath = (
|
|
6194
|
+
const getScriptFolderByPath = (path3, options) => {
|
|
6207
6195
|
return UmbracoManagementClient(
|
|
6208
6196
|
{
|
|
6209
|
-
url: `/umbraco/management/api/v1/script/folder/${
|
|
6197
|
+
url: `/umbraco/management/api/v1/script/folder/${path3}`,
|
|
6210
6198
|
method: "GET"
|
|
6211
6199
|
},
|
|
6212
6200
|
options
|
|
6213
6201
|
);
|
|
6214
6202
|
};
|
|
6215
|
-
const deleteScriptFolderByPath = (
|
|
6203
|
+
const deleteScriptFolderByPath = (path3, options) => {
|
|
6216
6204
|
return UmbracoManagementClient(
|
|
6217
6205
|
{
|
|
6218
|
-
url: `/umbraco/management/api/v1/script/folder/${
|
|
6206
|
+
url: `/umbraco/management/api/v1/script/folder/${path3}`,
|
|
6219
6207
|
method: "DELETE"
|
|
6220
6208
|
},
|
|
6221
6209
|
options
|
|
@@ -6429,28 +6417,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
6429
6417
|
options
|
|
6430
6418
|
);
|
|
6431
6419
|
};
|
|
6432
|
-
const getStylesheetByPath = (
|
|
6420
|
+
const getStylesheetByPath = (path3, options) => {
|
|
6433
6421
|
return UmbracoManagementClient(
|
|
6434
6422
|
{
|
|
6435
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6423
|
+
url: `/umbraco/management/api/v1/stylesheet/${path3}`,
|
|
6436
6424
|
method: "GET"
|
|
6437
6425
|
},
|
|
6438
6426
|
options
|
|
6439
6427
|
);
|
|
6440
6428
|
};
|
|
6441
|
-
const deleteStylesheetByPath = (
|
|
6429
|
+
const deleteStylesheetByPath = (path3, options) => {
|
|
6442
6430
|
return UmbracoManagementClient(
|
|
6443
6431
|
{
|
|
6444
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6432
|
+
url: `/umbraco/management/api/v1/stylesheet/${path3}`,
|
|
6445
6433
|
method: "DELETE"
|
|
6446
6434
|
},
|
|
6447
6435
|
options
|
|
6448
6436
|
);
|
|
6449
6437
|
};
|
|
6450
|
-
const putStylesheetByPath = (
|
|
6438
|
+
const putStylesheetByPath = (path3, updateStylesheetRequestModel, options) => {
|
|
6451
6439
|
return UmbracoManagementClient(
|
|
6452
6440
|
{
|
|
6453
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6441
|
+
url: `/umbraco/management/api/v1/stylesheet/${path3}`,
|
|
6454
6442
|
method: "PUT",
|
|
6455
6443
|
headers: { "Content-Type": "application/json" },
|
|
6456
6444
|
data: updateStylesheetRequestModel
|
|
@@ -6458,10 +6446,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
6458
6446
|
options
|
|
6459
6447
|
);
|
|
6460
6448
|
};
|
|
6461
|
-
const putStylesheetByPathRename = (
|
|
6449
|
+
const putStylesheetByPathRename = (path3, renameStylesheetRequestModel, options) => {
|
|
6462
6450
|
return UmbracoManagementClient(
|
|
6463
6451
|
{
|
|
6464
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6452
|
+
url: `/umbraco/management/api/v1/stylesheet/${path3}/rename`,
|
|
6465
6453
|
method: "PUT",
|
|
6466
6454
|
headers: { "Content-Type": "application/json" },
|
|
6467
6455
|
data: renameStylesheetRequestModel
|
|
@@ -6480,19 +6468,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
6480
6468
|
options
|
|
6481
6469
|
);
|
|
6482
6470
|
};
|
|
6483
|
-
const getStylesheetFolderByPath = (
|
|
6471
|
+
const getStylesheetFolderByPath = (path3, options) => {
|
|
6484
6472
|
return UmbracoManagementClient(
|
|
6485
6473
|
{
|
|
6486
|
-
url: `/umbraco/management/api/v1/stylesheet/folder/${
|
|
6474
|
+
url: `/umbraco/management/api/v1/stylesheet/folder/${path3}`,
|
|
6487
6475
|
method: "GET"
|
|
6488
6476
|
},
|
|
6489
6477
|
options
|
|
6490
6478
|
);
|
|
6491
6479
|
};
|
|
6492
|
-
const deleteStylesheetFolderByPath = (
|
|
6480
|
+
const deleteStylesheetFolderByPath = (path3, options) => {
|
|
6493
6481
|
return UmbracoManagementClient(
|
|
6494
6482
|
{
|
|
6495
|
-
url: `/umbraco/management/api/v1/stylesheet/folder/${
|
|
6483
|
+
url: `/umbraco/management/api/v1/stylesheet/folder/${path3}`,
|
|
6496
6484
|
method: "DELETE"
|
|
6497
6485
|
},
|
|
6498
6486
|
options
|
|
@@ -13633,14 +13621,34 @@ var GetDataTypeTool = CreateUmbracoTool(
|
|
|
13633
13621
|
);
|
|
13634
13622
|
var get_data_type_default = GetDataTypeTool;
|
|
13635
13623
|
|
|
13624
|
+
// src/umb-management-api/tools/data-type/get/get-data-type-configuration.ts
|
|
13625
|
+
var GetDataTypeConfigurationTool = CreateUmbracoTool(
|
|
13626
|
+
"get-data-type-configuration",
|
|
13627
|
+
"Gets global data type configuration settings including change permissions and default list view IDs",
|
|
13628
|
+
{},
|
|
13629
|
+
async () => {
|
|
13630
|
+
const client = UmbracoManagementClient2.getClient();
|
|
13631
|
+
const response = await client.getDataTypeConfiguration();
|
|
13632
|
+
return {
|
|
13633
|
+
content: [
|
|
13634
|
+
{
|
|
13635
|
+
type: "text",
|
|
13636
|
+
text: JSON.stringify(response, null, 2)
|
|
13637
|
+
}
|
|
13638
|
+
]
|
|
13639
|
+
};
|
|
13640
|
+
}
|
|
13641
|
+
);
|
|
13642
|
+
var get_data_type_configuration_default = GetDataTypeConfigurationTool;
|
|
13643
|
+
|
|
13636
13644
|
// src/umb-management-api/tools/data-type/put/update-data-type.ts
|
|
13637
|
-
import { z as
|
|
13645
|
+
import { z as z3 } from "zod";
|
|
13638
13646
|
var UpdateDataTypeTool = CreateUmbracoTool(
|
|
13639
13647
|
"update-data-type",
|
|
13640
13648
|
"Updates a data type by Id",
|
|
13641
13649
|
{
|
|
13642
13650
|
id: putDataTypeByIdParams.shape.id,
|
|
13643
|
-
data:
|
|
13651
|
+
data: z3.object(putDataTypeByIdBody.shape)
|
|
13644
13652
|
},
|
|
13645
13653
|
async (model) => {
|
|
13646
13654
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -13658,13 +13666,13 @@ var UpdateDataTypeTool = CreateUmbracoTool(
|
|
|
13658
13666
|
var update_data_type_default = UpdateDataTypeTool;
|
|
13659
13667
|
|
|
13660
13668
|
// src/umb-management-api/tools/data-type/post/copy-data-type.ts
|
|
13661
|
-
import { z as
|
|
13669
|
+
import { z as z4 } from "zod";
|
|
13662
13670
|
var CopyDataTypeTool = CreateUmbracoTool(
|
|
13663
13671
|
"copy-data-type",
|
|
13664
13672
|
"Copy a data type by Id",
|
|
13665
13673
|
{
|
|
13666
13674
|
id: postDataTypeByIdCopyParams.shape.id,
|
|
13667
|
-
body:
|
|
13675
|
+
body: z4.object(postDataTypeByIdCopyBody.shape)
|
|
13668
13676
|
},
|
|
13669
13677
|
async ({ id, body }) => {
|
|
13670
13678
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -13702,13 +13710,13 @@ var IsUsedDataTypeTool = CreateUmbracoTool(
|
|
|
13702
13710
|
var is_used_data_type_default = IsUsedDataTypeTool;
|
|
13703
13711
|
|
|
13704
13712
|
// src/umb-management-api/tools/data-type/put/move-data-type.ts
|
|
13705
|
-
import { z as
|
|
13713
|
+
import { z as z5 } from "zod";
|
|
13706
13714
|
var MoveDataTypeTool = CreateUmbracoTool(
|
|
13707
13715
|
"move-data-type",
|
|
13708
13716
|
"Move a data type by Id",
|
|
13709
13717
|
{
|
|
13710
13718
|
id: putDataTypeByIdMoveParams.shape.id,
|
|
13711
|
-
body:
|
|
13719
|
+
body: z5.object(putDataTypeByIdMoveBody.shape)
|
|
13712
13720
|
},
|
|
13713
13721
|
async ({ id, body }) => {
|
|
13714
13722
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -13837,13 +13845,13 @@ var GetDataTypeSearchTool = CreateUmbracoTool(
|
|
|
13837
13845
|
var get_search_default = GetDataTypeSearchTool;
|
|
13838
13846
|
|
|
13839
13847
|
// src/umb-management-api/tools/data-type/folders/put/update-folder.ts
|
|
13840
|
-
import { z as
|
|
13848
|
+
import { z as z6 } from "zod";
|
|
13841
13849
|
var UpdateDataTypeFolderTool = CreateUmbracoTool(
|
|
13842
13850
|
"update-data-type-folder",
|
|
13843
13851
|
"Updates a data type folder by Id",
|
|
13844
13852
|
{
|
|
13845
13853
|
id: putDataTypeFolderByIdParams.shape.id,
|
|
13846
|
-
data:
|
|
13854
|
+
data: z6.object(putDataTypeFolderByIdBody.shape)
|
|
13847
13855
|
},
|
|
13848
13856
|
async (model) => {
|
|
13849
13857
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14024,6 +14032,7 @@ var DataTypeCollection = {
|
|
|
14024
14032
|
tools.push(get_references_data_type_default());
|
|
14025
14033
|
tools.push(is_used_data_type_default());
|
|
14026
14034
|
tools.push(get_data_type_default());
|
|
14035
|
+
tools.push(get_data_type_configuration_default());
|
|
14027
14036
|
}
|
|
14028
14037
|
if (AuthorizationPolicies.TreeAccessDataTypes(user)) {
|
|
14029
14038
|
tools.push(get_root_default());
|
|
@@ -14130,13 +14139,13 @@ var CreateDictionaryItemTool = CreateUmbracoTool(
|
|
|
14130
14139
|
var create_dictionary_item_default = CreateDictionaryItemTool;
|
|
14131
14140
|
|
|
14132
14141
|
// src/umb-management-api/tools/dictionary/put/update-dictionary-item.ts
|
|
14133
|
-
import { z as
|
|
14142
|
+
import { z as z7 } from "zod";
|
|
14134
14143
|
var UpdateDictionaryItemTool = CreateUmbracoTool(
|
|
14135
14144
|
"update-dictionary-item",
|
|
14136
14145
|
"Updates a dictionary item by Id",
|
|
14137
14146
|
{
|
|
14138
14147
|
id: putDictionaryByIdParams.shape.id,
|
|
14139
|
-
data:
|
|
14148
|
+
data: z7.object(putDictionaryByIdBody.shape)
|
|
14140
14149
|
},
|
|
14141
14150
|
async (model) => {
|
|
14142
14151
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14154,13 +14163,13 @@ var UpdateDictionaryItemTool = CreateUmbracoTool(
|
|
|
14154
14163
|
var update_dictionary_item_default = UpdateDictionaryItemTool;
|
|
14155
14164
|
|
|
14156
14165
|
// src/umb-management-api/tools/dictionary/put/move-dictionary-item.ts
|
|
14157
|
-
import { z as
|
|
14166
|
+
import { z as z8 } from "zod";
|
|
14158
14167
|
var MoveDictionaryItemTool = CreateUmbracoTool(
|
|
14159
14168
|
"move-dictionary-item",
|
|
14160
14169
|
"Moves a dictionary item by Id",
|
|
14161
14170
|
{
|
|
14162
14171
|
id: putDictionaryByIdMoveParams.shape.id,
|
|
14163
|
-
data:
|
|
14172
|
+
data: z8.object(putDictionaryByIdMoveBody.shape)
|
|
14164
14173
|
},
|
|
14165
14174
|
async (model) => {
|
|
14166
14175
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14265,18 +14274,18 @@ var DictionaryCollection = {
|
|
|
14265
14274
|
};
|
|
14266
14275
|
|
|
14267
14276
|
// src/umb-management-api/tools/document-type/post/create-document-type.ts
|
|
14268
|
-
import { z as
|
|
14277
|
+
import { z as z10 } from "zod";
|
|
14269
14278
|
import { v4 as uuidv42 } from "uuid";
|
|
14270
14279
|
|
|
14271
14280
|
// src/umb-management-api/tools/document-type/post/helpers/create-container-hierarchy.ts
|
|
14272
14281
|
import { v4 as uuidv4 } from "uuid";
|
|
14273
|
-
import { z as
|
|
14274
|
-
var propertySchema =
|
|
14275
|
-
name:
|
|
14276
|
-
alias:
|
|
14277
|
-
dataTypeId:
|
|
14278
|
-
tab:
|
|
14279
|
-
group:
|
|
14282
|
+
import { z as z9 } from "zod";
|
|
14283
|
+
var propertySchema = z9.object({
|
|
14284
|
+
name: z9.string().min(1, "Property name is required"),
|
|
14285
|
+
alias: z9.string().min(1, "Property alias is required"),
|
|
14286
|
+
dataTypeId: z9.string().uuid("Must be a valid UUID"),
|
|
14287
|
+
tab: z9.string().optional(),
|
|
14288
|
+
group: z9.string().optional()
|
|
14280
14289
|
});
|
|
14281
14290
|
function createContainerHierarchy(properties) {
|
|
14282
14291
|
const containerIds = /* @__PURE__ */ new Map();
|
|
@@ -14317,22 +14326,22 @@ function createContainerHierarchy(properties) {
|
|
|
14317
14326
|
}
|
|
14318
14327
|
|
|
14319
14328
|
// src/umb-management-api/tools/document-type/post/create-document-type.ts
|
|
14320
|
-
var createDocumentTypeSchema =
|
|
14321
|
-
name:
|
|
14322
|
-
alias:
|
|
14323
|
-
description:
|
|
14324
|
-
icon:
|
|
14325
|
-
allowedAsRoot:
|
|
14326
|
-
compositions:
|
|
14327
|
-
allowedDocumentTypes:
|
|
14328
|
-
collection:
|
|
14329
|
-
properties:
|
|
14330
|
-
|
|
14331
|
-
name:
|
|
14332
|
-
alias:
|
|
14333
|
-
dataTypeId:
|
|
14334
|
-
tab:
|
|
14335
|
-
group:
|
|
14329
|
+
var createDocumentTypeSchema = z10.object({
|
|
14330
|
+
name: z10.string().min(1, "Name is required"),
|
|
14331
|
+
alias: z10.string().min(1, "Alias is required"),
|
|
14332
|
+
description: z10.string().optional(),
|
|
14333
|
+
icon: z10.string().min(1, "Icon is required"),
|
|
14334
|
+
allowedAsRoot: z10.boolean().default(false),
|
|
14335
|
+
compositions: z10.array(z10.string().uuid("Must be a valid document type UUID")).default([]),
|
|
14336
|
+
allowedDocumentTypes: z10.array(z10.string().uuid("Must be a valid document type UUID")).default([]),
|
|
14337
|
+
collection: z10.string().uuid("Must be a valid collection data type UUID").optional(),
|
|
14338
|
+
properties: z10.array(
|
|
14339
|
+
z10.object({
|
|
14340
|
+
name: z10.string().min(1, "Property name is required"),
|
|
14341
|
+
alias: z10.string().min(1, "Property alias is required"),
|
|
14342
|
+
dataTypeId: z10.string().uuid("Must be a valid data type UUID"),
|
|
14343
|
+
tab: z10.string().optional(),
|
|
14344
|
+
group: z10.string().optional()
|
|
14336
14345
|
})
|
|
14337
14346
|
).default([])
|
|
14338
14347
|
});
|
|
@@ -14469,13 +14478,13 @@ var GetDocumentTypeByIdTool = CreateUmbracoTool(
|
|
|
14469
14478
|
var get_document_type_by_ids_default = GetDocumentTypeByIdTool;
|
|
14470
14479
|
|
|
14471
14480
|
// src/umb-management-api/tools/document-type/put/update-document-type.ts
|
|
14472
|
-
import { z as
|
|
14481
|
+
import { z as z11 } from "zod";
|
|
14473
14482
|
var UpdateDocumentTypeTool = CreateUmbracoTool(
|
|
14474
14483
|
"update-document-type",
|
|
14475
14484
|
"Updates a document type by Id",
|
|
14476
14485
|
{
|
|
14477
14486
|
id: putDocumentTypeByIdParams.shape.id,
|
|
14478
|
-
data:
|
|
14487
|
+
data: z11.object(putDocumentTypeByIdBody.shape)
|
|
14479
14488
|
},
|
|
14480
14489
|
async (model) => {
|
|
14481
14490
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14493,13 +14502,13 @@ var UpdateDocumentTypeTool = CreateUmbracoTool(
|
|
|
14493
14502
|
var update_document_type_default = UpdateDocumentTypeTool;
|
|
14494
14503
|
|
|
14495
14504
|
// src/umb-management-api/tools/document-type/post/copy-document-type.ts
|
|
14496
|
-
import { z as
|
|
14505
|
+
import { z as z12 } from "zod";
|
|
14497
14506
|
var CopyDocumentTypeTool = CreateUmbracoTool(
|
|
14498
14507
|
"copy-document-type",
|
|
14499
14508
|
"Copy a document type to a new location",
|
|
14500
14509
|
{
|
|
14501
|
-
id:
|
|
14502
|
-
data:
|
|
14510
|
+
id: z12.string().uuid(),
|
|
14511
|
+
data: z12.object(postDocumentTypeByIdCopyBody.shape)
|
|
14503
14512
|
},
|
|
14504
14513
|
async (model) => {
|
|
14505
14514
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14520,13 +14529,13 @@ var CopyDocumentTypeTool = CreateUmbracoTool(
|
|
|
14520
14529
|
var copy_document_type_default = CopyDocumentTypeTool;
|
|
14521
14530
|
|
|
14522
14531
|
// src/umb-management-api/tools/document-type/put/move-document-type.ts
|
|
14523
|
-
import { z as
|
|
14532
|
+
import { z as z13 } from "zod";
|
|
14524
14533
|
var MoveDocumentTypeTool = CreateUmbracoTool(
|
|
14525
14534
|
"move-document-type",
|
|
14526
14535
|
"Move a document type to a new location",
|
|
14527
14536
|
{
|
|
14528
|
-
id:
|
|
14529
|
-
data:
|
|
14537
|
+
id: z13.string().uuid(),
|
|
14538
|
+
data: z13.object(putDocumentTypeByIdMoveBody.shape)
|
|
14530
14539
|
},
|
|
14531
14540
|
async (model) => {
|
|
14532
14541
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -14664,13 +14673,13 @@ var GetDocumentTypeFolderTool = CreateUmbracoTool(
|
|
|
14664
14673
|
var get_folder_default2 = GetDocumentTypeFolderTool;
|
|
14665
14674
|
|
|
14666
14675
|
// src/umb-management-api/tools/document-type/folders/put/update-folder.ts
|
|
14667
|
-
import { z as
|
|
14676
|
+
import { z as z14 } from "zod";
|
|
14668
14677
|
var UpdateDocumentTypeFolderTool = CreateUmbracoTool(
|
|
14669
14678
|
"update-document-type-folder",
|
|
14670
14679
|
"Updates a document type folder by Id",
|
|
14671
14680
|
{
|
|
14672
14681
|
id: putDocumentTypeFolderByIdParams.shape.id,
|
|
14673
|
-
data:
|
|
14682
|
+
data: z14.object(putDocumentTypeFolderByIdBody.shape)
|
|
14674
14683
|
},
|
|
14675
14684
|
async (model) => {
|
|
14676
14685
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -15343,21 +15352,21 @@ var GetIconsTool = CreateUmbracoTool(
|
|
|
15343
15352
|
var get_icons_default = GetIconsTool;
|
|
15344
15353
|
|
|
15345
15354
|
// src/umb-management-api/tools/document-type/post/create-element-type.ts
|
|
15346
|
-
import { z as
|
|
15355
|
+
import { z as z15 } from "zod";
|
|
15347
15356
|
import { v4 as uuidv43 } from "uuid";
|
|
15348
|
-
var createElementTypeSchema =
|
|
15349
|
-
name:
|
|
15350
|
-
alias:
|
|
15351
|
-
description:
|
|
15352
|
-
icon:
|
|
15353
|
-
compositions:
|
|
15354
|
-
properties:
|
|
15355
|
-
|
|
15356
|
-
name:
|
|
15357
|
-
alias:
|
|
15358
|
-
dataTypeId:
|
|
15359
|
-
tab:
|
|
15360
|
-
group:
|
|
15357
|
+
var createElementTypeSchema = z15.object({
|
|
15358
|
+
name: z15.string().min(1, "Name is required"),
|
|
15359
|
+
alias: z15.string().min(1, "Alias is required"),
|
|
15360
|
+
description: z15.string().optional(),
|
|
15361
|
+
icon: z15.string().min(1, "Icon is required"),
|
|
15362
|
+
compositions: z15.array(z15.string().uuid("Must be a valid document type UUID")).default([]),
|
|
15363
|
+
properties: z15.array(
|
|
15364
|
+
z15.object({
|
|
15365
|
+
name: z15.string().min(1, "Property name is required"),
|
|
15366
|
+
alias: z15.string().min(1, "Property alias is required"),
|
|
15367
|
+
dataTypeId: z15.string().uuid("Must be a valid data type UUID"),
|
|
15368
|
+
tab: z15.string().optional(),
|
|
15369
|
+
group: z15.string().optional()
|
|
15361
15370
|
})
|
|
15362
15371
|
).default([])
|
|
15363
15372
|
});
|
|
@@ -15622,13 +15631,13 @@ var CreateLanguageTool = CreateUmbracoTool(
|
|
|
15622
15631
|
var create_language_default = CreateLanguageTool;
|
|
15623
15632
|
|
|
15624
15633
|
// src/umb-management-api/tools/language/put/update-language.ts
|
|
15625
|
-
import { z as
|
|
15634
|
+
import { z as z16 } from "zod";
|
|
15626
15635
|
var UpdateLanguageTool = CreateUmbracoTool(
|
|
15627
15636
|
"update-language",
|
|
15628
15637
|
"Updates an existing language by ISO code",
|
|
15629
15638
|
{
|
|
15630
15639
|
isoCode: putLanguageByIsoCodeParams.shape.isoCode,
|
|
15631
|
-
data:
|
|
15640
|
+
data: z16.object(putLanguageByIsoCodeBody.shape)
|
|
15632
15641
|
},
|
|
15633
15642
|
async (model) => {
|
|
15634
15643
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -15734,13 +15743,13 @@ var DeleteDocumentBlueprintTool = CreateUmbracoTool(
|
|
|
15734
15743
|
var delete_blueprint_default = DeleteDocumentBlueprintTool;
|
|
15735
15744
|
|
|
15736
15745
|
// src/umb-management-api/tools/document-blueprint/put/update-blueprint.ts
|
|
15737
|
-
import { z as
|
|
15746
|
+
import { z as z17 } from "zod";
|
|
15738
15747
|
var UpdateDocumentBlueprintTool = CreateUmbracoTool(
|
|
15739
15748
|
"update-document-blueprint",
|
|
15740
15749
|
"Updates a document blueprint by Id",
|
|
15741
15750
|
{
|
|
15742
15751
|
id: putDocumentBlueprintByIdParams.shape.id,
|
|
15743
|
-
data:
|
|
15752
|
+
data: z17.object(putDocumentBlueprintByIdBody.shape)
|
|
15744
15753
|
},
|
|
15745
15754
|
async (model) => {
|
|
15746
15755
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -15838,6 +15847,49 @@ var GetDocumentBlueprintRootTool = CreateUmbracoTool(
|
|
|
15838
15847
|
);
|
|
15839
15848
|
var get_root_default4 = GetDocumentBlueprintRootTool;
|
|
15840
15849
|
|
|
15850
|
+
// src/umb-management-api/tools/document-blueprint/get/get-document-blueprint-scaffold.ts
|
|
15851
|
+
var GetDocumentBlueprintScaffoldTool = CreateUmbracoTool(
|
|
15852
|
+
"get-document-blueprint-scaffold",
|
|
15853
|
+
`Get scaffold information for a document blueprint
|
|
15854
|
+
Use this to retrieve the scaffold structure and default values for a document blueprint, typically used when creating new documents from blueprints.`,
|
|
15855
|
+
getDocumentBlueprintByIdScaffoldParams.shape,
|
|
15856
|
+
async ({ id }) => {
|
|
15857
|
+
const client = UmbracoManagementClient2.getClient();
|
|
15858
|
+
const response = await client.getDocumentBlueprintByIdScaffold(id);
|
|
15859
|
+
return {
|
|
15860
|
+
content: [
|
|
15861
|
+
{
|
|
15862
|
+
type: "text",
|
|
15863
|
+
text: JSON.stringify(response)
|
|
15864
|
+
}
|
|
15865
|
+
]
|
|
15866
|
+
};
|
|
15867
|
+
}
|
|
15868
|
+
);
|
|
15869
|
+
var get_document_blueprint_scaffold_default = GetDocumentBlueprintScaffoldTool;
|
|
15870
|
+
|
|
15871
|
+
// src/umb-management-api/tools/document-blueprint/post/create-document-blueprint-from-document.ts
|
|
15872
|
+
var CreateDocumentBlueprintFromDocumentTool = CreateUmbracoTool(
|
|
15873
|
+
"create-document-blueprint-from-document",
|
|
15874
|
+
`Create a new document blueprint from an existing document
|
|
15875
|
+
Use this to create a blueprint template based on an existing document, preserving its structure and content for reuse.`,
|
|
15876
|
+
postDocumentBlueprintFromDocumentBody.shape,
|
|
15877
|
+
async (model) => {
|
|
15878
|
+
const client = UmbracoManagementClient2.getClient();
|
|
15879
|
+
const response = await client.postDocumentBlueprintFromDocument(model);
|
|
15880
|
+
return {
|
|
15881
|
+
content: [
|
|
15882
|
+
{
|
|
15883
|
+
type: "text",
|
|
15884
|
+
text: JSON.stringify(response)
|
|
15885
|
+
}
|
|
15886
|
+
]
|
|
15887
|
+
};
|
|
15888
|
+
},
|
|
15889
|
+
(user) => user.fallbackPermissions.includes("Umb.Document.CreateBlueprint")
|
|
15890
|
+
);
|
|
15891
|
+
var create_document_blueprint_from_document_default = CreateDocumentBlueprintFromDocumentTool;
|
|
15892
|
+
|
|
15841
15893
|
// src/umb-management-api/tools/document-blueprint/index.ts
|
|
15842
15894
|
var DocumentBlueprintCollection = {
|
|
15843
15895
|
metadata: {
|
|
@@ -15856,6 +15908,8 @@ var DocumentBlueprintCollection = {
|
|
|
15856
15908
|
tools.push(get_ancestors_default4());
|
|
15857
15909
|
tools.push(get_children_default4());
|
|
15858
15910
|
tools.push(get_root_default4());
|
|
15911
|
+
tools.push(get_document_blueprint_scaffold_default());
|
|
15912
|
+
tools.push(create_document_blueprint_from_document_default());
|
|
15859
15913
|
}
|
|
15860
15914
|
return tools;
|
|
15861
15915
|
}
|
|
@@ -16025,13 +16079,13 @@ var GetDocumentPublicAccessTool = CreateUmbracoTool(
|
|
|
16025
16079
|
var get_document_public_access_default = GetDocumentPublicAccessTool;
|
|
16026
16080
|
|
|
16027
16081
|
// src/umb-management-api/tools/document/get/get-document-audit-log.ts
|
|
16028
|
-
import { z as
|
|
16082
|
+
import { z as z18 } from "zod";
|
|
16029
16083
|
var GetDocumentAuditLogTool = CreateUmbracoTool(
|
|
16030
16084
|
"get-document-audit-log",
|
|
16031
16085
|
"Fetches the audit log for a document by Id.",
|
|
16032
16086
|
{
|
|
16033
16087
|
id: getDocumentByIdAuditLogParams.shape.id,
|
|
16034
|
-
data:
|
|
16088
|
+
data: z18.object(getDocumentByIdAuditLogQueryParams.shape)
|
|
16035
16089
|
},
|
|
16036
16090
|
async (model) => {
|
|
16037
16091
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16131,14 +16185,164 @@ var SearchDocumentTool = CreateUmbracoTool(
|
|
|
16131
16185
|
);
|
|
16132
16186
|
var search_document_default = SearchDocumentTool;
|
|
16133
16187
|
|
|
16134
|
-
// src/umb-management-api/tools/document/
|
|
16188
|
+
// src/umb-management-api/tools/document/get/get-collection-document-by-id.ts
|
|
16189
|
+
import { z as z19 } from "zod";
|
|
16190
|
+
var GetCollectionDocumentByIdTool = CreateUmbracoTool(
|
|
16191
|
+
"get-collection-document-by-id",
|
|
16192
|
+
`Get a collection of document items
|
|
16193
|
+
Use this to retrieve a filtered and paginated collection of document items based on various criteria like data type, ordering, and filtering.`,
|
|
16194
|
+
z19.object({
|
|
16195
|
+
...getCollectionDocumentByIdParams.shape,
|
|
16196
|
+
...getCollectionDocumentByIdQueryParams.shape
|
|
16197
|
+
}).shape,
|
|
16198
|
+
async ({ id, dataTypeId, orderBy, orderDirection, filter, skip, take }) => {
|
|
16199
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16200
|
+
const response = await client.getCollectionDocumentById(id, {
|
|
16201
|
+
dataTypeId,
|
|
16202
|
+
orderBy,
|
|
16203
|
+
orderDirection,
|
|
16204
|
+
filter,
|
|
16205
|
+
skip,
|
|
16206
|
+
take
|
|
16207
|
+
});
|
|
16208
|
+
return {
|
|
16209
|
+
content: [
|
|
16210
|
+
{
|
|
16211
|
+
type: "text",
|
|
16212
|
+
text: JSON.stringify(response)
|
|
16213
|
+
}
|
|
16214
|
+
]
|
|
16215
|
+
};
|
|
16216
|
+
}
|
|
16217
|
+
);
|
|
16218
|
+
var get_collection_document_by_id_default = GetCollectionDocumentByIdTool;
|
|
16219
|
+
|
|
16220
|
+
// src/umb-management-api/tools/document/get/get-document-are-referenced.ts
|
|
16221
|
+
var GetDocumentAreReferencedTool = CreateUmbracoTool(
|
|
16222
|
+
"get-document-are-referenced",
|
|
16223
|
+
`Check if document items are referenced
|
|
16224
|
+
Use this to verify if specific document items are being referenced by other content before deletion or modification.`,
|
|
16225
|
+
getDocumentAreReferencedQueryParams.shape,
|
|
16226
|
+
async ({ id, skip, take }) => {
|
|
16227
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16228
|
+
const response = await client.getDocumentAreReferenced({ id, skip, take });
|
|
16229
|
+
return {
|
|
16230
|
+
content: [
|
|
16231
|
+
{
|
|
16232
|
+
type: "text",
|
|
16233
|
+
text: JSON.stringify(response)
|
|
16234
|
+
}
|
|
16235
|
+
]
|
|
16236
|
+
};
|
|
16237
|
+
}
|
|
16238
|
+
);
|
|
16239
|
+
var get_document_are_referenced_default = GetDocumentAreReferencedTool;
|
|
16240
|
+
|
|
16241
|
+
// src/umb-management-api/tools/document/get/get-document-by-id-referenced-by.ts
|
|
16135
16242
|
import { z as z20 } from "zod";
|
|
16243
|
+
var GetDocumentByIdReferencedByTool = CreateUmbracoTool(
|
|
16244
|
+
"get-document-by-id-referenced-by",
|
|
16245
|
+
`Get items that reference a specific document item
|
|
16246
|
+
Use this to find all content, documents, or other items that are currently referencing a specific document item.`,
|
|
16247
|
+
z20.object({
|
|
16248
|
+
...getDocumentByIdReferencedByParams.shape,
|
|
16249
|
+
...getDocumentByIdReferencedByQueryParams.shape
|
|
16250
|
+
}).shape,
|
|
16251
|
+
async ({ id, skip, take }) => {
|
|
16252
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16253
|
+
const response = await client.getDocumentByIdReferencedBy(id, { skip, take });
|
|
16254
|
+
return {
|
|
16255
|
+
content: [
|
|
16256
|
+
{
|
|
16257
|
+
type: "text",
|
|
16258
|
+
text: JSON.stringify(response)
|
|
16259
|
+
}
|
|
16260
|
+
]
|
|
16261
|
+
};
|
|
16262
|
+
}
|
|
16263
|
+
);
|
|
16264
|
+
var get_document_by_id_referenced_by_default = GetDocumentByIdReferencedByTool;
|
|
16265
|
+
|
|
16266
|
+
// src/umb-management-api/tools/document/get/get-document-by-id-referenced-descendants.ts
|
|
16267
|
+
import { z as z21 } from "zod";
|
|
16268
|
+
var GetDocumentByIdReferencedDescendantsTool = CreateUmbracoTool(
|
|
16269
|
+
"get-document-by-id-referenced-descendants",
|
|
16270
|
+
`Get descendant references for a document item
|
|
16271
|
+
Use this to find all descendant references (child items) that are being referenced for a specific document item.
|
|
16272
|
+
|
|
16273
|
+
Useful for:
|
|
16274
|
+
\u2022 Impact analysis: Before deleting a document folder, see what content would be affected
|
|
16275
|
+
\u2022 Dependency tracking: Find all content using documents from a specific folder hierarchy
|
|
16276
|
+
\u2022 Content auditing: Identify which descendant document items are actually being used`,
|
|
16277
|
+
z21.object({
|
|
16278
|
+
...getDocumentByIdReferencedDescendantsParams.shape,
|
|
16279
|
+
...getDocumentByIdReferencedDescendantsQueryParams.shape
|
|
16280
|
+
}).shape,
|
|
16281
|
+
async ({ id, skip, take }) => {
|
|
16282
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16283
|
+
const response = await client.getDocumentByIdReferencedDescendants(id, { skip, take });
|
|
16284
|
+
return {
|
|
16285
|
+
content: [
|
|
16286
|
+
{
|
|
16287
|
+
type: "text",
|
|
16288
|
+
text: JSON.stringify(response)
|
|
16289
|
+
}
|
|
16290
|
+
]
|
|
16291
|
+
};
|
|
16292
|
+
}
|
|
16293
|
+
);
|
|
16294
|
+
var get_document_by_id_referenced_descendants_default = GetDocumentByIdReferencedDescendantsTool;
|
|
16295
|
+
|
|
16296
|
+
// src/umb-management-api/tools/document/get/get-recycle-bin-document-original-parent.ts
|
|
16297
|
+
var GetRecycleBinDocumentOriginalParentTool = CreateUmbracoTool(
|
|
16298
|
+
"get-recycle-bin-document-original-parent",
|
|
16299
|
+
`Get the original parent location of a document item in the recycle bin
|
|
16300
|
+
Returns information about where the document item was located before deletion.`,
|
|
16301
|
+
getRecycleBinDocumentByIdOriginalParentParams.shape,
|
|
16302
|
+
async ({ id }) => {
|
|
16303
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16304
|
+
const response = await client.getRecycleBinDocumentByIdOriginalParent(id);
|
|
16305
|
+
return {
|
|
16306
|
+
content: [
|
|
16307
|
+
{
|
|
16308
|
+
type: "text",
|
|
16309
|
+
text: JSON.stringify(response)
|
|
16310
|
+
}
|
|
16311
|
+
]
|
|
16312
|
+
};
|
|
16313
|
+
}
|
|
16314
|
+
);
|
|
16315
|
+
var get_recycle_bin_document_original_parent_default = GetRecycleBinDocumentOriginalParentTool;
|
|
16316
|
+
|
|
16317
|
+
// src/umb-management-api/tools/document/get/get-recycle-bin-document-referenced-by.ts
|
|
16318
|
+
var GetRecycleBinDocumentReferencedByTool = CreateUmbracoTool(
|
|
16319
|
+
"get-recycle-bin-document-referenced-by",
|
|
16320
|
+
`Get references to deleted document items in the recycle bin
|
|
16321
|
+
Use this to find content that still references deleted document items before permanently deleting them.`,
|
|
16322
|
+
getRecycleBinDocumentReferencedByQueryParams.shape,
|
|
16323
|
+
async ({ skip, take }) => {
|
|
16324
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16325
|
+
const response = await client.getRecycleBinDocumentReferencedBy({ skip, take });
|
|
16326
|
+
return {
|
|
16327
|
+
content: [
|
|
16328
|
+
{
|
|
16329
|
+
type: "text",
|
|
16330
|
+
text: JSON.stringify(response)
|
|
16331
|
+
}
|
|
16332
|
+
]
|
|
16333
|
+
};
|
|
16334
|
+
}
|
|
16335
|
+
);
|
|
16336
|
+
var get_recycle_bin_document_referenced_by_default = GetRecycleBinDocumentReferencedByTool;
|
|
16337
|
+
|
|
16338
|
+
// src/umb-management-api/tools/document/post/post-document-public-access.ts
|
|
16339
|
+
import { z as z22 } from "zod";
|
|
16136
16340
|
var PostDocumentPublicAccessTool = CreateUmbracoTool(
|
|
16137
16341
|
"post-document-public-access",
|
|
16138
16342
|
"Adds public access settings to a document by Id.",
|
|
16139
16343
|
{
|
|
16140
16344
|
id: postDocumentByIdPublicAccessParams.shape.id,
|
|
16141
|
-
data:
|
|
16345
|
+
data: z22.object(postDocumentByIdPublicAccessBody.shape)
|
|
16142
16346
|
},
|
|
16143
16347
|
async (model) => {
|
|
16144
16348
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16181,7 +16385,13 @@ var ValidateDocumentTool = CreateUmbracoTool(
|
|
|
16181
16385
|
var validate_document_default = ValidateDocumentTool;
|
|
16182
16386
|
|
|
16183
16387
|
// src/umb-management-api/tools/document/post/copy-document.ts
|
|
16184
|
-
import { z as
|
|
16388
|
+
import { z as z23 } from "zod";
|
|
16389
|
+
var copyDocumentSchema = z23.object({
|
|
16390
|
+
parentId: z23.string().uuid("Must be a valid document UUID of the parent node").optional(),
|
|
16391
|
+
idToCopy: z23.string().uuid("Must be a valid document UUID that belongs to the parent document's children"),
|
|
16392
|
+
relateToOriginal: z23.boolean().describe("Relate the copy to the original document. This is usually set to false unless specified."),
|
|
16393
|
+
includeDescendants: z23.boolean().describe("If true, all descendant documents (children, grandchildren, etc.) will also be copied. This is usually set to false unless specified.")
|
|
16394
|
+
});
|
|
16185
16395
|
var CopyDocumentTool = CreateUmbracoTool(
|
|
16186
16396
|
"copy-document",
|
|
16187
16397
|
`Copy a document to a new location. This is also the recommended way to create new documents.
|
|
@@ -16202,13 +16412,17 @@ var CopyDocumentTool = CreateUmbracoTool(
|
|
|
16202
16412
|
Example workflows:
|
|
16203
16413
|
1. Copy only: copy-document (creates draft copy)
|
|
16204
16414
|
2. Copy and update: copy-document \u2192 search-document \u2192 update-document \u2192 publish-document`,
|
|
16205
|
-
|
|
16206
|
-
id: z21.string().uuid(),
|
|
16207
|
-
data: z21.object(postDocumentByIdCopyBody.shape)
|
|
16208
|
-
},
|
|
16415
|
+
copyDocumentSchema.shape,
|
|
16209
16416
|
async (model) => {
|
|
16210
16417
|
const client = UmbracoManagementClient2.getClient();
|
|
16211
|
-
const
|
|
16418
|
+
const payload = {
|
|
16419
|
+
target: model.parentId ? {
|
|
16420
|
+
id: model.parentId
|
|
16421
|
+
} : void 0,
|
|
16422
|
+
relateToOriginal: model.relateToOriginal,
|
|
16423
|
+
includeDescendants: model.includeDescendants
|
|
16424
|
+
};
|
|
16425
|
+
const response = await client.postDocumentByIdCopy(model.idToCopy, payload);
|
|
16212
16426
|
return {
|
|
16213
16427
|
content: [
|
|
16214
16428
|
{
|
|
@@ -16224,24 +16438,28 @@ var copy_document_default = CopyDocumentTool;
|
|
|
16224
16438
|
|
|
16225
16439
|
// src/umb-management-api/tools/document/post/create-document.ts
|
|
16226
16440
|
import { v4 as uuidv44 } from "uuid";
|
|
16227
|
-
import { z as
|
|
16228
|
-
var createDocumentSchema =
|
|
16229
|
-
documentTypeId:
|
|
16230
|
-
parentId:
|
|
16231
|
-
name:
|
|
16232
|
-
|
|
16233
|
-
|
|
16234
|
-
|
|
16235
|
-
|
|
16236
|
-
|
|
16237
|
-
|
|
16238
|
-
|
|
16441
|
+
import { z as z24 } from "zod";
|
|
16442
|
+
var createDocumentSchema = z24.object({
|
|
16443
|
+
documentTypeId: z24.string().uuid("Must be a valid document type type UUID"),
|
|
16444
|
+
parentId: z24.string().uuid("Must be a valid document UUID").optional(),
|
|
16445
|
+
name: z24.string(),
|
|
16446
|
+
cultures: z24.array(z24.string()).optional().describe("Array of culture codes. If not provided or empty array, will create single variant with null culture."),
|
|
16447
|
+
values: z24.array(
|
|
16448
|
+
z24.object({
|
|
16449
|
+
editorAlias: z24.string(),
|
|
16450
|
+
culture: z24.string().nullable(),
|
|
16451
|
+
segment: z24.string().nullable(),
|
|
16452
|
+
alias: z24.string(),
|
|
16453
|
+
value: z24.any()
|
|
16239
16454
|
})
|
|
16240
16455
|
).default([])
|
|
16241
16456
|
});
|
|
16242
16457
|
var CreateDocumentTool = CreateUmbracoTool(
|
|
16243
16458
|
"create-document",
|
|
16244
|
-
`Creates a document
|
|
16459
|
+
`Creates a document with support for multiple cultures.
|
|
16460
|
+
|
|
16461
|
+
If cultures parameter is provided, a variant will be created for each culture code.
|
|
16462
|
+
If cultures parameter is not provided or is an empty array, will create a single variant with null culture (original behavior).
|
|
16245
16463
|
|
|
16246
16464
|
Always follow these requirements when creating documents exactly, do not deviate in any way.
|
|
16247
16465
|
|
|
@@ -16847,6 +17065,17 @@ var CreateDocumentTool = CreateUmbracoTool(
|
|
|
16847
17065
|
async (model) => {
|
|
16848
17066
|
const client = UmbracoManagementClient2.getClient();
|
|
16849
17067
|
const documentId = uuidv44();
|
|
17068
|
+
let culturesToUse = [];
|
|
17069
|
+
if (model.cultures === void 0 || model.cultures.length === 0) {
|
|
17070
|
+
culturesToUse = [null];
|
|
17071
|
+
} else {
|
|
17072
|
+
culturesToUse = model.cultures;
|
|
17073
|
+
}
|
|
17074
|
+
const variants = culturesToUse.map((culture) => ({
|
|
17075
|
+
culture,
|
|
17076
|
+
name: model.name,
|
|
17077
|
+
segment: null
|
|
17078
|
+
}));
|
|
16850
17079
|
const payload = {
|
|
16851
17080
|
id: documentId,
|
|
16852
17081
|
documentType: {
|
|
@@ -16857,13 +17086,7 @@ var CreateDocumentTool = CreateUmbracoTool(
|
|
|
16857
17086
|
} : void 0,
|
|
16858
17087
|
template: null,
|
|
16859
17088
|
values: model.values,
|
|
16860
|
-
variants
|
|
16861
|
-
{
|
|
16862
|
-
culture: null,
|
|
16863
|
-
name: model.name,
|
|
16864
|
-
segment: null
|
|
16865
|
-
}
|
|
16866
|
-
]
|
|
17089
|
+
variants
|
|
16867
17090
|
};
|
|
16868
17091
|
const response = await client.postDocument(payload);
|
|
16869
17092
|
return {
|
|
@@ -16880,13 +17103,13 @@ var CreateDocumentTool = CreateUmbracoTool(
|
|
|
16880
17103
|
var create_document_default = CreateDocumentTool;
|
|
16881
17104
|
|
|
16882
17105
|
// src/umb-management-api/tools/document/put/put-document-public-access.ts
|
|
16883
|
-
import { z as
|
|
17106
|
+
import { z as z25 } from "zod";
|
|
16884
17107
|
var PutDocumentPublicAccessTool = CreateUmbracoTool(
|
|
16885
17108
|
"put-document-public-access",
|
|
16886
17109
|
"Updates public access settings for a document by Id.",
|
|
16887
17110
|
{
|
|
16888
17111
|
id: putDocumentByIdPublicAccessParams.shape.id,
|
|
16889
|
-
data:
|
|
17112
|
+
data: z25.object(putDocumentByIdPublicAccessBody.shape)
|
|
16890
17113
|
},
|
|
16891
17114
|
async (model) => {
|
|
16892
17115
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16908,14 +17131,14 @@ var PutDocumentPublicAccessTool = CreateUmbracoTool(
|
|
|
16908
17131
|
var put_document_public_access_default = PutDocumentPublicAccessTool;
|
|
16909
17132
|
|
|
16910
17133
|
// src/umb-management-api/tools/document/put/put-document-domains.ts
|
|
16911
|
-
import { z as
|
|
17134
|
+
import { z as z26 } from "zod";
|
|
16912
17135
|
var PutDocumentDomainsTool = CreateUmbracoTool(
|
|
16913
17136
|
"put-document-domains",
|
|
16914
17137
|
`Updates the domains assigned to a document by Id. Default value of the defaultIsoCode is null.
|
|
16915
17138
|
Domain isoCode in the domains array should be in the format of 'en-US' amd be a valid domain name from the Umbraco instance.`,
|
|
16916
17139
|
{
|
|
16917
17140
|
id: putDocumentByIdDomainsParams.shape.id,
|
|
16918
|
-
data:
|
|
17141
|
+
data: z26.object(putDocumentByIdDomainsBody.shape)
|
|
16919
17142
|
},
|
|
16920
17143
|
async (model) => {
|
|
16921
17144
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16934,13 +17157,13 @@ var PutDocumentDomainsTool = CreateUmbracoTool(
|
|
|
16934
17157
|
var put_document_domains_default = PutDocumentDomainsTool;
|
|
16935
17158
|
|
|
16936
17159
|
// src/umb-management-api/tools/document/put/put-document-notifications.ts
|
|
16937
|
-
import { z as
|
|
17160
|
+
import { z as z27 } from "zod";
|
|
16938
17161
|
var PutDocumentNotificationsTool = CreateUmbracoTool(
|
|
16939
17162
|
"put-document-notifications",
|
|
16940
17163
|
"Updates the notifications for a document by Id.",
|
|
16941
17164
|
{
|
|
16942
17165
|
id: putDocumentByIdNotificationsParams.shape.id,
|
|
16943
|
-
data:
|
|
17166
|
+
data: z27.object(putDocumentByIdNotificationsBody.shape)
|
|
16944
17167
|
},
|
|
16945
17168
|
async (model) => {
|
|
16946
17169
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16961,14 +17184,14 @@ var PutDocumentNotificationsTool = CreateUmbracoTool(
|
|
|
16961
17184
|
var put_document_notifications_default = PutDocumentNotificationsTool;
|
|
16962
17185
|
|
|
16963
17186
|
// src/umb-management-api/tools/document/put/publish-document-with-descendants.ts
|
|
16964
|
-
import { z as
|
|
17187
|
+
import { z as z28 } from "zod";
|
|
16965
17188
|
var PublishDocumentWithDescendantsTool = CreateUmbracoTool(
|
|
16966
17189
|
"publish-document-with-descendants",
|
|
16967
17190
|
`Publishes a document and its descendants by Id. This is an asynchronous operation that may take time for large document trees.
|
|
16968
17191
|
The tool will poll for completion and return the final result when finished.`,
|
|
16969
17192
|
{
|
|
16970
|
-
id:
|
|
16971
|
-
data:
|
|
17193
|
+
id: z28.string().uuid(),
|
|
17194
|
+
data: z28.object(putDocumentByIdPublishWithDescendantsBody.shape)
|
|
16972
17195
|
},
|
|
16973
17196
|
async (model) => {
|
|
16974
17197
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -16991,7 +17214,7 @@ var PublishDocumentWithDescendantsTool = CreateUmbracoTool(
|
|
|
16991
17214
|
let attempts = 0;
|
|
16992
17215
|
while (attempts < maxAttempts) {
|
|
16993
17216
|
attempts++;
|
|
16994
|
-
await new Promise((
|
|
17217
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
16995
17218
|
try {
|
|
16996
17219
|
const statusResponse = await client.getDocumentByIdPublishWithDescendantsResultByTaskId(
|
|
16997
17220
|
model.id,
|
|
@@ -17040,13 +17263,13 @@ var PublishDocumentWithDescendantsTool = CreateUmbracoTool(
|
|
|
17040
17263
|
var publish_document_with_descendants_default = PublishDocumentWithDescendantsTool;
|
|
17041
17264
|
|
|
17042
17265
|
// src/umb-management-api/tools/document/put/unpublish-document.ts
|
|
17043
|
-
import { z as
|
|
17266
|
+
import { z as z29 } from "zod";
|
|
17044
17267
|
var UnpublishDocumentTool = CreateUmbracoTool(
|
|
17045
17268
|
"unpublish-document",
|
|
17046
17269
|
"Unpublishes a document by Id.",
|
|
17047
17270
|
{
|
|
17048
|
-
id:
|
|
17049
|
-
data:
|
|
17271
|
+
id: z29.string().uuid(),
|
|
17272
|
+
data: z29.object(putDocumentByIdUnpublishBody.shape)
|
|
17050
17273
|
},
|
|
17051
17274
|
async (model) => {
|
|
17052
17275
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17090,13 +17313,13 @@ var SortDocumentTool = CreateUmbracoTool(
|
|
|
17090
17313
|
var sort_document_default = SortDocumentTool;
|
|
17091
17314
|
|
|
17092
17315
|
// src/umb-management-api/tools/document/put/move-document.ts
|
|
17093
|
-
import { z as
|
|
17316
|
+
import { z as z30 } from "zod";
|
|
17094
17317
|
var MoveDocumentTool = CreateUmbracoTool(
|
|
17095
17318
|
"move-document",
|
|
17096
17319
|
"Move a document to a new location",
|
|
17097
17320
|
{
|
|
17098
|
-
id:
|
|
17099
|
-
data:
|
|
17321
|
+
id: z30.string().uuid(),
|
|
17322
|
+
data: z30.object(putDocumentByIdMoveBody.shape)
|
|
17100
17323
|
},
|
|
17101
17324
|
async (model) => {
|
|
17102
17325
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17115,7 +17338,7 @@ var MoveDocumentTool = CreateUmbracoTool(
|
|
|
17115
17338
|
var move_document_default = MoveDocumentTool;
|
|
17116
17339
|
|
|
17117
17340
|
// src/umb-management-api/tools/document/put/publish-document.ts
|
|
17118
|
-
import { z as
|
|
17341
|
+
import { z as z31 } from "zod";
|
|
17119
17342
|
var PublishDocumentTool = CreateUmbracoTool(
|
|
17120
17343
|
"publish-document",
|
|
17121
17344
|
`Publishes a document by Id. IMPORTANT: If workflow approval is required, use the initiate-workflow-action function instead.
|
|
@@ -17123,8 +17346,8 @@ var PublishDocumentTool = CreateUmbracoTool(
|
|
|
17123
17346
|
When the culture is not provided, the default culture is null.
|
|
17124
17347
|
When the schedule is not provided, the default schedule is null.`,
|
|
17125
17348
|
{
|
|
17126
|
-
id:
|
|
17127
|
-
data:
|
|
17349
|
+
id: z31.string().uuid(),
|
|
17350
|
+
data: z31.object(putDocumentByIdPublishBody.shape)
|
|
17128
17351
|
},
|
|
17129
17352
|
async (model) => {
|
|
17130
17353
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17188,7 +17411,7 @@ var MoveDocumentToRecycleBinTool = CreateUmbracoTool(
|
|
|
17188
17411
|
var move_to_recycle_bin_default = MoveDocumentToRecycleBinTool;
|
|
17189
17412
|
|
|
17190
17413
|
// src/umb-management-api/tools/document/put/update-document.ts
|
|
17191
|
-
import { z as
|
|
17414
|
+
import { z as z32 } from "zod";
|
|
17192
17415
|
var UpdateDocumentTool = CreateUmbracoTool(
|
|
17193
17416
|
"update-document",
|
|
17194
17417
|
`Updates a document by Id
|
|
@@ -17196,7 +17419,7 @@ var UpdateDocumentTool = CreateUmbracoTool(
|
|
|
17196
17419
|
Don't miss any properties from the original document that you are updating`,
|
|
17197
17420
|
{
|
|
17198
17421
|
id: putDocumentByIdParams.shape.id,
|
|
17199
|
-
data:
|
|
17422
|
+
data: z32.object(putDocumentByIdBody.shape)
|
|
17200
17423
|
},
|
|
17201
17424
|
async (model) => {
|
|
17202
17425
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17354,6 +17577,12 @@ var DocumentCollection = {
|
|
|
17354
17577
|
tools.push(get_recycle_bin_children_default());
|
|
17355
17578
|
tools.push(search_document_default());
|
|
17356
17579
|
tools.push(validate_document_default());
|
|
17580
|
+
tools.push(get_collection_document_by_id_default());
|
|
17581
|
+
tools.push(get_document_are_referenced_default());
|
|
17582
|
+
tools.push(get_document_by_id_referenced_by_default());
|
|
17583
|
+
tools.push(get_document_by_id_referenced_descendants_default());
|
|
17584
|
+
tools.push(get_recycle_bin_document_original_parent_default());
|
|
17585
|
+
tools.push(get_recycle_bin_document_referenced_by_default());
|
|
17357
17586
|
}
|
|
17358
17587
|
if (AuthorizationPolicies.SectionAccessForContentTree(user)) {
|
|
17359
17588
|
tools.push(get_root_default5());
|
|
@@ -17471,57 +17700,386 @@ var DocumentVersionCollection = {
|
|
|
17471
17700
|
};
|
|
17472
17701
|
|
|
17473
17702
|
// src/umb-management-api/tools/media/post/create-media.ts
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17481
|
-
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
|
|
17485
|
-
|
|
17486
|
-
|
|
17487
|
-
|
|
17488
|
-
|
|
17489
|
-
|
|
17490
|
-
|
|
17491
|
-
|
|
17492
|
-
|
|
17703
|
+
import { z as z33 } from "zod";
|
|
17704
|
+
import { v4 as uuidv45 } from "uuid";
|
|
17705
|
+
|
|
17706
|
+
// src/umb-management-api/tools/media/post/helpers/media-upload-helpers.ts
|
|
17707
|
+
import * as fs from "fs";
|
|
17708
|
+
import * as os from "os";
|
|
17709
|
+
import * as path from "path";
|
|
17710
|
+
import axios from "axios";
|
|
17711
|
+
import mime from "mime-types";
|
|
17712
|
+
function getExtensionFromMimeType(mimeType) {
|
|
17713
|
+
if (!mimeType) return void 0;
|
|
17714
|
+
const baseMimeType = mimeType.split(";")[0].trim();
|
|
17715
|
+
const extension = mime.extension(baseMimeType);
|
|
17716
|
+
return extension ? `.${extension}` : void 0;
|
|
17717
|
+
}
|
|
17718
|
+
function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
|
|
17719
|
+
const isSvg = filePath?.toLowerCase().endsWith(".svg") || fileUrl?.toLowerCase().endsWith(".svg") || fileName.toLowerCase().endsWith(".svg");
|
|
17720
|
+
if (isSvg && mediaTypeName === "Image") {
|
|
17721
|
+
console.warn("SVG detected - using Vector Graphic media type instead of Image");
|
|
17722
|
+
return "Vector Graphic (SVG)";
|
|
17493
17723
|
}
|
|
17494
|
-
|
|
17495
|
-
|
|
17496
|
-
|
|
17497
|
-
|
|
17498
|
-
|
|
17499
|
-
|
|
17500
|
-
|
|
17501
|
-
|
|
17502
|
-
|
|
17503
|
-
|
|
17504
|
-
|
|
17505
|
-
|
|
17506
|
-
|
|
17507
|
-
|
|
17508
|
-
|
|
17509
|
-
|
|
17510
|
-
|
|
17511
|
-
|
|
17724
|
+
return mediaTypeName;
|
|
17725
|
+
}
|
|
17726
|
+
async function fetchMediaTypeId(client, mediaTypeName) {
|
|
17727
|
+
const response = await client.getItemMediaTypeSearch({ query: mediaTypeName });
|
|
17728
|
+
const mediaType = response.items.find(
|
|
17729
|
+
(mt) => mt.name.toLowerCase() === mediaTypeName.toLowerCase()
|
|
17730
|
+
);
|
|
17731
|
+
if (!mediaType) {
|
|
17732
|
+
const availableTypes = response.items.map((mt) => mt.name).join(", ");
|
|
17733
|
+
throw new Error(
|
|
17734
|
+
`Media type '${mediaTypeName}' not found. Available types: ${availableTypes || "None found"}`
|
|
17735
|
+
);
|
|
17736
|
+
}
|
|
17737
|
+
return mediaType.id;
|
|
17738
|
+
}
|
|
17739
|
+
function getEditorAlias(mediaTypeName) {
|
|
17740
|
+
return mediaTypeName === "Image" ? "Umbraco.ImageCropper" : "Umbraco.UploadField";
|
|
17741
|
+
}
|
|
17742
|
+
function buildValueStructure(mediaTypeName, temporaryFileId) {
|
|
17743
|
+
const base = {
|
|
17744
|
+
alias: "umbracoFile",
|
|
17745
|
+
editorAlias: getEditorAlias(mediaTypeName),
|
|
17746
|
+
entityType: "media-property-value"
|
|
17747
|
+
};
|
|
17748
|
+
if (mediaTypeName === "Image") {
|
|
17749
|
+
return {
|
|
17750
|
+
...base,
|
|
17751
|
+
value: {
|
|
17752
|
+
crops: [],
|
|
17753
|
+
culture: null,
|
|
17754
|
+
segment: null,
|
|
17755
|
+
focalPoint: {
|
|
17756
|
+
top: 0.5,
|
|
17757
|
+
right: 0.5
|
|
17758
|
+
},
|
|
17759
|
+
temporaryFileId
|
|
17760
|
+
}
|
|
17512
17761
|
};
|
|
17513
17762
|
}
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
|
|
17518
|
-
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
|
|
17523
|
-
|
|
17524
|
-
|
|
17763
|
+
return {
|
|
17764
|
+
...base,
|
|
17765
|
+
value: { temporaryFileId }
|
|
17766
|
+
};
|
|
17767
|
+
}
|
|
17768
|
+
async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fileName, temporaryFileId) {
|
|
17769
|
+
let tempFilePath = null;
|
|
17770
|
+
let readStream;
|
|
17771
|
+
switch (sourceType) {
|
|
17772
|
+
case "filePath":
|
|
17773
|
+
if (!filePath) {
|
|
17774
|
+
throw new Error("filePath is required when sourceType is 'filePath'");
|
|
17775
|
+
}
|
|
17776
|
+
if (!fs.existsSync(filePath)) {
|
|
17777
|
+
throw new Error(`File not found: ${filePath}`);
|
|
17778
|
+
}
|
|
17779
|
+
readStream = fs.createReadStream(filePath);
|
|
17780
|
+
break;
|
|
17781
|
+
case "url":
|
|
17782
|
+
if (!fileUrl) {
|
|
17783
|
+
throw new Error("fileUrl is required when sourceType is 'url'");
|
|
17784
|
+
}
|
|
17785
|
+
try {
|
|
17786
|
+
const response = await axios.get(fileUrl, {
|
|
17787
|
+
responseType: "arraybuffer",
|
|
17788
|
+
timeout: 3e4,
|
|
17789
|
+
validateStatus: (status) => status < 500
|
|
17790
|
+
// Don't throw on 4xx errors
|
|
17791
|
+
});
|
|
17792
|
+
if (response.status >= 400) {
|
|
17793
|
+
throw new Error(`Failed to fetch file from URL: HTTP ${response.status} ${response.statusText}`);
|
|
17794
|
+
}
|
|
17795
|
+
let fileNameWithExtension = fileName;
|
|
17796
|
+
if (!fileName.includes(".")) {
|
|
17797
|
+
const urlPath = new URL(fileUrl).pathname;
|
|
17798
|
+
const urlExtension = path.extname(urlPath);
|
|
17799
|
+
if (urlExtension) {
|
|
17800
|
+
fileNameWithExtension = `${fileName}${urlExtension}`;
|
|
17801
|
+
} else {
|
|
17802
|
+
const contentType = response.headers["content-type"];
|
|
17803
|
+
const extensionFromMime = getExtensionFromMimeType(contentType);
|
|
17804
|
+
if (extensionFromMime) {
|
|
17805
|
+
fileNameWithExtension = `${fileName}${extensionFromMime}`;
|
|
17806
|
+
} else {
|
|
17807
|
+
fileNameWithExtension = `${fileName}.bin`;
|
|
17808
|
+
}
|
|
17809
|
+
}
|
|
17810
|
+
}
|
|
17811
|
+
tempFilePath = path.join(os.tmpdir(), fileNameWithExtension);
|
|
17812
|
+
fs.writeFileSync(tempFilePath, response.data);
|
|
17813
|
+
readStream = fs.createReadStream(tempFilePath);
|
|
17814
|
+
} catch (error) {
|
|
17815
|
+
const axiosError = error;
|
|
17816
|
+
if (axiosError.response) {
|
|
17817
|
+
throw new Error(`Failed to fetch URL: HTTP ${axiosError.response.status} - ${axiosError.response.statusText} (${fileUrl})`);
|
|
17818
|
+
} else if (axiosError.code === "ECONNABORTED") {
|
|
17819
|
+
throw new Error(`Request timeout after 30s fetching URL: ${fileUrl}`);
|
|
17820
|
+
} else if (axiosError.code) {
|
|
17821
|
+
throw new Error(`Network error (${axiosError.code}) fetching URL: ${fileUrl} - ${axiosError.message}`);
|
|
17822
|
+
}
|
|
17823
|
+
throw new Error(`Failed to fetch URL: ${fileUrl} - ${error.message}`);
|
|
17824
|
+
}
|
|
17825
|
+
break;
|
|
17826
|
+
case "base64":
|
|
17827
|
+
if (!fileAsBase64) {
|
|
17828
|
+
throw new Error("fileAsBase64 is required when sourceType is 'base64'");
|
|
17829
|
+
}
|
|
17830
|
+
const fileContent = Buffer.from(fileAsBase64, "base64");
|
|
17831
|
+
tempFilePath = path.join(os.tmpdir(), fileName);
|
|
17832
|
+
fs.writeFileSync(tempFilePath, fileContent);
|
|
17833
|
+
readStream = fs.createReadStream(tempFilePath);
|
|
17834
|
+
break;
|
|
17835
|
+
}
|
|
17836
|
+
return { readStream, tempFilePath };
|
|
17837
|
+
}
|
|
17838
|
+
function cleanupTempFile(tempFilePath) {
|
|
17839
|
+
if (tempFilePath && fs.existsSync(tempFilePath)) {
|
|
17840
|
+
try {
|
|
17841
|
+
fs.unlinkSync(tempFilePath);
|
|
17842
|
+
} catch (e) {
|
|
17843
|
+
console.error("Failed to cleanup temp file:", e);
|
|
17844
|
+
}
|
|
17845
|
+
}
|
|
17846
|
+
}
|
|
17847
|
+
async function uploadMediaFile(client, params) {
|
|
17848
|
+
let tempFilePath = null;
|
|
17849
|
+
try {
|
|
17850
|
+
const validatedMediaTypeName = validateMediaTypeForSvg(
|
|
17851
|
+
params.filePath,
|
|
17852
|
+
params.fileUrl,
|
|
17853
|
+
params.name,
|
|
17854
|
+
params.mediaTypeName
|
|
17855
|
+
);
|
|
17856
|
+
const mediaTypeId = await fetchMediaTypeId(client, validatedMediaTypeName);
|
|
17857
|
+
const { readStream, tempFilePath: createdTempPath } = await createFileStream(
|
|
17858
|
+
params.sourceType,
|
|
17859
|
+
params.filePath,
|
|
17860
|
+
params.fileUrl,
|
|
17861
|
+
params.fileAsBase64,
|
|
17862
|
+
params.name,
|
|
17863
|
+
params.temporaryFileId
|
|
17864
|
+
);
|
|
17865
|
+
tempFilePath = createdTempPath;
|
|
17866
|
+
try {
|
|
17867
|
+
await client.postTemporaryFile({
|
|
17868
|
+
Id: params.temporaryFileId,
|
|
17869
|
+
File: readStream
|
|
17870
|
+
});
|
|
17871
|
+
} catch (error) {
|
|
17872
|
+
const err = error;
|
|
17873
|
+
const errorData = err.response?.data ? typeof err.response.data === "string" ? err.response.data : JSON.stringify(err.response.data) : err.message;
|
|
17874
|
+
throw new Error(`Failed to upload temporary file: ${err.response?.status || "Unknown error"} - ${errorData}`);
|
|
17875
|
+
}
|
|
17876
|
+
const valueStructure = buildValueStructure(validatedMediaTypeName, params.temporaryFileId);
|
|
17877
|
+
try {
|
|
17878
|
+
await client.postMedia({
|
|
17879
|
+
mediaType: { id: mediaTypeId },
|
|
17880
|
+
variants: [
|
|
17881
|
+
{
|
|
17882
|
+
culture: null,
|
|
17883
|
+
segment: null,
|
|
17884
|
+
name: params.name
|
|
17885
|
+
// Use original name provided by user
|
|
17886
|
+
}
|
|
17887
|
+
],
|
|
17888
|
+
values: [valueStructure],
|
|
17889
|
+
parent: params.parentId ? { id: params.parentId } : null
|
|
17890
|
+
});
|
|
17891
|
+
} catch (error) {
|
|
17892
|
+
const err = error;
|
|
17893
|
+
throw new Error(`Failed to create media item: ${err.response?.status || "Unknown error"} - ${JSON.stringify(err.response?.data) || err.message}`);
|
|
17894
|
+
}
|
|
17895
|
+
return params.name;
|
|
17896
|
+
} finally {
|
|
17897
|
+
cleanupTempFile(tempFilePath);
|
|
17898
|
+
}
|
|
17899
|
+
}
|
|
17900
|
+
|
|
17901
|
+
// src/umb-management-api/tools/media/post/create-media.ts
|
|
17902
|
+
var createMediaSchema = z33.object({
|
|
17903
|
+
sourceType: z33.enum(["filePath", "url", "base64"]).describe("Media source type: 'filePath' for local files (most efficient), 'url' for web files, 'base64' for embedded data (small files only)"),
|
|
17904
|
+
name: z33.string().describe("The name of the media item"),
|
|
17905
|
+
mediaTypeName: z33.string().describe("Media type: 'Image', 'Article', 'Audio', 'Video', 'Vector Graphic (SVG)', 'File', or custom media type name"),
|
|
17906
|
+
filePath: z33.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17907
|
+
fileUrl: z33.string().url().optional().describe("URL to fetch the file from (required if sourceType is 'url')"),
|
|
17908
|
+
fileAsBase64: z33.string().optional().describe("Base64 encoded file data (required if sourceType is 'base64')"),
|
|
17909
|
+
parentId: z33.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
17910
|
+
});
|
|
17911
|
+
var CreateMediaTool = CreateUmbracoTool(
|
|
17912
|
+
"create-media",
|
|
17913
|
+
`Upload any media file to Umbraco (images, documents, audio, video, SVG, or custom types).
|
|
17914
|
+
|
|
17915
|
+
Media Types:
|
|
17916
|
+
- Image: jpg, png, gif, webp, etc. (supports cropping)
|
|
17917
|
+
- Article: pdf, docx, doc (documents)
|
|
17918
|
+
- Audio: mp3, wav, etc.
|
|
17919
|
+
- Video: mp4, webm, etc.
|
|
17920
|
+
- Vector Graphic (SVG): svg files only
|
|
17921
|
+
- File: any other file type
|
|
17922
|
+
- Custom: any custom media type created in Umbraco
|
|
17923
|
+
|
|
17924
|
+
Source Types:
|
|
17925
|
+
1. filePath - Most efficient for local files, works with any size
|
|
17926
|
+
2. url - Fetch from web URL
|
|
17927
|
+
3. base64 - Only for small files (<10KB) due to token usage
|
|
17928
|
+
|
|
17929
|
+
The tool automatically:
|
|
17930
|
+
- Creates temporary files
|
|
17931
|
+
- Detects and validates media types (auto-corrects SVG vs Image)
|
|
17932
|
+
- Configures correct property editors (ImageCropper vs UploadField)
|
|
17933
|
+
- Cleans up temporary files`,
|
|
17934
|
+
createMediaSchema.shape,
|
|
17935
|
+
async (model) => {
|
|
17936
|
+
try {
|
|
17937
|
+
const client = UmbracoManagementClient2.getClient();
|
|
17938
|
+
const temporaryFileId = uuidv45();
|
|
17939
|
+
const actualName = await uploadMediaFile(client, {
|
|
17940
|
+
sourceType: model.sourceType,
|
|
17941
|
+
name: model.name,
|
|
17942
|
+
mediaTypeName: model.mediaTypeName,
|
|
17943
|
+
filePath: model.filePath,
|
|
17944
|
+
fileUrl: model.fileUrl,
|
|
17945
|
+
fileAsBase64: model.fileAsBase64,
|
|
17946
|
+
parentId: model.parentId,
|
|
17947
|
+
temporaryFileId
|
|
17948
|
+
});
|
|
17949
|
+
return {
|
|
17950
|
+
content: [
|
|
17951
|
+
{
|
|
17952
|
+
type: "text",
|
|
17953
|
+
text: `Media "${actualName}" created successfully`
|
|
17954
|
+
}
|
|
17955
|
+
]
|
|
17956
|
+
};
|
|
17957
|
+
} catch (error) {
|
|
17958
|
+
return {
|
|
17959
|
+
content: [
|
|
17960
|
+
{
|
|
17961
|
+
type: "text",
|
|
17962
|
+
text: `Error creating media: ${error.message}`
|
|
17963
|
+
}
|
|
17964
|
+
],
|
|
17965
|
+
isError: true
|
|
17966
|
+
};
|
|
17967
|
+
}
|
|
17968
|
+
}
|
|
17969
|
+
);
|
|
17970
|
+
var create_media_default = CreateMediaTool;
|
|
17971
|
+
|
|
17972
|
+
// src/umb-management-api/tools/media/post/create-media-multiple.ts
|
|
17973
|
+
import { z as z34 } from "zod";
|
|
17974
|
+
import { v4 as uuidv46 } from "uuid";
|
|
17975
|
+
var createMediaMultipleSchema = z34.object({
|
|
17976
|
+
sourceType: z34.enum(["filePath", "url"]).describe("Media source type: 'filePath' for local files (most efficient), 'url' for web files. Base64 not supported for batch uploads due to token usage."),
|
|
17977
|
+
files: z34.array(z34.object({
|
|
17978
|
+
name: z34.string().describe("The name of the media item"),
|
|
17979
|
+
filePath: z34.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17980
|
+
fileUrl: z34.string().url().optional().describe("URL to fetch the file from (required if sourceType is 'url')"),
|
|
17981
|
+
mediaTypeName: z34.string().optional().describe("Optional override: 'Image', 'Article', 'Audio', 'Video', 'Vector Graphic (SVG)', 'File', or custom media type name. If not specified, defaults to 'File'")
|
|
17982
|
+
})).describe("Array of files to upload (maximum 20 files per batch)"),
|
|
17983
|
+
parentId: z34.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
17984
|
+
});
|
|
17985
|
+
var CreateMediaMultipleTool = CreateUmbracoTool(
|
|
17986
|
+
"create-media-multiple",
|
|
17987
|
+
`Batch upload multiple media files to Umbraco (maximum 20 files per batch).
|
|
17988
|
+
|
|
17989
|
+
Supports any file type: images, documents, audio, video, SVG, or custom types.
|
|
17990
|
+
|
|
17991
|
+
Source Types:
|
|
17992
|
+
1. filePath - Most efficient for local files, works with any size
|
|
17993
|
+
2. url - Fetch from web URL
|
|
17994
|
+
|
|
17995
|
+
Note: base64 is not supported for batch uploads due to token usage.
|
|
17996
|
+
|
|
17997
|
+
The tool processes files sequentially and returns detailed results for each file.
|
|
17998
|
+
If some files fail, others will continue processing (continue-on-error strategy).`,
|
|
17999
|
+
createMediaMultipleSchema.shape,
|
|
18000
|
+
async (model) => {
|
|
18001
|
+
if (model.files.length > 20) {
|
|
18002
|
+
return {
|
|
18003
|
+
content: [{
|
|
18004
|
+
type: "text",
|
|
18005
|
+
text: `Batch upload limited to 20 files per call. You provided ${model.files.length} files. Please split into multiple batches.`
|
|
18006
|
+
}],
|
|
18007
|
+
isError: true
|
|
18008
|
+
};
|
|
18009
|
+
}
|
|
18010
|
+
const results = [];
|
|
18011
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18012
|
+
for (const file of model.files) {
|
|
18013
|
+
try {
|
|
18014
|
+
const temporaryFileId = uuidv46();
|
|
18015
|
+
const defaultMediaType = file.mediaTypeName || "File";
|
|
18016
|
+
const actualName = await uploadMediaFile(client, {
|
|
18017
|
+
sourceType: model.sourceType,
|
|
18018
|
+
name: file.name,
|
|
18019
|
+
mediaTypeName: defaultMediaType,
|
|
18020
|
+
filePath: file.filePath,
|
|
18021
|
+
fileUrl: file.fileUrl,
|
|
18022
|
+
fileAsBase64: void 0,
|
|
18023
|
+
parentId: model.parentId,
|
|
18024
|
+
temporaryFileId
|
|
18025
|
+
});
|
|
18026
|
+
results.push({
|
|
18027
|
+
success: true,
|
|
18028
|
+
name: actualName
|
|
18029
|
+
});
|
|
18030
|
+
} catch (error) {
|
|
18031
|
+
results.push({
|
|
18032
|
+
success: false,
|
|
18033
|
+
name: file.name,
|
|
18034
|
+
error: error.message
|
|
18035
|
+
});
|
|
18036
|
+
}
|
|
18037
|
+
}
|
|
18038
|
+
const successCount = results.filter((r) => r.success).length;
|
|
18039
|
+
const failureCount = results.filter((r) => !r.success).length;
|
|
18040
|
+
return {
|
|
18041
|
+
content: [
|
|
18042
|
+
{
|
|
18043
|
+
type: "text",
|
|
18044
|
+
text: JSON.stringify({
|
|
18045
|
+
summary: `Processed ${model.files.length} files: ${successCount} succeeded, ${failureCount} failed`,
|
|
18046
|
+
results
|
|
18047
|
+
}, null, 2)
|
|
18048
|
+
}
|
|
18049
|
+
]
|
|
18050
|
+
};
|
|
18051
|
+
}
|
|
18052
|
+
);
|
|
18053
|
+
var create_media_multiple_default = CreateMediaMultipleTool;
|
|
18054
|
+
|
|
18055
|
+
// src/umb-management-api/tools/media/delete/delete-media.ts
|
|
18056
|
+
var DeleteMediaTool = CreateUmbracoTool(
|
|
18057
|
+
"delete-media",
|
|
18058
|
+
"Deletes a media item by Id",
|
|
18059
|
+
deleteMediaByIdParams.shape,
|
|
18060
|
+
async ({ id }) => {
|
|
18061
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18062
|
+
const response = await client.deleteMediaById(id);
|
|
18063
|
+
return {
|
|
18064
|
+
content: [
|
|
18065
|
+
{
|
|
18066
|
+
type: "text",
|
|
18067
|
+
text: JSON.stringify(response)
|
|
18068
|
+
}
|
|
18069
|
+
]
|
|
18070
|
+
};
|
|
18071
|
+
}
|
|
18072
|
+
);
|
|
18073
|
+
var delete_media_default = DeleteMediaTool;
|
|
18074
|
+
|
|
18075
|
+
// src/umb-management-api/tools/media/get/get-media-by-id.ts
|
|
18076
|
+
var GetMediaByIdTool = CreateUmbracoTool(
|
|
18077
|
+
"get-media-by-id",
|
|
18078
|
+
`Gets a media item by id
|
|
18079
|
+
Use this to retrieve existing media items.`,
|
|
18080
|
+
getMediaByIdParams.shape,
|
|
18081
|
+
async ({ id }) => {
|
|
18082
|
+
const client = UmbracoManagementClient2.getClient();
|
|
17525
18083
|
const response = await client.getMediaById(id);
|
|
17526
18084
|
return {
|
|
17527
18085
|
content: [
|
|
@@ -17536,7 +18094,7 @@ var GetMediaByIdTool = CreateUmbracoTool(
|
|
|
17536
18094
|
var get_media_by_id_default = GetMediaByIdTool;
|
|
17537
18095
|
|
|
17538
18096
|
// src/umb-management-api/tools/media/put/update-media.ts
|
|
17539
|
-
import { z as
|
|
18097
|
+
import { z as z35 } from "zod";
|
|
17540
18098
|
var UpdateMediaTool = CreateUmbracoTool(
|
|
17541
18099
|
"update-media",
|
|
17542
18100
|
`Updates a media item by Id
|
|
@@ -17545,7 +18103,7 @@ var UpdateMediaTool = CreateUmbracoTool(
|
|
|
17545
18103
|
This cannot be used for moving media to a new folder. Use the move endpoint to do that`,
|
|
17546
18104
|
{
|
|
17547
18105
|
id: putMediaByIdParams.shape.id,
|
|
17548
|
-
data:
|
|
18106
|
+
data: z35.object(putMediaByIdBody.shape)
|
|
17549
18107
|
},
|
|
17550
18108
|
async (model) => {
|
|
17551
18109
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17665,13 +18223,13 @@ var GetMediaByIdArrayTool = CreateUmbracoTool(
|
|
|
17665
18223
|
var get_media_by_id_array_default = GetMediaByIdArrayTool;
|
|
17666
18224
|
|
|
17667
18225
|
// src/umb-management-api/tools/media/put/move-media.ts
|
|
17668
|
-
import { z as
|
|
18226
|
+
import { z as z36 } from "zod";
|
|
17669
18227
|
var MoveMediaTool = CreateUmbracoTool(
|
|
17670
18228
|
"move-media",
|
|
17671
18229
|
"Move a media item to a new location",
|
|
17672
18230
|
{
|
|
17673
|
-
id:
|
|
17674
|
-
data:
|
|
18231
|
+
id: z36.string().uuid(),
|
|
18232
|
+
data: z36.object(putMediaByIdMoveBody.shape)
|
|
17675
18233
|
},
|
|
17676
18234
|
async (model) => {
|
|
17677
18235
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17749,13 +18307,13 @@ var GetMediaRootTool = CreateUmbracoTool(
|
|
|
17749
18307
|
var get_root_default6 = GetMediaRootTool;
|
|
17750
18308
|
|
|
17751
18309
|
// src/umb-management-api/tools/media/get/get-media-audit-log.ts
|
|
17752
|
-
import { z as
|
|
18310
|
+
import { z as z37 } from "zod";
|
|
17753
18311
|
var GetMediaAuditLogTool = CreateUmbracoTool(
|
|
17754
18312
|
"get-media-audit-log",
|
|
17755
18313
|
"Fetches the audit log for a media item by Id.",
|
|
17756
18314
|
{
|
|
17757
18315
|
id: getMediaByIdAuditLogParams.shape.id,
|
|
17758
|
-
data:
|
|
18316
|
+
data: z37.object(getMediaByIdAuditLogQueryParams.shape)
|
|
17759
18317
|
},
|
|
17760
18318
|
async (model) => {
|
|
17761
18319
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -17894,6 +18452,153 @@ var DeleteFromRecycleBinTool2 = CreateUmbracoTool(
|
|
|
17894
18452
|
);
|
|
17895
18453
|
var delete_from_recycle_bin_default2 = DeleteFromRecycleBinTool2;
|
|
17896
18454
|
|
|
18455
|
+
// src/umb-management-api/tools/media/get/get-media-are-referenced.ts
|
|
18456
|
+
var GetMediaAreReferencedTool = CreateUmbracoTool(
|
|
18457
|
+
"get-media-are-referenced",
|
|
18458
|
+
`Check if media items are referenced
|
|
18459
|
+
Use this to verify if specific media items are being referenced by other content before deletion or modification.`,
|
|
18460
|
+
getMediaAreReferencedQueryParams.shape,
|
|
18461
|
+
async ({ id, skip, take }) => {
|
|
18462
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18463
|
+
const response = await client.getMediaAreReferenced({ id, skip, take });
|
|
18464
|
+
return {
|
|
18465
|
+
content: [
|
|
18466
|
+
{
|
|
18467
|
+
type: "text",
|
|
18468
|
+
text: JSON.stringify(response)
|
|
18469
|
+
}
|
|
18470
|
+
]
|
|
18471
|
+
};
|
|
18472
|
+
}
|
|
18473
|
+
);
|
|
18474
|
+
var get_media_are_referenced_default = GetMediaAreReferencedTool;
|
|
18475
|
+
|
|
18476
|
+
// src/umb-management-api/tools/media/get/get-media-by-id-referenced-by.ts
|
|
18477
|
+
import { z as z38 } from "zod";
|
|
18478
|
+
var GetMediaByIdReferencedByTool = CreateUmbracoTool(
|
|
18479
|
+
"get-media-by-id-referenced-by",
|
|
18480
|
+
`Get items that reference a specific media item
|
|
18481
|
+
Use this to find all content, documents, or other items that are currently referencing a specific media item.`,
|
|
18482
|
+
z38.object({
|
|
18483
|
+
...getMediaByIdReferencedByParams.shape,
|
|
18484
|
+
...getMediaByIdReferencedByQueryParams.shape
|
|
18485
|
+
}).shape,
|
|
18486
|
+
async ({ id, skip, take }) => {
|
|
18487
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18488
|
+
const response = await client.getMediaByIdReferencedBy(id, { skip, take });
|
|
18489
|
+
return {
|
|
18490
|
+
content: [
|
|
18491
|
+
{
|
|
18492
|
+
type: "text",
|
|
18493
|
+
text: JSON.stringify(response)
|
|
18494
|
+
}
|
|
18495
|
+
]
|
|
18496
|
+
};
|
|
18497
|
+
}
|
|
18498
|
+
);
|
|
18499
|
+
var get_media_by_id_referenced_by_default = GetMediaByIdReferencedByTool;
|
|
18500
|
+
|
|
18501
|
+
// src/umb-management-api/tools/media/get/get-media-by-id-referenced-descendants.ts
|
|
18502
|
+
import { z as z39 } from "zod";
|
|
18503
|
+
var GetMediaByIdReferencedDescendantsTool = CreateUmbracoTool(
|
|
18504
|
+
"get-media-by-id-referenced-descendants",
|
|
18505
|
+
`Get descendant references for a media item
|
|
18506
|
+
Use this to find all descendant references (child items) that are being referenced for a specific media item.
|
|
18507
|
+
|
|
18508
|
+
Useful for:
|
|
18509
|
+
\u2022 Impact analysis: Before deleting a media folder, see what content would be affected
|
|
18510
|
+
\u2022 Dependency tracking: Find all content using media from a specific folder hierarchy
|
|
18511
|
+
\u2022 Content auditing: Identify which descendant media items are actually being used`,
|
|
18512
|
+
z39.object({
|
|
18513
|
+
...getMediaByIdReferencedDescendantsParams.shape,
|
|
18514
|
+
...getMediaByIdReferencedDescendantsQueryParams.shape
|
|
18515
|
+
}).shape,
|
|
18516
|
+
async ({ id, skip, take }) => {
|
|
18517
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18518
|
+
const response = await client.getMediaByIdReferencedDescendants(id, { skip, take });
|
|
18519
|
+
return {
|
|
18520
|
+
content: [
|
|
18521
|
+
{
|
|
18522
|
+
type: "text",
|
|
18523
|
+
text: JSON.stringify(response)
|
|
18524
|
+
}
|
|
18525
|
+
]
|
|
18526
|
+
};
|
|
18527
|
+
}
|
|
18528
|
+
);
|
|
18529
|
+
var get_media_by_id_referenced_descendants_default = GetMediaByIdReferencedDescendantsTool;
|
|
18530
|
+
|
|
18531
|
+
// src/umb-management-api/tools/media/get/get-collection-media.ts
|
|
18532
|
+
var GetCollectionMediaTool = CreateUmbracoTool(
|
|
18533
|
+
"get-collection-media",
|
|
18534
|
+
`Get a collection of media items
|
|
18535
|
+
Use this to retrieve a filtered and paginated collection of media items based on various criteria like data type, ordering, and filtering.`,
|
|
18536
|
+
getCollectionMediaQueryParams.shape,
|
|
18537
|
+
async ({ id, dataTypeId, orderBy, orderDirection, filter, skip, take }) => {
|
|
18538
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18539
|
+
const response = await client.getCollectionMedia({
|
|
18540
|
+
id,
|
|
18541
|
+
dataTypeId,
|
|
18542
|
+
orderBy,
|
|
18543
|
+
orderDirection,
|
|
18544
|
+
filter,
|
|
18545
|
+
skip,
|
|
18546
|
+
take
|
|
18547
|
+
});
|
|
18548
|
+
return {
|
|
18549
|
+
content: [
|
|
18550
|
+
{
|
|
18551
|
+
type: "text",
|
|
18552
|
+
text: JSON.stringify(response)
|
|
18553
|
+
}
|
|
18554
|
+
]
|
|
18555
|
+
};
|
|
18556
|
+
}
|
|
18557
|
+
);
|
|
18558
|
+
var get_collection_media_default = GetCollectionMediaTool;
|
|
18559
|
+
|
|
18560
|
+
// src/umb-management-api/tools/media/get/get-recycle-bin-media-referenced-by.ts
|
|
18561
|
+
var GetRecycleBinMediaReferencedByTool = CreateUmbracoTool(
|
|
18562
|
+
"get-recycle-bin-media-referenced-by",
|
|
18563
|
+
`Get references to deleted media items in the recycle bin
|
|
18564
|
+
Use this to find content that still references deleted media items before permanently deleting them.`,
|
|
18565
|
+
getRecycleBinMediaReferencedByQueryParams.shape,
|
|
18566
|
+
async ({ skip, take }) => {
|
|
18567
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18568
|
+
const response = await client.getRecycleBinMediaReferencedBy({ skip, take });
|
|
18569
|
+
return {
|
|
18570
|
+
content: [
|
|
18571
|
+
{
|
|
18572
|
+
type: "text",
|
|
18573
|
+
text: JSON.stringify(response)
|
|
18574
|
+
}
|
|
18575
|
+
]
|
|
18576
|
+
};
|
|
18577
|
+
}
|
|
18578
|
+
);
|
|
18579
|
+
var get_recycle_bin_media_referenced_by_default = GetRecycleBinMediaReferencedByTool;
|
|
18580
|
+
|
|
18581
|
+
// src/umb-management-api/tools/media/get/get-recycle-bin-media-original-parent.ts
|
|
18582
|
+
var GetRecycleBinMediaOriginalParentTool = CreateUmbracoTool(
|
|
18583
|
+
"get-recycle-bin-media-original-parent",
|
|
18584
|
+
`Get the original parent location of a media item in the recycle bin
|
|
18585
|
+
Returns information about where the media item was located before deletion.`,
|
|
18586
|
+
getRecycleBinMediaByIdOriginalParentParams.shape,
|
|
18587
|
+
async ({ id }) => {
|
|
18588
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18589
|
+
const response = await client.getRecycleBinMediaByIdOriginalParent(id);
|
|
18590
|
+
return {
|
|
18591
|
+
content: [
|
|
18592
|
+
{
|
|
18593
|
+
type: "text",
|
|
18594
|
+
text: JSON.stringify(response)
|
|
18595
|
+
}
|
|
18596
|
+
]
|
|
18597
|
+
};
|
|
18598
|
+
}
|
|
18599
|
+
);
|
|
18600
|
+
var get_recycle_bin_media_original_parent_default = GetRecycleBinMediaOriginalParentTool;
|
|
18601
|
+
|
|
17897
18602
|
// src/umb-management-api/tools/media/index.ts
|
|
17898
18603
|
var MediaCollection = {
|
|
17899
18604
|
metadata: {
|
|
@@ -17912,6 +18617,7 @@ var MediaCollection = {
|
|
|
17912
18617
|
}
|
|
17913
18618
|
if (AuthorizationPolicies.SectionAccessMedia(user)) {
|
|
17914
18619
|
tools.push(create_media_default());
|
|
18620
|
+
tools.push(create_media_multiple_default());
|
|
17915
18621
|
tools.push(delete_media_default());
|
|
17916
18622
|
tools.push(update_media_default());
|
|
17917
18623
|
tools.push(get_media_configuration_default());
|
|
@@ -17927,6 +18633,12 @@ var MediaCollection = {
|
|
|
17927
18633
|
tools.push(restore_from_recycle_bin_default());
|
|
17928
18634
|
tools.push(move_to_recycle_bin_default2());
|
|
17929
18635
|
tools.push(delete_from_recycle_bin_default2());
|
|
18636
|
+
tools.push(get_media_are_referenced_default());
|
|
18637
|
+
tools.push(get_media_by_id_referenced_by_default());
|
|
18638
|
+
tools.push(get_media_by_id_referenced_descendants_default());
|
|
18639
|
+
tools.push(get_collection_media_default());
|
|
18640
|
+
tools.push(get_recycle_bin_media_referenced_by_default());
|
|
18641
|
+
tools.push(get_recycle_bin_media_original_parent_default());
|
|
17930
18642
|
}
|
|
17931
18643
|
return tools;
|
|
17932
18644
|
}
|
|
@@ -17973,12 +18685,12 @@ var GetMediaTypeByIdTool = CreateUmbracoTool(
|
|
|
17973
18685
|
var get_media_type_by_id_default = GetMediaTypeByIdTool;
|
|
17974
18686
|
|
|
17975
18687
|
// src/umb-management-api/tools/media-type/get/get-media-type-by-ids.ts
|
|
17976
|
-
import { z as
|
|
18688
|
+
import { z as z40 } from "zod";
|
|
17977
18689
|
var GetMediaTypeByIdsTool = CreateUmbracoTool(
|
|
17978
18690
|
"get-media-type-by-ids",
|
|
17979
18691
|
"Gets media types by ids",
|
|
17980
18692
|
{
|
|
17981
|
-
ids:
|
|
18693
|
+
ids: z40.array(z40.string())
|
|
17982
18694
|
},
|
|
17983
18695
|
async ({ ids }) => {
|
|
17984
18696
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18143,6 +18855,26 @@ var GetMediaTypeAncestorsTool = CreateUmbracoTool(
|
|
|
18143
18855
|
);
|
|
18144
18856
|
var get_ancestors_default7 = GetMediaTypeAncestorsTool;
|
|
18145
18857
|
|
|
18858
|
+
// src/umb-management-api/tools/media-type/items/get/get-media-type-folders.ts
|
|
18859
|
+
var GetMediaTypeFoldersTool = CreateUmbracoTool(
|
|
18860
|
+
"get-media-type-folders",
|
|
18861
|
+
"Lists media type folders with pagination support",
|
|
18862
|
+
getItemMediaTypeFoldersQueryParams.shape,
|
|
18863
|
+
async (params) => {
|
|
18864
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18865
|
+
const response = await client.getItemMediaTypeFolders(params);
|
|
18866
|
+
return {
|
|
18867
|
+
content: [
|
|
18868
|
+
{
|
|
18869
|
+
type: "text",
|
|
18870
|
+
text: JSON.stringify(response)
|
|
18871
|
+
}
|
|
18872
|
+
]
|
|
18873
|
+
};
|
|
18874
|
+
}
|
|
18875
|
+
);
|
|
18876
|
+
var get_media_type_folders_default = GetMediaTypeFoldersTool;
|
|
18877
|
+
|
|
18146
18878
|
// src/umb-management-api/tools/media-type/folders/get/get-folder.ts
|
|
18147
18879
|
var GetMediaTypeFolderTool = CreateUmbracoTool(
|
|
18148
18880
|
"get-media-type-folder",
|
|
@@ -18204,13 +18936,13 @@ var DeleteMediaTypeFolderTool = CreateUmbracoTool(
|
|
|
18204
18936
|
var delete_folder_default3 = DeleteMediaTypeFolderTool;
|
|
18205
18937
|
|
|
18206
18938
|
// src/umb-management-api/tools/media-type/folders/put/update-folder.ts
|
|
18207
|
-
import { z as
|
|
18939
|
+
import { z as z41 } from "zod";
|
|
18208
18940
|
var UpdateMediaTypeFolderTool = CreateUmbracoTool(
|
|
18209
18941
|
"update-media-type-folder",
|
|
18210
18942
|
"Updates a media type folder by Id",
|
|
18211
18943
|
{
|
|
18212
18944
|
id: putMediaTypeFolderByIdParams.shape.id,
|
|
18213
|
-
data:
|
|
18945
|
+
data: z41.object(putMediaTypeFolderByIdBody.shape)
|
|
18214
18946
|
},
|
|
18215
18947
|
async (model) => {
|
|
18216
18948
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18248,13 +18980,13 @@ var CreateMediaTypeTool = CreateUmbracoTool(
|
|
|
18248
18980
|
var create_media_type_default = CreateMediaTypeTool;
|
|
18249
18981
|
|
|
18250
18982
|
// src/umb-management-api/tools/media-type/post/copy-media-type.ts
|
|
18251
|
-
import { z as
|
|
18983
|
+
import { z as z42 } from "zod";
|
|
18252
18984
|
var CopyMediaTypeTool = CreateUmbracoTool(
|
|
18253
18985
|
"copy-media-type",
|
|
18254
18986
|
"Copy a media type to a new location",
|
|
18255
18987
|
{
|
|
18256
|
-
id:
|
|
18257
|
-
data:
|
|
18988
|
+
id: z42.string().uuid(),
|
|
18989
|
+
data: z42.object(postMediaTypeByIdCopyBody.shape)
|
|
18258
18990
|
},
|
|
18259
18991
|
async (model) => {
|
|
18260
18992
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18292,13 +19024,13 @@ var GetMediaTypeAvailableCompositionsTool = CreateUmbracoTool(
|
|
|
18292
19024
|
var get_media_type_available_compositions_default = GetMediaTypeAvailableCompositionsTool;
|
|
18293
19025
|
|
|
18294
19026
|
// src/umb-management-api/tools/media-type/put/update-media-type.ts
|
|
18295
|
-
import { z as
|
|
19027
|
+
import { z as z43 } from "zod";
|
|
18296
19028
|
var UpdateMediaTypeTool = CreateUmbracoTool(
|
|
18297
19029
|
"update-media-type",
|
|
18298
19030
|
"Updates a media type by Id",
|
|
18299
19031
|
{
|
|
18300
19032
|
id: putMediaTypeByIdParams.shape.id,
|
|
18301
|
-
data:
|
|
19033
|
+
data: z43.object(putMediaTypeByIdBody.shape)
|
|
18302
19034
|
},
|
|
18303
19035
|
async (model) => {
|
|
18304
19036
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18316,13 +19048,13 @@ var UpdateMediaTypeTool = CreateUmbracoTool(
|
|
|
18316
19048
|
var update_media_type_default = UpdateMediaTypeTool;
|
|
18317
19049
|
|
|
18318
19050
|
// src/umb-management-api/tools/media-type/put/move-media-type.ts
|
|
18319
|
-
import { z as
|
|
19051
|
+
import { z as z44 } from "zod";
|
|
18320
19052
|
var MoveMediaTypeTool = CreateUmbracoTool(
|
|
18321
19053
|
"move-media-type",
|
|
18322
19054
|
"Move a media type to a new location",
|
|
18323
19055
|
{
|
|
18324
|
-
id:
|
|
18325
|
-
data:
|
|
19056
|
+
id: z44.string().uuid(),
|
|
19057
|
+
data: z44.object(putMediaTypeByIdMoveBody.shape)
|
|
18326
19058
|
},
|
|
18327
19059
|
async (model) => {
|
|
18328
19060
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18383,6 +19115,7 @@ var MediaTypeCollection = {
|
|
|
18383
19115
|
tools.push(get_root_default7());
|
|
18384
19116
|
tools.push(get_children_default7());
|
|
18385
19117
|
tools.push(get_ancestors_default7());
|
|
19118
|
+
tools.push(get_media_type_folders_default());
|
|
18386
19119
|
}
|
|
18387
19120
|
if (AuthorizationPolicies.TreeAccessMediaOrMediaTypes(user)) {
|
|
18388
19121
|
tools.push(get_media_type_by_id_default());
|
|
@@ -18438,6 +19171,27 @@ var CreateMemberTool = CreateUmbracoTool(
|
|
|
18438
19171
|
);
|
|
18439
19172
|
var create_member_default = CreateMemberTool;
|
|
18440
19173
|
|
|
19174
|
+
// src/umb-management-api/tools/member/post/validate-member.ts
|
|
19175
|
+
var ValidateMemberTool = CreateUmbracoTool(
|
|
19176
|
+
"validate-member",
|
|
19177
|
+
`Validates member data before creation using the Umbraco API.
|
|
19178
|
+
Use this endpoint to validate member data structure, properties, and business rules before attempting to create a new member.`,
|
|
19179
|
+
postMemberValidateBody.shape,
|
|
19180
|
+
async (model) => {
|
|
19181
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19182
|
+
const response = await client.postMemberValidate(model);
|
|
19183
|
+
return {
|
|
19184
|
+
content: [
|
|
19185
|
+
{
|
|
19186
|
+
type: "text",
|
|
19187
|
+
text: JSON.stringify(response)
|
|
19188
|
+
}
|
|
19189
|
+
]
|
|
19190
|
+
};
|
|
19191
|
+
}
|
|
19192
|
+
);
|
|
19193
|
+
var validate_member_default = ValidateMemberTool;
|
|
19194
|
+
|
|
18441
19195
|
// src/umb-management-api/tools/member/delete/delete-member.ts
|
|
18442
19196
|
var DeleteMemberTool = CreateUmbracoTool(
|
|
18443
19197
|
"delete-member",
|
|
@@ -18459,13 +19213,13 @@ var DeleteMemberTool = CreateUmbracoTool(
|
|
|
18459
19213
|
var delete_member_default = DeleteMemberTool;
|
|
18460
19214
|
|
|
18461
19215
|
// src/umb-management-api/tools/member/put/update-member.ts
|
|
18462
|
-
import { z as
|
|
19216
|
+
import { z as z45 } from "zod";
|
|
18463
19217
|
var UpdateMemberTool = CreateUmbracoTool(
|
|
18464
19218
|
"update-member",
|
|
18465
19219
|
"Updates a member by Id",
|
|
18466
19220
|
{
|
|
18467
19221
|
id: putMemberByIdParams.shape.id,
|
|
18468
|
-
data:
|
|
19222
|
+
data: z45.object(putMemberByIdBody.shape)
|
|
18469
19223
|
},
|
|
18470
19224
|
async (model) => {
|
|
18471
19225
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18482,14 +19236,19 @@ var UpdateMemberTool = CreateUmbracoTool(
|
|
|
18482
19236
|
);
|
|
18483
19237
|
var update_member_default = UpdateMemberTool;
|
|
18484
19238
|
|
|
18485
|
-
// src/umb-management-api/tools/member/
|
|
18486
|
-
|
|
18487
|
-
|
|
18488
|
-
|
|
18489
|
-
|
|
19239
|
+
// src/umb-management-api/tools/member/put/validate-member-update.ts
|
|
19240
|
+
import { z as z46 } from "zod";
|
|
19241
|
+
var ValidateMemberUpdateTool = CreateUmbracoTool(
|
|
19242
|
+
"validate-member-update",
|
|
19243
|
+
`Validates member data before updating using the Umbraco API.
|
|
19244
|
+
Use this endpoint to validate member data structure, properties, and business rules before attempting to update an existing member.`,
|
|
19245
|
+
{
|
|
19246
|
+
id: putMemberByIdValidateParams.shape.id,
|
|
19247
|
+
data: z46.object(putMemberByIdValidateBody.shape)
|
|
19248
|
+
},
|
|
18490
19249
|
async (model) => {
|
|
18491
19250
|
const client = UmbracoManagementClient2.getClient();
|
|
18492
|
-
|
|
19251
|
+
const response = await client.putMemberByIdValidate(model.id, model.data);
|
|
18493
19252
|
return {
|
|
18494
19253
|
content: [
|
|
18495
19254
|
{
|
|
@@ -18500,10 +19259,101 @@ var FindMemberTool = CreateUmbracoTool(
|
|
|
18500
19259
|
};
|
|
18501
19260
|
}
|
|
18502
19261
|
);
|
|
18503
|
-
var
|
|
19262
|
+
var validate_member_update_default = ValidateMemberUpdateTool;
|
|
18504
19263
|
|
|
18505
|
-
// src/umb-management-api/tools/member/
|
|
18506
|
-
var
|
|
19264
|
+
// src/umb-management-api/tools/member/get/find-member.ts
|
|
19265
|
+
var FindMemberTool = CreateUmbracoTool(
|
|
19266
|
+
"find-member",
|
|
19267
|
+
`Finds members by various filter criteria`,
|
|
19268
|
+
getFilterMemberQueryParams.shape,
|
|
19269
|
+
async (model) => {
|
|
19270
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19271
|
+
var response = await client.getFilterMember(model);
|
|
19272
|
+
return {
|
|
19273
|
+
content: [
|
|
19274
|
+
{
|
|
19275
|
+
type: "text",
|
|
19276
|
+
text: JSON.stringify(response)
|
|
19277
|
+
}
|
|
19278
|
+
]
|
|
19279
|
+
};
|
|
19280
|
+
}
|
|
19281
|
+
);
|
|
19282
|
+
var find_member_default = FindMemberTool;
|
|
19283
|
+
|
|
19284
|
+
// src/umb-management-api/tools/member/get/get-member-are-referenced.ts
|
|
19285
|
+
var GetMemberAreReferencedTool = CreateUmbracoTool(
|
|
19286
|
+
"get-member-are-referenced",
|
|
19287
|
+
`Check if member accounts are referenced
|
|
19288
|
+
Use this to verify if specific member accounts are being referenced by content.`,
|
|
19289
|
+
getMemberAreReferencedQueryParams.shape,
|
|
19290
|
+
async ({ id, skip, take }) => {
|
|
19291
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19292
|
+
const response = await client.getMemberAreReferenced({ id, skip, take });
|
|
19293
|
+
return {
|
|
19294
|
+
content: [
|
|
19295
|
+
{
|
|
19296
|
+
type: "text",
|
|
19297
|
+
text: JSON.stringify(response)
|
|
19298
|
+
}
|
|
19299
|
+
]
|
|
19300
|
+
};
|
|
19301
|
+
}
|
|
19302
|
+
);
|
|
19303
|
+
var get_member_are_referenced_default = GetMemberAreReferencedTool;
|
|
19304
|
+
|
|
19305
|
+
// src/umb-management-api/tools/member/get/get-member-by-id-referenced-by.ts
|
|
19306
|
+
import { z as z47 } from "zod";
|
|
19307
|
+
var GetMemberByIdReferencedByTool = CreateUmbracoTool(
|
|
19308
|
+
"get-member-by-id-referenced-by",
|
|
19309
|
+
`Get items that reference a specific member
|
|
19310
|
+
Use this to find all content, documents, or other items that are currently referencing a specific member account.`,
|
|
19311
|
+
z47.object({
|
|
19312
|
+
...getMemberByIdReferencedByParams.shape,
|
|
19313
|
+
...getMemberByIdReferencedByQueryParams.shape
|
|
19314
|
+
}).shape,
|
|
19315
|
+
async ({ id, skip, take }) => {
|
|
19316
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19317
|
+
const response = await client.getMemberByIdReferencedBy(id, { skip, take });
|
|
19318
|
+
return {
|
|
19319
|
+
content: [
|
|
19320
|
+
{
|
|
19321
|
+
type: "text",
|
|
19322
|
+
text: JSON.stringify(response)
|
|
19323
|
+
}
|
|
19324
|
+
]
|
|
19325
|
+
};
|
|
19326
|
+
}
|
|
19327
|
+
);
|
|
19328
|
+
var get_member_by_id_referenced_by_default = GetMemberByIdReferencedByTool;
|
|
19329
|
+
|
|
19330
|
+
// src/umb-management-api/tools/member/get/get-member-by-id-referenced-descendants.ts
|
|
19331
|
+
import { z as z48 } from "zod";
|
|
19332
|
+
var GetMemberByIdReferencedDescendantsTool = CreateUmbracoTool(
|
|
19333
|
+
"get-member-by-id-referenced-descendants",
|
|
19334
|
+
`Get descendant references for a member
|
|
19335
|
+
Use this to find all descendant references that are being referenced for a specific member account.`,
|
|
19336
|
+
z48.object({
|
|
19337
|
+
...getMemberByIdReferencedDescendantsParams.shape,
|
|
19338
|
+
...getMemberByIdReferencedDescendantsQueryParams.shape
|
|
19339
|
+
}).shape,
|
|
19340
|
+
async ({ id, skip, take }) => {
|
|
19341
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19342
|
+
const response = await client.getMemberByIdReferencedDescendants(id, { skip, take });
|
|
19343
|
+
return {
|
|
19344
|
+
content: [
|
|
19345
|
+
{
|
|
19346
|
+
type: "text",
|
|
19347
|
+
text: JSON.stringify(response)
|
|
19348
|
+
}
|
|
19349
|
+
]
|
|
19350
|
+
};
|
|
19351
|
+
}
|
|
19352
|
+
);
|
|
19353
|
+
var get_member_by_id_referenced_descendants_default = GetMemberByIdReferencedDescendantsTool;
|
|
19354
|
+
|
|
19355
|
+
// src/umb-management-api/tools/member/index.ts
|
|
19356
|
+
var MemberCollection = {
|
|
18507
19357
|
metadata: {
|
|
18508
19358
|
name: "member",
|
|
18509
19359
|
displayName: "Members",
|
|
@@ -18515,8 +19365,13 @@ var MemberCollection = {
|
|
|
18515
19365
|
if (AuthorizationPolicies.SectionAccessMembers(user)) {
|
|
18516
19366
|
tools.push(get_member_default());
|
|
18517
19367
|
tools.push(create_member_default());
|
|
19368
|
+
tools.push(validate_member_default());
|
|
18518
19369
|
tools.push(delete_member_default());
|
|
18519
19370
|
tools.push(update_member_default());
|
|
19371
|
+
tools.push(validate_member_update_default());
|
|
19372
|
+
tools.push(get_member_are_referenced_default());
|
|
19373
|
+
tools.push(get_member_by_id_referenced_by_default());
|
|
19374
|
+
tools.push(get_member_by_id_referenced_descendants_default());
|
|
18520
19375
|
}
|
|
18521
19376
|
tools.push(find_member_default());
|
|
18522
19377
|
return tools;
|
|
@@ -18605,13 +19460,13 @@ var CreateMemberGroupTool = CreateUmbracoTool(
|
|
|
18605
19460
|
var create_member_group_default = CreateMemberGroupTool;
|
|
18606
19461
|
|
|
18607
19462
|
// src/umb-management-api/tools/member-group/put/update-member-group.ts
|
|
18608
|
-
import { z as
|
|
19463
|
+
import { z as z49 } from "zod";
|
|
18609
19464
|
var UpdateMemberGroupTool = CreateUmbracoTool(
|
|
18610
19465
|
"update-member-group",
|
|
18611
19466
|
"Updates a member group by Id",
|
|
18612
19467
|
{
|
|
18613
19468
|
id: putMemberGroupByIdParams.shape.id,
|
|
18614
|
-
data:
|
|
19469
|
+
data: z49.object(putMemberGroupByIdBody.shape)
|
|
18615
19470
|
},
|
|
18616
19471
|
async (model) => {
|
|
18617
19472
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18753,13 +19608,13 @@ var DeleteMemberTypeTool = CreateUmbracoTool(
|
|
|
18753
19608
|
var delete_member_type_default = DeleteMemberTypeTool;
|
|
18754
19609
|
|
|
18755
19610
|
// src/umb-management-api/tools/member-type/put/update-member-type.ts
|
|
18756
|
-
import { z as
|
|
19611
|
+
import { z as z50 } from "zod";
|
|
18757
19612
|
var UpdateMemberTypeTool = CreateUmbracoTool(
|
|
18758
19613
|
"update-member-type",
|
|
18759
19614
|
"Updates a member type by id",
|
|
18760
19615
|
{
|
|
18761
19616
|
id: putMemberTypeByIdParams.shape.id,
|
|
18762
|
-
data:
|
|
19617
|
+
data: z50.object(putMemberTypeByIdBody.shape)
|
|
18763
19618
|
},
|
|
18764
19619
|
async (model) => {
|
|
18765
19620
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -18777,12 +19632,12 @@ var UpdateMemberTypeTool = CreateUmbracoTool(
|
|
|
18777
19632
|
var update_member_type_default = UpdateMemberTypeTool;
|
|
18778
19633
|
|
|
18779
19634
|
// src/umb-management-api/tools/member-type/post/copy-member-type.ts
|
|
18780
|
-
import { z as
|
|
19635
|
+
import { z as z51 } from "zod";
|
|
18781
19636
|
var CopyMemberTypeTool = CreateUmbracoTool(
|
|
18782
19637
|
"copy-member-type",
|
|
18783
19638
|
"Copy a member type to a new location",
|
|
18784
19639
|
{
|
|
18785
|
-
id:
|
|
19640
|
+
id: z51.string().uuid()
|
|
18786
19641
|
},
|
|
18787
19642
|
async (model) => {
|
|
18788
19643
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -19111,11 +19966,11 @@ var LogViewerCollection = {
|
|
|
19111
19966
|
};
|
|
19112
19967
|
|
|
19113
19968
|
// src/umb-management-api/tools/partial-view/post/create-partial-view.ts
|
|
19114
|
-
import
|
|
19115
|
-
var createPartialViewSchema =
|
|
19116
|
-
name:
|
|
19117
|
-
path:
|
|
19118
|
-
content:
|
|
19969
|
+
import z52 from "zod";
|
|
19970
|
+
var createPartialViewSchema = z52.object({
|
|
19971
|
+
name: z52.string().min(1, "Name is required"),
|
|
19972
|
+
path: z52.string().optional(),
|
|
19973
|
+
content: z52.string().min(1, "Content is required")
|
|
19119
19974
|
});
|
|
19120
19975
|
var CreatePartialViewTool = CreateUmbracoTool(
|
|
19121
19976
|
"create-partial-view",
|
|
@@ -19205,18 +20060,18 @@ var GetPartialViewFolderByPathTool = CreateUmbracoTool(
|
|
|
19205
20060
|
var get_partial_view_folder_by_path_default = GetPartialViewFolderByPathTool;
|
|
19206
20061
|
|
|
19207
20062
|
// src/umb-management-api/tools/partial-view/put/update-partial-view.ts
|
|
19208
|
-
import { z as
|
|
20063
|
+
import { z as z53 } from "zod";
|
|
19209
20064
|
var UpdatePartialViewTool = CreateUmbracoTool(
|
|
19210
20065
|
"update-partial-view",
|
|
19211
20066
|
"Updates a partial view",
|
|
19212
|
-
|
|
20067
|
+
z53.object({
|
|
19213
20068
|
...putPartialViewByPathParams.shape,
|
|
19214
20069
|
...putPartialViewByPathBody.shape
|
|
19215
20070
|
}).shape,
|
|
19216
20071
|
async (model) => {
|
|
19217
20072
|
const client = UmbracoManagementClient2.getClient();
|
|
19218
|
-
const { path, ...updateModel } = model;
|
|
19219
|
-
var response = await client.putPartialViewByPath(
|
|
20073
|
+
const { path: path3, ...updateModel } = model;
|
|
20074
|
+
var response = await client.putPartialViewByPath(path3, updateModel);
|
|
19220
20075
|
return {
|
|
19221
20076
|
content: [
|
|
19222
20077
|
{
|
|
@@ -19230,18 +20085,18 @@ var UpdatePartialViewTool = CreateUmbracoTool(
|
|
|
19230
20085
|
var update_partial_view_default = UpdatePartialViewTool;
|
|
19231
20086
|
|
|
19232
20087
|
// src/umb-management-api/tools/partial-view/put/rename-partial-view.ts
|
|
19233
|
-
import { z as
|
|
20088
|
+
import { z as z54 } from "zod";
|
|
19234
20089
|
var RenamePartialViewTool = CreateUmbracoTool(
|
|
19235
20090
|
"rename-partial-view",
|
|
19236
20091
|
`Renames a partial view`,
|
|
19237
|
-
|
|
20092
|
+
z54.object({
|
|
19238
20093
|
...putPartialViewByPathRenameParams.shape,
|
|
19239
20094
|
...putPartialViewByPathRenameBody.shape
|
|
19240
20095
|
}).shape,
|
|
19241
20096
|
async (model) => {
|
|
19242
20097
|
const client = UmbracoManagementClient2.getClient();
|
|
19243
|
-
const { path, ...renameModel } = model;
|
|
19244
|
-
const normalizedPath = encodeURIComponent(
|
|
20098
|
+
const { path: path3, ...renameModel } = model;
|
|
20099
|
+
const normalizedPath = encodeURIComponent(path3);
|
|
19245
20100
|
var response = await client.putPartialViewByPathRename(normalizedPath, renameModel);
|
|
19246
20101
|
return {
|
|
19247
20102
|
content: [
|
|
@@ -19424,7 +20279,7 @@ var PartialViewCollection = {
|
|
|
19424
20279
|
dependencies: []
|
|
19425
20280
|
},
|
|
19426
20281
|
tools: (user) => {
|
|
19427
|
-
const tools = [
|
|
20282
|
+
const tools = [];
|
|
19428
20283
|
if (AuthorizationPolicies.TreeAccessPartialViews(user)) {
|
|
19429
20284
|
tools.push(create_partial_view_default());
|
|
19430
20285
|
tools.push(create_partial_view_folder_default());
|
|
@@ -19439,6 +20294,7 @@ var PartialViewCollection = {
|
|
|
19439
20294
|
tools.push(get_ancestors_default8());
|
|
19440
20295
|
tools.push(get_children_default8());
|
|
19441
20296
|
tools.push(get_root_default10());
|
|
20297
|
+
tools.push(get_search_default2());
|
|
19442
20298
|
}
|
|
19443
20299
|
return tools;
|
|
19444
20300
|
}
|
|
@@ -19521,6 +20377,26 @@ var GetTemplateTool = CreateUmbracoTool(
|
|
|
19521
20377
|
);
|
|
19522
20378
|
var get_template_default = GetTemplateTool;
|
|
19523
20379
|
|
|
20380
|
+
// src/umb-management-api/tools/template/get/get-template-configuration.ts
|
|
20381
|
+
var GetTemplateConfigurationTool = CreateUmbracoTool(
|
|
20382
|
+
"get-template-configuration",
|
|
20383
|
+
"Gets template configuration settings including whether templates are disabled system-wide",
|
|
20384
|
+
{},
|
|
20385
|
+
async () => {
|
|
20386
|
+
const client = UmbracoManagementClient2.getClient();
|
|
20387
|
+
const response = await client.getTemplateConfiguration();
|
|
20388
|
+
return {
|
|
20389
|
+
content: [
|
|
20390
|
+
{
|
|
20391
|
+
type: "text",
|
|
20392
|
+
text: JSON.stringify(response, null, 2)
|
|
20393
|
+
}
|
|
20394
|
+
]
|
|
20395
|
+
};
|
|
20396
|
+
}
|
|
20397
|
+
);
|
|
20398
|
+
var get_template_configuration_default = GetTemplateConfigurationTool;
|
|
20399
|
+
|
|
19524
20400
|
// src/umb-management-api/tools/template/get/get-template-by-id-array.ts
|
|
19525
20401
|
var GetTemplatesByIdArrayTool = CreateUmbracoTool(
|
|
19526
20402
|
"get-templates-by-id-array",
|
|
@@ -19542,13 +20418,13 @@ var GetTemplatesByIdArrayTool = CreateUmbracoTool(
|
|
|
19542
20418
|
var get_template_by_id_array_default = GetTemplatesByIdArrayTool;
|
|
19543
20419
|
|
|
19544
20420
|
// src/umb-management-api/tools/template/put/update-template.ts
|
|
19545
|
-
import { z as
|
|
20421
|
+
import { z as z55 } from "zod";
|
|
19546
20422
|
var UpdateTemplateTool = CreateUmbracoTool(
|
|
19547
20423
|
"update-template",
|
|
19548
20424
|
"Updates a template by Id",
|
|
19549
20425
|
{
|
|
19550
20426
|
id: putTemplateByIdParams.shape.id,
|
|
19551
|
-
data:
|
|
20427
|
+
data: z55.object(putTemplateByIdBody.shape)
|
|
19552
20428
|
},
|
|
19553
20429
|
async (model) => {
|
|
19554
20430
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -19723,9 +20599,10 @@ var TemplateCollection = {
|
|
|
19723
20599
|
dependencies: []
|
|
19724
20600
|
},
|
|
19725
20601
|
tools: (user) => {
|
|
19726
|
-
const tools = [
|
|
20602
|
+
const tools = [];
|
|
19727
20603
|
if (AuthorizationPolicies.TreeAccessTemplates(user)) {
|
|
19728
20604
|
tools.push(get_template_default());
|
|
20605
|
+
tools.push(get_template_configuration_default());
|
|
19729
20606
|
tools.push(get_template_by_id_array_default());
|
|
19730
20607
|
tools.push(create_template_default());
|
|
19731
20608
|
tools.push(update_template_default());
|
|
@@ -19735,6 +20612,7 @@ var TemplateCollection = {
|
|
|
19735
20612
|
tools.push(get_ancestors_default9());
|
|
19736
20613
|
tools.push(get_children_default9());
|
|
19737
20614
|
tools.push(get_root_default11());
|
|
20615
|
+
tools.push(get_search_default3());
|
|
19738
20616
|
}
|
|
19739
20617
|
return tools;
|
|
19740
20618
|
}
|
|
@@ -19780,6 +20658,26 @@ var GetWebhookItemTool = CreateUmbracoTool(
|
|
|
19780
20658
|
);
|
|
19781
20659
|
var get_webhook_by_id_array_default = GetWebhookItemTool;
|
|
19782
20660
|
|
|
20661
|
+
// src/umb-management-api/tools/webhook/get/get-webhook.ts
|
|
20662
|
+
var GetWebhookTool = CreateUmbracoTool(
|
|
20663
|
+
"get-webhook",
|
|
20664
|
+
"Gets a paged list of webhooks",
|
|
20665
|
+
getWebhookQueryParams.shape,
|
|
20666
|
+
async (params) => {
|
|
20667
|
+
const client = UmbracoManagementClient2.getClient();
|
|
20668
|
+
const response = await client.getWebhook(params);
|
|
20669
|
+
return {
|
|
20670
|
+
content: [
|
|
20671
|
+
{
|
|
20672
|
+
type: "text",
|
|
20673
|
+
text: JSON.stringify(response)
|
|
20674
|
+
}
|
|
20675
|
+
]
|
|
20676
|
+
};
|
|
20677
|
+
}
|
|
20678
|
+
);
|
|
20679
|
+
var get_webhook_default = GetWebhookTool;
|
|
20680
|
+
|
|
19783
20681
|
// src/umb-management-api/tools/webhook/delete/delete-webhook.ts
|
|
19784
20682
|
var DeleteWebhookTool = CreateUmbracoTool(
|
|
19785
20683
|
"delete-webhook",
|
|
@@ -19801,13 +20699,13 @@ var DeleteWebhookTool = CreateUmbracoTool(
|
|
|
19801
20699
|
var delete_webhook_default = DeleteWebhookTool;
|
|
19802
20700
|
|
|
19803
20701
|
// src/umb-management-api/tools/webhook/put/update-webhook.ts
|
|
19804
|
-
import { z as
|
|
20702
|
+
import { z as z56 } from "zod";
|
|
19805
20703
|
var UpdateWebhookTool = CreateUmbracoTool(
|
|
19806
20704
|
"update-webhook",
|
|
19807
20705
|
"Updates a webhook by id",
|
|
19808
20706
|
{
|
|
19809
20707
|
id: putWebhookByIdParams.shape.id,
|
|
19810
|
-
data:
|
|
20708
|
+
data: z56.object(putWebhookByIdBody.shape)
|
|
19811
20709
|
},
|
|
19812
20710
|
async (model) => {
|
|
19813
20711
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -19899,6 +20797,7 @@ var WebhookCollection = {
|
|
|
19899
20797
|
if (AuthorizationPolicies.TreeAccessWebhooks(user)) {
|
|
19900
20798
|
tools.push(get_webhook_by_id_array_default());
|
|
19901
20799
|
tools.push(create_webhook_default());
|
|
20800
|
+
tools.push(get_webhook_default());
|
|
19902
20801
|
tools.push(get_webhook_by_id_default());
|
|
19903
20802
|
tools.push(delete_webhook_default());
|
|
19904
20803
|
tools.push(update_webhook_default());
|
|
@@ -20122,13 +21021,15 @@ var ServerCollection = {
|
|
|
20122
21021
|
dependencies: []
|
|
20123
21022
|
},
|
|
20124
21023
|
tools: (user) => {
|
|
20125
|
-
|
|
20126
|
-
|
|
20127
|
-
|
|
20128
|
-
|
|
20129
|
-
|
|
20130
|
-
|
|
20131
|
-
|
|
21024
|
+
const tools = [];
|
|
21025
|
+
tools.push(get_server_status_default());
|
|
21026
|
+
tools.push(get_server_configuration_default());
|
|
21027
|
+
tools.push(get_server_information_default());
|
|
21028
|
+
tools.push(get_server_troubleshooting_default());
|
|
21029
|
+
if (AuthorizationPolicies.RequireAdminAccess(user)) {
|
|
21030
|
+
tools.push(get_server_upgrade_check_default());
|
|
21031
|
+
}
|
|
21032
|
+
return tools;
|
|
20132
21033
|
}
|
|
20133
21034
|
};
|
|
20134
21035
|
|
|
@@ -20404,13 +21305,13 @@ var CreateUserGroupTool = CreateUmbracoTool(
|
|
|
20404
21305
|
var create_user_group_default = CreateUserGroupTool;
|
|
20405
21306
|
|
|
20406
21307
|
// src/umb-management-api/tools/user-group/put/update-user-group.ts
|
|
20407
|
-
import { z as
|
|
21308
|
+
import { z as z57 } from "zod";
|
|
20408
21309
|
var UpdateUserGroupTool = CreateUmbracoTool(
|
|
20409
21310
|
"update-user-group",
|
|
20410
21311
|
"Updates a user group by Id",
|
|
20411
21312
|
{
|
|
20412
21313
|
id: putUserGroupByIdParams.shape.id,
|
|
20413
|
-
data:
|
|
21314
|
+
data: z57.object(putUserGroupByIdBody.shape)
|
|
20414
21315
|
},
|
|
20415
21316
|
async (model) => {
|
|
20416
21317
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -20491,6 +21392,69 @@ var UserGroupCollection = {
|
|
|
20491
21392
|
}
|
|
20492
21393
|
};
|
|
20493
21394
|
|
|
21395
|
+
// src/umb-management-api/tools/temporary-file/post/create-temporary-file.ts
|
|
21396
|
+
import { z as z58 } from "zod";
|
|
21397
|
+
import * as fs2 from "fs";
|
|
21398
|
+
import * as os2 from "os";
|
|
21399
|
+
import * as path2 from "path";
|
|
21400
|
+
var createTemporaryFileSchema = z58.object({
|
|
21401
|
+
id: z58.string().uuid().describe("Unique identifier for the temporary file"),
|
|
21402
|
+
fileName: z58.string().describe("Name of the file"),
|
|
21403
|
+
fileAsBase64: z58.string().describe("File content encoded as base64 string")
|
|
21404
|
+
});
|
|
21405
|
+
var CreateTemporaryFileTool = CreateUmbracoTool(
|
|
21406
|
+
"create-temporary-file",
|
|
21407
|
+
`Creates a new temporary file. The file will be deleted after 10 minutes.
|
|
21408
|
+
The temporary file id is used when uploading media files to Umbraco.
|
|
21409
|
+
The process is as follows:
|
|
21410
|
+
- Create a temporary file using this endpoint
|
|
21411
|
+
- Use the temporary file id when creating a media item using the media post endpoint
|
|
21412
|
+
|
|
21413
|
+
Provide the file content as a base64 encoded string.`,
|
|
21414
|
+
createTemporaryFileSchema.shape,
|
|
21415
|
+
async (model) => {
|
|
21416
|
+
let tempFilePath = null;
|
|
21417
|
+
try {
|
|
21418
|
+
const fileContent = Buffer.from(model.fileAsBase64, "base64");
|
|
21419
|
+
tempFilePath = path2.join(os2.tmpdir(), `umbraco-upload-${model.id}-${model.fileName}`);
|
|
21420
|
+
fs2.writeFileSync(tempFilePath, fileContent);
|
|
21421
|
+
const readStream = fs2.createReadStream(tempFilePath);
|
|
21422
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21423
|
+
await client.postTemporaryFile({
|
|
21424
|
+
Id: model.id,
|
|
21425
|
+
File: readStream
|
|
21426
|
+
});
|
|
21427
|
+
return {
|
|
21428
|
+
content: [
|
|
21429
|
+
{
|
|
21430
|
+
type: "text",
|
|
21431
|
+
text: JSON.stringify({ id: model.id })
|
|
21432
|
+
}
|
|
21433
|
+
]
|
|
21434
|
+
};
|
|
21435
|
+
} catch (error) {
|
|
21436
|
+
return {
|
|
21437
|
+
content: [
|
|
21438
|
+
{
|
|
21439
|
+
type: "text",
|
|
21440
|
+
text: `Error creating temporary file: ${error.message}`
|
|
21441
|
+
}
|
|
21442
|
+
],
|
|
21443
|
+
isError: true
|
|
21444
|
+
};
|
|
21445
|
+
} finally {
|
|
21446
|
+
if (tempFilePath && fs2.existsSync(tempFilePath)) {
|
|
21447
|
+
try {
|
|
21448
|
+
fs2.unlinkSync(tempFilePath);
|
|
21449
|
+
} catch (e) {
|
|
21450
|
+
console.error("Failed to cleanup temp file:", e);
|
|
21451
|
+
}
|
|
21452
|
+
}
|
|
21453
|
+
}
|
|
21454
|
+
}
|
|
21455
|
+
);
|
|
21456
|
+
var create_temporary_file_default = CreateTemporaryFileTool;
|
|
21457
|
+
|
|
20494
21458
|
// src/umb-management-api/api/temporary-file/types.zod.ts
|
|
20495
21459
|
import { ReadStream } from "fs";
|
|
20496
21460
|
import { z as zod2 } from "zod";
|
|
@@ -20516,32 +21480,6 @@ var getTemporaryFileConfigurationResponse = zod2.object({
|
|
|
20516
21480
|
maxFileSize: zod2.number().nullish()
|
|
20517
21481
|
});
|
|
20518
21482
|
|
|
20519
|
-
// src/umb-management-api/tools/temporary-file/post/create-temporary-file.ts
|
|
20520
|
-
var CreateTemporaryFileTool = CreateUmbracoTool(
|
|
20521
|
-
"create-temporary-file",
|
|
20522
|
-
`Creates a new temporary file. The file will be deleted after 10 minutes.
|
|
20523
|
-
The file must be updated as a stream.
|
|
20524
|
-
The temporary file id is used when uploading media files to Umbraco.
|
|
20525
|
-
The process is as follows:
|
|
20526
|
-
- Create a temporary fileusing this endpoint
|
|
20527
|
-
- Use the temporary file id when creating a media item using the media post endpoint
|
|
20528
|
-
`,
|
|
20529
|
-
postTemporaryFileBody.shape,
|
|
20530
|
-
async (model) => {
|
|
20531
|
-
const client = UmbracoManagementClient2.getClient();
|
|
20532
|
-
await client.postTemporaryFile(model);
|
|
20533
|
-
return {
|
|
20534
|
-
content: [
|
|
20535
|
-
{
|
|
20536
|
-
type: "text",
|
|
20537
|
-
text: JSON.stringify({ id: model.Id })
|
|
20538
|
-
}
|
|
20539
|
-
]
|
|
20540
|
-
};
|
|
20541
|
-
}
|
|
20542
|
-
);
|
|
20543
|
-
var create_temporary_file_default = CreateTemporaryFileTool;
|
|
20544
|
-
|
|
20545
21483
|
// src/umb-management-api/tools/temporary-file/get/get-temporary-file.ts
|
|
20546
21484
|
var GetTemporaryFileTool = CreateUmbracoTool(
|
|
20547
21485
|
"get-temporary-file",
|
|
@@ -20631,9 +21569,9 @@ var GetScriptByPathTool = CreateUmbracoTool(
|
|
|
20631
21569
|
"get-script-by-path",
|
|
20632
21570
|
"Gets a script by path",
|
|
20633
21571
|
getScriptByPathParams.shape,
|
|
20634
|
-
async ({ path }) => {
|
|
21572
|
+
async ({ path: path3 }) => {
|
|
20635
21573
|
const client = UmbracoManagementClient2.getClient();
|
|
20636
|
-
const response = await client.getScriptByPath(
|
|
21574
|
+
const response = await client.getScriptByPath(path3);
|
|
20637
21575
|
return {
|
|
20638
21576
|
content: [
|
|
20639
21577
|
{
|
|
@@ -20651,9 +21589,9 @@ var GetScriptFolderByPathTool = CreateUmbracoTool(
|
|
|
20651
21589
|
"get-script-folder-by-path",
|
|
20652
21590
|
"Gets a script folder by path",
|
|
20653
21591
|
getScriptFolderByPathParams.shape,
|
|
20654
|
-
async ({ path }) => {
|
|
21592
|
+
async ({ path: path3 }) => {
|
|
20655
21593
|
const client = UmbracoManagementClient2.getClient();
|
|
20656
|
-
const response = await client.getScriptFolderByPath(
|
|
21594
|
+
const response = await client.getScriptFolderByPath(path3);
|
|
20657
21595
|
return {
|
|
20658
21596
|
content: [
|
|
20659
21597
|
{
|
|
@@ -20747,11 +21685,11 @@ var GetScriptTreeRootTool = CreateUmbracoTool(
|
|
|
20747
21685
|
var get_script_tree_root_default = GetScriptTreeRootTool;
|
|
20748
21686
|
|
|
20749
21687
|
// src/umb-management-api/tools/script/post/create-script.ts
|
|
20750
|
-
import
|
|
20751
|
-
var createScriptSchema =
|
|
20752
|
-
name:
|
|
20753
|
-
path:
|
|
20754
|
-
content:
|
|
21688
|
+
import z59 from "zod";
|
|
21689
|
+
var createScriptSchema = z59.object({
|
|
21690
|
+
name: z59.string().min(1, "Name is required"),
|
|
21691
|
+
path: z59.string().optional(),
|
|
21692
|
+
content: z59.string().min(1, "Content is required")
|
|
20755
21693
|
});
|
|
20756
21694
|
var CreateScriptTool = CreateUmbracoTool(
|
|
20757
21695
|
"create-script",
|
|
@@ -20800,13 +21738,13 @@ var CreateScriptFolderTool = CreateUmbracoTool(
|
|
|
20800
21738
|
var create_script_folder_default = CreateScriptFolderTool;
|
|
20801
21739
|
|
|
20802
21740
|
// src/umb-management-api/tools/script/put/update-script.ts
|
|
20803
|
-
import { z as
|
|
21741
|
+
import { z as z60 } from "zod";
|
|
20804
21742
|
var UpdateScriptTool = CreateUmbracoTool(
|
|
20805
21743
|
"update-script",
|
|
20806
21744
|
"Updates a script by path",
|
|
20807
21745
|
{
|
|
20808
21746
|
path: putScriptByPathParams.shape.path,
|
|
20809
|
-
data:
|
|
21747
|
+
data: z60.object(putScriptByPathBody.shape)
|
|
20810
21748
|
},
|
|
20811
21749
|
async (model) => {
|
|
20812
21750
|
const client = UmbracoManagementClient2.getClient();
|
|
@@ -20824,11 +21762,11 @@ var UpdateScriptTool = CreateUmbracoTool(
|
|
|
20824
21762
|
var update_script_default = UpdateScriptTool;
|
|
20825
21763
|
|
|
20826
21764
|
// src/umb-management-api/tools/script/put/rename-script.ts
|
|
20827
|
-
import { z as
|
|
20828
|
-
var renameScriptSchema =
|
|
20829
|
-
name:
|
|
20830
|
-
folderPath:
|
|
20831
|
-
newName:
|
|
21765
|
+
import { z as z61 } from "zod";
|
|
21766
|
+
var renameScriptSchema = z61.object({
|
|
21767
|
+
name: z61.string().min(1, "Current script name is required"),
|
|
21768
|
+
folderPath: z61.string().optional().describe("Path to the folder containing the script (optional, leave empty for root)"),
|
|
21769
|
+
newName: z61.string().min(1, "New script name is required")
|
|
20832
21770
|
});
|
|
20833
21771
|
var RenameScriptTool = CreateUmbracoTool(
|
|
20834
21772
|
"rename-script",
|
|
@@ -20862,9 +21800,9 @@ var DeleteScriptTool = CreateUmbracoTool(
|
|
|
20862
21800
|
"delete-script",
|
|
20863
21801
|
"Deletes a script by path",
|
|
20864
21802
|
deleteScriptByPathParams.shape,
|
|
20865
|
-
async ({ path }) => {
|
|
21803
|
+
async ({ path: path3 }) => {
|
|
20866
21804
|
const client = UmbracoManagementClient2.getClient();
|
|
20867
|
-
const response = await client.deleteScriptByPath(
|
|
21805
|
+
const response = await client.deleteScriptByPath(path3);
|
|
20868
21806
|
return {
|
|
20869
21807
|
content: [
|
|
20870
21808
|
{
|
|
@@ -20882,9 +21820,9 @@ var DeleteScriptFolderTool = CreateUmbracoTool(
|
|
|
20882
21820
|
"delete-script-folder",
|
|
20883
21821
|
"Deletes a script folder by path",
|
|
20884
21822
|
deleteScriptFolderByPathParams.shape,
|
|
20885
|
-
async ({ path }) => {
|
|
21823
|
+
async ({ path: path3 }) => {
|
|
20886
21824
|
const client = UmbracoManagementClient2.getClient();
|
|
20887
|
-
const response = await client.deleteScriptFolderByPath(
|
|
21825
|
+
const response = await client.deleteScriptFolderByPath(path3);
|
|
20888
21826
|
return {
|
|
20889
21827
|
content: [
|
|
20890
21828
|
{
|
|
@@ -21006,18 +21944,18 @@ var GetStylesheetFolderByPathTool = CreateUmbracoTool(
|
|
|
21006
21944
|
var get_stylesheet_folder_by_path_default = GetStylesheetFolderByPathTool;
|
|
21007
21945
|
|
|
21008
21946
|
// src/umb-management-api/tools/stylesheet/put/update-stylesheet.ts
|
|
21009
|
-
import { z as
|
|
21947
|
+
import { z as z62 } from "zod";
|
|
21010
21948
|
var UpdateStylesheetTool = CreateUmbracoTool(
|
|
21011
21949
|
"update-stylesheet",
|
|
21012
21950
|
"Updates a stylesheet by path",
|
|
21013
|
-
|
|
21951
|
+
z62.object({
|
|
21014
21952
|
...putStylesheetByPathParams.shape,
|
|
21015
21953
|
...putStylesheetByPathBody.shape
|
|
21016
21954
|
}).shape,
|
|
21017
21955
|
async (model) => {
|
|
21018
21956
|
const client = UmbracoManagementClient2.getClient();
|
|
21019
|
-
const { path, ...updateModel } = model;
|
|
21020
|
-
var response = await client.putStylesheetByPath(
|
|
21957
|
+
const { path: path3, ...updateModel } = model;
|
|
21958
|
+
var response = await client.putStylesheetByPath(path3, updateModel);
|
|
21021
21959
|
return {
|
|
21022
21960
|
content: [
|
|
21023
21961
|
{
|
|
@@ -21031,18 +21969,18 @@ var UpdateStylesheetTool = CreateUmbracoTool(
|
|
|
21031
21969
|
var update_stylesheet_default = UpdateStylesheetTool;
|
|
21032
21970
|
|
|
21033
21971
|
// src/umb-management-api/tools/stylesheet/put/rename-stylesheet.ts
|
|
21034
|
-
import { z as
|
|
21972
|
+
import { z as z63 } from "zod";
|
|
21035
21973
|
var RenameStylesheetTool = CreateUmbracoTool(
|
|
21036
21974
|
"rename-stylesheet",
|
|
21037
21975
|
`Renames a stylesheet`,
|
|
21038
|
-
|
|
21976
|
+
z63.object({
|
|
21039
21977
|
...putStylesheetByPathRenameParams.shape,
|
|
21040
21978
|
...putStylesheetByPathRenameBody.shape
|
|
21041
21979
|
}).shape,
|
|
21042
21980
|
async (model) => {
|
|
21043
21981
|
const client = UmbracoManagementClient2.getClient();
|
|
21044
|
-
const { path, ...renameModel } = model;
|
|
21045
|
-
const normalizedPath = encodeURIComponent(
|
|
21982
|
+
const { path: path3, ...renameModel } = model;
|
|
21983
|
+
const normalizedPath = encodeURIComponent(path3);
|
|
21046
21984
|
var response = await client.putStylesheetByPathRename(normalizedPath, renameModel);
|
|
21047
21985
|
return {
|
|
21048
21986
|
content: [
|
|
@@ -21185,7 +22123,7 @@ var StylesheetCollection = {
|
|
|
21185
22123
|
dependencies: []
|
|
21186
22124
|
},
|
|
21187
22125
|
tools: (user) => {
|
|
21188
|
-
const tools = [
|
|
22126
|
+
const tools = [];
|
|
21189
22127
|
if (AuthorizationPolicies.TreeAccessStylesheets(user)) {
|
|
21190
22128
|
tools.push(create_stylesheet_default());
|
|
21191
22129
|
tools.push(create_stylesheet_folder_default());
|
|
@@ -21198,97 +22136,1250 @@ var StylesheetCollection = {
|
|
|
21198
22136
|
tools.push(get_ancestors_default10());
|
|
21199
22137
|
tools.push(get_children_default10());
|
|
21200
22138
|
tools.push(get_root_default12());
|
|
22139
|
+
tools.push(get_search_default4());
|
|
21201
22140
|
}
|
|
21202
22141
|
return tools;
|
|
21203
22142
|
}
|
|
21204
22143
|
};
|
|
21205
22144
|
|
|
21206
|
-
// src/
|
|
21207
|
-
var
|
|
21208
|
-
|
|
21209
|
-
|
|
21210
|
-
|
|
21211
|
-
|
|
21212
|
-
|
|
21213
|
-
|
|
21214
|
-
// src/helpers/config/collection-config-loader.ts
|
|
21215
|
-
var CollectionConfigLoader = class {
|
|
21216
|
-
static loadFromEnv() {
|
|
22145
|
+
// src/umb-management-api/tools/health/get/get-health-check-groups.ts
|
|
22146
|
+
var GetHealthCheckGroupsTool = CreateUmbracoTool(
|
|
22147
|
+
"get-health-check-groups",
|
|
22148
|
+
"Gets a paged list of health check groups for system monitoring",
|
|
22149
|
+
getHealthCheckGroupQueryParams.shape,
|
|
22150
|
+
async (params) => {
|
|
22151
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22152
|
+
const response = await client.getHealthCheckGroup(params);
|
|
21217
22153
|
return {
|
|
21218
|
-
|
|
21219
|
-
|
|
21220
|
-
|
|
21221
|
-
|
|
22154
|
+
content: [
|
|
22155
|
+
{
|
|
22156
|
+
type: "text",
|
|
22157
|
+
text: JSON.stringify(response)
|
|
22158
|
+
}
|
|
22159
|
+
]
|
|
21222
22160
|
};
|
|
21223
22161
|
}
|
|
21224
|
-
|
|
22162
|
+
);
|
|
22163
|
+
var get_health_check_groups_default = GetHealthCheckGroupsTool;
|
|
21225
22164
|
|
|
21226
|
-
// src/umb-management-api/tools/
|
|
21227
|
-
var
|
|
21228
|
-
|
|
21229
|
-
|
|
21230
|
-
|
|
21231
|
-
|
|
21232
|
-
|
|
21233
|
-
|
|
21234
|
-
|
|
21235
|
-
|
|
21236
|
-
|
|
21237
|
-
|
|
21238
|
-
|
|
21239
|
-
MemberGroupCollection,
|
|
21240
|
-
MemberTypeCollection,
|
|
21241
|
-
LogViewerCollection,
|
|
21242
|
-
PartialViewCollection,
|
|
21243
|
-
PropertyTypeCollection,
|
|
21244
|
-
TemplateCollection,
|
|
21245
|
-
WebhookCollection,
|
|
21246
|
-
ServerCollection,
|
|
21247
|
-
RedirectCollection,
|
|
21248
|
-
UserGroupCollection,
|
|
21249
|
-
TemporaryFileCollection,
|
|
21250
|
-
ScriptCollection,
|
|
21251
|
-
StylesheetCollection
|
|
21252
|
-
];
|
|
21253
|
-
var mapTools = (server, user, tools) => {
|
|
21254
|
-
return tools.forEach((tool) => {
|
|
21255
|
-
const userHasPermission = tool.enabled === void 0 || tool.enabled(user);
|
|
21256
|
-
if (!userHasPermission) return;
|
|
21257
|
-
if (env_default.UMBRACO_EXCLUDE_TOOLS?.includes(tool.name)) return;
|
|
21258
|
-
if (env_default.UMBRACO_INCLUDE_TOOLS?.length && !env_default.UMBRACO_INCLUDE_TOOLS.includes(tool.name)) return;
|
|
21259
|
-
server.tool(tool.name, tool.description, tool.schema, tool.handler);
|
|
21260
|
-
});
|
|
21261
|
-
};
|
|
21262
|
-
function validateConfiguration(config, collections) {
|
|
21263
|
-
const availableNames = new Set(collections.map((c) => c.metadata.name));
|
|
21264
|
-
const referencedNames = [
|
|
21265
|
-
...config.enabledCollections,
|
|
21266
|
-
...config.disabledCollections,
|
|
21267
|
-
...collections.flatMap((c) => c.metadata.dependencies || [])
|
|
21268
|
-
];
|
|
21269
|
-
const invalid = referencedNames.filter((name) => !availableNames.has(name));
|
|
21270
|
-
if (invalid.length > 0) {
|
|
21271
|
-
console.warn(`Referenced collections don't exist: ${[...new Set(invalid)].join(", ")}`);
|
|
21272
|
-
}
|
|
21273
|
-
}
|
|
21274
|
-
function resolveDependencies(requestedNames, collections) {
|
|
21275
|
-
const result = new Set(requestedNames);
|
|
21276
|
-
const collectionMap = new Map(collections.map((c) => [c.metadata.name, c]));
|
|
21277
|
-
function addDependencies(collectionName) {
|
|
21278
|
-
const collection = collectionMap.get(collectionName);
|
|
21279
|
-
if (collection?.metadata.dependencies) {
|
|
21280
|
-
collection.metadata.dependencies.forEach((dep) => {
|
|
21281
|
-
if (!result.has(dep)) {
|
|
21282
|
-
result.add(dep);
|
|
21283
|
-
addDependencies(dep);
|
|
22165
|
+
// src/umb-management-api/tools/health/get/get-health-check-group-by-name.ts
|
|
22166
|
+
var GetHealthCheckGroupByNameTool = CreateUmbracoTool(
|
|
22167
|
+
"get-health-check-group-by-name",
|
|
22168
|
+
"Gets specific health check group details by name for system monitoring",
|
|
22169
|
+
getHealthCheckGroupByNameParams.shape,
|
|
22170
|
+
async (params) => {
|
|
22171
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22172
|
+
const response = await client.getHealthCheckGroupByName(params.name);
|
|
22173
|
+
return {
|
|
22174
|
+
content: [
|
|
22175
|
+
{
|
|
22176
|
+
type: "text",
|
|
22177
|
+
text: JSON.stringify(response)
|
|
21284
22178
|
}
|
|
21285
|
-
|
|
21286
|
-
}
|
|
22179
|
+
]
|
|
22180
|
+
};
|
|
21287
22181
|
}
|
|
21288
|
-
|
|
21289
|
-
|
|
21290
|
-
|
|
21291
|
-
|
|
22182
|
+
);
|
|
22183
|
+
var get_health_check_group_by_name_default = GetHealthCheckGroupByNameTool;
|
|
22184
|
+
|
|
22185
|
+
// src/umb-management-api/tools/health/post/run-health-check-group.ts
|
|
22186
|
+
var RunHealthCheckGroupTool = CreateUmbracoTool(
|
|
22187
|
+
"run-health-check-group",
|
|
22188
|
+
"Executes health checks for a specific group. WARNING: This will run system diagnostics which may take time and could temporarily affect system performance.",
|
|
22189
|
+
postHealthCheckGroupByNameCheckParams.shape,
|
|
22190
|
+
async (params) => {
|
|
22191
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22192
|
+
const response = await client.postHealthCheckGroupByNameCheck(params.name);
|
|
22193
|
+
return {
|
|
22194
|
+
content: [
|
|
22195
|
+
{
|
|
22196
|
+
type: "text",
|
|
22197
|
+
text: JSON.stringify(response)
|
|
22198
|
+
}
|
|
22199
|
+
]
|
|
22200
|
+
};
|
|
22201
|
+
}
|
|
22202
|
+
);
|
|
22203
|
+
var run_health_check_group_default = RunHealthCheckGroupTool;
|
|
22204
|
+
|
|
22205
|
+
// src/umb-management-api/tools/health/post/execute-health-check-action.ts
|
|
22206
|
+
var ExecuteHealthCheckActionTool = CreateUmbracoTool(
|
|
22207
|
+
"execute-health-check-action",
|
|
22208
|
+
"Executes remedial actions for health issues. WARNING: This performs system remedial actions that may modify system configuration, files, or database content. Use with caution.",
|
|
22209
|
+
postHealthCheckExecuteActionBody.shape,
|
|
22210
|
+
async (model) => {
|
|
22211
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22212
|
+
const response = await client.postHealthCheckExecuteAction(model);
|
|
22213
|
+
return {
|
|
22214
|
+
content: [
|
|
22215
|
+
{
|
|
22216
|
+
type: "text",
|
|
22217
|
+
text: JSON.stringify(response)
|
|
22218
|
+
}
|
|
22219
|
+
]
|
|
22220
|
+
};
|
|
22221
|
+
}
|
|
22222
|
+
);
|
|
22223
|
+
var execute_health_check_action_default = ExecuteHealthCheckActionTool;
|
|
22224
|
+
|
|
22225
|
+
// src/umb-management-api/tools/health/index.ts
|
|
22226
|
+
var HealthCollection = {
|
|
22227
|
+
metadata: {
|
|
22228
|
+
name: "health",
|
|
22229
|
+
displayName: "Health Checks",
|
|
22230
|
+
description: "System health monitoring and diagnostic capabilities",
|
|
22231
|
+
dependencies: []
|
|
22232
|
+
},
|
|
22233
|
+
tools: (user) => {
|
|
22234
|
+
const tools = [];
|
|
22235
|
+
if (AuthorizationPolicies.SectionAccessSettings(user)) {
|
|
22236
|
+
tools.push(get_health_check_groups_default());
|
|
22237
|
+
tools.push(get_health_check_group_by_name_default());
|
|
22238
|
+
tools.push(run_health_check_group_default());
|
|
22239
|
+
tools.push(execute_health_check_action_default());
|
|
22240
|
+
}
|
|
22241
|
+
return tools;
|
|
22242
|
+
}
|
|
22243
|
+
};
|
|
22244
|
+
|
|
22245
|
+
// src/umb-management-api/tools/manifest/get/get-manifest-manifest.ts
|
|
22246
|
+
var GetManifestManifestTool = CreateUmbracoTool(
|
|
22247
|
+
"get-manifest-manifest",
|
|
22248
|
+
"Gets all manifests (both public and private) from the Umbraco installation. Each manifest contains an extensions property showing what the package exposes to Umbraco. Use to see which packages are installed, troubleshoot package issues, or list available extensions.",
|
|
22249
|
+
{},
|
|
22250
|
+
async () => {
|
|
22251
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22252
|
+
const response = await client.getManifestManifest();
|
|
22253
|
+
return {
|
|
22254
|
+
content: [
|
|
22255
|
+
{
|
|
22256
|
+
type: "text",
|
|
22257
|
+
text: JSON.stringify(response)
|
|
22258
|
+
}
|
|
22259
|
+
]
|
|
22260
|
+
};
|
|
22261
|
+
}
|
|
22262
|
+
);
|
|
22263
|
+
var get_manifest_manifest_default = GetManifestManifestTool;
|
|
22264
|
+
|
|
22265
|
+
// src/umb-management-api/tools/manifest/get/get-manifest-manifest-private.ts
|
|
22266
|
+
var GetManifestManifestPrivateTool = CreateUmbracoTool(
|
|
22267
|
+
"get-manifest-manifest-private",
|
|
22268
|
+
"Gets private manifests from the Umbraco installation. Private manifests require authentication and contain administrative/sensitive extensions.",
|
|
22269
|
+
{},
|
|
22270
|
+
async () => {
|
|
22271
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22272
|
+
const response = await client.getManifestManifestPrivate();
|
|
22273
|
+
return {
|
|
22274
|
+
content: [
|
|
22275
|
+
{
|
|
22276
|
+
type: "text",
|
|
22277
|
+
text: JSON.stringify(response)
|
|
22278
|
+
}
|
|
22279
|
+
]
|
|
22280
|
+
};
|
|
22281
|
+
}
|
|
22282
|
+
);
|
|
22283
|
+
var get_manifest_manifest_private_default = GetManifestManifestPrivateTool;
|
|
22284
|
+
|
|
22285
|
+
// src/umb-management-api/tools/manifest/get/get-manifest-manifest-public.ts
|
|
22286
|
+
var GetManifestManifestPublicTool = CreateUmbracoTool(
|
|
22287
|
+
"get-manifest-manifest-public",
|
|
22288
|
+
"Gets public manifests from the Umbraco installation. Public manifests can be accessed without authentication and contain public-facing extensions.",
|
|
22289
|
+
{},
|
|
22290
|
+
async () => {
|
|
22291
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22292
|
+
const response = await client.getManifestManifestPublic();
|
|
22293
|
+
return {
|
|
22294
|
+
content: [
|
|
22295
|
+
{
|
|
22296
|
+
type: "text",
|
|
22297
|
+
text: JSON.stringify(response)
|
|
22298
|
+
}
|
|
22299
|
+
]
|
|
22300
|
+
};
|
|
22301
|
+
}
|
|
22302
|
+
);
|
|
22303
|
+
var get_manifest_manifest_public_default = GetManifestManifestPublicTool;
|
|
22304
|
+
|
|
22305
|
+
// src/umb-management-api/tools/manifest/index.ts
|
|
22306
|
+
var ManifestCollection = {
|
|
22307
|
+
metadata: {
|
|
22308
|
+
name: "manifest",
|
|
22309
|
+
displayName: "Manifest",
|
|
22310
|
+
description: "System manifests and extension definitions",
|
|
22311
|
+
dependencies: []
|
|
22312
|
+
},
|
|
22313
|
+
tools: (user) => {
|
|
22314
|
+
const tools = [];
|
|
22315
|
+
if (AuthorizationPolicies.SectionAccessSettings(user)) {
|
|
22316
|
+
tools.push(get_manifest_manifest_default());
|
|
22317
|
+
tools.push(get_manifest_manifest_private_default());
|
|
22318
|
+
tools.push(get_manifest_manifest_public_default());
|
|
22319
|
+
}
|
|
22320
|
+
return tools;
|
|
22321
|
+
}
|
|
22322
|
+
};
|
|
22323
|
+
|
|
22324
|
+
// src/umb-management-api/tools/tag/get/get-tags.ts
|
|
22325
|
+
var GetTagsTool = CreateUmbracoTool(
|
|
22326
|
+
"get-tags",
|
|
22327
|
+
"Retrieves a paginated list of tags used in the Umbraco instance",
|
|
22328
|
+
getTagQueryParams.shape,
|
|
22329
|
+
async (params) => {
|
|
22330
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22331
|
+
var response = await client.getTag(params);
|
|
22332
|
+
return {
|
|
22333
|
+
content: [
|
|
22334
|
+
{
|
|
22335
|
+
type: "text",
|
|
22336
|
+
text: JSON.stringify(response)
|
|
22337
|
+
}
|
|
22338
|
+
]
|
|
22339
|
+
};
|
|
22340
|
+
}
|
|
22341
|
+
);
|
|
22342
|
+
var get_tags_default = GetTagsTool;
|
|
22343
|
+
|
|
22344
|
+
// src/umb-management-api/tools/tag/index.ts
|
|
22345
|
+
var TagCollection = {
|
|
22346
|
+
metadata: {
|
|
22347
|
+
name: "tag",
|
|
22348
|
+
displayName: "Tag Management",
|
|
22349
|
+
description: "Tag management and retrieval",
|
|
22350
|
+
dependencies: []
|
|
22351
|
+
},
|
|
22352
|
+
tools: (user) => {
|
|
22353
|
+
const tools = [get_tags_default()];
|
|
22354
|
+
return tools;
|
|
22355
|
+
}
|
|
22356
|
+
};
|
|
22357
|
+
|
|
22358
|
+
// src/umb-management-api/tools/models-builder/get/get-models-builder-dashboard.ts
|
|
22359
|
+
var GetModelsBuilderDashboardTool = CreateUmbracoTool(
|
|
22360
|
+
"get-models-builder-dashboard",
|
|
22361
|
+
`Gets Models Builder dashboard information and current status.
|
|
22362
|
+
Returns an object containing:
|
|
22363
|
+
- mode: The Models Builder mode, one of: 'Nothing', 'InMemoryAuto', 'SourceCodeManual', 'SourceCodeAuto' (string)
|
|
22364
|
+
- canGenerate: Whether models can be generated (boolean)
|
|
22365
|
+
- outOfDateModels: Whether models are out of date (boolean)
|
|
22366
|
+
- lastError: Last error message if any (string | null)
|
|
22367
|
+
- version: Version information (string | null)
|
|
22368
|
+
- modelsNamespace: Namespace for generated models (string | null)
|
|
22369
|
+
- trackingOutOfDateModels: Whether tracking is enabled (boolean)`,
|
|
22370
|
+
{},
|
|
22371
|
+
async () => {
|
|
22372
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22373
|
+
const response = await client.getModelsBuilderDashboard();
|
|
22374
|
+
return {
|
|
22375
|
+
content: [
|
|
22376
|
+
{
|
|
22377
|
+
type: "text",
|
|
22378
|
+
text: JSON.stringify(response)
|
|
22379
|
+
}
|
|
22380
|
+
]
|
|
22381
|
+
};
|
|
22382
|
+
}
|
|
22383
|
+
);
|
|
22384
|
+
var get_models_builder_dashboard_default = GetModelsBuilderDashboardTool;
|
|
22385
|
+
|
|
22386
|
+
// src/umb-management-api/tools/models-builder/get/get-models-builder-status.ts
|
|
22387
|
+
var GetModelsBuilderStatusTool = CreateUmbracoTool(
|
|
22388
|
+
"get-models-builder-status",
|
|
22389
|
+
`Gets the out-of-date status of Models Builder models.
|
|
22390
|
+
Returns an object containing:
|
|
22391
|
+
- status: The out-of-date status, one of: 'OutOfDate', 'Current', 'Unknown' (string)`,
|
|
22392
|
+
{},
|
|
22393
|
+
async () => {
|
|
22394
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22395
|
+
const response = await client.getModelsBuilderStatus();
|
|
22396
|
+
return {
|
|
22397
|
+
content: [
|
|
22398
|
+
{
|
|
22399
|
+
type: "text",
|
|
22400
|
+
text: JSON.stringify(response)
|
|
22401
|
+
}
|
|
22402
|
+
]
|
|
22403
|
+
};
|
|
22404
|
+
}
|
|
22405
|
+
);
|
|
22406
|
+
var get_models_builder_status_default = GetModelsBuilderStatusTool;
|
|
22407
|
+
|
|
22408
|
+
// src/umb-management-api/tools/models-builder/post/post-models-builder-build.ts
|
|
22409
|
+
var PostModelsBuilderBuildTool = CreateUmbracoTool(
|
|
22410
|
+
"post-models-builder-build",
|
|
22411
|
+
`Triggers the generation/build of Models Builder models.
|
|
22412
|
+
This endpoint initiates the process of generating strongly-typed models from Umbraco content types.
|
|
22413
|
+
The operation runs asynchronously and does not return any response data.
|
|
22414
|
+
|
|
22415
|
+
Use this tool to:
|
|
22416
|
+
- Generate models after making changes to document types, media types, or member types
|
|
22417
|
+
- Refresh models when they become out of date
|
|
22418
|
+
- Ensure the latest content type definitions are reflected in generated models
|
|
22419
|
+
|
|
22420
|
+
Note: This operation may take some time to complete depending on the number of content types.
|
|
22421
|
+
Use get-models-builder-dashboard or get-models-builder-status to check the current state and if new models need to be generated.`,
|
|
22422
|
+
{},
|
|
22423
|
+
async () => {
|
|
22424
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22425
|
+
await client.postModelsBuilderBuild();
|
|
22426
|
+
return {
|
|
22427
|
+
content: [
|
|
22428
|
+
{
|
|
22429
|
+
type: "text",
|
|
22430
|
+
text: "Models Builder build process initiated successfully."
|
|
22431
|
+
}
|
|
22432
|
+
]
|
|
22433
|
+
};
|
|
22434
|
+
}
|
|
22435
|
+
);
|
|
22436
|
+
var post_models_builder_build_default = PostModelsBuilderBuildTool;
|
|
22437
|
+
|
|
22438
|
+
// src/umb-management-api/tools/models-builder/index.ts
|
|
22439
|
+
var ModelsBuilderCollection = {
|
|
22440
|
+
metadata: {
|
|
22441
|
+
name: "models-builder",
|
|
22442
|
+
displayName: "Models Builder",
|
|
22443
|
+
description: "Models Builder management and code generation",
|
|
22444
|
+
dependencies: []
|
|
22445
|
+
},
|
|
22446
|
+
tools: (user) => {
|
|
22447
|
+
const tools = [];
|
|
22448
|
+
if (AuthorizationPolicies.SectionAccessSettings(user)) {
|
|
22449
|
+
tools.push(get_models_builder_dashboard_default());
|
|
22450
|
+
tools.push(get_models_builder_status_default());
|
|
22451
|
+
tools.push(post_models_builder_build_default());
|
|
22452
|
+
}
|
|
22453
|
+
return tools;
|
|
22454
|
+
}
|
|
22455
|
+
};
|
|
22456
|
+
|
|
22457
|
+
// src/umb-management-api/tools/searcher/get/get-searcher.ts
|
|
22458
|
+
var GetSearcherTool = CreateUmbracoTool(
|
|
22459
|
+
"get-searcher",
|
|
22460
|
+
`Lists all searchers with pagination support.
|
|
22461
|
+
Returns an object containing:
|
|
22462
|
+
- total: Total number of searchers (number)
|
|
22463
|
+
- items: Array of searcher objects with name and isEnabled properties`,
|
|
22464
|
+
getSearcherQueryParams.shape,
|
|
22465
|
+
async (model) => {
|
|
22466
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22467
|
+
const response = await client.getSearcher(model);
|
|
22468
|
+
return {
|
|
22469
|
+
content: [
|
|
22470
|
+
{
|
|
22471
|
+
type: "text",
|
|
22472
|
+
text: JSON.stringify(response)
|
|
22473
|
+
}
|
|
22474
|
+
]
|
|
22475
|
+
};
|
|
22476
|
+
}
|
|
22477
|
+
);
|
|
22478
|
+
var get_searcher_default = GetSearcherTool;
|
|
22479
|
+
|
|
22480
|
+
// src/umb-management-api/tools/searcher/get/get-searcher-by-searcher-name-query.ts
|
|
22481
|
+
var combinedSchema = getSearcherBySearcherNameQueryParams.merge(getSearcherBySearcherNameQueryQueryParams);
|
|
22482
|
+
var GetSearcherBySearcherNameQueryTool = CreateUmbracoTool(
|
|
22483
|
+
"get-searcher-by-searcher-name-query",
|
|
22484
|
+
`Gets search results from a specific searcher by name with query parameters.
|
|
22485
|
+
Returns search results from the specified searcher with pagination support.`,
|
|
22486
|
+
combinedSchema.shape,
|
|
22487
|
+
async (model) => {
|
|
22488
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22489
|
+
const { searcherName, ...queryParams } = model;
|
|
22490
|
+
const response = await client.getSearcherBySearcherNameQuery(searcherName, queryParams);
|
|
22491
|
+
return {
|
|
22492
|
+
content: [
|
|
22493
|
+
{
|
|
22494
|
+
type: "text",
|
|
22495
|
+
text: JSON.stringify(response)
|
|
22496
|
+
}
|
|
22497
|
+
]
|
|
22498
|
+
};
|
|
22499
|
+
}
|
|
22500
|
+
);
|
|
22501
|
+
var get_searcher_by_searcher_name_query_default = GetSearcherBySearcherNameQueryTool;
|
|
22502
|
+
|
|
22503
|
+
// src/umb-management-api/tools/searcher/index.ts
|
|
22504
|
+
var SearcherCollection = {
|
|
22505
|
+
metadata: {
|
|
22506
|
+
name: "searcher",
|
|
22507
|
+
displayName: "Searcher",
|
|
22508
|
+
description: "Searcher management and query operations",
|
|
22509
|
+
dependencies: []
|
|
22510
|
+
},
|
|
22511
|
+
tools: (user) => {
|
|
22512
|
+
const tools = [];
|
|
22513
|
+
if (AuthorizationPolicies.SectionAccessSettings(user)) {
|
|
22514
|
+
tools.push(get_searcher_default());
|
|
22515
|
+
tools.push(get_searcher_by_searcher_name_query_default());
|
|
22516
|
+
}
|
|
22517
|
+
return tools;
|
|
22518
|
+
}
|
|
22519
|
+
};
|
|
22520
|
+
|
|
22521
|
+
// src/umb-management-api/tools/indexer/get/get-indexer.ts
|
|
22522
|
+
var GetIndexerTool = CreateUmbracoTool(
|
|
22523
|
+
"get-indexer",
|
|
22524
|
+
`Lists all indexes with pagination support.
|
|
22525
|
+
Returns an object containing:
|
|
22526
|
+
- total: Total number of indexes (number)
|
|
22527
|
+
- items: Array of index objects with name, searcherName, and other properties`,
|
|
22528
|
+
getIndexerQueryParams.shape,
|
|
22529
|
+
async (model) => {
|
|
22530
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22531
|
+
const response = await client.getIndexer(model);
|
|
22532
|
+
return {
|
|
22533
|
+
content: [
|
|
22534
|
+
{
|
|
22535
|
+
type: "text",
|
|
22536
|
+
text: JSON.stringify(response)
|
|
22537
|
+
}
|
|
22538
|
+
]
|
|
22539
|
+
};
|
|
22540
|
+
}
|
|
22541
|
+
);
|
|
22542
|
+
var get_indexer_default = GetIndexerTool;
|
|
22543
|
+
|
|
22544
|
+
// src/umb-management-api/tools/indexer/get/get-indexer-by-index-name.ts
|
|
22545
|
+
var GetIndexerByIndexNameTool = CreateUmbracoTool(
|
|
22546
|
+
"get-indexer-by-index-name",
|
|
22547
|
+
`Gets a specific index by its name.
|
|
22548
|
+
Returns detailed information about the index including its configuration and status.`,
|
|
22549
|
+
getIndexerByIndexNameParams.shape,
|
|
22550
|
+
async (model) => {
|
|
22551
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22552
|
+
const response = await client.getIndexerByIndexName(model.indexName);
|
|
22553
|
+
return {
|
|
22554
|
+
content: [
|
|
22555
|
+
{
|
|
22556
|
+
type: "text",
|
|
22557
|
+
text: JSON.stringify(response)
|
|
22558
|
+
}
|
|
22559
|
+
]
|
|
22560
|
+
};
|
|
22561
|
+
}
|
|
22562
|
+
);
|
|
22563
|
+
var get_indexer_by_index_name_default = GetIndexerByIndexNameTool;
|
|
22564
|
+
|
|
22565
|
+
// src/umb-management-api/tools/indexer/post/post-indexer-by-index-name-rebuild.ts
|
|
22566
|
+
var PostIndexerByIndexNameRebuildTool = CreateUmbracoTool(
|
|
22567
|
+
"post-indexer-by-index-name-rebuild",
|
|
22568
|
+
`Rebuilds a specific index by name.
|
|
22569
|
+
This operation will trigger a full rebuild of the index, which may take some time depending on the amount of content.
|
|
22570
|
+
Use this only when asked to by the user.`,
|
|
22571
|
+
postIndexerByIndexNameRebuildParams.shape,
|
|
22572
|
+
async (model) => {
|
|
22573
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22574
|
+
await client.postIndexerByIndexNameRebuild(model.indexName);
|
|
22575
|
+
return {
|
|
22576
|
+
content: [
|
|
22577
|
+
{
|
|
22578
|
+
type: "text",
|
|
22579
|
+
text: `Index rebuild initiated for: ${model.indexName}`
|
|
22580
|
+
}
|
|
22581
|
+
]
|
|
22582
|
+
};
|
|
22583
|
+
}
|
|
22584
|
+
);
|
|
22585
|
+
var post_indexer_by_index_name_rebuild_default = PostIndexerByIndexNameRebuildTool;
|
|
22586
|
+
|
|
22587
|
+
// src/umb-management-api/tools/indexer/index.ts
|
|
22588
|
+
var IndexerCollection = {
|
|
22589
|
+
metadata: {
|
|
22590
|
+
name: "indexer",
|
|
22591
|
+
displayName: "Indexer",
|
|
22592
|
+
description: "Index management and configuration operations",
|
|
22593
|
+
dependencies: []
|
|
22594
|
+
},
|
|
22595
|
+
tools: (user) => {
|
|
22596
|
+
const tools = [];
|
|
22597
|
+
if (AuthorizationPolicies.SectionAccessSettings(user)) {
|
|
22598
|
+
tools.push(get_indexer_default());
|
|
22599
|
+
tools.push(get_indexer_by_index_name_default());
|
|
22600
|
+
tools.push(post_indexer_by_index_name_rebuild_default());
|
|
22601
|
+
}
|
|
22602
|
+
return tools;
|
|
22603
|
+
}
|
|
22604
|
+
};
|
|
22605
|
+
|
|
22606
|
+
// src/umb-management-api/tools/imaging/get/get-imaging-resize-urls.ts
|
|
22607
|
+
var GetImagingResizeUrlsTool = CreateUmbracoTool(
|
|
22608
|
+
"get-imaging-resize-urls",
|
|
22609
|
+
`Generates resized image URLs for media items.
|
|
22610
|
+
Takes media item IDs and resize parameters to generate optimized image URLs.
|
|
22611
|
+
Returns an object containing:
|
|
22612
|
+
- Array of media items with their resize URL information
|
|
22613
|
+
- Each item includes the media ID and URL info with culture and resized URLs
|
|
22614
|
+
|
|
22615
|
+
Parameters:
|
|
22616
|
+
- id: Array of media item UUIDs
|
|
22617
|
+
- height: Target height in pixels (default: 200)
|
|
22618
|
+
- width: Target width in pixels (default: 200)
|
|
22619
|
+
- mode: Resize mode (Crop, Max, Stretch, Pad, BoxPad, Min)`,
|
|
22620
|
+
getImagingResizeUrlsQueryParams.shape,
|
|
22621
|
+
async (model) => {
|
|
22622
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22623
|
+
const response = await client.getImagingResizeUrls(model);
|
|
22624
|
+
return {
|
|
22625
|
+
content: [
|
|
22626
|
+
{
|
|
22627
|
+
type: "text",
|
|
22628
|
+
text: JSON.stringify(response)
|
|
22629
|
+
}
|
|
22630
|
+
]
|
|
22631
|
+
};
|
|
22632
|
+
}
|
|
22633
|
+
);
|
|
22634
|
+
var get_imaging_resize_urls_default = GetImagingResizeUrlsTool;
|
|
22635
|
+
|
|
22636
|
+
// src/umb-management-api/tools/imaging/index.ts
|
|
22637
|
+
var ImagingCollection = {
|
|
22638
|
+
metadata: {
|
|
22639
|
+
name: "imaging",
|
|
22640
|
+
displayName: "Imaging",
|
|
22641
|
+
description: "Image processing and URL generation utilities",
|
|
22642
|
+
dependencies: ["media"]
|
|
22643
|
+
},
|
|
22644
|
+
tools: (user) => {
|
|
22645
|
+
const tools = [];
|
|
22646
|
+
if (AuthorizationPolicies.SectionAccessContentOrMedia(user)) {
|
|
22647
|
+
tools.push(get_imaging_resize_urls_default());
|
|
22648
|
+
}
|
|
22649
|
+
return tools;
|
|
22650
|
+
}
|
|
22651
|
+
};
|
|
22652
|
+
|
|
22653
|
+
// src/umb-management-api/tools/relation-type/get/get-relation-type.ts
|
|
22654
|
+
var GetRelationTypeTool = CreateUmbracoTool(
|
|
22655
|
+
"get-relation-type",
|
|
22656
|
+
"Gets all relation types with pagination",
|
|
22657
|
+
getRelationTypeQueryParams.shape,
|
|
22658
|
+
async (model) => {
|
|
22659
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22660
|
+
const response = await client.getRelationType(model);
|
|
22661
|
+
return {
|
|
22662
|
+
content: [
|
|
22663
|
+
{
|
|
22664
|
+
type: "text",
|
|
22665
|
+
text: JSON.stringify(response)
|
|
22666
|
+
}
|
|
22667
|
+
]
|
|
22668
|
+
};
|
|
22669
|
+
}
|
|
22670
|
+
);
|
|
22671
|
+
var get_relation_type_default = GetRelationTypeTool;
|
|
22672
|
+
|
|
22673
|
+
// src/umb-management-api/tools/relation-type/get/get-relation-type-by-id.ts
|
|
22674
|
+
var GetRelationTypeByIdTool = CreateUmbracoTool(
|
|
22675
|
+
"get-relation-type-by-id",
|
|
22676
|
+
"Gets a relation type by Id",
|
|
22677
|
+
getRelationTypeByIdParams.shape,
|
|
22678
|
+
async ({ id }) => {
|
|
22679
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22680
|
+
const response = await client.getRelationTypeById(id);
|
|
22681
|
+
return {
|
|
22682
|
+
content: [
|
|
22683
|
+
{
|
|
22684
|
+
type: "text",
|
|
22685
|
+
text: JSON.stringify(response)
|
|
22686
|
+
}
|
|
22687
|
+
]
|
|
22688
|
+
};
|
|
22689
|
+
}
|
|
22690
|
+
);
|
|
22691
|
+
var get_relation_type_by_id_default = GetRelationTypeByIdTool;
|
|
22692
|
+
|
|
22693
|
+
// src/umb-management-api/tools/relation-type/index.ts
|
|
22694
|
+
var RelationTypeCollection = {
|
|
22695
|
+
metadata: {
|
|
22696
|
+
name: "relation-type",
|
|
22697
|
+
displayName: "Relation Type",
|
|
22698
|
+
description: "Relation type management and configuration"
|
|
22699
|
+
},
|
|
22700
|
+
tools: (user) => {
|
|
22701
|
+
const tools = [];
|
|
22702
|
+
if (AuthorizationPolicies.TreeAccessRelationTypes(user)) {
|
|
22703
|
+
tools.push(get_relation_type_default());
|
|
22704
|
+
tools.push(get_relation_type_by_id_default());
|
|
22705
|
+
}
|
|
22706
|
+
return tools;
|
|
22707
|
+
}
|
|
22708
|
+
};
|
|
22709
|
+
|
|
22710
|
+
// src/umb-management-api/tools/relation/get/get-relation-by-relation-type-id.ts
|
|
22711
|
+
import { z as z64 } from "zod";
|
|
22712
|
+
var GetRelationByRelationTypeIdTool = CreateUmbracoTool(
|
|
22713
|
+
"get-relation-by-relation-type-id",
|
|
22714
|
+
"Gets relations by relation type ID",
|
|
22715
|
+
z64.object({
|
|
22716
|
+
...getRelationByRelationTypeIdParams.shape,
|
|
22717
|
+
...getRelationByRelationTypeIdQueryParams.shape
|
|
22718
|
+
}).shape,
|
|
22719
|
+
async ({ id, skip, take }) => {
|
|
22720
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22721
|
+
const response = await client.getRelationByRelationTypeId(id, {
|
|
22722
|
+
skip,
|
|
22723
|
+
take
|
|
22724
|
+
});
|
|
22725
|
+
return {
|
|
22726
|
+
content: [
|
|
22727
|
+
{
|
|
22728
|
+
type: "text",
|
|
22729
|
+
text: JSON.stringify(response)
|
|
22730
|
+
}
|
|
22731
|
+
]
|
|
22732
|
+
};
|
|
22733
|
+
}
|
|
22734
|
+
);
|
|
22735
|
+
var get_relation_by_relation_type_id_default = GetRelationByRelationTypeIdTool;
|
|
22736
|
+
|
|
22737
|
+
// src/umb-management-api/tools/relation/index.ts
|
|
22738
|
+
var RelationCollection = {
|
|
22739
|
+
metadata: {
|
|
22740
|
+
name: "relation",
|
|
22741
|
+
displayName: "Relation",
|
|
22742
|
+
description: "Relation management and querying"
|
|
22743
|
+
},
|
|
22744
|
+
tools: (user) => {
|
|
22745
|
+
const tools = [];
|
|
22746
|
+
if (AuthorizationPolicies.TreeAccessRelationTypes(user)) {
|
|
22747
|
+
tools.push(get_relation_by_relation_type_id_default());
|
|
22748
|
+
}
|
|
22749
|
+
return tools;
|
|
22750
|
+
}
|
|
22751
|
+
};
|
|
22752
|
+
|
|
22753
|
+
// src/umb-management-api/tools/user/get/get-user.ts
|
|
22754
|
+
var GetUserTool = CreateUmbracoTool(
|
|
22755
|
+
"get-user",
|
|
22756
|
+
"Lists users with pagination and filtering options",
|
|
22757
|
+
getUserQueryParams.shape,
|
|
22758
|
+
async (params) => {
|
|
22759
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22760
|
+
const response = await client.getUser(params);
|
|
22761
|
+
return {
|
|
22762
|
+
content: [
|
|
22763
|
+
{
|
|
22764
|
+
type: "text",
|
|
22765
|
+
text: JSON.stringify(response)
|
|
22766
|
+
}
|
|
22767
|
+
]
|
|
22768
|
+
};
|
|
22769
|
+
}
|
|
22770
|
+
);
|
|
22771
|
+
var get_user_default = GetUserTool;
|
|
22772
|
+
|
|
22773
|
+
// src/umb-management-api/tools/user/get/get-user-by-id.ts
|
|
22774
|
+
var GetUserByIdTool = CreateUmbracoTool(
|
|
22775
|
+
"get-user-by-id",
|
|
22776
|
+
"Gets a user by their unique identifier",
|
|
22777
|
+
getUserByIdParams.shape,
|
|
22778
|
+
async ({ id }) => {
|
|
22779
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22780
|
+
const response = await client.getUserById(id);
|
|
22781
|
+
return {
|
|
22782
|
+
content: [
|
|
22783
|
+
{
|
|
22784
|
+
type: "text",
|
|
22785
|
+
text: JSON.stringify(response)
|
|
22786
|
+
}
|
|
22787
|
+
]
|
|
22788
|
+
};
|
|
22789
|
+
}
|
|
22790
|
+
);
|
|
22791
|
+
var get_user_by_id_default = GetUserByIdTool;
|
|
22792
|
+
|
|
22793
|
+
// src/umb-management-api/tools/user/get/find-user.ts
|
|
22794
|
+
var FindUserTool = CreateUmbracoTool(
|
|
22795
|
+
"find-user",
|
|
22796
|
+
"Finds users by filtering with name, email, or other criteria",
|
|
22797
|
+
getFilterUserQueryParams.shape,
|
|
22798
|
+
async (params) => {
|
|
22799
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22800
|
+
const response = await client.getFilterUser(params);
|
|
22801
|
+
return {
|
|
22802
|
+
content: [
|
|
22803
|
+
{
|
|
22804
|
+
type: "text",
|
|
22805
|
+
text: JSON.stringify(response)
|
|
22806
|
+
}
|
|
22807
|
+
]
|
|
22808
|
+
};
|
|
22809
|
+
}
|
|
22810
|
+
);
|
|
22811
|
+
var find_user_default = FindUserTool;
|
|
22812
|
+
|
|
22813
|
+
// src/umb-management-api/tools/user/get/get-item-user.ts
|
|
22814
|
+
var GetItemUserTool = CreateUmbracoTool(
|
|
22815
|
+
"get-item-user",
|
|
22816
|
+
"Gets user items for selection lists and pickers",
|
|
22817
|
+
getItemUserQueryParams.shape,
|
|
22818
|
+
async (params) => {
|
|
22819
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22820
|
+
const response = await client.getItemUser(params);
|
|
22821
|
+
return {
|
|
22822
|
+
content: [
|
|
22823
|
+
{
|
|
22824
|
+
type: "text",
|
|
22825
|
+
text: JSON.stringify(response)
|
|
22826
|
+
}
|
|
22827
|
+
]
|
|
22828
|
+
};
|
|
22829
|
+
}
|
|
22830
|
+
);
|
|
22831
|
+
var get_item_user_default = GetItemUserTool;
|
|
22832
|
+
|
|
22833
|
+
// src/umb-management-api/tools/user/get/get-user-current.ts
|
|
22834
|
+
var GetUserCurrentTool = CreateUmbracoTool(
|
|
22835
|
+
"get-user-current",
|
|
22836
|
+
"Gets the current authenticated user's information",
|
|
22837
|
+
{},
|
|
22838
|
+
// No parameters required
|
|
22839
|
+
async () => {
|
|
22840
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22841
|
+
const response = await client.getUserCurrent();
|
|
22842
|
+
return {
|
|
22843
|
+
content: [
|
|
22844
|
+
{
|
|
22845
|
+
type: "text",
|
|
22846
|
+
text: JSON.stringify(response)
|
|
22847
|
+
}
|
|
22848
|
+
]
|
|
22849
|
+
};
|
|
22850
|
+
}
|
|
22851
|
+
);
|
|
22852
|
+
var get_user_current_default = GetUserCurrentTool;
|
|
22853
|
+
|
|
22854
|
+
// src/umb-management-api/tools/user/get/get-user-configuration.ts
|
|
22855
|
+
var GetUserConfigurationTool = CreateUmbracoTool(
|
|
22856
|
+
"get-user-configuration",
|
|
22857
|
+
"Gets user configuration settings including user invitation settings and password requirements",
|
|
22858
|
+
{},
|
|
22859
|
+
async () => {
|
|
22860
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22861
|
+
const response = await client.getUserConfiguration();
|
|
22862
|
+
return {
|
|
22863
|
+
content: [
|
|
22864
|
+
{
|
|
22865
|
+
type: "text",
|
|
22866
|
+
text: JSON.stringify(response, null, 2)
|
|
22867
|
+
}
|
|
22868
|
+
]
|
|
22869
|
+
};
|
|
22870
|
+
}
|
|
22871
|
+
);
|
|
22872
|
+
var get_user_configuration_default = GetUserConfigurationTool;
|
|
22873
|
+
|
|
22874
|
+
// src/umb-management-api/tools/user/get/get-user-current-configuration.ts
|
|
22875
|
+
var GetUserCurrentConfigurationTool = CreateUmbracoTool(
|
|
22876
|
+
"get-user-current-configuration",
|
|
22877
|
+
"Gets current user configuration settings including login preferences and password requirements",
|
|
22878
|
+
{},
|
|
22879
|
+
async () => {
|
|
22880
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22881
|
+
const response = await client.getUserCurrentConfiguration();
|
|
22882
|
+
return {
|
|
22883
|
+
content: [
|
|
22884
|
+
{
|
|
22885
|
+
type: "text",
|
|
22886
|
+
text: JSON.stringify(response, null, 2)
|
|
22887
|
+
}
|
|
22888
|
+
]
|
|
22889
|
+
};
|
|
22890
|
+
}
|
|
22891
|
+
);
|
|
22892
|
+
var get_user_current_configuration_default = GetUserCurrentConfigurationTool;
|
|
22893
|
+
|
|
22894
|
+
// src/umb-management-api/tools/user/get/get-user-current-login-providers.ts
|
|
22895
|
+
var GetUserCurrentLoginProvidersTool = CreateUmbracoTool(
|
|
22896
|
+
"get-user-current-login-providers",
|
|
22897
|
+
"Gets the current user's available login providers",
|
|
22898
|
+
{},
|
|
22899
|
+
// No parameters required
|
|
22900
|
+
async () => {
|
|
22901
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22902
|
+
const response = await client.getUserCurrentLoginProviders();
|
|
22903
|
+
return {
|
|
22904
|
+
content: [
|
|
22905
|
+
{
|
|
22906
|
+
type: "text",
|
|
22907
|
+
text: JSON.stringify(response)
|
|
22908
|
+
}
|
|
22909
|
+
]
|
|
22910
|
+
};
|
|
22911
|
+
}
|
|
22912
|
+
);
|
|
22913
|
+
var get_user_current_login_providers_default = GetUserCurrentLoginProvidersTool;
|
|
22914
|
+
|
|
22915
|
+
// src/umb-management-api/tools/user/get/get-user-current-permissions.ts
|
|
22916
|
+
var GetUserCurrentPermissionsTool = CreateUmbracoTool(
|
|
22917
|
+
"get-user-current-permissions",
|
|
22918
|
+
"Gets the current user's permissions for the specified entity",
|
|
22919
|
+
getUserCurrentPermissionsQueryParams.shape,
|
|
22920
|
+
async (params) => {
|
|
22921
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22922
|
+
const response = await client.getUserCurrentPermissions(params);
|
|
22923
|
+
return {
|
|
22924
|
+
content: [
|
|
22925
|
+
{
|
|
22926
|
+
type: "text",
|
|
22927
|
+
text: JSON.stringify(response)
|
|
22928
|
+
}
|
|
22929
|
+
]
|
|
22930
|
+
};
|
|
22931
|
+
}
|
|
22932
|
+
);
|
|
22933
|
+
var get_user_current_permissions_default = GetUserCurrentPermissionsTool;
|
|
22934
|
+
|
|
22935
|
+
// src/umb-management-api/tools/user/get/get-user-current-permissions-document.ts
|
|
22936
|
+
var GetUserCurrentPermissionsDocumentTool = CreateUmbracoTool(
|
|
22937
|
+
"get-user-current-permissions-document",
|
|
22938
|
+
"Gets the current user's document permissions for specific documents",
|
|
22939
|
+
getUserCurrentPermissionsDocumentQueryParams.shape,
|
|
22940
|
+
async (params) => {
|
|
22941
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22942
|
+
const response = await client.getUserCurrentPermissionsDocument(params);
|
|
22943
|
+
return {
|
|
22944
|
+
content: [
|
|
22945
|
+
{
|
|
22946
|
+
type: "text",
|
|
22947
|
+
text: JSON.stringify(response)
|
|
22948
|
+
}
|
|
22949
|
+
]
|
|
22950
|
+
};
|
|
22951
|
+
}
|
|
22952
|
+
);
|
|
22953
|
+
var get_user_current_permissions_document_default = GetUserCurrentPermissionsDocumentTool;
|
|
22954
|
+
|
|
22955
|
+
// src/umb-management-api/tools/user/get/get-user-current-permissions-media.ts
|
|
22956
|
+
var GetUserCurrentPermissionsMediaTool = CreateUmbracoTool(
|
|
22957
|
+
"get-user-current-permissions-media",
|
|
22958
|
+
"Gets the current user's media permissions for specific media items",
|
|
22959
|
+
getUserCurrentPermissionsMediaQueryParams.shape,
|
|
22960
|
+
async (params) => {
|
|
22961
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22962
|
+
const response = await client.getUserCurrentPermissionsMedia(params);
|
|
22963
|
+
return {
|
|
22964
|
+
content: [
|
|
22965
|
+
{
|
|
22966
|
+
type: "text",
|
|
22967
|
+
text: JSON.stringify(response)
|
|
22968
|
+
}
|
|
22969
|
+
]
|
|
22970
|
+
};
|
|
22971
|
+
}
|
|
22972
|
+
);
|
|
22973
|
+
var get_user_current_permissions_media_default = GetUserCurrentPermissionsMediaTool;
|
|
22974
|
+
|
|
22975
|
+
// src/umb-management-api/tools/user/get/get-user-by-id-calculate-start-nodes.ts
|
|
22976
|
+
var GetUserByIdCalculateStartNodesTool = CreateUmbracoTool(
|
|
22977
|
+
"get-user-by-id-calculate-start-nodes",
|
|
22978
|
+
"Calculates start nodes for a user by their ID based on permissions",
|
|
22979
|
+
getUserByIdCalculateStartNodesParams.shape,
|
|
22980
|
+
async ({ id }) => {
|
|
22981
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22982
|
+
const response = await client.getUserByIdCalculateStartNodes(id);
|
|
22983
|
+
return {
|
|
22984
|
+
content: [
|
|
22985
|
+
{
|
|
22986
|
+
type: "text",
|
|
22987
|
+
text: JSON.stringify(response)
|
|
22988
|
+
}
|
|
22989
|
+
]
|
|
22990
|
+
};
|
|
22991
|
+
}
|
|
22992
|
+
);
|
|
22993
|
+
var get_user_by_id_calculate_start_nodes_default = GetUserByIdCalculateStartNodesTool;
|
|
22994
|
+
|
|
22995
|
+
// src/umb-management-api/tools/user/post/upload-user-avatar-by-id.ts
|
|
22996
|
+
var UploadUserAvatarByIdTool = CreateUmbracoTool(
|
|
22997
|
+
"upload-user-avatar-by-id",
|
|
22998
|
+
"Uploads an avatar for a specific user by ID (admin only or self-service)",
|
|
22999
|
+
{
|
|
23000
|
+
...postUserAvatarByIdParams.shape,
|
|
23001
|
+
...postUserAvatarByIdBody.shape
|
|
23002
|
+
},
|
|
23003
|
+
async ({ id, file }) => {
|
|
23004
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23005
|
+
const response = await client.postUserAvatarById(id, { file });
|
|
23006
|
+
return {
|
|
23007
|
+
content: [
|
|
23008
|
+
{
|
|
23009
|
+
type: "text",
|
|
23010
|
+
text: JSON.stringify(response)
|
|
23011
|
+
}
|
|
23012
|
+
]
|
|
23013
|
+
};
|
|
23014
|
+
}
|
|
23015
|
+
);
|
|
23016
|
+
var upload_user_avatar_by_id_default = UploadUserAvatarByIdTool;
|
|
23017
|
+
|
|
23018
|
+
// src/umb-management-api/tools/user/post/upload-user-current-avatar.ts
|
|
23019
|
+
var UploadUserCurrentAvatarTool = CreateUmbracoTool(
|
|
23020
|
+
"upload-user-current-avatar",
|
|
23021
|
+
"Uploads an avatar for the current authenticated user",
|
|
23022
|
+
postUserCurrentAvatarBody.shape,
|
|
23023
|
+
async ({ file }) => {
|
|
23024
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23025
|
+
const response = await client.postUserCurrentAvatar({ file });
|
|
23026
|
+
return {
|
|
23027
|
+
content: [
|
|
23028
|
+
{
|
|
23029
|
+
type: "text",
|
|
23030
|
+
text: JSON.stringify(response)
|
|
23031
|
+
}
|
|
23032
|
+
]
|
|
23033
|
+
};
|
|
23034
|
+
}
|
|
23035
|
+
);
|
|
23036
|
+
var upload_user_current_avatar_default = UploadUserCurrentAvatarTool;
|
|
23037
|
+
|
|
23038
|
+
// src/umb-management-api/tools/user/delete/delete-user-avatar-by-id.ts
|
|
23039
|
+
var DeleteUserAvatarByIdTool = CreateUmbracoTool(
|
|
23040
|
+
"delete-user-avatar-by-id",
|
|
23041
|
+
"Deletes an avatar for a specific user by ID (admin only or self-service)",
|
|
23042
|
+
deleteUserAvatarByIdParams.shape,
|
|
23043
|
+
async ({ id }) => {
|
|
23044
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23045
|
+
const response = await client.deleteUserAvatarById(id);
|
|
23046
|
+
return {
|
|
23047
|
+
content: [
|
|
23048
|
+
{
|
|
23049
|
+
type: "text",
|
|
23050
|
+
text: JSON.stringify(response)
|
|
23051
|
+
}
|
|
23052
|
+
]
|
|
23053
|
+
};
|
|
23054
|
+
}
|
|
23055
|
+
);
|
|
23056
|
+
var delete_user_avatar_by_id_default = DeleteUserAvatarByIdTool;
|
|
23057
|
+
|
|
23058
|
+
// src/umb-management-api/tools/user/index.ts
|
|
23059
|
+
var UserCollection = {
|
|
23060
|
+
metadata: {
|
|
23061
|
+
name: "user",
|
|
23062
|
+
displayName: "Users",
|
|
23063
|
+
description: "User account management and administration",
|
|
23064
|
+
dependencies: []
|
|
23065
|
+
},
|
|
23066
|
+
tools: (user) => {
|
|
23067
|
+
const tools = [];
|
|
23068
|
+
tools.push(get_user_current_default());
|
|
23069
|
+
tools.push(get_user_current_configuration_default());
|
|
23070
|
+
tools.push(get_user_current_login_providers_default());
|
|
23071
|
+
tools.push(get_user_current_permissions_default());
|
|
23072
|
+
tools.push(get_user_current_permissions_document_default());
|
|
23073
|
+
tools.push(get_user_current_permissions_media_default());
|
|
23074
|
+
tools.push(upload_user_current_avatar_default());
|
|
23075
|
+
if (AuthorizationPolicies.SectionAccessUsers(user)) {
|
|
23076
|
+
tools.push(get_user_default());
|
|
23077
|
+
tools.push(get_user_by_id_default());
|
|
23078
|
+
tools.push(find_user_default());
|
|
23079
|
+
tools.push(get_item_user_default());
|
|
23080
|
+
tools.push(get_user_configuration_default());
|
|
23081
|
+
tools.push(get_user_by_id_calculate_start_nodes_default());
|
|
23082
|
+
tools.push(upload_user_avatar_by_id_default());
|
|
23083
|
+
tools.push(delete_user_avatar_by_id_default());
|
|
23084
|
+
}
|
|
23085
|
+
return tools;
|
|
23086
|
+
}
|
|
23087
|
+
};
|
|
23088
|
+
|
|
23089
|
+
// src/umb-management-api/tools/user-data/post/create-user-data.ts
|
|
23090
|
+
var CreateUserDataTool = CreateUmbracoTool(
|
|
23091
|
+
"create-user-data",
|
|
23092
|
+
"Creates a new user data record",
|
|
23093
|
+
postUserDataBody.shape,
|
|
23094
|
+
async (body) => {
|
|
23095
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23096
|
+
const response = await client.postUserData(body);
|
|
23097
|
+
return {
|
|
23098
|
+
content: [
|
|
23099
|
+
{
|
|
23100
|
+
type: "text",
|
|
23101
|
+
text: JSON.stringify(response)
|
|
23102
|
+
}
|
|
23103
|
+
]
|
|
23104
|
+
};
|
|
23105
|
+
}
|
|
23106
|
+
);
|
|
23107
|
+
var create_user_data_default = CreateUserDataTool;
|
|
23108
|
+
|
|
23109
|
+
// src/umb-management-api/tools/user-data/put/update-user-data.ts
|
|
23110
|
+
var UpdateUserDataTool = CreateUmbracoTool(
|
|
23111
|
+
"update-user-data",
|
|
23112
|
+
"Updates an existing user data record",
|
|
23113
|
+
putUserDataBody.shape,
|
|
23114
|
+
async (body) => {
|
|
23115
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23116
|
+
const response = await client.putUserData(body);
|
|
23117
|
+
return {
|
|
23118
|
+
content: [
|
|
23119
|
+
{
|
|
23120
|
+
type: "text",
|
|
23121
|
+
text: JSON.stringify(response)
|
|
23122
|
+
}
|
|
23123
|
+
]
|
|
23124
|
+
};
|
|
23125
|
+
}
|
|
23126
|
+
);
|
|
23127
|
+
var update_user_data_default = UpdateUserDataTool;
|
|
23128
|
+
|
|
23129
|
+
// src/umb-management-api/tools/user-data/get/get-user-data.ts
|
|
23130
|
+
var GetUserDataTool = CreateUmbracoTool(
|
|
23131
|
+
"get-user-data",
|
|
23132
|
+
"Retrieves user data records with pagination and filtering",
|
|
23133
|
+
getUserDataQueryParams.shape,
|
|
23134
|
+
async (params) => {
|
|
23135
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23136
|
+
const response = await client.getUserData(params);
|
|
23137
|
+
return {
|
|
23138
|
+
content: [
|
|
23139
|
+
{
|
|
23140
|
+
type: "text",
|
|
23141
|
+
text: JSON.stringify(response)
|
|
23142
|
+
}
|
|
23143
|
+
]
|
|
23144
|
+
};
|
|
23145
|
+
}
|
|
23146
|
+
);
|
|
23147
|
+
var get_user_data_default = GetUserDataTool;
|
|
23148
|
+
|
|
23149
|
+
// src/umb-management-api/tools/user-data/get/get-user-data-by-id.ts
|
|
23150
|
+
var GetUserDataByIdTool = CreateUmbracoTool(
|
|
23151
|
+
"get-user-data-by-id",
|
|
23152
|
+
"Retrieves a specific personal key-value storage record by its unique identifier for the authenticated user. User data stores user preferences, settings, and configuration values that persist permanently and are organized by group (category) and identifier (key).",
|
|
23153
|
+
getUserDataByIdParams.shape,
|
|
23154
|
+
async ({ id }) => {
|
|
23155
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23156
|
+
const response = await client.getUserDataById(id);
|
|
23157
|
+
return {
|
|
23158
|
+
content: [
|
|
23159
|
+
{
|
|
23160
|
+
type: "text",
|
|
23161
|
+
text: JSON.stringify(response)
|
|
23162
|
+
}
|
|
23163
|
+
]
|
|
23164
|
+
};
|
|
23165
|
+
}
|
|
23166
|
+
);
|
|
23167
|
+
var get_user_data_by_id_default = GetUserDataByIdTool;
|
|
23168
|
+
|
|
23169
|
+
// src/umb-management-api/tools/user-data/index.ts
|
|
23170
|
+
var UserDataCollection = {
|
|
23171
|
+
metadata: {
|
|
23172
|
+
name: "user-data",
|
|
23173
|
+
displayName: "User Data",
|
|
23174
|
+
description: "Personal key-value storage for authenticated users - manage preferences, settings, and application state",
|
|
23175
|
+
dependencies: []
|
|
23176
|
+
},
|
|
23177
|
+
tools: (user) => {
|
|
23178
|
+
const tools = [];
|
|
23179
|
+
tools.push(create_user_data_default());
|
|
23180
|
+
tools.push(update_user_data_default());
|
|
23181
|
+
tools.push(get_user_data_default());
|
|
23182
|
+
tools.push(get_user_data_by_id_default());
|
|
23183
|
+
return tools;
|
|
23184
|
+
}
|
|
23185
|
+
};
|
|
23186
|
+
|
|
23187
|
+
// src/umb-management-api/tools/static-file/items/get/get-static-files.ts
|
|
23188
|
+
var GetStaticFilesTool = CreateUmbracoTool(
|
|
23189
|
+
"get-static-files",
|
|
23190
|
+
"Lists static files with optional path filtering for browsing the file system",
|
|
23191
|
+
getItemStaticFileQueryParams.shape,
|
|
23192
|
+
async (params) => {
|
|
23193
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23194
|
+
const response = await client.getItemStaticFile(params);
|
|
23195
|
+
return {
|
|
23196
|
+
content: [
|
|
23197
|
+
{
|
|
23198
|
+
type: "text",
|
|
23199
|
+
text: JSON.stringify(response)
|
|
23200
|
+
}
|
|
23201
|
+
]
|
|
23202
|
+
};
|
|
23203
|
+
}
|
|
23204
|
+
);
|
|
23205
|
+
var get_static_files_default = GetStaticFilesTool;
|
|
23206
|
+
|
|
23207
|
+
// src/umb-management-api/tools/static-file/items/get/get-root.ts
|
|
23208
|
+
var GetStaticFileRootTool = CreateUmbracoTool(
|
|
23209
|
+
"get-static-file-root",
|
|
23210
|
+
"Gets root-level static files and folders in the Umbraco file system",
|
|
23211
|
+
getTreeStaticFileRootQueryParams.shape,
|
|
23212
|
+
async (params) => {
|
|
23213
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23214
|
+
const response = await client.getTreeStaticFileRoot(params);
|
|
23215
|
+
return {
|
|
23216
|
+
content: [
|
|
23217
|
+
{
|
|
23218
|
+
type: "text",
|
|
23219
|
+
text: JSON.stringify(response)
|
|
23220
|
+
}
|
|
23221
|
+
]
|
|
23222
|
+
};
|
|
23223
|
+
}
|
|
23224
|
+
);
|
|
23225
|
+
var get_root_default13 = GetStaticFileRootTool;
|
|
23226
|
+
|
|
23227
|
+
// src/umb-management-api/tools/static-file/items/get/get-children.ts
|
|
23228
|
+
var GetStaticFileChildrenTool = CreateUmbracoTool(
|
|
23229
|
+
"get-static-file-children",
|
|
23230
|
+
"Lists child files and folders in a static file directory by parent path",
|
|
23231
|
+
getTreeStaticFileChildrenQueryParams.shape,
|
|
23232
|
+
async (params) => {
|
|
23233
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23234
|
+
const response = await client.getTreeStaticFileChildren(params);
|
|
23235
|
+
return {
|
|
23236
|
+
content: [
|
|
23237
|
+
{
|
|
23238
|
+
type: "text",
|
|
23239
|
+
text: JSON.stringify(response)
|
|
23240
|
+
}
|
|
23241
|
+
]
|
|
23242
|
+
};
|
|
23243
|
+
}
|
|
23244
|
+
);
|
|
23245
|
+
var get_children_default11 = GetStaticFileChildrenTool;
|
|
23246
|
+
|
|
23247
|
+
// src/umb-management-api/tools/static-file/items/get/get-ancestors.ts
|
|
23248
|
+
var GetStaticFileAncestorsTool = CreateUmbracoTool(
|
|
23249
|
+
"get-static-file-ancestors",
|
|
23250
|
+
"Gets ancestor folders for navigation breadcrumbs by descendant path",
|
|
23251
|
+
getTreeStaticFileAncestorsQueryParams.shape,
|
|
23252
|
+
async (params) => {
|
|
23253
|
+
const client = UmbracoManagementClient2.getClient();
|
|
23254
|
+
const response = await client.getTreeStaticFileAncestors(params);
|
|
23255
|
+
return {
|
|
23256
|
+
content: [
|
|
23257
|
+
{
|
|
23258
|
+
type: "text",
|
|
23259
|
+
text: JSON.stringify(response)
|
|
23260
|
+
}
|
|
23261
|
+
]
|
|
23262
|
+
};
|
|
23263
|
+
}
|
|
23264
|
+
);
|
|
23265
|
+
var get_ancestors_default11 = GetStaticFileAncestorsTool;
|
|
23266
|
+
|
|
23267
|
+
// src/umb-management-api/tools/static-file/index.ts
|
|
23268
|
+
var StaticFileCollection = {
|
|
23269
|
+
metadata: {
|
|
23270
|
+
name: "static-file",
|
|
23271
|
+
displayName: "Static Files",
|
|
23272
|
+
description: "Read-only access to static files and folders in the Umbraco file system",
|
|
23273
|
+
dependencies: []
|
|
23274
|
+
},
|
|
23275
|
+
tools: (user) => {
|
|
23276
|
+
const tools = [];
|
|
23277
|
+
tools.push(get_static_files_default());
|
|
23278
|
+
tools.push(get_root_default13());
|
|
23279
|
+
tools.push(get_children_default11());
|
|
23280
|
+
tools.push(get_ancestors_default11());
|
|
23281
|
+
return tools;
|
|
23282
|
+
}
|
|
23283
|
+
};
|
|
23284
|
+
|
|
23285
|
+
// src/types/collection-configuration.ts
|
|
23286
|
+
var DEFAULT_COLLECTION_CONFIG = {
|
|
23287
|
+
enabledCollections: [],
|
|
23288
|
+
disabledCollections: [],
|
|
23289
|
+
enabledTools: [],
|
|
23290
|
+
disabledTools: []
|
|
23291
|
+
};
|
|
23292
|
+
|
|
23293
|
+
// src/helpers/config/collection-config-loader.ts
|
|
23294
|
+
var CollectionConfigLoader = class {
|
|
23295
|
+
static loadFromConfig(config) {
|
|
23296
|
+
return {
|
|
23297
|
+
enabledCollections: config.includeToolCollections ?? DEFAULT_COLLECTION_CONFIG.enabledCollections,
|
|
23298
|
+
disabledCollections: config.excludeToolCollections ?? DEFAULT_COLLECTION_CONFIG.disabledCollections,
|
|
23299
|
+
enabledTools: config.includeTools ?? DEFAULT_COLLECTION_CONFIG.enabledTools,
|
|
23300
|
+
disabledTools: config.excludeTools ?? DEFAULT_COLLECTION_CONFIG.disabledTools
|
|
23301
|
+
};
|
|
23302
|
+
}
|
|
23303
|
+
};
|
|
23304
|
+
|
|
23305
|
+
// src/umb-management-api/tools/tool-factory.ts
|
|
23306
|
+
var availableCollections = [
|
|
23307
|
+
CultureCollection,
|
|
23308
|
+
DataTypeCollection,
|
|
23309
|
+
DictionaryCollection,
|
|
23310
|
+
DocumentTypeCollection,
|
|
23311
|
+
LanguageCollection,
|
|
23312
|
+
DocumentBlueprintCollection,
|
|
23313
|
+
DocumentCollection,
|
|
23314
|
+
DocumentVersionCollection,
|
|
23315
|
+
MediaCollection,
|
|
23316
|
+
MediaTypeCollection,
|
|
23317
|
+
MemberCollection,
|
|
23318
|
+
MemberGroupCollection,
|
|
23319
|
+
MemberTypeCollection,
|
|
23320
|
+
LogViewerCollection,
|
|
23321
|
+
PartialViewCollection,
|
|
23322
|
+
PropertyTypeCollection,
|
|
23323
|
+
TemplateCollection,
|
|
23324
|
+
WebhookCollection,
|
|
23325
|
+
ServerCollection,
|
|
23326
|
+
RedirectCollection,
|
|
23327
|
+
UserGroupCollection,
|
|
23328
|
+
TemporaryFileCollection,
|
|
23329
|
+
ScriptCollection,
|
|
23330
|
+
StylesheetCollection,
|
|
23331
|
+
HealthCollection,
|
|
23332
|
+
ManifestCollection,
|
|
23333
|
+
TagCollection,
|
|
23334
|
+
ModelsBuilderCollection,
|
|
23335
|
+
SearcherCollection,
|
|
23336
|
+
IndexerCollection,
|
|
23337
|
+
ImagingCollection,
|
|
23338
|
+
RelationTypeCollection,
|
|
23339
|
+
RelationCollection,
|
|
23340
|
+
UserCollection,
|
|
23341
|
+
UserDataCollection,
|
|
23342
|
+
StaticFileCollection
|
|
23343
|
+
];
|
|
23344
|
+
var mapTools = (server, user, tools, config) => {
|
|
23345
|
+
return tools.forEach((tool) => {
|
|
23346
|
+
const userHasPermission = tool.enabled === void 0 || tool.enabled(user);
|
|
23347
|
+
if (!userHasPermission) return;
|
|
23348
|
+
if (config.disabledTools?.includes(tool.name)) return;
|
|
23349
|
+
if (config.enabledTools?.length && !config.enabledTools.includes(tool.name)) return;
|
|
23350
|
+
server.tool(tool.name, tool.description, tool.schema, tool.handler);
|
|
23351
|
+
});
|
|
23352
|
+
};
|
|
23353
|
+
function validateConfiguration(config, collections) {
|
|
23354
|
+
const availableNames = new Set(collections.map((c) => c.metadata.name));
|
|
23355
|
+
const referencedNames = [
|
|
23356
|
+
...config.enabledCollections,
|
|
23357
|
+
...config.disabledCollections,
|
|
23358
|
+
...collections.flatMap((c) => c.metadata.dependencies || [])
|
|
23359
|
+
];
|
|
23360
|
+
const invalid = referencedNames.filter((name) => !availableNames.has(name));
|
|
23361
|
+
if (invalid.length > 0) {
|
|
23362
|
+
console.warn(`Referenced collections don't exist: ${[...new Set(invalid)].join(", ")}`);
|
|
23363
|
+
}
|
|
23364
|
+
}
|
|
23365
|
+
function resolveDependencies(requestedNames, collections) {
|
|
23366
|
+
const result = new Set(requestedNames);
|
|
23367
|
+
const collectionMap = new Map(collections.map((c) => [c.metadata.name, c]));
|
|
23368
|
+
function addDependencies(collectionName) {
|
|
23369
|
+
const collection = collectionMap.get(collectionName);
|
|
23370
|
+
if (collection?.metadata.dependencies) {
|
|
23371
|
+
collection.metadata.dependencies.forEach((dep) => {
|
|
23372
|
+
if (!result.has(dep)) {
|
|
23373
|
+
result.add(dep);
|
|
23374
|
+
addDependencies(dep);
|
|
23375
|
+
}
|
|
23376
|
+
});
|
|
23377
|
+
}
|
|
23378
|
+
}
|
|
23379
|
+
requestedNames.forEach(addDependencies);
|
|
23380
|
+
return Array.from(result);
|
|
23381
|
+
}
|
|
23382
|
+
function getEnabledCollections(config) {
|
|
21292
23383
|
const allCollectionNames = availableCollections.map((c) => c.metadata.name);
|
|
21293
23384
|
let enabledNames = allCollectionNames.filter((name) => {
|
|
21294
23385
|
if (config.disabledCollections.includes(name)) return false;
|
|
@@ -21302,13 +23393,13 @@ function getEnabledCollections(config) {
|
|
|
21302
23393
|
(collection) => enabledWithDependencies.includes(collection.metadata.name)
|
|
21303
23394
|
);
|
|
21304
23395
|
}
|
|
21305
|
-
function UmbracoToolFactory(server, user) {
|
|
21306
|
-
const config = CollectionConfigLoader.
|
|
23396
|
+
function UmbracoToolFactory(server, user, serverConfig) {
|
|
23397
|
+
const config = CollectionConfigLoader.loadFromConfig(serverConfig);
|
|
21307
23398
|
validateConfiguration(config, availableCollections);
|
|
21308
23399
|
const enabledCollections = getEnabledCollections(config);
|
|
21309
23400
|
enabledCollections.forEach((collection) => {
|
|
21310
23401
|
const tools = collection.tools(user);
|
|
21311
|
-
mapTools(server, user, tools);
|
|
23402
|
+
mapTools(server, user, tools, config);
|
|
21312
23403
|
});
|
|
21313
23404
|
}
|
|
21314
23405
|
|
|
@@ -21354,7 +23445,7 @@ var GetDataTypeAncestorsResource = CreateUmbracoTemplateResource(
|
|
|
21354
23445
|
}
|
|
21355
23446
|
}
|
|
21356
23447
|
);
|
|
21357
|
-
var
|
|
23448
|
+
var get_ancestors_default12 = GetDataTypeAncestorsResource;
|
|
21358
23449
|
|
|
21359
23450
|
// src/umb-management-api/resources/data-types/get/get-children.ts
|
|
21360
23451
|
var GetDataTypeChildrenResource = CreateUmbracoTemplateResource(
|
|
@@ -21405,7 +23496,7 @@ var GetDataTypeChildrenResource = CreateUmbracoTemplateResource(
|
|
|
21405
23496
|
}
|
|
21406
23497
|
}
|
|
21407
23498
|
);
|
|
21408
|
-
var
|
|
23499
|
+
var get_children_default12 = GetDataTypeChildrenResource;
|
|
21409
23500
|
|
|
21410
23501
|
// src/umb-management-api/resources/data-types/get/get-folder.ts
|
|
21411
23502
|
var GetDataTypeFolderResource = CreateUmbracoTemplateResource(
|
|
@@ -21607,7 +23698,7 @@ var GetDataTypeRootResource = CreateUmbracoTemplateResource(
|
|
|
21607
23698
|
}
|
|
21608
23699
|
}
|
|
21609
23700
|
);
|
|
21610
|
-
var
|
|
23701
|
+
var get_root_default14 = GetDataTypeRootResource;
|
|
21611
23702
|
|
|
21612
23703
|
// src/umb-management-api/resources/data-types/get/get-search.ts
|
|
21613
23704
|
var GetDataTypeSearchResource = CreateUmbracoTemplateResource(
|
|
@@ -21661,13 +23752,13 @@ var get_search_default5 = GetDataTypeSearchResource;
|
|
|
21661
23752
|
|
|
21662
23753
|
// src/umb-management-api/resources/data-types/index.ts
|
|
21663
23754
|
var DataTypeTemplateResources = [
|
|
21664
|
-
|
|
21665
|
-
|
|
23755
|
+
get_ancestors_default12,
|
|
23756
|
+
get_children_default12,
|
|
21666
23757
|
get_folder_default4,
|
|
21667
23758
|
get_is_used_default,
|
|
21668
23759
|
get_query_default,
|
|
21669
23760
|
get_references_default,
|
|
21670
|
-
|
|
23761
|
+
get_root_default14,
|
|
21671
23762
|
get_search_default5
|
|
21672
23763
|
];
|
|
21673
23764
|
|
|
@@ -21720,13 +23811,197 @@ function ResourceFactory(server) {
|
|
|
21720
23811
|
);
|
|
21721
23812
|
}
|
|
21722
23813
|
|
|
23814
|
+
// src/config.ts
|
|
23815
|
+
import { config as loadEnv } from "dotenv";
|
|
23816
|
+
import yargs from "yargs";
|
|
23817
|
+
import { hideBin } from "yargs/helpers";
|
|
23818
|
+
import { resolve } from "path";
|
|
23819
|
+
function maskSecret(secret) {
|
|
23820
|
+
if (!secret || secret.length <= 4) return "****";
|
|
23821
|
+
return `****${secret.slice(-4)}`;
|
|
23822
|
+
}
|
|
23823
|
+
function getServerConfig(isStdioMode) {
|
|
23824
|
+
const argv = yargs(hideBin(process.argv)).options({
|
|
23825
|
+
"umbraco-client-id": {
|
|
23826
|
+
type: "string",
|
|
23827
|
+
description: "Umbraco API client ID"
|
|
23828
|
+
},
|
|
23829
|
+
"umbraco-client-secret": {
|
|
23830
|
+
type: "string",
|
|
23831
|
+
description: "Umbraco API client secret"
|
|
23832
|
+
},
|
|
23833
|
+
"umbraco-base-url": {
|
|
23834
|
+
type: "string",
|
|
23835
|
+
description: "Umbraco base URL (e.g., https://localhost:44391)"
|
|
23836
|
+
},
|
|
23837
|
+
"umbraco-include-tool-collections": {
|
|
23838
|
+
type: "string",
|
|
23839
|
+
description: "Comma-separated list of tool collections to include"
|
|
23840
|
+
},
|
|
23841
|
+
"umbraco-exclude-tool-collections": {
|
|
23842
|
+
type: "string",
|
|
23843
|
+
description: "Comma-separated list of tool collections to exclude"
|
|
23844
|
+
},
|
|
23845
|
+
"umbraco-include-tools": {
|
|
23846
|
+
type: "string",
|
|
23847
|
+
description: "Comma-separated list of tools to include"
|
|
23848
|
+
},
|
|
23849
|
+
"umbraco-exclude-tools": {
|
|
23850
|
+
type: "string",
|
|
23851
|
+
description: "Comma-separated list of tools to exclude"
|
|
23852
|
+
},
|
|
23853
|
+
env: {
|
|
23854
|
+
type: "string",
|
|
23855
|
+
description: "Path to custom .env file to load environment variables from"
|
|
23856
|
+
}
|
|
23857
|
+
}).help().version(process.env.NPM_PACKAGE_VERSION ?? "unknown").parseSync();
|
|
23858
|
+
let envFilePath;
|
|
23859
|
+
let envFileSource;
|
|
23860
|
+
if (argv["env"]) {
|
|
23861
|
+
envFilePath = resolve(argv["env"]);
|
|
23862
|
+
envFileSource = "cli";
|
|
23863
|
+
} else {
|
|
23864
|
+
envFilePath = resolve(process.cwd(), ".env");
|
|
23865
|
+
envFileSource = "default";
|
|
23866
|
+
}
|
|
23867
|
+
loadEnv({ path: envFilePath, override: true });
|
|
23868
|
+
const auth = {
|
|
23869
|
+
clientId: "",
|
|
23870
|
+
clientSecret: "",
|
|
23871
|
+
baseUrl: ""
|
|
23872
|
+
};
|
|
23873
|
+
const config = {
|
|
23874
|
+
includeToolCollections: void 0,
|
|
23875
|
+
excludeToolCollections: void 0,
|
|
23876
|
+
includeTools: void 0,
|
|
23877
|
+
excludeTools: void 0,
|
|
23878
|
+
configSources: {
|
|
23879
|
+
clientId: "env",
|
|
23880
|
+
clientSecret: "env",
|
|
23881
|
+
baseUrl: "env",
|
|
23882
|
+
includeToolCollections: "none",
|
|
23883
|
+
excludeToolCollections: "none",
|
|
23884
|
+
includeTools: "none",
|
|
23885
|
+
excludeTools: "none",
|
|
23886
|
+
envFile: envFileSource
|
|
23887
|
+
}
|
|
23888
|
+
};
|
|
23889
|
+
if (argv["umbraco-client-id"]) {
|
|
23890
|
+
auth.clientId = argv["umbraco-client-id"];
|
|
23891
|
+
config.configSources.clientId = "cli";
|
|
23892
|
+
} else if (process.env.UMBRACO_CLIENT_ID) {
|
|
23893
|
+
auth.clientId = process.env.UMBRACO_CLIENT_ID;
|
|
23894
|
+
config.configSources.clientId = "env";
|
|
23895
|
+
}
|
|
23896
|
+
if (argv["umbraco-client-secret"]) {
|
|
23897
|
+
auth.clientSecret = argv["umbraco-client-secret"];
|
|
23898
|
+
config.configSources.clientSecret = "cli";
|
|
23899
|
+
} else if (process.env.UMBRACO_CLIENT_SECRET) {
|
|
23900
|
+
auth.clientSecret = process.env.UMBRACO_CLIENT_SECRET;
|
|
23901
|
+
config.configSources.clientSecret = "env";
|
|
23902
|
+
}
|
|
23903
|
+
if (argv["umbraco-base-url"]) {
|
|
23904
|
+
auth.baseUrl = argv["umbraco-base-url"];
|
|
23905
|
+
config.configSources.baseUrl = "cli";
|
|
23906
|
+
} else if (process.env.UMBRACO_BASE_URL) {
|
|
23907
|
+
auth.baseUrl = process.env.UMBRACO_BASE_URL;
|
|
23908
|
+
config.configSources.baseUrl = "env";
|
|
23909
|
+
}
|
|
23910
|
+
if (argv["umbraco-include-tool-collections"]) {
|
|
23911
|
+
config.includeToolCollections = argv["umbraco-include-tool-collections"].split(",").map((c) => c.trim()).filter(Boolean);
|
|
23912
|
+
config.configSources.includeToolCollections = "cli";
|
|
23913
|
+
} else if (process.env.UMBRACO_INCLUDE_TOOL_COLLECTIONS) {
|
|
23914
|
+
config.includeToolCollections = process.env.UMBRACO_INCLUDE_TOOL_COLLECTIONS.split(",").map((c) => c.trim()).filter(Boolean);
|
|
23915
|
+
config.configSources.includeToolCollections = "env";
|
|
23916
|
+
}
|
|
23917
|
+
if (argv["umbraco-exclude-tool-collections"]) {
|
|
23918
|
+
config.excludeToolCollections = argv["umbraco-exclude-tool-collections"].split(",").map((c) => c.trim()).filter(Boolean);
|
|
23919
|
+
config.configSources.excludeToolCollections = "cli";
|
|
23920
|
+
} else if (process.env.UMBRACO_EXCLUDE_TOOL_COLLECTIONS) {
|
|
23921
|
+
config.excludeToolCollections = process.env.UMBRACO_EXCLUDE_TOOL_COLLECTIONS.split(",").map((c) => c.trim()).filter(Boolean);
|
|
23922
|
+
config.configSources.excludeToolCollections = "env";
|
|
23923
|
+
}
|
|
23924
|
+
if (argv["umbraco-include-tools"]) {
|
|
23925
|
+
config.includeTools = argv["umbraco-include-tools"].split(",").map((t) => t.trim()).filter(Boolean);
|
|
23926
|
+
config.configSources.includeTools = "cli";
|
|
23927
|
+
} else if (process.env.UMBRACO_INCLUDE_TOOLS) {
|
|
23928
|
+
config.includeTools = process.env.UMBRACO_INCLUDE_TOOLS.split(",").map((t) => t.trim()).filter(Boolean);
|
|
23929
|
+
config.configSources.includeTools = "env";
|
|
23930
|
+
}
|
|
23931
|
+
if (argv["umbraco-exclude-tools"]) {
|
|
23932
|
+
config.excludeTools = argv["umbraco-exclude-tools"].split(",").map((t) => t.trim()).filter(Boolean);
|
|
23933
|
+
config.configSources.excludeTools = "cli";
|
|
23934
|
+
} else if (process.env.UMBRACO_EXCLUDE_TOOLS) {
|
|
23935
|
+
config.excludeTools = process.env.UMBRACO_EXCLUDE_TOOLS.split(",").map((t) => t.trim()).filter(Boolean);
|
|
23936
|
+
config.configSources.excludeTools = "env";
|
|
23937
|
+
}
|
|
23938
|
+
if (!auth.clientId) {
|
|
23939
|
+
console.error(
|
|
23940
|
+
"UMBRACO_CLIENT_ID is required (via CLI argument --umbraco-client-id or .env file)"
|
|
23941
|
+
);
|
|
23942
|
+
process.exit(1);
|
|
23943
|
+
}
|
|
23944
|
+
if (!auth.clientSecret) {
|
|
23945
|
+
console.error(
|
|
23946
|
+
"UMBRACO_CLIENT_SECRET is required (via CLI argument --umbraco-client-secret or .env file)"
|
|
23947
|
+
);
|
|
23948
|
+
process.exit(1);
|
|
23949
|
+
}
|
|
23950
|
+
if (!auth.baseUrl) {
|
|
23951
|
+
console.error(
|
|
23952
|
+
"UMBRACO_BASE_URL is required (via CLI argument --umbraco-base-url or .env file)"
|
|
23953
|
+
);
|
|
23954
|
+
process.exit(1);
|
|
23955
|
+
}
|
|
23956
|
+
if (!isStdioMode) {
|
|
23957
|
+
console.log("\nUmbraco MCP Configuration:");
|
|
23958
|
+
console.log(`- ENV_FILE: ${envFilePath} (source: ${config.configSources.envFile})`);
|
|
23959
|
+
console.log(
|
|
23960
|
+
`- UMBRACO_CLIENT_ID: ${auth.clientId} (source: ${config.configSources.clientId})`
|
|
23961
|
+
);
|
|
23962
|
+
console.log(
|
|
23963
|
+
`- UMBRACO_CLIENT_SECRET: ${maskSecret(auth.clientSecret)} (source: ${config.configSources.clientSecret})`
|
|
23964
|
+
);
|
|
23965
|
+
console.log(
|
|
23966
|
+
`- UMBRACO_BASE_URL: ${auth.baseUrl} (source: ${config.configSources.baseUrl})`
|
|
23967
|
+
);
|
|
23968
|
+
if (config.includeToolCollections) {
|
|
23969
|
+
console.log(
|
|
23970
|
+
`- UMBRACO_INCLUDE_TOOL_COLLECTIONS: ${config.includeToolCollections.join(", ")} (source: ${config.configSources.includeToolCollections})`
|
|
23971
|
+
);
|
|
23972
|
+
}
|
|
23973
|
+
if (config.excludeToolCollections) {
|
|
23974
|
+
console.log(
|
|
23975
|
+
`- UMBRACO_EXCLUDE_TOOL_COLLECTIONS: ${config.excludeToolCollections.join(", ")} (source: ${config.configSources.excludeToolCollections})`
|
|
23976
|
+
);
|
|
23977
|
+
}
|
|
23978
|
+
if (config.includeTools) {
|
|
23979
|
+
console.log(
|
|
23980
|
+
`- UMBRACO_INCLUDE_TOOLS: ${config.includeTools.join(", ")} (source: ${config.configSources.includeTools})`
|
|
23981
|
+
);
|
|
23982
|
+
}
|
|
23983
|
+
if (config.excludeTools) {
|
|
23984
|
+
console.log(
|
|
23985
|
+
`- UMBRACO_EXCLUDE_TOOLS: ${config.excludeTools.join(", ")} (source: ${config.configSources.excludeTools})`
|
|
23986
|
+
);
|
|
23987
|
+
}
|
|
23988
|
+
console.log();
|
|
23989
|
+
}
|
|
23990
|
+
return {
|
|
23991
|
+
...config,
|
|
23992
|
+
auth
|
|
23993
|
+
};
|
|
23994
|
+
}
|
|
23995
|
+
|
|
21723
23996
|
// src/index.ts
|
|
21724
23997
|
var main = async () => {
|
|
23998
|
+
const config = getServerConfig(true);
|
|
23999
|
+
initializeUmbracoAxios(config.auth);
|
|
21725
24000
|
const server = UmbracoMcpServer.GetServer();
|
|
21726
24001
|
const client = UmbracoManagementClient2.getClient();
|
|
21727
24002
|
const user = await client.getUserCurrent();
|
|
21728
24003
|
ResourceFactory(server);
|
|
21729
|
-
UmbracoToolFactory(server, user);
|
|
24004
|
+
UmbracoToolFactory(server, user, config);
|
|
21730
24005
|
const transport = new StdioServerTransport();
|
|
21731
24006
|
await server.connect(transport);
|
|
21732
24007
|
};
|