vayu-ts 0.2.6 → 0.2.7-test2

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.
Files changed (301) hide show
  1. package/dist/openapi/apis/AuthApi.js +47 -61
  2. package/dist/openapi/apis/ContractsApi.js +203 -232
  3. package/dist/openapi/apis/CreditsApi.js +162 -186
  4. package/dist/openapi/apis/CustomersApi.d.ts +15 -0
  5. package/dist/openapi/apis/CustomersApi.js +378 -353
  6. package/dist/openapi/apis/EventsApi.js +282 -316
  7. package/dist/openapi/apis/IntegrationsApi.js +105 -124
  8. package/dist/openapi/apis/InvoicesApi.js +100 -119
  9. package/dist/openapi/apis/MetersApi.js +211 -240
  10. package/dist/openapi/apis/PlansApi.js +150 -174
  11. package/dist/openapi/apis/ProductConsumptionsApi.d.ts +25 -0
  12. package/dist/openapi/apis/ProductConsumptionsApi.js +82 -0
  13. package/dist/openapi/apis/ReportsApi.js +100 -119
  14. package/dist/openapi/apis/WebhooksApi.js +55 -69
  15. package/dist/openapi/auth/auth.d.ts +1 -0
  16. package/dist/openapi/auth/auth.js +2 -13
  17. package/dist/openapi/http/http.d.ts +7 -20
  18. package/dist/openapi/http/http.js +15 -25
  19. package/dist/openapi/index.d.ts +3 -3
  20. package/dist/openapi/index.js +2 -1
  21. package/dist/openapi/models/Address.d.ts +3 -0
  22. package/dist/openapi/models/Address.js +1 -0
  23. package/dist/openapi/models/AggregationMethod.d.ts +3 -0
  24. package/dist/openapi/models/AggregationMethod.js +1 -0
  25. package/dist/openapi/models/Condition.d.ts +3 -0
  26. package/dist/openapi/models/Condition.js +1 -0
  27. package/dist/openapi/models/Contact.d.ts +4 -1
  28. package/dist/openapi/models/Contact.js +3 -2
  29. package/dist/openapi/models/ContractStatus.d.ts +1 -0
  30. package/dist/openapi/models/ContractStatus.js +1 -0
  31. package/dist/openapi/models/CreateContractRequest.d.ts +3 -0
  32. package/dist/openapi/models/CreateContractRequest.js +1 -0
  33. package/dist/openapi/models/CreateContractResponse.d.ts +3 -0
  34. package/dist/openapi/models/CreateContractResponse.js +1 -0
  35. package/dist/openapi/models/CreateCustomerRequest.d.ts +3 -0
  36. package/dist/openapi/models/CreateCustomerRequest.js +1 -0
  37. package/dist/openapi/models/CreateCustomerResponse.d.ts +3 -0
  38. package/dist/openapi/models/CreateCustomerResponse.js +1 -0
  39. package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +3 -0
  40. package/dist/openapi/models/CreateCustomerResponseCustomer.js +1 -0
  41. package/dist/openapi/models/CreditLedgerEntry.d.ts +3 -0
  42. package/dist/openapi/models/CreditLedgerEntry.js +1 -0
  43. package/dist/openapi/models/Criterion.d.ts +3 -0
  44. package/dist/openapi/models/Criterion.js +1 -0
  45. package/dist/openapi/models/CriterionOperator.d.ts +3 -1
  46. package/dist/openapi/models/CriterionOperator.js +2 -0
  47. package/dist/openapi/models/DeductCreditsRequest.d.ts +3 -0
  48. package/dist/openapi/models/DeductCreditsRequest.js +1 -0
  49. package/dist/openapi/models/DeleteContractResponse.d.ts +3 -0
  50. package/dist/openapi/models/DeleteContractResponse.js +1 -0
  51. package/dist/openapi/models/DeleteContractResponseContract.d.ts +3 -0
  52. package/dist/openapi/models/DeleteContractResponseContract.js +1 -0
  53. package/dist/openapi/models/DeleteCustomerResponse.d.ts +3 -0
  54. package/dist/openapi/models/DeleteCustomerResponse.js +1 -0
  55. package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +3 -0
  56. package/dist/openapi/models/DeleteCustomerResponseCustomer.js +1 -0
  57. package/dist/openapi/models/DeleteEventResponse.d.ts +3 -0
  58. package/dist/openapi/models/DeleteEventResponse.js +1 -0
  59. package/dist/openapi/models/DeleteEventResponseEvent.d.ts +3 -0
  60. package/dist/openapi/models/DeleteEventResponseEvent.js +1 -0
  61. package/dist/openapi/models/DeleteMeterResponse.d.ts +3 -0
  62. package/dist/openapi/models/DeleteMeterResponse.js +1 -0
  63. package/dist/openapi/models/DeleteMeterResponseMeter.d.ts +3 -0
  64. package/dist/openapi/models/DeleteMeterResponseMeter.js +1 -0
  65. package/dist/openapi/models/DeletePlanResponse.d.ts +3 -0
  66. package/dist/openapi/models/DeletePlanResponse.js +1 -0
  67. package/dist/openapi/models/DeletePlanResponsePlan.d.ts +3 -0
  68. package/dist/openapi/models/DeletePlanResponsePlan.js +1 -0
  69. package/dist/openapi/models/Event.d.ts +3 -0
  70. package/dist/openapi/models/Event.js +1 -0
  71. package/dist/openapi/models/EventsDryRunRequest.d.ts +3 -0
  72. package/dist/openapi/models/EventsDryRunRequest.js +1 -0
  73. package/dist/openapi/models/EventsDryRunResponse.d.ts +3 -0
  74. package/dist/openapi/models/EventsDryRunResponse.js +1 -0
  75. package/dist/openapi/models/EventsDryRunResponseObject.d.ts +3 -0
  76. package/dist/openapi/models/EventsDryRunResponseObject.js +1 -0
  77. package/dist/openapi/models/EventsDryRunResponseObjectEvent.d.ts +3 -0
  78. package/dist/openapi/models/EventsDryRunResponseObjectEvent.js +1 -0
  79. package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +3 -0
  80. package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.js +1 -0
  81. package/dist/openapi/models/Filter.d.ts +3 -0
  82. package/dist/openapi/models/Filter.js +1 -0
  83. package/dist/openapi/models/FullDayPeriod.d.ts +3 -0
  84. package/dist/openapi/models/FullDayPeriod.js +1 -0
  85. package/dist/openapi/models/GetCommitmentReportResponse.d.ts +5 -0
  86. package/dist/openapi/models/GetCommitmentReportResponse.js +13 -0
  87. package/dist/openapi/models/GetContractResponse.d.ts +3 -0
  88. package/dist/openapi/models/GetContractResponse.js +1 -0
  89. package/dist/openapi/models/GetContractResponseContract.d.ts +3 -0
  90. package/dist/openapi/models/GetContractResponseContract.js +1 -0
  91. package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.d.ts +32 -0
  92. package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.js +32 -0
  93. package/dist/openapi/models/GetCustomerResponse.d.ts +3 -0
  94. package/dist/openapi/models/GetCustomerResponse.js +1 -0
  95. package/dist/openapi/models/GetEventResponse.d.ts +3 -0
  96. package/dist/openapi/models/GetEventResponse.js +1 -0
  97. package/dist/openapi/models/GetEventResponseEvent.d.ts +3 -0
  98. package/dist/openapi/models/GetEventResponseEvent.js +1 -0
  99. package/dist/openapi/models/GetInvoiceResponse.d.ts +3 -0
  100. package/dist/openapi/models/GetInvoiceResponse.js +1 -0
  101. package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +3 -0
  102. package/dist/openapi/models/GetInvoiceResponseInvoice.js +1 -0
  103. package/dist/openapi/models/GetMeterResponse.d.ts +3 -0
  104. package/dist/openapi/models/GetMeterResponse.js +1 -0
  105. package/dist/openapi/models/GetMeterResponseMeter.d.ts +3 -0
  106. package/dist/openapi/models/GetMeterResponseMeter.js +1 -0
  107. package/dist/openapi/models/GetPlanResponse.d.ts +3 -0
  108. package/dist/openapi/models/GetPlanResponse.js +1 -0
  109. package/dist/openapi/models/GetPlanResponsePlan.d.ts +3 -0
  110. package/dist/openapi/models/GetPlanResponsePlan.js +1 -0
  111. package/dist/openapi/models/GetProductConsumptionResponse.d.ts +32 -0
  112. package/dist/openapi/models/GetProductConsumptionResponse.js +32 -0
  113. package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.d.ts +59 -0
  114. package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.js +74 -0
  115. package/dist/openapi/models/GetProductsUsageReportResponse.d.ts +5 -0
  116. package/dist/openapi/models/GetProductsUsageReportResponse.js +13 -0
  117. package/dist/openapi/models/GrantCreditsRequest.d.ts +3 -0
  118. package/dist/openapi/models/GrantCreditsRequest.js +1 -0
  119. package/dist/openapi/models/InvalidEvent.d.ts +3 -0
  120. package/dist/openapi/models/InvalidEvent.js +1 -0
  121. package/dist/openapi/models/LineItem.d.ts +3 -0
  122. package/dist/openapi/models/LineItem.js +1 -0
  123. package/dist/openapi/models/LineItemRevenueBreakdown.d.ts +3 -0
  124. package/dist/openapi/models/LineItemRevenueBreakdown.js +1 -0
  125. package/dist/openapi/models/ListContractsResponse.d.ts +3 -0
  126. package/dist/openapi/models/ListContractsResponse.js +1 -0
  127. package/dist/openapi/models/ListCreditLedgerEntriesResponse.d.ts +3 -0
  128. package/dist/openapi/models/ListCreditLedgerEntriesResponse.js +1 -0
  129. package/dist/openapi/models/ListCustomersResponse.d.ts +3 -0
  130. package/dist/openapi/models/ListCustomersResponse.js +1 -0
  131. package/dist/openapi/models/ListInvoicesResponse.d.ts +3 -0
  132. package/dist/openapi/models/ListInvoicesResponse.js +1 -0
  133. package/dist/openapi/models/ListMetersResponse.d.ts +3 -0
  134. package/dist/openapi/models/ListMetersResponse.js +1 -0
  135. package/dist/openapi/models/ListPlansResponse.d.ts +3 -0
  136. package/dist/openapi/models/ListPlansResponse.js +1 -0
  137. package/dist/openapi/models/LoginRequest.d.ts +3 -0
  138. package/dist/openapi/models/LoginRequest.js +1 -0
  139. package/dist/openapi/models/LoginResponse.d.ts +3 -0
  140. package/dist/openapi/models/LoginResponse.js +1 -0
  141. package/dist/openapi/models/Meter.d.ts +3 -0
  142. package/dist/openapi/models/Meter.js +1 -0
  143. package/dist/openapi/models/NetSuiteExportSalesOrderRequest.d.ts +3 -0
  144. package/dist/openapi/models/NetSuiteExportSalesOrderRequest.js +1 -0
  145. package/dist/openapi/models/NetSuiteSyncInvoicesRequest.d.ts +3 -0
  146. package/dist/openapi/models/NetSuiteSyncInvoicesRequest.js +1 -0
  147. package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.d.ts +3 -0
  148. package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.js +1 -0
  149. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.d.ts +3 -0
  150. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.js +1 -0
  151. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.d.ts +3 -0
  152. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.js +1 -0
  153. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.d.ts +3 -0
  154. package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.js +1 -0
  155. package/dist/openapi/models/NetSuiteSyncInvoicesResponse.d.ts +3 -0
  156. package/dist/openapi/models/NetSuiteSyncInvoicesResponse.js +1 -0
  157. package/dist/openapi/models/NotificationEventType.d.ts +2 -1
  158. package/dist/openapi/models/NotificationEventType.js +1 -0
  159. package/dist/openapi/models/ObjectSerializer.d.ts +6 -0
  160. package/dist/openapi/models/ObjectSerializer.js +68 -11
  161. package/dist/openapi/models/PlanBillingData.d.ts +5 -1
  162. package/dist/openapi/models/PlanBillingData.js +2 -1
  163. package/dist/openapi/models/PlanDuration.d.ts +30 -0
  164. package/dist/openapi/models/PlanDuration.js +25 -0
  165. package/dist/openapi/models/ProductConsumption.d.ts +59 -0
  166. package/dist/openapi/models/ProductConsumption.js +74 -0
  167. package/dist/openapi/models/QueryEventsResponse.d.ts +3 -0
  168. package/dist/openapi/models/QueryEventsResponse.js +1 -0
  169. package/dist/openapi/models/QueryEventsResponseEventsInner.d.ts +3 -0
  170. package/dist/openapi/models/QueryEventsResponseEventsInner.js +1 -0
  171. package/dist/openapi/models/SendEventsRequest.d.ts +3 -0
  172. package/dist/openapi/models/SendEventsRequest.js +1 -0
  173. package/dist/openapi/models/SendEventsResponse.d.ts +3 -0
  174. package/dist/openapi/models/SendEventsResponse.js +1 -0
  175. package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
  176. package/dist/openapi/models/UnlimitedDuration.js +18 -0
  177. package/dist/openapi/models/UpdateCustomerRequest.d.ts +3 -0
  178. package/dist/openapi/models/UpdateCustomerRequest.js +1 -0
  179. package/dist/openapi/models/UpdateCustomerResponse.d.ts +3 -0
  180. package/dist/openapi/models/UpdateCustomerResponse.js +1 -0
  181. package/dist/openapi/models/UpdateMeterRequest.d.ts +3 -0
  182. package/dist/openapi/models/UpdateMeterRequest.js +1 -0
  183. package/dist/openapi/models/UpdateMeterResponse.d.ts +3 -0
  184. package/dist/openapi/models/UpdateMeterResponse.js +1 -0
  185. package/dist/openapi/models/WebhookSubscribeRequest.d.ts +3 -0
  186. package/dist/openapi/models/WebhookSubscribeRequest.js +1 -0
  187. package/dist/openapi/models/all.d.ts +6 -0
  188. package/dist/openapi/models/all.js +6 -0
  189. package/dist/openapi/servers.js +2 -3
  190. package/dist/openapi/types/ObservableAPI.d.ts +71 -38
  191. package/dist/openapi/types/ObservableAPI.js +172 -105
  192. package/dist/openapi/types/PromiseAPI.d.ts +69 -38
  193. package/dist/openapi/types/PromiseAPI.js +85 -42
  194. package/dist/openapi-v2/apis/AuthenticationApi.js +35 -49
  195. package/dist/openapi-v2/apis/CustomersApi.js +230 -269
  196. package/dist/openapi-v2/apis/EntitlementsApi.js +98 -122
  197. package/dist/openapi-v2/apis/EventsApi.js +136 -165
  198. package/dist/openapi-v2/apis/InvoicesApi.js +214 -253
  199. package/dist/openapi-v2/apis/ProductsApi.js +182 -216
  200. package/dist/openapi-v2/auth/auth.d.ts +1 -0
  201. package/dist/openapi-v2/http/http.d.ts +7 -20
  202. package/dist/openapi-v2/http/http.js +15 -25
  203. package/dist/openapi-v2/index.d.ts +2 -2
  204. package/dist/openapi-v2/models/APICreateCustomerPayload.d.ts +3 -0
  205. package/dist/openapi-v2/models/APICreateCustomerPayload.js +1 -0
  206. package/dist/openapi-v2/models/APICreateInvoicePayload.d.ts +3 -0
  207. package/dist/openapi-v2/models/APICreateInvoicePayload.js +1 -0
  208. package/dist/openapi-v2/models/APICreateProductPayload.d.ts +3 -0
  209. package/dist/openapi-v2/models/APICreateProductPayload.js +1 -0
  210. package/dist/openapi-v2/models/APICustomer.d.ts +3 -0
  211. package/dist/openapi-v2/models/APICustomer.js +1 -0
  212. package/dist/openapi-v2/models/APIEntitlement.d.ts +3 -0
  213. package/dist/openapi-v2/models/APIEntitlement.js +1 -0
  214. package/dist/openapi-v2/models/APIEvent.d.ts +3 -0
  215. package/dist/openapi-v2/models/APIEvent.js +1 -0
  216. package/dist/openapi-v2/models/APIIngestEventPayload.d.ts +3 -0
  217. package/dist/openapi-v2/models/APIIngestEventPayload.js +1 -0
  218. package/dist/openapi-v2/models/APIInvoice.d.ts +3 -0
  219. package/dist/openapi-v2/models/APIInvoice.js +1 -0
  220. package/dist/openapi-v2/models/APIInvoiceBillingPeriod.d.ts +3 -0
  221. package/dist/openapi-v2/models/APIInvoiceBillingPeriod.js +1 -0
  222. package/dist/openapi-v2/models/APIProduct.d.ts +3 -0
  223. package/dist/openapi-v2/models/APIProduct.js +1 -0
  224. package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.d.ts +3 -0
  225. package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.js +1 -0
  226. package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.d.ts +3 -0
  227. package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.js +1 -0
  228. package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.d.ts +3 -0
  229. package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.js +1 -0
  230. package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.d.ts +3 -0
  231. package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.js +1 -0
  232. package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.d.ts +3 -0
  233. package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.js +1 -0
  234. package/dist/openapi-v2/models/APIUpdateCustomerPayload.d.ts +3 -0
  235. package/dist/openapi-v2/models/APIUpdateCustomerPayload.js +1 -0
  236. package/dist/openapi-v2/models/APIUpdateInvoicePayload.d.ts +3 -0
  237. package/dist/openapi-v2/models/APIUpdateInvoicePayload.js +1 -0
  238. package/dist/openapi-v2/models/APIUpdateProductPayload.d.ts +3 -0
  239. package/dist/openapi-v2/models/APIUpdateProductPayload.js +1 -0
  240. package/dist/openapi-v2/models/Aggregation.d.ts +3 -0
  241. package/dist/openapi-v2/models/Aggregation.js +1 -0
  242. package/dist/openapi-v2/models/Condition.d.ts +3 -0
  243. package/dist/openapi-v2/models/Condition.js +1 -0
  244. package/dist/openapi-v2/models/Criterion.d.ts +3 -0
  245. package/dist/openapi-v2/models/Criterion.js +1 -0
  246. package/dist/openapi-v2/models/CriterionValue.d.ts +3 -0
  247. package/dist/openapi-v2/models/CriterionValue.js +1 -0
  248. package/dist/openapi-v2/models/EntitlementRevision.d.ts +3 -0
  249. package/dist/openapi-v2/models/EntitlementRevision.js +1 -0
  250. package/dist/openapi-v2/models/IngestEventToTheSystem201Response.d.ts +3 -0
  251. package/dist/openapi-v2/models/IngestEventToTheSystem201Response.js +1 -0
  252. package/dist/openapi-v2/models/InvoiceProductBreakdown.d.ts +3 -0
  253. package/dist/openapi-v2/models/InvoiceProductBreakdown.js +1 -0
  254. package/dist/openapi-v2/models/Login200Response.d.ts +3 -0
  255. package/dist/openapi-v2/models/Login200Response.js +1 -0
  256. package/dist/openapi-v2/models/LoginRequest.d.ts +3 -0
  257. package/dist/openapi-v2/models/LoginRequest.js +1 -0
  258. package/dist/openapi-v2/models/ObjectSerializer.js +51 -11
  259. package/dist/openapi-v2/models/Pricing.d.ts +3 -0
  260. package/dist/openapi-v2/models/Pricing.js +1 -0
  261. package/dist/openapi-v2/models/PricingTiersInner.d.ts +3 -0
  262. package/dist/openapi-v2/models/PricingTiersInner.js +1 -0
  263. package/dist/openapi-v2/models/ProductBreakdown.d.ts +3 -0
  264. package/dist/openapi-v2/models/ProductBreakdown.js +1 -0
  265. package/dist/openapi-v2/models/QueryResultAPICustomer.d.ts +3 -0
  266. package/dist/openapi-v2/models/QueryResultAPICustomer.js +1 -0
  267. package/dist/openapi-v2/models/QueryResultAPIEntitlement.d.ts +3 -0
  268. package/dist/openapi-v2/models/QueryResultAPIEntitlement.js +1 -0
  269. package/dist/openapi-v2/models/QueryResultAPIEvent.d.ts +3 -0
  270. package/dist/openapi-v2/models/QueryResultAPIEvent.js +1 -0
  271. package/dist/openapi-v2/models/QueryResultAPIInvoice.d.ts +3 -0
  272. package/dist/openapi-v2/models/QueryResultAPIInvoice.js +1 -0
  273. package/dist/openapi-v2/models/QueryResultAPIProduct.d.ts +3 -0
  274. package/dist/openapi-v2/models/QueryResultAPIProduct.js +1 -0
  275. package/dist/openapi-v2/models/ReviseEntitlementPayload.d.ts +3 -0
  276. package/dist/openapi-v2/models/ReviseEntitlementPayload.js +1 -0
  277. package/dist/openapi-v2/servers.js +2 -3
  278. package/dist/openapi-v2/types/ObservableAPI.js +50 -50
  279. package/dist/sdk/clients/ContractsClient.js +10 -27
  280. package/dist/sdk/clients/CustomersClient.d.ts +1 -0
  281. package/dist/sdk/clients/CustomersClient.js +22 -40
  282. package/dist/sdk/clients/EventsClient.js +13 -32
  283. package/dist/sdk/clients/InvoicesClient.js +6 -19
  284. package/dist/sdk/clients/MetersClient.js +10 -27
  285. package/dist/sdk/clients/PlansClient.js +8 -23
  286. package/dist/sdk/clients/ProductsConsumptionsClient.d.ts +5 -0
  287. package/dist/sdk/clients/ProductsConsumptionsClient.js +14 -0
  288. package/dist/sdk/clients/WebhooksClient.js +2 -13
  289. package/dist/sdk/clients/index.d.ts +1 -0
  290. package/dist/sdk/clients/index.js +1 -0
  291. package/dist/sdk/index.d.ts +2 -1
  292. package/dist/sdk/index.js +5 -13
  293. package/dist/sdk/services/configuration.service.js +21 -33
  294. package/dist/sdk-v2/clients/CustomersClient.js +12 -33
  295. package/dist/sdk-v2/clients/EntitlementsClient.js +6 -21
  296. package/dist/sdk-v2/clients/EventsClient.js +8 -25
  297. package/dist/sdk-v2/clients/InvoicesClient.js +12 -33
  298. package/dist/sdk-v2/clients/ProductsClient.js +10 -29
  299. package/dist/sdk-v2/index.js +2 -13
  300. package/dist/sdk-v2/services/configuration.service.js +22 -34
  301. package/package.json +1 -1
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.MetersClient = void 0;
13
4
  const openapi_1 = require("../../openapi");
