@appaflytech/wappa-mcp 0.0.10 → 0.0.12
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 +40 -0
- package/dist/auth.d.ts +25 -0
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +35 -0
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts +39 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +159 -6
- package/dist/client.js.map +1 -1
- package/dist/factory.d.ts +32 -0
- package/dist/factory.d.ts.map +1 -0
- package/dist/factory.js +286 -0
- package/dist/factory.js.map +1 -0
- package/dist/http/auth.d.ts +33 -0
- package/dist/http/auth.d.ts.map +1 -0
- package/dist/http/auth.js +55 -0
- package/dist/http/auth.js.map +1 -0
- package/dist/http/session.d.ts +30 -0
- package/dist/http/session.d.ts.map +1 -0
- package/dist/http/session.js +56 -0
- package/dist/http/session.js.map +1 -0
- package/dist/http/transport.d.ts +21 -0
- package/dist/http/transport.d.ts.map +1 -0
- package/dist/http/transport.js +101 -0
- package/dist/http/transport.js.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -262
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +25 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +94 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/ai-chat-sessions.d.ts +143 -0
- package/dist/tools/ai-chat-sessions.d.ts.map +1 -0
- package/dist/tools/ai-chat-sessions.js +144 -0
- package/dist/tools/ai-chat-sessions.js.map +1 -0
- package/dist/tools/app-users.d.ts +440 -0
- package/dist/tools/app-users.d.ts.map +1 -0
- package/dist/tools/app-users.js +347 -0
- package/dist/tools/app-users.js.map +1 -0
- package/dist/tools/component-categories.d.ts +157 -0
- package/dist/tools/component-categories.d.ts.map +1 -0
- package/dist/tools/component-categories.js +162 -0
- package/dist/tools/component-categories.js.map +1 -0
- package/dist/tools/countries.d.ts +148 -0
- package/dist/tools/countries.d.ts.map +1 -0
- package/dist/tools/countries.js +142 -0
- package/dist/tools/countries.js.map +1 -0
- package/dist/tools/db-routines.d.ts +229 -0
- package/dist/tools/db-routines.d.ts.map +1 -0
- package/dist/tools/db-routines.js +233 -0
- package/dist/tools/db-routines.js.map +1 -0
- package/dist/tools/dynamic-entities.d.ts +166 -0
- package/dist/tools/dynamic-entities.d.ts.map +1 -1
- package/dist/tools/dynamic-entities.js +156 -0
- package/dist/tools/dynamic-entities.js.map +1 -1
- package/dist/tools/entities.d.ts +119 -0
- package/dist/tools/entities.d.ts.map +1 -1
- package/dist/tools/entities.js +413 -4
- package/dist/tools/entities.js.map +1 -1
- package/dist/tools/error-logs.d.ts +67 -0
- package/dist/tools/error-logs.d.ts.map +1 -0
- package/dist/tools/error-logs.js +74 -0
- package/dist/tools/error-logs.js.map +1 -0
- package/dist/tools/general.d.ts.map +1 -1
- package/dist/tools/general.js +218 -0
- package/dist/tools/general.js.map +1 -1
- package/dist/tools/layouts.d.ts +21 -0
- package/dist/tools/layouts.d.ts.map +1 -1
- package/dist/tools/layouts.js +20 -2
- package/dist/tools/layouts.js.map +1 -1
- package/dist/tools/operations.d.ts +184 -0
- package/dist/tools/operations.d.ts.map +1 -0
- package/dist/tools/operations.js +217 -0
- package/dist/tools/operations.js.map +1 -0
- package/dist/tools/organizations.d.ts +178 -0
- package/dist/tools/organizations.d.ts.map +1 -0
- package/dist/tools/organizations.js +158 -0
- package/dist/tools/organizations.js.map +1 -0
- package/dist/tools/page-entities.d.ts +522 -0
- package/dist/tools/page-entities.d.ts.map +1 -0
- package/dist/tools/page-entities.js +535 -0
- package/dist/tools/page-entities.js.map +1 -0
- package/dist/tools/pages.d.ts +226 -0
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +473 -17
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/plans.d.ts +293 -0
- package/dist/tools/plans.d.ts.map +1 -0
- package/dist/tools/plans.js +213 -0
- package/dist/tools/plans.js.map +1 -0
- package/dist/tools/plugins.d.ts +230 -0
- package/dist/tools/plugins.d.ts.map +1 -0
- package/dist/tools/plugins.js +218 -0
- package/dist/tools/plugins.js.map +1 -0
- package/dist/tools/push-notifications.d.ts +261 -0
- package/dist/tools/push-notifications.d.ts.map +1 -0
- package/dist/tools/push-notifications.js +246 -0
- package/dist/tools/push-notifications.js.map +1 -0
- package/dist/tools/queries.d.ts +274 -0
- package/dist/tools/queries.d.ts.map +1 -1
- package/dist/tools/queries.js +319 -17
- package/dist/tools/queries.js.map +1 -1
- package/dist/tools/query-categories.d.ts +192 -0
- package/dist/tools/query-categories.d.ts.map +1 -0
- package/dist/tools/query-categories.js +204 -0
- package/dist/tools/query-categories.js.map +1 -0
- package/dist/tools/regions.d.ts +148 -0
- package/dist/tools/regions.d.ts.map +1 -0
- package/dist/tools/regions.js +148 -0
- package/dist/tools/regions.js.map +1 -0
- package/dist/tools/roles.d.ts +284 -0
- package/dist/tools/roles.d.ts.map +1 -0
- package/dist/tools/roles.js +291 -0
- package/dist/tools/roles.js.map +1 -0
- package/dist/tools/settings.d.ts +160 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +187 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/showcases.d.ts +184 -0
- package/dist/tools/showcases.d.ts.map +1 -0
- package/dist/tools/showcases.js +179 -0
- package/dist/tools/showcases.js.map +1 -0
- package/dist/tools/storage.d.ts +297 -0
- package/dist/tools/storage.d.ts.map +1 -0
- package/dist/tools/storage.js +302 -0
- package/dist/tools/storage.js.map +1 -0
- package/dist/tools/subscriptions.d.ts +166 -0
- package/dist/tools/subscriptions.d.ts.map +1 -0
- package/dist/tools/subscriptions.js +144 -0
- package/dist/tools/subscriptions.js.map +1 -0
- package/dist/tools/system-tools.d.ts +124 -0
- package/dist/tools/system-tools.d.ts.map +1 -0
- package/dist/tools/system-tools.js +147 -0
- package/dist/tools/system-tools.js.map +1 -0
- package/dist/tools/system-variables.d.ts +167 -0
- package/dist/tools/system-variables.d.ts.map +1 -0
- package/dist/tools/system-variables.js +176 -0
- package/dist/tools/system-variables.js.map +1 -0
- package/dist/tools/users.d.ts +266 -0
- package/dist/tools/users.d.ts.map +1 -0
- package/dist/tools/users.js +235 -0
- package/dist/tools/users.js.map +1 -0
- package/dist/tools/workflows.d.ts +278 -0
- package/dist/tools/workflows.d.ts.map +1 -0
- package/dist/tools/workflows.js +267 -0
- package/dist/tools/workflows.js.map +1 -0
- package/package.json +12 -3
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAP Storage operations
|
|
3
|
+
* Storage = global file/directory management (klasör ve dosya yönetimi)
|
|
4
|
+
* GLOBAL /storage routes (no {site} prefix).
|
|
5
|
+
*/
|
|
6
|
+
export function getStorageTools(client) {
|
|
7
|
+
return {
|
|
8
|
+
// ─── Create Directory ─────────────────────────────────
|
|
9
|
+
create_directory: {
|
|
10
|
+
description: "Depolamada yeni bir klasör (dizin) oluşturur. 'name' klasör adıdır; 'parentId' verilirse klasör o üst klasörün altına, verilmezse köke oluşturulur.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
name: { type: "string", description: "Yeni klasörün adı" },
|
|
15
|
+
parentId: {
|
|
16
|
+
type: "string",
|
|
17
|
+
description: "Üst klasör ID (GUID). Boş bırakılırsa kök dizinde oluşturulur.",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ["name"],
|
|
21
|
+
},
|
|
22
|
+
handler: async (args) => {
|
|
23
|
+
const body = { name: args.name };
|
|
24
|
+
if (args.parentId !== undefined)
|
|
25
|
+
body.parentId = args.parentId;
|
|
26
|
+
const result = await client.request("POST", "/storage/directories", body);
|
|
27
|
+
return {
|
|
28
|
+
content: [
|
|
29
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
30
|
+
],
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
// ─── Delete Directory ─────────────────────────────────
|
|
35
|
+
delete_directory: {
|
|
36
|
+
description: "Bir klasörü ID ile siler. DİKKAT: Klasör ve içeriği silinir, bu işlem geri alınamaz.",
|
|
37
|
+
inputSchema: {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
id: { type: "string", description: "Silinecek klasör ID (GUID)" },
|
|
41
|
+
},
|
|
42
|
+
required: ["id"],
|
|
43
|
+
},
|
|
44
|
+
handler: async (args) => {
|
|
45
|
+
const result = await client.request("DELETE", `/storage/directories/${args.id}`);
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
49
|
+
],
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
// ─── Rename Directory ─────────────────────────────────
|
|
54
|
+
rename_directory: {
|
|
55
|
+
description: "Mevcut bir klasörü yeniden adlandırır.",
|
|
56
|
+
inputSchema: {
|
|
57
|
+
type: "object",
|
|
58
|
+
properties: {
|
|
59
|
+
directoryId: {
|
|
60
|
+
type: "string",
|
|
61
|
+
description: "Yeniden adlandırılacak klasör ID (GUID)",
|
|
62
|
+
},
|
|
63
|
+
name: { type: "string", description: "Klasörün yeni adı" },
|
|
64
|
+
},
|
|
65
|
+
required: ["directoryId", "name"],
|
|
66
|
+
},
|
|
67
|
+
handler: async (args) => {
|
|
68
|
+
const result = await client.request("POST", "/storage/directories/rename", { directoryId: args.directoryId, name: args.name });
|
|
69
|
+
return {
|
|
70
|
+
content: [
|
|
71
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
// ─── Search Directories ───────────────────────────────
|
|
77
|
+
search_directories: {
|
|
78
|
+
description: "Klasörleri arar/listeler. İsim ve üst klasör (directoryId) ile filtreleyebilir, sayfalama ve sıralama yapabilirsiniz.",
|
|
79
|
+
inputSchema: {
|
|
80
|
+
type: "object",
|
|
81
|
+
properties: {
|
|
82
|
+
name: { type: "string", description: "Klasör adına göre filtrele" },
|
|
83
|
+
directoryId: {
|
|
84
|
+
type: "string",
|
|
85
|
+
description: "Üst klasör ID (GUID). Belirtilen klasörün altındaki klasörleri getirir.",
|
|
86
|
+
},
|
|
87
|
+
pageIndex: { type: "number", description: "Sayfa numarası (0-based)" },
|
|
88
|
+
pageLength: {
|
|
89
|
+
type: "number",
|
|
90
|
+
description: "Sayfa boyutu (varsayılan: 10)",
|
|
91
|
+
},
|
|
92
|
+
order: { type: "string", description: "Sıralanacak alan adı" },
|
|
93
|
+
isDescending: {
|
|
94
|
+
type: "boolean",
|
|
95
|
+
description: "Azalan sıralama (true) / artan (false)",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
handler: async (args) => {
|
|
100
|
+
const params = {};
|
|
101
|
+
if (args.name)
|
|
102
|
+
params.Name = args.name;
|
|
103
|
+
if (args.directoryId)
|
|
104
|
+
params.DirectoryId = args.directoryId;
|
|
105
|
+
if (args.pageIndex !== undefined)
|
|
106
|
+
params.PageIndex = String(args.pageIndex);
|
|
107
|
+
if (args.pageLength !== undefined)
|
|
108
|
+
params.PageLength = String(args.pageLength);
|
|
109
|
+
if (args.order)
|
|
110
|
+
params.Order = args.order;
|
|
111
|
+
if (args.isDescending !== undefined)
|
|
112
|
+
params.IsDescending = String(args.isDescending);
|
|
113
|
+
const result = await client.request("GET", "/storage/directories/search", undefined, params);
|
|
114
|
+
return {
|
|
115
|
+
content: [
|
|
116
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
// ─── Directory Breadcrumb ─────────────────────────────
|
|
122
|
+
get_directory_breadcrumb: {
|
|
123
|
+
description: "Bir klasörün breadcrumb (üst klasör hiyerarşisi / yol) bilgisini getirir. Kökten verilen klasöre kadarki dizin zincirini döndürür.",
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
id: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "Breadcrumb'ı istenen klasör ID (GUID)",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
required: ["id"],
|
|
133
|
+
},
|
|
134
|
+
handler: async (args) => {
|
|
135
|
+
const result = await client.request("GET", "/storage/directories/breadcrumb", undefined, { Id: args.id });
|
|
136
|
+
return {
|
|
137
|
+
content: [
|
|
138
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
// ─── Delete File ──────────────────────────────────────
|
|
144
|
+
delete_file: {
|
|
145
|
+
description: "Bir dosyayı ID ile siler. DİKKAT: Bu işlem geri alınamaz.",
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: "object",
|
|
148
|
+
properties: {
|
|
149
|
+
id: { type: "string", description: "Silinecek dosya ID (GUID)" },
|
|
150
|
+
},
|
|
151
|
+
required: ["id"],
|
|
152
|
+
},
|
|
153
|
+
handler: async (args) => {
|
|
154
|
+
const result = await client.request("DELETE", `/storage/files/${args.id}`);
|
|
155
|
+
return {
|
|
156
|
+
content: [
|
|
157
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
// ─── Rename File ──────────────────────────────────────
|
|
163
|
+
rename_file: {
|
|
164
|
+
description: "Mevcut bir dosyayı yeniden adlandırır.",
|
|
165
|
+
inputSchema: {
|
|
166
|
+
type: "object",
|
|
167
|
+
properties: {
|
|
168
|
+
fileId: {
|
|
169
|
+
type: "string",
|
|
170
|
+
description: "Yeniden adlandırılacak dosya ID (GUID)",
|
|
171
|
+
},
|
|
172
|
+
name: { type: "string", description: "Dosyanın yeni adı" },
|
|
173
|
+
},
|
|
174
|
+
required: ["fileId", "name"],
|
|
175
|
+
},
|
|
176
|
+
handler: async (args) => {
|
|
177
|
+
const result = await client.request("POST", "/storage/files/rename", {
|
|
178
|
+
fileId: args.fileId,
|
|
179
|
+
name: args.name,
|
|
180
|
+
});
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
// ─── Move File(s) ─────────────────────────────────────
|
|
189
|
+
move_file: {
|
|
190
|
+
description: "Bir veya birden fazla dosyayı hedef klasöre taşır. 'fileIds' taşınacak dosya ID'lerinin (GUID) dizisidir.",
|
|
191
|
+
inputSchema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
fileIds: {
|
|
195
|
+
type: "array",
|
|
196
|
+
description: "Taşınacak dosya ID'leri (GUID) dizisi",
|
|
197
|
+
},
|
|
198
|
+
targetDirectoryId: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Hedef klasör ID (GUID)",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
required: ["fileIds", "targetDirectoryId"],
|
|
204
|
+
},
|
|
205
|
+
handler: async (args) => {
|
|
206
|
+
const result = await client.request("POST", "/storage/files/move", {
|
|
207
|
+
fileIds: args.fileIds,
|
|
208
|
+
targetDirectoryId: args.targetDirectoryId,
|
|
209
|
+
});
|
|
210
|
+
return {
|
|
211
|
+
content: [
|
|
212
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
213
|
+
],
|
|
214
|
+
};
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
// ─── Copy File(s) ─────────────────────────────────────
|
|
218
|
+
copy_file: {
|
|
219
|
+
description: "Bir veya birden fazla dosyayı hedef klasöre kopyalar. 'fileIds' kopyalanacak dosya ID'lerinin (GUID) dizisidir.",
|
|
220
|
+
inputSchema: {
|
|
221
|
+
type: "object",
|
|
222
|
+
properties: {
|
|
223
|
+
fileIds: {
|
|
224
|
+
type: "array",
|
|
225
|
+
description: "Kopyalanacak dosya ID'leri (GUID) dizisi",
|
|
226
|
+
},
|
|
227
|
+
targetDirectoryId: {
|
|
228
|
+
type: "string",
|
|
229
|
+
description: "Hedef klasör ID (GUID)",
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
required: ["fileIds", "targetDirectoryId"],
|
|
233
|
+
},
|
|
234
|
+
handler: async (args) => {
|
|
235
|
+
const result = await client.request("POST", "/storage/files/copy", {
|
|
236
|
+
fileIds: args.fileIds,
|
|
237
|
+
targetDirectoryId: args.targetDirectoryId,
|
|
238
|
+
});
|
|
239
|
+
return {
|
|
240
|
+
content: [
|
|
241
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
242
|
+
],
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
// ─── Search Files ─────────────────────────────────────
|
|
247
|
+
search_files: {
|
|
248
|
+
description: "Dosyaları arar/listeler. Metin (text), klasör (directoryId) ve dosya türü (typeList) ile filtreleyebilir; sayfalama ve sıralama yapabilirsiniz. typeList değerleri: 0=Image, 1=Video, 2=Document, 3=Audio, 4=Binary.",
|
|
249
|
+
inputSchema: {
|
|
250
|
+
type: "object",
|
|
251
|
+
properties: {
|
|
252
|
+
text: {
|
|
253
|
+
type: "string",
|
|
254
|
+
description: "Dosya adı/içeriğinde arama metni",
|
|
255
|
+
},
|
|
256
|
+
directoryId: {
|
|
257
|
+
type: "string",
|
|
258
|
+
description: "Klasör ID (GUID). Belirtilen klasördeki dosyaları getirir.",
|
|
259
|
+
},
|
|
260
|
+
typeList: {
|
|
261
|
+
type: "array",
|
|
262
|
+
description: "Dosya türü kodları dizisi (0=Image,1=Video,2=Document,3=Audio,4=Binary)",
|
|
263
|
+
},
|
|
264
|
+
pageIndex: { type: "number", description: "Sayfa numarası (0-based)" },
|
|
265
|
+
pageLength: {
|
|
266
|
+
type: "number",
|
|
267
|
+
description: "Sayfa boyutu (varsayılan: 10)",
|
|
268
|
+
},
|
|
269
|
+
order: { type: "string", description: "Sıralanacak alan adı" },
|
|
270
|
+
isDescending: {
|
|
271
|
+
type: "boolean",
|
|
272
|
+
description: "Azalan sıralama (true) / artan (false)",
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
handler: async (args) => {
|
|
277
|
+
const params = {};
|
|
278
|
+
if (args.text)
|
|
279
|
+
params.Text = args.text;
|
|
280
|
+
if (args.directoryId)
|
|
281
|
+
params.DirectoryId = args.directoryId;
|
|
282
|
+
if (args.typeList && args.typeList.length > 0)
|
|
283
|
+
params.TypeList = args.typeList.map(String).join(",");
|
|
284
|
+
if (args.pageIndex !== undefined)
|
|
285
|
+
params.PageIndex = String(args.pageIndex);
|
|
286
|
+
if (args.pageLength !== undefined)
|
|
287
|
+
params.PageLength = String(args.pageLength);
|
|
288
|
+
if (args.order)
|
|
289
|
+
params.Order = args.order;
|
|
290
|
+
if (args.isDescending !== undefined)
|
|
291
|
+
params.IsDescending = String(args.isDescending);
|
|
292
|
+
const result = await client.request("GET", "/storage/files/search", undefined, params);
|
|
293
|
+
return {
|
|
294
|
+
content: [
|
|
295
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
296
|
+
],
|
|
297
|
+
};
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sourceRoot":"","sources":["../../src/tools/storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,OAAO;QACL,yDAAyD;QACzD,gBAAgB,EAAE;YAChB,WAAW,EACT,qJAAqJ;YACvJ,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,IAAI,EAA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,CAAC,CAAC;gBAClD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CACjC,KAAK,EACL,uBAAuB,EACvB,SAAS,EACT,MAAM,CACP,CAAC;gBACF,OAAO;oBACL,OAAO,EAAE;wBACP,EAAE,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,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAPPA SaaS Subscription operations
|
|
3
|
+
*
|
|
4
|
+
* Subscriptions link a public user to a plan within an organization.
|
|
5
|
+
* They are read/managed (status changes, refund decisions) but not created
|
|
6
|
+
* directly here — creation happens through the billing flow.
|
|
7
|
+
*/
|
|
8
|
+
import { WapClient } from "../client.js";
|
|
9
|
+
export declare function getSubscriptionTools(client: WapClient): {
|
|
10
|
+
list_subscriptions: {
|
|
11
|
+
description: string;
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object";
|
|
14
|
+
properties: {
|
|
15
|
+
organizationId: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
publicUserId: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
planId: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
subscriptionStatus: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
pageIndex: {
|
|
32
|
+
type: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
pageLength: {
|
|
36
|
+
type: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
required: string[];
|
|
41
|
+
};
|
|
42
|
+
handler: (args: {
|
|
43
|
+
organizationId: string;
|
|
44
|
+
publicUserId?: string;
|
|
45
|
+
planId?: string;
|
|
46
|
+
subscriptionStatus?: number;
|
|
47
|
+
pageIndex?: number;
|
|
48
|
+
pageLength?: number;
|
|
49
|
+
}) => Promise<{
|
|
50
|
+
content: {
|
|
51
|
+
type: "text";
|
|
52
|
+
text: string;
|
|
53
|
+
}[];
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
get_subscription: {
|
|
57
|
+
description: string;
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object";
|
|
60
|
+
properties: {
|
|
61
|
+
organizationId: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
id: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
required: string[];
|
|
71
|
+
};
|
|
72
|
+
handler: (args: {
|
|
73
|
+
organizationId: string;
|
|
74
|
+
id: string;
|
|
75
|
+
}) => Promise<{
|
|
76
|
+
content: {
|
|
77
|
+
type: "text";
|
|
78
|
+
text: string;
|
|
79
|
+
}[];
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
82
|
+
change_subscription_status: {
|
|
83
|
+
description: string;
|
|
84
|
+
inputSchema: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: {
|
|
87
|
+
organizationId: {
|
|
88
|
+
type: string;
|
|
89
|
+
description: string;
|
|
90
|
+
};
|
|
91
|
+
id: {
|
|
92
|
+
type: string;
|
|
93
|
+
description: string;
|
|
94
|
+
};
|
|
95
|
+
subscriptionStatus: {
|
|
96
|
+
type: string;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
required: string[];
|
|
101
|
+
};
|
|
102
|
+
handler: (args: {
|
|
103
|
+
organizationId: string;
|
|
104
|
+
id: string;
|
|
105
|
+
subscriptionStatus: number;
|
|
106
|
+
}) => Promise<{
|
|
107
|
+
content: {
|
|
108
|
+
type: "text";
|
|
109
|
+
text: string;
|
|
110
|
+
}[];
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
approve_subscription_refund: {
|
|
114
|
+
description: string;
|
|
115
|
+
inputSchema: {
|
|
116
|
+
type: "object";
|
|
117
|
+
properties: {
|
|
118
|
+
organizationId: {
|
|
119
|
+
type: string;
|
|
120
|
+
description: string;
|
|
121
|
+
};
|
|
122
|
+
id: {
|
|
123
|
+
type: string;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
required: string[];
|
|
128
|
+
};
|
|
129
|
+
handler: (args: {
|
|
130
|
+
organizationId: string;
|
|
131
|
+
id: string;
|
|
132
|
+
}) => Promise<{
|
|
133
|
+
content: {
|
|
134
|
+
type: "text";
|
|
135
|
+
text: string;
|
|
136
|
+
}[];
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
reject_subscription_refund: {
|
|
140
|
+
description: string;
|
|
141
|
+
inputSchema: {
|
|
142
|
+
type: "object";
|
|
143
|
+
properties: {
|
|
144
|
+
organizationId: {
|
|
145
|
+
type: string;
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
id: {
|
|
149
|
+
type: string;
|
|
150
|
+
description: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
required: string[];
|
|
154
|
+
};
|
|
155
|
+
handler: (args: {
|
|
156
|
+
organizationId: string;
|
|
157
|
+
id: string;
|
|
158
|
+
}) => Promise<{
|
|
159
|
+
content: {
|
|
160
|
+
type: "text";
|
|
161
|
+
text: string;
|
|
162
|
+
}[];
|
|
163
|
+
}>;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/tools/subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMzC,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwB1B;YACpB,cAAc,EAAE,MAAM,CAAC;YACvB,YAAY,CAAC,EAAE,MAAM,CAAC;YACtB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;YAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB;;;;;;;;;;;;;;;;;;;;;;;wBA8BqB;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA6BtC;YACpB,cAAc,EAAE,MAAM,CAAC;YACvB,EAAE,EAAE,MAAM,CAAC;YACX,kBAAkB,EAAE,MAAM,CAAC;SAC5B;;;;;;;;;;;;;;;;;;;;;;;wBA6BqB;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;wBA4BtC;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;EAajE"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAPPA SaaS Subscription operations
|
|
3
|
+
*
|
|
4
|
+
* Subscriptions link a public user to a plan within an organization.
|
|
5
|
+
* They are read/managed (status changes, refund decisions) but not created
|
|
6
|
+
* directly here — creation happens through the billing flow.
|
|
7
|
+
*/
|
|
8
|
+
// SubscriptionStatus backend enum values
|
|
9
|
+
const STATUS_HINT = "Abonelik durumu (sayısal): 0=PaymentPending (ödeme bekliyor), 1=Trialing (deneme), 2=Active (aktif), 3=PastDue (vadesi geçmiş), 4=Suspended (askıda), 5=Cancelled (iptal), 6=Expired (süresi dolmuş), 7=RenewalProcces (yenileniyor), 8=UpgradeProcces (yükseltiliyor), 9=RefundRequest (iade talebi), 10=Refunded (iade edildi), 11=RefundRejected (iade reddedildi).";
|
|
10
|
+
export function getSubscriptionTools(client) {
|
|
11
|
+
return {
|
|
12
|
+
// ─── List Subscriptions ───────────────────────────────
|
|
13
|
+
list_subscriptions: {
|
|
14
|
+
description: "Bir organizasyonun aboneliklerini listeler. organizationId zorunludur. publicUserId, planId ve subscriptionStatus ile filtrelenebilir.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
organizationId: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Organizasyon id'si (GUID)",
|
|
21
|
+
},
|
|
22
|
+
publicUserId: {
|
|
23
|
+
type: "string",
|
|
24
|
+
description: "Public kullanıcı id'sine göre filtrele",
|
|
25
|
+
},
|
|
26
|
+
planId: { type: "string", description: "Plan id'sine (GUID) göre filtrele" },
|
|
27
|
+
subscriptionStatus: { type: "number", description: STATUS_HINT },
|
|
28
|
+
pageIndex: { type: "number", description: "Sayfa numarası (0-based)" },
|
|
29
|
+
pageLength: { type: "number", description: "Sayfa boyutu" },
|
|
30
|
+
},
|
|
31
|
+
required: ["organizationId"],
|
|
32
|
+
},
|
|
33
|
+
handler: async (args) => {
|
|
34
|
+
const { organizationId, ...rest } = args;
|
|
35
|
+
const params = {};
|
|
36
|
+
for (const [k, v] of Object.entries(rest)) {
|
|
37
|
+
if (v !== undefined && v !== null)
|
|
38
|
+
params[k] = String(v);
|
|
39
|
+
}
|
|
40
|
+
const result = await client.getSubscriptions(organizationId, params);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
44
|
+
],
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
// ─── Get Subscription ─────────────────────────────────
|
|
49
|
+
get_subscription: {
|
|
50
|
+
description: "Belirli bir aboneliği id ile getirir. Plan snapshot'ı (planSnapshotJson) ve dönem bilgileri dahil tüm detayları döner.",
|
|
51
|
+
inputSchema: {
|
|
52
|
+
type: "object",
|
|
53
|
+
properties: {
|
|
54
|
+
organizationId: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Organizasyon id'si (GUID)",
|
|
57
|
+
},
|
|
58
|
+
id: { type: "string", description: "Abonelik id'si (GUID)" },
|
|
59
|
+
},
|
|
60
|
+
required: ["organizationId", "id"],
|
|
61
|
+
},
|
|
62
|
+
handler: async (args) => {
|
|
63
|
+
const result = await client.getSubscription(args.organizationId, args.id);
|
|
64
|
+
return {
|
|
65
|
+
content: [
|
|
66
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// ─── Change Subscription Status ───────────────────────
|
|
72
|
+
change_subscription_status: {
|
|
73
|
+
description: `Bir aboneliğin durumunu değiştirir.
|
|
74
|
+
'subscriptionStatus': ${STATUS_HINT}`,
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: "object",
|
|
77
|
+
properties: {
|
|
78
|
+
organizationId: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Organizasyon id'si (GUID)",
|
|
81
|
+
},
|
|
82
|
+
id: { type: "string", description: "Abonelik id'si (GUID)" },
|
|
83
|
+
subscriptionStatus: { type: "number", description: STATUS_HINT },
|
|
84
|
+
},
|
|
85
|
+
required: ["organizationId", "id", "subscriptionStatus"],
|
|
86
|
+
},
|
|
87
|
+
handler: async (args) => {
|
|
88
|
+
const result = await client.changeSubscriptionStatus(args.organizationId, args.id, { subscriptionStatus: args.subscriptionStatus });
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
// ─── Approve Refund Request ───────────────────────────
|
|
97
|
+
approve_subscription_refund: {
|
|
98
|
+
description: "Bir abonelik için yapılan iade talebini (RefundRequest) onaylar.",
|
|
99
|
+
inputSchema: {
|
|
100
|
+
type: "object",
|
|
101
|
+
properties: {
|
|
102
|
+
organizationId: {
|
|
103
|
+
type: "string",
|
|
104
|
+
description: "Organizasyon id'si (GUID)",
|
|
105
|
+
},
|
|
106
|
+
id: { type: "string", description: "Abonelik id'si (GUID)" },
|
|
107
|
+
},
|
|
108
|
+
required: ["organizationId", "id"],
|
|
109
|
+
},
|
|
110
|
+
handler: async (args) => {
|
|
111
|
+
const result = await client.approveSubscriptionRefund(args.organizationId, args.id);
|
|
112
|
+
return {
|
|
113
|
+
content: [
|
|
114
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
// ─── Reject Refund Request ────────────────────────────
|
|
120
|
+
reject_subscription_refund: {
|
|
121
|
+
description: "Bir abonelik için yapılan iade talebini (RefundRequest) reddeder.",
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
organizationId: {
|
|
126
|
+
type: "string",
|
|
127
|
+
description: "Organizasyon id'si (GUID)",
|
|
128
|
+
},
|
|
129
|
+
id: { type: "string", description: "Abonelik id'si (GUID)" },
|
|
130
|
+
},
|
|
131
|
+
required: ["organizationId", "id"],
|
|
132
|
+
},
|
|
133
|
+
handler: async (args) => {
|
|
134
|
+
const result = await client.rejectSubscriptionRefund(args.organizationId, args.id);
|
|
135
|
+
return {
|
|
136
|
+
content: [
|
|
137
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
138
|
+
],
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../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