@capivv/mcp-server 0.5.11 → 0.5.13
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/dist/client.d.ts +5 -1
- package/dist/client.js +13 -0
- package/dist/tools/delete-apple-iap.d.ts +3 -0
- package/dist/tools/delete-apple-iap.js +19 -0
- package/dist/tools/delete-apple-subscription.d.ts +3 -0
- package/dist/tools/delete-apple-subscription.js +19 -0
- package/dist/tools/index.js +12 -0
- package/dist/tools/list-apple-iaps.d.ts +3 -0
- package/dist/tools/list-apple-iaps.js +13 -0
- package/dist/tools/list-apple-subscriptions.d.ts +3 -0
- package/dist/tools/list-apple-subscriptions.js +13 -0
- package/dist/types.d.ts +12 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from './config.js';
|
|
2
|
-
import type { App, Product, Entitlement, Offering, Rule, Experiment, ExperimentSummary, AnalyticsOverview, OnboardingResponse, ImportPreviewResponse, CreateAppRequest, CreateEntitlementRequest, CreateProductRequest, CreateOfferingRequest, CreateRuleRequest, ValidateRuleRequest, ValidateRuleResponse, WhoamiResponse, ApiKeyUsageResponse, Paywall, CreatePaywallRequest, UpdatePaywallRequest, PaywallStats, Promotion, CreatePromotionRequest, UpdatePromotionRequest, RescueFlow, CreateRescueFlowRequest, UpdateRescueFlowRequest, RescueStats, PricingStrategy, CreatePricingStrategyRequest, PricingPreviewResult, PricingRecomputeRequest, PricingRecomputeResult, PricingPushResult, PricingChangeRequest, SetCountryPriceOverrideRequest, ExperimentWithVariants, CreateExperimentRequest, UpdateExperimentRequest, UpdateAppRequest, UpdateEntitlementRequest, UpdateOfferingRequest, AutopilotRunResult, SyncSuggestion, SyncSuggestionsCount, TriggerSyncResult, IntegrationSummary, ConnectAppleIntegrationRequest, ConnectAppleIntegrationResult, ConnectGoogleIntegrationRequest, ConnectGoogleIntegrationResult, SetSubscriptionReviewScreenshotRequest, SetSubscriptionReviewScreenshotResult, SubscriptionStateInfo, TouchSubscriptionResult, ProbeSubmissionRequest, ProbeSubmissionResult, SetAppPrivacyUrlRequest, SetAppPrivacyUrlResult, SetIapReviewScreenshotRequest, SetIapReviewScreenshotResult, IapStateInfo } from './types.js';
|
|
2
|
+
import type { App, Product, Entitlement, Offering, Rule, Experiment, ExperimentSummary, AnalyticsOverview, OnboardingResponse, ImportPreviewResponse, CreateAppRequest, CreateEntitlementRequest, CreateProductRequest, CreateOfferingRequest, CreateRuleRequest, ValidateRuleRequest, ValidateRuleResponse, WhoamiResponse, ApiKeyUsageResponse, Paywall, CreatePaywallRequest, UpdatePaywallRequest, PaywallStats, Promotion, CreatePromotionRequest, UpdatePromotionRequest, RescueFlow, CreateRescueFlowRequest, UpdateRescueFlowRequest, RescueStats, PricingStrategy, CreatePricingStrategyRequest, PricingPreviewResult, PricingRecomputeRequest, PricingRecomputeResult, PricingPushResult, PricingChangeRequest, SetCountryPriceOverrideRequest, ExperimentWithVariants, CreateExperimentRequest, UpdateExperimentRequest, UpdateAppRequest, UpdateEntitlementRequest, UpdateOfferingRequest, AutopilotRunResult, SyncSuggestion, SyncSuggestionsCount, TriggerSyncResult, IntegrationSummary, ConnectAppleIntegrationRequest, ConnectAppleIntegrationResult, ConnectGoogleIntegrationRequest, ConnectGoogleIntegrationResult, SetSubscriptionReviewScreenshotRequest, SetSubscriptionReviewScreenshotResult, SubscriptionStateInfo, TouchSubscriptionResult, ProbeSubmissionRequest, ProbeSubmissionResult, SetAppPrivacyUrlRequest, SetAppPrivacyUrlResult, SetIapReviewScreenshotRequest, SetIapReviewScreenshotResult, IapStateInfo, ListAppleSubscriptionsResult, ListAppleIapsResult, DeleteAppleResult } from './types.js';
|
|
3
3
|
export declare class ApiError extends Error {
|
|
4
4
|
status: number;
|
|
5
5
|
code: string;
|
|
@@ -98,4 +98,8 @@ export declare class CapivvClient {
|
|
|
98
98
|
setAppPrivacyUrl(req: SetAppPrivacyUrlRequest): Promise<SetAppPrivacyUrlResult>;
|
|
99
99
|
setIapReviewScreenshot(req: SetIapReviewScreenshotRequest): Promise<SetIapReviewScreenshotResult>;
|
|
100
100
|
getIapState(appleIapId: string): Promise<IapStateInfo>;
|
|
101
|
+
listAppleSubscriptions(appId: string): Promise<ListAppleSubscriptionsResult>;
|
|
102
|
+
listAppleIaps(appId: string): Promise<ListAppleIapsResult>;
|
|
103
|
+
deleteAppleSubscription(appleSubscriptionId: string): Promise<DeleteAppleResult>;
|
|
104
|
+
deleteAppleIap(appleIapId: string): Promise<DeleteAppleResult>;
|
|
101
105
|
}
|
package/dist/client.js
CHANGED
|
@@ -365,4 +365,17 @@ export class CapivvClient {
|
|
|
365
365
|
async getIapState(appleIapId) {
|
|
366
366
|
return this.get(`/dashboard/iap/${encodeURIComponent(appleIapId)}/state`);
|
|
367
367
|
}
|
|
368
|
+
// ---- V0.5.12 — Orphan recovery ----
|
|
369
|
+
async listAppleSubscriptions(appId) {
|
|
370
|
+
return this.get(`/dashboard/apps/${encodeURIComponent(appId)}/apple/subscriptions`);
|
|
371
|
+
}
|
|
372
|
+
async listAppleIaps(appId) {
|
|
373
|
+
return this.get(`/dashboard/apps/${encodeURIComponent(appId)}/apple/iaps`);
|
|
374
|
+
}
|
|
375
|
+
async deleteAppleSubscription(appleSubscriptionId) {
|
|
376
|
+
return this.delete(`/dashboard/subscriptions/${encodeURIComponent(appleSubscriptionId)}`);
|
|
377
|
+
}
|
|
378
|
+
async deleteAppleIap(appleIapId) {
|
|
379
|
+
return this.delete(`/dashboard/iap/${encodeURIComponent(appleIapId)}`);
|
|
380
|
+
}
|
|
368
381
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerDeleteAppleIapTool(server, client) {
|
|
3
|
+
server.tool('capivv_delete_apple_iap', [
|
|
4
|
+
"Delete an in-app purchase from App Store Connect. Use this to clean up orphans left by a failed capivv_create_product.",
|
|
5
|
+
'',
|
|
6
|
+
"**Destructive.** Apple returns 204 on delete and 404 on already-deleted (treated as success).",
|
|
7
|
+
'',
|
|
8
|
+
"**Apple productID cooldown — important.** Apple holds the deleted productId reserved for ~90 days. After deleting, recreating with the SAME productId will 409 DUPLICATE until the cooldown expires. If you need to recreate immediately, use a new productId (e.g. append `_v2`) — the alternative is waiting 90 days.",
|
|
9
|
+
'',
|
|
10
|
+
'Get apple_iap_id from capivv_list_apple_iaps or App Store Connect.',
|
|
11
|
+
].join(' '), {
|
|
12
|
+
apple_iap_id: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe('Apple in-app purchase ID (e.g. "6765812345") — NOT the Capivv product UUID.'),
|
|
15
|
+
}, async ({ apple_iap_id }) => {
|
|
16
|
+
const result = await client.deleteAppleIap(apple_iap_id);
|
|
17
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerDeleteAppleSubscriptionTool(server, client) {
|
|
3
|
+
server.tool('capivv_delete_apple_subscription', [
|
|
4
|
+
"Delete a subscription from App Store Connect. Use this to clean up orphans left by a failed capivv_create_product (where Apple created the resource but Capivv rolled back).",
|
|
5
|
+
'',
|
|
6
|
+
"**Destructive.** Apple's API returns 204 on delete and 404 on already-deleted (treated as success). Once deleted the subscription is gone from ASC.",
|
|
7
|
+
'',
|
|
8
|
+
"**Apple productID cooldown — important.** Apple holds the deleted productId reserved for ~90 days. After deleting, recreating with the SAME productId will 409 DUPLICATE until the cooldown expires. If you need to recreate immediately, use a new productId (e.g. append `_v2`) — the alternative is waiting 90 days.",
|
|
9
|
+
'',
|
|
10
|
+
'Get apple_subscription_id from capivv_list_apple_subscriptions or App Store Connect.',
|
|
11
|
+
].join(' '), {
|
|
12
|
+
apple_subscription_id: z
|
|
13
|
+
.string()
|
|
14
|
+
.describe('Apple subscription ID (e.g. "6764778053") — NOT the Capivv product UUID.'),
|
|
15
|
+
}, async ({ apple_subscription_id }) => {
|
|
16
|
+
const result = await client.deleteAppleSubscription(apple_subscription_id);
|
|
17
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
18
|
+
});
|
|
19
|
+
}
|
package/dist/tools/index.js
CHANGED
|
@@ -79,6 +79,10 @@ import { registerProbeSubmissionTool } from './probe-submission.js';
|
|
|
79
79
|
import { registerSetAppPrivacyUrlTool } from './set-app-privacy-url.js';
|
|
80
80
|
import { registerSetIapReviewScreenshotTool } from './set-iap-review-screenshot.js';
|
|
81
81
|
import { registerGetIapStateTool } from './get-iap-state.js';
|
|
82
|
+
import { registerListAppleSubscriptionsTool } from './list-apple-subscriptions.js';
|
|
83
|
+
import { registerListAppleIapsTool } from './list-apple-iaps.js';
|
|
84
|
+
import { registerDeleteAppleSubscriptionTool } from './delete-apple-subscription.js';
|
|
85
|
+
import { registerDeleteAppleIapTool } from './delete-apple-iap.js';
|
|
82
86
|
export function registerAllTools(server, client) {
|
|
83
87
|
// Identity — call this first to verify which workspace you're connected to
|
|
84
88
|
registerWhoamiTool(server, client);
|
|
@@ -201,4 +205,12 @@ export function registerAllTools(server, client) {
|
|
|
201
205
|
registerSetIapReviewScreenshotTool(server, client);
|
|
202
206
|
// V0.5.11 — IAP state probe (mirror of get_subscription_state).
|
|
203
207
|
registerGetIapStateTool(server, client);
|
|
208
|
+
// V0.5.12 — orphan recovery (list/delete on the Apple side for
|
|
209
|
+
// both subs and IAPs). Pairs with capivv_create_product's roll-back
|
|
210
|
+
// path: when ASC creates the resource but Capivv side rolls back,
|
|
211
|
+
// these tools let the agent find and clean up the leftover.
|
|
212
|
+
registerListAppleSubscriptionsTool(server, client);
|
|
213
|
+
registerListAppleIapsTool(server, client);
|
|
214
|
+
registerDeleteAppleSubscriptionTool(server, client);
|
|
215
|
+
registerDeleteAppleIapTool(server, client);
|
|
204
216
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerListAppleIapsTool(server, client) {
|
|
3
|
+
server.tool('capivv_list_apple_iaps', [
|
|
4
|
+
"List every in-app purchase (consumable / non-consumable) on the connected Apple App Store Connect account for a Capivv app.",
|
|
5
|
+
'',
|
|
6
|
+
"Returns Apple iap_id, productId, name, lifecycle state, and inAppPurchaseType for each. Use this to spot orphan IAPs Apple created during a failed capivv_create_product (so you can delete them with capivv_delete_apple_iap, or recover them with capivv_create_product + skip_store_write=true).",
|
|
7
|
+
].join(' '), {
|
|
8
|
+
app_id: z.string().describe('Capivv app UUID.'),
|
|
9
|
+
}, async ({ app_id }) => {
|
|
10
|
+
const result = await client.listAppleIaps(app_id);
|
|
11
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
12
|
+
});
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerListAppleSubscriptionsTool(server, client) {
|
|
3
|
+
server.tool('capivv_list_apple_subscriptions', [
|
|
4
|
+
"List every subscription on the connected Apple App Store Connect account for a Capivv app.",
|
|
5
|
+
'',
|
|
6
|
+
'Returns Apple subscription_id, productId, name, and lifecycle state for each — enough to spot orphans left by failed capivv_create_product attempts (e.g. a subscription Apple created but Capivv rolled back). Pair with capivv_delete_apple_subscription to clean orphans up.',
|
|
7
|
+
].join(' '), {
|
|
8
|
+
app_id: z.string().describe('Capivv app UUID.'),
|
|
9
|
+
}, async ({ app_id }) => {
|
|
10
|
+
const result = await client.listAppleSubscriptions(app_id);
|
|
11
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
12
|
+
});
|
|
13
|
+
}
|
package/dist/types.d.ts
CHANGED
|
@@ -660,3 +660,15 @@ export interface IapStateInfo {
|
|
|
660
660
|
/** "CONSUMABLE" / "NON_CONSUMABLE". */
|
|
661
661
|
in_app_purchase_type: string | null;
|
|
662
662
|
}
|
|
663
|
+
export interface ListAppleSubscriptionsResult {
|
|
664
|
+
bundle_id: string;
|
|
665
|
+
subscriptions: SubscriptionStateInfo[];
|
|
666
|
+
}
|
|
667
|
+
export interface ListAppleIapsResult {
|
|
668
|
+
bundle_id: string;
|
|
669
|
+
iaps: IapStateInfo[];
|
|
670
|
+
}
|
|
671
|
+
export interface DeleteAppleResult {
|
|
672
|
+
deleted: boolean;
|
|
673
|
+
apple_id: string;
|
|
674
|
+
}
|