@@ -16,27 +7,19 @@ class MetersClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_1.MetersApi);
18
9
  }
19
- list(pagination) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const cursor = pagination === null || pagination === void 0 ? void 0 : pagination.cursor;
22
- const limit = pagination === null || pagination === void 0 ? void 0 : pagination.limit;
23
- return this.client.listMeters(limit, cursor);
24
- });
10
+ async list(pagination) {
11
+ const cursor = pagination?.cursor;
12
+ const limit = pagination?.limit;
13
+ return this.client.listMeters(limit, cursor);
25
14
  }
26
- get(id) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return this.client.getMeter(id);
29
- });
15
+ async get(id) {
16
+ return this.client.getMeter(id);
30
17
  }
31
- update(id, payload) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return this.client.updateMeter(payload, id);
34
- });
18
+ async update(id, payload) {
19
+ return this.client.updateMeter(payload, id);
35
20
  }
36
- delete(id) {
37
- return __awaiter(this, void 0, void 0, function* () {
38
- return this.client.deleteMeter(id);
39
- });
21
+ async delete(id) {
22
+ return this.client.deleteMeter(id);
40
23
  }
41
24
  }
42
25
  exports.MetersClient = MetersClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.PlansClient = void 0;
13
4
  const openapi_1 = require("../../openapi");
