@capivv/mcp-server 0.5.24 → 0.5.25
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 +2 -1
- package/dist/client.js +4 -0
- package/dist/tools/index.js +6 -0
- package/dist/tools/set-iap-review-screenshot.js +2 -0
- package/dist/tools/set-review-screenshot.d.ts +3 -0
- package/dist/tools/set-review-screenshot.js +50 -0
- package/dist/tools/set-subscription-review-screenshot.js +2 -0
- package/dist/types.d.ts +14 -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, ListAppleSubscriptionsResult, ListAppleIapsResult, DeleteAppleResult, ListAppUsersResult, FindUserResult, GrantEntitlementRequest, GrantEntitlementResult, RevokeEntitlementRequest, SetAppleSubscriptionLevelRequest, SetAppleSubscriptionLevelResult } 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, ListAppUsersResult, FindUserResult, GrantEntitlementRequest, GrantEntitlementResult, RevokeEntitlementRequest, SetAppleSubscriptionLevelRequest, SetAppleSubscriptionLevelResult, SetReviewScreenshotRequest, SetReviewScreenshotResult } from './types.js';
|
|
3
3
|
export declare class ApiError extends Error {
|
|
4
4
|
status: number;
|
|
5
5
|
code: string;
|
|
@@ -109,4 +109,5 @@ export declare class CapivvClient {
|
|
|
109
109
|
success: boolean;
|
|
110
110
|
}>;
|
|
111
111
|
setAppleSubscriptionLevel(req: SetAppleSubscriptionLevelRequest): Promise<SetAppleSubscriptionLevelResult>;
|
|
112
|
+
setReviewScreenshot(req: SetReviewScreenshotRequest): Promise<SetReviewScreenshotResult>;
|
|
112
113
|
}
|
package/dist/client.js
CHANGED
|
@@ -397,4 +397,8 @@ export class CapivvClient {
|
|
|
397
397
|
const { apple_subscription_id, level } = req;
|
|
398
398
|
return this.post(`/dashboard/subscriptions/${encodeURIComponent(apple_subscription_id)}/level`, { level });
|
|
399
399
|
}
|
|
400
|
+
async setReviewScreenshot(req) {
|
|
401
|
+
const { external_id, ...body } = req;
|
|
402
|
+
return this.post(`/dashboard/products/by-external-id/${encodeURIComponent(external_id)}/review-screenshot`, body);
|
|
403
|
+
}
|
|
400
404
|
}
|
package/dist/tools/index.js
CHANGED
|
@@ -85,6 +85,7 @@ import { registerRevokeEntitlementTool } from './revoke-entitlement.js';
|
|
|
85
85
|
import { registerListUsersTool } from './list-users.js';
|
|
86
86
|
import { registerFindUserTool } from './find-user.js';
|
|
87
87
|
import { registerSetAppleSubscriptionLevelTool } from './set-apple-subscription-level.js';
|
|
88
|
+
import { registerSetReviewScreenshotTool } from './set-review-screenshot.js';
|
|
88
89
|
import { registerListAppleSubscriptionsTool } from './list-apple-subscriptions.js';
|
|
89
90
|
import { registerListAppleIapsTool } from './list-apple-iaps.js';
|
|
90
91
|
import { registerDeleteAppleSubscriptionTool } from './delete-apple-subscription.js';
|
|
@@ -232,4 +233,9 @@ export function registerAllTools(server, client) {
|
|
|
232
233
|
registerListUsersTool(server, client);
|
|
233
234
|
registerFindUserTool(server, client);
|
|
234
235
|
registerSetAppleSubscriptionLevelTool(server, client);
|
|
236
|
+
// V0.5.25 — issue #4: unified review-screenshot upload routing by
|
|
237
|
+
// product type from Capivv's DB. The two existing tools
|
|
238
|
+
// (set_subscription_review_screenshot / set_iap_review_screenshot)
|
|
239
|
+
// remain as escape hatches but their docstrings now redirect here.
|
|
240
|
+
registerSetReviewScreenshotTool(server, client);
|
|
235
241
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export function registerSetIapReviewScreenshotTool(server, client) {
|
|
3
3
|
server.tool('capivv_set_iap_review_screenshot', [
|
|
4
|
+
'**Lower-level escape hatch — prefer `capivv_set_review_screenshot` unless you already have the Apple IAP numeric id.** This tool only works for consumables/non-consumables; calling it with a subscription id will silently fail. The unified tool reads product type from Capivv\'s DB and routes correctly.',
|
|
5
|
+
'',
|
|
4
6
|
'Upload the App Store review screenshot for an in-app purchase (consumable or non-consumable). Mirrors capivv_set_subscription_review_screenshot but uses the IAP endpoint.',
|
|
5
7
|
'',
|
|
6
8
|
'Apple expects 640x920 (or larger) PNG / JPEG. Provide either `image_url` (Capivv backend fetches it via HTTPS) or `image_base64` (raw bytes inline). The backend handles the 3-step Apple flow: reserve → PUT bytes to S3 → PATCH uploaded=true with MD5.',
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerSetReviewScreenshotTool(server, client) {
|
|
3
|
+
server.tool('capivv_set_review_screenshot', [
|
|
4
|
+
"**Preferred way to attach an App Store review screenshot to a product.** Single tool that routes to the right Apple endpoint based on Capivv's stored product type — sub vs IAP. Use this instead of capivv_set_subscription_review_screenshot / capivv_set_iap_review_screenshot when you don't already know the product type.",
|
|
5
|
+
'',
|
|
6
|
+
'Why it exists: customers with mixed product sets (e.g. 2 auto-renewable subs + 1 lifetime IAP) tripped over the two-tool split — agents reached for the subscription tool for everything, the IAP screenshot silently never uploaded, and Apple rejected the app at review for missing IAP metadata. This unified tool eliminates that class of error: pass the product\'s external_id (e.g. "com.example.pro.lifetime") and Capivv figures out the type.',
|
|
7
|
+
'',
|
|
8
|
+
'Apple expects 640x920 PNG/JPEG. Provide image_url (HTTPS, backend fetches up to 10MB) OR image_base64 (raw bytes inline). The backend handles the 3-step Apple flow (reserve → S3 upload → PATCH uploaded=true with MD5).',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
app_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Capivv app UUID. external_id is unique per app, not globally. Get this from capivv_list_apps.'),
|
|
13
|
+
external_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe('The product\'s external_id (the identifier you used when creating the product — e.g. "com.example.pro.monthly"). Capivv reads the product type from its DB and routes to the right Apple endpoint.'),
|
|
16
|
+
image_url: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Public HTTPS URL of the screenshot. Mutually exclusive with image_base64.'),
|
|
20
|
+
image_base64: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Base64-encoded raw image bytes. Use for private storage. Mutually exclusive with image_url.'),
|
|
24
|
+
file_name: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Filename Apple stores. Defaults to "screenshot.png".'),
|
|
28
|
+
}, async (args) => {
|
|
29
|
+
if (!args.image_url && !args.image_base64) {
|
|
30
|
+
return {
|
|
31
|
+
isError: true,
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: 'Provide either image_url (HTTPS) or image_base64 (raw bytes).',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const result = await client.setReviewScreenshot(args);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: JSON.stringify(result, null, 2),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export function registerSetSubscriptionReviewScreenshotTool(server, client) {
|
|
3
3
|
server.tool('capivv_set_subscription_review_screenshot', [
|
|
4
|
+
'**Lower-level escape hatch — prefer `capivv_set_review_screenshot` unless you already have the Apple subscription numeric id.** This tool only works for auto-renewing subscriptions; calling it with an IAP id will silently fail or upload to the wrong product. The unified tool reads product type from Capivv\'s DB and routes correctly.',
|
|
5
|
+
'',
|
|
4
6
|
'Upload the App Store review screenshot for a subscription. Apple requires this before an auto-renewing subscription can leave MISSING_METADATA and be submitted for review.',
|
|
5
7
|
'',
|
|
6
8
|
'Apple expects 640x920 (or larger) PNG / JPEG. Provide either `image_url` (Capivv backend fetches it via HTTPS) or `image_base64` (raw bytes inline). The backend handles the 3-step Apple flow: reserve → PUT bytes to S3 → PATCH uploaded=true with MD5.',
|
package/dist/types.d.ts
CHANGED
|
@@ -727,3 +727,17 @@ export interface SetAppleSubscriptionLevelResult {
|
|
|
727
727
|
apple_subscription_id: string;
|
|
728
728
|
level: number;
|
|
729
729
|
}
|
|
730
|
+
export interface SetReviewScreenshotRequest {
|
|
731
|
+
app_id: string;
|
|
732
|
+
external_id: string;
|
|
733
|
+
image_url?: string;
|
|
734
|
+
image_base64?: string;
|
|
735
|
+
file_name?: string;
|
|
736
|
+
}
|
|
737
|
+
export interface SetReviewScreenshotResult {
|
|
738
|
+
external_id: string;
|
|
739
|
+
product_type: 'subscription' | 'consumable' | 'non_consumable';
|
|
740
|
+
apple_product_id: string;
|
|
741
|
+
screenshot_id: string;
|
|
742
|
+
bytes_uploaded: number;
|
|
743
|
+
}
|