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