vayu-ts 0.2.15 → 0.3.7
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/dist/example/index.d.ts +1 -0
- package/dist/example/index.js +74 -0
- package/dist/openapi/apis/AuthApi.js +8 -4
- package/dist/openapi/apis/CatalogProductsApi.d.ts +89 -0
- package/dist/openapi/apis/CatalogProductsApi.js +377 -0
- package/dist/openapi/apis/CloudUsageSubmissionApi.d.ts +25 -0
- package/dist/openapi/apis/CloudUsageSubmissionApi.js +89 -0
- package/dist/openapi/apis/ContractsApi.d.ts +21 -3
- package/dist/openapi/apis/ContractsApi.js +119 -21
- package/dist/openapi/apis/CreditsApi.js +24 -12
- package/dist/openapi/apis/CustomFieldsApi.d.ts +89 -0
- package/dist/openapi/apis/CustomFieldsApi.js +377 -0
- package/dist/openapi/apis/CustomersApi.d.ts +63 -0
- package/dist/openapi/apis/CustomersApi.js +360 -38
- package/dist/openapi/apis/EventsApi.d.ts +132 -1
- package/dist/openapi/apis/EventsApi.js +660 -25
- package/dist/openapi/apis/InvoicesApi.d.ts +19 -3
- package/dist/openapi/apis/InvoicesApi.js +91 -12
- package/dist/openapi/apis/MeasurementsApi.js +36 -18
- package/dist/openapi/apis/MetersApi.js +38 -19
- package/dist/openapi/apis/PlansApi.d.ts +56 -0
- package/dist/openapi/apis/PlansApi.js +225 -0
- package/dist/openapi/apis/ProductConsumptionsApi.js +10 -5
- package/dist/openapi/apis/WebhooksApi.js +10 -5
- package/dist/openapi/http/http.d.ts +6 -18
- package/dist/openapi/http/http.js +25 -13
- package/dist/openapi/http/isomorphic-fetch.d.ts +1 -0
- package/dist/openapi/http/isomorphic-fetch.js +4 -7
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +5 -1
- package/dist/openapi/models/Address.d.ts +5 -5
- package/dist/openapi/models/BillingInterval.d.ts +18 -0
- package/dist/openapi/models/BillingInterval.js +22 -0
- package/dist/openapi/models/CloudUsageResult.d.ts +83 -0
- package/dist/openapi/models/CloudUsageResult.js +103 -0
- package/dist/openapi/models/ConflictErrorResponse.d.ts +42 -0
- package/dist/openapi/models/ConflictErrorResponse.js +52 -0
- package/dist/openapi/models/Contact.d.ts +3 -1
- package/dist/openapi/models/Contact.js +13 -1
- package/dist/openapi/models/ContractStatus.d.ts +23 -0
- package/dist/openapi/models/ContractStatus.js +27 -0
- package/dist/openapi/models/CreateCatalogProductRequest.d.ts +42 -0
- package/dist/openapi/models/CreateCatalogProductRequest.js +44 -0
- package/dist/openapi/models/CreateCatalogProductResponse.d.ts +32 -0
- package/dist/openapi/models/CreateCatalogProductResponse.js +32 -0
- package/dist/openapi/models/CreateCatalogProductResponseCatalogProduct.d.ts +45 -0
- package/dist/openapi/models/CreateCatalogProductResponseCatalogProduct.js +62 -0
- package/dist/openapi/models/CreateContractRequest.d.ts +53 -5
- package/dist/openapi/models/CreateContractRequest.js +76 -4
- package/dist/openapi/models/CreateCustomFieldRequest.d.ts +71 -0
- package/dist/openapi/models/CreateCustomFieldRequest.js +90 -0
- package/dist/openapi/models/CreateCustomFieldResponse.d.ts +32 -0
- package/dist/openapi/models/CreateCustomFieldResponse.js +32 -0
- package/dist/openapi/models/CreateCustomFieldResponseCustomField.d.ts +74 -0
- package/dist/openapi/models/CreateCustomFieldResponseCustomField.js +108 -0
- package/dist/openapi/models/CreateCustomerRelationRequest.d.ts +38 -0
- package/dist/openapi/models/CreateCustomerRelationRequest.js +38 -0
- package/dist/openapi/models/CreateCustomerRelationResponse.d.ts +32 -0
- package/dist/openapi/models/CreateCustomerRelationResponse.js +32 -0
- package/dist/openapi/models/CreateCustomerRelationResponseCustomerRelation.d.ts +41 -0
- package/dist/openapi/models/CreateCustomerRelationResponseCustomerRelation.js +56 -0
- package/dist/openapi/models/CreateCustomerRequest.d.ts +70 -2
- package/dist/openapi/models/CreateCustomerRequest.js +112 -6
- package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +70 -2
- package/dist/openapi/models/CreateCustomerResponseCustomer.js +112 -6
- package/dist/openapi/models/CreditLedgerEntry.d.ts +3 -1
- package/dist/openapi/models/CreditLedgerEntry.js +8 -2
- package/dist/openapi/models/Currency.d.ts +24 -0
- package/dist/openapi/models/Currency.js +28 -0
- package/dist/openapi/models/CustomField.d.ts +65 -0
- package/dist/openapi/models/CustomField.js +78 -0
- package/dist/openapi/models/CustomFieldEntities.d.ts +20 -0
- package/dist/openapi/models/CustomFieldEntities.js +24 -0
- package/dist/openapi/models/CustomFieldValue.d.ts +33 -0
- package/dist/openapi/models/CustomFieldValue.js +44 -0
- package/dist/openapi/models/CustomFieldValueTypes.d.ts +20 -0
- package/dist/openapi/models/CustomFieldValueTypes.js +24 -0
- package/dist/openapi/models/CustomerCloudProviderSettings.d.ts +39 -0
- package/dist/openapi/models/CustomerCloudProviderSettings.js +51 -0
- package/dist/openapi/models/CustomerSource.d.ts +21 -0
- package/dist/openapi/models/CustomerSource.js +25 -0
- package/dist/openapi/models/DeleteCatalogProductResponse.d.ts +32 -0
- package/dist/openapi/models/DeleteCatalogProductResponse.js +32 -0
- package/dist/openapi/models/DeleteCatalogProductResponseCatalogProduct.d.ts +46 -0
- package/dist/openapi/models/DeleteCatalogProductResponseCatalogProduct.js +68 -0
- package/dist/openapi/models/DeleteContractResponseContract.d.ts +53 -5
- package/dist/openapi/models/DeleteContractResponseContract.js +76 -4
- package/dist/openapi/models/DeleteCustomFieldResponse.d.ts +32 -0
- package/dist/openapi/models/DeleteCustomFieldResponse.js +32 -0
- package/dist/openapi/models/DeleteCustomFieldResponseCustomField.d.ts +75 -0
- package/dist/openapi/models/DeleteCustomFieldResponseCustomField.js +114 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +70 -2
- package/dist/openapi/models/DeleteCustomerResponseCustomer.js +112 -6
- package/dist/openapi/models/DeleteEventsByRefsRequest.d.ts +31 -0
- package/dist/openapi/models/DeleteEventsByRefsRequest.js +32 -0
- package/dist/openapi/models/DeleteEventsByRefsResponse.d.ts +35 -0
- package/dist/openapi/models/DeleteEventsByRefsResponse.js +32 -0
- package/dist/openapi/models/DeleteEventsByRefsResponseEventsInner.d.ts +56 -0
- package/dist/openapi/models/DeleteEventsByRefsResponseEventsInner.js +80 -0
- package/dist/openapi/models/DeletePlanResponse.d.ts +32 -0
- package/dist/openapi/models/DeletePlanResponse.js +32 -0
- package/dist/openapi/models/DeletePlanResponsePlan.d.ts +42 -0
- package/dist/openapi/models/DeletePlanResponsePlan.js +68 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +1 -1
- package/dist/openapi/models/ExternalOverageStrategy.d.ts +20 -0
- package/dist/openapi/models/ExternalOverageStrategy.js +24 -0
- package/dist/openapi/models/GetCatalogProductResponse.d.ts +32 -0
- package/dist/openapi/models/GetCatalogProductResponse.js +32 -0
- package/dist/openapi/models/GetContractByIntegrationIdResponse.d.ts +32 -0
- package/dist/openapi/models/GetContractByIntegrationIdResponse.js +32 -0
- package/dist/openapi/models/GetContractResponseContract.d.ts +53 -5
- package/dist/openapi/models/GetContractResponseContract.js +76 -4
- package/dist/openapi/models/GetCustomFieldResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomFieldResponse.js +32 -0
- package/dist/openapi/models/GetCustomerByIntegrationIdResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomerByIntegrationIdResponse.js +32 -0
- package/dist/openapi/models/GetCustomerByNameResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomerByNameResponse.js +32 -0
- package/dist/openapi/models/GetCustomerByNameResponseCustomer.d.ts +123 -0
- package/dist/openapi/models/GetCustomerByNameResponseCustomer.js +183 -0
- package/dist/openapi/models/GetCustomerRelationResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomerRelationResponse.js +32 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +14 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.js +30 -0
- package/dist/openapi/models/GetInvoiceResponseInvoiceRevenueBreakdown.d.ts +39 -0
- package/dist/openapi/models/GetInvoiceResponseInvoiceRevenueBreakdown.js +65 -0
- package/dist/openapi/models/GetPlanResponse.d.ts +32 -0
- package/dist/openapi/models/GetPlanResponse.js +32 -0
- package/dist/openapi/models/GetPlanResponsePlan.d.ts +41 -0
- package/dist/openapi/models/GetPlanResponsePlan.js +62 -0
- package/dist/openapi/models/IntegrationEntity.d.ts +42 -0
- package/dist/openapi/models/IntegrationEntity.js +62 -0
- package/dist/openapi/models/IntegrationEntityTypes.d.ts +23 -0
- package/dist/openapi/models/IntegrationEntityTypes.js +27 -0
- package/dist/openapi/models/IntegrationProviders.d.ts +26 -0
- package/dist/openapi/models/IntegrationProviders.js +30 -0
- package/dist/openapi/models/IntegrationType.d.ts +26 -0
- package/dist/openapi/models/IntegrationType.js +30 -0
- package/dist/openapi/models/InternalServerErrorResponse.d.ts +42 -0
- package/dist/openapi/models/InternalServerErrorResponse.js +52 -0
- package/dist/openapi/models/InvoiceBillingStatus.d.ts +21 -0
- package/dist/openapi/models/InvoiceBillingStatus.js +25 -0
- package/dist/openapi/models/InvoicePaymentStatusResponse.d.ts +39 -0
- package/dist/openapi/models/InvoicePaymentStatusResponse.js +74 -0
- package/dist/openapi/models/ListCatalogProductsResponse.d.ts +35 -0
- package/dist/openapi/models/ListCatalogProductsResponse.js +50 -0
- package/dist/openapi/models/ListCustomFieldsResponse.d.ts +35 -0
- package/dist/openapi/models/ListCustomFieldsResponse.js +50 -0
- package/dist/openapi/models/ListPlansResponse.d.ts +35 -0
- package/dist/openapi/models/ListPlansResponse.js +50 -0
- package/dist/openapi/models/NotFoundErrorResponse.d.ts +42 -0
- package/dist/openapi/models/NotFoundErrorResponse.js +52 -0
- package/dist/openapi/models/NotificationEventType.d.ts +7 -1
- package/dist/openapi/models/NotificationEventType.js +6 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +112 -0
- package/dist/openapi/models/ObjectSerializer.js +367 -0
- package/dist/openapi/models/PartnerSubmissionDetail.d.ts +46 -0
- package/dist/openapi/models/PartnerSubmissionDetail.js +49 -0
- package/dist/openapi/models/PaymentInfo.d.ts +45 -0
- package/dist/openapi/models/PaymentInfo.js +89 -0
- package/dist/openapi/models/PaymentInfoDepositTo.d.ts +32 -0
- package/dist/openapi/models/PaymentInfoDepositTo.js +38 -0
- package/dist/openapi/models/PaymentTerm.d.ts +18 -0
- package/dist/openapi/models/PaymentTerm.js +22 -0
- package/dist/openapi/models/PlanBillingData.d.ts +41 -0
- package/dist/openapi/models/PlanBillingData.js +59 -0
- package/dist/openapi/models/PlanDuration.d.ts +30 -0
- package/dist/openapi/models/PlanDuration.js +25 -0
- package/dist/openapi/models/PlanStatus.d.ts +19 -0
- package/dist/openapi/models/PlanStatus.js +23 -0
- package/dist/openapi/models/ProductCloudProviderSettings.d.ts +39 -0
- package/dist/openapi/models/ProductCloudProviderSettings.js +51 -0
- package/dist/openapi/models/ProductGroup.d.ts +65 -0
- package/dist/openapi/models/ProductGroup.js +80 -0
- package/dist/openapi/models/ProductGroupCommitment.d.ts +53 -0
- package/dist/openapi/models/ProductGroupCommitment.js +64 -0
- package/dist/openapi/models/ProductGroupProductsInner.d.ts +68 -0
- package/dist/openapi/models/ProductGroupProductsInner.js +98 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitment.d.ts +53 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitment.js +64 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.d.ts +39 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitmentScheduling.js +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.d.ts +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerCommitmentSchedulingDuration.js +48 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricing.d.ts +38 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricing.js +24 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.d.ts +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf.js +54 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.d.ts +39 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1.js +54 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1InstallmentsInner.d.ts +32 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf1InstallmentsInner.js +38 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.d.ts +39 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2.js +54 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2SubscriptionCadence.d.ts +38 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf2SubscriptionCadence.js +45 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3.d.ts +46 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3.js +78 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3SubscriptionCadence.d.ts +38 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3SubscriptionCadence.js +45 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3TiersInner.d.ts +35 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf3TiersInner.js +56 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf4.d.ts +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf4.js +60 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.d.ts +42 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf5.js +48 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.d.ts +42 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOf6.js +48 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.d.ts +53 -0
- package/dist/openapi/models/ProductGroupProductsInnerPricingOneOfDiscount.js +58 -0
- package/dist/openapi/models/ProductGroupProductsInnerScheduling.d.ts +39 -0
- package/dist/openapi/models/ProductGroupProductsInnerScheduling.js +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerSchedulingDuration.d.ts +41 -0
- package/dist/openapi/models/ProductGroupProductsInnerSchedulingDuration.js +48 -0
- package/dist/openapi/models/QueryEventsResponse.d.ts +3 -3
- package/dist/openapi/models/QueryEventsResponse.js +18 -0
- package/dist/openapi/models/RateLimitErrorResponse.d.ts +42 -0
- package/dist/openapi/models/RateLimitErrorResponse.js +52 -0
- package/dist/openapi/models/RequestTooLongErrorResponse.d.ts +42 -0
- package/dist/openapi/models/RequestTooLongErrorResponse.js +52 -0
- package/dist/openapi/models/SubmitCloudUsageRequest.d.ts +39 -0
- package/dist/openapi/models/SubmitCloudUsageRequest.js +38 -0
- package/dist/openapi/models/SyncStatus.d.ts +16 -0
- package/dist/openapi/models/SyncStatus.js +20 -0
- package/dist/openapi/models/UnauthorizedErrorResponse.d.ts +42 -0
- package/dist/openapi/models/UnauthorizedErrorResponse.js +52 -0
- package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
- package/dist/openapi/models/UnlimitedDuration.js +18 -0
- package/dist/openapi/models/UpdateCatalogProductRequest.d.ts +42 -0
- package/dist/openapi/models/UpdateCatalogProductRequest.js +44 -0
- package/dist/openapi/models/UpdateCatalogProductResponse.d.ts +32 -0
- package/dist/openapi/models/UpdateCatalogProductResponse.js +32 -0
- package/dist/openapi/models/UpdateCustomFieldRequest.d.ts +71 -0
- package/dist/openapi/models/UpdateCustomFieldRequest.js +90 -0
- package/dist/openapi/models/UpdateCustomFieldResponse.d.ts +32 -0
- package/dist/openapi/models/UpdateCustomFieldResponse.js +32 -0
- package/dist/openapi/models/UpdateCustomerRequest.d.ts +70 -2
- package/dist/openapi/models/UpdateCustomerRequest.js +112 -6
- package/dist/openapi/models/UsageWindow.d.ts +41 -0
- package/dist/openapi/models/UsageWindow.js +41 -0
- package/dist/openapi/models/V2DeleteEventResponse.d.ts +32 -0
- package/dist/openapi/models/V2DeleteEventResponse.js +32 -0
- package/dist/openapi/models/V2DeleteEventsByRefsRequest.d.ts +31 -0
- package/dist/openapi/models/V2DeleteEventsByRefsRequest.js +32 -0
- package/dist/openapi/models/V2DeleteEventsByRefsResponse.d.ts +35 -0
- package/dist/openapi/models/V2DeleteEventsByRefsResponse.js +32 -0
- package/dist/openapi/models/V2EventsDryRunRequest.d.ts +32 -0
- package/dist/openapi/models/V2EventsDryRunRequest.js +32 -0
- package/dist/openapi/models/V2EventsDryRunResponse.d.ts +32 -0
- package/dist/openapi/models/V2EventsDryRunResponse.js +32 -0
- package/dist/openapi/models/V2GetEventResponse.d.ts +32 -0
- package/dist/openapi/models/V2GetEventResponse.js +32 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequest.d.ts +45 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequest.js +70 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.d.ts +39 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInner.js +62 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.d.ts +35 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregation.js +44 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.d.ts +38 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerAggregationFieldArithmetic.js +45 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.d.ts +43 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInner.js +54 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.d.ts +30 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerFiltersInnerValue.js +25 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.d.ts +34 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestMetersInnerSqlFullQuery.js +38 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.d.ts +32 -0
- package/dist/openapi/models/V2QueryEventsAggregationRequestPeriod.js +38 -0
- package/dist/openapi/models/V2QueryEventsAggregationResponse.d.ts +42 -0
- package/dist/openapi/models/V2QueryEventsAggregationResponse.js +52 -0
- package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.d.ts +34 -0
- package/dist/openapi/models/V2QueryEventsAggregationResponseDataPointsInner.js +38 -0
- package/dist/openapi/models/V2QueryEventsResponse.d.ts +35 -0
- package/dist/openapi/models/V2QueryEventsResponse.js +50 -0
- package/dist/openapi/models/V2SendEventsRequest.d.ts +32 -0
- package/dist/openapi/models/V2SendEventsRequest.js +32 -0
- package/dist/openapi/models/V2SendEventsResponse.d.ts +40 -0
- package/dist/openapi/models/V2SendEventsResponse.js +38 -0
- package/dist/openapi/models/ValidationErrorResponse.d.ts +51 -0
- package/dist/openapi/models/ValidationErrorResponse.js +60 -0
- package/dist/openapi/models/ValidationErrorResponseParamsInner.d.ts +38 -0
- package/dist/openapi/models/ValidationErrorResponseParamsInner.js +38 -0
- package/dist/openapi/models/WebhookSubscribeRequest.d.ts +1 -0
- package/dist/openapi/models/WebhookSubscribeRequest.js +6 -0
- package/dist/openapi/models/all.d.ts +112 -0
- package/dist/openapi/models/all.js +112 -0
- package/dist/openapi/types/ObservableAPI.d.ts +447 -14
- package/dist/openapi/types/ObservableAPI.js +907 -29
- package/dist/openapi/types/PromiseAPI.d.ts +439 -14
- package/dist/openapi/types/PromiseAPI.js +600 -38
- package/dist/sdk/clients/CatalogProductsClient.d.ts +11 -0
- package/dist/sdk/clients/CatalogProductsClient.js +28 -0
- package/dist/sdk/clients/CloudUsageSubmissionClient.d.ts +6 -0
- package/dist/sdk/clients/CloudUsageSubmissionClient.js +14 -0
- package/dist/sdk/clients/ContractsClient.d.ts +2 -1
- package/dist/sdk/clients/ContractsClient.js +3 -0
- package/dist/sdk/clients/CreditsClient.d.ts +9 -0
- package/dist/sdk/clients/CreditsClient.js +22 -0
- package/dist/sdk/clients/CustomersClient.d.ts +5 -1
- package/dist/sdk/clients/CustomersClient.js +12 -0
- package/dist/sdk/clients/EventsClient.d.ts +2 -1
- package/dist/sdk/clients/EventsClient.js +4 -1
- package/dist/sdk/clients/InvoicesClient.d.ts +1 -0
- package/dist/sdk/clients/InvoicesClient.js +3 -0
- package/dist/sdk/clients/MeasurementsClient.d.ts +10 -0
- package/dist/sdk/clients/MeasurementsClient.js +25 -0
- package/dist/sdk/clients/WebhooksClient.d.ts +2 -0
- package/dist/sdk/clients/WebhooksClient.js +14 -0
- package/dist/sdk/clients/index.d.ts +4 -0
- package/dist/sdk/clients/index.js +4 -0
- package/dist/sdk/index.d.ts +6 -1
- package/dist/sdk/index.js +13 -0
- package/dist/sdk/services/authenticated-http-library.d.ts +11 -0
- package/dist/sdk/services/authenticated-http-library.js +29 -0
- package/dist/sdk/services/authenticator.d.ts +11 -0
- package/dist/sdk/services/authenticator.js +57 -0
- package/dist/sdk/services/configuration.service.d.ts +7 -6
- package/dist/sdk/services/configuration.service.js +12 -44
- package/dist/sdk/types/CatalogProducts.d.ts +1 -0
- package/dist/sdk/types/CatalogProducts.js +2 -0
- package/dist/sdk/types/CloudUsageSubmission.d.ts +1 -0
- package/dist/sdk/types/CloudUsageSubmission.js +2 -0
- package/dist/sdk/types/Contracts.d.ts +1 -1
- package/dist/sdk/types/Credits.d.ts +1 -0
- package/dist/sdk/types/Credits.js +2 -0
- package/dist/sdk/types/Customers.d.ts +1 -1
- package/dist/sdk/types/Events.d.ts +1 -1
- package/dist/sdk/types/Invoices.d.ts +1 -1
- package/dist/sdk/types/Measurements.d.ts +1 -0
- package/dist/sdk/types/Measurements.js +2 -0
- package/dist/sdk/types/index.d.ts +4 -0
- package/dist/sdk/types/index.js +4 -0
- package/dist/sdk-v2/services/configuration.service.js +16 -8
- package/package.json +3 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PlansApiResponseProcessor = exports.PlansApiRequestFactory = void 0;
|
|
4
|
+
// TODO: better import syntax?
|
|
5
|
+
const baseapi_1 = require("./baseapi");
|
|
6
|
+
const http_1 = require("../http/http");
|
|
7
|
+
const ObjectSerializer_1 = require("../models/ObjectSerializer");
|
|
8
|
+
const exception_1 = require("./exception");
|
|
9
|
+
const util_1 = require("../util");
|
|
10
|
+
/**
|
|
11
|
+
* no description
|
|
12
|
+
*/
|
|
13
|
+
class PlansApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
14
|
+
/**
|
|
15
|
+
* Delete a Plan by id.
|
|
16
|
+
* Delete Plan
|
|
17
|
+
* @param planId
|
|
18
|
+
*/
|
|
19
|
+
async deletePlan(planId, _options) {
|
|
20
|
+
let _config = _options || this.configuration;
|
|
21
|
+
// verify required parameter 'planId' is not null or undefined
|
|
22
|
+
if (planId === null || planId === undefined) {
|
|
23
|
+
throw new baseapi_1.RequiredError("PlansApi", "deletePlan", "planId");
|
|
24
|
+
}
|
|
25
|
+
// Path Params
|
|
26
|
+
const localVarPath = '/plans/{planId}'
|
|
27
|
+
.replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
|
|
28
|
+
// Make Request Context
|
|
29
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.DELETE);
|
|
30
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
31
|
+
let authMethod;
|
|
32
|
+
// Apply auth methods
|
|
33
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
34
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
35
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
36
|
+
}
|
|
37
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
38
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
39
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
40
|
+
}
|
|
41
|
+
return requestContext;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get a Plan by id.
|
|
45
|
+
* Get Plan
|
|
46
|
+
* @param planId
|
|
47
|
+
*/
|
|
48
|
+
async getPlan(planId, _options) {
|
|
49
|
+
let _config = _options || this.configuration;
|
|
50
|
+
// verify required parameter 'planId' is not null or undefined
|
|
51
|
+
if (planId === null || planId === undefined) {
|
|
52
|
+
throw new baseapi_1.RequiredError("PlansApi", "getPlan", "planId");
|
|
53
|
+
}
|
|
54
|
+
// Path Params
|
|
55
|
+
const localVarPath = '/plans/{planId}'
|
|
56
|
+
.replace('{' + 'planId' + '}', encodeURIComponent(String(planId)));
|
|
57
|
+
// Make Request Context
|
|
58
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
59
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
60
|
+
let authMethod;
|
|
61
|
+
// Apply auth methods
|
|
62
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
63
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
64
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
65
|
+
}
|
|
66
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
67
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
68
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
69
|
+
}
|
|
70
|
+
return requestContext;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get a list of Plans.
|
|
74
|
+
* List Plans
|
|
75
|
+
* @param limit
|
|
76
|
+
* @param cursor
|
|
77
|
+
*/
|
|
78
|
+
async listPlans(limit, cursor, _options) {
|
|
79
|
+
let _config = _options || this.configuration;
|
|
80
|
+
// Path Params
|
|
81
|
+
const localVarPath = '/plans';
|
|
82
|
+
// Make Request Context
|
|
83
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
84
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
85
|
+
// Query Params
|
|
86
|
+
if (limit !== undefined) {
|
|
87
|
+
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
|
|
88
|
+
}
|
|
89
|
+
// Query Params
|
|
90
|
+
if (cursor !== undefined) {
|
|
91
|
+
requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
|
|
92
|
+
}
|
|
93
|
+
let authMethod;
|
|
94
|
+
// Apply auth methods
|
|
95
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
96
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
97
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
98
|
+
}
|
|
99
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
100
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
101
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
102
|
+
}
|
|
103
|
+
return requestContext;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.PlansApiRequestFactory = PlansApiRequestFactory;
|
|
107
|
+
class PlansApiResponseProcessor {
|
|
108
|
+
/**
|
|
109
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
110
|
+
* to the expected objects
|
|
111
|
+
*
|
|
112
|
+
* @params response Response returned by the server for a request to deletePlan
|
|
113
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
114
|
+
*/
|
|
115
|
+
async deletePlanWithHttpInfo(response) {
|
|
116
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
117
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
118
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
|
|
119
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
120
|
+
}
|
|
121
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
122
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
|
|
123
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
|
|
124
|
+
}
|
|
125
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
126
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
|
|
127
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
|
|
128
|
+
}
|
|
129
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
130
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
|
|
131
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
|
|
132
|
+
}
|
|
133
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
134
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
|
|
135
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
|
|
136
|
+
}
|
|
137
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
138
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
|
|
139
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
|
|
140
|
+
}
|
|
141
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
142
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
143
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "DeletePlanResponse", "");
|
|
144
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
145
|
+
}
|
|
146
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
150
|
+
* to the expected objects
|
|
151
|
+
*
|
|
152
|
+
* @params response Response returned by the server for a request to getPlan
|
|
153
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
154
|
+
*/
|
|
155
|
+
async getPlanWithHttpInfo(response) {
|
|
156
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
157
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
158
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
|
|
159
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
160
|
+
}
|
|
161
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
162
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
|
|
163
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
|
|
164
|
+
}
|
|
165
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
166
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
|
|
167
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
|
|
168
|
+
}
|
|
169
|
+
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
170
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
|
|
171
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
|
|
172
|
+
}
|
|
173
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
174
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
|
|
175
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
|
|
176
|
+
}
|
|
177
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
178
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
|
|
179
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
|
|
180
|
+
}
|
|
181
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
182
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
183
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetPlanResponse", "");
|
|
184
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
185
|
+
}
|
|
186
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
190
|
+
* to the expected objects
|
|
191
|
+
*
|
|
192
|
+
* @params response Response returned by the server for a request to listPlans
|
|
193
|
+
* @throws ApiException if the response code was not in [200, 299]
|
|
194
|
+
*/
|
|
195
|
+
async listPlansWithHttpInfo(response) {
|
|
196
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
197
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
198
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
|
|
199
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
200
|
+
}
|
|
201
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
202
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
|
|
203
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
|
|
204
|
+
}
|
|
205
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
206
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
|
|
207
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
|
|
208
|
+
}
|
|
209
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
210
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
|
|
211
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
|
|
212
|
+
}
|
|
213
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
214
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
|
|
215
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
|
|
216
|
+
}
|
|
217
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
218
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
219
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ListPlansResponse", "");
|
|
220
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
221
|
+
}
|
|
222
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.PlansApiResponseProcessor = PlansApiResponseProcessor;
|
|
@@ -57,19 +57,24 @@ class ProductConsumptionsApiResponseProcessor {
|
|
|
57
57
|
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
58
58
|
}
|
|
59
59
|
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
60
|
-
|
|
60
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
|
|
61
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
|
|
61
62
|
}
|
|
62
63
|
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
63
|
-
|
|
64
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
|
|
65
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
|
|
64
66
|
}
|
|
65
67
|
if ((0, util_1.isCodeInRange)("404", response.httpStatusCode)) {
|
|
66
|
-
|
|
68
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "NotFoundErrorResponse", "");
|
|
69
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Not Found", body, response.headers);
|
|
67
70
|
}
|
|
68
71
|
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
69
|
-
|
|
72
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
|
|
73
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
|
|
70
74
|
}
|
|
71
75
|
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
72
|
-
|
|
76
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
|
|
77
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
|
|
73
78
|
}
|
|
74
79
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
75
80
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
@@ -62,19 +62,24 @@ class WebhooksApiResponseProcessor {
|
|
|
62
62
|
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
|
|
63
63
|
}
|
|
64
64
|
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
65
|
-
|
|
65
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "ValidationErrorResponse", "");
|
|
66
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", body, response.headers);
|
|
66
67
|
}
|
|
67
68
|
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
68
|
-
|
|
69
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "UnauthorizedErrorResponse", "");
|
|
70
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", body, response.headers);
|
|
69
71
|
}
|
|
70
72
|
if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
|
|
71
|
-
|
|
73
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RequestTooLongErrorResponse", "");
|
|
74
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", body, response.headers);
|
|
72
75
|
}
|
|
73
76
|
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
74
|
-
|
|
77
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "RateLimitErrorResponse", "");
|
|
78
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", body, response.headers);
|
|
75
79
|
}
|
|
76
80
|
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
77
|
-
|
|
81
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "InternalServerErrorResponse", "");
|
|
82
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", body, response.headers);
|
|
78
83
|
}
|
|
79
84
|
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
80
85
|
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/// <reference types="node" />
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import * as FormData from "form-data";
|
|
6
|
-
import { URLSearchParams } from 'url';
|
|
7
|
-
import * as http from 'http';
|
|
8
|
-
import * as https from 'https';
|
|
9
1
|
import { Observable } from '../rxjsStub';
|
|
10
2
|
export * from './isomorphic-fetch';
|
|
11
3
|
/**
|
|
@@ -25,9 +17,8 @@ export declare enum HttpMethod {
|
|
|
25
17
|
/**
|
|
26
18
|
* Represents an HTTP file which will be transferred from or to a server.
|
|
27
19
|
*/
|
|
28
|
-
export type HttpFile = {
|
|
29
|
-
|
|
30
|
-
name: string;
|
|
20
|
+
export type HttpFile = Blob & {
|
|
21
|
+
readonly name: string;
|
|
31
22
|
};
|
|
32
23
|
export declare class HttpException extends Error {
|
|
33
24
|
constructor(msg: string);
|
|
@@ -45,7 +36,6 @@ export declare class RequestContext {
|
|
|
45
36
|
private headers;
|
|
46
37
|
private body;
|
|
47
38
|
private url;
|
|
48
|
-
private agent;
|
|
49
39
|
/**
|
|
50
40
|
* Creates the request context using a http method and request resource url
|
|
51
41
|
*
|
|
@@ -80,20 +70,18 @@ export declare class RequestContext {
|
|
|
80
70
|
*/
|
|
81
71
|
addCookie(name: string, value: string): void;
|
|
82
72
|
setHeaderParam(key: string, value: string): void;
|
|
83
|
-
setAgent(agent: http.Agent | https.Agent): void;
|
|
84
|
-
getAgent(): http.Agent | https.Agent | undefined;
|
|
85
73
|
}
|
|
86
74
|
export interface ResponseBody {
|
|
87
75
|
text(): Promise<string>;
|
|
88
|
-
binary(): Promise<
|
|
76
|
+
binary(): Promise<Blob>;
|
|
89
77
|
}
|
|
90
78
|
/**
|
|
91
79
|
* Helper class to generate a `ResponseBody` from binary data
|
|
92
80
|
*/
|
|
93
81
|
export declare class SelfDecodingBody implements ResponseBody {
|
|
94
82
|
private dataSource;
|
|
95
|
-
constructor(dataSource: Promise<
|
|
96
|
-
binary(): Promise<
|
|
83
|
+
constructor(dataSource: Promise<Blob>);
|
|
84
|
+
binary(): Promise<Blob>;
|
|
97
85
|
text(): Promise<string>;
|
|
98
86
|
}
|
|
99
87
|
export declare class ResponseContext {
|
|
@@ -114,7 +102,7 @@ export declare class ResponseContext {
|
|
|
114
102
|
* Use a heuristic to get a body of unknown data structure.
|
|
115
103
|
* Return as string if possible, otherwise as binary.
|
|
116
104
|
*/
|
|
117
|
-
getBodyAsAny(): Promise<string |
|
|
105
|
+
getBodyAsAny(): Promise<string | Blob | undefined>;
|
|
118
106
|
}
|
|
119
107
|
export interface HttpLibrary {
|
|
120
108
|
send(request: RequestContext): Observable<ResponseContext>;
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.HttpInfo = exports.wrapHttpLibrary = exports.ResponseContext = exports.SelfDecodingBody = exports.RequestContext = exports.HttpException = exports.HttpMethod = void 0;
|
|
18
|
-
const url_1 = require("url");
|
|
19
18
|
const rxjsStub_1 = require("../rxjsStub");
|
|
20
19
|
__exportStar(require("./isomorphic-fetch"), exports);
|
|
21
20
|
/**
|
|
@@ -43,7 +42,7 @@ function ensureAbsoluteUrl(url) {
|
|
|
43
42
|
if (url.startsWith("http://") || url.startsWith("https://")) {
|
|
44
43
|
return url;
|
|
45
44
|
}
|
|
46
|
-
|
|
45
|
+
return window.location.origin + url;
|
|
47
46
|
}
|
|
48
47
|
/**
|
|
49
48
|
* Represents an HTTP request context
|
|
@@ -59,8 +58,7 @@ class RequestContext {
|
|
|
59
58
|
this.httpMethod = httpMethod;
|
|
60
59
|
this.headers = {};
|
|
61
60
|
this.body = undefined;
|
|
62
|
-
this.
|
|
63
|
-
this.url = new url_1.URL(ensureAbsoluteUrl(url));
|
|
61
|
+
this.url = new URL(ensureAbsoluteUrl(url));
|
|
64
62
|
}
|
|
65
63
|
/*
|
|
66
64
|
* Returns the url set in the constructor including the query string
|
|
@@ -76,7 +74,7 @@ class RequestContext {
|
|
|
76
74
|
*
|
|
77
75
|
*/
|
|
78
76
|
setUrl(url) {
|
|
79
|
-
this.url = new
|
|
77
|
+
this.url = new URL(ensureAbsoluteUrl(url));
|
|
80
78
|
}
|
|
81
79
|
/**
|
|
82
80
|
* Sets the body of the http request either as a string or FormData
|
|
@@ -118,12 +116,6 @@ class RequestContext {
|
|
|
118
116
|
setHeaderParam(key, value) {
|
|
119
117
|
this.headers[key] = value;
|
|
120
118
|
}
|
|
121
|
-
setAgent(agent) {
|
|
122
|
-
this.agent = agent;
|
|
123
|
-
}
|
|
124
|
-
getAgent() {
|
|
125
|
-
return this.agent;
|
|
126
|
-
}
|
|
127
119
|
}
|
|
128
120
|
exports.RequestContext = RequestContext;
|
|
129
121
|
/**
|
|
@@ -138,7 +130,17 @@ class SelfDecodingBody {
|
|
|
138
130
|
}
|
|
139
131
|
async text() {
|
|
140
132
|
const data = await this.dataSource;
|
|
141
|
-
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
if (data.text) {
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
return data.text();
|
|
137
|
+
}
|
|
138
|
+
return new Promise((resolve, reject) => {
|
|
139
|
+
const reader = new FileReader();
|
|
140
|
+
reader.addEventListener("load", () => resolve(reader.result));
|
|
141
|
+
reader.addEventListener("error", () => reject(reader.error));
|
|
142
|
+
reader.readAsText(data);
|
|
143
|
+
});
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
exports.SelfDecodingBody = SelfDecodingBody;
|
|
@@ -183,7 +185,17 @@ class ResponseContext {
|
|
|
183
185
|
async getBodyAsFile() {
|
|
184
186
|
const data = await this.body.binary();
|
|
185
187
|
const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
|
|
186
|
-
|
|
188
|
+
const contentType = this.headers["content-type"] || "";
|
|
189
|
+
try {
|
|
190
|
+
return new File([data], fileName, { type: contentType });
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
/** Fallback for when the File constructor is not available */
|
|
194
|
+
return Object.assign(data, {
|
|
195
|
+
name: fileName,
|
|
196
|
+
type: contentType
|
|
197
|
+
});
|
|
198
|
+
}
|
|
187
199
|
}
|
|
188
200
|
/**
|
|
189
201
|
* Use a heuristic to get a body of unknown data structure.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { HttpLibrary, RequestContext, ResponseContext } from './http';
|
|
2
2
|
import { Observable } from '../rxjsStub';
|
|
3
|
+
import "whatwg-fetch";
|
|
3
4
|
export declare class IsomorphicFetchHttpLibrary implements HttpLibrary {
|
|
4
5
|
send(request: RequestContext): Observable<ResponseContext>;
|
|
5
6
|
}
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.IsomorphicFetchHttpLibrary = void 0;
|
|
7
4
|
const http_1 = require("./http");
|
|
8
5
|
const rxjsStub_1 = require("../rxjsStub");
|
|
9
|
-
|
|
6
|
+
require("whatwg-fetch");
|
|
10
7
|
class IsomorphicFetchHttpLibrary {
|
|
11
8
|
send(request) {
|
|
12
9
|
let method = request.getHttpMethod().toString();
|
|
13
10
|
let body = request.getBody();
|
|
14
|
-
const resultPromise = (
|
|
11
|
+
const resultPromise = fetch(request.getUrl(), {
|
|
15
12
|
method: method,
|
|
16
13
|
body: body,
|
|
17
14
|
headers: request.getHeaders(),
|
|
18
|
-
|
|
15
|
+
credentials: "same-origin"
|
|
19
16
|
}).then((resp) => {
|
|
20
17
|
const headers = {};
|
|
21
18
|
resp.headers.forEach((value, name) => {
|
|
@@ -23,7 +20,7 @@ class IsomorphicFetchHttpLibrary {
|
|
|
23
20
|
});
|
|
24
21
|
const body = {
|
|
25
22
|
text: () => resp.text(),
|
|
26
|
-
binary: () => resp.
|
|
23
|
+
binary: () => resp.blob()
|
|
27
24
|
};
|
|
28
25
|
return new http_1.ResponseContext(resp.status, headers, body);
|
|
29
26
|
});
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -7,4 +7,4 @@ export * from "./apis/exception";
|
|
|
7
7
|
export * from "./servers";
|
|
8
8
|
export { RequiredError } from "./apis/baseapi";
|
|
9
9
|
export type { PromiseMiddleware as Middleware } from './middleware';
|
|
10
|
-
export { PromiseAuthApi as AuthApi, PromiseContractsApi as ContractsApi, PromiseCreditsApi as CreditsApi, PromiseCustomersApi as CustomersApi, PromiseEventsApi as EventsApi, PromiseInvoicesApi as InvoicesApi, PromiseMeasurementsApi as MeasurementsApi, PromiseMetersApi as MetersApi, PromiseProductConsumptionsApi as ProductConsumptionsApi, PromiseWebhooksApi as WebhooksApi } from './types/PromiseAPI';
|
|
10
|
+
export { PromiseAuthApi as AuthApi, PromiseCatalogProductsApi as CatalogProductsApi, PromiseCloudUsageSubmissionApi as CloudUsageSubmissionApi, PromiseContractsApi as ContractsApi, PromiseCreditsApi as CreditsApi, PromiseCustomFieldsApi as CustomFieldsApi, PromiseCustomersApi as CustomersApi, PromiseEventsApi as EventsApi, PromiseInvoicesApi as InvoicesApi, PromiseMeasurementsApi as MeasurementsApi, PromiseMetersApi as MetersApi, PromisePlansApi as PlansApi, PromiseProductConsumptionsApi as ProductConsumptionsApi, PromiseWebhooksApi as WebhooksApi } from './types/PromiseAPI';
|
package/dist/openapi/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.WebhooksApi = exports.ProductConsumptionsApi = exports.MetersApi = exports.MeasurementsApi = exports.InvoicesApi = exports.EventsApi = exports.CustomersApi = exports.CreditsApi = exports.ContractsApi = exports.AuthApi = exports.RequiredError = exports.createConfiguration = void 0;
|
|
17
|
+
exports.WebhooksApi = exports.ProductConsumptionsApi = exports.PlansApi = exports.MetersApi = exports.MeasurementsApi = exports.InvoicesApi = exports.EventsApi = exports.CustomersApi = exports.CustomFieldsApi = exports.CreditsApi = exports.ContractsApi = exports.CloudUsageSubmissionApi = exports.CatalogProductsApi = exports.AuthApi = exports.RequiredError = exports.createConfiguration = void 0;
|
|
18
18
|
__exportStar(require("./http/http"), exports);
|
|
19
19
|
__exportStar(require("./auth/auth"), exports);
|
|
20
20
|
__exportStar(require("./models/all"), exports);
|
|
@@ -26,12 +26,16 @@ var baseapi_1 = require("./apis/baseapi");
|
|
|
26
26
|
Object.defineProperty(exports, "RequiredError", { enumerable: true, get: function () { return baseapi_1.RequiredError; } });
|
|
27
27
|
var PromiseAPI_1 = require("./types/PromiseAPI");
|
|
28
28
|
Object.defineProperty(exports, "AuthApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseAuthApi; } });
|
|
29
|
+
Object.defineProperty(exports, "CatalogProductsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCatalogProductsApi; } });
|
|
30
|
+
Object.defineProperty(exports, "CloudUsageSubmissionApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCloudUsageSubmissionApi; } });
|
|
29
31
|
Object.defineProperty(exports, "ContractsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseContractsApi; } });
|
|
30
32
|
Object.defineProperty(exports, "CreditsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCreditsApi; } });
|
|
33
|
+
Object.defineProperty(exports, "CustomFieldsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCustomFieldsApi; } });
|
|
31
34
|
Object.defineProperty(exports, "CustomersApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseCustomersApi; } });
|
|
32
35
|
Object.defineProperty(exports, "EventsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseEventsApi; } });
|
|
33
36
|
Object.defineProperty(exports, "InvoicesApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseInvoicesApi; } });
|
|
34
37
|
Object.defineProperty(exports, "MeasurementsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseMeasurementsApi; } });
|
|
35
38
|
Object.defineProperty(exports, "MetersApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseMetersApi; } });
|
|
39
|
+
Object.defineProperty(exports, "PlansApi", { enumerable: true, get: function () { return PromiseAPI_1.PromisePlansApi; } });
|
|
36
40
|
Object.defineProperty(exports, "ProductConsumptionsApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseProductConsumptionsApi; } });
|
|
37
41
|
Object.defineProperty(exports, "WebhooksApi", { enumerable: true, get: function () { return PromiseAPI_1.PromiseWebhooksApi; } });
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* The address of the customer
|
|
14
14
|
*/
|
|
15
15
|
export declare class Address {
|
|
16
|
-
'country'?: string;
|
|
17
|
-
'city'?: string;
|
|
18
|
-
'addressText'?: string;
|
|
19
|
-
'state'?: string;
|
|
20
|
-
'postalCode'?: string;
|
|
16
|
+
'country'?: string | null;
|
|
17
|
+
'city'?: string | null;
|
|
18
|
+
'addressText'?: string | null;
|
|
19
|
+
'state'?: string | null;
|
|
20
|
+
'postalCode'?: string | null;
|
|
21
21
|
static readonly discriminator: string | undefined;
|
|
22
22
|
static readonly mapping: {
|
|
23
23
|
[index: string]: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vayu API
|
|
3
|
+
* The Vayu API is a RESTful API that allows you to submit events for processing and storage & manage billing related entities. The API is secured using the Bearer Authentication scheme with JWT tokens. To obtain a JWT token, please contact Vayu at team@withvayu.com
|
|
4
|
+
*
|
|
5
|
+
* OpenAPI spec version: 1.0.0
|
|
6
|
+
* Contact: dev@withvayu.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum BillingInterval {
|
|
13
|
+
Monthly = "Monthly",
|
|
14
|
+
BiMonthly = "BiMonthly",
|
|
15
|
+
Quarterly = "Quarterly",
|
|
16
|
+
SixMonths = "SixMonths",
|
|
17
|
+
Yearly = "Yearly"
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Vayu API
|
|
4
|
+
* The Vayu API is a RESTful API that allows you to submit events for processing and storage & manage billing related entities. The API is secured using the Bearer Authentication scheme with JWT tokens. To obtain a JWT token, please contact Vayu at team@withvayu.com
|
|
5
|
+
*
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
* Contact: dev@withvayu.com
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.BillingInterval = void 0;
|
|
15
|
+
var BillingInterval;
|
|
16
|
+
(function (BillingInterval) {
|
|
17
|
+
BillingInterval["Monthly"] = "Monthly";
|
|
18
|
+
BillingInterval["BiMonthly"] = "BiMonthly";
|
|
19
|
+
BillingInterval["Quarterly"] = "Quarterly";
|
|
20
|
+
BillingInterval["SixMonths"] = "SixMonths";
|
|
21
|
+
BillingInterval["Yearly"] = "Yearly";
|
|
22
|
+
})(BillingInterval = exports.BillingInterval || (exports.BillingInterval = {}));
|