@paygentic/sdk 0.6.38 → 0.7.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 +44 -33
- package/dist/commonjs/funcs/billableMetricsListEvents.js +1 -0
- package/dist/commonjs/funcs/billableMetricsListEvents.js.map +1 -1
- package/dist/commonjs/funcs/{usageEventsGet.d.ts → costsGetCostReport.d.ts} +6 -3
- package/dist/commonjs/funcs/costsGetCostReport.d.ts.map +1 -0
- package/dist/commonjs/funcs/{usageEventsList.js → costsGetCostReport.js} +25 -14
- package/dist/commonjs/funcs/costsGetCostReport.js.map +1 -0
- package/dist/commonjs/funcs/entitlementsIssue.d.ts +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.d.ts.map +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.js +1 -1
- package/dist/commonjs/funcs/entitlementsIssue.js.map +1 -1
- package/dist/commonjs/funcs/revenueGet.js +1 -0
- package/dist/commonjs/funcs/revenueGet.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.d.ts.map +1 -1
- package/dist/commonjs/lib/config.js +6 -2
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/costreportgroup.d.ts +48 -0
- package/dist/commonjs/models/costreportgroup.d.ts.map +1 -0
- package/dist/commonjs/models/{activeentitlement.js → costreportgroup.js} +22 -19
- package/dist/commonjs/models/costreportgroup.js.map +1 -0
- package/dist/commonjs/models/costreportresponse.d.ts +68 -0
- package/dist/commonjs/models/costreportresponse.d.ts.map +1 -0
- package/dist/commonjs/models/costreportresponse.js +87 -0
- package/dist/commonjs/models/costreportresponse.js.map +1 -0
- package/dist/commonjs/models/costreporttimeseries.d.ts +17 -0
- package/dist/commonjs/models/costreporttimeseries.d.ts.map +1 -0
- package/dist/commonjs/models/{createdisputerequest.js → costreporttimeseries.js} +10 -8
- package/dist/commonjs/models/costreporttimeseries.js.map +1 -0
- package/dist/commonjs/models/currencybreakdownentry.d.ts +26 -0
- package/dist/commonjs/models/currencybreakdownentry.d.ts.map +1 -0
- package/dist/commonjs/models/{operations/batchcreateusageevents.js → currencybreakdownentry.js} +15 -8
- package/dist/commonjs/models/currencybreakdownentry.js.map +1 -0
- package/dist/commonjs/models/entitlement.d.ts +34 -37
- package/dist/commonjs/models/entitlement.d.ts.map +1 -1
- package/dist/commonjs/models/entitlement.js +19 -22
- package/dist/commonjs/models/entitlement.js.map +1 -1
- package/dist/commonjs/models/errors/error.d.ts +2 -3
- package/dist/commonjs/models/errors/error.d.ts.map +1 -1
- package/dist/commonjs/models/errors/error.js +1 -2
- package/dist/commonjs/models/errors/error.js.map +1 -1
- package/dist/commonjs/models/index.d.ts +4 -10
- package/dist/commonjs/models/index.d.ts.map +1 -1
- package/dist/commonjs/models/index.js +4 -10
- package/dist/commonjs/models/index.js.map +1 -1
- package/dist/commonjs/models/meterevent.d.ts +4 -0
- package/dist/commonjs/models/meterevent.d.ts.map +1 -1
- package/dist/commonjs/models/meterevent.js +1 -0
- package/dist/commonjs/models/meterevent.js.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts +4 -4
- package/dist/commonjs/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getbillablemetricmeter.js +4 -5
- package/dist/commonjs/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/commonjs/models/operations/getcostreport.d.ts +126 -0
- package/dist/commonjs/models/operations/getcostreport.d.ts.map +1 -0
- package/dist/commonjs/models/operations/getcostreport.js +92 -0
- package/dist/commonjs/models/operations/getcostreport.js.map +1 -0
- package/dist/commonjs/models/operations/getrevenue.d.ts +10 -3
- package/dist/commonjs/models/operations/getrevenue.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getrevenue.js +4 -1
- package/dist/commonjs/models/operations/getrevenue.js.map +1 -1
- package/dist/commonjs/models/operations/index.d.ts +1 -6
- package/dist/commonjs/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/models/operations/index.js +1 -6
- package/dist/commonjs/models/operations/index.js.map +1 -1
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts +5 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listbillablemetricevents.js +1 -0
- package/dist/commonjs/models/operations/listbillablemetricevents.js.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.d.ts +12 -7
- package/dist/commonjs/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/commonjs/models/revenuesummaryresponse.js +6 -4
- package/dist/commonjs/models/revenuesummaryresponse.js.map +1 -1
- package/dist/commonjs/models/revenuetrendbucket.d.ts +1 -1
- package/dist/commonjs/models/subscription.d.ts +5 -1
- package/dist/commonjs/models/subscription.d.ts.map +1 -1
- package/dist/commonjs/models/subscription.js +1 -0
- package/dist/commonjs/models/subscription.js.map +1 -1
- package/dist/commonjs/models/user.d.ts +4 -0
- package/dist/commonjs/models/user.d.ts.map +1 -1
- package/dist/commonjs/models/user.js +1 -0
- package/dist/commonjs/models/user.js.map +1 -1
- package/dist/commonjs/sdk/costs.d.ts +7 -0
- package/dist/commonjs/sdk/costs.d.ts.map +1 -1
- package/dist/commonjs/sdk/costs.js +10 -0
- package/dist/commonjs/sdk/costs.js.map +1 -1
- package/dist/commonjs/sdk/entitlements.d.ts +1 -1
- package/dist/commonjs/sdk/entitlements.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +0 -9
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +0 -12
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/types/index.d.ts +0 -1
- package/dist/commonjs/types/index.d.ts.map +1 -1
- package/dist/commonjs/types/index.js +1 -3
- package/dist/commonjs/types/index.js.map +1 -1
- package/dist/esm/funcs/billableMetricsListEvents.js +1 -0
- package/dist/esm/funcs/billableMetricsListEvents.js.map +1 -1
- package/dist/esm/funcs/{usageEventsGet.d.ts → costsGetCostReport.d.ts} +6 -3
- package/dist/esm/funcs/costsGetCostReport.d.ts.map +1 -0
- package/dist/esm/funcs/{usageEventsList.js → costsGetCostReport.js} +24 -13
- package/dist/esm/funcs/costsGetCostReport.js.map +1 -0
- package/dist/esm/funcs/entitlementsIssue.d.ts +1 -1
- package/dist/esm/funcs/entitlementsIssue.d.ts.map +1 -1
- package/dist/esm/funcs/entitlementsIssue.js +1 -1
- package/dist/esm/funcs/entitlementsIssue.js.map +1 -1
- package/dist/esm/funcs/revenueGet.js +1 -0
- package/dist/esm/funcs/revenueGet.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.d.ts.map +1 -1
- package/dist/esm/lib/config.js +6 -2
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/costreportgroup.d.ts +48 -0
- package/dist/esm/models/costreportgroup.d.ts.map +1 -0
- package/dist/esm/models/costreportgroup.js +28 -0
- package/dist/esm/models/costreportgroup.js.map +1 -0
- package/dist/esm/models/costreportresponse.d.ts +68 -0
- package/dist/esm/models/costreportresponse.d.ts.map +1 -0
- package/dist/esm/models/costreportresponse.js +48 -0
- package/dist/esm/models/costreportresponse.js.map +1 -0
- package/dist/esm/models/costreporttimeseries.d.ts +17 -0
- package/dist/esm/models/costreporttimeseries.d.ts.map +1 -0
- package/dist/esm/models/costreporttimeseries.js +15 -0
- package/dist/esm/models/costreporttimeseries.js.map +1 -0
- package/dist/esm/models/currencybreakdownentry.d.ts +26 -0
- package/dist/esm/models/currencybreakdownentry.d.ts.map +1 -0
- package/dist/esm/models/currencybreakdownentry.js +20 -0
- package/dist/esm/models/currencybreakdownentry.js.map +1 -0
- package/dist/esm/models/entitlement.d.ts +34 -37
- package/dist/esm/models/entitlement.d.ts.map +1 -1
- package/dist/esm/models/entitlement.js +18 -20
- package/dist/esm/models/entitlement.js.map +1 -1
- package/dist/esm/models/errors/error.d.ts +2 -3
- package/dist/esm/models/errors/error.d.ts.map +1 -1
- package/dist/esm/models/errors/error.js +1 -2
- package/dist/esm/models/errors/error.js.map +1 -1
- package/dist/esm/models/index.d.ts +4 -10
- package/dist/esm/models/index.d.ts.map +1 -1
- package/dist/esm/models/index.js +4 -10
- package/dist/esm/models/index.js.map +1 -1
- package/dist/esm/models/meterevent.d.ts +4 -0
- package/dist/esm/models/meterevent.d.ts.map +1 -1
- package/dist/esm/models/meterevent.js +1 -0
- package/dist/esm/models/meterevent.js.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts +4 -4
- package/dist/esm/models/operations/getbillablemetricmeter.d.ts.map +1 -1
- package/dist/esm/models/operations/getbillablemetricmeter.js +3 -4
- package/dist/esm/models/operations/getbillablemetricmeter.js.map +1 -1
- package/dist/esm/models/operations/getcostreport.d.ts +126 -0
- package/dist/esm/models/operations/getcostreport.d.ts.map +1 -0
- package/dist/esm/models/operations/getcostreport.js +55 -0
- package/dist/esm/models/operations/getcostreport.js.map +1 -0
- package/dist/esm/models/operations/getrevenue.d.ts +10 -3
- package/dist/esm/models/operations/getrevenue.d.ts.map +1 -1
- package/dist/esm/models/operations/getrevenue.js +4 -1
- package/dist/esm/models/operations/getrevenue.js.map +1 -1
- package/dist/esm/models/operations/index.d.ts +1 -6
- package/dist/esm/models/operations/index.d.ts.map +1 -1
- package/dist/esm/models/operations/index.js +1 -6
- package/dist/esm/models/operations/index.js.map +1 -1
- package/dist/esm/models/operations/listbillablemetricevents.d.ts +5 -0
- package/dist/esm/models/operations/listbillablemetricevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listbillablemetricevents.js +1 -0
- package/dist/esm/models/operations/listbillablemetricevents.js.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.d.ts +12 -7
- package/dist/esm/models/revenuesummaryresponse.d.ts.map +1 -1
- package/dist/esm/models/revenuesummaryresponse.js +6 -4
- package/dist/esm/models/revenuesummaryresponse.js.map +1 -1
- package/dist/esm/models/revenuetrendbucket.d.ts +1 -1
- package/dist/esm/models/subscription.d.ts +5 -1
- package/dist/esm/models/subscription.d.ts.map +1 -1
- package/dist/esm/models/subscription.js +1 -0
- package/dist/esm/models/subscription.js.map +1 -1
- package/dist/esm/models/user.d.ts +4 -0
- package/dist/esm/models/user.d.ts.map +1 -1
- package/dist/esm/models/user.js +1 -0
- package/dist/esm/models/user.js.map +1 -1
- package/dist/esm/sdk/costs.d.ts +7 -0
- package/dist/esm/sdk/costs.d.ts.map +1 -1
- package/dist/esm/sdk/costs.js +10 -0
- package/dist/esm/sdk/costs.js.map +1 -1
- package/dist/esm/sdk/entitlements.d.ts +1 -1
- package/dist/esm/sdk/entitlements.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +0 -9
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +0 -12
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/esm/types/index.d.ts.map +1 -1
- package/dist/esm/types/index.js +0 -1
- package/dist/esm/types/index.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -2
- package/src/funcs/billableMetricsListEvents.ts +1 -0
- package/src/funcs/{usageEventsList.ts → costsGetCostReport.ts} +29 -18
- package/src/funcs/entitlementsIssue.ts +4 -4
- package/src/funcs/revenueGet.ts +1 -0
- package/src/lib/config.ts +6 -2
- package/src/models/costreportgroup.ts +94 -0
- package/src/models/costreportresponse.ts +145 -0
- package/src/models/costreporttimeseries.ts +40 -0
- package/src/models/currencybreakdownentry.ts +60 -0
- package/src/models/entitlement.ts +43 -68
- package/src/models/errors/error.ts +3 -4
- package/src/models/index.ts +4 -10
- package/src/models/meterevent.ts +5 -0
- package/src/models/operations/getbillablemetricmeter.ts +9 -6
- package/src/models/operations/getcostreport.ts +172 -0
- package/src/models/operations/getrevenue.ts +11 -3
- package/src/models/operations/index.ts +1 -6
- package/src/models/operations/listbillablemetricevents.ts +6 -0
- package/src/models/revenuesummaryresponse.ts +20 -11
- package/src/models/revenuetrendbucket.ts +1 -1
- package/src/models/subscription.ts +6 -1
- package/src/models/user.ts +5 -0
- package/src/sdk/costs.ts +18 -0
- package/src/sdk/entitlements.ts +1 -1
- package/src/sdk/sdk.ts +0 -18
- package/src/types/index.ts +0 -1
- package/dist/commonjs/funcs/disputesCreate.d.ts +0 -18
- package/dist/commonjs/funcs/disputesCreate.d.ts.map +0 -1
- package/dist/commonjs/funcs/disputesCreate.js +0 -118
- package/dist/commonjs/funcs/disputesCreate.js.map +0 -1
- package/dist/commonjs/funcs/disputesList.d.ts +0 -18
- package/dist/commonjs/funcs/disputesList.d.ts.map +0 -1
- package/dist/commonjs/funcs/disputesList.js +0 -126
- package/dist/commonjs/funcs/disputesList.js.map +0 -1
- package/dist/commonjs/funcs/entitlementsV0Create.d.ts +0 -18
- package/dist/commonjs/funcs/entitlementsV0Create.d.ts.map +0 -1
- package/dist/commonjs/funcs/entitlementsV0Create.js +0 -118
- package/dist/commonjs/funcs/entitlementsV0Create.js.map +0 -1
- package/dist/commonjs/funcs/entitlementsV0ListActive.d.ts +0 -15
- package/dist/commonjs/funcs/entitlementsV0ListActive.d.ts.map +0 -1
- package/dist/commonjs/funcs/entitlementsV0ListActive.js +0 -120
- package/dist/commonjs/funcs/entitlementsV0ListActive.js.map +0 -1
- package/dist/commonjs/funcs/usageEventsBatchCreate.d.ts +0 -19
- package/dist/commonjs/funcs/usageEventsBatchCreate.d.ts.map +0 -1
- package/dist/commonjs/funcs/usageEventsBatchCreate.js +0 -119
- package/dist/commonjs/funcs/usageEventsBatchCreate.js.map +0 -1
- package/dist/commonjs/funcs/usageEventsCreate.d.ts +0 -18
- package/dist/commonjs/funcs/usageEventsCreate.d.ts.map +0 -1
- package/dist/commonjs/funcs/usageEventsCreate.js +0 -118
- package/dist/commonjs/funcs/usageEventsCreate.js.map +0 -1
- package/dist/commonjs/funcs/usageEventsGet.d.ts.map +0 -1
- package/dist/commonjs/funcs/usageEventsGet.js +0 -121
- package/dist/commonjs/funcs/usageEventsGet.js.map +0 -1
- package/dist/commonjs/funcs/usageEventsList.d.ts +0 -15
- package/dist/commonjs/funcs/usageEventsList.d.ts.map +0 -1
- package/dist/commonjs/funcs/usageEventsList.js.map +0 -1
- package/dist/commonjs/funcs/usageEventsRefund.d.ts +0 -19
- package/dist/commonjs/funcs/usageEventsRefund.d.ts.map +0 -1
- package/dist/commonjs/funcs/usageEventsRefund.js +0 -125
- package/dist/commonjs/funcs/usageEventsRefund.js.map +0 -1
- package/dist/commonjs/models/activeentitlement.d.ts +0 -45
- package/dist/commonjs/models/activeentitlement.d.ts.map +0 -1
- package/dist/commonjs/models/activeentitlement.js.map +0 -1
- package/dist/commonjs/models/batchusageeventresponse.d.ts +0 -67
- package/dist/commonjs/models/batchusageeventresponse.d.ts.map +0 -1
- package/dist/commonjs/models/batchusageeventresponse.js +0 -80
- package/dist/commonjs/models/batchusageeventresponse.js.map +0 -1
- package/dist/commonjs/models/createdisputerequest.d.ts +0 -20
- package/dist/commonjs/models/createdisputerequest.d.ts.map +0 -1
- package/dist/commonjs/models/createdisputerequest.js.map +0 -1
- package/dist/commonjs/models/createentitlementrequest.d.ts +0 -53
- package/dist/commonjs/models/createentitlementrequest.d.ts.map +0 -1
- package/dist/commonjs/models/createentitlementrequest.js +0 -62
- package/dist/commonjs/models/createentitlementrequest.js.map +0 -1
- package/dist/commonjs/models/createusageeventrequest.d.ts +0 -69
- package/dist/commonjs/models/createusageeventrequest.d.ts.map +0 -1
- package/dist/commonjs/models/createusageeventrequest.js +0 -65
- package/dist/commonjs/models/createusageeventrequest.js.map +0 -1
- package/dist/commonjs/models/dispute.d.ts +0 -70
- package/dist/commonjs/models/dispute.d.ts.map +0 -1
- package/dist/commonjs/models/dispute.js +0 -77
- package/dist/commonjs/models/dispute.js.map +0 -1
- package/dist/commonjs/models/disputewithcustomer.d.ts +0 -79
- package/dist/commonjs/models/disputewithcustomer.d.ts.map +0 -1
- package/dist/commonjs/models/disputewithcustomer.js +0 -88
- package/dist/commonjs/models/disputewithcustomer.js.map +0 -1
- package/dist/commonjs/models/error.d.ts +0 -16
- package/dist/commonjs/models/error.d.ts.map +0 -1
- package/dist/commonjs/models/error.js +0 -50
- package/dist/commonjs/models/error.js.map +0 -1
- package/dist/commonjs/models/operations/batchcreateusageevents.d.ts +0 -13
- package/dist/commonjs/models/operations/batchcreateusageevents.d.ts.map +0 -1
- package/dist/commonjs/models/operations/batchcreateusageevents.js.map +0 -1
- package/dist/commonjs/models/operations/getactiveentitlements.d.ts +0 -54
- package/dist/commonjs/models/operations/getactiveentitlements.d.ts.map +0 -1
- package/dist/commonjs/models/operations/getactiveentitlements.js +0 -79
- package/dist/commonjs/models/operations/getactiveentitlements.js.map +0 -1
- package/dist/commonjs/models/operations/getusageevent.d.ts +0 -12
- package/dist/commonjs/models/operations/getusageevent.d.ts.map +0 -1
- package/dist/commonjs/models/operations/getusageevent.js +0 -49
- package/dist/commonjs/models/operations/getusageevent.js.map +0 -1
- package/dist/commonjs/models/operations/listdisputes.d.ts +0 -84
- package/dist/commonjs/models/operations/listdisputes.d.ts.map +0 -1
- package/dist/commonjs/models/operations/listdisputes.js +0 -92
- package/dist/commonjs/models/operations/listdisputes.js.map +0 -1
- package/dist/commonjs/models/operations/listusageevents.d.ts +0 -74
- package/dist/commonjs/models/operations/listusageevents.d.ts.map +0 -1
- package/dist/commonjs/models/operations/listusageevents.js +0 -73
- package/dist/commonjs/models/operations/listusageevents.js.map +0 -1
- package/dist/commonjs/models/operations/refundusageevent.d.ts +0 -32
- package/dist/commonjs/models/operations/refundusageevent.d.ts.map +0 -1
- package/dist/commonjs/models/operations/refundusageevent.js +0 -64
- package/dist/commonjs/models/operations/refundusageevent.js.map +0 -1
- package/dist/commonjs/models/schemasentitlement.d.ts +0 -71
- package/dist/commonjs/models/schemasentitlement.d.ts.map +0 -1
- package/dist/commonjs/models/schemasentitlement.js +0 -74
- package/dist/commonjs/models/schemasentitlement.js.map +0 -1
- package/dist/commonjs/models/usageevent.d.ts +0 -110
- package/dist/commonjs/models/usageevent.d.ts.map +0 -1
- package/dist/commonjs/models/usageevent.js +0 -102
- package/dist/commonjs/models/usageevent.js.map +0 -1
- package/dist/commonjs/sdk/disputes.d.ts +0 -20
- package/dist/commonjs/sdk/disputes.d.ts.map +0 -1
- package/dist/commonjs/sdk/disputes.js +0 -32
- package/dist/commonjs/sdk/disputes.js.map +0 -1
- package/dist/commonjs/sdk/entitlementsv0.d.ts +0 -17
- package/dist/commonjs/sdk/entitlementsv0.d.ts.map +0 -1
- package/dist/commonjs/sdk/entitlementsv0.js +0 -29
- package/dist/commonjs/sdk/entitlementsv0.js.map +0 -1
- package/dist/commonjs/sdk/usageevents.d.ts +0 -35
- package/dist/commonjs/sdk/usageevents.d.ts.map +0 -1
- package/dist/commonjs/sdk/usageevents.js +0 -56
- package/dist/commonjs/sdk/usageevents.js.map +0 -1
- package/dist/commonjs/types/decimal.d.ts +0 -2
- package/dist/commonjs/types/decimal.d.ts.map +0 -1
- package/dist/commonjs/types/decimal.js +0 -21
- package/dist/commonjs/types/decimal.js.map +0 -1
- package/dist/esm/funcs/disputesCreate.d.ts +0 -18
- package/dist/esm/funcs/disputesCreate.d.ts.map +0 -1
- package/dist/esm/funcs/disputesCreate.js +0 -82
- package/dist/esm/funcs/disputesCreate.js.map +0 -1
- package/dist/esm/funcs/disputesList.d.ts +0 -18
- package/dist/esm/funcs/disputesList.d.ts.map +0 -1
- package/dist/esm/funcs/disputesList.js +0 -90
- package/dist/esm/funcs/disputesList.js.map +0 -1
- package/dist/esm/funcs/entitlementsV0Create.d.ts +0 -18
- package/dist/esm/funcs/entitlementsV0Create.d.ts.map +0 -1
- package/dist/esm/funcs/entitlementsV0Create.js +0 -82
- package/dist/esm/funcs/entitlementsV0Create.js.map +0 -1
- package/dist/esm/funcs/entitlementsV0ListActive.d.ts +0 -15
- package/dist/esm/funcs/entitlementsV0ListActive.d.ts.map +0 -1
- package/dist/esm/funcs/entitlementsV0ListActive.js +0 -84
- package/dist/esm/funcs/entitlementsV0ListActive.js.map +0 -1
- package/dist/esm/funcs/usageEventsBatchCreate.d.ts +0 -19
- package/dist/esm/funcs/usageEventsBatchCreate.d.ts.map +0 -1
- package/dist/esm/funcs/usageEventsBatchCreate.js +0 -83
- package/dist/esm/funcs/usageEventsBatchCreate.js.map +0 -1
- package/dist/esm/funcs/usageEventsCreate.d.ts +0 -18
- package/dist/esm/funcs/usageEventsCreate.d.ts.map +0 -1
- package/dist/esm/funcs/usageEventsCreate.js +0 -82
- package/dist/esm/funcs/usageEventsCreate.js.map +0 -1
- package/dist/esm/funcs/usageEventsGet.d.ts.map +0 -1
- package/dist/esm/funcs/usageEventsGet.js +0 -85
- package/dist/esm/funcs/usageEventsGet.js.map +0 -1
- package/dist/esm/funcs/usageEventsList.d.ts +0 -15
- package/dist/esm/funcs/usageEventsList.d.ts.map +0 -1
- package/dist/esm/funcs/usageEventsList.js.map +0 -1
- package/dist/esm/funcs/usageEventsRefund.d.ts +0 -19
- package/dist/esm/funcs/usageEventsRefund.d.ts.map +0 -1
- package/dist/esm/funcs/usageEventsRefund.js +0 -89
- package/dist/esm/funcs/usageEventsRefund.js.map +0 -1
- package/dist/esm/models/activeentitlement.d.ts +0 -45
- package/dist/esm/models/activeentitlement.d.ts.map +0 -1
- package/dist/esm/models/activeentitlement.js +0 -26
- package/dist/esm/models/activeentitlement.js.map +0 -1
- package/dist/esm/models/batchusageeventresponse.d.ts +0 -67
- package/dist/esm/models/batchusageeventresponse.d.ts.map +0 -1
- package/dist/esm/models/batchusageeventresponse.js +0 -41
- package/dist/esm/models/batchusageeventresponse.js.map +0 -1
- package/dist/esm/models/createdisputerequest.d.ts +0 -20
- package/dist/esm/models/createdisputerequest.d.ts.map +0 -1
- package/dist/esm/models/createdisputerequest.js +0 -13
- package/dist/esm/models/createdisputerequest.js.map +0 -1
- package/dist/esm/models/createentitlementrequest.d.ts +0 -53
- package/dist/esm/models/createentitlementrequest.d.ts.map +0 -1
- package/dist/esm/models/createentitlementrequest.js +0 -24
- package/dist/esm/models/createentitlementrequest.js.map +0 -1
- package/dist/esm/models/createusageeventrequest.d.ts +0 -69
- package/dist/esm/models/createusageeventrequest.d.ts.map +0 -1
- package/dist/esm/models/createusageeventrequest.js +0 -27
- package/dist/esm/models/createusageeventrequest.js.map +0 -1
- package/dist/esm/models/dispute.d.ts +0 -70
- package/dist/esm/models/dispute.d.ts.map +0 -1
- package/dist/esm/models/dispute.js +0 -40
- package/dist/esm/models/dispute.js.map +0 -1
- package/dist/esm/models/disputewithcustomer.d.ts +0 -79
- package/dist/esm/models/disputewithcustomer.d.ts.map +0 -1
- package/dist/esm/models/disputewithcustomer.js +0 -50
- package/dist/esm/models/disputewithcustomer.js.map +0 -1
- package/dist/esm/models/error.d.ts +0 -16
- package/dist/esm/models/error.d.ts.map +0 -1
- package/dist/esm/models/error.js +0 -14
- package/dist/esm/models/error.js.map +0 -1
- package/dist/esm/models/operations/batchcreateusageevents.d.ts +0 -13
- package/dist/esm/models/operations/batchcreateusageevents.d.ts.map +0 -1
- package/dist/esm/models/operations/batchcreateusageevents.js +0 -13
- package/dist/esm/models/operations/batchcreateusageevents.js.map +0 -1
- package/dist/esm/models/operations/getactiveentitlements.d.ts +0 -54
- package/dist/esm/models/operations/getactiveentitlements.d.ts.map +0 -1
- package/dist/esm/models/operations/getactiveentitlements.js +0 -40
- package/dist/esm/models/operations/getactiveentitlements.js.map +0 -1
- package/dist/esm/models/operations/getusageevent.d.ts +0 -12
- package/dist/esm/models/operations/getusageevent.d.ts.map +0 -1
- package/dist/esm/models/operations/getusageevent.js +0 -12
- package/dist/esm/models/operations/getusageevent.js.map +0 -1
- package/dist/esm/models/operations/listdisputes.d.ts +0 -84
- package/dist/esm/models/operations/listdisputes.d.ts.map +0 -1
- package/dist/esm/models/operations/listdisputes.js +0 -53
- package/dist/esm/models/operations/listdisputes.js.map +0 -1
- package/dist/esm/models/operations/listusageevents.d.ts +0 -74
- package/dist/esm/models/operations/listusageevents.d.ts.map +0 -1
- package/dist/esm/models/operations/listusageevents.js +0 -35
- package/dist/esm/models/operations/listusageevents.js.map +0 -1
- package/dist/esm/models/operations/refundusageevent.d.ts +0 -32
- package/dist/esm/models/operations/refundusageevent.d.ts.map +0 -1
- package/dist/esm/models/operations/refundusageevent.js +0 -26
- package/dist/esm/models/operations/refundusageevent.js.map +0 -1
- package/dist/esm/models/schemasentitlement.d.ts +0 -71
- package/dist/esm/models/schemasentitlement.d.ts.map +0 -1
- package/dist/esm/models/schemasentitlement.js +0 -37
- package/dist/esm/models/schemasentitlement.js.map +0 -1
- package/dist/esm/models/usageevent.d.ts +0 -110
- package/dist/esm/models/usageevent.d.ts.map +0 -1
- package/dist/esm/models/usageevent.js +0 -62
- package/dist/esm/models/usageevent.js.map +0 -1
- package/dist/esm/sdk/disputes.d.ts +0 -20
- package/dist/esm/sdk/disputes.d.ts.map +0 -1
- package/dist/esm/sdk/disputes.js +0 -28
- package/dist/esm/sdk/disputes.js.map +0 -1
- package/dist/esm/sdk/entitlementsv0.d.ts +0 -17
- package/dist/esm/sdk/entitlementsv0.d.ts.map +0 -1
- package/dist/esm/sdk/entitlementsv0.js +0 -25
- package/dist/esm/sdk/entitlementsv0.js.map +0 -1
- package/dist/esm/sdk/usageevents.d.ts +0 -35
- package/dist/esm/sdk/usageevents.d.ts.map +0 -1
- package/dist/esm/sdk/usageevents.js +0 -52
- package/dist/esm/sdk/usageevents.js.map +0 -1
- package/dist/esm/types/decimal.d.ts +0 -2
- package/dist/esm/types/decimal.d.ts.map +0 -1
- package/dist/esm/types/decimal.js +0 -5
- package/dist/esm/types/decimal.js.map +0 -1
- package/src/funcs/disputesCreate.ts +0 -174
- package/src/funcs/disputesList.ts +0 -184
- package/src/funcs/entitlementsV0Create.ts +0 -174
- package/src/funcs/entitlementsV0ListActive.ts +0 -178
- package/src/funcs/usageEventsBatchCreate.ts +0 -176
- package/src/funcs/usageEventsCreate.ts +0 -174
- package/src/funcs/usageEventsGet.ts +0 -173
- package/src/funcs/usageEventsRefund.ts +0 -181
- package/src/models/activeentitlement.ts +0 -80
- package/src/models/batchusageeventresponse.ts +0 -129
- package/src/models/createdisputerequest.ts +0 -40
- package/src/models/createentitlementrequest.ts +0 -93
- package/src/models/createusageeventrequest.ts +0 -112
- package/src/models/dispute.ts +0 -113
- package/src/models/disputewithcustomer.ts +0 -145
- package/src/models/error.ts +0 -23
- package/src/models/operations/batchcreateusageevents.ts +0 -34
- package/src/models/operations/getactiveentitlements.ts +0 -123
- package/src/models/operations/getusageevent.ts +0 -31
- package/src/models/operations/listdisputes.ts +0 -156
- package/src/models/operations/listusageevents.ts +0 -124
- package/src/models/operations/refundusageevent.ts +0 -76
- package/src/models/schemasentitlement.ts +0 -111
- package/src/models/usageevent.ts +0 -202
- package/src/sdk/disputes.ts +0 -46
- package/src/sdk/entitlementsv0.ts +0 -43
- package/src/sdk/usageevents.ts +0 -94
- package/src/types/decimal.ts +0 -5
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { PaygenticCore } from "../core.js";
|
|
6
|
-
import { encodeSimple } 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
|
-
* Get
|
|
31
|
-
*/
|
|
32
|
-
export function usageEventsGet(
|
|
33
|
-
client: PaygenticCore,
|
|
34
|
-
request: operations.GetUsageEventRequest,
|
|
35
|
-
options?: RequestOptions,
|
|
36
|
-
): APIPromise<
|
|
37
|
-
Result<
|
|
38
|
-
models.UsageEvent,
|
|
39
|
-
| errors.ErrorT
|
|
40
|
-
| PaygenticError
|
|
41
|
-
| ResponseValidationError
|
|
42
|
-
| ConnectionError
|
|
43
|
-
| RequestAbortedError
|
|
44
|
-
| RequestTimeoutError
|
|
45
|
-
| InvalidRequestError
|
|
46
|
-
| UnexpectedClientError
|
|
47
|
-
| SDKValidationError
|
|
48
|
-
>
|
|
49
|
-
> {
|
|
50
|
-
return new APIPromise($do(
|
|
51
|
-
client,
|
|
52
|
-
request,
|
|
53
|
-
options,
|
|
54
|
-
));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function $do(
|
|
58
|
-
client: PaygenticCore,
|
|
59
|
-
request: operations.GetUsageEventRequest,
|
|
60
|
-
options?: RequestOptions,
|
|
61
|
-
): Promise<
|
|
62
|
-
[
|
|
63
|
-
Result<
|
|
64
|
-
models.UsageEvent,
|
|
65
|
-
| errors.ErrorT
|
|
66
|
-
| PaygenticError
|
|
67
|
-
| ResponseValidationError
|
|
68
|
-
| ConnectionError
|
|
69
|
-
| RequestAbortedError
|
|
70
|
-
| RequestTimeoutError
|
|
71
|
-
| InvalidRequestError
|
|
72
|
-
| UnexpectedClientError
|
|
73
|
-
| SDKValidationError
|
|
74
|
-
>,
|
|
75
|
-
APICall,
|
|
76
|
-
]
|
|
77
|
-
> {
|
|
78
|
-
const parsed = safeParse(
|
|
79
|
-
request,
|
|
80
|
-
(value) => operations.GetUsageEventRequest$outboundSchema.parse(value),
|
|
81
|
-
"Input validation failed",
|
|
82
|
-
);
|
|
83
|
-
if (!parsed.ok) {
|
|
84
|
-
return [parsed, { status: "invalid" }];
|
|
85
|
-
}
|
|
86
|
-
const payload = parsed.value;
|
|
87
|
-
const body = null;
|
|
88
|
-
|
|
89
|
-
const pathParams = {
|
|
90
|
-
id: encodeSimple("id", payload.id, {
|
|
91
|
-
explode: false,
|
|
92
|
-
charEncoding: "percent",
|
|
93
|
-
}),
|
|
94
|
-
};
|
|
95
|
-
const path = pathToFunc("/v0/usage/{id}")(pathParams);
|
|
96
|
-
|
|
97
|
-
const headers = new Headers(compactMap({
|
|
98
|
-
Accept: "application/json",
|
|
99
|
-
}));
|
|
100
|
-
|
|
101
|
-
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
102
|
-
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
103
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
|
-
|
|
105
|
-
const context = {
|
|
106
|
-
options: client._options,
|
|
107
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
108
|
-
operationID: "getUsageEvent",
|
|
109
|
-
oAuth2Scopes: null,
|
|
110
|
-
|
|
111
|
-
resolvedSecurity: requestSecurity,
|
|
112
|
-
|
|
113
|
-
securitySource: client._options.bearerAuth,
|
|
114
|
-
retryConfig: options?.retries
|
|
115
|
-
|| client._options.retryConfig
|
|
116
|
-
|| { strategy: "none" },
|
|
117
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const requestRes = client._createRequest(context, {
|
|
121
|
-
security: requestSecurity,
|
|
122
|
-
method: "GET",
|
|
123
|
-
baseURL: options?.serverURL,
|
|
124
|
-
path: path,
|
|
125
|
-
headers: headers,
|
|
126
|
-
body: body,
|
|
127
|
-
userAgent: client._options.userAgent,
|
|
128
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
129
|
-
}, options);
|
|
130
|
-
if (!requestRes.ok) {
|
|
131
|
-
return [requestRes, { status: "invalid" }];
|
|
132
|
-
}
|
|
133
|
-
const req = requestRes.value;
|
|
134
|
-
|
|
135
|
-
const doResult = await client._do(req, {
|
|
136
|
-
context,
|
|
137
|
-
errorCodes: ["403", "404", "4XX", "500", "5XX"],
|
|
138
|
-
retryConfig: context.retryConfig,
|
|
139
|
-
retryCodes: context.retryCodes,
|
|
140
|
-
});
|
|
141
|
-
if (!doResult.ok) {
|
|
142
|
-
return [doResult, { status: "request-error", request: req }];
|
|
143
|
-
}
|
|
144
|
-
const response = doResult.value;
|
|
145
|
-
|
|
146
|
-
const responseFields = {
|
|
147
|
-
HttpMeta: { Response: response, Request: req },
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
const [result] = await M.match<
|
|
151
|
-
models.UsageEvent,
|
|
152
|
-
| errors.ErrorT
|
|
153
|
-
| PaygenticError
|
|
154
|
-
| ResponseValidationError
|
|
155
|
-
| ConnectionError
|
|
156
|
-
| RequestAbortedError
|
|
157
|
-
| RequestTimeoutError
|
|
158
|
-
| InvalidRequestError
|
|
159
|
-
| UnexpectedClientError
|
|
160
|
-
| SDKValidationError
|
|
161
|
-
>(
|
|
162
|
-
M.json(200, models.UsageEvent$inboundSchema),
|
|
163
|
-
M.jsonErr([403, 404], errors.ErrorT$inboundSchema),
|
|
164
|
-
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
165
|
-
M.fail("4XX"),
|
|
166
|
-
M.fail("5XX"),
|
|
167
|
-
)(response, req, { extraFields: responseFields });
|
|
168
|
-
if (!result.ok) {
|
|
169
|
-
return [result, { status: "complete", request: req, response }];
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return [result, { status: "complete", request: req, response }];
|
|
173
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { PaygenticCore } from "../core.js";
|
|
6
|
-
import { encodeJSON, encodeSimple } 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
|
-
* Refund
|
|
31
|
-
*
|
|
32
|
-
* @remarks
|
|
33
|
-
* Marks a usage event as refunded. This reverts the consumption recorded by the usage event and creates a corresponding refund billing event if the usage event was already billed.
|
|
34
|
-
*/
|
|
35
|
-
export function usageEventsRefund(
|
|
36
|
-
client: PaygenticCore,
|
|
37
|
-
request: operations.RefundUsageEventRequest,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
models.UsageEvent,
|
|
42
|
-
| errors.BadRequest
|
|
43
|
-
| errors.ErrorT
|
|
44
|
-
| PaygenticError
|
|
45
|
-
| ResponseValidationError
|
|
46
|
-
| ConnectionError
|
|
47
|
-
| RequestAbortedError
|
|
48
|
-
| RequestTimeoutError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| UnexpectedClientError
|
|
51
|
-
| SDKValidationError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
return new APIPromise($do(
|
|
55
|
-
client,
|
|
56
|
-
request,
|
|
57
|
-
options,
|
|
58
|
-
));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
async function $do(
|
|
62
|
-
client: PaygenticCore,
|
|
63
|
-
request: operations.RefundUsageEventRequest,
|
|
64
|
-
options?: RequestOptions,
|
|
65
|
-
): Promise<
|
|
66
|
-
[
|
|
67
|
-
Result<
|
|
68
|
-
models.UsageEvent,
|
|
69
|
-
| errors.BadRequest
|
|
70
|
-
| errors.ErrorT
|
|
71
|
-
| PaygenticError
|
|
72
|
-
| ResponseValidationError
|
|
73
|
-
| ConnectionError
|
|
74
|
-
| RequestAbortedError
|
|
75
|
-
| RequestTimeoutError
|
|
76
|
-
| InvalidRequestError
|
|
77
|
-
| UnexpectedClientError
|
|
78
|
-
| SDKValidationError
|
|
79
|
-
>,
|
|
80
|
-
APICall,
|
|
81
|
-
]
|
|
82
|
-
> {
|
|
83
|
-
const parsed = safeParse(
|
|
84
|
-
request,
|
|
85
|
-
(value) => operations.RefundUsageEventRequest$outboundSchema.parse(value),
|
|
86
|
-
"Input validation failed",
|
|
87
|
-
);
|
|
88
|
-
if (!parsed.ok) {
|
|
89
|
-
return [parsed, { status: "invalid" }];
|
|
90
|
-
}
|
|
91
|
-
const payload = parsed.value;
|
|
92
|
-
const body = encodeJSON("body", payload.RequestBody, { explode: true });
|
|
93
|
-
|
|
94
|
-
const pathParams = {
|
|
95
|
-
id: encodeSimple("id", payload.id, {
|
|
96
|
-
explode: false,
|
|
97
|
-
charEncoding: "percent",
|
|
98
|
-
}),
|
|
99
|
-
};
|
|
100
|
-
const path = pathToFunc("/v0/usage/{id}")(pathParams);
|
|
101
|
-
|
|
102
|
-
const headers = new Headers(compactMap({
|
|
103
|
-
"Content-Type": "application/json",
|
|
104
|
-
Accept: "application/json",
|
|
105
|
-
}));
|
|
106
|
-
|
|
107
|
-
const secConfig = await extractSecurity(client._options.bearerAuth);
|
|
108
|
-
const securityInput = secConfig == null ? {} : { bearerAuth: secConfig };
|
|
109
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
110
|
-
|
|
111
|
-
const context = {
|
|
112
|
-
options: client._options,
|
|
113
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "refundUsageEvent",
|
|
115
|
-
oAuth2Scopes: null,
|
|
116
|
-
|
|
117
|
-
resolvedSecurity: requestSecurity,
|
|
118
|
-
|
|
119
|
-
securitySource: client._options.bearerAuth,
|
|
120
|
-
retryConfig: options?.retries
|
|
121
|
-
|| client._options.retryConfig
|
|
122
|
-
|| { strategy: "none" },
|
|
123
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
const requestRes = client._createRequest(context, {
|
|
127
|
-
security: requestSecurity,
|
|
128
|
-
method: "PATCH",
|
|
129
|
-
baseURL: options?.serverURL,
|
|
130
|
-
path: path,
|
|
131
|
-
headers: headers,
|
|
132
|
-
body: body,
|
|
133
|
-
userAgent: client._options.userAgent,
|
|
134
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
|
-
}, options);
|
|
136
|
-
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status: "invalid" }];
|
|
138
|
-
}
|
|
139
|
-
const req = requestRes.value;
|
|
140
|
-
|
|
141
|
-
const doResult = await client._do(req, {
|
|
142
|
-
context,
|
|
143
|
-
errorCodes: ["400", "403", "404", "422", "4XX", "500", "5XX"],
|
|
144
|
-
retryConfig: context.retryConfig,
|
|
145
|
-
retryCodes: context.retryCodes,
|
|
146
|
-
});
|
|
147
|
-
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status: "request-error", request: req }];
|
|
149
|
-
}
|
|
150
|
-
const response = doResult.value;
|
|
151
|
-
|
|
152
|
-
const responseFields = {
|
|
153
|
-
HttpMeta: { Response: response, Request: req },
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const [result] = await M.match<
|
|
157
|
-
models.UsageEvent,
|
|
158
|
-
| errors.BadRequest
|
|
159
|
-
| errors.ErrorT
|
|
160
|
-
| PaygenticError
|
|
161
|
-
| ResponseValidationError
|
|
162
|
-
| ConnectionError
|
|
163
|
-
| RequestAbortedError
|
|
164
|
-
| RequestTimeoutError
|
|
165
|
-
| InvalidRequestError
|
|
166
|
-
| UnexpectedClientError
|
|
167
|
-
| SDKValidationError
|
|
168
|
-
>(
|
|
169
|
-
M.json(200, models.UsageEvent$inboundSchema),
|
|
170
|
-
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
171
|
-
M.jsonErr([403, 404, 422], errors.ErrorT$inboundSchema),
|
|
172
|
-
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
173
|
-
M.fail("4XX"),
|
|
174
|
-
M.fail("5XX"),
|
|
175
|
-
)(response, req, { extraFields: responseFields });
|
|
176
|
-
if (!result.ok) {
|
|
177
|
-
return [result, { status: "complete", request: req, response }];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
return [result, { status: "complete", request: req, response }];
|
|
181
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
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 { ClosedEnum } from "../types/enums.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
export const ActiveEntitlementObject = {
|
|
12
|
-
Entitlement: "entitlement",
|
|
13
|
-
} as const;
|
|
14
|
-
export type ActiveEntitlementObject = ClosedEnum<
|
|
15
|
-
typeof ActiveEntitlementObject
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
export type ActiveEntitlement = {
|
|
19
|
-
/**
|
|
20
|
-
* Unique identifier for an entitlement
|
|
21
|
-
*/
|
|
22
|
-
id?: string | undefined;
|
|
23
|
-
object: ActiveEntitlementObject;
|
|
24
|
-
/**
|
|
25
|
-
* List of billable metrics that this entitlement covers.
|
|
26
|
-
*/
|
|
27
|
-
billableMetrics?: Array<string> | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* Unique identifier for a customer
|
|
30
|
-
*/
|
|
31
|
-
customerId?: string | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Unique identifier for a plan
|
|
34
|
-
*/
|
|
35
|
-
planId?: string | undefined;
|
|
36
|
-
/**
|
|
37
|
-
* Unique identifier for a product
|
|
38
|
-
*/
|
|
39
|
-
productId?: string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Unique identifier for a subscription
|
|
42
|
-
*/
|
|
43
|
-
subscriptionId?: string | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Timestamp when the entitlement was checked.
|
|
46
|
-
*/
|
|
47
|
-
verifiedAt?: Date | undefined;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/** @internal */
|
|
51
|
-
export const ActiveEntitlementObject$inboundSchema: z.ZodNativeEnum<
|
|
52
|
-
typeof ActiveEntitlementObject
|
|
53
|
-
> = z.nativeEnum(ActiveEntitlementObject);
|
|
54
|
-
|
|
55
|
-
/** @internal */
|
|
56
|
-
export const ActiveEntitlement$inboundSchema: z.ZodType<
|
|
57
|
-
ActiveEntitlement,
|
|
58
|
-
z.ZodTypeDef,
|
|
59
|
-
unknown
|
|
60
|
-
> = z.object({
|
|
61
|
-
id: z.string().optional(),
|
|
62
|
-
object: ActiveEntitlementObject$inboundSchema.default("entitlement"),
|
|
63
|
-
billableMetrics: z.array(z.string()).optional(),
|
|
64
|
-
customerId: z.string().optional(),
|
|
65
|
-
planId: z.string().optional(),
|
|
66
|
-
productId: z.string().optional(),
|
|
67
|
-
subscriptionId: z.string().optional(),
|
|
68
|
-
verifiedAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
69
|
-
.optional(),
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
export function activeEntitlementFromJSON(
|
|
73
|
-
jsonString: string,
|
|
74
|
-
): SafeParseResult<ActiveEntitlement, SDKValidationError> {
|
|
75
|
-
return safeParse(
|
|
76
|
-
jsonString,
|
|
77
|
-
(x) => ActiveEntitlement$inboundSchema.parse(JSON.parse(x)),
|
|
78
|
-
`Failed to parse 'ActiveEntitlement' from JSON`,
|
|
79
|
-
);
|
|
80
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
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 { ClosedEnum } from "../types/enums.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
|
-
import { UsageEvent, UsageEvent$inboundSchema } from "./usageevent.js";
|
|
11
|
-
|
|
12
|
-
export const BatchUsageEventResponseObject = {
|
|
13
|
-
BatchUsageEvents: "batchUsageEvents",
|
|
14
|
-
} as const;
|
|
15
|
-
export type BatchUsageEventResponseObject = ClosedEnum<
|
|
16
|
-
typeof BatchUsageEventResponseObject
|
|
17
|
-
>;
|
|
18
|
-
|
|
19
|
-
export type Failed = {
|
|
20
|
-
/**
|
|
21
|
-
* Error message describing why the event failed
|
|
22
|
-
*/
|
|
23
|
-
error: string;
|
|
24
|
-
/**
|
|
25
|
-
* Idempotency key of the failed event for identification
|
|
26
|
-
*/
|
|
27
|
-
idempotencyKey: string;
|
|
28
|
-
/**
|
|
29
|
-
* Index of the failed event in the original request array
|
|
30
|
-
*/
|
|
31
|
-
index: number;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Summary of batch processing results
|
|
36
|
-
*/
|
|
37
|
-
export type Summary = {
|
|
38
|
-
/**
|
|
39
|
-
* Number of events that failed to be created
|
|
40
|
-
*/
|
|
41
|
-
failed: number;
|
|
42
|
-
/**
|
|
43
|
-
* Number of successfully created events
|
|
44
|
-
*/
|
|
45
|
-
successful: number;
|
|
46
|
-
/**
|
|
47
|
-
* Total number of events in the batch
|
|
48
|
-
*/
|
|
49
|
-
total: number;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export type BatchUsageEventResponse = {
|
|
53
|
-
object: BatchUsageEventResponseObject;
|
|
54
|
-
/**
|
|
55
|
-
* Array of events that failed to be created with error details
|
|
56
|
-
*/
|
|
57
|
-
failed: Array<Failed>;
|
|
58
|
-
/**
|
|
59
|
-
* Array of successfully created usage events
|
|
60
|
-
*/
|
|
61
|
-
successful: Array<UsageEvent>;
|
|
62
|
-
/**
|
|
63
|
-
* Summary of batch processing results
|
|
64
|
-
*/
|
|
65
|
-
summary: Summary;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
/** @internal */
|
|
69
|
-
export const BatchUsageEventResponseObject$inboundSchema: z.ZodNativeEnum<
|
|
70
|
-
typeof BatchUsageEventResponseObject
|
|
71
|
-
> = z.nativeEnum(BatchUsageEventResponseObject);
|
|
72
|
-
|
|
73
|
-
/** @internal */
|
|
74
|
-
export const Failed$inboundSchema: z.ZodType<Failed, z.ZodTypeDef, unknown> = z
|
|
75
|
-
.object({
|
|
76
|
-
error: z.string(),
|
|
77
|
-
idempotencyKey: z.string(),
|
|
78
|
-
index: z.number().int(),
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
export function failedFromJSON(
|
|
82
|
-
jsonString: string,
|
|
83
|
-
): SafeParseResult<Failed, SDKValidationError> {
|
|
84
|
-
return safeParse(
|
|
85
|
-
jsonString,
|
|
86
|
-
(x) => Failed$inboundSchema.parse(JSON.parse(x)),
|
|
87
|
-
`Failed to parse 'Failed' from JSON`,
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** @internal */
|
|
92
|
-
export const Summary$inboundSchema: z.ZodType<Summary, z.ZodTypeDef, unknown> =
|
|
93
|
-
z.object({
|
|
94
|
-
failed: z.number().int(),
|
|
95
|
-
successful: z.number().int(),
|
|
96
|
-
total: z.number().int(),
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
export function summaryFromJSON(
|
|
100
|
-
jsonString: string,
|
|
101
|
-
): SafeParseResult<Summary, SDKValidationError> {
|
|
102
|
-
return safeParse(
|
|
103
|
-
jsonString,
|
|
104
|
-
(x) => Summary$inboundSchema.parse(JSON.parse(x)),
|
|
105
|
-
`Failed to parse 'Summary' from JSON`,
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/** @internal */
|
|
110
|
-
export const BatchUsageEventResponse$inboundSchema: z.ZodType<
|
|
111
|
-
BatchUsageEventResponse,
|
|
112
|
-
z.ZodTypeDef,
|
|
113
|
-
unknown
|
|
114
|
-
> = z.object({
|
|
115
|
-
object: BatchUsageEventResponseObject$inboundSchema,
|
|
116
|
-
failed: z.array(z.lazy(() => Failed$inboundSchema)),
|
|
117
|
-
successful: z.array(UsageEvent$inboundSchema),
|
|
118
|
-
summary: z.lazy(() => Summary$inboundSchema),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
export function batchUsageEventResponseFromJSON(
|
|
122
|
-
jsonString: string,
|
|
123
|
-
): SafeParseResult<BatchUsageEventResponse, SDKValidationError> {
|
|
124
|
-
return safeParse(
|
|
125
|
-
jsonString,
|
|
126
|
-
(x) => BatchUsageEventResponse$inboundSchema.parse(JSON.parse(x)),
|
|
127
|
-
`Failed to parse 'BatchUsageEventResponse' from JSON`,
|
|
128
|
-
);
|
|
129
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
|
|
7
|
-
export type CreateDisputeRequest = {
|
|
8
|
-
/**
|
|
9
|
-
* Customer explanation for challenging the consumption event. Sample values: 'Token count appears incorrect for this request', 'Storage charges don't match actual usage', 'API call was made during maintenance window', 'Inference request failed but still charged'
|
|
10
|
-
*/
|
|
11
|
-
message: string;
|
|
12
|
-
/**
|
|
13
|
-
* Usage event identifier being challenged. Sample values: 'usg_abc123xyz', 'usg_789def456'
|
|
14
|
-
*/
|
|
15
|
-
usageEventId: string;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/** @internal */
|
|
19
|
-
export type CreateDisputeRequest$Outbound = {
|
|
20
|
-
message: string;
|
|
21
|
-
usageEventId: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/** @internal */
|
|
25
|
-
export const CreateDisputeRequest$outboundSchema: z.ZodType<
|
|
26
|
-
CreateDisputeRequest$Outbound,
|
|
27
|
-
z.ZodTypeDef,
|
|
28
|
-
CreateDisputeRequest
|
|
29
|
-
> = z.object({
|
|
30
|
-
message: z.string(),
|
|
31
|
-
usageEventId: z.string(),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export function createDisputeRequestToJSON(
|
|
35
|
-
createDisputeRequest: CreateDisputeRequest,
|
|
36
|
-
): string {
|
|
37
|
-
return JSON.stringify(
|
|
38
|
-
CreateDisputeRequest$outboundSchema.parse(createDisputeRequest),
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod/v3";
|
|
6
|
-
|
|
7
|
-
export type EntitlementDatum = {
|
|
8
|
-
/**
|
|
9
|
-
* Unique identifier for a billable metric
|
|
10
|
-
*/
|
|
11
|
-
billableMetricId: string;
|
|
12
|
-
/**
|
|
13
|
-
* Optional per-unit price override in decimal dollars for variable-rate pricing. Sample values: '0.000025' sets $0.000025 per token, '0.12' sets $0.12 per GB
|
|
14
|
-
*/
|
|
15
|
-
price?: string | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Amount of metric units to pre-authorize. Sample values: 10000 tokens, 500 GB storage, 1000 API calls, 24 compute hours
|
|
18
|
-
*/
|
|
19
|
-
quantity: number;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type CreateEntitlementRequest = {
|
|
23
|
-
/**
|
|
24
|
-
* Unique identifier for a customer
|
|
25
|
-
*/
|
|
26
|
-
customerId: string;
|
|
27
|
-
/**
|
|
28
|
-
* Array of consumption metrics with quantities to pre-authorize payment for.
|
|
29
|
-
*/
|
|
30
|
-
entitlementData: Array<EntitlementDatum>;
|
|
31
|
-
/**
|
|
32
|
-
* Maximum consumption events allowed before expiration (optional). Defaults to 1 for global entitlements, 100 for regional entitlements.
|
|
33
|
-
*/
|
|
34
|
-
maxUses?: number | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* Unique identifier for a merchant/organization
|
|
37
|
-
*/
|
|
38
|
-
merchantId: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/** @internal */
|
|
42
|
-
export type EntitlementDatum$Outbound = {
|
|
43
|
-
billableMetricId: string;
|
|
44
|
-
price?: string | undefined;
|
|
45
|
-
quantity: number;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
/** @internal */
|
|
49
|
-
export const EntitlementDatum$outboundSchema: z.ZodType<
|
|
50
|
-
EntitlementDatum$Outbound,
|
|
51
|
-
z.ZodTypeDef,
|
|
52
|
-
EntitlementDatum
|
|
53
|
-
> = z.object({
|
|
54
|
-
billableMetricId: z.string(),
|
|
55
|
-
price: z.string().optional(),
|
|
56
|
-
quantity: z.number(),
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export function entitlementDatumToJSON(
|
|
60
|
-
entitlementDatum: EntitlementDatum,
|
|
61
|
-
): string {
|
|
62
|
-
return JSON.stringify(
|
|
63
|
-
EntitlementDatum$outboundSchema.parse(entitlementDatum),
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** @internal */
|
|
68
|
-
export type CreateEntitlementRequest$Outbound = {
|
|
69
|
-
customerId: string;
|
|
70
|
-
entitlementData: Array<EntitlementDatum$Outbound>;
|
|
71
|
-
maxUses?: number | undefined;
|
|
72
|
-
merchantId: string;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
/** @internal */
|
|
76
|
-
export const CreateEntitlementRequest$outboundSchema: z.ZodType<
|
|
77
|
-
CreateEntitlementRequest$Outbound,
|
|
78
|
-
z.ZodTypeDef,
|
|
79
|
-
CreateEntitlementRequest
|
|
80
|
-
> = z.object({
|
|
81
|
-
customerId: z.string(),
|
|
82
|
-
entitlementData: z.array(z.lazy(() => EntitlementDatum$outboundSchema)),
|
|
83
|
-
maxUses: z.number().int().optional(),
|
|
84
|
-
merchantId: z.string(),
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
export function createEntitlementRequestToJSON(
|
|
88
|
-
createEntitlementRequest: CreateEntitlementRequest,
|
|
89
|
-
): string {
|
|
90
|
-
return JSON.stringify(
|
|
91
|
-
CreateEntitlementRequest$outboundSchema.parse(createEntitlementRequest),
|
|
92
|
-
);
|
|
93
|
-
}
|