@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.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
|
+
"use strict"; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
3
3
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
4
4
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
5
5
|
|
|
@@ -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
|
}
|
|
@@ -1954,7 +1954,7 @@ function stringifyRegExpWithFlags(regex, refs) {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
try {
|
|
1956
1956
|
new RegExp(pattern);
|
|
1957
|
-
} catch (
|
|
1957
|
+
} catch (e2) {
|
|
1958
1958
|
console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
|
|
1959
1959
|
return regex.source;
|
|
1960
1960
|
}
|
|
@@ -2284,7 +2284,7 @@ function decideAdditionalProperties(def, refs) {
|
|
|
2284
2284
|
function safeIsOptional(schema) {
|
|
2285
2285
|
try {
|
|
2286
2286
|
return schema.isOptional();
|
|
2287
|
-
} catch (
|
|
2287
|
+
} catch (e3) {
|
|
2288
2288
|
return true;
|
|
2289
2289
|
}
|
|
2290
2290
|
}
|
|
@@ -3238,44 +3238,32 @@ var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
|
3238
3238
|
// src/orval/client/umbraco-axios.ts
|
|
3239
3239
|
var _qs = require('qs'); var _qs2 = _interopRequireDefault(_qs);
|
|
3240
3240
|
|
|
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 = _axios2.default.create(
|
|
3255
|
+
var UmbracoAxios = _axios2.default.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 _axios2.default.post(
|
|
3275
|
-
`${
|
|
3263
|
+
`${authConfig.baseUrl}${tokenPath}`,
|
|
3276
3264
|
{
|
|
3277
|
-
client_id,
|
|
3278
|
-
client_secret: _nullishCoalesce(
|
|
3265
|
+
client_id: authConfig.clientId,
|
|
3266
|
+
client_secret: _nullishCoalesce(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
|
|
@@ -7343,7 +7331,7 @@ var getTemporaryFileAPI = () => ({
|
|
|
7343
7331
|
formData.append("File", postTemporaryFileBody2.File);
|
|
7344
7332
|
const headers = {
|
|
7345
7333
|
...formData.getHeaders(),
|
|
7346
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7334
|
+
..._optionalChain([options, 'optionalAccess', _46 => _46.headers])
|
|
7347
7335
|
};
|
|
7348
7336
|
return UmbracoManagementClient(
|
|
7349
7337
|
{
|
|
@@ -7411,7 +7399,7 @@ var CreateUmbracoTool = (name, description, schema, handler, enabled) => () => (
|
|
|
7411
7399
|
const errorDetails = error instanceof Error ? {
|
|
7412
7400
|
message: error.message,
|
|
7413
7401
|
cause: error.cause,
|
|
7414
|
-
response: _optionalChain([error, 'access',
|
|
7402
|
+
response: _optionalChain([error, 'access', _47 => _47.response, 'optionalAccess', _48 => _48.data])
|
|
7415
7403
|
} : error;
|
|
7416
7404
|
return {
|
|
7417
7405
|
content: [
|
|
@@ -13633,6 +13621,26 @@ 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
13645
|
|
|
13638
13646
|
var UpdateDataTypeTool = CreateUmbracoTool(
|
|
@@ -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());
|
|
@@ -14308,7 +14317,7 @@ function createContainerHierarchy(properties) {
|
|
|
14308
14317
|
id,
|
|
14309
14318
|
name: groupName,
|
|
14310
14319
|
type: "Group",
|
|
14311
|
-
parent: _optionalChain([prop, 'optionalAccess',
|
|
14320
|
+
parent: _optionalChain([prop, 'optionalAccess', _49 => _49.tab]) ? { id: containerIds.get(prop.tab) } : null,
|
|
14312
14321
|
sortOrder: index
|
|
14313
14322
|
};
|
|
14314
14323
|
})
|
|
@@ -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
|
}
|
|
@@ -16131,6 +16185,156 @@ var SearchDocumentTool = CreateUmbracoTool(
|
|
|
16131
16185
|
);
|
|
16132
16186
|
var search_document_default = SearchDocumentTool;
|
|
16133
16187
|
|
|
16188
|
+
// src/umb-management-api/tools/document/get/get-collection-document-by-id.ts
|
|
16189
|
+
|
|
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
|
+
_zod.z.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
|
|
16242
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
16134
16338
|
// src/umb-management-api/tools/document/post/post-document-public-access.ts
|
|
16135
16339
|
|
|
16136
16340
|
var PostDocumentPublicAccessTool = CreateUmbracoTool(
|
|
@@ -16182,6 +16386,12 @@ var validate_document_default = ValidateDocumentTool;
|
|
|
16182
16386
|
|
|
16183
16387
|
// src/umb-management-api/tools/document/post/copy-document.ts
|
|
16184
16388
|
|
|
16389
|
+
var copyDocumentSchema = _zod.z.object({
|
|
16390
|
+
parentId: _zod.z.string().uuid("Must be a valid document UUID of the parent node").optional(),
|
|
16391
|
+
idToCopy: _zod.z.string().uuid("Must be a valid document UUID that belongs to the parent document's children"),
|
|
16392
|
+
relateToOriginal: _zod.z.boolean().describe("Relate the copy to the original document. This is usually set to false unless specified."),
|
|
16393
|
+
includeDescendants: _zod.z.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: _zod.z.string().uuid(),
|
|
16207
|
-
data: _zod.z.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
|
{
|
|
@@ -16229,6 +16443,7 @@ var createDocumentSchema = _zod.z.object({
|
|
|
16229
16443
|
documentTypeId: _zod.z.string().uuid("Must be a valid document type type UUID"),
|
|
16230
16444
|
parentId: _zod.z.string().uuid("Must be a valid document UUID").optional(),
|
|
16231
16445
|
name: _zod.z.string(),
|
|
16446
|
+
cultures: _zod.z.array(_zod.z.string()).optional().describe("Array of culture codes. If not provided or empty array, will create single variant with null culture."),
|
|
16232
16447
|
values: _zod.z.array(
|
|
16233
16448
|
_zod.z.object({
|
|
16234
16449
|
editorAlias: _zod.z.string(),
|
|
@@ -16241,7 +16456,10 @@ var createDocumentSchema = _zod.z.object({
|
|
|
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 = _uuid.v4.call(void 0, );
|
|
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 {
|
|
@@ -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,
|
|
@@ -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,28 +17700,357 @@ var DocumentVersionCollection = {
|
|
|
17471
17700
|
};
|
|
17472
17701
|
|
|
17473
17702
|
// src/umb-management-api/tools/media/post/create-media.ts
|
|
17703
|
+
|
|
17704
|
+
|
|
17705
|
+
|
|
17706
|
+
// src/umb-management-api/tools/media/post/helpers/media-upload-helpers.ts
|
|
17707
|
+
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs); var fs2 = _interopRequireWildcard(_fs);
|
|
17708
|
+
var _os = require('os'); var os = _interopRequireWildcard(_os); var os2 = _interopRequireWildcard(_os);
|
|
17709
|
+
var _path = require('path'); var path = _interopRequireWildcard(_path); var path2 = _interopRequireWildcard(_path);
|
|
17710
|
+
|
|
17711
|
+
var _mimetypes = require('mime-types'); var _mimetypes2 = _interopRequireDefault(_mimetypes);
|
|
17712
|
+
function getExtensionFromMimeType(mimeType) {
|
|
17713
|
+
if (!mimeType) return void 0;
|
|
17714
|
+
const baseMimeType = mimeType.split(";")[0].trim();
|
|
17715
|
+
const extension = _mimetypes2.default.extension(baseMimeType);
|
|
17716
|
+
return extension ? `.${extension}` : void 0;
|
|
17717
|
+
}
|
|
17718
|
+
function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
|
|
17719
|
+
const isSvg = _optionalChain([filePath, 'optionalAccess', _50 => _50.toLowerCase, 'call', _51 => _51(), 'access', _52 => _52.endsWith, 'call', _53 => _53(".svg")]) || _optionalChain([fileUrl, 'optionalAccess', _54 => _54.toLowerCase, 'call', _55 => _55(), 'access', _56 => _56.endsWith, 'call', _57 => _57(".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)";
|
|
17723
|
+
}
|
|
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
|
+
}
|
|
17761
|
+
};
|
|
17762
|
+
}
|
|
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 _axios2.default.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 = _optionalChain([err, 'access', _58 => _58.response, 'optionalAccess', _59 => _59.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: ${_optionalChain([err, 'access', _60 => _60.response, 'optionalAccess', _61 => _61.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: ${_optionalChain([err, 'access', _62 => _62.response, 'optionalAccess', _63 => _63.status]) || "Unknown error"} - ${JSON.stringify(_optionalChain([err, 'access', _64 => _64.response, 'optionalAccess', _65 => _65.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 = _zod.z.object({
|
|
17903
|
+
sourceType: _zod.z.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: _zod.z.string().describe("The name of the media item"),
|
|
17905
|
+
mediaTypeName: _zod.z.string().describe("Media type: 'Image', 'Article', 'Audio', 'Video', 'Vector Graphic (SVG)', 'File', or custom media type name"),
|
|
17906
|
+
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17907
|
+
fileUrl: _zod.z.string().url().optional().describe("URL to fetch the file from (required if sourceType is 'url')"),
|
|
17908
|
+
fileAsBase64: _zod.z.string().optional().describe("Base64 encoded file data (required if sourceType is 'base64')"),
|
|
17909
|
+
parentId: _zod.z.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
17910
|
+
});
|
|
17474
17911
|
var CreateMediaTool = CreateUmbracoTool(
|
|
17475
17912
|
"create-media",
|
|
17476
|
-
`
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
-
|
|
17480
|
-
-
|
|
17481
|
-
|
|
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 = _uuid.v4.call(void 0, );
|
|
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
|
+
|
|
17974
|
+
|
|
17975
|
+
var createMediaMultipleSchema = _zod.z.object({
|
|
17976
|
+
sourceType: _zod.z.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: _zod.z.array(_zod.z.object({
|
|
17978
|
+
name: _zod.z.string().describe("The name of the media item"),
|
|
17979
|
+
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17980
|
+
fileUrl: _zod.z.string().url().optional().describe("URL to fetch the file from (required if sourceType is 'url')"),
|
|
17981
|
+
mediaTypeName: _zod.z.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: _zod.z.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,
|
|
17482
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 = [];
|
|
17483
18011
|
const client = UmbracoManagementClient2.getClient();
|
|
17484
|
-
const
|
|
18012
|
+
for (const file of model.files) {
|
|
18013
|
+
try {
|
|
18014
|
+
const temporaryFileId = _uuid.v4.call(void 0, );
|
|
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;
|
|
17485
18040
|
return {
|
|
17486
18041
|
content: [
|
|
17487
18042
|
{
|
|
17488
18043
|
type: "text",
|
|
17489
|
-
text: JSON.stringify(
|
|
18044
|
+
text: JSON.stringify({
|
|
18045
|
+
summary: `Processed ${model.files.length} files: ${successCount} succeeded, ${failureCount} failed`,
|
|
18046
|
+
results
|
|
18047
|
+
}, null, 2)
|
|
17490
18048
|
}
|
|
17491
18049
|
]
|
|
17492
18050
|
};
|
|
17493
18051
|
}
|
|
17494
18052
|
);
|
|
17495
|
-
var
|
|
18053
|
+
var create_media_multiple_default = CreateMediaMultipleTool;
|
|
17496
18054
|
|
|
17497
18055
|
// src/umb-management-api/tools/media/delete/delete-media.ts
|
|
17498
18056
|
var DeleteMediaTool = CreateUmbracoTool(
|
|
@@ -17894,7 +18452,154 @@ var DeleteFromRecycleBinTool2 = CreateUmbracoTool(
|
|
|
17894
18452
|
);
|
|
17895
18453
|
var delete_from_recycle_bin_default2 = DeleteFromRecycleBinTool2;
|
|
17896
18454
|
|
|
17897
|
-
// src/umb-management-api/tools/media/
|
|
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
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
18602
|
+
// src/umb-management-api/tools/media/index.ts
|
|
17898
18603
|
var MediaCollection = {
|
|
17899
18604
|
metadata: {
|
|
17900
18605
|
name: "media",
|
|
@@ -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
|
}
|
|
@@ -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",
|
|
@@ -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",
|
|
@@ -18482,6 +19236,31 @@ var UpdateMemberTool = CreateUmbracoTool(
|
|
|
18482
19236
|
);
|
|
18483
19237
|
var update_member_default = UpdateMemberTool;
|
|
18484
19238
|
|
|
19239
|
+
// src/umb-management-api/tools/member/put/validate-member-update.ts
|
|
19240
|
+
|
|
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: _zod.z.object(putMemberByIdValidateBody.shape)
|
|
19248
|
+
},
|
|
19249
|
+
async (model) => {
|
|
19250
|
+
const client = UmbracoManagementClient2.getClient();
|
|
19251
|
+
const response = await client.putMemberByIdValidate(model.id, model.data);
|
|
19252
|
+
return {
|
|
19253
|
+
content: [
|
|
19254
|
+
{
|
|
19255
|
+
type: "text",
|
|
19256
|
+
text: JSON.stringify(response)
|
|
19257
|
+
}
|
|
19258
|
+
]
|
|
19259
|
+
};
|
|
19260
|
+
}
|
|
19261
|
+
);
|
|
19262
|
+
var validate_member_update_default = ValidateMemberUpdateTool;
|
|
19263
|
+
|
|
18485
19264
|
// src/umb-management-api/tools/member/get/find-member.ts
|
|
18486
19265
|
var FindMemberTool = CreateUmbracoTool(
|
|
18487
19266
|
"find-member",
|
|
@@ -18502,6 +19281,77 @@ var FindMemberTool = CreateUmbracoTool(
|
|
|
18502
19281
|
);
|
|
18503
19282
|
var find_member_default = FindMemberTool;
|
|
18504
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
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
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
|
+
_zod.z.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
|
+
|
|
18505
19355
|
// src/umb-management-api/tools/member/index.ts
|
|
18506
19356
|
var MemberCollection = {
|
|
18507
19357
|
metadata: {
|
|
@@ -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;
|
|
@@ -19215,8 +20070,8 @@ var UpdatePartialViewTool = CreateUmbracoTool(
|
|
|
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
|
{
|
|
@@ -19240,8 +20095,8 @@ var RenamePartialViewTool = CreateUmbracoTool(
|
|
|
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",
|
|
@@ -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",
|
|
@@ -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
|
|
|
@@ -20491,8 +21392,71 @@ var UserGroupCollection = {
|
|
|
20491
21392
|
}
|
|
20492
21393
|
};
|
|
20493
21394
|
|
|
21395
|
+
// src/umb-management-api/tools/temporary-file/post/create-temporary-file.ts
|
|
21396
|
+
|
|
21397
|
+
|
|
21398
|
+
|
|
21399
|
+
|
|
21400
|
+
var createTemporaryFileSchema = _zod.z.object({
|
|
21401
|
+
id: _zod.z.string().uuid().describe("Unique identifier for the temporary file"),
|
|
21402
|
+
fileName: _zod.z.string().describe("Name of the file"),
|
|
21403
|
+
fileAsBase64: _zod.z.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
|
+
|
|
20496
21460
|
|
|
20497
21461
|
var postTemporaryFileBody = _zod.z.object({
|
|
20498
21462
|
Id: _zod.z.string().uuid(),
|
|
@@ -20516,45 +21480,19 @@ var getTemporaryFileConfigurationResponse = _zod.z.object({
|
|
|
20516
21480
|
maxFileSize: _zod.z.number().nullish()
|
|
20517
21481
|
});
|
|
20518
21482
|
|
|
20519
|
-
// src/umb-management-api/tools/temporary-file/
|
|
20520
|
-
var
|
|
20521
|
-
"
|
|
20522
|
-
|
|
20523
|
-
|
|
20524
|
-
|
|
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) => {
|
|
21483
|
+
// src/umb-management-api/tools/temporary-file/get/get-temporary-file.ts
|
|
21484
|
+
var GetTemporaryFileTool = CreateUmbracoTool(
|
|
21485
|
+
"get-temporary-file",
|
|
21486
|
+
"Gets a temporary file by id",
|
|
21487
|
+
getTemporaryFileByIdParams.shape,
|
|
21488
|
+
async (params) => {
|
|
20531
21489
|
const client = UmbracoManagementClient2.getClient();
|
|
20532
|
-
await client.
|
|
21490
|
+
const response = await client.getTemporaryFileById(params.id);
|
|
20533
21491
|
return {
|
|
20534
21492
|
content: [
|
|
20535
21493
|
{
|
|
20536
21494
|
type: "text",
|
|
20537
|
-
text: JSON.stringify(
|
|
20538
|
-
}
|
|
20539
|
-
]
|
|
20540
|
-
};
|
|
20541
|
-
}
|
|
20542
|
-
);
|
|
20543
|
-
var create_temporary_file_default = CreateTemporaryFileTool;
|
|
20544
|
-
|
|
20545
|
-
// src/umb-management-api/tools/temporary-file/get/get-temporary-file.ts
|
|
20546
|
-
var GetTemporaryFileTool = CreateUmbracoTool(
|
|
20547
|
-
"get-temporary-file",
|
|
20548
|
-
"Gets a temporary file by id",
|
|
20549
|
-
getTemporaryFileByIdParams.shape,
|
|
20550
|
-
async (params) => {
|
|
20551
|
-
const client = UmbracoManagementClient2.getClient();
|
|
20552
|
-
const response = await client.getTemporaryFileById(params.id);
|
|
20553
|
-
return {
|
|
20554
|
-
content: [
|
|
20555
|
-
{
|
|
20556
|
-
type: "text",
|
|
20557
|
-
text: JSON.stringify(response)
|
|
21495
|
+
text: JSON.stringify(response)
|
|
20558
21496
|
}
|
|
20559
21497
|
]
|
|
20560
21498
|
};
|
|
@@ -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
|
{
|
|
@@ -20810,7 +21748,1158 @@ var UpdateScriptTool = CreateUmbracoTool(
|
|
|
20810
21748
|
},
|
|
20811
21749
|
async (model) => {
|
|
20812
21750
|
const client = UmbracoManagementClient2.getClient();
|
|
20813
|
-
const response = await client.putScriptByPath(model.path, model.data);
|
|
21751
|
+
const response = await client.putScriptByPath(model.path, model.data);
|
|
21752
|
+
return {
|
|
21753
|
+
content: [
|
|
21754
|
+
{
|
|
21755
|
+
type: "text",
|
|
21756
|
+
text: JSON.stringify(response)
|
|
21757
|
+
}
|
|
21758
|
+
]
|
|
21759
|
+
};
|
|
21760
|
+
}
|
|
21761
|
+
);
|
|
21762
|
+
var update_script_default = UpdateScriptTool;
|
|
21763
|
+
|
|
21764
|
+
// src/umb-management-api/tools/script/put/rename-script.ts
|
|
21765
|
+
|
|
21766
|
+
var renameScriptSchema = _zod.z.object({
|
|
21767
|
+
name: _zod.z.string().min(1, "Current script name is required"),
|
|
21768
|
+
folderPath: _zod.z.string().optional().describe("Path to the folder containing the script (optional, leave empty for root)"),
|
|
21769
|
+
newName: _zod.z.string().min(1, "New script name is required")
|
|
21770
|
+
});
|
|
21771
|
+
var RenameScriptTool = CreateUmbracoTool(
|
|
21772
|
+
"rename-script",
|
|
21773
|
+
"Renames a script by name and folder path",
|
|
21774
|
+
renameScriptSchema.shape,
|
|
21775
|
+
async (model) => {
|
|
21776
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21777
|
+
const currentName = model.name.endsWith(".js") ? model.name : `${model.name}.js`;
|
|
21778
|
+
const newName = model.newName.endsWith(".js") ? model.newName : `${model.newName}.js`;
|
|
21779
|
+
const normalizedFolderPath = model.folderPath && !model.folderPath.startsWith("/") ? `/${model.folderPath}` : model.folderPath;
|
|
21780
|
+
const fullPath = normalizedFolderPath ? `${normalizedFolderPath}/${currentName}` : `/${currentName}`;
|
|
21781
|
+
const encodedPath = encodeURIComponent(fullPath);
|
|
21782
|
+
const renameModel = {
|
|
21783
|
+
name: newName
|
|
21784
|
+
};
|
|
21785
|
+
const response = await client.putScriptByPathRename(encodedPath, renameModel);
|
|
21786
|
+
return {
|
|
21787
|
+
content: [
|
|
21788
|
+
{
|
|
21789
|
+
type: "text",
|
|
21790
|
+
text: JSON.stringify(response)
|
|
21791
|
+
}
|
|
21792
|
+
]
|
|
21793
|
+
};
|
|
21794
|
+
}
|
|
21795
|
+
);
|
|
21796
|
+
var rename_script_default = RenameScriptTool;
|
|
21797
|
+
|
|
21798
|
+
// src/umb-management-api/tools/script/delete/delete-script.ts
|
|
21799
|
+
var DeleteScriptTool = CreateUmbracoTool(
|
|
21800
|
+
"delete-script",
|
|
21801
|
+
"Deletes a script by path",
|
|
21802
|
+
deleteScriptByPathParams.shape,
|
|
21803
|
+
async ({ path: path3 }) => {
|
|
21804
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21805
|
+
const response = await client.deleteScriptByPath(path3);
|
|
21806
|
+
return {
|
|
21807
|
+
content: [
|
|
21808
|
+
{
|
|
21809
|
+
type: "text",
|
|
21810
|
+
text: JSON.stringify(response)
|
|
21811
|
+
}
|
|
21812
|
+
]
|
|
21813
|
+
};
|
|
21814
|
+
}
|
|
21815
|
+
);
|
|
21816
|
+
var delete_script_default = DeleteScriptTool;
|
|
21817
|
+
|
|
21818
|
+
// src/umb-management-api/tools/script/delete/delete-script-folder.ts
|
|
21819
|
+
var DeleteScriptFolderTool = CreateUmbracoTool(
|
|
21820
|
+
"delete-script-folder",
|
|
21821
|
+
"Deletes a script folder by path",
|
|
21822
|
+
deleteScriptFolderByPathParams.shape,
|
|
21823
|
+
async ({ path: path3 }) => {
|
|
21824
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21825
|
+
const response = await client.deleteScriptFolderByPath(path3);
|
|
21826
|
+
return {
|
|
21827
|
+
content: [
|
|
21828
|
+
{
|
|
21829
|
+
type: "text",
|
|
21830
|
+
text: JSON.stringify(response)
|
|
21831
|
+
}
|
|
21832
|
+
]
|
|
21833
|
+
};
|
|
21834
|
+
}
|
|
21835
|
+
);
|
|
21836
|
+
var delete_script_folder_default = DeleteScriptFolderTool;
|
|
21837
|
+
|
|
21838
|
+
// src/umb-management-api/tools/script/index.ts
|
|
21839
|
+
var ScriptCollection = {
|
|
21840
|
+
metadata: {
|
|
21841
|
+
name: "script",
|
|
21842
|
+
displayName: "Scripts",
|
|
21843
|
+
description: "JavaScript file management and scripting",
|
|
21844
|
+
dependencies: []
|
|
21845
|
+
},
|
|
21846
|
+
tools: (user) => {
|
|
21847
|
+
const tools = [];
|
|
21848
|
+
if (AuthorizationPolicies.TreeAccessScripts(user)) {
|
|
21849
|
+
tools.push(get_script_by_path_default());
|
|
21850
|
+
tools.push(get_script_folder_by_path_default());
|
|
21851
|
+
tools.push(get_script_items_default());
|
|
21852
|
+
tools.push(get_script_tree_ancestors_default());
|
|
21853
|
+
tools.push(get_script_tree_children_default());
|
|
21854
|
+
tools.push(get_script_tree_root_default());
|
|
21855
|
+
tools.push(create_script_default());
|
|
21856
|
+
tools.push(create_script_folder_default());
|
|
21857
|
+
tools.push(update_script_default());
|
|
21858
|
+
tools.push(rename_script_default());
|
|
21859
|
+
tools.push(delete_script_default());
|
|
21860
|
+
tools.push(delete_script_folder_default());
|
|
21861
|
+
}
|
|
21862
|
+
return tools;
|
|
21863
|
+
}
|
|
21864
|
+
};
|
|
21865
|
+
|
|
21866
|
+
// src/umb-management-api/tools/stylesheet/post/create-stylesheet.ts
|
|
21867
|
+
var CreateStylesheetTool = CreateUmbracoTool(
|
|
21868
|
+
"create-stylesheet",
|
|
21869
|
+
"Creates a new stylesheet",
|
|
21870
|
+
postStylesheetBody.shape,
|
|
21871
|
+
async (model) => {
|
|
21872
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21873
|
+
var response = await client.postStylesheet(model);
|
|
21874
|
+
return {
|
|
21875
|
+
content: [
|
|
21876
|
+
{
|
|
21877
|
+
type: "text",
|
|
21878
|
+
text: JSON.stringify(response)
|
|
21879
|
+
}
|
|
21880
|
+
]
|
|
21881
|
+
};
|
|
21882
|
+
}
|
|
21883
|
+
);
|
|
21884
|
+
var create_stylesheet_default = CreateStylesheetTool;
|
|
21885
|
+
|
|
21886
|
+
// src/umb-management-api/tools/stylesheet/post/create-stylesheet-folder.ts
|
|
21887
|
+
var CreateStylesheetFolderTool = CreateUmbracoTool(
|
|
21888
|
+
"create-stylesheet-folder",
|
|
21889
|
+
"Creates a new stylesheet folder",
|
|
21890
|
+
postStylesheetFolderBody.shape,
|
|
21891
|
+
async (model) => {
|
|
21892
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21893
|
+
var response = await client.postStylesheetFolder(model);
|
|
21894
|
+
return {
|
|
21895
|
+
content: [
|
|
21896
|
+
{
|
|
21897
|
+
type: "text",
|
|
21898
|
+
text: JSON.stringify(response)
|
|
21899
|
+
}
|
|
21900
|
+
]
|
|
21901
|
+
};
|
|
21902
|
+
}
|
|
21903
|
+
);
|
|
21904
|
+
var create_stylesheet_folder_default = CreateStylesheetFolderTool;
|
|
21905
|
+
|
|
21906
|
+
// src/umb-management-api/tools/stylesheet/get/get-stylesheet-by-path.ts
|
|
21907
|
+
var GetStylesheetByPathTool = CreateUmbracoTool(
|
|
21908
|
+
"get-stylesheet-by-path",
|
|
21909
|
+
"Gets a stylesheet by its path",
|
|
21910
|
+
getStylesheetByPathParams.shape,
|
|
21911
|
+
async (model) => {
|
|
21912
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21913
|
+
var response = await client.getStylesheetByPath(model.path);
|
|
21914
|
+
return {
|
|
21915
|
+
content: [
|
|
21916
|
+
{
|
|
21917
|
+
type: "text",
|
|
21918
|
+
text: JSON.stringify(response)
|
|
21919
|
+
}
|
|
21920
|
+
]
|
|
21921
|
+
};
|
|
21922
|
+
}
|
|
21923
|
+
);
|
|
21924
|
+
var get_stylesheet_by_path_default = GetStylesheetByPathTool;
|
|
21925
|
+
|
|
21926
|
+
// src/umb-management-api/tools/stylesheet/get/get-stylesheet-folder-by-path.ts
|
|
21927
|
+
var GetStylesheetFolderByPathTool = CreateUmbracoTool(
|
|
21928
|
+
"get-stylesheet-folder-by-path",
|
|
21929
|
+
"Gets a stylesheet folder by its path",
|
|
21930
|
+
getStylesheetFolderByPathParams.shape,
|
|
21931
|
+
async (model) => {
|
|
21932
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21933
|
+
var response = await client.getStylesheetFolderByPath(model.path);
|
|
21934
|
+
return {
|
|
21935
|
+
content: [
|
|
21936
|
+
{
|
|
21937
|
+
type: "text",
|
|
21938
|
+
text: JSON.stringify(response)
|
|
21939
|
+
}
|
|
21940
|
+
]
|
|
21941
|
+
};
|
|
21942
|
+
}
|
|
21943
|
+
);
|
|
21944
|
+
var get_stylesheet_folder_by_path_default = GetStylesheetFolderByPathTool;
|
|
21945
|
+
|
|
21946
|
+
// src/umb-management-api/tools/stylesheet/put/update-stylesheet.ts
|
|
21947
|
+
|
|
21948
|
+
var UpdateStylesheetTool = CreateUmbracoTool(
|
|
21949
|
+
"update-stylesheet",
|
|
21950
|
+
"Updates a stylesheet by path",
|
|
21951
|
+
_zod.z.object({
|
|
21952
|
+
...putStylesheetByPathParams.shape,
|
|
21953
|
+
...putStylesheetByPathBody.shape
|
|
21954
|
+
}).shape,
|
|
21955
|
+
async (model) => {
|
|
21956
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21957
|
+
const { path: path3, ...updateModel } = model;
|
|
21958
|
+
var response = await client.putStylesheetByPath(path3, updateModel);
|
|
21959
|
+
return {
|
|
21960
|
+
content: [
|
|
21961
|
+
{
|
|
21962
|
+
type: "text",
|
|
21963
|
+
text: JSON.stringify(response)
|
|
21964
|
+
}
|
|
21965
|
+
]
|
|
21966
|
+
};
|
|
21967
|
+
}
|
|
21968
|
+
);
|
|
21969
|
+
var update_stylesheet_default = UpdateStylesheetTool;
|
|
21970
|
+
|
|
21971
|
+
// src/umb-management-api/tools/stylesheet/put/rename-stylesheet.ts
|
|
21972
|
+
|
|
21973
|
+
var RenameStylesheetTool = CreateUmbracoTool(
|
|
21974
|
+
"rename-stylesheet",
|
|
21975
|
+
`Renames a stylesheet`,
|
|
21976
|
+
_zod.z.object({
|
|
21977
|
+
...putStylesheetByPathRenameParams.shape,
|
|
21978
|
+
...putStylesheetByPathRenameBody.shape
|
|
21979
|
+
}).shape,
|
|
21980
|
+
async (model) => {
|
|
21981
|
+
const client = UmbracoManagementClient2.getClient();
|
|
21982
|
+
const { path: path3, ...renameModel } = model;
|
|
21983
|
+
const normalizedPath = encodeURIComponent(path3);
|
|
21984
|
+
var response = await client.putStylesheetByPathRename(normalizedPath, renameModel);
|
|
21985
|
+
return {
|
|
21986
|
+
content: [
|
|
21987
|
+
{
|
|
21988
|
+
type: "text",
|
|
21989
|
+
text: JSON.stringify(response)
|
|
21990
|
+
}
|
|
21991
|
+
]
|
|
21992
|
+
};
|
|
21993
|
+
}
|
|
21994
|
+
);
|
|
21995
|
+
var rename_stylesheet_default = RenameStylesheetTool;
|
|
21996
|
+
|
|
21997
|
+
// src/umb-management-api/tools/stylesheet/delete/delete-stylesheet.ts
|
|
21998
|
+
var DeleteStylesheetTool = CreateUmbracoTool(
|
|
21999
|
+
"delete-stylesheet",
|
|
22000
|
+
"Deletes a stylesheet by its path",
|
|
22001
|
+
deleteStylesheetByPathParams.shape,
|
|
22002
|
+
async (model) => {
|
|
22003
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22004
|
+
var response = await client.deleteStylesheetByPath(model.path);
|
|
22005
|
+
return {
|
|
22006
|
+
content: [
|
|
22007
|
+
{
|
|
22008
|
+
type: "text",
|
|
22009
|
+
text: JSON.stringify(response)
|
|
22010
|
+
}
|
|
22011
|
+
]
|
|
22012
|
+
};
|
|
22013
|
+
}
|
|
22014
|
+
);
|
|
22015
|
+
var delete_stylesheet_default = DeleteStylesheetTool;
|
|
22016
|
+
|
|
22017
|
+
// src/umb-management-api/tools/stylesheet/delete/delete-stylesheet-folder.ts
|
|
22018
|
+
var DeleteStylesheetFolderTool = CreateUmbracoTool(
|
|
22019
|
+
"delete-stylesheet-folder",
|
|
22020
|
+
"Deletes a stylesheet folder by its path",
|
|
22021
|
+
deleteStylesheetFolderByPathParams.shape,
|
|
22022
|
+
async (model) => {
|
|
22023
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22024
|
+
var response = await client.deleteStylesheetFolderByPath(model.path);
|
|
22025
|
+
return {
|
|
22026
|
+
content: [
|
|
22027
|
+
{
|
|
22028
|
+
type: "text",
|
|
22029
|
+
text: JSON.stringify(response)
|
|
22030
|
+
}
|
|
22031
|
+
]
|
|
22032
|
+
};
|
|
22033
|
+
}
|
|
22034
|
+
);
|
|
22035
|
+
var delete_stylesheet_folder_default = DeleteStylesheetFolderTool;
|
|
22036
|
+
|
|
22037
|
+
// src/umb-management-api/tools/stylesheet/items/get/get-ancestors.ts
|
|
22038
|
+
var GetStylesheetAncestorsTool = CreateUmbracoTool(
|
|
22039
|
+
"get-stylesheet-ancestors",
|
|
22040
|
+
"Gets the ancestors of a stylesheet in the tree structure",
|
|
22041
|
+
getTreeStylesheetAncestorsQueryParams.shape,
|
|
22042
|
+
async (model) => {
|
|
22043
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22044
|
+
var response = await client.getTreeStylesheetAncestors(model);
|
|
22045
|
+
return {
|
|
22046
|
+
content: [
|
|
22047
|
+
{
|
|
22048
|
+
type: "text",
|
|
22049
|
+
text: JSON.stringify(response)
|
|
22050
|
+
}
|
|
22051
|
+
]
|
|
22052
|
+
};
|
|
22053
|
+
}
|
|
22054
|
+
);
|
|
22055
|
+
var get_ancestors_default10 = GetStylesheetAncestorsTool;
|
|
22056
|
+
|
|
22057
|
+
// src/umb-management-api/tools/stylesheet/items/get/get-children.ts
|
|
22058
|
+
var GetStylesheetChildrenTool = CreateUmbracoTool(
|
|
22059
|
+
"get-stylesheet-children",
|
|
22060
|
+
"Gets the children of a stylesheet in the tree structure",
|
|
22061
|
+
getTreeStylesheetChildrenQueryParams.shape,
|
|
22062
|
+
async (model) => {
|
|
22063
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22064
|
+
var response = await client.getTreeStylesheetChildren(model);
|
|
22065
|
+
return {
|
|
22066
|
+
content: [
|
|
22067
|
+
{
|
|
22068
|
+
type: "text",
|
|
22069
|
+
text: JSON.stringify(response)
|
|
22070
|
+
}
|
|
22071
|
+
]
|
|
22072
|
+
};
|
|
22073
|
+
}
|
|
22074
|
+
);
|
|
22075
|
+
var get_children_default10 = GetStylesheetChildrenTool;
|
|
22076
|
+
|
|
22077
|
+
// src/umb-management-api/tools/stylesheet/items/get/get-root.ts
|
|
22078
|
+
var GetStylesheetRootTool = CreateUmbracoTool(
|
|
22079
|
+
"get-stylesheet-root",
|
|
22080
|
+
"Gets the root stylesheets in the tree structure",
|
|
22081
|
+
getTreeStylesheetRootQueryParams.shape,
|
|
22082
|
+
async (model) => {
|
|
22083
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22084
|
+
var response = await client.getTreeStylesheetRoot(model);
|
|
22085
|
+
return {
|
|
22086
|
+
content: [
|
|
22087
|
+
{
|
|
22088
|
+
type: "text",
|
|
22089
|
+
text: JSON.stringify(response)
|
|
22090
|
+
}
|
|
22091
|
+
]
|
|
22092
|
+
};
|
|
22093
|
+
}
|
|
22094
|
+
);
|
|
22095
|
+
var get_root_default12 = GetStylesheetRootTool;
|
|
22096
|
+
|
|
22097
|
+
// src/umb-management-api/tools/stylesheet/items/get/get-search.ts
|
|
22098
|
+
var GetStylesheetSearchTool = CreateUmbracoTool(
|
|
22099
|
+
"get-stylesheet-search",
|
|
22100
|
+
"Searches for stylesheets by name or path",
|
|
22101
|
+
getItemStylesheetQueryParams.shape,
|
|
22102
|
+
async (model) => {
|
|
22103
|
+
const client = UmbracoManagementClient2.getClient();
|
|
22104
|
+
var response = await client.getItemStylesheet(model);
|
|
22105
|
+
return {
|
|
22106
|
+
content: [
|
|
22107
|
+
{
|
|
22108
|
+
type: "text",
|
|
22109
|
+
text: JSON.stringify(response)
|
|
22110
|
+
}
|
|
22111
|
+
]
|
|
22112
|
+
};
|
|
22113
|
+
}
|
|
22114
|
+
);
|
|
22115
|
+
var get_search_default4 = GetStylesheetSearchTool;
|
|
22116
|
+
|
|
22117
|
+
// src/umb-management-api/tools/stylesheet/index.ts
|
|
22118
|
+
var StylesheetCollection = {
|
|
22119
|
+
metadata: {
|
|
22120
|
+
name: "stylesheet",
|
|
22121
|
+
displayName: "Stylesheets",
|
|
22122
|
+
description: "CSS stylesheet file management",
|
|
22123
|
+
dependencies: []
|
|
22124
|
+
},
|
|
22125
|
+
tools: (user) => {
|
|
22126
|
+
const tools = [];
|
|
22127
|
+
if (AuthorizationPolicies.TreeAccessStylesheets(user)) {
|
|
22128
|
+
tools.push(create_stylesheet_default());
|
|
22129
|
+
tools.push(create_stylesheet_folder_default());
|
|
22130
|
+
tools.push(get_stylesheet_by_path_default());
|
|
22131
|
+
tools.push(get_stylesheet_folder_by_path_default());
|
|
22132
|
+
tools.push(update_stylesheet_default());
|
|
22133
|
+
tools.push(rename_stylesheet_default());
|
|
22134
|
+
tools.push(delete_stylesheet_default());
|
|
22135
|
+
tools.push(delete_stylesheet_folder_default());
|
|
22136
|
+
tools.push(get_ancestors_default10());
|
|
22137
|
+
tools.push(get_children_default10());
|
|
22138
|
+
tools.push(get_root_default12());
|
|
22139
|
+
tools.push(get_search_default4());
|
|
22140
|
+
}
|
|
22141
|
+
return tools;
|
|
22142
|
+
}
|
|
22143
|
+
};
|
|
22144
|
+
|
|
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);
|
|
22153
|
+
return {
|
|
22154
|
+
content: [
|
|
22155
|
+
{
|
|
22156
|
+
type: "text",
|
|
22157
|
+
text: JSON.stringify(response)
|
|
22158
|
+
}
|
|
22159
|
+
]
|
|
22160
|
+
};
|
|
22161
|
+
}
|
|
22162
|
+
);
|
|
22163
|
+
var get_health_check_groups_default = GetHealthCheckGroupsTool;
|
|
22164
|
+
|
|
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)
|
|
22178
|
+
}
|
|
22179
|
+
]
|
|
22180
|
+
};
|
|
22181
|
+
}
|
|
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
|
+
|
|
22712
|
+
var GetRelationByRelationTypeIdTool = CreateUmbracoTool(
|
|
22713
|
+
"get-relation-by-relation-type-id",
|
|
22714
|
+
"Gets relations by relation type ID",
|
|
22715
|
+
_zod.z.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();
|
|
20814
22903
|
return {
|
|
20815
22904
|
content: [
|
|
20816
22905
|
{
|
|
@@ -20821,30 +22910,16 @@ var UpdateScriptTool = CreateUmbracoTool(
|
|
|
20821
22910
|
};
|
|
20822
22911
|
}
|
|
20823
22912
|
);
|
|
20824
|
-
var
|
|
22913
|
+
var get_user_current_login_providers_default = GetUserCurrentLoginProvidersTool;
|
|
20825
22914
|
|
|
20826
|
-
// src/umb-management-api/tools/
|
|
20827
|
-
|
|
20828
|
-
|
|
20829
|
-
|
|
20830
|
-
|
|
20831
|
-
|
|
20832
|
-
});
|
|
20833
|
-
var RenameScriptTool = CreateUmbracoTool(
|
|
20834
|
-
"rename-script",
|
|
20835
|
-
"Renames a script by name and folder path",
|
|
20836
|
-
renameScriptSchema.shape,
|
|
20837
|
-
async (model) => {
|
|
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) => {
|
|
20838
22921
|
const client = UmbracoManagementClient2.getClient();
|
|
20839
|
-
const
|
|
20840
|
-
const newName = model.newName.endsWith(".js") ? model.newName : `${model.newName}.js`;
|
|
20841
|
-
const normalizedFolderPath = model.folderPath && !model.folderPath.startsWith("/") ? `/${model.folderPath}` : model.folderPath;
|
|
20842
|
-
const fullPath = normalizedFolderPath ? `${normalizedFolderPath}/${currentName}` : `/${currentName}`;
|
|
20843
|
-
const encodedPath = encodeURIComponent(fullPath);
|
|
20844
|
-
const renameModel = {
|
|
20845
|
-
name: newName
|
|
20846
|
-
};
|
|
20847
|
-
const response = await client.putScriptByPathRename(encodedPath, renameModel);
|
|
22922
|
+
const response = await client.getUserCurrentPermissions(params);
|
|
20848
22923
|
return {
|
|
20849
22924
|
content: [
|
|
20850
22925
|
{
|
|
@@ -20855,16 +22930,16 @@ var RenameScriptTool = CreateUmbracoTool(
|
|
|
20855
22930
|
};
|
|
20856
22931
|
}
|
|
20857
22932
|
);
|
|
20858
|
-
var
|
|
22933
|
+
var get_user_current_permissions_default = GetUserCurrentPermissionsTool;
|
|
20859
22934
|
|
|
20860
|
-
// src/umb-management-api/tools/
|
|
20861
|
-
var
|
|
20862
|
-
"
|
|
20863
|
-
"
|
|
20864
|
-
|
|
20865
|
-
async (
|
|
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) => {
|
|
20866
22941
|
const client = UmbracoManagementClient2.getClient();
|
|
20867
|
-
const response = await client.
|
|
22942
|
+
const response = await client.getUserCurrentPermissionsDocument(params);
|
|
20868
22943
|
return {
|
|
20869
22944
|
content: [
|
|
20870
22945
|
{
|
|
@@ -20875,16 +22950,16 @@ var DeleteScriptTool = CreateUmbracoTool(
|
|
|
20875
22950
|
};
|
|
20876
22951
|
}
|
|
20877
22952
|
);
|
|
20878
|
-
var
|
|
22953
|
+
var get_user_current_permissions_document_default = GetUserCurrentPermissionsDocumentTool;
|
|
20879
22954
|
|
|
20880
|
-
// src/umb-management-api/tools/
|
|
20881
|
-
var
|
|
20882
|
-
"
|
|
20883
|
-
"
|
|
20884
|
-
|
|
20885
|
-
async (
|
|
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) => {
|
|
20886
22961
|
const client = UmbracoManagementClient2.getClient();
|
|
20887
|
-
const response = await client.
|
|
22962
|
+
const response = await client.getUserCurrentPermissionsMedia(params);
|
|
20888
22963
|
return {
|
|
20889
22964
|
content: [
|
|
20890
22965
|
{
|
|
@@ -20895,44 +22970,16 @@ var DeleteScriptFolderTool = CreateUmbracoTool(
|
|
|
20895
22970
|
};
|
|
20896
22971
|
}
|
|
20897
22972
|
);
|
|
20898
|
-
var
|
|
20899
|
-
|
|
20900
|
-
// src/umb-management-api/tools/script/index.ts
|
|
20901
|
-
var ScriptCollection = {
|
|
20902
|
-
metadata: {
|
|
20903
|
-
name: "script",
|
|
20904
|
-
displayName: "Scripts",
|
|
20905
|
-
description: "JavaScript file management and scripting",
|
|
20906
|
-
dependencies: []
|
|
20907
|
-
},
|
|
20908
|
-
tools: (user) => {
|
|
20909
|
-
const tools = [];
|
|
20910
|
-
if (AuthorizationPolicies.TreeAccessScripts(user)) {
|
|
20911
|
-
tools.push(get_script_by_path_default());
|
|
20912
|
-
tools.push(get_script_folder_by_path_default());
|
|
20913
|
-
tools.push(get_script_items_default());
|
|
20914
|
-
tools.push(get_script_tree_ancestors_default());
|
|
20915
|
-
tools.push(get_script_tree_children_default());
|
|
20916
|
-
tools.push(get_script_tree_root_default());
|
|
20917
|
-
tools.push(create_script_default());
|
|
20918
|
-
tools.push(create_script_folder_default());
|
|
20919
|
-
tools.push(update_script_default());
|
|
20920
|
-
tools.push(rename_script_default());
|
|
20921
|
-
tools.push(delete_script_default());
|
|
20922
|
-
tools.push(delete_script_folder_default());
|
|
20923
|
-
}
|
|
20924
|
-
return tools;
|
|
20925
|
-
}
|
|
20926
|
-
};
|
|
22973
|
+
var get_user_current_permissions_media_default = GetUserCurrentPermissionsMediaTool;
|
|
20927
22974
|
|
|
20928
|
-
// src/umb-management-api/tools/
|
|
20929
|
-
var
|
|
20930
|
-
"
|
|
20931
|
-
"
|
|
20932
|
-
|
|
20933
|
-
async (
|
|
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 }) => {
|
|
20934
22981
|
const client = UmbracoManagementClient2.getClient();
|
|
20935
|
-
|
|
22982
|
+
const response = await client.getUserByIdCalculateStartNodes(id);
|
|
20936
22983
|
return {
|
|
20937
22984
|
content: [
|
|
20938
22985
|
{
|
|
@@ -20943,16 +22990,19 @@ var CreateStylesheetTool = CreateUmbracoTool(
|
|
|
20943
22990
|
};
|
|
20944
22991
|
}
|
|
20945
22992
|
);
|
|
20946
|
-
var
|
|
22993
|
+
var get_user_by_id_calculate_start_nodes_default = GetUserByIdCalculateStartNodesTool;
|
|
20947
22994
|
|
|
20948
|
-
// src/umb-management-api/tools/
|
|
20949
|
-
var
|
|
20950
|
-
"
|
|
20951
|
-
"
|
|
20952
|
-
|
|
20953
|
-
|
|
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 }) => {
|
|
20954
23004
|
const client = UmbracoManagementClient2.getClient();
|
|
20955
|
-
|
|
23005
|
+
const response = await client.postUserAvatarById(id, { file });
|
|
20956
23006
|
return {
|
|
20957
23007
|
content: [
|
|
20958
23008
|
{
|
|
@@ -20963,16 +23013,16 @@ var CreateStylesheetFolderTool = CreateUmbracoTool(
|
|
|
20963
23013
|
};
|
|
20964
23014
|
}
|
|
20965
23015
|
);
|
|
20966
|
-
var
|
|
23016
|
+
var upload_user_avatar_by_id_default = UploadUserAvatarByIdTool;
|
|
20967
23017
|
|
|
20968
|
-
// src/umb-management-api/tools/
|
|
20969
|
-
var
|
|
20970
|
-
"
|
|
20971
|
-
"
|
|
20972
|
-
|
|
20973
|
-
async (
|
|
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 }) => {
|
|
20974
23024
|
const client = UmbracoManagementClient2.getClient();
|
|
20975
|
-
|
|
23025
|
+
const response = await client.postUserCurrentAvatar({ file });
|
|
20976
23026
|
return {
|
|
20977
23027
|
content: [
|
|
20978
23028
|
{
|
|
@@ -20983,16 +23033,16 @@ var GetStylesheetByPathTool = CreateUmbracoTool(
|
|
|
20983
23033
|
};
|
|
20984
23034
|
}
|
|
20985
23035
|
);
|
|
20986
|
-
var
|
|
23036
|
+
var upload_user_current_avatar_default = UploadUserCurrentAvatarTool;
|
|
20987
23037
|
|
|
20988
|
-
// src/umb-management-api/tools/
|
|
20989
|
-
var
|
|
20990
|
-
"
|
|
20991
|
-
"
|
|
20992
|
-
|
|
20993
|
-
async (
|
|
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 }) => {
|
|
20994
23044
|
const client = UmbracoManagementClient2.getClient();
|
|
20995
|
-
|
|
23045
|
+
const response = await client.deleteUserAvatarById(id);
|
|
20996
23046
|
return {
|
|
20997
23047
|
content: [
|
|
20998
23048
|
{
|
|
@@ -21003,21 +23053,47 @@ var GetStylesheetFolderByPathTool = CreateUmbracoTool(
|
|
|
21003
23053
|
};
|
|
21004
23054
|
}
|
|
21005
23055
|
);
|
|
21006
|
-
var
|
|
23056
|
+
var delete_user_avatar_by_id_default = DeleteUserAvatarByIdTool;
|
|
21007
23057
|
|
|
21008
|
-
// src/umb-management-api/tools/
|
|
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
|
+
};
|
|
21009
23088
|
|
|
21010
|
-
|
|
21011
|
-
|
|
21012
|
-
"
|
|
21013
|
-
|
|
21014
|
-
|
|
21015
|
-
|
|
21016
|
-
}).shape,
|
|
21017
|
-
async (model) => {
|
|
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) => {
|
|
21018
23095
|
const client = UmbracoManagementClient2.getClient();
|
|
21019
|
-
const
|
|
21020
|
-
var response = await client.putStylesheetByPath(path, updateModel);
|
|
23096
|
+
const response = await client.postUserData(body);
|
|
21021
23097
|
return {
|
|
21022
23098
|
content: [
|
|
21023
23099
|
{
|
|
@@ -21028,22 +23104,16 @@ var UpdateStylesheetTool = CreateUmbracoTool(
|
|
|
21028
23104
|
};
|
|
21029
23105
|
}
|
|
21030
23106
|
);
|
|
21031
|
-
var
|
|
21032
|
-
|
|
21033
|
-
// src/umb-management-api/tools/stylesheet/put/rename-stylesheet.ts
|
|
23107
|
+
var create_user_data_default = CreateUserDataTool;
|
|
21034
23108
|
|
|
21035
|
-
|
|
21036
|
-
|
|
21037
|
-
|
|
21038
|
-
|
|
21039
|
-
|
|
21040
|
-
|
|
21041
|
-
}).shape,
|
|
21042
|
-
async (model) => {
|
|
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) => {
|
|
21043
23115
|
const client = UmbracoManagementClient2.getClient();
|
|
21044
|
-
const
|
|
21045
|
-
const normalizedPath = encodeURIComponent(path);
|
|
21046
|
-
var response = await client.putStylesheetByPathRename(normalizedPath, renameModel);
|
|
23116
|
+
const response = await client.putUserData(body);
|
|
21047
23117
|
return {
|
|
21048
23118
|
content: [
|
|
21049
23119
|
{
|
|
@@ -21054,16 +23124,16 @@ var RenameStylesheetTool = CreateUmbracoTool(
|
|
|
21054
23124
|
};
|
|
21055
23125
|
}
|
|
21056
23126
|
);
|
|
21057
|
-
var
|
|
23127
|
+
var update_user_data_default = UpdateUserDataTool;
|
|
21058
23128
|
|
|
21059
|
-
// src/umb-management-api/tools/
|
|
21060
|
-
var
|
|
21061
|
-
"
|
|
21062
|
-
"
|
|
21063
|
-
|
|
21064
|
-
async (
|
|
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) => {
|
|
21065
23135
|
const client = UmbracoManagementClient2.getClient();
|
|
21066
|
-
|
|
23136
|
+
const response = await client.getUserData(params);
|
|
21067
23137
|
return {
|
|
21068
23138
|
content: [
|
|
21069
23139
|
{
|
|
@@ -21074,16 +23144,16 @@ var DeleteStylesheetTool = CreateUmbracoTool(
|
|
|
21074
23144
|
};
|
|
21075
23145
|
}
|
|
21076
23146
|
);
|
|
21077
|
-
var
|
|
23147
|
+
var get_user_data_default = GetUserDataTool;
|
|
21078
23148
|
|
|
21079
|
-
// src/umb-management-api/tools/
|
|
21080
|
-
var
|
|
21081
|
-
"
|
|
21082
|
-
"
|
|
21083
|
-
|
|
21084
|
-
async (
|
|
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 }) => {
|
|
21085
23155
|
const client = UmbracoManagementClient2.getClient();
|
|
21086
|
-
|
|
23156
|
+
const response = await client.getUserDataById(id);
|
|
21087
23157
|
return {
|
|
21088
23158
|
content: [
|
|
21089
23159
|
{
|
|
@@ -21094,16 +23164,34 @@ var DeleteStylesheetFolderTool = CreateUmbracoTool(
|
|
|
21094
23164
|
};
|
|
21095
23165
|
}
|
|
21096
23166
|
);
|
|
21097
|
-
var
|
|
23167
|
+
var get_user_data_by_id_default = GetUserDataByIdTool;
|
|
21098
23168
|
|
|
21099
|
-
// src/umb-management-api/tools/
|
|
21100
|
-
var
|
|
21101
|
-
|
|
21102
|
-
|
|
21103
|
-
|
|
21104
|
-
|
|
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) => {
|
|
21105
23193
|
const client = UmbracoManagementClient2.getClient();
|
|
21106
|
-
|
|
23194
|
+
const response = await client.getItemStaticFile(params);
|
|
21107
23195
|
return {
|
|
21108
23196
|
content: [
|
|
21109
23197
|
{
|
|
@@ -21114,16 +23202,16 @@ var GetStylesheetAncestorsTool = CreateUmbracoTool(
|
|
|
21114
23202
|
};
|
|
21115
23203
|
}
|
|
21116
23204
|
);
|
|
21117
|
-
var
|
|
23205
|
+
var get_static_files_default = GetStaticFilesTool;
|
|
21118
23206
|
|
|
21119
|
-
// src/umb-management-api/tools/
|
|
21120
|
-
var
|
|
21121
|
-
"get-
|
|
21122
|
-
"Gets
|
|
21123
|
-
|
|
21124
|
-
async (
|
|
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) => {
|
|
21125
23213
|
const client = UmbracoManagementClient2.getClient();
|
|
21126
|
-
|
|
23214
|
+
const response = await client.getTreeStaticFileRoot(params);
|
|
21127
23215
|
return {
|
|
21128
23216
|
content: [
|
|
21129
23217
|
{
|
|
@@ -21134,16 +23222,16 @@ var GetStylesheetChildrenTool = CreateUmbracoTool(
|
|
|
21134
23222
|
};
|
|
21135
23223
|
}
|
|
21136
23224
|
);
|
|
21137
|
-
var
|
|
23225
|
+
var get_root_default13 = GetStaticFileRootTool;
|
|
21138
23226
|
|
|
21139
|
-
// src/umb-management-api/tools/
|
|
21140
|
-
var
|
|
21141
|
-
"get-
|
|
21142
|
-
"
|
|
21143
|
-
|
|
21144
|
-
async (
|
|
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) => {
|
|
21145
23233
|
const client = UmbracoManagementClient2.getClient();
|
|
21146
|
-
|
|
23234
|
+
const response = await client.getTreeStaticFileChildren(params);
|
|
21147
23235
|
return {
|
|
21148
23236
|
content: [
|
|
21149
23237
|
{
|
|
@@ -21154,16 +23242,16 @@ var GetStylesheetRootTool = CreateUmbracoTool(
|
|
|
21154
23242
|
};
|
|
21155
23243
|
}
|
|
21156
23244
|
);
|
|
21157
|
-
var
|
|
23245
|
+
var get_children_default11 = GetStaticFileChildrenTool;
|
|
21158
23246
|
|
|
21159
|
-
// src/umb-management-api/tools/
|
|
21160
|
-
var
|
|
21161
|
-
"get-
|
|
21162
|
-
"
|
|
21163
|
-
|
|
21164
|
-
async (
|
|
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) => {
|
|
21165
23253
|
const client = UmbracoManagementClient2.getClient();
|
|
21166
|
-
|
|
23254
|
+
const response = await client.getTreeStaticFileAncestors(params);
|
|
21167
23255
|
return {
|
|
21168
23256
|
content: [
|
|
21169
23257
|
{
|
|
@@ -21174,31 +23262,22 @@ var GetStylesheetSearchTool = CreateUmbracoTool(
|
|
|
21174
23262
|
};
|
|
21175
23263
|
}
|
|
21176
23264
|
);
|
|
21177
|
-
var
|
|
23265
|
+
var get_ancestors_default11 = GetStaticFileAncestorsTool;
|
|
21178
23266
|
|
|
21179
|
-
// src/umb-management-api/tools/
|
|
21180
|
-
var
|
|
23267
|
+
// src/umb-management-api/tools/static-file/index.ts
|
|
23268
|
+
var StaticFileCollection = {
|
|
21181
23269
|
metadata: {
|
|
21182
|
-
name: "
|
|
21183
|
-
displayName: "
|
|
21184
|
-
description: "
|
|
23270
|
+
name: "static-file",
|
|
23271
|
+
displayName: "Static Files",
|
|
23272
|
+
description: "Read-only access to static files and folders in the Umbraco file system",
|
|
21185
23273
|
dependencies: []
|
|
21186
23274
|
},
|
|
21187
23275
|
tools: (user) => {
|
|
21188
|
-
const tools = [
|
|
21189
|
-
|
|
21190
|
-
|
|
21191
|
-
|
|
21192
|
-
|
|
21193
|
-
tools.push(get_stylesheet_folder_by_path_default());
|
|
21194
|
-
tools.push(update_stylesheet_default());
|
|
21195
|
-
tools.push(rename_stylesheet_default());
|
|
21196
|
-
tools.push(delete_stylesheet_default());
|
|
21197
|
-
tools.push(delete_stylesheet_folder_default());
|
|
21198
|
-
tools.push(get_ancestors_default10());
|
|
21199
|
-
tools.push(get_children_default10());
|
|
21200
|
-
tools.push(get_root_default12());
|
|
21201
|
-
}
|
|
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());
|
|
21202
23281
|
return tools;
|
|
21203
23282
|
}
|
|
21204
23283
|
};
|
|
@@ -21213,12 +23292,12 @@ var DEFAULT_COLLECTION_CONFIG = {
|
|
|
21213
23292
|
|
|
21214
23293
|
// src/helpers/config/collection-config-loader.ts
|
|
21215
23294
|
var CollectionConfigLoader = class {
|
|
21216
|
-
static
|
|
23295
|
+
static loadFromConfig(config) {
|
|
21217
23296
|
return {
|
|
21218
|
-
enabledCollections: _nullishCoalesce(
|
|
21219
|
-
disabledCollections: _nullishCoalesce(
|
|
21220
|
-
enabledTools: _nullishCoalesce(
|
|
21221
|
-
disabledTools: _nullishCoalesce(
|
|
23297
|
+
enabledCollections: _nullishCoalesce(config.includeToolCollections, () => ( DEFAULT_COLLECTION_CONFIG.enabledCollections)),
|
|
23298
|
+
disabledCollections: _nullishCoalesce(config.excludeToolCollections, () => ( DEFAULT_COLLECTION_CONFIG.disabledCollections)),
|
|
23299
|
+
enabledTools: _nullishCoalesce(config.includeTools, () => ( DEFAULT_COLLECTION_CONFIG.enabledTools)),
|
|
23300
|
+
disabledTools: _nullishCoalesce(config.excludeTools, () => ( DEFAULT_COLLECTION_CONFIG.disabledTools))
|
|
21222
23301
|
};
|
|
21223
23302
|
}
|
|
21224
23303
|
};
|
|
@@ -21248,14 +23327,26 @@ var availableCollections = [
|
|
|
21248
23327
|
UserGroupCollection,
|
|
21249
23328
|
TemporaryFileCollection,
|
|
21250
23329
|
ScriptCollection,
|
|
21251
|
-
StylesheetCollection
|
|
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
|
|
21252
23343
|
];
|
|
21253
|
-
var mapTools = (server, user, tools) => {
|
|
23344
|
+
var mapTools = (server, user, tools, config) => {
|
|
21254
23345
|
return tools.forEach((tool) => {
|
|
21255
23346
|
const userHasPermission = tool.enabled === void 0 || tool.enabled(user);
|
|
21256
23347
|
if (!userHasPermission) return;
|
|
21257
|
-
if (_optionalChain([
|
|
21258
|
-
if (_optionalChain([
|
|
23348
|
+
if (_optionalChain([config, 'access', _66 => _66.disabledTools, 'optionalAccess', _67 => _67.includes, 'call', _68 => _68(tool.name)])) return;
|
|
23349
|
+
if (_optionalChain([config, 'access', _69 => _69.enabledTools, 'optionalAccess', _70 => _70.length]) && !config.enabledTools.includes(tool.name)) return;
|
|
21259
23350
|
server.tool(tool.name, tool.description, tool.schema, tool.handler);
|
|
21260
23351
|
});
|
|
21261
23352
|
};
|
|
@@ -21276,7 +23367,7 @@ function resolveDependencies(requestedNames, collections) {
|
|
|
21276
23367
|
const collectionMap = new Map(collections.map((c) => [c.metadata.name, c]));
|
|
21277
23368
|
function addDependencies(collectionName) {
|
|
21278
23369
|
const collection = collectionMap.get(collectionName);
|
|
21279
|
-
if (_optionalChain([collection, 'optionalAccess',
|
|
23370
|
+
if (_optionalChain([collection, 'optionalAccess', _71 => _71.metadata, 'access', _72 => _72.dependencies])) {
|
|
21280
23371
|
collection.metadata.dependencies.forEach((dep) => {
|
|
21281
23372
|
if (!result.has(dep)) {
|
|
21282
23373
|
result.add(dep);
|
|
@@ -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
|
+
var _dotenv = require('dotenv');
|
|
23816
|
+
var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
|
|
23817
|
+
var _helpers = require('yargs/helpers');
|
|
23818
|
+
|
|
23819
|
+
function maskSecret(secret) {
|
|
23820
|
+
if (!secret || secret.length <= 4) return "****";
|
|
23821
|
+
return `****${secret.slice(-4)}`;
|
|
23822
|
+
}
|
|
23823
|
+
function getServerConfig(isStdioMode) {
|
|
23824
|
+
const argv = _yargs2.default.call(void 0, _helpers.hideBin.call(void 0, 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(_nullishCoalesce(process.env.NPM_PACKAGE_VERSION, () => ( "unknown"))).parseSync();
|
|
23858
|
+
let envFilePath;
|
|
23859
|
+
let envFileSource;
|
|
23860
|
+
if (argv["env"]) {
|
|
23861
|
+
envFilePath = _path.resolve.call(void 0, argv["env"]);
|
|
23862
|
+
envFileSource = "cli";
|
|
23863
|
+
} else {
|
|
23864
|
+
envFilePath = _path.resolve.call(void 0, process.cwd(), ".env");
|
|
23865
|
+
envFileSource = "default";
|
|
23866
|
+
}
|
|
23867
|
+
_dotenv.config.call(void 0, { 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
|
};
|