@@ -16,22 +7,16 @@ class PlansClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_1.PlansApi);
18
9
  }
19
- list(pagination) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- const cursor = pagination === null || pagination === void 0 ? void 0 : pagination.cursor;
22
- const limit = pagination === null || pagination === void 0 ? void 0 : pagination.limit;
23
- return this.client.listPlans(limit, cursor);
24
- });
10
+ async list(pagination) {
11
+ const cursor = pagination?.cursor;
12
+ const limit = pagination?.limit;
13
+ return this.client.listPlans(limit, cursor);
25
14
  }
26
- get(id) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- return this.client.getPlan(id);
29
- });
15
+ async get(id) {
16
+ return this.client.getPlan(id);
30
17
  }
31
- delete(id) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return this.client.deletePlan(id);
34
- });
18
+ async delete(id) {
19
+ return this.client.deletePlan(id);
35
20
  }
36
21
  }
37
22
  exports.PlansClient = PlansClient;
@@ -0,0 +1,5 @@
1
+ export declare class ProductConsumptionsClient {
2
+ private client;
3
+ constructor();
4
+ get(id: string): Promise<import("../../openapi").GetProductConsumptionResponse>;
5
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductConsumptionsClient = void 0;
4
+ const openapi_1 = require("../../openapi");
5
+ const services_1 = require("../services");
6
+ class ProductConsumptionsClient {
7
+ constructor() {
8
+ this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_1.ProductConsumptionsApi);
9
+ }
10
+ async get(id) {
11
+ return this.client.getProductConsumption(id);
12
+ }
13
+ }
14
+ exports.ProductConsumptionsClient = ProductConsumptionsClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.WebhooksClient = void 0;
13
4
  const openapi_1 = require("../../openapi");
