Convenience type to reflect the type of the instances of a collection field. The actual type of the elements for complex type collections is ComplexTypeNamespace.
Type of of elements of the collection. This can either be an EDM type or complex type.
Union type to represent the parent of a field. This can either be an entity constructor or a complex type field.
Options to use while fetching destinations. Encompasses both DestinationCachingOptions and ResilienceOptions interfaces.
Credentials for the Destination service.
Allowed Edm types for OData v2.
Convenience type to support legacy EdmTypeField
with field type as generic parameter.
This will become obsolete in the next major version update.
Allowed Edm types for OData v4.
Convenient type to reflect all the values of a string based enum as a union type.
String based enum type
Represents all expandables, i.e. everything that can be used in an .expand
statement. Only relevant for OData v4 requests.
Type of the entity to be selected on
Union type to represent all possible types of a field.
Convenience type that maps the given EDM type to a FieldType. It also considers whether the field is nullable.
EDM type of the field. Deprecated: Field type of the field.
Boolean type that represents whether the field is nullable.
Type of a parameter of a filter function. This can either be a primitive type, a reference to a field or another filter function.
Primitive type of a parameter of a filter function.
hidden
A union of all types that can be used for filtering.
Type of the entity to be filtered on
Internal representation of all parameters of a function import as a map
External representation of all parameters
Convenience type to determine whether a field should be orderable. If the given EdmT
is of type OrderableEdmTypes
, it is orderable.
EDM type of the field.
Convenience type to determine whether a field should be selectable. If the given FieldOfT
is the type of an entity, it is selectable.
Type of the entity or complex type field this field belongs to.
HTTP Methods supported by the http-client.
A union of all types that can be used for ordering.
Type of the entity to be ordered
EDM types that can be compared with greaterThan
, greaterOrEqual
, lessThan
and lessOrEqual
.
A union of all types that can be used as input for ordering.
Type of the entity to be ordered
Unspecific representation of a service's credentials as read from VCAP_SERVICES (for Cloud Foundry) or mounted secrets (for K8S).
Credentials for the XSUAA service.
Selector of destination selection strategies. See alwaysProvider, alwaysSubscriber and subscriberFirst for more information available selection strategies.
A list of request config keys that are not allowed to be customized by default.
Entity deserializer instance for v2 entities. See EntityDeserializer for the provided methods.
Entity deserializer instance for v4 entities. See EntityDeserializer for the provided methods.
Entity serializer instance for v2 entities. See EntitySerializer for the provided methods.
Entity serializer instance for v4 entities. See EntitySerializer for the provided methods.
OData v2 specific filter functions
OData v4 specific filter functions
Mapping between key name in the Tenant and key name in decoded JWT.
Mapping between key name in the User and key name in decoded JWT and the
Instance of the ODataUri conversion interface for OData v2.
Instance of the ODataUri conversion interface for OData v4.
an ODataRequest.
The headers that should be added to.
The provided headers with the new authorization headers.
Builds a DestinationHttpRequestConfig for the given destination and then merges it into the given request configuration. Setting of the given request configuration take precedence over any destination related configuration.
A destination or a destination name and a JWT.
Any object representing an HTTP request.
The given request config merged with the config built for the given destination.
Given a destination and a JWT (required for subscriber destinations), this function will add a proxy configuration to a destination. See also ProxyConfiguration.
This function will reject if no connectivity service is bound, no XSUAA service with plan application is bound or the client credentials grant with the XSUAA service fails.
The destination to which the proxy configuration should be added.
The JWT of the current user.
A promise resolving to the destination with the added proxy configuration.
Adds the proxy configuration to a destination based on web proxies defined in environment variables. See ProxyConfiguration and proxyStrategy for details.
to which the proxy configuration is added.
Destination containing the configuration for web proxy.
Will return the entity if all elements of the one-to-many link relation fulfill the condition.
A filter condition like MyEntity.someMultiLink.someProperty.eq('value')
The lambda filter function to be considered in the query
Constraints the selection to provider destinations.
Retrieved destinations.
Name of the destination to retrieve.
the destination to retrieve, returns null
, if no matched provider destination is found.
Constraints the selection to subscriber destinations.
Retrieved destinations.
Name of the destination to retrieve.
the destination to retrieve, returns null
, if no matched subscriber destination is found.
Combine Filterables with logical and
to create a FilterList.
Example:
Entity.requestBuilder()
.getAll()
.filter(and(filterExp1, filterExp2));
Note that the GetAllRequestBuilderV2.filter and GetAllRequestBuilderV4.filter method take a rest parameter and thereby an array of filter expressions that are then combined conjunctively. As a consequence following is equivalent to the example above:
Entity.requestBuilder()
.getAll()
.filter(filterExp1, filterExp2);
Type of the entity filter on.
Filterables to be combined with logical and
.
The newly created FilterList.
Will return the entity if at least one element of the one-to-many link relation fulfills the condition.
A filter condition like MyEntity.someMultiLink.someProperty.eq('value')
The lambda filter function to be considered in the query
Create new Order by orderBy._fieldName
in ascending order.
Type of the entity to be ordered
Field or link to be ordered by
New order
Retrieve the audiences of a decoded JWT based on the audiences and scopes in the token.
Token to retrieve the audiences from.
A set of audiences.
A destination.
The provided headers with the new authorization headers.
The headers that should be added to.
The provided headers with the new authorization headers.
A destination or a destination name and a JWT.
Any object representing an HTTP request.
Get CSRF token and cookies for a destination and request configuration. The CSRF token and cookies will be retrieved based on the URL of the destination and the custom configuration given by the requestConfig
.
If there is a relative url in the requestConfig
it will be appended to the destination's URL, an absolute URL overwrites the destination related URL.
The destination to get the headers from
An http request configuration containing additional information about the request, like URL or headers
A promise to an object containing the CSRF related headers
Builds a DestinationHttpRequestConfig for the given destination. If a destination name (and a JWT) are provided, it will try to resolve the destination.
A destination or a destination name and a JWT.
Custom default headers for the resulting HTTP request.
Build a filter function to ceil a number. Evaluates to double or decimal, defaults to double.
The number to ceil. This can either be a number, a reference to a field or another filter function.
The return type to use.
The newly created filter function
Checks if a given key is present in the decoded JWT. If not, an error is thrown.
The key of the representation in typescript
The mapping between the typescript keys and the JWT key
JWT payload to check fo the given key.
The URL of the token service or the credentials of a XSUAA service instance.
Client credentials for which to request a token.
Options to use by retrieving access token.
Object containing value required for the body request.
A promise resolving to the response.
Build a filter function to concatenate two strings. Evaluates to string.
The first string to concatenate. This can either be a string, a reference to a field or another filter function.
The second string to concatenate. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Build a filter function to test whether a string is a substring of the other. Evaluates to boolean.
The substring to test for. This can either be a string, a reference to a field or another filter function.
The string to test. This can either be a string, a reference to a field or another filter function.
The newly created filter function
A raw json object to deserialize a complex type from.
A list of rules on how to convert json to the respective type in JavaScript or TypeScript.
A deserialized complex type representation.
Creates a getFilter function using the OData v2 or OData v4 URI converter. The concrete filter getters are initiated in odata/v2/uri-conversion/odata-uri.ts and odata/v4/uri-conversion/odata-uri.ts.
Uri converter for v2 or v4.
The filter getter. See interface GetFilter
Creates a getResourcePathForKeys function using the OData v2 or OData v4 URI converter. The concrete instances for v2 or v4 are initiated in odata/v2/uri-conversion/odata-uri.ts and odata/v4/uri-conversion/odata-uri.ts.
Uri converter for v2 or v4.
The filter getter. See GetFilter
Extracts the custom attributes from the JWT.
Token payload to read the custom attributes from.
Custom attributes added by the XSUAA service to the issued JWT.
Build a filter function to get the day of a date. Evaluates to int.
The date to get the day for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Decode JWT.
JWT to be decoded
Decoded payload.
Decode JWT and return the complete decoded token.
JWT to be decoded.
Decoded token containing payload, header and signature.
Create new Order by orderBy._fieldName
in descending order.
Type of the entity to be ordered
Field or link to be ordered by
New order
Deserialize the parsed batch response.
Two dimensional list of parsed batch sub responses.
A map that holds the entity type to constructor mapping.
Response data access module.
Entity deserializer.
An array of parsed sub responses of the batch response.
Tries to build a destination from a service binding with the given name. Throws an error if no services are bound at all, no service with the given name can be found, or the service type is not supported. The last error can be circumvent by using the second parameter to provide a custom function that transforms a service binding to a destination.
The name of the service.
Options to customize the behavior of this function.
A destination.
Detects the system dependent line break in a string.
The string to check for line breaks. Should have at least two lines, otherwise an error will be thrown.
The system dependent line break
Build a filter function to test whether a string ends with another. Evaluates to boolean.
The string to test. This can either be a string, a reference to a field or another filter function.
The suffix to test for. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Constructs an entityDeserializer given the OData v2 or v4 specific methods. The concrete deserializers are created in odata/v2/entity-deserializer.ts and odata/v4/entity-deserializer.ts
Converters emd input to ts values.
Extractor for the ETag.
Extractor for data related to one to many links.
a entity deserializer as defined by EntityDeserializer
Takes as parameter a function that expects an HttpRequest and returns a Promise of HttpResponse. Returns a function that takes a destination and a request-config (extends HttpRequestConfig), builds an HttpRequest from them, and calls the provided execute function.
NOTE: If you simply want to execute a request without passing your own execute function, use executeHttpRequest instead.
A function that can execute an HttpRequestConfig.
A function expecting destination and a request.
Takes as parameter a function that expects an HttpRequest and returns a Promise of HttpResponse. Returns a function that takes a destination and a request-config (extends HttpRequestConfig), builds an HttpRequest from them, and calls the provided execute function.
NOTE: If you simply want to execute a request without passing your own execute function, use executeHttpRequest instead.
A function expecting destination and a request.
Builds a DestinationHttpRequestConfig for the given destination, merges it into the given requestConfig and executes it (using Axios).
A destination or a destination name and a JWT.
Any object representing an HTTP request.
An HttpRequestOptions of the http request for configuring e.g., csrf token delegation. By default, the SDK will not fetch the csrf token.
A promise resolving to an HttpResponse.
Extracts the credentials of a service into an instance of ClientCredentials.
The credentials of a service as read from VCAP_SERVICES.
A ClientCredentials instance.
Extracts all custom fields from the JSON payload for a single entity. In this context, a custom fields is every property that is not known in the corresponding entity class.
The JSON payload.
The constructor function of the entity class.
An object containing the custom fields as key-value pairs.
Extractor for the ETag for OData v2 responses used in entityDeserializer.
Response data from which the ETag is extracted.
The ETag.
Extractor for the ETag for OData v4 responses used in entityDeserializer.
Response data from which the ETag is extracted.
The ETag.
Fetches a specific destination by name from the given URI, including authorization tokens. For destinations with authenticationType OAuth2SAMLBearerAssertion, this call will trigger the OAuth2SAMLBearerFlow against the target destination. In this pass the access token as string. Fetches a specific destination with authenticationType OAuth2UserTokenExchange by name from the given URI, including authorization tokens.
The URI of the destination service
The access token or AuthAndExchangeTokens if you want to include the X-user-token for OAuth2UserTokenExchange.
The name of the desired destination
Options to use by retrieving destinations
A Promise resolving to the destination
Fetches all instance destinations from the given URI.
The URI of the destination service
The access token
Options to use by retrieving destinations
A promise resolving to a list of instance destinations
Fetches all subaccount destinations from the given URI.
The URI of the destination service
The access token
Options to use by retrieving destinations
A promise resolving to a list of subaccount destinations
Deprecated since v1.49.0. Use fetchVerificationKeys(url: string)
instead. Credentials are ignored.
Fetches verification keys from the XSUAA service for the given credentials.
Credentials of the XSUAA service instance.
Value of the jku property in the JWT header. If not provided the old legacy URL xsuaaCredentials.url/token_keys is used as a fallback which will not work for subscriber accounts created after 14th of April 2020.
An array of TokenKeys.
Deprecated since v1.49.0. Use fetchVerificationKeys(url: string)
instead. Credentials are ignored.
Fetches verification keys from the XSUAA service for the given URL, with the given pair of credentials.
URL of the XSUAA service instance.
Client ID of the XSUAA service instance.
Client secret of the XSUAA service instance.
An array of token keys.
Fetches verification keys from the XSUAA service for the given URL.
URL of the XSUAA service instance.
An array of token keys.
Filter disallowed keys from a given custom request config object.
a given custom request config object to be filtered
A list of keys that are not allowed to be customized.
Filtered custom request config object.
A header object to be filtered.
Build a filter function to floor a number. Evaluates to double or decimal, defaults to double.
The number to floor. This can either be a number, a reference to a field or another filter function.
The return type to use.
The newly created filter function
Build a filter function to get the fractional seconds of a date. Evaluates to decimal.
The date to get the fractional seconds for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Returns the http or https-agent config depending on the destination URL. If the destination contains a proxy configuration, the agent will be a proxy-agent. If not it will be the default http-agent coming from node.
determining which kind of configuration is returned
The http or http-agent configuration.
Builds an Axios config with default configuration i.e. no_proxy, default http and https agent and GET as request method.
AxiosRequestConfig with default parameters
Extract the collection data from the response. If the data does not contain a collection an empty array is returned.
Response of the OData v4 service.
Collection extracted from the response.
Builds a destination from one of three sources (in the given order):
If you want to get a destination only from a specific source, use the corresponding function directly
(getDestinationFromEnvByName
, destinationForServiceBinding
, getDestinationFromDestinationService
).
The name of the destination to be retrieved.
Configuration for how to retrieve destinations from the destination service.
A promise returning the requested destination on success.
Basic Credentials Getter from Destination service credentials needed for JWT generator.
Basic credentials.
Name of the destination
The requested destination if existent, otherwise null
Retrieves a destination with the given name from the Cloud Foundry destination service.
Returns null
, if no destination can be found.
Requires the following service bindings: destination, XSUAA
By default, selects subscriber over provider and instance over subaccount destinations.
If the destinations are read from the environment, the jwt will be ignored.
The name of the destination to be retrieved.
Configuration for how to retrieve destinations from the destination service.
A promise returning the requested destination on success.
Get a destination from the environment variables by name. If there are multiple destinations with the same name the first one will be used. This is discouraged for productive use! Use destination-accessor/useOrFetchDestination for fetching destinations from the Cloud Foundry destination service.
Name of the destination
The requested destination if existent, otherwise null
The name of the destination to be retrieved.
The options of the fetching query of the destination that include the JWT of the current request and the strategy for selecting a destination.
A promise returning the requested destination on success.
Get destination service if one is present.
Destination service
First 'destination' credentials getter.
The 'destination' credentials object or null
, if it does not exist.
Destination credentials getter.
A list of 'credentials' objects in 'destination' service.
Destination URI getter NOTICE: If there exist more than one destination/uri, the function returns the first entry.
The first existing uri in destination or null
, if not found.
A list of destinations
Get all destinations from the environment variable "destinations". This is discouraged for productive use! Use useOrFetchDestination for fetching destinations from the Cloud Foundry destination service.
A list of destinations
Convenience method to get the EdmTypeShared from the overloaded constructor. The two scenarios are:
complexTypeNameOrEdmType
is of type EdmTypeShared
and edmTypeOrUndefined
is undefined
complexTypeNameOrEdmType
is of type string
and edmTypeOrUndefined
is of type EdmTypeShared
Either the name of the complex type or the EDM type.
Either the EDM type or undefined
.
The EDM type resolved for the two arguments.
Convenience method to get the entity constructor of the parent of a complex type.
Either an entity constructor or another complex type field.
The constructor of the transitive parent entity;
Helper function that maps an entity to its keys map with their original names.
Entity to map
The constructor of the entity
object that includes all keys that represent given entity
Environment variables accessor.
Environment variable name.
Env variable value if defined. null: If not defined.
Get an object containing the given expand as a query parameter, or an empty object if none was given. In this OData v2 expand, selected properties are automatically added to the expand.
Type of the entity to expand on
The selects which are expanded if necessary
An object containing the query parameter or an empty object
Get an object containing the given expand as a query parameter, or an empty object if none was given.
Type of the entity to expand on
The expands to transform to a query parameter
Constructor type of the entity to expand on
An object containing the query parameter or an empty object
Get field options merged with default values. The given options take precedence.
Given options.
Given options merged with default values.
Name of the header to be found.
Header object to be searched for given key.
headers
or an empty object if not found.Name of the header to be found.
Header object to be searched for given key.
The value of the header with the given key or undefined
.
Name of the header to be found.
Header object to be searched for given key.
headers
or an empty object if not found.The serialized request as <HTTP method> <URL> <HTTP version>
.
Extract the collection data from the one to many link response. If the data does not contain a collection an empty array is returned.
Response of the one to many link.
Collection extracted from the response.
A destination having OAuth2ClientCredentials
authentication type
A promise returning the requested access token on success.
Get an object containing the given order bys as query parameter, or an empty object if none was given.
Type of the entity to order
A list of orderables to get the query parameters for
An object containing the query parameter or an empty object
Extracts the http protocol from the destination URL. The default value is http if no protocol is given.
URL of this destination is parsed
The protocol, either https or http.
Type of the entity to filter on
The filter to transform to a query parameter
Constructor type of the entity to filter on
An object containing the query parameter or an empty object
Type of the entity to get the selection for
The list of selectables to be transformed to query parameters
An object containing the query parameters or an empty object
Type of the entity to get the resource path for
Key-value pairs where the key is the name of a key property of the given entity and the value is the respective value
Constructor type of the entity to get the resource path for
The path to the resource
Get the response body from the string representation of a response.
String representation of a response.
The response body as a one line string.
Get an object containing the given Selectables as query parameter, or an empty object if none were given.
This retrieves where in addition to the selection (select
) there is also an expansion (expand
) needed.
Type of the entity to get the selection for
The list of selectables to be transformed to query parameters
An object containing the query parameters or an empty object
Get an object containing the given Selectables as query parameter, or an empty object if none were given. In OData v4 selected properties are not automatically expanded anymore and a manual expand needs to be performed.
Type of the entity to get the selection for
The list of selectables to be transformed to query parameters
An object containing the query parameters or an empty object
Returns the first found instance for the given service type.
The service type.
The first found service.
Credentials list getter for a given service.
Service name
Fetched credentials objects of existing service in 'VCAP_SERVICES'.
Services getter for a given service.
Service name.
List of service bindings of the given type. Returns an empty array if no service binding exists for the given type.
Extract the single entry data from the response. If the data does not contain a single object an empty object is returned.
Response of the OData v4 service.
A single object extracted from the response.
URL of this destination is parsed
The protocol either undefined
if no ://
is found or anything before the delimiter.
'VCAP_SERVICES' Getter from environment variables.
This function returns the VCAP_SERVICES as object or null
, if it is not defined (i.e. no services are bound to the application).
'VCAP_SERVICES' found in environment variables or null
, if not defined. The key denotes the name ov the service and the value is the definition.
Takes a decoded JWT and uses the client_id and audience claims to determine the XSUAA service instance that issued the JWT. Returns the credentials if a match is found, otherwise throws an error. If no decoded JWT is specified, then returns the first existing XSUAA credential service plan "application".
Either an encoded or decoded JWT.
The credentials for a match, otherwise null
.
Build a filter function to test whether a set is a subsequence of the other, i. e. whether the second parameter can be transformed into the first by removing items. Evaluates to boolean.
The subsequence to test for. This can either be an array, a reference to a field or another filter function.
The sequence to test. This can either be an array, a reference to a field or another filter function.
The newly created filter function
Build a filter function to test whether a set is a subset of the other, i. e. whether the second parameter can be transformed into the first by reordering and / or removing items. Evaluates to boolean.
The subset to test for. This can either be an array, a reference to a field or another filter function.
The set to test. This can either be an array, a reference to a field or another filter function.
The newly created filter function
Build a filter function to get the hour of a date. Evaluates to int.
The date to get the hour for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Build a filter function to get the start index of a substring. Evaluates to int.
The string to get the index from. This can either be a string, a reference to a field or another filter function.
The substring to get the index for. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Checks if the data contains a collection result.
Response of the OData v4 service
true
, if the data is a collection result
Check whether a value is an EdmType. This will yield positive results for every string starting with Edm.
.
Value to test.
Whether the given value is of type EdmTypeShared
hidden
Compare two decoded JWTs based on their tenantId
s.
User JWT payload.
Provider JWT payload.
Whether the tenant is identical.
Checks if the property with name key of the entity is a navigation property.
Name of the property.
Constructor of the entity.
A boolean denoting whether an entity is a navigation property or not.
Build a filter function to test whether a selection is of a given type. Evaluates to boolean.
The type to test for, e. g. API_BUSINESS_PARTNER.A_BusinessPartner
.
The newly created filter function
Build a filter function to test whether a field is of a given type. Evaluates to boolean.
A reference to a field to test for type.
The type to test for, e. g. API_BUSINESS_PARTNER.A_BusinessPartner
.
The newly created filter function
Convenience function to check whether a given EDM type is of type OrderableEdmType.
Literal EDM type string to check.
Whether the given edmType
is of type OrderableEdmType.
Get the issuer URL of a decoded JWT.
Token to read the issuer URL from.
The issuer URL if available.
Returns a jwt bearer token that can be used to call the given service. The token is fetched via a JWT bearer token grant using the user token + client credentials.
Throws an error if there is no instance of the given service type or the XSUAA service, or if the request to the XSUAA service fails.
The JWT of the user for whom the access token should be fetched
The type of the service or an instance of Service.
Options to influence resilience behavior (see ResilienceOptions). By default, usage of a circuit breaker is enabled.
A jwt bearer token.
The URL of the token service or the credentials of a XSUAA service instance.
The credentials (client_id, client_secret) of the target XSUAA service instance.
The JWT of the user on whose behalf the request is executed.
Options to use by retrieving access token.
A promise resolving to the response of the XSUAA service.
Build a filter function to get the length of a string. Evaluates to int.
The string to compute the length for. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Build a filter function to test whether a string matches a pattern. Evaluates to boolean.
The string to get the index from. This can either be a string, a reference to a field or another filter function.
The pattern to test against. This should be a regular expression as a string.
The newly created filter function
Build a filter function to get the latest possible point in time. Evaluates to DateTimeOffset.
The newly created filter function
A base header object that contains the headers that will be compared with customHeaders
.
A header object to be compared with headers. Only headers present in headers
will be compared.
customHeaders
are replaced. Note that the case (upper / lower) used by customHeaders
will be used.Build a filter function to get the earliest possible point in time. Evaluates to DateTimeOffset.
The newly created filter function
Build a filter function to get the minute of a date. Evaluates to int.
The date to get the minute for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Build a filter function to get the month of a date. Evaluates to int.
The date to get the month for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Negate a filter.
The filter to negate.
The negated filter.
Build a filter function to get the current point in time. Evaluates to DateTimeOffset.
The newly created filter function
Combine Filterables with logical or
to create a FilterList.
Example:
Entity.requestBuilder()
.getAll()
.filter(or(filterExp1, filterExp2));
Type of the entity filter on.
Filterables to be combined with logical or
The newly created FilterList
Parse the complete batch HTTP response.
HTTP response of a batch request.
An array of parsed sub responses of the batch response.
Takes a JSON object returned by any of the calls to the destination service and returns an SDK compatible destination object. This function only accepts destination configurations of type 'HTTP' and will error if no 'URL' is given.
A JSON object returned by the destination service.
An SDK compatible destination object.
Parse the entity name from the metadata uri. This should be the __metadata
property of a single entity in the response.
The URI to parse the entity name from
The entity name.
Parse the HTTP code of response.
String representation of the response.
The HTTP code.
Parses the environment variable for the web proxy and extracts the values considering defaults like http for the protocol and 80 or 443 for the port.
The general pattern to be parsed is protocol://user:password@host:port
, where everything besides the host is optional.
Special characters in the user and password need to be percent encoded.
Environment variable which is parsed.
Configuration with default values or undefined
if the parsing failed.
Parse the body and http code of a batch sub response.
A batch sub response.
The parsed response.s
Builds the http(s)-agent config. Note that the proxy agent type like http or https is determined by the destination RUL protocol. The protocol from the proxy is unrelated to this and in most cases http. All additional options are forwarded to tls.connect and net.connect see https://github.com/TooTallNate/node-https-proxy-agent#new-httpsproxyagentobject-options
Destination containing the proxy configurations
Additional options for the agent
The http(s)-agent containing the proxy configuration
Determines the proxy strategy. If noProxy is set the ProxyConfiguration in the destination is omitted. For onPremProxy or internetProxy the connectivity service or environment variables are checked to fill the ProxyConfiguration.
from which the proxy strategy is derived.
ProxyStrategy possible values are noProxy, internetProxy or onPremProxy.
The URL of the token service or the credentials of a XSUAA service instance.
The credentials (client_id, client_secret) of the target XSUAA service instance.
The refresh token that should be used to generate a new access token.
Options to use by retrieving access token.
A promise resolving to the response of the XSUAA service.
A base header object that contains the headers that will be compared with customHeaders
.
A header object to be compared with headers. Only headers present in headers
will be compared.
headers
object, where headers present in the customHeaders
are replaced. Note that the case (upper / lower) used by customHeaders
will be used.Takes a string that represents the service type and resolves it by calling getService. If the parameter is already an instance of Service, it is returned directly.
Throws an error when no service can be found for the given type.
A Service instance.
Retrieve JWT from a request that is based on the node IncomingMessage
. Fails if no authorization header is given or has the wrong format. Expected format is 'Bearer
Request to retrieve the JWT from
JWT found in header
Build a filter function to round a number. Evaluates to double or decimal, defaults to double.
The number to round. This can either be a number, a reference to a field or another filter function.
The return type to use.
The newly created filter function
Takes an existing or a parsed destination and returns an SDK compatible destination object.
An object that adheres to the Destination interface.
An SDK compatible destination object.
Build a filter function to get the second of a date. Evaluates to int.
The date to get the second for. This can either be a date (moment.Moment) or a reference to a field.
The newly created filter function
Serialize a batch request to string. This is used for the batch request payload when executing the request.
Batch request to serialize.
Request serialization options.
String representation of the batch request.
Serialize change set to string.
Change set containing a collection of write operations.
Request serialization options.
The serialized string representation of a change set.
Serialize a multipart request to string.
Request serialization options.
The serialized string representation of a multipart request, including the multipart headers.
Returns an access token that can be used to call the given service. The token is fetched via a client credentials grant with the credentials of the given service. If multiple instances of the provided service exist, the first instance will be selected. When a JWT is passed, the tenant of the JWT will be used when performing the grant. When no JWT is passed, the grant will be performed using the provider tenant.
Throws an error if there is no instance of the given service type or the XSUAA service, or if the request to the XSUAA service fails.
The type of the service or an instance of Service.
Options to influence caching and resilience behavior (see CachingOptions and ResilienceOptions, respectively) and a JWT. By default, caching and usage of a circuit breaker are enabled.
Access token.
Split a batch response into an array of sub responses for the retrieve requests and changesets.
The raw HTTP response.
A list of sub responses represented as strings.
Split a changeset (sub) response into an array of sub responses.
The string representation of a change set response.
A list of sub responses represented as strings.
Split a string representation of a response into sub responses given its boundary.
The string representation of the response to split.
The boundary to split by.
A list of sub responses represented as strings.
Build a filter function to test whether a string starts with another. Evaluates to boolean.
The string to test. This can either be a string, a reference to a field or another filter function.
The prefix to test for. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Prioritizes the selection of subscriber destinations.
Retrieved destinations.
Name of the destination to retrieve.
the destination to retrieve, returns null
if no matched destination is found.
Build a filter function to get a substring starting from a designated position. Evaluates to string.
The string to get a substring from. This can either be a string, a reference to a field or another filter function.
The starting position of the substring. This can be either a number, a reference to a field or another filter function.
The length of the substring. This can be either a number, a reference to a field or another filter function.
The newly created filter function
Build a filter function to test whether a string is a substring of the other. Evaluates to boolean.
The substring to test for. This can either be a string, a reference to a field or another filter function.
The string to test. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Creates a tenant object from the JWT payload.
Throws an error if the property id
is not present in the payload.
Token payload to get the tenant information from.
Representation of the tenant.
Converts the given time to seconds in positive numerical format.
Time to convert.
number Time in seconds.
Change set containing a collection of write operations.
The serialized string representation of a change set.
Change set containing a collection of write operations.
The serialized string representation of a change set.
The request builder of the retrieve request.
The request body.
The request builder of the retrieve request.
The request body.
Build a filter function to transform a string to lower case. Evaluates to string.
The string to transform. This can either be a string, a reference to a field or another filter function.
The newly created filter function
The string to be transformed.
The transformed string.
The string to be transformed.
The transformed string.
Name of the header.
Value of the header.
The string to be transformed.
The transformed string.
The string to be transformed.
The transformed string.
The string to be transformed.
The transformed string.
Build a filter function to transform a string to upper case. Evaluates to string.
The string to transform. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Build a filter function to get the signed number of minutes in the time zone offset. Evaluates to int.
The date to get the offset minutes for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Build a filter function to trim whitespace from a string. Evaluates to string.
The string to trim whitespace from. This can either be a string, a reference to a field or another filter function.
The newly created filter function
Builds part of the request config containing the URL and if needed proxy agents or normal http agents.
Considers the no_proxy
environment variable together with the targetUri
.
Used as baseURL in request config.
HttpRequestConfig containing baseUrl and http(s) agents.
Returns the parameter if it is a destination, calls getDestination otherwise (which will try to fetch the destination from the Cloud Foundry destination service).
Fetching a destination requires:
If either of the prerequisites is not met or one of the services returns an error, this function will either throw an error or return a promise that rejects.
A destination or the necessary parameters to fetch one.
Caching options by fetching destination.
A promise resolving to the requested destination on success.
The JWT of the user for whom the access token should be fetched.
The type of the service or an instance of Service.
Options to influence resilience behavior (see ResilienceOptions). By default, usage of a circuit breaker is enabled.
A user approved access token.
Creates a user object from the decoded JWT.
Throws an error if no id
or userName
property is present on the JWT payload.
Token payload to get the user from.
Representation of the user.
The URL of the token service or the credentials of a XSUAA service instance.
The JWT of the user on whose behalf the request is executed.
The client_id of the target XSUAA service instance.
Options to use by retrieving access token
A promise resolving to the response of the XSUAA service.
Verifies the given JWT and returns the decoded payload.
JWT to be verified
Options to control certain aspects of JWT verification behavior.
A Promise to the decoded and verified JWT.
Verifies the given JWT with the given key and returns the decoded payload.
JWT to be verified.
Key to use for verification.
A Promise to the decoded and verified JWT.
Wraps the access token in header's authorization.
Token to attach in request header
The request header that holds the access token
Build a filter function to get the year of a date. Evaluates to int.
The date to get the year for. This can either be a date (Moment) or a reference to a field.
The newly created filter function
Copyright â’¸ 2023 SAP SE or an SAP affiliate company. All rights reserved.
Version 2 Release
The SAP Cloud SDK has released version 2. Check the upgrade guide for more details. Make sure you understand our release policy.
@sap-cloud-sdk/core
This package contains the core functionality of the SAP Cloud SDK as well as the SAP Business Technology Platform abstractions.
Installation
Usage
The core is the heart of the SAP Cloud SDK and contains the functionality that is essential to every project powered by the SDK. Any OData client built by the SAP Cloud SDK, be it the VDM or clients built by the generator are using the core. We recommend to install this in addition to your clients.
Below is an example showing how you can build and execute your request with multiple filters by using an function called
and
.For more detailed overview visit our OData client documentation.
Support
The recommended way to get in touch with us is to create an issue in our github repository. Select the issue category
Bug
,Feature
orQuestion
depending on the nature of your request. We try to provide fixes, features and answers as soon as possible.Contribute
If you would like to contribute to the SAP Cloud SDK, please make yourself familiar with our contributing guidelines and follow the given instructions.
Links
License
The SAP Cloud SDK is released under the Apache License Version 2.0.