orb-billing 1.0.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/LICENSE.md +21 -0
- package/README.md +169 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -0
- package/dist/internal/utils/contenttype.d.ts +1 -0
- package/dist/internal/utils/contenttype.js +33 -0
- package/dist/internal/utils/headers.d.ts +4 -0
- package/dist/internal/utils/headers.js +92 -0
- package/dist/internal/utils/index.d.ts +8 -0
- package/dist/internal/utils/index.js +27 -0
- package/dist/internal/utils/pathparams.d.ts +2 -0
- package/dist/internal/utils/pathparams.js +53 -0
- package/dist/internal/utils/queryparams.d.ts +2 -0
- package/dist/internal/utils/queryparams.js +178 -0
- package/dist/internal/utils/requestbody.d.ts +2 -0
- package/dist/internal/utils/requestbody.js +318 -0
- package/dist/internal/utils/retries.d.ts +20 -0
- package/dist/internal/utils/retries.js +250 -0
- package/dist/internal/utils/security.d.ts +2 -0
- package/dist/internal/utils/security.js +188 -0
- package/dist/internal/utils/utils.d.ts +37 -0
- package/dist/internal/utils/utils.js +370 -0
- package/dist/sdk/availability.d.ts +19 -0
- package/dist/sdk/availability.js +135 -0
- package/dist/sdk/coupon.d.ts +53 -0
- package/dist/sdk/coupon.js +358 -0
- package/dist/sdk/credit.d.ts +142 -0
- package/dist/sdk/credit.js +501 -0
- package/dist/sdk/creditnote.d.ts +26 -0
- package/dist/sdk/creditnote.js +186 -0
- package/dist/sdk/customer.d.ts +264 -0
- package/dist/sdk/customer.js +958 -0
- package/dist/sdk/event.d.ts +258 -0
- package/dist/sdk/event.js +732 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +20 -0
- package/dist/sdk/invoice.d.ts +60 -0
- package/dist/sdk/invoice.js +416 -0
- package/dist/sdk/models/operations/addledgerentryexternalid.d.ts +16 -0
- package/dist/sdk/models/operations/addledgerentryexternalid.js +95 -0
- package/dist/sdk/models/operations/amendevent.d.ts +23 -0
- package/dist/sdk/models/operations/amendevent.js +99 -0
- package/dist/sdk/models/operations/amendusage.d.ts +34 -0
- package/dist/sdk/models/operations/amendusage.js +122 -0
- package/dist/sdk/models/operations/amendusageexternalcustomerid.d.ts +34 -0
- package/dist/sdk/models/operations/amendusageexternalcustomerid.js +122 -0
- package/dist/sdk/models/operations/archivecoupon.d.ts +15 -0
- package/dist/sdk/models/operations/archivecoupon.js +91 -0
- package/dist/sdk/models/operations/cancelsubscription.d.ts +16 -0
- package/dist/sdk/models/operations/cancelsubscription.js +95 -0
- package/dist/sdk/models/operations/closebackfill.d.ts +15 -0
- package/dist/sdk/models/operations/closebackfill.js +91 -0
- package/dist/sdk/models/operations/createbackfill.d.ts +12 -0
- package/dist/sdk/models/operations/createbackfill.js +79 -0
- package/dist/sdk/models/operations/createcoupon.d.ts +12 -0
- package/dist/sdk/models/operations/createcoupon.js +79 -0
- package/dist/sdk/models/operations/createcustomer.d.ts +12 -0
- package/dist/sdk/models/operations/createcustomer.js +79 -0
- package/dist/sdk/models/operations/createcustomerbalancetransaction.d.ts +16 -0
- package/dist/sdk/models/operations/createcustomerbalancetransaction.js +95 -0
- package/dist/sdk/models/operations/createinvoicelineitem.d.ts +12 -0
- package/dist/sdk/models/operations/createinvoicelineitem.js +79 -0
- package/dist/sdk/models/operations/createledgerentry.d.ts +16 -0
- package/dist/sdk/models/operations/createledgerentry.js +95 -0
- package/dist/sdk/models/operations/createsubscription.d.ts +12 -0
- package/dist/sdk/models/operations/createsubscription.js +79 -0
- package/dist/sdk/models/operations/deletecustomer.d.ts +22 -0
- package/dist/sdk/models/operations/deletecustomer.js +78 -0
- package/dist/sdk/models/operations/deprecateevent.d.ts +22 -0
- package/dist/sdk/models/operations/deprecateevent.js +95 -0
- package/dist/sdk/models/operations/fetchcoupon.d.ts +15 -0
- package/dist/sdk/models/operations/fetchcoupon.js +91 -0
- package/dist/sdk/models/operations/fetchcreditnote.d.ts +18 -0
- package/dist/sdk/models/operations/fetchcreditnote.js +91 -0
- package/dist/sdk/models/operations/fetchcustomer.d.ts +18 -0
- package/dist/sdk/models/operations/fetchcustomer.js +91 -0
- package/dist/sdk/models/operations/fetchcustomercosts.d.ts +34 -0
- package/dist/sdk/models/operations/fetchcustomercosts.js +107 -0
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.d.ts +31 -0
- package/dist/sdk/models/operations/fetchcustomercostsexternalid.js +107 -0
- package/dist/sdk/models/operations/fetchcustomercredits.d.ts +26 -0
- package/dist/sdk/models/operations/fetchcustomercredits.js +99 -0
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.d.ts +23 -0
- package/dist/sdk/models/operations/fetchcustomercreditsexternalid.js +99 -0
- package/dist/sdk/models/operations/fetchcustomercreditsledger.d.ts +35 -0
- package/dist/sdk/models/operations/fetchcustomercreditsledger.js +111 -0
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.d.ts +35 -0
- package/dist/sdk/models/operations/fetchcustomercreditsledgerexternalid.js +111 -0
- package/dist/sdk/models/operations/fetchcustomerexternalid.d.ts +15 -0
- package/dist/sdk/models/operations/fetchcustomerexternalid.js +91 -0
- package/dist/sdk/models/operations/fetchinvoice.d.ts +15 -0
- package/dist/sdk/models/operations/fetchinvoice.js +91 -0
- package/dist/sdk/models/operations/fetchplan.d.ts +15 -0
- package/dist/sdk/models/operations/fetchplan.js +91 -0
- package/dist/sdk/models/operations/fetchplanexternalid.d.ts +15 -0
- package/dist/sdk/models/operations/fetchplanexternalid.js +91 -0
- package/dist/sdk/models/operations/fetchsubscription.d.ts +15 -0
- package/dist/sdk/models/operations/fetchsubscription.js +91 -0
- package/dist/sdk/models/operations/fetchsubscriptioncosts.d.ts +31 -0
- package/dist/sdk/models/operations/fetchsubscriptioncosts.js +107 -0
- package/dist/sdk/models/operations/fetchsubscriptionschedule.d.ts +23 -0
- package/dist/sdk/models/operations/fetchsubscriptionschedule.js +99 -0
- package/dist/sdk/models/operations/fetchsubscriptionusage.d.ts +39 -0
- package/dist/sdk/models/operations/fetchsubscriptionusage.js +115 -0
- package/dist/sdk/models/operations/fetchupcominginvoice.d.ts +15 -0
- package/dist/sdk/models/operations/fetchupcominginvoice.js +91 -0
- package/dist/sdk/models/operations/index.d.ts +55 -0
- package/dist/sdk/models/operations/index.js +74 -0
- package/dist/sdk/models/operations/ingest.d.ts +30 -0
- package/dist/sdk/models/operations/ingest.js +118 -0
- package/dist/sdk/models/operations/issueinvoice.d.ts +19 -0
- package/dist/sdk/models/operations/issueinvoice.js +95 -0
- package/dist/sdk/models/operations/listbackfills.d.ts +22 -0
- package/dist/sdk/models/operations/listbackfills.js +95 -0
- package/dist/sdk/models/operations/listbalancetransactions.d.ts +23 -0
- package/dist/sdk/models/operations/listbalancetransactions.js +99 -0
- package/dist/sdk/models/operations/listcoupons.d.ts +30 -0
- package/dist/sdk/models/operations/listcoupons.js +103 -0
- package/dist/sdk/models/operations/listcouponsubscriptions.d.ts +15 -0
- package/dist/sdk/models/operations/listcouponsubscriptions.js +91 -0
- package/dist/sdk/models/operations/listcreditnote.d.ts +34 -0
- package/dist/sdk/models/operations/listcreditnote.js +107 -0
- package/dist/sdk/models/operations/listcustomers.d.ts +22 -0
- package/dist/sdk/models/operations/listcustomers.js +95 -0
- package/dist/sdk/models/operations/listinvoices.d.ts +38 -0
- package/dist/sdk/models/operations/listinvoices.js +111 -0
- package/dist/sdk/models/operations/listplans.d.ts +22 -0
- package/dist/sdk/models/operations/listplans.js +95 -0
- package/dist/sdk/models/operations/listsubscriptions.d.ts +24 -0
- package/dist/sdk/models/operations/listsubscriptions.js +103 -0
- package/dist/sdk/models/operations/ping.d.ts +12 -0
- package/dist/sdk/models/operations/ping.js +79 -0
- package/dist/sdk/models/operations/revertbackfill.d.ts +15 -0
- package/dist/sdk/models/operations/revertbackfill.js +91 -0
- package/dist/sdk/models/operations/scheduleplanchange.d.ts +16 -0
- package/dist/sdk/models/operations/scheduleplanchange.js +95 -0
- package/dist/sdk/models/operations/searchevents.d.ts +23 -0
- package/dist/sdk/models/operations/searchevents.js +99 -0
- package/dist/sdk/models/operations/unschedulecancellation.d.ts +15 -0
- package/dist/sdk/models/operations/unschedulecancellation.js +91 -0
- package/dist/sdk/models/operations/unscheduleplanchange.d.ts +15 -0
- package/dist/sdk/models/operations/unscheduleplanchange.js +91 -0
- package/dist/sdk/models/operations/updatecustomer.d.ts +19 -0
- package/dist/sdk/models/operations/updatecustomer.js +95 -0
- package/dist/sdk/models/operations/updatecustomerexternalid.d.ts +16 -0
- package/dist/sdk/models/operations/updatecustomerexternalid.js +95 -0
- package/dist/sdk/models/operations/updatefixedfeequantity.d.ts +16 -0
- package/dist/sdk/models/operations/updatefixedfeequantity.js +95 -0
- package/dist/sdk/models/operations/voidinvoice.d.ts +19 -0
- package/dist/sdk/models/operations/voidinvoice.js +95 -0
- package/dist/sdk/models/shared/action.d.ts +8 -0
- package/dist/sdk/models/shared/action.js +15 -0
- package/dist/sdk/models/shared/amendedevent.d.ts +28 -0
- package/dist/sdk/models/shared/amendedevent.js +81 -0
- package/dist/sdk/models/shared/amendedusage.d.ts +16 -0
- package/dist/sdk/models/shared/amendedusage.js +62 -0
- package/dist/sdk/models/shared/amendeventresult.d.ts +10 -0
- package/dist/sdk/models/shared/amendeventresult.js +48 -0
- package/dist/sdk/models/shared/autocollection.d.ts +18 -0
- package/dist/sdk/models/shared/autocollection.js +66 -0
- package/dist/sdk/models/shared/availability.d.ts +7 -0
- package/dist/sdk/models/shared/availability.js +48 -0
- package/dist/sdk/models/shared/backfill.d.ts +27 -0
- package/dist/sdk/models/shared/backfill.js +104 -0
- package/dist/sdk/models/shared/backfills.d.ts +10 -0
- package/dist/sdk/models/shared/backfills.js +57 -0
- package/dist/sdk/models/shared/backfillstatus.d.ts +9 -0
- package/dist/sdk/models/shared/backfillstatus.js +16 -0
- package/dist/sdk/models/shared/billablemetric.d.ts +4 -0
- package/dist/sdk/models/shared/billablemetric.js +45 -0
- package/dist/sdk/models/shared/billablemetricminified.d.ts +5 -0
- package/dist/sdk/models/shared/billablemetricminified.js +50 -0
- package/dist/sdk/models/shared/bpsconfig.d.ts +8 -0
- package/dist/sdk/models/shared/bpsconfig.js +53 -0
- package/dist/sdk/models/shared/bpspriceoverride.d.ts +24 -0
- package/dist/sdk/models/shared/bpspriceoverride.js +74 -0
- package/dist/sdk/models/shared/bpstier.d.ts +7 -0
- package/dist/sdk/models/shared/bpstier.js +60 -0
- package/dist/sdk/models/shared/bulkbpsconfig.d.ts +8 -0
- package/dist/sdk/models/shared/bulkbpsconfig.js +50 -0
- package/dist/sdk/models/shared/bulkbpspriceoverride.d.ts +24 -0
- package/dist/sdk/models/shared/bulkbpspriceoverride.js +74 -0
- package/dist/sdk/models/shared/bulkbpstier.d.ts +6 -0
- package/dist/sdk/models/shared/bulkbpstier.js +55 -0
- package/dist/sdk/models/shared/bulkconfig.d.ts +8 -0
- package/dist/sdk/models/shared/bulkconfig.js +50 -0
- package/dist/sdk/models/shared/bulkpriceoverride.d.ts +24 -0
- package/dist/sdk/models/shared/bulkpriceoverride.js +74 -0
- package/dist/sdk/models/shared/bulktier.d.ts +5 -0
- package/dist/sdk/models/shared/bulktier.js +50 -0
- package/dist/sdk/models/shared/cadence.d.ts +5 -0
- package/dist/sdk/models/shared/cadence.js +12 -0
- package/dist/sdk/models/shared/canceloption.d.ts +8 -0
- package/dist/sdk/models/shared/canceloption.js +15 -0
- package/dist/sdk/models/shared/changeoption.d.ts +8 -0
- package/dist/sdk/models/shared/changeoption.js +15 -0
- package/dist/sdk/models/shared/changeoption1.d.ts +8 -0
- package/dist/sdk/models/shared/changeoption1.js +15 -0
- package/dist/sdk/models/shared/coupon.d.ts +36 -0
- package/dist/sdk/models/shared/coupon.js +88 -0
- package/dist/sdk/models/shared/coupons.d.ts +10 -0
- package/dist/sdk/models/shared/coupons.js +57 -0
- package/dist/sdk/models/shared/credit.d.ts +16 -0
- package/dist/sdk/models/shared/credit.js +64 -0
- package/dist/sdk/models/shared/creditblock.d.ts +15 -0
- package/dist/sdk/models/shared/creditblock.js +58 -0
- package/dist/sdk/models/shared/creditledgerentries.d.ts +10 -0
- package/dist/sdk/models/shared/creditledgerentries.js +57 -0
- package/dist/sdk/models/shared/creditledgerentry.d.ts +58 -0
- package/dist/sdk/models/shared/creditledgerentry.js +144 -0
- package/dist/sdk/models/shared/creditnote.d.ts +71 -0
- package/dist/sdk/models/shared/creditnote.js +134 -0
- package/dist/sdk/models/shared/creditnotelineitem.d.ts +38 -0
- package/dist/sdk/models/shared/creditnotelineitem.js +86 -0
- package/dist/sdk/models/shared/creditnotes.d.ts +10 -0
- package/dist/sdk/models/shared/creditnotes.js +57 -0
- package/dist/sdk/models/shared/creditnotesummary.d.ts +9 -0
- package/dist/sdk/models/shared/creditnotesummary.js +74 -0
- package/dist/sdk/models/shared/creditnotetype.d.ts +7 -0
- package/dist/sdk/models/shared/creditnotetype.js +14 -0
- package/dist/sdk/models/shared/credits.d.ts +10 -0
- package/dist/sdk/models/shared/credits.js +57 -0
- package/dist/sdk/models/shared/customer.d.ts +227 -0
- package/dist/sdk/models/shared/customer.js +364 -0
- package/dist/sdk/models/shared/customerbalancetransaction.d.ts +57 -0
- package/dist/sdk/models/shared/customerbalancetransaction.js +133 -0
- package/dist/sdk/models/shared/customercost.d.ts +15 -0
- package/dist/sdk/models/shared/customercost.js +75 -0
- package/dist/sdk/models/shared/customercosts.d.ts +8 -0
- package/dist/sdk/models/shared/customercosts.js +50 -0
- package/dist/sdk/models/shared/customerminified.d.ts +8 -0
- package/dist/sdk/models/shared/customerminified.js +53 -0
- package/dist/sdk/models/shared/customers.d.ts +10 -0
- package/dist/sdk/models/shared/customers.js +57 -0
- package/dist/sdk/models/shared/debug.d.ts +8 -0
- package/dist/sdk/models/shared/debug.js +53 -0
- package/dist/sdk/models/shared/deprecatedeventresult.d.ts +10 -0
- package/dist/sdk/models/shared/deprecatedeventresult.js +48 -0
- package/dist/sdk/models/shared/discount.d.ts +25 -0
- package/dist/sdk/models/shared/discount.js +71 -0
- package/dist/sdk/models/shared/discounttype.d.ts +6 -0
- package/dist/sdk/models/shared/discounttype.js +13 -0
- package/dist/sdk/models/shared/durationunit.d.ts +8 -0
- package/dist/sdk/models/shared/durationunit.js +15 -0
- package/dist/sdk/models/shared/entrystatus.d.ts +7 -0
- package/dist/sdk/models/shared/entrystatus.js +14 -0
- package/dist/sdk/models/shared/entrytype.d.ts +9 -0
- package/dist/sdk/models/shared/entrytype.js +16 -0
- package/dist/sdk/models/shared/event.d.ts +32 -0
- package/dist/sdk/models/shared/event.js +82 -0
- package/dist/sdk/models/shared/eventsearchcriteria.d.ts +11 -0
- package/dist/sdk/models/shared/eventsearchcriteria.js +50 -0
- package/dist/sdk/models/shared/eventsearchresults.d.ts +10 -0
- package/dist/sdk/models/shared/eventsearchresults.js +57 -0
- package/dist/sdk/models/shared/externalmarketplace.d.ts +8 -0
- package/dist/sdk/models/shared/externalmarketplace.js +15 -0
- package/dist/sdk/models/shared/fixedfeequantitychange.d.ts +18 -0
- package/dist/sdk/models/shared/fixedfeequantitychange.js +66 -0
- package/dist/sdk/models/shared/fixedfeequantityschedule.d.ts +7 -0
- package/dist/sdk/models/shared/fixedfeequantityschedule.js +68 -0
- package/dist/sdk/models/shared/granularity.d.ts +6 -0
- package/dist/sdk/models/shared/granularity.js +13 -0
- package/dist/sdk/models/shared/grouping.d.ts +8 -0
- package/dist/sdk/models/shared/grouping.js +53 -0
- package/dist/sdk/models/shared/index.d.ts +125 -0
- package/dist/sdk/models/shared/index.js +144 -0
- package/dist/sdk/models/shared/ingestionresponse.d.ts +13 -0
- package/dist/sdk/models/shared/ingestionresponse.js +57 -0
- package/dist/sdk/models/shared/invoice.d.ts +274 -0
- package/dist/sdk/models/shared/invoice.js +460 -0
- package/dist/sdk/models/shared/invoicelineitem.d.ts +207 -0
- package/dist/sdk/models/shared/invoicelineitem.js +416 -0
- package/dist/sdk/models/shared/invoices.d.ts +10 -0
- package/dist/sdk/models/shared/invoices.js +57 -0
- package/dist/sdk/models/shared/invoicesettings.d.ts +18 -0
- package/dist/sdk/models/shared/invoicesettings.js +58 -0
- package/dist/sdk/models/shared/invoicestatus.d.ts +10 -0
- package/dist/sdk/models/shared/invoicestatus.js +17 -0
- package/dist/sdk/models/shared/lineitem.d.ts +58 -0
- package/dist/sdk/models/shared/lineitem.js +147 -0
- package/dist/sdk/models/shared/matrixconfig.d.ts +13 -0
- package/dist/sdk/models/shared/matrixconfig.js +60 -0
- package/dist/sdk/models/shared/matrixconfig1.d.ts +10 -0
- package/dist/sdk/models/shared/matrixconfig1.js +48 -0
- package/dist/sdk/models/shared/matrixvalue.d.ts +8 -0
- package/dist/sdk/models/shared/matrixvalue.js +50 -0
- package/dist/sdk/models/shared/modeltype.d.ts +10 -0
- package/dist/sdk/models/shared/modeltype.js +17 -0
- package/dist/sdk/models/shared/newbackfill.d.ts +27 -0
- package/dist/sdk/models/shared/newbackfill.js +82 -0
- package/dist/sdk/models/shared/newcoupon.d.ts +24 -0
- package/dist/sdk/models/shared/newcoupon.js +69 -0
- package/dist/sdk/models/shared/newcreditledgerentry.d.ts +44 -0
- package/dist/sdk/models/shared/newcreditledgerentry.js +109 -0
- package/dist/sdk/models/shared/newcustomer.d.ts +202 -0
- package/dist/sdk/models/shared/newcustomer.js +324 -0
- package/dist/sdk/models/shared/newinvoicelineitem.d.ts +28 -0
- package/dist/sdk/models/shared/newinvoicelineitem.js +79 -0
- package/dist/sdk/models/shared/newsubscription.d.ts +79 -0
- package/dist/sdk/models/shared/newsubscription.js +145 -0
- package/dist/sdk/models/shared/newtransaction.d.ts +10 -0
- package/dist/sdk/models/shared/newtransaction.js +56 -0
- package/dist/sdk/models/shared/packageconfig.d.ts +8 -0
- package/dist/sdk/models/shared/packageconfig.js +53 -0
- package/dist/sdk/models/shared/packagepriceoverride.d.ts +24 -0
- package/dist/sdk/models/shared/packagepriceoverride.js +74 -0
- package/dist/sdk/models/shared/paginationmetadata.d.ts +5 -0
- package/dist/sdk/models/shared/paginationmetadata.js +50 -0
- package/dist/sdk/models/shared/perpricecost.d.ts +24 -0
- package/dist/sdk/models/shared/perpricecost.js +67 -0
- package/dist/sdk/models/shared/phaseoverride.d.ts +40 -0
- package/dist/sdk/models/shared/phaseoverride.js +100 -0
- package/dist/sdk/models/shared/plan.d.ts +101 -0
- package/dist/sdk/models/shared/plan.js +250 -0
- package/dist/sdk/models/shared/planminified.d.ts +5 -0
- package/dist/sdk/models/shared/planminified.js +50 -0
- package/dist/sdk/models/shared/planphase.d.ts +68 -0
- package/dist/sdk/models/shared/planphase.js +162 -0
- package/dist/sdk/models/shared/plans.d.ts +10 -0
- package/dist/sdk/models/shared/plans.js +57 -0
- package/dist/sdk/models/shared/price.d.ts +114 -0
- package/dist/sdk/models/shared/price.js +245 -0
- package/dist/sdk/models/shared/pricegroup.d.ts +17 -0
- package/dist/sdk/models/shared/pricegroup.js +65 -0
- package/dist/sdk/models/shared/product.d.ts +6 -0
- package/dist/sdk/models/shared/product.js +59 -0
- package/dist/sdk/models/shared/reason.d.ts +9 -0
- package/dist/sdk/models/shared/reason.js +16 -0
- package/dist/sdk/models/shared/requestvalidationerror.d.ts +20 -0
- package/dist/sdk/models/shared/requestvalidationerror.js +65 -0
- package/dist/sdk/models/shared/security.d.ts +4 -0
- package/dist/sdk/models/shared/security.js +45 -0
- package/dist/sdk/models/shared/sublineitem.d.ts +32 -0
- package/dist/sdk/models/shared/sublineitem.js +102 -0
- package/dist/sdk/models/shared/sublineitem1.d.ts +24 -0
- package/dist/sdk/models/shared/sublineitem1.js +75 -0
- package/dist/sdk/models/shared/sublineitem2.d.ts +6 -0
- package/dist/sdk/models/shared/sublineitem2.js +55 -0
- package/dist/sdk/models/shared/subscription.d.ts +95 -0
- package/dist/sdk/models/shared/subscription.js +207 -0
- package/dist/sdk/models/shared/subscriptioncancellation.d.ts +12 -0
- package/dist/sdk/models/shared/subscriptioncancellation.js +55 -0
- package/dist/sdk/models/shared/subscriptioncost.d.ts +15 -0
- package/dist/sdk/models/shared/subscriptioncost.js +75 -0
- package/dist/sdk/models/shared/subscriptioncosts.d.ts +8 -0
- package/dist/sdk/models/shared/subscriptioncosts.js +50 -0
- package/dist/sdk/models/shared/subscriptionminified.d.ts +7 -0
- package/dist/sdk/models/shared/subscriptionminified.js +48 -0
- package/dist/sdk/models/shared/subscriptionplanchange.d.ts +54 -0
- package/dist/sdk/models/shared/subscriptionplanchange.js +104 -0
- package/dist/sdk/models/shared/subscriptions.d.ts +10 -0
- package/dist/sdk/models/shared/subscriptions.js +57 -0
- package/dist/sdk/models/shared/subscriptionschedule.d.ts +10 -0
- package/dist/sdk/models/shared/subscriptionschedule.js +57 -0
- package/dist/sdk/models/shared/subscriptionscheduleitem.d.ts +7 -0
- package/dist/sdk/models/shared/subscriptionscheduleitem.js +65 -0
- package/dist/sdk/models/shared/subscriptionstatus.d.ts +5 -0
- package/dist/sdk/models/shared/subscriptionstatus.js +12 -0
- package/dist/sdk/models/shared/subscriptionusage.d.ts +8 -0
- package/dist/sdk/models/shared/subscriptionusage.js +50 -0
- package/dist/sdk/models/shared/taxamount.d.ts +15 -0
- package/dist/sdk/models/shared/taxamount.js +55 -0
- package/dist/sdk/models/shared/tier.d.ts +6 -0
- package/dist/sdk/models/shared/tier.js +55 -0
- package/dist/sdk/models/shared/tier7.d.ts +7 -0
- package/dist/sdk/models/shared/tier7.js +60 -0
- package/dist/sdk/models/shared/tierconfig.d.ts +9 -0
- package/dist/sdk/models/shared/tierconfig.js +58 -0
- package/dist/sdk/models/shared/tieredbpsconfig.d.ts +8 -0
- package/dist/sdk/models/shared/tieredbpsconfig.js +50 -0
- package/dist/sdk/models/shared/tieredbpsconfig1.d.ts +5 -0
- package/dist/sdk/models/shared/tieredbpsconfig1.js +47 -0
- package/dist/sdk/models/shared/tieredbpspriceoverride.d.ts +21 -0
- package/dist/sdk/models/shared/tieredbpspriceoverride.js +74 -0
- package/dist/sdk/models/shared/tieredconfig.d.ts +8 -0
- package/dist/sdk/models/shared/tieredconfig.js +50 -0
- package/dist/sdk/models/shared/tieredpriceoverride.d.ts +27 -0
- package/dist/sdk/models/shared/tieredpriceoverride.js +74 -0
- package/dist/sdk/models/shared/transactions.d.ts +10 -0
- package/dist/sdk/models/shared/transactions.js +57 -0
- package/dist/sdk/models/shared/transactiontype.d.ts +4 -0
- package/dist/sdk/models/shared/transactiontype.js +11 -0
- package/dist/sdk/models/shared/trialconfig.d.ts +8 -0
- package/dist/sdk/models/shared/trialconfig.js +54 -0
- package/dist/sdk/models/shared/type.d.ts +7 -0
- package/dist/sdk/models/shared/type.js +14 -0
- package/dist/sdk/models/shared/unitconfig.d.ts +7 -0
- package/dist/sdk/models/shared/unitconfig.js +48 -0
- package/dist/sdk/models/shared/unitpriceoverride.d.ts +24 -0
- package/dist/sdk/models/shared/unitpriceoverride.js +74 -0
- package/dist/sdk/models/shared/upcominginvoice.d.ts +95 -0
- package/dist/sdk/models/shared/upcominginvoice.js +193 -0
- package/dist/sdk/models/shared/updateevent.d.ts +28 -0
- package/dist/sdk/models/shared/updateevent.js +77 -0
- package/dist/sdk/models/shared/usage.d.ts +13 -0
- package/dist/sdk/models/shared/usage.js +69 -0
- package/dist/sdk/models/shared/usageitem.d.ts +6 -0
- package/dist/sdk/models/shared/usageitem.js +63 -0
- package/dist/sdk/models/shared/validationerrors.d.ts +13 -0
- package/dist/sdk/models/shared/validationerrors.js +59 -0
- package/dist/sdk/models/shared/viewmode.d.ts +7 -0
- package/dist/sdk/models/shared/viewmode.js +14 -0
- package/dist/sdk/plan.d.ts +222 -0
- package/dist/sdk/plan.js +422 -0
- package/dist/sdk/sdk.d.ts +298 -0
- package/dist/sdk/sdk.js +110 -0
- package/dist/sdk/subscription.d.ts +614 -0
- package/dist/sdk/subscription.js +1192 -0
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.js +20 -0
- package/dist/sdk/types/rfcdate.d.ts +9 -0
- package/dist/sdk/types/rfcdate.js +59 -0
- package/package.json +33 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 orbcorp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# orb-billing
|
|
2
|
+
|
|
3
|
+
<!-- Start SDK Installation -->
|
|
4
|
+
## SDK Installation
|
|
5
|
+
|
|
6
|
+
### NPM
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm add orb-billing
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
### Yarn
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
yarn add orb-billing
|
|
16
|
+
```
|
|
17
|
+
<!-- End SDK Installation -->
|
|
18
|
+
|
|
19
|
+
## SDK Example Usage
|
|
20
|
+
<!-- Start SDK Example Usage -->
|
|
21
|
+
```typescript
|
|
22
|
+
import { Orb } from "orb-billing";
|
|
23
|
+
import { CreateCustomerResponse } from "orb-billing/dist/sdk/models/operations";
|
|
24
|
+
import { CustomerPaymentProvider, NewCustomerPaymentProvider } from "orb-billing/dist/sdk/models/shared";
|
|
25
|
+
|
|
26
|
+
const sdk = new Orb({
|
|
27
|
+
security: {
|
|
28
|
+
apiKeyAuth: "",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
sdk.customer.create({
|
|
33
|
+
autoCollection: false,
|
|
34
|
+
billingAddress: {
|
|
35
|
+
city: "Laruecester",
|
|
36
|
+
country: "US",
|
|
37
|
+
line1: "quibusdam",
|
|
38
|
+
line2: "unde",
|
|
39
|
+
postalCode: "58466-3428",
|
|
40
|
+
state: "ipsa",
|
|
41
|
+
},
|
|
42
|
+
currency: "delectus",
|
|
43
|
+
email: "Geraldine_Kreiger52@gmail.com",
|
|
44
|
+
externalCustomerId: "iusto",
|
|
45
|
+
metadata: {},
|
|
46
|
+
name: "Charlie Walsh II",
|
|
47
|
+
paymentProvider: NewCustomerPaymentProvider.Quickbooks,
|
|
48
|
+
paymentProviderId: "deserunt",
|
|
49
|
+
shippingAddress: {
|
|
50
|
+
city: "West Ritaworth",
|
|
51
|
+
country: "US",
|
|
52
|
+
line1: "quo",
|
|
53
|
+
line2: "odit",
|
|
54
|
+
postalCode: "89478-4576",
|
|
55
|
+
state: "dicta",
|
|
56
|
+
},
|
|
57
|
+
taxId: {
|
|
58
|
+
country: "Puerto Rico",
|
|
59
|
+
type: "officia",
|
|
60
|
+
value: "occaecati",
|
|
61
|
+
},
|
|
62
|
+
timezone: "Etc/UTC",
|
|
63
|
+
}).then((res: CreateCustomerResponse) => {
|
|
64
|
+
if (res.statusCode == 200) {
|
|
65
|
+
// handle response
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
```
|
|
69
|
+
<!-- End SDK Example Usage -->
|
|
70
|
+
|
|
71
|
+
<!-- Start SDK Available Operations -->
|
|
72
|
+
## Available Resources and Operations
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
### [availability](docs/sdks/availability/README.md)
|
|
76
|
+
|
|
77
|
+
* [ping](docs/sdks/availability/README.md#ping) - Check availability
|
|
78
|
+
|
|
79
|
+
### [coupon](docs/sdks/coupon/README.md)
|
|
80
|
+
|
|
81
|
+
* [archive](docs/sdks/coupon/README.md#archive) - Archive coupon
|
|
82
|
+
* [create](docs/sdks/coupon/README.md#create) - Create coupon
|
|
83
|
+
* [fetch](docs/sdks/coupon/README.md#fetch) - Fetch coupon
|
|
84
|
+
* [list](docs/sdks/coupon/README.md#list) - List coupons
|
|
85
|
+
* [listSubscriptions](docs/sdks/coupon/README.md#listsubscriptions) - List coupon subscriptions
|
|
86
|
+
|
|
87
|
+
### [credit](docs/sdks/credit/README.md)
|
|
88
|
+
|
|
89
|
+
* [addByExternalId](docs/sdks/credit/README.md#addbyexternalid) - Create ledger entry by external ID
|
|
90
|
+
* [create](docs/sdks/credit/README.md#create) - Create ledger entry
|
|
91
|
+
* [fetch](docs/sdks/credit/README.md#fetch) - Fetch customer credit balance
|
|
92
|
+
* [fetchByExternalId](docs/sdks/credit/README.md#fetchbyexternalid) - Fetch customer credit balance by external customer id
|
|
93
|
+
* [fetchLedger](docs/sdks/credit/README.md#fetchledger) - Fetch customer credits ledger
|
|
94
|
+
* [fetchLedgerExternalId](docs/sdks/credit/README.md#fetchledgerexternalid) - Fetch credits ledger by external ID
|
|
95
|
+
|
|
96
|
+
### [creditNote](docs/sdks/creditnote/README.md)
|
|
97
|
+
|
|
98
|
+
* [fetch](docs/sdks/creditnote/README.md#fetch) - Fetch credit note
|
|
99
|
+
* [list](docs/sdks/creditnote/README.md#list) - List credit notes
|
|
100
|
+
|
|
101
|
+
### [customer](docs/sdks/customer/README.md)
|
|
102
|
+
|
|
103
|
+
* [amend](docs/sdks/customer/README.md#amend) - Amend usage
|
|
104
|
+
* [amendByExternalId](docs/sdks/customer/README.md#amendbyexternalid) - Amend usage by external ID
|
|
105
|
+
* [create](docs/sdks/customer/README.md#create) - Create customer
|
|
106
|
+
* [createBalanceTransaction](docs/sdks/customer/README.md#createbalancetransaction) - Create customer balance transaction
|
|
107
|
+
* [delete](docs/sdks/customer/README.md#delete) - Delete customer
|
|
108
|
+
* [fetch](docs/sdks/customer/README.md#fetch) - Fetch customer
|
|
109
|
+
* [fetchByExternalId](docs/sdks/customer/README.md#fetchbyexternalid) - Fetch customer by external ID
|
|
110
|
+
* [fetchCosts](docs/sdks/customer/README.md#fetchcosts) - Fetch customer costs
|
|
111
|
+
* [fetchCostsByExternalId](docs/sdks/customer/README.md#fetchcostsbyexternalid) - Fetch customer costs by external ID
|
|
112
|
+
* [fetchTransactions](docs/sdks/customer/README.md#fetchtransactions) - List balance transactions
|
|
113
|
+
* [list](docs/sdks/customer/README.md#list) - List customers
|
|
114
|
+
* [updateByExternalId](docs/sdks/customer/README.md#updatebyexternalid) - Update customer by external ID
|
|
115
|
+
* [updateCustomer](docs/sdks/customer/README.md#updatecustomer) - Update customer
|
|
116
|
+
|
|
117
|
+
### [event](docs/sdks/event/README.md)
|
|
118
|
+
|
|
119
|
+
* [amend](docs/sdks/event/README.md#amend) - Amend event
|
|
120
|
+
* [closeBackfill](docs/sdks/event/README.md#closebackfill) - Close backfill
|
|
121
|
+
* [create](docs/sdks/event/README.md#create) - Create backfill
|
|
122
|
+
* [deprecateEvent](docs/sdks/event/README.md#deprecateevent) - Deprecate event
|
|
123
|
+
* [ingest](docs/sdks/event/README.md#ingest) - Ingest events
|
|
124
|
+
* [listBackfills](docs/sdks/event/README.md#listbackfills) - List backfills
|
|
125
|
+
* [revertBackfill](docs/sdks/event/README.md#revertbackfill) - Revert backfill
|
|
126
|
+
* [search](docs/sdks/event/README.md#search) - Search events
|
|
127
|
+
|
|
128
|
+
### [invoice](docs/sdks/invoice/README.md)
|
|
129
|
+
|
|
130
|
+
* [create](docs/sdks/invoice/README.md#create) - Create invoice line item
|
|
131
|
+
* [fetch](docs/sdks/invoice/README.md#fetch) - Fetch invoice
|
|
132
|
+
* [fetchUpcoming](docs/sdks/invoice/README.md#fetchupcoming) - Fetch upcoming invoice
|
|
133
|
+
* [issue](docs/sdks/invoice/README.md#issue) - Issue an invoice
|
|
134
|
+
* [list](docs/sdks/invoice/README.md#list) - List invoices
|
|
135
|
+
* [void](docs/sdks/invoice/README.md#void) - Void invoice
|
|
136
|
+
|
|
137
|
+
### [plan](docs/sdks/plan/README.md)
|
|
138
|
+
|
|
139
|
+
* [fetch](docs/sdks/plan/README.md#fetch) - Fetch plan
|
|
140
|
+
* [getByExternalId](docs/sdks/plan/README.md#getbyexternalid) - Fetch plan by external ID
|
|
141
|
+
* [list](docs/sdks/plan/README.md#list) - List plans
|
|
142
|
+
|
|
143
|
+
### [subscription](docs/sdks/subscription/README.md)
|
|
144
|
+
|
|
145
|
+
* [cancel](docs/sdks/subscription/README.md#cancel) - Cancel subscription
|
|
146
|
+
* [create](docs/sdks/subscription/README.md#create) - Create subscription
|
|
147
|
+
* [fetch](docs/sdks/subscription/README.md#fetch) - Fetch subscription
|
|
148
|
+
* [fetchCosts](docs/sdks/subscription/README.md#fetchcosts) - Fetch subscription costs
|
|
149
|
+
* [fetchSchedule](docs/sdks/subscription/README.md#fetchschedule) - Fetch subscription schedule
|
|
150
|
+
* [fetchUsage](docs/sdks/subscription/README.md#fetchusage) - Fetch subscription usage
|
|
151
|
+
* [list](docs/sdks/subscription/README.md#list) - List subscriptions
|
|
152
|
+
* [schedulePlanChange](docs/sdks/subscription/README.md#scheduleplanchange) - Schedule plan change
|
|
153
|
+
* [unscheduleCancellation](docs/sdks/subscription/README.md#unschedulecancellation) - Unschedule subscription cancellation
|
|
154
|
+
* [unschedulePlanChange](docs/sdks/subscription/README.md#unscheduleplanchange) - Unschedule plan change
|
|
155
|
+
* [updateFixedFeeQuantity](docs/sdks/subscription/README.md#updatefixedfeequantity) - Update price quantity
|
|
156
|
+
<!-- End SDK Available Operations -->
|
|
157
|
+
|
|
158
|
+
### Maturity
|
|
159
|
+
|
|
160
|
+
This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage
|
|
161
|
+
to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally
|
|
162
|
+
looking for the latest version.
|
|
163
|
+
|
|
164
|
+
### Contributions
|
|
165
|
+
|
|
166
|
+
While we value open-source contributions to this SDK, this library is generated programmatically.
|
|
167
|
+
Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!
|
|
168
|
+
|
|
169
|
+
### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./sdk";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./sdk"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchContentType(contentType: string, pattern: string): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.matchContentType = void 0;
|
|
7
|
+
function matchContentType(contentType, pattern) {
|
|
8
|
+
var res = false;
|
|
9
|
+
contentType
|
|
10
|
+
.split(";")
|
|
11
|
+
.map(function (ctPart) {
|
|
12
|
+
return ctPart.trim();
|
|
13
|
+
})
|
|
14
|
+
.forEach(function (ctPart) {
|
|
15
|
+
if (ctPart === pattern || pattern === "*" || pattern === "*/*") {
|
|
16
|
+
res = true;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (ctPart === pattern) {
|
|
20
|
+
res = true;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
var parts = ctPart.split("/");
|
|
24
|
+
if (parts.length === 2) {
|
|
25
|
+
if ("".concat(parts[0], "/*") === pattern || "*/".concat(parts[1]) === pattern) {
|
|
26
|
+
res = true;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return res;
|
|
32
|
+
}
|
|
33
|
+
exports.matchContentType = matchContentType;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AxiosResponseHeaders, RawAxiosResponseHeaders } from "axios";
|
|
2
|
+
export declare const headerMetadataKey = "header";
|
|
3
|
+
export declare function getHeadersFromRequest(headerParams: any): any;
|
|
4
|
+
export declare function getHeadersFromResponse(headers: RawAxiosResponseHeaders | AxiosResponseHeaders): Record<string, string[]>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getHeadersFromResponse = exports.getHeadersFromRequest = exports.headerMetadataKey = void 0;
|
|
7
|
+
var utils_1 = require("./utils");
|
|
8
|
+
var requestbody_1 = require("./requestbody");
|
|
9
|
+
exports.headerMetadataKey = "header";
|
|
10
|
+
function getHeadersFromRequest(headerParams) {
|
|
11
|
+
if (headerParams == null)
|
|
12
|
+
return;
|
|
13
|
+
var headers = {};
|
|
14
|
+
var fieldNames = Object.getOwnPropertyNames(headerParams);
|
|
15
|
+
fieldNames.forEach(function (fname) {
|
|
16
|
+
var requestBodyAnn = Reflect.getMetadata(requestbody_1.requestMetadataKey, headerParams, fname);
|
|
17
|
+
if (requestBodyAnn)
|
|
18
|
+
return;
|
|
19
|
+
var headerAnn = Reflect.getMetadata(exports.headerMetadataKey, headerParams, fname);
|
|
20
|
+
if (headerAnn == null)
|
|
21
|
+
return;
|
|
22
|
+
var headerDecorator = (0, utils_1.parseParamDecorator)(headerAnn, fname, "simple", false);
|
|
23
|
+
if (headerDecorator == null)
|
|
24
|
+
return;
|
|
25
|
+
var value = serializeHeader(headerParams[fname], headerDecorator.Explode);
|
|
26
|
+
if (value != "")
|
|
27
|
+
headers[headerDecorator.ParamName] = value;
|
|
28
|
+
});
|
|
29
|
+
return headers;
|
|
30
|
+
}
|
|
31
|
+
exports.getHeadersFromRequest = getHeadersFromRequest;
|
|
32
|
+
function getHeadersFromResponse(headers) {
|
|
33
|
+
var reponseHeaders = {};
|
|
34
|
+
Object.keys(headers).forEach(function (key) {
|
|
35
|
+
var value = headers[key];
|
|
36
|
+
if (!value)
|
|
37
|
+
return;
|
|
38
|
+
if (Array.isArray(value)) {
|
|
39
|
+
var h_1 = [];
|
|
40
|
+
value.forEach(function (val) {
|
|
41
|
+
if (val) {
|
|
42
|
+
h_1.push(String(val));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
reponseHeaders[key] = h_1;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
reponseHeaders[key] = [value];
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return reponseHeaders;
|
|
52
|
+
}
|
|
53
|
+
exports.getHeadersFromResponse = getHeadersFromResponse;
|
|
54
|
+
function serializeHeader(header, explode) {
|
|
55
|
+
var headerVals = [];
|
|
56
|
+
if (Array.isArray(header)) {
|
|
57
|
+
header.forEach(function (val) {
|
|
58
|
+
headerVals.push((0, utils_1.valToString)(val));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else if ((0, utils_1.isStringRecord)(header) ||
|
|
62
|
+
(0, utils_1.isNumberRecord)(header) ||
|
|
63
|
+
(0, utils_1.isBooleanRecord)(header)) {
|
|
64
|
+
Object.getOwnPropertyNames(header).forEach(function (headerKey) {
|
|
65
|
+
if (explode)
|
|
66
|
+
headerVals.push("".concat(headerKey, "=").concat((0, utils_1.valToString)(header[headerKey])));
|
|
67
|
+
else
|
|
68
|
+
headerVals.push("".concat(headerKey, ",").concat((0, utils_1.valToString)(header[headerKey])));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
else if (header instanceof Object) {
|
|
72
|
+
Object.getOwnPropertyNames(header).forEach(function (headerKey) {
|
|
73
|
+
var headerAnn = Reflect.getMetadata(exports.headerMetadataKey, header, headerKey);
|
|
74
|
+
if (headerAnn == null)
|
|
75
|
+
return;
|
|
76
|
+
var headerDecorator = (0, utils_1.parseParamDecorator)(headerAnn, headerKey, "simple", explode);
|
|
77
|
+
if (headerDecorator == null)
|
|
78
|
+
return;
|
|
79
|
+
var headerFieldValue = (0, utils_1.valToString)(header[headerKey]);
|
|
80
|
+
if ((0, utils_1.isEmpty)(headerFieldValue))
|
|
81
|
+
return;
|
|
82
|
+
else if (explode)
|
|
83
|
+
headerVals.push("".concat(headerDecorator.ParamName, "=").concat(headerFieldValue));
|
|
84
|
+
else
|
|
85
|
+
headerVals.push("".concat(headerDecorator.ParamName, ",").concat(headerFieldValue));
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
return String(header);
|
|
90
|
+
}
|
|
91
|
+
return headerVals.join(",");
|
|
92
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
17
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
__exportStar(require("./contenttype"), exports);
|
|
21
|
+
__exportStar(require("./headers"), exports);
|
|
22
|
+
__exportStar(require("./pathparams"), exports);
|
|
23
|
+
__exportStar(require("./queryparams"), exports);
|
|
24
|
+
__exportStar(require("./requestbody"), exports);
|
|
25
|
+
__exportStar(require("./retries"), exports);
|
|
26
|
+
__exportStar(require("./security"), exports);
|
|
27
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getSimplePathParams = exports.ppMetadataKey = void 0;
|
|
7
|
+
var utils_1 = require("./utils");
|
|
8
|
+
exports.ppMetadataKey = "pathParam";
|
|
9
|
+
function getSimplePathParams(paramName, paramValue, explode) {
|
|
10
|
+
var pathParams = new Map();
|
|
11
|
+
var ppVals = [];
|
|
12
|
+
if (Array.isArray(paramValue)) {
|
|
13
|
+
paramValue.forEach(function (param) {
|
|
14
|
+
ppVals.push(encodeURIComponent((0, utils_1.valToString)(param)));
|
|
15
|
+
});
|
|
16
|
+
pathParams.set(paramName, ppVals.join(","));
|
|
17
|
+
}
|
|
18
|
+
else if ((0, utils_1.isStringRecord)(paramValue) ||
|
|
19
|
+
(0, utils_1.isNumberRecord)(paramValue) ||
|
|
20
|
+
(0, utils_1.isBooleanRecord)(paramValue)) {
|
|
21
|
+
Object.getOwnPropertyNames(paramValue).forEach(function (paramKey) {
|
|
22
|
+
var paramFieldValue = encodeURIComponent((0, utils_1.valToString)(paramValue[paramKey]));
|
|
23
|
+
if (explode)
|
|
24
|
+
ppVals.push("".concat(paramKey, "=").concat(paramFieldValue));
|
|
25
|
+
else
|
|
26
|
+
ppVals.push("".concat(paramKey, ",").concat(paramFieldValue));
|
|
27
|
+
});
|
|
28
|
+
pathParams.set(paramName, ppVals.join(","));
|
|
29
|
+
}
|
|
30
|
+
else if (paramValue instanceof Object) {
|
|
31
|
+
Object.getOwnPropertyNames(paramValue).forEach(function (paramKey) {
|
|
32
|
+
var ppAnn = Reflect.getMetadata(exports.ppMetadataKey, paramValue, paramKey);
|
|
33
|
+
if (ppAnn == null)
|
|
34
|
+
return;
|
|
35
|
+
var ppDecorator = (0, utils_1.parseParamDecorator)(ppAnn, paramKey, "simple", explode);
|
|
36
|
+
if (ppDecorator == null)
|
|
37
|
+
return;
|
|
38
|
+
var paramFieldValue = encodeURIComponent((0, utils_1.valToString)(paramValue[paramKey]));
|
|
39
|
+
if ((0, utils_1.isEmpty)(paramFieldValue))
|
|
40
|
+
return;
|
|
41
|
+
else if (explode)
|
|
42
|
+
ppVals.push("".concat(ppDecorator.ParamName, "=").concat(paramFieldValue));
|
|
43
|
+
else
|
|
44
|
+
ppVals.push("".concat(ppDecorator.ParamName, ",").concat(paramFieldValue));
|
|
45
|
+
});
|
|
46
|
+
pathParams.set(paramName, ppVals.join(","));
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
pathParams.set(paramName, encodeURIComponent((0, utils_1.valToString)(paramValue)));
|
|
50
|
+
}
|
|
51
|
+
return pathParams;
|
|
52
|
+
}
|
|
53
|
+
exports.getSimplePathParams = getSimplePathParams;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
6
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
7
|
+
if (!m) return o;
|
|
8
|
+
var i = m.call(o), r, ar = [], e;
|
|
9
|
+
try {
|
|
10
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11
|
+
}
|
|
12
|
+
catch (error) { e = { error: error }; }
|
|
13
|
+
finally {
|
|
14
|
+
try {
|
|
15
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
16
|
+
}
|
|
17
|
+
finally { if (e) throw e.error; }
|
|
18
|
+
}
|
|
19
|
+
return ar;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.serializeQueryParams = exports.qpMetadataKey = void 0;
|
|
23
|
+
var utils_1 = require("./utils");
|
|
24
|
+
var requestbody_1 = require("./requestbody");
|
|
25
|
+
exports.qpMetadataKey = "queryParam";
|
|
26
|
+
var queryStringPrefix = "?";
|
|
27
|
+
var filterAndJoin = function (strings) { return strings.filter(function (s) { return !!s; }).join("&"); };
|
|
28
|
+
function serializeQueryParams(queryParams, globals) {
|
|
29
|
+
var queryStringParts = [];
|
|
30
|
+
if (!queryParams)
|
|
31
|
+
return filterAndJoin(queryStringParts);
|
|
32
|
+
var fieldNames = "__props__" in queryParams
|
|
33
|
+
? queryParams["__props__"].map(function (prop) { return prop.key; })
|
|
34
|
+
: Object.getOwnPropertyNames(queryParams);
|
|
35
|
+
fieldNames.forEach(function (fname) {
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
37
|
+
var requestBodyAnn = Reflect.getMetadata(requestbody_1.requestMetadataKey, queryParams, fname);
|
|
38
|
+
if (requestBodyAnn)
|
|
39
|
+
return;
|
|
40
|
+
var qpAnn = Reflect.getMetadata(exports.qpMetadataKey, queryParams, fname);
|
|
41
|
+
if (!qpAnn)
|
|
42
|
+
return { serialize: function () { return ""; } };
|
|
43
|
+
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, fname, "form", true);
|
|
44
|
+
if (!qpDecorator)
|
|
45
|
+
return;
|
|
46
|
+
var value = queryParams[fname];
|
|
47
|
+
value = (0, utils_1.populateFromGlobals)(value, fname, "queryParam", globals);
|
|
48
|
+
if (qpDecorator.Serialization === "json")
|
|
49
|
+
queryStringParts.push(jsonSerializer((_a = {}, _a[qpDecorator.ParamName] = value, _a)));
|
|
50
|
+
else {
|
|
51
|
+
switch (qpDecorator.Style) {
|
|
52
|
+
case "deepObject":
|
|
53
|
+
queryStringParts.push(deepObjectSerializer((_b = {}, _b[qpDecorator.ParamName] = value, _b)));
|
|
54
|
+
return;
|
|
55
|
+
case "form":
|
|
56
|
+
if (!qpDecorator.Explode)
|
|
57
|
+
queryStringParts.push(noExplodeSerializer((_c = {}, _c[qpDecorator.ParamName] = value, _c)));
|
|
58
|
+
else
|
|
59
|
+
queryStringParts.push(formSerializerExplode((_d = {}, _d[qpDecorator.ParamName] = value, _d)));
|
|
60
|
+
return;
|
|
61
|
+
case "pipeDelimited":
|
|
62
|
+
if (!qpDecorator.Explode) {
|
|
63
|
+
queryStringParts.push(noExplodeSerializer((_e = {}, _e[qpDecorator.ParamName] = value, _e), "|"));
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
queryStringParts.push(formSerializerExplode((_f = {}, _f[qpDecorator.ParamName] = value, _f)));
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
default:
|
|
70
|
+
queryStringParts.push(formSerializerExplode((_g = {}, _g[qpDecorator.ParamName] = value, _g)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return queryStringPrefix + filterAndJoin(queryStringParts);
|
|
75
|
+
}
|
|
76
|
+
exports.serializeQueryParams = serializeQueryParams;
|
|
77
|
+
// TODO: Add support for disabling percent encoding for reserved characters
|
|
78
|
+
function jsonSerializer(params) {
|
|
79
|
+
var query = [];
|
|
80
|
+
Object.entries(Object.assign({}, params)).forEach(function (_a) {
|
|
81
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
82
|
+
query.push("".concat(key, "=").concat(encodeURIComponent(JSON.stringify(value))));
|
|
83
|
+
});
|
|
84
|
+
return filterAndJoin(query);
|
|
85
|
+
}
|
|
86
|
+
// TODO: Add support for disabling percent encoding for reserved characters
|
|
87
|
+
function noExplodeSerializer(params, delimiter) {
|
|
88
|
+
if (delimiter === void 0) { delimiter = ","; }
|
|
89
|
+
var query = [];
|
|
90
|
+
Object.entries(Object.assign({}, params)).forEach(function (_a) {
|
|
91
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
92
|
+
if (!(0, utils_1.shouldQueryParamSerialize)(value))
|
|
93
|
+
return;
|
|
94
|
+
if (value !== Object(value))
|
|
95
|
+
query.push("".concat(key, "=").concat(encodeURIComponent((0, utils_1.valToString)(value))));
|
|
96
|
+
else if (Array.isArray(value)) {
|
|
97
|
+
var values = value.map(function (aValue) { return aValue; }).join(delimiter);
|
|
98
|
+
query.push("".concat(key, "=").concat(encodeURIComponent(values)));
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
var values = Object.getOwnPropertyNames(value)
|
|
102
|
+
.map(function (paramKey) {
|
|
103
|
+
var qpAnn = Reflect.getMetadata(exports.qpMetadataKey, value, paramKey);
|
|
104
|
+
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, paramKey, "form", true);
|
|
105
|
+
if (qpDecorator == null)
|
|
106
|
+
return;
|
|
107
|
+
return "".concat(paramKey).concat(delimiter).concat((0, utils_1.valToString)(value[paramKey]));
|
|
108
|
+
})
|
|
109
|
+
.join(delimiter);
|
|
110
|
+
query.push("".concat(key, "=").concat(encodeURIComponent(values)));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
return filterAndJoin(query);
|
|
114
|
+
}
|
|
115
|
+
// TODO: Add support for disabling percent encoding for reserved characters
|
|
116
|
+
function formSerializerExplode(params) {
|
|
117
|
+
var query = [];
|
|
118
|
+
Object.entries(Object.assign({}, params)).forEach(function (_a) {
|
|
119
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
120
|
+
if (!(0, utils_1.shouldQueryParamSerialize)(value))
|
|
121
|
+
return;
|
|
122
|
+
if (value !== Object(value))
|
|
123
|
+
query.push("".concat(key, "=").concat(encodeURIComponent(value)));
|
|
124
|
+
else if (Array.isArray(value)) {
|
|
125
|
+
query.push(value
|
|
126
|
+
.map(function (aValue) { return "".concat(key, "=").concat(encodeURIComponent((0, utils_1.valToString)(aValue))); })
|
|
127
|
+
.join("&"));
|
|
128
|
+
}
|
|
129
|
+
else
|
|
130
|
+
query.push(Object.getOwnPropertyNames(value)
|
|
131
|
+
.map(function (paramKey) {
|
|
132
|
+
var qpAnn = Reflect.getMetadata(exports.qpMetadataKey, value, paramKey);
|
|
133
|
+
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, paramKey, "form", true);
|
|
134
|
+
if (qpDecorator == null)
|
|
135
|
+
return;
|
|
136
|
+
return "".concat(paramKey, "=").concat(encodeURIComponent((0, utils_1.valToString)(value[paramKey])));
|
|
137
|
+
})
|
|
138
|
+
.join("&"));
|
|
139
|
+
});
|
|
140
|
+
return filterAndJoin(query);
|
|
141
|
+
}
|
|
142
|
+
// TODO: Add support for disabling percent encoding for reserved characters
|
|
143
|
+
function deepObjectSerializer(params) {
|
|
144
|
+
var query = [];
|
|
145
|
+
Object.entries(Object.assign({}, params)).forEach(function (_a) {
|
|
146
|
+
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
147
|
+
if (!(0, utils_1.shouldQueryParamSerialize)(value))
|
|
148
|
+
return;
|
|
149
|
+
if (value !== Object(value))
|
|
150
|
+
query.push("".concat(key, "=").concat(encodeURIComponent(value)));
|
|
151
|
+
else if (Array.isArray(value)) {
|
|
152
|
+
query.push(value
|
|
153
|
+
.map(function (_a) {
|
|
154
|
+
var _b = __read(_a, 2), objKey = _b[0], objValue = _b[1];
|
|
155
|
+
return "".concat(key, "[").concat(objKey, "]=").concat(encodeURIComponent((0, utils_1.valToString)(objValue)));
|
|
156
|
+
})
|
|
157
|
+
.join("&"));
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
query.push(Object.getOwnPropertyNames(value)
|
|
161
|
+
.map(function (paramKey) {
|
|
162
|
+
var qpAnn = Reflect.getMetadata(exports.qpMetadataKey, value, paramKey);
|
|
163
|
+
var qpDecorator = (0, utils_1.parseParamDecorator)(qpAnn, paramKey, "form", true);
|
|
164
|
+
if (qpDecorator == null)
|
|
165
|
+
return;
|
|
166
|
+
// For deep objects, arr is wrapped inside object
|
|
167
|
+
if (Array.isArray(value[paramKey]))
|
|
168
|
+
return value[paramKey]
|
|
169
|
+
.map(function (arrValue) {
|
|
170
|
+
return "".concat(key, "[").concat(paramKey, "]=").concat(encodeURIComponent((0, utils_1.valToString)(arrValue)));
|
|
171
|
+
})
|
|
172
|
+
.join("&");
|
|
173
|
+
return "".concat(key, "[").concat(paramKey, "]=").concat(encodeURIComponent((0, utils_1.valToString)(value[paramKey])));
|
|
174
|
+
})
|
|
175
|
+
.join("&"));
|
|
176
|
+
});
|
|
177
|
+
return filterAndJoin(query);
|
|
178
|
+
}
|