@polar-sh/sdk 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -44
- package/docs/sdks/benefits/README.md +4 -13
- package/docs/sdks/clients/README.md +4 -4
- package/docs/sdks/files/README.md +9 -9
- package/docs/sdks/oauth2/README.md +2 -2
- package/docs/sdks/polarsubscriptions/README.md +5 -89
- package/docs/sdks/products/README.md +2 -5
- package/docs/sdks/subscriptions/README.md +0 -164
- package/funcs/advertisementsGet.d.ts +1 -1
- package/funcs/advertisementsGet.d.ts.map +1 -1
- package/funcs/advertisementsGet.js +32 -32
- package/funcs/advertisementsGet.js.map +1 -1
- package/funcs/advertisementsList.d.ts +1 -1
- package/funcs/advertisementsList.d.ts.map +1 -1
- package/funcs/advertisementsList.js +42 -42
- package/funcs/advertisementsList.js.map +1 -1
- package/funcs/articlesCreate.d.ts +1 -1
- package/funcs/articlesCreate.d.ts.map +1 -1
- package/funcs/articlesCreate.js +30 -30
- package/funcs/articlesCreate.js.map +1 -1
- package/funcs/articlesDelete.d.ts +1 -1
- package/funcs/articlesDelete.d.ts.map +1 -1
- package/funcs/articlesDelete.js +32 -32
- package/funcs/articlesDelete.js.map +1 -1
- package/funcs/articlesGet.d.ts +1 -1
- package/funcs/articlesGet.d.ts.map +1 -1
- package/funcs/articlesGet.js +32 -32
- package/funcs/articlesGet.js.map +1 -1
- package/funcs/articlesList.d.ts +1 -1
- package/funcs/articlesList.d.ts.map +1 -1
- package/funcs/articlesList.js +46 -46
- package/funcs/articlesList.js.map +1 -1
- package/funcs/articlesPreview.d.ts +1 -1
- package/funcs/articlesPreview.d.ts.map +1 -1
- package/funcs/articlesPreview.js +32 -32
- package/funcs/articlesPreview.js.map +1 -1
- package/funcs/articlesReceivers.d.ts +1 -1
- package/funcs/articlesReceivers.d.ts.map +1 -1
- package/funcs/articlesReceivers.js +32 -32
- package/funcs/articlesReceivers.js.map +1 -1
- package/funcs/articlesSend.d.ts +1 -1
- package/funcs/articlesSend.d.ts.map +1 -1
- package/funcs/articlesSend.js +32 -32
- package/funcs/articlesSend.js.map +1 -1
- package/funcs/articlesUpdate.d.ts +1 -1
- package/funcs/articlesUpdate.d.ts.map +1 -1
- package/funcs/articlesUpdate.js +32 -32
- package/funcs/articlesUpdate.js.map +1 -1
- package/funcs/benefitsCreate.d.ts +1 -1
- package/funcs/benefitsCreate.d.ts.map +1 -1
- package/funcs/benefitsCreate.js +30 -30
- package/funcs/benefitsCreate.js.map +1 -1
- package/funcs/benefitsDelete.d.ts +1 -1
- package/funcs/benefitsDelete.d.ts.map +1 -1
- package/funcs/benefitsDelete.js +32 -32
- package/funcs/benefitsDelete.js.map +1 -1
- package/funcs/benefitsGet.d.ts +1 -1
- package/funcs/benefitsGet.d.ts.map +1 -1
- package/funcs/benefitsGet.js +32 -32
- package/funcs/benefitsGet.js.map +1 -1
- package/funcs/benefitsGrants.d.ts +1 -1
- package/funcs/benefitsGrants.d.ts.map +1 -1
- package/funcs/benefitsGrants.js +45 -45
- package/funcs/benefitsGrants.js.map +1 -1
- package/funcs/benefitsList.d.ts +1 -1
- package/funcs/benefitsList.d.ts.map +1 -1
- package/funcs/benefitsList.js +42 -42
- package/funcs/benefitsList.js.map +1 -1
- package/funcs/benefitsUpdate.d.ts +1 -1
- package/funcs/benefitsUpdate.d.ts.map +1 -1
- package/funcs/benefitsUpdate.js +32 -32
- package/funcs/benefitsUpdate.js.map +1 -1
- package/funcs/checkoutsCreate.d.ts +1 -1
- package/funcs/checkoutsCreate.d.ts.map +1 -1
- package/funcs/checkoutsCreate.js +30 -30
- package/funcs/checkoutsCreate.js.map +1 -1
- package/funcs/checkoutsGet.d.ts +1 -1
- package/funcs/checkoutsGet.d.ts.map +1 -1
- package/funcs/checkoutsGet.js +32 -32
- package/funcs/checkoutsGet.js.map +1 -1
- package/funcs/externalOrganizationsList.d.ts +1 -1
- package/funcs/externalOrganizationsList.d.ts.map +1 -1
- package/funcs/externalOrganizationsList.js +44 -44
- package/funcs/externalOrganizationsList.js.map +1 -1
- package/funcs/filesCreate.d.ts +1 -1
- package/funcs/filesCreate.d.ts.map +1 -1
- package/funcs/filesCreate.js +30 -30
- package/funcs/filesCreate.js.map +1 -1
- package/funcs/filesDelete.d.ts +1 -1
- package/funcs/filesDelete.d.ts.map +1 -1
- package/funcs/filesDelete.js +32 -32
- package/funcs/filesDelete.js.map +1 -1
- package/funcs/filesList.d.ts +1 -1
- package/funcs/filesList.d.ts.map +1 -1
- package/funcs/filesList.js +41 -41
- package/funcs/filesList.js.map +1 -1
- package/funcs/filesUpdate.d.ts +1 -1
- package/funcs/filesUpdate.d.ts.map +1 -1
- package/funcs/filesUpdate.js +32 -32
- package/funcs/filesUpdate.js.map +1 -1
- package/funcs/filesUploaded.d.ts +1 -1
- package/funcs/filesUploaded.d.ts.map +1 -1
- package/funcs/filesUploaded.js +32 -32
- package/funcs/filesUploaded.js.map +1 -1
- package/funcs/licenseKeysGet.d.ts +1 -1
- package/funcs/licenseKeysGet.d.ts.map +1 -1
- package/funcs/licenseKeysGet.js +32 -32
- package/funcs/licenseKeysGet.js.map +1 -1
- package/funcs/licenseKeysGetActivation.d.ts +1 -1
- package/funcs/licenseKeysGetActivation.d.ts.map +1 -1
- package/funcs/licenseKeysGetActivation.js +33 -33
- package/funcs/licenseKeysGetActivation.js.map +1 -1
- package/funcs/licenseKeysList.d.ts +1 -1
- package/funcs/licenseKeysList.d.ts.map +1 -1
- package/funcs/licenseKeysList.js +41 -41
- package/funcs/licenseKeysList.js.map +1 -1
- package/funcs/licenseKeysUpdate.d.ts +1 -1
- package/funcs/licenseKeysUpdate.d.ts.map +1 -1
- package/funcs/licenseKeysUpdate.js +32 -34
- package/funcs/licenseKeysUpdate.js.map +1 -1
- package/funcs/metricsGet.d.ts +1 -1
- package/funcs/metricsGet.d.ts.map +1 -1
- package/funcs/metricsGet.js +38 -38
- package/funcs/metricsGet.js.map +1 -1
- package/funcs/metricsLimits.d.ts +1 -1
- package/funcs/metricsLimits.d.ts.map +1 -1
- package/funcs/metricsLimits.js +20 -20
- package/funcs/metricsLimits.js.map +1 -1
- package/funcs/oauth2ClientsCreate.d.ts +1 -1
- package/funcs/oauth2ClientsCreate.d.ts.map +1 -1
- package/funcs/oauth2ClientsCreate.js +30 -30
- package/funcs/oauth2ClientsCreate.js.map +1 -1
- package/funcs/oauth2ClientsDelete.d.ts +1 -1
- package/funcs/oauth2ClientsDelete.d.ts.map +1 -1
- package/funcs/oauth2ClientsDelete.js +32 -32
- package/funcs/oauth2ClientsDelete.js.map +1 -1
- package/funcs/oauth2ClientsGet.d.ts +1 -1
- package/funcs/oauth2ClientsGet.d.ts.map +1 -1
- package/funcs/oauth2ClientsGet.js +32 -32
- package/funcs/oauth2ClientsGet.js.map +1 -1
- package/funcs/oauth2ClientsList.d.ts +1 -1
- package/funcs/oauth2ClientsList.d.ts.map +1 -1
- package/funcs/oauth2ClientsList.js +40 -40
- package/funcs/oauth2ClientsList.js.map +1 -1
- package/funcs/oauth2ClientsUpdate.d.ts +1 -1
- package/funcs/oauth2ClientsUpdate.d.ts.map +1 -1
- package/funcs/oauth2ClientsUpdate.js +32 -32
- package/funcs/oauth2ClientsUpdate.js.map +1 -1
- package/funcs/oauth2Introspect.d.ts +1 -1
- package/funcs/oauth2Introspect.d.ts.map +1 -1
- package/funcs/oauth2Introspect.js +29 -29
- package/funcs/oauth2Introspect.js.map +1 -1
- package/funcs/oauth2Revoke.d.ts +1 -1
- package/funcs/oauth2Revoke.d.ts.map +1 -1
- package/funcs/oauth2Revoke.js +28 -28
- package/funcs/oauth2Revoke.js.map +1 -1
- package/funcs/oauth2Token.d.ts +1 -1
- package/funcs/oauth2Token.d.ts.map +1 -1
- package/funcs/oauth2Token.js +28 -28
- package/funcs/oauth2Token.js.map +1 -1
- package/funcs/oauth2Userinfo.d.ts +1 -1
- package/funcs/oauth2Userinfo.d.ts.map +1 -1
- package/funcs/oauth2Userinfo.js +20 -20
- package/funcs/oauth2Userinfo.js.map +1 -1
- package/funcs/ordersGet.d.ts +1 -1
- package/funcs/ordersGet.d.ts.map +1 -1
- package/funcs/ordersGet.js +32 -32
- package/funcs/ordersGet.js.map +1 -1
- package/funcs/ordersInvoice.d.ts +1 -1
- package/funcs/ordersInvoice.d.ts.map +1 -1
- package/funcs/ordersInvoice.js +32 -32
- package/funcs/ordersInvoice.js.map +1 -1
- package/funcs/ordersList.d.ts +1 -1
- package/funcs/ordersList.d.ts.map +1 -1
- package/funcs/ordersList.js +44 -46
- package/funcs/ordersList.js.map +1 -1
- package/funcs/organizationsCreate.d.ts +1 -1
- package/funcs/organizationsCreate.d.ts.map +1 -1
- package/funcs/organizationsCreate.js +30 -30
- package/funcs/organizationsCreate.js.map +1 -1
- package/funcs/organizationsGet.d.ts +1 -1
- package/funcs/organizationsGet.d.ts.map +1 -1
- package/funcs/organizationsGet.js +32 -32
- package/funcs/organizationsGet.js.map +1 -1
- package/funcs/organizationsList.d.ts +1 -1
- package/funcs/organizationsList.d.ts.map +1 -1
- package/funcs/organizationsList.js +43 -43
- package/funcs/organizationsList.js.map +1 -1
- package/funcs/organizationsUpdate.d.ts +1 -1
- package/funcs/organizationsUpdate.d.ts.map +1 -1
- package/funcs/organizationsUpdate.js +32 -32
- package/funcs/organizationsUpdate.js.map +1 -1
- package/funcs/productsCreate.d.ts +1 -1
- package/funcs/productsCreate.d.ts.map +1 -1
- package/funcs/productsCreate.js +30 -30
- package/funcs/productsCreate.js.map +1 -1
- package/funcs/productsGet.d.ts +1 -1
- package/funcs/productsGet.d.ts.map +1 -1
- package/funcs/productsGet.js +32 -32
- package/funcs/productsGet.js.map +1 -1
- package/funcs/productsList.d.ts +1 -1
- package/funcs/productsList.d.ts.map +1 -1
- package/funcs/productsList.js +44 -45
- package/funcs/productsList.js.map +1 -1
- package/funcs/productsUpdate.d.ts +1 -1
- package/funcs/productsUpdate.d.ts.map +1 -1
- package/funcs/productsUpdate.js +32 -32
- package/funcs/productsUpdate.js.map +1 -1
- package/funcs/productsUpdateBenefits.d.ts +1 -1
- package/funcs/productsUpdateBenefits.d.ts.map +1 -1
- package/funcs/productsUpdateBenefits.js +32 -32
- package/funcs/productsUpdateBenefits.js.map +1 -1
- package/funcs/repositoriesGet.d.ts +1 -1
- package/funcs/repositoriesGet.d.ts.map +1 -1
- package/funcs/repositoriesGet.js +32 -32
- package/funcs/repositoriesGet.js.map +1 -1
- package/funcs/repositoriesList.d.ts +1 -1
- package/funcs/repositoriesList.d.ts.map +1 -1
- package/funcs/repositoriesList.js +46 -46
- package/funcs/repositoriesList.js.map +1 -1
- package/funcs/repositoriesUpdate.d.ts +1 -1
- package/funcs/repositoriesUpdate.d.ts.map +1 -1
- package/funcs/repositoriesUpdate.js +32 -34
- package/funcs/repositoriesUpdate.js.map +1 -1
- package/funcs/subscriptionsExport.d.ts +1 -1
- package/funcs/subscriptionsExport.d.ts.map +1 -1
- package/funcs/subscriptionsExport.js +33 -33
- package/funcs/subscriptionsExport.js.map +1 -1
- package/funcs/subscriptionsList.d.ts +1 -1
- package/funcs/subscriptionsList.d.ts.map +1 -1
- package/funcs/subscriptionsList.js +44 -45
- package/funcs/subscriptionsList.js.map +1 -1
- package/funcs/usersAdvertisementsCreate.d.ts +1 -1
- package/funcs/usersAdvertisementsCreate.d.ts.map +1 -1
- package/funcs/usersAdvertisementsCreate.js +30 -30
- package/funcs/usersAdvertisementsCreate.js.map +1 -1
- package/funcs/usersAdvertisementsDelete.d.ts +1 -1
- package/funcs/usersAdvertisementsDelete.d.ts.map +1 -1
- package/funcs/usersAdvertisementsDelete.js +32 -32
- package/funcs/usersAdvertisementsDelete.js.map +1 -1
- package/funcs/usersAdvertisementsEnable.d.ts +1 -1
- package/funcs/usersAdvertisementsEnable.d.ts.map +1 -1
- package/funcs/usersAdvertisementsEnable.js +32 -32
- package/funcs/usersAdvertisementsEnable.js.map +1 -1
- package/funcs/usersAdvertisementsGet.d.ts +1 -1
- package/funcs/usersAdvertisementsGet.d.ts.map +1 -1
- package/funcs/usersAdvertisementsGet.js +32 -32
- package/funcs/usersAdvertisementsGet.js.map +1 -1
- package/funcs/usersAdvertisementsList.d.ts +1 -1
- package/funcs/usersAdvertisementsList.d.ts.map +1 -1
- package/funcs/usersAdvertisementsList.js +41 -41
- package/funcs/usersAdvertisementsList.js.map +1 -1
- package/funcs/usersAdvertisementsUpdate.d.ts +1 -1
- package/funcs/usersAdvertisementsUpdate.d.ts.map +1 -1
- package/funcs/usersAdvertisementsUpdate.js +32 -32
- package/funcs/usersAdvertisementsUpdate.js.map +1 -1
- package/funcs/usersBenefitsGet.d.ts +1 -1
- package/funcs/usersBenefitsGet.d.ts.map +1 -1
- package/funcs/usersBenefitsGet.js +32 -32
- package/funcs/usersBenefitsGet.js.map +1 -1
- package/funcs/usersBenefitsList.d.ts +1 -1
- package/funcs/usersBenefitsList.d.ts.map +1 -1
- package/funcs/usersBenefitsList.js +45 -45
- package/funcs/usersBenefitsList.js.map +1 -1
- package/funcs/usersDownloadablesGet.d.ts +1 -1
- package/funcs/usersDownloadablesGet.d.ts.map +1 -1
- package/funcs/usersDownloadablesGet.js +32 -32
- package/funcs/usersDownloadablesGet.js.map +1 -1
- package/funcs/usersDownloadablesList.d.ts +1 -1
- package/funcs/usersDownloadablesList.d.ts.map +1 -1
- package/funcs/usersDownloadablesList.js +42 -42
- package/funcs/usersDownloadablesList.js.map +1 -1
- package/funcs/usersLicenseKeysActivate.d.ts +1 -1
- package/funcs/usersLicenseKeysActivate.d.ts.map +1 -1
- package/funcs/usersLicenseKeysActivate.js +30 -30
- package/funcs/usersLicenseKeysActivate.js.map +1 -1
- package/funcs/usersLicenseKeysDeactivate.d.ts +1 -1
- package/funcs/usersLicenseKeysDeactivate.d.ts.map +1 -1
- package/funcs/usersLicenseKeysDeactivate.js +30 -30
- package/funcs/usersLicenseKeysDeactivate.js.map +1 -1
- package/funcs/usersLicenseKeysGet.d.ts +1 -1
- package/funcs/usersLicenseKeysGet.d.ts.map +1 -1
- package/funcs/usersLicenseKeysGet.js +32 -32
- package/funcs/usersLicenseKeysGet.js.map +1 -1
- package/funcs/usersLicenseKeysList.d.ts +1 -1
- package/funcs/usersLicenseKeysList.d.ts.map +1 -1
- package/funcs/usersLicenseKeysList.js +42 -42
- package/funcs/usersLicenseKeysList.js.map +1 -1
- package/funcs/usersLicenseKeysValidate.d.ts +1 -1
- package/funcs/usersLicenseKeysValidate.d.ts.map +1 -1
- package/funcs/usersLicenseKeysValidate.js +30 -30
- package/funcs/usersLicenseKeysValidate.js.map +1 -1
- package/funcs/usersOrdersGet.d.ts +1 -1
- package/funcs/usersOrdersGet.d.ts.map +1 -1
- package/funcs/usersOrdersGet.js +32 -32
- package/funcs/usersOrdersGet.js.map +1 -1
- package/funcs/usersOrdersInvoice.d.ts +1 -1
- package/funcs/usersOrdersInvoice.d.ts.map +1 -1
- package/funcs/usersOrdersInvoice.js +32 -32
- package/funcs/usersOrdersInvoice.js.map +1 -1
- package/funcs/usersOrdersList.d.ts +1 -1
- package/funcs/usersOrdersList.d.ts.map +1 -1
- package/funcs/usersOrdersList.js +46 -46
- package/funcs/usersOrdersList.js.map +1 -1
- package/funcs/usersSubscriptionsCancel.d.ts +1 -1
- package/funcs/usersSubscriptionsCancel.d.ts.map +1 -1
- package/funcs/usersSubscriptionsCancel.js +32 -32
- package/funcs/usersSubscriptionsCancel.js.map +1 -1
- package/funcs/usersSubscriptionsGet.d.ts +1 -1
- package/funcs/usersSubscriptionsGet.d.ts.map +1 -1
- package/funcs/usersSubscriptionsGet.js +32 -32
- package/funcs/usersSubscriptionsGet.js.map +1 -1
- package/funcs/usersSubscriptionsList.d.ts +1 -1
- package/funcs/usersSubscriptionsList.d.ts.map +1 -1
- package/funcs/usersSubscriptionsList.js +45 -45
- package/funcs/usersSubscriptionsList.js.map +1 -1
- package/funcs/usersSubscriptionsUpdate.d.ts +1 -1
- package/funcs/usersSubscriptionsUpdate.d.ts.map +1 -1
- package/funcs/usersSubscriptionsUpdate.js +33 -33
- package/funcs/usersSubscriptionsUpdate.js.map +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts +5 -8
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +36 -20
- package/lib/sdks.js.map +1 -1
- package/models/components/index.d.ts +5 -6
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -6
- package/models/components/index.js.map +1 -1
- package/models/components/orderproduct.d.ts +0 -11
- package/models/components/orderproduct.d.ts.map +1 -1
- package/models/components/orderproduct.js +0 -7
- package/models/components/orderproduct.js.map +1 -1
- package/models/components/ordersubscription.d.ts +2 -2
- package/models/components/ordersubscription.d.ts.map +1 -1
- package/models/components/ordersubscription.js +2 -2
- package/models/components/ordersubscription.js.map +1 -1
- package/models/components/productinput.d.ts +0 -11
- package/models/components/productinput.d.ts.map +1 -1
- package/models/components/productinput.js +0 -7
- package/models/components/productinput.js.map +1 -1
- package/models/components/productonetimecreate.d.ts +5 -4
- package/models/components/productonetimecreate.d.ts.map +1 -1
- package/models/components/productonetimecreate.js +5 -0
- package/models/components/productonetimecreate.js.map +1 -1
- package/models/components/productoutput.d.ts +0 -11
- package/models/components/productoutput.d.ts.map +1 -1
- package/models/components/productoutput.js +0 -7
- package/models/components/productoutput.js.map +1 -1
- package/models/components/productpriceonetime.d.ts +3 -2
- package/models/components/productpriceonetime.d.ts.map +1 -1
- package/models/components/productpriceonetime.js +3 -0
- package/models/components/productpriceonetime.js.map +1 -1
- package/models/components/productpriceonetimecustom.d.ts +5 -5
- package/models/components/productpriceonetimecustom.d.ts.map +1 -1
- package/models/components/productpriceonetimecustom.js +4 -4
- package/models/components/productpriceonetimecustom.js.map +1 -1
- package/models/components/productpriceonetimecustomcreate.d.ts +24 -0
- package/models/components/productpriceonetimecustomcreate.d.ts.map +1 -1
- package/models/components/productpriceonetimecustomcreate.js +24 -1
- package/models/components/productpriceonetimecustomcreate.js.map +1 -1
- package/models/components/productpriceonetimefixed.d.ts +5 -5
- package/models/components/productpriceonetimefixed.d.ts.map +1 -1
- package/models/components/productpriceonetimefixed.js +4 -4
- package/models/components/productpriceonetimefixed.js.map +1 -1
- package/models/components/productpriceonetimefixedcreate.d.ts +29 -5
- package/models/components/productpriceonetimefixedcreate.d.ts.map +1 -1
- package/models/components/productpriceonetimefixedcreate.js +28 -5
- package/models/components/productpriceonetimefixedcreate.js.map +1 -1
- package/models/components/productpriceonetimefree.d.ts +104 -0
- package/models/components/productpriceonetimefree.d.ts.map +1 -0
- package/models/components/productpriceonetimefree.js +114 -0
- package/models/components/productpriceonetimefree.js.map +1 -0
- package/models/components/productpriceonetimefreecreate.d.ts +75 -0
- package/models/components/productpriceonetimefreecreate.d.ts.map +1 -0
- package/models/components/productpriceonetimefreecreate.js +98 -0
- package/models/components/productpriceonetimefreecreate.js.map +1 -0
- package/models/components/productpricerecurringcustom.d.ts +5 -5
- package/models/components/productpricerecurringcustom.d.ts.map +1 -1
- package/models/components/productpricerecurringcustom.js +4 -4
- package/models/components/productpricerecurringcustom.js.map +1 -1
- package/models/components/productpricerecurringfixed.d.ts +5 -5
- package/models/components/productpricerecurringfixed.d.ts.map +1 -1
- package/models/components/productpricerecurringfixed.js +4 -4
- package/models/components/productpricerecurringfixed.js.map +1 -1
- package/models/components/productpricerecurringfixedcreate.d.ts +91 -0
- package/models/components/productpricerecurringfixedcreate.d.ts.map +1 -0
- package/models/components/productpricerecurringfixedcreate.js +111 -0
- package/models/components/productpricerecurringfixedcreate.js.map +1 -0
- package/models/components/productpricerecurringfree.d.ts +110 -0
- package/models/components/productpricerecurringfree.d.ts.map +1 -0
- package/models/components/productpricerecurringfree.js +119 -0
- package/models/components/productpricerecurringfree.js.map +1 -0
- package/models/components/productpricerecurringfreecreate.d.ts +81 -0
- package/models/components/productpricerecurringfreecreate.d.ts.map +1 -0
- package/models/components/productpricerecurringfreecreate.js +103 -0
- package/models/components/productpricerecurringfreecreate.js.map +1 -0
- package/models/components/productpricerecurringinput.d.ts +7 -2
- package/models/components/productpricerecurringinput.d.ts.map +1 -1
- package/models/components/productpricerecurringinput.js +7 -0
- package/models/components/productpricerecurringinput.js.map +1 -1
- package/models/components/productpricerecurringoutput.d.ts +7 -2
- package/models/components/productpricerecurringoutput.d.ts.map +1 -1
- package/models/components/productpricerecurringoutput.js +7 -0
- package/models/components/productpricerecurringoutput.js.map +1 -1
- package/models/components/productrecurringcreate.d.ts +17 -36
- package/models/components/productrecurringcreate.d.ts.map +1 -1
- package/models/components/productrecurringcreate.js +26 -26
- package/models/components/productrecurringcreate.js.map +1 -1
- package/models/components/productupdate.d.ts +7 -10
- package/models/components/productupdate.d.ts.map +1 -1
- package/models/components/productupdate.js +15 -9
- package/models/components/productupdate.js.map +1 -1
- package/models/components/subscriptioninput.d.ts +4 -4
- package/models/components/subscriptioninput.d.ts.map +1 -1
- package/models/components/subscriptioninput.js +4 -4
- package/models/components/subscriptioninput.js.map +1 -1
- package/models/components/subscriptionoutput.d.ts +4 -4
- package/models/components/subscriptionoutput.d.ts.map +1 -1
- package/models/components/subscriptionoutput.js +4 -4
- package/models/components/subscriptionoutput.js.map +1 -1
- package/models/components/subscriptionsortproperty.d.ts +0 -6
- package/models/components/subscriptionsortproperty.d.ts.map +1 -1
- package/models/components/subscriptionsortproperty.js +0 -2
- package/models/components/subscriptionsortproperty.js.map +1 -1
- package/models/components/userorderproduct.d.ts +0 -11
- package/models/components/userorderproduct.d.ts.map +1 -1
- package/models/components/userorderproduct.js +0 -7
- package/models/components/userorderproduct.js.map +1 -1
- package/models/components/userordersubscription.d.ts +2 -2
- package/models/components/userordersubscription.d.ts.map +1 -1
- package/models/components/userordersubscription.js +2 -2
- package/models/components/userordersubscription.js.map +1 -1
- package/models/components/usersubscription.d.ts +4 -4
- package/models/components/usersubscription.d.ts.map +1 -1
- package/models/components/usersubscription.js +4 -4
- package/models/components/usersubscription.js.map +1 -1
- package/models/components/usersubscriptionproduct.d.ts +0 -11
- package/models/components/usersubscriptionproduct.d.ts.map +1 -1
- package/models/components/usersubscriptionproduct.js +0 -7
- package/models/components/usersubscriptionproduct.js.map +1 -1
- package/models/errors/index.d.ts +0 -2
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -2
- package/models/errors/index.js.map +1 -1
- package/models/operations/productscreate.d.ts +2 -2
- package/models/operations/productscreate.d.ts.map +1 -1
- package/models/operations/productscreate.js +2 -2
- package/models/operations/productscreate.js.map +1 -1
- package/models/operations/productslist.d.ts +0 -27
- package/models/operations/productslist.d.ts.map +1 -1
- package/models/operations/productslist.js +1 -32
- package/models/operations/productslist.js.map +1 -1
- package/models/operations/subscriptionslist.d.ts +0 -29
- package/models/operations/subscriptionslist.d.ts.map +1 -1
- package/models/operations/subscriptionslist.js +1 -32
- package/models/operations/subscriptionslist.js.map +1 -1
- package/package.json +1 -1
- package/sdk/oauth2.js +1 -1
- package/sdk/polarsubscriptions.d.ts +0 -9
- package/sdk/polarsubscriptions.d.ts.map +1 -1
- package/sdk/polarsubscriptions.js +0 -12
- package/sdk/polarsubscriptions.js.map +1 -1
- package/sdk/sdk.js +15 -15
- package/sdk/subscriptions.d.ts +0 -15
- package/sdk/subscriptions.d.ts.map +1 -1
- package/sdk/subscriptions.js +0 -20
- package/sdk/subscriptions.js.map +1 -1
- package/sdk/users.js +6 -6
- package/src/funcs/advertisementsGet.ts +40 -41
- package/src/funcs/advertisementsList.ts +48 -49
- package/src/funcs/articlesCreate.ts +37 -37
- package/src/funcs/articlesDelete.ts +41 -41
- package/src/funcs/articlesGet.ts +40 -40
- package/src/funcs/articlesList.ts +52 -52
- package/src/funcs/articlesPreview.ts +41 -44
- package/src/funcs/articlesReceivers.ts +39 -40
- package/src/funcs/articlesSend.ts +41 -41
- package/src/funcs/articlesUpdate.ts +41 -44
- package/src/funcs/benefitsCreate.ts +38 -38
- package/src/funcs/benefitsDelete.ts +41 -41
- package/src/funcs/benefitsGet.ts +40 -40
- package/src/funcs/benefitsGrants.ts +52 -55
- package/src/funcs/benefitsList.ts +48 -48
- package/src/funcs/benefitsUpdate.ts +41 -44
- package/src/funcs/checkoutsCreate.ts +37 -37
- package/src/funcs/checkoutsGet.ts +39 -39
- package/src/funcs/externalOrganizationsList.ts +51 -51
- package/src/funcs/filesCreate.ts +37 -37
- package/src/funcs/filesDelete.ts +41 -41
- package/src/funcs/filesList.ts +48 -48
- package/src/funcs/filesUpdate.ts +39 -42
- package/src/funcs/filesUploaded.ts +39 -42
- package/src/funcs/licenseKeysGet.ts +41 -41
- package/src/funcs/licenseKeysGetActivation.ts +44 -44
- package/src/funcs/licenseKeysList.ts +49 -49
- package/src/funcs/licenseKeysUpdate.ts +41 -47
- package/src/funcs/metricsGet.ts +45 -45
- package/src/funcs/metricsLimits.ts +22 -22
- package/src/funcs/oauth2ClientsCreate.ts +37 -38
- package/src/funcs/oauth2ClientsDelete.ts +40 -40
- package/src/funcs/oauth2ClientsGet.ts +40 -40
- package/src/funcs/oauth2ClientsList.ts +46 -47
- package/src/funcs/oauth2ClientsUpdate.ts +40 -43
- package/src/funcs/oauth2Introspect.ts +35 -35
- package/src/funcs/oauth2Revoke.ts +35 -35
- package/src/funcs/oauth2Token.ts +35 -35
- package/src/funcs/oauth2Userinfo.ts +22 -22
- package/src/funcs/ordersGet.ts +40 -40
- package/src/funcs/ordersInvoice.ts +40 -40
- package/src/funcs/ordersList.ts +51 -53
- package/src/funcs/organizationsCreate.ts +37 -37
- package/src/funcs/organizationsGet.ts +40 -40
- package/src/funcs/organizationsList.ts +49 -50
- package/src/funcs/organizationsUpdate.ts +42 -45
- package/src/funcs/productsCreate.ts +38 -38
- package/src/funcs/productsGet.ts +40 -40
- package/src/funcs/productsList.ts +50 -51
- package/src/funcs/productsUpdate.ts +41 -44
- package/src/funcs/productsUpdateBenefits.ts +42 -45
- package/src/funcs/repositoriesGet.ts +40 -40
- package/src/funcs/repositoriesList.ts +52 -52
- package/src/funcs/repositoriesUpdate.ts +41 -47
- package/src/funcs/subscriptionsExport.ts +41 -41
- package/src/funcs/subscriptionsList.ts +50 -52
- package/src/funcs/usersAdvertisementsCreate.ts +38 -38
- package/src/funcs/usersAdvertisementsDelete.ts +42 -42
- package/src/funcs/usersAdvertisementsEnable.ts +41 -44
- package/src/funcs/usersAdvertisementsGet.ts +41 -41
- package/src/funcs/usersAdvertisementsList.ts +48 -48
- package/src/funcs/usersAdvertisementsUpdate.ts +41 -44
- package/src/funcs/usersBenefitsGet.ts +40 -40
- package/src/funcs/usersBenefitsList.ts +51 -52
- package/src/funcs/usersDownloadablesGet.ts +41 -41
- package/src/funcs/usersDownloadablesList.ts +49 -49
- package/src/funcs/usersLicenseKeysActivate.ts +39 -39
- package/src/funcs/usersLicenseKeysDeactivate.ts +38 -38
- package/src/funcs/usersLicenseKeysGet.ts +42 -42
- package/src/funcs/usersLicenseKeysList.ts +51 -51
- package/src/funcs/usersLicenseKeysValidate.ts +38 -38
- package/src/funcs/usersOrdersGet.ts +40 -40
- package/src/funcs/usersOrdersInvoice.ts +40 -41
- package/src/funcs/usersOrdersList.ts +52 -52
- package/src/funcs/usersSubscriptionsCancel.ts +42 -42
- package/src/funcs/usersSubscriptionsGet.ts +41 -41
- package/src/funcs/usersSubscriptionsList.ts +52 -52
- package/src/funcs/usersSubscriptionsUpdate.ts +42 -48
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +26 -26
- package/src/models/components/index.ts +5 -6
- package/src/models/components/orderproduct.ts +0 -21
- package/src/models/components/ordersubscription.ts +4 -4
- package/src/models/components/productinput.ts +0 -21
- package/src/models/components/productonetimecreate.ts +16 -1
- package/src/models/components/productoutput.ts +0 -21
- package/src/models/components/productpriceonetime.ts +10 -0
- package/src/models/components/productpriceonetimecustom.ts +9 -9
- package/src/models/components/productpriceonetimecustomcreate.ts +36 -0
- package/src/models/components/productpriceonetimefixed.ts +9 -9
- package/src/models/components/productpriceonetimefixedcreate.ts +45 -9
- package/src/models/components/productpriceonetimefree.ts +164 -0
- package/src/models/components/productpriceonetimefreecreate.ts +121 -0
- package/src/models/components/productpricerecurringcustom.ts +9 -9
- package/src/models/components/productpricerecurringfixed.ts +9 -9
- package/src/models/components/productpricerecurringfixedcreate.ts +155 -0
- package/src/models/components/productpricerecurringfree.ts +179 -0
- package/src/models/components/productpricerecurringfreecreate.ts +136 -0
- package/src/models/components/productpricerecurringinput.ts +18 -0
- package/src/models/components/productpricerecurringoutput.ts +18 -0
- package/src/models/components/productrecurringcreate.ts +57 -48
- package/src/models/components/productupdate.ts +41 -22
- package/src/models/components/subscriptioninput.ts +8 -8
- package/src/models/components/subscriptionoutput.ts +8 -8
- package/src/models/components/subscriptionsortproperty.ts +0 -2
- package/src/models/components/userorderproduct.ts +0 -21
- package/src/models/components/userordersubscription.ts +4 -4
- package/src/models/components/usersubscription.ts +8 -8
- package/src/models/components/usersubscriptionproduct.ts +0 -21
- package/src/models/errors/index.ts +0 -2
- package/src/models/operations/productscreate.ts +6 -6
- package/src/models/operations/productslist.ts +0 -70
- package/src/models/operations/subscriptionslist.ts +0 -68
- package/src/sdk/oauth2.ts +1 -1
- package/src/sdk/polarsubscriptions.ts +0 -20
- package/src/sdk/sdk.ts +15 -15
- package/src/sdk/subscriptions.ts +0 -37
- package/src/sdk/users.ts +6 -6
- package/funcs/subscriptionsCreate.d.ts +0 -16
- package/funcs/subscriptionsCreate.d.ts.map +0 -1
- package/funcs/subscriptionsCreate.js +0 -96
- package/funcs/subscriptionsCreate.js.map +0 -1
- package/funcs/subscriptionsImportSubscriptions.d.ts +0 -16
- package/funcs/subscriptionsImportSubscriptions.d.ts.map +0 -1
- package/funcs/subscriptionsImportSubscriptions.js +0 -109
- package/funcs/subscriptionsImportSubscriptions.js.map +0 -1
- package/funcs/usersSubscriptionsCreate.d.ts +0 -18
- package/funcs/usersSubscriptionsCreate.d.ts.map +0 -1
- package/funcs/usersSubscriptionsCreate.js +0 -98
- package/funcs/usersSubscriptionsCreate.js.map +0 -1
- package/models/components/bodysubscriptionsimport.d.ts +0 -58
- package/models/components/bodysubscriptionsimport.d.ts.map +0 -1
- package/models/components/bodysubscriptionsimport.js +0 -94
- package/models/components/bodysubscriptionsimport.js.map +0 -1
- package/models/components/productpricerecurringcreate.d.ts +0 -67
- package/models/components/productpricerecurringcreate.d.ts.map +0 -1
- package/models/components/productpricerecurringcreate.js +0 -88
- package/models/components/productpricerecurringcreate.js.map +0 -1
- package/models/components/subscriptioncreateemail.d.ts +0 -36
- package/models/components/subscriptioncreateemail.d.ts.map +0 -1
- package/models/components/subscriptioncreateemail.js +0 -61
- package/models/components/subscriptioncreateemail.js.map +0 -1
- package/models/components/subscriptionsimported.d.ts +0 -28
- package/models/components/subscriptionsimported.d.ts.map +0 -1
- package/models/components/subscriptionsimported.js +0 -50
- package/models/components/subscriptionsimported.js.map +0 -1
- package/models/components/subscriptiontiertype.d.ts +0 -31
- package/models/components/subscriptiontiertype.d.ts.map +0 -1
- package/models/components/subscriptiontiertype.js +0 -51
- package/models/components/subscriptiontiertype.js.map +0 -1
- package/models/components/userfreesubscriptioncreate.d.ts +0 -33
- package/models/components/userfreesubscriptioncreate.d.ts.map +0 -1
- package/models/components/userfreesubscriptioncreate.js +0 -63
- package/models/components/userfreesubscriptioncreate.js.map +0 -1
- package/models/errors/alreadysubscribed.d.ts +0 -57
- package/models/errors/alreadysubscribed.d.ts.map +0 -1
- package/models/errors/alreadysubscribed.js +0 -88
- package/models/errors/alreadysubscribed.js.map +0 -1
- package/models/errors/freesubscriptionupgrade.d.ts +0 -57
- package/models/errors/freesubscriptionupgrade.d.ts.map +0 -1
- package/models/errors/freesubscriptionupgrade.js +0 -88
- package/models/errors/freesubscriptionupgrade.js.map +0 -1
- package/src/funcs/subscriptionsCreate.ts +0 -126
- package/src/funcs/subscriptionsImportSubscriptions.ts +0 -142
- package/src/funcs/usersSubscriptionsCreate.ts +0 -135
- package/src/models/components/bodysubscriptionsimport.ts +0 -116
- package/src/models/components/productpricerecurringcreate.ts +0 -116
- package/src/models/components/subscriptioncreateemail.ts +0 -67
- package/src/models/components/subscriptionsimported.ts +0 -48
- package/src/models/components/subscriptiontiertype.ts +0 -34
- package/src/models/components/userfreesubscriptioncreate.ts +0 -66
- package/src/models/errors/alreadysubscribed.ts +0 -102
- package/src/models/errors/freesubscriptionupgrade.ts +0 -106
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { PolarCore } from "../core.js";
|
|
7
|
-
import { encodeSimple
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
@@ -34,7 +34,7 @@ import { Result } from "../types/fp.js";
|
|
|
34
34
|
* > Users will lose access to the benefit.
|
|
35
35
|
*/
|
|
36
36
|
export async function benefitsDelete(
|
|
37
|
-
client
|
|
37
|
+
client: PolarCore,
|
|
38
38
|
request: operations.BenefitsDeleteRequest,
|
|
39
39
|
options?: RequestOptions,
|
|
40
40
|
): Promise<
|
|
@@ -52,59 +52,59 @@ export async function benefitsDelete(
|
|
|
52
52
|
| ConnectionError
|
|
53
53
|
>
|
|
54
54
|
> {
|
|
55
|
-
const input
|
|
55
|
+
const input = request;
|
|
56
56
|
|
|
57
|
-
const parsed
|
|
58
|
-
input
|
|
59
|
-
(value
|
|
57
|
+
const parsed = safeParse(
|
|
58
|
+
input,
|
|
59
|
+
(value) => operations.BenefitsDeleteRequest$outboundSchema.parse(value),
|
|
60
60
|
"Input validation failed",
|
|
61
61
|
);
|
|
62
|
-
if (!parsed
|
|
63
|
-
return parsed
|
|
62
|
+
if (!parsed.ok) {
|
|
63
|
+
return parsed;
|
|
64
64
|
}
|
|
65
|
-
const payload
|
|
66
|
-
const body
|
|
65
|
+
const payload = parsed.value;
|
|
66
|
+
const body = null;
|
|
67
67
|
|
|
68
|
-
const pathParams
|
|
69
|
-
id: encodeSimple
|
|
68
|
+
const pathParams = {
|
|
69
|
+
id: encodeSimple("id", payload.id, {
|
|
70
70
|
explode: false,
|
|
71
71
|
charEncoding: "percent",
|
|
72
72
|
}),
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
const path
|
|
75
|
+
const path = pathToFunc("/v1/benefits/{id}")(pathParams);
|
|
76
76
|
|
|
77
|
-
const headers
|
|
77
|
+
const headers = new Headers({
|
|
78
78
|
Accept: "application/json",
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
-
const
|
|
82
|
-
const
|
|
81
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
82
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
83
83
|
const context = {
|
|
84
84
|
operationID: "benefits:delete",
|
|
85
85
|
oAuth2Scopes: [],
|
|
86
|
-
securitySource: client
|
|
86
|
+
securitySource: client._options.accessToken,
|
|
87
87
|
};
|
|
88
|
-
const
|
|
88
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
89
89
|
|
|
90
|
-
const requestRes = client
|
|
91
|
-
security:
|
|
90
|
+
const requestRes = client._createRequest(context, {
|
|
91
|
+
security: requestSecurity,
|
|
92
92
|
method: "DELETE",
|
|
93
|
-
path: path
|
|
94
|
-
headers: headers
|
|
95
|
-
body: body
|
|
96
|
-
timeoutMs: options?.timeoutMs || client
|
|
93
|
+
path: path,
|
|
94
|
+
headers: headers,
|
|
95
|
+
body: body,
|
|
96
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
97
97
|
}, options);
|
|
98
98
|
if (!requestRes.ok) {
|
|
99
99
|
return requestRes;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const req = requestRes.value;
|
|
102
102
|
|
|
103
|
-
const doResult = await client
|
|
103
|
+
const doResult = await client._do(req, {
|
|
104
104
|
context,
|
|
105
105
|
errorCodes: ["403", "404", "422", "4XX", "5XX"],
|
|
106
106
|
retryConfig: options?.retries
|
|
107
|
-
|| client
|
|
107
|
+
|| client._options.retryConfig,
|
|
108
108
|
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
109
109
|
});
|
|
110
110
|
if (!doResult.ok) {
|
|
@@ -112,11 +112,11 @@ export async function benefitsDelete(
|
|
|
112
112
|
}
|
|
113
113
|
const response = doResult.value;
|
|
114
114
|
|
|
115
|
-
const responseFields
|
|
116
|
-
HttpMeta: { Response: response, Request:
|
|
115
|
+
const responseFields = {
|
|
116
|
+
HttpMeta: { Response: response, Request: req },
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
const [result
|
|
119
|
+
const [result] = await M.match<
|
|
120
120
|
void,
|
|
121
121
|
| errors.NotPermitted
|
|
122
122
|
| errors.ResourceNotFound
|
|
@@ -129,15 +129,15 @@ export async function benefitsDelete(
|
|
|
129
129
|
| RequestTimeoutError
|
|
130
130
|
| ConnectionError
|
|
131
131
|
>(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
)(response, { extraFields: responseFields
|
|
138
|
-
if (!result
|
|
139
|
-
return result
|
|
132
|
+
M.nil(204, z.void()),
|
|
133
|
+
M.jsonErr(403, errors.NotPermitted$inboundSchema),
|
|
134
|
+
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
135
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
136
|
+
M.fail(["4XX", "5XX"]),
|
|
137
|
+
)(response, { extraFields: responseFields });
|
|
138
|
+
if (!result.ok) {
|
|
139
|
+
return result;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
return result
|
|
142
|
+
return result;
|
|
143
143
|
}
|
package/src/funcs/benefitsGet.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { PolarCore } from "../core.js";
|
|
6
|
-
import { encodeSimple
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { safeParse } from "../lib/schemas.js";
|
|
9
9
|
import { RequestOptions } from "../lib/sdks.js";
|
|
10
10
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
11
|
import { pathToFunc } from "../lib/url.js";
|
|
@@ -29,7 +29,7 @@ import { Result } from "../types/fp.js";
|
|
|
29
29
|
* Get a benefit by ID.
|
|
30
30
|
*/
|
|
31
31
|
export async function benefitsGet(
|
|
32
|
-
client
|
|
32
|
+
client: PolarCore,
|
|
33
33
|
request: operations.BenefitsGetRequest,
|
|
34
34
|
options?: RequestOptions,
|
|
35
35
|
): Promise<
|
|
@@ -46,59 +46,59 @@ export async function benefitsGet(
|
|
|
46
46
|
| ConnectionError
|
|
47
47
|
>
|
|
48
48
|
> {
|
|
49
|
-
const input
|
|
49
|
+
const input = request;
|
|
50
50
|
|
|
51
|
-
const parsed
|
|
52
|
-
input
|
|
53
|
-
(value
|
|
51
|
+
const parsed = safeParse(
|
|
52
|
+
input,
|
|
53
|
+
(value) => operations.BenefitsGetRequest$outboundSchema.parse(value),
|
|
54
54
|
"Input validation failed",
|
|
55
55
|
);
|
|
56
|
-
if (!parsed
|
|
57
|
-
return parsed
|
|
56
|
+
if (!parsed.ok) {
|
|
57
|
+
return parsed;
|
|
58
58
|
}
|
|
59
|
-
const payload
|
|
60
|
-
const body
|
|
59
|
+
const payload = parsed.value;
|
|
60
|
+
const body = null;
|
|
61
61
|
|
|
62
|
-
const pathParams
|
|
63
|
-
id: encodeSimple
|
|
62
|
+
const pathParams = {
|
|
63
|
+
id: encodeSimple("id", payload.id, {
|
|
64
64
|
explode: false,
|
|
65
65
|
charEncoding: "percent",
|
|
66
66
|
}),
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
const path
|
|
69
|
+
const path = pathToFunc("/v1/benefits/{id}")(pathParams);
|
|
70
70
|
|
|
71
|
-
const headers
|
|
71
|
+
const headers = new Headers({
|
|
72
72
|
Accept: "application/json",
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
const
|
|
76
|
-
const
|
|
75
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
76
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
77
77
|
const context = {
|
|
78
78
|
operationID: "benefits:get",
|
|
79
79
|
oAuth2Scopes: [],
|
|
80
|
-
securitySource: client
|
|
80
|
+
securitySource: client._options.accessToken,
|
|
81
81
|
};
|
|
82
|
-
const
|
|
82
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
83
83
|
|
|
84
|
-
const requestRes = client
|
|
85
|
-
security:
|
|
84
|
+
const requestRes = client._createRequest(context, {
|
|
85
|
+
security: requestSecurity,
|
|
86
86
|
method: "GET",
|
|
87
|
-
path: path
|
|
88
|
-
headers: headers
|
|
89
|
-
body: body
|
|
90
|
-
timeoutMs: options?.timeoutMs || client
|
|
87
|
+
path: path,
|
|
88
|
+
headers: headers,
|
|
89
|
+
body: body,
|
|
90
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
91
91
|
}, options);
|
|
92
92
|
if (!requestRes.ok) {
|
|
93
93
|
return requestRes;
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const req = requestRes.value;
|
|
96
96
|
|
|
97
|
-
const doResult = await client
|
|
97
|
+
const doResult = await client._do(req, {
|
|
98
98
|
context,
|
|
99
99
|
errorCodes: ["404", "422", "4XX", "5XX"],
|
|
100
100
|
retryConfig: options?.retries
|
|
101
|
-
|| client
|
|
101
|
+
|| client._options.retryConfig,
|
|
102
102
|
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
103
103
|
});
|
|
104
104
|
if (!doResult.ok) {
|
|
@@ -106,11 +106,11 @@ export async function benefitsGet(
|
|
|
106
106
|
}
|
|
107
107
|
const response = doResult.value;
|
|
108
108
|
|
|
109
|
-
const responseFields
|
|
110
|
-
HttpMeta: { Response: response, Request:
|
|
109
|
+
const responseFields = {
|
|
110
|
+
HttpMeta: { Response: response, Request: req },
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
const [result
|
|
113
|
+
const [result] = await M.match<
|
|
114
114
|
operations.BenefitsGetResponseBenefitsGet,
|
|
115
115
|
| errors.ResourceNotFound
|
|
116
116
|
| errors.HTTPValidationError
|
|
@@ -122,14 +122,14 @@ export async function benefitsGet(
|
|
|
122
122
|
| RequestTimeoutError
|
|
123
123
|
| ConnectionError
|
|
124
124
|
>(
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
)(response, { extraFields: responseFields
|
|
130
|
-
if (!result
|
|
131
|
-
return result
|
|
125
|
+
M.json(200, operations.BenefitsGetResponseBenefitsGet$inboundSchema),
|
|
126
|
+
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
127
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
128
|
+
M.fail(["4XX", "5XX"]),
|
|
129
|
+
)(response, { extraFields: responseFields });
|
|
130
|
+
if (!result.ok) {
|
|
131
|
+
return result;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
return result
|
|
134
|
+
return result;
|
|
135
135
|
}
|
|
@@ -4,12 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { PolarCore } from "../core.js";
|
|
6
6
|
import { dlv } from "../lib/dlv.js";
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from "../lib/encodings.js";
|
|
11
|
-
import * as m$ from "../lib/matchers.js";
|
|
12
|
-
import * as schemas$ from "../lib/schemas.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
13
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
14
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
15
12
|
import { pathToFunc } from "../lib/url.js";
|
|
@@ -41,7 +38,7 @@ import {
|
|
|
41
38
|
* It's especially useful to check if a user has been granted a benefit.
|
|
42
39
|
*/
|
|
43
40
|
export async function benefitsGrants(
|
|
44
|
-
client
|
|
41
|
+
client: PolarCore,
|
|
45
42
|
request: operations.BenefitsGrantsRequest,
|
|
46
43
|
options?: RequestOptions,
|
|
47
44
|
): Promise<
|
|
@@ -60,68 +57,68 @@ export async function benefitsGrants(
|
|
|
60
57
|
>
|
|
61
58
|
>
|
|
62
59
|
> {
|
|
63
|
-
const input
|
|
60
|
+
const input = request;
|
|
64
61
|
|
|
65
|
-
const parsed
|
|
66
|
-
input
|
|
67
|
-
(value
|
|
62
|
+
const parsed = safeParse(
|
|
63
|
+
input,
|
|
64
|
+
(value) => operations.BenefitsGrantsRequest$outboundSchema.parse(value),
|
|
68
65
|
"Input validation failed",
|
|
69
66
|
);
|
|
70
|
-
if (!parsed
|
|
71
|
-
return haltIterator(parsed
|
|
67
|
+
if (!parsed.ok) {
|
|
68
|
+
return haltIterator(parsed);
|
|
72
69
|
}
|
|
73
|
-
const payload
|
|
74
|
-
const body
|
|
70
|
+
const payload = parsed.value;
|
|
71
|
+
const body = null;
|
|
75
72
|
|
|
76
|
-
const pathParams
|
|
77
|
-
id: encodeSimple
|
|
73
|
+
const pathParams = {
|
|
74
|
+
id: encodeSimple("id", payload.id, {
|
|
78
75
|
explode: false,
|
|
79
76
|
charEncoding: "percent",
|
|
80
77
|
}),
|
|
81
78
|
};
|
|
82
79
|
|
|
83
|
-
const path
|
|
80
|
+
const path = pathToFunc("/v1/benefits/{id}/grants")(pathParams);
|
|
84
81
|
|
|
85
|
-
const query
|
|
86
|
-
"github_user_id": payload
|
|
87
|
-
"is_granted": payload
|
|
88
|
-
"limit": payload
|
|
89
|
-
"page": payload
|
|
90
|
-
"user_id": payload
|
|
82
|
+
const query = encodeFormQuery({
|
|
83
|
+
"github_user_id": payload.github_user_id,
|
|
84
|
+
"is_granted": payload.is_granted,
|
|
85
|
+
"limit": payload.limit,
|
|
86
|
+
"page": payload.page,
|
|
87
|
+
"user_id": payload.user_id,
|
|
91
88
|
});
|
|
92
89
|
|
|
93
|
-
const headers
|
|
90
|
+
const headers = new Headers({
|
|
94
91
|
Accept: "application/json",
|
|
95
92
|
});
|
|
96
93
|
|
|
97
|
-
const
|
|
98
|
-
const
|
|
94
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
95
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
99
96
|
const context = {
|
|
100
97
|
operationID: "benefits:grants",
|
|
101
98
|
oAuth2Scopes: [],
|
|
102
|
-
securitySource: client
|
|
99
|
+
securitySource: client._options.accessToken,
|
|
103
100
|
};
|
|
104
|
-
const
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
102
|
|
|
106
|
-
const requestRes = client
|
|
107
|
-
security:
|
|
103
|
+
const requestRes = client._createRequest(context, {
|
|
104
|
+
security: requestSecurity,
|
|
108
105
|
method: "GET",
|
|
109
|
-
path: path
|
|
110
|
-
headers: headers
|
|
111
|
-
query: query
|
|
112
|
-
body: body
|
|
113
|
-
timeoutMs: options?.timeoutMs || client
|
|
106
|
+
path: path,
|
|
107
|
+
headers: headers,
|
|
108
|
+
query: query,
|
|
109
|
+
body: body,
|
|
110
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
114
111
|
}, options);
|
|
115
112
|
if (!requestRes.ok) {
|
|
116
113
|
return haltIterator(requestRes);
|
|
117
114
|
}
|
|
118
|
-
const
|
|
115
|
+
const req = requestRes.value;
|
|
119
116
|
|
|
120
|
-
const doResult = await client
|
|
117
|
+
const doResult = await client._do(req, {
|
|
121
118
|
context,
|
|
122
119
|
errorCodes: ["404", "422", "4XX", "5XX"],
|
|
123
120
|
retryConfig: options?.retries
|
|
124
|
-
|| client
|
|
121
|
+
|| client._options.retryConfig,
|
|
125
122
|
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
126
123
|
});
|
|
127
124
|
if (!doResult.ok) {
|
|
@@ -129,11 +126,11 @@ export async function benefitsGrants(
|
|
|
129
126
|
}
|
|
130
127
|
const response = doResult.value;
|
|
131
128
|
|
|
132
|
-
const responseFields
|
|
133
|
-
HttpMeta: { Response: response, Request:
|
|
129
|
+
const responseFields = {
|
|
130
|
+
HttpMeta: { Response: response, Request: req },
|
|
134
131
|
};
|
|
135
132
|
|
|
136
|
-
const [result
|
|
133
|
+
const [result, raw] = await M.match<
|
|
137
134
|
operations.BenefitsGrantsResponse,
|
|
138
135
|
| errors.ResourceNotFound
|
|
139
136
|
| errors.HTTPValidationError
|
|
@@ -145,15 +142,15 @@ export async function benefitsGrants(
|
|
|
145
142
|
| RequestTimeoutError
|
|
146
143
|
| ConnectionError
|
|
147
144
|
>(
|
|
148
|
-
|
|
145
|
+
M.json(200, operations.BenefitsGrantsResponse$inboundSchema, {
|
|
149
146
|
key: "Result",
|
|
150
147
|
}),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
)(response, { extraFields: responseFields
|
|
155
|
-
if (!result
|
|
156
|
-
return haltIterator(result
|
|
148
|
+
M.jsonErr(404, errors.ResourceNotFound$inboundSchema),
|
|
149
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
150
|
+
M.fail(["4XX", "5XX"]),
|
|
151
|
+
)(response, { extraFields: responseFields });
|
|
152
|
+
if (!result.ok) {
|
|
153
|
+
return haltIterator(result);
|
|
157
154
|
}
|
|
158
155
|
|
|
159
156
|
const nextFunc = (
|
|
@@ -172,7 +169,7 @@ export async function benefitsGrants(
|
|
|
172
169
|
| ConnectionError
|
|
173
170
|
>
|
|
174
171
|
> => {
|
|
175
|
-
const page = input
|
|
172
|
+
const page = input?.page || 0;
|
|
176
173
|
const nextPage = page + 1;
|
|
177
174
|
const numPages = dlv(responseData, "pagination.max_page");
|
|
178
175
|
if (numPages == null || numPages <= page) {
|
|
@@ -186,22 +183,22 @@ export async function benefitsGrants(
|
|
|
186
183
|
if (!Array.isArray(results) || !results.length) {
|
|
187
184
|
return () => null;
|
|
188
185
|
}
|
|
189
|
-
const limit = input
|
|
186
|
+
const limit = input?.limit || 0;
|
|
190
187
|
if (results.length < limit) {
|
|
191
188
|
return () => null;
|
|
192
189
|
}
|
|
193
190
|
|
|
194
191
|
return () =>
|
|
195
192
|
benefitsGrants(
|
|
196
|
-
client
|
|
193
|
+
client,
|
|
197
194
|
{
|
|
198
|
-
...input
|
|
195
|
+
...input,
|
|
199
196
|
page: nextPage,
|
|
200
197
|
},
|
|
201
198
|
options,
|
|
202
199
|
);
|
|
203
200
|
};
|
|
204
201
|
|
|
205
|
-
const page
|
|
206
|
-
return { ...page
|
|
202
|
+
const page = { ...result, next: nextFunc(raw) };
|
|
203
|
+
return { ...page, ...createPageIterator(page, (v) => !v.ok) };
|
|
207
204
|
}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { PolarCore } from "../core.js";
|
|
6
6
|
import { dlv } from "../lib/dlv.js";
|
|
7
|
-
import { encodeFormQuery
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
7
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
10
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
11
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
12
|
import { pathToFunc } from "../lib/url.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
* List benefits.
|
|
37
37
|
*/
|
|
38
38
|
export async function benefitsList(
|
|
39
|
-
client
|
|
39
|
+
client: PolarCore,
|
|
40
40
|
request: operations.BenefitsListRequest,
|
|
41
41
|
options?: RequestOptions,
|
|
42
42
|
): Promise<
|
|
@@ -54,60 +54,60 @@ export async function benefitsList(
|
|
|
54
54
|
>
|
|
55
55
|
>
|
|
56
56
|
> {
|
|
57
|
-
const input
|
|
57
|
+
const input = request;
|
|
58
58
|
|
|
59
|
-
const parsed
|
|
60
|
-
input
|
|
61
|
-
(value
|
|
59
|
+
const parsed = safeParse(
|
|
60
|
+
input,
|
|
61
|
+
(value) => operations.BenefitsListRequest$outboundSchema.parse(value),
|
|
62
62
|
"Input validation failed",
|
|
63
63
|
);
|
|
64
|
-
if (!parsed
|
|
65
|
-
return haltIterator(parsed
|
|
64
|
+
if (!parsed.ok) {
|
|
65
|
+
return haltIterator(parsed);
|
|
66
66
|
}
|
|
67
|
-
const payload
|
|
68
|
-
const body
|
|
67
|
+
const payload = parsed.value;
|
|
68
|
+
const body = null;
|
|
69
69
|
|
|
70
|
-
const path
|
|
70
|
+
const path = pathToFunc("/v1/benefits/")();
|
|
71
71
|
|
|
72
|
-
const query
|
|
73
|
-
"limit": payload
|
|
74
|
-
"organization_id": payload
|
|
75
|
-
"page": payload
|
|
76
|
-
"type": payload
|
|
72
|
+
const query = encodeFormQuery({
|
|
73
|
+
"limit": payload.limit,
|
|
74
|
+
"organization_id": payload.organization_id,
|
|
75
|
+
"page": payload.page,
|
|
76
|
+
"type": payload.type_filter,
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
const headers
|
|
79
|
+
const headers = new Headers({
|
|
80
80
|
Accept: "application/json",
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
const
|
|
84
|
-
const
|
|
83
|
+
const secConfig = await extractSecurity(client._options.accessToken);
|
|
84
|
+
const securityInput = secConfig == null ? {} : { accessToken: secConfig };
|
|
85
85
|
const context = {
|
|
86
86
|
operationID: "benefits:list",
|
|
87
87
|
oAuth2Scopes: [],
|
|
88
|
-
securitySource: client
|
|
88
|
+
securitySource: client._options.accessToken,
|
|
89
89
|
};
|
|
90
|
-
const
|
|
90
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
91
91
|
|
|
92
|
-
const requestRes = client
|
|
93
|
-
security:
|
|
92
|
+
const requestRes = client._createRequest(context, {
|
|
93
|
+
security: requestSecurity,
|
|
94
94
|
method: "GET",
|
|
95
|
-
path: path
|
|
96
|
-
headers: headers
|
|
97
|
-
query: query
|
|
98
|
-
body: body
|
|
99
|
-
timeoutMs: options?.timeoutMs || client
|
|
95
|
+
path: path,
|
|
96
|
+
headers: headers,
|
|
97
|
+
query: query,
|
|
98
|
+
body: body,
|
|
99
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
100
100
|
}, options);
|
|
101
101
|
if (!requestRes.ok) {
|
|
102
102
|
return haltIterator(requestRes);
|
|
103
103
|
}
|
|
104
|
-
const
|
|
104
|
+
const req = requestRes.value;
|
|
105
105
|
|
|
106
|
-
const doResult = await client
|
|
106
|
+
const doResult = await client._do(req, {
|
|
107
107
|
context,
|
|
108
108
|
errorCodes: ["422", "4XX", "5XX"],
|
|
109
109
|
retryConfig: options?.retries
|
|
110
|
-
|| client
|
|
110
|
+
|| client._options.retryConfig,
|
|
111
111
|
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
112
112
|
});
|
|
113
113
|
if (!doResult.ok) {
|
|
@@ -115,11 +115,11 @@ export async function benefitsList(
|
|
|
115
115
|
}
|
|
116
116
|
const response = doResult.value;
|
|
117
117
|
|
|
118
|
-
const responseFields
|
|
119
|
-
HttpMeta: { Response: response, Request:
|
|
118
|
+
const responseFields = {
|
|
119
|
+
HttpMeta: { Response: response, Request: req },
|
|
120
120
|
};
|
|
121
121
|
|
|
122
|
-
const [result
|
|
122
|
+
const [result, raw] = await M.match<
|
|
123
123
|
operations.BenefitsListResponse,
|
|
124
124
|
| errors.HTTPValidationError
|
|
125
125
|
| SDKError
|
|
@@ -130,14 +130,14 @@ export async function benefitsList(
|
|
|
130
130
|
| RequestTimeoutError
|
|
131
131
|
| ConnectionError
|
|
132
132
|
>(
|
|
133
|
-
|
|
133
|
+
M.json(200, operations.BenefitsListResponse$inboundSchema, {
|
|
134
134
|
key: "Result",
|
|
135
135
|
}),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
)(response, { extraFields: responseFields
|
|
139
|
-
if (!result
|
|
140
|
-
return haltIterator(result
|
|
136
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
137
|
+
M.fail(["4XX", "5XX"]),
|
|
138
|
+
)(response, { extraFields: responseFields });
|
|
139
|
+
if (!result.ok) {
|
|
140
|
+
return haltIterator(result);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
const nextFunc = (
|
|
@@ -155,7 +155,7 @@ export async function benefitsList(
|
|
|
155
155
|
| ConnectionError
|
|
156
156
|
>
|
|
157
157
|
> => {
|
|
158
|
-
const page = input
|
|
158
|
+
const page = input?.page || 0;
|
|
159
159
|
const nextPage = page + 1;
|
|
160
160
|
const numPages = dlv(responseData, "pagination.max_page");
|
|
161
161
|
if (numPages == null || numPages <= page) {
|
|
@@ -169,22 +169,22 @@ export async function benefitsList(
|
|
|
169
169
|
if (!Array.isArray(results) || !results.length) {
|
|
170
170
|
return () => null;
|
|
171
171
|
}
|
|
172
|
-
const limit = input
|
|
172
|
+
const limit = input?.limit || 0;
|
|
173
173
|
if (results.length < limit) {
|
|
174
174
|
return () => null;
|
|
175
175
|
}
|
|
176
176
|
|
|
177
177
|
return () =>
|
|
178
178
|
benefitsList(
|
|
179
|
-
client
|
|
179
|
+
client,
|
|
180
180
|
{
|
|
181
|
-
...input
|
|
181
|
+
...input,
|
|
182
182
|
page: nextPage,
|
|
183
183
|
},
|
|
184
184
|
options,
|
|
185
185
|
);
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
-
const page
|
|
189
|
-
return { ...page
|
|
188
|
+
const page = { ...result, next: nextFunc(raw) };
|
|
189
|
+
return { ...page, ...createPageIterator(page, (v) => !v.ok) };
|
|
190
190
|
}
|