@polar-sh/sdk 0.32.13 → 0.32.14
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 +7 -0
- package/bin/mcp-server.js +1029 -118
- package/bin/mcp-server.js.map +30 -15
- package/dist/commonjs/funcs/checkoutsList.js +3 -0
- package/dist/commonjs/funcs/checkoutsList.js.map +1 -1
- package/dist/commonjs/funcs/paymentsGet.d.ts +21 -0
- package/dist/commonjs/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsGet.js +115 -0
- package/dist/commonjs/funcs/paymentsGet.js.map +1 -0
- package/dist/commonjs/funcs/paymentsList.d.ts +22 -0
- package/dist/commonjs/funcs/paymentsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/paymentsList.js +154 -0
- package/dist/commonjs/funcs/paymentsList.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/sdks.d.ts +3 -1
- package/dist/commonjs/lib/sdks.d.ts.map +1 -1
- package/dist/commonjs/lib/sdks.js +6 -11
- package/dist/commonjs/lib/sdks.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/scopes.d.ts +1 -1
- package/dist/commonjs/mcp-server/scopes.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/scopes.js +1 -0
- package/dist/commonjs/mcp-server/scopes.js.map +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/paymentsGet.d.ts +7 -0
- package/dist/commonjs/mcp-server/tools/paymentsGet.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/paymentsGet.js +34 -0
- package/dist/commonjs/mcp-server/tools/paymentsGet.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/paymentsList.d.ts +7 -0
- package/dist/commonjs/mcp-server/tools/paymentsList.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/paymentsList.js +34 -0
- package/dist/commonjs/mcp-server/tools/paymentsList.js.map +1 -0
- package/dist/commonjs/models/components/benefitmetercreditcreateproperties.d.ts +2 -0
- package/dist/commonjs/models/components/benefitmetercreditcreateproperties.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitmetercreditcreateproperties.js +2 -0
- package/dist/commonjs/models/components/benefitmetercreditcreateproperties.js.map +1 -1
- package/dist/commonjs/models/components/benefitmetercreditproperties.d.ts +2 -0
- package/dist/commonjs/models/components/benefitmetercreditproperties.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitmetercreditproperties.js +2 -0
- package/dist/commonjs/models/components/benefitmetercreditproperties.js.map +1 -1
- package/dist/commonjs/models/components/benefitmetercreditsubscriberproperties.d.ts +2 -0
- package/dist/commonjs/models/components/benefitmetercreditsubscriberproperties.d.ts.map +1 -1
- package/dist/commonjs/models/components/benefitmetercreditsubscriberproperties.js +2 -0
- package/dist/commonjs/models/components/benefitmetercreditsubscriberproperties.js.map +1 -1
- package/dist/commonjs/models/components/cardpayment.d.ts +97 -0
- package/dist/commonjs/models/components/cardpayment.d.ts.map +1 -0
- package/dist/commonjs/models/components/cardpayment.js +111 -0
- package/dist/commonjs/models/components/cardpayment.js.map +1 -0
- package/dist/commonjs/models/components/cardpaymentmetadata.d.ts +40 -0
- package/dist/commonjs/models/components/cardpaymentmetadata.d.ts.map +1 -0
- package/dist/commonjs/models/components/cardpaymentmetadata.js +61 -0
- package/dist/commonjs/models/components/cardpaymentmetadata.js.map +1 -0
- package/dist/commonjs/models/components/checkoutsortproperty.d.ts +6 -0
- package/dist/commonjs/models/components/checkoutsortproperty.d.ts.map +1 -1
- package/dist/commonjs/models/components/checkoutsortproperty.js +2 -0
- package/dist/commonjs/models/components/checkoutsortproperty.js.map +1 -1
- package/dist/commonjs/models/components/customercustomermeter.d.ts +1 -1
- package/dist/commonjs/models/components/customermeter.d.ts +1 -1
- package/dist/commonjs/models/components/customerstatemeter.d.ts +1 -1
- package/dist/commonjs/models/components/genericpayment.d.ts +91 -0
- package/dist/commonjs/models/components/genericpayment.d.ts.map +1 -0
- package/dist/commonjs/models/components/genericpayment.js +106 -0
- package/dist/commonjs/models/components/genericpayment.js.map +1 -0
- package/dist/commonjs/models/components/listresource.d.ts +33 -0
- package/dist/commonjs/models/components/listresource.d.ts.map +1 -0
- package/dist/commonjs/models/components/listresource.js +63 -0
- package/dist/commonjs/models/components/listresource.js.map +1 -0
- package/dist/commonjs/models/components/metricperiod.d.ts +345 -24
- package/dist/commonjs/models/components/metricperiod.d.ts.map +1 -1
- package/dist/commonjs/models/components/metricperiod.js +381 -25
- package/dist/commonjs/models/components/metricperiod.js.map +1 -1
- package/dist/commonjs/models/components/metrics.d.ts +15 -0
- package/dist/commonjs/models/components/metrics.d.ts.map +1 -1
- package/dist/commonjs/models/components/metrics.js +10 -0
- package/dist/commonjs/models/components/metrics.js.map +1 -1
- package/dist/commonjs/models/components/metricsresponse.d.ts +3 -0
- package/dist/commonjs/models/components/metricsresponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/metricsresponse.js +3 -0
- package/dist/commonjs/models/components/metricsresponse.js.map +1 -1
- package/dist/commonjs/models/components/metricstotals.d.ts +372 -0
- package/dist/commonjs/models/components/metricstotals.d.ts.map +1 -0
- package/dist/commonjs/models/components/metricstotals.js +463 -0
- package/dist/commonjs/models/components/metricstotals.js.map +1 -0
- package/dist/commonjs/models/components/metrictype.d.ts +3 -0
- package/dist/commonjs/models/components/metrictype.d.ts.map +1 -1
- package/dist/commonjs/models/components/metrictype.js +1 -0
- package/dist/commonjs/models/components/metrictype.js.map +1 -1
- package/dist/commonjs/models/components/oauth2client.js +2 -2
- package/dist/commonjs/models/components/oauth2client.js.map +1 -1
- package/dist/commonjs/models/components/oauth2clientconfiguration.js +2 -2
- package/dist/commonjs/models/components/oauth2clientconfiguration.js.map +1 -1
- package/dist/commonjs/models/components/oauth2clientconfigurationupdate.js +2 -2
- package/dist/commonjs/models/components/oauth2clientconfigurationupdate.js.map +1 -1
- package/dist/commonjs/models/components/payment.d.ts +27 -0
- package/dist/commonjs/models/components/payment.d.ts.map +1 -0
- package/dist/commonjs/models/components/payment.js +57 -0
- package/dist/commonjs/models/components/payment.js.map +1 -0
- package/dist/commonjs/models/components/paymentsortproperty.d.ts +46 -0
- package/dist/commonjs/models/components/paymentsortproperty.d.ts.map +1 -0
- package/dist/commonjs/models/components/paymentsortproperty.js +56 -0
- package/dist/commonjs/models/components/paymentsortproperty.js.map +1 -0
- package/dist/commonjs/models/components/paymentstatus.d.ts +31 -0
- package/dist/commonjs/models/components/paymentstatus.d.ts.map +1 -0
- package/dist/commonjs/models/components/paymentstatus.js +51 -0
- package/dist/commonjs/models/components/paymentstatus.js.map +1 -0
- package/dist/commonjs/models/components/scope.d.ts +3 -0
- package/dist/commonjs/models/components/scope.d.ts.map +1 -1
- package/dist/commonjs/models/components/scope.js +1 -0
- package/dist/commonjs/models/components/scope.js.map +1 -1
- package/dist/commonjs/models/operations/checkoutslist.d.ts +64 -0
- package/dist/commonjs/models/operations/checkoutslist.d.ts.map +1 -1
- package/dist/commonjs/models/operations/checkoutslist.js +69 -1
- package/dist/commonjs/models/operations/checkoutslist.js.map +1 -1
- package/dist/commonjs/models/operations/paymentsget.d.ts +32 -0
- package/dist/commonjs/models/operations/paymentsget.d.ts.map +1 -0
- package/dist/commonjs/models/operations/paymentsget.js +59 -0
- package/dist/commonjs/models/operations/paymentsget.js.map +1 -0
- package/dist/commonjs/models/operations/paymentslist.d.ts +244 -0
- package/dist/commonjs/models/operations/paymentslist.d.ts.map +1 -0
- package/dist/commonjs/models/operations/paymentslist.js +283 -0
- package/dist/commonjs/models/operations/paymentslist.js.map +1 -0
- package/dist/commonjs/sdk/payments.d.ts +28 -0
- package/dist/commonjs/sdk/payments.d.ts.map +1 -0
- package/dist/commonjs/sdk/payments.js +37 -0
- package/dist/commonjs/sdk/payments.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/checkoutsList.js +3 -0
- package/dist/esm/funcs/checkoutsList.js.map +1 -1
- package/dist/esm/funcs/paymentsGet.d.ts +21 -0
- package/dist/esm/funcs/paymentsGet.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsGet.js +89 -0
- package/dist/esm/funcs/paymentsGet.js.map +1 -0
- package/dist/esm/funcs/paymentsList.d.ts +22 -0
- package/dist/esm/funcs/paymentsList.d.ts.map +1 -0
- package/dist/esm/funcs/paymentsList.js +128 -0
- package/dist/esm/funcs/paymentsList.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/sdks.d.ts +3 -1
- package/dist/esm/lib/sdks.d.ts.map +1 -1
- package/dist/esm/lib/sdks.js +6 -11
- package/dist/esm/lib/sdks.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/scopes.d.ts +1 -1
- package/dist/esm/mcp-server/scopes.d.ts.map +1 -1
- package/dist/esm/mcp-server/scopes.js +1 -0
- package/dist/esm/mcp-server/scopes.js.map +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/paymentsGet.d.ts +7 -0
- package/dist/esm/mcp-server/tools/paymentsGet.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/paymentsGet.js +31 -0
- package/dist/esm/mcp-server/tools/paymentsGet.js.map +1 -0
- package/dist/esm/mcp-server/tools/paymentsList.d.ts +7 -0
- package/dist/esm/mcp-server/tools/paymentsList.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/paymentsList.js +31 -0
- package/dist/esm/mcp-server/tools/paymentsList.js.map +1 -0
- package/dist/esm/models/components/benefitmetercreditcreateproperties.d.ts +2 -0
- package/dist/esm/models/components/benefitmetercreditcreateproperties.d.ts.map +1 -1
- package/dist/esm/models/components/benefitmetercreditcreateproperties.js +2 -0
- package/dist/esm/models/components/benefitmetercreditcreateproperties.js.map +1 -1
- package/dist/esm/models/components/benefitmetercreditproperties.d.ts +2 -0
- package/dist/esm/models/components/benefitmetercreditproperties.d.ts.map +1 -1
- package/dist/esm/models/components/benefitmetercreditproperties.js +2 -0
- package/dist/esm/models/components/benefitmetercreditproperties.js.map +1 -1
- package/dist/esm/models/components/benefitmetercreditsubscriberproperties.d.ts +2 -0
- package/dist/esm/models/components/benefitmetercreditsubscriberproperties.d.ts.map +1 -1
- package/dist/esm/models/components/benefitmetercreditsubscriberproperties.js +2 -0
- package/dist/esm/models/components/benefitmetercreditsubscriberproperties.js.map +1 -1
- package/dist/esm/models/components/cardpayment.d.ts +97 -0
- package/dist/esm/models/components/cardpayment.d.ts.map +1 -0
- package/dist/esm/models/components/cardpayment.js +83 -0
- package/dist/esm/models/components/cardpayment.js.map +1 -0
- package/dist/esm/models/components/cardpaymentmetadata.d.ts +40 -0
- package/dist/esm/models/components/cardpaymentmetadata.d.ts.map +1 -0
- package/dist/esm/models/components/cardpaymentmetadata.js +33 -0
- package/dist/esm/models/components/cardpaymentmetadata.js.map +1 -0
- package/dist/esm/models/components/checkoutsortproperty.d.ts +6 -0
- package/dist/esm/models/components/checkoutsortproperty.d.ts.map +1 -1
- package/dist/esm/models/components/checkoutsortproperty.js +2 -0
- package/dist/esm/models/components/checkoutsortproperty.js.map +1 -1
- package/dist/esm/models/components/customercustomermeter.d.ts +1 -1
- package/dist/esm/models/components/customermeter.d.ts +1 -1
- package/dist/esm/models/components/customerstatemeter.d.ts +1 -1
- package/dist/esm/models/components/genericpayment.d.ts +91 -0
- package/dist/esm/models/components/genericpayment.d.ts.map +1 -0
- package/dist/esm/models/components/genericpayment.js +78 -0
- package/dist/esm/models/components/genericpayment.js.map +1 -0
- package/dist/esm/models/components/listresource.d.ts +33 -0
- package/dist/esm/models/components/listresource.d.ts.map +1 -0
- package/dist/esm/models/components/listresource.js +35 -0
- package/dist/esm/models/components/listresource.js.map +1 -0
- package/dist/esm/models/components/metricperiod.d.ts +345 -24
- package/dist/esm/models/components/metricperiod.d.ts.map +1 -1
- package/dist/esm/models/components/metricperiod.js +350 -24
- package/dist/esm/models/components/metricperiod.js.map +1 -1
- package/dist/esm/models/components/metrics.d.ts +15 -0
- package/dist/esm/models/components/metrics.d.ts.map +1 -1
- package/dist/esm/models/components/metrics.js +10 -0
- package/dist/esm/models/components/metrics.js.map +1 -1
- package/dist/esm/models/components/metricsresponse.d.ts +3 -0
- package/dist/esm/models/components/metricsresponse.d.ts.map +1 -1
- package/dist/esm/models/components/metricsresponse.js +3 -0
- package/dist/esm/models/components/metricsresponse.js.map +1 -1
- package/dist/esm/models/components/metricstotals.d.ts +372 -0
- package/dist/esm/models/components/metricstotals.d.ts.map +1 -0
- package/dist/esm/models/components/metricstotals.js +405 -0
- package/dist/esm/models/components/metricstotals.js.map +1 -0
- package/dist/esm/models/components/metrictype.d.ts +3 -0
- package/dist/esm/models/components/metrictype.d.ts.map +1 -1
- package/dist/esm/models/components/metrictype.js +1 -0
- package/dist/esm/models/components/metrictype.js.map +1 -1
- package/dist/esm/models/components/oauth2client.js +2 -2
- package/dist/esm/models/components/oauth2client.js.map +1 -1
- package/dist/esm/models/components/oauth2clientconfiguration.js +2 -2
- package/dist/esm/models/components/oauth2clientconfiguration.js.map +1 -1
- package/dist/esm/models/components/oauth2clientconfigurationupdate.js +2 -2
- package/dist/esm/models/components/oauth2clientconfigurationupdate.js.map +1 -1
- package/dist/esm/models/components/payment.d.ts +27 -0
- package/dist/esm/models/components/payment.d.ts.map +1 -0
- package/dist/esm/models/components/payment.js +29 -0
- package/dist/esm/models/components/payment.js.map +1 -0
- package/dist/esm/models/components/paymentsortproperty.d.ts +46 -0
- package/dist/esm/models/components/paymentsortproperty.d.ts.map +1 -0
- package/dist/esm/models/components/paymentsortproperty.js +30 -0
- package/dist/esm/models/components/paymentsortproperty.js.map +1 -0
- package/dist/esm/models/components/paymentstatus.d.ts +31 -0
- package/dist/esm/models/components/paymentstatus.d.ts.map +1 -0
- package/dist/esm/models/components/paymentstatus.js +25 -0
- package/dist/esm/models/components/paymentstatus.js.map +1 -0
- package/dist/esm/models/components/scope.d.ts +3 -0
- package/dist/esm/models/components/scope.d.ts.map +1 -1
- package/dist/esm/models/components/scope.js +1 -0
- package/dist/esm/models/components/scope.js.map +1 -1
- package/dist/esm/models/operations/checkoutslist.d.ts +64 -0
- package/dist/esm/models/operations/checkoutslist.d.ts.map +1 -1
- package/dist/esm/models/operations/checkoutslist.js +64 -0
- package/dist/esm/models/operations/checkoutslist.js.map +1 -1
- package/dist/esm/models/operations/paymentsget.d.ts +32 -0
- package/dist/esm/models/operations/paymentsget.d.ts.map +1 -0
- package/dist/esm/models/operations/paymentsget.js +31 -0
- package/dist/esm/models/operations/paymentsget.js.map +1 -0
- package/dist/esm/models/operations/paymentslist.d.ts +244 -0
- package/dist/esm/models/operations/paymentslist.d.ts.map +1 -0
- package/dist/esm/models/operations/paymentslist.js +241 -0
- package/dist/esm/models/operations/paymentslist.js.map +1 -0
- package/dist/esm/sdk/payments.d.ts +28 -0
- package/dist/esm/sdk/payments.d.ts.map +1 -0
- package/dist/esm/sdk/payments.js +33 -0
- package/dist/esm/sdk/payments.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/docs/sdks/meters/README.md +14 -2
- package/docs/sdks/payments/README.md +176 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/checkoutsList.ts +3 -0
- package/src/funcs/paymentsGet.ts +189 -0
- package/src/funcs/paymentsList.ts +257 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +11 -11
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/scopes.ts +1 -0
- package/src/mcp-server/server.ts +5 -1
- package/src/mcp-server/tools/paymentsGet.ts +40 -0
- package/src/mcp-server/tools/paymentsList.ts +40 -0
- package/src/models/components/benefitmetercreditcreateproperties.ts +4 -0
- package/src/models/components/benefitmetercreditproperties.ts +4 -0
- package/src/models/components/benefitmetercreditsubscriberproperties.ts +4 -0
- package/src/models/components/cardpayment.ts +194 -0
- package/src/models/components/cardpaymentmetadata.ts +79 -0
- package/src/models/components/checkoutsortproperty.ts +2 -0
- package/src/models/components/customercustomermeter.ts +1 -1
- package/src/models/components/customermeter.ts +1 -1
- package/src/models/components/customerstatemeter.ts +1 -1
- package/src/models/components/genericpayment.ts +179 -0
- package/src/models/components/listresource.ts +78 -0
- package/src/models/components/metricperiod.ts +796 -48
- package/src/models/components/metrics.ts +25 -0
- package/src/models/components/metricsresponse.ts +10 -0
- package/src/models/components/metricstotals.ts +942 -0
- package/src/models/components/metrictype.ts +1 -0
- package/src/models/components/oauth2client.ts +2 -2
- package/src/models/components/oauth2clientconfiguration.ts +2 -2
- package/src/models/components/oauth2clientconfigurationupdate.ts +2 -2
- package/src/models/components/payment.ts +63 -0
- package/src/models/components/paymentsortproperty.ts +39 -0
- package/src/models/components/paymentstatus.ts +34 -0
- package/src/models/components/scope.ts +1 -0
- package/src/models/operations/checkoutslist.ts +160 -0
- package/src/models/operations/paymentsget.ts +69 -0
- package/src/models/operations/paymentslist.ts +584 -0
- package/src/sdk/payments.ts +55 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
CardPaymentMetadata,
|
|
12
|
+
CardPaymentMetadata$inboundSchema,
|
|
13
|
+
CardPaymentMetadata$Outbound,
|
|
14
|
+
CardPaymentMetadata$outboundSchema,
|
|
15
|
+
} from "./cardpaymentmetadata.js";
|
|
16
|
+
import {
|
|
17
|
+
PaymentProcessor,
|
|
18
|
+
PaymentProcessor$inboundSchema,
|
|
19
|
+
PaymentProcessor$outboundSchema,
|
|
20
|
+
} from "./paymentprocessor.js";
|
|
21
|
+
import {
|
|
22
|
+
PaymentStatus,
|
|
23
|
+
PaymentStatus$inboundSchema,
|
|
24
|
+
PaymentStatus$outboundSchema,
|
|
25
|
+
} from "./paymentstatus.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Schema of a payment with a card payment method.
|
|
29
|
+
*/
|
|
30
|
+
export type CardPayment = {
|
|
31
|
+
/**
|
|
32
|
+
* Creation timestamp of the object.
|
|
33
|
+
*/
|
|
34
|
+
createdAt: Date;
|
|
35
|
+
/**
|
|
36
|
+
* Last modification timestamp of the object.
|
|
37
|
+
*/
|
|
38
|
+
modifiedAt: Date | null;
|
|
39
|
+
/**
|
|
40
|
+
* The ID of the object.
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
processor: PaymentProcessor;
|
|
44
|
+
status: PaymentStatus;
|
|
45
|
+
/**
|
|
46
|
+
* The payment amount in cents.
|
|
47
|
+
*/
|
|
48
|
+
amount: number;
|
|
49
|
+
/**
|
|
50
|
+
* The payment currency. Currently, only `usd` is supported.
|
|
51
|
+
*/
|
|
52
|
+
currency: string;
|
|
53
|
+
/**
|
|
54
|
+
* The payment method used.
|
|
55
|
+
*/
|
|
56
|
+
method?: "card" | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Error code, if the payment was declined.
|
|
59
|
+
*/
|
|
60
|
+
declineReason: string | null;
|
|
61
|
+
/**
|
|
62
|
+
* Human-reasable error message, if the payment was declined.
|
|
63
|
+
*/
|
|
64
|
+
declineMessage: string | null;
|
|
65
|
+
/**
|
|
66
|
+
* The ID of the organization that owns the payment.
|
|
67
|
+
*/
|
|
68
|
+
organizationId: string;
|
|
69
|
+
/**
|
|
70
|
+
* The ID of the checkout session associated with this payment.
|
|
71
|
+
*/
|
|
72
|
+
checkoutId: string | null;
|
|
73
|
+
/**
|
|
74
|
+
* The ID of the order associated with this payment.
|
|
75
|
+
*/
|
|
76
|
+
orderId: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Additional metadata for a card payment method.
|
|
79
|
+
*/
|
|
80
|
+
methodMetadata: CardPaymentMetadata;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const CardPayment$inboundSchema: z.ZodType<
|
|
85
|
+
CardPayment,
|
|
86
|
+
z.ZodTypeDef,
|
|
87
|
+
unknown
|
|
88
|
+
> = z.object({
|
|
89
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
90
|
+
modified_at: z.nullable(
|
|
91
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
92
|
+
),
|
|
93
|
+
id: z.string(),
|
|
94
|
+
processor: PaymentProcessor$inboundSchema,
|
|
95
|
+
status: PaymentStatus$inboundSchema,
|
|
96
|
+
amount: z.number().int(),
|
|
97
|
+
currency: z.string(),
|
|
98
|
+
method: z.literal("card").optional(),
|
|
99
|
+
decline_reason: z.nullable(z.string()),
|
|
100
|
+
decline_message: z.nullable(z.string()),
|
|
101
|
+
organization_id: z.string(),
|
|
102
|
+
checkout_id: z.nullable(z.string()),
|
|
103
|
+
order_id: z.nullable(z.string()),
|
|
104
|
+
method_metadata: CardPaymentMetadata$inboundSchema,
|
|
105
|
+
}).transform((v) => {
|
|
106
|
+
return remap$(v, {
|
|
107
|
+
"created_at": "createdAt",
|
|
108
|
+
"modified_at": "modifiedAt",
|
|
109
|
+
"decline_reason": "declineReason",
|
|
110
|
+
"decline_message": "declineMessage",
|
|
111
|
+
"organization_id": "organizationId",
|
|
112
|
+
"checkout_id": "checkoutId",
|
|
113
|
+
"order_id": "orderId",
|
|
114
|
+
"method_metadata": "methodMetadata",
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export type CardPayment$Outbound = {
|
|
120
|
+
created_at: string;
|
|
121
|
+
modified_at: string | null;
|
|
122
|
+
id: string;
|
|
123
|
+
processor: string;
|
|
124
|
+
status: string;
|
|
125
|
+
amount: number;
|
|
126
|
+
currency: string;
|
|
127
|
+
method: "card";
|
|
128
|
+
decline_reason: string | null;
|
|
129
|
+
decline_message: string | null;
|
|
130
|
+
organization_id: string;
|
|
131
|
+
checkout_id: string | null;
|
|
132
|
+
order_id: string | null;
|
|
133
|
+
method_metadata: CardPaymentMetadata$Outbound;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/** @internal */
|
|
137
|
+
export const CardPayment$outboundSchema: z.ZodType<
|
|
138
|
+
CardPayment$Outbound,
|
|
139
|
+
z.ZodTypeDef,
|
|
140
|
+
CardPayment
|
|
141
|
+
> = z.object({
|
|
142
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
143
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
144
|
+
id: z.string(),
|
|
145
|
+
processor: PaymentProcessor$outboundSchema,
|
|
146
|
+
status: PaymentStatus$outboundSchema,
|
|
147
|
+
amount: z.number().int(),
|
|
148
|
+
currency: z.string(),
|
|
149
|
+
method: z.literal("card").default("card" as const),
|
|
150
|
+
declineReason: z.nullable(z.string()),
|
|
151
|
+
declineMessage: z.nullable(z.string()),
|
|
152
|
+
organizationId: z.string(),
|
|
153
|
+
checkoutId: z.nullable(z.string()),
|
|
154
|
+
orderId: z.nullable(z.string()),
|
|
155
|
+
methodMetadata: CardPaymentMetadata$outboundSchema,
|
|
156
|
+
}).transform((v) => {
|
|
157
|
+
return remap$(v, {
|
|
158
|
+
createdAt: "created_at",
|
|
159
|
+
modifiedAt: "modified_at",
|
|
160
|
+
declineReason: "decline_reason",
|
|
161
|
+
declineMessage: "decline_message",
|
|
162
|
+
organizationId: "organization_id",
|
|
163
|
+
checkoutId: "checkout_id",
|
|
164
|
+
orderId: "order_id",
|
|
165
|
+
methodMetadata: "method_metadata",
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @internal
|
|
171
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
172
|
+
*/
|
|
173
|
+
export namespace CardPayment$ {
|
|
174
|
+
/** @deprecated use `CardPayment$inboundSchema` instead. */
|
|
175
|
+
export const inboundSchema = CardPayment$inboundSchema;
|
|
176
|
+
/** @deprecated use `CardPayment$outboundSchema` instead. */
|
|
177
|
+
export const outboundSchema = CardPayment$outboundSchema;
|
|
178
|
+
/** @deprecated use `CardPayment$Outbound` instead. */
|
|
179
|
+
export type Outbound = CardPayment$Outbound;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function cardPaymentToJSON(cardPayment: CardPayment): string {
|
|
183
|
+
return JSON.stringify(CardPayment$outboundSchema.parse(cardPayment));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function cardPaymentFromJSON(
|
|
187
|
+
jsonString: string,
|
|
188
|
+
): SafeParseResult<CardPayment, SDKValidationError> {
|
|
189
|
+
return safeParse(
|
|
190
|
+
jsonString,
|
|
191
|
+
(x) => CardPayment$inboundSchema.parse(JSON.parse(x)),
|
|
192
|
+
`Failed to parse 'CardPayment' from JSON`,
|
|
193
|
+
);
|
|
194
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
* Additional metadata for a card payment method.
|
|
12
|
+
*/
|
|
13
|
+
export type CardPaymentMetadata = {
|
|
14
|
+
/**
|
|
15
|
+
* The brand of the card used for the payment.
|
|
16
|
+
*/
|
|
17
|
+
brand: string;
|
|
18
|
+
/**
|
|
19
|
+
* The last 4 digits of the card number.
|
|
20
|
+
*/
|
|
21
|
+
last4: string;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const CardPaymentMetadata$inboundSchema: z.ZodType<
|
|
26
|
+
CardPaymentMetadata,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
unknown
|
|
29
|
+
> = z.object({
|
|
30
|
+
brand: z.string(),
|
|
31
|
+
last4: z.string(),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export type CardPaymentMetadata$Outbound = {
|
|
36
|
+
brand: string;
|
|
37
|
+
last4: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const CardPaymentMetadata$outboundSchema: z.ZodType<
|
|
42
|
+
CardPaymentMetadata$Outbound,
|
|
43
|
+
z.ZodTypeDef,
|
|
44
|
+
CardPaymentMetadata
|
|
45
|
+
> = z.object({
|
|
46
|
+
brand: z.string(),
|
|
47
|
+
last4: z.string(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
53
|
+
*/
|
|
54
|
+
export namespace CardPaymentMetadata$ {
|
|
55
|
+
/** @deprecated use `CardPaymentMetadata$inboundSchema` instead. */
|
|
56
|
+
export const inboundSchema = CardPaymentMetadata$inboundSchema;
|
|
57
|
+
/** @deprecated use `CardPaymentMetadata$outboundSchema` instead. */
|
|
58
|
+
export const outboundSchema = CardPaymentMetadata$outboundSchema;
|
|
59
|
+
/** @deprecated use `CardPaymentMetadata$Outbound` instead. */
|
|
60
|
+
export type Outbound = CardPaymentMetadata$Outbound;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function cardPaymentMetadataToJSON(
|
|
64
|
+
cardPaymentMetadata: CardPaymentMetadata,
|
|
65
|
+
): string {
|
|
66
|
+
return JSON.stringify(
|
|
67
|
+
CardPaymentMetadata$outboundSchema.parse(cardPaymentMetadata),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function cardPaymentMetadataFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<CardPaymentMetadata, SDKValidationError> {
|
|
74
|
+
return safeParse(
|
|
75
|
+
jsonString,
|
|
76
|
+
(x) => CardPaymentMetadata$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'CardPaymentMetadata' from JSON`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -10,6 +10,8 @@ export const CheckoutSortProperty = {
|
|
|
10
10
|
MinusCreatedAt: "-created_at",
|
|
11
11
|
ExpiresAt: "expires_at",
|
|
12
12
|
MinusExpiresAt: "-expires_at",
|
|
13
|
+
Status: "status",
|
|
14
|
+
MinusStatus: "-status",
|
|
13
15
|
} as const;
|
|
14
16
|
export type CheckoutSortProperty = ClosedEnum<typeof CheckoutSortProperty>;
|
|
15
17
|
|
|
@@ -44,7 +44,7 @@ export type CustomerCustomerMeter = {
|
|
|
44
44
|
*/
|
|
45
45
|
creditedUnits: number;
|
|
46
46
|
/**
|
|
47
|
-
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
47
|
+
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
48
48
|
*/
|
|
49
49
|
balance: number;
|
|
50
50
|
meter: CustomerCustomerMeterMeter;
|
|
@@ -53,7 +53,7 @@ export type CustomerMeter = {
|
|
|
53
53
|
*/
|
|
54
54
|
creditedUnits: number;
|
|
55
55
|
/**
|
|
56
|
-
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
56
|
+
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
57
57
|
*/
|
|
58
58
|
balance: number;
|
|
59
59
|
/**
|
|
@@ -33,7 +33,7 @@ export type CustomerStateMeter = {
|
|
|
33
33
|
*/
|
|
34
34
|
creditedUnits: number;
|
|
35
35
|
/**
|
|
36
|
-
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
36
|
+
* The balance of the meter, i.e. the difference between credited and consumed units.
|
|
37
37
|
*/
|
|
38
38
|
balance: number;
|
|
39
39
|
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
PaymentProcessor,
|
|
12
|
+
PaymentProcessor$inboundSchema,
|
|
13
|
+
PaymentProcessor$outboundSchema,
|
|
14
|
+
} from "./paymentprocessor.js";
|
|
15
|
+
import {
|
|
16
|
+
PaymentStatus,
|
|
17
|
+
PaymentStatus$inboundSchema,
|
|
18
|
+
PaymentStatus$outboundSchema,
|
|
19
|
+
} from "./paymentstatus.js";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Schema of a payment with a generic payment method.
|
|
23
|
+
*/
|
|
24
|
+
export type GenericPayment = {
|
|
25
|
+
/**
|
|
26
|
+
* Creation timestamp of the object.
|
|
27
|
+
*/
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
/**
|
|
30
|
+
* Last modification timestamp of the object.
|
|
31
|
+
*/
|
|
32
|
+
modifiedAt: Date | null;
|
|
33
|
+
/**
|
|
34
|
+
* The ID of the object.
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
processor: PaymentProcessor;
|
|
38
|
+
status: PaymentStatus;
|
|
39
|
+
/**
|
|
40
|
+
* The payment amount in cents.
|
|
41
|
+
*/
|
|
42
|
+
amount: number;
|
|
43
|
+
/**
|
|
44
|
+
* The payment currency. Currently, only `usd` is supported.
|
|
45
|
+
*/
|
|
46
|
+
currency: string;
|
|
47
|
+
/**
|
|
48
|
+
* The payment method used.
|
|
49
|
+
*/
|
|
50
|
+
method: string;
|
|
51
|
+
/**
|
|
52
|
+
* Error code, if the payment was declined.
|
|
53
|
+
*/
|
|
54
|
+
declineReason: string | null;
|
|
55
|
+
/**
|
|
56
|
+
* Human-reasable error message, if the payment was declined.
|
|
57
|
+
*/
|
|
58
|
+
declineMessage: string | null;
|
|
59
|
+
/**
|
|
60
|
+
* The ID of the organization that owns the payment.
|
|
61
|
+
*/
|
|
62
|
+
organizationId: string;
|
|
63
|
+
/**
|
|
64
|
+
* The ID of the checkout session associated with this payment.
|
|
65
|
+
*/
|
|
66
|
+
checkoutId: string | null;
|
|
67
|
+
/**
|
|
68
|
+
* The ID of the order associated with this payment.
|
|
69
|
+
*/
|
|
70
|
+
orderId: string | null;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const GenericPayment$inboundSchema: z.ZodType<
|
|
75
|
+
GenericPayment,
|
|
76
|
+
z.ZodTypeDef,
|
|
77
|
+
unknown
|
|
78
|
+
> = z.object({
|
|
79
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
80
|
+
modified_at: z.nullable(
|
|
81
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
82
|
+
),
|
|
83
|
+
id: z.string(),
|
|
84
|
+
processor: PaymentProcessor$inboundSchema,
|
|
85
|
+
status: PaymentStatus$inboundSchema,
|
|
86
|
+
amount: z.number().int(),
|
|
87
|
+
currency: z.string(),
|
|
88
|
+
method: z.string(),
|
|
89
|
+
decline_reason: z.nullable(z.string()),
|
|
90
|
+
decline_message: z.nullable(z.string()),
|
|
91
|
+
organization_id: z.string(),
|
|
92
|
+
checkout_id: z.nullable(z.string()),
|
|
93
|
+
order_id: z.nullable(z.string()),
|
|
94
|
+
}).transform((v) => {
|
|
95
|
+
return remap$(v, {
|
|
96
|
+
"created_at": "createdAt",
|
|
97
|
+
"modified_at": "modifiedAt",
|
|
98
|
+
"decline_reason": "declineReason",
|
|
99
|
+
"decline_message": "declineMessage",
|
|
100
|
+
"organization_id": "organizationId",
|
|
101
|
+
"checkout_id": "checkoutId",
|
|
102
|
+
"order_id": "orderId",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/** @internal */
|
|
107
|
+
export type GenericPayment$Outbound = {
|
|
108
|
+
created_at: string;
|
|
109
|
+
modified_at: string | null;
|
|
110
|
+
id: string;
|
|
111
|
+
processor: string;
|
|
112
|
+
status: string;
|
|
113
|
+
amount: number;
|
|
114
|
+
currency: string;
|
|
115
|
+
method: string;
|
|
116
|
+
decline_reason: string | null;
|
|
117
|
+
decline_message: string | null;
|
|
118
|
+
organization_id: string;
|
|
119
|
+
checkout_id: string | null;
|
|
120
|
+
order_id: string | null;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/** @internal */
|
|
124
|
+
export const GenericPayment$outboundSchema: z.ZodType<
|
|
125
|
+
GenericPayment$Outbound,
|
|
126
|
+
z.ZodTypeDef,
|
|
127
|
+
GenericPayment
|
|
128
|
+
> = z.object({
|
|
129
|
+
createdAt: z.date().transform(v => v.toISOString()),
|
|
130
|
+
modifiedAt: z.nullable(z.date().transform(v => v.toISOString())),
|
|
131
|
+
id: z.string(),
|
|
132
|
+
processor: PaymentProcessor$outboundSchema,
|
|
133
|
+
status: PaymentStatus$outboundSchema,
|
|
134
|
+
amount: z.number().int(),
|
|
135
|
+
currency: z.string(),
|
|
136
|
+
method: z.string(),
|
|
137
|
+
declineReason: z.nullable(z.string()),
|
|
138
|
+
declineMessage: z.nullable(z.string()),
|
|
139
|
+
organizationId: z.string(),
|
|
140
|
+
checkoutId: z.nullable(z.string()),
|
|
141
|
+
orderId: z.nullable(z.string()),
|
|
142
|
+
}).transform((v) => {
|
|
143
|
+
return remap$(v, {
|
|
144
|
+
createdAt: "created_at",
|
|
145
|
+
modifiedAt: "modified_at",
|
|
146
|
+
declineReason: "decline_reason",
|
|
147
|
+
declineMessage: "decline_message",
|
|
148
|
+
organizationId: "organization_id",
|
|
149
|
+
checkoutId: "checkout_id",
|
|
150
|
+
orderId: "order_id",
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* @internal
|
|
156
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
157
|
+
*/
|
|
158
|
+
export namespace GenericPayment$ {
|
|
159
|
+
/** @deprecated use `GenericPayment$inboundSchema` instead. */
|
|
160
|
+
export const inboundSchema = GenericPayment$inboundSchema;
|
|
161
|
+
/** @deprecated use `GenericPayment$outboundSchema` instead. */
|
|
162
|
+
export const outboundSchema = GenericPayment$outboundSchema;
|
|
163
|
+
/** @deprecated use `GenericPayment$Outbound` instead. */
|
|
164
|
+
export type Outbound = GenericPayment$Outbound;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function genericPaymentToJSON(genericPayment: GenericPayment): string {
|
|
168
|
+
return JSON.stringify(GenericPayment$outboundSchema.parse(genericPayment));
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function genericPaymentFromJSON(
|
|
172
|
+
jsonString: string,
|
|
173
|
+
): SafeParseResult<GenericPayment, SDKValidationError> {
|
|
174
|
+
return safeParse(
|
|
175
|
+
jsonString,
|
|
176
|
+
(x) => GenericPayment$inboundSchema.parse(JSON.parse(x)),
|
|
177
|
+
`Failed to parse 'GenericPayment' from JSON`,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
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
|
+
Pagination,
|
|
11
|
+
Pagination$inboundSchema,
|
|
12
|
+
Pagination$Outbound,
|
|
13
|
+
Pagination$outboundSchema,
|
|
14
|
+
} from "./pagination.js";
|
|
15
|
+
import {
|
|
16
|
+
Payment,
|
|
17
|
+
Payment$inboundSchema,
|
|
18
|
+
Payment$Outbound,
|
|
19
|
+
Payment$outboundSchema,
|
|
20
|
+
} from "./payment.js";
|
|
21
|
+
|
|
22
|
+
export type ListResource = {
|
|
23
|
+
items: Array<Payment>;
|
|
24
|
+
pagination: Pagination;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const ListResource$inboundSchema: z.ZodType<
|
|
29
|
+
ListResource,
|
|
30
|
+
z.ZodTypeDef,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.object({
|
|
33
|
+
items: z.array(Payment$inboundSchema),
|
|
34
|
+
pagination: Pagination$inboundSchema,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export type ListResource$Outbound = {
|
|
39
|
+
items: Array<Payment$Outbound>;
|
|
40
|
+
pagination: Pagination$Outbound;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const ListResource$outboundSchema: z.ZodType<
|
|
45
|
+
ListResource$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
ListResource
|
|
48
|
+
> = z.object({
|
|
49
|
+
items: z.array(Payment$outboundSchema),
|
|
50
|
+
pagination: Pagination$outboundSchema,
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
+
*/
|
|
57
|
+
export namespace ListResource$ {
|
|
58
|
+
/** @deprecated use `ListResource$inboundSchema` instead. */
|
|
59
|
+
export const inboundSchema = ListResource$inboundSchema;
|
|
60
|
+
/** @deprecated use `ListResource$outboundSchema` instead. */
|
|
61
|
+
export const outboundSchema = ListResource$outboundSchema;
|
|
62
|
+
/** @deprecated use `ListResource$Outbound` instead. */
|
|
63
|
+
export type Outbound = ListResource$Outbound;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function listResourceToJSON(listResource: ListResource): string {
|
|
67
|
+
return JSON.stringify(ListResource$outboundSchema.parse(listResource));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function listResourceFromJSON(
|
|
71
|
+
jsonString: string,
|
|
72
|
+
): SafeParseResult<ListResource, SDKValidationError> {
|
|
73
|
+
return safeParse(
|
|
74
|
+
jsonString,
|
|
75
|
+
(x) => ListResource$inboundSchema.parse(JSON.parse(x)),
|
|
76
|
+
`Failed to parse 'ListResource' from JSON`,
|
|
77
|
+
);
|
|
78
|
+
}
|