@capivv/mcp-server 0.5.24 → 0.5.26

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 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
  }
@@ -52,6 +52,10 @@ export function registerCreateProductTool(server, client) {
52
52
  .boolean()
53
53
  .optional()
54
54
  .describe('When true (default), opts the subscription into new Apple territories automatically as Apple adds them. SaaS-friendly default.'),
55
+ apple_review_note: z
56
+ .string()
57
+ .optional()
58
+ .describe('Text written to Apple\'s "App Review Notes" field on the subscription / IAP. Optional — when omitted Capivv writes a sensible default ("This product grants the user the X entitlement..."). Override when App Review needs explicit testing instructions (e.g. a demo account, a way to skip past a paywall).'),
55
59
  }, async (args) => {
56
60
  const { skip_store_write, ...rest } = args;
57
61
  const product = await client.createProduct({
@@ -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,3 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { CapivvClient } from '../client.js';
3
+ export declare function registerSetReviewScreenshotTool(server: McpServer, client: CapivvClient): void;
@@ -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
@@ -262,6 +262,14 @@ export interface CreateProductRequest {
262
262
  * adds them. Defaults to true.
263
263
  */
264
264
  apple_available_in_new_territories?: boolean;
265
+ /**
266
+ * V0.5.26 — text written to Apple's "App Review Notes" field on the
267
+ * subscription / IAP. Optional; when omitted Capivv generates a sensible
268
+ * default based on product_type + display_name. Override for products
269
+ * that need explicit testing instructions for the App Review team
270
+ * (e.g. a demo account, a way to skip past a paywall).
271
+ */
272
+ apple_review_note?: string;
265
273
  }
266
274
  export interface Paywall {
267
275
  id: string;
@@ -727,3 +735,17 @@ export interface SetAppleSubscriptionLevelResult {
727
735
  apple_subscription_id: string;
728
736
  level: number;
729
737
  }
738
+ export interface SetReviewScreenshotRequest {
739
+ app_id: string;
740
+ external_id: string;
741
+ image_url?: string;
742
+ image_base64?: string;
743
+ file_name?: string;
744
+ }
745
+ export interface SetReviewScreenshotResult {
746
+ external_id: string;
747
+ product_type: 'subscription' | 'consumable' | 'non_consumable';
748
+ apple_product_id: string;
749
+ screenshot_id: string;
750
+ bytes_uploaded: number;
751
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capivv/mcp-server",
3
- "version": "0.5.24",
3
+ "version": "0.5.26",
4
4
  "description": "MCP server for managing Capivv subscription platform via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {