@flexprice/mcp-server 2.1.18 → 2.1.20
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 +42 -21
- package/bin/mcp-server.js.map +10 -10
- package/bun.lock +15 -15
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/lib/retries.js +7 -0
- package/esm/lib/retries.js.map +1 -1
- package/esm/mcp-server/mcp-server.js +1 -1
- package/esm/mcp-server/server.js +1 -1
- package/esm/models/getusagerequest.d.ts +1 -0
- package/esm/models/getusagerequest.d.ts.map +1 -1
- package/esm/models/getusagerequest.js +2 -1
- package/esm/models/getusagerequest.js.map +1 -1
- package/esm/models/pointbucket.d.ts +7 -0
- package/esm/models/pointbucket.d.ts.map +1 -0
- package/esm/models/pointbucket.js +9 -0
- package/esm/models/pointbucket.js.map +1 -0
- package/esm/models/submodifycouponparams.d.ts +1 -2
- package/esm/models/submodifycouponparams.d.ts.map +1 -1
- package/esm/models/submodifycouponparams.js +2 -3
- package/esm/models/submodifycouponparams.js.map +1 -1
- package/esm/models/submodifytaxparams.d.ts +1 -1
- package/esm/models/submodifytaxparams.d.ts.map +1 -1
- package/esm/models/submodifytaxparams.js +1 -1
- package/esm/models/submodifytaxparams.js.map +1 -1
- package/esm/models/usageanalyticpoint.d.ts +2 -2
- package/esm/models/usageanalyticpoint.d.ts.map +1 -1
- package/esm/models/usageanalyticpoint.js +2 -2
- package/esm/models/usageanalyticpoint.js.map +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/retries.ts +8 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/getusagerequest.ts +5 -1
- package/src/models/pointbucket.ts +15 -0
- package/src/models/submodifycouponparams.ts +3 -7
- package/src/models/submodifytaxparams.ts +4 -4
- package/src/models/usageanalyticpoint.ts +4 -5
package/manifest.json
CHANGED
package/package.json
CHANGED
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.20",
|
|
73
|
+
genVersion: "2.911.0",
|
|
74
74
|
userAgent:
|
|
75
|
-
"speakeasy-sdk/mcp-typescript 2.1.
|
|
75
|
+
"speakeasy-sdk/mcp-typescript 2.1.20 2.911.0 1.0 @flexprice/mcp-server",
|
|
76
76
|
} as const;
|
package/src/lib/retries.ts
CHANGED
|
@@ -194,6 +194,14 @@ async function retryBackoff(
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
function retryIntervalFromResponse(res: Response): number {
|
|
197
|
+
const retryAfterMsVal = res.headers.get("retry-after-ms");
|
|
198
|
+
if (retryAfterMsVal) {
|
|
199
|
+
const parsedMs = Number(retryAfterMsVal);
|
|
200
|
+
if (Number.isFinite(parsedMs) && parsedMs >= 0) {
|
|
201
|
+
return parsedMs;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
197
205
|
const retryVal = res.headers.get("retry-after") || "";
|
|
198
206
|
if (!retryVal) {
|
|
199
207
|
return 0;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -18,6 +18,7 @@ export type GetUsageRequest = {
|
|
|
18
18
|
event_name: string;
|
|
19
19
|
external_customer_id?: string | undefined;
|
|
20
20
|
filters?: { [k: string]: Array<string> } | undefined;
|
|
21
|
+
group_by?: Array<string> | undefined;
|
|
21
22
|
group_by_property?: string | undefined;
|
|
22
23
|
multiplier?: string | undefined;
|
|
23
24
|
property_name?: string | undefined;
|
|
@@ -36,8 +37,11 @@ export const GetUsageRequest$zodSchema: z.ZodType<GetUsageRequest> = z.object({
|
|
|
36
37
|
event_name: z.string(),
|
|
37
38
|
external_customer_id: z.string().optional(),
|
|
38
39
|
filters: z.record(z.string(), z.array(z.string())).optional(),
|
|
40
|
+
group_by: z.array(z.string()).optional().describe(
|
|
41
|
+
"GroupBy lists the analytics group_by dimensions.\n - \"source\" — group by event source column\n - \"properties.X\" — group by JSON property X",
|
|
42
|
+
),
|
|
39
43
|
group_by_property: z.string().optional().describe(
|
|
40
|
-
"GroupByProperty is the property name in event.properties to group by before aggregating.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total.",
|
|
44
|
+
"GroupByProperty is the property name in event.properties to group by before aggregating.\nWhen set, aggregation is applied per unique value of this property within each bucket,\nthen the per-group results are summed to produce the bucket total.\n\nDeprecated: prefer GroupBy []string{\"properties.<X>\"} for parity with\nother analytics endpoints. ToUsageParams translates this field into\nGroupBy when GroupBy is otherwise empty.",
|
|
41
45
|
),
|
|
42
46
|
multiplier: z.string().optional(),
|
|
43
47
|
property_name: z.string().optional().describe(
|
|
@@ -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 PointBucket = {
|
|
8
|
+
bucket_id?: string | undefined;
|
|
9
|
+
price_id?: string | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const PointBucket$zodSchema: z.ZodType<PointBucket> = z.object({
|
|
13
|
+
bucket_id: z.string().optional(),
|
|
14
|
+
price_id: z.string().optional(),
|
|
15
|
+
});
|
|
@@ -10,9 +10,8 @@ import {
|
|
|
10
10
|
|
|
11
11
|
export type SubModifyCouponParams = {
|
|
12
12
|
action: SubModifyCouponAction;
|
|
13
|
-
|
|
13
|
+
coupon_association_id?: string | undefined;
|
|
14
14
|
coupon_code?: string | undefined;
|
|
15
|
-
effective_date?: string | undefined;
|
|
16
15
|
end_date?: string | undefined;
|
|
17
16
|
start_date?: string | undefined;
|
|
18
17
|
subscription_id?: string | undefined;
|
|
@@ -22,20 +21,17 @@ export type SubModifyCouponParams = {
|
|
|
22
21
|
export const SubModifyCouponParams$zodSchema: z.ZodType<SubModifyCouponParams> =
|
|
23
22
|
z.object({
|
|
24
23
|
action: SubModifyCouponAction$zodSchema,
|
|
25
|
-
|
|
24
|
+
coupon_association_id: z.string().optional().describe(
|
|
26
25
|
"Required when action=\"remove\". ID of the CouponAssociation to soft-delete.",
|
|
27
26
|
),
|
|
28
27
|
coupon_code: z.string().optional().describe(
|
|
29
28
|
"Required for action=\"add\". Coupon code of the coupon to attach.",
|
|
30
29
|
),
|
|
31
|
-
effective_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
32
|
-
"Optional. When to apply the change; defaults to now if omitted.",
|
|
33
|
-
),
|
|
34
30
|
end_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
35
31
|
"Optional. When the coupon association ends.",
|
|
36
32
|
),
|
|
37
33
|
start_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
38
|
-
"Optional. When the coupon association starts; defaults to
|
|
34
|
+
"Optional. When the coupon association starts; defaults to now.",
|
|
39
35
|
),
|
|
40
36
|
subscription_id: z.string().optional().describe(
|
|
41
37
|
"Optional. Apply at subscription level. Mutually exclusive with SubscriptionLineItemID.",
|
|
@@ -10,20 +10,20 @@ import {
|
|
|
10
10
|
|
|
11
11
|
export type SubModifyTaxParams = {
|
|
12
12
|
action: SubModifyTaxAction;
|
|
13
|
-
association_id?: string | undefined;
|
|
14
13
|
effective_date?: string | undefined;
|
|
14
|
+
tax_association_id?: string | undefined;
|
|
15
15
|
tax_rate_id?: string | undefined;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const SubModifyTaxParams$zodSchema: z.ZodType<SubModifyTaxParams> = z
|
|
19
19
|
.object({
|
|
20
20
|
action: SubModifyTaxAction$zodSchema,
|
|
21
|
-
association_id: z.string().optional().describe(
|
|
22
|
-
"Required when action=\"remove\". ID of the TaxAssociation to soft-delete.",
|
|
23
|
-
),
|
|
24
21
|
effective_date: z.iso.datetime({ offset: true }).optional().describe(
|
|
25
22
|
"Optional. When to apply the change; defaults to now if omitted.",
|
|
26
23
|
),
|
|
24
|
+
tax_association_id: z.string().optional().describe(
|
|
25
|
+
"Required when action=\"remove\". ID of the TaxAssociation to soft-delete.",
|
|
26
|
+
),
|
|
27
27
|
tax_rate_id: z.string().optional().describe(
|
|
28
28
|
"Required when action=\"add\". ID of the active tax rate to attach.",
|
|
29
29
|
),
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
+
import { PointBucket, PointBucket$zodSchema } from "./pointbucket.js";
|
|
6
7
|
|
|
7
8
|
export type UsageAnalyticPoint = {
|
|
8
|
-
|
|
9
|
-
bucket_price_id?: string | undefined;
|
|
9
|
+
buckets?: Array<PointBucket> | undefined;
|
|
10
10
|
computed_commitment_utilized_amount?: string | undefined;
|
|
11
11
|
computed_overage_amount?: string | undefined;
|
|
12
12
|
computed_true_up_amount?: string | undefined;
|
|
@@ -18,10 +18,9 @@ export type UsageAnalyticPoint = {
|
|
|
18
18
|
|
|
19
19
|
export const UsageAnalyticPoint$zodSchema: z.ZodType<UsageAnalyticPoint> = z
|
|
20
20
|
.object({
|
|
21
|
-
|
|
22
|
-
"
|
|
21
|
+
buckets: z.array(PointBucket$zodSchema).optional().describe(
|
|
22
|
+
"Buckets lists every commitment bucket this (possibly rolled-up) window\noverlaps — only populated when BreakdownBucket=true and the line item has\nCommitmentTimeBuckets. A coarse window can overlap more than one bucket, and\nonly partially, so this is a list. Empty when the window touches no bucket.\nIt is an informational HINT only: the point's single cost/computed_* totals\nmix all overlapped buckets and out-of-bucket time and CANNOT be split per\nbucket — read bucket_summaries for exact per-bucket cost.",
|
|
23
23
|
),
|
|
24
|
-
bucket_price_id: z.string().optional(),
|
|
25
24
|
computed_commitment_utilized_amount: z.string().optional().describe(
|
|
26
25
|
"Commitment breakdown (only populated for windowed commitments)",
|
|
27
26
|
),
|