@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
|
@@ -21,20 +21,24 @@ import * as errors from "../models/errors/index.js";
|
|
|
21
21
|
import { PaygenticError } from "../models/errors/paygenticerror.js";
|
|
22
22
|
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
23
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as models from "../models/index.js";
|
|
24
25
|
import * as operations from "../models/operations/index.js";
|
|
25
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
26
27
|
import { Result } from "../types/fp.js";
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* Report
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Aggregate cost data across costs and customers with grouping, filtering, and time-series breakdown.
|
|
30
34
|
*/
|
|
31
|
-
export function
|
|
35
|
+
export function costsGetCostReport(
|
|
32
36
|
client: PaygenticCore,
|
|
33
|
-
request: operations.
|
|
37
|
+
request: operations.GetCostReportRequest,
|
|
34
38
|
options?: RequestOptions,
|
|
35
39
|
): APIPromise<
|
|
36
40
|
Result<
|
|
37
|
-
|
|
41
|
+
models.CostReportResponse,
|
|
38
42
|
| errors.BadRequest
|
|
39
43
|
| errors.ErrorT
|
|
40
44
|
| PaygenticError
|
|
@@ -56,12 +60,12 @@ export function usageEventsList(
|
|
|
56
60
|
|
|
57
61
|
async function $do(
|
|
58
62
|
client: PaygenticCore,
|
|
59
|
-
request: operations.
|
|
63
|
+
request: operations.GetCostReportRequest,
|
|
60
64
|
options?: RequestOptions,
|
|
61
65
|
): Promise<
|
|
62
66
|
[
|
|
63
67
|
Result<
|
|
64
|
-
|
|
68
|
+
models.CostReportResponse,
|
|
65
69
|
| errors.BadRequest
|
|
66
70
|
| errors.ErrorT
|
|
67
71
|
| PaygenticError
|
|
@@ -78,7 +82,7 @@ async function $do(
|
|
|
78
82
|
> {
|
|
79
83
|
const parsed = safeParse(
|
|
80
84
|
request,
|
|
81
|
-
(value) => operations.
|
|
85
|
+
(value) => operations.GetCostReportRequest$outboundSchema.parse(value),
|
|
82
86
|
"Input validation failed",
|
|
83
87
|
);
|
|
84
88
|
if (!parsed.ok) {
|
|
@@ -87,17 +91,24 @@ async function $do(
|
|
|
87
91
|
const payload = parsed.value;
|
|
88
92
|
const body = null;
|
|
89
93
|
|
|
90
|
-
const path = pathToFunc("/v0/
|
|
94
|
+
const path = pathToFunc("/v0/costs/report")();
|
|
91
95
|
|
|
92
96
|
const query = encodeFormQuery({
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
97
|
+
"comparePriorPeriod": payload.comparePriorPeriod,
|
|
98
|
+
"costId": payload.costId,
|
|
99
|
+
"currency": payload.currency,
|
|
100
|
+
"filterGroupBy": payload.filterGroupBy,
|
|
101
|
+
"from": payload.from,
|
|
102
|
+
"groupBy": payload.groupBy,
|
|
96
103
|
"limit": payload.limit,
|
|
97
104
|
"merchantId": payload.merchantId,
|
|
98
105
|
"offset": payload.offset,
|
|
99
|
-
"
|
|
100
|
-
"
|
|
106
|
+
"sort": payload.sort,
|
|
107
|
+
"sortDir": payload.sortDir,
|
|
108
|
+
"subject": payload.subject,
|
|
109
|
+
"to": payload.to,
|
|
110
|
+
"topN": payload.topN,
|
|
111
|
+
"windowSize": payload.windowSize,
|
|
101
112
|
});
|
|
102
113
|
|
|
103
114
|
const headers = new Headers(compactMap({
|
|
@@ -111,7 +122,7 @@ async function $do(
|
|
|
111
122
|
const context = {
|
|
112
123
|
options: client._options,
|
|
113
124
|
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
114
|
-
operationID: "
|
|
125
|
+
operationID: "getCostReport",
|
|
115
126
|
oAuth2Scopes: null,
|
|
116
127
|
|
|
117
128
|
resolvedSecurity: requestSecurity,
|
|
@@ -141,7 +152,7 @@ async function $do(
|
|
|
141
152
|
|
|
142
153
|
const doResult = await client._do(req, {
|
|
143
154
|
context,
|
|
144
|
-
errorCodes: ["400", "403", "4XX", "500", "5XX"],
|
|
155
|
+
errorCodes: ["400", "401", "403", "4XX", "500", "5XX"],
|
|
145
156
|
retryConfig: context.retryConfig,
|
|
146
157
|
retryCodes: context.retryCodes,
|
|
147
158
|
});
|
|
@@ -155,7 +166,7 @@ async function $do(
|
|
|
155
166
|
};
|
|
156
167
|
|
|
157
168
|
const [result] = await M.match<
|
|
158
|
-
|
|
169
|
+
models.CostReportResponse,
|
|
159
170
|
| errors.BadRequest
|
|
160
171
|
| errors.ErrorT
|
|
161
172
|
| PaygenticError
|
|
@@ -167,9 +178,9 @@ async function $do(
|
|
|
167
178
|
| UnexpectedClientError
|
|
168
179
|
| SDKValidationError
|
|
169
180
|
>(
|
|
170
|
-
M.json(200,
|
|
181
|
+
M.json(200, models.CostReportResponse$inboundSchema),
|
|
171
182
|
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
172
|
-
M.jsonErr(403, errors.ErrorT$inboundSchema),
|
|
183
|
+
M.jsonErr([401, 403], errors.ErrorT$inboundSchema),
|
|
173
184
|
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
|
174
185
|
M.fail("4XX"),
|
|
175
186
|
M.fail("5XX"),
|
|
@@ -37,7 +37,7 @@ export function entitlementsIssue(
|
|
|
37
37
|
options?: RequestOptions,
|
|
38
38
|
): APIPromise<
|
|
39
39
|
Result<
|
|
40
|
-
models.
|
|
40
|
+
models.Entitlement,
|
|
41
41
|
| errors.BadRequest
|
|
42
42
|
| errors.ErrorT
|
|
43
43
|
| PaygenticError
|
|
@@ -64,7 +64,7 @@ async function $do(
|
|
|
64
64
|
): Promise<
|
|
65
65
|
[
|
|
66
66
|
Result<
|
|
67
|
-
models.
|
|
67
|
+
models.Entitlement,
|
|
68
68
|
| errors.BadRequest
|
|
69
69
|
| errors.ErrorT
|
|
70
70
|
| PaygenticError
|
|
@@ -147,7 +147,7 @@ async function $do(
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
const [result] = await M.match<
|
|
150
|
-
models.
|
|
150
|
+
models.Entitlement,
|
|
151
151
|
| errors.BadRequest
|
|
152
152
|
| errors.ErrorT
|
|
153
153
|
| PaygenticError
|
|
@@ -159,7 +159,7 @@ async function $do(
|
|
|
159
159
|
| UnexpectedClientError
|
|
160
160
|
| SDKValidationError
|
|
161
161
|
>(
|
|
162
|
-
M.json(201, models.
|
|
162
|
+
M.json(201, models.Entitlement$inboundSchema),
|
|
163
163
|
M.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
164
164
|
M.jsonErr([403, 404, 409], errors.ErrorT$inboundSchema),
|
|
165
165
|
M.jsonErr(500, errors.ErrorT$inboundSchema),
|
package/src/funcs/revenueGet.ts
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -15,6 +15,10 @@ export const ServerList = [
|
|
|
15
15
|
* Production API
|
|
16
16
|
*/
|
|
17
17
|
"https://api.paygentic.io",
|
|
18
|
+
/**
|
|
19
|
+
* Sandbox API
|
|
20
|
+
*/
|
|
21
|
+
"https://api.sandbox.paygentic.io",
|
|
18
22
|
] as const;
|
|
19
23
|
|
|
20
24
|
export type SDKOptions = {
|
|
@@ -61,7 +65,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
61
65
|
export const SDK_METADATA = {
|
|
62
66
|
language: "typescript",
|
|
63
67
|
openapiDocVersion: "0.1.0",
|
|
64
|
-
sdkVersion: "0.
|
|
68
|
+
sdkVersion: "0.7.1",
|
|
65
69
|
genVersion: "2.879.13",
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
70
|
+
userAgent: "speakeasy-sdk/typescript 0.7.1 2.879.13 0.1.0 @paygentic/sdk",
|
|
67
71
|
} as const;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Prior-period comparison data. Present only when comparePriorPeriod=true.
|
|
12
|
+
*/
|
|
13
|
+
export type PriorPeriod = {
|
|
14
|
+
cost: number;
|
|
15
|
+
/**
|
|
16
|
+
* Percentage change vs prior period. Null when prior period cost is 0.
|
|
17
|
+
*/
|
|
18
|
+
changePercent: number | null;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type CostReportGroup = {
|
|
22
|
+
/**
|
|
23
|
+
* Group identifier (cost ID, customer ID, or dimension value). '__other__' for the aggregated remainder bucket.
|
|
24
|
+
*/
|
|
25
|
+
key: string;
|
|
26
|
+
/**
|
|
27
|
+
* Human-readable display name for the group.
|
|
28
|
+
*/
|
|
29
|
+
label: string;
|
|
30
|
+
totalCost: number;
|
|
31
|
+
totalQuantity: number;
|
|
32
|
+
/**
|
|
33
|
+
* Unit label for the quantity (e.g. 'token', 'request').
|
|
34
|
+
*/
|
|
35
|
+
unit?: string | null | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* This group's share of total cost, 0–100.
|
|
38
|
+
*/
|
|
39
|
+
percentOfTotal: number;
|
|
40
|
+
/**
|
|
41
|
+
* Prior-period comparison data. Present only when comparePriorPeriod=true.
|
|
42
|
+
*/
|
|
43
|
+
priorPeriod?: PriorPeriod | null | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* True for the aggregated 'Other' bucket.
|
|
46
|
+
*/
|
|
47
|
+
isOther: boolean;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/** @internal */
|
|
51
|
+
export const PriorPeriod$inboundSchema: z.ZodType<
|
|
52
|
+
PriorPeriod,
|
|
53
|
+
z.ZodTypeDef,
|
|
54
|
+
unknown
|
|
55
|
+
> = z.object({
|
|
56
|
+
cost: z.number(),
|
|
57
|
+
changePercent: z.nullable(z.number()),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export function priorPeriodFromJSON(
|
|
61
|
+
jsonString: string,
|
|
62
|
+
): SafeParseResult<PriorPeriod, SDKValidationError> {
|
|
63
|
+
return safeParse(
|
|
64
|
+
jsonString,
|
|
65
|
+
(x) => PriorPeriod$inboundSchema.parse(JSON.parse(x)),
|
|
66
|
+
`Failed to parse 'PriorPeriod' from JSON`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const CostReportGroup$inboundSchema: z.ZodType<
|
|
72
|
+
CostReportGroup,
|
|
73
|
+
z.ZodTypeDef,
|
|
74
|
+
unknown
|
|
75
|
+
> = z.object({
|
|
76
|
+
key: z.string(),
|
|
77
|
+
label: z.string(),
|
|
78
|
+
totalCost: z.number(),
|
|
79
|
+
totalQuantity: z.number(),
|
|
80
|
+
unit: z.nullable(z.string()).optional(),
|
|
81
|
+
percentOfTotal: z.number(),
|
|
82
|
+
priorPeriod: z.nullable(z.lazy(() => PriorPeriod$inboundSchema)).optional(),
|
|
83
|
+
isOther: z.boolean(),
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
export function costReportGroupFromJSON(
|
|
87
|
+
jsonString: string,
|
|
88
|
+
): SafeParseResult<CostReportGroup, SDKValidationError> {
|
|
89
|
+
return safeParse(
|
|
90
|
+
jsonString,
|
|
91
|
+
(x) => CostReportGroup$inboundSchema.parse(JSON.parse(x)),
|
|
92
|
+
`Failed to parse 'CostReportGroup' from JSON`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,145 @@
|
|
|
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 {
|
|
10
|
+
CostReportGroup,
|
|
11
|
+
CostReportGroup$inboundSchema,
|
|
12
|
+
} from "./costreportgroup.js";
|
|
13
|
+
import {
|
|
14
|
+
CostReportTimeSeries,
|
|
15
|
+
CostReportTimeSeries$inboundSchema,
|
|
16
|
+
} from "./costreporttimeseries.js";
|
|
17
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
18
|
+
|
|
19
|
+
export const CostReportResponseObject = {
|
|
20
|
+
CostReport: "cost_report",
|
|
21
|
+
} as const;
|
|
22
|
+
export type CostReportResponseObject = ClosedEnum<
|
|
23
|
+
typeof CostReportResponseObject
|
|
24
|
+
>;
|
|
25
|
+
|
|
26
|
+
export type Period = {
|
|
27
|
+
from: Date;
|
|
28
|
+
to: Date;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type Pagination = {
|
|
32
|
+
total: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
offset: number;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type CostReportResponse = {
|
|
38
|
+
object: CostReportResponseObject;
|
|
39
|
+
/**
|
|
40
|
+
* ISO 4217 currency code for all monetary values in this response.
|
|
41
|
+
*/
|
|
42
|
+
currency: string;
|
|
43
|
+
period: Period;
|
|
44
|
+
/**
|
|
45
|
+
* The active grouping dimension (e.g. 'cost', 'customer', or a dynamic dimension key).
|
|
46
|
+
*/
|
|
47
|
+
groupBy: string;
|
|
48
|
+
/**
|
|
49
|
+
* Sum of cost across all groups (not just top N).
|
|
50
|
+
*/
|
|
51
|
+
totalCost: number;
|
|
52
|
+
/**
|
|
53
|
+
* Sum of quantity across all groups.
|
|
54
|
+
*/
|
|
55
|
+
totalQuantity: number;
|
|
56
|
+
/**
|
|
57
|
+
* Top N groups plus an 'Other' bucket aggregating the remainder.
|
|
58
|
+
*/
|
|
59
|
+
groups: Array<CostReportGroup>;
|
|
60
|
+
/**
|
|
61
|
+
* Time-bucketed breakdown per group. Keys in each window's 'groups' object correspond to CostReportGroup.key. The 'Other' bucket key is '__other__'.
|
|
62
|
+
*/
|
|
63
|
+
timeSeries: Array<CostReportTimeSeries>;
|
|
64
|
+
/**
|
|
65
|
+
* Dimension keys available for further drill-down (populated when a single cost is filtered).
|
|
66
|
+
*/
|
|
67
|
+
availableDimensions: Array<string>;
|
|
68
|
+
/**
|
|
69
|
+
* Non-fatal warnings, e.g. costs that could not be queried.
|
|
70
|
+
*/
|
|
71
|
+
warnings?: Array<string> | undefined;
|
|
72
|
+
pagination: Pagination;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** @internal */
|
|
76
|
+
export const CostReportResponseObject$inboundSchema: z.ZodNativeEnum<
|
|
77
|
+
typeof CostReportResponseObject
|
|
78
|
+
> = z.nativeEnum(CostReportResponseObject);
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const Period$inboundSchema: z.ZodType<Period, z.ZodTypeDef, unknown> = z
|
|
82
|
+
.object({
|
|
83
|
+
from: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
84
|
+
to: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
export function periodFromJSON(
|
|
88
|
+
jsonString: string,
|
|
89
|
+
): SafeParseResult<Period, SDKValidationError> {
|
|
90
|
+
return safeParse(
|
|
91
|
+
jsonString,
|
|
92
|
+
(x) => Period$inboundSchema.parse(JSON.parse(x)),
|
|
93
|
+
`Failed to parse 'Period' from JSON`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** @internal */
|
|
98
|
+
export const Pagination$inboundSchema: z.ZodType<
|
|
99
|
+
Pagination,
|
|
100
|
+
z.ZodTypeDef,
|
|
101
|
+
unknown
|
|
102
|
+
> = z.object({
|
|
103
|
+
total: z.number().int(),
|
|
104
|
+
limit: z.number().int(),
|
|
105
|
+
offset: z.number().int(),
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export function paginationFromJSON(
|
|
109
|
+
jsonString: string,
|
|
110
|
+
): SafeParseResult<Pagination, SDKValidationError> {
|
|
111
|
+
return safeParse(
|
|
112
|
+
jsonString,
|
|
113
|
+
(x) => Pagination$inboundSchema.parse(JSON.parse(x)),
|
|
114
|
+
`Failed to parse 'Pagination' from JSON`,
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export const CostReportResponse$inboundSchema: z.ZodType<
|
|
120
|
+
CostReportResponse,
|
|
121
|
+
z.ZodTypeDef,
|
|
122
|
+
unknown
|
|
123
|
+
> = z.object({
|
|
124
|
+
object: CostReportResponseObject$inboundSchema.default("cost_report"),
|
|
125
|
+
currency: z.string(),
|
|
126
|
+
period: z.lazy(() => Period$inboundSchema),
|
|
127
|
+
groupBy: z.string(),
|
|
128
|
+
totalCost: z.number(),
|
|
129
|
+
totalQuantity: z.number(),
|
|
130
|
+
groups: z.array(CostReportGroup$inboundSchema),
|
|
131
|
+
timeSeries: z.array(CostReportTimeSeries$inboundSchema),
|
|
132
|
+
availableDimensions: z.array(z.string()),
|
|
133
|
+
warnings: z.array(z.string()).optional(),
|
|
134
|
+
pagination: z.lazy(() => Pagination$inboundSchema),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
export function costReportResponseFromJSON(
|
|
138
|
+
jsonString: string,
|
|
139
|
+
): SafeParseResult<CostReportResponse, SDKValidationError> {
|
|
140
|
+
return safeParse(
|
|
141
|
+
jsonString,
|
|
142
|
+
(x) => CostReportResponse$inboundSchema.parse(JSON.parse(x)),
|
|
143
|
+
`Failed to parse 'CostReportResponse' from JSON`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type CostReportTimeSeries = {
|
|
11
|
+
windowStart: Date;
|
|
12
|
+
windowEnd: Date;
|
|
13
|
+
/**
|
|
14
|
+
* Map of group key → cost value for this time window. Keys match CostReportGroup.key.
|
|
15
|
+
*/
|
|
16
|
+
groups: { [k: string]: number };
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const CostReportTimeSeries$inboundSchema: z.ZodType<
|
|
21
|
+
CostReportTimeSeries,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z.object({
|
|
25
|
+
windowStart: z.string().datetime({ offset: true }).transform(v =>
|
|
26
|
+
new Date(v)
|
|
27
|
+
),
|
|
28
|
+
windowEnd: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
29
|
+
groups: z.record(z.number()),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function costReportTimeSeriesFromJSON(
|
|
33
|
+
jsonString: string,
|
|
34
|
+
): SafeParseResult<CostReportTimeSeries, SDKValidationError> {
|
|
35
|
+
return safeParse(
|
|
36
|
+
jsonString,
|
|
37
|
+
(x) => CostReportTimeSeries$inboundSchema.parse(JSON.parse(x)),
|
|
38
|
+
`Failed to parse 'CostReportTimeSeries' from JSON`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
InvoiceSummary,
|
|
11
|
+
InvoiceSummary$inboundSchema,
|
|
12
|
+
} from "./invoicesummary.js";
|
|
13
|
+
import {
|
|
14
|
+
PaymentSummary,
|
|
15
|
+
PaymentSummary$inboundSchema,
|
|
16
|
+
} from "./paymentsummary.js";
|
|
17
|
+
import {
|
|
18
|
+
RevenueTrendBucket,
|
|
19
|
+
RevenueTrendBucket$inboundSchema,
|
|
20
|
+
} from "./revenuetrendbucket.js";
|
|
21
|
+
|
|
22
|
+
export type CurrencyBreakdownEntry = {
|
|
23
|
+
/**
|
|
24
|
+
* ISO 4217 currency code (uppercase, e.g. USD, EUR, GBP)
|
|
25
|
+
*/
|
|
26
|
+
currency: string;
|
|
27
|
+
/**
|
|
28
|
+
* Net collected revenue in dollars for this currency (issued invoices + completed payments)
|
|
29
|
+
*/
|
|
30
|
+
netRevenue: string;
|
|
31
|
+
invoices: InvoiceSummary;
|
|
32
|
+
payments: PaymentSummary;
|
|
33
|
+
/**
|
|
34
|
+
* Time-bucketed revenue trend data for this currency
|
|
35
|
+
*/
|
|
36
|
+
trend: Array<RevenueTrendBucket>;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** @internal */
|
|
40
|
+
export const CurrencyBreakdownEntry$inboundSchema: z.ZodType<
|
|
41
|
+
CurrencyBreakdownEntry,
|
|
42
|
+
z.ZodTypeDef,
|
|
43
|
+
unknown
|
|
44
|
+
> = z.object({
|
|
45
|
+
currency: z.string(),
|
|
46
|
+
netRevenue: z.string(),
|
|
47
|
+
invoices: InvoiceSummary$inboundSchema,
|
|
48
|
+
payments: PaymentSummary$inboundSchema,
|
|
49
|
+
trend: z.array(RevenueTrendBucket$inboundSchema),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export function currencyBreakdownEntryFromJSON(
|
|
53
|
+
jsonString: string,
|
|
54
|
+
): SafeParseResult<CurrencyBreakdownEntry, SDKValidationError> {
|
|
55
|
+
return safeParse(
|
|
56
|
+
jsonString,
|
|
57
|
+
(x) => CurrencyBreakdownEntry$inboundSchema.parse(JSON.parse(x)),
|
|
58
|
+
`Failed to parse 'CurrencyBreakdownEntry' from JSON`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
@@ -13,63 +13,57 @@ export const EntitlementObject = {
|
|
|
13
13
|
} as const;
|
|
14
14
|
export type EntitlementObject = ClosedEnum<typeof EntitlementObject>;
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
quantity?: number | undefined;
|
|
29
|
-
};
|
|
16
|
+
/**
|
|
17
|
+
* Current status of the entitlement.
|
|
18
|
+
*/
|
|
19
|
+
export const EntitlementStatus = {
|
|
20
|
+
Active: "active",
|
|
21
|
+
Canceled: "canceled",
|
|
22
|
+
Expired: "expired",
|
|
23
|
+
} as const;
|
|
24
|
+
/**
|
|
25
|
+
* Current status of the entitlement.
|
|
26
|
+
*/
|
|
27
|
+
export type EntitlementStatus = ClosedEnum<typeof EntitlementStatus>;
|
|
30
28
|
|
|
31
29
|
export type Entitlement = {
|
|
32
|
-
/**
|
|
33
|
-
* Unique identifier for an entitlement
|
|
34
|
-
*/
|
|
35
|
-
id?: string | undefined;
|
|
36
30
|
object: EntitlementObject;
|
|
37
31
|
/**
|
|
38
|
-
*
|
|
32
|
+
* Unique identifier for the entitlement.
|
|
39
33
|
*/
|
|
40
|
-
|
|
34
|
+
id: string;
|
|
41
35
|
/**
|
|
42
|
-
*
|
|
36
|
+
* Unique identifier for a customer
|
|
43
37
|
*/
|
|
44
|
-
|
|
38
|
+
customerId: string;
|
|
45
39
|
/**
|
|
46
|
-
*
|
|
40
|
+
* The feature this entitlement grants access to.
|
|
47
41
|
*/
|
|
48
|
-
|
|
42
|
+
featureId: string;
|
|
49
43
|
/**
|
|
50
|
-
*
|
|
44
|
+
* The subscription this entitlement is associated with, if any.
|
|
51
45
|
*/
|
|
52
|
-
|
|
46
|
+
subscriptionId?: string | null | undefined;
|
|
53
47
|
/**
|
|
54
|
-
*
|
|
48
|
+
* Current status of the entitlement.
|
|
55
49
|
*/
|
|
56
|
-
|
|
50
|
+
status: EntitlementStatus;
|
|
57
51
|
/**
|
|
58
|
-
*
|
|
52
|
+
* When the entitlement becomes active.
|
|
59
53
|
*/
|
|
60
|
-
|
|
54
|
+
activeFrom: Date;
|
|
61
55
|
/**
|
|
62
|
-
*
|
|
56
|
+
* When the entitlement expires. Null means no expiration.
|
|
63
57
|
*/
|
|
64
|
-
|
|
58
|
+
activeTo?: Date | null | undefined;
|
|
65
59
|
/**
|
|
66
|
-
*
|
|
60
|
+
* Configuration values for static features.
|
|
67
61
|
*/
|
|
68
|
-
|
|
62
|
+
config: { [k: string]: any } | null;
|
|
69
63
|
/**
|
|
70
|
-
*
|
|
64
|
+
* Additional metadata for the entitlement.
|
|
71
65
|
*/
|
|
72
|
-
|
|
66
|
+
metadata?: { [k: string]: string } | undefined;
|
|
73
67
|
};
|
|
74
68
|
|
|
75
69
|
/** @internal */
|
|
@@ -78,25 +72,9 @@ export const EntitlementObject$inboundSchema: z.ZodNativeEnum<
|
|
|
78
72
|
> = z.nativeEnum(EntitlementObject);
|
|
79
73
|
|
|
80
74
|
/** @internal */
|
|
81
|
-
export const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
unknown
|
|
85
|
-
> = z.object({
|
|
86
|
-
billableMetricId: z.string().optional(),
|
|
87
|
-
price: z.string().optional(),
|
|
88
|
-
quantity: z.number().optional(),
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
export function entitlementBillableMetricFromJSON(
|
|
92
|
-
jsonString: string,
|
|
93
|
-
): SafeParseResult<EntitlementBillableMetric, SDKValidationError> {
|
|
94
|
-
return safeParse(
|
|
95
|
-
jsonString,
|
|
96
|
-
(x) => EntitlementBillableMetric$inboundSchema.parse(JSON.parse(x)),
|
|
97
|
-
`Failed to parse 'EntitlementBillableMetric' from JSON`,
|
|
98
|
-
);
|
|
99
|
-
}
|
|
75
|
+
export const EntitlementStatus$inboundSchema: z.ZodNativeEnum<
|
|
76
|
+
typeof EntitlementStatus
|
|
77
|
+
> = z.nativeEnum(EntitlementStatus);
|
|
100
78
|
|
|
101
79
|
/** @internal */
|
|
102
80
|
export const Entitlement$inboundSchema: z.ZodType<
|
|
@@ -104,21 +82,18 @@ export const Entitlement$inboundSchema: z.ZodType<
|
|
|
104
82
|
z.ZodTypeDef,
|
|
105
83
|
unknown
|
|
106
84
|
> = z.object({
|
|
107
|
-
id: z.string().optional(),
|
|
108
85
|
object: EntitlementObject$inboundSchema.default("entitlement"),
|
|
109
|
-
|
|
110
|
-
|
|
86
|
+
id: z.string(),
|
|
87
|
+
customerId: z.string(),
|
|
88
|
+
featureId: z.string(),
|
|
89
|
+
subscriptionId: z.nullable(z.string()).optional(),
|
|
90
|
+
status: EntitlementStatus$inboundSchema,
|
|
91
|
+
activeFrom: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
92
|
+
activeTo: z.nullable(
|
|
93
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
111
94
|
).optional(),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
customerId: z.string().optional(),
|
|
115
|
-
expiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
116
|
-
.optional(),
|
|
117
|
-
maxUses: z.number().int().optional(),
|
|
118
|
-
merchantId: z.string().optional(),
|
|
119
|
-
region: z.string().optional(),
|
|
120
|
-
remainingBalance: z.string().optional(),
|
|
121
|
-
usedCount: z.number().int().optional(),
|
|
95
|
+
config: z.nullable(z.record(z.any())),
|
|
96
|
+
metadata: z.record(z.string()).optional(),
|
|
122
97
|
});
|
|
123
98
|
|
|
124
99
|
export function entitlementFromJSON(
|