@capivv/mcp-server 0.5.10 → 0.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +6 -1
- package/dist/client.js +16 -0
- package/dist/tools/delete-apple-iap.d.ts +3 -0
- package/dist/tools/delete-apple-iap.js +17 -0
- package/dist/tools/delete-apple-subscription.d.ts +3 -0
- package/dist/tools/delete-apple-subscription.js +17 -0
- package/dist/tools/get-iap-state.d.ts +3 -0
- package/dist/tools/get-iap-state.js +17 -0
- package/dist/tools/index.js +15 -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 +20 -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 } 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;
|
|
@@ -97,4 +97,9 @@ export declare class CapivvClient {
|
|
|
97
97
|
probeAppleSubmission(req: ProbeSubmissionRequest): Promise<ProbeSubmissionResult>;
|
|
98
98
|
setAppPrivacyUrl(req: SetAppPrivacyUrlRequest): Promise<SetAppPrivacyUrlResult>;
|
|
99
99
|
setIapReviewScreenshot(req: SetIapReviewScreenshotRequest): Promise<SetIapReviewScreenshotResult>;
|
|
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>;
|
|
100
105
|
}
|
package/dist/client.js
CHANGED
|
@@ -362,4 +362,20 @@ export class CapivvClient {
|
|
|
362
362
|
const { apple_iap_id, ...body } = req;
|
|
363
363
|
return this.post(`/dashboard/iap/${encodeURIComponent(apple_iap_id)}/review-screenshot`, body);
|
|
364
364
|
}
|
|
365
|
+
async getIapState(appleIapId) {
|
|
366
|
+
return this.get(`/dashboard/iap/${encodeURIComponent(appleIapId)}/state`);
|
|
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
|
+
}
|
|
365
381
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
'Get apple_iap_id from capivv_list_apple_iaps or App Store Connect.',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
apple_iap_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Apple in-app purchase ID (e.g. "6765812345") — NOT the Capivv product UUID.'),
|
|
13
|
+
}, async ({ apple_iap_id }) => {
|
|
14
|
+
const result = await client.deleteAppleIap(apple_iap_id);
|
|
15
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
'Get apple_subscription_id from capivv_list_apple_subscriptions or App Store Connect.',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
apple_subscription_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Apple subscription ID (e.g. "6764778053") — NOT the Capivv product UUID.'),
|
|
13
|
+
}, async ({ apple_subscription_id }) => {
|
|
14
|
+
const result = await client.deleteAppleSubscription(apple_subscription_id);
|
|
15
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
16
|
+
});
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerGetIapStateTool(server, client) {
|
|
3
|
+
server.tool('capivv_get_iap_state', [
|
|
4
|
+
"Read an Apple in-app purchase's lifecycle state from App Store Connect. Mirror of capivv_get_subscription_state for IAPs (consumable / non-consumable).",
|
|
5
|
+
'',
|
|
6
|
+
'Returns the IAP\'s current `state` (MISSING_METADATA, READY_TO_SUBMIT, WAITING_FOR_REVIEW, IN_REVIEW, APPROVED, etc.), the productId, name, and whether it\'s CONSUMABLE or NON_CONSUMABLE. Useful after capivv_create_product / capivv_set_iap_review_screenshot to confirm the IAP is no longer stuck in MISSING_METADATA.',
|
|
7
|
+
'',
|
|
8
|
+
'Get `apple_iap_id` from the `store_create.store_product_id` field of capivv_create_product or from App Store Connect.',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
apple_iap_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Apple in-app purchase ID (e.g. "6765812345") — NOT the Capivv product UUID.'),
|
|
13
|
+
}, async ({ apple_iap_id }) => {
|
|
14
|
+
const result = await client.getIapState(apple_iap_id);
|
|
15
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
16
|
+
});
|
|
17
|
+
}
|
package/dist/tools/index.js
CHANGED
|
@@ -78,6 +78,11 @@ import { registerTouchSubscriptionTool } from './touch-subscription.js';
|
|
|
78
78
|
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
|
+
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';
|
|
81
86
|
export function registerAllTools(server, client) {
|
|
82
87
|
// Identity — call this first to verify which workspace you're connected to
|
|
83
88
|
registerWhoamiTool(server, client);
|
|
@@ -198,4 +203,14 @@ export function registerAllTools(server, client) {
|
|
|
198
203
|
registerProbeSubmissionTool(server, client);
|
|
199
204
|
registerSetAppPrivacyUrlTool(server, client);
|
|
200
205
|
registerSetIapReviewScreenshotTool(server, client);
|
|
206
|
+
// V0.5.11 — IAP state probe (mirror of get_subscription_state).
|
|
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);
|
|
201
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
|
@@ -652,3 +652,23 @@ export interface SetIapReviewScreenshotResult {
|
|
|
652
652
|
screenshot_id: string;
|
|
653
653
|
bytes_uploaded: number;
|
|
654
654
|
}
|
|
655
|
+
export interface IapStateInfo {
|
|
656
|
+
apple_iap_id: string;
|
|
657
|
+
product_id: string;
|
|
658
|
+
name: string | null;
|
|
659
|
+
state: string | null;
|
|
660
|
+
/** "CONSUMABLE" / "NON_CONSUMABLE". */
|
|
661
|
+
in_app_purchase_type: string | null;
|
|
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
|
+
}
|