@@ -16,10 +7,8 @@ class WebhooksClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_1.WebhooksApi);
18
9
  }
19
- subscribe(payload) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.webhookSubscribe(payload);
22
- });
10
+ async subscribe(payload) {
11
+ return this.client.webhookSubscribe(payload);
23
12
  }
24
13
  }
25
14
  exports.WebhooksClient = WebhooksClient;
@@ -5,3 +5,4 @@ export * from './InvoicesClient';
5
5
  export * from './MetersClient';
6
6
  export * from './PlansClient';
7
7
  export * from './WebhooksClient';
8
+ export * from './ProductsConsumptionsClient';
@@ -21,3 +21,4 @@ __exportStar(require("./InvoicesClient"), exports);
21
21
  __exportStar(require("./MetersClient"), exports);
22
22
  __exportStar(require("./PlansClient"), exports);
23
23
  __exportStar(require("./WebhooksClient"), exports);
24
+ __exportStar(require("./ProductsConsumptionsClient"), exports);
@@ -1,4 +1,4 @@
1
- import { ContractsClient, CustomersClient, EventsClient, InvoicesClient, MetersClient, PlansClient, WebhooksClient } from './clients';
1
+ import { ContractsClient, CustomersClient, EventsClient, InvoicesClient, MetersClient, PlansClient, WebhooksClient, ProductConsumptionsClient } from './clients';
2
2
  export declare class Vayu {
3
3
  private configurationManager;
4
4
  constructor(apiKey: string, baseUrl?: string);
@@ -10,5 +10,6 @@ export declare class Vayu {
10
10
  get contracts(): ContractsClient;
11
11
  get invoices(): InvoicesClient;
12
12
  get webhooks(): WebhooksClient;
13
+ get productConsumptions(): ProductConsumptionsClient;
13
14
  }
14
15
  export * from './types';
package/dist/sdk/index.js CHANGED
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  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
- 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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.Vayu = void 0;
27
18
  const clients_1 = require("./clients");
@@ -31,10 +22,8 @@ class Vayu {
31
22
  const baseServer = services_1.ConfigurationService.generateServerConfiguration(baseUrl);
32
23
  this.configurationManager = services_1.ConfigurationService.initialize(apiKey, baseServer);
33
24
  }
34
- login() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- yield this.configurationManager.generateToken();
37
- });
25
+ async login() {
26
+ await this.configurationManager.generateToken();
38
27
  }
