@appaflytech/wappa-mcp 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -0
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/dist/auth.d.ts +20 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +58 -0
- package/dist/auth.js.map +1 -0
- package/dist/base-components.d.ts +52 -0
- package/dist/base-components.d.ts.map +1 -0
- package/dist/base-components.js +552 -0
- package/dist/base-components.js.map +1 -0
- package/dist/client.d.ts +141 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +341 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +287 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/components.d.ts +217 -0
- package/dist/tools/components.d.ts.map +1 -0
- package/dist/tools/components.js +258 -0
- package/dist/tools/components.js.map +1 -0
- package/dist/tools/dynamic-entities.d.ts +308 -0
- package/dist/tools/dynamic-entities.d.ts.map +1 -0
- package/dist/tools/dynamic-entities.js +278 -0
- package/dist/tools/dynamic-entities.js.map +1 -0
- package/dist/tools/entities.d.ts +212 -0
- package/dist/tools/entities.d.ts.map +1 -0
- package/dist/tools/entities.js +223 -0
- package/dist/tools/entities.js.map +1 -0
- package/dist/tools/general.d.ts +93 -0
- package/dist/tools/general.d.ts.map +1 -0
- package/dist/tools/general.js +218 -0
- package/dist/tools/general.js.map +1 -0
- package/dist/tools/languages.d.ts +157 -0
- package/dist/tools/languages.d.ts.map +1 -0
- package/dist/tools/languages.js +142 -0
- package/dist/tools/languages.js.map +1 -0
- package/dist/tools/layouts.d.ts +244 -0
- package/dist/tools/layouts.d.ts.map +1 -0
- package/dist/tools/layouts.js +218 -0
- package/dist/tools/layouts.js.map +1 -0
- package/dist/tools/menus.d.ts +154 -0
- package/dist/tools/menus.d.ts.map +1 -0
- package/dist/tools/menus.js +173 -0
- package/dist/tools/menus.js.map +1 -0
- package/dist/tools/pages.d.ts +472 -0
- package/dist/tools/pages.d.ts.map +1 -0
- package/dist/tools/pages.js +465 -0
- package/dist/tools/pages.js.map +1 -0
- package/dist/tools/queries.d.ts +221 -0
- package/dist/tools/queries.d.ts.map +1 -0
- package/dist/tools/queries.js +210 -0
- package/dist/tools/queries.js.map +1 -0
- package/dist/tools/sites.d.ts +187 -0
- package/dist/tools/sites.d.ts.map +1 -0
- package/dist/tools/sites.js +167 -0
- package/dist/tools/sites.js.map +1 -0
- package/dist/tools/themes.d.ts +182 -0
- package/dist/tools/themes.d.ts.map +1 -0
- package/dist/tools/themes.js +175 -0
- package/dist/tools/themes.js.map +1 -0
- package/dist/tools/widgets.d.ts +216 -0
- package/dist/tools/widgets.d.ts.map +1 -0
- package/dist/tools/widgets.js +182 -0
- package/dist/tools/widgets.js.map +1 -0
- package/package.json +50 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAP Sites CRUD operations
|
|
3
|
+
* Sites = tenant/domain definitions in the platform
|
|
4
|
+
*/
|
|
5
|
+
export function getSiteTools(client) {
|
|
6
|
+
return {
|
|
7
|
+
// ─── List Sites ────────────────────────────────────────
|
|
8
|
+
list_sites: {
|
|
9
|
+
description: "WAP üzerindeki tüm siteleri listeler. Her site bir tenant/domain temsil eder.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
key: { type: "string", description: "Site key ile filtrele" },
|
|
14
|
+
title: { type: "string", description: "Site başlığı ile filtrele" },
|
|
15
|
+
pageIndex: {
|
|
16
|
+
type: "number",
|
|
17
|
+
description: "Sayfa numarası (0-based)",
|
|
18
|
+
},
|
|
19
|
+
pageLength: {
|
|
20
|
+
type: "number",
|
|
21
|
+
description: "Sayfa boyutu (varsayılan: 20)",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
handler: async (args) => {
|
|
26
|
+
const params = {};
|
|
27
|
+
if (args.key)
|
|
28
|
+
params.key = args.key;
|
|
29
|
+
if (args.title)
|
|
30
|
+
params.title = args.title;
|
|
31
|
+
if (args.pageIndex !== undefined)
|
|
32
|
+
params.pageIndex = String(args.pageIndex);
|
|
33
|
+
if (args.pageLength !== undefined)
|
|
34
|
+
params.pageLength = String(args.pageLength);
|
|
35
|
+
const result = await client.getSites(params);
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
39
|
+
],
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
// ─── Get Site ─────────────────────────────────────────
|
|
44
|
+
get_site: {
|
|
45
|
+
description: "Belirli bir sitenin detaylarını ID ile getirir.",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
id: { type: "string", description: "Site ID (GUID)" },
|
|
50
|
+
},
|
|
51
|
+
required: ["id"],
|
|
52
|
+
},
|
|
53
|
+
handler: async (args) => {
|
|
54
|
+
const result = await client.getSite(args.id);
|
|
55
|
+
return {
|
|
56
|
+
content: [
|
|
57
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
58
|
+
],
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
// ─── Create Site ──────────────────────────────────────
|
|
63
|
+
create_site: {
|
|
64
|
+
description: `Yeni bir site (tenant) oluşturur.
|
|
65
|
+
'key': Site'ın benzersiz anahtarı (örn: "sayinlaw.com.tr"). URL routing'de kullanılır.
|
|
66
|
+
'service': WAP backend Ui.API URL'i (örn: "https://api.sayinlaw.com.tr").
|
|
67
|
+
'url': Site'ın public URL'i (örn: "https://sayinlaw.com.tr").`,
|
|
68
|
+
inputSchema: {
|
|
69
|
+
type: "object",
|
|
70
|
+
properties: {
|
|
71
|
+
key: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: 'Site benzersiz anahtarı (domain, örn: "mysite.com")',
|
|
74
|
+
},
|
|
75
|
+
title: { type: "string", description: "Site başlığı" },
|
|
76
|
+
service: {
|
|
77
|
+
type: "string",
|
|
78
|
+
description: 'WAP Ui.API base URL (örn: "https://api.mysite.com")',
|
|
79
|
+
},
|
|
80
|
+
url: {
|
|
81
|
+
type: "string",
|
|
82
|
+
description: 'Site public URL (örn: "https://mysite.com")',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
required: ["key", "title"],
|
|
86
|
+
},
|
|
87
|
+
handler: async (args) => {
|
|
88
|
+
const result = await client.createSite(args);
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
// ─── Update Site ──────────────────────────────────────
|
|
97
|
+
update_site: {
|
|
98
|
+
description: "Mevcut bir siteyi günceller.",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {
|
|
102
|
+
id: { type: "string", description: "Güncellenecek site ID" },
|
|
103
|
+
title: { type: "string", description: "Yeni site başlığı" },
|
|
104
|
+
service: { type: "string", description: "Yeni Ui.API URL" },
|
|
105
|
+
url: { type: "string", description: "Yeni public URL" },
|
|
106
|
+
},
|
|
107
|
+
required: ["id", "title"],
|
|
108
|
+
},
|
|
109
|
+
handler: async (args) => {
|
|
110
|
+
const { id, ...data } = args;
|
|
111
|
+
const result = await client.updateSite(id, data);
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
// ─── Delete Site ──────────────────────────────────────
|
|
120
|
+
delete_site: {
|
|
121
|
+
description: "Bir siteyi siler. DİKKAT: Bu işlem geri alınamaz.",
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
id: { type: "string", description: "Silinecek site ID" },
|
|
126
|
+
},
|
|
127
|
+
required: ["id"],
|
|
128
|
+
},
|
|
129
|
+
handler: async (args) => {
|
|
130
|
+
const result = await client.deleteSite(args.id);
|
|
131
|
+
return {
|
|
132
|
+
content: [
|
|
133
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
134
|
+
],
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
// ─── Get Sites with Entities ──────────────────────────
|
|
139
|
+
get_sites_with_entities: {
|
|
140
|
+
description: "Siteleri ilişkili entity bilgileriyle birlikte getirir. Hangi entity'lerin hangi sitelerde kullanıldığını görmek için kullanılır.",
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object",
|
|
143
|
+
properties: {
|
|
144
|
+
search: { type: "string", description: "Arama terimi" },
|
|
145
|
+
pageIndex: { type: "number", description: "Sayfa numarası" },
|
|
146
|
+
pageLength: { type: "number", description: "Sayfa boyutu" },
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
handler: async (args) => {
|
|
150
|
+
const params = {};
|
|
151
|
+
if (args.search)
|
|
152
|
+
params.search = args.search;
|
|
153
|
+
if (args.pageIndex !== undefined)
|
|
154
|
+
params.pageIndex = String(args.pageIndex);
|
|
155
|
+
if (args.pageLength !== undefined)
|
|
156
|
+
params.pageLength = String(args.pageLength);
|
|
157
|
+
const result = await client.getSitesWithEntities(params);
|
|
158
|
+
return {
|
|
159
|
+
content: [
|
|
160
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
161
|
+
],
|
|
162
|
+
};
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=sites.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sites.js","sourceRoot":"","sources":["../../src/tools/sites.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAI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IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;qBACjE;iBACF,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAP Theme Settings CRUD
|
|
3
|
+
* Themes = color palettes, font sizes, and visual tokens for sites
|
|
4
|
+
*/
|
|
5
|
+
import { WapClient } from "../client.js";
|
|
6
|
+
export declare function getThemeTools(client: WapClient): {
|
|
7
|
+
list_themes: {
|
|
8
|
+
description: string;
|
|
9
|
+
inputSchema: {
|
|
10
|
+
type: "object";
|
|
11
|
+
properties: {
|
|
12
|
+
title: {
|
|
13
|
+
type: string;
|
|
14
|
+
description: string;
|
|
15
|
+
};
|
|
16
|
+
pageIndex: {
|
|
17
|
+
type: string;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
pageLength: {
|
|
21
|
+
type: string;
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
handler: (args: {
|
|
27
|
+
title?: string;
|
|
28
|
+
pageIndex?: number;
|
|
29
|
+
pageLength?: number;
|
|
30
|
+
}) => Promise<{
|
|
31
|
+
content: {
|
|
32
|
+
type: "text";
|
|
33
|
+
text: string;
|
|
34
|
+
}[];
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
get_theme: {
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: "object";
|
|
41
|
+
properties: {
|
|
42
|
+
id: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
required: string[];
|
|
48
|
+
};
|
|
49
|
+
handler: (args: {
|
|
50
|
+
id: string;
|
|
51
|
+
}) => Promise<{
|
|
52
|
+
content: {
|
|
53
|
+
type: "text";
|
|
54
|
+
text: string;
|
|
55
|
+
}[];
|
|
56
|
+
}>;
|
|
57
|
+
};
|
|
58
|
+
create_theme: {
|
|
59
|
+
description: string;
|
|
60
|
+
inputSchema: {
|
|
61
|
+
type: "object";
|
|
62
|
+
properties: {
|
|
63
|
+
title: {
|
|
64
|
+
type: string;
|
|
65
|
+
description: string;
|
|
66
|
+
};
|
|
67
|
+
colors: {
|
|
68
|
+
type: string;
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
mobileColors: {
|
|
72
|
+
type: string;
|
|
73
|
+
description: string;
|
|
74
|
+
};
|
|
75
|
+
fontSizes: {
|
|
76
|
+
type: string;
|
|
77
|
+
description: string;
|
|
78
|
+
};
|
|
79
|
+
mobileFontSizes: {
|
|
80
|
+
type: string;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
neutrals: {
|
|
84
|
+
type: string;
|
|
85
|
+
description: string;
|
|
86
|
+
};
|
|
87
|
+
accessType: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
selectedSiteIds: {
|
|
92
|
+
type: string;
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
required: string[];
|
|
97
|
+
};
|
|
98
|
+
handler: (args: Record<string, unknown>) => Promise<{
|
|
99
|
+
content: {
|
|
100
|
+
type: "text";
|
|
101
|
+
text: string;
|
|
102
|
+
}[];
|
|
103
|
+
}>;
|
|
104
|
+
};
|
|
105
|
+
update_theme: {
|
|
106
|
+
description: string;
|
|
107
|
+
inputSchema: {
|
|
108
|
+
type: "object";
|
|
109
|
+
properties: {
|
|
110
|
+
id: {
|
|
111
|
+
type: string;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
title: {
|
|
115
|
+
type: string;
|
|
116
|
+
description: string;
|
|
117
|
+
};
|
|
118
|
+
colors: {
|
|
119
|
+
type: string;
|
|
120
|
+
description: string;
|
|
121
|
+
};
|
|
122
|
+
mobileColors: {
|
|
123
|
+
type: string;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
fontSizes: {
|
|
127
|
+
type: string;
|
|
128
|
+
description: string;
|
|
129
|
+
};
|
|
130
|
+
mobileFontSizes: {
|
|
131
|
+
type: string;
|
|
132
|
+
description: string;
|
|
133
|
+
};
|
|
134
|
+
neutrals: {
|
|
135
|
+
type: string;
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
accessType: {
|
|
139
|
+
type: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
selectedSiteIds: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
status: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
required: string[];
|
|
152
|
+
};
|
|
153
|
+
handler: (args: Record<string, unknown>) => Promise<{
|
|
154
|
+
content: {
|
|
155
|
+
type: "text";
|
|
156
|
+
text: string;
|
|
157
|
+
}[];
|
|
158
|
+
}>;
|
|
159
|
+
};
|
|
160
|
+
delete_theme: {
|
|
161
|
+
description: string;
|
|
162
|
+
inputSchema: {
|
|
163
|
+
type: "object";
|
|
164
|
+
properties: {
|
|
165
|
+
id: {
|
|
166
|
+
type: string;
|
|
167
|
+
description: string;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
required: string[];
|
|
171
|
+
};
|
|
172
|
+
handler: (args: {
|
|
173
|
+
id: string;
|
|
174
|
+
}) => Promise<{
|
|
175
|
+
content: {
|
|
176
|
+
type: "text";
|
|
177
|
+
text: string;
|
|
178
|
+
}[];
|
|
179
|
+
}>;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/tools/themes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;wBAiBnB;YACpB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB;;;;;;;;;;;;;;;;;;;wBA2BqB;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA0Dd,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAyCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;wBAyBvB;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;EAUzC"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAP Theme Settings CRUD
|
|
3
|
+
* Themes = color palettes, font sizes, and visual tokens for sites
|
|
4
|
+
*/
|
|
5
|
+
export function getThemeTools(client) {
|
|
6
|
+
return {
|
|
7
|
+
// ─── List Themes ──────────────────────────────────────
|
|
8
|
+
list_themes: {
|
|
9
|
+
description: "WAP tema ayarlarını listeler. Temalar renk paleti ve yazı boyutlarını tanımlar.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
type: "object",
|
|
12
|
+
properties: {
|
|
13
|
+
title: { type: "string", description: "Tema başlığı ile filtrele" },
|
|
14
|
+
pageIndex: {
|
|
15
|
+
type: "number",
|
|
16
|
+
description: "Sayfa numarası (0-based)",
|
|
17
|
+
},
|
|
18
|
+
pageLength: { type: "number", description: "Sayfa boyutu" },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
handler: async (args) => {
|
|
22
|
+
const params = {};
|
|
23
|
+
if (args.title)
|
|
24
|
+
params.title = args.title;
|
|
25
|
+
if (args.pageIndex !== undefined)
|
|
26
|
+
params.pageIndex = String(args.pageIndex);
|
|
27
|
+
if (args.pageLength !== undefined)
|
|
28
|
+
params.pageLength = String(args.pageLength);
|
|
29
|
+
const result = await client.getThemes(params);
|
|
30
|
+
return {
|
|
31
|
+
content: [
|
|
32
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
// ─── Get Theme ────────────────────────────────────────
|
|
38
|
+
get_theme: {
|
|
39
|
+
description: "Belirli bir temanın tüm renk ve yazı boyutu detaylarını getirir.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {
|
|
43
|
+
id: { type: "string", description: "Tema ID (GUID)" },
|
|
44
|
+
},
|
|
45
|
+
required: ["id"],
|
|
46
|
+
},
|
|
47
|
+
handler: async (args) => {
|
|
48
|
+
const result = await client.getTheme(args.id);
|
|
49
|
+
return {
|
|
50
|
+
content: [
|
|
51
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
// ─── Create Theme ─────────────────────────────────────
|
|
57
|
+
create_theme: {
|
|
58
|
+
description: `Yeni bir tema oluşturur.
|
|
59
|
+
'colors': Renk paleti (CSS custom property isimleri ile). Örnek:
|
|
60
|
+
{
|
|
61
|
+
"primary": "#1a73e8",
|
|
62
|
+
"secondary": "#4caf50",
|
|
63
|
+
"background": "#ffffff",
|
|
64
|
+
"text": "#333333"
|
|
65
|
+
}
|
|
66
|
+
'fontSizes': Yazı boyutları. Örnek: { "sm": "14px", "md": "16px", "lg": "20px" }
|
|
67
|
+
'mobileColors': Mobil için ayrı renk paleti (opsiyonel).
|
|
68
|
+
'neutrals': Nötr renkler (gri tonları vb).`,
|
|
69
|
+
inputSchema: {
|
|
70
|
+
type: "object",
|
|
71
|
+
properties: {
|
|
72
|
+
title: { type: "string", description: "Tema başlığı" },
|
|
73
|
+
colors: {
|
|
74
|
+
type: "object",
|
|
75
|
+
description: "Renk paleti (CSS token isimleri → hex/rgb değerleri)",
|
|
76
|
+
},
|
|
77
|
+
mobileColors: {
|
|
78
|
+
type: "object",
|
|
79
|
+
description: "Mobil renk paleti (opsiyonel, farklıysa)",
|
|
80
|
+
},
|
|
81
|
+
fontSizes: {
|
|
82
|
+
type: "object",
|
|
83
|
+
description: "Yazı boyutları (opsiyonel)",
|
|
84
|
+
},
|
|
85
|
+
mobileFontSizes: {
|
|
86
|
+
type: "object",
|
|
87
|
+
description: "Mobil yazı boyutları (opsiyonel)",
|
|
88
|
+
},
|
|
89
|
+
neutrals: {
|
|
90
|
+
type: "object",
|
|
91
|
+
description: "Nötr renkler (gri tonları, opsiyonel)",
|
|
92
|
+
},
|
|
93
|
+
accessType: {
|
|
94
|
+
type: "number",
|
|
95
|
+
description: "Erişim tipi: 0=public, 1=private",
|
|
96
|
+
},
|
|
97
|
+
selectedSiteIds: {
|
|
98
|
+
type: "array",
|
|
99
|
+
description: "Erişilebilecek site ID'leri",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
required: ["title"],
|
|
103
|
+
},
|
|
104
|
+
handler: async (args) => {
|
|
105
|
+
const result = await client.createTheme(args);
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
109
|
+
],
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
// ─── Update Theme ─────────────────────────────────────
|
|
114
|
+
update_theme: {
|
|
115
|
+
description: "Mevcut bir temayı günceller.",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
type: "object",
|
|
118
|
+
properties: {
|
|
119
|
+
id: { type: "string", description: "Güncellenecek tema ID" },
|
|
120
|
+
title: { type: "string", description: "Yeni başlık" },
|
|
121
|
+
colors: { type: "object", description: "Güncellenmiş renk paleti" },
|
|
122
|
+
mobileColors: {
|
|
123
|
+
type: "object",
|
|
124
|
+
description: "Güncellenmiş mobil renk paleti",
|
|
125
|
+
},
|
|
126
|
+
fontSizes: {
|
|
127
|
+
type: "object",
|
|
128
|
+
description: "Güncellenmiş yazı boyutları",
|
|
129
|
+
},
|
|
130
|
+
mobileFontSizes: {
|
|
131
|
+
type: "object",
|
|
132
|
+
description: "Güncellenmiş mobil yazı boyutları",
|
|
133
|
+
},
|
|
134
|
+
neutrals: {
|
|
135
|
+
type: "object",
|
|
136
|
+
description: "Güncellenmiş nötr renkler",
|
|
137
|
+
},
|
|
138
|
+
accessType: { type: "number", description: "Erişim tipi" },
|
|
139
|
+
selectedSiteIds: { type: "array", description: "Site ID'leri" },
|
|
140
|
+
status: { type: "string", description: "Durum: Published | Draft" },
|
|
141
|
+
},
|
|
142
|
+
required: ["id"],
|
|
143
|
+
},
|
|
144
|
+
handler: async (args) => {
|
|
145
|
+
const { id, ...data } = args;
|
|
146
|
+
const result = await client.updateTheme(id, data);
|
|
147
|
+
return {
|
|
148
|
+
content: [
|
|
149
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
// ─── Delete Theme ─────────────────────────────────────
|
|
155
|
+
delete_theme: {
|
|
156
|
+
description: "Bir temayı siler. Bu temayı kullanan layout'lar etkilenebilir.",
|
|
157
|
+
inputSchema: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
id: { type: "string", description: "Silinecek tema ID" },
|
|
161
|
+
},
|
|
162
|
+
required: ["id"],
|
|
163
|
+
},
|
|
164
|
+
handler: async (args) => {
|
|
165
|
+
const result = await client.deleteTheme(args.id);
|
|
166
|
+
return {
|
|
167
|
+
content: [
|
|
168
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
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