@umbraco-cms/mcp-dev 16.0.0-beta.2 → 16.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -755
- package/dist/index.cjs +2581 -1318
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3011 -1748
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
package/dist/index.cjs
CHANGED
|
@@ -815,12 +815,12 @@ var StdioServerTransport = class {
|
|
|
815
815
|
(_a = this.onclose) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
816
816
|
}
|
|
817
817
|
send(message) {
|
|
818
|
-
return new Promise((
|
|
818
|
+
return new Promise((resolve3) => {
|
|
819
819
|
const json = serializeMessage(message);
|
|
820
820
|
if (this._stdout.write(json)) {
|
|
821
|
-
|
|
821
|
+
resolve3();
|
|
822
822
|
} else {
|
|
823
|
-
this._stdout.once("drain",
|
|
823
|
+
this._stdout.once("drain", resolve3);
|
|
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((resolve3, 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
|
+
resolve3(result);
|
|
1081
1081
|
} catch (error) {
|
|
1082
1082
|
reject(error);
|
|
1083
1083
|
}
|
|
@@ -3308,11 +3308,14 @@ UmbracoAxios.interceptors.response.use(
|
|
|
3308
3308
|
// src/orval/client/mutators/umbraco-management.ts
|
|
3309
3309
|
var UmbracoManagementClient = (config, options) => {
|
|
3310
3310
|
const source = _axios2.default.CancelToken.source();
|
|
3311
|
+
const returnFullResponse = _optionalChain([options, 'optionalAccess', _46 => _46.returnFullResponse]);
|
|
3311
3312
|
const promise = UmbracoAxios({
|
|
3312
3313
|
...config,
|
|
3313
3314
|
...options,
|
|
3314
3315
|
cancelToken: source.token
|
|
3315
|
-
}).then((
|
|
3316
|
+
}).then((response) => {
|
|
3317
|
+
return returnFullResponse ? response : response.data;
|
|
3318
|
+
});
|
|
3316
3319
|
promise.cancel = () => {
|
|
3317
3320
|
source.cancel("Query was cancelled");
|
|
3318
3321
|
};
|
|
@@ -5839,28 +5842,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
5839
5842
|
options
|
|
5840
5843
|
);
|
|
5841
5844
|
};
|
|
5842
|
-
const getPartialViewByPath = (
|
|
5845
|
+
const getPartialViewByPath = (path4, options) => {
|
|
5843
5846
|
return UmbracoManagementClient(
|
|
5844
5847
|
{
|
|
5845
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5848
|
+
url: `/umbraco/management/api/v1/partial-view/${path4}`,
|
|
5846
5849
|
method: "GET"
|
|
5847
5850
|
},
|
|
5848
5851
|
options
|
|
5849
5852
|
);
|
|
5850
5853
|
};
|
|
5851
|
-
const deletePartialViewByPath = (
|
|
5854
|
+
const deletePartialViewByPath = (path4, options) => {
|
|
5852
5855
|
return UmbracoManagementClient(
|
|
5853
5856
|
{
|
|
5854
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5857
|
+
url: `/umbraco/management/api/v1/partial-view/${path4}`,
|
|
5855
5858
|
method: "DELETE"
|
|
5856
5859
|
},
|
|
5857
5860
|
options
|
|
5858
5861
|
);
|
|
5859
5862
|
};
|
|
5860
|
-
const putPartialViewByPath = (
|
|
5863
|
+
const putPartialViewByPath = (path4, updatePartialViewRequestModel, options) => {
|
|
5861
5864
|
return UmbracoManagementClient(
|
|
5862
5865
|
{
|
|
5863
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5866
|
+
url: `/umbraco/management/api/v1/partial-view/${path4}`,
|
|
5864
5867
|
method: "PUT",
|
|
5865
5868
|
headers: { "Content-Type": "application/json" },
|
|
5866
5869
|
data: updatePartialViewRequestModel
|
|
@@ -5868,10 +5871,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
5868
5871
|
options
|
|
5869
5872
|
);
|
|
5870
5873
|
};
|
|
5871
|
-
const putPartialViewByPathRename = (
|
|
5874
|
+
const putPartialViewByPathRename = (path4, renamePartialViewRequestModel, options) => {
|
|
5872
5875
|
return UmbracoManagementClient(
|
|
5873
5876
|
{
|
|
5874
|
-
url: `/umbraco/management/api/v1/partial-view/${
|
|
5877
|
+
url: `/umbraco/management/api/v1/partial-view/${path4}/rename`,
|
|
5875
5878
|
method: "PUT",
|
|
5876
5879
|
headers: { "Content-Type": "application/json" },
|
|
5877
5880
|
data: renamePartialViewRequestModel
|
|
@@ -5890,19 +5893,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
5890
5893
|
options
|
|
5891
5894
|
);
|
|
5892
5895
|
};
|
|
5893
|
-
const getPartialViewFolderByPath = (
|
|
5896
|
+
const getPartialViewFolderByPath = (path4, options) => {
|
|
5894
5897
|
return UmbracoManagementClient(
|
|
5895
5898
|
{
|
|
5896
|
-
url: `/umbraco/management/api/v1/partial-view/folder/${
|
|
5899
|
+
url: `/umbraco/management/api/v1/partial-view/folder/${path4}`,
|
|
5897
5900
|
method: "GET"
|
|
5898
5901
|
},
|
|
5899
5902
|
options
|
|
5900
5903
|
);
|
|
5901
5904
|
};
|
|
5902
|
-
const deletePartialViewFolderByPath = (
|
|
5905
|
+
const deletePartialViewFolderByPath = (path4, options) => {
|
|
5903
5906
|
return UmbracoManagementClient(
|
|
5904
5907
|
{
|
|
5905
|
-
url: `/umbraco/management/api/v1/partial-view/folder/${
|
|
5908
|
+
url: `/umbraco/management/api/v1/partial-view/folder/${path4}`,
|
|
5906
5909
|
method: "DELETE"
|
|
5907
5910
|
},
|
|
5908
5911
|
options
|
|
@@ -6140,28 +6143,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
6140
6143
|
options
|
|
6141
6144
|
);
|
|
6142
6145
|
};
|
|
6143
|
-
const getScriptByPath = (
|
|
6146
|
+
const getScriptByPath = (path4, options) => {
|
|
6144
6147
|
return UmbracoManagementClient(
|
|
6145
6148
|
{
|
|
6146
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6149
|
+
url: `/umbraco/management/api/v1/script/${path4}`,
|
|
6147
6150
|
method: "GET"
|
|
6148
6151
|
},
|
|
6149
6152
|
options
|
|
6150
6153
|
);
|
|
6151
6154
|
};
|
|
6152
|
-
const deleteScriptByPath = (
|
|
6155
|
+
const deleteScriptByPath = (path4, options) => {
|
|
6153
6156
|
return UmbracoManagementClient(
|
|
6154
6157
|
{
|
|
6155
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6158
|
+
url: `/umbraco/management/api/v1/script/${path4}`,
|
|
6156
6159
|
method: "DELETE"
|
|
6157
6160
|
},
|
|
6158
6161
|
options
|
|
6159
6162
|
);
|
|
6160
6163
|
};
|
|
6161
|
-
const putScriptByPath = (
|
|
6164
|
+
const putScriptByPath = (path4, updateScriptRequestModel, options) => {
|
|
6162
6165
|
return UmbracoManagementClient(
|
|
6163
6166
|
{
|
|
6164
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6167
|
+
url: `/umbraco/management/api/v1/script/${path4}`,
|
|
6165
6168
|
method: "PUT",
|
|
6166
6169
|
headers: { "Content-Type": "application/json" },
|
|
6167
6170
|
data: updateScriptRequestModel
|
|
@@ -6169,10 +6172,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
6169
6172
|
options
|
|
6170
6173
|
);
|
|
6171
6174
|
};
|
|
6172
|
-
const putScriptByPathRename = (
|
|
6175
|
+
const putScriptByPathRename = (path4, renameScriptRequestModel, options) => {
|
|
6173
6176
|
return UmbracoManagementClient(
|
|
6174
6177
|
{
|
|
6175
|
-
url: `/umbraco/management/api/v1/script/${
|
|
6178
|
+
url: `/umbraco/management/api/v1/script/${path4}/rename`,
|
|
6176
6179
|
method: "PUT",
|
|
6177
6180
|
headers: { "Content-Type": "application/json" },
|
|
6178
6181
|
data: renameScriptRequestModel
|
|
@@ -6191,19 +6194,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
6191
6194
|
options
|
|
6192
6195
|
);
|
|
6193
6196
|
};
|
|
6194
|
-
const getScriptFolderByPath = (
|
|
6197
|
+
const getScriptFolderByPath = (path4, options) => {
|
|
6195
6198
|
return UmbracoManagementClient(
|
|
6196
6199
|
{
|
|
6197
|
-
url: `/umbraco/management/api/v1/script/folder/${
|
|
6200
|
+
url: `/umbraco/management/api/v1/script/folder/${path4}`,
|
|
6198
6201
|
method: "GET"
|
|
6199
6202
|
},
|
|
6200
6203
|
options
|
|
6201
6204
|
);
|
|
6202
6205
|
};
|
|
6203
|
-
const deleteScriptFolderByPath = (
|
|
6206
|
+
const deleteScriptFolderByPath = (path4, options) => {
|
|
6204
6207
|
return UmbracoManagementClient(
|
|
6205
6208
|
{
|
|
6206
|
-
url: `/umbraco/management/api/v1/script/folder/${
|
|
6209
|
+
url: `/umbraco/management/api/v1/script/folder/${path4}`,
|
|
6207
6210
|
method: "DELETE"
|
|
6208
6211
|
},
|
|
6209
6212
|
options
|
|
@@ -6417,28 +6420,28 @@ var getUmbracoManagementAPI = () => {
|
|
|
6417
6420
|
options
|
|
6418
6421
|
);
|
|
6419
6422
|
};
|
|
6420
|
-
const getStylesheetByPath = (
|
|
6423
|
+
const getStylesheetByPath = (path4, options) => {
|
|
6421
6424
|
return UmbracoManagementClient(
|
|
6422
6425
|
{
|
|
6423
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6426
|
+
url: `/umbraco/management/api/v1/stylesheet/${path4}`,
|
|
6424
6427
|
method: "GET"
|
|
6425
6428
|
},
|
|
6426
6429
|
options
|
|
6427
6430
|
);
|
|
6428
6431
|
};
|
|
6429
|
-
const deleteStylesheetByPath = (
|
|
6432
|
+
const deleteStylesheetByPath = (path4, options) => {
|
|
6430
6433
|
return UmbracoManagementClient(
|
|
6431
6434
|
{
|
|
6432
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6435
|
+
url: `/umbraco/management/api/v1/stylesheet/${path4}`,
|
|
6433
6436
|
method: "DELETE"
|
|
6434
6437
|
},
|
|
6435
6438
|
options
|
|
6436
6439
|
);
|
|
6437
6440
|
};
|
|
6438
|
-
const putStylesheetByPath = (
|
|
6441
|
+
const putStylesheetByPath = (path4, updateStylesheetRequestModel, options) => {
|
|
6439
6442
|
return UmbracoManagementClient(
|
|
6440
6443
|
{
|
|
6441
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6444
|
+
url: `/umbraco/management/api/v1/stylesheet/${path4}`,
|
|
6442
6445
|
method: "PUT",
|
|
6443
6446
|
headers: { "Content-Type": "application/json" },
|
|
6444
6447
|
data: updateStylesheetRequestModel
|
|
@@ -6446,10 +6449,10 @@ var getUmbracoManagementAPI = () => {
|
|
|
6446
6449
|
options
|
|
6447
6450
|
);
|
|
6448
6451
|
};
|
|
6449
|
-
const putStylesheetByPathRename = (
|
|
6452
|
+
const putStylesheetByPathRename = (path4, renameStylesheetRequestModel, options) => {
|
|
6450
6453
|
return UmbracoManagementClient(
|
|
6451
6454
|
{
|
|
6452
|
-
url: `/umbraco/management/api/v1/stylesheet/${
|
|
6455
|
+
url: `/umbraco/management/api/v1/stylesheet/${path4}/rename`,
|
|
6453
6456
|
method: "PUT",
|
|
6454
6457
|
headers: { "Content-Type": "application/json" },
|
|
6455
6458
|
data: renameStylesheetRequestModel
|
|
@@ -6468,19 +6471,19 @@ var getUmbracoManagementAPI = () => {
|
|
|
6468
6471
|
options
|
|
6469
6472
|
);
|
|
6470
6473
|
};
|
|
6471
|
-
const getStylesheetFolderByPath = (
|
|
6474
|
+
const getStylesheetFolderByPath = (path4, options) => {
|
|
6472
6475
|
return UmbracoManagementClient(
|
|
6473
6476
|
{
|
|
6474
|
-
url: `/umbraco/management/api/v1/stylesheet/folder/${
|
|
6477
|
+
url: `/umbraco/management/api/v1/stylesheet/folder/${path4}`,
|
|
6475
6478
|
method: "GET"
|
|
6476
6479
|
},
|
|
6477
6480
|
options
|
|
6478
6481
|
);
|
|
6479
6482
|
};
|
|
6480
|
-
const deleteStylesheetFolderByPath = (
|
|
6483
|
+
const deleteStylesheetFolderByPath = (path4, options) => {
|
|
6481
6484
|
return UmbracoManagementClient(
|
|
6482
6485
|
{
|
|
6483
|
-
url: `/umbraco/management/api/v1/stylesheet/folder/${
|
|
6486
|
+
url: `/umbraco/management/api/v1/stylesheet/folder/${path4}`,
|
|
6484
6487
|
method: "DELETE"
|
|
6485
6488
|
},
|
|
6486
6489
|
options
|
|
@@ -7331,7 +7334,7 @@ var getTemporaryFileAPI = () => ({
|
|
|
7331
7334
|
formData.append("File", postTemporaryFileBody2.File);
|
|
7332
7335
|
const headers = {
|
|
7333
7336
|
...formData.getHeaders(),
|
|
7334
|
-
..._optionalChain([options, 'optionalAccess',
|
|
7337
|
+
..._optionalChain([options, 'optionalAccess', _47 => _47.headers])
|
|
7335
7338
|
};
|
|
7336
7339
|
return UmbracoManagementClient(
|
|
7337
7340
|
{
|
|
@@ -7385,6 +7388,125 @@ var UmbracoManagementClient2 = (_class2 = class {
|
|
|
7385
7388
|
}
|
|
7386
7389
|
}, _class2.__initStatic2(), _class2);
|
|
7387
7390
|
|
|
7391
|
+
// package.json
|
|
7392
|
+
var package_default = {
|
|
7393
|
+
name: "@umbraco-cms/mcp-dev",
|
|
7394
|
+
version: "16.0.1",
|
|
7395
|
+
type: "module",
|
|
7396
|
+
description: "A model context protocol (MCP) server for Umbraco CMS",
|
|
7397
|
+
main: "index.js",
|
|
7398
|
+
mcpName: "io.github.umbraco/Umbraco-CMS-MCP-Dev",
|
|
7399
|
+
bin: {
|
|
7400
|
+
umbraco: "dist/index.js"
|
|
7401
|
+
},
|
|
7402
|
+
scripts: {
|
|
7403
|
+
clean: "rimraf dist",
|
|
7404
|
+
build: "tsup --config tsup.config.ts",
|
|
7405
|
+
compile: "tsc --noEmit",
|
|
7406
|
+
watch: "tsup --config tsup.config.ts --watch",
|
|
7407
|
+
generate: "orval --config orval.config.ts",
|
|
7408
|
+
inspect: "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
7409
|
+
test: "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
7410
|
+
"patch-publish-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha --access public",
|
|
7411
|
+
"eval-mcp:basic": "npx mcp-server-tester@1.4.0 evals tests/e2e/basic/basic-tests.yaml --server-config tests/e2e/basic/basic-tests-config.json",
|
|
7412
|
+
"eval-mcp:create-data-type-text-box": "npx mcp-server-tester@1.4.0 evals tests/e2e/create-data-type/create-data-type-text-box.yaml --server-config tests/e2e/create-data-type/create-data-type-config.json",
|
|
7413
|
+
"eval-mcp:create-data-type-block-list": "npx mcp-server-tester@1.4.0 evals tests/e2e/create-data-type/create-data-type-block-list.yaml --server-config tests/e2e/create-data-type/create-data-type-config.json --debug",
|
|
7414
|
+
"eval-mcp:create-document-type": "npx mcp-server-tester@1.4.0 evals tests/e2e/create-document-type/create-document-type.yaml --server-config tests/e2e/create-document-type/create-document-type-config.json",
|
|
7415
|
+
"eval-mcp:create-document-copy": "npx mcp-server-tester@1.4.0 evals tests/e2e/create-document-copy/create-document-copy.yaml --server-config tests/e2e/create-document-copy/create-document-copy-config.json",
|
|
7416
|
+
"eval-mcp:create-document-with-template": "npx mcp-server-tester@1.4.0 evals tests/e2e/create-document-with-template/create-document-with-template.yaml --server-config tests/e2e/create-document-with-template/create-document-with-template-config.json",
|
|
7417
|
+
"eval-mcp:all": "npm run eval-mcp:basic && npm run eval-mcp:create-data-type && npm run eval-mcp:create-document-type && npm run eval-mcp:create-blog-post"
|
|
7418
|
+
},
|
|
7419
|
+
engines: {
|
|
7420
|
+
node: ">=22.0.0"
|
|
7421
|
+
},
|
|
7422
|
+
files: [
|
|
7423
|
+
"dist"
|
|
7424
|
+
],
|
|
7425
|
+
repository: {
|
|
7426
|
+
type: "git",
|
|
7427
|
+
url: "git+https://github.com/umbraco/Umbraco-CMS-MCP-Dev"
|
|
7428
|
+
},
|
|
7429
|
+
keywords: [
|
|
7430
|
+
"Umbraco",
|
|
7431
|
+
"MCP",
|
|
7432
|
+
"Model Context Protocol",
|
|
7433
|
+
"CMS",
|
|
7434
|
+
"MCP-Server",
|
|
7435
|
+
"AI"
|
|
7436
|
+
],
|
|
7437
|
+
author: "",
|
|
7438
|
+
license: "MIT",
|
|
7439
|
+
bugs: {
|
|
7440
|
+
url: "https://github.com/umbraco/Umbraco-CMS-MCP-Dev/issues"
|
|
7441
|
+
},
|
|
7442
|
+
homepage: "https://github.com/umbraco/Umbraco-CMS-MCP-Dev#readme",
|
|
7443
|
+
dependencies: {
|
|
7444
|
+
"@modelcontextprotocol/sdk": "^1.9.0",
|
|
7445
|
+
"@types/uuid": "^10.0.0",
|
|
7446
|
+
"@types/yargs": "^17.0.33",
|
|
7447
|
+
axios: "^1.8.4",
|
|
7448
|
+
dotenv: "^16.5.0",
|
|
7449
|
+
"form-data": "^4.0.4",
|
|
7450
|
+
"mime-types": "^3.0.1",
|
|
7451
|
+
qs: "^6.14.0",
|
|
7452
|
+
uuid: "^11.1.0",
|
|
7453
|
+
yargs: "^18.0.0",
|
|
7454
|
+
zod: "^3.24.3"
|
|
7455
|
+
},
|
|
7456
|
+
devDependencies: {
|
|
7457
|
+
"@types/dotenv": "^6.1.1",
|
|
7458
|
+
"@types/jest": "^29.5.14",
|
|
7459
|
+
"@types/mime-types": "^3.0.1",
|
|
7460
|
+
"@types/node": "^22.14.1",
|
|
7461
|
+
"@types/qs": "^6.9.18",
|
|
7462
|
+
copyfiles: "^2.4.1",
|
|
7463
|
+
glob: "^11.0.2",
|
|
7464
|
+
jest: "^29.7.0",
|
|
7465
|
+
"jest-extended": "^4.0.2",
|
|
7466
|
+
orval: "^7.8.0",
|
|
7467
|
+
rimraf: "^6.0.1",
|
|
7468
|
+
"ts-jest": "^29.3.2",
|
|
7469
|
+
"ts-node": "^10.9.2",
|
|
7470
|
+
tsup: "^8.4.0",
|
|
7471
|
+
typescript: "^5.8.3"
|
|
7472
|
+
}
|
|
7473
|
+
};
|
|
7474
|
+
|
|
7475
|
+
// src/helpers/version-check/check-umbraco-version.ts
|
|
7476
|
+
var versionCheckMessage = null;
|
|
7477
|
+
var isBlocked = false;
|
|
7478
|
+
async function checkUmbracoVersion(client) {
|
|
7479
|
+
try {
|
|
7480
|
+
const serverInfo = await client.getServerInformation();
|
|
7481
|
+
const umbracoVersion = serverInfo.version;
|
|
7482
|
+
const mcpVersion = package_default.version;
|
|
7483
|
+
const mcpMajor = mcpVersion.split(".")[0];
|
|
7484
|
+
const umbracoMajor = umbracoVersion.split(".")[0];
|
|
7485
|
+
if (umbracoMajor === mcpMajor) {
|
|
7486
|
+
versionCheckMessage = null;
|
|
7487
|
+
isBlocked = false;
|
|
7488
|
+
} else {
|
|
7489
|
+
versionCheckMessage = `\u26A0\uFE0F Version Mismatch: Connected to Umbraco ${umbracoMajor}.x, but MCP server (${mcpVersion}) expects Umbraco ${mcpMajor}.x
|
|
7490
|
+
This may cause compatibility issues with the Management API.`;
|
|
7491
|
+
isBlocked = true;
|
|
7492
|
+
}
|
|
7493
|
+
} catch (error) {
|
|
7494
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
7495
|
+
versionCheckMessage = `\u26A0\uFE0F Unable to verify Umbraco version compatibility: ${errorMessage}`;
|
|
7496
|
+
isBlocked = false;
|
|
7497
|
+
}
|
|
7498
|
+
}
|
|
7499
|
+
function getVersionCheckMessage() {
|
|
7500
|
+
return versionCheckMessage;
|
|
7501
|
+
}
|
|
7502
|
+
function clearVersionCheckMessage() {
|
|
7503
|
+
versionCheckMessage = null;
|
|
7504
|
+
isBlocked = false;
|
|
7505
|
+
}
|
|
7506
|
+
function isToolExecutionBlocked() {
|
|
7507
|
+
return isBlocked;
|
|
7508
|
+
}
|
|
7509
|
+
|
|
7388
7510
|
// src/helpers/mcp/create-umbraco-tool.ts
|
|
7389
7511
|
var CreateUmbracoTool = (name, description, schema, handler, enabled) => () => ({
|
|
7390
7512
|
name,
|
|
@@ -7392,27 +7514,32 @@ var CreateUmbracoTool = (name, description, schema, handler, enabled) => () => (
|
|
|
7392
7514
|
enabled,
|
|
7393
7515
|
schema,
|
|
7394
7516
|
handler: async (args, context) => {
|
|
7517
|
+
if (isToolExecutionBlocked()) {
|
|
7518
|
+
const versionMessage = getVersionCheckMessage();
|
|
7519
|
+
clearVersionCheckMessage();
|
|
7520
|
+
return {
|
|
7521
|
+
content: [{
|
|
7522
|
+
type: "text",
|
|
7523
|
+
text: `${versionMessage}
|
|
7524
|
+
|
|
7525
|
+
\u26A0\uFE0F Tool execution paused due to version incompatibility.
|
|
7526
|
+
|
|
7527
|
+
If you understand the risks and want to proceed anyway, please retry your request.`
|
|
7528
|
+
}],
|
|
7529
|
+
isError: true
|
|
7530
|
+
};
|
|
7531
|
+
}
|
|
7395
7532
|
try {
|
|
7396
7533
|
return await handler(args, context);
|
|
7397
7534
|
} catch (error) {
|
|
7398
7535
|
console.error(`Error in tool ${name}:`, error);
|
|
7399
|
-
const errorDetails = error instanceof Error ? {
|
|
7400
|
-
message: error.message,
|
|
7401
|
-
cause: error.cause,
|
|
7402
|
-
response: _optionalChain([error, 'access', _47 => _47.response, 'optionalAccess', _48 => _48.data])
|
|
7403
|
-
} : error;
|
|
7536
|
+
const errorDetails = error instanceof Error ? { message: error.message, cause: error.cause, response: _optionalChain([error, 'access', _48 => _48.response, 'optionalAccess', _49 => _49.data]) } : error;
|
|
7404
7537
|
return {
|
|
7405
|
-
content: [
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
errorDetails,
|
|
7411
|
-
null,
|
|
7412
|
-
2
|
|
7413
|
-
)}`
|
|
7414
|
-
}
|
|
7415
|
-
]
|
|
7538
|
+
content: [{
|
|
7539
|
+
type: "text",
|
|
7540
|
+
text: `Error using ${name}:
|
|
7541
|
+
${JSON.stringify(errorDetails, null, 2)}`
|
|
7542
|
+
}]
|
|
7416
7543
|
};
|
|
7417
7544
|
}
|
|
7418
7545
|
}
|
|
@@ -13375,6 +13502,19 @@ var CultureCollection = {
|
|
|
13375
13502
|
};
|
|
13376
13503
|
|
|
13377
13504
|
// src/umb-management-api/tools/data-type/post/create-data-type.ts
|
|
13505
|
+
|
|
13506
|
+
var _uuid = require('uuid');
|
|
13507
|
+
var createDataTypeSchema = _zod.z.object({
|
|
13508
|
+
name: _zod.z.string().min(1),
|
|
13509
|
+
editorAlias: _zod.z.string().min(1),
|
|
13510
|
+
editorUiAlias: _zod.z.string(),
|
|
13511
|
+
values: _zod.z.array(_zod.z.object({
|
|
13512
|
+
alias: _zod.z.string(),
|
|
13513
|
+
value: _zod.z.any().nullish()
|
|
13514
|
+
})),
|
|
13515
|
+
parentId: _zod.z.string().uuid().optional()
|
|
13516
|
+
// Flattened parent ID
|
|
13517
|
+
});
|
|
13378
13518
|
var CreateDataTypeTool = CreateUmbracoTool(
|
|
13379
13519
|
"create-data-type",
|
|
13380
13520
|
`Creates a new data type
|
|
@@ -13386,177 +13526,64 @@ var CreateDataTypeTool = CreateUmbracoTool(
|
|
|
13386
13526
|
3. Only proceed with creating a new data type if no suitable option exists
|
|
13387
13527
|
4. If a similar data type exists, inform the user and suggest using this one instead.
|
|
13388
13528
|
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
Always create new element types in the root, if you need to create a new element type in a specific folder then move the element type to the correct folder after it has been created.
|
|
13392
|
-
|
|
13393
|
-
Below is the list of property editor available by default in Umbraco. Each property editor is followed by an example.
|
|
13394
|
-
IMPORTANT: Amend these examples to match the requirements of the data type you are creating. DO NOT STRAY FROM THE EXAMPLES BUT USE THEM AS TEMPLATES.
|
|
13395
|
-
Some property editors have optional parameter, it in doubt, leave it out.
|
|
13396
|
-
|
|
13397
|
-
*** Common Property Editors ***
|
|
13398
|
-
|
|
13399
|
-
Decimal
|
|
13400
|
-
{"id":"8480eacc-894f-4fbf-8f28-ec001a115c3f","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Decimal","editorUiAlias":"Umb.PropertyEditorUi.Decimal","values":[{"alias":"step","value":"0.01"},{"alias":"min","value":3},{"alias":"max","value":10},{"alias":"placeholder","value":"Item"}]}
|
|
13401
|
-
|
|
13402
|
-
Email | Umb.PropertyEditorUi.EmailAddress, | Umbraco.EmailAddress
|
|
13403
|
-
{"id":"38e3fdb3-2cc2-433e-9064-58edffc5456c","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.EmailAddress","editorUiAlias":"Umb.PropertyEditorUi.EmailAddress","values":[{"alias":"inputType","value":"email"}]}
|
|
13404
|
-
|
|
13405
|
-
Label | Umb.PropertyEditorUi.Label, | Umbraco.Label
|
|
13406
|
-
{"id":"05c199b8-d134-4890-803f-053476633686","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Label","editorUiAlias":"Umb.PropertyEditorUi.Label","values":[{"alias":"umbracoDataValueType","value":"DECIMAL"}]}
|
|
13407
|
-
label options : STRING, DECIMAL, DATETIME, TIME, INTEGER, BIGINT, TEXT
|
|
13408
|
-
|
|
13409
|
-
Numeric
|
|
13410
|
-
{"id":"05c199b8-d134-4890-803f-053476633686","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Label","editorUiAlias":"Umb.PropertyEditorUi.Label","values":[{"alias":"umbracoDataValueType","value":"DECIMAL"}]}
|
|
13411
|
-
|
|
13412
|
-
Slider
|
|
13413
|
-
{"id":"4a949427-2814-42c3-86eb-c874cf5100d6","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Slider","editorUiAlias":"Umb.PropertyEditorUi.Slider","values":[{"alias":"minVal","value":0},{"alias":"maxVal","value":100},{"alias":"initVal1","value":0},{"alias":"initVal2","value":0},{"alias":"step","value":1}]}
|
|
13414
|
-
|
|
13415
|
-
Tags
|
|
13416
|
-
{"id":"87a371cc-9da9-4771-ae58-6895a37b4560","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Tags","editorUiAlias":"Umb.PropertyEditorUi.Tags","values":[{"alias":"group","value":"default"},{"alias":"storageType","value":"Json"}]}
|
|
13417
|
-
Storage options : Json, CSV
|
|
13418
|
-
|
|
13419
|
-
Textarea
|
|
13420
|
-
{"id":"5ee0462b-d8d9-45fd-a742-bb0cd4536d78","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.TextArea","editorUiAlias":"Umb.PropertyEditorUi.TextArea","values":[{"alias":"rows","value":10},{"alias":"maxChars","value":100},{"alias":"minHeight","value":200},{"alias":"maxHeight","value":100}]}
|
|
13421
|
-
|
|
13422
|
-
Textbox
|
|
13423
|
-
{"id":"21732e7d-14b9-4413-bf39-86e73beb96c9","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.TextBox","editorUiAlias":"Umb.PropertyEditorUi.TextBox","values":[{"alias":"maxChars","value":512},{"alias":"inputType","value":"text"}]}
|
|
13424
|
-
|
|
13425
|
-
Toggle
|
|
13426
|
-
{"id":"b5889bfd-2f39-4214-bc4c-31de062cca73","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.TrueFalse","editorUiAlias":"Umb.PropertyEditorUi.Toggle","values":[{"alias":"default","value":true},{"alias":"showLabels","value":true},{"alias":"labelOn","value":"On"},{"alias":"labelOff","value":"Off"},{"alias":"ariaLabel","value":"Reader"}]}
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
*** Lists Property Editors ***
|
|
13430
|
-
|
|
13431
|
-
BlockList
|
|
13432
|
-
|
|
13433
|
-
IMPORTANT - when creating new block list data types always create the reuired element types first before creating the data type
|
|
13434
|
-
|
|
13435
|
-
{"id":"aff61371-d3d3-4dde-9c85-7c01ff330ede","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.BlockList","editorUiAlias":"Umb.PropertyEditorUi.BlockList","values":[{"alias":"blocks","value":[{"contentElementTypeKey":"c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90","settingsElementTypeKey":"2e1a4fd4-b695-4033-8626-1a45b54e04cb","backgroundColor":"#c05454","iconColor":"#00ff6f"}]},{"alias":"validationLimit","value":{"max":3}},{"alias":"useLiveEditing","value":true},{"alias":"useInlineEditingAsDefault","value":true},{"alias":"maxPropertyWidth","value":"100px"}]}
|
|
13436
|
-
|
|
13437
|
-
CheckBoxList
|
|
13438
|
-
{"id":"aff61371-d3d3-4dde-9c85-7c01ff330ede","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.BlockList","editorUiAlias":"Umb.PropertyEditorUi.BlockList","values":[{"alias":"blocks","value":[{"contentElementTypeKey":"c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90","settingsElementTypeKey":"2e1a4fd4-b695-4033-8626-1a45b54e04cb","backgroundColor":"#c05454","iconColor":"#00ff6f"}]},{"alias":"validationLimit","value":{"max":3}},{"alias":"useLiveEditing","value":true},{"alias":"useInlineEditingAsDefault","value":true},{"alias":"maxPropertyWidth","value":"100px"}]}
|
|
13439
|
-
|
|
13440
|
-
Collection
|
|
13441
|
-
{"id":"aff61371-d3d3-4dde-9c85-7c01ff330ede","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.BlockList","editorUiAlias":"Umb.PropertyEditorUi.BlockList","values":[{"alias":"blocks","value":[{"contentElementTypeKey":"c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90","settingsElementTypeKey":"2e1a4fd4-b695-4033-8626-1a45b54e04cb","backgroundColor":"#c05454","iconColor":"#00ff6f"}]},{"alias":"validationLimit","value":{"max":3}},{"alias":"useLiveEditing","value":true},{"alias":"useInlineEditingAsDefault","value":true},{"alias":"maxPropertyWidth","value":"100px"}]}
|
|
13442
|
-
|
|
13443
|
-
Dropdown
|
|
13444
|
-
{"id":"0aa7b755-d24a-44fd-917a-1d6a7fa07c1e","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.DropDown.Flexible","editorUiAlias":"Umb.PropertyEditorUi.Dropdown","values":[{"alias":"items","value":["Item 1","Item 2"]},{"alias":"multiple","value":true}]}
|
|
13445
|
-
|
|
13446
|
-
MultipleTestString
|
|
13447
|
-
{"id":"aaa23533-275e-4ba2-9a06-fc2bf0ea053a","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MultipleTextstring","editorUiAlias":"Umb.PropertyEditorUi.MultipleTextString","values":[{"alias":"min","value":3},{"alias":"max","value":10}]}
|
|
13448
|
-
|
|
13449
|
-
RadioButtonList
|
|
13450
|
-
{"id":"99f20003-8b65-4db9-ac0b-932c2fd5abaa","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.RadioButtonList","editorUiAlias":"Umb.PropertyEditorUi.RadioButtonList","values":[{"alias":"items","value":["Item 1","Item 2"]}]}
|
|
13451
|
-
|
|
13452
|
-
|
|
13453
|
-
*** Media Property Editors ***
|
|
13454
|
-
|
|
13455
|
-
ImageCropper
|
|
13456
|
-
Doesn't work
|
|
13529
|
+
*** PROPERTY EDITOR CONFIGURATION ***
|
|
13530
|
+
When creating a new data type you will need to assign a property editor with the correct configuration.
|
|
13457
13531
|
|
|
13458
|
-
|
|
13459
|
-
|
|
13532
|
+
IMPORTANT: Use the get-data-type-property-editor-template tool to:
|
|
13533
|
+
- View all available property editors (call without parameters)
|
|
13534
|
+
- Get the correct configuration template for a specific property editor (call with editorName parameter)
|
|
13535
|
+
- Each template shows the required editorAlias, editorUiAlias, and values configuration
|
|
13536
|
+
- Customize the template values to match your specific requirements
|
|
13460
13537
|
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
*** Peeople Property Editors ***
|
|
13465
|
-
|
|
13466
|
-
MemberGroupPicker
|
|
13467
|
-
{"id":"44802c76-ef67-4bf9-90dd-1e2d431a29d9","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MemberGroupPicker","editorUiAlias":"Umb.PropertyEditorUi.MemberGroupPicker","values":[]}
|
|
13468
|
-
|
|
13469
|
-
MemberPicker
|
|
13470
|
-
{"id":"79f86b6f-f01a-4ba2-8e6d-a7204f8e04b3","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MemberPicker","editorUiAlias":"Umb.PropertyEditorUi.MemberPicker","values":[]}
|
|
13471
|
-
|
|
13472
|
-
UserPicker
|
|
13473
|
-
{"id":"c6f83e2d-3863-4577-9cd6-544e6906bfaa","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.UserPicker","editorUiAlias":"Umb.PropertyEditorUi.UserPicker","values":[]}
|
|
13474
|
-
|
|
13475
|
-
*** Picker Property Editors ***
|
|
13476
|
-
|
|
13477
|
-
ColorPicker
|
|
13478
|
-
{"id":"93f22ab5-1cf3-4b4f-b1b1-98d60205929f","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.ColorPicker","editorUiAlias":"Umb.PropertyEditorUi.ColorPicker","values":[{"alias":"useLabel","value":true},{"alias":"items","value":[{"value":"F00","label":"Red"}]}]}
|
|
13479
|
-
|
|
13480
|
-
* ContentPicker | Umb.PropertyEditorUi.ContentPicker | Umbraco.ContentPicker
|
|
13481
|
-
{"id":"4bc0e04c-cde8-4f92-a85b-f83a5860a1e8","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MultiNodeTreePicker","editorUiAlias":"Umb.PropertyEditorUi.ContentPicker","values":[{"alias":"minNumber","value":0},{"alias":"maxNumber","value":0},{"alias":"ignoreUserStartNodes","value":true},{"alias":"startNode","value":{"type":"content","dynamicRoot":{"originAlias":"Current"}}},{"alias":"filter","value":"0fde8472-7c10-4e8a-bd4a-fffc0306d0aa"},{"alias":"showOpenButton","value":true}]}
|
|
13482
|
-
|
|
13483
|
-
DatePicker
|
|
13484
|
-
{"id":"d022160d-9703-42f7-9e0d-3611bb26222e","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.DateTime","editorUiAlias":"Umb.PropertyEditorUi.DatePicker","values":[{"alias":"format","value":"YYYY-MM-DD HH:mm:ss"}]}
|
|
13485
|
-
|
|
13486
|
-
DocumentPicker
|
|
13487
|
-
{"id":"ed366ea4-ed19-4d7a-bf76-66b4e225cd7f","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.ContentPicker","editorUiAlias":"Umb.PropertyEditorUi.DocumentPicker","values":[{"alias":"ignoreUserStartNodes","value":true},{"alias":"startNodeId","value":"dcf18a51-6919-4cf8-89d1-36b94ce4d963"},{"alias":"showOpenButton","value":true}]}
|
|
13488
|
-
|
|
13489
|
-
EyeDropper | Umb.PropertyEditorUi.EyeDropper | Umbraco.ColorPicker.EyeDropper
|
|
13490
|
-
{"id":"871938c0-a549-4da4-84ff-589d0237575b","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.ColorPicker.EyeDropper","editorUiAlias":"Umb.PropertyEditorUi.EyeDropper","values":[{"alias":"showAlpha","value":true},{"alias":"showPalette","value":true}]}
|
|
13491
|
-
|
|
13492
|
-
MultiUrlPicker | Umb.PropertyEditorUi.MultiUrlPicker | Umbraco.MultiUrlPicker
|
|
13493
|
-
{"id":"a9887fb3-d2af-40eb-a566-c0907ac7bba3","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MultiUrlPicker","editorUiAlias":"Umb.PropertyEditorUi.MultiUrlPicker","values":[{"alias":"minNumber","value":1},{"alias":"maxNumber","value":3},{"alias":"ignoreUserStartNodes","value":true},{"alias":"hideAnchor","value":false}]}
|
|
13494
|
-
|
|
13495
|
-
*** Rich Text Property Editors ***
|
|
13496
|
-
|
|
13497
|
-
BlockGrid
|
|
13498
|
-
|
|
13499
|
-
IMPORTANT - when creating new block grid data types always create the reuired element types first before creating the data type
|
|
13500
|
-
|
|
13501
|
-
{"id":"cfdd79d9-6f18-4b2b-a502-c67b0fb3929c","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.BlockGrid","editorUiAlias":"Umb.PropertyEditorUi.BlockGrid","values":[{"alias":"gridColumns","value":12},{"alias":"blocks","value":[{"contentElementTypeKey":"c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90","allowAtRoot":true,"allowInAreas":true,"settingsElementTypeKey":"93638715-f76c-4a11-86b1-6a9d66504901","columnSpanOptions":[{"columnSpan":12}],"rowMinSpan":0,"rowMaxSpan":3}]}]}
|
|
13502
|
-
|
|
13503
|
-
CodeEditor | Umb.PropertyEditorUi.CodeEditor | Umbraco.Plain.String
|
|
13504
|
-
{"id":"f845a669-c92d-4af7-9f3c-3a9717925e36","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.Plain.String","editorUiAlias":"Umb.PropertyEditorUi.CodeEditor","values":[{"alias":"language","value":"javascript"},{"alias":"height","value":400},{"alias":"lineNumbers","value":true},{"alias":"minimap","value":true},{"alias":"wordWrap","value":false}]}
|
|
13505
|
-
|
|
13506
|
-
MarkdownEditor
|
|
13507
|
-
{"id":"18594f1e-75b7-4e04-9abf-20805556f02c","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.MarkdownEditor","editorUiAlias":"Umb.PropertyEditorUi.MarkdownEditor","values":[{"alias":"preview","value":true},{"alias":"defaultValue","value":"Default value"},{"alias":"overlaySize","value":"small"}]}
|
|
13508
|
-
|
|
13509
|
-
RichTextEditor
|
|
13510
|
-
{"id":"29d6b5cf-80ec-4271-bdc0-d18494555b44","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.RichText","editorUiAlias":"Umb.PropertyEditorUi.TinyMCE","values":[{"alias":"toolbar","value":["styles","bold","italic","alignleft","aligncenter","alignright","bullist","numlist","outdent","indent","sourcecode","link","umbmediapicker","umbembeddialog"]},{"alias":"mode","value":"Classic"},{"alias":"maxImageSize","value":500},{"alias":"blocks","value":[{"contentElementTypeKey":"c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90","settingsElementTypeKey":"93638715-f76c-4a11-86b1-6a9d66504901","label":"Appearance","displayInline":true,"editorSize":"small","backgroundColor":"#000000","iconColor":"#000000"}]},{"alias":"mediaParentId"},{"alias":"ignoreUserStartNodes","value":true}]}
|
|
13511
|
-
|
|
13512
|
-
RichTextEditor
|
|
13513
|
-
{"id":"45a57ebf-5a20-4148-b247-cb8718059df6","parent":{"id":"6e92aaa2-89b0-48f5-9e68-abff56010e8a"},"name":"Example","editorAlias":"Umbraco.RichText","editorUiAlias":"Umb.PropertyEditorUi.Tiptap","values":[{"alias":"toolbar","value":[[["Umb.Tiptap.Toolbar.SourceEditor"],["Umb.Tiptap.Toolbar.Bold","Umb.Tiptap.Toolbar.Italic","Umb.Tiptap.Toolbar.Underline"],["Umb.Tiptap.Toolbar.TextAlignLeft","Umb.Tiptap.Toolbar.TextAlignCenter","Umb.Tiptap.Toolbar.TextAlignRight"],["Umb.Tiptap.Toolbar.BulletList","Umb.Tiptap.Toolbar.OrderedList"],["Umb.Tiptap.Toolbar.Blockquote","Umb.Tiptap.Toolbar.HorizontalRule"],["Umb.Tiptap.Toolbar.Link","Umb.Tiptap.Toolbar.Unlink"],["Umb.Tiptap.Toolbar.MediaPicker","Umb.Tiptap.Toolbar.EmbeddedMedia"]]]},{"alias":"maxImageSize","value":500},{"alias":"overlaySize","value":"medium"},{"alias":"extensions","value":["Umb.Tiptap.Embed","Umb.Tiptap.Figure","Umb.Tiptap.Image","Umb.Tiptap.Link","Umb.Tiptap.MediaUpload","Umb.Tiptap.RichTextEssentials","Umb.Tiptap.Subscript","Umb.Tiptap.Superscript","Umb.Tiptap.Table","Umb.Tiptap.TextAlign","Umb.Tiptap.TextDirection","Umb.Tiptap.Underline"]}]}
|
|
13514
|
-
|
|
13515
|
-
if you are not asked for a property editor then stop and ask the user to provide one.
|
|
13516
|
-
|
|
13517
|
-
if you are asked to create a data type for a property that already exists, then stop and ask the user to provide a unique name.
|
|
13518
|
-
|
|
13519
|
-
Each property editor is configurable. That configuration is different for each property editor. The configuration options can be found in the Umbraco Sourcecode.
|
|
13520
|
-
|
|
13521
|
-
IMPRTANT : Always use the correct configration for the specific property editor. Do not make assumptions.
|
|
13522
|
-
|
|
13523
|
-
The Umbraco Sourcecode can be found at https://github.com/umbraco/Umbraco-CMS
|
|
13524
|
-
|
|
13525
|
-
The property editors are located in the Umbraco.Core.PropertyEditors namespace.
|
|
13526
|
-
|
|
13527
|
-
|
|
13528
|
-
Here is an example of a dropdown property editor configuration:
|
|
13529
|
-
|
|
13530
|
-
{
|
|
13531
|
-
"id": "b90cccaf-549d-4419-8543-d50aecae0819",
|
|
13532
|
-
"parent": null,
|
|
13533
|
-
"name": "Test",
|
|
13534
|
-
"editorAlias": "Umbraco.DropDown.Flexible", // These MUST match one of the property editors listed above.
|
|
13535
|
-
"editorUiAlias": "Umb.PropertyEditorUi.Dropdown", // These MUST match one of the property editors listed above.
|
|
13536
|
-
"values": [
|
|
13537
|
-
{
|
|
13538
|
-
"alias": "items",
|
|
13539
|
-
"value": [
|
|
13540
|
-
"test",
|
|
13541
|
-
"test 2"
|
|
13542
|
-
]
|
|
13543
|
-
}
|
|
13544
|
-
]
|
|
13545
|
-
}
|
|
13538
|
+
*** VALIDATION ***
|
|
13539
|
+
If you are not asked for a property editor then stop and ask the user to provide one.
|
|
13540
|
+
If you are asked to create a data type for a property that already exists, then stop and ask the user to provide a unique name.
|
|
13546
13541
|
|
|
13547
13542
|
`,
|
|
13548
|
-
|
|
13543
|
+
createDataTypeSchema.shape,
|
|
13549
13544
|
async (model) => {
|
|
13550
13545
|
const client = UmbracoManagementClient2.getClient();
|
|
13551
|
-
|
|
13552
|
-
|
|
13553
|
-
|
|
13554
|
-
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13546
|
+
const dataTypeId = _uuid.v4.call(void 0, );
|
|
13547
|
+
const payload = {
|
|
13548
|
+
name: model.name,
|
|
13549
|
+
editorAlias: model.editorAlias,
|
|
13550
|
+
editorUiAlias: model.editorUiAlias,
|
|
13551
|
+
values: model.values,
|
|
13552
|
+
id: dataTypeId,
|
|
13553
|
+
parent: model.parentId ? { id: model.parentId } : void 0
|
|
13559
13554
|
};
|
|
13555
|
+
const response = await client.postDataType(payload, {
|
|
13556
|
+
returnFullResponse: true,
|
|
13557
|
+
validateStatus: () => true
|
|
13558
|
+
});
|
|
13559
|
+
if (response.status === 201) {
|
|
13560
|
+
return {
|
|
13561
|
+
content: [
|
|
13562
|
+
{
|
|
13563
|
+
type: "text",
|
|
13564
|
+
text: JSON.stringify({
|
|
13565
|
+
message: "Data type created successfully",
|
|
13566
|
+
id: dataTypeId
|
|
13567
|
+
})
|
|
13568
|
+
}
|
|
13569
|
+
]
|
|
13570
|
+
};
|
|
13571
|
+
} else {
|
|
13572
|
+
const errorData = response.data;
|
|
13573
|
+
return {
|
|
13574
|
+
content: [
|
|
13575
|
+
{
|
|
13576
|
+
type: "text",
|
|
13577
|
+
text: JSON.stringify({
|
|
13578
|
+
message: "Failed to create data type",
|
|
13579
|
+
status: response.status,
|
|
13580
|
+
error: errorData || response.statusText
|
|
13581
|
+
})
|
|
13582
|
+
}
|
|
13583
|
+
],
|
|
13584
|
+
isError: true
|
|
13585
|
+
};
|
|
13586
|
+
}
|
|
13560
13587
|
}
|
|
13561
13588
|
);
|
|
13562
13589
|
var create_data_type_default = CreateDataTypeTool;
|
|
@@ -13641,121 +13668,922 @@ var GetDataTypeConfigurationTool = CreateUmbracoTool(
|
|
|
13641
13668
|
);
|
|
13642
13669
|
var get_data_type_configuration_default = GetDataTypeConfigurationTool;
|
|
13643
13670
|
|
|
13644
|
-
// src/umb-management-api/tools/data-type/
|
|
13645
|
-
|
|
13646
|
-
var UpdateDataTypeTool = CreateUmbracoTool(
|
|
13647
|
-
"update-data-type",
|
|
13648
|
-
"Updates a data type by Id",
|
|
13649
|
-
{
|
|
13650
|
-
id: putDataTypeByIdParams.shape.id,
|
|
13651
|
-
data: _zod.z.object(putDataTypeByIdBody.shape)
|
|
13652
|
-
},
|
|
13653
|
-
async (model) => {
|
|
13654
|
-
const client = UmbracoManagementClient2.getClient();
|
|
13655
|
-
var response = await client.putDataTypeById(model.id, model.data);
|
|
13656
|
-
return {
|
|
13657
|
-
content: [
|
|
13658
|
-
{
|
|
13659
|
-
type: "text",
|
|
13660
|
-
text: JSON.stringify(response)
|
|
13661
|
-
}
|
|
13662
|
-
]
|
|
13663
|
-
};
|
|
13664
|
-
}
|
|
13665
|
-
);
|
|
13666
|
-
var update_data_type_default = UpdateDataTypeTool;
|
|
13671
|
+
// src/umb-management-api/tools/data-type/get/get-data-type-property-editor-template.ts
|
|
13667
13672
|
|
|
13668
|
-
// src/umb-management-api/tools/data-type/post/copy-data-type.ts
|
|
13669
13673
|
|
|
13670
|
-
|
|
13671
|
-
|
|
13672
|
-
"
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13674
|
+
// src/umb-management-api/tools/data-type/post/property-editor-templates.ts
|
|
13675
|
+
var propertyEditorTemplates = {
|
|
13676
|
+
"Decimal": {
|
|
13677
|
+
"editorAlias": "Umbraco.Decimal",
|
|
13678
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Decimal",
|
|
13679
|
+
"values": [
|
|
13680
|
+
{
|
|
13681
|
+
"alias": "step",
|
|
13682
|
+
"value": "0.01"
|
|
13683
|
+
},
|
|
13684
|
+
{
|
|
13685
|
+
"alias": "min",
|
|
13686
|
+
"value": 3
|
|
13687
|
+
},
|
|
13688
|
+
{
|
|
13689
|
+
"alias": "max",
|
|
13690
|
+
"value": 10
|
|
13691
|
+
},
|
|
13692
|
+
{
|
|
13693
|
+
"alias": "placeholder",
|
|
13694
|
+
"value": "Item"
|
|
13695
|
+
}
|
|
13696
|
+
]
|
|
13676
13697
|
},
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
|
|
13680
|
-
|
|
13681
|
-
|
|
13682
|
-
|
|
13683
|
-
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
]
|
|
13687
|
-
};
|
|
13688
|
-
}
|
|
13689
|
-
);
|
|
13690
|
-
var copy_data_type_default = CopyDataTypeTool;
|
|
13691
|
-
|
|
13692
|
-
// src/umb-management-api/tools/data-type/get/is-used-data-type.ts
|
|
13693
|
-
var IsUsedDataTypeTool = CreateUmbracoTool(
|
|
13694
|
-
"is-used-data-type",
|
|
13695
|
-
"Checks if a data type is used within Umbraco",
|
|
13696
|
-
getDataTypeByIdIsUsedParams.shape,
|
|
13697
|
-
async ({ id }) => {
|
|
13698
|
-
const client = UmbracoManagementClient2.getClient();
|
|
13699
|
-
var response = await client.getDataTypeByIdIsUsed(id);
|
|
13700
|
-
return {
|
|
13701
|
-
content: [
|
|
13702
|
-
{
|
|
13703
|
-
type: "text",
|
|
13704
|
-
text: JSON.stringify(response)
|
|
13705
|
-
}
|
|
13706
|
-
]
|
|
13707
|
-
};
|
|
13708
|
-
}
|
|
13709
|
-
);
|
|
13710
|
-
var is_used_data_type_default = IsUsedDataTypeTool;
|
|
13711
|
-
|
|
13712
|
-
// src/umb-management-api/tools/data-type/put/move-data-type.ts
|
|
13713
|
-
|
|
13714
|
-
var MoveDataTypeTool = CreateUmbracoTool(
|
|
13715
|
-
"move-data-type",
|
|
13716
|
-
"Move a data type by Id",
|
|
13717
|
-
{
|
|
13718
|
-
id: putDataTypeByIdMoveParams.shape.id,
|
|
13719
|
-
body: _zod.z.object(putDataTypeByIdMoveBody.shape)
|
|
13698
|
+
"Email": {
|
|
13699
|
+
"editorAlias": "Umbraco.EmailAddress",
|
|
13700
|
+
"editorUiAlias": "Umb.PropertyEditorUi.EmailAddress",
|
|
13701
|
+
"values": [
|
|
13702
|
+
{
|
|
13703
|
+
"alias": "inputType",
|
|
13704
|
+
"value": "email"
|
|
13705
|
+
}
|
|
13706
|
+
]
|
|
13720
13707
|
},
|
|
13721
|
-
|
|
13722
|
-
|
|
13723
|
-
|
|
13724
|
-
|
|
13725
|
-
|
|
13726
|
-
|
|
13727
|
-
|
|
13728
|
-
|
|
13729
|
-
|
|
13730
|
-
|
|
13731
|
-
|
|
13732
|
-
|
|
13733
|
-
|
|
13734
|
-
|
|
13735
|
-
|
|
13736
|
-
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
|
|
13740
|
-
|
|
13741
|
-
|
|
13742
|
-
|
|
13743
|
-
|
|
13744
|
-
|
|
13745
|
-
|
|
13746
|
-
|
|
13747
|
-
|
|
13748
|
-
|
|
13749
|
-
|
|
13750
|
-
|
|
13751
|
-
|
|
13752
|
-
|
|
13753
|
-
|
|
13754
|
-
|
|
13755
|
-
|
|
13756
|
-
|
|
13757
|
-
|
|
13758
|
-
|
|
13708
|
+
"Label": {
|
|
13709
|
+
"editorAlias": "Umbraco.Label",
|
|
13710
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Label",
|
|
13711
|
+
"values": [
|
|
13712
|
+
{
|
|
13713
|
+
"alias": "umbracoDataValueType",
|
|
13714
|
+
"value": "DECIMAL"
|
|
13715
|
+
}
|
|
13716
|
+
],
|
|
13717
|
+
"_notes": "Label options: STRING, DECIMAL, DATETIME, TIME, INTEGER, BIGINT, TEXT"
|
|
13718
|
+
},
|
|
13719
|
+
"Numeric": {
|
|
13720
|
+
"editorAlias": "Umbraco.Label",
|
|
13721
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Label",
|
|
13722
|
+
"values": [
|
|
13723
|
+
{
|
|
13724
|
+
"alias": "umbracoDataValueType",
|
|
13725
|
+
"value": "DECIMAL"
|
|
13726
|
+
}
|
|
13727
|
+
]
|
|
13728
|
+
},
|
|
13729
|
+
"Slider": {
|
|
13730
|
+
"editorAlias": "Umbraco.Slider",
|
|
13731
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Slider",
|
|
13732
|
+
"values": [
|
|
13733
|
+
{
|
|
13734
|
+
"alias": "minVal",
|
|
13735
|
+
"value": 0
|
|
13736
|
+
},
|
|
13737
|
+
{
|
|
13738
|
+
"alias": "maxVal",
|
|
13739
|
+
"value": 100
|
|
13740
|
+
},
|
|
13741
|
+
{
|
|
13742
|
+
"alias": "initVal1",
|
|
13743
|
+
"value": 0
|
|
13744
|
+
},
|
|
13745
|
+
{
|
|
13746
|
+
"alias": "initVal2",
|
|
13747
|
+
"value": 0
|
|
13748
|
+
},
|
|
13749
|
+
{
|
|
13750
|
+
"alias": "step",
|
|
13751
|
+
"value": 1
|
|
13752
|
+
}
|
|
13753
|
+
]
|
|
13754
|
+
},
|
|
13755
|
+
"Tags": {
|
|
13756
|
+
"editorAlias": "Umbraco.Tags",
|
|
13757
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Tags",
|
|
13758
|
+
"values": [
|
|
13759
|
+
{
|
|
13760
|
+
"alias": "group",
|
|
13761
|
+
"value": "default"
|
|
13762
|
+
},
|
|
13763
|
+
{
|
|
13764
|
+
"alias": "storageType",
|
|
13765
|
+
"value": "Json"
|
|
13766
|
+
}
|
|
13767
|
+
],
|
|
13768
|
+
"_notes": "Storage options: Json, CSV"
|
|
13769
|
+
},
|
|
13770
|
+
"Textarea": {
|
|
13771
|
+
"editorAlias": "Umbraco.TextArea",
|
|
13772
|
+
"editorUiAlias": "Umb.PropertyEditorUi.TextArea",
|
|
13773
|
+
"values": [
|
|
13774
|
+
{
|
|
13775
|
+
"alias": "rows",
|
|
13776
|
+
"value": 10
|
|
13777
|
+
},
|
|
13778
|
+
{
|
|
13779
|
+
"alias": "maxChars",
|
|
13780
|
+
"value": 100
|
|
13781
|
+
},
|
|
13782
|
+
{
|
|
13783
|
+
"alias": "minHeight",
|
|
13784
|
+
"value": 200
|
|
13785
|
+
},
|
|
13786
|
+
{
|
|
13787
|
+
"alias": "maxHeight",
|
|
13788
|
+
"value": 100
|
|
13789
|
+
}
|
|
13790
|
+
]
|
|
13791
|
+
},
|
|
13792
|
+
"Textbox": {
|
|
13793
|
+
"editorAlias": "Umbraco.TextBox",
|
|
13794
|
+
"editorUiAlias": "Umb.PropertyEditorUi.TextBox",
|
|
13795
|
+
"values": [
|
|
13796
|
+
{
|
|
13797
|
+
"alias": "maxChars",
|
|
13798
|
+
"value": 512
|
|
13799
|
+
},
|
|
13800
|
+
{
|
|
13801
|
+
"alias": "inputType",
|
|
13802
|
+
"value": "text"
|
|
13803
|
+
}
|
|
13804
|
+
]
|
|
13805
|
+
},
|
|
13806
|
+
"Toggle": {
|
|
13807
|
+
"editorAlias": "Umbraco.TrueFalse",
|
|
13808
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Toggle",
|
|
13809
|
+
"values": [
|
|
13810
|
+
{
|
|
13811
|
+
"alias": "default",
|
|
13812
|
+
"value": true
|
|
13813
|
+
},
|
|
13814
|
+
{
|
|
13815
|
+
"alias": "showLabels",
|
|
13816
|
+
"value": true
|
|
13817
|
+
},
|
|
13818
|
+
{
|
|
13819
|
+
"alias": "labelOn",
|
|
13820
|
+
"value": "On"
|
|
13821
|
+
},
|
|
13822
|
+
{
|
|
13823
|
+
"alias": "labelOff",
|
|
13824
|
+
"value": "Off"
|
|
13825
|
+
},
|
|
13826
|
+
{
|
|
13827
|
+
"alias": "ariaLabel",
|
|
13828
|
+
"value": "Reader"
|
|
13829
|
+
}
|
|
13830
|
+
]
|
|
13831
|
+
},
|
|
13832
|
+
"BlockList": {
|
|
13833
|
+
"editorAlias": "Umbraco.BlockList",
|
|
13834
|
+
"editorUiAlias": "Umb.PropertyEditorUi.BlockList",
|
|
13835
|
+
"values": [
|
|
13836
|
+
{
|
|
13837
|
+
"alias": "blocks",
|
|
13838
|
+
"value": [
|
|
13839
|
+
{
|
|
13840
|
+
"contentElementTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
13841
|
+
"settingsElementTypeKey": "2e1a4fd4-b695-4033-8626-1a45b54e04cb",
|
|
13842
|
+
"backgroundColor": "#c05454",
|
|
13843
|
+
"iconColor": "#00ff6f"
|
|
13844
|
+
}
|
|
13845
|
+
]
|
|
13846
|
+
},
|
|
13847
|
+
{
|
|
13848
|
+
"alias": "validationLimit",
|
|
13849
|
+
"value": {
|
|
13850
|
+
"max": 3
|
|
13851
|
+
}
|
|
13852
|
+
},
|
|
13853
|
+
{
|
|
13854
|
+
"alias": "useLiveEditing",
|
|
13855
|
+
"value": true
|
|
13856
|
+
},
|
|
13857
|
+
{
|
|
13858
|
+
"alias": "useInlineEditingAsDefault",
|
|
13859
|
+
"value": true
|
|
13860
|
+
},
|
|
13861
|
+
{
|
|
13862
|
+
"alias": "maxPropertyWidth",
|
|
13863
|
+
"value": "100px"
|
|
13864
|
+
}
|
|
13865
|
+
],
|
|
13866
|
+
"_notes": "IMPORTANT - when creating new block list data types always create the required element types first before creating the data type"
|
|
13867
|
+
},
|
|
13868
|
+
"CheckBoxList": {
|
|
13869
|
+
"editorAlias": "Umbraco.BlockList",
|
|
13870
|
+
"editorUiAlias": "Umb.PropertyEditorUi.BlockList",
|
|
13871
|
+
"values": [
|
|
13872
|
+
{
|
|
13873
|
+
"alias": "blocks",
|
|
13874
|
+
"value": [
|
|
13875
|
+
{
|
|
13876
|
+
"contentElementTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
13877
|
+
"settingsElementTypeKey": "2e1a4fd4-b695-4033-8626-1a45b54e04cb",
|
|
13878
|
+
"backgroundColor": "#c05454",
|
|
13879
|
+
"iconColor": "#00ff6f"
|
|
13880
|
+
}
|
|
13881
|
+
]
|
|
13882
|
+
},
|
|
13883
|
+
{
|
|
13884
|
+
"alias": "validationLimit",
|
|
13885
|
+
"value": {
|
|
13886
|
+
"max": 3
|
|
13887
|
+
}
|
|
13888
|
+
},
|
|
13889
|
+
{
|
|
13890
|
+
"alias": "useLiveEditing",
|
|
13891
|
+
"value": true
|
|
13892
|
+
},
|
|
13893
|
+
{
|
|
13894
|
+
"alias": "useInlineEditingAsDefault",
|
|
13895
|
+
"value": true
|
|
13896
|
+
},
|
|
13897
|
+
{
|
|
13898
|
+
"alias": "maxPropertyWidth",
|
|
13899
|
+
"value": "100px"
|
|
13900
|
+
}
|
|
13901
|
+
]
|
|
13902
|
+
},
|
|
13903
|
+
"Collection": {
|
|
13904
|
+
"editorAlias": "Umbraco.BlockList",
|
|
13905
|
+
"editorUiAlias": "Umb.PropertyEditorUi.BlockList",
|
|
13906
|
+
"values": [
|
|
13907
|
+
{
|
|
13908
|
+
"alias": "blocks",
|
|
13909
|
+
"value": [
|
|
13910
|
+
{
|
|
13911
|
+
"contentElementTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
13912
|
+
"settingsElementTypeKey": "2e1a4fd4-b695-4033-8626-1a45b54e04cb",
|
|
13913
|
+
"backgroundColor": "#c05454",
|
|
13914
|
+
"iconColor": "#00ff6f"
|
|
13915
|
+
}
|
|
13916
|
+
]
|
|
13917
|
+
},
|
|
13918
|
+
{
|
|
13919
|
+
"alias": "validationLimit",
|
|
13920
|
+
"value": {
|
|
13921
|
+
"max": 3
|
|
13922
|
+
}
|
|
13923
|
+
},
|
|
13924
|
+
{
|
|
13925
|
+
"alias": "useLiveEditing",
|
|
13926
|
+
"value": true
|
|
13927
|
+
},
|
|
13928
|
+
{
|
|
13929
|
+
"alias": "useInlineEditingAsDefault",
|
|
13930
|
+
"value": true
|
|
13931
|
+
},
|
|
13932
|
+
{
|
|
13933
|
+
"alias": "maxPropertyWidth",
|
|
13934
|
+
"value": "100px"
|
|
13935
|
+
}
|
|
13936
|
+
]
|
|
13937
|
+
},
|
|
13938
|
+
"Dropdown": {
|
|
13939
|
+
"editorAlias": "Umbraco.DropDown.Flexible",
|
|
13940
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Dropdown",
|
|
13941
|
+
"values": [
|
|
13942
|
+
{
|
|
13943
|
+
"alias": "items",
|
|
13944
|
+
"value": [
|
|
13945
|
+
"Item 1",
|
|
13946
|
+
"Item 2"
|
|
13947
|
+
]
|
|
13948
|
+
},
|
|
13949
|
+
{
|
|
13950
|
+
"alias": "multiple",
|
|
13951
|
+
"value": true
|
|
13952
|
+
}
|
|
13953
|
+
]
|
|
13954
|
+
},
|
|
13955
|
+
"MultipleTextString": {
|
|
13956
|
+
"editorAlias": "Umbraco.MultipleTextstring",
|
|
13957
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MultipleTextString",
|
|
13958
|
+
"values": [
|
|
13959
|
+
{
|
|
13960
|
+
"alias": "min",
|
|
13961
|
+
"value": 3
|
|
13962
|
+
},
|
|
13963
|
+
{
|
|
13964
|
+
"alias": "max",
|
|
13965
|
+
"value": 10
|
|
13966
|
+
}
|
|
13967
|
+
]
|
|
13968
|
+
},
|
|
13969
|
+
"RadioButtonList": {
|
|
13970
|
+
"editorAlias": "Umbraco.RadioButtonList",
|
|
13971
|
+
"editorUiAlias": "Umb.PropertyEditorUi.RadioButtonList",
|
|
13972
|
+
"values": [
|
|
13973
|
+
{
|
|
13974
|
+
"alias": "items",
|
|
13975
|
+
"value": [
|
|
13976
|
+
"Item 1",
|
|
13977
|
+
"Item 2"
|
|
13978
|
+
]
|
|
13979
|
+
}
|
|
13980
|
+
]
|
|
13981
|
+
},
|
|
13982
|
+
"ImageCropper": {
|
|
13983
|
+
"_notes": "Doesn't work"
|
|
13984
|
+
},
|
|
13985
|
+
"MediaPicker": {
|
|
13986
|
+
"editorAlias": "Umbraco.MediaPicker3",
|
|
13987
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MediaPicker",
|
|
13988
|
+
"values": [
|
|
13989
|
+
{
|
|
13990
|
+
"alias": "filter",
|
|
13991
|
+
"value": "cc07b313-0843-4aa8-bbda-871c8da728c8"
|
|
13992
|
+
},
|
|
13993
|
+
{
|
|
13994
|
+
"alias": "multiple",
|
|
13995
|
+
"value": true
|
|
13996
|
+
},
|
|
13997
|
+
{
|
|
13998
|
+
"alias": "validationLimit",
|
|
13999
|
+
"value": {
|
|
14000
|
+
"max": 10
|
|
14001
|
+
}
|
|
14002
|
+
},
|
|
14003
|
+
{
|
|
14004
|
+
"alias": "startNodeId"
|
|
14005
|
+
},
|
|
14006
|
+
{
|
|
14007
|
+
"alias": "enableLocalFocalPoint",
|
|
14008
|
+
"value": true
|
|
14009
|
+
},
|
|
14010
|
+
{
|
|
14011
|
+
"alias": "ignoreUserStartNodes",
|
|
14012
|
+
"value": true
|
|
14013
|
+
}
|
|
14014
|
+
]
|
|
14015
|
+
},
|
|
14016
|
+
"UploadField": {
|
|
14017
|
+
"editorAlias": "Umbraco.UploadField",
|
|
14018
|
+
"editorUiAlias": "Umb.PropertyEditorUi.UploadField",
|
|
14019
|
+
"values": [
|
|
14020
|
+
{
|
|
14021
|
+
"alias": "fileExtensions",
|
|
14022
|
+
"value": [
|
|
14023
|
+
"pdf"
|
|
14024
|
+
]
|
|
14025
|
+
}
|
|
14026
|
+
]
|
|
14027
|
+
},
|
|
14028
|
+
"MemberGroupPicker": {
|
|
14029
|
+
"editorAlias": "Umbraco.MemberGroupPicker",
|
|
14030
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MemberGroupPicker",
|
|
14031
|
+
"values": []
|
|
14032
|
+
},
|
|
14033
|
+
"MemberPicker": {
|
|
14034
|
+
"editorAlias": "Umbraco.MemberPicker",
|
|
14035
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MemberPicker",
|
|
14036
|
+
"values": []
|
|
14037
|
+
},
|
|
14038
|
+
"UserPicker": {
|
|
14039
|
+
"editorAlias": "Umbraco.UserPicker",
|
|
14040
|
+
"editorUiAlias": "Umb.PropertyEditorUi.UserPicker",
|
|
14041
|
+
"values": []
|
|
14042
|
+
},
|
|
14043
|
+
"ColorPicker": {
|
|
14044
|
+
"editorAlias": "Umbraco.ColorPicker",
|
|
14045
|
+
"editorUiAlias": "Umb.PropertyEditorUi.ColorPicker",
|
|
14046
|
+
"values": [
|
|
14047
|
+
{
|
|
14048
|
+
"alias": "useLabel",
|
|
14049
|
+
"value": true
|
|
14050
|
+
},
|
|
14051
|
+
{
|
|
14052
|
+
"alias": "items",
|
|
14053
|
+
"value": [
|
|
14054
|
+
{
|
|
14055
|
+
"value": "F00",
|
|
14056
|
+
"label": "Red"
|
|
14057
|
+
}
|
|
14058
|
+
]
|
|
14059
|
+
}
|
|
14060
|
+
]
|
|
14061
|
+
},
|
|
14062
|
+
"ContentPicker": {
|
|
14063
|
+
"editorAlias": "Umbraco.MultiNodeTreePicker",
|
|
14064
|
+
"editorUiAlias": "Umb.PropertyEditorUi.ContentPicker",
|
|
14065
|
+
"values": [
|
|
14066
|
+
{
|
|
14067
|
+
"alias": "minNumber",
|
|
14068
|
+
"value": 0
|
|
14069
|
+
},
|
|
14070
|
+
{
|
|
14071
|
+
"alias": "maxNumber",
|
|
14072
|
+
"value": 0
|
|
14073
|
+
},
|
|
14074
|
+
{
|
|
14075
|
+
"alias": "ignoreUserStartNodes",
|
|
14076
|
+
"value": true
|
|
14077
|
+
},
|
|
14078
|
+
{
|
|
14079
|
+
"alias": "startNode",
|
|
14080
|
+
"value": {
|
|
14081
|
+
"type": "content",
|
|
14082
|
+
"dynamicRoot": {
|
|
14083
|
+
"originAlias": "Current"
|
|
14084
|
+
}
|
|
14085
|
+
}
|
|
14086
|
+
},
|
|
14087
|
+
{
|
|
14088
|
+
"alias": "filter",
|
|
14089
|
+
"value": "0fde8472-7c10-4e8a-bd4a-fffc0306d0aa"
|
|
14090
|
+
},
|
|
14091
|
+
{
|
|
14092
|
+
"alias": "showOpenButton",
|
|
14093
|
+
"value": true
|
|
14094
|
+
}
|
|
14095
|
+
]
|
|
14096
|
+
},
|
|
14097
|
+
"DatePicker": {
|
|
14098
|
+
"editorAlias": "Umbraco.DateTime",
|
|
14099
|
+
"editorUiAlias": "Umb.PropertyEditorUi.DatePicker",
|
|
14100
|
+
"values": [
|
|
14101
|
+
{
|
|
14102
|
+
"alias": "format",
|
|
14103
|
+
"value": "YYYY-MM-DD HH:mm:ss"
|
|
14104
|
+
}
|
|
14105
|
+
]
|
|
14106
|
+
},
|
|
14107
|
+
"DocumentPicker": {
|
|
14108
|
+
"editorAlias": "Umbraco.ContentPicker",
|
|
14109
|
+
"editorUiAlias": "Umb.PropertyEditorUi.DocumentPicker",
|
|
14110
|
+
"values": [
|
|
14111
|
+
{
|
|
14112
|
+
"alias": "ignoreUserStartNodes",
|
|
14113
|
+
"value": true
|
|
14114
|
+
},
|
|
14115
|
+
{
|
|
14116
|
+
"alias": "startNodeId",
|
|
14117
|
+
"value": "dcf18a51-6919-4cf8-89d1-36b94ce4d963"
|
|
14118
|
+
},
|
|
14119
|
+
{
|
|
14120
|
+
"alias": "showOpenButton",
|
|
14121
|
+
"value": true
|
|
14122
|
+
}
|
|
14123
|
+
]
|
|
14124
|
+
},
|
|
14125
|
+
"EyeDropper": {
|
|
14126
|
+
"editorAlias": "Umbraco.ColorPicker.EyeDropper",
|
|
14127
|
+
"editorUiAlias": "Umb.PropertyEditorUi.EyeDropper",
|
|
14128
|
+
"values": [
|
|
14129
|
+
{
|
|
14130
|
+
"alias": "showAlpha",
|
|
14131
|
+
"value": true
|
|
14132
|
+
},
|
|
14133
|
+
{
|
|
14134
|
+
"alias": "showPalette",
|
|
14135
|
+
"value": true
|
|
14136
|
+
}
|
|
14137
|
+
]
|
|
14138
|
+
},
|
|
14139
|
+
"MultiUrlPicker": {
|
|
14140
|
+
"editorAlias": "Umbraco.MultiUrlPicker",
|
|
14141
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MultiUrlPicker",
|
|
14142
|
+
"values": [
|
|
14143
|
+
{
|
|
14144
|
+
"alias": "minNumber",
|
|
14145
|
+
"value": 1
|
|
14146
|
+
},
|
|
14147
|
+
{
|
|
14148
|
+
"alias": "maxNumber",
|
|
14149
|
+
"value": 3
|
|
14150
|
+
},
|
|
14151
|
+
{
|
|
14152
|
+
"alias": "ignoreUserStartNodes",
|
|
14153
|
+
"value": true
|
|
14154
|
+
},
|
|
14155
|
+
{
|
|
14156
|
+
"alias": "hideAnchor",
|
|
14157
|
+
"value": false
|
|
14158
|
+
}
|
|
14159
|
+
]
|
|
14160
|
+
},
|
|
14161
|
+
"BlockGrid": {
|
|
14162
|
+
"editorAlias": "Umbraco.BlockGrid",
|
|
14163
|
+
"editorUiAlias": "Umb.PropertyEditorUi.BlockGrid",
|
|
14164
|
+
"values": [
|
|
14165
|
+
{
|
|
14166
|
+
"alias": "gridColumns",
|
|
14167
|
+
"value": 12
|
|
14168
|
+
},
|
|
14169
|
+
{
|
|
14170
|
+
"alias": "blocks",
|
|
14171
|
+
"value": [
|
|
14172
|
+
{
|
|
14173
|
+
"contentElementTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
14174
|
+
"allowAtRoot": true,
|
|
14175
|
+
"allowInAreas": true,
|
|
14176
|
+
"settingsElementTypeKey": "93638715-f76c-4a11-86b1-6a9d66504901",
|
|
14177
|
+
"columnSpanOptions": [
|
|
14178
|
+
{
|
|
14179
|
+
"columnSpan": 12
|
|
14180
|
+
}
|
|
14181
|
+
],
|
|
14182
|
+
"rowMinSpan": 0,
|
|
14183
|
+
"rowMaxSpan": 3
|
|
14184
|
+
}
|
|
14185
|
+
]
|
|
14186
|
+
}
|
|
14187
|
+
],
|
|
14188
|
+
"_notes": "IMPORTANT - when creating new block grid data types always create the required element types first before creating the data type"
|
|
14189
|
+
},
|
|
14190
|
+
"CodeEditor": {
|
|
14191
|
+
"editorAlias": "Umbraco.Plain.String",
|
|
14192
|
+
"editorUiAlias": "Umb.PropertyEditorUi.CodeEditor",
|
|
14193
|
+
"values": [
|
|
14194
|
+
{
|
|
14195
|
+
"alias": "language",
|
|
14196
|
+
"value": "javascript"
|
|
14197
|
+
},
|
|
14198
|
+
{
|
|
14199
|
+
"alias": "height",
|
|
14200
|
+
"value": 400
|
|
14201
|
+
},
|
|
14202
|
+
{
|
|
14203
|
+
"alias": "lineNumbers",
|
|
14204
|
+
"value": true
|
|
14205
|
+
},
|
|
14206
|
+
{
|
|
14207
|
+
"alias": "minimap",
|
|
14208
|
+
"value": true
|
|
14209
|
+
},
|
|
14210
|
+
{
|
|
14211
|
+
"alias": "wordWrap",
|
|
14212
|
+
"value": false
|
|
14213
|
+
}
|
|
14214
|
+
]
|
|
14215
|
+
},
|
|
14216
|
+
"MarkdownEditor": {
|
|
14217
|
+
"editorAlias": "Umbraco.MarkdownEditor",
|
|
14218
|
+
"editorUiAlias": "Umb.PropertyEditorUi.MarkdownEditor",
|
|
14219
|
+
"values": [
|
|
14220
|
+
{
|
|
14221
|
+
"alias": "preview",
|
|
14222
|
+
"value": true
|
|
14223
|
+
},
|
|
14224
|
+
{
|
|
14225
|
+
"alias": "defaultValue",
|
|
14226
|
+
"value": "Default value"
|
|
14227
|
+
},
|
|
14228
|
+
{
|
|
14229
|
+
"alias": "overlaySize",
|
|
14230
|
+
"value": "small"
|
|
14231
|
+
}
|
|
14232
|
+
]
|
|
14233
|
+
},
|
|
14234
|
+
"RichTextEditor_TinyMCE": {
|
|
14235
|
+
"editorAlias": "Umbraco.RichText",
|
|
14236
|
+
"editorUiAlias": "Umb.PropertyEditorUi.TinyMCE",
|
|
14237
|
+
"values": [
|
|
14238
|
+
{
|
|
14239
|
+
"alias": "toolbar",
|
|
14240
|
+
"value": [
|
|
14241
|
+
"styles",
|
|
14242
|
+
"bold",
|
|
14243
|
+
"italic",
|
|
14244
|
+
"alignleft",
|
|
14245
|
+
"aligncenter",
|
|
14246
|
+
"alignright",
|
|
14247
|
+
"bullist",
|
|
14248
|
+
"numlist",
|
|
14249
|
+
"outdent",
|
|
14250
|
+
"indent",
|
|
14251
|
+
"sourcecode",
|
|
14252
|
+
"link",
|
|
14253
|
+
"umbmediapicker",
|
|
14254
|
+
"umbembeddialog"
|
|
14255
|
+
]
|
|
14256
|
+
},
|
|
14257
|
+
{
|
|
14258
|
+
"alias": "mode",
|
|
14259
|
+
"value": "Classic"
|
|
14260
|
+
},
|
|
14261
|
+
{
|
|
14262
|
+
"alias": "maxImageSize",
|
|
14263
|
+
"value": 500
|
|
14264
|
+
},
|
|
14265
|
+
{
|
|
14266
|
+
"alias": "blocks",
|
|
14267
|
+
"value": [
|
|
14268
|
+
{
|
|
14269
|
+
"contentElementTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
14270
|
+
"settingsElementTypeKey": "93638715-f76c-4a11-86b1-6a9d66504901",
|
|
14271
|
+
"label": "Appearance",
|
|
14272
|
+
"displayInline": true,
|
|
14273
|
+
"editorSize": "small",
|
|
14274
|
+
"backgroundColor": "#000000",
|
|
14275
|
+
"iconColor": "#000000"
|
|
14276
|
+
}
|
|
14277
|
+
]
|
|
14278
|
+
},
|
|
14279
|
+
{
|
|
14280
|
+
"alias": "mediaParentId"
|
|
14281
|
+
},
|
|
14282
|
+
{
|
|
14283
|
+
"alias": "ignoreUserStartNodes",
|
|
14284
|
+
"value": true
|
|
14285
|
+
}
|
|
14286
|
+
]
|
|
14287
|
+
},
|
|
14288
|
+
"RichTextEditor_Tiptap": {
|
|
14289
|
+
"editorAlias": "Umbraco.RichText",
|
|
14290
|
+
"editorUiAlias": "Umb.PropertyEditorUi.Tiptap",
|
|
14291
|
+
"values": [
|
|
14292
|
+
{
|
|
14293
|
+
"alias": "toolbar",
|
|
14294
|
+
"value": [
|
|
14295
|
+
[
|
|
14296
|
+
[
|
|
14297
|
+
"Umb.Tiptap.Toolbar.SourceEditor"
|
|
14298
|
+
],
|
|
14299
|
+
[
|
|
14300
|
+
"Umb.Tiptap.Toolbar.Bold",
|
|
14301
|
+
"Umb.Tiptap.Toolbar.Italic",
|
|
14302
|
+
"Umb.Tiptap.Toolbar.Underline"
|
|
14303
|
+
],
|
|
14304
|
+
[
|
|
14305
|
+
"Umb.Tiptap.Toolbar.TextAlignLeft",
|
|
14306
|
+
"Umb.Tiptap.Toolbar.TextAlignCenter",
|
|
14307
|
+
"Umb.Tiptap.Toolbar.TextAlignRight"
|
|
14308
|
+
],
|
|
14309
|
+
[
|
|
14310
|
+
"Umb.Tiptap.Toolbar.BulletList",
|
|
14311
|
+
"Umb.Tiptap.Toolbar.OrderedList"
|
|
14312
|
+
],
|
|
14313
|
+
[
|
|
14314
|
+
"Umb.Tiptap.Toolbar.Blockquote",
|
|
14315
|
+
"Umb.Tiptap.Toolbar.HorizontalRule"
|
|
14316
|
+
],
|
|
14317
|
+
[
|
|
14318
|
+
"Umb.Tiptap.Toolbar.Link",
|
|
14319
|
+
"Umb.Tiptap.Toolbar.Unlink"
|
|
14320
|
+
],
|
|
14321
|
+
[
|
|
14322
|
+
"Umb.Tiptap.Toolbar.MediaPicker",
|
|
14323
|
+
"Umb.Tiptap.Toolbar.EmbeddedMedia"
|
|
14324
|
+
]
|
|
14325
|
+
]
|
|
14326
|
+
]
|
|
14327
|
+
},
|
|
14328
|
+
{
|
|
14329
|
+
"alias": "maxImageSize",
|
|
14330
|
+
"value": 500
|
|
14331
|
+
},
|
|
14332
|
+
{
|
|
14333
|
+
"alias": "overlaySize",
|
|
14334
|
+
"value": "medium"
|
|
14335
|
+
},
|
|
14336
|
+
{
|
|
14337
|
+
"alias": "extensions",
|
|
14338
|
+
"value": [
|
|
14339
|
+
"Umb.Tiptap.Embed",
|
|
14340
|
+
"Umb.Tiptap.Figure",
|
|
14341
|
+
"Umb.Tiptap.Image",
|
|
14342
|
+
"Umb.Tiptap.Link",
|
|
14343
|
+
"Umb.Tiptap.MediaUpload",
|
|
14344
|
+
"Umb.Tiptap.RichTextEssentials",
|
|
14345
|
+
"Umb.Tiptap.Subscript",
|
|
14346
|
+
"Umb.Tiptap.Superscript",
|
|
14347
|
+
"Umb.Tiptap.Table",
|
|
14348
|
+
"Umb.Tiptap.TextAlign",
|
|
14349
|
+
"Umb.Tiptap.TextDirection",
|
|
14350
|
+
"Umb.Tiptap.Underline"
|
|
14351
|
+
]
|
|
14352
|
+
}
|
|
14353
|
+
]
|
|
14354
|
+
}
|
|
14355
|
+
};
|
|
14356
|
+
|
|
14357
|
+
// src/umb-management-api/tools/data-type/get/get-data-type-property-editor-template.ts
|
|
14358
|
+
var propertyEditorTemplateSchema = _zod.z.object({
|
|
14359
|
+
editorName: _zod.z.string().optional().describe("The name of the property editor template to retrieve (e.g., 'Textbox', 'Toggle', 'RichTextEditor_TinyMCE'). If not provided, returns a list of all available property editor names.")
|
|
14360
|
+
});
|
|
14361
|
+
var GetDataTypePropertyEditorTemplateTool = CreateUmbracoTool(
|
|
14362
|
+
"get-data-type-property-editor-template",
|
|
14363
|
+
`Retrieves property editor templates for creating data types in Umbraco.
|
|
14364
|
+
|
|
14365
|
+
IMPORTANT: This tool should be used BEFORE creating data types to understand:
|
|
14366
|
+
- What property editors are available
|
|
14367
|
+
- The required configuration structure for each property editor
|
|
14368
|
+
- Example values that can be customized for your needs
|
|
14369
|
+
|
|
14370
|
+
Usage:
|
|
14371
|
+
1. Call without parameters to see all available property editor names
|
|
14372
|
+
2. Call with a specific editorName to get the full configuration template for that property editor
|
|
14373
|
+
3. Use the returned template as a starting point when creating new data types with create-data-type
|
|
14374
|
+
|
|
14375
|
+
The templates include:
|
|
14376
|
+
- editorAlias: The internal Umbraco editor identifier (required)
|
|
14377
|
+
- editorUiAlias: The UI component identifier (required)
|
|
14378
|
+
- values: An array of configuration options with example values
|
|
14379
|
+
- _notes: Important information about special requirements or options
|
|
14380
|
+
|
|
14381
|
+
Note: Some templates (like BlockList, BlockGrid) have _notes indicating you must create element types first before creating the data type.`,
|
|
14382
|
+
propertyEditorTemplateSchema.shape,
|
|
14383
|
+
async (model) => {
|
|
14384
|
+
try {
|
|
14385
|
+
if (!model.editorName) {
|
|
14386
|
+
const availableEditors = Object.entries(propertyEditorTemplates).map(([name, config]) => {
|
|
14387
|
+
const hasNotes = config._notes ? ` (${config._notes})` : "";
|
|
14388
|
+
return `- ${name}${hasNotes}`;
|
|
14389
|
+
}).sort().join("\n");
|
|
14390
|
+
return {
|
|
14391
|
+
content: [
|
|
14392
|
+
{
|
|
14393
|
+
type: "text",
|
|
14394
|
+
text: `Available Property Editor Templates:
|
|
14395
|
+
|
|
14396
|
+
${availableEditors}
|
|
14397
|
+
|
|
14398
|
+
Use get-data-type-property-editor-template with a specific editorName to see the full configuration.`
|
|
14399
|
+
}
|
|
14400
|
+
]
|
|
14401
|
+
};
|
|
14402
|
+
}
|
|
14403
|
+
const editorKey = Object.keys(propertyEditorTemplates).find(
|
|
14404
|
+
(key) => key.toLowerCase() === model.editorName.toLowerCase()
|
|
14405
|
+
);
|
|
14406
|
+
if (!editorKey) {
|
|
14407
|
+
const availableEditors = Object.keys(propertyEditorTemplates).sort().join(", ");
|
|
14408
|
+
return {
|
|
14409
|
+
content: [
|
|
14410
|
+
{
|
|
14411
|
+
type: "text",
|
|
14412
|
+
text: `Property editor template '${model.editorName}' not found.
|
|
14413
|
+
|
|
14414
|
+
Available templates: ${availableEditors}
|
|
14415
|
+
|
|
14416
|
+
Note: Editor names are case-insensitive.`
|
|
14417
|
+
}
|
|
14418
|
+
],
|
|
14419
|
+
isError: true
|
|
14420
|
+
};
|
|
14421
|
+
}
|
|
14422
|
+
const template = propertyEditorTemplates[editorKey];
|
|
14423
|
+
let response = `Property Editor Template: ${editorKey}
|
|
14424
|
+
|
|
14425
|
+
`;
|
|
14426
|
+
if (template._notes) {
|
|
14427
|
+
response += `IMPORTANT NOTES:
|
|
14428
|
+
${template._notes}
|
|
14429
|
+
|
|
14430
|
+
`;
|
|
14431
|
+
}
|
|
14432
|
+
response += `Configuration:
|
|
14433
|
+
${JSON.stringify(template, null, 2)}
|
|
14434
|
+
|
|
14435
|
+
`;
|
|
14436
|
+
response += `Usage with create-data-type:
|
|
14437
|
+
`;
|
|
14438
|
+
response += `When creating a data type with this property editor, use:
|
|
14439
|
+
`;
|
|
14440
|
+
response += `- editorAlias: "${template.editorAlias}"
|
|
14441
|
+
`;
|
|
14442
|
+
response += `- editorUiAlias: "${template.editorUiAlias}"
|
|
14443
|
+
`;
|
|
14444
|
+
if (template.values && template.values.length > 0) {
|
|
14445
|
+
response += `- values: Customize the values array based on your requirements
|
|
14446
|
+
`;
|
|
14447
|
+
}
|
|
14448
|
+
return {
|
|
14449
|
+
content: [
|
|
14450
|
+
{
|
|
14451
|
+
type: "text",
|
|
14452
|
+
text: response
|
|
14453
|
+
}
|
|
14454
|
+
]
|
|
14455
|
+
};
|
|
14456
|
+
} catch (error) {
|
|
14457
|
+
console.error("Error reading property editor templates:", error);
|
|
14458
|
+
return {
|
|
14459
|
+
content: [
|
|
14460
|
+
{
|
|
14461
|
+
type: "text",
|
|
14462
|
+
text: `Error reading property editor templates: ${error instanceof Error ? error.message : String(error)}`
|
|
14463
|
+
}
|
|
14464
|
+
],
|
|
14465
|
+
isError: true
|
|
14466
|
+
};
|
|
14467
|
+
}
|
|
14468
|
+
}
|
|
14469
|
+
);
|
|
14470
|
+
var get_data_type_property_editor_template_default = GetDataTypePropertyEditorTemplateTool;
|
|
14471
|
+
|
|
14472
|
+
// src/umb-management-api/tools/data-type/put/update-data-type.ts
|
|
14473
|
+
|
|
14474
|
+
var UpdateDataTypeTool = CreateUmbracoTool(
|
|
14475
|
+
"update-data-type",
|
|
14476
|
+
"Updates a data type by Id",
|
|
14477
|
+
{
|
|
14478
|
+
id: putDataTypeByIdParams.shape.id,
|
|
14479
|
+
data: _zod.z.object(putDataTypeByIdBody.shape)
|
|
14480
|
+
},
|
|
14481
|
+
async (model) => {
|
|
14482
|
+
const client = UmbracoManagementClient2.getClient();
|
|
14483
|
+
var response = await client.putDataTypeById(model.id, model.data);
|
|
14484
|
+
return {
|
|
14485
|
+
content: [
|
|
14486
|
+
{
|
|
14487
|
+
type: "text",
|
|
14488
|
+
text: JSON.stringify(response)
|
|
14489
|
+
}
|
|
14490
|
+
]
|
|
14491
|
+
};
|
|
14492
|
+
}
|
|
14493
|
+
);
|
|
14494
|
+
var update_data_type_default = UpdateDataTypeTool;
|
|
14495
|
+
|
|
14496
|
+
// src/umb-management-api/tools/data-type/post/copy-data-type.ts
|
|
14497
|
+
|
|
14498
|
+
var CopyDataTypeTool = CreateUmbracoTool(
|
|
14499
|
+
"copy-data-type",
|
|
14500
|
+
"Copy a data type by Id",
|
|
14501
|
+
{
|
|
14502
|
+
id: postDataTypeByIdCopyParams.shape.id,
|
|
14503
|
+
body: _zod.z.object(postDataTypeByIdCopyBody.shape)
|
|
14504
|
+
},
|
|
14505
|
+
async ({ id, body }) => {
|
|
14506
|
+
const client = UmbracoManagementClient2.getClient();
|
|
14507
|
+
var response = await client.postDataTypeByIdCopy(id, body);
|
|
14508
|
+
return {
|
|
14509
|
+
content: [
|
|
14510
|
+
{
|
|
14511
|
+
type: "text",
|
|
14512
|
+
text: JSON.stringify(response)
|
|
14513
|
+
}
|
|
14514
|
+
]
|
|
14515
|
+
};
|
|
14516
|
+
}
|
|
14517
|
+
);
|
|
14518
|
+
var copy_data_type_default = CopyDataTypeTool;
|
|
14519
|
+
|
|
14520
|
+
// src/umb-management-api/tools/data-type/get/is-used-data-type.ts
|
|
14521
|
+
var IsUsedDataTypeTool = CreateUmbracoTool(
|
|
14522
|
+
"is-used-data-type",
|
|
14523
|
+
"Checks if a data type is used within Umbraco",
|
|
14524
|
+
getDataTypeByIdIsUsedParams.shape,
|
|
14525
|
+
async ({ id }) => {
|
|
14526
|
+
const client = UmbracoManagementClient2.getClient();
|
|
14527
|
+
var response = await client.getDataTypeByIdIsUsed(id);
|
|
14528
|
+
return {
|
|
14529
|
+
content: [
|
|
14530
|
+
{
|
|
14531
|
+
type: "text",
|
|
14532
|
+
text: JSON.stringify(response)
|
|
14533
|
+
}
|
|
14534
|
+
]
|
|
14535
|
+
};
|
|
14536
|
+
}
|
|
14537
|
+
);
|
|
14538
|
+
var is_used_data_type_default = IsUsedDataTypeTool;
|
|
14539
|
+
|
|
14540
|
+
// src/umb-management-api/tools/data-type/put/move-data-type.ts
|
|
14541
|
+
|
|
14542
|
+
var MoveDataTypeTool = CreateUmbracoTool(
|
|
14543
|
+
"move-data-type",
|
|
14544
|
+
"Move a data type by Id",
|
|
14545
|
+
{
|
|
14546
|
+
id: putDataTypeByIdMoveParams.shape.id,
|
|
14547
|
+
body: _zod.z.object(putDataTypeByIdMoveBody.shape)
|
|
14548
|
+
},
|
|
14549
|
+
async ({ id, body }) => {
|
|
14550
|
+
const client = UmbracoManagementClient2.getClient();
|
|
14551
|
+
var response = await client.putDataTypeByIdMove(id, body);
|
|
14552
|
+
return {
|
|
14553
|
+
content: [
|
|
14554
|
+
{
|
|
14555
|
+
type: "text",
|
|
14556
|
+
text: JSON.stringify(response)
|
|
14557
|
+
}
|
|
14558
|
+
]
|
|
14559
|
+
};
|
|
14560
|
+
}
|
|
14561
|
+
);
|
|
14562
|
+
var move_data_type_default = MoveDataTypeTool;
|
|
14563
|
+
|
|
14564
|
+
// src/umb-management-api/tools/data-type/get/get-references-data-type.ts
|
|
14565
|
+
var GetReferencesDataTypeTool = CreateUmbracoTool(
|
|
14566
|
+
"get-references-data-type",
|
|
14567
|
+
`Gets the document types and properties that use a specific data type.
|
|
14568
|
+
|
|
14569
|
+
This is the recommended method to find all document types that reference a particular data type.
|
|
14570
|
+
|
|
14571
|
+
Usage examples:
|
|
14572
|
+
- Find all document types using the RichText editor data type
|
|
14573
|
+
- Identify properties that reference a specific data type before modifying or deleting it
|
|
14574
|
+
- Perform bulk updates to all properties using a specific data type
|
|
14575
|
+
|
|
14576
|
+
Returns a detailed list with content type information (id, type, name, icon) and all properties
|
|
14577
|
+
(name, alias) that use the specified data type.
|
|
14578
|
+
`,
|
|
14579
|
+
getDataTypeByIdReferencesParams.shape,
|
|
14580
|
+
async ({ id }) => {
|
|
14581
|
+
const client = UmbracoManagementClient2.getClient();
|
|
14582
|
+
var response = await client.getDataTypeByIdReferences(id);
|
|
14583
|
+
return {
|
|
14584
|
+
content: [
|
|
14585
|
+
{
|
|
14586
|
+
type: "text",
|
|
13759
14587
|
text: JSON.stringify(response)
|
|
13760
14588
|
}
|
|
13761
14589
|
]
|
|
@@ -14033,6 +14861,7 @@ var DataTypeCollection = {
|
|
|
14033
14861
|
tools.push(is_used_data_type_default());
|
|
14034
14862
|
tools.push(get_data_type_default());
|
|
14035
14863
|
tools.push(get_data_type_configuration_default());
|
|
14864
|
+
tools.push(get_data_type_property_editor_template_default());
|
|
14036
14865
|
}
|
|
14037
14866
|
if (AuthorizationPolicies.TreeAccessDataTypes(user)) {
|
|
14038
14867
|
tools.push(get_root_default());
|
|
@@ -14119,13 +14948,29 @@ var GetDictionaryItemTool = CreateUmbracoTool(
|
|
|
14119
14948
|
var get_dictionary_item_default = GetDictionaryItemTool;
|
|
14120
14949
|
|
|
14121
14950
|
// src/umb-management-api/tools/dictionary/post/create-dictionary-item.ts
|
|
14951
|
+
|
|
14952
|
+
var createDictionarySchema = _zod.z.object({
|
|
14953
|
+
name: _zod.z.string().min(1, "Name is required"),
|
|
14954
|
+
parentId: _zod.z.string().uuid().optional(),
|
|
14955
|
+
translations: _zod.z.array(_zod.z.object({
|
|
14956
|
+
isoCode: _zod.z.string().min(1, "ISO code is required"),
|
|
14957
|
+
translation: _zod.z.string()
|
|
14958
|
+
})),
|
|
14959
|
+
id: _zod.z.string().uuid().nullish()
|
|
14960
|
+
});
|
|
14122
14961
|
var CreateDictionaryItemTool = CreateUmbracoTool(
|
|
14123
14962
|
"create-dictionary",
|
|
14124
|
-
|
|
14125
|
-
|
|
14963
|
+
`Creates a new dictionary item.`,
|
|
14964
|
+
createDictionarySchema.shape,
|
|
14126
14965
|
async (model) => {
|
|
14127
14966
|
const client = UmbracoManagementClient2.getClient();
|
|
14128
|
-
|
|
14967
|
+
const payload = {
|
|
14968
|
+
name: model.name,
|
|
14969
|
+
parent: model.parentId ? { id: model.parentId } : void 0,
|
|
14970
|
+
translations: model.translations,
|
|
14971
|
+
id: model.id
|
|
14972
|
+
};
|
|
14973
|
+
var response = await client.postDictionary(payload);
|
|
14129
14974
|
return {
|
|
14130
14975
|
content: [
|
|
14131
14976
|
{
|
|
@@ -14275,7 +15120,7 @@ var DictionaryCollection = {
|
|
|
14275
15120
|
|
|
14276
15121
|
// src/umb-management-api/tools/document-type/post/create-document-type.ts
|
|
14277
15122
|
|
|
14278
|
-
|
|
15123
|
+
|
|
14279
15124
|
|
|
14280
15125
|
// src/umb-management-api/tools/document-type/post/helpers/create-container-hierarchy.ts
|
|
14281
15126
|
|
|
@@ -14290,38 +15135,44 @@ var propertySchema = _zod.z.object({
|
|
|
14290
15135
|
function createContainerHierarchy(properties) {
|
|
14291
15136
|
const containerIds = /* @__PURE__ */ new Map();
|
|
14292
15137
|
const tabs = /* @__PURE__ */ new Set();
|
|
14293
|
-
const groups = /* @__PURE__ */ new Set();
|
|
14294
15138
|
properties.forEach((prop) => {
|
|
14295
15139
|
if (prop.tab) tabs.add(prop.tab);
|
|
14296
|
-
if (prop.group) groups.add(prop.group);
|
|
14297
15140
|
});
|
|
14298
|
-
const
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
const
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
15141
|
+
const groupKeys = /* @__PURE__ */ new Map();
|
|
15142
|
+
properties.forEach((prop) => {
|
|
15143
|
+
if (prop.group) {
|
|
15144
|
+
const key = `${prop.tab || "NO_TAB"}::${prop.group}`;
|
|
15145
|
+
if (!groupKeys.has(key)) {
|
|
15146
|
+
groupKeys.set(key, {
|
|
15147
|
+
groupName: prop.group,
|
|
15148
|
+
tabName: prop.tab
|
|
15149
|
+
});
|
|
15150
|
+
}
|
|
15151
|
+
}
|
|
15152
|
+
});
|
|
15153
|
+
const containers = Array.from(tabs).map((tabName, index) => {
|
|
15154
|
+
const id = _uuid.v4.call(void 0, );
|
|
15155
|
+
containerIds.set(tabName, id);
|
|
15156
|
+
return {
|
|
15157
|
+
id,
|
|
15158
|
+
name: tabName,
|
|
15159
|
+
type: "Tab",
|
|
15160
|
+
parent: null,
|
|
15161
|
+
sortOrder: index
|
|
15162
|
+
};
|
|
15163
|
+
});
|
|
15164
|
+
const groupContainers = Array.from(groupKeys.entries()).map(([key, groupKey], index) => {
|
|
15165
|
+
const id = _uuid.v4.call(void 0, );
|
|
15166
|
+
containerIds.set(key, id);
|
|
15167
|
+
return {
|
|
15168
|
+
id,
|
|
15169
|
+
name: groupKey.groupName,
|
|
15170
|
+
type: "Group",
|
|
15171
|
+
parent: groupKey.tabName ? { id: containerIds.get(groupKey.tabName) } : null,
|
|
15172
|
+
sortOrder: index
|
|
15173
|
+
};
|
|
15174
|
+
});
|
|
15175
|
+
containers.push(...groupContainers);
|
|
14325
15176
|
return { containers, containerIds };
|
|
14326
15177
|
}
|
|
14327
15178
|
|
|
@@ -14332,6 +15183,7 @@ var createDocumentTypeSchema = _zod.z.object({
|
|
|
14332
15183
|
description: _zod.z.string().optional(),
|
|
14333
15184
|
icon: _zod.z.string().min(1, "Icon is required"),
|
|
14334
15185
|
allowedAsRoot: _zod.z.boolean().default(false),
|
|
15186
|
+
parentId: _zod.z.string().uuid().optional(),
|
|
14335
15187
|
compositions: _zod.z.array(_zod.z.string().uuid("Must be a valid document type UUID")).default([]),
|
|
14336
15188
|
allowedDocumentTypes: _zod.z.array(_zod.z.string().uuid("Must be a valid document type UUID")).default([]),
|
|
14337
15189
|
collection: _zod.z.string().uuid("Must be a valid collection data type UUID").optional(),
|
|
@@ -14342,28 +15194,36 @@ var createDocumentTypeSchema = _zod.z.object({
|
|
|
14342
15194
|
dataTypeId: _zod.z.string().uuid("Must be a valid data type UUID"),
|
|
14343
15195
|
tab: _zod.z.string().optional(),
|
|
14344
15196
|
group: _zod.z.string().optional()
|
|
14345
|
-
})
|
|
15197
|
+
}).refine(
|
|
15198
|
+
(data) => data.tab || data.group,
|
|
15199
|
+
{
|
|
15200
|
+
message: "Property must specify either 'tab' or 'group' (or both) to appear in Umbraco UI. Properties without a container are invisible.",
|
|
15201
|
+
path: ["tab"]
|
|
15202
|
+
}
|
|
15203
|
+
)
|
|
14346
15204
|
).default([])
|
|
14347
15205
|
});
|
|
14348
15206
|
var CreateDocumentTypeTool = CreateUmbracoTool(
|
|
14349
15207
|
"create-document-type",
|
|
14350
15208
|
`Creates a new document type in Umbraco.
|
|
14351
|
-
|
|
15209
|
+
|
|
14352
15210
|
IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
14353
15211
|
|
|
14354
15212
|
1. ALWAYS use the get-icons tool to find a valid icon name
|
|
14355
15213
|
2. When referencing data types, first find them using find-data-type to get their correct IDs
|
|
14356
15214
|
3. When adding compositions or allowed document types, first use get-document-type-root to find the actual IDs
|
|
14357
15215
|
4. The tool will automatically generate UUIDs for properties and containers
|
|
14358
|
-
5.
|
|
15216
|
+
5. Document types can be created in folders by specifying a parentId, or at the root level by omitting the parentId
|
|
14359
15217
|
6. Do not try to add templates to document types they are not currently supported
|
|
14360
|
-
|
|
14361
|
-
- Properties
|
|
14362
|
-
-
|
|
14363
|
-
-
|
|
15218
|
+
7. Property container structure:
|
|
15219
|
+
- Properties MUST specify either a 'tab' or 'group' (or both) to appear in Umbraco UI
|
|
15220
|
+
- Property with only tab: appears directly in the tab
|
|
15221
|
+
- Property with only group: appears in the group (group has no parent tab)
|
|
15222
|
+
- Property with both tab and group: group is nested inside the tab, property appears in the group
|
|
14364
15223
|
- The tool will automatically create the container hierarchy`,
|
|
14365
15224
|
createDocumentTypeSchema.shape,
|
|
14366
|
-
async (
|
|
15225
|
+
async (rawModel) => {
|
|
15226
|
+
const model = createDocumentTypeSchema.parse(rawModel);
|
|
14367
15227
|
const documentTypeId = _uuid.v4.call(void 0, );
|
|
14368
15228
|
const { containers, containerIds } = createContainerHierarchy(
|
|
14369
15229
|
model.properties
|
|
@@ -14371,7 +15231,8 @@ IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
|
14371
15231
|
const properties = model.properties.map((prop, index) => {
|
|
14372
15232
|
let containerId;
|
|
14373
15233
|
if (prop.group) {
|
|
14374
|
-
|
|
15234
|
+
const key = `${prop.tab || "NO_TAB"}::${prop.group}`;
|
|
15235
|
+
containerId = containerIds.get(key);
|
|
14375
15236
|
} else if (prop.tab) {
|
|
14376
15237
|
containerId = containerIds.get(prop.tab);
|
|
14377
15238
|
}
|
|
@@ -14421,18 +15282,42 @@ IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
|
14421
15282
|
documentType: { id },
|
|
14422
15283
|
sortOrder: index
|
|
14423
15284
|
})),
|
|
14424
|
-
collection: model.collection ? { id: model.collection } : void 0
|
|
15285
|
+
collection: model.collection ? { id: model.collection } : void 0,
|
|
15286
|
+
parent: model.parentId ? { id: model.parentId } : void 0
|
|
14425
15287
|
};
|
|
14426
15288
|
const client = UmbracoManagementClient2.getClient();
|
|
14427
|
-
const response = await client.postDocumentType(payload
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
15289
|
+
const response = await client.postDocumentType(payload, {
|
|
15290
|
+
returnFullResponse: true,
|
|
15291
|
+
validateStatus: () => true
|
|
15292
|
+
});
|
|
15293
|
+
if (response.status === 201) {
|
|
15294
|
+
return {
|
|
15295
|
+
content: [
|
|
15296
|
+
{
|
|
15297
|
+
type: "text",
|
|
15298
|
+
text: JSON.stringify({
|
|
15299
|
+
message: "Document type created successfully",
|
|
15300
|
+
id: documentTypeId
|
|
15301
|
+
})
|
|
15302
|
+
}
|
|
15303
|
+
]
|
|
15304
|
+
};
|
|
15305
|
+
} else {
|
|
15306
|
+
const errorData = response.data;
|
|
15307
|
+
return {
|
|
15308
|
+
content: [
|
|
15309
|
+
{
|
|
15310
|
+
type: "text",
|
|
15311
|
+
text: JSON.stringify({
|
|
15312
|
+
message: "Failed to create document type",
|
|
15313
|
+
status: response.status,
|
|
15314
|
+
error: errorData || response.statusText
|
|
15315
|
+
})
|
|
15316
|
+
}
|
|
15317
|
+
],
|
|
15318
|
+
isError: true
|
|
15319
|
+
};
|
|
15320
|
+
}
|
|
14436
15321
|
}
|
|
14437
15322
|
);
|
|
14438
15323
|
var create_document_type_default = CreateDocumentTypeTool;
|
|
@@ -15367,7 +16252,13 @@ var createElementTypeSchema = _zod.z.object({
|
|
|
15367
16252
|
dataTypeId: _zod.z.string().uuid("Must be a valid data type UUID"),
|
|
15368
16253
|
tab: _zod.z.string().optional(),
|
|
15369
16254
|
group: _zod.z.string().optional()
|
|
15370
|
-
})
|
|
16255
|
+
}).refine(
|
|
16256
|
+
(data) => data.tab || data.group,
|
|
16257
|
+
{
|
|
16258
|
+
message: "Property must specify either 'tab' or 'group' (or both) to appear in Umbraco UI. Properties without a container are invisible.",
|
|
16259
|
+
path: ["tab"]
|
|
16260
|
+
}
|
|
16261
|
+
)
|
|
15371
16262
|
).default([])
|
|
15372
16263
|
});
|
|
15373
16264
|
var CreateElementTypeTool = CreateUmbracoTool(
|
|
@@ -15382,12 +16273,14 @@ IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
|
15382
16273
|
4. The tool will automatically generate UUIDs for properties and containers
|
|
15383
16274
|
5. Always create new element types in the root before copying to a new folder if required
|
|
15384
16275
|
6. Property container structure:
|
|
15385
|
-
- Properties
|
|
15386
|
-
-
|
|
15387
|
-
-
|
|
16276
|
+
- Properties MUST specify either a 'tab' or 'group' (or both) to appear in Umbraco UI
|
|
16277
|
+
- Property with only tab: appears directly in the tab
|
|
16278
|
+
- Property with only group: appears in the group (group has no parent tab)
|
|
16279
|
+
- Property with both tab and group: group is nested inside the tab, property appears in the group
|
|
15388
16280
|
- The tool will automatically create the container hierarchy`,
|
|
15389
16281
|
createElementTypeSchema.shape,
|
|
15390
|
-
async (
|
|
16282
|
+
async (rawModel) => {
|
|
16283
|
+
const model = createElementTypeSchema.parse(rawModel);
|
|
15391
16284
|
const elementTypeId = _uuid.v4.call(void 0, );
|
|
15392
16285
|
const { containers, containerIds } = createContainerHierarchy(
|
|
15393
16286
|
model.properties
|
|
@@ -15395,7 +16288,8 @@ IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
|
15395
16288
|
const properties = model.properties.map((prop, index) => {
|
|
15396
16289
|
let containerId;
|
|
15397
16290
|
if (prop.group) {
|
|
15398
|
-
|
|
16291
|
+
const key = `${prop.tab || "NO_TAB"}::${prop.group}`;
|
|
16292
|
+
containerId = containerIds.get(key);
|
|
15399
16293
|
} else if (prop.tab) {
|
|
15400
16294
|
containerId = containerIds.get(prop.tab);
|
|
15401
16295
|
}
|
|
@@ -15444,15 +16338,38 @@ IMPORTANT: IMPLEMENTATION REQUIREMENTS
|
|
|
15444
16338
|
allowedDocumentTypes: []
|
|
15445
16339
|
};
|
|
15446
16340
|
const client = UmbracoManagementClient2.getClient();
|
|
15447
|
-
const response = await client.postDocumentType(payload
|
|
15448
|
-
|
|
15449
|
-
|
|
15450
|
-
|
|
15451
|
-
|
|
15452
|
-
|
|
15453
|
-
|
|
15454
|
-
|
|
15455
|
-
|
|
16341
|
+
const response = await client.postDocumentType(payload, {
|
|
16342
|
+
returnFullResponse: true,
|
|
16343
|
+
validateStatus: () => true
|
|
16344
|
+
});
|
|
16345
|
+
if (response.status === 201) {
|
|
16346
|
+
return {
|
|
16347
|
+
content: [
|
|
16348
|
+
{
|
|
16349
|
+
type: "text",
|
|
16350
|
+
text: JSON.stringify({
|
|
16351
|
+
message: "Element type created successfully",
|
|
16352
|
+
id: elementTypeId
|
|
16353
|
+
})
|
|
16354
|
+
}
|
|
16355
|
+
]
|
|
16356
|
+
};
|
|
16357
|
+
} else {
|
|
16358
|
+
const errorData = response.data;
|
|
16359
|
+
return {
|
|
16360
|
+
content: [
|
|
16361
|
+
{
|
|
16362
|
+
type: "text",
|
|
16363
|
+
text: JSON.stringify({
|
|
16364
|
+
message: "Failed to create element type",
|
|
16365
|
+
status: response.status,
|
|
16366
|
+
error: errorData || response.statusText
|
|
16367
|
+
})
|
|
16368
|
+
}
|
|
16369
|
+
],
|
|
16370
|
+
isError: true
|
|
16371
|
+
};
|
|
16372
|
+
}
|
|
15456
16373
|
}
|
|
15457
16374
|
);
|
|
15458
16375
|
var create_element_type_default = CreateElementTypeTool;
|
|
@@ -15753,7 +16670,136 @@ var UpdateDocumentBlueprintTool = CreateUmbracoTool(
|
|
|
15753
16670
|
},
|
|
15754
16671
|
async (model) => {
|
|
15755
16672
|
const client = UmbracoManagementClient2.getClient();
|
|
15756
|
-
var response = await client.putDocumentBlueprintById(model.id, model.data);
|
|
16673
|
+
var response = await client.putDocumentBlueprintById(model.id, model.data);
|
|
16674
|
+
return {
|
|
16675
|
+
content: [
|
|
16676
|
+
{
|
|
16677
|
+
type: "text",
|
|
16678
|
+
text: JSON.stringify(response)
|
|
16679
|
+
}
|
|
16680
|
+
]
|
|
16681
|
+
};
|
|
16682
|
+
}
|
|
16683
|
+
);
|
|
16684
|
+
var update_blueprint_default = UpdateDocumentBlueprintTool;
|
|
16685
|
+
|
|
16686
|
+
// src/umb-management-api/tools/document-blueprint/post/create-blueprint.ts
|
|
16687
|
+
|
|
16688
|
+
var createDocumentBlueprintSchema = _zod.z.object({
|
|
16689
|
+
values: _zod.z.array(_zod.z.object({
|
|
16690
|
+
culture: _zod.z.string().nullish(),
|
|
16691
|
+
segment: _zod.z.string().nullish(),
|
|
16692
|
+
alias: _zod.z.string().min(1),
|
|
16693
|
+
value: _zod.z.any().nullish()
|
|
16694
|
+
})),
|
|
16695
|
+
variants: _zod.z.array(_zod.z.object({
|
|
16696
|
+
culture: _zod.z.string().nullish(),
|
|
16697
|
+
segment: _zod.z.string().nullish(),
|
|
16698
|
+
name: _zod.z.string().min(1)
|
|
16699
|
+
})),
|
|
16700
|
+
documentType: _zod.z.object({
|
|
16701
|
+
id: _zod.z.string().uuid()
|
|
16702
|
+
}),
|
|
16703
|
+
id: _zod.z.string().uuid().nullish(),
|
|
16704
|
+
parentId: _zod.z.string().uuid().optional()
|
|
16705
|
+
// Flattened parent ID
|
|
16706
|
+
});
|
|
16707
|
+
var CreateDocumentBlueprintTool = CreateUmbracoTool(
|
|
16708
|
+
"create-document-blueprint",
|
|
16709
|
+
`Creates a new document blueprint.`,
|
|
16710
|
+
createDocumentBlueprintSchema.shape,
|
|
16711
|
+
async (model) => {
|
|
16712
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16713
|
+
const payload = {
|
|
16714
|
+
values: model.values,
|
|
16715
|
+
variants: model.variants,
|
|
16716
|
+
documentType: model.documentType,
|
|
16717
|
+
id: model.id,
|
|
16718
|
+
parent: model.parentId ? { id: model.parentId } : void 0
|
|
16719
|
+
};
|
|
16720
|
+
const response = await client.postDocumentBlueprint(payload);
|
|
16721
|
+
return {
|
|
16722
|
+
content: [
|
|
16723
|
+
{
|
|
16724
|
+
type: "text",
|
|
16725
|
+
text: JSON.stringify(response)
|
|
16726
|
+
}
|
|
16727
|
+
]
|
|
16728
|
+
};
|
|
16729
|
+
},
|
|
16730
|
+
(user) => user.fallbackPermissions.includes("Umb.Document.CreateBlueprint")
|
|
16731
|
+
);
|
|
16732
|
+
var create_blueprint_default = CreateDocumentBlueprintTool;
|
|
16733
|
+
|
|
16734
|
+
// src/umb-management-api/tools/document-blueprint/get/get-ancestors.ts
|
|
16735
|
+
var GetDocumentBlueprintAncestorsTool = CreateUmbracoTool(
|
|
16736
|
+
"get-document-blueprint-ancestors",
|
|
16737
|
+
"Gets the ancestors of a document blueprint by Id",
|
|
16738
|
+
getTreeDocumentBlueprintAncestorsQueryParams.shape,
|
|
16739
|
+
async (params) => {
|
|
16740
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16741
|
+
var response = await client.getTreeDocumentBlueprintAncestors(params);
|
|
16742
|
+
return {
|
|
16743
|
+
content: [
|
|
16744
|
+
{
|
|
16745
|
+
type: "text",
|
|
16746
|
+
text: JSON.stringify(response)
|
|
16747
|
+
}
|
|
16748
|
+
]
|
|
16749
|
+
};
|
|
16750
|
+
}
|
|
16751
|
+
);
|
|
16752
|
+
var get_ancestors_default4 = GetDocumentBlueprintAncestorsTool;
|
|
16753
|
+
|
|
16754
|
+
// src/umb-management-api/tools/document-blueprint/get/get-children.ts
|
|
16755
|
+
var GetDocumentBlueprintChildrenTool = CreateUmbracoTool(
|
|
16756
|
+
"get-document-blueprint-children",
|
|
16757
|
+
"Gets the children of a document blueprint by Id",
|
|
16758
|
+
getTreeDocumentBlueprintChildrenQueryParams.shape,
|
|
16759
|
+
async (params) => {
|
|
16760
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16761
|
+
var response = await client.getTreeDocumentBlueprintChildren(params);
|
|
16762
|
+
return {
|
|
16763
|
+
content: [
|
|
16764
|
+
{
|
|
16765
|
+
type: "text",
|
|
16766
|
+
text: JSON.stringify(response)
|
|
16767
|
+
}
|
|
16768
|
+
]
|
|
16769
|
+
};
|
|
16770
|
+
}
|
|
16771
|
+
);
|
|
16772
|
+
var get_children_default4 = GetDocumentBlueprintChildrenTool;
|
|
16773
|
+
|
|
16774
|
+
// src/umb-management-api/tools/document-blueprint/get/get-root.ts
|
|
16775
|
+
var GetDocumentBlueprintRootTool = CreateUmbracoTool(
|
|
16776
|
+
"get-document-blueprint-root",
|
|
16777
|
+
"Gets the root level of the document blueprint tree",
|
|
16778
|
+
getTreeDocumentBlueprintRootQueryParams.shape,
|
|
16779
|
+
async (params) => {
|
|
16780
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16781
|
+
var response = await client.getTreeDocumentBlueprintRoot(params);
|
|
16782
|
+
return {
|
|
16783
|
+
content: [
|
|
16784
|
+
{
|
|
16785
|
+
type: "text",
|
|
16786
|
+
text: JSON.stringify(response)
|
|
16787
|
+
}
|
|
16788
|
+
]
|
|
16789
|
+
};
|
|
16790
|
+
}
|
|
16791
|
+
);
|
|
16792
|
+
var get_root_default4 = GetDocumentBlueprintRootTool;
|
|
16793
|
+
|
|
16794
|
+
// src/umb-management-api/tools/document-blueprint/get/get-document-blueprint-scaffold.ts
|
|
16795
|
+
var GetDocumentBlueprintScaffoldTool = CreateUmbracoTool(
|
|
16796
|
+
"get-document-blueprint-scaffold",
|
|
16797
|
+
`Get scaffold information for a document blueprint
|
|
16798
|
+
Use this to retrieve the scaffold structure and default values for a document blueprint, typically used when creating new documents from blueprints.`,
|
|
16799
|
+
getDocumentBlueprintByIdScaffoldParams.shape,
|
|
16800
|
+
async ({ id }) => {
|
|
16801
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16802
|
+
const response = await client.getDocumentBlueprintByIdScaffold(id);
|
|
15757
16803
|
return {
|
|
15758
16804
|
content: [
|
|
15759
16805
|
{
|
|
@@ -15764,16 +16810,33 @@ var UpdateDocumentBlueprintTool = CreateUmbracoTool(
|
|
|
15764
16810
|
};
|
|
15765
16811
|
}
|
|
15766
16812
|
);
|
|
15767
|
-
var
|
|
16813
|
+
var get_document_blueprint_scaffold_default = GetDocumentBlueprintScaffoldTool;
|
|
15768
16814
|
|
|
15769
|
-
// src/umb-management-api/tools/document-blueprint/post/create-blueprint.ts
|
|
15770
|
-
|
|
15771
|
-
|
|
15772
|
-
|
|
15773
|
-
|
|
16815
|
+
// src/umb-management-api/tools/document-blueprint/post/create-document-blueprint-from-document.ts
|
|
16816
|
+
|
|
16817
|
+
var createDocumentBlueprintFromDocumentSchema = _zod.z.object({
|
|
16818
|
+
document: _zod.z.object({
|
|
16819
|
+
id: _zod.z.string().uuid()
|
|
16820
|
+
}),
|
|
16821
|
+
id: _zod.z.string().uuid().optional(),
|
|
16822
|
+
name: _zod.z.string()
|
|
16823
|
+
});
|
|
16824
|
+
var CreateDocumentBlueprintFromDocumentTool = CreateUmbracoTool(
|
|
16825
|
+
"create-document-blueprint-from-document",
|
|
16826
|
+
`Create a new document blueprint from an existing document
|
|
16827
|
+
Use this to create a blueprint template based on an existing document, preserving its structure and content for reuse.
|
|
16828
|
+
|
|
16829
|
+
Note: Blueprints created from documents are always created at the root level. Use the move-document-blueprint tool to relocate them to folders after creation if needed.`,
|
|
16830
|
+
createDocumentBlueprintFromDocumentSchema.shape,
|
|
15774
16831
|
async (model) => {
|
|
15775
16832
|
const client = UmbracoManagementClient2.getClient();
|
|
15776
|
-
|
|
16833
|
+
const payload = {
|
|
16834
|
+
document: model.document,
|
|
16835
|
+
id: _nullishCoalesce(model.id, () => ( void 0)),
|
|
16836
|
+
name: model.name,
|
|
16837
|
+
parent: void 0
|
|
16838
|
+
};
|
|
16839
|
+
const response = await client.postDocumentBlueprintFromDocument(payload);
|
|
15777
16840
|
return {
|
|
15778
16841
|
content: [
|
|
15779
16842
|
{
|
|
@@ -15785,16 +16848,16 @@ var CreateDocumentBlueprintTool = CreateUmbracoTool(
|
|
|
15785
16848
|
},
|
|
15786
16849
|
(user) => user.fallbackPermissions.includes("Umb.Document.CreateBlueprint")
|
|
15787
16850
|
);
|
|
15788
|
-
var
|
|
16851
|
+
var create_document_blueprint_from_document_default = CreateDocumentBlueprintFromDocumentTool;
|
|
15789
16852
|
|
|
15790
|
-
// src/umb-management-api/tools/document-blueprint/get/get-
|
|
15791
|
-
var
|
|
15792
|
-
"get-document-blueprint-
|
|
15793
|
-
"Gets
|
|
15794
|
-
|
|
16853
|
+
// src/umb-management-api/tools/document-blueprint/get/get-document-blueprint-by-id-array.ts
|
|
16854
|
+
var GetDocumentBlueprintByIdArrayTool = CreateUmbracoTool(
|
|
16855
|
+
"get-document-blueprint-by-id-array",
|
|
16856
|
+
"Gets document blueprints by IDs (or empty array if no IDs are provided)",
|
|
16857
|
+
getItemDocumentBlueprintQueryParams.shape,
|
|
15795
16858
|
async (params) => {
|
|
15796
16859
|
const client = UmbracoManagementClient2.getClient();
|
|
15797
|
-
|
|
16860
|
+
const response = await client.getItemDocumentBlueprint(params);
|
|
15798
16861
|
return {
|
|
15799
16862
|
content: [
|
|
15800
16863
|
{
|
|
@@ -15805,16 +16868,23 @@ var GetDocumentBlueprintAncestorsTool = CreateUmbracoTool(
|
|
|
15805
16868
|
};
|
|
15806
16869
|
}
|
|
15807
16870
|
);
|
|
15808
|
-
var
|
|
16871
|
+
var get_document_blueprint_by_id_array_default = GetDocumentBlueprintByIdArrayTool;
|
|
15809
16872
|
|
|
15810
|
-
// src/umb-management-api/tools/document-blueprint/
|
|
15811
|
-
|
|
15812
|
-
|
|
15813
|
-
"
|
|
15814
|
-
|
|
15815
|
-
|
|
16873
|
+
// src/umb-management-api/tools/document-blueprint/put/move-blueprint.ts
|
|
16874
|
+
|
|
16875
|
+
var MoveDocumentBlueprintTool = CreateUmbracoTool(
|
|
16876
|
+
"move-document-blueprint",
|
|
16877
|
+
"Moves a document blueprint by Id",
|
|
16878
|
+
{
|
|
16879
|
+
id: putDocumentBlueprintByIdMoveParams.shape.id,
|
|
16880
|
+
data: _zod.z.object(putDocumentBlueprintByIdMoveBody.shape)
|
|
16881
|
+
},
|
|
16882
|
+
async (model) => {
|
|
15816
16883
|
const client = UmbracoManagementClient2.getClient();
|
|
15817
|
-
var response = await client.
|
|
16884
|
+
var response = await client.putDocumentBlueprintByIdMove(
|
|
16885
|
+
model.id,
|
|
16886
|
+
model.data
|
|
16887
|
+
);
|
|
15818
16888
|
return {
|
|
15819
16889
|
content: [
|
|
15820
16890
|
{
|
|
@@ -15825,16 +16895,16 @@ var GetDocumentBlueprintChildrenTool = CreateUmbracoTool(
|
|
|
15825
16895
|
};
|
|
15826
16896
|
}
|
|
15827
16897
|
);
|
|
15828
|
-
var
|
|
16898
|
+
var move_blueprint_default = MoveDocumentBlueprintTool;
|
|
15829
16899
|
|
|
15830
|
-
// src/umb-management-api/tools/document-blueprint/
|
|
15831
|
-
var
|
|
15832
|
-
"
|
|
15833
|
-
"
|
|
15834
|
-
|
|
15835
|
-
async (
|
|
16900
|
+
// src/umb-management-api/tools/document-blueprint/folders/post/create-folder.ts
|
|
16901
|
+
var CreateDocumentBlueprintFolderTool = CreateUmbracoTool(
|
|
16902
|
+
"create-document-blueprint-folder",
|
|
16903
|
+
"Creates a new document blueprint folder",
|
|
16904
|
+
postDocumentBlueprintFolderBody.shape,
|
|
16905
|
+
async (model) => {
|
|
15836
16906
|
const client = UmbracoManagementClient2.getClient();
|
|
15837
|
-
var response = await client.
|
|
16907
|
+
var response = await client.postDocumentBlueprintFolder(model);
|
|
15838
16908
|
return {
|
|
15839
16909
|
content: [
|
|
15840
16910
|
{
|
|
@@ -15845,17 +16915,16 @@ var GetDocumentBlueprintRootTool = CreateUmbracoTool(
|
|
|
15845
16915
|
};
|
|
15846
16916
|
}
|
|
15847
16917
|
);
|
|
15848
|
-
var
|
|
16918
|
+
var create_folder_default3 = CreateDocumentBlueprintFolderTool;
|
|
15849
16919
|
|
|
15850
|
-
// src/umb-management-api/tools/document-blueprint/get/get-
|
|
15851
|
-
var
|
|
15852
|
-
"get-document-blueprint-
|
|
15853
|
-
|
|
15854
|
-
|
|
15855
|
-
getDocumentBlueprintByIdScaffoldParams.shape,
|
|
16920
|
+
// src/umb-management-api/tools/document-blueprint/folders/get/get-folder.ts
|
|
16921
|
+
var GetDocumentBlueprintFolderTool = CreateUmbracoTool(
|
|
16922
|
+
"get-document-blueprint-folder",
|
|
16923
|
+
"Gets a document blueprint folder by Id",
|
|
16924
|
+
getDocumentBlueprintFolderByIdParams.shape,
|
|
15856
16925
|
async ({ id }) => {
|
|
15857
16926
|
const client = UmbracoManagementClient2.getClient();
|
|
15858
|
-
|
|
16927
|
+
var response = await client.getDocumentBlueprintFolderById(id);
|
|
15859
16928
|
return {
|
|
15860
16929
|
content: [
|
|
15861
16930
|
{
|
|
@@ -15866,17 +16935,20 @@ var GetDocumentBlueprintScaffoldTool = CreateUmbracoTool(
|
|
|
15866
16935
|
};
|
|
15867
16936
|
}
|
|
15868
16937
|
);
|
|
15869
|
-
var
|
|
16938
|
+
var get_folder_default3 = GetDocumentBlueprintFolderTool;
|
|
15870
16939
|
|
|
15871
|
-
// src/umb-management-api/tools/document-blueprint/
|
|
15872
|
-
|
|
15873
|
-
|
|
15874
|
-
|
|
15875
|
-
|
|
15876
|
-
|
|
15877
|
-
|
|
16940
|
+
// src/umb-management-api/tools/document-blueprint/folders/put/update-folder.ts
|
|
16941
|
+
|
|
16942
|
+
var UpdateDocumentBlueprintFolderTool = CreateUmbracoTool(
|
|
16943
|
+
"update-document-blueprint-folder",
|
|
16944
|
+
"Updates a document blueprint folder",
|
|
16945
|
+
{
|
|
16946
|
+
id: putDocumentBlueprintFolderByIdParams.shape.id,
|
|
16947
|
+
data: _zod.z.object(putDocumentBlueprintFolderByIdBody.shape)
|
|
16948
|
+
},
|
|
16949
|
+
async ({ id, data }) => {
|
|
15878
16950
|
const client = UmbracoManagementClient2.getClient();
|
|
15879
|
-
const response = await client.
|
|
16951
|
+
const response = await client.putDocumentBlueprintFolderById(id, data);
|
|
15880
16952
|
return {
|
|
15881
16953
|
content: [
|
|
15882
16954
|
{
|
|
@@ -15885,10 +16957,29 @@ var CreateDocumentBlueprintFromDocumentTool = CreateUmbracoTool(
|
|
|
15885
16957
|
}
|
|
15886
16958
|
]
|
|
15887
16959
|
};
|
|
15888
|
-
}
|
|
15889
|
-
(user) => user.fallbackPermissions.includes("Umb.Document.CreateBlueprint")
|
|
16960
|
+
}
|
|
15890
16961
|
);
|
|
15891
|
-
var
|
|
16962
|
+
var update_folder_default3 = UpdateDocumentBlueprintFolderTool;
|
|
16963
|
+
|
|
16964
|
+
// src/umb-management-api/tools/document-blueprint/folders/delete/delete-folder.ts
|
|
16965
|
+
var DeleteDocumentBlueprintFolderTool = CreateUmbracoTool(
|
|
16966
|
+
"delete-document-blueprint-folder",
|
|
16967
|
+
"Deletes a document blueprint folder by Id",
|
|
16968
|
+
deleteDocumentBlueprintFolderByIdParams.shape,
|
|
16969
|
+
async ({ id }) => {
|
|
16970
|
+
const client = UmbracoManagementClient2.getClient();
|
|
16971
|
+
var response = await client.deleteDocumentBlueprintFolderById(id);
|
|
16972
|
+
return {
|
|
16973
|
+
content: [
|
|
16974
|
+
{
|
|
16975
|
+
type: "text",
|
|
16976
|
+
text: JSON.stringify(response)
|
|
16977
|
+
}
|
|
16978
|
+
]
|
|
16979
|
+
};
|
|
16980
|
+
}
|
|
16981
|
+
);
|
|
16982
|
+
var delete_folder_default3 = DeleteDocumentBlueprintFolderTool;
|
|
15892
16983
|
|
|
15893
16984
|
// src/umb-management-api/tools/document-blueprint/index.ts
|
|
15894
16985
|
var DocumentBlueprintCollection = {
|
|
@@ -15902,14 +16993,20 @@ var DocumentBlueprintCollection = {
|
|
|
15902
16993
|
const tools = [];
|
|
15903
16994
|
if (AuthorizationPolicies.TreeAccessDocumentTypes(user)) {
|
|
15904
16995
|
tools.push(get_blueprint_default());
|
|
15905
|
-
tools.push(delete_blueprint_default());
|
|
15906
|
-
tools.push(update_blueprint_default());
|
|
15907
16996
|
tools.push(create_blueprint_default());
|
|
16997
|
+
tools.push(update_blueprint_default());
|
|
16998
|
+
tools.push(delete_blueprint_default());
|
|
16999
|
+
tools.push(move_blueprint_default());
|
|
17000
|
+
tools.push(get_document_blueprint_by_id_array_default());
|
|
17001
|
+
tools.push(get_document_blueprint_scaffold_default());
|
|
17002
|
+
tools.push(create_document_blueprint_from_document_default());
|
|
15908
17003
|
tools.push(get_ancestors_default4());
|
|
15909
17004
|
tools.push(get_children_default4());
|
|
15910
17005
|
tools.push(get_root_default4());
|
|
15911
|
-
tools.push(
|
|
15912
|
-
tools.push(
|
|
17006
|
+
tools.push(create_folder_default3());
|
|
17007
|
+
tools.push(get_folder_default3());
|
|
17008
|
+
tools.push(update_folder_default3());
|
|
17009
|
+
tools.push(delete_folder_default3());
|
|
15913
17010
|
}
|
|
15914
17011
|
return tools;
|
|
15915
17012
|
}
|
|
@@ -16159,11 +17256,507 @@ var GetDocumentUrlsTool = CreateUmbracoTool(
|
|
|
16159
17256
|
type: "text",
|
|
16160
17257
|
text: JSON.stringify(response)
|
|
16161
17258
|
}
|
|
16162
|
-
]
|
|
16163
|
-
};
|
|
17259
|
+
]
|
|
17260
|
+
};
|
|
17261
|
+
}
|
|
17262
|
+
);
|
|
17263
|
+
var get_document_urls_default = GetDocumentUrlsTool;
|
|
17264
|
+
|
|
17265
|
+
// src/umb-management-api/tools/document/get/get-document-property-value-template.ts
|
|
17266
|
+
|
|
17267
|
+
|
|
17268
|
+
// src/umb-management-api/tools/document/post/property-value-templates.ts
|
|
17269
|
+
var propertyValueTemplates = {
|
|
17270
|
+
"BlockList": {
|
|
17271
|
+
editorAlias: "Umbraco.BlockList",
|
|
17272
|
+
value: {
|
|
17273
|
+
layout: {
|
|
17274
|
+
"Umbraco.BlockList": [
|
|
17275
|
+
{
|
|
17276
|
+
contentKey: "7a61b31c-792f-4f6b-a665-960a90b49853"
|
|
17277
|
+
}
|
|
17278
|
+
]
|
|
17279
|
+
},
|
|
17280
|
+
contentData: [
|
|
17281
|
+
{
|
|
17282
|
+
key: "7a61b31c-792f-4f6b-a665-960a90b49853",
|
|
17283
|
+
contentTypeKey: "3a7ec32d-7fd4-49f8-aae6-d9259d5bfee1",
|
|
17284
|
+
values: [
|
|
17285
|
+
{
|
|
17286
|
+
editorAlias: "Umbraco.MediaPicker3",
|
|
17287
|
+
culture: null,
|
|
17288
|
+
segment: null,
|
|
17289
|
+
alias: "recipeImage",
|
|
17290
|
+
value: [
|
|
17291
|
+
{
|
|
17292
|
+
key: "9bac772d-cd63-4bb6-b2db-1449042129a7",
|
|
17293
|
+
mediaKey: "3c6c415c-35a0-4629-891e-683506250c31",
|
|
17294
|
+
mediaTypeAlias: "",
|
|
17295
|
+
crops: [],
|
|
17296
|
+
focalPoint: null
|
|
17297
|
+
}
|
|
17298
|
+
]
|
|
17299
|
+
}
|
|
17300
|
+
]
|
|
17301
|
+
}
|
|
17302
|
+
],
|
|
17303
|
+
settingsData: [],
|
|
17304
|
+
expose: [
|
|
17305
|
+
{
|
|
17306
|
+
contentKey: "7a61b31c-792f-4f6b-a665-960a90b49853",
|
|
17307
|
+
culture: null,
|
|
17308
|
+
segment: null
|
|
17309
|
+
}
|
|
17310
|
+
]
|
|
17311
|
+
},
|
|
17312
|
+
_notes: "Complex structure with layout, contentData, settingsData, and expose arrays. contentData.values contains nested property values. All keys must be unique UUIDs."
|
|
17313
|
+
},
|
|
17314
|
+
"BlockGrid": {
|
|
17315
|
+
editorAlias: "Umbraco.BlockGrid",
|
|
17316
|
+
value: {
|
|
17317
|
+
layout: {
|
|
17318
|
+
"Umbraco.BlockGrid": [
|
|
17319
|
+
{
|
|
17320
|
+
contentKey: "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
17321
|
+
columnSpan: 12,
|
|
17322
|
+
rowSpan: 1,
|
|
17323
|
+
areas: [
|
|
17324
|
+
{
|
|
17325
|
+
key: "43743e78-0f2b-465e-a3ce-f381c90b68e0",
|
|
17326
|
+
items: [
|
|
17327
|
+
{
|
|
17328
|
+
contentKey: "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
17329
|
+
settingsKey: "6248d134-4657-4605-b0d5-ae804858bb88",
|
|
17330
|
+
columnSpan: 6,
|
|
17331
|
+
rowSpan: 1
|
|
17332
|
+
}
|
|
17333
|
+
]
|
|
17334
|
+
}
|
|
17335
|
+
]
|
|
17336
|
+
}
|
|
17337
|
+
]
|
|
17338
|
+
},
|
|
17339
|
+
contentData: [
|
|
17340
|
+
{
|
|
17341
|
+
key: "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
17342
|
+
contentTypeKey: "6960aaca-0b26-4fae-9cee-db73405d7a3e",
|
|
17343
|
+
values: [
|
|
17344
|
+
{
|
|
17345
|
+
editorAlias: "Umbraco.TextBox",
|
|
17346
|
+
culture: null,
|
|
17347
|
+
segment: null,
|
|
17348
|
+
alias: "title",
|
|
17349
|
+
value: "Title"
|
|
17350
|
+
},
|
|
17351
|
+
{
|
|
17352
|
+
editorAlias: "Umbraco.RichText",
|
|
17353
|
+
culture: null,
|
|
17354
|
+
segment: null,
|
|
17355
|
+
alias: "bodyText",
|
|
17356
|
+
value: {
|
|
17357
|
+
markup: "<p>Content here</p>",
|
|
17358
|
+
blocks: {
|
|
17359
|
+
layout: {},
|
|
17360
|
+
contentData: [],
|
|
17361
|
+
settingsData: [],
|
|
17362
|
+
expose: []
|
|
17363
|
+
}
|
|
17364
|
+
}
|
|
17365
|
+
},
|
|
17366
|
+
{
|
|
17367
|
+
editorAlias: "Umbraco.MediaPicker3",
|
|
17368
|
+
culture: null,
|
|
17369
|
+
segment: null,
|
|
17370
|
+
alias: "image",
|
|
17371
|
+
value: [
|
|
17372
|
+
{
|
|
17373
|
+
key: "40edd153-31eb-4c61-82fc-1ec2e695197b",
|
|
17374
|
+
mediaKey: "3c6c415c-35a0-4629-891e-683506250c31",
|
|
17375
|
+
mediaTypeAlias: "",
|
|
17376
|
+
crops: [],
|
|
17377
|
+
focalPoint: null
|
|
17378
|
+
}
|
|
17379
|
+
]
|
|
17380
|
+
}
|
|
17381
|
+
]
|
|
17382
|
+
},
|
|
17383
|
+
{
|
|
17384
|
+
key: "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
17385
|
+
contentTypeKey: "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
17386
|
+
values: [
|
|
17387
|
+
{
|
|
17388
|
+
editorAlias: "Umbraco.TextBox",
|
|
17389
|
+
culture: null,
|
|
17390
|
+
segment: null,
|
|
17391
|
+
alias: "title",
|
|
17392
|
+
value: "Nested Title"
|
|
17393
|
+
},
|
|
17394
|
+
{
|
|
17395
|
+
editorAlias: "Umbraco.RichText",
|
|
17396
|
+
culture: null,
|
|
17397
|
+
segment: null,
|
|
17398
|
+
alias: "content",
|
|
17399
|
+
value: {
|
|
17400
|
+
markup: "<p>Nested content</p>",
|
|
17401
|
+
blocks: {
|
|
17402
|
+
layout: {},
|
|
17403
|
+
contentData: [],
|
|
17404
|
+
settingsData: [],
|
|
17405
|
+
expose: []
|
|
17406
|
+
}
|
|
17407
|
+
}
|
|
17408
|
+
}
|
|
17409
|
+
]
|
|
17410
|
+
}
|
|
17411
|
+
],
|
|
17412
|
+
settingsData: [
|
|
17413
|
+
{
|
|
17414
|
+
key: "6248d134-4657-4605-b0d5-ae804858bb88",
|
|
17415
|
+
contentTypeKey: "06200e23-1c29-4298-9582-48b2eaa81fbf",
|
|
17416
|
+
values: []
|
|
17417
|
+
}
|
|
17418
|
+
],
|
|
17419
|
+
expose: [
|
|
17420
|
+
{
|
|
17421
|
+
contentKey: "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
17422
|
+
culture: null,
|
|
17423
|
+
segment: null
|
|
17424
|
+
},
|
|
17425
|
+
{
|
|
17426
|
+
contentKey: "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
17427
|
+
culture: null,
|
|
17428
|
+
segment: null
|
|
17429
|
+
}
|
|
17430
|
+
]
|
|
17431
|
+
},
|
|
17432
|
+
_notes: "Complex hierarchical structure with areas and nested items. Layout defines structure with columnSpan/rowSpan. contentData stores actual content. All keys must be unique UUIDs."
|
|
17433
|
+
},
|
|
17434
|
+
"Decimal": {
|
|
17435
|
+
editorAlias: "Umbraco.Decimal",
|
|
17436
|
+
value: 1.2
|
|
17437
|
+
},
|
|
17438
|
+
"EmailAddress": {
|
|
17439
|
+
editorAlias: "Umbraco.EmailAddress",
|
|
17440
|
+
value: "admin@admin.co.uk"
|
|
17441
|
+
},
|
|
17442
|
+
"Integer": {
|
|
17443
|
+
editorAlias: "Umbraco.Integer",
|
|
17444
|
+
value: 1
|
|
17445
|
+
},
|
|
17446
|
+
"Tags": {
|
|
17447
|
+
editorAlias: "Umbraco.Tags",
|
|
17448
|
+
value: [
|
|
17449
|
+
"Tag 1",
|
|
17450
|
+
"Tag 2"
|
|
17451
|
+
]
|
|
17452
|
+
},
|
|
17453
|
+
"ColorPicker": {
|
|
17454
|
+
editorAlias: "Umbraco.ColorPicker",
|
|
17455
|
+
value: {
|
|
17456
|
+
label: "Green",
|
|
17457
|
+
value: "#00FF00"
|
|
17458
|
+
}
|
|
17459
|
+
},
|
|
17460
|
+
"TrueFalse": {
|
|
17461
|
+
editorAlias: "Umbraco.TrueFalse",
|
|
17462
|
+
value: true
|
|
17463
|
+
},
|
|
17464
|
+
"CheckBoxList": {
|
|
17465
|
+
editorAlias: "Umbraco.CheckBoxList",
|
|
17466
|
+
value: [
|
|
17467
|
+
"item 1",
|
|
17468
|
+
"items 2"
|
|
17469
|
+
]
|
|
17470
|
+
},
|
|
17471
|
+
"Dropdown": {
|
|
17472
|
+
editorAlias: "Umbraco.DropDown.Flexible",
|
|
17473
|
+
value: [
|
|
17474
|
+
"Item 3"
|
|
17475
|
+
]
|
|
17476
|
+
},
|
|
17477
|
+
"MultipleTextstring": {
|
|
17478
|
+
editorAlias: "Umbraco.MultipleTextstring",
|
|
17479
|
+
value: [
|
|
17480
|
+
"Item 1",
|
|
17481
|
+
"item 2"
|
|
17482
|
+
]
|
|
17483
|
+
},
|
|
17484
|
+
"RadioButtonList": {
|
|
17485
|
+
editorAlias: "Umbraco.RadioButtonList",
|
|
17486
|
+
value: "item 1"
|
|
17487
|
+
},
|
|
17488
|
+
"ImageCropper": {
|
|
17489
|
+
editorAlias: "Umbraco.ImageCropper",
|
|
17490
|
+
value: {
|
|
17491
|
+
temporaryFileId: "b45eb1dd-2959-4b0b-a675-761b6a19824c",
|
|
17492
|
+
src: "",
|
|
17493
|
+
crops: [],
|
|
17494
|
+
focalPoint: {
|
|
17495
|
+
left: 0.5,
|
|
17496
|
+
top: 0.5
|
|
17497
|
+
}
|
|
17498
|
+
},
|
|
17499
|
+
_notes: "IMPORTANT: Requires a temporary file uploaded first. Use the temporaryFileId from the upload response."
|
|
17500
|
+
},
|
|
17501
|
+
"MediaPicker3": {
|
|
17502
|
+
editorAlias: "Umbraco.MediaPicker3",
|
|
17503
|
+
value: [
|
|
17504
|
+
{
|
|
17505
|
+
key: "4c82123c-cd3e-4d92-84b8-9c79ad5a5319",
|
|
17506
|
+
mediaKey: "3c6c415c-35a0-4629-891e-683506250c31",
|
|
17507
|
+
mediaTypeAlias: "",
|
|
17508
|
+
crops: [],
|
|
17509
|
+
focalPoint: null
|
|
17510
|
+
}
|
|
17511
|
+
],
|
|
17512
|
+
_notes: "The key is generated by you. The mediaKey relates to an existing media item id."
|
|
17513
|
+
},
|
|
17514
|
+
"UploadField": {
|
|
17515
|
+
editorAlias: "Umbraco.UploadField",
|
|
17516
|
+
value: {
|
|
17517
|
+
src: "blob:http://localhost:56472/0884388b-41a3-46c2-a224-9b9ff02de24a",
|
|
17518
|
+
temporaryFileId: "fc76f270-83c2-4daa-ba8b-fde4554dda2a"
|
|
17519
|
+
},
|
|
17520
|
+
_notes: "IMPORTANT: Requires a temporary file uploaded first. Use the temporaryFileId from the upload response."
|
|
17521
|
+
},
|
|
17522
|
+
"Slider": {
|
|
17523
|
+
editorAlias: "Umbraco.Slider",
|
|
17524
|
+
value: {
|
|
17525
|
+
from: 31,
|
|
17526
|
+
to: 31
|
|
17527
|
+
}
|
|
17528
|
+
},
|
|
17529
|
+
"MemberGroupPicker": {
|
|
17530
|
+
editorAlias: "Umbraco.MemberGroupPicker",
|
|
17531
|
+
value: "9815503d-a5a9-487f-aee3-827ca43fdb2c",
|
|
17532
|
+
_notes: "The value relates to an existing member group id."
|
|
17533
|
+
},
|
|
17534
|
+
"MemberPicker": {
|
|
17535
|
+
editorAlias: "Umbraco.MemberPicker",
|
|
17536
|
+
value: "f8abd31e-c78d-46ea-bb6b-c00cb9107bfb",
|
|
17537
|
+
_notes: "The value relates to an existing member id."
|
|
17538
|
+
},
|
|
17539
|
+
"UserPicker": {
|
|
17540
|
+
editorAlias: "Umbraco.UserPicker",
|
|
17541
|
+
value: "1e70f841-c261-413b-abb2-2d68cdb96094",
|
|
17542
|
+
_notes: "The value relates to an existing user id."
|
|
17543
|
+
},
|
|
17544
|
+
"MultiNodeTreePicker": {
|
|
17545
|
+
editorAlias: "Umbraco.MultiNodeTreePicker",
|
|
17546
|
+
value: [
|
|
17547
|
+
{
|
|
17548
|
+
type: "document",
|
|
17549
|
+
unique: "dcf18a51-6919-4cf8-89d1-36b94ce4d963"
|
|
17550
|
+
}
|
|
17551
|
+
],
|
|
17552
|
+
_notes: "The unique property relates to an existing document, media, or member id. Type can be 'document', 'media', or 'member'."
|
|
17553
|
+
},
|
|
17554
|
+
"DateTime": {
|
|
17555
|
+
editorAlias: "Umbraco.DateTime",
|
|
17556
|
+
value: "2025-05-23 00:00:00"
|
|
17557
|
+
},
|
|
17558
|
+
"ContentPicker": {
|
|
17559
|
+
editorAlias: "Umbraco.ContentPicker",
|
|
17560
|
+
value: "dcf18a51-6919-4cf8-89d1-36b94ce4d963",
|
|
17561
|
+
_notes: "The value relates to an existing document id."
|
|
17562
|
+
},
|
|
17563
|
+
"ColorPickerEyeDropper": {
|
|
17564
|
+
editorAlias: "Umbraco.ColorPicker.EyeDropper",
|
|
17565
|
+
value: "#982020"
|
|
17566
|
+
},
|
|
17567
|
+
"MultiUrlPicker": {
|
|
17568
|
+
editorAlias: "Umbraco.MultiUrlPicker",
|
|
17569
|
+
value: [
|
|
17570
|
+
{
|
|
17571
|
+
icon: "icon-home color-blue",
|
|
17572
|
+
name: "Home",
|
|
17573
|
+
type: "document",
|
|
17574
|
+
unique: "dcf18a51-6919-4cf8-89d1-36b94ce4d963",
|
|
17575
|
+
url: "/"
|
|
17576
|
+
},
|
|
17577
|
+
{
|
|
17578
|
+
icon: "icon-picture",
|
|
17579
|
+
name: "Chairs lamps",
|
|
17580
|
+
type: "media",
|
|
17581
|
+
unique: "3c6c415c-35a0-4629-891e-683506250c31",
|
|
17582
|
+
url: "http://localhost:56472/media/0ofdvcwj/chairs-lamps.jpg"
|
|
17583
|
+
},
|
|
17584
|
+
{
|
|
17585
|
+
name: "Title",
|
|
17586
|
+
target: "_blank",
|
|
17587
|
+
type: "external",
|
|
17588
|
+
url: "www.google.com"
|
|
17589
|
+
}
|
|
17590
|
+
],
|
|
17591
|
+
_notes: "Can contain document, media, or external link entries. For document/media, unique is the content id."
|
|
17592
|
+
},
|
|
17593
|
+
"MarkdownEditor": {
|
|
17594
|
+
editorAlias: "Umbraco.MarkdownEditor",
|
|
17595
|
+
value: "Markdown"
|
|
17596
|
+
},
|
|
17597
|
+
"CodeEditor": {
|
|
17598
|
+
editorAlias: "Umbraco.CodeEditor",
|
|
17599
|
+
value: "Code"
|
|
17600
|
+
},
|
|
17601
|
+
"Textbox": {
|
|
17602
|
+
editorAlias: "Umbraco.TextBox",
|
|
17603
|
+
value: "some string"
|
|
17604
|
+
},
|
|
17605
|
+
"TextArea": {
|
|
17606
|
+
editorAlias: "Umbraco.TextArea",
|
|
17607
|
+
value: "some string"
|
|
17608
|
+
},
|
|
17609
|
+
"RichTextEditor": {
|
|
17610
|
+
editorAlias: "Umbraco.RichText",
|
|
17611
|
+
value: {
|
|
17612
|
+
markup: "<p>some string</p>",
|
|
17613
|
+
blocks: {
|
|
17614
|
+
layout: {},
|
|
17615
|
+
contentData: [],
|
|
17616
|
+
settingsData: [],
|
|
17617
|
+
expose: []
|
|
17618
|
+
}
|
|
17619
|
+
},
|
|
17620
|
+
_notes: "The blocks property has the same structure as BlockList. Can include nested block content within the rich text."
|
|
17621
|
+
}
|
|
17622
|
+
};
|
|
17623
|
+
|
|
17624
|
+
// src/umb-management-api/tools/document/get/get-document-property-value-template.ts
|
|
17625
|
+
var propertyValueTemplateSchema = _zod.z.object({
|
|
17626
|
+
editorAlias: _zod.z.string().optional().describe("The editor alias of the property value template to retrieve (e.g., 'Umbraco.TextBox', 'Umbraco.BlockList', 'Umbraco.MediaPicker3'). If not provided, returns a list of all available property editor aliases.")
|
|
17627
|
+
});
|
|
17628
|
+
var GetDocumentPropertyValueTemplateTool = CreateUmbracoTool(
|
|
17629
|
+
"get-document-property-value-template",
|
|
17630
|
+
`Retrieves property value templates for creating documents in Umbraco.
|
|
17631
|
+
|
|
17632
|
+
IMPORTANT: This tool should be used BEFORE creating documents to understand:
|
|
17633
|
+
- What property editors are available
|
|
17634
|
+
- The required value structure for each property editor
|
|
17635
|
+
- Example values that can be customized for your needs
|
|
17636
|
+
|
|
17637
|
+
Usage:
|
|
17638
|
+
1. Call without parameters to see all available property editor aliases
|
|
17639
|
+
2. Call with a specific editorAlias to get the full value template for that property editor
|
|
17640
|
+
3. Use the returned template as a starting point when creating document property values with create-document
|
|
17641
|
+
|
|
17642
|
+
The templates include:
|
|
17643
|
+
- editorAlias: The property editor identifier (required in create-document values array)
|
|
17644
|
+
- value: Example value structure showing the expected format
|
|
17645
|
+
- _notes: Important information about special requirements (IDs, temporary files, etc.)
|
|
17646
|
+
|
|
17647
|
+
IMPORTANT: Templates only provide editorAlias and value structure. When using with create-document, you must also provide:
|
|
17648
|
+
- culture: The culture code or null
|
|
17649
|
+
- segment: The segment or null
|
|
17650
|
+
- alias: The property alias from your document type
|
|
17651
|
+
|
|
17652
|
+
Note: Some templates (BlockList, BlockGrid, ImageCropper, UploadField) have special requirements indicated in their _notes.`,
|
|
17653
|
+
propertyValueTemplateSchema.shape,
|
|
17654
|
+
async (model) => {
|
|
17655
|
+
try {
|
|
17656
|
+
if (!model.editorAlias) {
|
|
17657
|
+
const availableEditors = Object.entries(propertyValueTemplates).map(([name, config]) => {
|
|
17658
|
+
const hasNotes = config._notes ? ` (IMPORTANT: ${config._notes.substring(0, 50)}${config._notes.length > 50 ? "..." : ""})` : "";
|
|
17659
|
+
return `- ${name} (${config.editorAlias})${hasNotes}`;
|
|
17660
|
+
}).sort().join("\n");
|
|
17661
|
+
return {
|
|
17662
|
+
content: [
|
|
17663
|
+
{
|
|
17664
|
+
type: "text",
|
|
17665
|
+
text: `Available Property Value Templates:
|
|
17666
|
+
|
|
17667
|
+
${availableEditors}
|
|
17668
|
+
|
|
17669
|
+
Use get-document-property-value-template with a specific editorAlias to see the full value structure.`
|
|
17670
|
+
}
|
|
17671
|
+
]
|
|
17672
|
+
};
|
|
17673
|
+
}
|
|
17674
|
+
const editorKey = Object.keys(propertyValueTemplates).find(
|
|
17675
|
+
(key) => propertyValueTemplates[key].editorAlias.toLowerCase() === model.editorAlias.toLowerCase()
|
|
17676
|
+
);
|
|
17677
|
+
if (!editorKey) {
|
|
17678
|
+
const editorKeyByName = Object.keys(propertyValueTemplates).find(
|
|
17679
|
+
(key) => key.toLowerCase() === model.editorAlias.toLowerCase()
|
|
17680
|
+
);
|
|
17681
|
+
if (!editorKeyByName) {
|
|
17682
|
+
const availableAliases = Object.values(propertyValueTemplates).map((t) => t.editorAlias).sort().join(", ");
|
|
17683
|
+
return {
|
|
17684
|
+
content: [
|
|
17685
|
+
{
|
|
17686
|
+
type: "text",
|
|
17687
|
+
text: `Property value template with editorAlias '${model.editorAlias}' not found.
|
|
17688
|
+
|
|
17689
|
+
Available editor aliases: ${availableAliases}
|
|
17690
|
+
|
|
17691
|
+
Note: Matching is case-insensitive. You can also use the template name (e.g., 'Textbox' instead of 'Umbraco.TextBox').`
|
|
17692
|
+
}
|
|
17693
|
+
],
|
|
17694
|
+
isError: true
|
|
17695
|
+
};
|
|
17696
|
+
}
|
|
17697
|
+
const template2 = propertyValueTemplates[editorKeyByName];
|
|
17698
|
+
return buildTemplateResponse(editorKeyByName, template2);
|
|
17699
|
+
}
|
|
17700
|
+
const template = propertyValueTemplates[editorKey];
|
|
17701
|
+
return buildTemplateResponse(editorKey, template);
|
|
17702
|
+
} catch (error) {
|
|
17703
|
+
console.error("Error reading property value templates:", error);
|
|
17704
|
+
return {
|
|
17705
|
+
content: [
|
|
17706
|
+
{
|
|
17707
|
+
type: "text",
|
|
17708
|
+
text: `Error reading property value templates: ${error instanceof Error ? error.message : String(error)}`
|
|
17709
|
+
}
|
|
17710
|
+
],
|
|
17711
|
+
isError: true
|
|
17712
|
+
};
|
|
17713
|
+
}
|
|
16164
17714
|
}
|
|
16165
17715
|
);
|
|
16166
|
-
|
|
17716
|
+
function buildTemplateResponse(editorKey, template) {
|
|
17717
|
+
let response = `Property Value Template: ${editorKey}
|
|
17718
|
+
|
|
17719
|
+
`;
|
|
17720
|
+
if (template._notes) {
|
|
17721
|
+
response += `IMPORTANT NOTES:
|
|
17722
|
+
${template._notes}
|
|
17723
|
+
|
|
17724
|
+
`;
|
|
17725
|
+
}
|
|
17726
|
+
response += `Template:
|
|
17727
|
+
${JSON.stringify({ editorAlias: template.editorAlias, value: template.value }, null, 2)}
|
|
17728
|
+
|
|
17729
|
+
`;
|
|
17730
|
+
response += `Usage with create-document:
|
|
17731
|
+
`;
|
|
17732
|
+
response += `When creating a document with this property, include in the values array:
|
|
17733
|
+
`;
|
|
17734
|
+
response += `{
|
|
17735
|
+
`;
|
|
17736
|
+
response += ` "editorAlias": "${template.editorAlias}", // From template
|
|
17737
|
+
`;
|
|
17738
|
+
response += ` "culture": null, // Document-specific: culture code or null
|
|
17739
|
+
`;
|
|
17740
|
+
response += ` "segment": null, // Document-specific: segment or null
|
|
17741
|
+
`;
|
|
17742
|
+
response += ` "alias": "yourPropertyAlias", // Document-specific: property alias from document type
|
|
17743
|
+
`;
|
|
17744
|
+
response += ` "value": <customize from template> // From template - customize as needed
|
|
17745
|
+
`;
|
|
17746
|
+
response += `}
|
|
17747
|
+
|
|
17748
|
+
`;
|
|
17749
|
+
response += `The template provides editorAlias and value structure. You must add culture, segment, and alias based on your document requirements.`;
|
|
17750
|
+
return {
|
|
17751
|
+
content: [
|
|
17752
|
+
{
|
|
17753
|
+
type: "text",
|
|
17754
|
+
text: response
|
|
17755
|
+
}
|
|
17756
|
+
]
|
|
17757
|
+
};
|
|
17758
|
+
}
|
|
17759
|
+
var get_document_property_value_template_default = GetDocumentPropertyValueTemplateTool;
|
|
16167
17760
|
|
|
16168
17761
|
// src/umb-management-api/tools/document/get/search-document.ts
|
|
16169
17762
|
var SearchDocumentTool = CreateUmbracoTool(
|
|
@@ -16458,608 +18051,75 @@ var CreateDocumentTool = CreateUmbracoTool(
|
|
|
16458
18051
|
"create-document",
|
|
16459
18052
|
`Creates a document with support for multiple cultures.
|
|
16460
18053
|
|
|
16461
|
-
|
|
16462
|
-
If cultures parameter is not provided or is an empty array, will create a single variant with null culture (original behavior).
|
|
16463
|
-
|
|
16464
|
-
Always follow these requirements when creating documents exactly, do not deviate in any way.
|
|
16465
|
-
|
|
16466
|
-
## CRITICAL WORKFLOW REQUIREMENTS
|
|
16467
|
-
1. ALWAYS first search for existing documents using search-document to find any documents that use the same document type
|
|
16468
|
-
2. If documents of the same type exist, use copy-document instead to duplicate and modify the existing structure
|
|
16469
|
-
3. ONLY if NO documents of the target document type exist should you analyze the document type structure
|
|
16470
|
-
4. When analyzing document types, use get-document-type-by-id to understand the required properties
|
|
16471
|
-
5. Then create the new document with the proper structure
|
|
16472
|
-
|
|
16473
|
-
## CRITICAL FOR DOCUMENT TYPES AND DATA TYPES
|
|
16474
|
-
1. BEFORE creating any new document type or data type, ALWAYS search for existing ones using get-document-type-root, get-document-type-search, or find-data-type
|
|
16475
|
-
2. ONLY create a new document type or data type if NO suitable existing ones are found
|
|
16476
|
-
3. If similar types exist, inform the user and suggest using the existing types instead
|
|
16477
|
-
4. Creation of new types should be a last resort when nothing suitable exists
|
|
16478
|
-
|
|
16479
|
-
## CRITICAL: For document types with allowedAsRoot=true, DO NOT include the parentId parameter at all in the function call.
|
|
16480
|
-
|
|
16481
|
-
Values must match the aliases of the document type structure.
|
|
16482
|
-
Block lists, Block Grids and Rich Text Blocks items and settings must match the defined blocks document type structures.
|
|
16483
|
-
|
|
16484
|
-
## CRITICAL: All generated keys must be unique and randomly generated.
|
|
16485
|
-
|
|
16486
|
-
## Property Editor Value Examples
|
|
16487
|
-
|
|
16488
|
-
### Block List
|
|
16489
|
-
|
|
16490
|
-
layout stores references to content and settings keys
|
|
16491
|
-
contentData stores the content of the block list as an array of content items
|
|
16492
|
-
settingsData stores the settings of the block list as an array of settings items
|
|
16493
|
-
expose stores the segment and culture variants of the block list as an array of expose items
|
|
16494
|
-
|
|
16495
|
-
contentdata and settingsDate items
|
|
16496
|
-
.key is the key of the content item, it is referenced by the layout and expose properties
|
|
16497
|
-
contentTypeKey is the document type key
|
|
16498
|
-
values stores a array of property values
|
|
16499
|
-
|
|
16500
|
-
{
|
|
16501
|
-
"editorAlias": "Umbraco.BlockList",
|
|
16502
|
-
"culture": null,
|
|
16503
|
-
"segment": null,
|
|
16504
|
-
"alias": "example",
|
|
16505
|
-
"value": {
|
|
16506
|
-
"layout": {
|
|
16507
|
-
"Umbraco.BlockList": [
|
|
16508
|
-
{
|
|
16509
|
-
"contentKey": "7a61b31c-792f-4f6b-a665-960a90b49853"
|
|
16510
|
-
}
|
|
16511
|
-
]
|
|
16512
|
-
},
|
|
16513
|
-
"contentData": [
|
|
16514
|
-
{
|
|
16515
|
-
"key": "7a61b31c-792f-4f6b-a665-960a90b49853",
|
|
16516
|
-
"contentTypeKey": "3a7ec32d-7fd4-49f8-aae6-d9259d5bfee1",
|
|
16517
|
-
"values": [
|
|
16518
|
-
{
|
|
16519
|
-
"editorAlias": "Umbraco.MediaPicker3",
|
|
16520
|
-
"culture": null,
|
|
16521
|
-
"segment": null,
|
|
16522
|
-
"alias": "recipeImage",
|
|
16523
|
-
"value": [
|
|
16524
|
-
{
|
|
16525
|
-
"key": "9bac772d-cd63-4bb6-b2db-1449042129a7",
|
|
16526
|
-
"mediaKey": "3c6c415c-35a0-4629-891e-683506250c31",
|
|
16527
|
-
"mediaTypeAlias": "",
|
|
16528
|
-
"crops": [],
|
|
16529
|
-
"focalPoint": null
|
|
16530
|
-
}
|
|
16531
|
-
]
|
|
16532
|
-
}
|
|
16533
|
-
]
|
|
16534
|
-
}
|
|
16535
|
-
],
|
|
16536
|
-
"settingsData": [],
|
|
16537
|
-
"expose": [
|
|
16538
|
-
{
|
|
16539
|
-
"contentKey": "7a61b31c-792f-4f6b-a665-960a90b49853",
|
|
16540
|
-
"culture": null,
|
|
16541
|
-
"segment": null
|
|
16542
|
-
}
|
|
16543
|
-
]
|
|
16544
|
-
}
|
|
16545
|
-
}
|
|
16546
|
-
|
|
16547
|
-
### Block Grid
|
|
16548
|
-
|
|
16549
|
-
Block grids create a hierarchy structure of content items.
|
|
16550
|
-
|
|
16551
|
-
layout stores the structure of the block grid where items can have multiple areas and each area can items which can in turn have areas and items.
|
|
16552
|
-
areas can have a columnSpan and rowSpan to determine the size of the area.
|
|
16553
|
-
contentData stores the content of the block grid as an array of content items, it has no bearing on the structure.
|
|
16554
|
-
settingsData stores the settings of the block list as an array of settings items, it has no bearing on the structure.
|
|
16555
|
-
expose stores the segment and culture variants of the block list as an array of expose items
|
|
16556
|
-
|
|
16557
|
-
contentdata and settingsDate items
|
|
16558
|
-
.key is the key of the content item, it is referenced by the layout and expose properties
|
|
16559
|
-
contentTypeKey is the document type key
|
|
16560
|
-
values stores a array of property values
|
|
16561
|
-
|
|
16562
|
-
{
|
|
16563
|
-
"editorAlias": "Umbraco.BlockGrid",
|
|
16564
|
-
"culture": null,
|
|
16565
|
-
"segment": null,
|
|
16566
|
-
"alias": "grid",
|
|
16567
|
-
"value": {
|
|
16568
|
-
"layout": {
|
|
16569
|
-
"Umbraco.BlockGrid": [
|
|
16570
|
-
{
|
|
16571
|
-
"contentKey": "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
16572
|
-
"columnSpan": 12,
|
|
16573
|
-
"rowSpan": 1,
|
|
16574
|
-
"areas": [
|
|
16575
|
-
{
|
|
16576
|
-
"key": "43743e78-0f2b-465e-a3ce-f381c90b68e0",
|
|
16577
|
-
"items": [
|
|
16578
|
-
{
|
|
16579
|
-
"contentKey": "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
16580
|
-
"settingsKey": "6248d134-4657-4605-b0d5-ae804858bb88",
|
|
16581
|
-
"columnSpan": 6,
|
|
16582
|
-
"rowSpan": 1
|
|
16583
|
-
}
|
|
16584
|
-
]
|
|
16585
|
-
}
|
|
16586
|
-
]
|
|
16587
|
-
}
|
|
16588
|
-
]
|
|
16589
|
-
},
|
|
16590
|
-
"contentData": [
|
|
16591
|
-
{
|
|
16592
|
-
"key": "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
16593
|
-
"contentTypeKey": "6960aaca-0b26-4fae-9cee-db73405d7a3e",
|
|
16594
|
-
"values": [
|
|
16595
|
-
{
|
|
16596
|
-
"editorAlias": "Umbraco.TextBox",
|
|
16597
|
-
"culture": null,
|
|
16598
|
-
"segment": null,
|
|
16599
|
-
"alias": "title",
|
|
16600
|
-
"value": "Title"
|
|
16601
|
-
},
|
|
16602
|
-
{
|
|
16603
|
-
"editorAlias": "Umbraco.RichText",
|
|
16604
|
-
"culture": null,
|
|
16605
|
-
"segment": null,
|
|
16606
|
-
"alias": "bodyText",
|
|
16607
|
-
"value": {
|
|
16608
|
-
"markup": "<p>cxcxcx</p>",
|
|
16609
|
-
"blocks": {
|
|
16610
|
-
"layout": {},
|
|
16611
|
-
"contentData": [],
|
|
16612
|
-
"settingsData": [],
|
|
16613
|
-
"expose": []
|
|
16614
|
-
}
|
|
16615
|
-
}
|
|
16616
|
-
},
|
|
16617
|
-
{
|
|
16618
|
-
"editorAlias": "Umbraco.MediaPicker3",
|
|
16619
|
-
"culture": null,
|
|
16620
|
-
"segment": null,
|
|
16621
|
-
"alias": "image",
|
|
16622
|
-
"value": [
|
|
16623
|
-
{
|
|
16624
|
-
"key": "40edd153-31eb-4c61-82fc-1ec2e695197b",
|
|
16625
|
-
"mediaKey": "3c6c415c-35a0-4629-891e-683506250c31",
|
|
16626
|
-
"mediaTypeAlias": "",
|
|
16627
|
-
"crops": [],
|
|
16628
|
-
"focalPoint": null
|
|
16629
|
-
}
|
|
16630
|
-
]
|
|
16631
|
-
}
|
|
16632
|
-
]
|
|
16633
|
-
},
|
|
16634
|
-
{
|
|
16635
|
-
"key": "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
16636
|
-
"contentTypeKey": "c80027e5-7e87-49c1-9b4f-1b9d3fbc2e90",
|
|
16637
|
-
"values": [
|
|
16638
|
-
{
|
|
16639
|
-
"editorAlias": "Umbraco.TextBox",
|
|
16640
|
-
"culture": null,
|
|
16641
|
-
"segment": null,
|
|
16642
|
-
"alias": "title",
|
|
16643
|
-
"value": "xccx"
|
|
16644
|
-
},
|
|
16645
|
-
{
|
|
16646
|
-
"editorAlias": "Umbraco.RichText",
|
|
16647
|
-
"culture": null,
|
|
16648
|
-
"segment": null,
|
|
16649
|
-
"alias": "content",
|
|
16650
|
-
"value": {
|
|
16651
|
-
"markup": "<p>xccx</p>",
|
|
16652
|
-
"blocks": {
|
|
16653
|
-
"layout": {},
|
|
16654
|
-
"contentData": [],
|
|
16655
|
-
"settingsData": [],
|
|
16656
|
-
"expose": []
|
|
16657
|
-
}
|
|
16658
|
-
}
|
|
16659
|
-
}
|
|
16660
|
-
]
|
|
16661
|
-
}
|
|
16662
|
-
],
|
|
16663
|
-
"settingsData": [
|
|
16664
|
-
{
|
|
16665
|
-
"key": "6248d134-4657-4605-b0d5-ae804858bb88",
|
|
16666
|
-
"contentTypeKey": "06200e23-1c29-4298-9582-48b2eaa81fbf",
|
|
16667
|
-
"values": []
|
|
16668
|
-
}
|
|
16669
|
-
],
|
|
16670
|
-
"expose": [
|
|
16671
|
-
{
|
|
16672
|
-
"contentKey": "d8fa3d28-79aa-4c60-8e73-5819ed313ea2",
|
|
16673
|
-
"culture": null,
|
|
16674
|
-
"segment": null
|
|
16675
|
-
},
|
|
16676
|
-
{
|
|
16677
|
-
"contentKey": "3145f922-7ec1-41e0-99a5-d9677e558163",
|
|
16678
|
-
"culture": null,
|
|
16679
|
-
"segment": null
|
|
16680
|
-
}
|
|
16681
|
-
]
|
|
16682
|
-
}
|
|
16683
|
-
}
|
|
16684
|
-
|
|
16685
|
-
### Decimal
|
|
16686
|
-
|
|
16687
|
-
{
|
|
16688
|
-
"editorAlias": "Umbraco.Decimal",
|
|
16689
|
-
"culture": null,
|
|
16690
|
-
"segment": null,
|
|
16691
|
-
"alias": "example",
|
|
16692
|
-
"value": 1.2
|
|
16693
|
-
}
|
|
16694
|
-
|
|
16695
|
-
### EmailAddress
|
|
16696
|
-
|
|
16697
|
-
{
|
|
16698
|
-
"editorAlias": "Umbraco.EmailAddress",
|
|
16699
|
-
"culture": null,
|
|
16700
|
-
"segment": null,
|
|
16701
|
-
"alias": "example",
|
|
16702
|
-
"value": "admin@admin.co.uk"
|
|
16703
|
-
}
|
|
16704
|
-
|
|
16705
|
-
### Integer
|
|
16706
|
-
|
|
16707
|
-
{
|
|
16708
|
-
"editorAlias": "Umbraco.Integer",
|
|
16709
|
-
"culture": null,
|
|
16710
|
-
"segment": null,
|
|
16711
|
-
"alias": "example",
|
|
16712
|
-
"value": 1
|
|
16713
|
-
}
|
|
16714
|
-
|
|
16715
|
-
### Tags
|
|
16716
|
-
|
|
16717
|
-
{
|
|
16718
|
-
"editorAlias": "Umbraco.Tags",
|
|
16719
|
-
"culture": null,
|
|
16720
|
-
"segment": null,
|
|
16721
|
-
"alias": "example",
|
|
16722
|
-
"value": [
|
|
16723
|
-
"Tag 1",
|
|
16724
|
-
"Tag 2"
|
|
16725
|
-
]
|
|
16726
|
-
}
|
|
16727
|
-
|
|
16728
|
-
### Colour Picker
|
|
16729
|
-
|
|
16730
|
-
{
|
|
16731
|
-
"editorAlias": "Umbraco.ColorPicker",
|
|
16732
|
-
"culture": null,
|
|
16733
|
-
"segment": null,
|
|
16734
|
-
"alias": "test",
|
|
16735
|
-
"value": {
|
|
16736
|
-
"label": "Green",
|
|
16737
|
-
"value": "#00FF00"
|
|
16738
|
-
}
|
|
16739
|
-
}
|
|
16740
|
-
|
|
16741
|
-
### True False
|
|
16742
|
-
|
|
16743
|
-
{
|
|
16744
|
-
"editorAlias": "Umbraco.TrueFalse",
|
|
16745
|
-
"culture": null,
|
|
16746
|
-
"segment": null,
|
|
16747
|
-
"alias": "example",
|
|
16748
|
-
"value": true
|
|
16749
|
-
}
|
|
16750
|
-
|
|
16751
|
-
### CheckBoxList
|
|
16752
|
-
|
|
16753
|
-
{
|
|
16754
|
-
"editorAlias": "Umbraco.CheckBoxList",
|
|
16755
|
-
"culture": null,
|
|
16756
|
-
"segment": null,
|
|
16757
|
-
"alias": "checkboxList",
|
|
16758
|
-
"value": [
|
|
16759
|
-
"item 1",
|
|
16760
|
-
"items 2"
|
|
16761
|
-
]
|
|
16762
|
-
}
|
|
16763
|
-
|
|
16764
|
-
### Dropdown Flexible
|
|
16765
|
-
|
|
16766
|
-
{
|
|
16767
|
-
"editorAlias": "Umbraco.DropDown.Flexible",
|
|
16768
|
-
"culture": null,
|
|
16769
|
-
"segment": null,
|
|
16770
|
-
"alias": "dropdown",
|
|
16771
|
-
"value": [
|
|
16772
|
-
"Item 3"
|
|
16773
|
-
]
|
|
16774
|
-
}
|
|
16775
|
-
|
|
16776
|
-
### Multiple Textstring
|
|
16777
|
-
|
|
16778
|
-
{
|
|
16779
|
-
"editorAlias": "Umbraco.MultipleTextstring",
|
|
16780
|
-
"culture": null,
|
|
16781
|
-
"segment": null,
|
|
16782
|
-
"alias": "repeatableStrings",
|
|
16783
|
-
"value": [
|
|
16784
|
-
"Item 1",
|
|
16785
|
-
"item 2"
|
|
16786
|
-
]
|
|
16787
|
-
}
|
|
16788
|
-
|
|
16789
|
-
### Radio Button List
|
|
16790
|
-
|
|
16791
|
-
{
|
|
16792
|
-
"editorAlias": "Umbraco.RadioButtonList",
|
|
16793
|
-
"culture": null,
|
|
16794
|
-
"segment": null,
|
|
16795
|
-
"alias": "radioButton",
|
|
16796
|
-
"value": "item 1"
|
|
16797
|
-
}
|
|
16798
|
-
|
|
16799
|
-
### Image Cropper
|
|
16800
|
-
|
|
16801
|
-
Using this will require a temporary file uploaded first and the id provided
|
|
16802
|
-
|
|
16803
|
-
{
|
|
16804
|
-
"editorAlias": "Umbraco.ImageCropper",
|
|
16805
|
-
"culture": null,
|
|
16806
|
-
"segment": null,
|
|
16807
|
-
"alias": "imageBropper",
|
|
16808
|
-
"value": {
|
|
16809
|
-
"temporaryFileId": "b45eb1dd-2959-4b0b-a675-761b6a19824c",
|
|
16810
|
-
"src": "",
|
|
16811
|
-
"crops": [],
|
|
16812
|
-
"focalPoint": {
|
|
16813
|
-
"left": 0.5,
|
|
16814
|
-
"top": 0.5
|
|
16815
|
-
}
|
|
16816
|
-
}
|
|
16817
|
-
}
|
|
16818
|
-
|
|
16819
|
-
### Media Picker 3
|
|
16820
|
-
|
|
16821
|
-
This key relates to a media item id. The key is generated by the system and is not provided by the user.
|
|
16822
|
-
|
|
16823
|
-
{
|
|
16824
|
-
"editorAlias": "Umbraco.MediaPicker3",
|
|
16825
|
-
"culture": null,
|
|
16826
|
-
"segment": null,
|
|
16827
|
-
"alias": "mediaPicker",
|
|
16828
|
-
"value": [
|
|
16829
|
-
{
|
|
16830
|
-
"key": "4c82123c-cd3e-4d92-84b8-9c79ad5a5319",
|
|
16831
|
-
"mediaKey": "3c6c415c-35a0-4629-891e-683506250c31",
|
|
16832
|
-
"mediaTypeAlias": "",
|
|
16833
|
-
"crops": [],
|
|
16834
|
-
"focalPoint": null
|
|
16835
|
-
}
|
|
16836
|
-
]
|
|
16837
|
-
}
|
|
16838
|
-
|
|
16839
|
-
### Upload Field
|
|
16840
|
-
|
|
16841
|
-
Using this will require a temporary file uploaded first and the id provided
|
|
16842
|
-
|
|
16843
|
-
{
|
|
16844
|
-
"editorAlias": "Umbraco.UploadField",
|
|
16845
|
-
"culture": null,
|
|
16846
|
-
"segment": null,
|
|
16847
|
-
"alias": "upload",
|
|
16848
|
-
"value": {
|
|
16849
|
-
"src": "blob:http://localhost:56472/0884388b-41a3-46c2-a224-9b9ff02de24a",
|
|
16850
|
-
"temporaryFileId": "fc76f270-83c2-4daa-ba8b-fde4554dda2a"
|
|
16851
|
-
}
|
|
16852
|
-
}
|
|
16853
|
-
|
|
16854
|
-
### Slider
|
|
16855
|
-
|
|
16856
|
-
{
|
|
16857
|
-
"editorAlias": "Umbraco.Slider",
|
|
16858
|
-
"culture": null,
|
|
16859
|
-
"segment": null,
|
|
16860
|
-
"alias": "slider",
|
|
16861
|
-
"value": {
|
|
16862
|
-
"from": 31,
|
|
16863
|
-
"to": 31
|
|
16864
|
-
}
|
|
16865
|
-
}
|
|
16866
|
-
|
|
16867
|
-
### Member Group Picker
|
|
16868
|
-
|
|
16869
|
-
The value relates to an existing member group id.
|
|
16870
|
-
|
|
16871
|
-
{
|
|
16872
|
-
"editorAlias": "Umbraco.MemberGroupPicker",
|
|
16873
|
-
"culture": null,
|
|
16874
|
-
"segment": null,
|
|
16875
|
-
"alias": "memberGroup",
|
|
16876
|
-
"value": "9815503d-a5a9-487f-aee3-827ca43fdb2c"
|
|
16877
|
-
}
|
|
16878
|
-
|
|
16879
|
-
### Member Picker
|
|
16880
|
-
|
|
16881
|
-
The value relates to an existing member id.
|
|
16882
|
-
|
|
16883
|
-
{
|
|
16884
|
-
"editorAlias": "Umbraco.MemberPicker",
|
|
16885
|
-
"culture": null,
|
|
16886
|
-
"segment": null,
|
|
16887
|
-
"alias": "member",
|
|
16888
|
-
"value": "f8abd31e-c78d-46ea-bb6b-c00cb9107bfb"
|
|
16889
|
-
}
|
|
16890
|
-
|
|
16891
|
-
### User Picker
|
|
16892
|
-
|
|
16893
|
-
The value relates to an existing user id.
|
|
16894
|
-
|
|
16895
|
-
{
|
|
16896
|
-
"editorAlias": "Umbraco.UserPicker",
|
|
16897
|
-
"culture": null,
|
|
16898
|
-
"segment": null,
|
|
16899
|
-
"alias": "user",
|
|
16900
|
-
"value": "1e70f841-c261-413b-abb2-2d68cdb96094"
|
|
16901
|
-
}
|
|
16902
|
-
|
|
16903
|
-
### Multi Node Tree Picker
|
|
16904
|
-
|
|
16905
|
-
{
|
|
16906
|
-
"editorAlias": "Umbraco.MultiNodeTreePicker",
|
|
16907
|
-
"culture": null,
|
|
16908
|
-
"segment": null,
|
|
16909
|
-
"alias": "contentPicker",
|
|
16910
|
-
"value": [
|
|
16911
|
-
{
|
|
16912
|
-
"type": "document",
|
|
16913
|
-
"unique": "dcf18a51-6919-4cf8-89d1-36b94ce4d963"
|
|
16914
|
-
}
|
|
16915
|
-
]
|
|
16916
|
-
}
|
|
16917
|
-
|
|
16918
|
-
### Date Time
|
|
16919
|
-
|
|
16920
|
-
{
|
|
16921
|
-
"editorAlias": "Umbraco.DateTime",
|
|
16922
|
-
"culture": null,
|
|
16923
|
-
"segment": null,
|
|
16924
|
-
"alias": "date",
|
|
16925
|
-
"value": "2025-05-23 00:00:00"
|
|
16926
|
-
}
|
|
16927
|
-
|
|
16928
|
-
### Content Picker
|
|
16929
|
-
|
|
16930
|
-
The value relates to an existing document id.
|
|
16931
|
-
|
|
16932
|
-
{
|
|
16933
|
-
"editorAlias": "Umbraco.ContentPicker",
|
|
16934
|
-
"culture": null,
|
|
16935
|
-
"segment": null,
|
|
16936
|
-
"alias": "content",
|
|
16937
|
-
"value": "dcf18a51-6919-4cf8-89d1-36b94ce4d963"
|
|
16938
|
-
}
|
|
16939
|
-
|
|
16940
|
-
### Colour Picker Eye Dropper
|
|
16941
|
-
|
|
16942
|
-
{
|
|
16943
|
-
"editorAlias": "Umbraco.ColorPicker.EyeDropper",
|
|
16944
|
-
"culture": null,
|
|
16945
|
-
"segment": null,
|
|
16946
|
-
"alias": "eyeDropper",
|
|
16947
|
-
"value": "#982020"
|
|
16948
|
-
}
|
|
16949
|
-
|
|
16950
|
-
### Multi Url Picker
|
|
16951
|
-
|
|
16952
|
-
{
|
|
16953
|
-
"editorAlias": "Umbraco.MultiUrlPicker",
|
|
16954
|
-
"culture": null,
|
|
16955
|
-
"segment": null,
|
|
16956
|
-
"alias": "multiUrl",
|
|
16957
|
-
"value": [
|
|
16958
|
-
{
|
|
16959
|
-
"icon": "icon-home color-blue",
|
|
16960
|
-
"name": "Home",
|
|
16961
|
-
"type": "document",
|
|
16962
|
-
"unique": "dcf18a51-6919-4cf8-89d1-36b94ce4d963",
|
|
16963
|
-
"url": "/"
|
|
16964
|
-
},
|
|
16965
|
-
{
|
|
16966
|
-
"icon": "icon-picture",
|
|
16967
|
-
"name": "Chairs lamps",
|
|
16968
|
-
"type": "media",
|
|
16969
|
-
"unique": "3c6c415c-35a0-4629-891e-683506250c31",
|
|
16970
|
-
"url": "http://localhost:56472/media/0ofdvcwj/chairs-lamps.jpg"
|
|
16971
|
-
},
|
|
16972
|
-
{
|
|
16973
|
-
"name": "Title",
|
|
16974
|
-
"target": "_blank",
|
|
16975
|
-
"type": "external",
|
|
16976
|
-
"url": "www.google.com"
|
|
16977
|
-
}
|
|
16978
|
-
]
|
|
16979
|
-
}
|
|
18054
|
+
Always follow these requirements when creating documents exactly, do not deviate in any way.
|
|
16980
18055
|
|
|
16981
|
-
|
|
18056
|
+
## COPY-FIRST APPROACH (RECOMMENDED)
|
|
16982
18057
|
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
18058
|
+
**FIRST: Try to copy an existing document**
|
|
18059
|
+
1. Only use this if copy-document and search-document tools are available
|
|
18060
|
+
2. Use search-document to find documents with the same document type
|
|
18061
|
+
3. If similar documents exist AND copy-document tool is available:
|
|
18062
|
+
- Use copy-document to duplicate the existing structure
|
|
18063
|
+
- Use search-document to find the new document (copy returns empty string, not the new ID)
|
|
18064
|
+
- Update with update-document and publish with publish-document as needed
|
|
16990
18065
|
|
|
16991
|
-
|
|
18066
|
+
**SECOND: Only create from scratch when:**
|
|
18067
|
+
- No similar documents exist in Umbraco
|
|
18068
|
+
- Copy-document tool doesn't exist
|
|
18069
|
+
- You need to create from scratch with unique structure
|
|
16992
18070
|
|
|
16993
|
-
|
|
16994
|
-
"editorAlias": "Umbraco.CodeEditor",
|
|
16995
|
-
"culture": null,
|
|
16996
|
-
"segment": null,
|
|
16997
|
-
"alias": "code",
|
|
16998
|
-
"value": "Code"
|
|
16999
|
-
}
|
|
18071
|
+
Benefits: Preserves structure, inherits properties, maintains consistency with existing content.
|
|
17000
18072
|
|
|
17001
|
-
|
|
17002
|
-
{
|
|
17003
|
-
"editorAlias": "Umbraco.TextBox",
|
|
17004
|
-
"culture": null,
|
|
17005
|
-
"segment": null,
|
|
17006
|
-
"alias": "example",
|
|
17007
|
-
"value": "some string"
|
|
17008
|
-
}
|
|
18073
|
+
## Introduction
|
|
17009
18074
|
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
"culture": null,
|
|
17014
|
-
"segment": null,
|
|
17015
|
-
"alias": "example",
|
|
17016
|
-
"value": "some string"
|
|
17017
|
-
}
|
|
18075
|
+
This tool creates documents with multi-culture support:
|
|
18076
|
+
- If cultures parameter is provided, a variant will be created for each culture code
|
|
18077
|
+
- If cultures parameter is not provided or is an empty array, will create a single variant with null culture (original behavior)
|
|
17018
18078
|
|
|
18079
|
+
## Critical Requirements
|
|
17019
18080
|
|
|
17020
|
-
###
|
|
18081
|
+
### Document Type Analysis (When Creating from Scratch)
|
|
18082
|
+
1. Use get-document-type-by-id to understand the document type structure and required properties
|
|
18083
|
+
2. Ensure all required properties are included in the values array
|
|
17021
18084
|
|
|
17022
|
-
|
|
18085
|
+
### Document Types and Data Types
|
|
18086
|
+
1. BEFORE creating any new document type, ALWAYS search for existing ones using get-all-document-types
|
|
18087
|
+
2. BEFORE creating any new data type, ALWAYS search for existing ones using get-all-data-types
|
|
18088
|
+
3. ONLY create a new document type or data type if NO suitable existing ones are found
|
|
18089
|
+
4. If similar types exist, inform the user and suggest using the existing types instead
|
|
18090
|
+
5. Creation of new types should be a last resort when nothing suitable exists
|
|
17023
18091
|
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
|
|
17029
|
-
|
|
17030
|
-
|
|
17031
|
-
|
|
17032
|
-
|
|
17033
|
-
|
|
17034
|
-
|
|
17035
|
-
|
|
17036
|
-
}
|
|
17037
|
-
}
|
|
17038
|
-
}
|
|
18092
|
+
### Parent ID Handling
|
|
18093
|
+
For document types with allowedAsRoot=true, DO NOT include the parentId parameter at all in the function call.
|
|
18094
|
+
When adding a parent, first find the parent using get-document-root or get-document-children and then use the id of the parent in the parentId parameter. Alway makes sure that the id is valid.
|
|
18095
|
+
|
|
18096
|
+
### Values Matching
|
|
18097
|
+
- Values must match the aliases of the document type structure
|
|
18098
|
+
- Block lists, Block Grids and Rich Text Blocks items and settings must match the defined blocks document type structures
|
|
18099
|
+
|
|
18100
|
+
### Unique Keys
|
|
18101
|
+
All generated keys must be unique and randomly generated.
|
|
18102
|
+
|
|
18103
|
+
## Property Editor Values Reference
|
|
17039
18104
|
|
|
17040
|
-
|
|
18105
|
+
When creating documents, you need to provide property values that match the property editors defined in the document type.
|
|
17041
18106
|
|
|
17042
|
-
|
|
17043
|
-
|
|
17044
|
-
value
|
|
18107
|
+
IMPORTANT: Use the get-document-property-value-template tool to:
|
|
18108
|
+
- View all available property editors (call without parameters)
|
|
18109
|
+
- Get the correct value structure for a specific property editor (call with editorAlias parameter)
|
|
18110
|
+
- Each template provides the editorAlias and value format
|
|
18111
|
+
- You must add culture, segment, and alias based on your document's specific requirements
|
|
17045
18112
|
|
|
18113
|
+
The values parameter is an array of property value objects following this structure:
|
|
17046
18114
|
{
|
|
17047
|
-
"editorAlias": "Umbraco.
|
|
17048
|
-
"culture": null,
|
|
17049
|
-
"segment": null,
|
|
17050
|
-
"alias": "
|
|
17051
|
-
"value":
|
|
17052
|
-
{
|
|
17053
|
-
"key": "9bac772d-cd63-4bb6-b2db-1449042129a7",
|
|
17054
|
-
"mediaKey": "3c6c415c-35a0-4629-891e-683506250c31",
|
|
17055
|
-
"mediaTypeAlias": "",
|
|
17056
|
-
"crops": [],
|
|
17057
|
-
"focalPoint": null
|
|
17058
|
-
}
|
|
17059
|
-
]
|
|
18115
|
+
"editorAlias": "Umbraco.TextBox", // From template - the property editor type
|
|
18116
|
+
"culture": null, // Document-specific - culture code or null
|
|
18117
|
+
"segment": null, // Document-specific - segment or null
|
|
18118
|
+
"alias": "propertyAlias", // Document-specific - property alias from document type
|
|
18119
|
+
"value": "your value here" // From template - customize the value structure
|
|
17060
18120
|
}
|
|
17061
18121
|
|
|
17062
|
-
|
|
18122
|
+
Note: Some property editors (BlockList, BlockGrid, ImageCropper, UploadField) have special requirements - check their templates for important notes.
|
|
17063
18123
|
`,
|
|
17064
18124
|
createDocumentSchema.shape,
|
|
17065
18125
|
async (model) => {
|
|
@@ -17088,15 +18148,39 @@ var CreateDocumentTool = CreateUmbracoTool(
|
|
|
17088
18148
|
values: model.values,
|
|
17089
18149
|
variants
|
|
17090
18150
|
};
|
|
17091
|
-
const response = await client.postDocument(payload
|
|
17092
|
-
|
|
17093
|
-
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
18151
|
+
const response = await client.postDocument(payload, {
|
|
18152
|
+
returnFullResponse: true,
|
|
18153
|
+
validateStatus: () => true
|
|
18154
|
+
// Don't throw on any status
|
|
18155
|
+
});
|
|
18156
|
+
if (response.status === 201) {
|
|
18157
|
+
return {
|
|
18158
|
+
content: [
|
|
18159
|
+
{
|
|
18160
|
+
type: "text",
|
|
18161
|
+
text: JSON.stringify({
|
|
18162
|
+
message: "Document created successfully",
|
|
18163
|
+
id: documentId
|
|
18164
|
+
})
|
|
18165
|
+
}
|
|
18166
|
+
]
|
|
18167
|
+
};
|
|
18168
|
+
} else {
|
|
18169
|
+
const errorData = response.data;
|
|
18170
|
+
return {
|
|
18171
|
+
content: [
|
|
18172
|
+
{
|
|
18173
|
+
type: "text",
|
|
18174
|
+
text: JSON.stringify({
|
|
18175
|
+
message: "Failed to create document",
|
|
18176
|
+
status: response.status,
|
|
18177
|
+
error: errorData || response.statusText
|
|
18178
|
+
})
|
|
18179
|
+
}
|
|
18180
|
+
],
|
|
18181
|
+
isError: true
|
|
18182
|
+
};
|
|
18183
|
+
}
|
|
17100
18184
|
},
|
|
17101
18185
|
(user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Create)
|
|
17102
18186
|
);
|
|
@@ -17214,7 +18298,7 @@ var PublishDocumentWithDescendantsTool = CreateUmbracoTool(
|
|
|
17214
18298
|
let attempts = 0;
|
|
17215
18299
|
while (attempts < maxAttempts) {
|
|
17216
18300
|
attempts++;
|
|
17217
|
-
await new Promise((
|
|
18301
|
+
await new Promise((resolve3) => setTimeout(resolve3, pollInterval));
|
|
17218
18302
|
try {
|
|
17219
18303
|
const statusResponse = await client.getDocumentByIdPublishWithDescendantsResultByTaskId(
|
|
17220
18304
|
model.id,
|
|
@@ -17389,6 +18473,29 @@ var EmptyRecycleBinTool = CreateUmbracoTool(
|
|
|
17389
18473
|
);
|
|
17390
18474
|
var empty_recycle_bin_default = EmptyRecycleBinTool;
|
|
17391
18475
|
|
|
18476
|
+
// src/umb-management-api/tools/document/put/restore-from-recycle-bin.ts
|
|
18477
|
+
var RestoreFromRecycleBinTool = CreateUmbracoTool(
|
|
18478
|
+
"restore-document-from-recycle-bin",
|
|
18479
|
+
"Restores a document from the recycle bin.",
|
|
18480
|
+
putRecycleBinDocumentByIdRestoreParams.shape,
|
|
18481
|
+
async ({ id }) => {
|
|
18482
|
+
const client = UmbracoManagementClient2.getClient();
|
|
18483
|
+
const response = await client.putRecycleBinDocumentByIdRestore(id, {
|
|
18484
|
+
target: null
|
|
18485
|
+
});
|
|
18486
|
+
return {
|
|
18487
|
+
content: [
|
|
18488
|
+
{
|
|
18489
|
+
type: "text",
|
|
18490
|
+
text: JSON.stringify(response)
|
|
18491
|
+
}
|
|
18492
|
+
]
|
|
18493
|
+
};
|
|
18494
|
+
},
|
|
18495
|
+
(user) => user.fallbackPermissions.includes(UmbracoDocumentPermissions.Delete)
|
|
18496
|
+
);
|
|
18497
|
+
var restore_from_recycle_bin_default = RestoreFromRecycleBinTool;
|
|
18498
|
+
|
|
17392
18499
|
// src/umb-management-api/tools/document/put/move-to-recycle-bin.ts
|
|
17393
18500
|
var MoveDocumentToRecycleBinTool = CreateUmbracoTool(
|
|
17394
18501
|
"move-document-to-recycle-bin",
|
|
@@ -17551,6 +18658,7 @@ var DocumentCollection = {
|
|
|
17551
18658
|
tools.push(get_document_by_id_default());
|
|
17552
18659
|
tools.push(get_document_publish_default());
|
|
17553
18660
|
tools.push(get_document_configuration_default());
|
|
18661
|
+
tools.push(get_document_property_value_template_default());
|
|
17554
18662
|
tools.push(copy_document_default());
|
|
17555
18663
|
tools.push(create_document_default());
|
|
17556
18664
|
tools.push(post_document_public_access_default());
|
|
@@ -17573,6 +18681,7 @@ var DocumentCollection = {
|
|
|
17573
18681
|
tools.push(put_document_public_access_default());
|
|
17574
18682
|
tools.push(delete_from_recycle_bin_default());
|
|
17575
18683
|
tools.push(empty_recycle_bin_default());
|
|
18684
|
+
tools.push(restore_from_recycle_bin_default());
|
|
17576
18685
|
tools.push(get_recycle_bin_root_default());
|
|
17577
18686
|
tools.push(get_recycle_bin_children_default());
|
|
17578
18687
|
tools.push(search_document_default());
|
|
@@ -17695,20 +18804,292 @@ var DocumentVersionCollection = {
|
|
|
17695
18804
|
tools.push(update_document_version_prevent_cleanup_default());
|
|
17696
18805
|
tools.push(create_document_version_rollback_default());
|
|
17697
18806
|
}
|
|
17698
|
-
return tools;
|
|
18807
|
+
return tools;
|
|
18808
|
+
}
|
|
18809
|
+
};
|
|
18810
|
+
|
|
18811
|
+
// src/umb-management-api/tools/media/post/create-media.ts
|
|
18812
|
+
|
|
18813
|
+
|
|
18814
|
+
|
|
18815
|
+
// src/umb-management-api/tools/media/post/helpers/media-upload-helpers.ts
|
|
18816
|
+
var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs); var fs3 = _interopRequireWildcard(_fs);
|
|
18817
|
+
var _os = require('os'); var os = _interopRequireWildcard(_os); var os2 = _interopRequireWildcard(_os);
|
|
18818
|
+
var _path = require('path'); var path2 = _interopRequireWildcard(_path); var path = _interopRequireWildcard(_path); var path3 = _interopRequireWildcard(_path);
|
|
18819
|
+
|
|
18820
|
+
var _mimetypes = require('mime-types'); var _mimetypes2 = _interopRequireDefault(_mimetypes);
|
|
18821
|
+
|
|
18822
|
+
// src/constants/constants.ts
|
|
18823
|
+
var FOLDER_MEDIA_TYPE_ID = "f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d";
|
|
18824
|
+
var IMAGE_MEDIA_TYPE_ID = "cc07b313-0843-4aa8-bbda-871c8da728c8";
|
|
18825
|
+
var FILE_MEDIA_TYPE_ID = "4c52d8ab-54e6-40cd-999c-7a5f24903e4d";
|
|
18826
|
+
var VIDEO_MEDIA_TYPE_ID = "f6c515bb-653c-4bdc-821c-987729ebe327";
|
|
18827
|
+
var AUDIO_MEDIA_TYPE_ID = "a5ddeee0-8fd8-4cee-a658-6f1fcdb00de3";
|
|
18828
|
+
var ARTICLE_MEDIA_TYPE_ID = "a43e3414-9599-4230-a7d3-943a21b20122";
|
|
18829
|
+
var VECTOR_GRAPHICS_MEDIA_TYPE_ID = "c4b1efcf-a9d5-41c4-9621-e9d273b52a9c";
|
|
18830
|
+
var MEDIA_TYPE_FOLDER = "Folder";
|
|
18831
|
+
var MEDIA_TYPE_IMAGE = "Image";
|
|
18832
|
+
var MEDIA_TYPE_FILE = "File";
|
|
18833
|
+
var MEDIA_TYPE_VIDEO = "Video";
|
|
18834
|
+
var MEDIA_TYPE_AUDIO = "Audio";
|
|
18835
|
+
var MEDIA_TYPE_ARTICLE = "Article";
|
|
18836
|
+
var MEDIA_TYPE_VECTOR_GRAPHICS = "SVG";
|
|
18837
|
+
var STANDARD_MEDIA_TYPES = {
|
|
18838
|
+
[MEDIA_TYPE_FOLDER]: FOLDER_MEDIA_TYPE_ID,
|
|
18839
|
+
[MEDIA_TYPE_IMAGE]: IMAGE_MEDIA_TYPE_ID,
|
|
18840
|
+
[MEDIA_TYPE_FILE]: FILE_MEDIA_TYPE_ID,
|
|
18841
|
+
[MEDIA_TYPE_VIDEO]: VIDEO_MEDIA_TYPE_ID,
|
|
18842
|
+
[MEDIA_TYPE_AUDIO]: AUDIO_MEDIA_TYPE_ID,
|
|
18843
|
+
[MEDIA_TYPE_ARTICLE]: ARTICLE_MEDIA_TYPE_ID,
|
|
18844
|
+
[MEDIA_TYPE_VECTOR_GRAPHICS]: VECTOR_GRAPHICS_MEDIA_TYPE_ID
|
|
18845
|
+
};
|
|
18846
|
+
|
|
18847
|
+
// src/umb-management-api/tools/media/post/helpers/validate-file-path.ts
|
|
18848
|
+
|
|
18849
|
+
|
|
18850
|
+
|
|
18851
|
+
// src/config.ts
|
|
18852
|
+
var _dotenv = require('dotenv');
|
|
18853
|
+
var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
|
|
18854
|
+
var _helpers = require('yargs/helpers');
|
|
18855
|
+
|
|
18856
|
+
function maskSecret(secret) {
|
|
18857
|
+
if (!secret || secret.length <= 4) return "****";
|
|
18858
|
+
return `****${secret.slice(-4)}`;
|
|
18859
|
+
}
|
|
18860
|
+
function getServerConfig(isStdioMode) {
|
|
18861
|
+
const argv = _yargs2.default.call(void 0, _helpers.hideBin.call(void 0, process.argv)).options({
|
|
18862
|
+
"umbraco-client-id": {
|
|
18863
|
+
type: "string",
|
|
18864
|
+
description: "Umbraco API client ID"
|
|
18865
|
+
},
|
|
18866
|
+
"umbraco-client-secret": {
|
|
18867
|
+
type: "string",
|
|
18868
|
+
description: "Umbraco API client secret"
|
|
18869
|
+
},
|
|
18870
|
+
"umbraco-base-url": {
|
|
18871
|
+
type: "string",
|
|
18872
|
+
description: "Umbraco base URL (e.g., https://localhost:44391)"
|
|
18873
|
+
},
|
|
18874
|
+
"umbraco-include-tool-collections": {
|
|
18875
|
+
type: "string",
|
|
18876
|
+
description: "Comma-separated list of tool collections to include"
|
|
18877
|
+
},
|
|
18878
|
+
"umbraco-exclude-tool-collections": {
|
|
18879
|
+
type: "string",
|
|
18880
|
+
description: "Comma-separated list of tool collections to exclude"
|
|
18881
|
+
},
|
|
18882
|
+
"umbraco-include-tools": {
|
|
18883
|
+
type: "string",
|
|
18884
|
+
description: "Comma-separated list of tools to include"
|
|
18885
|
+
},
|
|
18886
|
+
"umbraco-exclude-tools": {
|
|
18887
|
+
type: "string",
|
|
18888
|
+
description: "Comma-separated list of tools to exclude"
|
|
18889
|
+
},
|
|
18890
|
+
"umbraco-allowed-media-paths": {
|
|
18891
|
+
type: "string",
|
|
18892
|
+
description: "Comma-separated list of allowed file system paths for media uploads (security: restricts file path access)"
|
|
18893
|
+
},
|
|
18894
|
+
env: {
|
|
18895
|
+
type: "string",
|
|
18896
|
+
description: "Path to custom .env file to load environment variables from"
|
|
18897
|
+
}
|
|
18898
|
+
}).help().version(_nullishCoalesce(process.env.NPM_PACKAGE_VERSION, () => ( "unknown"))).parseSync();
|
|
18899
|
+
let envFilePath;
|
|
18900
|
+
let envFileSource;
|
|
18901
|
+
if (argv["env"]) {
|
|
18902
|
+
envFilePath = _path.resolve.call(void 0, argv["env"]);
|
|
18903
|
+
envFileSource = "cli";
|
|
18904
|
+
} else {
|
|
18905
|
+
envFilePath = _path.resolve.call(void 0, process.cwd(), ".env");
|
|
18906
|
+
envFileSource = "default";
|
|
18907
|
+
}
|
|
18908
|
+
_dotenv.config.call(void 0, { path: envFilePath, override: true });
|
|
18909
|
+
const auth = {
|
|
18910
|
+
clientId: "",
|
|
18911
|
+
clientSecret: "",
|
|
18912
|
+
baseUrl: ""
|
|
18913
|
+
};
|
|
18914
|
+
const config = {
|
|
18915
|
+
includeToolCollections: void 0,
|
|
18916
|
+
excludeToolCollections: void 0,
|
|
18917
|
+
includeTools: void 0,
|
|
18918
|
+
excludeTools: void 0,
|
|
18919
|
+
allowedMediaPaths: void 0,
|
|
18920
|
+
configSources: {
|
|
18921
|
+
clientId: "env",
|
|
18922
|
+
clientSecret: "env",
|
|
18923
|
+
baseUrl: "env",
|
|
18924
|
+
includeToolCollections: "none",
|
|
18925
|
+
excludeToolCollections: "none",
|
|
18926
|
+
includeTools: "none",
|
|
18927
|
+
excludeTools: "none",
|
|
18928
|
+
allowedMediaPaths: "none",
|
|
18929
|
+
envFile: envFileSource
|
|
18930
|
+
}
|
|
18931
|
+
};
|
|
18932
|
+
if (argv["umbraco-client-id"]) {
|
|
18933
|
+
auth.clientId = argv["umbraco-client-id"];
|
|
18934
|
+
config.configSources.clientId = "cli";
|
|
18935
|
+
} else if (process.env.UMBRACO_CLIENT_ID) {
|
|
18936
|
+
auth.clientId = process.env.UMBRACO_CLIENT_ID;
|
|
18937
|
+
config.configSources.clientId = "env";
|
|
18938
|
+
}
|
|
18939
|
+
if (argv["umbraco-client-secret"]) {
|
|
18940
|
+
auth.clientSecret = argv["umbraco-client-secret"];
|
|
18941
|
+
config.configSources.clientSecret = "cli";
|
|
18942
|
+
} else if (process.env.UMBRACO_CLIENT_SECRET) {
|
|
18943
|
+
auth.clientSecret = process.env.UMBRACO_CLIENT_SECRET;
|
|
18944
|
+
config.configSources.clientSecret = "env";
|
|
18945
|
+
}
|
|
18946
|
+
if (argv["umbraco-base-url"]) {
|
|
18947
|
+
auth.baseUrl = argv["umbraco-base-url"];
|
|
18948
|
+
config.configSources.baseUrl = "cli";
|
|
18949
|
+
} else if (process.env.UMBRACO_BASE_URL) {
|
|
18950
|
+
auth.baseUrl = process.env.UMBRACO_BASE_URL;
|
|
18951
|
+
config.configSources.baseUrl = "env";
|
|
18952
|
+
}
|
|
18953
|
+
if (argv["umbraco-include-tool-collections"]) {
|
|
18954
|
+
config.includeToolCollections = argv["umbraco-include-tool-collections"].split(",").map((c) => c.trim()).filter(Boolean);
|
|
18955
|
+
config.configSources.includeToolCollections = "cli";
|
|
18956
|
+
} else if (process.env.UMBRACO_INCLUDE_TOOL_COLLECTIONS) {
|
|
18957
|
+
config.includeToolCollections = process.env.UMBRACO_INCLUDE_TOOL_COLLECTIONS.split(",").map((c) => c.trim()).filter(Boolean);
|
|
18958
|
+
config.configSources.includeToolCollections = "env";
|
|
18959
|
+
}
|
|
18960
|
+
if (argv["umbraco-exclude-tool-collections"]) {
|
|
18961
|
+
config.excludeToolCollections = argv["umbraco-exclude-tool-collections"].split(",").map((c) => c.trim()).filter(Boolean);
|
|
18962
|
+
config.configSources.excludeToolCollections = "cli";
|
|
18963
|
+
} else if (process.env.UMBRACO_EXCLUDE_TOOL_COLLECTIONS) {
|
|
18964
|
+
config.excludeToolCollections = process.env.UMBRACO_EXCLUDE_TOOL_COLLECTIONS.split(",").map((c) => c.trim()).filter(Boolean);
|
|
18965
|
+
config.configSources.excludeToolCollections = "env";
|
|
18966
|
+
}
|
|
18967
|
+
if (argv["umbraco-include-tools"]) {
|
|
18968
|
+
config.includeTools = argv["umbraco-include-tools"].split(",").map((t) => t.trim()).filter(Boolean);
|
|
18969
|
+
config.configSources.includeTools = "cli";
|
|
18970
|
+
} else if (process.env.UMBRACO_INCLUDE_TOOLS) {
|
|
18971
|
+
config.includeTools = process.env.UMBRACO_INCLUDE_TOOLS.split(",").map((t) => t.trim()).filter(Boolean);
|
|
18972
|
+
config.configSources.includeTools = "env";
|
|
18973
|
+
}
|
|
18974
|
+
if (argv["umbraco-exclude-tools"]) {
|
|
18975
|
+
config.excludeTools = argv["umbraco-exclude-tools"].split(",").map((t) => t.trim()).filter(Boolean);
|
|
18976
|
+
config.configSources.excludeTools = "cli";
|
|
18977
|
+
} else if (process.env.UMBRACO_EXCLUDE_TOOLS) {
|
|
18978
|
+
config.excludeTools = process.env.UMBRACO_EXCLUDE_TOOLS.split(",").map((t) => t.trim()).filter(Boolean);
|
|
18979
|
+
config.configSources.excludeTools = "env";
|
|
18980
|
+
}
|
|
18981
|
+
if (argv["umbraco-allowed-media-paths"]) {
|
|
18982
|
+
config.allowedMediaPaths = argv["umbraco-allowed-media-paths"].split(",").map((p) => _path.resolve.call(void 0, p.trim())).filter(Boolean);
|
|
18983
|
+
config.configSources.allowedMediaPaths = "cli";
|
|
18984
|
+
} else if (process.env.UMBRACO_ALLOWED_MEDIA_PATHS) {
|
|
18985
|
+
config.allowedMediaPaths = process.env.UMBRACO_ALLOWED_MEDIA_PATHS.split(",").map((p) => _path.resolve.call(void 0, p.trim())).filter(Boolean);
|
|
18986
|
+
config.configSources.allowedMediaPaths = "env";
|
|
18987
|
+
}
|
|
18988
|
+
if (!auth.clientId) {
|
|
18989
|
+
console.error(
|
|
18990
|
+
"UMBRACO_CLIENT_ID is required (via CLI argument --umbraco-client-id or .env file)"
|
|
18991
|
+
);
|
|
18992
|
+
process.exit(1);
|
|
18993
|
+
}
|
|
18994
|
+
if (!auth.clientSecret) {
|
|
18995
|
+
console.error(
|
|
18996
|
+
"UMBRACO_CLIENT_SECRET is required (via CLI argument --umbraco-client-secret or .env file)"
|
|
18997
|
+
);
|
|
18998
|
+
process.exit(1);
|
|
18999
|
+
}
|
|
19000
|
+
if (!auth.baseUrl) {
|
|
19001
|
+
console.error(
|
|
19002
|
+
"UMBRACO_BASE_URL is required (via CLI argument --umbraco-base-url or .env file)"
|
|
19003
|
+
);
|
|
19004
|
+
process.exit(1);
|
|
19005
|
+
}
|
|
19006
|
+
if (!isStdioMode) {
|
|
19007
|
+
console.log("\nUmbraco MCP Configuration:");
|
|
19008
|
+
console.log(`- ENV_FILE: ${envFilePath} (source: ${config.configSources.envFile})`);
|
|
19009
|
+
console.log(
|
|
19010
|
+
`- UMBRACO_CLIENT_ID: ${auth.clientId} (source: ${config.configSources.clientId})`
|
|
19011
|
+
);
|
|
19012
|
+
console.log(
|
|
19013
|
+
`- UMBRACO_CLIENT_SECRET: ${maskSecret(auth.clientSecret)} (source: ${config.configSources.clientSecret})`
|
|
19014
|
+
);
|
|
19015
|
+
console.log(
|
|
19016
|
+
`- UMBRACO_BASE_URL: ${auth.baseUrl} (source: ${config.configSources.baseUrl})`
|
|
19017
|
+
);
|
|
19018
|
+
if (config.includeToolCollections) {
|
|
19019
|
+
console.log(
|
|
19020
|
+
`- UMBRACO_INCLUDE_TOOL_COLLECTIONS: ${config.includeToolCollections.join(", ")} (source: ${config.configSources.includeToolCollections})`
|
|
19021
|
+
);
|
|
19022
|
+
}
|
|
19023
|
+
if (config.excludeToolCollections) {
|
|
19024
|
+
console.log(
|
|
19025
|
+
`- UMBRACO_EXCLUDE_TOOL_COLLECTIONS: ${config.excludeToolCollections.join(", ")} (source: ${config.configSources.excludeToolCollections})`
|
|
19026
|
+
);
|
|
19027
|
+
}
|
|
19028
|
+
if (config.includeTools) {
|
|
19029
|
+
console.log(
|
|
19030
|
+
`- UMBRACO_INCLUDE_TOOLS: ${config.includeTools.join(", ")} (source: ${config.configSources.includeTools})`
|
|
19031
|
+
);
|
|
19032
|
+
}
|
|
19033
|
+
if (config.excludeTools) {
|
|
19034
|
+
console.log(
|
|
19035
|
+
`- UMBRACO_EXCLUDE_TOOLS: ${config.excludeTools.join(", ")} (source: ${config.configSources.excludeTools})`
|
|
19036
|
+
);
|
|
19037
|
+
}
|
|
19038
|
+
if (config.allowedMediaPaths) {
|
|
19039
|
+
console.log(
|
|
19040
|
+
`- UMBRACO_ALLOWED_MEDIA_PATHS: ${config.allowedMediaPaths.join(", ")} (source: ${config.configSources.allowedMediaPaths})`
|
|
19041
|
+
);
|
|
19042
|
+
}
|
|
19043
|
+
console.log();
|
|
17699
19044
|
}
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
19045
|
+
return {
|
|
19046
|
+
...config,
|
|
19047
|
+
auth
|
|
19048
|
+
};
|
|
19049
|
+
}
|
|
17704
19050
|
|
|
19051
|
+
// src/umb-management-api/tools/media/post/helpers/validate-file-path.ts
|
|
19052
|
+
function validateFilePath(filePath, allowedPaths) {
|
|
19053
|
+
const allowedMediaPaths = _nullishCoalesce(allowedPaths, () => ( getServerConfig(true).allowedMediaPaths));
|
|
19054
|
+
if (!allowedMediaPaths || allowedMediaPaths.length === 0) {
|
|
19055
|
+
throw new Error(
|
|
19056
|
+
'File path uploads are disabled. To enable, set UMBRACO_ALLOWED_MEDIA_PATHS environment variable with comma-separated allowed directory paths (e.g., UMBRACO_ALLOWED_MEDIA_PATHS="/tmp/uploads,/var/media")'
|
|
19057
|
+
);
|
|
19058
|
+
}
|
|
19059
|
+
const normalizedPath = path.resolve(filePath);
|
|
19060
|
+
const isAllowed = allowedMediaPaths.some((allowedPath) => {
|
|
19061
|
+
const realAllowedPath = fs.realpathSync(allowedPath);
|
|
19062
|
+
return normalizedPath.startsWith(allowedPath) || normalizedPath.startsWith(realAllowedPath);
|
|
19063
|
+
});
|
|
19064
|
+
if (!isAllowed) {
|
|
19065
|
+
throw new Error(
|
|
19066
|
+
`File path "${filePath}" is not in an allowed directory. Allowed directories: ${allowedMediaPaths.join(", ")}`
|
|
19067
|
+
);
|
|
19068
|
+
}
|
|
19069
|
+
try {
|
|
19070
|
+
const stats = fs.lstatSync(normalizedPath);
|
|
19071
|
+
if (stats.isSymbolicLink()) {
|
|
19072
|
+
const realPath = fs.realpathSync(normalizedPath);
|
|
19073
|
+
const symlinkAllowed = allowedMediaPaths.some((allowedPath) => {
|
|
19074
|
+
const realAllowedPath = fs.realpathSync(allowedPath);
|
|
19075
|
+
return realPath.startsWith(allowedPath) || realPath.startsWith(realAllowedPath);
|
|
19076
|
+
});
|
|
19077
|
+
if (!symlinkAllowed) {
|
|
19078
|
+
throw new Error(
|
|
19079
|
+
`File path "${filePath}" is a symbolic link to "${realPath}" which is outside allowed directories`
|
|
19080
|
+
);
|
|
19081
|
+
}
|
|
19082
|
+
}
|
|
19083
|
+
} catch (error) {
|
|
19084
|
+
if (error.code === "ENOENT") {
|
|
19085
|
+
throw new Error(`File not found: ${filePath}`);
|
|
19086
|
+
}
|
|
19087
|
+
throw error;
|
|
19088
|
+
}
|
|
19089
|
+
return normalizedPath;
|
|
19090
|
+
}
|
|
17705
19091
|
|
|
17706
19092
|
// 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
19093
|
function getExtensionFromMimeType(mimeType) {
|
|
17713
19094
|
if (!mimeType) return void 0;
|
|
17714
19095
|
const baseMimeType = mimeType.split(";")[0].trim();
|
|
@@ -17717,13 +19098,19 @@ function getExtensionFromMimeType(mimeType) {
|
|
|
17717
19098
|
}
|
|
17718
19099
|
function validateMediaTypeForSvg(filePath, fileUrl, fileName, mediaTypeName) {
|
|
17719
19100
|
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 ===
|
|
17721
|
-
console.warn(
|
|
17722
|
-
return
|
|
19101
|
+
if (isSvg && mediaTypeName === MEDIA_TYPE_IMAGE) {
|
|
19102
|
+
console.warn(`SVG detected - using ${MEDIA_TYPE_VECTOR_GRAPHICS} media type instead of ${MEDIA_TYPE_IMAGE}`);
|
|
19103
|
+
return MEDIA_TYPE_VECTOR_GRAPHICS;
|
|
17723
19104
|
}
|
|
17724
19105
|
return mediaTypeName;
|
|
17725
19106
|
}
|
|
17726
19107
|
async function fetchMediaTypeId(client, mediaTypeName) {
|
|
19108
|
+
const standardTypeKey = Object.keys(STANDARD_MEDIA_TYPES).find(
|
|
19109
|
+
(key) => key.toLowerCase() === mediaTypeName.toLowerCase()
|
|
19110
|
+
);
|
|
19111
|
+
if (standardTypeKey) {
|
|
19112
|
+
return STANDARD_MEDIA_TYPES[standardTypeKey];
|
|
19113
|
+
}
|
|
17727
19114
|
const response = await client.getItemMediaTypeSearch({ query: mediaTypeName });
|
|
17728
19115
|
const mediaType = response.items.find(
|
|
17729
19116
|
(mt) => mt.name.toLowerCase() === mediaTypeName.toLowerCase()
|
|
@@ -17737,7 +19124,7 @@ async function fetchMediaTypeId(client, mediaTypeName) {
|
|
|
17737
19124
|
return mediaType.id;
|
|
17738
19125
|
}
|
|
17739
19126
|
function getEditorAlias(mediaTypeName) {
|
|
17740
|
-
return mediaTypeName ===
|
|
19127
|
+
return mediaTypeName === MEDIA_TYPE_IMAGE ? "Umbraco.ImageCropper" : "Umbraco.UploadField";
|
|
17741
19128
|
}
|
|
17742
19129
|
function buildValueStructure(mediaTypeName, temporaryFileId) {
|
|
17743
19130
|
const base = {
|
|
@@ -17745,7 +19132,7 @@ function buildValueStructure(mediaTypeName, temporaryFileId) {
|
|
|
17745
19132
|
editorAlias: getEditorAlias(mediaTypeName),
|
|
17746
19133
|
entityType: "media-property-value"
|
|
17747
19134
|
};
|
|
17748
|
-
if (mediaTypeName ===
|
|
19135
|
+
if (mediaTypeName === MEDIA_TYPE_IMAGE) {
|
|
17749
19136
|
return {
|
|
17750
19137
|
...base,
|
|
17751
19138
|
value: {
|
|
@@ -17765,7 +19152,7 @@ function buildValueStructure(mediaTypeName, temporaryFileId) {
|
|
|
17765
19152
|
value: { temporaryFileId }
|
|
17766
19153
|
};
|
|
17767
19154
|
}
|
|
17768
|
-
async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fileName
|
|
19155
|
+
async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fileName) {
|
|
17769
19156
|
let tempFilePath = null;
|
|
17770
19157
|
let readStream;
|
|
17771
19158
|
switch (sourceType) {
|
|
@@ -17773,10 +19160,8 @@ async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fil
|
|
|
17773
19160
|
if (!filePath) {
|
|
17774
19161
|
throw new Error("filePath is required when sourceType is 'filePath'");
|
|
17775
19162
|
}
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
}
|
|
17779
|
-
readStream = fs.createReadStream(filePath);
|
|
19163
|
+
const validatedPath = validateFilePath(filePath);
|
|
19164
|
+
readStream = fs2.createReadStream(validatedPath);
|
|
17780
19165
|
break;
|
|
17781
19166
|
case "url":
|
|
17782
19167
|
if (!fileUrl) {
|
|
@@ -17795,7 +19180,7 @@ async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fil
|
|
|
17795
19180
|
let fileNameWithExtension = fileName;
|
|
17796
19181
|
if (!fileName.includes(".")) {
|
|
17797
19182
|
const urlPath = new URL(fileUrl).pathname;
|
|
17798
|
-
const urlExtension =
|
|
19183
|
+
const urlExtension = path2.extname(urlPath);
|
|
17799
19184
|
if (urlExtension) {
|
|
17800
19185
|
fileNameWithExtension = `${fileName}${urlExtension}`;
|
|
17801
19186
|
} else {
|
|
@@ -17808,9 +19193,9 @@ async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fil
|
|
|
17808
19193
|
}
|
|
17809
19194
|
}
|
|
17810
19195
|
}
|
|
17811
|
-
tempFilePath =
|
|
17812
|
-
|
|
17813
|
-
readStream =
|
|
19196
|
+
tempFilePath = path2.join(os.tmpdir(), fileNameWithExtension);
|
|
19197
|
+
fs2.writeFileSync(tempFilePath, response.data);
|
|
19198
|
+
readStream = fs2.createReadStream(tempFilePath);
|
|
17814
19199
|
} catch (error) {
|
|
17815
19200
|
const axiosError = error;
|
|
17816
19201
|
if (axiosError.response) {
|
|
@@ -17828,17 +19213,17 @@ async function createFileStream(sourceType, filePath, fileUrl, fileAsBase64, fil
|
|
|
17828
19213
|
throw new Error("fileAsBase64 is required when sourceType is 'base64'");
|
|
17829
19214
|
}
|
|
17830
19215
|
const fileContent = Buffer.from(fileAsBase64, "base64");
|
|
17831
|
-
tempFilePath =
|
|
17832
|
-
|
|
17833
|
-
readStream =
|
|
19216
|
+
tempFilePath = path2.join(os.tmpdir(), fileName);
|
|
19217
|
+
fs2.writeFileSync(tempFilePath, fileContent);
|
|
19218
|
+
readStream = fs2.createReadStream(tempFilePath);
|
|
17834
19219
|
break;
|
|
17835
19220
|
}
|
|
17836
19221
|
return { readStream, tempFilePath };
|
|
17837
19222
|
}
|
|
17838
19223
|
function cleanupTempFile(tempFilePath) {
|
|
17839
|
-
if (tempFilePath &&
|
|
19224
|
+
if (tempFilePath && fs2.existsSync(tempFilePath)) {
|
|
17840
19225
|
try {
|
|
17841
|
-
|
|
19226
|
+
fs2.unlinkSync(tempFilePath);
|
|
17842
19227
|
} catch (e) {
|
|
17843
19228
|
console.error("Failed to cleanup temp file:", e);
|
|
17844
19229
|
}
|
|
@@ -17859,8 +19244,7 @@ async function uploadMediaFile(client, params) {
|
|
|
17859
19244
|
params.filePath,
|
|
17860
19245
|
params.fileUrl,
|
|
17861
19246
|
params.fileAsBase64,
|
|
17862
|
-
params.name
|
|
17863
|
-
params.temporaryFileId
|
|
19247
|
+
params.name
|
|
17864
19248
|
);
|
|
17865
19249
|
tempFilePath = createdTempPath;
|
|
17866
19250
|
try {
|
|
@@ -17902,7 +19286,7 @@ async function uploadMediaFile(client, params) {
|
|
|
17902
19286
|
var createMediaSchema = _zod.z.object({
|
|
17903
19287
|
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
19288
|
name: _zod.z.string().describe("The name of the media item"),
|
|
17905
|
-
mediaTypeName: _zod.z.string().describe(
|
|
19289
|
+
mediaTypeName: _zod.z.string().describe(`Media type: '${MEDIA_TYPE_IMAGE}', '${MEDIA_TYPE_ARTICLE}', '${MEDIA_TYPE_AUDIO}', '${MEDIA_TYPE_VIDEO}', '${MEDIA_TYPE_VECTOR_GRAPHICS}', '${MEDIA_TYPE_FILE}', or custom media type name`),
|
|
17906
19290
|
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17907
19291
|
fileUrl: _zod.z.string().url().optional().describe("URL to fetch the file from (required if sourceType is 'url')"),
|
|
17908
19292
|
fileAsBase64: _zod.z.string().optional().describe("Base64 encoded file data (required if sourceType is 'base64')"),
|
|
@@ -17913,16 +19297,19 @@ var CreateMediaTool = CreateUmbracoTool(
|
|
|
17913
19297
|
`Upload any media file to Umbraco (images, documents, audio, video, SVG, or custom types).
|
|
17914
19298
|
|
|
17915
19299
|
Media Types:
|
|
17916
|
-
-
|
|
17917
|
-
-
|
|
17918
|
-
-
|
|
17919
|
-
-
|
|
17920
|
-
-
|
|
17921
|
-
-
|
|
19300
|
+
- ${MEDIA_TYPE_IMAGE}: jpg, png, gif, webp, etc. (supports cropping)
|
|
19301
|
+
- ${MEDIA_TYPE_ARTICLE}: pdf, docx, doc (documents)
|
|
19302
|
+
- ${MEDIA_TYPE_AUDIO}: mp3, wav, etc.
|
|
19303
|
+
- ${MEDIA_TYPE_VIDEO}: mp4, webm, etc.
|
|
19304
|
+
- ${MEDIA_TYPE_VECTOR_GRAPHICS}: svg files only
|
|
19305
|
+
- ${MEDIA_TYPE_FILE}: any other file type
|
|
17922
19306
|
- Custom: any custom media type created in Umbraco
|
|
17923
19307
|
|
|
17924
19308
|
Source Types:
|
|
17925
19309
|
1. filePath - Most efficient for local files, works with any size
|
|
19310
|
+
SECURITY: Requires UMBRACO_ALLOWED_MEDIA_PATHS environment variable
|
|
19311
|
+
to be configured with comma-separated allowed directories.
|
|
19312
|
+
Example: UMBRACO_ALLOWED_MEDIA_PATHS="/tmp/uploads,/var/media"
|
|
17926
19313
|
2. url - Fetch from web URL
|
|
17927
19314
|
3. base64 - Only for small files (<10KB) due to token usage
|
|
17928
19315
|
|
|
@@ -17978,7 +19365,7 @@ var createMediaMultipleSchema = _zod.z.object({
|
|
|
17978
19365
|
name: _zod.z.string().describe("The name of the media item"),
|
|
17979
19366
|
filePath: _zod.z.string().optional().describe("Absolute path to the file (required if sourceType is 'filePath')"),
|
|
17980
19367
|
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(
|
|
19368
|
+
mediaTypeName: _zod.z.string().optional().describe(`Optional override: '${MEDIA_TYPE_IMAGE}', '${MEDIA_TYPE_ARTICLE}', '${MEDIA_TYPE_AUDIO}', '${MEDIA_TYPE_VIDEO}', '${MEDIA_TYPE_VECTOR_GRAPHICS}', '${MEDIA_TYPE_FILE}', or custom media type name. If not specified, defaults to '${MEDIA_TYPE_FILE}'`)
|
|
17982
19369
|
})).describe("Array of files to upload (maximum 20 files per batch)"),
|
|
17983
19370
|
parentId: _zod.z.string().uuid().optional().describe("Parent folder ID (defaults to root)")
|
|
17984
19371
|
});
|
|
@@ -17990,6 +19377,9 @@ var CreateMediaMultipleTool = CreateUmbracoTool(
|
|
|
17990
19377
|
|
|
17991
19378
|
Source Types:
|
|
17992
19379
|
1. filePath - Most efficient for local files, works with any size
|
|
19380
|
+
SECURITY: Requires UMBRACO_ALLOWED_MEDIA_PATHS environment variable
|
|
19381
|
+
to be configured with comma-separated allowed directories.
|
|
19382
|
+
Example: UMBRACO_ALLOWED_MEDIA_PATHS="/tmp/uploads,/var/media"
|
|
17993
19383
|
2. url - Fetch from web URL
|
|
17994
19384
|
|
|
17995
19385
|
Note: base64 is not supported for batch uploads due to token usage.
|
|
@@ -18012,7 +19402,7 @@ var CreateMediaMultipleTool = CreateUmbracoTool(
|
|
|
18012
19402
|
for (const file of model.files) {
|
|
18013
19403
|
try {
|
|
18014
19404
|
const temporaryFileId = _uuid.v4.call(void 0, );
|
|
18015
|
-
const defaultMediaType = file.mediaTypeName ||
|
|
19405
|
+
const defaultMediaType = file.mediaTypeName || MEDIA_TYPE_FILE;
|
|
18016
19406
|
const actualName = await uploadMediaFile(client, {
|
|
18017
19407
|
sourceType: model.sourceType,
|
|
18018
19408
|
name: file.name,
|
|
@@ -18391,7 +19781,7 @@ var EmptyRecycleBinTool2 = CreateUmbracoTool(
|
|
|
18391
19781
|
var empty_recycle_bin_default2 = EmptyRecycleBinTool2;
|
|
18392
19782
|
|
|
18393
19783
|
// src/umb-management-api/tools/media/put/restore-from-recycle-bin.ts
|
|
18394
|
-
var
|
|
19784
|
+
var RestoreFromRecycleBinTool2 = CreateUmbracoTool(
|
|
18395
19785
|
"restore-media-from-recycle-bin",
|
|
18396
19786
|
"Restores a media item from the recycle bin.",
|
|
18397
19787
|
putRecycleBinMediaByIdRestoreParams.shape,
|
|
@@ -18410,7 +19800,7 @@ var RestoreFromRecycleBinTool = CreateUmbracoTool(
|
|
|
18410
19800
|
};
|
|
18411
19801
|
}
|
|
18412
19802
|
);
|
|
18413
|
-
var
|
|
19803
|
+
var restore_from_recycle_bin_default2 = RestoreFromRecycleBinTool2;
|
|
18414
19804
|
|
|
18415
19805
|
// src/umb-management-api/tools/media/put/move-to-recycle-bin.ts
|
|
18416
19806
|
var MoveMediaToRecycleBinTool = CreateUmbracoTool(
|
|
@@ -18630,7 +20020,7 @@ var MediaCollection = {
|
|
|
18630
20020
|
tools.push(get_recycle_bin_root_default2());
|
|
18631
20021
|
tools.push(get_recycle_bin_children_default2());
|
|
18632
20022
|
tools.push(empty_recycle_bin_default2());
|
|
18633
|
-
tools.push(
|
|
20023
|
+
tools.push(restore_from_recycle_bin_default2());
|
|
18634
20024
|
tools.push(move_to_recycle_bin_default2());
|
|
18635
20025
|
tools.push(delete_from_recycle_bin_default2());
|
|
18636
20026
|
tools.push(get_media_are_referenced_default());
|
|
@@ -18893,7 +20283,7 @@ var GetMediaTypeFolderTool = CreateUmbracoTool(
|
|
|
18893
20283
|
};
|
|
18894
20284
|
}
|
|
18895
20285
|
);
|
|
18896
|
-
var
|
|
20286
|
+
var get_folder_default4 = GetMediaTypeFolderTool;
|
|
18897
20287
|
|
|
18898
20288
|
// src/umb-management-api/tools/media-type/folders/post/create-folder.ts
|
|
18899
20289
|
var CreateMediaTypeFolderTool = CreateUmbracoTool(
|
|
@@ -18913,7 +20303,7 @@ var CreateMediaTypeFolderTool = CreateUmbracoTool(
|
|
|
18913
20303
|
};
|
|
18914
20304
|
}
|
|
18915
20305
|
);
|
|
18916
|
-
var
|
|
20306
|
+
var create_folder_default4 = CreateMediaTypeFolderTool;
|
|
18917
20307
|
|
|
18918
20308
|
// src/umb-management-api/tools/media-type/folders/delete/delete-folder.ts
|
|
18919
20309
|
var DeleteMediaTypeFolderTool = CreateUmbracoTool(
|
|
@@ -18933,7 +20323,7 @@ var DeleteMediaTypeFolderTool = CreateUmbracoTool(
|
|
|
18933
20323
|
};
|
|
18934
20324
|
}
|
|
18935
20325
|
);
|
|
18936
|
-
var
|
|
20326
|
+
var delete_folder_default4 = DeleteMediaTypeFolderTool;
|
|
18937
20327
|
|
|
18938
20328
|
// src/umb-management-api/tools/media-type/folders/put/update-folder.ts
|
|
18939
20329
|
|
|
@@ -18957,16 +20347,57 @@ var UpdateMediaTypeFolderTool = CreateUmbracoTool(
|
|
|
18957
20347
|
};
|
|
18958
20348
|
}
|
|
18959
20349
|
);
|
|
18960
|
-
var
|
|
20350
|
+
var update_folder_default4 = UpdateMediaTypeFolderTool;
|
|
18961
20351
|
|
|
18962
20352
|
// src/umb-management-api/tools/media-type/post/create-media-type.ts
|
|
20353
|
+
|
|
20354
|
+
var propertySchema2 = postMediaTypeBody.shape.properties;
|
|
20355
|
+
var containerSchema = postMediaTypeBody.shape.containers;
|
|
20356
|
+
var allowedMediaTypeSchema = postMediaTypeBody.shape.allowedMediaTypes;
|
|
20357
|
+
var compositionSchema = postMediaTypeBody.shape.compositions;
|
|
20358
|
+
var collectionSchema = postMediaTypeBody.shape.collection;
|
|
20359
|
+
var createMediaTypeSchema = _zod.z.object({
|
|
20360
|
+
alias: _zod.z.string().min(1),
|
|
20361
|
+
name: _zod.z.string().min(1),
|
|
20362
|
+
description: _zod.z.string().nullish(),
|
|
20363
|
+
icon: _zod.z.string().min(1),
|
|
20364
|
+
allowedAsRoot: _zod.z.boolean(),
|
|
20365
|
+
variesByCulture: _zod.z.boolean(),
|
|
20366
|
+
variesBySegment: _zod.z.boolean(),
|
|
20367
|
+
isElement: _zod.z.boolean(),
|
|
20368
|
+
properties: propertySchema2,
|
|
20369
|
+
containers: containerSchema,
|
|
20370
|
+
id: _zod.z.string().uuid().nullish(),
|
|
20371
|
+
parentId: _zod.z.string().uuid().optional(),
|
|
20372
|
+
// Flattened parent ID
|
|
20373
|
+
allowedMediaTypes: allowedMediaTypeSchema,
|
|
20374
|
+
compositions: compositionSchema,
|
|
20375
|
+
collection: collectionSchema
|
|
20376
|
+
});
|
|
18963
20377
|
var CreateMediaTypeTool = CreateUmbracoTool(
|
|
18964
20378
|
"create-media-type",
|
|
18965
20379
|
"Creates a new media type",
|
|
18966
|
-
|
|
20380
|
+
createMediaTypeSchema.shape,
|
|
18967
20381
|
async (model) => {
|
|
18968
20382
|
const client = UmbracoManagementClient2.getClient();
|
|
18969
|
-
|
|
20383
|
+
const payload = {
|
|
20384
|
+
alias: model.alias,
|
|
20385
|
+
name: model.name,
|
|
20386
|
+
description: model.description,
|
|
20387
|
+
icon: model.icon,
|
|
20388
|
+
allowedAsRoot: model.allowedAsRoot,
|
|
20389
|
+
variesByCulture: model.variesByCulture,
|
|
20390
|
+
variesBySegment: model.variesBySegment,
|
|
20391
|
+
isElement: model.isElement,
|
|
20392
|
+
properties: model.properties,
|
|
20393
|
+
containers: model.containers,
|
|
20394
|
+
id: model.id,
|
|
20395
|
+
parent: model.parentId ? { id: model.parentId } : void 0,
|
|
20396
|
+
allowedMediaTypes: model.allowedMediaTypes,
|
|
20397
|
+
compositions: model.compositions,
|
|
20398
|
+
collection: model.collection
|
|
20399
|
+
};
|
|
20400
|
+
const response = await client.postMediaType(payload);
|
|
18970
20401
|
return {
|
|
18971
20402
|
content: [
|
|
18972
20403
|
{
|
|
@@ -19102,10 +20533,10 @@ var MediaTypeCollection = {
|
|
|
19102
20533
|
tools: (user) => {
|
|
19103
20534
|
const tools = [];
|
|
19104
20535
|
if (AuthorizationPolicies.TreeAccessMediaTypes(user)) {
|
|
19105
|
-
tools.push(
|
|
19106
|
-
tools.push(
|
|
19107
|
-
tools.push(
|
|
19108
|
-
tools.push(
|
|
20536
|
+
tools.push(get_folder_default4());
|
|
20537
|
+
tools.push(create_folder_default4());
|
|
20538
|
+
tools.push(delete_folder_default4());
|
|
20539
|
+
tools.push(update_folder_default4());
|
|
19109
20540
|
tools.push(create_media_type_default());
|
|
19110
20541
|
tools.push(copy_media_type_default());
|
|
19111
20542
|
tools.push(get_media_type_available_compositions_default());
|
|
@@ -20070,8 +21501,8 @@ var UpdatePartialViewTool = CreateUmbracoTool(
|
|
|
20070
21501
|
}).shape,
|
|
20071
21502
|
async (model) => {
|
|
20072
21503
|
const client = UmbracoManagementClient2.getClient();
|
|
20073
|
-
const { path:
|
|
20074
|
-
var response = await client.putPartialViewByPath(
|
|
21504
|
+
const { path: path4, ...updateModel } = model;
|
|
21505
|
+
var response = await client.putPartialViewByPath(path4, updateModel);
|
|
20075
21506
|
return {
|
|
20076
21507
|
content: [
|
|
20077
21508
|
{
|
|
@@ -20095,8 +21526,8 @@ var RenamePartialViewTool = CreateUmbracoTool(
|
|
|
20095
21526
|
}).shape,
|
|
20096
21527
|
async (model) => {
|
|
20097
21528
|
const client = UmbracoManagementClient2.getClient();
|
|
20098
|
-
const { path:
|
|
20099
|
-
const normalizedPath = encodeURIComponent(
|
|
21529
|
+
const { path: path4, ...renameModel } = model;
|
|
21530
|
+
const normalizedPath = encodeURIComponent(path4);
|
|
20100
21531
|
var response = await client.putPartialViewByPathRename(normalizedPath, renameModel);
|
|
20101
21532
|
return {
|
|
20102
21533
|
content: [
|
|
@@ -21416,9 +22847,9 @@ var CreateTemporaryFileTool = CreateUmbracoTool(
|
|
|
21416
22847
|
let tempFilePath = null;
|
|
21417
22848
|
try {
|
|
21418
22849
|
const fileContent = Buffer.from(model.fileAsBase64, "base64");
|
|
21419
|
-
tempFilePath =
|
|
21420
|
-
|
|
21421
|
-
const readStream =
|
|
22850
|
+
tempFilePath = path3.join(os2.tmpdir(), `umbraco-upload-${model.id}-${model.fileName}`);
|
|
22851
|
+
fs3.writeFileSync(tempFilePath, fileContent);
|
|
22852
|
+
const readStream = fs3.createReadStream(tempFilePath);
|
|
21422
22853
|
const client = UmbracoManagementClient2.getClient();
|
|
21423
22854
|
await client.postTemporaryFile({
|
|
21424
22855
|
Id: model.id,
|
|
@@ -21443,9 +22874,9 @@ var CreateTemporaryFileTool = CreateUmbracoTool(
|
|
|
21443
22874
|
isError: true
|
|
21444
22875
|
};
|
|
21445
22876
|
} finally {
|
|
21446
|
-
if (tempFilePath &&
|
|
22877
|
+
if (tempFilePath && fs3.existsSync(tempFilePath)) {
|
|
21447
22878
|
try {
|
|
21448
|
-
|
|
22879
|
+
fs3.unlinkSync(tempFilePath);
|
|
21449
22880
|
} catch (e) {
|
|
21450
22881
|
console.error("Failed to cleanup temp file:", e);
|
|
21451
22882
|
}
|
|
@@ -21552,7 +22983,7 @@ var TemporaryFileCollection = {
|
|
|
21552
22983
|
name: "temporary-file",
|
|
21553
22984
|
displayName: "Temporary Files",
|
|
21554
22985
|
description: "Temporary file management and upload handling",
|
|
21555
|
-
dependencies: [
|
|
22986
|
+
dependencies: []
|
|
21556
22987
|
},
|
|
21557
22988
|
tools: (user) => {
|
|
21558
22989
|
const tools = [];
|
|
@@ -21569,9 +23000,9 @@ var GetScriptByPathTool = CreateUmbracoTool(
|
|
|
21569
23000
|
"get-script-by-path",
|
|
21570
23001
|
"Gets a script by path",
|
|
21571
23002
|
getScriptByPathParams.shape,
|
|
21572
|
-
async ({ path:
|
|
23003
|
+
async ({ path: path4 }) => {
|
|
21573
23004
|
const client = UmbracoManagementClient2.getClient();
|
|
21574
|
-
const response = await client.getScriptByPath(
|
|
23005
|
+
const response = await client.getScriptByPath(path4);
|
|
21575
23006
|
return {
|
|
21576
23007
|
content: [
|
|
21577
23008
|
{
|
|
@@ -21589,9 +23020,9 @@ var GetScriptFolderByPathTool = CreateUmbracoTool(
|
|
|
21589
23020
|
"get-script-folder-by-path",
|
|
21590
23021
|
"Gets a script folder by path",
|
|
21591
23022
|
getScriptFolderByPathParams.shape,
|
|
21592
|
-
async ({ path:
|
|
23023
|
+
async ({ path: path4 }) => {
|
|
21593
23024
|
const client = UmbracoManagementClient2.getClient();
|
|
21594
|
-
const response = await client.getScriptFolderByPath(
|
|
23025
|
+
const response = await client.getScriptFolderByPath(path4);
|
|
21595
23026
|
return {
|
|
21596
23027
|
content: [
|
|
21597
23028
|
{
|
|
@@ -21800,9 +23231,9 @@ var DeleteScriptTool = CreateUmbracoTool(
|
|
|
21800
23231
|
"delete-script",
|
|
21801
23232
|
"Deletes a script by path",
|
|
21802
23233
|
deleteScriptByPathParams.shape,
|
|
21803
|
-
async ({ path:
|
|
23234
|
+
async ({ path: path4 }) => {
|
|
21804
23235
|
const client = UmbracoManagementClient2.getClient();
|
|
21805
|
-
const response = await client.deleteScriptByPath(
|
|
23236
|
+
const response = await client.deleteScriptByPath(path4);
|
|
21806
23237
|
return {
|
|
21807
23238
|
content: [
|
|
21808
23239
|
{
|
|
@@ -21820,9 +23251,9 @@ var DeleteScriptFolderTool = CreateUmbracoTool(
|
|
|
21820
23251
|
"delete-script-folder",
|
|
21821
23252
|
"Deletes a script folder by path",
|
|
21822
23253
|
deleteScriptFolderByPathParams.shape,
|
|
21823
|
-
async ({ path:
|
|
23254
|
+
async ({ path: path4 }) => {
|
|
21824
23255
|
const client = UmbracoManagementClient2.getClient();
|
|
21825
|
-
const response = await client.deleteScriptFolderByPath(
|
|
23256
|
+
const response = await client.deleteScriptFolderByPath(path4);
|
|
21826
23257
|
return {
|
|
21827
23258
|
content: [
|
|
21828
23259
|
{
|
|
@@ -21864,13 +23295,26 @@ var ScriptCollection = {
|
|
|
21864
23295
|
};
|
|
21865
23296
|
|
|
21866
23297
|
// src/umb-management-api/tools/stylesheet/post/create-stylesheet.ts
|
|
23298
|
+
|
|
23299
|
+
var createStylesheetSchema = _zod.z.object({
|
|
23300
|
+
name: _zod.z.string().min(1, "Name is required"),
|
|
23301
|
+
path: _zod.z.string().optional(),
|
|
23302
|
+
content: _zod.z.string().min(1, "Content is required")
|
|
23303
|
+
});
|
|
21867
23304
|
var CreateStylesheetTool = CreateUmbracoTool(
|
|
21868
23305
|
"create-stylesheet",
|
|
21869
|
-
|
|
21870
|
-
|
|
23306
|
+
`Creates a new stylesheet.`,
|
|
23307
|
+
createStylesheetSchema.shape,
|
|
21871
23308
|
async (model) => {
|
|
21872
23309
|
const client = UmbracoManagementClient2.getClient();
|
|
21873
|
-
|
|
23310
|
+
const normalizedPath = model.path && !model.path.startsWith("/") ? `/${model.path}` : model.path;
|
|
23311
|
+
const name = model.name.endsWith(".css") ? model.name : `${model.name}.css`;
|
|
23312
|
+
const payload = {
|
|
23313
|
+
name,
|
|
23314
|
+
content: model.content,
|
|
23315
|
+
parent: normalizedPath ? { path: normalizedPath } : void 0
|
|
23316
|
+
};
|
|
23317
|
+
const response = await client.postStylesheet(payload);
|
|
21874
23318
|
return {
|
|
21875
23319
|
content: [
|
|
21876
23320
|
{
|
|
@@ -21954,8 +23398,8 @@ var UpdateStylesheetTool = CreateUmbracoTool(
|
|
|
21954
23398
|
}).shape,
|
|
21955
23399
|
async (model) => {
|
|
21956
23400
|
const client = UmbracoManagementClient2.getClient();
|
|
21957
|
-
const { path:
|
|
21958
|
-
var response = await client.putStylesheetByPath(
|
|
23401
|
+
const { path: path4, ...updateModel } = model;
|
|
23402
|
+
var response = await client.putStylesheetByPath(path4, updateModel);
|
|
21959
23403
|
return {
|
|
21960
23404
|
content: [
|
|
21961
23405
|
{
|
|
@@ -21979,8 +23423,8 @@ var RenameStylesheetTool = CreateUmbracoTool(
|
|
|
21979
23423
|
}).shape,
|
|
21980
23424
|
async (model) => {
|
|
21981
23425
|
const client = UmbracoManagementClient2.getClient();
|
|
21982
|
-
const { path:
|
|
21983
|
-
const normalizedPath = encodeURIComponent(
|
|
23426
|
+
const { path: path4, ...renameModel } = model;
|
|
23427
|
+
const normalizedPath = encodeURIComponent(path4);
|
|
21984
23428
|
var response = await client.putStylesheetByPathRename(normalizedPath, renameModel);
|
|
21985
23429
|
return {
|
|
21986
23430
|
content: [
|
|
@@ -23061,7 +24505,7 @@ var UserCollection = {
|
|
|
23061
24505
|
name: "user",
|
|
23062
24506
|
displayName: "Users",
|
|
23063
24507
|
description: "User account management and administration",
|
|
23064
|
-
dependencies: []
|
|
24508
|
+
dependencies: ["temporary-file"]
|
|
23065
24509
|
},
|
|
23066
24510
|
tools: (user) => {
|
|
23067
24511
|
const tools = [];
|
|
@@ -23529,7 +24973,7 @@ var GetDataTypeFolderResource = CreateUmbracoTemplateResource(
|
|
|
23529
24973
|
}
|
|
23530
24974
|
}
|
|
23531
24975
|
);
|
|
23532
|
-
var
|
|
24976
|
+
var get_folder_default5 = GetDataTypeFolderResource;
|
|
23533
24977
|
|
|
23534
24978
|
// src/umb-management-api/resources/data-types/get/get-is-used.ts
|
|
23535
24979
|
var GetDataTypeIsUsedResource = CreateUmbracoTemplateResource(
|
|
@@ -23754,7 +25198,7 @@ var get_search_default5 = GetDataTypeSearchResource;
|
|
|
23754
25198
|
var DataTypeTemplateResources = [
|
|
23755
25199
|
get_ancestors_default12,
|
|
23756
25200
|
get_children_default12,
|
|
23757
|
-
|
|
25201
|
+
get_folder_default5,
|
|
23758
25202
|
get_is_used_default,
|
|
23759
25203
|
get_query_default,
|
|
23760
25204
|
get_references_default,
|
|
@@ -23811,188 +25255,6 @@ function ResourceFactory(server) {
|
|
|
23811
25255
|
);
|
|
23812
25256
|
}
|
|
23813
25257
|
|
|
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
|
-
|
|
23996
25258
|
// src/index.ts
|
|
23997
25259
|
var main = async () => {
|
|
23998
25260
|
const config = getServerConfig(true);
|
|
@@ -24000,6 +25262,7 @@ var main = async () => {
|
|
|
24000
25262
|
const server = UmbracoMcpServer.GetServer();
|
|
24001
25263
|
const client = UmbracoManagementClient2.getClient();
|
|
24002
25264
|
const user = await client.getUserCurrent();
|
|
25265
|
+
await checkUmbracoVersion(client);
|
|
24003
25266
|
ResourceFactory(server);
|
|
24004
25267
|
UmbracoToolFactory(server, user, config);
|
|
24005
25268
|
const transport = new StdioServerTransport();
|