@cosmotech/aip-client 0.2.0-dev2 → 0.2.0-dev4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +147 -4
- package/api/default-api.ts +8 -15
- package/api/favored-option-api.ts +210 -0
- package/api/impact-api.ts +507 -0
- package/api/investment-api.ts +1464 -0
- package/api/metric-api.ts +185 -164
- package/api/metric-costs-api.ts +144 -0
- package/api/metric-costs-per-year-api.ts +200 -200
- package/api/objective-api.ts +538 -44
- package/api/objective-weight-api.ts +190 -190
- package/api/objective-weights-api.ts +144 -0
- package/api/option-api.ts +925 -0
- package/api/value-framework-api.ts +1223 -109
- package/api/value-framework-costs-api.ts +239 -0
- package/api/value-framework-weights-api.ts +144 -0
- package/api.ts +9 -1
- package/base.ts +1 -25
- package/common.ts +20 -43
- package/configuration.ts +31 -20
- package/dist/api/default-api.d.ts +3 -10
- package/dist/api/default-api.js +7 -13
- package/dist/api/favored-option-api.d.ts +104 -0
- package/dist/api/favored-option-api.js +209 -0
- package/dist/api/impact-api.d.ts +245 -0
- package/dist/api/impact-api.js +493 -0
- package/dist/api/investment-api.d.ts +677 -0
- package/dist/api/investment-api.js +1394 -0
- package/dist/api/metric-api.d.ts +97 -88
- package/dist/api/metric-api.js +185 -157
- package/dist/api/metric-costs-api.d.ts +75 -0
- package/dist/api/metric-costs-api.js +146 -0
- package/dist/api/metric-costs-per-year-api.d.ts +105 -108
- package/dist/api/metric-costs-per-year-api.js +199 -192
- package/dist/api/objective-api.d.ts +242 -21
- package/dist/api/objective-api.js +508 -37
- package/dist/api/objective-weight-api.d.ts +105 -108
- package/dist/api/objective-weight-api.js +189 -182
- package/dist/api/objective-weights-api.d.ts +75 -0
- package/dist/api/objective-weights-api.js +146 -0
- package/dist/api/option-api.d.ts +436 -0
- package/dist/api/option-api.js +888 -0
- package/dist/api/value-framework-api.d.ts +528 -21
- package/dist/api/value-framework-api.js +1138 -78
- package/dist/api/value-framework-costs-api.d.ts +119 -0
- package/dist/api/value-framework-costs-api.js +236 -0
- package/dist/api/value-framework-weights-api.d.ts +75 -0
- package/dist/api/value-framework-weights-api.js +146 -0
- package/dist/api.d.ts +9 -1
- package/dist/api.js +9 -1
- package/dist/base.d.ts +1 -25
- package/dist/base.js +1 -20
- package/dist/common.d.ts +6 -37
- package/dist/common.js +17 -39
- package/dist/configuration.d.ts +25 -18
- package/dist/configuration.js +4 -3
- package/dist/esm/api/default-api.d.ts +3 -10
- package/dist/esm/api/default-api.js +7 -13
- package/dist/esm/api/favored-option-api.d.ts +104 -0
- package/dist/esm/api/favored-option-api.js +202 -0
- package/dist/esm/api/impact-api.d.ts +245 -0
- package/dist/esm/api/impact-api.js +486 -0
- package/dist/esm/api/investment-api.d.ts +677 -0
- package/dist/esm/api/investment-api.js +1387 -0
- package/dist/esm/api/metric-api.d.ts +97 -88
- package/dist/esm/api/metric-api.js +185 -157
- package/dist/esm/api/metric-costs-api.d.ts +75 -0
- package/dist/esm/api/metric-costs-api.js +139 -0
- package/dist/esm/api/metric-costs-per-year-api.d.ts +105 -108
- package/dist/esm/api/metric-costs-per-year-api.js +199 -192
- package/dist/esm/api/objective-api.d.ts +242 -21
- package/dist/esm/api/objective-api.js +508 -37
- package/dist/esm/api/objective-weight-api.d.ts +105 -108
- package/dist/esm/api/objective-weight-api.js +189 -182
- package/dist/esm/api/objective-weights-api.d.ts +75 -0
- package/dist/esm/api/objective-weights-api.js +139 -0
- package/dist/esm/api/option-api.d.ts +436 -0
- package/dist/esm/api/option-api.js +881 -0
- package/dist/esm/api/value-framework-api.d.ts +528 -21
- package/dist/esm/api/value-framework-api.js +1137 -77
- package/dist/esm/api/value-framework-costs-api.d.ts +119 -0
- package/dist/esm/api/value-framework-costs-api.js +229 -0
- package/dist/esm/api/value-framework-weights-api.d.ts +75 -0
- package/dist/esm/api/value-framework-weights-api.js +139 -0
- package/dist/esm/api.d.ts +9 -1
- package/dist/esm/api.js +9 -1
- package/dist/esm/base.d.ts +1 -25
- package/dist/esm/base.js +1 -20
- package/dist/esm/common.d.ts +6 -37
- package/dist/esm/common.js +15 -38
- package/dist/esm/configuration.d.ts +25 -18
- package/dist/esm/configuration.js +4 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/models/evolution-type.d.ts +16 -0
- package/dist/esm/models/evolution-type.js +17 -0
- package/dist/esm/models/favored-option-request.d.ts +20 -0
- package/dist/esm/models/{validation-error-loc-inner.js → favored-option-request.js} +1 -1
- package/dist/esm/models/favored-option-response.d.ts +20 -0
- package/dist/esm/models/favored-option-response.js +14 -0
- package/dist/esm/models/httpvalidation-error.d.ts +2 -12
- package/dist/esm/models/httpvalidation-error.js +1 -1
- package/dist/esm/models/impact-apiresponse.d.ts +33 -0
- package/dist/esm/models/impact-apiresponse.js +14 -0
- package/dist/esm/models/impact-create.d.ts +37 -0
- package/dist/esm/models/impact-create.js +14 -0
- package/dist/esm/models/impact-update.d.ts +22 -0
- package/dist/esm/models/impact-update.js +14 -0
- package/dist/esm/models/index.d.ts +13 -1
- package/dist/esm/models/index.js +13 -1
- package/dist/esm/models/investment-create.d.ts +21 -0
- package/dist/esm/models/investment-create.js +14 -0
- package/dist/esm/models/investment-response.d.ts +26 -0
- package/dist/esm/models/investment-response.js +14 -0
- package/dist/esm/models/investment-update.d.ts +18 -0
- package/dist/esm/models/investment-update.js +14 -0
- package/dist/esm/models/{validation-error-loc-inner.d.ts → location-inner.d.ts} +2 -7
- package/dist/esm/models/location-inner.js +14 -0
- package/dist/esm/models/measurement-type.d.ts +1 -6
- package/dist/esm/models/measurement-type.js +1 -6
- package/dist/esm/models/metric-costs-per-year-create.d.ts +1 -17
- package/dist/esm/models/metric-costs-per-year-create.js +1 -1
- package/dist/esm/models/metric-costs-per-year-response.d.ts +1 -18
- package/dist/esm/models/metric-costs-per-year-response.js +1 -1
- package/dist/esm/models/metric-costs-per-year-update.d.ts +1 -13
- package/dist/esm/models/metric-costs-per-year-update.js +1 -1
- package/dist/esm/models/metric-create.d.ts +3 -28
- package/dist/esm/models/metric-create.js +1 -1
- package/dist/esm/models/metric-response.d.ts +3 -50
- package/dist/esm/models/metric-response.js +1 -1
- package/dist/esm/models/metric-type.d.ts +1 -6
- package/dist/esm/models/metric-type.js +1 -6
- package/dist/esm/models/metric-update.d.ts +3 -35
- package/dist/esm/models/metric-update.js +1 -1
- package/dist/esm/models/objective-create.d.ts +1 -10
- package/dist/esm/models/objective-create.js +1 -1
- package/dist/esm/models/objective-response.d.ts +1 -30
- package/dist/esm/models/objective-response.js +1 -1
- package/dist/esm/models/objective-update.d.ts +1 -13
- package/dist/esm/models/objective-update.js +1 -1
- package/dist/esm/models/objective-weight-create.d.ts +1 -9
- package/dist/esm/models/objective-weight-create.js +1 -1
- package/dist/esm/models/objective-weight-response.d.ts +1 -14
- package/dist/esm/models/objective-weight-response.js +1 -1
- package/dist/esm/models/objective-weight-update.d.ts +1 -8
- package/dist/esm/models/objective-weight-update.js +1 -1
- package/dist/esm/models/option-create.d.ts +33 -0
- package/dist/esm/models/option-create.js +14 -0
- package/dist/esm/models/option-response.d.ts +32 -0
- package/dist/esm/models/option-response.js +14 -0
- package/dist/esm/models/option-update.d.ts +21 -0
- package/dist/esm/models/option-update.js +14 -0
- package/dist/esm/models/validation-error.d.ts +3 -33
- package/dist/esm/models/validation-error.js +1 -1
- package/dist/esm/models/value-framework-create.d.ts +1 -10
- package/dist/esm/models/value-framework-create.js +1 -1
- package/dist/esm/models/value-framework-response.d.ts +1 -30
- package/dist/esm/models/value-framework-response.js +1 -1
- package/dist/esm/models/value-framework-update.d.ts +1 -13
- package/dist/esm/models/value-framework-update.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/models/evolution-type.d.ts +16 -0
- package/dist/models/evolution-type.js +20 -0
- package/dist/models/favored-option-request.d.ts +20 -0
- package/dist/models/{validation-error-loc-inner.js → favored-option-request.js} +1 -1
- package/dist/models/favored-option-response.d.ts +20 -0
- package/dist/models/favored-option-response.js +15 -0
- package/dist/models/httpvalidation-error.d.ts +2 -12
- package/dist/models/httpvalidation-error.js +1 -1
- package/dist/models/impact-apiresponse.d.ts +33 -0
- package/dist/models/impact-apiresponse.js +15 -0
- package/dist/models/impact-create.d.ts +37 -0
- package/dist/models/impact-create.js +15 -0
- package/dist/models/impact-update.d.ts +22 -0
- package/dist/models/impact-update.js +15 -0
- package/dist/models/index.d.ts +13 -1
- package/dist/models/index.js +13 -1
- package/dist/models/investment-create.d.ts +21 -0
- package/dist/models/investment-create.js +15 -0
- package/dist/models/investment-response.d.ts +26 -0
- package/dist/models/investment-response.js +15 -0
- package/dist/models/investment-update.d.ts +18 -0
- package/dist/models/investment-update.js +15 -0
- package/dist/models/{validation-error-loc-inner.d.ts → location-inner.d.ts} +2 -7
- package/dist/models/location-inner.js +15 -0
- package/dist/models/measurement-type.d.ts +1 -6
- package/dist/models/measurement-type.js +1 -6
- package/dist/models/metric-costs-per-year-create.d.ts +1 -17
- package/dist/models/metric-costs-per-year-create.js +1 -1
- package/dist/models/metric-costs-per-year-response.d.ts +1 -18
- package/dist/models/metric-costs-per-year-response.js +1 -1
- package/dist/models/metric-costs-per-year-update.d.ts +1 -13
- package/dist/models/metric-costs-per-year-update.js +1 -1
- package/dist/models/metric-create.d.ts +3 -28
- package/dist/models/metric-create.js +1 -1
- package/dist/models/metric-response.d.ts +3 -50
- package/dist/models/metric-response.js +1 -1
- package/dist/models/metric-type.d.ts +1 -6
- package/dist/models/metric-type.js +1 -6
- package/dist/models/metric-update.d.ts +3 -35
- package/dist/models/metric-update.js +1 -1
- package/dist/models/objective-create.d.ts +1 -10
- package/dist/models/objective-create.js +1 -1
- package/dist/models/objective-response.d.ts +1 -30
- package/dist/models/objective-response.js +1 -1
- package/dist/models/objective-update.d.ts +1 -13
- package/dist/models/objective-update.js +1 -1
- package/dist/models/objective-weight-create.d.ts +1 -9
- package/dist/models/objective-weight-create.js +1 -1
- package/dist/models/objective-weight-response.d.ts +1 -14
- package/dist/models/objective-weight-response.js +1 -1
- package/dist/models/objective-weight-update.d.ts +1 -8
- package/dist/models/objective-weight-update.js +1 -1
- package/dist/models/option-create.d.ts +33 -0
- package/dist/models/option-create.js +15 -0
- package/dist/models/option-response.d.ts +32 -0
- package/dist/models/option-response.js +15 -0
- package/dist/models/option-update.d.ts +21 -0
- package/dist/models/option-update.js +15 -0
- package/dist/models/validation-error.d.ts +3 -33
- package/dist/models/validation-error.js +1 -1
- package/dist/models/value-framework-create.d.ts +1 -10
- package/dist/models/value-framework-create.js +1 -1
- package/dist/models/value-framework-response.d.ts +1 -30
- package/dist/models/value-framework-response.js +1 -1
- package/dist/models/value-framework-update.d.ts +1 -13
- package/dist/models/value-framework-update.js +1 -1
- package/docs/DefaultApi.md +51 -0
- package/docs/EvolutionType.md +10 -0
- package/docs/FavoredOptionApi.md +119 -0
- package/docs/FavoredOptionRequest.md +21 -0
- package/docs/FavoredOptionResponse.md +21 -0
- package/docs/HTTPValidationError.md +20 -0
- package/docs/ImpactAPIResponse.md +39 -0
- package/docs/ImpactApi.md +312 -0
- package/docs/ImpactCreate.md +29 -0
- package/docs/ImpactUpdate.md +29 -0
- package/docs/InvestmentApi.md +987 -0
- package/docs/InvestmentCreate.md +23 -0
- package/docs/InvestmentResponse.md +33 -0
- package/docs/InvestmentUpdate.md +23 -0
- package/docs/LocationInner.md +18 -0
- package/docs/MeasurementType.md +10 -0
- package/docs/MetricApi.md +299 -0
- package/docs/MetricCostsApi.md +66 -0
- package/docs/MetricCostsPerYearApi.md +307 -0
- package/docs/MetricCostsPerYearCreate.md +27 -0
- package/docs/MetricCostsPerYearResponse.md +31 -0
- package/docs/MetricCostsPerYearUpdate.md +23 -0
- package/docs/MetricCreate.md +33 -0
- package/docs/MetricResponse.md +43 -0
- package/docs/MetricType.md +12 -0
- package/docs/MetricUpdate.md +31 -0
- package/docs/ObjectiveApi.md +633 -0
- package/docs/ObjectiveCreate.md +23 -0
- package/docs/ObjectiveResponse.md +31 -0
- package/docs/ObjectiveUpdate.md +23 -0
- package/docs/ObjectiveWeightApi.md +298 -0
- package/docs/ObjectiveWeightCreate.md +25 -0
- package/docs/ObjectiveWeightResponse.md +27 -0
- package/docs/ObjectiveWeightUpdate.md +21 -0
- package/docs/ObjectiveWeightsApi.md +66 -0
- package/docs/OptionApi.md +602 -0
- package/docs/OptionCreate.md +29 -0
- package/docs/OptionResponse.md +39 -0
- package/docs/OptionUpdate.md +29 -0
- package/docs/ValidationError.md +28 -0
- package/docs/ValueFrameworkApi.md +1053 -0
- package/docs/ValueFrameworkCostsApi.md +128 -0
- package/docs/ValueFrameworkCreate.md +23 -0
- package/docs/ValueFrameworkResponse.md +31 -0
- package/docs/ValueFrameworkUpdate.md +23 -0
- package/docs/ValueFrameworkWeightsApi.md +66 -0
- package/index.ts +1 -1
- package/models/evolution-type.ts +26 -0
- package/models/favored-option-request.ts +26 -0
- package/models/favored-option-response.ts +26 -0
- package/models/httpvalidation-error.ts +2 -12
- package/models/impact-apiresponse.ts +43 -0
- package/models/impact-create.ts +47 -0
- package/models/impact-update.ts +32 -0
- package/models/index.ts +13 -1
- package/models/investment-create.ts +27 -0
- package/models/investment-response.ts +32 -0
- package/models/investment-update.ts +24 -0
- package/models/{validation-error-loc-inner.ts → location-inner.ts} +2 -7
- package/models/measurement-type.ts +1 -6
- package/models/metric-costs-per-year-create.ts +1 -17
- package/models/metric-costs-per-year-response.ts +1 -18
- package/models/metric-costs-per-year-update.ts +1 -13
- package/models/metric-create.ts +3 -28
- package/models/metric-response.ts +3 -50
- package/models/metric-type.ts +1 -6
- package/models/metric-update.ts +3 -35
- package/models/objective-create.ts +1 -10
- package/models/objective-response.ts +1 -30
- package/models/objective-update.ts +1 -13
- package/models/objective-weight-create.ts +1 -9
- package/models/objective-weight-response.ts +1 -14
- package/models/objective-weight-update.ts +1 -8
- package/models/option-create.ts +39 -0
- package/models/option-response.ts +38 -0
- package/models/option-update.ts +27 -0
- package/models/validation-error.ts +3 -33
- package/models/value-framework-create.ts +1 -10
- package/models/value-framework-response.ts +1 -30
- package/models/value-framework-update.ts +1 -13
- package/package.json +4 -4
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Asset Investment Planning
|
|
5
|
+
* API for Asset Investment Planning
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.2.0-dev3
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import type { Configuration } from '../configuration';
|
|
17
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
18
|
+
import globalAxios from 'axios';
|
|
19
|
+
// Some imports not used depending on template conditions
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
import type { MetricCostsPerYearResponse } from '../models';
|
|
26
|
+
/**
|
|
27
|
+
* ValueFrameworkCostsApi - axios parameter creator
|
|
28
|
+
*/
|
|
29
|
+
export const ValueFrameworkCostsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a paginated list of all metric costs for a specific value framework.
|
|
33
|
+
* @summary List all metric costs for a value framework
|
|
34
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
35
|
+
* @param {number} [offset] Number of records to skip
|
|
36
|
+
* @param {number} [limit] Max number of records to return
|
|
37
|
+
* @param {*} [options] Override http request option.
|
|
38
|
+
* @throws {RequiredError}
|
|
39
|
+
*/
|
|
40
|
+
getCostsForValueFramework: async (valueFrameworkId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
41
|
+
// verify required parameter 'valueFrameworkId' is not null or undefined
|
|
42
|
+
assertParamExists('getCostsForValueFramework', 'valueFrameworkId', valueFrameworkId)
|
|
43
|
+
const localVarPath = `/value_framework/{value_framework_id}/costs/`
|
|
44
|
+
.replace(`{${"value_framework_id"}}`, encodeURIComponent(String(valueFrameworkId)));
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
47
|
+
let baseOptions;
|
|
48
|
+
if (configuration) {
|
|
49
|
+
baseOptions = configuration.baseOptions;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
53
|
+
const localVarHeaderParameter = {} as any;
|
|
54
|
+
const localVarQueryParameter = {} as any;
|
|
55
|
+
|
|
56
|
+
// authentication OAuth2AuthorizationCodeBearer required
|
|
57
|
+
// oauth required
|
|
58
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
|
|
59
|
+
|
|
60
|
+
if (offset !== undefined) {
|
|
61
|
+
localVarQueryParameter['offset'] = offset;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (limit !== undefined) {
|
|
65
|
+
localVarQueryParameter['limit'] = limit;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
69
|
+
|
|
70
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
71
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
72
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
url: toPathString(localVarUrlObj),
|
|
76
|
+
options: localVarRequestOptions,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Retrieve a paginated list of metric costs for a specific metric within a value framework.
|
|
81
|
+
* @summary List metric costs for a value framework filtered by metric
|
|
82
|
+
* @param {string} metricId UUID of the metric
|
|
83
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
84
|
+
* @param {number} [offset] Number of records to skip
|
|
85
|
+
* @param {number} [limit] Max number of records to return
|
|
86
|
+
* @param {*} [options] Override http request option.
|
|
87
|
+
* @throws {RequiredError}
|
|
88
|
+
*/
|
|
89
|
+
getCostsForValueFrameworkByMetric: async (metricId: string, valueFrameworkId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
90
|
+
// verify required parameter 'metricId' is not null or undefined
|
|
91
|
+
assertParamExists('getCostsForValueFrameworkByMetric', 'metricId', metricId)
|
|
92
|
+
// verify required parameter 'valueFrameworkId' is not null or undefined
|
|
93
|
+
assertParamExists('getCostsForValueFrameworkByMetric', 'valueFrameworkId', valueFrameworkId)
|
|
94
|
+
const localVarPath = `/value_framework/{value_framework_id}/costs/{metric_id}`
|
|
95
|
+
.replace(`{${"metric_id"}}`, encodeURIComponent(String(metricId)))
|
|
96
|
+
.replace(`{${"value_framework_id"}}`, encodeURIComponent(String(valueFrameworkId)));
|
|
97
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
98
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
99
|
+
let baseOptions;
|
|
100
|
+
if (configuration) {
|
|
101
|
+
baseOptions = configuration.baseOptions;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
105
|
+
const localVarHeaderParameter = {} as any;
|
|
106
|
+
const localVarQueryParameter = {} as any;
|
|
107
|
+
|
|
108
|
+
// authentication OAuth2AuthorizationCodeBearer required
|
|
109
|
+
// oauth required
|
|
110
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
|
|
111
|
+
|
|
112
|
+
if (offset !== undefined) {
|
|
113
|
+
localVarQueryParameter['offset'] = offset;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (limit !== undefined) {
|
|
117
|
+
localVarQueryParameter['limit'] = limit;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
121
|
+
|
|
122
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
123
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
124
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
url: toPathString(localVarUrlObj),
|
|
128
|
+
options: localVarRequestOptions,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* ValueFrameworkCostsApi - functional programming interface
|
|
136
|
+
*/
|
|
137
|
+
export const ValueFrameworkCostsApiFp = function(configuration?: Configuration) {
|
|
138
|
+
const localVarAxiosParamCreator = ValueFrameworkCostsApiAxiosParamCreator(configuration)
|
|
139
|
+
return {
|
|
140
|
+
/**
|
|
141
|
+
* Retrieve a paginated list of all metric costs for a specific value framework.
|
|
142
|
+
* @summary List all metric costs for a value framework
|
|
143
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
144
|
+
* @param {number} [offset] Number of records to skip
|
|
145
|
+
* @param {number} [limit] Max number of records to return
|
|
146
|
+
* @param {*} [options] Override http request option.
|
|
147
|
+
* @throws {RequiredError}
|
|
148
|
+
*/
|
|
149
|
+
async getCostsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetricCostsPerYearResponse>>> {
|
|
150
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getCostsForValueFramework(valueFrameworkId, offset, limit, options);
|
|
151
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
152
|
+
const localVarOperationServerBasePath = operationServerMap['ValueFrameworkCostsApi.getCostsForValueFramework']?.[localVarOperationServerIndex]?.url;
|
|
153
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* Retrieve a paginated list of metric costs for a specific metric within a value framework.
|
|
157
|
+
* @summary List metric costs for a value framework filtered by metric
|
|
158
|
+
* @param {string} metricId UUID of the metric
|
|
159
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
160
|
+
* @param {number} [offset] Number of records to skip
|
|
161
|
+
* @param {number} [limit] Max number of records to return
|
|
162
|
+
* @param {*} [options] Override http request option.
|
|
163
|
+
* @throws {RequiredError}
|
|
164
|
+
*/
|
|
165
|
+
async getCostsForValueFrameworkByMetric(metricId: string, valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<MetricCostsPerYearResponse>>> {
|
|
166
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getCostsForValueFrameworkByMetric(metricId, valueFrameworkId, offset, limit, options);
|
|
167
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
168
|
+
const localVarOperationServerBasePath = operationServerMap['ValueFrameworkCostsApi.getCostsForValueFrameworkByMetric']?.[localVarOperationServerIndex]?.url;
|
|
169
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
170
|
+
},
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* ValueFrameworkCostsApi - factory interface
|
|
176
|
+
*/
|
|
177
|
+
export const ValueFrameworkCostsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
178
|
+
const localVarFp = ValueFrameworkCostsApiFp(configuration)
|
|
179
|
+
return {
|
|
180
|
+
/**
|
|
181
|
+
* Retrieve a paginated list of all metric costs for a specific value framework.
|
|
182
|
+
* @summary List all metric costs for a value framework
|
|
183
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
184
|
+
* @param {number} [offset] Number of records to skip
|
|
185
|
+
* @param {number} [limit] Max number of records to return
|
|
186
|
+
* @param {*} [options] Override http request option.
|
|
187
|
+
* @throws {RequiredError}
|
|
188
|
+
*/
|
|
189
|
+
getCostsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<MetricCostsPerYearResponse>> {
|
|
190
|
+
return localVarFp.getCostsForValueFramework(valueFrameworkId, offset, limit, options).then((request) => request(axios, basePath));
|
|
191
|
+
},
|
|
192
|
+
/**
|
|
193
|
+
* Retrieve a paginated list of metric costs for a specific metric within a value framework.
|
|
194
|
+
* @summary List metric costs for a value framework filtered by metric
|
|
195
|
+
* @param {string} metricId UUID of the metric
|
|
196
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
197
|
+
* @param {number} [offset] Number of records to skip
|
|
198
|
+
* @param {number} [limit] Max number of records to return
|
|
199
|
+
* @param {*} [options] Override http request option.
|
|
200
|
+
* @throws {RequiredError}
|
|
201
|
+
*/
|
|
202
|
+
getCostsForValueFrameworkByMetric(metricId: string, valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<MetricCostsPerYearResponse>> {
|
|
203
|
+
return localVarFp.getCostsForValueFrameworkByMetric(metricId, valueFrameworkId, offset, limit, options).then((request) => request(axios, basePath));
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* ValueFrameworkCostsApi - object-oriented interface
|
|
210
|
+
*/
|
|
211
|
+
export class ValueFrameworkCostsApi extends BaseAPI {
|
|
212
|
+
/**
|
|
213
|
+
* Retrieve a paginated list of all metric costs for a specific value framework.
|
|
214
|
+
* @summary List all metric costs for a value framework
|
|
215
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
216
|
+
* @param {number} [offset] Number of records to skip
|
|
217
|
+
* @param {number} [limit] Max number of records to return
|
|
218
|
+
* @param {*} [options] Override http request option.
|
|
219
|
+
* @throws {RequiredError}
|
|
220
|
+
*/
|
|
221
|
+
public getCostsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig) {
|
|
222
|
+
return ValueFrameworkCostsApiFp(this.configuration).getCostsForValueFramework(valueFrameworkId, offset, limit, options).then((request) => request(this.axios, this.basePath));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Retrieve a paginated list of metric costs for a specific metric within a value framework.
|
|
227
|
+
* @summary List metric costs for a value framework filtered by metric
|
|
228
|
+
* @param {string} metricId UUID of the metric
|
|
229
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
230
|
+
* @param {number} [offset] Number of records to skip
|
|
231
|
+
* @param {number} [limit] Max number of records to return
|
|
232
|
+
* @param {*} [options] Override http request option.
|
|
233
|
+
* @throws {RequiredError}
|
|
234
|
+
*/
|
|
235
|
+
public getCostsForValueFrameworkByMetric(metricId: string, valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig) {
|
|
236
|
+
return ValueFrameworkCostsApiFp(this.configuration).getCostsForValueFrameworkByMetric(metricId, valueFrameworkId, offset, limit, options).then((request) => request(this.axios, this.basePath));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Asset Investment Planning
|
|
5
|
+
* API for Asset Investment Planning
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.2.0-dev3
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import type { Configuration } from '../configuration';
|
|
17
|
+
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
|
|
18
|
+
import globalAxios from 'axios';
|
|
19
|
+
// Some imports not used depending on template conditions
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded } from '../common';
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
import type { ObjectiveWeightResponse } from '../models';
|
|
26
|
+
/**
|
|
27
|
+
* ValueFrameworkWeightsApi - axios parameter creator
|
|
28
|
+
*/
|
|
29
|
+
export const ValueFrameworkWeightsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
30
|
+
return {
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a paginated list of all objective weights for a specific value framework.
|
|
33
|
+
* @summary List all objective weights for a value framework
|
|
34
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
35
|
+
* @param {number} [offset] Number of records to skip
|
|
36
|
+
* @param {number} [limit] Max number of records to return
|
|
37
|
+
* @param {*} [options] Override http request option.
|
|
38
|
+
* @throws {RequiredError}
|
|
39
|
+
*/
|
|
40
|
+
getWeightsForValueFramework: async (valueFrameworkId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
41
|
+
// verify required parameter 'valueFrameworkId' is not null or undefined
|
|
42
|
+
assertParamExists('getWeightsForValueFramework', 'valueFrameworkId', valueFrameworkId)
|
|
43
|
+
const localVarPath = `/value_framework/{value_framework_id}/weights/`
|
|
44
|
+
.replace(`{${"value_framework_id"}}`, encodeURIComponent(String(valueFrameworkId)));
|
|
45
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
46
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
47
|
+
let baseOptions;
|
|
48
|
+
if (configuration) {
|
|
49
|
+
baseOptions = configuration.baseOptions;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
53
|
+
const localVarHeaderParameter = {} as any;
|
|
54
|
+
const localVarQueryParameter = {} as any;
|
|
55
|
+
|
|
56
|
+
// authentication OAuth2AuthorizationCodeBearer required
|
|
57
|
+
// oauth required
|
|
58
|
+
await setOAuthToObject(localVarHeaderParameter, "OAuth2AuthorizationCodeBearer", [], configuration)
|
|
59
|
+
|
|
60
|
+
if (offset !== undefined) {
|
|
61
|
+
localVarQueryParameter['offset'] = offset;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (limit !== undefined) {
|
|
65
|
+
localVarQueryParameter['limit'] = limit;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
localVarHeaderParameter['Accept'] = 'application/json';
|
|
69
|
+
|
|
70
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
71
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
72
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
73
|
+
|
|
74
|
+
return {
|
|
75
|
+
url: toPathString(localVarUrlObj),
|
|
76
|
+
options: localVarRequestOptions,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* ValueFrameworkWeightsApi - functional programming interface
|
|
84
|
+
*/
|
|
85
|
+
export const ValueFrameworkWeightsApiFp = function(configuration?: Configuration) {
|
|
86
|
+
const localVarAxiosParamCreator = ValueFrameworkWeightsApiAxiosParamCreator(configuration)
|
|
87
|
+
return {
|
|
88
|
+
/**
|
|
89
|
+
* Retrieve a paginated list of all objective weights for a specific value framework.
|
|
90
|
+
* @summary List all objective weights for a value framework
|
|
91
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
92
|
+
* @param {number} [offset] Number of records to skip
|
|
93
|
+
* @param {number} [limit] Max number of records to return
|
|
94
|
+
* @param {*} [options] Override http request option.
|
|
95
|
+
* @throws {RequiredError}
|
|
96
|
+
*/
|
|
97
|
+
async getWeightsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<ObjectiveWeightResponse>>> {
|
|
98
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getWeightsForValueFramework(valueFrameworkId, offset, limit, options);
|
|
99
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
100
|
+
const localVarOperationServerBasePath = operationServerMap['ValueFrameworkWeightsApi.getWeightsForValueFramework']?.[localVarOperationServerIndex]?.url;
|
|
101
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
102
|
+
},
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* ValueFrameworkWeightsApi - factory interface
|
|
108
|
+
*/
|
|
109
|
+
export const ValueFrameworkWeightsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
110
|
+
const localVarFp = ValueFrameworkWeightsApiFp(configuration)
|
|
111
|
+
return {
|
|
112
|
+
/**
|
|
113
|
+
* Retrieve a paginated list of all objective weights for a specific value framework.
|
|
114
|
+
* @summary List all objective weights for a value framework
|
|
115
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
116
|
+
* @param {number} [offset] Number of records to skip
|
|
117
|
+
* @param {number} [limit] Max number of records to return
|
|
118
|
+
* @param {*} [options] Override http request option.
|
|
119
|
+
* @throws {RequiredError}
|
|
120
|
+
*/
|
|
121
|
+
getWeightsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise<Array<ObjectiveWeightResponse>> {
|
|
122
|
+
return localVarFp.getWeightsForValueFramework(valueFrameworkId, offset, limit, options).then((request) => request(axios, basePath));
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* ValueFrameworkWeightsApi - object-oriented interface
|
|
129
|
+
*/
|
|
130
|
+
export class ValueFrameworkWeightsApi extends BaseAPI {
|
|
131
|
+
/**
|
|
132
|
+
* Retrieve a paginated list of all objective weights for a specific value framework.
|
|
133
|
+
* @summary List all objective weights for a value framework
|
|
134
|
+
* @param {string} valueFrameworkId UUID of the value framework
|
|
135
|
+
* @param {number} [offset] Number of records to skip
|
|
136
|
+
* @param {number} [limit] Max number of records to return
|
|
137
|
+
* @param {*} [options] Override http request option.
|
|
138
|
+
* @throws {RequiredError}
|
|
139
|
+
*/
|
|
140
|
+
public getWeightsForValueFramework(valueFrameworkId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig) {
|
|
141
|
+
return ValueFrameworkWeightsApiFp(this.configuration).getWeightsForValueFramework(valueFrameworkId, offset, limit, options).then((request) => request(this.axios, this.basePath));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
package/api.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Asset Investment Planning
|
|
5
5
|
* API for Asset Investment Planning
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.2.0-
|
|
7
|
+
* The version of the OpenAPI document: 0.2.0-dev3
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -15,9 +15,17 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
export * from './api/default-api';
|
|
18
|
+
export * from './api/favored-option-api';
|
|
19
|
+
export * from './api/impact-api';
|
|
20
|
+
export * from './api/investment-api';
|
|
18
21
|
export * from './api/metric-api';
|
|
22
|
+
export * from './api/metric-costs-api';
|
|
19
23
|
export * from './api/metric-costs-per-year-api';
|
|
20
24
|
export * from './api/objective-api';
|
|
21
25
|
export * from './api/objective-weight-api';
|
|
26
|
+
export * from './api/objective-weights-api';
|
|
27
|
+
export * from './api/option-api';
|
|
22
28
|
export * from './api/value-framework-api';
|
|
29
|
+
export * from './api/value-framework-costs-api';
|
|
30
|
+
export * from './api/value-framework-weights-api';
|
|
23
31
|
|
package/base.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Asset Investment Planning
|
|
5
5
|
* API for Asset Investment Planning
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.2.0-
|
|
7
|
+
* The version of the OpenAPI document: 0.2.0-dev3
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -21,10 +21,6 @@ import globalAxios from 'axios';
|
|
|
21
21
|
|
|
22
22
|
export const BASE_PATH = "http://localhost".replace(/\/+$/, "");
|
|
23
23
|
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @export
|
|
27
|
-
*/
|
|
28
24
|
export const COLLECTION_FORMATS = {
|
|
29
25
|
csv: ",",
|
|
30
26
|
ssv: " ",
|
|
@@ -32,21 +28,11 @@ export const COLLECTION_FORMATS = {
|
|
|
32
28
|
pipes: "|",
|
|
33
29
|
};
|
|
34
30
|
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @export
|
|
38
|
-
* @interface RequestArgs
|
|
39
|
-
*/
|
|
40
31
|
export interface RequestArgs {
|
|
41
32
|
url: string;
|
|
42
33
|
options: RawAxiosRequestConfig;
|
|
43
34
|
}
|
|
44
35
|
|
|
45
|
-
/**
|
|
46
|
-
*
|
|
47
|
-
* @export
|
|
48
|
-
* @class BaseAPI
|
|
49
|
-
*/
|
|
50
36
|
export class BaseAPI {
|
|
51
37
|
protected configuration: Configuration | undefined;
|
|
52
38
|
|
|
@@ -58,12 +44,6 @@ export class BaseAPI {
|
|
|
58
44
|
}
|
|
59
45
|
};
|
|
60
46
|
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @export
|
|
64
|
-
* @class RequiredError
|
|
65
|
-
* @extends {Error}
|
|
66
|
-
*/
|
|
67
47
|
export class RequiredError extends Error {
|
|
68
48
|
constructor(public field: string, msg?: string) {
|
|
69
49
|
super(msg);
|
|
@@ -78,9 +58,5 @@ interface ServerMap {
|
|
|
78
58
|
}[];
|
|
79
59
|
}
|
|
80
60
|
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @export
|
|
84
|
-
*/
|
|
85
61
|
export const operationServerMap: ServerMap = {
|
|
86
62
|
}
|
package/common.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Asset Investment Planning
|
|
5
5
|
* API for Asset Investment Planning
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.2.0-
|
|
7
|
+
* The version of the OpenAPI document: 0.2.0-dev3
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -12,22 +12,16 @@
|
|
|
12
12
|
* Do not edit the class manually.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
import type { Configuration } from "./configuration";
|
|
17
16
|
import type { RequestArgs } from "./base";
|
|
18
17
|
import type { AxiosInstance, AxiosResponse } from 'axios';
|
|
19
18
|
import { RequiredError } from "./base";
|
|
20
19
|
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @export
|
|
24
|
-
*/
|
|
25
20
|
export const DUMMY_BASE_URL = 'https://example.com'
|
|
26
21
|
|
|
27
22
|
/**
|
|
28
23
|
*
|
|
29
24
|
* @throws {RequiredError}
|
|
30
|
-
* @export
|
|
31
25
|
*/
|
|
32
26
|
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
|
|
33
27
|
if (paramValue === null || paramValue === undefined) {
|
|
@@ -35,10 +29,6 @@ export const assertParamExists = function (functionName: string, paramName: stri
|
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @export
|
|
41
|
-
*/
|
|
42
32
|
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
|
|
43
33
|
if (configuration && configuration.apiKey) {
|
|
44
34
|
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
@@ -48,20 +38,12 @@ export const setApiKeyToObject = async function (object: any, keyParamName: stri
|
|
|
48
38
|
}
|
|
49
39
|
}
|
|
50
40
|
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @export
|
|
54
|
-
*/
|
|
55
41
|
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
|
|
56
42
|
if (configuration && (configuration.username || configuration.password)) {
|
|
57
43
|
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
58
44
|
}
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @export
|
|
64
|
-
*/
|
|
65
47
|
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
|
|
66
48
|
if (configuration && configuration.accessToken) {
|
|
67
49
|
const accessToken = typeof configuration.accessToken === 'function'
|
|
@@ -71,10 +53,6 @@ export const setBearerAuthToObject = async function (object: any, configuration?
|
|
|
71
53
|
}
|
|
72
54
|
}
|
|
73
55
|
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @export
|
|
77
|
-
*/
|
|
78
56
|
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
|
|
79
57
|
if (configuration && configuration.accessToken) {
|
|
80
58
|
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
@@ -84,32 +62,29 @@ export const setOAuthToObject = async function (object: any, name: string, scope
|
|
|
84
62
|
}
|
|
85
63
|
}
|
|
86
64
|
|
|
65
|
+
|
|
87
66
|
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
|
|
88
67
|
if (parameter == null) return;
|
|
89
68
|
if (typeof parameter === "object") {
|
|
90
|
-
if (Array.isArray(parameter)) {
|
|
69
|
+
if (Array.isArray(parameter) || parameter instanceof Set) {
|
|
91
70
|
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
92
|
-
}
|
|
71
|
+
}
|
|
93
72
|
else {
|
|
94
|
-
Object.keys(parameter).forEach(currentKey =>
|
|
73
|
+
Object.keys(parameter).forEach(currentKey =>
|
|
95
74
|
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
|
|
96
75
|
);
|
|
97
76
|
}
|
|
98
|
-
}
|
|
77
|
+
}
|
|
99
78
|
else {
|
|
100
79
|
if (urlSearchParams.has(key)) {
|
|
101
80
|
urlSearchParams.append(key, parameter);
|
|
102
|
-
}
|
|
81
|
+
}
|
|
103
82
|
else {
|
|
104
83
|
urlSearchParams.set(key, parameter);
|
|
105
84
|
}
|
|
106
85
|
}
|
|
107
86
|
}
|
|
108
87
|
|
|
109
|
-
/**
|
|
110
|
-
*
|
|
111
|
-
* @export
|
|
112
|
-
*/
|
|
113
88
|
export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
114
89
|
const searchParams = new URLSearchParams(url.search);
|
|
115
90
|
setFlattenedQueryParams(searchParams, objects);
|
|
@@ -117,31 +92,33 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
|
|
|
117
92
|
}
|
|
118
93
|
|
|
119
94
|
/**
|
|
120
|
-
*
|
|
121
|
-
*
|
|
95
|
+
* JSON serialization helper function which replaces instances of unserializable types with serializable ones.
|
|
96
|
+
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
|
|
97
|
+
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
|
|
122
98
|
*/
|
|
99
|
+
// @ts-ignore
|
|
100
|
+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
|
|
101
|
+
if (value instanceof Set) {
|
|
102
|
+
return Array.from(value);
|
|
103
|
+
} else {
|
|
104
|
+
return value;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
123
108
|
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
|
|
124
109
|
const nonString = typeof value !== 'string';
|
|
125
110
|
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
126
111
|
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
127
112
|
: nonString;
|
|
128
113
|
return needsSerialization
|
|
129
|
-
? JSON.stringify(value !== undefined ? value : {})
|
|
114
|
+
? JSON.stringify(value !== undefined ? value : {}, replaceWithSerializableTypeIfNeeded)
|
|
130
115
|
: (value || "");
|
|
131
116
|
}
|
|
132
117
|
|
|
133
|
-
/**
|
|
134
|
-
*
|
|
135
|
-
* @export
|
|
136
|
-
*/
|
|
137
118
|
export const toPathString = function (url: URL) {
|
|
138
119
|
return url.pathname + url.search + url.hash
|
|
139
120
|
}
|
|
140
121
|
|
|
141
|
-
/**
|
|
142
|
-
*
|
|
143
|
-
* @export
|
|
144
|
-
*/
|
|
145
122
|
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
|
|
146
123
|
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
|
|
147
124
|
const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
|