posterly-mcp-server 0.52.2 → 0.53.2

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.
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import type { PosterlyClient, SubscriptionTierName, UpgradePaymentPending, UpgradeQuote, UpgradeSubscriptionResponse } from '../lib/api-client.js';
3
+ import { type ToolContext } from '../lib/tool-runtime.js';
4
+ /** Same wording as the hosted endpoint (lib/mcp/http-tools.ts). */
5
+ export declare function formatUpgradePaymentPending(pending: UpgradePaymentPending | null | undefined): string;
6
+ export declare function formatUpgradeQuote(q: UpgradeQuote): string;
7
+ export declare function formatUpgradeResult(d: UpgradeSubscriptionResponse): string;
8
+ type UpgradeSubscriptionInput = {
9
+ tier: SubscriptionTierName;
10
+ interval?: 'month' | 'year';
11
+ workspace_id?: string;
12
+ expected_current_tier?: SubscriptionTierName;
13
+ expected_interval?: 'week' | 'month' | 'year';
14
+ confirm?: boolean;
15
+ preview_id?: string;
16
+ };
17
+ export declare const upgradeSubscriptionTool: {
18
+ name: string;
19
+ description: string;
20
+ inputSchema: z.ZodObject<{
21
+ tier: z.ZodEnum<["starter", "pro", "power_user", "agency"]>;
22
+ interval: z.ZodOptional<z.ZodEnum<["month", "year"]>>;
23
+ workspace_id: z.ZodOptional<z.ZodString>;
24
+ expected_current_tier: z.ZodOptional<z.ZodEnum<["starter", "pro", "power_user", "agency"]>>;
25
+ expected_interval: z.ZodOptional<z.ZodEnum<["week", "month", "year"]>>;
26
+ confirm: z.ZodOptional<z.ZodBoolean>;
27
+ preview_id: z.ZodOptional<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ tier: "starter" | "pro" | "power_user" | "agency";
30
+ workspace_id?: string | undefined;
31
+ confirm?: boolean | undefined;
32
+ preview_id?: string | undefined;
33
+ interval?: "month" | "year" | undefined;
34
+ expected_interval?: "week" | "month" | "year" | undefined;
35
+ expected_current_tier?: "starter" | "pro" | "power_user" | "agency" | undefined;
36
+ }, {
37
+ tier: "starter" | "pro" | "power_user" | "agency";
38
+ workspace_id?: string | undefined;
39
+ confirm?: boolean | undefined;
40
+ preview_id?: string | undefined;
41
+ interval?: "month" | "year" | undefined;
42
+ expected_interval?: "week" | "month" | "year" | undefined;
43
+ expected_current_tier?: "starter" | "pro" | "power_user" | "agency" | undefined;
44
+ }>;
45
+ execute(client: PosterlyClient, input: UpgradeSubscriptionInput, ctx: ToolContext): Promise<string>;
46
+ };
47
+ export {};
@@ -0,0 +1,169 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { z } from 'zod';
3
+ import { formatDateTime, mdKeyValue, mdSection, mdTitle } from '../lib/format.js';
4
+ import { previewThenConfirm, readForPreview, validateArgs } from '../lib/tool-runtime.js';
5
+ import { usdFromCents } from './manage-extra-account.js';
6
+ const TIER_VALUES = ['starter', 'pro', 'power_user', 'agency'];
7
+ function upgradeNumber(value) {
8
+ return Number.isFinite(value) ? value.toLocaleString('en-US') : String(value);
9
+ }
10
+ function intervalNoun(interval) {
11
+ return interval === 'year' ? 'year' : interval === 'week' ? 'week' : 'month';
12
+ }
13
+ function intervalAdverb(interval) {
14
+ return interval === 'year' ? 'yearly' : interval === 'week' ? 'weekly' : 'monthly';
15
+ }
16
+ /** Same wording as the hosted endpoint (lib/mcp/http-tools.ts). */
17
+ export function formatUpgradePaymentPending(pending) {
18
+ if (!pending)
19
+ return '';
20
+ return mdSection('Payment waiting', [
21
+ mdKeyValue([
22
+ ['Requested plan', pending.requested_tier || 'a plan change'],
23
+ ['Amount due', pending.amount_due_cents === null || pending.amount_due_cents === undefined ? 'n/a' : usdFromCents(pending.amount_due_cents)],
24
+ ['Expires', pending.expires_at ? formatDateTime(pending.expires_at) : 'n/a'],
25
+ ['Payment link', pending.hosted_invoice_url || 'not available, finish it on the billing page'],
26
+ ]),
27
+ 'The plan has not changed yet. It changes automatically once this invoice is paid. Until then posterly will not accept another plan change.',
28
+ ].join('\n\n'));
29
+ }
30
+ export function formatUpgradeQuote(q) {
31
+ const word = intervalNoun(q.interval);
32
+ const rows = [
33
+ ['Plan now', `${q.current_tier_name} (${intervalAdverb(q.current_interval)})`],
34
+ ['Plan after', `${q.new_tier_name} (${intervalAdverb(q.interval)})`],
35
+ ['Connected accounts', `${upgradeNumber(q.account_limit_before)} to ${upgradeNumber(q.account_limit_after)}`],
36
+ ['AI credits a month', `${upgradeNumber(q.included_credits_before)} to ${upgradeNumber(q.included_credits_after)}`],
37
+ ['Charge today', q.trialing ? '$0.00 (trial)' : q.charge_today || usdFromCents(q.charge_today_cents)],
38
+ [
39
+ 'New recurring cost',
40
+ `${q.new_recurring || usdFromCents(q.new_recurring_cents)} per ${word}${q.current_recurring_cents === null || q.current_recurring_cents === undefined ? '' : ` (now ${usdFromCents(q.current_recurring_cents)} per ${intervalNoun(q.current_interval)})`}`,
41
+ ],
42
+ ];
43
+ if (q.interval_changes)
44
+ rows.push(['Billing interval', `${intervalAdverb(q.current_interval)} to ${intervalAdverb(q.interval)}`]);
45
+ const chargeLine = q.trialing
46
+ ? 'Nothing is charged today because the subscription is on a trial. The trial continues and the new price starts when it ends.'
47
+ : `The saved card on file is charged ${q.charge_today || usdFromCents(q.charge_today_cents)} today (${q.interval_changes ? 'the unused time on the current plan is credited, and the new billing period starts today' : 'prorated for the rest of this billing period'}) when this is confirmed. Prices are before any discount on the subscription, and discounts carry over. If the card needs confirmation or declines, nothing changes and a payment link is returned instead.`;
48
+ return [mdSection(`Upgrade to ${q.new_tier_name}`, mdKeyValue(rows)), chargeLine].join('\n\n');
49
+ }
50
+ export function formatUpgradeResult(d) {
51
+ if (d.status === 'payment_required') {
52
+ return [
53
+ mdTitle('Payment needed: the plan was not changed yet'),
54
+ 'The saved card needs confirmation (3D Secure) or was declined, so posterly did not change the plan. Send the user to the payment link. The plan changes automatically once it is paid.',
55
+ mdKeyValue([
56
+ ['Requested plan', d.requested_tier_name],
57
+ ['Connected accounts once paid', d.account_limit_after_payment],
58
+ ['AI credits a month once paid', d.included_credits_after_payment],
59
+ ['Amount due', d.payment_pending?.amount_due_cents === null || d.payment_pending?.amount_due_cents === undefined ? 'n/a' : usdFromCents(d.payment_pending.amount_due_cents)],
60
+ ['Link expires', d.payment_pending?.expires_at ? formatDateTime(d.payment_pending.expires_at) : 'n/a'],
61
+ ['Payment link', d.hosted_invoice_url || 'not available, ask the user to finish it on the billing page'],
62
+ ]),
63
+ 'Call get_subscription afterwards to confirm the new plan.',
64
+ ].join('\n\n');
65
+ }
66
+ return [
67
+ mdTitle(`Upgraded to ${d.tier_name}`),
68
+ `The plan is now ${d.tier_name}. New limits show in get_subscription as soon as Stripe confirms the change, usually within seconds.`,
69
+ mdKeyValue([
70
+ ['Plan', `${d.previous_tier_name} to ${d.tier_name}`],
71
+ ['Connected accounts', d.account_limit],
72
+ ['AI credits a month', d.included_credits],
73
+ ['Billing interval', intervalAdverb(d.interval)],
74
+ ['Charged today', d.trialing ? '$0.00 (trial)' : d.charged_cents === null || d.charged_cents === undefined ? 'the prorated amount' : usdFromCents(d.charged_cents)],
75
+ ]),
76
+ d.trialing ? 'The trial continues. The new price starts when it ends.' : 'The prorated amount was charged to the saved card.',
77
+ ].join('\n\n');
78
+ }
79
+ export const upgradeSubscriptionTool = {
80
+ name: 'upgrade_subscription',
81
+ description: 'Upgrade to a strictly higher plan. MONEY: charges the saved card (prorated). Owner only. Call without confirm for the quote and preview_id; after the user agrees, call with confirm=true, that preview_id and the expected_ fields. 3D Secure or a decline returns a payment link; nothing changes.',
82
+ inputSchema: z.object({
83
+ tier: z.enum(TIER_VALUES),
84
+ interval: z.enum(['month', 'year']).optional(),
85
+ workspace_id: z.string().optional(),
86
+ expected_current_tier: z.enum(TIER_VALUES).optional(),
87
+ expected_interval: z.enum(['week', 'month', 'year']).optional(),
88
+ confirm: z.boolean().optional(),
89
+ preview_id: z.string().optional(),
90
+ }),
91
+ async execute(client, input, ctx) {
92
+ const { args } = validateArgs(ctx, 'upgrade_subscription', input);
93
+ const call = args;
94
+ // Read at use time: a repeated, equal interval is dropped below.
95
+ const makeBase = () => ({
96
+ tier: call.tier,
97
+ ...(call.interval ? { interval: call.interval } : {}),
98
+ ...(call.workspace_id ? { workspace_id: call.workspace_id } : {}),
99
+ });
100
+ // A preview is only issued for a change posterly can actually make: price
101
+ // it first, and answer a failed quote with an error and NO preview_id. The
102
+ // quote's current plan and interval are pinned into the previewed args, so
103
+ // the confirm must repeat them and the API refuses a stale quote.
104
+ let quote = null;
105
+ let previewArgs = args;
106
+ if (call.confirm !== true) {
107
+ const read = await readForPreview(() => client.quoteUpgrade(makeBase()));
108
+ if (!read.ok) {
109
+ throw new Error([
110
+ 'No preview: this plan change cannot be made right now.',
111
+ read.error,
112
+ 'Nothing was changed and no preview_id was issued. Tell the user why. If the reason points to the billing page, send them there.',
113
+ ].join('\n\n'));
114
+ }
115
+ quote = read.data.quote;
116
+ // An interval equal to the current one is a no-op the preview does not
117
+ // ask to repeat, so it is dropped from the previewed args: the confirm
118
+ // then binds to exactly the fields listed under "Fields to repeat on
119
+ // confirm".
120
+ const { interval: _noopInterval, ...rest } = args;
121
+ previewArgs = {
122
+ ...(quote.interval_changes ? args : rest),
123
+ expected_current_tier: quote.current_tier,
124
+ expected_interval: quote.current_interval,
125
+ };
126
+ }
127
+ else if (call.interval && call.interval === call.expected_interval) {
128
+ // Confirm side of the same rule: a repeated, equal interval is a no-op.
129
+ const { interval: _noopInterval, ...rest } = args;
130
+ previewArgs = rest;
131
+ call.interval = undefined;
132
+ }
133
+ return previewThenConfirm({
134
+ tool: 'upgrade_subscription',
135
+ action: 'upgrade',
136
+ args: previewArgs,
137
+ nonce: true,
138
+ legacyRefusal: 'Refusing to upgrade the plan without confirm=true after explicit user confirmation.',
139
+ ctx,
140
+ describe: async () => [
141
+ formatUpgradeQuote(quote),
142
+ 'Only confirm after the user has seen the price and agreed. The change is billed to the saved card, not to anything the user types here.',
143
+ mdSection('Fields to repeat on confirm', mdKeyValue([
144
+ ['tier', quote.new_tier],
145
+ ...(quote.interval_changes ? [['interval', quote.interval]] : []),
146
+ ['expected_current_tier', quote.current_tier],
147
+ ['expected_interval', quote.current_interval],
148
+ ])),
149
+ ].join('\n\n'),
150
+ run: async () => {
151
+ if (!call.expected_current_tier || !call.expected_interval) {
152
+ throw new Error('Confirm needs expected_current_tier and expected_interval from the preview. Get a new preview.');
153
+ }
154
+ // The same preview_id always maps to the same request_id, so a replayed
155
+ // confirm can never upgrade twice.
156
+ const requestId = typeof call.preview_id === 'string' && call.preview_id
157
+ ? `mcp-${createHash('sha256').update(call.preview_id).digest('hex').slice(0, 40)}`
158
+ : undefined;
159
+ const result = await client.upgradeSubscription({
160
+ ...makeBase(),
161
+ expected_current_tier: call.expected_current_tier,
162
+ expected_interval: call.expected_interval,
163
+ ...(requestId ? { request_id: requestId } : {}),
164
+ });
165
+ return formatUpgradeResult(result);
166
+ },
167
+ });
168
+ },
169
+ };
@@ -88,9 +88,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
88
88
  option_d?: string | undefined;
