@paygentic/sdk 0.9.17 → 0.10.0
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 +10 -7
- package/dist/commonjs/funcs/revenueGetRevenueAccounts.d.ts +23 -0
- package/dist/commonjs/funcs/revenueGetRevenueAccounts.d.ts.map +1 -0
- package/dist/commonjs/funcs/revenueGetRevenueAccounts.js +129 -0
- package/dist/commonjs/funcs/revenueGetRevenueAccounts.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/models/accountfigure.d.ts +20 -0
- package/dist/commonjs/models/accountfigure.d.ts.map +1 -0
- package/dist/commonjs/models/accountfigure.js +51 -0
- package/dist/commonjs/models/accountfigure.js.map +1 -0
- 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 +20 -0
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +20 -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/getrevenue.d.ts +7 -7
- package/dist/commonjs/models/operations/getrevenue.js +1 -1
- package/dist/commonjs/models/operations/getrevenueaccounts.d.ts +30 -0
- package/dist/commonjs/models/operations/getrevenueaccounts.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getrevenueaccounts.js +52 -0
- package/dist/commonjs/models/operations/getrevenueaccounts.js.map +1 -0
- package/dist/commonjs/models/operations/index.d.ts +1 -0
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -0
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listlineitems.d.ts +1 -1
- package/dist/commonjs/models/outstandingblock.d.ts +29 -0
- package/dist/commonjs/models/outstandingblock.d.ts.map +1 -0
- package/dist/commonjs/models/outstandingblock.js +54 -0
- package/dist/commonjs/models/outstandingblock.js.map +1 -0
- package/dist/commonjs/models/revenueaccountrow.d.ts +26 -0
- package/dist/commonjs/models/revenueaccountrow.d.ts.map +1 -0
- package/dist/commonjs/models/revenueaccountrow.js +54 -0
- package/dist/commonjs/models/revenueaccountrow.js.map +1 -0
- package/dist/commonjs/models/revenueaccountsresponse.d.ts +41 -0
- package/dist/commonjs/models/revenueaccountsresponse.d.ts.map +1 -0
- package/dist/commonjs/models/revenueaccountsresponse.js +64 -0
- package/dist/commonjs/models/revenueaccountsresponse.js.map +1 -0
- package/dist/commonjs/models/revenueaccounttotal.d.ts +18 -0
- package/dist/commonjs/models/revenueaccounttotal.d.ts.map +1 -0
- package/dist/commonjs/models/revenueaccounttotal.js +52 -0
- package/dist/commonjs/models/revenueaccounttotal.js.map +1 -0
- package/dist/commonjs/models/revenuesummaryresponse.d.ts +4 -0
- package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.js +1 -0
- package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -1
- package/dist/commonjs/sdk/revenue.d.ts +11 -0
- package/dist/commonjs/sdk/revenue.d.ts.map +1 -1
- package/dist/commonjs/sdk/revenue.js +14 -0
- package/dist/commonjs/sdk/revenue.js.map +1 -1
- package/dist/esm/funcs/revenueGetRevenueAccounts.d.ts +23 -0
- package/dist/esm/funcs/revenueGetRevenueAccounts.d.ts.map +1 -0
- package/dist/esm/funcs/revenueGetRevenueAccounts.js +93 -0
- package/dist/esm/funcs/revenueGetRevenueAccounts.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/models/accountfigure.d.ts +20 -0
- package/dist/esm/models/accountfigure.d.ts.map +1 -0
- package/dist/esm/models/accountfigure.js +14 -0
- package/dist/esm/models/accountfigure.js.map +1 -0
- 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 +20 -0
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +20 -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/getrevenue.d.ts +7 -7
- package/dist/esm/models/operations/getrevenue.js +1 -1
- package/dist/esm/models/operations/getrevenueaccounts.d.ts +30 -0
- package/dist/esm/models/operations/getrevenueaccounts.d.ts.map +1 -0
- package/dist/esm/models/operations/getrevenueaccounts.js +15 -0
- package/dist/esm/models/operations/getrevenueaccounts.js.map +1 -0
- package/dist/esm/models/operations/index.d.ts +1 -0
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -0
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listlineitems.d.ts +1 -1
- package/dist/esm/models/outstandingblock.d.ts +29 -0
- package/dist/esm/models/outstandingblock.d.ts.map +1 -0
- package/dist/esm/models/outstandingblock.js +17 -0
- package/dist/esm/models/outstandingblock.js.map +1 -0
- package/dist/esm/models/revenueaccountrow.d.ts +26 -0
- package/dist/esm/models/revenueaccountrow.d.ts.map +1 -0
- package/dist/esm/models/revenueaccountrow.js +17 -0
- package/dist/esm/models/revenueaccountrow.js.map +1 -0
- package/dist/esm/models/revenueaccountsresponse.d.ts +41 -0
- package/dist/esm/models/revenueaccountsresponse.d.ts.map +1 -0
- package/dist/esm/models/revenueaccountsresponse.js +27 -0
- package/dist/esm/models/revenueaccountsresponse.js.map +1 -0
- package/dist/esm/models/revenueaccounttotal.d.ts +18 -0
- package/dist/esm/models/revenueaccounttotal.d.ts.map +1 -0
- package/dist/esm/models/revenueaccounttotal.js +15 -0
- package/dist/esm/models/revenueaccounttotal.js.map +1 -0
- package/dist/esm/models/revenuesummaryresponse.d.ts +4 -0
- package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.js +1 -0
- package/dist/esm/models/revenuesummaryresponse.js.map +1 -1
- package/dist/esm/sdk/revenue.d.ts +11 -0
- package/dist/esm/sdk/revenue.d.ts.map +1 -1
- package/dist/esm/sdk/revenue.js +14 -0
- package/dist/esm/sdk/revenue.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/revenueGetRevenueAccounts.ts +186 -0
- package/src/lib/config.ts +2 -2
- package/src/models/accountfigure.ts +42 -0
- 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 +20 -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/getrevenue.ts +7 -7
- package/src/models/operations/getrevenueaccounts.ts +52 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/listlineitems.ts +1 -1
- package/src/models/outstandingblock.ts +53 -0
- package/src/models/revenueaccountrow.ts +53 -0
- package/src/models/revenueaccountsresponse.ts +80 -0
- package/src/models/revenueaccounttotal.ts +43 -0
- package/src/models/revenuesummaryresponse.ts +5 -0
- package/src/sdk/revenue.ts +22 -0
package/package.json
CHANGED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PaygenticCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* List customer accounts
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Returns each customer's account as at today, one row per customer and currency, with a total per currency. Every figure covers all dates: there is no date window.
|
|
34
|
+
*
|
|
35
|
+
* `outstanding` is what customers owe: every invoice with status `ISSUED` or `PAYMENT_FAILED`, at the amount due printed on the invoice (subtotal and tax, each rounded to the currency's minor unit), so it is gross of tax. Revenue (`GET /v0/revenue`) is net of tax. `outstanding` splits into `awaitingPayment` (status `ISSUED`) and `paymentFailed` (status `PAYMENT_FAILED`, collection has ended); the two always add up to it, in count and amount. A credit invoice (a negative amount due) nets against what is owed and is counted in no `count`; nor is an invoice whose amount due rounds to zero. A customer with nothing counted and nothing owed has no row.
|
|
36
|
+
*
|
|
37
|
+
* Amounts are grouped by currency and never combined or converted. `totals` covers every row in the filter, not only the returned page, so the rows on one page add up to `totals` only when the page holds every row. Pages fetched in separate requests are separate reads.
|
|
38
|
+
*/
|
|
39
|
+
export function revenueGetRevenueAccounts(
|
|
40
|
+
client: PaygenticCore,
|
|
41
|
+
request: operations.GetRevenueAccountsRequest,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<
|
|
44
|
+
Result<
|
|
45
|
+
models.RevenueAccountsResponse,
|
|
46
|
+
| errors.BadRequest
|
|
47
|
+
| errors.ErrorT
|
|
48
|
+
| PaygenticError
|
|
49
|
+
| ResponseValidationError
|
|
50
|
+
| ConnectionError
|
|
51
|
+
| RequestAbortedError
|
|
52
|
+
| RequestTimeoutError
|
|
53
|
+
| InvalidRequestError
|
|
54
|
+
| UnexpectedClientError
|
|
55
|
+
| SDKValidationError
|
|
56
|
+
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
request,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: PaygenticCore,
|
|
67
|
+
request: operations.GetRevenueAccountsRequest,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
models.RevenueAccountsResponse,
|
|
73
|
+
| errors.BadRequest
|
|
74
|
+
| errors.ErrorT
|
|
75
|
+
| PaygenticError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const parsed = safeParse(
|
|
88
|
+
request,
|
|
89
|
+
(value) => operations.GetRevenueAccountsRequest$outboundSchema.parse(value),
|
|
90
|
+
"Input validation failed",
|
|
91
|
+
);
|
|
92
|
+
if (!parsed.ok) {
|
|
93
|
+
return [parsed, { status: "invalid" }];
|
|
94
|
+
}
|
|
95
|
+
const payload = parsed.value;
|
|
96
|
+
const body = null;
|
|
97
|
+
|
|
98
|
+
const path = pathToFunc("/v0/revenue/accounts")();
|
|
99
|
+
|
|
100
|
+
const query = encodeFormQuery({
|
|
101
|
+
"customerIds": payload.customerIds,
|
|
102
|
+
"limit": payload.limit,
|
|
103
|
+
"merchantId": payload.merchantId,
|
|
104
|
+
"offset": payload.offset,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const headers = new Headers(compactMap({
|
|
108
|
+
Accept: "application/json",
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
112
|
+
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
113
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
114
|
+
|
|
115
|
+
const context = {
|
|
116
|
+
options: client._options,
|
|
117
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
118
|
+
operationID: "getRevenueAccounts",
|
|
119
|
+
oAuth2Scopes: null,
|
|
120
|
+
|
|
121
|
+
resolvedSecurity: requestSecurity,
|
|
122
|
+
|
|
123
|
+
securitySource: client._options.bearerAuth,
|
|
124
|
+
retryConfig: options?.retries
|
|
125
|
+
|| client._options.retryConfig
|
|
126
|
+
|| { strategy: "none" },
|
|
127
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
const requestRes = client._createRequest(context, {
|
|
131
|
+
security: requestSecurity,
|
|
132
|
+
method: "GET",
|
|
133
|
+
baseURL: options?.serverURL,
|
|
134
|
+
path: path,
|
|
135
|
+
headers: headers,
|
|
136
|
+
query: query,
|
|
137
|
+
body: body,
|
|
138
|
+
userAgent: client._options.userAgent,
|
|
139
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
140
|
+
}, options);
|
|
141
|
+
if (!requestRes.ok) {
|
|
142
|
+
return [requestRes, { status: "invalid" }];
|
|
143
|
+
}
|
|
144
|
+
const req = requestRes.value;
|
|
145
|
+
|
|
146
|
+
const doResult = await client._do(req, {
|
|
147
|
+
context,
|
|
148
|
+
errorCodes: ["400", "401", "403", "404", "4XX", "500", "5XX"],
|
|
149
|
+
retryConfig: context.retryConfig,
|
|
150
|
+
retryCodes: context.retryCodes,
|
|
151
|
+
});
|
|
152
|
+
if (!doResult.ok) {
|
|
153
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
|
+
}
|
|
155
|
+
const response = doResult.value;
|
|
156
|
+
|
|
157
|
+
const responseFields = {
|
|
158
|
+
HttpMeta: { Response: response, Request: req },
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const [result] = await M.match<
|
|
162
|
+
models.RevenueAccountsResponse,
|
|
163
|
+
| errors.BadRequest
|
|
164
|
+
| errors.ErrorT
|
|
165
|
+
| PaygenticError
|
|
166
|
+
| ResponseValidationError
|
|
167
|
+
| ConnectionError
|
|
168
|
+
| RequestAbortedError
|
|
169
|
+
| RequestTimeoutError
|
|
170
|
+
| InvalidRequestError
|
|
171
|
+
| UnexpectedClientError
|
|
172
|
+
| SDKValidationError
|
|
173
|
+
>(
|
|
174
|
+
M.json(200, models.RevenueAccountsResponse$inboundSchema),
|
|
175
|
+
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
176
|
+
M.jsonErr([401, 403, 404], errors.ErrorT$inboundSchema),
|
|
177
|
+
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
178
|
+
M.fail("4XX"),
|
|
179
|
+
M.fail("5XX"),
|
|
180
|
+
)(response, req, { extraFields: responseFields });
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
return [result, { status: "complete", request: req, response }];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return [result, { status: "complete", request: req, response }];
|
|
186
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -65,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
65
65
|
export const SDK_METADATA = {
|
|
66
66
|
language: "typescript",
|
|
67
67
|
openapiDocVersion: "0.1.0",
|
|
68
|
-
sdkVersion: "0.
|
|
68
|
+
sdkVersion: "0.10.0",
|
|
69
69
|
genVersion: "2.879.13",
|
|
70
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.10.0 2.879.13 0.1.0 @paygentic/sdk",
|
|
71
71
|
} as const;
|
|
@@ -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 number of invoices and their total amount due, gross of tax.
|
|
12
|
+
*/
|
|
13
|
+
export type AccountFigure = {
|
|
14
|
+
/**
|
|
15
|
+
* Number of invoices with an amount due above zero. A credit invoice, or one whose amount due rounds to zero, is not counted.
|
|
16
|
+
*/
|
|
17
|
+
count: number;
|
|
18
|
+
/**
|
|
19
|
+
* Total amount due in major units of the currency, in its decimal places
|
|
20
|
+
*/
|
|
21
|
+
amount: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const AccountFigure$inboundSchema: z.ZodType<
|
|
26
|
+
AccountFigure,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
count: z.number().int(),
|
|
31
|
+
amount: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function accountFigureFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<AccountFigure, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => AccountFigure$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'AccountFigure' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { ClosedEnum } from "../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
10
|
+
*/
|
|
11
|
+
export const AuthorizationDenialReason = {
|
|
12
|
+
NoPermission: "no_permission",
|
|
13
|
+
InsufficientScope: "insufficient_scope",
|
|
14
|
+
NotMember: "not_member",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
18
|
+
*/
|
|
19
|
+
export type AuthorizationDenialReason = ClosedEnum<
|
|
20
|
+
typeof AuthorizationDenialReason
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const AuthorizationDenialReason$inboundSchema: z.ZodNativeEnum<
|
|
25
|
+
typeof AuthorizationDenialReason
|
|
26
|
+
> = z.nativeEnum(AuthorizationDenialReason);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import * as models from "../index.js";
|
|
6
7
|
import { PaygenticError } from "./paygenticerror.js";
|
|
7
8
|
|
|
8
9
|
export type ErrorTData = {
|
|
@@ -22,6 +23,14 @@ export type ErrorTData = {
|
|
|
22
23
|
* Additional error details
|
|
23
24
|
*/
|
|
24
25
|
details?: { [k: string]: any } | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
28
|
+
*/
|
|
29
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
32
|
+
*/
|
|
33
|
+
requiredPermissions?: Array<string> | undefined;
|
|
25
34
|
};
|
|
26
35
|
|
|
27
36
|
export class ErrorT extends PaygenticError {
|
|
@@ -37,6 +46,14 @@ export class ErrorT extends PaygenticError {
|
|
|
37
46
|
* Additional error details
|
|
38
47
|
*/
|
|
39
48
|
details?: { [k: string]: any } | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
51
|
+
*/
|
|
52
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
55
|
+
*/
|
|
56
|
+
requiredPermissions?: Array<string> | undefined;
|
|
40
57
|
|
|
41
58
|
/** The original data that was passed to this error instance. */
|
|
42
59
|
data$: ErrorTData;
|
|
@@ -51,6 +68,10 @@ export class ErrorT extends PaygenticError {
|
|
|
51
68
|
if (err.error != null) this.error = err.error;
|
|
52
69
|
if (err.code != null) this.code = err.code;
|
|
53
70
|
if (err.details != null) this.details = err.details;
|
|
71
|
+
if (err.reason != null) this.reason = err.reason;
|
|
72
|
+
if (err.requiredPermissions != null) {
|
|
73
|
+
this.requiredPermissions = err.requiredPermissions;
|
|
74
|
+
}
|
|
54
75
|
|
|
55
76
|
this.name = "ErrorT";
|
|
56
77
|
}
|
|
@@ -63,6 +84,8 @@ export const ErrorT$inboundSchema: z.ZodType<ErrorT, z.ZodTypeDef, unknown> = z
|
|
|
63
84
|
message: z.string(),
|
|
64
85
|
code: z.string().optional(),
|
|
65
86
|
details: z.record(z.any()).optional(),
|
|
87
|
+
reason: models.AuthorizationDenialReason$inboundSchema.optional(),
|
|
88
|
+
requiredPermissions: z.array(z.string()).optional(),
|
|
66
89
|
request$: z.instanceof(Request),
|
|
67
90
|
response$: z.instanceof(Response),
|
|
68
91
|
body$: z.string(),
|
|
@@ -26,6 +26,14 @@ export type UnprocessableEntityErrorData = {
|
|
|
26
26
|
* Additional error details
|
|
27
27
|
*/
|
|
28
28
|
details?: { [k: string]: any } | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
31
|
+
*/
|
|
32
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
35
|
+
*/
|
|
36
|
+
requiredPermissions?: Array<string> | undefined;
|
|
29
37
|
};
|
|
30
38
|
|
|
31
39
|
/**
|
|
@@ -44,6 +52,14 @@ export class UnprocessableEntityError extends PaygenticError {
|
|
|
44
52
|
* Additional error details
|
|
45
53
|
*/
|
|
46
54
|
details?: { [k: string]: any } | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Present on a 403 from the authorization check. Says why access was refused: the caller has no role that grants the permission, the OAuth token lacks the scope, or the caller is not a member of the organization.
|
|
57
|
+
*/
|
|
58
|
+
reason?: models.AuthorizationDenialReason | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Present on a 403 from the authorization check. The permissions the caller needs for this request.
|
|
61
|
+
*/
|
|
62
|
+
requiredPermissions?: Array<string> | undefined;
|
|
47
63
|
|
|
48
64
|
/** The original data that was passed to this error instance. */
|
|
49
65
|
data$: UnprocessableEntityErrorData;
|
|
@@ -58,6 +74,10 @@ export class UnprocessableEntityError extends PaygenticError {
|
|
|
58
74
|
this.error = err.error;
|
|
59
75
|
this.code = err.code;
|
|
60
76
|
if (err.details != null) this.details = err.details;
|
|
77
|
+
if (err.reason != null) this.reason = err.reason;
|
|
78
|
+
if (err.requiredPermissions != null) {
|
|
79
|
+
this.requiredPermissions = err.requiredPermissions;
|
|
80
|
+
}
|
|
61
81
|
|
|
62
82
|
this.name = "UnprocessableEntityError";
|
|
63
83
|
}
|
|
@@ -73,6 +93,8 @@ export const UnprocessableEntityError$inboundSchema: z.ZodType<
|
|
|
73
93
|
message: z.string(),
|
|
74
94
|
code: models.InvoicePaymentLinkErrorCode$inboundSchema,
|
|
75
95
|
details: z.record(z.any()).optional(),
|
|
96
|
+
reason: models.AuthorizationDenialReason$inboundSchema.optional(),
|
|
97
|
+
requiredPermissions: z.array(z.string()).optional(),
|
|
76
98
|
request$: z.instanceof(Request),
|
|
77
99
|
response$: z.instanceof(Response),
|
|
78
100
|
body$: z.string(),
|
package/src/models/index.ts
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
export * from "./accountfigure.js";
|
|
5
6
|
export * from "./address.js";
|
|
6
7
|
export * from "./approval.js";
|
|
7
8
|
export * from "./approvallist.js";
|
|
9
|
+
export * from "./authorizationdenialreason.js";
|
|
8
10
|
export * from "./billablemetric.js";
|
|
9
11
|
export * from "./billingschedule.js";
|
|
10
12
|
export * from "./booleanentitlementdetail.js";
|
|
@@ -60,9 +62,23 @@ export * from "./invoicerefundlist.js";
|
|
|
60
62
|
export * from "./invoicesummary.js";
|
|
61
63
|
export * from "./issueentitlementrequest.js";
|
|
62
64
|
export * from "./item.js";
|
|
65
|
+
export * from "./linecalculationcontribution.js";
|
|
66
|
+
export * from "./linecalculationgiven.js";
|
|
67
|
+
export * from "./linecalculationinputprice.js";
|
|
68
|
+
export * from "./linecalculationinputs.js";
|
|
69
|
+
export * from "./linecalculationnotapplied.js";
|
|
70
|
+
export * from "./linecalculationperiod.js";
|
|
71
|
+
export * from "./linecalculationprecision.js";
|
|
72
|
+
export * from "./linecalculationpriceband.js";
|
|
73
|
+
export * from "./linecalculationpricefn.js";
|
|
74
|
+
export * from "./linecalculationresult.js";
|
|
75
|
+
export * from "./linecalculationsource.js";
|
|
76
|
+
export * from "./linecalculationstep.js";
|
|
77
|
+
export * from "./linecalculationvalue.js";
|
|
63
78
|
export * from "./lineitem.js";
|
|
64
79
|
export * from "./lineitemsresponse.js";
|
|
65
80
|
export * from "./lineitemssummary.js";
|
|
81
|
+
export * from "./lineprovenance.js";
|
|
66
82
|
export * from "./mappingcapabilities.js";
|
|
67
83
|
export * from "./merchantintegration.js";
|
|
68
84
|
export * from "./merchantintegrationprovider.js";
|
|
@@ -84,6 +100,7 @@ export * from "./orderbillingschedule.js";
|
|
|
84
100
|
export * from "./orderlineitem.js";
|
|
85
101
|
export * from "./orderlist.js";
|
|
86
102
|
export * from "./outofbandpaymentresult.js";
|
|
103
|
+
export * from "./outstandingblock.js";
|
|
87
104
|
export * from "./payment.js";
|
|
88
105
|
export * from "./paymentmethod.js";
|
|
89
106
|
export * from "./paymentsession.js";
|
|
@@ -117,6 +134,9 @@ export * from "./replacescheduleintervalsrequest.js";
|
|
|
117
134
|
export * from "./resolveditem.js";
|
|
118
135
|
export * from "./retrypaymenterror.js";
|
|
119
136
|
export * from "./retrypaymentresponse.js";
|
|
137
|
+
export * from "./revenueaccountrow.js";
|
|
138
|
+
export * from "./revenueaccountsresponse.js";
|
|
139
|
+
export * from "./revenueaccounttotal.js";
|
|
120
140
|
export * from "./revenuesummaryresponse.js";
|
|
121
141
|
export * from "./revenuetrendbucket.js";
|
|
122
142
|
export * from "./rulecondition.js";
|
|
@@ -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
|
* Type of event: 'usage' for billable metric events, 'fee' for fee events, 'discount' for grant discount line items (subtotal/total are negative, representing a credit)
|
|
@@ -134,6 +138,10 @@ export type InvoiceLineItem = {
|
|
|
134
138
|
* Unit price in decimal dollars
|
|
135
139
|
*/
|
|
136
140
|
unitPrice: string;
|
|
141
|
+
/**
|
|
142
|
+
* 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.
|
|
143
|
+
*/
|
|
144
|
+
provenance?: LineProvenance | undefined;
|
|
137
145
|
};
|
|
138
146
|
|
|
139
147
|
/** @internal */
|
|
@@ -179,6 +187,7 @@ export const InvoiceLineItem$inboundSchema: z.ZodType<
|
|
|
179
187
|
totalPrice: z.string(),
|
|
180
188
|
totalTax: z.string(),
|
|
181
189
|
unitPrice: z.string(),
|
|
190
|
+
provenance: LineProvenance$inboundSchema.optional(),
|
|
182
191
|
});
|
|
183
192
|
|
|
184
193
|
export function invoiceLineItemFromJSON(
|
|
@@ -0,0 +1,35 @@
|
|
|
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 LineCalculationContribution = {
|
|
11
|
+
lineItemId: string;
|
|
12
|
+
value: string;
|
|
13
|
+
share: string | null;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const LineCalculationContribution$inboundSchema: z.ZodType<
|
|
18
|
+
LineCalculationContribution,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
lineItemId: z.string(),
|
|
23
|
+
value: z.string(),
|
|
24
|
+
share: z.nullable(z.string()),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export function lineCalculationContributionFromJSON(
|
|
28
|
+
jsonString: string,
|
|
29
|
+
): SafeParseResult<LineCalculationContribution, SDKValidationError> {
|
|
30
|
+
return safeParse(
|
|
31
|
+
jsonString,
|
|
32
|
+
(x) => LineCalculationContribution$inboundSchema.parse(JSON.parse(x)),
|
|
33
|
+
`Failed to parse 'LineCalculationContribution' from JSON`,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -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 value the evaluation started from, and its source.
|
|
12
|
+
*/
|
|
13
|
+
export type LineCalculationGiven = {
|
|
14
|
+
/**
|
|
15
|
+
* The value.
|
|
16
|
+
*/
|
|
17
|
+
value: string;
|
|
18
|
+
/**
|
|
19
|
+
* The key of the source in `sources` that stated it.
|
|
20
|
+
*/
|
|
21
|
+
source: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const LineCalculationGiven$inboundSchema: z.ZodType<
|
|
26
|
+
LineCalculationGiven,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
value: z.string(),
|
|
31
|
+
source: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export function lineCalculationGivenFromJSON(
|
|
35
|
+
jsonString: string,
|
|
36
|
+
): SafeParseResult<LineCalculationGiven, SDKValidationError> {
|
|
37
|
+
return safeParse(
|
|
38
|
+
jsonString,
|
|
39
|
+
(x) => LineCalculationGiven$inboundSchema.parse(JSON.parse(x)),
|
|
40
|
+
`Failed to parse 'LineCalculationGiven' from JSON`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
* `priced` only: the price as a function, and its source.
|
|
16
|
+
*/
|
|
17
|
+
export type LineCalculationInputPrice = {
|
|
18
|
+
/**
|
|
19
|
+
* A price as a function from quantity to money. A new model may carry fields not listed here.
|
|
20
|
+
*/
|
|
21
|
+
fn: LineCalculationPriceFn;
|
|
22
|
+
/**
|
|
23
|
+
* The key of the source in `sources` that stated the price.
|
|
24
|
+
*/
|
|
25
|
+
source: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const LineCalculationInputPrice$inboundSchema: z.ZodType<
|
|
30
|
+
LineCalculationInputPrice,
|
|
31
|
+
z.ZodTypeDef,
|
|
32
|
+
unknown
|
|
33
|
+
> = z.object({
|
|
34
|
+
fn: LineCalculationPriceFn$inboundSchema,
|
|
35
|
+
source: z.string(),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export function lineCalculationInputPriceFromJSON(
|
|
39
|
+
jsonString: string,
|
|
40
|
+
): SafeParseResult<LineCalculationInputPrice, SDKValidationError> {
|
|
41
|
+
return safeParse(
|
|
42
|
+
jsonString,
|
|
43
|
+
(x) => LineCalculationInputPrice$inboundSchema.parse(JSON.parse(x)),
|
|
44
|
+
`Failed to parse 'LineCalculationInputPrice' from JSON`,
|
|
45
|
+
);
|
|
46
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
LineCalculationGiven,
|
|
11
|
+
LineCalculationGiven$inboundSchema,
|
|
12
|
+
} from "./linecalculationgiven.js";
|
|
13
|
+
import {
|
|
14
|
+
LineCalculationInputPrice,
|
|
15
|
+
LineCalculationInputPrice$inboundSchema,
|
|
16
|
+
} from "./linecalculationinputprice.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The values the evaluation started from.
|
|
20
|
+
*/
|
|
21
|
+
export type LineCalculationInputs = {
|
|
22
|
+
/**
|
|
23
|
+
* `priced`: a charge from a price, with `quantity`, `selector` and `price`. `fromLine`: a line whose base is another line's amount, with `amount`. `given`: an amount nobody priced on this run, with `amount`. An open set, so it is a string rather than an enum: known values are `priced`, `fromLine`, `given`, and new values may be added.
|
|
24
|
+
*/
|
|
25
|
+
kind: string;
|
|
26
|
+
/**
|
|
27
|
+
* A value the evaluation started from, and its source.
|
|
28
|
+
*/
|
|
29
|
+
quantity?: LineCalculationGiven | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* A value the evaluation started from, and its source.
|
|
32
|
+
*/
|
|
33
|
+
selector?: LineCalculationGiven | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* `priced` only: the price as a function, and its source.
|
|
36
|
+
*/
|
|
37
|
+
price?: LineCalculationInputPrice | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* A value the evaluation started from, and its source.
|
|
40
|
+
*/
|
|
41
|
+
amount?: LineCalculationGiven | undefined;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const LineCalculationInputs$inboundSchema: z.ZodType<
|
|
46
|
+
LineCalculationInputs,
|
|
47
|
+
z.ZodTypeDef,
|
|
48
|
+
unknown
|
|
49
|
+
> = z.object({
|
|
50
|
+
kind: z.string(),
|
|
51
|
+
quantity: LineCalculationGiven$inboundSchema.optional(),
|
|
52
|
+
selector: LineCalculationGiven$inboundSchema.optional(),
|
|
53
|
+
price: LineCalculationInputPrice$inboundSchema.optional(),
|
|
54
|
+
amount: LineCalculationGiven$inboundSchema.optional(),
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export function lineCalculationInputsFromJSON(
|
|
58
|
+
jsonString: string,
|
|
59
|
+
): SafeParseResult<LineCalculationInputs, SDKValidationError> {
|
|
60
|
+
return safeParse(
|
|
61
|
+
jsonString,
|
|
62
|
+
(x) => LineCalculationInputs$inboundSchema.parse(JSON.parse(x)),
|
|
63
|
+
`Failed to parse 'LineCalculationInputs' from JSON`,
|
|
64
|
+
);
|
|
65
|
+
}
|