vayu-ts 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/dist/openapi/apis/AuthApi.d.ts +26 -0
- package/dist/openapi/apis/AuthApi.js +93 -0
- package/dist/openapi/apis/ContractsApi.d.ts +72 -0
- package/dist/openapi/apis/ContractsApi.js +307 -0
- package/dist/openapi/apis/CreditsApi.d.ts +57 -0
- package/dist/openapi/apis/CreditsApi.js +248 -0
- package/dist/openapi/apis/CustomersApi.d.ts +103 -0
- package/dist/openapi/apis/CustomersApi.js +457 -0
- package/dist/openapi/apis/EventsApi.d.ts +91 -0
- package/dist/openapi/apis/EventsApi.js +408 -0
- package/dist/openapi/apis/IntegrationsApi.d.ts +41 -0
- package/dist/openapi/apis/IntegrationsApi.js +170 -0
- package/dist/openapi/apis/InvoicesApi.d.ts +41 -0
- package/dist/openapi/apis/InvoicesApi.js +166 -0
- package/dist/openapi/apis/MetersApi.d.ts +73 -0
- package/dist/openapi/apis/MetersApi.js +316 -0
- package/dist/openapi/apis/PlansApi.d.ts +56 -0
- package/dist/openapi/apis/PlansApi.js +235 -0
- package/dist/openapi/apis/ReportsApi.d.ts +41 -0
- package/dist/openapi/apis/ReportsApi.js +166 -0
- package/dist/openapi/apis/WebhooksApi.d.ts +25 -0
- package/dist/openapi/apis/WebhooksApi.js +101 -0
- package/dist/openapi/apis/baseapi.d.ts +33 -0
- package/dist/openapi/apis/baseapi.js +41 -0
- package/dist/openapi/apis/exception.d.ts +19 -0
- package/dist/openapi/apis/exception.js +22 -0
- package/dist/openapi/auth/auth.d.ts +54 -0
- package/dist/openapi/auth/auth.js +50 -0
- package/dist/openapi/configuration.d.ts +63 -0
- package/dist/openapi/configuration.js +34 -0
- package/dist/openapi/http/http.d.ts +142 -0
- package/dist/openapi/http/http.js +229 -0
- package/dist/openapi/http/isomorphic-fetch.d.ts +5 -0
- package/dist/openapi/http/isomorphic-fetch.js +33 -0
- package/dist/openapi/index.d.ts +10 -0
- package/dist/openapi/index.js +38 -0
- package/dist/openapi/middleware.d.ts +54 -0
- package/dist/openapi/middleware.js +16 -0
- package/dist/openapi/models/Address.d.ts +35 -0
- package/dist/openapi/models/Address.js +58 -0
- package/dist/openapi/models/AggregationMethod.d.ts +40 -0
- package/dist/openapi/models/AggregationMethod.js +46 -0
- package/dist/openapi/models/AggregationOperator.d.ts +24 -0
- package/dist/openapi/models/AggregationOperator.js +28 -0
- package/dist/openapi/models/BillingCycleStatus.d.ts +15 -0
- package/dist/openapi/models/BillingCycleStatus.js +19 -0
- package/dist/openapi/models/BillingInterval.d.ts +18 -0
- package/dist/openapi/models/BillingInterval.js +22 -0
- package/dist/openapi/models/Condition.d.ts +29 -0
- package/dist/openapi/models/Condition.js +31 -0
- package/dist/openapi/models/Contact.d.ts +30 -0
- package/dist/openapi/models/Contact.js +43 -0
- package/dist/openapi/models/ContractStatus.d.ts +18 -0
- package/dist/openapi/models/ContractStatus.js +22 -0
- package/dist/openapi/models/CreateContractRequest.d.ts +43 -0
- package/dist/openapi/models/CreateContractRequest.js +49 -0
- package/dist/openapi/models/CreateContractResponse.d.ts +29 -0
- package/dist/openapi/models/CreateContractResponse.js +31 -0
- package/dist/openapi/models/CreateCustomerRequest.d.ts +46 -0
- package/dist/openapi/models/CreateCustomerRequest.js +55 -0
- package/dist/openapi/models/CreateCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/CreateCustomerResponse.js +31 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +49 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.js +73 -0
- package/dist/openapi/models/CreditLedgerEntry.d.ts +32 -0
- package/dist/openapi/models/CreditLedgerEntry.js +49 -0
- package/dist/openapi/models/Criterion.d.ts +31 -0
- package/dist/openapi/models/Criterion.js +43 -0
- package/dist/openapi/models/CriterionOperator.d.ts +23 -0
- package/dist/openapi/models/CriterionOperator.js +27 -0
- package/dist/openapi/models/Currency.d.ts +17 -0
- package/dist/openapi/models/Currency.js +21 -0
- package/dist/openapi/models/DeductCreditsRequest.d.ts +35 -0
- package/dist/openapi/models/DeductCreditsRequest.js +37 -0
- package/dist/openapi/models/DeleteContractResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteContractResponse.js +31 -0
- package/dist/openapi/models/DeleteContractResponseContract.d.ts +47 -0
- package/dist/openapi/models/DeleteContractResponseContract.js +73 -0
- package/dist/openapi/models/DeleteCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteCustomerResponse.js +31 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +50 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.js +79 -0
- package/dist/openapi/models/DeleteEventResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteEventResponse.js +31 -0
- package/dist/openapi/models/DeleteEventResponseEvent.d.ts +56 -0
- package/dist/openapi/models/DeleteEventResponseEvent.js +82 -0
- package/dist/openapi/models/DeleteMeterResponse.d.ts +29 -0
- package/dist/openapi/models/DeleteMeterResponse.js +31 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.d.ts +43 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.js +73 -0
- package/dist/openapi/models/DeletePlanResponse.d.ts +29 -0
- package/dist/openapi/models/DeletePlanResponse.js +31 -0
- package/dist/openapi/models/DeletePlanResponsePlan.d.ts +39 -0
- package/dist/openapi/models/DeletePlanResponsePlan.js +67 -0
- package/dist/openapi/models/Event.d.ts +49 -0
- package/dist/openapi/models/Event.js +55 -0
- package/dist/openapi/models/EventsDryRunRequest.d.ts +29 -0
- package/dist/openapi/models/EventsDryRunRequest.js +31 -0
- package/dist/openapi/models/EventsDryRunResponse.d.ts +29 -0
- package/dist/openapi/models/EventsDryRunResponse.js +31 -0
- package/dist/openapi/models/EventsDryRunResponseObject.d.ts +32 -0
- package/dist/openapi/models/EventsDryRunResponseObject.js +43 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.d.ts +35 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.js +61 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +41 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.js +61 -0
- package/dist/openapi/models/Filter.d.ts +32 -0
- package/dist/openapi/models/Filter.js +34 -0
- package/dist/openapi/models/FullDayPeriod.d.ts +32 -0
- package/dist/openapi/models/FullDayPeriod.js +40 -0
- package/dist/openapi/models/GetCommitmentReportResponse.d.ts +44 -0
- package/dist/openapi/models/GetCommitmentReportResponse.js +115 -0
- package/dist/openapi/models/GetContractResponse.d.ts +29 -0
- package/dist/openapi/models/GetContractResponse.js +31 -0
- package/dist/openapi/models/GetContractResponseContract.d.ts +46 -0
- package/dist/openapi/models/GetContractResponseContract.js +67 -0
- package/dist/openapi/models/GetCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/GetCustomerResponse.js +31 -0
- package/dist/openapi/models/GetEventResponse.d.ts +29 -0
- package/dist/openapi/models/GetEventResponse.js +31 -0
- package/dist/openapi/models/GetEventResponseEvent.d.ts +55 -0
- package/dist/openapi/models/GetEventResponseEvent.js +76 -0
- package/dist/openapi/models/GetInvoiceResponse.d.ts +29 -0
- package/dist/openapi/models/GetInvoiceResponse.js +31 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +50 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.js +79 -0
- package/dist/openapi/models/GetMeterResponse.d.ts +29 -0
- package/dist/openapi/models/GetMeterResponse.js +31 -0
- package/dist/openapi/models/GetMeterResponseMeter.d.ts +42 -0
- package/dist/openapi/models/GetMeterResponseMeter.js +67 -0
- package/dist/openapi/models/GetPlanResponse.d.ts +29 -0
- package/dist/openapi/models/GetPlanResponse.js +31 -0
- package/dist/openapi/models/GetPlanResponsePlan.d.ts +38 -0
- package/dist/openapi/models/GetPlanResponsePlan.js +61 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.d.ts +44 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.js +115 -0
- package/dist/openapi/models/GrantCreditsRequest.d.ts +35 -0
- package/dist/openapi/models/GrantCreditsRequest.js +37 -0
- package/dist/openapi/models/InvalidEvent.d.ts +33 -0
- package/dist/openapi/models/InvalidEvent.js +37 -0
- package/dist/openapi/models/LineItem.d.ts +33 -0
- package/dist/openapi/models/LineItem.js +37 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.d.ts +36 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.js +64 -0
- package/dist/openapi/models/ListContractsResponse.d.ts +32 -0
- package/dist/openapi/models/ListContractsResponse.js +49 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.d.ts +32 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.js +31 -0
- package/dist/openapi/models/ListCustomersResponse.d.ts +32 -0
- package/dist/openapi/models/ListCustomersResponse.js +49 -0
- package/dist/openapi/models/ListInvoicesResponse.d.ts +32 -0
- package/dist/openapi/models/ListInvoicesResponse.js +49 -0
- package/dist/openapi/models/ListMetersResponse.d.ts +32 -0
- package/dist/openapi/models/ListMetersResponse.js +49 -0
- package/dist/openapi/models/ListPlansResponse.d.ts +32 -0
- package/dist/openapi/models/ListPlansResponse.js +49 -0
- package/dist/openapi/models/LoginRequest.d.ts +31 -0
- package/dist/openapi/models/LoginRequest.js +31 -0
- package/dist/openapi/models/LoginResponse.d.ts +31 -0
- package/dist/openapi/models/LoginResponse.js +31 -0
- package/dist/openapi/models/Meter.d.ts +39 -0
- package/dist/openapi/models/Meter.js +49 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.d.ts +30 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.js +43 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.d.ts +34 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.js +47 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.d.ts +39 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.js +85 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.d.ts +28 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.js +31 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.d.ts +29 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.js +31 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.d.ts +33 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.js +55 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.d.ts +29 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.js +37 -0
- package/dist/openapi/models/NotificationEventType.d.ts +17 -0
- package/dist/openapi/models/NotificationEventType.js +21 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +109 -0
- package/dist/openapi/models/ObjectSerializer.js +497 -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 +37 -0
- package/dist/openapi/models/PlanBillingData.js +58 -0
- package/dist/openapi/models/PlanStatus.d.ts +19 -0
- package/dist/openapi/models/PlanStatus.js +23 -0
- package/dist/openapi/models/QueryEventsResponse.d.ts +32 -0
- package/dist/openapi/models/QueryEventsResponse.js +31 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.d.ts +52 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.js +73 -0
- package/dist/openapi/models/SendEventsRequest.d.ts +29 -0
- package/dist/openapi/models/SendEventsRequest.js +31 -0
- package/dist/openapi/models/SendEventsResponse.d.ts +37 -0
- package/dist/openapi/models/SendEventsResponse.js +37 -0
- package/dist/openapi/models/UpdateCustomerRequest.d.ts +46 -0
- package/dist/openapi/models/UpdateCustomerRequest.js +55 -0
- package/dist/openapi/models/UpdateCustomerResponse.d.ts +29 -0
- package/dist/openapi/models/UpdateCustomerResponse.js +31 -0
- package/dist/openapi/models/UpdateMeterRequest.d.ts +39 -0
- package/dist/openapi/models/UpdateMeterRequest.js +49 -0
- package/dist/openapi/models/UpdateMeterResponse.d.ts +29 -0
- package/dist/openapi/models/UpdateMeterResponse.js +31 -0
- package/dist/openapi/models/WebhookSubscribeRequest.d.ts +30 -0
- package/dist/openapi/models/WebhookSubscribeRequest.js +37 -0
- package/dist/openapi/models/all.d.ts +82 -0
- package/dist/openapi/models/all.js +98 -0
- package/dist/openapi/rxjsStub.d.ts +10 -0
- package/dist/openapi/rxjsStub.js +31 -0
- package/dist/openapi/servers.d.ts +39 -0
- package/dist/openapi/servers.js +52 -0
- package/dist/openapi/types/ObservableAPI.d.ts +544 -0
- package/dist/openapi/types/ObservableAPI.js +1089 -0
- package/dist/openapi/types/PromiseAPI.d.ts +521 -0
- package/dist/openapi/types/PromiseAPI.js +702 -0
- package/dist/openapi/util.d.ts +15 -0
- package/dist/openapi/util.js +42 -0
- package/dist/openapi-v2/apis/AuthenticationApi.d.ts +24 -0
- package/dist/openapi-v2/apis/AuthenticationApi.js +79 -0
- package/dist/openapi-v2/apis/CustomersApi.d.ts +76 -0
- package/dist/openapi-v2/apis/CustomersApi.js +295 -0
- package/dist/openapi-v2/apis/EventsApi.d.ts +63 -0
- package/dist/openapi-v2/apis/EventsApi.js +231 -0
- package/dist/openapi-v2/apis/InvoicesApi.d.ts +88 -0
- package/dist/openapi-v2/apis/InvoicesApi.js +344 -0
- package/dist/openapi-v2/apis/ProductsApi.d.ts +90 -0
- package/dist/openapi-v2/apis/ProductsApi.js +359 -0
- package/dist/openapi-v2/apis/baseapi.d.ts +33 -0
- package/dist/openapi-v2/apis/baseapi.js +41 -0
- package/dist/openapi-v2/apis/exception.d.ts +19 -0
- package/dist/openapi-v2/apis/exception.js +22 -0
- package/dist/openapi-v2/auth/auth.d.ts +38 -0
- package/dist/openapi-v2/auth/auth.js +16 -0
- package/dist/openapi-v2/configuration.d.ts +63 -0
- package/dist/openapi-v2/configuration.js +34 -0
- package/dist/openapi-v2/http/http.d.ts +142 -0
- package/dist/openapi-v2/http/http.js +229 -0
- package/dist/openapi-v2/http/isomorphic-fetch.d.ts +5 -0
- package/dist/openapi-v2/http/isomorphic-fetch.js +33 -0
- package/dist/openapi-v2/index.d.ts +10 -0
- package/dist/openapi-v2/index.js +32 -0
- package/dist/openapi-v2/middleware.d.ts +54 -0
- package/dist/openapi-v2/middleware.js +16 -0
- package/dist/openapi-v2/models/APICreateCustomerPayload.d.ts +45 -0
- package/dist/openapi-v2/models/APICreateCustomerPayload.js +49 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.d.ts +41 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.js +49 -0
- package/dist/openapi-v2/models/APICreateProductPayload.d.ts +39 -0
- package/dist/openapi-v2/models/APICreateProductPayload.js +49 -0
- package/dist/openapi-v2/models/APICustomer.d.ts +64 -0
- package/dist/openapi-v2/models/APICustomer.js +76 -0
- package/dist/openapi-v2/models/APIEvent.d.ts +72 -0
- package/dist/openapi-v2/models/APIEvent.js +88 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.d.ts +49 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.js +55 -0
- package/dist/openapi-v2/models/APIInvoice.d.ts +71 -0
- package/dist/openapi-v2/models/APIInvoice.js +88 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.d.ts +38 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.js +40 -0
- package/dist/openapi-v2/models/APIProduct.d.ts +63 -0
- package/dist/openapi-v2/models/APIProduct.js +82 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.d.ts +43 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.js +49 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.d.ts +43 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.js +49 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.d.ts +43 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.js +49 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.d.ts +43 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.js +49 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.d.ts +45 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.js +49 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.d.ts +41 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.js +49 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.d.ts +39 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.js +49 -0
- package/dist/openapi-v2/models/Aggregation.d.ts +32 -0
- package/dist/openapi-v2/models/Aggregation.js +43 -0
- package/dist/openapi-v2/models/AggregationMethods.d.ts +18 -0
- package/dist/openapi-v2/models/AggregationMethods.js +22 -0
- package/dist/openapi-v2/models/Condition.d.ts +29 -0
- package/dist/openapi-v2/models/Condition.js +31 -0
- package/dist/openapi-v2/models/Criterion.d.ts +32 -0
- package/dist/openapi-v2/models/Criterion.js +43 -0
- package/dist/openapi-v2/models/CriterionOperators.d.ts +23 -0
- package/dist/openapi-v2/models/CriterionOperators.js +27 -0
- package/dist/openapi-v2/models/CriterionValue.d.ts +27 -0
- package/dist/openapi-v2/models/CriterionValue.js +24 -0
- package/dist/openapi-v2/models/Event.d.ts +54 -0
- package/dist/openapi-v2/models/Event.js +85 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.d.ts +31 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.js +43 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.d.ts +36 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.js +46 -0
- package/dist/openapi-v2/models/Login200Response.d.ts +28 -0
- package/dist/openapi-v2/models/Login200Response.js +31 -0
- package/dist/openapi-v2/models/LoginRequest.d.ts +28 -0
- package/dist/openapi-v2/models/LoginRequest.js +31 -0
- package/dist/openapi-v2/models/ObjectSerializer.d.ts +64 -0
- package/dist/openapi-v2/models/ObjectSerializer.js +368 -0
- package/dist/openapi-v2/models/Pricing.d.ts +30 -0
- package/dist/openapi-v2/models/Pricing.js +37 -0
- package/dist/openapi-v2/models/PricingTiersInner.d.ts +31 -0
- package/dist/openapi-v2/models/PricingTiersInner.js +49 -0
- package/dist/openapi-v2/models/ProductBreakdown.d.ts +29 -0
- package/dist/openapi-v2/models/ProductBreakdown.js +37 -0
- package/dist/openapi-v2/models/ProductRevision.d.ts +36 -0
- package/dist/openapi-v2/models/ProductRevision.js +55 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.d.ts +40 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.js +43 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.d.ts +40 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.js +43 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.d.ts +40 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.js +43 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.d.ts +40 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.js +43 -0
- package/dist/openapi-v2/models/ReviseProductPayload.d.ts +37 -0
- package/dist/openapi-v2/models/ReviseProductPayload.js +43 -0
- package/dist/openapi-v2/models/UpdateEventPayload.d.ts +33 -0
- package/dist/openapi-v2/models/UpdateEventPayload.js +31 -0
- package/dist/openapi-v2/models/all.d.ts +37 -0
- package/dist/openapi-v2/models/all.js +53 -0
- package/dist/openapi-v2/rxjsStub.d.ts +10 -0
- package/dist/openapi-v2/rxjsStub.js +31 -0
- package/dist/openapi-v2/servers.d.ts +38 -0
- package/dist/openapi-v2/servers.js +51 -0
- package/dist/openapi-v2/types/ObservableAPI.d.ts +245 -0
- package/dist/openapi-v2/types/ObservableAPI.js +608 -0
- package/dist/openapi-v2/types/PromiseAPI.d.ts +234 -0
- package/dist/openapi-v2/types/PromiseAPI.js +354 -0
- package/dist/openapi-v2/util.d.ts +15 -0
- package/dist/openapi-v2/util.js +42 -0
- package/dist/sdk/clients/ContractsClient.d.ts +10 -0
- package/dist/sdk/clients/ContractsClient.js +42 -0
- package/dist/sdk/clients/CustomersClient.d.ts +12 -0
- package/dist/sdk/clients/CustomersClient.js +52 -0
- package/dist/sdk/clients/EventsClient.d.ts +11 -0
- package/dist/sdk/clients/EventsClient.js +49 -0
- package/dist/sdk/clients/InvoicesClient.d.ts +7 -0
- package/dist/sdk/clients/InvoicesClient.js +32 -0
- package/dist/sdk/clients/MetersClient.d.ts +10 -0
- package/dist/sdk/clients/MetersClient.js +42 -0
- package/dist/sdk/clients/PlansClient.d.ts +8 -0
- package/dist/sdk/clients/PlansClient.js +37 -0
- package/dist/sdk/clients/WebhooksClient.d.ts +6 -0
- package/dist/sdk/clients/WebhooksClient.js +25 -0
- package/dist/sdk/clients/index.d.ts +7 -0
- package/dist/sdk/clients/index.js +23 -0
- package/dist/sdk/index.d.ts +14 -0
- package/dist/sdk/index.js +62 -0
- package/dist/sdk/services/configuration.service.d.ts +21 -0
- package/dist/sdk/services/configuration.service.js +104 -0
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/sdk/services/index.js +17 -0
- package/dist/sdk/types/Contracts.d.ts +1 -0
- package/dist/sdk/types/Contracts.js +2 -0
- package/dist/sdk/types/Customers.d.ts +1 -0
- package/dist/sdk/types/Customers.js +2 -0
- package/dist/sdk/types/Events.d.ts +1 -0
- package/dist/sdk/types/Events.js +2 -0
- package/dist/sdk/types/Invoices.d.ts +1 -0
- package/dist/sdk/types/Invoices.js +2 -0
- package/dist/sdk/types/Meters.d.ts +1 -0
- package/dist/sdk/types/Meters.js +2 -0
- package/dist/sdk/types/Plans.d.ts +1 -0
- package/dist/sdk/types/Plans.js +2 -0
- package/dist/sdk/types/index.d.ts +7 -0
- package/dist/sdk/types/index.js +23 -0
- package/dist/sdk/types/pagination-options.d.ts +4 -0
- package/dist/sdk/types/pagination-options.js +2 -0
- package/dist/sdk-v2/clients/CustomersClient.d.ts +10 -0
- package/dist/sdk-v2/clients/CustomersClient.js +45 -0
- package/dist/sdk-v2/clients/EventsClient.d.ts +9 -0
- package/dist/sdk-v2/clients/EventsClient.js +46 -0
- package/dist/sdk-v2/clients/InvoicesClient.d.ts +11 -0
- package/dist/sdk-v2/clients/InvoicesClient.js +50 -0
- package/dist/sdk-v2/clients/ProductsClient.d.ts +11 -0
- package/dist/sdk-v2/clients/ProductsClient.js +50 -0
- package/dist/sdk-v2/clients/index.d.ts +4 -0
- package/dist/sdk-v2/clients/index.js +20 -0
- package/dist/sdk-v2/index.d.ts +11 -0
- package/dist/sdk-v2/index.js +53 -0
- package/dist/sdk-v2/services/configuration.service.d.ts +21 -0
- package/dist/sdk-v2/services/configuration.service.js +98 -0
- package/dist/sdk-v2/services/index.d.ts +1 -0
- package/dist/sdk-v2/services/index.js +17 -0
- package/dist/sdk-v2/types/Customers.d.ts +1 -0
- package/dist/sdk-v2/types/Customers.js +2 -0
- package/dist/sdk-v2/types/Events.d.ts +1 -0
- package/dist/sdk-v2/types/Events.js +2 -0
- package/dist/sdk-v2/types/Invoices.d.ts +1 -0
- package/dist/sdk-v2/types/Invoices.js +2 -0
- package/dist/sdk-v2/types/Products.d.ts +1 -0
- package/dist/sdk-v2/types/Products.js +2 -0
- package/dist/sdk-v2/types/index.d.ts +6 -0
- package/dist/sdk-v2/types/index.js +23 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +17 -0
- package/dist/v2.d.ts +1 -0
- package/dist/v2.js +17 -0
- package/package.json +17 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./pagination-options"), exports);
|
|
18
|
+
__exportStar(require("./Contracts"), exports);
|
|
19
|
+
__exportStar(require("./Customers"), exports);
|
|
20
|
+
__exportStar(require("./Events"), exports);
|
|
21
|
+
__exportStar(require("./Invoices"), exports);
|
|
22
|
+
__exportStar(require("./Meters"), exports);
|
|
23
|
+
__exportStar(require("./Plans"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { APIQueryPayloadAPICustomer, APICreateCustomerPayload, APIUpdateCustomerPayload } from '../../openapi-v2';
|
|
2
|
+
export declare class CustomersClient {
|
|
3
|
+
private client;
|
|
4
|
+
constructor();
|
|
5
|
+
get(id: string): Promise<import("../../openapi-v2").APICustomer>;
|
|
6
|
+
create(payload: APICreateCustomerPayload): Promise<import("../../openapi-v2").APICustomer>;
|
|
7
|
+
update(id: string, payload: APIUpdateCustomerPayload): Promise<import("../../openapi-v2").APICustomer>;
|
|
8
|
+
delete(id: string): Promise<void>;
|
|
9
|
+
query(payload: APIQueryPayloadAPICustomer): Promise<import("../../openapi-v2").QueryResultAPICustomer>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CustomersClient = void 0;
|
|
13
|
+
const openapi_v2_1 = require("../../openapi-v2");
|
|
14
|
+
const services_1 = require("../services");
|
|
15
|
+
class CustomersClient {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.CustomersApi);
|
|
18
|
+
}
|
|
19
|
+
get(id) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.client.getCustomer(id);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
create(payload) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return this.client.createCustomer(payload);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
update(id, payload) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
return this.client.updateCustomer(payload, id);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
delete(id) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return this.client.deleteCustomer(id);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
query(payload) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return this.client.queryCustomers(payload);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.CustomersClient = CustomersClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { APIQueryPayloadAPIEvent, APIIngestEventPayload } from '../../openapi-v2';
|
|
2
|
+
export declare class EventsClient {
|
|
3
|
+
private client;
|
|
4
|
+
constructor();
|
|
5
|
+
get(id: string): Promise<import("../../openapi-v2").APIEvent>;
|
|
6
|
+
delete(id: string): Promise<void>;
|
|
7
|
+
query(query: APIQueryPayloadAPIEvent): Promise<import("../../openapi-v2").QueryResultAPIEvent>;
|
|
8
|
+
ingest(payload: APIIngestEventPayload[]): Promise<import("../../openapi-v2").IngestEventToTheSystem201Response>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EventsClient = void 0;
|
|
13
|
+
const openapi_v2_1 = require("../../openapi-v2");
|
|
14
|
+
const services_1 = require("../services");
|
|
15
|
+
class EventsClient {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.EventsApi);
|
|
18
|
+
}
|
|
19
|
+
get(id) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.client.getEvent(id);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
// async create(payload: CreateEventPayload) {
|
|
25
|
+
// return this.client.createEvent(payload);
|
|
26
|
+
// }
|
|
27
|
+
// async update(id: string, payload: UpdateEventPayload) {
|
|
28
|
+
// return this.client.updateEvent(payload, id);
|
|
29
|
+
// }
|
|
30
|
+
delete(id) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return this.client.deleteEvent(id);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
query(query) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
return this.client.queryEvents(query);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
ingest(payload) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return this.client.ingestEventToTheSystem(payload);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.EventsClient = EventsClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { APIQueryPayloadAPIInvoice, APICreateInvoicePayload, APIUpdateInvoicePayload } from '../../openapi-v2';
|
|
2
|
+
export declare class InvoicesClient {
|
|
3
|
+
private client;
|
|
4
|
+
constructor();
|
|
5
|
+
get(id: string): Promise<import("../../openapi-v2").APIInvoice>;
|
|
6
|
+
create(payload: APICreateInvoicePayload): Promise<import("../../openapi-v2").APIInvoice>;
|
|
7
|
+
update(id: string, payload: APIUpdateInvoicePayload): Promise<import("../../openapi-v2").APIInvoice>;
|
|
8
|
+
delete(id: string): Promise<void>;
|
|
9
|
+
query(payload: APIQueryPayloadAPIInvoice): Promise<import("../../openapi-v2").QueryResultAPIInvoice>;
|
|
10
|
+
calculate(id: string): Promise<import("../../openapi-v2").APIInvoice>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InvoicesClient = void 0;
|
|
13
|
+
const openapi_v2_1 = require("../../openapi-v2");
|
|
14
|
+
const services_1 = require("../services");
|
|
15
|
+
class InvoicesClient {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.InvoicesApi);
|
|
18
|
+
}
|
|
19
|
+
get(id) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.client.getInvoice(id);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
create(payload) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return this.client.createInvoice(payload);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
update(id, payload) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
return this.client.updateInvoice(payload, id);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
delete(id) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return this.client.deleteInvoice(id);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
query(payload) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return this.client.queryInvoices(payload);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
calculate(id) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return this.client.calculateInvoice(id);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.InvoicesClient = InvoicesClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { APIQueryPayloadAPIProduct, APICreateProductPayload, APIUpdateProductPayload, ReviseProductPayload } from '../../openapi-v2';
|
|
2
|
+
export declare class ProductsClient {
|
|
3
|
+
private client;
|
|
4
|
+
constructor();
|
|
5
|
+
get(id: string): Promise<import("../../openapi-v2").APIProduct>;
|
|
6
|
+
create(payload: APICreateProductPayload): Promise<import("../../openapi-v2").APIProduct>;
|
|
7
|
+
update(id: string, payload: APIUpdateProductPayload): Promise<import("../../openapi-v2").APIProduct>;
|
|
8
|
+
revise(id: string, payload: ReviseProductPayload): Promise<import("../../openapi-v2").APIProduct>;
|
|
9
|
+
delete(id: string): Promise<void>;
|
|
10
|
+
query(query: APIQueryPayloadAPIProduct): Promise<import("../../openapi-v2").QueryResultAPIProduct>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductsClient = void 0;
|
|
13
|
+
const openapi_v2_1 = require("../../openapi-v2");
|
|
14
|
+
const services_1 = require("../services");
|
|
15
|
+
class ProductsClient {
|
|
16
|
+
constructor() {
|
|
17
|
+
this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.ProductsApi);
|
|
18
|
+
}
|
|
19
|
+
get(id) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.client.getProduct(id);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
create(payload) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return this.client.createProduct(payload);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
update(id, payload) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
return this.client.updateProduct(payload, id);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
revise(id, payload) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return this.client.reviseAProduct(payload, id);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
delete(id) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return this.client.deleteProduct(id);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
query(query) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return this.client.queryProducts(query);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.ProductsClient = ProductsClient;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CustomersClient"), exports);
|
|
18
|
+
__exportStar(require("./EventsClient"), exports);
|
|
19
|
+
__exportStar(require("./InvoicesClient"), exports);
|
|
20
|
+
__exportStar(require("./ProductsClient"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CustomersClient, EventsClient, InvoicesClient, ProductsClient } from './clients';
|
|
2
|
+
export declare class Vayu {
|
|
3
|
+
private configurationManager;
|
|
4
|
+
constructor(apiKey: string, _baseUrl?: string);
|
|
5
|
+
login(): Promise<void>;
|
|
6
|
+
get events(): EventsClient;
|
|
7
|
+
get customers(): CustomersClient;
|
|
8
|
+
get products(): ProductsClient;
|
|
9
|
+
get invoices(): InvoicesClient;
|
|
10
|
+
}
|
|
11
|
+
export * from './types';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Vayu = void 0;
|
|
27
|
+
const clients_1 = require("./clients");
|
|
28
|
+
const services_1 = require("./services");
|
|
29
|
+
class Vayu {
|
|
30
|
+
constructor(apiKey, _baseUrl) {
|
|
31
|
+
const baseServer = services_1.ConfigurationService.generateServerConfiguration('http://connect.v2.dev.withvayu.com');
|
|
32
|
+
this.configurationManager = services_1.ConfigurationService.initialize(apiKey, baseServer);
|
|
33
|
+
}
|
|
34
|
+
login() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
yield this.configurationManager.generateToken();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
get events() {
|
|
40
|
+
return new clients_1.EventsClient();
|
|
41
|
+
}
|
|
42
|
+
get customers() {
|
|
43
|
+
return new clients_1.CustomersClient();
|
|
44
|
+
}
|
|
45
|
+
get products() {
|
|
46
|
+
return new clients_1.ProductsClient();
|
|
47
|
+
}
|
|
48
|
+
get invoices() {
|
|
49
|
+
return new clients_1.InvoicesClient();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.Vayu = Vayu;
|
|
53
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BaseServerConfiguration, Configuration } from '../../openapi-v2';
|
|
2
|
+
export declare class ConfigurationService {
|
|
3
|
+
private apiKey;
|
|
4
|
+
private baseServer;
|
|
5
|
+
private static _instance;
|
|
6
|
+
static get instance(): ConfigurationService;
|
|
7
|
+
static initialize(apiKey: string, baseServer: BaseServerConfiguration): ConfigurationService;
|
|
8
|
+
static generateServerConfiguration(baseUrl?: string): BaseServerConfiguration;
|
|
9
|
+
private accessToken;
|
|
10
|
+
private expiresAt;
|
|
11
|
+
constructor(apiKey: string, baseServer: BaseServerConfiguration);
|
|
12
|
+
generateNewClient<T extends {
|
|
13
|
+
new (config: Configuration): InstanceType<T>;
|
|
14
|
+
}>(ClientClass: T): InstanceType<T>;
|
|
15
|
+
generateToken(): Promise<{
|
|
16
|
+
accessToken: string;
|
|
17
|
+
expiresAt: number | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
validateIsLoggedIn(): void;
|
|
20
|
+
private get configuration();
|
|
21
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ConfigurationService = void 0;
|
|
16
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
17
|
+
const openapi_v2_1 = require("../../openapi-v2");
|
|
18
|
+
const EXPIRATION_THRESHOLD = 1000 * 60 * 5;
|
|
19
|
+
const BASE_URLS_MAP = new Map([]);
|
|
20
|
+
/* eslint-disable no-underscore-dangle */
|
|
21
|
+
class ConfigurationService {
|
|
22
|
+
static get instance() {
|
|
23
|
+
if (!ConfigurationService._instance) {
|
|
24
|
+
throw new Error('ConfigurationService not initialized');
|
|
25
|
+
}
|
|
26
|
+
return ConfigurationService._instance;
|
|
27
|
+
}
|
|
28
|
+
static initialize(apiKey, baseServer) {
|
|
29
|
+
if (ConfigurationService._instance) {
|
|
30
|
+
throw new Error('ConfigurationService already initialized');
|
|
31
|
+
}
|
|
32
|
+
ConfigurationService._instance = new ConfigurationService(apiKey, baseServer);
|
|
33
|
+
return ConfigurationService._instance;
|
|
34
|
+
}
|
|
35
|
+
static generateServerConfiguration(baseUrl) {
|
|
36
|
+
const baseServer = BASE_URLS_MAP.get(baseUrl !== null && baseUrl !== void 0 ? baseUrl : '');
|
|
37
|
+
return baseServer !== null && baseServer !== void 0 ? baseServer : new openapi_v2_1.ServerConfiguration(baseUrl !== null && baseUrl !== void 0 ? baseUrl : '', {});
|
|
38
|
+
}
|
|
39
|
+
constructor(apiKey, baseServer) {
|
|
40
|
+
this.apiKey = apiKey;
|
|
41
|
+
this.baseServer = baseServer;
|
|
42
|
+
this.expiresAt = Date.now();
|
|
43
|
+
}
|
|
44
|
+
generateNewClient(ClientClass) {
|
|
45
|
+
this.validateIsLoggedIn();
|
|
46
|
+
const newClient = new ClientClass(this.configuration);
|
|
47
|
+
return newClient;
|
|
48
|
+
}
|
|
49
|
+
generateToken() {
|
|
50
|
+
var _a;
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const authClient = new openapi_v2_1.AuthenticationApi((0, openapi_v2_1.createConfiguration)({
|
|
53
|
+
baseServer: this.baseServer,
|
|
54
|
+
}));
|
|
55
|
+
const login = yield authClient.login({
|
|
56
|
+
refreshToken: this.apiKey,
|
|
57
|
+
});
|
|
58
|
+
this.accessToken = login.accessToken;
|
|
59
|
+
const decodedJWT = jsonwebtoken_1.default.decode(this.accessToken);
|
|
60
|
+
if (!decodedJWT) {
|
|
61
|
+
throw new Error('Invalid JWT token');
|
|
62
|
+
}
|
|
63
|
+
this.expiresAt = ((_a = decodedJWT.exp) !== null && _a !== void 0 ? _a : Math.floor(Date.now() / 1000) + 60 * 15) * 1000;
|
|
64
|
+
return {
|
|
65
|
+
accessToken: login.accessToken,
|
|
66
|
+
expiresAt: decodedJWT.exp,
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
validateIsLoggedIn() {
|
|
71
|
+
if (!this.accessToken) {
|
|
72
|
+
throw new Error('Please login first');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
get configuration() {
|
|
76
|
+
return (0, openapi_v2_1.createConfiguration)({
|
|
77
|
+
baseServer: this.baseServer,
|
|
78
|
+
authMethods: {
|
|
79
|
+
default: {
|
|
80
|
+
getName: () => 'Logged In',
|
|
81
|
+
applySecurityAuthentication: () => this.validateIsLoggedIn(),
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
promiseMiddleware: [{
|
|
85
|
+
pre: (context) => __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
if (this.expiresAt <= Date.now() + EXPIRATION_THRESHOLD) {
|
|
87
|
+
yield this.generateToken();
|
|
88
|
+
}
|
|
89
|
+
context.setHeaderParam('Authorization', `Bearer ${this.accessToken}`);
|
|
90
|
+
return context;
|
|
91
|
+
}),
|
|
92
|
+
post: (context) => __awaiter(this, void 0, void 0, function* () { return (context); }),
|
|
93
|
+
}],
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.ConfigurationService = ConfigurationService;
|
|
98
|
+
ConfigurationService._instance = null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './configuration.service';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./configuration.service"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { APICustomer as Customer, APICreateCustomerPayload as CreateCustomerPayload, APIUpdateCustomerPayload as UpdateCustomerPayload, APIQueryPayloadAPICustomer as QueryCustomerPayload, } from '../../openapi-v2';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { APIEvent as Event, APIIngestEventPayload as IngestEventPayload, IngestEventToTheSystem201Response as IngestEventResponse, } from '../../openapi-v2';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { APIInvoice as Invoice, APICreateInvoicePayload as CreateInvoicePayload, APIUpdateInvoicePayload as UpdateInvoicePayload, APIQueryPayloadAPIInvoice as QueryInvoicePayload, } from '../../openapi-v2';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ProductBreakdown, APICreateProductPayload as CreateProductPayload, APIProduct as Product, APIUpdateProductPayload as UpdateProductPayload, APIQueryPayloadAPIProduct as QueryProductPayload, ReviseProductPayload, InvoiceProductBreakdown, } from '../../openapi-v2';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './Customers';
|
|
2
|
+
export * from './Events';
|
|
3
|
+
export * from './Invoices';
|
|
4
|
+
export * from './Products';
|
|
5
|
+
export { AggregationMethods, } from '../../openapi-v2';
|
|
6
|
+
export type { Aggregation, Criterion, Condition, CriterionOperators, CriterionValue, Pricing, PricingTiersInner as PricingTiers, } from '../../openapi-v2';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AggregationMethods = void 0;
|
|
18
|
+
__exportStar(require("./Customers"), exports);
|
|
19
|
+
__exportStar(require("./Events"), exports);
|
|
20
|
+
__exportStar(require("./Invoices"), exports);
|
|
21
|
+
__exportStar(require("./Products"), exports);
|
|
22
|
+
var openapi_v2_1 = require("../../openapi-v2");
|
|
23
|
+
Object.defineProperty(exports, "AggregationMethods", { enumerable: true, get: function () { return openapi_v2_1.AggregationMethods; } });
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sdk/types';
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sdk/types"), exports);
|
package/dist/v2.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sdk-v2';
|
package/dist/v2.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./sdk-v2"), exports);
|