@sap_oss/odata-library
Advanced tools
Comparing version 2.3.4 to 2.3.5
@@ -10,3 +10,3 @@ export = Service; | ||
* <ul> | ||
* <li>agent - instance of superagent which contains current authorization</li> | ||
* <li>agent - wrapped fetch API which contains current authorization</li> | ||
* <li>init - promise which is resolved when Metadata are loaded and processed</li> | ||
@@ -13,0 +13,0 @@ * <li>metadata - instance of the Metadata object, which contains metadata infromations and methods for finding out them</li> |
# Changelog | ||
# 2.3.5 | ||
- [FIX] Enable action's payload for collection parameter - Sreelal Soman | ||
- [FIX] Provide compatibility capabilities on v4 entity set model - Jakub Vaclavik | ||
# 2.3.4 | ||
@@ -4,0 +9,0 @@ |
@@ -198,4 +198,8 @@ "use strict"; | ||
const paramDefinition = this.getParameterDefinition(key); | ||
if (paramDefinition) { | ||
if (_.hasIn(paramDefinition, "type.formatBody")) { | ||
payloadObject[key] = paramDefinition.type.formatBody(value); | ||
} else if (_.hasIn(paramDefinition, "type.elementType.formatBody")) { | ||
payloadObject[key] = value.map((v) => | ||
paramDefinition.type.elementType.formatBody(v) | ||
); | ||
} | ||
@@ -202,0 +206,0 @@ }); |
@@ -70,3 +70,3 @@ "use strict"; | ||
count() { | ||
if (!this._resource.entitySetModel.sap.countable) { | ||
if (this._resource.entitySetModel.sap.countable === false) { | ||
throw new Error( | ||
@@ -73,0 +73,0 @@ `The EntitySet ${this._resource.entitySetModel.name} is not countable.` |
"use strict"; | ||
const _ = require("lodash"); | ||
function applyEntityTypeExtensions(entityType) { | ||
@@ -17,2 +19,11 @@ Object.defineProperty(entityType, "sap", { | ||
function isAllowed(entitySet, capability, enabledProperty) { | ||
let anno = entitySet.annotations.find( | ||
(a) => a.term === `SAP__capabilities.${capability}` | ||
); | ||
return ( | ||
!anno || _.get(anno, `record.value.${enabledProperty}.bool`) !== "false" | ||
); | ||
} | ||
/** | ||
@@ -43,2 +54,3 @@ * Envelope for vendor specific extensions. | ||
pageable: true, // by OData v4 definition | ||
searchable: isAllowed(es, "SearchRestrictions", "Searchable"), | ||
}), | ||
@@ -45,0 +57,0 @@ }) |
@@ -22,3 +22,3 @@ "use strict"; | ||
* <ul> | ||
* <li>agent - instance of superagent which contains current authorization</li> | ||
* <li>agent - wrapped fetch API which contains current authorization</li> | ||
* <li>init - promise which is resolved when Metadata are loaded and processed</li> | ||
@@ -25,0 +25,0 @@ * <li>metadata - instance of the Metadata object, which contains metadata infromations and methods for finding out them</li> |
{ | ||
"name": "@sap_oss/odata-library", | ||
"version": "2.3.4", | ||
"version": "2.3.5", | ||
"description": "OData client for testing Netweawer OData services.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3460438
937
15877