@burdenoff/mcp-libs 2026.511.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.
Files changed (174) hide show
  1. package/README.md +76 -0
  2. package/dist/chunk-4GBVJ4OY.js +847 -0
  3. package/dist/chunk-4GBVJ4OY.js.map +1 -0
  4. package/dist/chunk-H2OYWLOA.js +919 -0
  5. package/dist/chunk-H2OYWLOA.js.map +1 -0
  6. package/dist/chunk-JFEQYSWM.js +174 -0
  7. package/dist/chunk-JFEQYSWM.js.map +1 -0
  8. package/dist/chunk-WWFVD7BO.js +273 -0
  9. package/dist/chunk-WWFVD7BO.js.map +1 -0
  10. package/dist/context-1jV4NsLv.d.cts +138 -0
  11. package/dist/context-1jV4NsLv.d.ts +138 -0
  12. package/dist/core/index.cjs +953 -0
  13. package/dist/core/index.cjs.map +1 -0
  14. package/dist/core/index.d.cts +59 -0
  15. package/dist/core/index.d.ts +59 -0
  16. package/dist/core/index.js +3 -0
  17. package/dist/core/index.js.map +1 -0
  18. package/dist/http-BP4c721D.d.cts +22 -0
  19. package/dist/http-DXTeCD5r.d.ts +22 -0
  20. package/dist/index.cjs +1013 -0
  21. package/dist/index.cjs.map +1 -0
  22. package/dist/index.d.cts +7 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/module-DBcfA-i3.d.ts +67 -0
  27. package/dist/module-DFQBZNK6.d.cts +67 -0
  28. package/dist/modules/auth/index.cjs +533 -0
  29. package/dist/modules/auth/index.cjs.map +1 -0
  30. package/dist/modules/auth/index.d.cts +51 -0
  31. package/dist/modules/auth/index.d.ts +51 -0
  32. package/dist/modules/auth/index.js +159 -0
  33. package/dist/modules/auth/index.js.map +1 -0
  34. package/dist/modules/billing/index.cjs +655 -0
  35. package/dist/modules/billing/index.cjs.map +1 -0
  36. package/dist/modules/billing/index.d.cts +8 -0
  37. package/dist/modules/billing/index.d.ts +8 -0
  38. package/dist/modules/billing/index.js +606 -0
  39. package/dist/modules/billing/index.js.map +1 -0
  40. package/dist/modules/channels/index.cjs +443 -0
  41. package/dist/modules/channels/index.cjs.map +1 -0
  42. package/dist/modules/channels/index.d.cts +8 -0
  43. package/dist/modules/channels/index.d.ts +8 -0
  44. package/dist/modules/channels/index.js +394 -0
  45. package/dist/modules/channels/index.js.map +1 -0
  46. package/dist/modules/conversations/index.cjs +288 -0
  47. package/dist/modules/conversations/index.cjs.map +1 -0
  48. package/dist/modules/conversations/index.d.cts +8 -0
  49. package/dist/modules/conversations/index.d.ts +8 -0
  50. package/dist/modules/conversations/index.js +239 -0
  51. package/dist/modules/conversations/index.js.map +1 -0
  52. package/dist/modules/devportal/index.cjs +796 -0
  53. package/dist/modules/devportal/index.cjs.map +1 -0
  54. package/dist/modules/devportal/index.d.cts +8 -0
  55. package/dist/modules/devportal/index.d.ts +8 -0
  56. package/dist/modules/devportal/index.js +747 -0
  57. package/dist/modules/devportal/index.js.map +1 -0
  58. package/dist/modules/export/index.cjs +333 -0
  59. package/dist/modules/export/index.cjs.map +1 -0
  60. package/dist/modules/export/index.d.cts +8 -0
  61. package/dist/modules/export/index.d.ts +8 -0
  62. package/dist/modules/export/index.js +284 -0
  63. package/dist/modules/export/index.js.map +1 -0
  64. package/dist/modules/files/index.cjs +278 -0
  65. package/dist/modules/files/index.cjs.map +1 -0
  66. package/dist/modules/files/index.d.cts +8 -0
  67. package/dist/modules/files/index.d.ts +8 -0
  68. package/dist/modules/files/index.js +229 -0
  69. package/dist/modules/files/index.js.map +1 -0
  70. package/dist/modules/groups/index.cjs +451 -0
  71. package/dist/modules/groups/index.cjs.map +1 -0
  72. package/dist/modules/groups/index.d.cts +8 -0
  73. package/dist/modules/groups/index.d.ts +8 -0
  74. package/dist/modules/groups/index.js +402 -0
  75. package/dist/modules/groups/index.js.map +1 -0
  76. package/dist/modules/health/index.cjs +159 -0
  77. package/dist/modules/health/index.cjs.map +1 -0
  78. package/dist/modules/health/index.d.cts +8 -0
  79. package/dist/modules/health/index.d.ts +8 -0
  80. package/dist/modules/health/index.js +36 -0
  81. package/dist/modules/health/index.js.map +1 -0
  82. package/dist/modules/integrations/index.cjs +316 -0
  83. package/dist/modules/integrations/index.cjs.map +1 -0
  84. package/dist/modules/integrations/index.d.cts +8 -0
  85. package/dist/modules/integrations/index.d.ts +8 -0
  86. package/dist/modules/integrations/index.js +267 -0
  87. package/dist/modules/integrations/index.js.map +1 -0
  88. package/dist/modules/notifications/index.cjs +222 -0
  89. package/dist/modules/notifications/index.cjs.map +1 -0
  90. package/dist/modules/notifications/index.d.cts +8 -0
  91. package/dist/modules/notifications/index.d.ts +8 -0
  92. package/dist/modules/notifications/index.js +173 -0
  93. package/dist/modules/notifications/index.js.map +1 -0
  94. package/dist/modules/organizations/index.cjs +267 -0
  95. package/dist/modules/organizations/index.cjs.map +1 -0
  96. package/dist/modules/organizations/index.d.cts +8 -0
  97. package/dist/modules/organizations/index.d.ts +8 -0
  98. package/dist/modules/organizations/index.js +218 -0
  99. package/dist/modules/organizations/index.js.map +1 -0
  100. package/dist/modules/products/index.cjs +736 -0
  101. package/dist/modules/products/index.cjs.map +1 -0
  102. package/dist/modules/products/index.d.cts +8 -0
  103. package/dist/modules/products/index.d.ts +8 -0
  104. package/dist/modules/products/index.js +687 -0
  105. package/dist/modules/products/index.js.map +1 -0
  106. package/dist/modules/rbac/index.cjs +378 -0
  107. package/dist/modules/rbac/index.cjs.map +1 -0
  108. package/dist/modules/rbac/index.d.cts +8 -0
  109. package/dist/modules/rbac/index.d.ts +8 -0
  110. package/dist/modules/rbac/index.js +329 -0
  111. package/dist/modules/rbac/index.js.map +1 -0
  112. package/dist/modules/sandbox/index.cjs +318 -0
  113. package/dist/modules/sandbox/index.cjs.map +1 -0
  114. package/dist/modules/sandbox/index.d.cts +8 -0
  115. package/dist/modules/sandbox/index.d.ts +8 -0
  116. package/dist/modules/sandbox/index.js +225 -0
  117. package/dist/modules/sandbox/index.js.map +1 -0
  118. package/dist/modules/scheduler/index.cjs +267 -0
  119. package/dist/modules/scheduler/index.cjs.map +1 -0
  120. package/dist/modules/scheduler/index.d.cts +8 -0
  121. package/dist/modules/scheduler/index.d.ts +8 -0
  122. package/dist/modules/scheduler/index.js +218 -0
  123. package/dist/modules/scheduler/index.js.map +1 -0
  124. package/dist/modules/security/index.cjs +529 -0
  125. package/dist/modules/security/index.cjs.map +1 -0
  126. package/dist/modules/security/index.d.cts +8 -0
  127. package/dist/modules/security/index.d.ts +8 -0
  128. package/dist/modules/security/index.js +480 -0
  129. package/dist/modules/security/index.js.map +1 -0
  130. package/dist/modules/store/index.cjs +450 -0
  131. package/dist/modules/store/index.cjs.map +1 -0
  132. package/dist/modules/store/index.d.cts +8 -0
  133. package/dist/modules/store/index.d.ts +8 -0
  134. package/dist/modules/store/index.js +401 -0
  135. package/dist/modules/store/index.js.map +1 -0
  136. package/dist/modules/support/index.cjs +285 -0
  137. package/dist/modules/support/index.cjs.map +1 -0
  138. package/dist/modules/support/index.d.cts +8 -0
  139. package/dist/modules/support/index.d.ts +8 -0
  140. package/dist/modules/support/index.js +236 -0
  141. package/dist/modules/support/index.js.map +1 -0
  142. package/dist/modules/tags/index.cjs +421 -0
  143. package/dist/modules/tags/index.cjs.map +1 -0
  144. package/dist/modules/tags/index.d.cts +8 -0
  145. package/dist/modules/tags/index.d.ts +8 -0
  146. package/dist/modules/tags/index.js +372 -0
  147. package/dist/modules/tags/index.js.map +1 -0
  148. package/dist/modules/tours/index.cjs +225 -0
  149. package/dist/modules/tours/index.cjs.map +1 -0
  150. package/dist/modules/tours/index.d.cts +8 -0
  151. package/dist/modules/tours/index.d.ts +8 -0
  152. package/dist/modules/tours/index.js +176 -0
  153. package/dist/modules/tours/index.js.map +1 -0
  154. package/dist/modules/vibecontrols/index.cjs +5551 -0
  155. package/dist/modules/vibecontrols/index.cjs.map +1 -0
  156. package/dist/modules/vibecontrols/index.d.cts +8 -0
  157. package/dist/modules/vibecontrols/index.d.ts +8 -0
  158. package/dist/modules/vibecontrols/index.js +4380 -0
  159. package/dist/modules/vibecontrols/index.js.map +1 -0
  160. package/dist/modules/workspaces/index.cjs +552 -0
  161. package/dist/modules/workspaces/index.cjs.map +1 -0
  162. package/dist/modules/workspaces/index.d.cts +8 -0
  163. package/dist/modules/workspaces/index.d.ts +8 -0
  164. package/dist/modules/workspaces/index.js +503 -0
  165. package/dist/modules/workspaces/index.js.map +1 -0
  166. package/dist/tool-name-CQf_IqAj.d.cts +47 -0
  167. package/dist/tool-name-DlnrBsZ6.d.ts +47 -0
  168. package/dist/transports/index.cjs +183 -0
  169. package/dist/transports/index.cjs.map +1 -0
  170. package/dist/transports/index.d.cts +13 -0
  171. package/dist/transports/index.d.ts +13 -0
  172. package/dist/transports/index.js +3 -0
  173. package/dist/transports/index.js.map +1 -0
  174. package/package.json +125 -0
