@flexprice/mcp-server 2.1.2 → 2.1.4
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/bin/mcp-server.js +527 -162
- package/bin/mcp-server.js.map +41 -19
- package/bun.lock +14 -14
- package/esm/funcs/{plansPostPlansIdClone.d.ts → plansClonePlan.d.ts} +3 -3
- package/esm/funcs/plansClonePlan.d.ts.map +1 -0
- package/esm/funcs/{plansPostPlansIdClone.js → plansClonePlan.js} +5 -5
- package/esm/funcs/plansClonePlan.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/config.js.map +1 -1
- package/esm/mcp-server/cli/serve/command.js +1 -1
- package/esm/mcp-server/cli/serve/command.js.map +1 -1
- package/esm/mcp-server/cli/start/command.js +1 -1
- package/esm/mcp-server/cli/start/command.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +3 -3
- package/esm/mcp-server/server.js.map +1 -1
- package/esm/mcp-server/tools/plansClonePlan.d.ts +7 -0
- package/esm/mcp-server/tools/plansClonePlan.d.ts.map +1 -0
- package/esm/mcp-server/tools/{plansPostPlansIdClone.js → plansClonePlan.js} +7 -7
- package/esm/mcp-server/tools/plansClonePlan.js.map +1 -0
- package/esm/mcp-server/tools.js +9 -9
- package/esm/mcp-server/tools.js.map +1 -1
- package/esm/models/address.d.ts +11 -0
- package/esm/models/address.d.ts.map +1 -0
- package/esm/models/address.js +13 -0
- package/esm/models/address.js.map +1 -0
- package/esm/models/alertstate.d.ts +16 -0
- package/esm/models/alertstate.d.ts.map +1 -0
- package/esm/models/alertstate.js +17 -0
- package/esm/models/alertstate.js.map +1 -0
- package/esm/models/autotopup.d.ts +9 -0
- package/esm/models/autotopup.d.ts.map +1 -0
- package/esm/models/autotopup.js +11 -0
- package/esm/models/autotopup.js.map +1 -0
- package/esm/models/changedinvoice.d.ts +8 -2
- package/esm/models/changedinvoice.d.ts.map +1 -1
- package/esm/models/changedinvoice.js +8 -2
- package/esm/models/changedinvoice.js.map +1 -1
- package/esm/models/changedinvoiceaction.d.ts +18 -0
- package/esm/models/changedinvoiceaction.d.ts.map +1 -0
- package/esm/models/changedinvoiceaction.js +16 -0
- package/esm/models/changedinvoiceaction.js.map +1 -0
- package/esm/models/changedinvoicestatus.d.ts +18 -0
- package/esm/models/changedinvoicestatus.d.ts.map +1 -0
- package/esm/models/changedinvoicestatus.js +16 -0
- package/esm/models/changedinvoicestatus.js.map +1 -0
- package/esm/models/changedlineitem.d.ts +2 -1
- package/esm/models/changedlineitem.d.ts.map +1 -1
- package/esm/models/changedlineitem.js +2 -1
- package/esm/models/changedlineitem.js.map +1 -1
- package/esm/models/changedlineitemaction.d.ts +20 -0
- package/esm/models/changedlineitemaction.d.ts.map +1 -0
- package/esm/models/changedlineitemaction.js +18 -0
- package/esm/models/changedlineitemaction.js.map +1 -0
- package/esm/models/changedsubscription.d.ts +2 -1
- package/esm/models/changedsubscription.d.ts.map +1 -1
- package/esm/models/changedsubscription.js +2 -1
- package/esm/models/changedsubscription.js.map +1 -1
- package/esm/models/changedsubscriptionaction.d.ts +18 -0
- package/esm/models/changedsubscriptionaction.d.ts.map +1 -0
- package/esm/models/changedsubscriptionaction.js +16 -0
- package/esm/models/changedsubscriptionaction.js.map +1 -0
- package/esm/models/cloneplanop.d.ts +12 -0
- package/esm/models/cloneplanop.d.ts.map +1 -0
- package/esm/models/{postplansidcloneop.js → cloneplanop.js} +4 -3
- package/esm/models/cloneplanop.js.map +1 -0
- package/esm/models/createsubscriptionrequest.d.ts +1 -0
- package/esm/models/createsubscriptionrequest.d.ts.map +1 -1
- package/esm/models/createsubscriptionrequest.js +1 -0
- package/esm/models/createsubscriptionrequest.js.map +1 -1
- package/esm/models/creditbreakdown.d.ts +7 -0
- package/esm/models/creditbreakdown.d.ts.map +1 -0
- package/esm/models/creditbreakdown.js +9 -0
- package/esm/models/creditbreakdown.js.map +1 -0
- package/esm/models/tenantbillingdetails.d.ts +10 -0
- package/esm/models/tenantbillingdetails.d.ts.map +1 -0
- package/esm/models/tenantbillingdetails.js +13 -0
- package/esm/models/tenantbillingdetails.js.map +1 -0
- package/esm/models/tenantresponse.d.ts +15 -0
- package/esm/models/tenantresponse.d.ts.map +1 -0
- package/esm/models/tenantresponse.js +15 -0
- package/esm/models/tenantresponse.js.map +1 -0
- package/esm/models/transactionreason.d.ts +30 -0
- package/esm/models/transactionreason.d.ts.map +1 -0
- package/esm/models/transactionreason.js +31 -0
- package/esm/models/transactionreason.js.map +1 -0
- package/esm/models/transactionstatus.d.ts +14 -0
- package/esm/models/transactionstatus.d.ts.map +1 -0
- package/esm/models/transactionstatus.js +15 -0
- package/esm/models/transactionstatus.js.map +1 -0
- package/esm/models/transactiontype.d.ts +12 -0
- package/esm/models/transactiontype.d.ts.map +1 -0
- package/esm/models/transactiontype.js +13 -0
- package/esm/models/transactiontype.js.map +1 -0
- package/esm/models/userresponse.d.ts +12 -0
- package/esm/models/userresponse.d.ts.map +1 -0
- package/esm/models/userresponse.js +14 -0
- package/esm/models/userresponse.js.map +1 -0
- package/esm/models/usertype.d.ts +12 -0
- package/esm/models/usertype.d.ts.map +1 -0
- package/esm/models/usertype.js +13 -0
- package/esm/models/usertype.js.map +1 -0
- package/esm/models/walletconfig.d.ts +7 -0
- package/esm/models/walletconfig.d.ts.map +1 -0
- package/esm/models/walletconfig.js +10 -0
- package/esm/models/walletconfig.js.map +1 -0
- package/esm/models/walletconfigpricetype.d.ts +14 -0
- package/esm/models/walletconfigpricetype.d.ts.map +1 -0
- package/esm/models/walletconfigpricetype.js +15 -0
- package/esm/models/walletconfigpricetype.js.map +1 -0
- package/esm/models/walletresponse.d.ts +39 -0
- package/esm/models/walletresponse.d.ts.map +1 -0
- package/esm/models/walletresponse.js +39 -0
- package/esm/models/walletresponse.js.map +1 -0
- package/esm/models/walletstatus.d.ts +14 -0
- package/esm/models/walletstatus.d.ts.map +1 -0
- package/esm/models/walletstatus.js +15 -0
- package/esm/models/walletstatus.js.map +1 -0
- package/esm/models/wallettransactionresponse.d.ts +46 -0
- package/esm/models/wallettransactionresponse.d.ts.map +1 -0
- package/esm/models/wallettransactionresponse.js +46 -0
- package/esm/models/wallettransactionresponse.js.map +1 -0
- package/esm/models/wallettxreferencetype.d.ts +16 -0
- package/esm/models/wallettxreferencetype.d.ts.map +1 -0
- package/esm/models/wallettxreferencetype.js +17 -0
- package/esm/models/wallettxreferencetype.js.map +1 -0
- package/esm/models/wallettype.d.ts +12 -0
- package/esm/models/wallettype.d.ts.map +1 -0
- package/esm/models/wallettype.js +13 -0
- package/esm/models/wallettype.js.map +1 -0
- package/esm/tool-names.js +1 -1
- package/esm/tool-names.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/src/funcs/{plansPostPlansIdClone.ts → plansClonePlan.ts} +9 -9
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/cli/serve/command.ts +1 -1
- package/src/mcp-server/cli/start/command.ts +1 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -3
- package/src/mcp-server/tools/{plansPostPlansIdClone.ts → plansClonePlan.ts} +6 -6
- package/src/mcp-server/tools.ts +10 -10
- package/src/models/address.ts +23 -0
- package/src/models/alertstate.ts +21 -0
- package/src/models/autotopup.ts +19 -0
- package/src/models/changedinvoice.ts +28 -4
- package/src/models/changedinvoiceaction.ts +23 -0
- package/src/models/changedinvoicestatus.ts +25 -0
- package/src/models/changedlineitem.ts +7 -3
- package/src/models/changedlineitemaction.ts +25 -0
- package/src/models/changedsubscription.ts +8 -2
- package/src/models/changedsubscriptionaction.ts +25 -0
- package/src/models/{postplansidcloneop.ts → cloneplanop.ts} +9 -10
- package/src/models/createsubscriptionrequest.ts +4 -0
- package/src/models/creditbreakdown.ts +15 -0
- package/src/models/tenantbillingdetails.ts +21 -0
- package/src/models/tenantresponse.ts +29 -0
- package/src/models/transactionreason.ts +35 -0
- package/src/models/transactionstatus.ts +19 -0
- package/src/models/transactiontype.ts +17 -0
- package/src/models/userresponse.ts +23 -0
- package/src/models/usertype.ts +17 -0
- package/src/models/walletconfig.ts +20 -0
- package/src/models/walletconfigpricetype.ts +19 -0
- package/src/models/walletresponse.ts +74 -0
- package/src/models/walletstatus.ts +19 -0
- package/src/models/wallettransactionresponse.ts +104 -0
- package/src/models/wallettxreferencetype.ts +21 -0
- package/src/models/wallettype.ts +17 -0
- package/src/tool-names.ts +1 -1
- package/esm/funcs/plansPostPlansIdClone.d.ts.map +0 -1
- package/esm/funcs/plansPostPlansIdClone.js.map +0 -1
- package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts +0 -7
- package/esm/mcp-server/tools/plansPostPlansIdClone.d.ts.map +0 -1
- package/esm/mcp-server/tools/plansPostPlansIdClone.js.map +0 -1
- package/esm/models/postplansidcloneop.d.ts +0 -12
- package/esm/models/postplansidcloneop.d.ts.map +0 -1
- package/esm/models/postplansidcloneop.js.map +0 -1
package/manifest.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"sensitive": true
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
"version": "2.1.
|
|
51
|
+
"version": "2.1.4",
|
|
52
52
|
"tools": [
|
|
53
53
|
{
|
|
54
54
|
"name": "update-customer",
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
"description": "Delete plan\n\nUse when retiring a plan (e.g. end-of-life). Existing subscriptions may be affected. Returns 200 with success message."
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
|
-
"name": "
|
|
202
|
+
"name": "clone-plan",
|
|
203
203
|
"description": "Clone a plan\n\nClone an existing plan, copying its active prices, published entitlements, and published credit grants"
|
|
204
204
|
},
|
|
205
205
|
{
|
package/package.json
CHANGED
|
@@ -9,6 +9,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
9
9
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ClonePlanRequestRequest,
|
|
14
|
+
ClonePlanRequestRequest$zodSchema,
|
|
15
|
+
} from "../models/cloneplanop.js";
|
|
12
16
|
import { APIError } from "../models/errors/apierror.js";
|
|
13
17
|
import {
|
|
14
18
|
ConnectionError,
|
|
@@ -18,10 +22,6 @@ import {
|
|
|
18
22
|
UnexpectedClientError,
|
|
19
23
|
} from "../models/errors/httpclienterrors.js";
|
|
20
24
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
-
import {
|
|
22
|
-
PostPlansIdCloneRequest,
|
|
23
|
-
PostPlansIdCloneRequest$zodSchema,
|
|
24
|
-
} from "../models/postplansidcloneop.js";
|
|
25
25
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
26
|
import { Result } from "../types/fp.js";
|
|
27
27
|
|
|
@@ -31,9 +31,9 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
* @remarks
|
|
32
32
|
* Clone an existing plan, copying its active prices, published entitlements, and published credit grants
|
|
33
33
|
*/
|
|
34
|
-
export function
|
|
34
|
+
export function plansClonePlan(
|
|
35
35
|
client$: FlexpriceCore,
|
|
36
|
-
request:
|
|
36
|
+
request: ClonePlanRequestRequest,
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
@@ -56,7 +56,7 @@ export function plansPostPlansIdClone(
|
|
|
56
56
|
|
|
57
57
|
async function $do(
|
|
58
58
|
client$: FlexpriceCore,
|
|
59
|
-
request:
|
|
59
|
+
request: ClonePlanRequestRequest,
|
|
60
60
|
options?: RequestOptions,
|
|
61
61
|
): Promise<
|
|
62
62
|
[
|
|
@@ -75,7 +75,7 @@ async function $do(
|
|
|
75
75
|
> {
|
|
76
76
|
const parsed$ = safeParse(
|
|
77
77
|
request,
|
|
78
|
-
(value$) =>
|
|
78
|
+
(value$) => ClonePlanRequestRequest$zodSchema.parse(value$),
|
|
79
79
|
"Input validation failed",
|
|
80
80
|
);
|
|
81
81
|
if (!parsed$.ok) {
|
|
@@ -104,7 +104,7 @@ async function $do(
|
|
|
104
104
|
const context = {
|
|
105
105
|
options: client$._options,
|
|
106
106
|
baseURL: options?.serverURL ?? client$._baseURL ?? "",
|
|
107
|
-
operationID: "
|
|
107
|
+
operationID: "clonePlan",
|
|
108
108
|
oAuth2Scopes: null,
|
|
109
109
|
resolvedSecurity: requestSecurity,
|
|
110
110
|
securitySource: client$._options.security,
|
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.
|
|
73
|
-
genVersion: "2.
|
|
72
|
+
sdkVersion: "2.1.4",
|
|
73
|
+
genVersion: "2.881.0",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/mcp-typescript 2.1.
|
|
75
|
+
"speakeasy-sdk/mcp-typescript 2.1.4 2.881.0 1.0 @flexprice/mcp-server",
|
|
76
76
|
} as const;
|
|
@@ -40,7 +40,7 @@ export const serveCommand = buildCommand({
|
|
|
40
40
|
mode: {
|
|
41
41
|
kind: "enum",
|
|
42
42
|
brief:
|
|
43
|
-
"Server mode (dynamic: expose list_tools,
|
|
43
|
+
"Server mode (dynamic: expose list_tools, describe_tool_input, and execute_tool instead of individual tools)",
|
|
44
44
|
values: ["dynamic"],
|
|
45
45
|
optional: true,
|
|
46
46
|
},
|
|
@@ -40,7 +40,7 @@ export const startCommand = buildCommand({
|
|
|
40
40
|
mode: {
|
|
41
41
|
kind: "enum",
|
|
42
42
|
brief:
|
|
43
|
-
"Server mode (dynamic: expose list_tools,
|
|
43
|
+
"Server mode (dynamic: expose list_tools, describe_tool_input, and execute_tool instead of individual tools)",
|
|
44
44
|
values: ["dynamic"],
|
|
45
45
|
optional: true,
|
|
46
46
|
},
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -49,10 +49,10 @@ import { tool$invoicesTriggerInvoiceCommsWebhook } from "./tools/invoicesTrigger
|
|
|
49
49
|
import { tool$invoicesUpdateInvoice } from "./tools/invoicesUpdateInvoice.js";
|
|
50
50
|
import { tool$invoicesUpdateInvoicePaymentStatus } from "./tools/invoicesUpdateInvoicePaymentStatus.js";
|
|
51
51
|
import { tool$invoicesVoidInvoice } from "./tools/invoicesVoidInvoice.js";
|
|
52
|
+
import { tool$plansClonePlan } from "./tools/plansClonePlan.js";
|
|
52
53
|
import { tool$plansCreatePlan } from "./tools/plansCreatePlan.js";
|
|
53
54
|
import { tool$plansDeletePlan } from "./tools/plansDeletePlan.js";
|
|
54
55
|
import { tool$plansGetPlan } from "./tools/plansGetPlan.js";
|
|
55
|
-
import { tool$plansPostPlansIdClone } from "./tools/plansPostPlansIdClone.js";
|
|
56
56
|
import { tool$plansQueryPlan } from "./tools/plansQueryPlan.js";
|
|
57
57
|
import { tool$plansSyncPlanPrices } from "./tools/plansSyncPlanPrices.js";
|
|
58
58
|
import { tool$plansUpdatePlan } from "./tools/plansUpdatePlan.js";
|
|
@@ -104,7 +104,7 @@ export function createMCPServer(deps: {
|
|
|
104
104
|
}) {
|
|
105
105
|
const server = new McpServer({
|
|
106
106
|
name: "Flexprice",
|
|
107
|
-
version: "2.1.
|
|
107
|
+
version: "2.1.4",
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
const getClient = deps.getSDK || (() =>
|
|
@@ -186,7 +186,7 @@ export function createMCPServer(deps: {
|
|
|
186
186
|
tool(tool$plansGetPlan);
|
|
187
187
|
tool(tool$plansUpdatePlan);
|
|
188
188
|
tool(tool$plansDeletePlan);
|
|
189
|
-
tool(tool$
|
|
189
|
+
tool(tool$plansClonePlan);
|
|
190
190
|
tool(tool$plansSyncPlanPrices);
|
|
191
191
|
tool(tool$pricesCreatePrice);
|
|
192
192
|
tool(tool$pricesCreatePricesBulk);
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { plansClonePlan } from "../../funcs/plansClonePlan.js";
|
|
6
|
+
import { ClonePlanRequestRequest$zodSchema } from "../../models/cloneplanop.js";
|
|
7
7
|
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
|
-
request:
|
|
10
|
+
request: ClonePlanRequestRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$
|
|
14
|
-
name: "
|
|
13
|
+
export const tool$plansClonePlan: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "clone-plan",
|
|
15
15
|
description: `Clone a plan
|
|
16
16
|
|
|
17
17
|
Clone an existing plan, copying its active prices, published entitlements, and published credit grants`,
|
|
@@ -25,7 +25,7 @@ Clone an existing plan, copying its active prices, published entitlements, and p
|
|
|
25
25
|
},
|
|
26
26
|
args,
|
|
27
27
|
tool: async (client, args, ctx) => {
|
|
28
|
-
const [result] = await
|
|
28
|
+
const [result] = await plansClonePlan(
|
|
29
29
|
client,
|
|
30
30
|
args.request,
|
|
31
31
|
{ fetchOptions: { signal: ctx.signal } },
|
package/src/mcp-server/tools.ts
CHANGED
|
@@ -358,16 +358,16 @@ export function registerDynamicTools(
|
|
|
358
358
|
|
|
359
359
|
return { content: [{ type: "text", text: parts.join("\n\n") }] };
|
|
360
360
|
});
|
|
361
|
-
logger.debug("Registered dynamic meta-tool", { name: "
|
|
361
|
+
logger.debug("Registered dynamic meta-tool", { name: "describe_tool_input" });
|
|
362
362
|
|
|
363
363
|
// 3. execute_tool
|
|
364
364
|
server.registerTool("execute_tool", {
|
|
365
365
|
description:
|
|
366
|
-
"Execute a tool by name with
|
|
366
|
+
"Execute a tool by name with its arguments. If executing a given tool for the first time, it is recommended to call describe_tool_input first to understand the expected `arguments` shape.",
|
|
367
367
|
inputSchema: {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"
|
|
368
|
+
name: z.string().describe("The name of the tool to execute"),
|
|
369
|
+
arguments: z.looseObject({}).optional().describe(
|
|
370
|
+
"Arguments for the target tool as a JSON object, matching the schema returned by describe_tool_input.",
|
|
371
371
|
),
|
|
372
372
|
},
|
|
373
373
|
annotations: {
|
|
@@ -378,17 +378,17 @@ export function registerDynamicTools(
|
|
|
378
378
|
openWorldHint: true,
|
|
379
379
|
},
|
|
380
380
|
}, async (args, ctx) => {
|
|
381
|
-
const def = toolMap.get(args.
|
|
381
|
+
const def = toolMap.get(args.name);
|
|
382
382
|
if (!def) {
|
|
383
383
|
return {
|
|
384
|
-
content: [{ type: "text", text: `Unknown tool: ${args.
|
|
384
|
+
content: [{ type: "text", text: `Unknown tool: ${args.name}` }],
|
|
385
385
|
isError: true,
|
|
386
386
|
};
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
let validatedInput: Record<string, unknown> = {};
|
|
390
390
|
if (def.args) {
|
|
391
|
-
const vres = z.object(def.args).safeParse(args.
|
|
391
|
+
const vres = z.object(def.args).safeParse(args.arguments ?? {});
|
|
392
392
|
if (vres.success) {
|
|
393
393
|
validatedInput = vres.data;
|
|
394
394
|
} else {
|
|
@@ -398,7 +398,7 @@ export function registerDynamicTools(
|
|
|
398
398
|
content: [{
|
|
399
399
|
type: "text",
|
|
400
400
|
text:
|
|
401
|
-
`Invalid input for tool ${args.
|
|
401
|
+
`Invalid input for tool ${args.name}:\n<issues>\n${issues}\n</issues>`,
|
|
402
402
|
}],
|
|
403
403
|
isError: true,
|
|
404
404
|
};
|
|
@@ -416,7 +416,7 @@ export function registerDynamicTools(
|
|
|
416
416
|
return {
|
|
417
417
|
content: [{
|
|
418
418
|
type: "text",
|
|
419
|
-
text: `Error executing tool ${args.
|
|
419
|
+
text: `Error executing tool ${args.name}: ${message}`,
|
|
420
420
|
}],
|
|
421
421
|
isError: true,
|
|
422
422
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type Address = {
|
|
8
|
+
address_city?: string | undefined;
|
|
9
|
+
address_country?: string | undefined;
|
|
10
|
+
address_line1?: string | undefined;
|
|
11
|
+
address_line2?: string | undefined;
|
|
12
|
+
address_postal_code?: string | undefined;
|
|
13
|
+
address_state?: string | undefined;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const Address$zodSchema: z.ZodType<Address> = z.object({
|
|
17
|
+
address_city: z.string().optional(),
|
|
18
|
+
address_country: z.string().optional(),
|
|
19
|
+
address_line1: z.string().optional(),
|
|
20
|
+
address_line2: z.string().optional(),
|
|
21
|
+
address_postal_code: z.string().optional(),
|
|
22
|
+
address_state: z.string().optional(),
|
|
23
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
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 AlertState = {
|
|
9
|
+
Ok: "ok",
|
|
10
|
+
Info: "info",
|
|
11
|
+
Warning: "warning",
|
|
12
|
+
InAlarm: "in_alarm",
|
|
13
|
+
} as const;
|
|
14
|
+
export type AlertState = ClosedEnum<typeof AlertState>;
|
|
15
|
+
|
|
16
|
+
export const AlertState$zodSchema = z.enum([
|
|
17
|
+
"ok",
|
|
18
|
+
"info",
|
|
19
|
+
"warning",
|
|
20
|
+
"in_alarm",
|
|
21
|
+
]);
|
|
@@ -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
|
+
|
|
7
|
+
export type AutoTopup = {
|
|
8
|
+
amount?: number | undefined;
|
|
9
|
+
enabled?: boolean | undefined;
|
|
10
|
+
invoicing?: boolean | undefined;
|
|
11
|
+
threshold?: number | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const AutoTopup$zodSchema: z.ZodType<AutoTopup> = z.object({
|
|
15
|
+
amount: z.number().optional(),
|
|
16
|
+
enabled: z.boolean().optional(),
|
|
17
|
+
invoicing: z.boolean().optional(),
|
|
18
|
+
threshold: z.number().optional(),
|
|
19
|
+
});
|
|
@@ -3,15 +3,39 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
ChangedInvoiceAction,
|
|
8
|
+
ChangedInvoiceAction$zodSchema,
|
|
9
|
+
} from "./changedinvoiceaction.js";
|
|
10
|
+
import {
|
|
11
|
+
ChangedInvoiceStatus,
|
|
12
|
+
ChangedInvoiceStatus$zodSchema,
|
|
13
|
+
} from "./changedinvoicestatus.js";
|
|
14
|
+
import {
|
|
15
|
+
InvoiceResponse,
|
|
16
|
+
InvoiceResponse$zodSchema,
|
|
17
|
+
} from "./invoiceresponse.js";
|
|
18
|
+
import {
|
|
19
|
+
WalletTransactionResponse,
|
|
20
|
+
WalletTransactionResponse$zodSchema,
|
|
21
|
+
} from "./wallettransactionresponse.js";
|
|
6
22
|
|
|
7
23
|
export type ChangedInvoice = {
|
|
8
|
-
action?:
|
|
24
|
+
action?: ChangedInvoiceAction | undefined;
|
|
9
25
|
id?: string | undefined;
|
|
10
|
-
|
|
26
|
+
invoice?: InvoiceResponse | undefined;
|
|
27
|
+
status?: ChangedInvoiceStatus | undefined;
|
|
28
|
+
wallet_transaction?: WalletTransactionResponse | undefined;
|
|
11
29
|
};
|
|
12
30
|
|
|
13
31
|
export const ChangedInvoice$zodSchema: z.ZodType<ChangedInvoice> = z.object({
|
|
14
|
-
action:
|
|
32
|
+
action: ChangedInvoiceAction$zodSchema.optional().describe(
|
|
33
|
+
"created (proration invoice) | wallet_credit (downgrade credit)",
|
|
34
|
+
),
|
|
15
35
|
id: z.string().optional(),
|
|
16
|
-
|
|
36
|
+
invoice: InvoiceResponse$zodSchema.optional(),
|
|
37
|
+
status: ChangedInvoiceStatus$zodSchema.optional().describe(
|
|
38
|
+
"preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED",
|
|
39
|
+
),
|
|
40
|
+
wallet_transaction: WalletTransactionResponse$zodSchema.optional(),
|
|
17
41
|
});
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* created (proration invoice) | wallet_credit (downgrade credit)
|
|
10
|
+
*/
|
|
11
|
+
export const ChangedInvoiceAction = {
|
|
12
|
+
Created: "created",
|
|
13
|
+
WalletCredit: "wallet_credit",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* created (proration invoice) | wallet_credit (downgrade credit)
|
|
17
|
+
*/
|
|
18
|
+
export type ChangedInvoiceAction = ClosedEnum<typeof ChangedInvoiceAction>;
|
|
19
|
+
|
|
20
|
+
export const ChangedInvoiceAction$zodSchema = z.enum([
|
|
21
|
+
"created",
|
|
22
|
+
"wallet_credit",
|
|
23
|
+
]).describe("created (proration invoice) | wallet_credit (downgrade credit)");
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED
|
|
10
|
+
*/
|
|
11
|
+
export const ChangedInvoiceStatus = {
|
|
12
|
+
Preview: "preview",
|
|
13
|
+
Issued: "issued",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED
|
|
17
|
+
*/
|
|
18
|
+
export type ChangedInvoiceStatus = ClosedEnum<typeof ChangedInvoiceStatus>;
|
|
19
|
+
|
|
20
|
+
export const ChangedInvoiceStatus$zodSchema = z.enum([
|
|
21
|
+
"preview",
|
|
22
|
+
"issued",
|
|
23
|
+
]).describe(
|
|
24
|
+
"preview | issued | INITIATED | PENDING | PROCESSING | SUCCEEDED | OVERPAID | FAILED | REFUNDED | PARTIALLY_REFUNDED",
|
|
25
|
+
);
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
ChangedLineItemAction,
|
|
8
|
+
ChangedLineItemAction$zodSchema,
|
|
9
|
+
} from "./changedlineitemaction.js";
|
|
6
10
|
|
|
7
11
|
export type ChangedLineItem = {
|
|
8
|
-
change_action?:
|
|
12
|
+
change_action?: ChangedLineItemAction | undefined;
|
|
9
13
|
end_date?: string | undefined;
|
|
10
14
|
id?: string | undefined;
|
|
11
15
|
price_id?: string | undefined;
|
|
@@ -14,8 +18,8 @@ export type ChangedLineItem = {
|
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
export const ChangedLineItem$zodSchema: z.ZodType<ChangedLineItem> = z.object({
|
|
17
|
-
change_action:
|
|
18
|
-
"
|
|
21
|
+
change_action: ChangedLineItemAction$zodSchema.optional().describe(
|
|
22
|
+
"created | updated | ended",
|
|
19
23
|
),
|
|
20
24
|
end_date: z.iso.datetime({ offset: true }).optional(),
|
|
21
25
|
id: z.string().optional(),
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* created | updated | ended
|
|
10
|
+
*/
|
|
11
|
+
export const ChangedLineItemAction = {
|
|
12
|
+
Created: "created",
|
|
13
|
+
Updated: "updated",
|
|
14
|
+
Ended: "ended",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* created | updated | ended
|
|
18
|
+
*/
|
|
19
|
+
export type ChangedLineItemAction = ClosedEnum<typeof ChangedLineItemAction>;
|
|
20
|
+
|
|
21
|
+
export const ChangedLineItemAction$zodSchema = z.enum([
|
|
22
|
+
"created",
|
|
23
|
+
"updated",
|
|
24
|
+
"ended",
|
|
25
|
+
]).describe("created | updated | ended");
|
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
ChangedSubscriptionAction,
|
|
8
|
+
ChangedSubscriptionAction$zodSchema,
|
|
9
|
+
} from "./changedsubscriptionaction.js";
|
|
6
10
|
import {
|
|
7
11
|
SubscriptionStatus,
|
|
8
12
|
SubscriptionStatus$zodSchema,
|
|
9
13
|
} from "./subscriptionstatus.js";
|
|
10
14
|
|
|
11
15
|
export type ChangedSubscription = {
|
|
12
|
-
action?:
|
|
16
|
+
action?: ChangedSubscriptionAction | undefined;
|
|
13
17
|
id?: string | undefined;
|
|
14
18
|
status?: SubscriptionStatus | undefined;
|
|
15
19
|
};
|
|
16
20
|
|
|
17
21
|
export const ChangedSubscription$zodSchema: z.ZodType<ChangedSubscription> = z
|
|
18
22
|
.object({
|
|
19
|
-
action:
|
|
23
|
+
action: ChangedSubscriptionAction$zodSchema.optional().describe(
|
|
24
|
+
"created | updated",
|
|
25
|
+
),
|
|
20
26
|
id: z.string().optional(),
|
|
21
27
|
status: SubscriptionStatus$zodSchema.optional(),
|
|
22
28
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
9
|
+
* created | updated
|
|
10
|
+
*/
|
|
11
|
+
export const ChangedSubscriptionAction = {
|
|
12
|
+
Created: "created",
|
|
13
|
+
Updated: "updated",
|
|
14
|
+
} as const;
|
|
15
|
+
/**
|
|
16
|
+
* created | updated
|
|
17
|
+
*/
|
|
18
|
+
export type ChangedSubscriptionAction = ClosedEnum<
|
|
19
|
+
typeof ChangedSubscriptionAction
|
|
20
|
+
>;
|
|
21
|
+
|
|
22
|
+
export const ChangedSubscriptionAction$zodSchema = z.enum([
|
|
23
|
+
"created",
|
|
24
|
+
"updated",
|
|
25
|
+
]).describe("created | updated");
|
|
@@ -10,20 +10,19 @@ import {
|
|
|
10
10
|
import { ErrorResponse, ErrorResponse$zodSchema } from "./errorresponse.js";
|
|
11
11
|
import { PlanResponse, PlanResponse$zodSchema } from "./planresponse.js";
|
|
12
12
|
|
|
13
|
-
export type
|
|
13
|
+
export type ClonePlanRequestRequest = { id: string; body: ClonePlanRequest };
|
|
14
14
|
|
|
15
|
-
export const
|
|
16
|
-
|
|
15
|
+
export const ClonePlanRequestRequest$zodSchema: z.ZodType<
|
|
16
|
+
ClonePlanRequestRequest
|
|
17
17
|
> = z.object({
|
|
18
18
|
body: ClonePlanRequest$zodSchema.describe("Clone configuration"),
|
|
19
19
|
id: z.string().describe("Source Plan ID"),
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
export type
|
|
22
|
+
export type ClonePlanResponse = PlanResponse | ErrorResponse;
|
|
23
23
|
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
]);
|
|
24
|
+
export const ClonePlanResponse$zodSchema: z.ZodType<ClonePlanResponse> = z
|
|
25
|
+
.union([
|
|
26
|
+
PlanResponse$zodSchema,
|
|
27
|
+
ErrorResponse$zodSchema,
|
|
28
|
+
]);
|
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
|
|
62
62
|
export type CreateSubscriptionRequest = {
|
|
63
63
|
addons?: Array<AddAddonToSubscriptionRequest> | undefined;
|
|
64
|
+
billing_anchor?: string | undefined;
|
|
64
65
|
billing_cycle?: BillingCycle | undefined;
|
|
65
66
|
billing_period: BillingPeriod;
|
|
66
67
|
billing_period_count?: number | undefined;
|
|
@@ -103,6 +104,9 @@ export const CreateSubscriptionRequest$zodSchema: z.ZodType<
|
|
|
103
104
|
addons: z.array(AddAddonToSubscriptionRequest$zodSchema).optional().describe(
|
|
104
105
|
"Addons represents addons to be added to the subscription during creation",
|
|
105
106
|
),
|
|
107
|
+
billing_anchor: z.iso.datetime({ offset: true }).optional().describe(
|
|
108
|
+
"BillingAnchor overrides the derived billing anchor when billing_cycle is anniversary.\nFor monthly billing, the day-of-month (and time-of-day) define cycle boundaries: if start_date\nis before that day in the month, the first billing period ends on the next occurrence of that\nday in the same month (a shorter first period); subsequent periods follow the usual interval.",
|
|
109
|
+
),
|
|
106
110
|
billing_cycle: BillingCycle$zodSchema.optional(),
|
|
107
111
|
billing_period: BillingPeriod$zodSchema,
|
|
108
112
|
billing_period_count: z.int().optional(),
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
|
|
7
|
+
export type CreditBreakdown = {
|
|
8
|
+
free?: string | undefined;
|
|
9
|
+
purchased?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const CreditBreakdown$zodSchema: z.ZodType<CreditBreakdown> = z.object({
|
|
13
|
+
free: z.string().optional(),
|
|
14
|
+
purchased: z.string().optional(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { Address, Address$zodSchema } from "./address.js";
|
|
7
|
+
|
|
8
|
+
export type TenantBillingDetails = {
|
|
9
|
+
address?: Address | undefined;
|
|
10
|
+
email?: string | undefined;
|
|
11
|
+
help_email?: string | undefined;
|
|
12
|
+
phone?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const TenantBillingDetails$zodSchema: z.ZodType<TenantBillingDetails> = z
|
|
16
|
+
.object({
|
|
17
|
+
address: Address$zodSchema.optional(),
|
|
18
|
+
email: z.string().optional(),
|
|
19
|
+
help_email: z.string().optional(),
|
|
20
|
+
phone: z.string().optional(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import {
|
|
7
|
+
TenantBillingDetails,
|
|
8
|
+
TenantBillingDetails$zodSchema,
|
|
9
|
+
} from "./tenantbillingdetails.js";
|
|
10
|
+
|
|
11
|
+
export type TenantResponse = {
|
|
12
|
+
billing_details?: TenantBillingDetails | undefined;
|
|
13
|
+
created_at?: string | undefined;
|
|
14
|
+
id?: string | undefined;
|
|
15
|
+
metadata?: { [k: string]: string } | undefined;
|
|
16
|
+
name?: string | undefined;
|
|
17
|
+
status?: string | undefined;
|
|
18
|
+
updated_at?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const TenantResponse$zodSchema: z.ZodType<TenantResponse> = z.object({
|
|
22
|
+
billing_details: TenantBillingDetails$zodSchema.optional(),
|
|
23
|
+
created_at: z.iso.datetime({ offset: true }).optional(),
|
|
24
|
+
id: z.string().optional(),
|
|
25
|
+
metadata: z.record(z.string(), z.string()).optional(),
|
|
26
|
+
name: z.string().optional(),
|
|
27
|
+
status: z.string().optional(),
|
|
28
|
+
updated_at: z.iso.datetime({ offset: true }).optional(),
|
|
29
|
+
});
|