@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
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAPPA SaaS Plan CRUD operations
|
|
3
|
+
*
|
|
4
|
+
* Plans are subscription tiers scoped under an organization (organizationId).
|
|
5
|
+
* All plan operations require the organizationId (GUID).
|
|
6
|
+
*/
|
|
7
|
+
import { WapClient } from "../client.js";
|
|
8
|
+
export declare function getPlanTools(client: WapClient): {
|
|
9
|
+
list_plans: {
|
|
10
|
+
description: string;
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: "object";
|
|
13
|
+
properties: {
|
|
14
|
+
organizationId: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
code: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
name: {
|
|
23
|
+
type: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
description: {
|
|
27
|
+
type: string;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
30
|
+
billingPeriod: {
|
|
31
|
+
type: string;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
currency: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
isActive: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
isPublic: {
|
|
43
|
+
type: string;
|
|
44
|
+
description: string;
|
|
45
|
+
};
|
|
46
|
+
pageIndex: {
|
|
47
|
+
type: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
pageLength: {
|
|
51
|
+
type: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
required: string[];
|
|
56
|
+
};
|
|
57
|
+
handler: (args: {
|
|
58
|
+
organizationId: string;
|
|
59
|
+
code?: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
billingPeriod?: number;
|
|
63
|
+
currency?: string;
|
|
64
|
+
isActive?: boolean;
|
|
65
|
+
isPublic?: boolean;
|
|
66
|
+
pageIndex?: number;
|
|
67
|
+
pageLength?: number;
|
|
68
|
+
}) => Promise<{
|
|
69
|
+
content: {
|
|
70
|
+
type: "text";
|
|
71
|
+
text: string;
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
get_plan: {
|
|
76
|
+
description: string;
|
|
77
|
+
inputSchema: {
|
|
78
|
+
type: "object";
|
|
79
|
+
properties: {
|
|
80
|
+
organizationId: {
|
|
81
|
+
type: string;
|
|
82
|
+
description: string;
|
|
83
|
+
};
|
|
84
|
+
id: {
|
|
85
|
+
type: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
required: string[];
|
|
90
|
+
};
|
|
91
|
+
handler: (args: {
|
|
92
|
+
organizationId: string;
|
|
93
|
+
id: string;
|
|
94
|
+
}) => Promise<{
|
|
95
|
+
content: {
|
|
96
|
+
type: "text";
|
|
97
|
+
text: string;
|
|
98
|
+
}[];
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
create_plan: {
|
|
102
|
+
description: string;
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: "object";
|
|
105
|
+
properties: {
|
|
106
|
+
organizationId: {
|
|
107
|
+
type: string;
|
|
108
|
+
description: string;
|
|
109
|
+
};
|
|
110
|
+
id: {
|
|
111
|
+
type: string;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
code: {
|
|
115
|
+
type: string;
|
|
116
|
+
description: string;
|
|
117
|
+
};
|
|
118
|
+
name: {
|
|
119
|
+
type: string;
|
|
120
|
+
description: string;
|
|
121
|
+
};
|
|
122
|
+
description: {
|
|
123
|
+
type: string;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
126
|
+
billingPeriod: {
|
|
127
|
+
type: string;
|
|
128
|
+
description: string;
|
|
129
|
+
};
|
|
130
|
+
price: {
|
|
131
|
+
type: string;
|
|
132
|
+
description: string;
|
|
133
|
+
};
|
|
134
|
+
currency: {
|
|
135
|
+
type: string;
|
|
136
|
+
description: string;
|
|
137
|
+
};
|
|
138
|
+
isActive: {
|
|
139
|
+
type: string;
|
|
140
|
+
description: string;
|
|
141
|
+
};
|
|
142
|
+
isPublic: {
|
|
143
|
+
type: string;
|
|
144
|
+
description: string;
|
|
145
|
+
};
|
|
146
|
+
planLevel: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
};
|
|
150
|
+
entitlements: {
|
|
151
|
+
type: string;
|
|
152
|
+
description: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
required: string[];
|
|
156
|
+
};
|
|
157
|
+
handler: (args: Record<string, unknown>) => Promise<{
|
|
158
|
+
content: {
|
|
159
|
+
type: "text";
|
|
160
|
+
text: string;
|
|
161
|
+
}[];
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
164
|
+
update_plan: {
|
|
165
|
+
description: string;
|
|
166
|
+
inputSchema: {
|
|
167
|
+
type: "object";
|
|
168
|
+
properties: {
|
|
169
|
+
organizationId: {
|
|
170
|
+
type: string;
|
|
171
|
+
description: string;
|
|
172
|
+
};
|
|
173
|
+
id: {
|
|
174
|
+
type: string;
|
|
175
|
+
description: string;
|
|
176
|
+
};
|
|
177
|
+
code: {
|
|
178
|
+
type: string;
|
|
179
|
+
description: string;
|
|
180
|
+
};
|
|
181
|
+
name: {
|
|
182
|
+
type: string;
|
|
183
|
+
description: string;
|
|
184
|
+
};
|
|
185
|
+
description: {
|
|
186
|
+
type: string;
|
|
187
|
+
description: string;
|
|
188
|
+
};
|
|
189
|
+
billingPeriod: {
|
|
190
|
+
type: string;
|
|
191
|
+
description: string;
|
|
192
|
+
};
|
|
193
|
+
price: {
|
|
194
|
+
type: string;
|
|
195
|
+
description: string;
|
|
196
|
+
};
|
|
197
|
+
currency: {
|
|
198
|
+
type: string;
|
|
199
|
+
description: string;
|
|
200
|
+
};
|
|
201
|
+
isActive: {
|
|
202
|
+
type: string;
|
|
203
|
+
description: string;
|
|
204
|
+
};
|
|
205
|
+
isPublic: {
|
|
206
|
+
type: string;
|
|
207
|
+
description: string;
|
|
208
|
+
};
|
|
209
|
+
planLevel: {
|
|
210
|
+
type: string;
|
|
211
|
+
description: string;
|
|
212
|
+
};
|
|
213
|
+
entitlements: {
|
|
214
|
+
type: string;
|
|
215
|
+
description: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
required: string[];
|
|
219
|
+
};
|
|
220
|
+
handler: (args: Record<string, unknown>) => Promise<{
|
|
221
|
+
content: {
|
|
222
|
+
type: "text";
|
|
223
|
+
text: string;
|
|
224
|
+
}[];
|
|
225
|
+
}>;
|
|
226
|
+
};
|
|
227
|
+
create_plan_localization: {
|
|
228
|
+
description: string;
|
|
229
|
+
inputSchema: {
|
|
230
|
+
type: "object";
|
|
231
|
+
properties: {
|
|
232
|
+
organizationId: {
|
|
233
|
+
type: string;
|
|
234
|
+
description: string;
|
|
235
|
+
};
|
|
236
|
+
id: {
|
|
237
|
+
type: string;
|
|
238
|
+
description: string;
|
|
239
|
+
};
|
|
240
|
+
name: {
|
|
241
|
+
type: string;
|
|
242
|
+
description: string;
|
|
243
|
+
};
|
|
244
|
+
description: {
|
|
245
|
+
type: string;
|
|
246
|
+
description: string;
|
|
247
|
+
};
|
|
248
|
+
entitlements: {
|
|
249
|
+
type: string;
|
|
250
|
+
description: string;
|
|
251
|
+
};
|
|
252
|
+
sourceLanguageId: {
|
|
253
|
+
type: string;
|
|
254
|
+
description: string;
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
required: string[];
|
|
258
|
+
};
|
|
259
|
+
handler: (args: Record<string, unknown>) => Promise<{
|
|
260
|
+
content: {
|
|
261
|
+
type: "text";
|
|
262
|
+
text: string;
|
|
263
|
+
}[];
|
|
264
|
+
}>;
|
|
265
|
+
};
|
|
266
|
+
delete_plan: {
|
|
267
|
+
description: string;
|
|
268
|
+
inputSchema: {
|
|
269
|
+
type: "object";
|
|
270
|
+
properties: {
|
|
271
|
+
organizationId: {
|
|
272
|
+
type: string;
|
|
273
|
+
description: string;
|
|
274
|
+
};
|
|
275
|
+
id: {
|
|
276
|
+
type: string;
|
|
277
|
+
description: string;
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
required: string[];
|
|
281
|
+
};
|
|
282
|
+
handler: (args: {
|
|
283
|
+
organizationId: string;
|
|
284
|
+
id: string;
|
|
285
|
+
}) => Promise<{
|
|
286
|
+
content: {
|
|
287
|
+
type: "text";
|
|
288
|
+
text: string;
|
|
289
|
+
}[];
|
|
290
|
+
}>;
|
|
291
|
+
};
|
|
292
|
+
};
|
|
293
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../../src/tools/plans.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AASzC,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA+BlB;YACpB,cAAc,EAAE,MAAM,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,aAAa,CAAC,EAAE,MAAM,CAAC;YACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;YAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,UAAU,CAAC,EAAE,MAAM,CAAC;SACrB;;;;;;;;;;;;;;;;;;;;;;;wBA6BqB;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA2CtC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAsCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqCvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;wBAiCvB;YAAE,cAAc,EAAE,MAAM,CAAC;YAAC,EAAE,EAAE,MAAM,CAAA;SAAE;;;;;;;EAUjE"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Tools for WAPPA SaaS Plan CRUD operations
|
|
3
|
+
*
|
|
4
|
+
* Plans are subscription tiers scoped under an organization (organizationId).
|
|
5
|
+
* All plan operations require the organizationId (GUID).
|
|
6
|
+
*/
|
|
7
|
+
// BillingPeriod backend enum: Monthly = 30, Yearly = 360
|
|
8
|
+
const BILLING_PERIOD_HINT = "Faturalama periyodu (gün): 30 = Aylık (Monthly), 360 = Yıllık (Yearly).";
|
|
9
|
+
const ENTITLEMENTS_HINT = "Plana dahil yetkiler. Her öğe { key, value, name? } şeklindedir. Örn: [{ \"key\": \"maxUsers\", \"value\": 10, \"name\": \"Kullanıcı limiti\" }].";
|
|
10
|
+
export function getPlanTools(client) {
|
|
11
|
+
return {
|
|
12
|
+
// ─── List Plans ───────────────────────────────────────
|
|
13
|
+
list_plans: {
|
|
14
|
+
description: "Bir organizasyonun planlarını (abonelik paketlerini) listeler. organizationId zorunludur.",
|
|
15
|
+
inputSchema: {
|
|
16
|
+
type: "object",
|
|
17
|
+
properties: {
|
|
18
|
+
organizationId: {
|
|
19
|
+
type: "string",
|
|
20
|
+
description: "Organizasyon id'si (GUID)",
|
|
21
|
+
},
|
|
22
|
+
code: { type: "string", description: "Plan koduna göre filtrele" },
|
|
23
|
+
name: { type: "string", description: "İsme göre filtrele" },
|
|
24
|
+
description: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: "Açıklamaya göre filtrele",
|
|
27
|
+
},
|
|
28
|
+
billingPeriod: {
|
|
29
|
+
type: "number",
|
|
30
|
+
description: BILLING_PERIOD_HINT,
|
|
31
|
+
},
|
|
32
|
+
currency: { type: "string", description: "Para birimine göre filtrele" },
|
|
33
|
+
isActive: { type: "boolean", description: "Aktiflik durumu filtresi" },
|
|
34
|
+
isPublic: { type: "boolean", description: "Herkese açıklık filtresi" },
|
|
35
|
+
pageIndex: { type: "number", description: "Sayfa numarası (0-based)" },
|
|
36
|
+
pageLength: { type: "number", description: "Sayfa boyutu" },
|
|
37
|
+
},
|
|
38
|
+
required: ["organizationId"],
|
|
39
|
+
},
|
|
40
|
+
handler: async (args) => {
|
|
41
|
+
const { organizationId, ...rest } = args;
|
|
42
|
+
const params = {};
|
|
43
|
+
for (const [k, v] of Object.entries(rest)) {
|
|
44
|
+
if (v !== undefined && v !== null)
|
|
45
|
+
params[k] = String(v);
|
|
46
|
+
}
|
|
47
|
+
const result = await client.getPlans(organizationId, params);
|
|
48
|
+
return {
|
|
49
|
+
content: [
|
|
50
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
// ─── Get Plan ─────────────────────────────────────────
|
|
56
|
+
get_plan: {
|
|
57
|
+
description: "Belirli bir planı id ile getirir.",
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: "object",
|
|
60
|
+
properties: {
|
|
61
|
+
organizationId: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Organizasyon id'si (GUID)",
|
|
64
|
+
},
|
|
65
|
+
id: { type: "string", description: "Plan id'si (GUID)" },
|
|
66
|
+
},
|
|
67
|
+
required: ["organizationId", "id"],
|
|
68
|
+
},
|
|
69
|
+
handler: async (args) => {
|
|
70
|
+
const result = await client.getPlan(args.organizationId, args.id);
|
|
71
|
+
return {
|
|
72
|
+
content: [
|
|
73
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
// ─── Create Plan ──────────────────────────────────────
|
|
79
|
+
create_plan: {
|
|
80
|
+
description: `Bir organizasyona yeni plan ekler.
|
|
81
|
+
'code': Benzersiz plan kodu.
|
|
82
|
+
'billingPeriod': ${BILLING_PERIOD_HINT}
|
|
83
|
+
'price' + 'currency': Fiyat ve para birimi (örn: 99.90 / "TRY").
|
|
84
|
+
'planLevel': Plan seviyesi (yükseltme/düşürme sıralaması için tam sayı).
|
|
85
|
+
'isPublic': Plan herkese açık satışta mı?
|
|
86
|
+
'entitlements': ${ENTITLEMENTS_HINT}`,
|
|
87
|
+
inputSchema: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
organizationId: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Organizasyon id'si (GUID)",
|
|
93
|
+
},
|
|
94
|
+
id: {
|
|
95
|
+
type: "string",
|
|
96
|
+
description: "Opsiyonel: belirli bir GUID atamak için",
|
|
97
|
+
},
|
|
98
|
+
code: { type: "string", description: "Benzersiz plan kodu" },
|
|
99
|
+
name: { type: "string", description: "Plan adı" },
|
|
100
|
+
description: { type: "string", description: "Açıklama" },
|
|
101
|
+
billingPeriod: { type: "number", description: BILLING_PERIOD_HINT },
|
|
102
|
+
price: { type: "number", description: "Fiyat" },
|
|
103
|
+
currency: { type: "string", description: 'Para birimi (örn: "TRY", "USD")' },
|
|
104
|
+
isActive: { type: "boolean", description: "Aktif mi?" },
|
|
105
|
+
isPublic: { type: "boolean", description: "Herkese açık mı?" },
|
|
106
|
+
planLevel: { type: "number", description: "Plan seviyesi (tam sayı)" },
|
|
107
|
+
entitlements: { type: "array", description: ENTITLEMENTS_HINT },
|
|
108
|
+
},
|
|
109
|
+
required: ["organizationId", "code", "name", "billingPeriod", "price", "currency"],
|
|
110
|
+
},
|
|
111
|
+
handler: async (args) => {
|
|
112
|
+
const { organizationId, ...data } = args;
|
|
113
|
+
const result = await client.createPlan(organizationId, data);
|
|
114
|
+
return {
|
|
115
|
+
content: [
|
|
116
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
117
|
+
],
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
// ─── Update Plan ──────────────────────────────────────
|
|
122
|
+
update_plan: {
|
|
123
|
+
description: "Mevcut bir planı günceller. Aktif dilde planın temel alanlarını günceller; başka bir dilin çevirisini eklemek için create_plan_localization kullanın.",
|
|
124
|
+
inputSchema: {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
organizationId: {
|
|
128
|
+
type: "string",
|
|
129
|
+
description: "Organizasyon id'si (GUID)",
|
|
130
|
+
},
|
|
131
|
+
id: { type: "string", description: "Güncellenecek plan id'si (GUID)" },
|
|
132
|
+
code: { type: "string", description: "Plan kodu" },
|
|
133
|
+
name: { type: "string", description: "Plan adı" },
|
|
134
|
+
description: { type: "string", description: "Açıklama" },
|
|
135
|
+
billingPeriod: { type: "number", description: BILLING_PERIOD_HINT },
|
|
136
|
+
price: { type: "number", description: "Fiyat" },
|
|
137
|
+
currency: { type: "string", description: "Para birimi" },
|
|
138
|
+
isActive: { type: "boolean", description: "Aktif mi?" },
|
|
139
|
+
isPublic: { type: "boolean", description: "Herkese açık mı?" },
|
|
140
|
+
planLevel: { type: "number", description: "Plan seviyesi (tam sayı)" },
|
|
141
|
+
entitlements: { type: "array", description: ENTITLEMENTS_HINT },
|
|
142
|
+
},
|
|
143
|
+
required: ["organizationId", "id"],
|
|
144
|
+
},
|
|
145
|
+
handler: async (args) => {
|
|
146
|
+
const { organizationId, id, ...data } = args;
|
|
147
|
+
const result = await client.updatePlan(organizationId, id, data);
|
|
148
|
+
return {
|
|
149
|
+
content: [
|
|
150
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
151
|
+
],
|
|
152
|
+
};
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
// ─── Create Plan Localization ─────────────────────────
|
|
156
|
+
create_plan_localization: {
|
|
157
|
+
description: `Bir plan için aktif dilde çeviri (yerelleştirme) oluşturur.
|
|
158
|
+
Yalnızca dile bağlı alanlar (name, description, entitlements) çevrilir.
|
|
159
|
+
'sourceLanguageId': Çevirinin kaynak dili (opsiyonel).`,
|
|
160
|
+
inputSchema: {
|
|
161
|
+
type: "object",
|
|
162
|
+
properties: {
|
|
163
|
+
organizationId: {
|
|
164
|
+
type: "string",
|
|
165
|
+
description: "Organizasyon id'si (GUID)",
|
|
166
|
+
},
|
|
167
|
+
id: { type: "string", description: "Plan id'si (GUID)" },
|
|
168
|
+
name: { type: "string", description: "Çevrilen plan adı" },
|
|
169
|
+
description: { type: "string", description: "Çevrilen açıklama" },
|
|
170
|
+
entitlements: { type: "array", description: ENTITLEMENTS_HINT },
|
|
171
|
+
sourceLanguageId: {
|
|
172
|
+
type: "string",
|
|
173
|
+
description: 'Kaynak dil kodu (örn: "en-us")',
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
required: ["organizationId", "id"],
|
|
177
|
+
},
|
|
178
|
+
handler: async (args) => {
|
|
179
|
+
const { organizationId, id, ...data } = args;
|
|
180
|
+
const result = await client.createPlanLocalization(organizationId, id, data);
|
|
181
|
+
return {
|
|
182
|
+
content: [
|
|
183
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
// ─── Delete Plan ──────────────────────────────────────
|
|
189
|
+
delete_plan: {
|
|
190
|
+
description: "Bir planı siler. Bu plana bağlı abonelikler etkilenebilir.",
|
|
191
|
+
inputSchema: {
|
|
192
|
+
type: "object",
|
|
193
|
+
properties: {
|
|
194
|
+
organizationId: {
|
|
195
|
+
type: "string",
|
|
196
|
+
description: "Organizasyon id'si (GUID)",
|
|
197
|
+
},
|
|
198
|
+
id: { type: "string", description: "Silinecek plan id'si (GUID)" },
|
|
199
|
+
},
|
|
200
|
+
required: ["organizationId", "id"],
|
|
201
|
+
},
|
|
202
|
+
handler: async (args) => {
|
|
203
|
+
const result = await client.deletePlan(args.organizationId, args.id);
|
|
204
|
+
return {
|
|
205
|
+
content: [
|
|
206
|
+
{ type: "text", text: JSON.stringify(result, null, 2) },
|
|
207
|
+
],
|
|
208
|
+
};
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=plans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.js","sourceRoot":"","sources":["../../src/tools/plans.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,yDAAyD;AACzD,MAAM,mBAAmB,GACvB,yEAAyE,CAAC;AAE5E,MAAM,iBAAiB,GACrB,mJAAmJ,CAAC;AA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