@appaflytech/wappa-mcp 0.0.9 → 0.0.11
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 +34 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +112 -8
- 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 +248 -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/dynamic-entities.d.ts +10 -0
- package/dist/tools/dynamic-entities.d.ts.map +1 -1
- package/dist/tools/dynamic-entities.js +77 -2
- package/dist/tools/dynamic-entities.js.map +1 -1
- package/dist/tools/entities.d.ts.map +1 -1
- package/dist/tools/entities.js +297 -4
- package/dist/tools/entities.js.map +1 -1
- package/dist/tools/layouts.d.ts.map +1 -1
- package/dist/tools/layouts.js +1 -2
- package/dist/tools/layouts.js.map +1 -1
- 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/pages.d.ts +8 -0
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +348 -24
- 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/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 +29 -0
- package/dist/tools/queries.d.ts.map +1 -1
- package/dist/tools/queries.js +106 -14
- package/dist/tools/queries.js.map +1 -1
- 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/package.json +20 -4
package/dist/tools/queries.js
CHANGED
|
@@ -34,8 +34,7 @@ export function getQueryTools(client) {
|
|
|
34
34
|
params.type = args.type;
|
|
35
35
|
if (args.pageIndex !== undefined)
|
|
36
36
|
params.pageIndex = String(args.pageIndex);
|
|
37
|
-
|
|
38
|
-
params.pageLength = String(args.pageLength);
|
|
37
|
+
params.pageLength = String(args.pageLength ?? 200);
|
|
39
38
|
const result = await client.getQueries(params);
|
|
40
39
|
return {
|
|
41
40
|
content: [
|
|
@@ -94,14 +93,15 @@ export function getQueryTools(client) {
|
|
|
94
93
|
// ─── Create Query ─────────────────────────────────────
|
|
95
94
|
create_query: {
|
|
96
95
|
description: `Yeni bir query tanımı oluşturur.
|
|
97
|
-
'type': "
|
|
98
|
-
'rawQuery': SQL sorgu metni (
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
96
|
+
'type': "raw" (ham SQL — sadece rawQuery gerekli), "system" | "application" | "integration" (schema + response zorunlu).
|
|
97
|
+
'rawQuery': SQL sorgu metni (raw tipi için).
|
|
98
|
+
'schema': { entityId: <Entity GUID>, fields: [{ name }] } — non-raw için zorunlu.
|
|
99
|
+
'response': { type: "single" | "multiple" } — non-raw için zorunlu.
|
|
100
|
+
'parameters': Query parametre tanımları: [{ name, type, defaultValue }].
|
|
101
|
+
'cache': { enabled: bool, durationSeconds: number }.
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
103
|
+
Önerilen: hızlı SQL için { type: "raw", rawQuery: "SELECT 1" }.
|
|
104
|
+
Şemalı sorgu için { type: "application", schema: { entityId, fields: [...] }, response: { type: "multiple" } }.`,
|
|
105
105
|
inputSchema: {
|
|
106
106
|
type: "object",
|
|
107
107
|
properties: {
|
|
@@ -112,17 +112,29 @@ REST örnek: "https://api.example.com/posts?lang={{language}}"`,
|
|
|
112
112
|
title: { type: "string", description: "Query başlığı" },
|
|
113
113
|
type: {
|
|
114
114
|
type: "string",
|
|
115
|
-
description: "Query tipi:
|
|
116
|
-
enum: ["
|
|
115
|
+
description: "Query tipi: raw | system | application | integration (varsayılan: raw)",
|
|
116
|
+
enum: ["raw", "system", "application", "integration"],
|
|
117
117
|
},
|
|
118
118
|
rawQuery: {
|
|
119
119
|
type: "string",
|
|
120
|
-
description: "SQL sorgu metni
|
|
120
|
+
description: "SQL sorgu metni (raw tipi için zorunlu)",
|
|
121
|
+
},
|
|
122
|
+
schema: {
|
|
123
|
+
type: "object",
|
|
124
|
+
description: "Schema (non-raw için): { entityId, fields: [{ name }], where?, joins?, orderBy? }",
|
|
125
|
+
},
|
|
126
|
+
response: {
|
|
127
|
+
type: "object",
|
|
128
|
+
description: 'Yanıt biçimi (non-raw için): { type: "single" | "multiple" }',
|
|
121
129
|
},
|
|
122
130
|
parameters: {
|
|
123
131
|
type: "array",
|
|
124
132
|
description: "Query parametre tanımları: [{ name, type, defaultValue }]",
|
|
125
133
|
},
|
|
134
|
+
queryMaps: {
|
|
135
|
+
type: "array",
|
|
136
|
+
description: "Mevcut query sonuç kolonlarının alias ve type eşleştirmeleri. Örn: [{ name: 'Image', type: 'image', alias: 'img', path: 'img', isMultiple: false }]"
|
|
137
|
+
},
|
|
126
138
|
cache: {
|
|
127
139
|
type: "object",
|
|
128
140
|
description: "Önbellekleme: { enabled: bool, durationSeconds: number }",
|
|
@@ -148,7 +160,25 @@ REST örnek: "https://api.example.com/posts?lang={{language}}"`,
|
|
|
148
160
|
required: ["name", "title"],
|
|
149
161
|
},
|
|
150
162
|
handler: async (args) => {
|
|
151
|
-
const
|
|
163
|
+
const incoming = args;
|
|
164
|
+
const type = typeof incoming.type === "string" ? incoming.type : "raw";
|
|
165
|
+
const payload = {
|
|
166
|
+
// sensible defaults — backend requires non-null httpMethod and
|
|
167
|
+
// tolerates empty lists better than nulls
|
|
168
|
+
httpMethod: "get",
|
|
169
|
+
parameters: [],
|
|
170
|
+
queryMaps: [],
|
|
171
|
+
rawQueryMap: [],
|
|
172
|
+
...incoming,
|
|
173
|
+
type,
|
|
174
|
+
};
|
|
175
|
+
if (type === "raw") {
|
|
176
|
+
// for raw queries the backend ignores schema; ensure response
|
|
177
|
+
// exists so domain ctor doesn't trip on null collections
|
|
178
|
+
if (!payload.response)
|
|
179
|
+
payload.response = { type: "multiple" };
|
|
180
|
+
}
|
|
181
|
+
const result = await client.createQuery(payload);
|
|
152
182
|
return {
|
|
153
183
|
content: [
|
|
154
184
|
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
@@ -165,8 +195,22 @@ REST örnek: "https://api.example.com/posts?lang={{language}}"`,
|
|
|
165
195
|
id: { type: "string", description: "Güncellenecek query ID" },
|
|
166
196
|
name: { type: "string", description: "Query adı" },
|
|
167
197
|
title: { type: "string", description: "Query başlığı" },
|
|
198
|
+
type: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Query tipi: raw | system | application | integration",
|
|
201
|
+
enum: ["raw", "system", "application", "integration"],
|
|
202
|
+
},
|
|
168
203
|
rawQuery: { type: "string", description: "SQL veya endpoint" },
|
|
204
|
+
schema: {
|
|
205
|
+
type: "object",
|
|
206
|
+
description: "Schema (non-raw): { entityId, fields, where?, joins?, orderBy? }",
|
|
207
|
+
},
|
|
208
|
+
response: {
|
|
209
|
+
type: "object",
|
|
210
|
+
description: 'Yanıt biçimi (non-raw): { type: "single" | "multiple" }',
|
|
211
|
+
},
|
|
169
212
|
parameters: { type: "array", description: "Parametre tanımları" },
|
|
213
|
+
queryMaps: { type: "array", description: "Query kolon eşleştirmeleri" },
|
|
170
214
|
cache: { type: "object", description: "Önbellekleme ayarları" },
|
|
171
215
|
transformTemplate: {
|
|
172
216
|
type: "string",
|
|
@@ -177,7 +221,55 @@ REST örnek: "https://api.example.com/posts?lang={{language}}"`,
|
|
|
177
221
|
required: ["id"],
|
|
178
222
|
},
|
|
179
223
|
handler: async (args) => {
|
|
180
|
-
const { id, ...
|
|
224
|
+
const { id, ...patch } = args;
|
|
225
|
+
// Backend update endpoint requires the full query payload (Name,
|
|
226
|
+
// Schema, Response, Type, etc. are NotEmpty). Fetch the existing
|
|
227
|
+
// record and merge any caller-provided changes on top so partial
|
|
228
|
+
// patches do not trip 422 validation errors.
|
|
229
|
+
let current = {};
|
|
230
|
+
try {
|
|
231
|
+
const res = await client.getQuery(id);
|
|
232
|
+
current = res?.data?.data ?? res?.data ?? res ?? {};
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
/* fall through with empty base */
|
|
236
|
+
}
|
|
237
|
+
const hasCurrent = current &&
|
|
238
|
+
typeof current === "object" &&
|
|
239
|
+
Object.keys(current).length > 0;
|
|
240
|
+
const data = hasCurrent
|
|
241
|
+
? {
|
|
242
|
+
name: current.name ?? current.Name,
|
|
243
|
+
title: current.title ?? current.Title,
|
|
244
|
+
type: current.type ?? current.Type,
|
|
245
|
+
rawQuery: current.rawQuery ?? current.RawQuery,
|
|
246
|
+
schema: current.schema ?? current.Schema,
|
|
247
|
+
response: current.response ?? current.Response,
|
|
248
|
+
parameters: current.parameters ?? current.Parameters,
|
|
249
|
+
rawQueryMap: current.rawQueryMap ?? current.RawQueryMap,
|
|
250
|
+
cache: current.cache ?? current.Cache,
|
|
251
|
+
transformTemplate: current.transformTemplate ?? current.TransformTemplate,
|
|
252
|
+
httpMethod: current.httpMethod ?? current.HttpMethod,
|
|
253
|
+
categoryId: current.categoryId ?? current.CategoryId,
|
|
254
|
+
...patch,
|
|
255
|
+
}
|
|
256
|
+
: { ...patch };
|
|
257
|
+
for (const key of Object.keys(data)) {
|
|
258
|
+
if (data[key] === undefined)
|
|
259
|
+
delete data[key];
|
|
260
|
+
}
|
|
261
|
+
// Apply the same raw-query defaults used by create_query so the
|
|
262
|
+
// backend's QueryAggregate constructor doesn't blow up on nulls.
|
|
263
|
+
if (data.type === "raw") {
|
|
264
|
+
if (!data.response)
|
|
265
|
+
data.response = { type: "multiple" };
|
|
266
|
+
if (!data.parameters)
|
|
267
|
+
data.parameters = [];
|
|
268
|
+
if (!data.rawQueryMap)
|
|
269
|
+
data.rawQueryMap = [];
|
|
270
|
+
if (!data.httpMethod)
|
|
271
|
+
data.httpMethod = "get";
|
|
272
|
+
}
|
|
181
273
|
const result = await client.updateQuery(id, data);
|
|
182
274
|
return {
|
|
183
275
|
content: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/tools/queries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,UAAU,aAAa,CAAC,MAAiB;IAC7C,OAAO;QACL,yDAAyD;QACzD,YAAY,EAAE;YACZ,WAAW,EACT,+EAA+E;YACjF,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;oBAC/D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;oBAC7D,IAAI,EAAE;wBACJ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,6BAA6B;qBAC3C;oBACD,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AAE,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;oBAC3C,IAAI,CAAC,IAAI,CAAC,WAAW;wBAAE,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;oBAC7C,IAAI,CAAC,IAAI,CAAC,UAAU;wBAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;gBAChD,CAAC;gBACD,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;gBAClD,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;QAED,yDAAyD;QACzD,YAAY,EAAE;YACZ,WAAW,EAAE,2BAA2B;YACxC,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;iBAC1D;gBACD,QAAQ,EAAE,CAAC,IAAI,CAAC;aACjB;YACD,OAAO,EAAE,KAAK,EAAE,IAAoB,EAAE,EAAE;gBACtC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBACjD,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":["../../src/tools/subscriptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,yCAAyC;AACzC,MAAM,WAAW,GACf,wWAAwW,CAAC;AAE3W,MAAM,UAAU,oBAAoB,CAAC,MAAiB;IACpD,OAAO;QACL,yDAAyD;QACzD,kBAAkB,EAAE;YAClB,WAAW,EACT,wIAAwI;YAC1I,WAAW,EAAE;gBACX,IAAI,EAAE,QAAiB;gBACvB,UAAU,EAAE;oBACV,cAAc,EAAE;wBACd,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,2BAA2B;qBACzC;oBACD,YAAY,EAAE;wBACZ,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,wCAAwC;qBACtD;oBACD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,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;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"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appaflytech/wappa-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "MCP Server for WAPPA (Content Management System & Web Site Tools) Admin API — Claude Code integration for component, page, widget, and site management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
|
-
"wappa-mcp": "dist/index.js"
|
|
9
|
+
"wappa-mcp": "dist/index.js",
|
|
10
|
+
"wappa-mcp-http": "dist/server.js"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
12
13
|
"dist",
|
|
@@ -17,8 +18,15 @@
|
|
|
17
18
|
"build": "tsc",
|
|
18
19
|
"dev": "tsc --watch",
|
|
19
20
|
"start": "node dist/index.js",
|
|
21
|
+
"start:http": "node dist/server.js",
|
|
22
|
+
"dev:http": "tsx watch src/server.ts",
|
|
20
23
|
"prepare": "npm run build",
|
|
21
|
-
"sync:components": "tsx scripts/sync-from-admin-ui.ts"
|
|
24
|
+
"sync:components": "tsx scripts/sync-from-admin-ui.ts",
|
|
25
|
+
"test": "vitest run --config vitest.config.ts",
|
|
26
|
+
"test:watch": "vitest --config vitest.config.ts",
|
|
27
|
+
"test:integration": "vitest run --config vitest.integration.config.ts",
|
|
28
|
+
"test:coverage": "vitest run --config vitest.config.ts --coverage",
|
|
29
|
+
"smoke": "node scripts/smoke-all.mjs"
|
|
22
30
|
},
|
|
23
31
|
"keywords": [
|
|
24
32
|
"mcp",
|
|
@@ -41,13 +49,21 @@
|
|
|
41
49
|
},
|
|
42
50
|
"dependencies": {
|
|
43
51
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
52
|
+
"cors": "^2.8.5",
|
|
44
53
|
"dotenv": "^17.4.2",
|
|
54
|
+
"express": "^4.21.0",
|
|
55
|
+
"express-rate-limit": "^7.5.0",
|
|
56
|
+
"helmet": "^8.0.0",
|
|
45
57
|
"zod": "^4.3.6"
|
|
46
58
|
},
|
|
47
59
|
"devDependencies": {
|
|
60
|
+
"@types/cors": "^2.8.17",
|
|
61
|
+
"@types/express": "^4.17.21",
|
|
48
62
|
"@types/node": "^22.19.17",
|
|
63
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
49
64
|
"esbuild": "^0.25.0",
|
|
50
65
|
"tsx": "^4.20.0",
|
|
51
|
-
"typescript": "^5.7.0"
|
|
66
|
+
"typescript": "^5.7.0",
|
|
67
|
+
"vitest": "^4.1.7"
|
|
52
68
|
}
|
|
53
69
|
}
|