39
28
  get events() {
40
29
  return new clients_1.EventsClient();
@@ -57,6 +46,9 @@ class Vayu {
57
46
  get webhooks() {
58
47
  return new clients_1.WebhooksClient();
59
48
  }
49
+ get productConsumptions() {
50
+ return new clients_1.ProductConsumptionsClient();
51
+ }
60
52
  }
61
53
  exports.Vayu = Vayu;
62
54
  __exportStar(require("./types"), exports);
@@ -1,13 +1,4 @@
1
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
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -40,7 +31,7 @@ class ConfigurationService {
40
31
  return openapi_1.server1;
41
32
  }
42
33
  const baseServer = BASE_URLS_MAP.get(baseUrl);
43
- return baseServer !== null && baseServer !== void 0 ? baseServer : new openapi_1.ServerConfiguration(baseUrl, {});
34
+ return baseServer ?? new openapi_1.ServerConfiguration(baseUrl, {});
44
35
  }
45
36
  constructor(apiKey, baseServer) {
46
37
  this.apiKey = apiKey;
@@ -52,26 +43,23 @@ class ConfigurationService {
52
43
  const newClient = new ClientClass(this.configuration);
53
44
  return newClient;
54
45
  }
55
- generateToken() {
56
- var _a;
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const authClient = new openapi_1.AuthApi((0, openapi_1.createConfiguration)({
59
- baseServer: this.baseServer,
60
- }));
61
- const login = yield authClient.login({
62
- refreshToken: this.apiKey,
63
- });
64
- this.accessToken = login.accessToken;
65
- const decodedJWT = jsonwebtoken_1.default.decode(this.accessToken);
66
- if (!decodedJWT) {
67
- throw new Error('Invalid JWT token');
68
- }
69
- this.expiresAt = ((_a = decodedJWT.exp) !== null && _a !== void 0 ? _a : Math.floor(Date.now() / 1000) + 60 * 15) * 1000;
70
- return {
71
- accessToken: login.accessToken,
72
- expiresAt: decodedJWT.exp,
73
- };
46
+ async generateToken() {
47
+ const authClient = new openapi_1.AuthApi((0, openapi_1.createConfiguration)({
48
+ baseServer: this.baseServer,
49
+ }));
50
+ const login = await authClient.login({
51
+ refreshToken: this.apiKey,
74
52
  });
53
+ this.accessToken = login.accessToken;
54
+ const decodedJWT = jsonwebtoken_1.default.decode(this.accessToken);
55
+ if (!decodedJWT) {
56
+ throw new Error('Invalid JWT token');
57
+ }
58
+ this.expiresAt = (decodedJWT.exp ?? Math.floor(Date.now() / 1000) + 60 * 15) * 1000;
59
+ return {
60
+ accessToken: login.accessToken,
61
+ expiresAt: decodedJWT.exp,
62
+ };
75
63
  }
76
64
  validateIsLoggedIn() {
77
65
  if (!this.accessToken) {
@@ -88,14 +76,14 @@ class ConfigurationService {
88
76
  },
89
77
  },
90
78
  promiseMiddleware: [{
91
- pre: (context) => __awaiter(this, void 0, void 0, function* () {
79
+ pre: async (context) => {
92
80
  if (this.expiresAt <= Date.now() + EXPIRATION_THRESHOLD) {
93
- yield this.generateToken();
81
+ await this.generateToken();
94
82
  }
95
83
  context.setHeaderParam('Authorization', `Bearer ${this.accessToken}`);
96
84
  return context;
97
- }),
98
- post: (context) => __awaiter(this, void 0, void 0, function* () { return (context); }),
85
+ },
86
+ post: async (context) => (context),
99
87
  }],
100
88
  });
101
89
  }
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.CustomersClient = void 0;
13
4
  const openapi_v2_1 = require("../../openapi-v2");
