@flexprice/sdk 2.1.6 → 2.1.10
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/FUNCTIONS.md +2 -2
- package/docs/sdk/models/create-subscription-request.md +38 -37
- package/docs/sdk/models/customer-filter.md +1 -0
- package/docs/sdk/models/execute-subscription-modify-request.md +7 -6
- package/docs/sdk/models/export-metadata-entity-type.md +17 -0
- package/docs/sdk/models/export-metadata-field.md +20 -0
- package/docs/sdk/models/grouped-invoicing-action.md +15 -0
- package/docs/sdk/models/invoice-billing-reason.md +2 -2
- package/docs/sdk/models/list-subscription-line-items-response.md +50 -0
- package/docs/sdk/models/plan-filter.md +1 -0
- package/docs/sdk/models/s3-job-config.md +10 -9
- package/docs/sdk/models/scheduled-task-entity-type.md +1 -1
- package/docs/sdk/models/sub-modify-grouped-invoicing-params.md +19 -0
- package/docs/sdk/models/subscription-inheritance-config.md +6 -5
- package/docs/sdk/models/subscription-line-item-filter-order.md +15 -0
- package/docs/sdk/models/subscription-line-item-filter.md +34 -0
- package/docs/sdk/models/subscription-modify-type.md +2 -2
- package/docs/sdk/models/subscription-response-v2.md +1 -0
- package/docs/sdk/models/subscription-response.md +1 -0
- package/docs/sdk/models/subscription-type.md +1 -1
- package/docs/sdks/scheduledtasks/README.md +2 -2
- package/docs/sdks/subscriptions/README.md +74 -2
- package/esm/funcs/subscriptions-query-subscription-line-items.d.ts +17 -0
- package/esm/funcs/subscriptions-query-subscription-line-items.d.ts.map +1 -0
- package/esm/funcs/subscriptions-query-subscription-line-items.js +83 -0
- package/esm/funcs/subscriptions-query-subscription-line-items.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/sdk/models/create-subscription-request.d.ts +11 -0
- package/esm/sdk/models/create-subscription-request.d.ts.map +1 -1
- package/esm/sdk/models/create-subscription-request.js +2 -0
- package/esm/sdk/models/create-subscription-request.js.map +1 -1
- package/esm/sdk/models/customer-filter.d.ts +6 -0
- package/esm/sdk/models/customer-filter.d.ts.map +1 -1
- package/esm/sdk/models/customer-filter.js +1 -0
- package/esm/sdk/models/customer-filter.js.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-request.d.ts +3 -0
- package/esm/sdk/models/execute-subscription-modify-request.d.ts.map +1 -1
- package/esm/sdk/models/execute-subscription-modify-request.js +3 -0
- package/esm/sdk/models/execute-subscription-modify-request.js.map +1 -1
- package/esm/sdk/models/export-metadata-entity-type.d.ts +12 -0
- package/esm/sdk/models/export-metadata-entity-type.d.ts.map +1 -0
- package/esm/sdk/models/export-metadata-entity-type.js +13 -0
- package/esm/sdk/models/export-metadata-entity-type.js.map +1 -0
- package/esm/sdk/models/export-metadata-field.d.ts +28 -0
- package/esm/sdk/models/export-metadata-field.d.ts.map +1 -0
- package/esm/sdk/models/export-metadata-field.js +39 -0
- package/esm/sdk/models/export-metadata-field.js.map +1 -0
- package/esm/sdk/models/grouped-invoicing-action.d.ts +10 -0
- package/esm/sdk/models/grouped-invoicing-action.d.ts.map +1 -0
- package/esm/sdk/models/grouped-invoicing-action.js +11 -0
- package/esm/sdk/models/grouped-invoicing-action.js.map +1 -0
- package/esm/sdk/models/index.d.ts +6 -0
- package/esm/sdk/models/index.d.ts.map +1 -1
- package/esm/sdk/models/index.js +6 -0
- package/esm/sdk/models/index.js.map +1 -1
- package/esm/sdk/models/invoice-billing-reason.d.ts +2 -0
- package/esm/sdk/models/invoice-billing-reason.d.ts.map +1 -1
- package/esm/sdk/models/invoice-billing-reason.js +2 -0
- package/esm/sdk/models/invoice-billing-reason.js.map +1 -1
- package/esm/sdk/models/list-subscription-line-items-response.d.ts +13 -0
- package/esm/sdk/models/list-subscription-line-items-response.d.ts.map +1 -0
- package/esm/sdk/models/list-subscription-line-items-response.js +17 -0
- package/esm/sdk/models/list-subscription-line-items-response.js.map +1 -0
- package/esm/sdk/models/plan-filter.d.ts +6 -0
- package/esm/sdk/models/plan-filter.d.ts.map +1 -1
- package/esm/sdk/models/plan-filter.js +1 -0
- package/esm/sdk/models/plan-filter.js.map +1 -1
- package/esm/sdk/models/s3-job-config.d.ts +7 -1
- package/esm/sdk/models/s3-job-config.d.ts.map +1 -1
- package/esm/sdk/models/s3-job-config.js +5 -0
- package/esm/sdk/models/s3-job-config.js.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.d.ts +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.d.ts.map +1 -1
- package/esm/sdk/models/scheduled-task-entity-type.js +1 -0
- package/esm/sdk/models/scheduled-task-entity-type.js.map +1 -1
- package/esm/sdk/models/sub-modify-grouped-invoicing-params.d.ts +20 -0
- package/esm/sdk/models/sub-modify-grouped-invoicing-params.d.ts.map +1 -0
- package/esm/sdk/models/sub-modify-grouped-invoicing-params.js +21 -0
- package/esm/sdk/models/sub-modify-grouped-invoicing-params.js.map +1 -0
- package/esm/sdk/models/subscription-inheritance-config.d.ts +26 -0
- package/esm/sdk/models/subscription-inheritance-config.d.ts.map +1 -1
- package/esm/sdk/models/subscription-inheritance-config.js +2 -0
- package/esm/sdk/models/subscription-inheritance-config.js.map +1 -1
- package/esm/sdk/models/subscription-line-item-entity-type.d.ts +2 -0
- package/esm/sdk/models/subscription-line-item-entity-type.d.ts.map +1 -1
- package/esm/sdk/models/subscription-line-item-entity-type.js +2 -0
- package/esm/sdk/models/subscription-line-item-entity-type.js.map +1 -1
- package/esm/sdk/models/subscription-line-item-filter.d.ts +65 -0
- package/esm/sdk/models/subscription-line-item-filter.d.ts.map +1 -0
- package/esm/sdk/models/subscription-line-item-filter.js +57 -0
- package/esm/sdk/models/subscription-line-item-filter.js.map +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts +1 -0
- package/esm/sdk/models/subscription-modify-type.d.ts.map +1 -1
- package/esm/sdk/models/subscription-modify-type.js +1 -0
- package/esm/sdk/models/subscription-modify-type.js.map +1 -1
- package/esm/sdk/models/subscription-response-v2.d.ts +8 -0
- package/esm/sdk/models/subscription-response-v2.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response-v2.js +2 -0
- package/esm/sdk/models/subscription-response-v2.js.map +1 -1
- package/esm/sdk/models/subscription-response.d.ts +8 -0
- package/esm/sdk/models/subscription-response.d.ts.map +1 -1
- package/esm/sdk/models/subscription-response.js +2 -0
- package/esm/sdk/models/subscription-response.js.map +1 -1
- package/esm/sdk/models/subscription-type.d.ts +2 -0
- package/esm/sdk/models/subscription-type.d.ts.map +1 -1
- package/esm/sdk/models/subscription-type.js +2 -0
- package/esm/sdk/models/subscription-type.js.map +1 -1
- package/esm/sdk/subscriptions.d.ts +7 -0
- package/esm/sdk/subscriptions.d.ts.map +1 -1
- package/esm/sdk/subscriptions.js +10 -0
- package/esm/sdk/subscriptions.js.map +1 -1
- package/esm/types/primitives.d.ts +1 -1
- package/esm/types/primitives.d.ts.map +1 -1
- package/esm/types/primitives.js +2 -3
- package/esm/types/primitives.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/subscriptions-query-subscription-line-items.ts +172 -0
- package/src/lib/config.ts +3 -3
- package/src/sdk/models/create-subscription-request.ts +13 -0
- package/src/sdk/models/customer-filter.ts +3 -0
- package/src/sdk/models/execute-subscription-modify-request.ts +13 -0
- package/src/sdk/models/export-metadata-entity-type.ts +26 -0
- package/src/sdk/models/export-metadata-field.ts +88 -0
- package/src/sdk/models/grouped-invoicing-action.ts +17 -0
- package/src/sdk/models/index.ts +6 -0
- package/src/sdk/models/invoice-billing-reason.ts +2 -0
- package/src/sdk/models/list-subscription-line-items-response.ts +41 -0
- package/src/sdk/models/plan-filter.ts +3 -0
- package/src/sdk/models/s3-job-config.ts +20 -1
- package/src/sdk/models/scheduled-task-entity-type.ts +1 -0
- package/src/sdk/models/sub-modify-grouped-invoicing-params.ts +54 -0
- package/src/sdk/models/subscription-inheritance-config.ts +29 -0
- package/src/sdk/models/subscription-line-item-entity-type.ts +5 -0
- package/src/sdk/models/subscription-line-item-filter.ts +140 -0
- package/src/sdk/models/subscription-modify-type.ts +1 -0
- package/src/sdk/models/subscription-response-v2.ts +10 -0
- package/src/sdk/models/subscription-response.ts +10 -0
- package/src/sdk/models/subscription-type.ts +2 -0
- package/src/sdk/subscriptions.ts +18 -0
- package/src/types/primitives.ts +2 -4
|
@@ -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 { 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
|
+
PaginationResponse,
|
|
11
|
+
PaginationResponse$inboundSchema,
|
|
12
|
+
} from "./pagination-response.js";
|
|
13
|
+
import { SDKValidationError } from "./sdk-validation-error.js";
|
|
14
|
+
import {
|
|
15
|
+
SubscriptionLineItemResponse,
|
|
16
|
+
SubscriptionLineItemResponse$inboundSchema,
|
|
17
|
+
} from "./subscription-line-item-response.js";
|
|
18
|
+
|
|
19
|
+
export type ListSubscriptionLineItemsResponse = {
|
|
20
|
+
items?: Array<SubscriptionLineItemResponse> | undefined;
|
|
21
|
+
pagination?: PaginationResponse | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const ListSubscriptionLineItemsResponse$inboundSchema: z.ZodMiniType<
|
|
26
|
+
ListSubscriptionLineItemsResponse,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
items: types.optional(z.array(SubscriptionLineItemResponse$inboundSchema)),
|
|
30
|
+
pagination: types.optional(PaginationResponse$inboundSchema),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export function listSubscriptionLineItemsResponseFromJSON(
|
|
34
|
+
jsonString: string,
|
|
35
|
+
): SafeParseResult<ListSubscriptionLineItemsResponse, SDKValidationError> {
|
|
36
|
+
return safeParse(
|
|
37
|
+
jsonString,
|
|
38
|
+
(x) => ListSubscriptionLineItemsResponse$inboundSchema.parse(JSON.parse(x)),
|
|
39
|
+
`Failed to parse 'ListSubscriptionLineItemsResponse' from JSON`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -32,6 +32,7 @@ export type PlanFilter = {
|
|
|
32
32
|
filters?: Array<FilterCondition> | undefined;
|
|
33
33
|
limit?: number | undefined;
|
|
34
34
|
lookupKey?: string | undefined;
|
|
35
|
+
metadata?: { [k: string]: string } | undefined;
|
|
35
36
|
offset?: number | undefined;
|
|
36
37
|
order?: PlanFilterOrder | undefined;
|
|
37
38
|
planIds?: Array<string> | undefined;
|
|
@@ -52,6 +53,7 @@ export type PlanFilter$Outbound = {
|
|
|
52
53
|
filters?: Array<FilterCondition$Outbound> | undefined;
|
|
53
54
|
limit?: number | undefined;
|
|
54
55
|
lookup_key?: string | undefined;
|
|
56
|
+
metadata?: { [k: string]: string } | undefined;
|
|
55
57
|
offset?: number | undefined;
|
|
56
58
|
order?: string | undefined;
|
|
57
59
|
plan_ids?: Array<string> | undefined;
|
|
@@ -71,6 +73,7 @@ export const PlanFilter$outboundSchema: z.ZodMiniType<
|
|
|
71
73
|
filters: z.optional(z.array(FilterCondition$outboundSchema)),
|
|
72
74
|
limit: z.optional(z.int()),
|
|
73
75
|
lookupKey: z.optional(z.string()),
|
|
76
|
+
metadata: z.optional(z.record(z.string(), z.string())),
|
|
74
77
|
offset: z.optional(z.int()),
|
|
75
78
|
order: z.optional(PlanFilterOrder$outboundSchema),
|
|
76
79
|
planIds: z.optional(z.array(z.string())),
|
|
@@ -7,6 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import * as types from "../../types/primitives.js";
|
|
10
|
+
import {
|
|
11
|
+
ExportMetadataField,
|
|
12
|
+
ExportMetadataField$inboundSchema,
|
|
13
|
+
ExportMetadataField$Outbound,
|
|
14
|
+
ExportMetadataField$outboundSchema,
|
|
15
|
+
} from "./export-metadata-field.js";
|
|
10
16
|
import {
|
|
11
17
|
S3CompressionType,
|
|
12
18
|
S3CompressionType$inboundSchema,
|
|
@@ -30,6 +36,10 @@ export type S3JobConfig = {
|
|
|
30
36
|
* Custom S3 endpoint URL (e.g., "http://minio:9000" for MinIO)
|
|
31
37
|
*/
|
|
32
38
|
endpointUrl?: string | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Optional user-selected metadata columns
|
|
41
|
+
*/
|
|
42
|
+
exportMetadataFields?: Array<ExportMetadataField> | undefined;
|
|
33
43
|
/**
|
|
34
44
|
* Optional prefix for S3 keys (e.g., "flexprice-exports/")
|
|
35
45
|
*/
|
|
@@ -39,7 +49,7 @@ export type S3JobConfig = {
|
|
|
39
49
|
*/
|
|
40
50
|
region?: string | undefined;
|
|
41
51
|
/**
|
|
42
|
-
* Use path-style addressing
|
|
52
|
+
* Use path-style addressing (required for MinIO)
|
|
43
53
|
*/
|
|
44
54
|
usePathStyle?: boolean | undefined;
|
|
45
55
|
};
|
|
@@ -52,6 +62,9 @@ export const S3JobConfig$inboundSchema: z.ZodMiniType<S3JobConfig, unknown> = z
|
|
|
52
62
|
compression: types.optional(S3CompressionType$inboundSchema),
|
|
53
63
|
encryption: types.optional(S3EncryptionType$inboundSchema),
|
|
54
64
|
endpoint_url: types.optional(types.string()),
|
|
65
|
+
export_metadata_fields: types.optional(
|
|
66
|
+
z.array(ExportMetadataField$inboundSchema),
|
|
67
|
+
),
|
|
55
68
|
key_prefix: types.optional(types.string()),
|
|
56
69
|
region: types.optional(types.string()),
|
|
57
70
|
use_path_style: types.optional(types.boolean()),
|
|
@@ -59,6 +72,7 @@ export const S3JobConfig$inboundSchema: z.ZodMiniType<S3JobConfig, unknown> = z
|
|
|
59
72
|
z.transform((v) => {
|
|
60
73
|
return remap$(v, {
|
|
61
74
|
"endpoint_url": "endpointUrl",
|
|
75
|
+
"export_metadata_fields": "exportMetadataFields",
|
|
62
76
|
"key_prefix": "keyPrefix",
|
|
63
77
|
"use_path_style": "usePathStyle",
|
|
64
78
|
});
|
|
@@ -70,6 +84,7 @@ export type S3JobConfig$Outbound = {
|
|
|
70
84
|
compression?: string | undefined;
|
|
71
85
|
encryption?: string | undefined;
|
|
72
86
|
endpoint_url?: string | undefined;
|
|
87
|
+
export_metadata_fields?: Array<ExportMetadataField$Outbound> | undefined;
|
|
73
88
|
key_prefix?: string | undefined;
|
|
74
89
|
region?: string | undefined;
|
|
75
90
|
use_path_style?: boolean | undefined;
|
|
@@ -85,6 +100,9 @@ export const S3JobConfig$outboundSchema: z.ZodMiniType<
|
|
|
85
100
|
compression: z.optional(S3CompressionType$outboundSchema),
|
|
86
101
|
encryption: z.optional(S3EncryptionType$outboundSchema),
|
|
87
102
|
endpointUrl: z.optional(z.string()),
|
|
103
|
+
exportMetadataFields: z.optional(
|
|
104
|
+
z.array(ExportMetadataField$outboundSchema),
|
|
105
|
+
),
|
|
88
106
|
keyPrefix: z.optional(z.string()),
|
|
89
107
|
region: z.optional(z.string()),
|
|
90
108
|
usePathStyle: z.optional(z.boolean()),
|
|
@@ -92,6 +110,7 @@ export const S3JobConfig$outboundSchema: z.ZodMiniType<
|
|
|
92
110
|
z.transform((v) => {
|
|
93
111
|
return remap$(v, {
|
|
94
112
|
endpointUrl: "endpoint_url",
|
|
113
|
+
exportMetadataFields: "export_metadata_fields",
|
|
95
114
|
keyPrefix: "key_prefix",
|
|
96
115
|
usePathStyle: "use_path_style",
|
|
97
116
|
});
|
|
@@ -11,6 +11,7 @@ export const ScheduledTaskEntityType = {
|
|
|
11
11
|
Invoice: "invoice",
|
|
12
12
|
CreditTopups: "credit_topups",
|
|
13
13
|
CreditUsage: "credit_usage",
|
|
14
|
+
UsageAnalytics: "usage_analytics",
|
|
14
15
|
} as const;
|
|
15
16
|
export type ScheduledTaskEntityType = OpenEnum<typeof ScheduledTaskEntityType>;
|
|
16
17
|
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
GroupedInvoicingAction,
|
|
9
|
+
GroupedInvoicingAction$outboundSchema,
|
|
10
|
+
} from "./grouped-invoicing-action.js";
|
|
11
|
+
|
|
12
|
+
export type SubModifyGroupedInvoicingParams = {
|
|
13
|
+
action: GroupedInvoicingAction;
|
|
14
|
+
childSubscriptionIds?: Array<string> | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* ParentSubscriptionID is required for action 'add'.
|
|
17
|
+
*/
|
|
18
|
+
parentSubscriptionId?: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export type SubModifyGroupedInvoicingParams$Outbound = {
|
|
23
|
+
action: string;
|
|
24
|
+
child_subscription_ids?: Array<string> | undefined;
|
|
25
|
+
parent_subscription_id?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const SubModifyGroupedInvoicingParams$outboundSchema: z.ZodMiniType<
|
|
30
|
+
SubModifyGroupedInvoicingParams$Outbound,
|
|
31
|
+
SubModifyGroupedInvoicingParams
|
|
32
|
+
> = z.pipe(
|
|
33
|
+
z.object({
|
|
34
|
+
action: GroupedInvoicingAction$outboundSchema,
|
|
35
|
+
childSubscriptionIds: z.optional(z.array(z.string())),
|
|
36
|
+
parentSubscriptionId: z.optional(z.string()),
|
|
37
|
+
}),
|
|
38
|
+
z.transform((v) => {
|
|
39
|
+
return remap$(v, {
|
|
40
|
+
childSubscriptionIds: "child_subscription_ids",
|
|
41
|
+
parentSubscriptionId: "parent_subscription_id",
|
|
42
|
+
});
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
export function subModifyGroupedInvoicingParamsToJSON(
|
|
47
|
+
subModifyGroupedInvoicingParams: SubModifyGroupedInvoicingParams,
|
|
48
|
+
): string {
|
|
49
|
+
return JSON.stringify(
|
|
50
|
+
SubModifyGroupedInvoicingParams$outboundSchema.parse(
|
|
51
|
+
subModifyGroupedInvoicingParams,
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -6,9 +6,34 @@ import * as z from "zod/v4-mini";
|
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
|
|
8
8
|
export type SubscriptionInheritanceConfig = {
|
|
9
|
+
/**
|
|
10
|
+
* ExternalCustomerIDsToInheritSubscription: child customer external IDs for which
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* inherited skeleton subscriptions will be created. Only valid for parent behavior.
|
|
14
|
+
*/
|
|
9
15
|
externalCustomerIdsToInheritSubscription?: Array<string> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* InvoicingCustomerExternalID sets a different billing recipient (external ID).
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Required for delegated; rejected for inherited; optional for others.
|
|
21
|
+
*/
|
|
10
22
|
invoicingCustomerExternalId?: string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* ParentSubscriptionID links this subscription to an existing parent.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* Required for inherited and grouped_invoicing; rejected for standalone, delegated, parent.
|
|
28
|
+
*/
|
|
11
29
|
parentSubscriptionId?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* SubscriptionsIDsForGroupedInvoicing: existing standalone subscription IDs to convert to
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* grouped_invoicing under this parent at creation time. Only valid for parent behavior.
|
|
35
|
+
*/
|
|
36
|
+
subscriptionsIdsForGroupedInvoicing?: Array<string> | undefined;
|
|
12
37
|
};
|
|
13
38
|
|
|
14
39
|
/** @internal */
|
|
@@ -16,6 +41,7 @@ export type SubscriptionInheritanceConfig$Outbound = {
|
|
|
16
41
|
external_customer_ids_to_inherit_subscription?: Array<string> | undefined;
|
|
17
42
|
invoicing_customer_external_id?: string | undefined;
|
|
18
43
|
parent_subscription_id?: string | undefined;
|
|
44
|
+
subscriptions_ids_for_grouped_invoicing?: Array<string> | undefined;
|
|
19
45
|
};
|
|
20
46
|
|
|
21
47
|
/** @internal */
|
|
@@ -27,6 +53,7 @@ export const SubscriptionInheritanceConfig$outboundSchema: z.ZodMiniType<
|
|
|
27
53
|
externalCustomerIdsToInheritSubscription: z.optional(z.array(z.string())),
|
|
28
54
|
invoicingCustomerExternalId: z.optional(z.string()),
|
|
29
55
|
parentSubscriptionId: z.optional(z.string()),
|
|
56
|
+
subscriptionsIdsForGroupedInvoicing: z.optional(z.array(z.string())),
|
|
30
57
|
}),
|
|
31
58
|
z.transform((v) => {
|
|
32
59
|
return remap$(v, {
|
|
@@ -34,6 +61,8 @@ export const SubscriptionInheritanceConfig$outboundSchema: z.ZodMiniType<
|
|
|
34
61
|
"external_customer_ids_to_inherit_subscription",
|
|
35
62
|
invoicingCustomerExternalId: "invoicing_customer_external_id",
|
|
36
63
|
parentSubscriptionId: "parent_subscription_id",
|
|
64
|
+
subscriptionsIdsForGroupedInvoicing:
|
|
65
|
+
"subscriptions_ids_for_grouped_invoicing",
|
|
37
66
|
});
|
|
38
67
|
}),
|
|
39
68
|
);
|
|
@@ -20,3 +20,8 @@ export const SubscriptionLineItemEntityType$inboundSchema: z.ZodMiniType<
|
|
|
20
20
|
SubscriptionLineItemEntityType,
|
|
21
21
|
unknown
|
|
22
22
|
> = openEnums.inboundSchema(SubscriptionLineItemEntityType);
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const SubscriptionLineItemEntityType$outboundSchema: z.ZodMiniType<
|
|
25
|
+
string,
|
|
26
|
+
SubscriptionLineItemEntityType
|
|
27
|
+
> = openEnums.outboundSchema(SubscriptionLineItemEntityType);
|
|
@@ -0,0 +1,140 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import {
|
|
9
|
+
FilterCondition,
|
|
10
|
+
FilterCondition$Outbound,
|
|
11
|
+
FilterCondition$outboundSchema,
|
|
12
|
+
} from "./filter-condition.js";
|
|
13
|
+
import {
|
|
14
|
+
SortCondition,
|
|
15
|
+
SortCondition$Outbound,
|
|
16
|
+
SortCondition$outboundSchema,
|
|
17
|
+
} from "./sort-condition.js";
|
|
18
|
+
import { Status, Status$outboundSchema } from "./status.js";
|
|
19
|
+
import {
|
|
20
|
+
SubscriptionLineItemEntityType,
|
|
21
|
+
SubscriptionLineItemEntityType$outboundSchema,
|
|
22
|
+
} from "./subscription-line-item-entity-type.js";
|
|
23
|
+
|
|
24
|
+
export const SubscriptionLineItemFilterOrder = {
|
|
25
|
+
Asc: "asc",
|
|
26
|
+
Desc: "desc",
|
|
27
|
+
} as const;
|
|
28
|
+
export type SubscriptionLineItemFilterOrder = ClosedEnum<
|
|
29
|
+
typeof SubscriptionLineItemFilterOrder
|
|
30
|
+
>;
|
|
31
|
+
|
|
32
|
+
export type SubscriptionLineItemFilter = {
|
|
33
|
+
activeFilter?: boolean | undefined;
|
|
34
|
+
addonAssociationIds?: Array<string> | undefined;
|
|
35
|
+
billingPeriods?: Array<string> | undefined;
|
|
36
|
+
currencies?: Array<string> | undefined;
|
|
37
|
+
currentPeriodStart?: Date | undefined;
|
|
38
|
+
customerIds?: Array<string> | undefined;
|
|
39
|
+
endTime?: Date | undefined;
|
|
40
|
+
entityIds?: Array<string> | undefined;
|
|
41
|
+
entityType?: SubscriptionLineItemEntityType | undefined;
|
|
42
|
+
expand?: string | undefined;
|
|
43
|
+
filters?: Array<FilterCondition> | undefined;
|
|
44
|
+
limit?: number | undefined;
|
|
45
|
+
meterIds?: Array<string> | undefined;
|
|
46
|
+
offset?: number | undefined;
|
|
47
|
+
order?: SubscriptionLineItemFilterOrder | undefined;
|
|
48
|
+
priceIds?: Array<string> | undefined;
|
|
49
|
+
sort?: Array<SortCondition> | undefined;
|
|
50
|
+
startTime?: Date | undefined;
|
|
51
|
+
status?: Status | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Specific filters
|
|
54
|
+
*/
|
|
55
|
+
subscriptionIds?: Array<string> | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const SubscriptionLineItemFilterOrder$outboundSchema: z.ZodMiniEnum<
|
|
60
|
+
typeof SubscriptionLineItemFilterOrder
|
|
61
|
+
> = z.enum(SubscriptionLineItemFilterOrder);
|
|
62
|
+
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type SubscriptionLineItemFilter$Outbound = {
|
|
65
|
+
active_filter: boolean;
|
|
66
|
+
addon_association_ids?: Array<string> | undefined;
|
|
67
|
+
billing_periods?: Array<string> | undefined;
|
|
68
|
+
currencies?: Array<string> | undefined;
|
|
69
|
+
current_period_start?: string | undefined;
|
|
70
|
+
customer_ids?: Array<string> | undefined;
|
|
71
|
+
end_time?: string | undefined;
|
|
72
|
+
entity_ids?: Array<string> | undefined;
|
|
73
|
+
entity_type?: string | undefined;
|
|
74
|
+
expand?: string | undefined;
|
|
75
|
+
filters?: Array<FilterCondition$Outbound> | undefined;
|
|
76
|
+
limit?: number | undefined;
|
|
77
|
+
meter_ids?: Array<string> | undefined;
|
|
78
|
+
offset?: number | undefined;
|
|
79
|
+
order?: string | undefined;
|
|
80
|
+
price_ids?: Array<string> | undefined;
|
|
81
|
+
sort?: Array<SortCondition$Outbound> | undefined;
|
|
82
|
+
start_time?: string | undefined;
|
|
83
|
+
status?: string | undefined;
|
|
84
|
+
subscription_ids?: Array<string> | undefined;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const SubscriptionLineItemFilter$outboundSchema: z.ZodMiniType<
|
|
89
|
+
SubscriptionLineItemFilter$Outbound,
|
|
90
|
+
SubscriptionLineItemFilter
|
|
91
|
+
> = z.pipe(
|
|
92
|
+
z.object({
|
|
93
|
+
activeFilter: z._default(z.boolean(), true),
|
|
94
|
+
addonAssociationIds: z.optional(z.array(z.string())),
|
|
95
|
+
billingPeriods: z.optional(z.array(z.string())),
|
|
96
|
+
currencies: z.optional(z.array(z.string())),
|
|
97
|
+
currentPeriodStart: z.optional(
|
|
98
|
+
z.pipe(z.date(), z.transform(v => v.toISOString())),
|
|
99
|
+
),
|
|
100
|
+
customerIds: z.optional(z.array(z.string())),
|
|
101
|
+
endTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
102
|
+
entityIds: z.optional(z.array(z.string())),
|
|
103
|
+
entityType: z.optional(SubscriptionLineItemEntityType$outboundSchema),
|
|
104
|
+
expand: z.optional(z.string()),
|
|
105
|
+
filters: z.optional(z.array(FilterCondition$outboundSchema)),
|
|
106
|
+
limit: z.optional(z.int()),
|
|
107
|
+
meterIds: z.optional(z.array(z.string())),
|
|
108
|
+
offset: z.optional(z.int()),
|
|
109
|
+
order: z.optional(SubscriptionLineItemFilterOrder$outboundSchema),
|
|
110
|
+
priceIds: z.optional(z.array(z.string())),
|
|
111
|
+
sort: z.optional(z.array(SortCondition$outboundSchema)),
|
|
112
|
+
startTime: z.optional(z.pipe(z.date(), z.transform(v => v.toISOString()))),
|
|
113
|
+
status: z.optional(Status$outboundSchema),
|
|
114
|
+
subscriptionIds: z.optional(z.array(z.string())),
|
|
115
|
+
}),
|
|
116
|
+
z.transform((v) => {
|
|
117
|
+
return remap$(v, {
|
|
118
|
+
activeFilter: "active_filter",
|
|
119
|
+
addonAssociationIds: "addon_association_ids",
|
|
120
|
+
billingPeriods: "billing_periods",
|
|
121
|
+
currentPeriodStart: "current_period_start",
|
|
122
|
+
customerIds: "customer_ids",
|
|
123
|
+
endTime: "end_time",
|
|
124
|
+
entityIds: "entity_ids",
|
|
125
|
+
entityType: "entity_type",
|
|
126
|
+
meterIds: "meter_ids",
|
|
127
|
+
priceIds: "price_ids",
|
|
128
|
+
startTime: "start_time",
|
|
129
|
+
subscriptionIds: "subscription_ids",
|
|
130
|
+
});
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export function subscriptionLineItemFilterToJSON(
|
|
135
|
+
subscriptionLineItemFilter: SubscriptionLineItemFilter,
|
|
136
|
+
): string {
|
|
137
|
+
return JSON.stringify(
|
|
138
|
+
SubscriptionLineItemFilter$outboundSchema.parse(subscriptionLineItemFilter),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -8,6 +8,7 @@ import { ClosedEnum } from "../../types/enums.js";
|
|
|
8
8
|
export const SubscriptionModifyType = {
|
|
9
9
|
Inheritance: "inheritance",
|
|
10
10
|
QuantityChange: "quantity_change",
|
|
11
|
+
GroupedInvoicing: "grouped_invoicing",
|
|
11
12
|
} as const;
|
|
12
13
|
export type SubscriptionModifyType = ClosedEnum<typeof SubscriptionModifyType>;
|
|
13
14
|
|
|
@@ -66,6 +66,14 @@ export type SubscriptionResponseV2 = {
|
|
|
66
66
|
* This will be null if no pause is active or scheduled
|
|
67
67
|
*/
|
|
68
68
|
activePauseId?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* an intermediate invoice. Overrides the plan-level threshold when set.
|
|
74
|
+
* Nil means: inherit from the plan's threshold (which may also be nil = disabled).
|
|
75
|
+
*/
|
|
76
|
+
autoInvoiceThreshold?: string | undefined;
|
|
69
77
|
/**
|
|
70
78
|
* BillingAnchor is the reference point that aligns future billing cycle dates.
|
|
71
79
|
*
|
|
@@ -234,6 +242,7 @@ export const SubscriptionResponseV2$inboundSchema: z.ZodMiniType<
|
|
|
234
242
|
> = z.pipe(
|
|
235
243
|
z.object({
|
|
236
244
|
active_pause_id: types.optional(types.string()),
|
|
245
|
+
auto_invoice_threshold: types.optional(types.string()),
|
|
237
246
|
billing_anchor: types.optional(types.date()),
|
|
238
247
|
billing_cadence: types.optional(BillingCadence$inboundSchema),
|
|
239
248
|
billing_cycle: types.optional(BillingCycle$inboundSchema),
|
|
@@ -294,6 +303,7 @@ export const SubscriptionResponseV2$inboundSchema: z.ZodMiniType<
|
|
|
294
303
|
z.transform((v) => {
|
|
295
304
|
return remap$(v, {
|
|
296
305
|
"active_pause_id": "activePauseId",
|
|
306
|
+
"auto_invoice_threshold": "autoInvoiceThreshold",
|
|
297
307
|
"billing_anchor": "billingAnchor",
|
|
298
308
|
"billing_cadence": "billingCadence",
|
|
299
309
|
"billing_cycle": "billingCycle",
|
|
@@ -70,6 +70,14 @@ export type SubscriptionResponse = {
|
|
|
70
70
|
* This will be null if no pause is active or scheduled
|
|
71
71
|
*/
|
|
72
72
|
activePauseId?: string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* an intermediate invoice. Overrides the plan-level threshold when set.
|
|
78
|
+
* Nil means: inherit from the plan's threshold (which may also be nil = disabled).
|
|
79
|
+
*/
|
|
80
|
+
autoInvoiceThreshold?: string | undefined;
|
|
73
81
|
/**
|
|
74
82
|
* BillingAnchor is the reference point that aligns future billing cycle dates.
|
|
75
83
|
*
|
|
@@ -230,6 +238,7 @@ export const SubscriptionResponse$inboundSchema: z.ZodMiniType<
|
|
|
230
238
|
> = z.pipe(
|
|
231
239
|
z.object({
|
|
232
240
|
active_pause_id: types.optional(types.string()),
|
|
241
|
+
auto_invoice_threshold: types.optional(types.string()),
|
|
233
242
|
billing_anchor: types.optional(types.date()),
|
|
234
243
|
billing_cadence: types.optional(BillingCadence$inboundSchema),
|
|
235
244
|
billing_cycle: types.optional(BillingCycle$inboundSchema),
|
|
@@ -291,6 +300,7 @@ export const SubscriptionResponse$inboundSchema: z.ZodMiniType<
|
|
|
291
300
|
z.transform((v) => {
|
|
292
301
|
return remap$(v, {
|
|
293
302
|
"active_pause_id": "activePauseId",
|
|
303
|
+
"auto_invoice_threshold": "autoInvoiceThreshold",
|
|
294
304
|
"billing_anchor": "billingAnchor",
|
|
295
305
|
"billing_cadence": "billingCadence",
|
|
296
306
|
"billing_cycle": "billingCycle",
|
|
@@ -8,8 +8,10 @@ import { OpenEnum } from "../../types/enums.js";
|
|
|
8
8
|
|
|
9
9
|
export const SubscriptionType = {
|
|
10
10
|
Standalone: "standalone",
|
|
11
|
+
DelegatedInvoicing: "delegated_invoicing",
|
|
11
12
|
Parent: "parent",
|
|
12
13
|
Inherited: "inherited",
|
|
14
|
+
GroupedInvoicing: "grouped_invoicing",
|
|
13
15
|
} as const;
|
|
14
16
|
export type SubscriptionType = OpenEnum<typeof SubscriptionType>;
|
|
15
17
|
|
package/src/sdk/subscriptions.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { subscriptionsListAllSubscriptionSchedules } from "../funcs/subscription
|
|
|
22
22
|
import { subscriptionsListSubscriptionSchedules } from "../funcs/subscriptions-list-subscription-schedules.js";
|
|
23
23
|
import { subscriptionsPreviewSubscriptionChange } from "../funcs/subscriptions-preview-subscription-change.js";
|
|
24
24
|
import { subscriptionsPreviewSubscriptionModify } from "../funcs/subscriptions-preview-subscription-modify.js";
|
|
25
|
+
import { subscriptionsQuerySubscriptionLineItems } from "../funcs/subscriptions-query-subscription-line-items.js";
|
|
25
26
|
import { subscriptionsQuerySubscription } from "../funcs/subscriptions-query-subscription.js";
|
|
26
27
|
import { subscriptionsRemoveSubscriptionAddon } from "../funcs/subscriptions-remove-subscription-addon.js";
|
|
27
28
|
import { subscriptionsUpdateSubscriptionLineItem } from "../funcs/subscriptions-update-subscription-line-item.js";
|
|
@@ -82,6 +83,23 @@ export class Subscriptions extends ClientSDK {
|
|
|
82
83
|
));
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Search subscription line items
|
|
88
|
+
*
|
|
89
|
+
* @remarks
|
|
90
|
+
* List subscription line items with a JSON filter (subscription, customer, price, pagination, expand=prices, etc.).
|
|
91
|
+
*/
|
|
92
|
+
async querySubscriptionLineItems(
|
|
93
|
+
request: models.SubscriptionLineItemFilter,
|
|
94
|
+
options?: RequestOptions,
|
|
95
|
+
): Promise<models.ListSubscriptionLineItemsResponse> {
|
|
96
|
+
return unwrapAsync(subscriptionsQuerySubscriptionLineItems(
|
|
97
|
+
this,
|
|
98
|
+
request,
|
|
99
|
+
options,
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
|
|
85
103
|
/**
|
|
86
104
|
* Update subscription line item
|
|
87
105
|
*
|
package/src/types/primitives.ts
CHANGED
|
@@ -131,13 +131,11 @@ export function literalBigInt<T extends bigint>(value: T): z.ZodMiniType<T> {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export function optional<T extends z.ZodMiniType>(t: T) {
|
|
134
|
-
return z.union([
|
|
135
|
-
z.undefined(),
|
|
136
|
-
|
|
134
|
+
return z.optional(z.union([
|
|
137
135
|
// Null -> undefined
|
|
138
136
|
z.pipe(z.null(), z.transform(() => unrecognized(undefined))),
|
|
139
137
|
t,
|
|
140
|
-
]);
|
|
138
|
+
]));
|
|
141
139
|
}
|
|
142
140
|
|
|
143
141
|
export function nullable<T extends z.ZodMiniType>(t: T) {
|