vayu-ts 0.2.6 → 0.2.7-test
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/openapi/apis/AuthApi.js +47 -61
- package/dist/openapi/apis/ContractsApi.js +203 -232
- package/dist/openapi/apis/CreditsApi.js +162 -186
- package/dist/openapi/apis/CustomersApi.d.ts +15 -0
- package/dist/openapi/apis/CustomersApi.js +378 -353
- package/dist/openapi/apis/EventsApi.js +282 -316
- package/dist/openapi/apis/IntegrationsApi.js +105 -124
- package/dist/openapi/apis/InvoicesApi.js +100 -119
- package/dist/openapi/apis/MetersApi.js +211 -240
- package/dist/openapi/apis/PlansApi.js +150 -174
- package/dist/openapi/apis/ProductConsumptionsApi.d.ts +25 -0
- package/dist/openapi/apis/ProductConsumptionsApi.js +82 -0
- package/dist/openapi/apis/ReportsApi.js +100 -119
- package/dist/openapi/apis/WebhooksApi.js +55 -69
- package/dist/openapi/auth/auth.d.ts +1 -0
- package/dist/openapi/auth/auth.js +2 -13
- package/dist/openapi/http/http.d.ts +7 -20
- package/dist/openapi/http/http.js +15 -25
- package/dist/openapi/index.d.ts +3 -3
- package/dist/openapi/index.js +2 -1
- package/dist/openapi/models/Address.d.ts +3 -0
- package/dist/openapi/models/Address.js +1 -0
- package/dist/openapi/models/AggregationMethod.d.ts +3 -0
- package/dist/openapi/models/AggregationMethod.js +1 -0
- package/dist/openapi/models/Condition.d.ts +3 -0
- package/dist/openapi/models/Condition.js +1 -0
- package/dist/openapi/models/Contact.d.ts +4 -1
- package/dist/openapi/models/Contact.js +3 -2
- package/dist/openapi/models/ContractStatus.d.ts +1 -0
- package/dist/openapi/models/ContractStatus.js +1 -0
- package/dist/openapi/models/CreateContractRequest.d.ts +3 -0
- package/dist/openapi/models/CreateContractRequest.js +1 -0
- package/dist/openapi/models/CreateContractResponse.d.ts +3 -0
- package/dist/openapi/models/CreateContractResponse.js +1 -0
- package/dist/openapi/models/CreateCustomerRequest.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerRequest.js +1 -0
- package/dist/openapi/models/CreateCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerResponse.js +1 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.d.ts +3 -0
- package/dist/openapi/models/CreateCustomerResponseCustomer.js +1 -0
- package/dist/openapi/models/CreditLedgerEntry.d.ts +3 -0
- package/dist/openapi/models/CreditLedgerEntry.js +1 -0
- package/dist/openapi/models/Criterion.d.ts +3 -0
- package/dist/openapi/models/Criterion.js +1 -0
- package/dist/openapi/models/CriterionOperator.d.ts +3 -1
- package/dist/openapi/models/CriterionOperator.js +2 -0
- package/dist/openapi/models/DeductCreditsRequest.d.ts +3 -0
- package/dist/openapi/models/DeductCreditsRequest.js +1 -0
- package/dist/openapi/models/DeleteContractResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteContractResponse.js +1 -0
- package/dist/openapi/models/DeleteContractResponseContract.d.ts +3 -0
- package/dist/openapi/models/DeleteContractResponseContract.js +1 -0
- package/dist/openapi/models/DeleteCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteCustomerResponse.js +1 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.d.ts +3 -0
- package/dist/openapi/models/DeleteCustomerResponseCustomer.js +1 -0
- package/dist/openapi/models/DeleteEventResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteEventResponse.js +1 -0
- package/dist/openapi/models/DeleteEventResponseEvent.d.ts +3 -0
- package/dist/openapi/models/DeleteEventResponseEvent.js +1 -0
- package/dist/openapi/models/DeleteMeterResponse.d.ts +3 -0
- package/dist/openapi/models/DeleteMeterResponse.js +1 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.d.ts +3 -0
- package/dist/openapi/models/DeleteMeterResponseMeter.js +1 -0
- package/dist/openapi/models/DeletePlanResponse.d.ts +3 -0
- package/dist/openapi/models/DeletePlanResponse.js +1 -0
- package/dist/openapi/models/DeletePlanResponsePlan.d.ts +3 -0
- package/dist/openapi/models/DeletePlanResponsePlan.js +1 -0
- package/dist/openapi/models/Event.d.ts +3 -0
- package/dist/openapi/models/Event.js +1 -0
- package/dist/openapi/models/EventsDryRunRequest.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunRequest.js +1 -0
- package/dist/openapi/models/EventsDryRunResponse.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponse.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObject.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObject.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObjectEvent.js +1 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.d.ts +3 -0
- package/dist/openapi/models/EventsDryRunResponseObjectMeterWithValuesInner.js +1 -0
- package/dist/openapi/models/Filter.d.ts +3 -0
- package/dist/openapi/models/Filter.js +1 -0
- package/dist/openapi/models/FullDayPeriod.d.ts +3 -0
- package/dist/openapi/models/FullDayPeriod.js +1 -0
- package/dist/openapi/models/GetCommitmentReportResponse.d.ts +5 -0
- package/dist/openapi/models/GetCommitmentReportResponse.js +13 -0
- package/dist/openapi/models/GetContractResponse.d.ts +3 -0
- package/dist/openapi/models/GetContractResponse.js +1 -0
- package/dist/openapi/models/GetContractResponseContract.d.ts +3 -0
- package/dist/openapi/models/GetContractResponseContract.js +1 -0
- package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.d.ts +32 -0
- package/dist/openapi/models/GetCustomerProductsConsumptionsResponse.js +32 -0
- package/dist/openapi/models/GetCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/GetCustomerResponse.js +1 -0
- package/dist/openapi/models/GetEventResponse.d.ts +3 -0
- package/dist/openapi/models/GetEventResponse.js +1 -0
- package/dist/openapi/models/GetEventResponseEvent.d.ts +3 -0
- package/dist/openapi/models/GetEventResponseEvent.js +1 -0
- package/dist/openapi/models/GetInvoiceResponse.d.ts +3 -0
- package/dist/openapi/models/GetInvoiceResponse.js +1 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.d.ts +3 -0
- package/dist/openapi/models/GetInvoiceResponseInvoice.js +1 -0
- package/dist/openapi/models/GetMeterResponse.d.ts +3 -0
- package/dist/openapi/models/GetMeterResponse.js +1 -0
- package/dist/openapi/models/GetMeterResponseMeter.d.ts +3 -0
- package/dist/openapi/models/GetMeterResponseMeter.js +1 -0
- package/dist/openapi/models/GetPlanResponse.d.ts +3 -0
- package/dist/openapi/models/GetPlanResponse.js +1 -0
- package/dist/openapi/models/GetPlanResponsePlan.d.ts +3 -0
- package/dist/openapi/models/GetPlanResponsePlan.js +1 -0
- package/dist/openapi/models/GetProductConsumptionResponse.d.ts +32 -0
- package/dist/openapi/models/GetProductConsumptionResponse.js +32 -0
- package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.d.ts +59 -0
- package/dist/openapi/models/GetProductConsumptionResponseProductConsumption.js +74 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.d.ts +5 -0
- package/dist/openapi/models/GetProductsUsageReportResponse.js +13 -0
- package/dist/openapi/models/GrantCreditsRequest.d.ts +3 -0
- package/dist/openapi/models/GrantCreditsRequest.js +1 -0
- package/dist/openapi/models/InvalidEvent.d.ts +3 -0
- package/dist/openapi/models/InvalidEvent.js +1 -0
- package/dist/openapi/models/LineItem.d.ts +3 -0
- package/dist/openapi/models/LineItem.js +1 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.d.ts +3 -0
- package/dist/openapi/models/LineItemRevenueBreakdown.js +1 -0
- package/dist/openapi/models/ListContractsResponse.d.ts +3 -0
- package/dist/openapi/models/ListContractsResponse.js +1 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.d.ts +3 -0
- package/dist/openapi/models/ListCreditLedgerEntriesResponse.js +1 -0
- package/dist/openapi/models/ListCustomersResponse.d.ts +3 -0
- package/dist/openapi/models/ListCustomersResponse.js +1 -0
- package/dist/openapi/models/ListInvoicesResponse.d.ts +3 -0
- package/dist/openapi/models/ListInvoicesResponse.js +1 -0
- package/dist/openapi/models/ListMetersResponse.d.ts +3 -0
- package/dist/openapi/models/ListMetersResponse.js +1 -0
- package/dist/openapi/models/ListPlansResponse.d.ts +3 -0
- package/dist/openapi/models/ListPlansResponse.js +1 -0
- package/dist/openapi/models/LoginRequest.d.ts +3 -0
- package/dist/openapi/models/LoginRequest.js +1 -0
- package/dist/openapi/models/LoginResponse.d.ts +3 -0
- package/dist/openapi/models/LoginResponse.js +1 -0
- package/dist/openapi/models/Meter.d.ts +3 -0
- package/dist/openapi/models/Meter.js +1 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.d.ts +3 -0
- package/dist/openapi/models/NetSuiteExportSalesOrderRequest.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequest.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestData.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataEntity.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItem.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesRequestDataItemItemsInner.js +1 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.d.ts +3 -0
- package/dist/openapi/models/NetSuiteSyncInvoicesResponse.js +1 -0
- package/dist/openapi/models/NotificationEventType.d.ts +2 -1
- package/dist/openapi/models/NotificationEventType.js +1 -0
- package/dist/openapi/models/ObjectSerializer.d.ts +6 -0
- package/dist/openapi/models/ObjectSerializer.js +68 -11
- package/dist/openapi/models/PlanBillingData.d.ts +5 -1
- package/dist/openapi/models/PlanBillingData.js +2 -1
- package/dist/openapi/models/PlanDuration.d.ts +30 -0
- package/dist/openapi/models/PlanDuration.js +25 -0
- package/dist/openapi/models/ProductConsumption.d.ts +59 -0
- package/dist/openapi/models/ProductConsumption.js +74 -0
- package/dist/openapi/models/QueryEventsResponse.d.ts +3 -0
- package/dist/openapi/models/QueryEventsResponse.js +1 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.d.ts +3 -0
- package/dist/openapi/models/QueryEventsResponseEventsInner.js +1 -0
- package/dist/openapi/models/SendEventsRequest.d.ts +3 -0
- package/dist/openapi/models/SendEventsRequest.js +1 -0
- package/dist/openapi/models/SendEventsResponse.d.ts +3 -0
- package/dist/openapi/models/SendEventsResponse.js +1 -0
- package/dist/openapi/models/UnlimitedDuration.d.ts +14 -0
- package/dist/openapi/models/UnlimitedDuration.js +18 -0
- package/dist/openapi/models/UpdateCustomerRequest.d.ts +3 -0
- package/dist/openapi/models/UpdateCustomerRequest.js +1 -0
- package/dist/openapi/models/UpdateCustomerResponse.d.ts +3 -0
- package/dist/openapi/models/UpdateCustomerResponse.js +1 -0
- package/dist/openapi/models/UpdateMeterRequest.d.ts +3 -0
- package/dist/openapi/models/UpdateMeterRequest.js +1 -0
- package/dist/openapi/models/UpdateMeterResponse.d.ts +3 -0
- package/dist/openapi/models/UpdateMeterResponse.js +1 -0
- package/dist/openapi/models/WebhookSubscribeRequest.d.ts +3 -0
- package/dist/openapi/models/WebhookSubscribeRequest.js +1 -0
- package/dist/openapi/models/all.d.ts +6 -0
- package/dist/openapi/models/all.js +6 -0
- package/dist/openapi/servers.js +2 -3
- package/dist/openapi/types/ObservableAPI.d.ts +71 -38
- package/dist/openapi/types/ObservableAPI.js +172 -105
- package/dist/openapi/types/PromiseAPI.d.ts +69 -38
- package/dist/openapi/types/PromiseAPI.js +85 -42
- package/dist/openapi-v2/apis/AuthenticationApi.js +35 -49
- package/dist/openapi-v2/apis/CustomersApi.js +230 -269
- package/dist/openapi-v2/apis/EntitlementsApi.js +98 -122
- package/dist/openapi-v2/apis/EventsApi.js +136 -165
- package/dist/openapi-v2/apis/InvoicesApi.js +214 -253
- package/dist/openapi-v2/apis/ProductsApi.js +182 -216
- package/dist/openapi-v2/auth/auth.d.ts +1 -0
- package/dist/openapi-v2/http/http.d.ts +7 -20
- package/dist/openapi-v2/http/http.js +15 -25
- package/dist/openapi-v2/index.d.ts +2 -2
- package/dist/openapi-v2/models/APICreateCustomerPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateCustomerPayload.js +1 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateInvoicePayload.js +1 -0
- package/dist/openapi-v2/models/APICreateProductPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APICreateProductPayload.js +1 -0
- package/dist/openapi-v2/models/APICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/APICustomer.js +1 -0
- package/dist/openapi-v2/models/APIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/APIEntitlement.js +1 -0
- package/dist/openapi-v2/models/APIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/APIEvent.js +1 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIIngestEventPayload.js +1 -0
- package/dist/openapi-v2/models/APIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/APIInvoice.js +1 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.d.ts +3 -0
- package/dist/openapi-v2/models/APIInvoiceBillingPeriod.js +1 -0
- package/dist/openapi-v2/models/APIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/APIProduct.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPICustomer.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEntitlement.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIEvent.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIInvoice.js +1 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/APIQueryPayloadAPIProduct.js +1 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateCustomerPayload.js +1 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateInvoicePayload.js +1 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.d.ts +3 -0
- package/dist/openapi-v2/models/APIUpdateProductPayload.js +1 -0
- package/dist/openapi-v2/models/Aggregation.d.ts +3 -0
- package/dist/openapi-v2/models/Aggregation.js +1 -0
- package/dist/openapi-v2/models/Condition.d.ts +3 -0
- package/dist/openapi-v2/models/Condition.js +1 -0
- package/dist/openapi-v2/models/Criterion.d.ts +3 -0
- package/dist/openapi-v2/models/Criterion.js +1 -0
- package/dist/openapi-v2/models/CriterionValue.d.ts +3 -0
- package/dist/openapi-v2/models/CriterionValue.js +1 -0
- package/dist/openapi-v2/models/EntitlementRevision.d.ts +3 -0
- package/dist/openapi-v2/models/EntitlementRevision.js +1 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.d.ts +3 -0
- package/dist/openapi-v2/models/IngestEventToTheSystem201Response.js +1 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.d.ts +3 -0
- package/dist/openapi-v2/models/InvoiceProductBreakdown.js +1 -0
- package/dist/openapi-v2/models/Login200Response.d.ts +3 -0
- package/dist/openapi-v2/models/Login200Response.js +1 -0
- package/dist/openapi-v2/models/LoginRequest.d.ts +3 -0
- package/dist/openapi-v2/models/LoginRequest.js +1 -0
- package/dist/openapi-v2/models/ObjectSerializer.js +51 -11
- package/dist/openapi-v2/models/Pricing.d.ts +3 -0
- package/dist/openapi-v2/models/Pricing.js +1 -0
- package/dist/openapi-v2/models/PricingTiersInner.d.ts +3 -0
- package/dist/openapi-v2/models/PricingTiersInner.js +1 -0
- package/dist/openapi-v2/models/ProductBreakdown.d.ts +3 -0
- package/dist/openapi-v2/models/ProductBreakdown.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPICustomer.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIEntitlement.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIEntitlement.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIEvent.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIInvoice.js +1 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.d.ts +3 -0
- package/dist/openapi-v2/models/QueryResultAPIProduct.js +1 -0
- package/dist/openapi-v2/models/ReviseEntitlementPayload.d.ts +3 -0
- package/dist/openapi-v2/models/ReviseEntitlementPayload.js +1 -0
- package/dist/openapi-v2/servers.js +2 -3
- package/dist/openapi-v2/types/ObservableAPI.js +50 -50
- package/dist/sdk/clients/ContractsClient.js +10 -27
- package/dist/sdk/clients/CustomersClient.js +14 -35
- package/dist/sdk/clients/EventsClient.js +13 -32
- package/dist/sdk/clients/InvoicesClient.js +6 -19
- package/dist/sdk/clients/MetersClient.js +10 -27
- package/dist/sdk/clients/PlansClient.js +8 -23
- package/dist/sdk/clients/ProductsConsumptionsClient.d.ts +5 -0
- package/dist/sdk/clients/ProductsConsumptionsClient.js +14 -0
- package/dist/sdk/clients/WebhooksClient.js +2 -13
- package/dist/sdk/clients/index.d.ts +1 -0
- package/dist/sdk/clients/index.js +1 -0
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +5 -13
- package/dist/sdk/services/configuration.service.js +21 -33
- package/dist/sdk-v2/clients/CustomersClient.js +12 -33
- package/dist/sdk-v2/clients/EntitlementsClient.js +6 -21
- package/dist/sdk-v2/clients/EventsClient.js +8 -25
- package/dist/sdk-v2/clients/InvoicesClient.js +12 -33
- package/dist/sdk-v2/clients/ProductsClient.js +10 -29
- package/dist/sdk-v2/index.js +2 -13
- package/dist/sdk-v2/services/configuration.service.js +22 -34
- 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.ReportsApiResponseProcessor = exports.ReportsApiRequestFactory = void 0;
|
|
13
4
|
// TODO: better import syntax?
|
|
@@ -24,31 +15,28 @@ class ReportsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
|
24
15
|
* Get commitment report
|
|
25
16
|
* @param reportId
|
|
26
17
|
*/
|
|
27
|
-
getCommitmentReportResponse(reportId, _options) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
authMethod
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
return requestContext;
|
|
51
|
-
});
|
|
18
|
+
async getCommitmentReportResponse(reportId, _options) {
|
|
19
|
+
let _config = _options || this.configuration;
|
|
20
|
+
// Path Params
|
|
21
|
+
const localVarPath = '/report/commitment';
|
|
22
|
+
// Make Request Context
|
|
23
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
24
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
25
|
+
// Query Params
|
|
26
|
+
if (reportId !== undefined) {
|
|
27
|
+
requestContext.setQueryParam("reportId", ObjectSerializer_1.ObjectSerializer.serialize(reportId, "string", ""));
|
|
28
|
+
}
|
|
29
|
+
let authMethod;
|
|
30
|
+
// Apply auth methods
|
|
31
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
32
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
33
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
34
|
+
}
|
|
35
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
36
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
37
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
38
|
+
}
|
|
39
|
+
return requestContext;
|
|
52
40
|
}
|
|
53
41
|
/**
|
|
54
42
|
* Use this endpoint to get the products usage report.
|
|
@@ -57,39 +45,36 @@ class ReportsApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
|
57
45
|
* @param limit
|
|
58
46
|
* @param cursor
|
|
59
47
|
*/
|
|
60
|
-
getProductsUsageReport(reportId, limit, cursor, _options) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
authMethod
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
return requestContext;
|
|
92
|
-
});
|
|
48
|
+
async getProductsUsageReport(reportId, limit, cursor, _options) {
|
|
49
|
+
let _config = _options || this.configuration;
|
|
50
|
+
// Path Params
|
|
51
|
+
const localVarPath = '/report/products-usage';
|
|
52
|
+
// Make Request Context
|
|
53
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.GET);
|
|
54
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
55
|
+
// Query Params
|
|
56
|
+
if (reportId !== undefined) {
|
|
57
|
+
requestContext.setQueryParam("reportId", ObjectSerializer_1.ObjectSerializer.serialize(reportId, "string", ""));
|
|
58
|
+
}
|
|
59
|
+
// Query Params
|
|
60
|
+
if (limit !== undefined) {
|
|
61
|
+
requestContext.setQueryParam("limit", ObjectSerializer_1.ObjectSerializer.serialize(limit, "number", ""));
|
|
62
|
+
}
|
|
63
|
+
// Query Params
|
|
64
|
+
if (cursor !== undefined) {
|
|
65
|
+
requestContext.setQueryParam("cursor", ObjectSerializer_1.ObjectSerializer.serialize(cursor, "string", ""));
|
|
66
|
+
}
|
|
67
|
+
let authMethod;
|
|
68
|
+
// Apply auth methods
|
|
69
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
70
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
71
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
72
|
+
}
|
|
73
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
74
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
75
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
76
|
+
}
|
|
77
|
+
return requestContext;
|
|
93
78
|
}
|
|
94
79
|
}
|
|
95
80
|
exports.ReportsApiRequestFactory = ReportsApiRequestFactory;
|
|
@@ -101,32 +86,30 @@ class ReportsApiResponseProcessor {
|
|
|
101
86
|
* @params response Response returned by the server for a request to getCommitmentReportResponse
|
|
102
87
|
* @throws ApiException if the response code was not in [200, 299]
|
|
103
88
|
*/
|
|
104
|
-
getCommitmentReportResponseWithHttpInfo(response) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
129
|
-
});
|
|
89
|
+
async getCommitmentReportResponseWithHttpInfo(response) {
|
|
90
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
91
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
92
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetCommitmentReportResponse", "");
|
|
93
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
94
|
+
}
|
|
95
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
96
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
97
|
+
}
|
|
98
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
99
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
100
|
+
}
|
|
101
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
102
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
103
|
+
}
|
|
104
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
105
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
106
|
+
}
|
|
107
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
108
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
109
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetCommitmentReportResponse", "");
|
|
110
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
111
|
+
}
|
|
112
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
130
113
|
}
|
|
131
114
|
/**
|
|
132
115
|
* Unwraps the actual response sent by the server from the response context and deserializes the response content
|
|
@@ -135,32 +118,30 @@ class ReportsApiResponseProcessor {
|
|
|
135
118
|
* @params response Response returned by the server for a request to getProductsUsageReport
|
|
136
119
|
* @throws ApiException if the response code was not in [200, 299]
|
|
137
120
|
*/
|
|
138
|
-
getProductsUsageReportWithHttpInfo(response) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
163
|
-
});
|
|
121
|
+
async getProductsUsageReportWithHttpInfo(response) {
|
|
122
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
123
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
124
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetProductsUsageReportResponse", "");
|
|
125
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
126
|
+
}
|
|
127
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
128
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
129
|
+
}
|
|
130
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
131
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
132
|
+
}
|
|
133
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
134
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
135
|
+
}
|
|
136
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
137
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
138
|
+
}
|
|
139
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
140
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
141
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "GetProductsUsageReportResponse", "");
|
|
142
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
143
|
+
}
|
|
144
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
164
145
|
}
|
|
165
146
|
}
|
|
166
147
|
exports.ReportsApiResponseProcessor = ReportsApiResponseProcessor;
|
|
@@ -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.WebhooksApiResponseProcessor = exports.WebhooksApiRequestFactory = void 0;
|
|
13
4
|
// TODO: better import syntax?
|
|
@@ -25,38 +16,35 @@ class WebhooksApiRequestFactory extends baseapi_1.BaseAPIRequestFactory {
|
|
|
25
16
|
* Subscribe to webhooks
|
|
26
17
|
* @param webhookSubscribeRequest Subscribe to webhooks and receive event notifications.
|
|
27
18
|
*/
|
|
28
|
-
webhookSubscribe(webhookSubscribeRequest, _options) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
authMethod
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
return requestContext;
|
|
59
|
-
});
|
|
19
|
+
async webhookSubscribe(webhookSubscribeRequest, _options) {
|
|
20
|
+
let _config = _options || this.configuration;
|
|
21
|
+
// verify required parameter 'webhookSubscribeRequest' is not null or undefined
|
|
22
|
+
if (webhookSubscribeRequest === null || webhookSubscribeRequest === undefined) {
|
|
23
|
+
throw new baseapi_1.RequiredError("WebhooksApi", "webhookSubscribe", "webhookSubscribeRequest");
|
|
24
|
+
}
|
|
25
|
+
// Path Params
|
|
26
|
+
const localVarPath = '/webhook';
|
|
27
|
+
// Make Request Context
|
|
28
|
+
const requestContext = _config.baseServer.makeRequestContext(localVarPath, http_1.HttpMethod.POST);
|
|
29
|
+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
|
|
30
|
+
// Body Params
|
|
31
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.getPreferredMediaType([
|
|
32
|
+
"application/json"
|
|
33
|
+
]);
|
|
34
|
+
requestContext.setHeaderParam("Content-Type", contentType);
|
|
35
|
+
const serializedBody = ObjectSerializer_1.ObjectSerializer.stringify(ObjectSerializer_1.ObjectSerializer.serialize(webhookSubscribeRequest, "WebhookSubscribeRequest", ""), contentType);
|
|
36
|
+
requestContext.setBody(serializedBody);
|
|
37
|
+
let authMethod;
|
|
38
|
+
// Apply auth methods
|
|
39
|
+
authMethod = _config.authMethods["BearerAuthorizer"];
|
|
40
|
+
if (authMethod?.applySecurityAuthentication) {
|
|
41
|
+
await authMethod?.applySecurityAuthentication(requestContext);
|
|
42
|
+
}
|
|
43
|
+
const defaultAuth = _options?.authMethods?.default || this.configuration?.authMethods?.default;
|
|
44
|
+
if (defaultAuth?.applySecurityAuthentication) {
|
|
45
|
+
await defaultAuth?.applySecurityAuthentication(requestContext);
|
|
46
|
+
}
|
|
47
|
+
return requestContext;
|
|
60
48
|
}
|
|
61
49
|
}
|
|
62
50
|
exports.WebhooksApiRequestFactory = WebhooksApiRequestFactory;
|
|
@@ -68,34 +56,32 @@ class WebhooksApiResponseProcessor {
|
|
|
68
56
|
* @params response Response returned by the server for a request to webhookSubscribe
|
|
69
57
|
* @throws ApiException if the response code was not in [200, 299]
|
|
70
58
|
*/
|
|
71
|
-
webhookSubscribeWithHttpInfo(response) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", yield response.getBodyAsAny(), response.headers);
|
|
98
|
-
});
|
|
59
|
+
async webhookSubscribeWithHttpInfo(response) {
|
|
60
|
+
const contentType = ObjectSerializer_1.ObjectSerializer.normalizeMediaType(response.headers["content-type"]);
|
|
61
|
+
if ((0, util_1.isCodeInRange)("200", response.httpStatusCode)) {
|
|
62
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, undefined);
|
|
63
|
+
}
|
|
64
|
+
if ((0, util_1.isCodeInRange)("400", response.httpStatusCode)) {
|
|
65
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Bad Request", undefined, response.headers);
|
|
66
|
+
}
|
|
67
|
+
if ((0, util_1.isCodeInRange)("401", response.httpStatusCode)) {
|
|
68
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unauthorized", undefined, response.headers);
|
|
69
|
+
}
|
|
70
|
+
if ((0, util_1.isCodeInRange)("413", response.httpStatusCode)) {
|
|
71
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Request Entity Too Large", undefined, response.headers);
|
|
72
|
+
}
|
|
73
|
+
if ((0, util_1.isCodeInRange)("429", response.httpStatusCode)) {
|
|
74
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Too Many Requests", undefined, response.headers);
|
|
75
|
+
}
|
|
76
|
+
if ((0, util_1.isCodeInRange)("500", response.httpStatusCode)) {
|
|
77
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Internal Server Error", undefined, response.headers);
|
|
78
|
+
}
|
|
79
|
+
// Work around for missing responses in specification, e.g. for petstore.yaml
|
|
80
|
+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
|
|
81
|
+
const body = ObjectSerializer_1.ObjectSerializer.deserialize(ObjectSerializer_1.ObjectSerializer.parse(await response.body.text(), contentType), "void", "");
|
|
82
|
+
return new http_1.HttpInfo(response.httpStatusCode, response.headers, response.body, body);
|
|
83
|
+
}
|
|
84
|
+
throw new exception_1.ApiException(response.httpStatusCode, "Unknown API Status Code!", await response.getBodyAsAny(), response.headers);
|
|
99
85
|
}
|
|
100
86
|
}
|
|
101
87
|
exports.WebhooksApiResponseProcessor = WebhooksApiResponseProcessor;
|
|
@@ -43,6 +43,7 @@ export type HttpBearerConfiguration = {
|
|
|
43
43
|
export type OAuth2Configuration = {
|
|
44
44
|
accessToken: string;
|
|
45
45
|
};
|
|
46
|
+
export type HttpSignatureConfiguration = unknown;
|
|
46
47
|
export type AuthMethodsConfiguration = {
|
|
47
48
|
"default"?: SecurityAuthentication;
|
|
48
49
|
"BearerAuthorizer"?: HttpBearerConfiguration;
|
|
@@ -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.configureAuthMethods = exports.BearerAuthorizerAuthentication = void 0;
|
|
13
4
|
/**
|
|
@@ -25,10 +16,8 @@ class BearerAuthorizerAuthentication {
|
|
|
25
16
|
getName() {
|
|
26
17
|
return "BearerAuthorizer";
|
|
27
18
|
}
|
|
28
|
-
applySecurityAuthentication(context) {
|
|
29
|
-
|
|
30
|
-
context.setHeaderParam("Authorization", "Bearer " + (yield this.tokenProvider.getToken()));
|
|
31
|
-
});
|
|
19
|
+
async applySecurityAuthentication(context) {
|
|
20
|
+
context.setHeaderParam("Authorization", "Bearer " + await this.tokenProvider.getToken());
|
|
32
21
|
}
|
|
33
22
|
}
|
|
34
23
|
exports.BearerAuthorizerAuthentication = BearerAuthorizerAuthentication;
|
|
@@ -36,6 +36,7 @@ export declare class HttpException extends Error {
|
|
|
36
36
|
* Represents the body of an outgoing HTTP request.
|
|
37
37
|
*/
|
|
38
38
|
export type RequestBody = undefined | string | FormData | URLSearchParams;
|
|
39
|
+
type Headers = Record<string, string>;
|
|
39
40
|
/**
|
|
40
41
|
* Represents an HTTP request context
|
|
41
42
|
*/
|
|
@@ -69,11 +70,10 @@ export declare class RequestContext {
|
|
|
69
70
|
*/
|
|
70
71
|
setBody(body: RequestBody): void;
|
|
71
72
|
getHttpMethod(): HttpMethod;
|
|
72
|
-
getHeaders():
|
|
73
|
-
[key: string]: string;
|
|
74
|
-
};
|
|
73
|
+
getHeaders(): Headers;
|
|
75
74
|
getBody(): RequestBody;
|
|
76
75
|
setQueryParam(name: string, value: string): void;
|
|
76
|
+
appendQueryParam(name: string, value: string): void;
|
|
77
77
|
/**
|
|
78
78
|
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
|
79
79
|
*
|
|
@@ -98,13 +98,9 @@ export declare class SelfDecodingBody implements ResponseBody {
|
|
|
98
98
|
}
|
|
99
99
|
export declare class ResponseContext {
|
|
100
100
|
httpStatusCode: number;
|
|
101
|
-
headers:
|
|
102
|
-
[key: string]: string;
|
|
103
|
-
};
|
|
101
|
+
headers: Headers;
|
|
104
102
|
body: ResponseBody;
|
|
105
|
-
constructor(httpStatusCode: number, headers:
|
|
106
|
-
[key: string]: string;
|
|
107
|
-
}, body: ResponseBody);
|
|
103
|
+
constructor(httpStatusCode: number, headers: Headers, body: ResponseBody);
|
|
108
104
|
/**
|
|
109
105
|
* Parse header value in the form `value; param1="value1"`
|
|
110
106
|
*
|
|
@@ -112,9 +108,7 @@ export declare class ResponseContext {
|
|
|
112
108
|
* Parameter names are converted to lower case
|
|
113
109
|
* The first parameter is returned with the key `""`
|
|
114
110
|
*/
|
|
115
|
-
getParsedHeader(headerName: string):
|
|
116
|
-
[parameter: string]: string;
|
|
117
|
-
};
|
|
111
|
+
getParsedHeader(headerName: string): Headers;
|
|
118
112
|
getBodyAsFile(): Promise<HttpFile>;
|
|
119
113
|
/**
|
|
120
114
|
* Use a heuristic to get a body of unknown data structure.
|
|
@@ -130,13 +124,6 @@ export interface PromiseHttpLibrary {
|
|
|
130
124
|
}
|
|
131
125
|
export declare function wrapHttpLibrary(promiseHttpLibrary: PromiseHttpLibrary): HttpLibrary;
|
|
132
126
|
export declare class HttpInfo<T> extends ResponseContext {
|
|
133
|
-
httpStatusCode: number;
|
|
134
|
-
headers: {
|
|
135
|
-
[key: string]: string;
|
|
136
|
-
};
|
|
137
|
-
body: ResponseBody;
|
|
138
127
|
data: T;
|
|
139
|
-
constructor(httpStatusCode: number, headers:
|
|
140
|
-
[key: string]: string;
|
|
141
|
-
}, body: ResponseBody, data: T);
|
|
128
|
+
constructor(httpStatusCode: number, headers: Headers, body: ResponseBody, data: T);
|
|
142
129
|
}
|
|
@@ -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.HttpInfo = exports.wrapHttpLibrary = exports.ResponseContext = exports.SelfDecodingBody = exports.RequestContext = exports.HttpException = exports.HttpMethod = void 0;
|
|
27
18
|
const url_1 = require("url");
|
|
@@ -111,6 +102,9 @@ class RequestContext {
|
|
|
111
102
|
setQueryParam(name, value) {
|
|
112
103
|
this.url.searchParams.set(name, value);
|
|
113
104
|
}
|
|
105
|
+
appendQueryParam(name, value) {
|
|
106
|
+
this.url.searchParams.append(name, value);
|
|
107
|
+
}
|
|
114
108
|
/**
|
|
115
109
|
* Sets a cookie with the name and value. NO check for duplicate cookies is performed
|
|
116
110
|
*
|
|
@@ -142,11 +136,9 @@ class SelfDecodingBody {
|
|
|
142
136
|
binary() {
|
|
143
137
|
return this.dataSource;
|
|
144
138
|
}
|
|
145
|
-
text() {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return data.toString();
|
|
149
|
-
});
|
|
139
|
+
async text() {
|
|
140
|
+
const data = await this.dataSource;
|
|
141
|
+
return data.toString();
|
|
150
142
|
}
|
|
151
143
|
}
|
|
152
144
|
exports.SelfDecodingBody = SelfDecodingBody;
|
|
@@ -171,6 +163,9 @@ class ResponseContext {
|
|
|
171
163
|
const parameters = this.headers[headerName].split(";");
|
|
172
164
|
for (const parameter of parameters) {
|
|
173
165
|
let [key, value] = parameter.split("=", 2);
|
|
166
|
+
if (!key) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
174
169
|
key = key.toLowerCase().trim();
|
|
175
170
|
if (value === undefined) {
|
|
176
171
|
result[""] = key;
|
|
@@ -185,12 +180,10 @@ class ResponseContext {
|
|
|
185
180
|
}
|
|
186
181
|
return result;
|
|
187
182
|
}
|
|
188
|
-
getBodyAsFile() {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
return { data, name: fileName };
|
|
193
|
-
});
|
|
183
|
+
async getBodyAsFile() {
|
|
184
|
+
const data = await this.body.binary();
|
|
185
|
+
const fileName = this.getParsedHeader("content-disposition")["filename"] || "";
|
|
186
|
+
return { data, name: fileName };
|
|
194
187
|
}
|
|
195
188
|
/**
|
|
196
189
|
* Use a heuristic to get a body of unknown data structure.
|
|
@@ -200,11 +193,11 @@ class ResponseContext {
|
|
|
200
193
|
try {
|
|
201
194
|
return this.body.text();
|
|
202
195
|
}
|
|
203
|
-
catch
|
|
196
|
+
catch { }
|
|
204
197
|
try {
|
|
205
198
|
return this.body.binary();
|
|
206
199
|
}
|
|
207
|
-
catch
|
|
200
|
+
catch { }
|
|
208
201
|
return Promise.resolve(undefined);
|
|
209
202
|
}
|
|
210
203
|
}
|
|
@@ -220,9 +213,6 @@ exports.wrapHttpLibrary = wrapHttpLibrary;
|
|
|
220
213
|
class HttpInfo extends ResponseContext {
|
|
221
214
|
constructor(httpStatusCode, headers, body, data) {
|
|
222
215
|
super(httpStatusCode, headers, body);
|
|
223
|
-
this.httpStatusCode = httpStatusCode;
|
|
224
|
-
this.headers = headers;
|
|
225
|
-
this.body = body;
|
|
226
216
|
this.data = data;
|
|
227
217
|
}
|
|
228
218
|
}
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ export * from "./http/http";
|
|
|
2
2
|
export * from "./auth/auth";
|
|
3
3
|
export * from "./models/all";
|
|
4
4
|
export { createConfiguration } from "./configuration";
|
|
5
|
-
export { Configuration } from "./configuration";
|
|
5
|
+
export type { Configuration } from "./configuration";
|
|
6
6
|
export * from "./apis/exception";
|
|
7
7
|
export * from "./servers";
|
|
8
8
|
export { RequiredError } from "./apis/baseapi";
|
|
9
|
-
export { PromiseMiddleware as Middleware } from './middleware';
|
|
10
|
-
export { PromiseAuthApi as AuthApi, PromiseContractsApi as ContractsApi, PromiseCreditsApi as CreditsApi, PromiseCustomersApi as CustomersApi, PromiseEventsApi as EventsApi, PromiseIntegrationsApi as IntegrationsApi, PromiseInvoicesApi as InvoicesApi, PromiseMetersApi as MetersApi, PromisePlansApi as PlansApi, PromiseReportsApi as ReportsApi, PromiseWebhooksApi as WebhooksApi } from './types/PromiseAPI';
|
|
9
|
+
export type { PromiseMiddleware as Middleware } from './middleware';
|
|
10
|
+
export { PromiseAuthApi as AuthApi, PromiseContractsApi as ContractsApi, PromiseCreditsApi as CreditsApi, PromiseCustomersApi as CustomersApi, PromiseEventsApi as EventsApi, PromiseIntegrationsApi as IntegrationsApi, PromiseInvoicesApi as InvoicesApi, PromiseMetersApi as MetersApi, PromisePlansApi as PlansApi, PromiseProductConsumptionsApi as ProductConsumptionsApi, PromiseReportsApi as ReportsApi, PromiseWebhooksApi as WebhooksApi } from './types/PromiseAPI';
|