@flexprice/sdk 2.1.1 → 2.1.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.
- package/docs/sdk/models/billing-cadence.md +1 -3
- package/docs/sdk/models/billing-period.md +1 -1
- package/docs/sdk/models/changed-invoice.md +17 -0
- package/docs/sdk/models/changed-line-item.md +20 -0
- package/docs/sdk/models/changed-resources.md +17 -0
- package/docs/sdk/models/changed-subscription.md +17 -0
- package/docs/sdk/models/create-price-request.md +7 -9
- package/docs/sdk/models/create-subscription-request.md +2 -4
- package/docs/sdk/models/execute-subscription-change-request.md +2 -2
- package/docs/sdk/models/execute-subscription-modify-request-request.md +21 -0
- package/docs/sdk/models/execute-subscription-modify-request.md +6 -6
- package/docs/sdk/models/invoice-filter.md +1 -0
- package/docs/sdk/models/invoice-response.md +1 -0
- package/docs/sdk/models/line-item-quantity-change.md +20 -0
- package/docs/sdk/models/meter-usage-analytics-request.md +30 -0
- package/docs/sdk/models/meter-usage-analytics-response.md +30 -0
- package/docs/sdk/models/meter-usage-point.md +21 -0
- package/docs/sdk/models/meter-usage-query-request.md +28 -0
- package/docs/sdk/models/meter-usage-query-response.md +30 -0
- package/docs/sdk/models/preview-subscription-change-request.md +2 -2
- package/docs/sdk/models/preview-subscription-modify-request.md +21 -0
- package/docs/sdk/models/secret-provider.md +2 -2
- package/docs/sdk/models/{execute-subscription-inheritance-request.md → sub-modify-inheritance-request.md} +3 -3
- package/docs/sdk/models/sub-modify-quantity-change-request.md +22 -0
- package/docs/sdk/models/subscription-change-request.md +1 -1
- package/docs/sdk/models/subscription-modify-response.md +25 -0
- package/docs/sdk/models/subscription-modify-type.md +15 -0
- package/docs/sdk/models/subscription-phase-create-request.md +9 -8
- package/docs/sdk/models/subscription-price-create-request.md +3 -5
- package/docs/sdk/models/window-size.md +2 -2
- package/docs/sdks/invoices/README.md +76 -0
- package/docs/sdks/meterusage/README.md +182 -0
- package/docs/sdks/prices/README.md +12 -14
- package/docs/sdks/subscriptions/README.md +101 -22
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.d.ts +17 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.d.ts.map +1 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.js +82 -0
- package/esm/funcs/invoices-get-meter-usage-preview-invoice.js.map +1 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.d.ts +17 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.d.ts.map +1 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.js +82 -0
- package/esm/funcs/meter-usage-get-meter-usage-analytics.js.map +1 -0
- package/esm/funcs/meter-usage-query-meter-usage.d.ts +17 -0
- package/esm/funcs/meter-usage-query-meter-usage.d.ts.map +1 -0
- package/esm/funcs/meter-usage-query-meter-usage.js +82 -0
- package/esm/funcs/meter-usage-query-meter-usage.js.map +1 -0
- package/esm/funcs/subscriptions-execute-subscription-modify.d.ts +3 -3
- package/esm/funcs/subscriptions-execute-subscription-modify.d.ts.map +1 -1
- package/esm/funcs/subscriptions-execute-subscription-modify.js +4 -4
- package/esm/funcs/subscriptions-execute-subscription-modify.js.map +1 -1
- package/esm/funcs/subscriptions-preview-subscription-modify.d.ts +17 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.d.ts.map +1 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.js +92 -0
- package/esm/funcs/subscriptions-preview-subscription-modify.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/lib/encodings.d.ts +1 -0
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +6 -0
- package/esm/lib/encodings.js.map +1 -1
- package/esm/sdk/invoices.d.ts +7 -0
- package/esm/sdk/invoices.d.ts.map +1 -1
- package/esm/sdk/invoices.js +10 -0
- package/esm/sdk/invoices.js.map +1 -1
- package/esm/sdk/meter-usage.d.ts +19 -0
- package/esm/sdk/meter-usage.d.ts.map +1 -0
- package/esm/sdk/meter-usage.js +28 -0
- package/esm/sdk/meter-usage.js.map +1 -0
- package/esm/sdk/models/billing-cadence.d.ts +4 -5
- package/esm/sdk/models/billing-cadence.d.ts.map +1 -1
- package/esm/sdk/models/billing-cadence.js +3 -4
- package/esm/sdk/models/billing-cadence.js.map +1 -1
- package/esm/sdk/models/billing-period.d.ts +1 -0
- package/esm/sdk/models/billing-period.d.ts.map +1 -1
- package/esm/sdk/models/billing-period.js +1 -0
- package/esm/sdk/models/billing-period.js.map +1 -1
- package/esm/sdk/models/changed-invoice.d.ts +15 -0
- package/esm/sdk/models/changed-invoice.d.ts.map +1 -0
- package/esm/sdk/models/changed-invoice.js +16 -0
- package/esm/sdk/models/changed-invoice.js.map +1 -0
- package/esm/sdk/models/changed-line-item.d.ts +18 -0
- package/esm/sdk/models/changed-line-item.d.ts.map +1 -0
- package/esm/sdk/models/changed-line-item.js +27 -0
- package/esm/sdk/models/changed-line-item.js.map +1 -0
- package/esm/sdk/models/changed-resources.d.ts +15 -0
- package/esm/sdk/models/changed-resources.d.ts.map +1 -0
- package/esm/sdk/models/changed-resources.js +24 -0
- package/esm/sdk/models/changed-resources.js.map +1 -0
- package/esm/sdk/models/changed-subscription.d.ts +16 -0
- package/esm/sdk/models/changed-subscription.d.ts.map +1 -0
- package/esm/sdk/models/changed-subscription.js +17 -0
- package/esm/sdk/models/changed-subscription.js.map +1 -0
- package/esm/sdk/models/create-price-request.d.ts +0 -3
- package/esm/sdk/models/create-price-request.d.ts.map +1 -1
- package/esm/sdk/models/create-price-request.js +0 -3
- package/esm/sdk/models/create-price-request.js.map +1 -1
- package/esm/sdk/models/create-subscription-request.d.ts +0 -3
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +0 -3
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-op.d.ts +8 -8
- package/esm/sdk/models/execute-subscription-modify-op.d.ts.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-op.js +5 -5
- package/esm/sdk/models/execute-subscription-modify-op.js.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-request.d.ts +19 -0
- package/esm/sdk/models/execute-subscription-modify-request.d.ts.map +1 -0
- package/esm/sdk/models/execute-subscription-modify-request.js +23 -0
- package/esm/sdk/models/execute-subscription-modify-request.js.map +1 -0
- package/esm/sdk/models/index.d.ts +16 -1
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +16 -1
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-filter.d.ts +5 -0
- package/esm/sdk/models/invoice-filter.d.ts.map +1 -1
- package/esm/sdk/models/invoice-filter.js +2 -0
- package/esm/sdk/models/invoice-filter.js.map +1 -1
- package/esm/sdk/models/invoice-response.d.ts +7 -0
- package/esm/sdk/models/invoice-response.d.ts.map +1 -1
- package/esm/sdk/models/invoice-response.js +2 -0
- package/esm/sdk/models/invoice-response.js.map +1 -1
- package/esm/sdk/models/line-item-quantity-change.d.ts +22 -0
- package/esm/sdk/models/line-item-quantity-change.d.ts.map +1 -0
- package/esm/sdk/models/line-item-quantity-change.js +19 -0
- package/esm/sdk/models/line-item-quantity-change.js.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-request.d.ts +26 -0
- package/esm/sdk/models/meter-usage-analytics-request.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-request.js +31 -0
- package/esm/sdk/models/meter-usage-analytics-request.js.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-response.d.ts +11 -0
- package/esm/sdk/models/meter-usage-analytics-response.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-analytics-response.js +15 -0
- package/esm/sdk/models/meter-usage-analytics-response.js.map +1 -0
- package/esm/sdk/models/meter-usage-point.d.ts +12 -0
- package/esm/sdk/models/meter-usage-point.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-point.js +21 -0
- package/esm/sdk/models/meter-usage-point.js.map +1 -0
- package/esm/sdk/models/meter-usage-query-request.d.ts +26 -0
- package/esm/sdk/models/meter-usage-query-request.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-query-request.js +31 -0
- package/esm/sdk/models/meter-usage-query-request.js.map +1 -0
- package/esm/sdk/models/meter-usage-query-response.d.ts +16 -0
- package/esm/sdk/models/meter-usage-query-response.d.ts.map +1 -0
- package/esm/sdk/models/meter-usage-query-response.js +28 -0
- package/esm/sdk/models/meter-usage-query-response.js.map +1 -0
- package/esm/sdk/models/preview-subscription-modify-op.d.ts +21 -0
- package/esm/sdk/models/preview-subscription-modify-op.d.ts.map +1 -0
- package/esm/sdk/models/preview-subscription-modify-op.js +14 -0
- package/esm/sdk/models/preview-subscription-modify-op.js.map +1 -0
- package/esm/sdk/models/secret-provider.d.ts +1 -0
- package/esm/sdk/models/secret-provider.d.ts.map +1 -1
- package/esm/sdk/models/secret-provider.js +1 -0
- package/esm/sdk/models/secret-provider.js.map +1 -1
- package/esm/sdk/models/sub-modify-inheritance-request.d.ts +12 -0
- package/esm/sdk/models/sub-modify-inheritance-request.d.ts.map +1 -0
- package/esm/sdk/models/{execute-subscription-inheritance-request.js → sub-modify-inheritance-request.js} +4 -4
- package/esm/sdk/models/sub-modify-inheritance-request.js.map +1 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.d.ts +13 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.d.ts.map +1 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.js +18 -0
- package/esm/sdk/models/sub-modify-quantity-change-request.js.map +1 -0
- package/esm/sdk/models/subscription-modify-response.d.ts +13 -0
- package/esm/sdk/models/subscription-modify-response.d.ts.map +1 -0
- package/esm/sdk/models/subscription-modify-response.js +22 -0
- package/esm/sdk/models/subscription-modify-response.js.map +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts +10 -0
- package/esm/sdk/models/subscription-modify-type.d.ts.map +1 -0
- package/esm/sdk/models/subscription-modify-type.js +11 -0
- package/esm/sdk/models/subscription-modify-type.js.map +1 -0
- package/esm/sdk/models/subscription-phase-create-request.d.ts +9 -0
- package/esm/sdk/models/subscription-phase-create-request.d.ts.map +1 -1
- package/esm/sdk/models/subscription-phase-create-request.js +3 -0
- package/esm/sdk/models/subscription-phase-create-request.js.map +1 -1
- package/esm/sdk/models/subscription-price-create-request.d.ts +0 -3
- package/esm/sdk/models/subscription-price-create-request.d.ts.map +1 -1
- package/esm/sdk/models/subscription-price-create-request.js +0 -3
- package/esm/sdk/models/subscription-price-create-request.js.map +1 -1
- package/esm/sdk/models/window-size.d.ts +1 -1
- package/esm/sdk/models/window-size.js +1 -1
- package/esm/sdk/models/window-size.js.map +1 -1
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/subscriptions.d.ts +10 -3
- package/esm/sdk/subscriptions.d.ts.map +1 -1
- package/esm/sdk/subscriptions.js +12 -2
- package/esm/sdk/subscriptions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/invoices-get-meter-usage-preview-invoice.ts +170 -0
- package/src/funcs/meter-usage-get-meter-usage-analytics.ts +170 -0
- package/src/funcs/meter-usage-query-meter-usage.ts +170 -0
- package/src/funcs/subscriptions-execute-subscription-modify.ts +13 -10
- package/src/funcs/subscriptions-preview-subscription-modify.ts +185 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/encodings.ts +9 -0
- package/src/sdk/invoices.ts +18 -0
- package/src/sdk/meter-usage.ts +45 -0
- package/src/sdk/models/billing-cadence.ts +8 -12
- package/src/sdk/models/billing-period.ts +1 -0
- package/src/sdk/models/changed-invoice.ts +38 -0
- package/src/sdk/models/changed-line-item.ts +55 -0
- package/src/sdk/models/changed-resources.ts +55 -0
- package/src/sdk/models/changed-subscription.ts +42 -0
- package/src/sdk/models/create-price-request.ts +0 -8
- package/src/sdk/models/create-subscription-request.ts +0 -8
- package/src/sdk/models/execute-subscription-modify-op.ts +22 -20
- package/src/sdk/models/execute-subscription-modify-request.ts +63 -0
- package/src/sdk/models/index.ts +16 -1
- package/src/sdk/models/invoice-filter.ts +7 -0
- package/src/sdk/models/invoice-response.ts +9 -0
- package/src/sdk/models/line-item-quantity-change.ts +52 -0
- package/src/sdk/models/meter-usage-analytics-request.ts +69 -0
- package/src/sdk/models/meter-usage-analytics-response.ts +35 -0
- package/src/sdk/models/meter-usage-point.ts +43 -0
- package/src/sdk/models/meter-usage-query-request.ts +69 -0
- package/src/sdk/models/meter-usage-query-response.ts +58 -0
- package/src/sdk/models/preview-subscription-modify-op.ts +46 -0
- package/src/sdk/models/secret-provider.ts +1 -0
- package/src/sdk/models/sub-modify-inheritance-request.ts +41 -0
- package/src/sdk/models/sub-modify-quantity-change-request.ts +45 -0
- package/src/sdk/models/subscription-modify-response.ts +49 -0
- package/src/sdk/models/subscription-modify-type.ts +17 -0
- package/src/sdk/models/subscription-phase-create-request.ts +17 -0
- package/src/sdk/models/subscription-price-create-request.ts +0 -8
- package/src/sdk/models/window-size.ts +1 -1
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/subscriptions.ts +24 -4
- package/esm/sdk/models/execute-subscription-inheritance-request.d.ts +0 -12
- package/esm/sdk/models/execute-subscription-inheritance-request.d.ts.map +0 -1
- package/esm/sdk/models/execute-subscription-inheritance-request.js.map +0 -1
- package/src/sdk/models/execute-subscription-inheritance-request.ts +0 -42
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
AggregationType,
|
|
9
|
+
AggregationType$outboundSchema,
|
|
10
|
+
} from "./aggregation-type.js";
|
|
11
|
+
import { WindowSize, WindowSize$outboundSchema } from "./window-size.js";
|
|
12
|
+
|
|
13
|
+
export type MeterUsageAnalyticsRequest = {
|
|
14
|
+
aggregationType: AggregationType;
|
|
15
|
+
billingAnchor?: Date | undefined;
|
|
16
|
+
endTime: Date;
|
|
17
|
+
externalCustomerId: string;
|
|
18
|
+
meterIds: Array<string>;
|
|
19
|
+
startTime: Date;
|
|
20
|
+
windowSize?: WindowSize | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type MeterUsageAnalyticsRequest$Outbound = {
|
|
25
|
+
aggregation_type: string;
|
|
26
|
+
billing_anchor?: string | undefined;
|
|
27
|
+
end_time: string;
|
|
28
|
+
external_customer_id: string;
|
|
29
|
+
meter_ids: Array<string>;
|
|
30
|
+
start_time: string;
|
|
31
|
+
window_size?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const MeterUsageAnalyticsRequest$outboundSchema: z.ZodMiniType<
|
|
36
|
+
MeterUsageAnalyticsRequest$Outbound,
|
|
37
|
+
MeterUsageAnalyticsRequest
|
|
38
|
+
> = z.pipe(
|
|
39
|
+
z.object({
|
|
40
|
+
aggregationType: AggregationType$outboundSchema,
|
|
41
|
+
billingAnchor: z.optional(
|
|
42
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
43
|
+
),
|
|
44
|
+
endTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
45
|
+
externalCustomerId: z.string(),
|
|
46
|
+
meterIds: z.array(z.string()),
|
|
47
|
+
startTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
48
|
+
windowSize: z.optional(WindowSize$outboundSchema),
|
|
49
|
+
}),
|
|
50
|
+
z.transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
aggregationType: "aggregation_type",
|
|
53
|
+
billingAnchor: "billing_anchor",
|
|
54
|
+
endTime: "end_time",
|
|
55
|
+
externalCustomerId: "external_customer_id",
|
|
56
|
+
meterIds: "meter_ids",
|
|
57
|
+
startTime: "start_time",
|
|
58
|
+
windowSize: "window_size",
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export function meterUsageAnalyticsRequestToJSON(
|
|
64
|
+
meterUsageAnalyticsRequest: MeterUsageAnalyticsRequest,
|
|
65
|
+
): string {
|
|
66
|
+
return JSON.stringify(
|
|
67
|
+
MeterUsageAnalyticsRequest$outboundSchema.parse(meterUsageAnalyticsRequest),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import * as types from "../../types/primitives.js";
|
|
9
|
+
import {
|
|
10
|
+
MeterUsageQueryResponse,
|
|
11
|
+
MeterUsageQueryResponse$inboundSchema,
|
|
12
|
+
} from "./meter-usage-query-response.js";
|
|
13
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
14
|
+
|
|
15
|
+
export type MeterUsageAnalyticsResponse = {
|
|
16
|
+
items?: Array<MeterUsageQueryResponse> | undefined;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const MeterUsageAnalyticsResponse$inboundSchema: z.ZodMiniType<
|
|
21
|
+
MeterUsageAnalyticsResponse,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
items: types.optional(z.array(MeterUsageQueryResponse$inboundSchema)),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function meterUsageAnalyticsResponseFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<MeterUsageAnalyticsResponse, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => MeterUsageAnalyticsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'MeterUsageAnalyticsResponse' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
11
|
+
|
|
12
|
+
export type MeterUsagePoint = {
|
|
13
|
+
eventCount?: number | undefined;
|
|
14
|
+
timestamp?: string | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const MeterUsagePoint$inboundSchema: z.ZodMiniType<
|
|
20
|
+
MeterUsagePoint,
|
|
21
|
+
unknown
|
|
22
|
+
> = z.pipe(
|
|
23
|
+
z.object({
|
|
24
|
+
event_count: types.optional(types.number()),
|
|
25
|
+
timestamp: types.optional(types.string()),
|
|
26
|
+
value: types.optional(types.string()),
|
|
27
|
+
}),
|
|
28
|
+
z.transform((v) => {
|
|
29
|
+
return remap$(v, {
|
|
30
|
+
"event_count": "eventCount",
|
|
31
|
+
});
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export function meterUsagePointFromJSON(
|
|
36
|
+
jsonString: string,
|
|
37
|
+
): SafeParseResult<MeterUsagePoint, SDKValidationError> {
|
|
38
|
+
return safeParse(
|
|
39
|
+
jsonString,
|
|
40
|
+
(x) => MeterUsagePoint$inboundSchema.parse(JSON.parse(x)),
|
|
41
|
+
`Failed to parse 'MeterUsagePoint' from JSON`,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
AggregationType,
|
|
9
|
+
AggregationType$outboundSchema,
|
|
10
|
+
} from "./aggregation-type.js";
|
|
11
|
+
import { WindowSize, WindowSize$outboundSchema } from "./window-size.js";
|
|
12
|
+
|
|
13
|
+
export type MeterUsageQueryRequest = {
|
|
14
|
+
aggregationType: AggregationType;
|
|
15
|
+
billingAnchor?: Date | undefined;
|
|
16
|
+
endTime: Date;
|
|
17
|
+
externalCustomerId: string;
|
|
18
|
+
meterId: string;
|
|
19
|
+
startTime: Date;
|
|
20
|
+
windowSize?: WindowSize | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type MeterUsageQueryRequest$Outbound = {
|
|
25
|
+
aggregation_type: string;
|
|
26
|
+
billing_anchor?: string | undefined;
|
|
27
|
+
end_time: string;
|
|
28
|
+
external_customer_id: string;
|
|
29
|
+
meter_id: string;
|
|
30
|
+
start_time: string;
|
|
31
|
+
window_size?: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const MeterUsageQueryRequest$outboundSchema: z.ZodMiniType<
|
|
36
|
+
MeterUsageQueryRequest$Outbound,
|
|
37
|
+
MeterUsageQueryRequest
|
|
38
|
+
> = z.pipe(
|
|
39
|
+
z.object({
|
|
40
|
+
aggregationType: AggregationType$outboundSchema,
|
|
41
|
+
billingAnchor: z.optional(
|
|
42
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
43
|
+
),
|
|
44
|
+
endTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
45
|
+
externalCustomerId: z.string(),
|
|
46
|
+
meterId: z.string(),
|
|
47
|
+
startTime: z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
48
|
+
windowSize: z.optional(WindowSize$outboundSchema),
|
|
49
|
+
}),
|
|
50
|
+
z.transform((v) => {
|
|
51
|
+
return remap$(v, {
|
|
52
|
+
aggregationType: "aggregation_type",
|
|
53
|
+
billingAnchor: "billing_anchor",
|
|
54
|
+
endTime: "end_time",
|
|
55
|
+
externalCustomerId: "external_customer_id",
|
|
56
|
+
meterId: "meter_id",
|
|
57
|
+
startTime: "start_time",
|
|
58
|
+
windowSize: "window_size",
|
|
59
|
+
});
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
export function meterUsageQueryRequestToJSON(
|
|
64
|
+
meterUsageQueryRequest: MeterUsageQueryRequest,
|
|
65
|
+
): string {
|
|
66
|
+
return JSON.stringify(
|
|
67
|
+
MeterUsageQueryRequest$outboundSchema.parse(meterUsageQueryRequest),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
AggregationType,
|
|
12
|
+
AggregationType$inboundSchema,
|
|
13
|
+
} from "./aggregation-type.js";
|
|
14
|
+
import {
|
|
15
|
+
MeterUsagePoint,
|
|
16
|
+
MeterUsagePoint$inboundSchema,
|
|
17
|
+
} from "./meter-usage-point.js";
|
|
18
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
19
|
+
|
|
20
|
+
export type MeterUsageQueryResponse = {
|
|
21
|
+
aggregationType?: AggregationType | undefined;
|
|
22
|
+
eventCount?: number | undefined;
|
|
23
|
+
meterId?: string | undefined;
|
|
24
|
+
points?: Array<MeterUsagePoint> | undefined;
|
|
25
|
+
totalValue?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const MeterUsageQueryResponse$inboundSchema: z.ZodMiniType<
|
|
30
|
+
MeterUsageQueryResponse,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
aggregation_type: types.optional(AggregationType$inboundSchema),
|
|
35
|
+
event_count: types.optional(types.number()),
|
|
36
|
+
meter_id: types.optional(types.string()),
|
|
37
|
+
points: types.optional(z.array(MeterUsagePoint$inboundSchema)),
|
|
38
|
+
total_value: types.optional(types.string()),
|
|
39
|
+
}),
|
|
40
|
+
z.transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"aggregation_type": "aggregationType",
|
|
43
|
+
"event_count": "eventCount",
|
|
44
|
+
"meter_id": "meterId",
|
|
45
|
+
"total_value": "totalValue",
|
|
46
|
+
});
|
|
47
|
+
}),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export function meterUsageQueryResponseFromJSON(
|
|
51
|
+
jsonString: string,
|
|
52
|
+
): SafeParseResult<MeterUsageQueryResponse, SDKValidationError> {
|
|
53
|
+
return safeParse(
|
|
54
|
+
jsonString,
|
|
55
|
+
(x) => MeterUsageQueryResponse$inboundSchema.parse(JSON.parse(x)),
|
|
56
|
+
`Failed to parse 'MeterUsageQueryResponse' from JSON`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import {
|
|
7
|
+
ExecuteSubscriptionModifyRequest,
|
|
8
|
+
ExecuteSubscriptionModifyRequest$Outbound,
|
|
9
|
+
ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
10
|
+
} from "./execute-subscription-modify-request.js";
|
|
11
|
+
|
|
12
|
+
export type PreviewSubscriptionModifyRequest = {
|
|
13
|
+
/**
|
|
14
|
+
* Subscription ID
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Modification preview request
|
|
19
|
+
*/
|
|
20
|
+
body: ExecuteSubscriptionModifyRequest;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export type PreviewSubscriptionModifyRequest$Outbound = {
|
|
25
|
+
id: string;
|
|
26
|
+
body: ExecuteSubscriptionModifyRequest$Outbound;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** @internal */
|
|
30
|
+
export const PreviewSubscriptionModifyRequest$outboundSchema: z.ZodMiniType<
|
|
31
|
+
PreviewSubscriptionModifyRequest$Outbound,
|
|
32
|
+
PreviewSubscriptionModifyRequest
|
|
33
|
+
> = z.object({
|
|
34
|
+
id: z.string(),
|
|
35
|
+
body: ExecuteSubscriptionModifyRequest$outboundSchema,
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function previewSubscriptionModifyRequestToJSON(
|
|
39
|
+
previewSubscriptionModifyRequest: PreviewSubscriptionModifyRequest,
|
|
40
|
+
): string {
|
|
41
|
+
return JSON.stringify(
|
|
42
|
+
PreviewSubscriptionModifyRequest$outboundSchema.parse(
|
|
43
|
+
previewSubscriptionModifyRequest,
|
|
44
|
+
),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
|
|
8
|
+
export type SubModifyInheritanceRequest = {
|
|
9
|
+
externalCustomerIdsToInheritSubscription?: Array<string> | undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** @internal */
|
|
13
|
+
export type SubModifyInheritanceRequest$Outbound = {
|
|
14
|
+
external_customer_ids_to_inherit_subscription?: Array<string> | undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export const SubModifyInheritanceRequest$outboundSchema: z.ZodMiniType<
|
|
19
|
+
SubModifyInheritanceRequest$Outbound,
|
|
20
|
+
SubModifyInheritanceRequest
|
|
21
|
+
> = z.pipe(
|
|
22
|
+
z.object({
|
|
23
|
+
externalCustomerIdsToInheritSubscription: z.optional(z.array(z.string())),
|
|
24
|
+
}),
|
|
25
|
+
z.transform((v) => {
|
|
26
|
+
return remap$(v, {
|
|
27
|
+
externalCustomerIdsToInheritSubscription:
|
|
28
|
+
"external_customer_ids_to_inherit_subscription",
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export function subModifyInheritanceRequestToJSON(
|
|
34
|
+
subModifyInheritanceRequest: SubModifyInheritanceRequest,
|
|
35
|
+
): string {
|
|
36
|
+
return JSON.stringify(
|
|
37
|
+
SubModifyInheritanceRequest$outboundSchema.parse(
|
|
38
|
+
subModifyInheritanceRequest,
|
|
39
|
+
),
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
LineItemQuantityChange,
|
|
9
|
+
LineItemQuantityChange$Outbound,
|
|
10
|
+
LineItemQuantityChange$outboundSchema,
|
|
11
|
+
} from "./line-item-quantity-change.js";
|
|
12
|
+
|
|
13
|
+
export type SubModifyQuantityChangeRequest = {
|
|
14
|
+
lineItems: Array<LineItemQuantityChange>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** @internal */
|
|
18
|
+
export type SubModifyQuantityChangeRequest$Outbound = {
|
|
19
|
+
line_items: Array<LineItemQuantityChange$Outbound>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const SubModifyQuantityChangeRequest$outboundSchema: z.ZodMiniType<
|
|
24
|
+
SubModifyQuantityChangeRequest$Outbound,
|
|
25
|
+
SubModifyQuantityChangeRequest
|
|
26
|
+
> = z.pipe(
|
|
27
|
+
z.object({
|
|
28
|
+
lineItems: z.array(LineItemQuantityChange$outboundSchema),
|
|
29
|
+
}),
|
|
30
|
+
z.transform((v) => {
|
|
31
|
+
return remap$(v, {
|
|
32
|
+
lineItems: "line_items",
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export function subModifyQuantityChangeRequestToJSON(
|
|
38
|
+
subModifyQuantityChangeRequest: SubModifyQuantityChangeRequest,
|
|
39
|
+
): string {
|
|
40
|
+
return JSON.stringify(
|
|
41
|
+
SubModifyQuantityChangeRequest$outboundSchema.parse(
|
|
42
|
+
subModifyQuantityChangeRequest,
|
|
43
|
+
),
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
ChangedResources,
|
|
12
|
+
ChangedResources$inboundSchema,
|
|
13
|
+
} from "./changed-resources.js";
|
|
14
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
15
|
+
import {
|
|
16
|
+
SubscriptionResponse,
|
|
17
|
+
SubscriptionResponse$inboundSchema,
|
|
18
|
+
} from "./subscription-response.js";
|
|
19
|
+
|
|
20
|
+
export type SubscriptionModifyResponse = {
|
|
21
|
+
changedResources?: ChangedResources | undefined;
|
|
22
|
+
subscription?: SubscriptionResponse | undefined;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const SubscriptionModifyResponse$inboundSchema: z.ZodMiniType<
|
|
27
|
+
SubscriptionModifyResponse,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.pipe(
|
|
30
|
+
z.object({
|
|
31
|
+
changed_resources: types.optional(ChangedResources$inboundSchema),
|
|
32
|
+
subscription: types.optional(SubscriptionResponse$inboundSchema),
|
|
33
|
+
}),
|
|
34
|
+
z.transform((v) => {
|
|
35
|
+
return remap$(v, {
|
|
36
|
+
"changed_resources": "changedResources",
|
|
37
|
+
});
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
export function subscriptionModifyResponseFromJSON(
|
|
42
|
+
jsonString: string,
|
|
43
|
+
): SafeParseResult<SubscriptionModifyResponse, SDKValidationError> {
|
|
44
|
+
return safeParse(
|
|
45
|
+
jsonString,
|
|
46
|
+
(x) => SubscriptionModifyResponse$inboundSchema.parse(JSON.parse(x)),
|
|
47
|
+
`Failed to parse 'SubscriptionModifyResponse' from JSON`,
|
|
48
|
+
);
|
|
49
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
export const SubscriptionModifyType = {
|
|
9
|
+
Inheritance: "inheritance",
|
|
10
|
+
QuantityChange: "quantity_change",
|
|
11
|
+
} as const;
|
|
12
|
+
export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
|
|
13
|
+
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const SubscriptionModifyType$outboundSchema: z.ZodMiniEnum<
|
|
16
|
+
typeof SubscriptionModifyType
|
|
17
|
+
> = z.enum(SubscriptionModifyType);
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import {
|
|
8
|
+
CreateSubscriptionLineItemRequest,
|
|
9
|
+
CreateSubscriptionLineItemRequest$Outbound,
|
|
10
|
+
CreateSubscriptionLineItemRequest$outboundSchema,
|
|
11
|
+
} from "./create-subscription-line-item-request.js";
|
|
7
12
|
import {
|
|
8
13
|
OverrideLineItemRequest,
|
|
9
14
|
OverrideLineItemRequest$Outbound,
|
|
@@ -20,6 +25,13 @@ export type SubscriptionPhaseCreateRequest = {
|
|
|
20
25
|
* LineItemCoupons represents line item-level coupons (map of line_item_id to coupon IDs)
|
|
21
26
|
*/
|
|
22
27
|
lineItemCoupons?: { [k: string]: Array<string> } | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* LineItems are extra line items to add during this phase, primarily one-time charges.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Each item's start_date defaults to the phase's start_date when not provided.
|
|
33
|
+
*/
|
|
34
|
+
lineItems?: Array<CreateSubscriptionLineItemRequest> | undefined;
|
|
23
35
|
metadata?: { [k: string]: string } | undefined;
|
|
24
36
|
/**
|
|
25
37
|
* OverrideLineItems allows customizing specific prices for this phase
|
|
@@ -36,6 +48,7 @@ export type SubscriptionPhaseCreateRequest$Outbound = {
|
|
|
36
48
|
coupons?: Array<string> | undefined;
|
|
37
49
|
end_date?: string | undefined;
|
|
38
50
|
line_item_coupons?: { [k: string]: Array<string> } | undefined;
|
|
51
|
+
line_items?: Array<CreateSubscriptionLineItemRequest$Outbound> | undefined;
|
|
39
52
|
metadata?: { [k: string]: string } | undefined;
|
|
40
53
|
override_line_items?: Array<OverrideLineItemRequest$Outbound> | undefined;
|
|
41
54
|
start_date: string;
|
|
@@ -50,6 +63,9 @@ export const SubscriptionPhaseCreateRequest$outboundSchema: z.ZodMiniType<
|
|
|
50
63
|
coupons: z.optional(z.array(z.string())),
|
|
51
64
|
endDate: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
52
65
|
lineItemCoupons: z.optional(z.record(z.string(), z.array(z.string()))),
|
|
66
|
+
lineItems: z.optional(
|
|
67
|
+
z.array(CreateSubscriptionLineItemRequest$outboundSchema),
|
|
68
|
+
),
|
|
53
69
|
metadata: z.optional(z.record(z.string(), z.string())),
|
|
54
70
|
overrideLineItems: z.optional(
|
|
55
71
|
z.array(OverrideLineItemRequest$outboundSchema),
|
|
@@ -60,6 +76,7 @@ export const SubscriptionPhaseCreateRequest$outboundSchema: z.ZodMiniType<
|
|
|
60
76
|
return remap$(v, {
|
|
61
77
|
endDate: "end_date",
|
|
62
78
|
lineItemCoupons: "line_item_coupons",
|
|
79
|
+
lineItems: "line_items",
|
|
63
80
|
overrideLineItems: "override_line_items",
|
|
64
81
|
startDate: "start_date",
|
|
65
82
|
});
|
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v4-mini";
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
-
import {
|
|
8
|
-
BillingCadence,
|
|
9
|
-
BillingCadence$outboundSchema,
|
|
10
|
-
} from "./billing-cadence.js";
|
|
11
7
|
import { BillingModel, BillingModel$outboundSchema } from "./billing-model.js";
|
|
12
8
|
import {
|
|
13
9
|
BillingPeriod,
|
|
@@ -41,7 +37,6 @@ import {
|
|
|
41
37
|
|
|
42
38
|
export type SubscriptionPriceCreateRequest = {
|
|
43
39
|
amount?: string | undefined;
|
|
44
|
-
billingCadence: BillingCadence;
|
|
45
40
|
billingModel: BillingModel;
|
|
46
41
|
billingPeriod: BillingPeriod;
|
|
47
42
|
billingPeriodCount?: number | undefined;
|
|
@@ -67,7 +62,6 @@ export type SubscriptionPriceCreateRequest = {
|
|
|
67
62
|
/** @internal */
|
|
68
63
|
export type SubscriptionPriceCreateRequest$Outbound = {
|
|
69
64
|
amount?: string | undefined;
|
|
70
|
-
billing_cadence: string;
|
|
71
65
|
billing_model: string;
|
|
72
66
|
billing_period: string;
|
|
73
67
|
billing_period_count?: number | undefined;
|
|
@@ -97,7 +91,6 @@ export const SubscriptionPriceCreateRequest$outboundSchema: z.ZodMiniType<
|
|
|
97
91
|
> = z.pipe(
|
|
98
92
|
z.object({
|
|
99
93
|
amount: z.optional(z.string()),
|
|
100
|
-
billingCadence: BillingCadence$outboundSchema,
|
|
101
94
|
billingModel: BillingModel$outboundSchema,
|
|
102
95
|
billingPeriod: BillingPeriod$outboundSchema,
|
|
103
96
|
billingPeriodCount: z.optional(z.int()),
|
|
@@ -121,7 +114,6 @@ export const SubscriptionPriceCreateRequest$outboundSchema: z.ZodMiniType<
|
|
|
121
114
|
}),
|
|
122
115
|
z.transform((v) => {
|
|
123
116
|
return remap$(v, {
|
|
124
|
-
billingCadence: "billing_cadence",
|
|
125
117
|
billingModel: "billing_model",
|
|
126
118
|
billingPeriod: "billing_period",
|
|
127
119
|
billingPeriodCount: "billing_period_count",
|
|
@@ -7,7 +7,6 @@ import * as openEnums from "../../types/enums.js";
|
|
|
7
7
|
import { OpenEnum } from "../../types/enums.js";
|
|
8
8
|
|
|
9
9
|
export const WindowSize = {
|
|
10
|
-
Month: "MONTH",
|
|
11
10
|
Minute: "MINUTE",
|
|
12
11
|
FifteenMIN: "15MIN",
|
|
13
12
|
ThirtyMIN: "30MIN",
|
|
@@ -17,6 +16,7 @@ export const WindowSize = {
|
|
|
17
16
|
TwelveHOUR: "12HOUR",
|
|
18
17
|
Day: "DAY",
|
|
19
18
|
Week: "WEEK",
|
|
19
|
+
Month: "MONTH",
|
|
20
20
|
} as const;
|
|
21
21
|
export type WindowSize = OpenEnum<typeof WindowSize>;
|
|
22
22
|
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { Features } from "./features.js";
|
|
|
16
16
|
import { Groups } from "./groups.js";
|
|
17
17
|
import { Integrations } from "./integrations.js";
|
|
18
18
|
import { Invoices } from "./invoices.js";
|
|
19
|
+
import { MeterUsage } from "./meter-usage.js";
|
|
19
20
|
import { Payments } from "./payments.js";
|
|
20
21
|
import { Plans } from "./plans.js";
|
|
21
22
|
import { PriceUnits } from "./price-units.js";
|
|
@@ -104,6 +105,11 @@ export class Flexprice extends ClientSDK {
|
|
|
104
105
|
return (this._integrations ??= new Integrations(this._options));
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
private _meterUsage?: MeterUsage;
|
|
109
|
+
get meterUsage(): MeterUsage {
|
|
110
|
+
return (this._meterUsage ??= new MeterUsage(this._options));
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
private _payments?: Payments;
|
|
108
114
|
get payments(): Payments {
|
|
109
115
|
return (this._payments ??= new Payments(this._options));
|
package/src/sdk/subscriptions.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { subscriptionsListSubscriptionPauses } from "../funcs/subscriptions-list
|
|
|
23
23
|
import { subscriptionsListSubscriptionSchedules } from "../funcs/subscriptions-list-subscription-schedules.js";
|
|
24
24
|
import { subscriptionsPauseSubscription } from "../funcs/subscriptions-pause-subscription.js";
|
|
25
25
|
import { subscriptionsPreviewSubscriptionChange } from "../funcs/subscriptions-preview-subscription-change.js";
|
|
26
|
+
import { subscriptionsPreviewSubscriptionModify } from "../funcs/subscriptions-preview-subscription-modify.js";
|
|
26
27
|
import { subscriptionsQuerySubscription } from "../funcs/subscriptions-query-subscription.js";
|
|
27
28
|
import { subscriptionsRemoveSubscriptionAddon } from "../funcs/subscriptions-remove-subscription-addon.js";
|
|
28
29
|
import { subscriptionsResumeSubscription } from "../funcs/subscriptions-resume-subscription.js";
|
|
@@ -341,16 +342,16 @@ export class Subscriptions extends ClientSDK {
|
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
/**
|
|
344
|
-
*
|
|
345
|
+
* Execute subscription modification
|
|
345
346
|
*
|
|
346
347
|
* @remarks
|
|
347
|
-
*
|
|
348
|
+
* Execute a mid-cycle subscription modification (inheritance or quantity change).
|
|
348
349
|
*/
|
|
349
350
|
async executeSubscriptionModify(
|
|
350
351
|
id: string,
|
|
351
|
-
body: models.
|
|
352
|
+
body: models.ExecuteSubscriptionModifyRequest,
|
|
352
353
|
options?: RequestOptions,
|
|
353
|
-
): Promise<models.
|
|
354
|
+
): Promise<models.SubscriptionModifyResponse> {
|
|
354
355
|
return unwrapAsync(subscriptionsExecuteSubscriptionModify(
|
|
355
356
|
this,
|
|
356
357
|
id,
|
|
@@ -359,6 +360,25 @@ export class Subscriptions extends ClientSDK {
|
|
|
359
360
|
));
|
|
360
361
|
}
|
|
361
362
|
|
|
363
|
+
/**
|
|
364
|
+
* Preview subscription modification
|
|
365
|
+
*
|
|
366
|
+
* @remarks
|
|
367
|
+
* Preview the impact of a mid-cycle subscription modification without committing changes.
|
|
368
|
+
*/
|
|
369
|
+
async previewSubscriptionModify(
|
|
370
|
+
id: string,
|
|
371
|
+
body: models.ExecuteSubscriptionModifyRequest,
|
|
372
|
+
options?: RequestOptions,
|
|
373
|
+
): Promise<models.SubscriptionModifyResponse> {
|
|
374
|
+
return unwrapAsync(subscriptionsPreviewSubscriptionModify(
|
|
375
|
+
this,
|
|
376
|
+
id,
|
|
377
|
+
body,
|
|
378
|
+
options,
|
|
379
|
+
));
|
|
380
|
+
}
|
|
381
|
+
|
|
362
382
|
/**
|
|
363
383
|
* Pause a subscription
|
|
364
384
|
*
|