89
89
  }>>;
90
90
  }, "strip", import("zod").ZodTypeAny, {
91
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
91
92
  type?: "none" | "poll" | "comment_prompt" | undefined;
92
93
  options?: string[] | undefined;
93
- kind?: "none" | "poll" | "comment_prompt" | undefined;
94
94
  extended_duration?: boolean | undefined;
95
95
  poll_attachment?: {
96
96
  options?: string[] | undefined;
@@ -100,9 +100,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
100
100
  option_d?: string | undefined;
101
101
  } | undefined;
102
102
  }, {
103
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
103
104
  type?: "none" | "poll" | "comment_prompt" | undefined;
104
105
  options?: string[] | undefined;
105
- kind?: "none" | "poll" | "comment_prompt" | undefined;
106
106
  extended_duration?: boolean | undefined;
107
107
  poll_attachment?: {
108
108
  options?: string[] | undefined;
@@ -168,9 +168,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
168
168
  option_d?: string | undefined;
169
169
  } | undefined;
170
170
  caption_addon?: {
171
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
171
172
  type?: "none" | "poll" | "comment_prompt" | undefined;
172
173
  options?: string[] | undefined;
173
- kind?: "none" | "poll" | "comment_prompt" | undefined;
174
174
  extended_duration?: boolean | undefined;
175
175
  poll_attachment?: {
176
176
  options?: string[] | undefined;
@@ -217,9 +217,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
217
217
  option_d?: string | undefined;
218
218
  } | undefined;
219
219
  caption_addon?: {
220
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
220
221
  type?: "none" | "poll" | "comment_prompt" | undefined;
221
222
  options?: string[] | undefined;
222
- kind?: "none" | "poll" | "comment_prompt" | undefined;
223
223
  extended_duration?: boolean | undefined;
224
224
  poll_attachment?: {
225
225
  options?: string[] | undefined;
@@ -727,9 +727,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
727
727
  option_d?: string | undefined;
728
728
  } | undefined;
729
729
  caption_addon?: {
730
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
730
731
  type?: "none" | "poll" | "comment_prompt" | undefined;
731
732
  options?: string[] | undefined;
732
- kind?: "none" | "poll" | "comment_prompt" | undefined;
733
733
  extended_duration?: boolean | undefined;
734
734
  poll_attachment?: {
735
735
  options?: string[] | undefined;
@@ -938,9 +938,9 @@ export declare const validatePostInputSchema: import("zod").ZodObject<{
938
938
  option_d?: string | undefined;
939
939
  } | undefined;
940
940
  caption_addon?: {
941
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
941
942
  type?: "none" | "poll" | "comment_prompt" | undefined;
942
943
  options?: string[] | undefined;
943
- kind?: "none" | "poll" | "comment_prompt" | undefined;
944
944
  extended_duration?: boolean | undefined;
945
945
  poll_attachment?: {
946
946
  options?: string[] | undefined;
@@ -1196,9 +1196,9 @@ export declare const validatePostTool: {
1196
1196
  option_d?: string | undefined;
1197
1197
  }>>;
1198
1198
  }, "strip", import("zod").ZodTypeAny, {
1199
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
1199
1200
  type?: "none" | "poll" | "comment_prompt" | undefined;
1200
1201
  options?: string[] | undefined;
1201
- kind?: "none" | "poll" | "comment_prompt" | undefined;
1202
1202
  extended_duration?: boolean | undefined;
1203
1203
  poll_attachment?: {
1204
1204
  options?: string[] | undefined;
@@ -1208,9 +1208,9 @@ export declare const validatePostTool: {
1208
1208
  option_d?: string | undefined;
1209
1209
  } | undefined;
1210
1210
  }, {
1211
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
1211
1212
  type?: "none" | "poll" | "comment_prompt" | undefined;
1212
1213
  options?: string[] | undefined;
1213
- kind?: "none" | "poll" | "comment_prompt" | undefined;
1214
1214
  extended_duration?: boolean | undefined;
1215
1215
  poll_attachment?: {
1216
1216
  options?: string[] | undefined;
@@ -1276,9 +1276,9 @@ export declare const validatePostTool: {
1276
1276
  option_d?: string | undefined;
1277
1277
  } | undefined;
1278
1278
  caption_addon?: {
1279
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
1279
1280
  type?: "none" | "poll" | "comment_prompt" | undefined;
1280
1281
  options?: string[] | undefined;
1281
- kind?: "none" | "poll" | "comment_prompt" | undefined;
1282
1282
  extended_duration?: boolean | undefined;
1283
1283
  poll_attachment?: {
1284
1284
  options?: string[] | undefined;
@@ -1325,9 +1325,9 @@ export declare const validatePostTool: {
1325
1325
  option_d?: string | undefined;
1326
1326
  } | undefined;
1327
1327
  caption_addon?: {
1328
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
1328
1329
  type?: "none" | "poll" | "comment_prompt" | undefined;
1329
1330
  options?: string[] | undefined;
1330
- kind?: "none" | "poll" | "comment_prompt" | undefined;
1331
1331
  extended_duration?: boolean | undefined;
1332
1332
  poll_attachment?: {
1333
1333
  options?: string[] | undefined;
@@ -1835,9 +1835,9 @@ export declare const validatePostTool: {
1835
1835
  option_d?: string | undefined;
1836
1836
  } | undefined;
1837
1837
  caption_addon?: {
1838
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
1838
1839
  type?: "none" | "poll" | "comment_prompt" | undefined;
1839
1840
  options?: string[] | undefined;
1840
- kind?: "none" | "poll" | "comment_prompt" | undefined;
1841
1841
  extended_duration?: boolean | undefined;
1842
1842
  poll_attachment?: {
1843
1843
  options?: string[] | undefined;
@@ -2046,9 +2046,9 @@ export declare const validatePostTool: {
2046
2046
  option_d?: string | undefined;
2047
2047
  } | undefined;
2048
2048
  caption_addon?: {
2049
+ kind?: "none" | "poll" | "comment_prompt" | undefined;
2049
2050
  type?: "none" | "poll" | "comment_prompt" | undefined;
2050
2051
  options?: string[] | undefined;
2051
- kind?: "none" | "poll" | "comment_prompt" | undefined;
2052
2052
  extended_duration?: boolean | undefined;
2053
2053
  poll_attachment?: {
2054
2054
  options?: string[] | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "posterly-mcp-server",
3
- "version": "0.52.2",
3
+ "version": "0.53.2",
4
4
  "mcpName": "io.github.awpthorp/posterly",
5
5
  "description": "MCP server for posterly: schedule and publish social media posts across 18 platforms from any MCP client (Claude, ChatGPT, Cursor, Windsurf, Cline, and more)",
6
6
  "license": "MIT",
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.awpthorp/posterly",
4
4
  "title": "posterly",
5
5
  "description": "Validate, schedule, publish, and analyze social content across 18 platforms with posterly.",
6
- "version": "0.52.2",
6
+ "version": "0.53.2",
7
7
  "websiteUrl": "https://www.poster.ly/mcp",
8
8
  "repository": {
9
9
  "url": "https://github.com/awpthorp/posterly-mcp-server",
@@ -13,7 +13,7 @@
13
13
  {
14
14
  "registryType": "npm",
15
15
  "identifier": "posterly-mcp-server",
16
- "version": "0.52.2",
16
+ "version": "0.53.2",
17
17
  "transport": {
18
18
  "type": "stdio"
19
19
  },
@@ -63,6 +63,8 @@
63
63
  "pause_subscription",
64
64
  "resume_subscription",
65
65
  "downgrade_subscription",
66
+ "upgrade_subscription",
67
+ "manage_extra_account",
66
68
  "get_updates"
67
69
  ],
68
70
  "readOnlyTools": [
@@ -113,7 +115,9 @@
113
115
  "cancel_subscription",
114
116
  "manage_publishing_pause",
115
117
  "pause_subscription",
116
- "downgrade_subscription"
118
+ "downgrade_subscription",
119
+ "upgrade_subscription",
120
+ "manage_extra_account"
117
121
  ],
118
122
  "idempotentMutationTools": [
119
123
  "delete_api_key",
@@ -125,7 +129,9 @@
125
129
  "cancel_subscription",
126
130
  "pause_subscription",
127
131
  "resume_subscription",
128
- "downgrade_subscription"
132
+ "downgrade_subscription",
133
+ "upgrade_subscription",
134
+ "manage_extra_account"
129
135
  ],
130
136
  "openWorldTools": [
131
137
  "start_signup",
@@ -168,6 +174,8 @@
168
174
  "pause_subscription",
169
175
  "resume_subscription",
170
176
  "downgrade_subscription",
177
+ "upgrade_subscription",
178
+ "manage_extra_account",
171
179
  "delete_post",
172
180
  "submit_product_feedback"
173
181
  ]
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "billing": {
32
32
  "label": "Billing",
33
- "description": "Subscription changes."
33
+ "description": "Subscription changes and Agency extra accounts."
34
34
  },
35
35
  "signup": {
36
36
  "label": "Signup",
@@ -1981,6 +1981,105 @@
1981
1981
  "openWorld": true,
1982
1982
  "confirm": "confirm"
1983
1983
  },
1984
+ "upgrade_subscription": {
1985
+ "set": "billing",
1986
+ "label": "Upgrade subscription",
1987
+ "exception": {
1988
+ "category": "money",
1989
+ "reason": "Moving to a higher plan charges the saved card; read the plans and eligibility with get_subscription."
1990
+ },
1991
+ "selector": "params",
1992
+ "defaultMode": "upgrade",
1993
+ "actions": {
1994
+ "upgrade": {
1995
+ "label": "Upgrade to a higher plan",
1996
+ "destructive": true,
1997
+ "idempotent": true,
1998
+ "openWorld": true,
1999
+ "confirm": "preview",
2000
+ "nonce": true,
2001
+ "params": {
2002
+ "tier": {
2003
+ "type": "string",
2004
+ "enum": [
2005
+ "starter",
2006
+ "pro",
2007
+ "power_user",
2008
+ "agency"
2009
+ ],
2010
+ "required": true
2011
+ },
2012
+ "interval": {
2013
+ "type": "string",
2014
+ "enum": [
2015
+ "month",
2016
+ "year"
2017
+ ]
2018
+ },
2019
+ "workspace_id": {
2020
+ "type": "string"
2021
+ },
2022
+ "expected_current_tier": {
2023
+ "type": "string",
2024
+ "enum": [
2025
+ "starter",
2026
+ "pro",
2027
+ "power_user",
2028
+ "agency"
2029
+ ]
2030
+ },
2031
+ "expected_interval": {
2032
+ "type": "string",
2033
+ "enum": [
2034
+ "week",
2035
+ "month",
2036
+ "year"
2037
+ ]
2038
+ }
2039
+ }
2040
+ }
2041
+ }
2042
+ },
2043
+ "manage_extra_account": {
2044
+ "set": "billing",
2045
+ "label": "Buy or remove extra accounts",
2046
+ "exception": {
2047
+ "category": "money",
2048
+ "reason": "Buying extra accounts charges the saved card; read the state with get_subscription."
2049
+ },
2050
+ "selector": "action",
2051
+ "actions": {
2052
+ "set": {
2053
+ "label": "Set extra accounts",
2054
+ "destructive": true,
2055
+ "idempotent": true,
2056
+ "openWorld": true,
2057
+ "confirm": "preview",
2058
+ "nonce": true,
2059
+ "params": {
2060
+ "extra_accounts": {
2061
+ "type": "integer",
2062
+ "min": 0,
2063
+ "required": true
2064
+ },
2065
+ "workspace_id": {
2066
+ "type": "string"
2067
+ },
2068
+ "expected_current_extra_accounts": {
2069
+ "type": "integer",
2070
+ "min": 0
2071
+ },
2072
+ "expected_interval": {
2073
+ "type": "string",
2074
+ "enum": [
2075
+ "month",
2076
+ "year"
2077
+ ]
2078
+ }
2079
+ }
2080
+ }
2081
+ }
2082
+ },
1984
2083
  "get_updates": {
1985
2084
  "set": "core",
1986
2085
  "label": "Product updates",