@paygentic/sdk 0.9.18 → 0.10.1
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/README.md +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/authorizationdenialreason.d.ts +17 -0
- package/dist/commonjs/models/authorizationdenialreason.d.ts.map +1 -0
- package/dist/commonjs/models/authorizationdenialreason.js +51 -0
- package/dist/commonjs/models/authorizationdenialreason.js.map +1 -0
- package/dist/commonjs/models/errors/error.d.ts +17 -0
- package/dist/commonjs/models/errors/error.d.ts.map +1 -1
- package/dist/commonjs/models/errors/error.js +8 -0
- package/dist/commonjs/models/errors/error.js.map +1 -1
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts +16 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.d.ts.map +1 -1
- package/dist/commonjs/models/errors/recordinvoicepayment.js +7 -0
- package/dist/commonjs/models/errors/recordinvoicepayment.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +15 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +15 -0
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/invoicelineitem.d.ts +5 -0
- package/dist/commonjs/models/invoicelineitem.d.ts.map +1 -1
- package/dist/commonjs/models/invoicelineitem.js +2 -0
- package/dist/commonjs/models/invoicelineitem.js.map +1 -1
- package/dist/commonjs/models/linecalculationcontribution.d.ts +12 -0
- package/dist/commonjs/models/linecalculationcontribution.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationcontribution.js +52 -0
- package/dist/commonjs/models/linecalculationcontribution.js.map +1 -0
- package/dist/commonjs/models/linecalculationgiven.d.ts +20 -0
- package/dist/commonjs/models/linecalculationgiven.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationgiven.js +51 -0
- package/dist/commonjs/models/linecalculationgiven.js.map +1 -0
- package/dist/commonjs/models/linecalculationinputprice.d.ts +21 -0
- package/dist/commonjs/models/linecalculationinputprice.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationinputprice.js +52 -0
- package/dist/commonjs/models/linecalculationinputprice.js.map +1 -0
- package/dist/commonjs/models/linecalculationinputs.d.ts +34 -0
- package/dist/commonjs/models/linecalculationinputs.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationinputs.js +56 -0
- package/dist/commonjs/models/linecalculationinputs.js.map +1 -0
- package/dist/commonjs/models/linecalculationnotapplied.d.ts +20 -0
- package/dist/commonjs/models/linecalculationnotapplied.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationnotapplied.js +51 -0
- package/dist/commonjs/models/linecalculationnotapplied.js.map +1 -0
- package/dist/commonjs/models/linecalculationperiod.d.ts +14 -0
- package/dist/commonjs/models/linecalculationperiod.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationperiod.js +51 -0
- package/dist/commonjs/models/linecalculationperiod.js.map +1 -0
- package/dist/commonjs/models/linecalculationprecision.d.ts +14 -0
- package/dist/commonjs/models/linecalculationprecision.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationprecision.js +51 -0
- package/dist/commonjs/models/linecalculationprecision.js.map +1 -0
- package/dist/commonjs/models/linecalculationpriceband.d.ts +11 -0
- package/dist/commonjs/models/linecalculationpriceband.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationpriceband.js +51 -0
- package/dist/commonjs/models/linecalculationpriceband.js.map +1 -0
- package/dist/commonjs/models/linecalculationpricefn.d.ts +40 -0
- package/dist/commonjs/models/linecalculationpricefn.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationpricefn.js +56 -0
- package/dist/commonjs/models/linecalculationpricefn.js.map +1 -0
- package/dist/commonjs/models/linecalculationresult.d.ts +24 -0
- package/dist/commonjs/models/linecalculationresult.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationresult.js +52 -0
- package/dist/commonjs/models/linecalculationresult.js.map +1 -0
- package/dist/commonjs/models/linecalculationsource.d.ts +32 -0
- package/dist/commonjs/models/linecalculationsource.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationsource.js +53 -0
- package/dist/commonjs/models/linecalculationsource.js.map +1 -0
- package/dist/commonjs/models/linecalculationstep.d.ts +50 -0
- package/dist/commonjs/models/linecalculationstep.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationstep.js +59 -0
- package/dist/commonjs/models/linecalculationstep.js.map +1 -0
- package/dist/commonjs/models/linecalculationvalue.d.ts +12 -0
- package/dist/commonjs/models/linecalculationvalue.d.ts.map +1 -0
- package/dist/commonjs/models/linecalculationvalue.js +49 -0
- package/dist/commonjs/models/linecalculationvalue.js.map +1 -0
- package/dist/commonjs/models/lineitem.d.ts +5 -0
- package/dist/commonjs/models/lineitem.d.ts.map +1 -1
- package/dist/commonjs/models/lineitem.js +2 -0
- package/dist/commonjs/models/lineitem.js.map +1 -1
- package/dist/commonjs/models/lineprovenance.d.ts +69 -0
- package/dist/commonjs/models/lineprovenance.d.ts.map +1 -0
- package/dist/commonjs/models/lineprovenance.js +68 -0
- package/dist/commonjs/models/lineprovenance.js.map +1 -0
- package/dist/commonjs/models/operations/getinvoice.d.ts +1 -1
- package/dist/commonjs/models/operations/getinvoicelineitems.d.ts +1 -1
- package/dist/commonjs/models/operations/listlineitems.d.ts +1 -1
- package/dist/commonjs/models/operations/listsubscriptions.d.ts +5 -2
- package/dist/commonjs/models/operations/listsubscriptions.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listsubscriptions.js +1 -1
- package/dist/commonjs/models/operations/listsubscriptions.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/authorizationdenialreason.d.ts +17 -0
- package/dist/esm/models/authorizationdenialreason.d.ts.map +1 -0
- package/dist/esm/models/authorizationdenialreason.js +15 -0
- package/dist/esm/models/authorizationdenialreason.js.map +1 -0
- package/dist/esm/models/errors/error.d.ts +17 -0
- package/dist/esm/models/errors/error.d.ts.map +1 -1
- package/dist/esm/models/errors/error.js +8 -0
- package/dist/esm/models/errors/error.js.map +1 -1
- package/dist/esm/models/errors/recordinvoicepayment.d.ts +16 -0
- package/dist/esm/models/errors/recordinvoicepayment.d.ts.map +1 -1
- package/dist/esm/models/errors/recordinvoicepayment.js +7 -0
- package/dist/esm/models/errors/recordinvoicepayment.js.map +1 -1
- package/dist/esm/models/index.d.ts +15 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +15 -0
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/invoicelineitem.d.ts +5 -0
- package/dist/esm/models/invoicelineitem.d.ts.map +1 -1
- package/dist/esm/models/invoicelineitem.js +2 -0
- package/dist/esm/models/invoicelineitem.js.map +1 -1
- package/dist/esm/models/linecalculationcontribution.d.ts +12 -0
- package/dist/esm/models/linecalculationcontribution.d.ts.map +1 -0
- package/dist/esm/models/linecalculationcontribution.js +15 -0
- package/dist/esm/models/linecalculationcontribution.js.map +1 -0
- package/dist/esm/models/linecalculationgiven.d.ts +20 -0
- package/dist/esm/models/linecalculationgiven.d.ts.map +1 -0
- package/dist/esm/models/linecalculationgiven.js +14 -0
- package/dist/esm/models/linecalculationgiven.js.map +1 -0
- package/dist/esm/models/linecalculationinputprice.d.ts +21 -0
- package/dist/esm/models/linecalculationinputprice.d.ts.map +1 -0
- package/dist/esm/models/linecalculationinputprice.js +15 -0
- package/dist/esm/models/linecalculationinputprice.js.map +1 -0
- package/dist/esm/models/linecalculationinputs.d.ts +34 -0
- package/dist/esm/models/linecalculationinputs.d.ts.map +1 -0
- package/dist/esm/models/linecalculationinputs.js +19 -0
- package/dist/esm/models/linecalculationinputs.js.map +1 -0
- package/dist/esm/models/linecalculationnotapplied.d.ts +20 -0
- package/dist/esm/models/linecalculationnotapplied.d.ts.map +1 -0
- package/dist/esm/models/linecalculationnotapplied.js +14 -0
- package/dist/esm/models/linecalculationnotapplied.js.map +1 -0
- package/dist/esm/models/linecalculationperiod.d.ts +14 -0
- package/dist/esm/models/linecalculationperiod.d.ts.map +1 -0
- package/dist/esm/models/linecalculationperiod.js +14 -0
- package/dist/esm/models/linecalculationperiod.js.map +1 -0
- package/dist/esm/models/linecalculationprecision.d.ts +14 -0
- package/dist/esm/models/linecalculationprecision.d.ts.map +1 -0
- package/dist/esm/models/linecalculationprecision.js +14 -0
- package/dist/esm/models/linecalculationprecision.js.map +1 -0
- package/dist/esm/models/linecalculationpriceband.d.ts +11 -0
- package/dist/esm/models/linecalculationpriceband.d.ts.map +1 -0
- package/dist/esm/models/linecalculationpriceband.js +14 -0
- package/dist/esm/models/linecalculationpriceband.js.map +1 -0
- package/dist/esm/models/linecalculationpricefn.d.ts +40 -0
- package/dist/esm/models/linecalculationpricefn.d.ts.map +1 -0
- package/dist/esm/models/linecalculationpricefn.js +19 -0
- package/dist/esm/models/linecalculationpricefn.js.map +1 -0
- package/dist/esm/models/linecalculationresult.d.ts +24 -0
- package/dist/esm/models/linecalculationresult.d.ts.map +1 -0
- package/dist/esm/models/linecalculationresult.js +15 -0
- package/dist/esm/models/linecalculationresult.js.map +1 -0
- package/dist/esm/models/linecalculationsource.d.ts +32 -0
- package/dist/esm/models/linecalculationsource.d.ts.map +1 -0
- package/dist/esm/models/linecalculationsource.js +16 -0
- package/dist/esm/models/linecalculationsource.js.map +1 -0
- package/dist/esm/models/linecalculationstep.d.ts +50 -0
- package/dist/esm/models/linecalculationstep.d.ts.map +1 -0
- package/dist/esm/models/linecalculationstep.js +22 -0
- package/dist/esm/models/linecalculationstep.js.map +1 -0
- package/dist/esm/models/linecalculationvalue.d.ts +12 -0
- package/dist/esm/models/linecalculationvalue.d.ts.map +1 -0
- package/dist/esm/models/linecalculationvalue.js +12 -0
- package/dist/esm/models/linecalculationvalue.js.map +1 -0
- package/dist/esm/models/lineitem.d.ts +5 -0
- package/dist/esm/models/lineitem.d.ts.map +1 -1
- package/dist/esm/models/lineitem.js +2 -0
- package/dist/esm/models/lineitem.js.map +1 -1
- package/dist/esm/models/lineprovenance.d.ts +69 -0
- package/dist/esm/models/lineprovenance.d.ts.map +1 -0
- package/dist/esm/models/lineprovenance.js +31 -0
- package/dist/esm/models/lineprovenance.js.map +1 -0
- package/dist/esm/models/operations/getinvoice.d.ts +1 -1
- package/dist/esm/models/operations/getinvoicelineitems.d.ts +1 -1
- package/dist/esm/models/operations/listlineitems.d.ts +1 -1
- package/dist/esm/models/operations/listsubscriptions.d.ts +5 -2
- package/dist/esm/models/operations/listsubscriptions.d.ts.map +1 -1
- package/dist/esm/models/operations/listsubscriptions.js +1 -1
- package/dist/esm/models/operations/listsubscriptions.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/authorizationdenialreason.ts +26 -0
- package/src/models/errors/error.ts +23 -0
- package/src/models/errors/recordinvoicepayment.ts +22 -0
- package/src/models/index.ts +15 -0
- package/src/models/invoicelineitem.ts +9 -0
- package/src/models/linecalculationcontribution.ts +35 -0
- package/src/models/linecalculationgiven.ts +42 -0
- package/src/models/linecalculationinputprice.ts +46 -0
- package/src/models/linecalculationinputs.ts +65 -0
- package/src/models/linecalculationnotapplied.ts +42 -0
- package/src/models/linecalculationperiod.ts +36 -0
- package/src/models/linecalculationprecision.ts +36 -0
- package/src/models/linecalculationpriceband.ts +33 -0
- package/src/models/linecalculationpricefn.ts +74 -0
- package/src/models/linecalculationresult.ts +47 -0
- package/src/models/linecalculationsource.ts +52 -0
- package/src/models/linecalculationstep.ts +80 -0
- package/src/models/linecalculationvalue.ts +34 -0
- package/src/models/lineitem.ts +9 -0
- package/src/models/lineprovenance.ts +122 -0
- package/src/models/operations/getinvoice.ts +1 -1
- package/src/models/operations/getinvoicelineitems.ts +1 -1
- package/src/models/operations/listlineitems.ts +1 -1
- package/src/models/operations/listsubscriptions.ts +6 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A rule in force for the line that did not change it.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationNotApplied = {
|
|
14
|
+
/**
|
|
15
|
+
* The key of the rule's source in `sources`.
|
|
16
|
+
*/
|
|
17
|
+
source: string;
|
|
18
|
+
/**
|
|
19
|
+
* Why the rule did not change the line, for example `within` or `notBinding`.
|
|
20
|
+
*/
|
|
21
|
+
reason: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const LineCalculationNotApplied$inboundSchema: z.ZodType<
|
|
26
|
+
LineCalculationNotApplied,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
source: z.string(),
|
|
31
|
+
reason: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function lineCalculationNotAppliedFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<LineCalculationNotApplied, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => LineCalculationNotApplied$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'LineCalculationNotApplied' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The period the line bills.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationPeriod = {
|
|
14
|
+
start: Date;
|
|
15
|
+
end: Date;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const LineCalculationPeriod$inboundSchema: z.ZodType<
|
|
20
|
+
LineCalculationPeriod,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
start: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
25
|
+
end: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function lineCalculationPeriodFromJSON(
|
|
29
|
+
jsonString: string,
|
|
30
|
+
): SafeParseResult<LineCalculationPeriod, SDKValidationError> {
|
|
31
|
+
return safeParse(
|
|
32
|
+
jsonString,
|
|
33
|
+
(x) => LineCalculationPeriod$inboundSchema.parse(JSON.parse(x)),
|
|
34
|
+
`Failed to parse 'LineCalculationPeriod' from JSON`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The default arithmetic of every step. Any other rounding is an explicit `round` step.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationPrecision = {
|
|
14
|
+
significantDigits: number;
|
|
15
|
+
rounding: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const LineCalculationPrecision$inboundSchema: z.ZodType<
|
|
20
|
+
LineCalculationPrecision,
|
|
21
|
+
z.ZodTypeDef,
|
|
22
|
+
unknown
|
|
23
|
+
> = z.object({
|
|
24
|
+
significantDigits: z.number().int(),
|
|
25
|
+
rounding: z.string(),
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export function lineCalculationPrecisionFromJSON(
|
|
29
|
+
jsonString: string,
|
|
30
|
+
): SafeParseResult<LineCalculationPrecision, SDKValidationError> {
|
|
31
|
+
return safeParse(
|
|
32
|
+
jsonString,
|
|
33
|
+
(x) => LineCalculationPrecision$inboundSchema.parse(JSON.parse(x)),
|
|
34
|
+
`Failed to parse 'LineCalculationPrecision' from JSON`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type LineCalculationPriceBand = {
|
|
11
|
+
upTo: string | null;
|
|
12
|
+
rate: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const LineCalculationPriceBand$inboundSchema: z.ZodType<
|
|
17
|
+
LineCalculationPriceBand,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
upTo: z.nullable(z.string()),
|
|
22
|
+
rate: z.string(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export function lineCalculationPriceBandFromJSON(
|
|
26
|
+
jsonString: string,
|
|
27
|
+
): SafeParseResult<LineCalculationPriceBand, SDKValidationError> {
|
|
28
|
+
return safeParse(
|
|
29
|
+
jsonString,
|
|
30
|
+
(x) => LineCalculationPriceBand$inboundSchema.parse(JSON.parse(x)),
|
|
31
|
+
`Failed to parse 'LineCalculationPriceBand' from JSON`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import {
|
|
7
|
+
collectExtraKeys as collectExtraKeys$,
|
|
8
|
+
safeParse,
|
|
9
|
+
} from "../lib/schemas.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
11
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
12
|
+
import {
|
|
13
|
+
LineCalculationPriceBand,
|
|
14
|
+
LineCalculationPriceBand$inboundSchema,
|
|
15
|
+
} from "./linecalculationpriceband.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A price as a function from quantity to money. A new model may carry fields not listed here.
|
|
19
|
+
*/
|
|
20
|
+
export type LineCalculationPriceFn = {
|
|
21
|
+
/**
|
|
22
|
+
* `unit`: `rate` per unit. `volume`: `bands`, each with `upTo` (null for the open band) and `rate`; one band prices every unit. `percentage`: `rate` as a fraction, with `min` and `max` charge or null. `flat`: one `amount`. `dynamic`: the quantity is already money. An open set, so it is a string rather than an enum: known values are `unit`, `volume`, `percentage`, `flat`, `dynamic`, and new values may be added.
|
|
23
|
+
*/
|
|
24
|
+
model: string;
|
|
25
|
+
/**
|
|
26
|
+
* `unit`, `percentage`: the rate.
|
|
27
|
+
*/
|
|
28
|
+
rate?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* `volume` only: the bands in ascending order.
|
|
31
|
+
*/
|
|
32
|
+
bands?: Array<LineCalculationPriceBand> | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* `percentage` only: the minimum charge, or null.
|
|
35
|
+
*/
|
|
36
|
+
min?: string | null | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* `percentage` only: the maximum charge, or null.
|
|
39
|
+
*/
|
|
40
|
+
max?: string | null | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* `flat` only: the amount for the period.
|
|
43
|
+
*/
|
|
44
|
+
amount?: string | undefined;
|
|
45
|
+
additionalProperties?: { [k: string]: any } | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const LineCalculationPriceFn$inboundSchema: z.ZodType<
|
|
50
|
+
LineCalculationPriceFn,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
unknown
|
|
53
|
+
> = collectExtraKeys$(
|
|
54
|
+
z.object({
|
|
55
|
+
model: z.string(),
|
|
56
|
+
rate: z.string().optional(),
|
|
57
|
+
bands: z.array(LineCalculationPriceBand$inboundSchema).optional(),
|
|
58
|
+
min: z.nullable(z.string()).optional(),
|
|
59
|
+
max: z.nullable(z.string()).optional(),
|
|
60
|
+
amount: z.string().optional(),
|
|
61
|
+
}).catchall(z.any()),
|
|
62
|
+
"additionalProperties",
|
|
63
|
+
true,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export function lineCalculationPriceFnFromJSON(
|
|
67
|
+
jsonString: string,
|
|
68
|
+
): SafeParseResult<LineCalculationPriceFn, SDKValidationError> {
|
|
69
|
+
return safeParse(
|
|
70
|
+
jsonString,
|
|
71
|
+
(x) => LineCalculationPriceFn$inboundSchema.parse(JSON.parse(x)),
|
|
72
|
+
`Failed to parse 'LineCalculationPriceFn' from JSON`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Equal to the line's stored amount, quantity and unit price.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationResult = {
|
|
14
|
+
/**
|
|
15
|
+
* The line's amount before tax.
|
|
16
|
+
*/
|
|
17
|
+
amount: string;
|
|
18
|
+
/**
|
|
19
|
+
* The line's quantity.
|
|
20
|
+
*/
|
|
21
|
+
quantity: string | null;
|
|
22
|
+
/**
|
|
23
|
+
* The line's unit price. It can be rounded, so quantity times unit price can differ from the amount.
|
|
24
|
+
*/
|
|
25
|
+
unitPrice: string | null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const LineCalculationResult$inboundSchema: z.ZodType<
|
|
30
|
+
LineCalculationResult,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
amount: z.string(),
|
|
35
|
+
quantity: z.nullable(z.string()),
|
|
36
|
+
unitPrice: z.nullable(z.string()),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export function lineCalculationResultFromJSON(
|
|
40
|
+
jsonString: string,
|
|
41
|
+
): SafeParseResult<LineCalculationResult, SDKValidationError> {
|
|
42
|
+
return safeParse(
|
|
43
|
+
jsonString,
|
|
44
|
+
(x) => LineCalculationResult$inboundSchema.parse(JSON.parse(x)),
|
|
45
|
+
`Failed to parse 'LineCalculationResult' from JSON`,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Where a value came from: `ref`, a link that can break after the invoice is issued, and `asUsed`, the values the calculation read, which never change.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationSource = {
|
|
14
|
+
/**
|
|
15
|
+
* `interval`: a subscription price interval. `price`: a catalog price. `meter`: a billable metric read directly. `entitlement`: the grant engine's reading of an entitlement. `grant`: a grant. `adjustment`: a subscription adjustment. `line`: another line on the invoice. `storedRow`: a figure the line already stored, with `reason`. `merchant`: an amount a merchant entered. `input` is reserved for a value from a system that is not a meter, with `ref` `name` and `eventId` and `asUsed` `value` and `unit`; nothing produces it yet. An open set, so it is a string rather than an enum: known values are `interval`, `price`, `meter`, `entitlement`, `grant`, `adjustment`, `line`, `storedRow`, `merchant`, and new values may be added.
|
|
16
|
+
*/
|
|
17
|
+
type: string;
|
|
18
|
+
/**
|
|
19
|
+
* The ids that link to the resource.
|
|
20
|
+
*/
|
|
21
|
+
ref?: { [k: string]: any } | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The values the calculation read from the resource. A `line` source has `amount`, and `unitPrice` where a step read the line's rate.
|
|
24
|
+
*/
|
|
25
|
+
asUsed?: { [k: string]: any } | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* `storedRow` only: why the stored figure stands. An open set, so it is a string rather than an enum: known values are `precedes_timeline`, `no_timeline`, `not_derived`, `no_covering_charge`, and new values may be added.
|
|
28
|
+
*/
|
|
29
|
+
reason?: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export const LineCalculationSource$inboundSchema: z.ZodType<
|
|
34
|
+
LineCalculationSource,
|
|
35
|
+
z.ZodTypeDef,
|
|
36
|
+
unknown
|
|
37
|
+
> = z.object({
|
|
38
|
+
type: z.string(),
|
|
39
|
+
ref: z.record(z.any()).optional(),
|
|
40
|
+
asUsed: z.record(z.any()).optional(),
|
|
41
|
+
reason: z.string().optional(),
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export function lineCalculationSourceFromJSON(
|
|
45
|
+
jsonString: string,
|
|
46
|
+
): SafeParseResult<LineCalculationSource, SDKValidationError> {
|
|
47
|
+
return safeParse(
|
|
48
|
+
jsonString,
|
|
49
|
+
(x) => LineCalculationSource$inboundSchema.parse(JSON.parse(x)),
|
|
50
|
+
`Failed to parse 'LineCalculationSource' from JSON`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LineCalculationContribution,
|
|
11
|
+
LineCalculationContribution$inboundSchema,
|
|
12
|
+
} from "./linecalculationcontribution.js";
|
|
13
|
+
import {
|
|
14
|
+
LineCalculationValue,
|
|
15
|
+
LineCalculationValue$inboundSchema,
|
|
16
|
+
} from "./linecalculationvalue.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* One step: the value it changed (`on`), the value before (`in`) and after (`out`), the rule's parameters, and the source of the rule. A reader that does not know an op shows it as "in → out, because source".
|
|
20
|
+
*/
|
|
21
|
+
export type LineCalculationStep = {
|
|
22
|
+
/**
|
|
23
|
+
* `allow`: units a grant covered (`covered`). `clamp`: `min` and `max`, null when open. `scaleToBound`: a minimum or maximum applied to a group of lines by uniform scaling (`bound`, `side`, `measured`, `factor`). `setToBound`: a minimum applied to a group that measured zero (`bound`, `sumOfShares`). `prorate`: `fraction` of the period, with the `billed` and full (`of`) windows and the `basis`. `evaluate`: the one join of quantity and price into an amount (`quantity`, `selector`, `fn`, `applied`); its `in` is null. `cap`: `max` and `scope`; on an `invoice` cap also `total`, what the cap started at, and `usedBefore`, what earlier credits took from it. `replace`: a value set by a rule, with `reason`. `subtract`: `units`. `scale`: ordered `terms`, each `by`, `value` and `label`. A `subtract`, `clamp` or `scale` that did not use the envelope's precision says so in `arithmetic`: `float64` or `decimal120`. `round`: `scale` and `mode`. An open set, so it is a string rather than an enum: known values are `allow`, `clamp`, `scaleToBound`, `setToBound`, `prorate`, `evaluate`, `cap`, `replace`, `subtract`, `scale`, `round`, and new values may be added.
|
|
24
|
+
*/
|
|
25
|
+
op: string;
|
|
26
|
+
/**
|
|
27
|
+
* The value the step changes. `quantity`, `selector` (the quantity a volume band is chosen on), `price` and `amount` are reserved; other names may be added.
|
|
28
|
+
*/
|
|
29
|
+
on: string;
|
|
30
|
+
/**
|
|
31
|
+
* The value before the step. Null only on `evaluate`.
|
|
32
|
+
*/
|
|
33
|
+
in: LineCalculationValue | null;
|
|
34
|
+
/**
|
|
35
|
+
* A decimal string, or a price function.
|
|
36
|
+
*/
|
|
37
|
+
out: LineCalculationValue;
|
|
38
|
+
/**
|
|
39
|
+
* The parameters of the op. See `op`.
|
|
40
|
+
*/
|
|
41
|
+
params: { [k: string]: any };
|
|
42
|
+
/**
|
|
43
|
+
* The key of the source in `sources` whose rule this is.
|
|
44
|
+
*/
|
|
45
|
+
source: string;
|
|
46
|
+
/**
|
|
47
|
+
* The other lines a group rule read, with each one's value and period share.
|
|
48
|
+
*/
|
|
49
|
+
inputsFrom?: Array<LineCalculationContribution> | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Reserved for an `evaluate` of a custom pricing function: the steps inside it, each of the same shape as a step. Free-form here so the schema does not refer to itself. Nothing produces it yet.
|
|
52
|
+
*/
|
|
53
|
+
trace?: Array<{ [k: string]: any }> | undefined;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const LineCalculationStep$inboundSchema: z.ZodType<
|
|
58
|
+
LineCalculationStep,
|
|
59
|
+
z.ZodTypeDef,
|
|
60
|
+
unknown
|
|
61
|
+
> = z.object({
|
|
62
|
+
op: z.string(),
|
|
63
|
+
on: z.string(),
|
|
64
|
+
in: z.nullable(LineCalculationValue$inboundSchema),
|
|
65
|
+
out: LineCalculationValue$inboundSchema,
|
|
66
|
+
params: z.record(z.any()),
|
|
67
|
+
source: z.string(),
|
|
68
|
+
inputsFrom: z.array(LineCalculationContribution$inboundSchema).optional(),
|
|
69
|
+
trace: z.array(z.record(z.any())).optional(),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export function lineCalculationStepFromJSON(
|
|
73
|
+
jsonString: string,
|
|
74
|
+
): SafeParseResult<LineCalculationStep, SDKValidationError> {
|
|
75
|
+
return safeParse(
|
|
76
|
+
jsonString,
|
|
77
|
+
(x) => LineCalculationStep$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
+
`Failed to parse 'LineCalculationStep' from JSON`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LineCalculationPriceFn,
|
|
11
|
+
LineCalculationPriceFn$inboundSchema,
|
|
12
|
+
} from "./linecalculationpricefn.js";
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A decimal string, or a price function.
|
|
16
|
+
*/
|
|
17
|
+
export type LineCalculationValue = LineCalculationPriceFn | string;
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const LineCalculationValue$inboundSchema: z.ZodType<
|
|
21
|
+
LineCalculationValue,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.union([LineCalculationPriceFn$inboundSchema, z.string()]);
|
|
25
|
+
|
|
26
|
+
export function lineCalculationValueFromJSON(
|
|
27
|
+
jsonString: string,
|
|
28
|
+
): SafeParseResult<LineCalculationValue, SDKValidationError> {
|
|
29
|
+
return safeParse(
|
|
30
|
+
jsonString,
|
|
31
|
+
(x) => LineCalculationValue$inboundSchema.parse(JSON.parse(x)),
|
|
32
|
+
`Failed to parse 'LineCalculationValue' from JSON`,
|
|
33
|
+
);
|
|
34
|
+
}
|
package/src/models/lineitem.ts
CHANGED
|
@@ -7,6 +7,10 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
7
7
|
import { ClosedEnum } from "../types/enums.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
LineProvenance,
|
|
12
|
+
LineProvenance$inboundSchema,
|
|
13
|
+
} from "./lineprovenance.js";
|
|
10
14
|
|
|
11
15
|
/**
|
|
12
16
|
* The type of line item. 'discount' and 'adjustment' line items have negative subtotal/total amounts: 'discount' is a grant discount, 'adjustment' is a discount agreed on the subscription.
|
|
@@ -156,6 +160,10 @@ export type LineItem = {
|
|
|
156
160
|
* Real-time estimated subtotal for a line whose amount is not final yet: current usage for a metered item, the rate the subscription is on for a fee. Null for manual items, and for any line whose amount is already final or cannot be estimated.
|
|
157
161
|
*/
|
|
158
162
|
estimatedSubtotal?: string | null | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* How the line's amount before tax was calculated: a trace of one evaluation, saved when the invoice was calculated and fixed once it is issued. Returned only with `expand=lineProvenance`. Every field but `status` is present when `status` is `recorded`. Every number is a plain decimal string.
|
|
165
|
+
*/
|
|
166
|
+
provenance?: LineProvenance | undefined;
|
|
159
167
|
};
|
|
160
168
|
|
|
161
169
|
/** @internal */
|
|
@@ -209,6 +217,7 @@ export const LineItem$inboundSchema: z.ZodType<
|
|
|
209
217
|
updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
210
218
|
estimatedMeteredQuantity: z.nullable(z.string()).optional(),
|
|
211
219
|
estimatedSubtotal: z.nullable(z.string()).optional(),
|
|
220
|
+
provenance: LineProvenance$inboundSchema.optional(),
|
|
212
221
|
});
|
|
213
222
|
|
|
214
223
|
export function lineItemFromJSON(
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
LineCalculationInputs,
|
|
11
|
+
LineCalculationInputs$inboundSchema,
|
|
12
|
+
} from "./linecalculationinputs.js";
|
|
13
|
+
import {
|
|
14
|
+
LineCalculationNotApplied,
|
|
15
|
+
LineCalculationNotApplied$inboundSchema,
|
|
16
|
+
} from "./linecalculationnotapplied.js";
|
|
17
|
+
import {
|
|
18
|
+
LineCalculationPeriod,
|
|
19
|
+
LineCalculationPeriod$inboundSchema,
|
|
20
|
+
} from "./linecalculationperiod.js";
|
|
21
|
+
import {
|
|
22
|
+
LineCalculationPrecision,
|
|
23
|
+
LineCalculationPrecision$inboundSchema,
|
|
24
|
+
} from "./linecalculationprecision.js";
|
|
25
|
+
import {
|
|
26
|
+
LineCalculationResult,
|
|
27
|
+
LineCalculationResult$inboundSchema,
|
|
28
|
+
} from "./linecalculationresult.js";
|
|
29
|
+
import {
|
|
30
|
+
LineCalculationSource,
|
|
31
|
+
LineCalculationSource$inboundSchema,
|
|
32
|
+
} from "./linecalculationsource.js";
|
|
33
|
+
import {
|
|
34
|
+
LineCalculationStep,
|
|
35
|
+
LineCalculationStep$inboundSchema,
|
|
36
|
+
} from "./linecalculationstep.js";
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* How the line's amount before tax was calculated: a trace of one evaluation, saved when the invoice was calculated and fixed once it is issued. Returned only with `expand=lineProvenance`. Every field but `status` is present when `status` is `recorded`. Every number is a plain decimal string.
|
|
40
|
+
*/
|
|
41
|
+
export type LineProvenance = {
|
|
42
|
+
/**
|
|
43
|
+
* `recorded`: the trace is present. `notRecorded`: the line was calculated but has no saved trace, for example a line calculated before traces were saved (show "Calculation not recorded"). `pending`: the line's invoice has not been calculated yet. An open set, so it is a string rather than an enum: known values are `recorded`, `notRecorded`, `pending`, and new values may be added.
|
|
44
|
+
*/
|
|
45
|
+
status: string;
|
|
46
|
+
/**
|
|
47
|
+
* The format version. It changes only when a field is removed or renamed, or a field changes meaning. A new op, source type, price model, reason or label is not a new version.
|
|
48
|
+
*/
|
|
49
|
+
version?: number | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The currency of every amount in the trace.
|
|
52
|
+
*/
|
|
53
|
+
currency?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* The default arithmetic of every step. Any other rounding is an explicit `round` step.
|
|
56
|
+
*/
|
|
57
|
+
precision?: LineCalculationPrecision | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The period the line bills.
|
|
60
|
+
*/
|
|
61
|
+
period?: LineCalculationPeriod | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* When the calculation ran.
|
|
64
|
+
*/
|
|
65
|
+
calculatedAt?: Date | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The subscription the line belongs to.
|
|
68
|
+
*/
|
|
69
|
+
subscriptionId?: string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* The values the evaluation started from.
|
|
72
|
+
*/
|
|
73
|
+
inputs?: LineCalculationInputs | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Every source a step or an input names, by key.
|
|
76
|
+
*/
|
|
77
|
+
sources?: { [k: string]: LineCalculationSource } | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* The steps in the order they were applied. Each starts where the last step on the same value ended.
|
|
80
|
+
*/
|
|
81
|
+
steps?: Array<LineCalculationStep> | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Rules in force for the line that did not change it, and why.
|
|
84
|
+
*/
|
|
85
|
+
notApplied?: Array<LineCalculationNotApplied> | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Equal to the line's stored amount, quantity and unit price.
|
|
88
|
+
*/
|
|
89
|
+
result?: LineCalculationResult | undefined;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const LineProvenance$inboundSchema: z.ZodType<
|
|
94
|
+
LineProvenance,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
unknown
|
|
97
|
+
> = z.object({
|
|
98
|
+
status: z.string(),
|
|
99
|
+
version: z.number().int().optional(),
|
|
100
|
+
currency: z.string().optional(),
|
|
101
|
+
precision: LineCalculationPrecision$inboundSchema.optional(),
|
|
102
|
+
period: LineCalculationPeriod$inboundSchema.optional(),
|
|
103
|
+
calculatedAt: z.string().datetime({ offset: true }).transform(v =>
|
|
104
|
+
new Date(v)
|
|
105
|
+
).optional(),
|
|
106
|
+
subscriptionId: z.string().optional(),
|
|
107
|
+
inputs: LineCalculationInputs$inboundSchema.optional(),
|
|
108
|
+
sources: z.record(LineCalculationSource$inboundSchema).optional(),
|
|
109
|
+
steps: z.array(LineCalculationStep$inboundSchema).optional(),
|
|
110
|
+
notApplied: z.array(LineCalculationNotApplied$inboundSchema).optional(),
|
|
111
|
+
result: LineCalculationResult$inboundSchema.optional(),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export function lineProvenanceFromJSON(
|
|
115
|
+
jsonString: string,
|
|
116
|
+
): SafeParseResult<LineProvenance, SDKValidationError> {
|
|
117
|
+
return safeParse(
|
|
118
|
+
jsonString,
|
|
119
|
+
(x) => LineProvenance$inboundSchema.parse(JSON.parse(x)),
|
|
120
|
+
`Failed to parse 'LineProvenance' from JSON`,
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -10,7 +10,7 @@ export type GetInvoiceRequest = {
|
|
|
10
10
|
*/
|
|
11
11
|
id: string;
|
|
12
12
|
/**
|
|
13
|
-
* Comma-separated list of fields to expand. Supports: lineItems, items. `items` resolves each returned line's item and its external accounting codes into an `items` collection inside the lineItems block; because those ids come from the lines, requesting `items` also expands `lineItems` on its default paging.
|
|
13
|
+
* Comma-separated list of fields to expand. Supports: lineItems, items, lineProvenance. `items` resolves each returned line's item and its external accounting codes into an `items` collection inside the lineItems block; because those ids come from the lines, requesting `items` also expands `lineItems` on its default paging. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated. It also expands `lineItems`.
|
|
14
14
|
*/
|
|
15
15
|
expand?: string | undefined;
|
|
16
16
|
/**
|
|
@@ -18,7 +18,7 @@ export type GetInvoiceLineItemsRequest = {
|
|
|
18
18
|
*/
|
|
19
19
|
pageToken?: string | undefined;
|
|
20
20
|
/**
|
|
21
|
-
* Comma-separated list of fields to expand. Supports: items
|
|
21
|
+
* Comma-separated list of fields to expand. Supports: items, lineProvenance. `items` resolves each returned line's item and that item's external accounting codes into an `items` collection, so a line can be translated to a GL/SKU code without a second call. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated.
|
|
22
22
|
*/
|
|
23
23
|
expand?: string | undefined;
|
|
24
24
|
/**
|
|
@@ -31,7 +31,7 @@ export type ListLineItemsRequest = {
|
|
|
31
31
|
*/
|
|
32
32
|
invoiceId?: string | undefined;
|
|
33
33
|
/**
|
|
34
|
-
* Comma-separated list of fields to expand. Supports: items
|
|
34
|
+
* Comma-separated list of fields to expand. Supports: items, lineProvenance. `items` resolves each returned line's item and that item's external accounting codes into an `items` collection, so a line can be translated to a GL/SKU code without a second call. `lineProvenance` adds `provenance` to each returned line: how its amount before tax was calculated.
|
|
35
35
|
*/
|
|
36
36
|
expand?: string | undefined;
|
|
37
37
|
/**
|
|
@@ -50,7 +50,10 @@ export type ListSubscriptionsRequest = {
|
|
|
50
50
|
* Number of subscriptions to skip
|
|
51
51
|
*/
|
|
52
52
|
offset?: string | undefined;
|
|
53
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Return subscriptions in any of these statuses. Repeat the parameter to pass several, e.g. `?status=active&status=pending_payment`. Omit it to return every status. An SDK leaves an empty list out of the request, so an empty list also returns every status: check for one before calling if it should match nothing.
|
|
55
|
+
*/
|
|
56
|
+
status?: Array<ListSubscriptionsStatus> | undefined;
|
|
54
57
|
/**
|
|
55
58
|
* Filter subscriptions started at or before this ISO 8601 date-time
|
|
56
59
|
*/
|
|
@@ -88,7 +91,7 @@ export type ListSubscriptionsRequest$Outbound = {
|
|
|
88
91
|
limit: string;
|
|
89
92
|
merchantId?: string | undefined;
|
|
90
93
|
offset: string;
|
|
91
|
-
status?: string | undefined;
|
|
94
|
+
status?: Array<string> | undefined;
|
|
92
95
|
startedBefore?: string | undefined;
|
|
93
96
|
include?: string | undefined;
|
|
94
97
|
};
|
|
@@ -104,7 +107,7 @@ export const ListSubscriptionsRequest$outboundSchema: z.ZodType<
|
|
|
104
107
|
limit: z.string().default("10"),
|
|
105
108
|
merchantId: z.string().optional(),
|
|
106
109
|
offset: z.string().default("0"),
|
|
107
|
-
status: ListSubscriptionsStatus$outboundSchema.optional(),
|
|
110
|
+
status: z.array(ListSubscriptionsStatus$outboundSchema).optional(),
|
|
108
111
|
startedBefore: z.date().transform(v => v.toISOString()).optional(),
|
|
109
112
|
include: Include$outboundSchema.optional(),
|
|
110
113
|
});
|