@@ -16,35 +7,23 @@ class CustomersClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.CustomersApi);
18
9
  }
19
- get(id) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.getCustomer(id);
22
- });
10
+ async get(id) {
11
+ return this.client.getCustomer(id);
23
12
  }
24
- create(payload) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.client.createCustomer(payload);
27
- });
13
+ async create(payload) {
14
+ return this.client.createCustomer(payload);
28
15
  }
29
- update(id, payload) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return this.client.updateCustomer(payload, id);
32
- });
16
+ async update(id, payload) {
17
+ return this.client.updateCustomer(payload, id);
33
18
  }
34
- delete(id) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- return this.client.deleteCustomer(id);
37
- });
19
+ async delete(id) {
20
+ return this.client.deleteCustomer(id);
38
21
  }
39
- query(payload) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- return this.client.queryCustomers(payload);
42
- });
22
+ async query(payload) {
23
+ return this.client.queryCustomers(payload);
43
24
  }
44
- revise(id, productId, payload) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- return this.client.updateACustomersProduct(payload, id, productId);
47
- });
25
+ async revise(id, productId, payload) {
26
+ return this.client.updateACustomersProduct(payload, id, productId);
48
27
  }
49
28
  }
50
29
  exports.CustomersClient = CustomersClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.EntitlementsClient = void 0;
