@flexprice/mcp-server 2.1.24 → 2.1.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.
Files changed (54) hide show
  1. package/bin/mcp-server.js +41 -9
  2. package/bin/mcp-server.js.map +15 -14
  3. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts +6 -0
  4. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -1
  5. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js +6 -0
  6. package/esm/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -1
  7. package/esm/lib/config.d.ts +2 -2
  8. package/esm/lib/config.js +2 -2
  9. package/esm/mcp-server/mcp-server.js +1 -1
  10. package/esm/mcp-server/server.js +1 -1
  11. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.d.ts.map +1 -1
  12. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js +7 -1
  13. package/esm/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.js.map +1 -1
  14. package/esm/models/entitlementgrantallocationbehavior.d.ts +12 -0
  15. package/esm/models/entitlementgrantallocationbehavior.d.ts.map +1 -0
  16. package/esm/models/entitlementgrantallocationbehavior.js +13 -0
  17. package/esm/models/entitlementgrantallocationbehavior.js.map +1 -0
  18. package/esm/models/entitlementgrantdurationunit.d.ts +2 -0
  19. package/esm/models/entitlementgrantdurationunit.d.ts.map +1 -1
  20. package/esm/models/entitlementgrantdurationunit.js +2 -0
  21. package/esm/models/entitlementgrantdurationunit.js.map +1 -1
  22. package/esm/models/entitlementresponse.d.ts +2 -0
  23. package/esm/models/entitlementresponse.d.ts.map +1 -1
  24. package/esm/models/entitlementresponse.js +3 -0
  25. package/esm/models/entitlementresponse.js.map +1 -1
  26. package/esm/models/integrationentitytype.d.ts +2 -0
  27. package/esm/models/integrationentitytype.d.ts.map +1 -1
  28. package/esm/models/integrationentitytype.js +2 -0
  29. package/esm/models/integrationentitytype.js.map +1 -1
  30. package/esm/models/subscriptionchangev2request.d.ts +2 -0
  31. package/esm/models/subscriptionchangev2request.d.ts.map +1 -1
  32. package/esm/models/subscriptionchangev2request.js +2 -0
  33. package/esm/models/subscriptionchangev2request.js.map +1 -1
  34. package/esm/models/subscriptionchangev2response.d.ts +3 -0
  35. package/esm/models/subscriptionchangev2response.d.ts.map +1 -1
  36. package/esm/models/subscriptionchangev2response.js +3 -0
  37. package/esm/models/subscriptionchangev2response.js.map +1 -1
  38. package/esm/tool-names.js +1 -1
  39. package/esm/tool-names.js.map +1 -1
  40. package/esm/tsconfig.tsbuildinfo +1 -1
  41. package/manifest.json +2 -2
  42. package/package.json +1 -1
  43. package/src/funcs/subscriptionsExecuteSubscriptionPlanChangeV2.ts +6 -0
  44. package/src/lib/config.ts +2 -2
  45. package/src/mcp-server/mcp-server.ts +1 -1
  46. package/src/mcp-server/server.ts +1 -1
  47. package/src/mcp-server/tools/subscriptionsExecuteSubscriptionPlanChangeV2.ts +7 -1
  48. package/src/models/entitlementgrantallocationbehavior.ts +19 -0
  49. package/src/models/entitlementgrantdurationunit.ts +2 -0
  50. package/src/models/entitlementresponse.ts +7 -0
  51. package/src/models/integrationentitytype.ts +2 -0
  52. package/src/models/subscriptionchangev2request.ts +3 -0
  53. package/src/models/subscriptionchangev2response.ts +8 -0
  54. package/src/tool-names.ts +1 -1
package/manifest.json CHANGED
@@ -48,7 +48,7 @@
48
48
  "sensitive": true
49
49
  }
50
50
  },
