@solvapay/server 1.0.1-preview.3 → 1.0.3

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/edge.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
2
  interface WebhookEvent {
3
3
  id: string;
4
4
  type: WebhookEventType;
@@ -94,7 +94,7 @@ interface components {
94
94
  */
95
95
  productRef: string;
96
96
  };
97
- CheckoutSessionResponse: {
97
+ CreateUiCheckoutSessionResponse: {
98
98
  /**
99
99
  * Checkout session ID
100
100
  * @example 507f1f77bcf86cd799439011
@@ -1070,6 +1070,40 @@ interface components {
1070
1070
  description?: string;
1071
1071
  }[];
1072
1072
  };
1073
+ McpToolPlanMapping: {
1074
+ /**
1075
+ * Tool name
1076
+ * @example deep_research
1077
+ */
1078
+ name: string;
1079
+ /**
1080
+ * Plan keys this tool should be gated to
1081
+ * @example [
1082
+ * "pro"
1083
+ * ]
1084
+ */
1085
+ planKeys: string[];
1086
+ };
1087
+ ConfigureMcpPlansRequest: {
1088
+ /** @description Required free plan configuration for updates. Applies to the existing default free plan only. */
1089
+ freePlan: components["schemas"]["McpBootstrapFreePlanConfig"];
1090
+ /** @description Optional paid plan definitions. [] reverts to free-only, omitted leaves existing paid plans unchanged. */
1091
+ paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1092
+ /** @description Optional tool-to-plan remapping. If paidPlans is omitted, only this remapping is applied. */
1093
+ toolMapping?: components["schemas"]["McpToolPlanMapping"][];
1094
+ };
1095
+ ConfigureMcpPlansResult: {
1096
+ /** @description Updated product */
1097
+ product: components["schemas"]["SdkProductResponse"];
1098
+ /** @description Updated MCP server identity */
1099
+ mcpServer: {
1100
+ [key: string]: unknown;
1101
+ };
1102
+ /** @description Resolved plan mapping by key (includes existing free plan) */
1103
+ planMap: {
1104
+ [key: string]: unknown;
1105
+ };
1106
+ };
1073
1107
  McpBootstrapPreviewResult: {
1074
1108
  /** @description Discovered tools from the origin MCP server */
1075
1109
  discoveredTools: {
@@ -2518,6 +2552,47 @@ interface operations {
2518
2552
  };
2519
2553
  };
2520
2554
  };
2555
+ ProductSdkController_configureMcpPlans: {
2556
+ parameters: {
2557
+ query?: never;
2558
+ header?: never;
2559
+ path: {
2560
+ /** @description Product reference or ID */
2561
+ productRef: string;
2562
+ };
2563
+ cookie?: never;
2564
+ };
2565
+ requestBody: {
2566
+ content: {
2567
+ "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
2568
+ };
2569
+ };
2570
+ responses: {
2571
+ /** @description MCP plans configured successfully */
2572
+ 200: {
2573
+ headers: {
2574
+ [name: string]: unknown;
2575
+ };
2576
+ content: {
2577
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
2578
+ };
2579
+ };
2580
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
2581
+ 400: {
2582
+ headers: {
2583
+ [name: string]: unknown;
2584
+ };
2585
+ content?: never;
2586
+ };
2587
+ /** @description Product not found */
2588
+ 404: {
2589
+ headers: {
2590
+ [name: string]: unknown;
2591
+ };
2592
+ content?: never;
2593
+ };
2594
+ };
2595
+ };
2521
2596
  ProductSdkController_cloneProduct: {
2522
2597
  parameters: {
2523
2598
  query?: never;
@@ -3241,6 +3316,10 @@ interface ToolPlanMappingInput {
3241
3316
  planRefs?: string[];
3242
3317
  planKeys?: string[];
3243
3318
  }
3319
+ interface McpToolPlanMappingInput {
3320
+ name: string;
3321
+ planKeys: string[];
3322
+ }
3244
3323
  interface McpBootstrapRequest {
3245
3324
  name?: string;
3246
3325
  description?: string;
@@ -3277,6 +3356,26 @@ interface McpBootstrapResponse {
3277
3356
  description?: string;
3278
3357
  }>;
3279
3358
  }
3359
+ interface ConfigureMcpPlansRequest {
3360
+ paidPlans?: McpBootstrapPaidPlanInput[];
3361
+ toolMapping?: McpToolPlanMappingInput[];
3362
+ }
3363
+ interface ConfigureMcpPlansResponse {
3364
+ product: components['schemas']['SdkProductResponse'];
3365
+ mcpServer: {
3366
+ id?: string;
3367
+ reference?: string;
3368
+ subdomain?: string;
3369
+ mcpProxyUrl?: string;
3370
+ url: string;
3371
+ defaultPlanId?: string;
3372
+ };
3373
+ planMap: Record<string, {
3374
+ id: string;
3375
+ reference: string;
3376
+ name?: string;
3377
+ }>;
3378
+ }
3280
3379
  /**
3281
3380
  * SolvaPay API Client Interface
3282
3381
  *
@@ -3318,6 +3417,7 @@ interface SolvaPayClient {
3318
3417
  name: string;
3319
3418
  }>;
3320
3419
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3420
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
3321
3421
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
3322
3422
  deleteProduct?(productRef: string): Promise<void>;
3323
3423
  cloneProduct?(productRef: string, overrides?: {
@@ -3375,7 +3475,7 @@ interface SolvaPayClient {
3375
3475
  customerRef: string;
3376
3476
  productRef: string;
3377
3477
  }): Promise<components['schemas']['UserInfoResponse']>;
3378
- createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CheckoutSessionResponse']>;
3478
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
3379
3479
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
3380
3480
  }
3381
3481
 
@@ -4141,6 +4241,13 @@ interface SolvaPay {
4141
4241
  * fast setup flows where you want one call for product + plans + MCP config.
4142
4242
  */
4143
4243
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
4244
+ /**
4245
+ * Configure MCP plans and tool mappings for an existing MCP product.
4246
+ *
4247
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
4248
+ * paid plans as well as remapping tool access.
4249
+ */
4250
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
4144
4251
  /**
4145
4252
  * Get virtual tool definitions with bound handlers for MCP server integration.
4146
4253
  *
package/dist/edge.js CHANGED
@@ -162,6 +162,21 @@ function createSolvaPayClient(opts) {
162
162
  }
163
163
  return await res.json();
164
164
  },
165
+ // PUT: /v1/sdk/products/{productRef}/mcp/plans
166
+ async configureMcpPlans(productRef, params) {
167
+ const url = `${base}/v1/sdk/products/${productRef}/mcp/plans`;
168
+ const res = await fetch(url, {
169
+ method: "PUT",
170
+ headers,
171
+ body: JSON.stringify(params)
172
+ });
173
+ if (!res.ok) {
174
+ const error = await res.text();
175
+ log(`\u274C API Error: ${res.status} - ${error}`);
176
+ throw new SolvaPayError(`Configure MCP plans failed (${res.status}): ${error}`);
177
+ }
178
+ return await res.json();
179
+ },
165
180
  // DELETE: /v1/sdk/products/{productRef}
166
181
  async deleteProduct(productRef) {
167
182
  const url = `${base}/v1/sdk/products/${productRef}`;
@@ -1476,6 +1491,12 @@ function createSolvaPay(config) {
1476
1491
  }
1477
1492
  return apiClient.bootstrapMcpProduct(params);
1478
1493
  },
1494
+ configureMcpPlans(productRef, params) {
1495
+ if (!apiClient.configureMcpPlans) {
1496
+ throw new SolvaPayError2("configureMcpPlans is not available on this API client");
1497
+ }
1498
+ return apiClient.configureMcpPlans(productRef, params);
1499
+ },
1479
1500
  getVirtualTools(options) {
1480
1501
  return createVirtualTools(apiClient, options);
1481
1502
  },
package/dist/index.cjs CHANGED
@@ -4503,6 +4503,21 @@ function createSolvaPayClient(opts) {
4503
4503
  }
4504
4504
  return await res.json();
4505
4505
  },
4506
+ // PUT: /v1/sdk/products/{productRef}/mcp/plans
4507
+ async configureMcpPlans(productRef, params) {
4508
+ const url = `${base}/v1/sdk/products/${productRef}/mcp/plans`;
4509
+ const res = await fetch(url, {
4510
+ method: "PUT",
4511
+ headers,
4512
+ body: JSON.stringify(params)
4513
+ });
4514
+ if (!res.ok) {
4515
+ const error = await res.text();
4516
+ log(`\u274C API Error: ${res.status} - ${error}`);
4517
+ throw new import_core.SolvaPayError(`Configure MCP plans failed (${res.status}): ${error}`);
4518
+ }
4519
+ return await res.json();
4520
+ },
4506
4521
  // DELETE: /v1/sdk/products/{productRef}
4507
4522
  async deleteProduct(productRef) {
4508
4523
  const url = `${base}/v1/sdk/products/${productRef}`;
@@ -5818,6 +5833,12 @@ function createSolvaPay(config) {
5818
5833
  }
5819
5834
  return apiClient.bootstrapMcpProduct(params);
5820
5835
  },
5836
+ configureMcpPlans(productRef, params) {
5837
+ if (!apiClient.configureMcpPlans) {
5838
+ throw new import_core2.SolvaPayError("configureMcpPlans is not available on this API client");
5839
+ }
5840
+ return apiClient.configureMcpPlans(productRef, params);
5841
+ },
5821
5842
  getVirtualTools(options) {
5822
5843
  return createVirtualTools(apiClient, options);
5823
5844
  },
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
2
  interface WebhookEvent {
3
3
  id: string;
4
4
  type: WebhookEventType;
@@ -94,7 +94,7 @@ interface components {
94
94
  */
95
95
  productRef: string;
96
96
  };
97
- CheckoutSessionResponse: {
97
+ CreateUiCheckoutSessionResponse: {
98
98
  /**
99
99
  * Checkout session ID
100
100
  * @example 507f1f77bcf86cd799439011
@@ -1070,6 +1070,40 @@ interface components {
1070
1070
  description?: string;
1071
1071
  }[];
1072
1072
  };
1073
+ McpToolPlanMapping: {
1074
+ /**
1075
+ * Tool name
1076
+ * @example deep_research
1077
+ */
1078
+ name: string;
1079
+ /**
1080
+ * Plan keys this tool should be gated to
1081
+ * @example [
1082
+ * "pro"
1083
+ * ]
1084
+ */
1085
+ planKeys: string[];
1086
+ };
1087
+ ConfigureMcpPlansRequest: {
1088
+ /** @description Required free plan configuration for updates. Applies to the existing default free plan only. */
1089
+ freePlan: components["schemas"]["McpBootstrapFreePlanConfig"];
1090
+ /** @description Optional paid plan definitions. [] reverts to free-only, omitted leaves existing paid plans unchanged. */
1091
+ paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1092
+ /** @description Optional tool-to-plan remapping. If paidPlans is omitted, only this remapping is applied. */
1093
+ toolMapping?: components["schemas"]["McpToolPlanMapping"][];
1094
+ };
1095
+ ConfigureMcpPlansResult: {
1096
+ /** @description Updated product */
1097
+ product: components["schemas"]["SdkProductResponse"];
1098
+ /** @description Updated MCP server identity */
1099
+ mcpServer: {
1100
+ [key: string]: unknown;
1101
+ };
1102
+ /** @description Resolved plan mapping by key (includes existing free plan) */
1103
+ planMap: {
1104
+ [key: string]: unknown;
1105
+ };
1106
+ };
1073
1107
  McpBootstrapPreviewResult: {
1074
1108
  /** @description Discovered tools from the origin MCP server */
1075
1109
  discoveredTools: {
@@ -2518,6 +2552,47 @@ interface operations {
2518
2552
  };
2519
2553
  };
2520
2554
  };
2555
+ ProductSdkController_configureMcpPlans: {
2556
+ parameters: {
2557
+ query?: never;
2558
+ header?: never;
2559
+ path: {
2560
+ /** @description Product reference or ID */
2561
+ productRef: string;
2562
+ };
2563
+ cookie?: never;
2564
+ };
2565
+ requestBody: {
2566
+ content: {
2567
+ "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
2568
+ };
2569
+ };
2570
+ responses: {
2571
+ /** @description MCP plans configured successfully */
2572
+ 200: {
2573
+ headers: {
2574
+ [name: string]: unknown;
2575
+ };
2576
+ content: {
2577
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
2578
+ };
2579
+ };
2580
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
2581
+ 400: {
2582
+ headers: {
2583
+ [name: string]: unknown;
2584
+ };
2585
+ content?: never;
2586
+ };
2587
+ /** @description Product not found */
2588
+ 404: {
2589
+ headers: {
2590
+ [name: string]: unknown;
2591
+ };
2592
+ content?: never;
2593
+ };
2594
+ };
2595
+ };
2521
2596
  ProductSdkController_cloneProduct: {
2522
2597
  parameters: {
2523
2598
  query?: never;
@@ -3241,6 +3316,10 @@ interface ToolPlanMappingInput {
3241
3316
  planRefs?: string[];
3242
3317
  planKeys?: string[];
3243
3318
  }
3319
+ interface McpToolPlanMappingInput {
3320
+ name: string;
3321
+ planKeys: string[];
3322
+ }
3244
3323
  interface McpBootstrapRequest {
3245
3324
  name?: string;
3246
3325
  description?: string;
@@ -3277,6 +3356,26 @@ interface McpBootstrapResponse {
3277
3356
  description?: string;
3278
3357
  }>;
3279
3358
  }
3359
+ interface ConfigureMcpPlansRequest {
3360
+ paidPlans?: McpBootstrapPaidPlanInput[];
3361
+ toolMapping?: McpToolPlanMappingInput[];
3362
+ }
3363
+ interface ConfigureMcpPlansResponse {
3364
+ product: components['schemas']['SdkProductResponse'];
3365
+ mcpServer: {
3366
+ id?: string;
3367
+ reference?: string;
3368
+ subdomain?: string;
3369
+ mcpProxyUrl?: string;
3370
+ url: string;
3371
+ defaultPlanId?: string;
3372
+ };
3373
+ planMap: Record<string, {
3374
+ id: string;
3375
+ reference: string;
3376
+ name?: string;
3377
+ }>;
3378
+ }
3280
3379
  /**
3281
3380
  * SolvaPay API Client Interface
3282
3381
  *
@@ -3318,6 +3417,7 @@ interface SolvaPayClient {
3318
3417
  name: string;
3319
3418
  }>;
3320
3419
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3420
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
3321
3421
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
3322
3422
  deleteProduct?(productRef: string): Promise<void>;
3323
3423
  cloneProduct?(productRef: string, overrides?: {
@@ -3375,7 +3475,7 @@ interface SolvaPayClient {
3375
3475
  customerRef: string;
3376
3476
  productRef: string;
3377
3477
  }): Promise<components['schemas']['UserInfoResponse']>;
3378
- createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CheckoutSessionResponse']>;
3478
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
3379
3479
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
3380
3480
  }
3381
3481
 
@@ -4102,6 +4202,13 @@ interface SolvaPay {
4102
4202
  * fast setup flows where you want one call for product + plans + MCP config.
4103
4203
  */
4104
4204
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
4205
+ /**
4206
+ * Configure MCP plans and tool mappings for an existing MCP product.
4207
+ *
4208
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
4209
+ * paid plans as well as remapping tool access.
4210
+ */
4211
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
4105
4212
  /**
4106
4213
  * Get virtual tool definitions with bound handlers for MCP server integration.
4107
4214
  *
@@ -4793,4 +4900,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
4793
4900
  secret: string;
4794
4901
  }): WebhookEvent;
4795
4902
 
4796
- export { type AuthenticatedUser, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, buildAuthInfoFromBearer, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
4903
+ export { type AuthenticatedUser, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type McpToolPlanMappingInput, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, buildAuthInfoFromBearer, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted';
1
+ type WebhookEventType = 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'payment.refund_failed' | 'purchase.created' | 'purchase.updated' | 'purchase.cancelled' | 'purchase.expired' | 'purchase.suspended' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'checkout_session.created';
2
2
  interface WebhookEvent {
3
3
  id: string;
4
4
  type: WebhookEventType;
@@ -94,7 +94,7 @@ interface components {
94
94
  */
95
95
  productRef: string;
96
96
  };
97
- CheckoutSessionResponse: {
97
+ CreateUiCheckoutSessionResponse: {
98
98
  /**
99
99
  * Checkout session ID
100
100
  * @example 507f1f77bcf86cd799439011
@@ -1070,6 +1070,40 @@ interface components {
1070
1070
  description?: string;
1071
1071
  }[];
1072
1072
  };
1073
+ McpToolPlanMapping: {
1074
+ /**
1075
+ * Tool name
1076
+ * @example deep_research
1077
+ */
1078
+ name: string;
1079
+ /**
1080
+ * Plan keys this tool should be gated to
1081
+ * @example [
1082
+ * "pro"
1083
+ * ]
1084
+ */
1085
+ planKeys: string[];
1086
+ };
1087
+ ConfigureMcpPlansRequest: {
1088
+ /** @description Required free plan configuration for updates. Applies to the existing default free plan only. */
1089
+ freePlan: components["schemas"]["McpBootstrapFreePlanConfig"];
1090
+ /** @description Optional paid plan definitions. [] reverts to free-only, omitted leaves existing paid plans unchanged. */
1091
+ paidPlans?: components["schemas"]["McpBootstrapPaidPlanInput"][];
1092
+ /** @description Optional tool-to-plan remapping. If paidPlans is omitted, only this remapping is applied. */
1093
+ toolMapping?: components["schemas"]["McpToolPlanMapping"][];
1094
+ };
1095
+ ConfigureMcpPlansResult: {
1096
+ /** @description Updated product */
1097
+ product: components["schemas"]["SdkProductResponse"];
1098
+ /** @description Updated MCP server identity */
1099
+ mcpServer: {
1100
+ [key: string]: unknown;
1101
+ };
1102
+ /** @description Resolved plan mapping by key (includes existing free plan) */
1103
+ planMap: {
1104
+ [key: string]: unknown;
1105
+ };
1106
+ };
1073
1107
  McpBootstrapPreviewResult: {
1074
1108
  /** @description Discovered tools from the origin MCP server */
1075
1109
  discoveredTools: {
@@ -2518,6 +2552,47 @@ interface operations {
2518
2552
  };
2519
2553
  };
2520
2554
  };
2555
+ ProductSdkController_configureMcpPlans: {
2556
+ parameters: {
2557
+ query?: never;
2558
+ header?: never;
2559
+ path: {
2560
+ /** @description Product reference or ID */
2561
+ productRef: string;
2562
+ };
2563
+ cookie?: never;
2564
+ };
2565
+ requestBody: {
2566
+ content: {
2567
+ "application/json": components["schemas"]["ConfigureMcpPlansRequest"];
2568
+ };
2569
+ };
2570
+ responses: {
2571
+ /** @description MCP plans configured successfully */
2572
+ 200: {
2573
+ headers: {
2574
+ [name: string]: unknown;
2575
+ };
2576
+ content: {
2577
+ "application/json": components["schemas"]["ConfigureMcpPlansResult"];
2578
+ };
2579
+ };
2580
+ /** @description Invalid MCP plans request or product is not MCP-enabled */
2581
+ 400: {
2582
+ headers: {
2583
+ [name: string]: unknown;
2584
+ };
2585
+ content?: never;
2586
+ };
2587
+ /** @description Product not found */
2588
+ 404: {
2589
+ headers: {
2590
+ [name: string]: unknown;
2591
+ };
2592
+ content?: never;
2593
+ };
2594
+ };
2595
+ };
2521
2596
  ProductSdkController_cloneProduct: {
2522
2597
  parameters: {
2523
2598
  query?: never;
@@ -3241,6 +3316,10 @@ interface ToolPlanMappingInput {
3241
3316
  planRefs?: string[];
3242
3317
  planKeys?: string[];
3243
3318
  }
3319
+ interface McpToolPlanMappingInput {
3320
+ name: string;
3321
+ planKeys: string[];
3322
+ }
3244
3323
  interface McpBootstrapRequest {
3245
3324
  name?: string;
3246
3325
  description?: string;
@@ -3277,6 +3356,26 @@ interface McpBootstrapResponse {
3277
3356
  description?: string;
3278
3357
  }>;
3279
3358
  }
3359
+ interface ConfigureMcpPlansRequest {
3360
+ paidPlans?: McpBootstrapPaidPlanInput[];
3361
+ toolMapping?: McpToolPlanMappingInput[];
3362
+ }
3363
+ interface ConfigureMcpPlansResponse {
3364
+ product: components['schemas']['SdkProductResponse'];
3365
+ mcpServer: {
3366
+ id?: string;
3367
+ reference?: string;
3368
+ subdomain?: string;
3369
+ mcpProxyUrl?: string;
3370
+ url: string;
3371
+ defaultPlanId?: string;
3372
+ };
3373
+ planMap: Record<string, {
3374
+ id: string;
3375
+ reference: string;
3376
+ name?: string;
3377
+ }>;
3378
+ }
3280
3379
  /**
3281
3380
  * SolvaPay API Client Interface
3282
3381
  *
@@ -3318,6 +3417,7 @@ interface SolvaPayClient {
3318
3417
  name: string;
3319
3418
  }>;
3320
3419
  bootstrapMcpProduct?(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
3420
+ configureMcpPlans?(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
3321
3421
  updateProduct?(productRef: string, params: components['schemas']['UpdateProductRequest']): Promise<components['schemas']['SdkProductResponse']>;
3322
3422
  deleteProduct?(productRef: string): Promise<void>;
3323
3423
  cloneProduct?(productRef: string, overrides?: {
@@ -3375,7 +3475,7 @@ interface SolvaPayClient {
3375
3475
  customerRef: string;
3376
3476
  productRef: string;
3377
3477
  }): Promise<components['schemas']['UserInfoResponse']>;
3378
- createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CheckoutSessionResponse']>;
3478
+ createCheckoutSession(params: operations['CheckoutSessionSdkController_createCheckoutSession']['requestBody']['content']['application/json']): Promise<components['schemas']['CreateCheckoutSessionResponse']>;
3379
3479
  createCustomerSession(params: components['schemas']['CreateCustomerSessionRequest']): Promise<components['schemas']['CreateCustomerSessionResponse']>;
3380
3480
  }
3381
3481
 
@@ -4102,6 +4202,13 @@ interface SolvaPay {
4102
4202
  * fast setup flows where you want one call for product + plans + MCP config.
4103
4203
  */
4104
4204
  bootstrapMcpProduct(params: McpBootstrapRequest): Promise<McpBootstrapResponse>;
4205
+ /**
4206
+ * Configure MCP plans and tool mappings for an existing MCP product.
4207
+ *
4208
+ * This helper wraps the backend MCP plans endpoint and supports adding/removing
4209
+ * paid plans as well as remapping tool access.
4210
+ */
4211
+ configureMcpPlans(productRef: string, params: ConfigureMcpPlansRequest): Promise<ConfigureMcpPlansResponse>;
4105
4212
  /**
4106
4213
  * Get virtual tool definitions with bound handlers for MCP server integration.
4107
4214
  *
@@ -4793,4 +4900,4 @@ declare function verifyWebhook({ body, signature, secret, }: {
4793
4900
  secret: string;
4794
4901
  }): WebhookEvent;
4795
4902
 
4796
- export { type AuthenticatedUser, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, buildAuthInfoFromBearer, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
4903
+ export { type AuthenticatedUser, type ConfigureMcpPlansRequest, type ConfigureMcpPlansResponse, type CreateSolvaPayConfig, type CustomerResponseMapped, type ErrorResult, type HttpAdapterOptions, type McpAdapterOptions, McpBearerAuthError, type McpBootstrapFreePlanConfig, type McpBootstrapPaidPlanInput, type McpBootstrapRequest, type McpBootstrapResponse, type McpServerLike, type McpToolExtra, type McpToolPlanMappingInput, type NextAdapterOptions, type OneTimePurchaseInfo, type PayableFunction, type PayableOptions, type PaywallArgs, PaywallError, type PaywallMetadata, type PaywallStructuredContent, type PaywallToolResult, type ProcessPaymentResult, type RegisterVirtualToolsMcpOptions, type RetryOptions, type ServerClientOptions, type SolvaPay, type SolvaPayClient, type ToolPlanMappingInput, VIRTUAL_TOOL_DEFINITIONS, type VirtualToolDefinition, type VirtualToolsOptions, type WebhookEvent, type WebhookEventType, buildAuthInfoFromBearer, cancelPurchaseCore, createCheckoutSessionCore, createCustomerSessionCore, createMcpOAuthBridge, createPaymentIntentCore, createSolvaPay, createSolvaPayClient, createVirtualTools, decodeJwtPayload, extractBearerToken, getAuthenticatedUserCore, getCustomerRefFromBearerAuthHeader, getCustomerRefFromJwtPayload, getOAuthAuthorizationServerResponse, getOAuthProtectedResourceResponse, handleRouteError, isErrorResult, jsonSchemaToZodRawShape, listPlansCore, processPaymentIntentCore, registerVirtualToolsMcpImpl, syncCustomerCore, verifyWebhook, withRetry };
package/dist/index.js CHANGED
@@ -163,6 +163,21 @@ function createSolvaPayClient(opts) {
163
163
  }
164
164
  return await res.json();
165
165
  },
166
+ // PUT: /v1/sdk/products/{productRef}/mcp/plans
167
+ async configureMcpPlans(productRef, params) {
168
+ const url = `${base}/v1/sdk/products/${productRef}/mcp/plans`;
169
+ const res = await fetch(url, {
170
+ method: "PUT",
171
+ headers,
172
+ body: JSON.stringify(params)
173
+ });
174
+ if (!res.ok) {
175
+ const error = await res.text();
176
+ log(`\u274C API Error: ${res.status} - ${error}`);
177
+ throw new SolvaPayError(`Configure MCP plans failed (${res.status}): ${error}`);
178
+ }
179
+ return await res.json();
180
+ },
166
181
  // DELETE: /v1/sdk/products/{productRef}
167
182
  async deleteProduct(productRef) {
168
183
  const url = `${base}/v1/sdk/products/${productRef}`;
@@ -1478,6 +1493,12 @@ function createSolvaPay(config) {
1478
1493
  }
1479
1494
  return apiClient.bootstrapMcpProduct(params);
1480
1495
  },
1496
+ configureMcpPlans(productRef, params) {
1497
+ if (!apiClient.configureMcpPlans) {
1498
+ throw new SolvaPayError2("configureMcpPlans is not available on this API client");
1499
+ }
1500
+ return apiClient.configureMcpPlans(productRef, params);
1501
+ },
1481
1502
  getVirtualTools(options) {
1482
1503
  return createVirtualTools(apiClient, options);
1483
1504
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solvapay/server",
3
- "version": "1.0.1-preview.3",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -37,12 +37,12 @@
37
37
  },
38
38
  "sideEffects": false,
39
39
  "dependencies": {
40
- "@solvapay/core": "1.0.1-preview.3"
40
+ "@solvapay/core": "1.0.3"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@modelcontextprotocol/sdk": "^1.28.0",
44
44
  "zod": "^3.25.0 || ^4.0.0",
45
- "@solvapay/auth": "1.0.1-preview.3"
45
+ "@solvapay/auth": "1.0.3"
46
46
  },
47
47
  "peerDependenciesMeta": {
48
48
  "@modelcontextprotocol/sdk": {
@@ -60,9 +60,9 @@
60
60
  "tsx": "^4.21.0",
61
61
  "typescript": "^5.9.3",
62
62
  "vitest": "^4.1.2",
63
- "@solvapay/demo-services": "0.0.0",
64
63
  "@solvapay/test-utils": "^0.0.0",
65
- "@solvapay/auth": "1.0.1-preview.3"
64
+ "@solvapay/auth": "1.0.3",
65
+ "@solvapay/demo-services": "0.0.0"
66
66
  },
67
67
  "scripts": {
68
68
  "build": "tsup src/index.ts --format esm,cjs --dts --tsconfig tsconfig.build.json && tsup src/edge.ts --format esm --dts --tsconfig tsconfig.build.json",