13
4
  const openapi_v2_1 = require("../../openapi-v2");
@@ -16,20 +7,14 @@ class EntitlementsClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.EntitlementsApi);
18
9
  }
19
- get(id) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.getEntitlement(id);
22
- });
10
+ async get(id) {
11
+ return this.client.getEntitlement(id);
23
12
  }
24
- delete(id) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.client.deleteEntitlement(id);
27
- });
13
+ async delete(id) {
14
+ return this.client.deleteEntitlement(id);
28
15
  }
29
- query(query) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return this.client.queryEntitlements(query);
32
- });
16
+ async query(query) {
17
+ return this.client.queryEntitlements(query);
33
18
  }
34
19
  }
35
20
  exports.EntitlementsClient = EntitlementsClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.EventsClient = void 0;
13
4
  const openapi_v2_1 = require("../../openapi-v2");
@@ -16,25 +7,17 @@ class EventsClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.EventsApi);
18
9
  }
19
- get(id) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.getEvent(id);
22
- });
10
+ async get(id) {
11
+ return this.client.getEvent(id);
23
12
  }
24
- delete(id) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.client.deleteEvent(id);
27
- });
13
+ async delete(id) {
14
+ return this.client.deleteEvent(id);
28
15
  }
29
- query(query) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return this.client.queryEvents(query);
32
- });
16
+ async query(query) {
17
+ return this.client.queryEvents(query);
33
18
  }