@@ -0,0 +1,747 @@
1
+ import { mcpToolName, jsonResult, errorResult } from '../../chunk-H2OYWLOA.js';
2
+ import { z } from 'zod';
3
+
4
+ // src/modules/devportal/operations.ts
5
+ var LIST_ORGANIZATIONS = `
6
+ query ListOrganizations($limit: Int, $offset: Int) {
7
+ organizations(limit: $limit, offset: $offset) {
8
+ edges { node { id name slug status } }
9
+ totalCount pageInfo { hasNextPage }
10
+ }
11
+ }
12
+ `;
13
+ var GET_ORGANIZATION = `
14
+ query GetOrganization($id: ID!) {
15
+ organization(id: $id) {
16
+ id name description status
17
+ }
18
+ }
19
+ `;
20
+ var CREATE_ORGANIZATION = `
21
+ mutation CreateOrganization($input: CreateOrganizationInput!) {
22
+ createOrganization(input: $input) {
23
+ id name slug status
24
+ }
25
+ }
26
+ `;
27
+ var UPDATE_ORGANIZATION = `
28
+ mutation UpdateOrganization($id: ID!, $input: UpdateOrganizationInput!) {
29
+ updateOrganization(id: $id, input: $input) {
30
+ id name updatedAt
31
+ }
32
+ }
33
+ `;
34
+ var DELETE_ORGANIZATION = `
35
+ mutation DeleteOrganization($id: ID!) {
36
+ deleteOrganization(id: $id) { success }
37
+ }
38
+ `;
39
+ var LIST_APPLICATIONS = `
40
+ query ListApplications($organizationId: ID, $status: String, $limit: Int) {
41
+ applications(organizationId: $organizationId, status: $status, limit: $limit) {
42
+ edges { node { id name status installCount averageRating } }
43
+ totalCount
44
+ }
45
+ }
46
+ `;
47
+ var GET_APPLICATION = `
48
+ query GetApplication($id: ID!) {
49
+ application(id: $id) {
50
+ id name status reviewStatus publishedAt installCount
51
+ }
52
+ }
53
+ `;
54
+ var CREATE_APPLICATION = `
55
+ mutation CreateApplication($input: CreateApplicationInput!) {
56
+ createApplication(input: $input) {
57
+ id name status appId
58
+ }
59
+ }
60
+ `;
61
+ var UPDATE_APPLICATION = `
62
+ mutation UpdateApplication($id: ID!, $input: UpdateApplicationInput!) {
63
+ updateApplication(id: $id, input: $input) {
64
+ id description updatedAt
65
+ }
66
+ }
67
+ `;
68
+ var SUBMIT_APPLICATION_FOR_REVIEW = `
69
+ mutation SubmitApplicationForReview($id: ID!, $notes: String) {
70
+ submitApplicationForReview(id: $id, notes: $notes) {
71
+ id status reviewStatus submittedAt
72
+ }
73
+ }
74
+ `;
75
+ var PUBLISH_APPLICATION = `
76
+ mutation PublishApplication($id: ID!) {
77
+ publishApplication(id: $id) {
78
+ id status publishedAt
79
+ }
80
+ }
81
+ `;
82
+ var DELETE_APPLICATION = `
83
+ mutation DeleteApplication($id: ID!) {
84
+ deleteApplication(id: $id) { success }
85
+ }
86
+ `;
87
+ var APPLICATION_VERSIONS = `
88
+ query ApplicationVersions($applicationId: ID!) {
89
+ applicationVersions(applicationId: $applicationId) {
90
+ id version status isLatest isStable releaseNotes
91
+ }
92
+ }
93
+ `;
94
+ var CREATE_APPLICATION_VERSION = `
95
+ mutation CreateApplicationVersion($applicationId: ID!, $input: CreateApplicationVersionInput!) {
96
+ createApplicationVersion(applicationId: $applicationId, input: $input) {
97
+ id version status publishedAt
98
+ }
99
+ }
100
+ `;
101
+ var LIST_WEBHOOKS = `
102
+ query ListDevportalWebhooks($applicationId: ID!) {
103
+ webhooks(applicationId: $applicationId) {
104
+ id name url events isActive status failureCount
105
+ }
106
+ }
107
+ `;
108
+ var CREATE_WEBHOOK = `
109
+ mutation CreateDevportalWebhook($input: CreateWebhookInput!) {
110
+ createWebhook(input: $input) {
111
+ id name url status
112
+ }
113
+ }
114
+ `;
115
+ var DELETE_WEBHOOK = `
116
+ mutation DeleteDevportalWebhook($id: ID!) {
117
+ deleteWebhook(id: $id) { success }
118
+ }
119
+ `;
120
+ var APPLICATION_ANALYTICS = `
121
+ query ApplicationAnalytics($applicationId: ID!, $period: String!, $startDate: DateTime, $endDate: DateTime) {
122
+ applicationAnalytics(applicationId: $applicationId, period: $period, startDate: $startDate, endDate: $endDate) {
123
+ date period activeUsers apiCalls avgResponseTime sessions
124
+ }
125
+ }
126
+ `;
127
+ var ORGANIZATION_REVENUE = `
128
+ query OrganizationRevenue($organizationId: ID!, $period: String!) {
129
+ organizationRevenue(organizationId: $organizationId, period: $period) {
130
+ totalEarnings currency netEarnings
131
+ }
132
+ }
133
+ `;
134
+ var ADMIN_REVIEWS = `
135
+ query AdminReviews($status: String) {
136
+ adminReviews(status: $status) {
137
+ edges { node { id applicationId reviewStatus reviewNotes } }
138
+ totalCount
139
+ }
140
+ }
141
+ `;
142
+ var APPROVE_APPLICATION = `
143
+ mutation ApproveApplication($id: ID!, $notes: String) {
144
+ approveApplication(id: $id, notes: $notes) {
145
+ id status reviewStatus publishedAt
146
+ }
147
+ }
148
+ `;
149
+ var REJECT_APPLICATION = `
150
+ mutation RejectApplication($id: ID!, $notes: String!) {
151
+ rejectApplication(id: $id, notes: $notes) {
152
+ id status reviewStatus reviewNotes
153
+ }
154
+ }
155
+ `;
156
+
157
+ // src/modules/devportal/tools.ts
158
+ function registerDevportalTools(server, ctx, track) {
159
+ server.registerTool(
160
+ track(mcpToolName(ctx.productName, "devportal_orgs_list")),
161
+ {
162
+ title: "List Devportal Organizations",
163
+ description: "List publisher organizations.",
164
+ inputSchema: {
165
+ limit: z.number().optional().describe("Page size (default 50)"),
166
+ offset: z.number().optional().describe("Skip results")
167
+ }
168
+ },
169
+ async ({ limit, offset }) => {
170
+ try {
171
+ const data = await ctx.gql.global.request(LIST_ORGANIZATIONS, { limit: limit ?? 50, offset: offset ?? 0 });
172
+ return jsonResult({
173
+ items: data.organizations.edges.map((e) => e.node),
174
+ totalCount: data.organizations.totalCount
175
+ });
176
+ } catch (error) {
177
+ ctx.logger.error("devportal_orgs_list failed", { error: String(error) });
178
+ return errorResult(
179
+ `Failed to list organizations: ${error instanceof Error ? error.message : String(error)}`
180
+ );
181
+ }
182
+ }
183
+ );
184
+ server.registerTool(
185
+ track(mcpToolName(ctx.productName, "devportal_orgs_get")),
186
+ {
187
+ title: "Get Devportal Organization",
188
+ description: "Get a publisher organization by ID.",
189
+ inputSchema: { id: z.string().describe("Organization ID") }
190
+ },
191
+ async ({ id }) => {
192
+ try {
193
+ const data = await ctx.gql.global.request(
194
+ GET_ORGANIZATION,
195
+ { id }
196
+ );
197
+ if (!data.organization) return errorResult(`Organization ${id} not found`);
198
+ return jsonResult(data.organization);
199
+ } catch (error) {
200
+ ctx.logger.error("devportal_orgs_get failed", { error: String(error) });
201
+ return errorResult(
202
+ `Failed to get organization: ${error instanceof Error ? error.message : String(error)}`
203
+ );
204
+ }
205
+ }
206
+ );
207
+ server.registerTool(
208
+ track(mcpToolName(ctx.productName, "devportal_orgs_create")),
209
+ {
210
+ title: "Create Publisher Organization",
211
+ description: "Create a publisher organization.",
212
+ inputSchema: {
213
+ name: z.string().describe("Organization name"),
214
+ description: z.string().optional(),
215
+ tier: z.string().optional().describe("INDIVIDUAL|ORGANIZATION|ENTERPRISE (default ORGANIZATION)")
216
+ }
217
+ },
218
+ async ({ name, description, tier }) => {
219
+ try {
220
+ const input = {
221
+ name,
222
+ tier: (tier ?? "ORGANIZATION").toUpperCase()
223
+ };
224
+ if (description !== void 0) input.description = description;
225
+ const data = await ctx.gql.global.request(
226
+ CREATE_ORGANIZATION,
227
+ { input }
228
+ );
229
+ return jsonResult(data.createOrganization);
230
+ } catch (error) {
231
+ ctx.logger.error("devportal_orgs_create failed", { error: String(error) });
232
+ return errorResult(
233
+ `Failed to create organization: ${error instanceof Error ? error.message : String(error)}`
234
+ );
235
+ }
236
+ }
237
+ );
238
+ server.registerTool(
239
+ track(mcpToolName(ctx.productName, "devportal_orgs_update")),
240
+ {
241
+ title: "Update Publisher Organization",
242
+ description: "Update a publisher organization.",
243
+ inputSchema: {
244
+ id: z.string().describe("Organization ID"),
245
+ name: z.string().optional(),
246
+ description: z.string().optional()
247
+ }
248
+ },
249
+ async ({ id, name, description }) => {
250
+ try {
251
+ const input = {};
252
+ if (name !== void 0) input.name = name;
253
+ if (description !== void 0) input.description = description;
254
+ if (!Object.keys(input).length) return errorResult("No updates specified");
255
+ const data = await ctx.gql.global.request(
256
+ UPDATE_ORGANIZATION,
257
+ { id, input }
258
+ );
259
+ return jsonResult(data.updateOrganization);
260
+ } catch (error) {
261
+ ctx.logger.error("devportal_orgs_update failed", { error: String(error) });
262
+ return errorResult(
263
+ `Failed to update organization: ${error instanceof Error ? error.message : String(error)}`
264
+ );
265
+ }
266
+ }
267
+ );
268
+ server.registerTool(
269
+ track(mcpToolName(ctx.productName, "devportal_orgs_delete")),
270
+ {
271
+ title: "Delete Publisher Organization",
272
+ description: "Delete a publisher organization.",
273
+ inputSchema: { id: z.string().describe("Organization ID") }
274
+ },
275
+ async ({ id }) => {
276
+ try {
277
+ await ctx.gql.global.request(DELETE_ORGANIZATION, { id });
278
+ return jsonResult({ status: "success", message: "Organization deleted", orgId: id });
279
+ } catch (error) {
280
+ ctx.logger.error("devportal_orgs_delete failed", { error: String(error) });
281
+ return errorResult(
282
+ `Failed to delete organization: ${error instanceof Error ? error.message : String(error)}`
283
+ );
284
+ }
285
+ }
286
+ );
287
+ server.registerTool(
288
+ track(mcpToolName(ctx.productName, "devportal_apps_list")),
289
+ {
290
+ title: "List Devportal Applications",
291
+ description: "List devportal applications.",
292
+ inputSchema: {
293
+ organizationId: z.string().optional(),
294
+ status: z.string().optional().describe("DRAFT|REVIEW|PUBLISHED|ARCHIVED"),
295
+ limit: z.number().optional().describe("Page size (default 50)")
296
+ }
297
+ },
298
+ async ({ organizationId, status, limit }) => {
299
+ try {
300
+ const data = await ctx.gql.global.request(LIST_APPLICATIONS, {
301
+ organizationId,
302
+ status: status ? status.toUpperCase() : void 0,
303
+ limit: limit ?? 50
304
+ });
305
+ return jsonResult({
306
+ items: data.applications.edges.map((e) => e.node),
307
+ totalCount: data.applications.totalCount
308
+ });
309
+ } catch (error) {
310
+ ctx.logger.error("devportal_apps_list failed", { error: String(error) });
311
+ return errorResult(
312
+ `Failed to list applications: ${error instanceof Error ? error.message : String(error)}`
313
+ );
314
+ }
315
+ }
316
+ );
317
+ server.registerTool(
318
+ track(mcpToolName(ctx.productName, "devportal_apps_get")),
319
+ {
320
+ title: "Get Devportal Application",
321
+ description: "Get a devportal application by ID.",
322
+ inputSchema: { id: z.string().describe("Application ID") }
323
+ },
324
+ async ({ id }) => {
325
+ try {
326
+ const data = await ctx.gql.global.request(
327
+ GET_APPLICATION,
328
+ { id }
329
+ );
330
+ if (!data.application) return errorResult(`Application ${id} not found`);
331
+ return jsonResult(data.application);
332
+ } catch (error) {
333
+ ctx.logger.error("devportal_apps_get failed", { error: String(error) });
334
+ return errorResult(
335
+ `Failed to get application: ${error instanceof Error ? error.message : String(error)}`
336
+ );
337
+ }
338
+ }
339
+ );
340
+ server.registerTool(
341
+ track(mcpToolName(ctx.productName, "devportal_apps_create")),
342
+ {
343
+ title: "Create Devportal Application",
344
+ description: "Create a devportal application.",
345
+ inputSchema: {
346
+ name: z.string().describe("Application name"),
347
+ organizationId: z.string().describe("Owning organization ID"),
348
+ appType: z.string().optional().describe("API_INTEGRATION|WEB_APP|MOBILE_APP (default API_INTEGRATION)"),
349
+ description: z.string().optional()
350
+ }
351
+ },
352
+ async ({ name, organizationId, appType, description }) => {
353
+ try {
354
+ const input = {
355
+ name,
356
+ organizationId,
357
+ appType: (appType ?? "API_INTEGRATION").toUpperCase()
358
+ };
359
+ if (description !== void 0) input.description = description;
360
+ const data = await ctx.gql.global.request(CREATE_APPLICATION, { input });
361
+ return jsonResult(data.createApplication);
362
+ } catch (error) {
363
+ ctx.logger.error("devportal_apps_create failed", { error: String(error) });
364
+ return errorResult(
365
+ `Failed to create application: ${error instanceof Error ? error.message : String(error)}`
366
+ );
367
+ }
368
+ }
369
+ );
370
+ server.registerTool(
371
+ track(mcpToolName(ctx.productName, "devportal_apps_update")),
372
+ {
373
+ title: "Update Devportal Application",
374
+ description: "Update a devportal application.",
375
+ inputSchema: {
376
+ id: z.string().describe("Application ID"),
377
+ description: z.string().optional(),
378
+ pricingType: z.string().optional().describe("FREE|PAID_ONETIME|SUBSCRIPTION"),
379
+ documentationUrl: z.string().optional()
380
+ }
381
+ },
382
+ async ({ id, description, pricingType, documentationUrl }) => {
383
+ try {
384
+ const input = {};
385
+ if (description !== void 0) input.description = description;
386
+ if (pricingType !== void 0) input.pricingType = pricingType.toUpperCase();
387
+ if (documentationUrl !== void 0) input.documentationUrl = documentationUrl;
388
+ if (!Object.keys(input).length) return errorResult("No updates specified");
389
+ const data = await ctx.gql.global.request(
390
+ UPDATE_APPLICATION,
391
+ { id, input }
392
+ );
393
+ return jsonResult(data.updateApplication);
394
+ } catch (error) {
395
+ ctx.logger.error("devportal_apps_update failed", { error: String(error) });
396
+ return errorResult(
397
+ `Failed to update application: ${error instanceof Error ? error.message : String(error)}`
398
+ );
399
+ }
400
+ }
401
+ );
402
+ server.registerTool(
403
+ track(mcpToolName(ctx.productName, "devportal_apps_submit_review")),
404
+ {
405
+ title: "Submit Application For Review",
406
+ description: "Submit an application for admin review.",
407
+ inputSchema: {
408
+ id: z.string().describe("Application ID"),
409
+ notes: z.string().optional().describe("Optional submission notes")
410
+ }
411
+ },
412
+ async ({ id, notes }) => {
413
+ try {
414
+ const data = await ctx.gql.global.request(
415
+ SUBMIT_APPLICATION_FOR_REVIEW,
416
+ { id, notes }
417
+ );
418
+ return jsonResult(data.submitApplicationForReview);
419
+ } catch (error) {
420
+ ctx.logger.error("devportal_apps_submit_review failed", { error: String(error) });
421
+ return errorResult(
422
+ `Failed to submit for review: ${error instanceof Error ? error.message : String(error)}`
423
+ );
424
+ }
425
+ }
426
+ );
427
+ server.registerTool(
428
+ track(mcpToolName(ctx.productName, "devportal_apps_publish")),
429
+ {
430
+ title: "Publish Application",
431
+ description: "Publish an approved application. Note: in the legacy CLI this opened a browser; here it just calls the publish mutation directly.",
432
+ inputSchema: { id: z.string().describe("Application ID") }
433
+ },
434
+ async ({ id }) => {
435
+ try {
436
+ const data = await ctx.gql.global.request(
437
+ PUBLISH_APPLICATION,
438
+ { id }
439
+ );
440
+ return jsonResult(data.publishApplication);
441
+ } catch (error) {
442
+ ctx.logger.error("devportal_apps_publish failed", { error: String(error) });
443
+ return errorResult(
444
+ `Failed to publish application: ${error instanceof Error ? error.message : String(error)}`
445
+ );
446
+ }
447
+ }
448
+ );
449
+ server.registerTool(
450
+ track(mcpToolName(ctx.productName, "devportal_apps_delete")),
451
+ {
452
+ title: "Delete Devportal Application",
453
+ description: "Delete a devportal application.",
454
+ inputSchema: { id: z.string().describe("Application ID") }
455
+ },
456
+ async ({ id }) => {
457
+ try {
458
+ await ctx.gql.global.request(DELETE_APPLICATION, { id });
459
+ return jsonResult({ status: "success", message: "Application deleted", appId: id });
460
+ } catch (error) {
461
+ ctx.logger.error("devportal_apps_delete failed", { error: String(error) });
462
+ return errorResult(
463
+ `Failed to delete application: ${error instanceof Error ? error.message : String(error)}`
464
+ );
465
+ }
466
+ }
467
+ );
468
+ server.registerTool(
469
+ track(mcpToolName(ctx.productName, "devportal_apps_versions_list")),
470
+ {
471
+ title: "List Application Versions",
472
+ description: "List versions for an application.",
473
+ inputSchema: { applicationId: z.string().describe("Application ID") }
474
+ },
475
+ async ({ applicationId }) => {
476
+ try {
477
+ const data = await ctx.gql.global.request(
478
+ APPLICATION_VERSIONS,
479
+ { applicationId }
480
+ );
481
+ return jsonResult(data.applicationVersions);
482
+ } catch (error) {
483
+ ctx.logger.error("devportal_apps_versions_list failed", { error: String(error) });
484
+ return errorResult(
485
+ `Failed to list versions: ${error instanceof Error ? error.message : String(error)}`
486
+ );
487
+ }
488
+ }
489
+ );
490
+ server.registerTool(
491
+ track(mcpToolName(ctx.productName, "devportal_apps_versions_create")),
492
+ {
493
+ title: "Create Application Version",
494
+ description: "Create a new version for an application.",
495
+ inputSchema: {
496
+ applicationId: z.string().describe("Application ID"),
497
+ version: z.string().describe('Version string (e.g. "1.2.0")'),
498
+ releaseNotes: z.string().optional(),
499
+ packageUrl: z.string().optional()
500
+ }
501
+ },
502
+ async ({ applicationId, version, releaseNotes, packageUrl }) => {
503
+ try {
504
+ const input = { version };
505
+ if (releaseNotes !== void 0) input.releaseNotes = releaseNotes;
506
+ if (packageUrl !== void 0) input.packageUrl = packageUrl;
507
+ const data = await ctx.gql.global.request(
508
+ CREATE_APPLICATION_VERSION,
509
+ { applicationId, input }
510
+ );
511
+ return jsonResult(data.createApplicationVersion);
512
+ } catch (error) {
513
+ ctx.logger.error("devportal_apps_versions_create failed", { error: String(error) });
514
+ return errorResult(
515
+ `Failed to create version: ${error instanceof Error ? error.message : String(error)}`
516
+ );
517
+ }
518
+ }
519
+ );
520
+ server.registerTool(
521
+ track(mcpToolName(ctx.productName, "devportal_apps_webhooks_list")),
522
+ {
523
+ title: "List Application Webhooks",
524
+ description: "List webhooks attached to an application.",
525
+ inputSchema: { applicationId: z.string().describe("Application ID") }
526
+ },
527
+ async ({ applicationId }) => {
528
+ try {
529
+ const data = await ctx.gql.global.request(LIST_WEBHOOKS, {
530
+ applicationId
531
+ });
532
+ return jsonResult(data.webhooks);
533
+ } catch (error) {
534
+ ctx.logger.error("devportal_apps_webhooks_list failed", { error: String(error) });
535
+ return errorResult(
536
+ `Failed to list webhooks: ${error instanceof Error ? error.message : String(error)}`
537
+ );
538
+ }
539
+ }
540
+ );
541
+ server.registerTool(
542
+ track(mcpToolName(ctx.productName, "devportal_apps_webhooks_add")),
543
+ {
544
+ title: "Add Application Webhook",
545
+ description: "Add a webhook to an application.",
546
+ inputSchema: {
547
+ applicationId: z.string().describe("Application ID"),
548
+ name: z.string().describe("Webhook name"),
549
+ url: z.string().describe("Delivery URL"),
550
+ events: z.array(z.string()).describe("Event names"),
551
+ maxRetries: z.number().optional().describe("Default 5")
552
+ }
553
+ },
554
+ async ({ applicationId, name, url, events, maxRetries }) => {
555
+ try {
556
+ const input = {
557
+ applicationId,
558
+ name,
559
+ url,
560
+ events,
561
+ retryEnabled: true,
562
+ maxRetries: maxRetries ?? 5
563
+ };
564
+ const data = await ctx.gql.global.request(
565
+ CREATE_WEBHOOK,
566
+ { input }
567
+ );
568
+ return jsonResult(data.createWebhook);
569
+ } catch (error) {
570
+ ctx.logger.error("devportal_apps_webhooks_add failed", { error: String(error) });
571
+ return errorResult(
572
+ `Failed to create webhook: ${error instanceof Error ? error.message : String(error)}`
573
+ );
574
+ }
575
+ }
576
+ );
577
+ server.registerTool(
578
+ track(mcpToolName(ctx.productName, "devportal_apps_webhooks_remove")),
579
+ {
580
+ title: "Remove Application Webhook",
581
+ description: "Remove a webhook by ID.",
582
+ inputSchema: { id: z.string().describe("Webhook ID") }
583
+ },
584
+ async ({ id }) => {
585
+ try {
586
+ await ctx.gql.global.request(DELETE_WEBHOOK, { id });
587
+ return jsonResult({ status: "success", message: "Webhook removed", webhookId: id });
588
+ } catch (error) {
589
+ ctx.logger.error("devportal_apps_webhooks_remove failed", { error: String(error) });
590
+ return errorResult(
591
+ `Failed to remove webhook: ${error instanceof Error ? error.message : String(error)}`
592
+ );
593
+ }
594
+ }
595
+ );
596
+ server.registerTool(
597
+ track(mcpToolName(ctx.productName, "devportal_apps_analytics")),
598
+ {
599
+ title: "Application Analytics",
600
+ description: "Get analytics for an application over a period.",
601
+ inputSchema: {
602
+ applicationId: z.string().describe("Application ID"),
603
+ period: z.string().optional().describe("LAST_7_DAYS|LAST_30_DAYS|CUSTOM (default LAST_30_DAYS)"),
604
+ startDate: z.string().optional().describe("ISO 8601 (required when period=CUSTOM)"),
605
+ endDate: z.string().optional().describe("ISO 8601")
606
+ }
607
+ },
608
+ async ({ applicationId, period, startDate, endDate }) => {
609
+ try {
610
+ const data = await ctx.gql.global.request(APPLICATION_ANALYTICS, {
611
+ applicationId,
612
+ period: (period ?? "LAST_30_DAYS").toUpperCase(),
613
+ startDate,
614
+ endDate
615
+ });
616
+ return jsonResult(data.applicationAnalytics);
617
+ } catch (error) {
618
+ ctx.logger.error("devportal_apps_analytics failed", { error: String(error) });
619
+ return errorResult(
620
+ `Failed to fetch analytics: ${error instanceof Error ? error.message : String(error)}`
621
+ );
622
+ }
623
+ }
624
+ );
625
+ server.registerTool(
626
+ track(mcpToolName(ctx.productName, "devportal_revenue")),
627
+ {
628
+ title: "Organization Revenue",
629
+ description: "Get revenue summary for an organization.",
630
+ inputSchema: {
631
+ organizationId: z.string().describe("Organization ID"),
632
+ period: z.string().optional().describe("LAST_7_DAYS|LAST_30_DAYS|YTD (default LAST_30_DAYS)")
633
+ }
634
+ },
635
+ async ({ organizationId, period }) => {
636
+ try {
637
+ const data = await ctx.gql.global.request(ORGANIZATION_REVENUE, {
638
+ organizationId,
639
+ period: (period ?? "LAST_30_DAYS").toUpperCase()
640
+ });
641
+ return jsonResult(data.organizationRevenue);
642
+ } catch (error) {
643
+ ctx.logger.error("devportal_revenue failed", { error: String(error) });
644
+ return errorResult(
645
+ `Failed to fetch revenue: ${error instanceof Error ? error.message : String(error)}`
646
+ );
647
+ }
648
+ }
649
+ );
650
+ server.registerTool(
651
+ track(mcpToolName(ctx.productName, "devportal_admin_reviews_list")),
652
+ {
653
+ title: "List Admin Application Reviews",
654
+ description: "List applications in the admin review queue.",
655
+ inputSchema: {
656
+ status: z.string().optional().describe("PENDING|APPROVED|REJECTED (default PENDING)")
657
+ }
658
+ },
659
+ async ({ status }) => {
660
+ try {
661
+ const data = await ctx.gql.global.request(ADMIN_REVIEWS, { status: (status ?? "PENDING").toUpperCase() });
662
+ return jsonResult({
663
+ items: data.adminReviews.edges.map((e) => e.node),
664
+ totalCount: data.adminReviews.totalCount
665
+ });
666
+ } catch (error) {
667
+ ctx.logger.error("devportal_admin_reviews_list failed", { error: String(error) });
668
+ return errorResult(
669
+ `Failed to list reviews: ${error instanceof Error ? error.message : String(error)}`
670
+ );
671
+ }
672
+ }
673
+ );
674
+ server.registerTool(
675
+ track(mcpToolName(ctx.productName, "devportal_admin_reviews_approve")),
676
+ {
677
+ title: "Approve Application",
678
+ description: "Approve a pending application.",
679
+ inputSchema: {
680
+ id: z.string().describe("Application ID"),
681
+ notes: z.string().optional()
682
+ }
683
+ },
684
+ async ({ id, notes }) => {
685
+ try {
686
+ const data = await ctx.gql.global.request(
687
+ APPROVE_APPLICATION,
688
+ { id, notes }
689
+ );
690
+ return jsonResult(data.approveApplication);
691
+ } catch (error) {
692
+ ctx.logger.error("devportal_admin_reviews_approve failed", { error: String(error) });
693
+ return errorResult(
694
+ `Failed to approve application: ${error instanceof Error ? error.message : String(error)}`
695
+ );
696
+ }
697
+ }
698
+ );
699
+ server.registerTool(
700
+ track(mcpToolName(ctx.productName, "devportal_admin_reviews_reject")),
701
+ {
702
+ title: "Reject Application",
703
+ description: "Reject a pending application.",
704
+ inputSchema: {
705
+ id: z.string().describe("Application ID"),
706
+ notes: z.string().describe("Reason for rejection (required)")
707
+ }
708
+ },
709
+ async ({ id, notes }) => {
710
+ try {
711
+ const data = await ctx.gql.global.request(
712
+ REJECT_APPLICATION,
713
+ { id, notes }
714
+ );
715
+ return jsonResult(data.rejectApplication);
716
+ } catch (error) {
717
+ ctx.logger.error("devportal_admin_reviews_reject failed", { error: String(error) });
718
+ return errorResult(
719
+ `Failed to reject application: ${error instanceof Error ? error.message : String(error)}`
720
+ );
721
+ }
722
+ }
723
+ );
724
+ }
725
+
726
+ // src/modules/devportal/index.ts
727
+ var devportalModule = {
728
+ id: "devportal",
729
+ version: "0.0.1",
730
+ displayName: "Developer Portal",
731
+ dependsOn: ["auth"],
732
+ capabilities: { tools: {} },
733
+ register(server, ctx) {
734
+ const tools = [];
735
+ const track = (n) => {
736
+ tools.push(n);
737
+ return n;
738
+ };
739
+ registerDevportalTools(server, ctx, track);
740
+ return { tools, resources: [], prompts: [] };
741
+ }
742
+ };
743
+ var devportal_default = devportalModule;
744
+
745
+ export { devportal_default as default };
746
+ //# sourceMappingURL=index.js.map
747
+ //# sourceMappingURL=index.js.map