@capivv/mcp-server 0.5.3 → 0.5.5

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 } 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 } from './types.js';
3
3
  export declare class ApiError extends Error {
4
4
  status: number;
5
5
  code: string;
@@ -91,4 +91,5 @@ export declare class CapivvClient {
91
91
  connectAppleIntegration(data: ConnectAppleIntegrationRequest): Promise<ConnectAppleIntegrationResult>;
92
92
  connectGoogleIntegration(data: ConnectGoogleIntegrationRequest): Promise<ConnectGoogleIntegrationResult>;
93
93
  disconnectIntegration(provider: string): Promise<void>;
94
+ setSubscriptionReviewScreenshot(data: SetSubscriptionReviewScreenshotRequest): Promise<SetSubscriptionReviewScreenshotResult>;
94
95
  }
package/dist/client.js CHANGED
@@ -339,4 +339,9 @@ export class CapivvClient {
339
339
  async disconnectIntegration(provider) {
340
340
  await this.post(`/dashboard/integrations/${encodeURIComponent(provider)}/disconnect`);
341
341
  }
342
+ // ---- Subscription review screenshot (V0.5.5) ----
343
+ async setSubscriptionReviewScreenshot(data) {
344
+ const { apple_subscription_id, ...body } = data;
345
+ return this.post(`/dashboard/subscriptions/${encodeURIComponent(apple_subscription_id)}/review-screenshot`, body);
346
+ }
342
347
  }
@@ -69,6 +69,12 @@ function formatStoreCreateSummary(product) {
69
69
  lines.push(` ${sp.currency}: used ${formatCents(sp.actual_cents, sp.currency)} — closest store tier to your ${formatCents(sp.requested_cents, sp.currency)} request.`);
70
70
  }
71
71
  }
72
+ if (sc.truncations && sc.truncations.length > 0) {
73
+ lines.push('Note: Apple length caps on subscription localization clipped the following fields — re-running with shorter values is fine but the existing values above are what was posted.');
74
+ for (const t of sc.truncations) {
75
+ lines.push(` ${t.locale} ${t.field}: shortened from ${t.original_chars} to ${t.truncated_chars} chars (Apple max ${t.limit}).`);
76
+ }
77
+ }
72
78
  return lines.join('\n');
73
79
  }
74
80
  function formatCents(cents, currency) {
@@ -72,6 +72,7 @@ import { registerListIntegrationsTool } from './list-integrations.js';
72
72
  import { registerConnectAppleIntegrationTool } from './connect-apple-integration.js';
73
73
  import { registerConnectGoogleIntegrationTool } from './connect-google-integration.js';
74
74
  import { registerDisconnectIntegrationTool } from './disconnect-integration.js';
75
+ import { registerSetSubscriptionReviewScreenshotTool } from './set-subscription-review-screenshot.js';
75
76
  export function registerAllTools(server, client) {
76
77
  // Identity — call this first to verify which workspace you're connected to
77
78
  registerWhoamiTool(server, client);
@@ -173,4 +174,8 @@ export function registerAllTools(server, client) {
173
174
  registerConnectAppleIntegrationTool(server, client);
174
175
  registerConnectGoogleIntegrationTool(server, client);
175
176
  registerDisconnectIntegrationTool(server, client);
177
+ // Subscription review screenshot (v0.5.5 — Apple's 3-step S3 upload flow
178
+ // wrapped in a single MCP call so the agent can take a subscription from
179
+ // MISSING_METADATA to READY_FOR_REVIEW in one step.)
180
+ registerSetSubscriptionReviewScreenshotTool(server, client);
176
181
  }
@@ -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 registerSetSubscriptionReviewScreenshotTool(server: McpServer, client: CapivvClient): void;
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ export function registerSetSubscriptionReviewScreenshotTool(server, client) {
3
+ server.tool('capivv_set_subscription_review_screenshot', [
4
+ '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
+ '',
6
+ '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.',
7
+ '',
8
+ 'Get `apple_subscription_id` from the `store_create` block of capivv_create_product, from capivv_check_drift, or from 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
+ image_url: z
14
+ .string()
15
+ .optional()
16
+ .describe('Public HTTPS URL of the screenshot. Mutually exclusive with image_base64.'),
17
+ image_base64: z
18
+ .string()
19
+ .optional()
20
+ .describe('Base64-encoded raw image bytes. Use for non-HTTPS sources. Mutually exclusive with image_url.'),
21
+ file_name: z
22
+ .string()
23
+ .optional()
24
+ .describe('Filename Apple stores on the screenshot resource. Defaults to "screenshot.png".'),
25
+ }, async (args) => {
26
+ if (!args.image_url && !args.image_base64) {
27
+ return {
28
+ isError: true,
29
+ content: [
30
+ {
31
+ type: 'text',
32
+ text: 'Provide either image_url (HTTPS) or image_base64 (raw bytes).',
33
+ },
34
+ ],
35
+ };
36
+ }
37
+ const result = await client.setSubscriptionReviewScreenshot(args);
38
+ return {
39
+ content: [
40
+ {
41
+ type: 'text',
42
+ text: JSON.stringify(result, null, 2),
43
+ },
44
+ ],
45
+ };
46
+ });
47
+ }
package/dist/types.d.ts CHANGED
@@ -68,6 +68,15 @@ export interface StoreCreateSummary {
68
68
  actual_cents: number;
69
69
  price_point_id?: string;
70
70
  }>;
71
+ /** Fields the orchestrator shortened to fit Apple's per-field length cap.
72
+ * Empty / undefined when nothing was clipped. */
73
+ truncations?: Array<{
74
+ field: string;
75
+ original_chars: number;
76
+ truncated_chars: number;
77
+ limit: number;
78
+ locale: string;
79
+ }>;
71
80
  }
72
81
  export interface Entitlement {
73
82
  id: string;
@@ -554,3 +563,17 @@ export interface ConnectGoogleIntegrationResult {
554
563
  error: string;
555
564
  }>;
556
565
  }
566
+ export interface SetSubscriptionReviewScreenshotRequest {
567
+ apple_subscription_id: string;
568
+ /** Public HTTPS URL the backend fetches. Either this or image_base64 is required. */
569
+ image_url?: string;
570
+ /** Base64-encoded raw image bytes. Either this or image_url is required. */
571
+ image_base64?: string;
572
+ /** Filename Apple records (defaults to screenshot.png). */
573
+ file_name?: string;
574
+ }
575
+ export interface SetSubscriptionReviewScreenshotResult {
576
+ apple_subscription_id: string;
577
+ screenshot_id: string;
578
+ bytes_uploaded: number;
579
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capivv/mcp-server",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "MCP server for managing Capivv subscription platform via AI assistants",
5
5
  "type": "module",
6
6
  "bin": {