34
- ingest(payload) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- return this.client.ingestEventToTheSystem(payload);
37
- });
19
+ async ingest(payload) {
20
+ return this.client.ingestEventToTheSystem(payload);
38
21
  }
39
22
  }
40
23
  exports.EventsClient = EventsClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.InvoicesClient = void 0;
13
4
  const openapi_v2_1 = require("../../openapi-v2");
@@ -16,35 +7,23 @@ class InvoicesClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.InvoicesApi);
18
9
  }
19
- get(id) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.getInvoice(id);
22
- });
10
+ async get(id) {
11
+ return this.client.getInvoice(id);
23
12
  }
24
- create(payload) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.client.createInvoice(payload);
27
- });
13
+ async create(payload) {
14
+ return this.client.createInvoice(payload);
28
15
  }
29
- update(id, payload) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return this.client.updateInvoice(payload, id);
32
- });
16
+ async update(id, payload) {
17
+ return this.client.updateInvoice(payload, id);
33
18
  }
34
- delete(id) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- return this.client.deleteInvoice(id);
37
- });
19
+ async delete(id) {
20
+ return this.client.deleteInvoice(id);
38
21
  }
39
- query(payload) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- return this.client.queryInvoices(payload);
42
- });
22
+ async query(payload) {
23
+ return this.client.queryInvoices(payload);
43
24
  }
44
- calculate(id) {
45
- return __awaiter(this, void 0, void 0, function* () {
46
- return this.client.calculateInvoice(id);
47
- });
25
+ async calculate(id) {
26
+ return this.client.calculateInvoice(id);
48
27
  }
49
28
  }
50
29
  exports.InvoicesClient = InvoicesClient;
@@ -1,13 +1,4 @@
1
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
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.ProductsClient = void 0;
13
4
  const openapi_v2_1 = require("../../openapi-v2");
@@ -16,30 +7,20 @@ class ProductsClient {
16
7
  constructor() {
17
8
  this.client = services_1.ConfigurationService.instance.generateNewClient(openapi_v2_1.ProductsApi);
18
9
  }
19
- get(id) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- return this.client.getProduct(id);
22
- });
10
+ async get(id) {
11
+ return this.client.getProduct(id);
23
12
  }
24
- create(payload) {
25
- return __awaiter(this, void 0, void 0, function* () {
26
- return this.client.createProduct(payload);
27
- });
13
+ async create(payload) {
14
+ return this.client.createProduct(payload);
28
15
  }
29
- update(id, payload) {
30
- return __awaiter(this, void 0, void 0, function* () {
31
- return this.client.updateProduct(payload, id);
32
- });
16
+ async update(id, payload) {
17
+ return this.client.updateProduct(payload, id);
33
18
  }
34
- delete(id) {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- return this.client.deleteProduct(id);
37
- });
19
+ async delete(id) {
20
+ return this.client.deleteProduct(id);
38
21
  }
39
- query(query) {
40
- return __awaiter(this, void 0, void 0, function* () {
41
- return this.client.queryProducts(query);
42
- });
22
+ async query(query) {
23
+ return this.client.queryProducts(query);
43
24
  }
44
25
  }
45
26
  exports.ProductsClient = ProductsClient;
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
13
13
  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
- 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
16
  Object.defineProperty(exports, "__esModule", { value: true });
26
17
  exports.Vayu = void 0;
27
18
  const clients_1 = require("./clients");
@@ -31,10 +22,8 @@ class Vayu {
31
22
  const baseServer = services_1.ConfigurationService.generateServerConfiguration('https://connect.v2.dev.withvayu.com');
32
23
  this.configurationManager = services_1.ConfigurationService.initialize(apiKey, baseServer);
33
24
  }
34
- login() {
35
- return __awaiter(this, void 0, void 0, function* () {
36
- yield this.configurationManager.generateToken();
37
- });
25
+ async login() {
26
+ await this.configurationManager.generateToken();
38
27
  }
39
28
  get events() {
40
29
  return new clients_1.EventsClient();