51
- "version": "2.1.24",
51
+ "version": "2.1.25",
52
52
  "tools": [
53
53
  {
54
54
  "name": "update-customer",
@@ -300,7 +300,7 @@
300
300
  },
301
301
  {
302
302
  "name": "execute-subscription-plan-change-v2",
303
- "description": "Execute a plan change (v2, swap in place)\n\nChange a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction."
303
+ "description": "Execute a plan change (v2, swap in place)\n\nChange a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.\n\nchange_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary.\n\nscheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this.\n\nOnly one plan change may be pending per subscription; request a second one and this returns 400. Cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules."
304
304
  },
305
305
  {
306
306
  "name": "preview-subscription-plan-change-v2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flexprice/mcp-server",
3
- "version": "2.1.24",
3
+ "version": "2.1.25",
4
4
  "author": "flexprice",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -30,6 +30,12 @@ import { Result } from "../types/fp.js";
30
30
  *
31
31
  * @remarks
32
32
  * Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.
33
+ *
34
+ * change_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary.
35
+ *
36
+ * scheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this.
37
+ *
38
+ * Only one plan change may be pending per subscription; request a second one and this returns 400. Cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules.
33
39
  */
34
40
  export function subscriptionsExecuteSubscriptionPlanChangeV2(
35
41
  client$: FlexpriceCore,
package/src/lib/config.ts CHANGED
@@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
69
69
  export const SDK_METADATA = {
70
70
  language: "typescript",
71
71
  openapiDocVersion: "1.0",
72
- sdkVersion: "2.1.24",
72
+ sdkVersion: "2.1.25",
73
73
  genVersion: "2.931.0",
74
74
  userAgent:
75
- "speakeasy-sdk/mcp-typescript 2.1.24 2.931.0 1.0 @flexprice/mcp-server",
75
+ "speakeasy-sdk/mcp-typescript 2.1.25 2.931.0 1.0 @flexprice/mcp-server",
76
76
  } as const;
@@ -21,7 +21,7 @@ const routes = buildRouteMap({
21
21
  export const app = buildApplication(routes, {
22
22
  name: "mcp",
23
23
  versionInfo: {
24
- currentVersion: "2.1.24",
24
+ currentVersion: "2.1.25",
25
25
  },
26
26
  });
27
27
 
@@ -105,7 +105,7 @@ export function createMCPServer(deps: {
105
105
  }) {
106
106
  const server = new McpServer({
107
107
  name: "Flexprice",
108
- version: "2.1.24",
108
+ version: "2.1.25",
109
109
  });
110
110
 
111
111
  const getClient = deps.getSDK || (() =>
@@ -16,7 +16,13 @@ export const tool$subscriptionsExecuteSubscriptionPlanChangeV2: ToolDefinition<
16
16
  name: "execute-subscription-plan-change-v2",
17
17
  description: `Execute a plan change (v2, swap in place)
18
18
 
19
- Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.`,
19
+ Change a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.
20
+
21
+ change_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary.
22
+
23
+ scheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this.
24
+
25
+ Only one plan change may be pending per subscription; request a second one and this returns 400. Cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules.`,
20
26
  scopes: ["write"],
21
27
  annotations: {
22
28
  "title": "",
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../types/enums.js";
7
+
8
+ export const EntitlementGrantAllocationBehavior = {
9
+ FirstUsage: "first_usage",
10
+ UnitStart: "unit_start",
11
+ } as const;
12
+ export type EntitlementGrantAllocationBehavior = ClosedEnum<
13
+ typeof EntitlementGrantAllocationBehavior
14
+ >;
15
+
16
+ export const EntitlementGrantAllocationBehavior$zodSchema = z.enum([
17
+ "first_usage",
18
+ "unit_start",
19
+ ]);
@@ -9,6 +9,7 @@ export const EntitlementGrantDurationUnit = {
9
9
  Hour: "hour",
10
10
  Day: "day",
11
11
  Week: "week",
12
+ SubscriptionPeriod: "subscription_period",
12
13
  } as const;
13
14
  export type EntitlementGrantDurationUnit = ClosedEnum<
14
15
  typeof EntitlementGrantDurationUnit
@@ -18,4 +19,5 @@ export const EntitlementGrantDurationUnit$zodSchema = z.enum([
18
19
  "hour",
19
20
  "day",
20
21
  "week",
22
+ "subscription_period",
21
23
  ]);
@@ -12,6 +12,10 @@ import {
12
12
  EntitlementEntityType,
13
13
  EntitlementEntityType$zodSchema,
14
14
  } from "./entitlemententitytype.js";
15
+ import {
16
+ EntitlementGrantAllocationBehavior,
17
+ EntitlementGrantAllocationBehavior$zodSchema,
18
+ } from "./entitlementgrantallocationbehavior.js";
15
19
  import {
16
20
  EntitlementGrantDurationUnit,
17
21
  EntitlementGrantDurationUnit$zodSchema,
@@ -46,6 +50,7 @@ export type EntitlementResponse = {
46
50
  feature?: FeatureResponse | undefined;
47
51
  feature_id?: string | undefined;
48
52
  feature_type?: FeatureType | undefined;
53
+ grant_allocation_behavior?: EntitlementGrantAllocationBehavior | undefined;
49
54
  grant_duration_unit?: EntitlementGrantDurationUnit | undefined;
50
55
  grant_duration_value?: number | undefined;
51
56
  grant_measure?: EntitlementGrantMeasure | undefined;
@@ -81,6 +86,8 @@ export const EntitlementResponse$zodSchema: z.ZodType<EntitlementResponse> = z
81
86
  feature: FeatureResponse$zodSchema.optional(),
82
87
  feature_id: z.string().optional(),
83
88
  feature_type: FeatureType$zodSchema.optional(),
89
+ grant_allocation_behavior: EntitlementGrantAllocationBehavior$zodSchema
90
+ .optional(),
84
91
  grant_duration_unit: EntitlementGrantDurationUnit$zodSchema.optional(),
85
92
  grant_duration_value: z.int().optional(),
86
93
  grant_measure: EntitlementGrantMeasure$zodSchema.optional(),
@@ -17,6 +17,7 @@ export const IntegrationEntityType = {
17
17
  ItemPrice: "item_price",
18
18
  Price: "price",
19
19
  InvoiceLineItem: "invoice_line_item",
20
+ SubscriptionLineItem: "subscription_line_item",
20
21
  } as const;
21
22
  export type IntegrationEntityType = ClosedEnum<typeof IntegrationEntityType>;
22
23
 
@@ -32,4 +33,5 @@ export const IntegrationEntityType$zodSchema = z.enum([
32
33
  "item_price",
33
34
  "price",
34
35
  "invoice_line_item",
36
+ "subscription_line_item",
35
37
  ]);
@@ -7,12 +7,14 @@ import {
7
7
  ProrationBehavior,
8
8
  ProrationBehavior$zodSchema,
9
9
  } from "./prorationbehavior.js";
10
+ import { ScheduleType, ScheduleType$zodSchema } from "./scheduletype.js";
10
11
  import {
11
12
  SubscriptionChangeEntityPolicies,
12
13
  SubscriptionChangeEntityPolicies$zodSchema,
13
14
  } from "./subscriptionchangeentitypolicies.js";
14
15
 
15
16
  export type SubscriptionChangeV2Request = {
17
+ change_at?: ScheduleType | undefined;
16
18
  entity_policies?: SubscriptionChangeEntityPolicies | undefined;
17
19
  idempotency_key?: string | undefined;
18
20
  metadata?: { [k: string]: string } | undefined;
@@ -23,6 +25,7 @@ export type SubscriptionChangeV2Request = {
23
25
  export const SubscriptionChangeV2Request$zodSchema: z.ZodType<
24
26
  SubscriptionChangeV2Request
25
27
  > = z.object({
28
+ change_at: ScheduleType$zodSchema.optional(),
26
29
  entity_policies: SubscriptionChangeEntityPolicies$zodSchema.optional(),
27
30
  idempotency_key: z.string().optional(),
28
31
  metadata: z.record(z.string(), z.string()).optional(),
@@ -27,7 +27,10 @@ export type SubscriptionChangeV2Response = {
27
27
  effective_at?: string | undefined;
28
28
  entity_changes?: Array<EntityChangeResult> | undefined;
29
29
  from_plan?: PlanSummary | undefined;
30
+ is_scheduled?: boolean | undefined;
30
31
  metadata?: { [k: string]: string } | undefined;
32
+ schedule_id?: string | undefined;
33
+ scheduled_at?: string | undefined;
31
34
  subscription?: SubscriptionResponse | undefined;
32
35
  to_plan?: PlanSummary | undefined;
33
36
  warnings?: Array<string> | undefined;
@@ -41,7 +44,12 @@ export const SubscriptionChangeV2Response$zodSchema: z.ZodType<
41
44
  effective_at: z.iso.datetime({ offset: true }).optional(),
42
45
  entity_changes: z.array(EntityChangeResult$zodSchema).optional(),
43
46
  from_plan: PlanSummary$zodSchema.optional(),
47
+ is_scheduled: z.boolean().optional().describe(
48
+ "IsScheduled is true when the change was deferred to the period end instead\nof being applied immediately.",
49
+ ),
44
50
  metadata: z.record(z.string(), z.string()).optional(),
51
+ schedule_id: z.string().optional(),
52
+ scheduled_at: z.iso.datetime({ offset: true }).optional(),
45
53
  subscription: SubscriptionResponse$zodSchema.optional(),
46
54
  to_plan: PlanSummary$zodSchema.optional(),
47
55
  warnings: z.array(z.string()).optional(),
package/src/tool-names.ts CHANGED
@@ -250,7 +250,7 @@ export const toolNames: Array<{ name: string; description: string }>= [
250
250
  },
251
251
  {
252
252
  "name": "execute-subscription-plan-change-v2",
253
- "description": "Execute a plan change (v2, swap in place)\n\nChange a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction."
253
+ "description": "Execute a plan change (v2, swap in place)\n\nChange a subscription's plan in place. Subscription id, billing anchor and period bounds are preserved; line items are sliced and settled in one transaction.\n\nchange_at controls timing. Omitted or 'immediate' applies the change now. 'end_of_period' records a pending schedule that executes at the subscription's current period end: the response returns is_scheduled, schedule_id and scheduled_at instead of a completed change, and nothing is swapped or billed until the boundary.\n\nscheduled_at is resolved from the subscription's current period end at request time. If that period end is already in the past (a backdated start date, a resumed pause, or worker downtime can all leave a subscription behind), the change is due immediately and fires on the next billing scan rather than a period away — inspect scheduled_at to see this.\n\nOnly one plan change may be pending per subscription; request a second one and this returns 400. Cancel the existing schedule via POST /subscriptions/schedules/{schedule_id}/cancel first. Pending schedules are listable via GET /subscriptions/{id}/schedules."
254
254
  },
255
255
  {
256
256
  "name": "preview-subscription-plan-change-v2",