@factset/sdk-barraportfoliooptimizer
Advanced tools
Comparing version 0.9.1 to 0.20.0
@@ -32,3 +32,3 @@ "use strict"; | ||
* @module api/AccountsApi | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -77,3 +77,3 @@ class AccountsApi { | ||
* @param {String} path The directory to get the accounts and sub-directories in | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AccountDirectoriesRoot} | ||
* @return { Promise.< module:model/AccountDirectoriesRoot > } a Promise, with data of type {@link module:model/AccountDirectoriesRoot } | ||
*/ | ||
@@ -80,0 +80,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
exports.default = exports.PutAndOptimizeResponseWrapper = exports.PostAndOptimizeResponseWrapper = void 0; | ||
@@ -37,3 +37,3 @@ var _ApiClient = _interopRequireDefault(require("../ApiClient")); | ||
* @module api/BPMOptimizerApi | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -82,3 +82,3 @@ class BPMOptimizerApi { | ||
* @param {String} id from url, provided from the location header in the Create and Run BPM optimization endpoint | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise} | ||
* @return { Promise } a Promise | ||
*/ | ||
@@ -123,3 +123,3 @@ | ||
* @param {String} id from url, provided from the location header in the Create and Run BPM optimization endpoint | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BPMOptimizationParametersRoot} | ||
* @return { Promise.< module:model/BPMOptimizationParametersRoot > } a Promise, with data of type {@link module:model/BPMOptimizationParametersRoot } | ||
*/ | ||
@@ -164,3 +164,3 @@ | ||
* @param {String} id from url, provided from the location header in the Get BPM optimization status by id endpoint | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ObjectRoot} | ||
* @return { Promise.< module:model/ObjectRoot > } a Promise, with data of type {@link module:model/ObjectRoot } | ||
*/ | ||
@@ -205,3 +205,3 @@ | ||
* @param {String} id from url, provided from the location header in the Create and Run BPM optimization endpoint | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ObjectRoot} | ||
* @return { Promise.< module:model/ObjectRoot > } a Promise, with data of type {@link module:model/ObjectRoot } | ||
*/ | ||
@@ -239,3 +239,3 @@ | ||
let accepts = ['application/json']; | ||
let returnType = _ObjectRoot.default; | ||
let returnType = PostAndOptimizeResponseWrapperTypeMap; | ||
return this.apiClient.callApi('/analytics/engines/bpm/v3/optimizations', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null); | ||
@@ -250,3 +250,3 @@ } | ||
* @param {module:model/BPMOptimizationParametersRoot} opts.bPMOptimizationParametersRoot Optimization Parameters | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ObjectRoot} | ||
* @return { Promise.< PostAndOptimizeResponseWrapper > } a Promise, with data of type {@link PostAndOptimizeResponseWrapper } | ||
*/ | ||
@@ -292,3 +292,3 @@ | ||
let accepts = ['application/json']; | ||
let returnType = _ObjectRoot.default; | ||
let returnType = PutAndOptimizeResponseWrapperTypeMap; | ||
return this.apiClient.callApi('/analytics/engines/bpm/v3/optimizations/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null); | ||
@@ -304,3 +304,3 @@ } | ||
* @param {module:model/BPMOptimizationParametersRoot} opts.bPMOptimizationParametersRoot Optimization Parameters | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ObjectRoot} | ||
* @return { Promise.< PutAndOptimizeResponseWrapper > } a Promise, with data of type {@link PutAndOptimizeResponseWrapper } | ||
*/ | ||
@@ -317,2 +317,174 @@ | ||
exports.default = BPMOptimizerApi; | ||
exports.default = BPMOptimizerApi; | ||
const PostAndOptimizeResponseWrapperTypeMap = { | ||
201: _ObjectRoot.default, | ||
202: _CalculationInfoRoot.default, | ||
400: _ClientErrorResponse.default, | ||
404: _ClientErrorResponse.default, | ||
_createResponseWrapper(statusCode, response) { | ||
return new PostAndOptimizeResponseWrapper(statusCode, response); | ||
} | ||
}; | ||
const PutAndOptimizeResponseWrapperTypeMap = { | ||
201: _ObjectRoot.default, | ||
202: _CalculationInfoRoot.default, | ||
400: _ClientErrorResponse.default, | ||
404: _ClientErrorResponse.default, | ||
409: _ClientErrorResponse.default, | ||
_createResponseWrapper(statusCode, response) { | ||
return new PutAndOptimizeResponseWrapper(statusCode, response); | ||
} | ||
}; | ||
/** | ||
* Wrapper to support POST /analytics/engines/bpm/v3/optimizations returning different types | ||
* per status code. | ||
* | ||
* <p> | ||
* Responses: | ||
* <ul> | ||
* <li>201 : {@code ObjectRoot }<br>Expected response, returns json if optimization is completed in a short span.</li> | ||
* | ||
* <li>202 : {@code CalculationInfoRoot }<br>Expected response, contains the poll URL in the Location header.</li> | ||
* </ul> | ||
* | ||
* </p> | ||
* Example: | ||
* <pre>{@code | ||
* const response = ...; | ||
* switch (response.statusCode) { | ||
* case 201: | ||
* ObjectRoot data201 = response.getResponse201(); | ||
* break; | ||
* case 202: | ||
* CalculationInfoRoot data202 = response.getResponse202(); | ||
* break; | ||
* } | ||
* }</pre> | ||
* | ||
* @alias module:PostAndOptimizeResponseWrapper | ||
* @class | ||
*/ | ||
class PostAndOptimizeResponseWrapper { | ||
/** | ||
* @param {number} statusCode | ||
* @param {*} response | ||
*/ | ||
constructor(statusCode, response) { | ||
/** | ||
* @type {number} | ||
*/ | ||
this.statusCode = statusCode; | ||
/** | ||
* @type {*} | ||
*/ | ||
this.response = response; | ||
} | ||
/** | ||
* @returns { ObjectRoot } | ||
*/ | ||
getResponse201() { | ||
if (this.statusCode !== 201) { | ||
throw new Error("Invalid response getter called. getResponse201 can't return a " + this.statusCode + " response"); | ||
} | ||
return this.response; | ||
} | ||
/** | ||
* @returns { CalculationInfoRoot } | ||
*/ | ||
getResponse202() { | ||
if (this.statusCode !== 202) { | ||
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response"); | ||
} | ||
return this.response; | ||
} | ||
} | ||
/** | ||
* Wrapper to support PUT /analytics/engines/bpm/v3/optimizations/{id} returning different types | ||
* per status code. | ||
* | ||
* <p> | ||
* Responses: | ||
* <ul> | ||
* <li>201 : {@code ObjectRoot }<br>Expected response, returns json if optimization is completed in a short span.</li> | ||
* | ||
* <li>202 : {@code CalculationInfoRoot }<br>Expected response, contains the poll URL in the Location header.</li> | ||
* </ul> | ||
* | ||
* </p> | ||
* Example: | ||
* <pre>{@code | ||
* const response = ...; | ||
* switch (response.statusCode) { | ||
* case 201: | ||
* ObjectRoot data201 = response.getResponse201(); | ||
* break; | ||
* case 202: | ||
* CalculationInfoRoot data202 = response.getResponse202(); | ||
* break; | ||
* } | ||
* }</pre> | ||
* | ||
* @alias module:PutAndOptimizeResponseWrapper | ||
* @class | ||
*/ | ||
exports.PostAndOptimizeResponseWrapper = PostAndOptimizeResponseWrapper; | ||
class PutAndOptimizeResponseWrapper { | ||
/** | ||
* @param {number} statusCode | ||
* @param {*} response | ||
*/ | ||
constructor(statusCode, response) { | ||
/** | ||
* @type {number} | ||
*/ | ||
this.statusCode = statusCode; | ||
/** | ||
* @type {*} | ||
*/ | ||
this.response = response; | ||
} | ||
/** | ||
* @returns { ObjectRoot } | ||
*/ | ||
getResponse201() { | ||
if (this.statusCode !== 201) { | ||
throw new Error("Invalid response getter called. getResponse201 can't return a " + this.statusCode + " response"); | ||
} | ||
return this.response; | ||
} | ||
/** | ||
* @returns { CalculationInfoRoot } | ||
*/ | ||
getResponse202() { | ||
if (this.statusCode !== 202) { | ||
throw new Error("Invalid response getter called. getResponse202 can't return a " + this.statusCode + " response"); | ||
} | ||
return this.response; | ||
} | ||
} | ||
exports.PutAndOptimizeResponseWrapper = PutAndOptimizeResponseWrapper; |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module api/CurrenciesApi | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -66,3 +66,3 @@ class CurrenciesApi { | ||
* This endpoint lists all the currencies that can be applied to any calculation. | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CurrencyRoot} | ||
* @return { Promise.< module:model/CurrencyRoot > } a Promise, with data of type {@link module:model/CurrencyRoot } | ||
*/ | ||
@@ -69,0 +69,0 @@ |
@@ -32,3 +32,3 @@ "use strict"; | ||
* @module api/StrategyDocumentsApi | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -77,3 +77,3 @@ class StrategyDocumentsApi { | ||
* @param {String} path The directory to get the strategy documents and sub-directories in | ||
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DocumentDirectoriesRoot} | ||
* @return { Promise.< module:model/DocumentDirectoriesRoot > } a Promise, with data of type {@link module:model/DocumentDirectoriesRoot } | ||
*/ | ||
@@ -80,0 +80,0 @@ |
@@ -29,3 +29,3 @@ "use strict"; | ||
* @module ApiClient | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -80,3 +80,3 @@ | ||
this.defaultHeaders = { | ||
'User-Agent': 'fds-sdk/javascript/BarraPortfolioOptimizer/0.9.1' | ||
'User-Agent': 'fds-sdk/javascript/BarraPortfolioOptimizer/0.20.0' | ||
}; | ||
@@ -426,2 +426,12 @@ /** | ||
if (typeof returnType._createResponseWrapper === "function") { | ||
let deserialized = null; | ||
if (returnType[response.status]) { | ||
deserialized = ApiClient.convertToType(data, returnType[response.status]); | ||
} | ||
return returnType._createResponseWrapper(response.status, deserialized); | ||
} | ||
return ApiClient.convertToType(data, returnType); | ||
@@ -428,0 +438,0 @@ } |
@@ -180,2 +180,14 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "PostAndOptimizeResponseWrapper", { | ||
enumerable: true, | ||
get: function () { | ||
return _BPMOptimizerApi.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "PutAndOptimizeResponseWrapper", { | ||
enumerable: true, | ||
get: function () { | ||
return _BPMOptimizerApi.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "StrategyDocumentsApi", { | ||
@@ -182,0 +194,0 @@ enumerable: true, |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/AccountDirectories | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class AccountDirectories { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/AccountDirectoriesRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class AccountDirectoriesRoot { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/BPMOptimization | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class BPMOptimization { |
@@ -36,3 +36,3 @@ "use strict"; | ||
* @module model/BPMOptimizationParameters | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -39,0 +39,0 @@ class BPMOptimizationParameters { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/BPMOptimizationParametersRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class BPMOptimizationParametersRoot { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/BPMOptimizerStrategy | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class BPMOptimizerStrategy { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/BPMOptimizerStrategyAlphaOverride | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class BPMOptimizerStrategyAlphaOverride { |
@@ -32,3 +32,3 @@ "use strict"; | ||
* @module model/BPMOptimizerStrategyOverrides | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -35,0 +35,0 @@ class BPMOptimizerStrategyOverrides { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/CalculationInfo | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class CalculationInfo { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/CalculationInfoRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class CalculationInfoRoot { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/ClientErrorResponse | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class ClientErrorResponse { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/ConstraintAction | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class ConstraintAction { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/Currency | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class Currency { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/CurrencyRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class CurrencyRoot { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/DocumentDirectories | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class DocumentDirectories { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/DocumentDirectoriesRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class DocumentDirectoriesRoot { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/Error | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class Error { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/ErrorSource | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class ErrorSource { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/ObjectRoot | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class ObjectRoot { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/OptimalPortfolio | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class OptimalPortfolio { |
@@ -30,3 +30,3 @@ "use strict"; | ||
* @module model/OptimizerAccount | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -33,0 +33,0 @@ class OptimizerAccount { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/OptimizerAccountOverrides | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class OptimizerAccountOverrides { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/OptimizerOptimalHoldings | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class OptimizerOptimalHoldings { |
@@ -34,3 +34,3 @@ "use strict"; | ||
* @module model/OptimizerOutputTypes | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -37,0 +37,0 @@ class OptimizerOutputTypes { |
@@ -28,3 +28,3 @@ "use strict"; | ||
* @module model/OptimizerTradesList | ||
* @version 0.9.1 | ||
* @version 0.20.0 | ||
*/ | ||
@@ -31,0 +31,0 @@ class OptimizerTradesList { |
{ | ||
"name": "@factset/sdk-barraportfoliooptimizer", | ||
"version": "0.9.1", | ||
"version": "0.20.0", | ||
"description": "Barra Portfolio Optimizer client library for JavaScript", | ||
@@ -18,3 +18,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@factset/sdk-utils": "^0.10.0", | ||
"@factset/sdk-utils": "^1.0.0", | ||
"superagent": "^7.1.1" | ||
@@ -21,0 +21,0 @@ }, |
@@ -13,3 +13,3 @@ <img alt="FactSet" src="https://www.factset.com/hubfs/Assets/images/factset-logo.svg" height="56" width="290"> | ||
- API version: 3 | ||
- Package version: 0.9.1 | ||
- Package version: 0.20.0 | ||
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen | ||
@@ -81,2 +81,3 @@ | ||
data => { | ||
console.log('API called successfully. Returned data:'); | ||
@@ -83,0 +84,0 @@ console.log(data); |
144980
3480
176
+ Added@factset/sdk-utils@1.0.0(transitive)
- Removed@factset/sdk-utils@0.10.0(transitive)
Updated@factset/sdk-utils@^1.0.0