Methods
and(…colFilters) → {string}
Concatenates filter expressions - can nest any, eq, between, gte, lte expressions
eg: and( eq("FirstName","David"), any("City","Vancouver","Edmonton") )
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
colFilters |
string |
<repeatable> |
comma delimited list of strings containing column filters |
- Source:
Returns:
concatenated URL segment containing multiple column filters
- Type
- string
any(col, …values) → {string}
Multi-value equality filter - column value equals any of the parameter values
eg: any("CustomerId",1,2,3)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
col |
string | name of column to apply filter to |
|
values |
string | number |
<repeatable> |
comma delimited list of values to filter by (can be mixed strings/numbers) |
- Source:
Returns:
constructed URL segment for filtering the given column
- Type
- string
base64urlencode(plain) → {string}
Base64 encoding strategy.
Parameters:
| Name | Type | Description |
|---|---|---|
plain |
string | The message to encode. |
Returns:
- Type
- string
between(arg1, lb, ub) → {string}
Range filter - column value is between the parameter values (inclusive)
eg:
between("CustomerId",1,10) - returns range string with column name
between(4,8) - returns range string w/o column name
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
arg1 |
string | name of column to apply filter to, or lower bound |
|
lb |
string | number | null | null | lower bound value of the range, or upper bound |
ub |
string | number | null | null | upper bound value of the range |
- Source:
Returns:
constructed URL segment for filtering the given column, or range string
- Type
- string
chgPlaceHolder(placeHolder, value) → {any}
Change placeholder values for null and , in filter functions.
eg: chgPlaceHolder(null,'*nullValue*') - updates the null placeholder to *nullValue*
Calling without parameters will reset all placeholders to their default values.
A single placeholder parameter w/o a value will reset only that parameter to its default value.
Note that changing the null placeholder with this function will automatically set the nullStr
query string parameter for any BaseFilter, DataDiscoveryFilter and SQLPassThruFilter
objects created afte invoking the function.
It is not recommended to change the , separator unless you are encountering issues creating filters
with the default value |SDBSEP|
Parameters:
| Name | Type | Description |
|---|---|---|
placeHolder |
any | placeholder to update |
value |
string | new value for the placeholder |
- Source:
Returns:
updated placeholder value
- Type
- any
dec2hex(dec) → {string}
Shortcut function to convert from decimal to hexadecimal.
Parameters:
| Name | Type | Description |
|---|---|---|
dec |
string | The message to convert. |
Returns:
The hexadecimal.
- Type
- string
eq(col, value) → {string}
Single value equality filter - column value equals parameter value
eg: eq("CustomerId",1)
Parameters:
| Name | Type | Description |
|---|---|---|
col |
string | name of column to apply filter to |
value |
string | number | parameter containing the value to filter by |
- Source:
Returns:
constructed URL segment for filtering the given column
- Type
- string
(async) fetchWrapper(httpMethod, url, body, headers, onlyResopt) → {object|object}
fetch API wrapper for handling HTTP requests.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
httpMethod |
string | HTTP method to use for the |
||
url |
string | protocol, host:port and path to resource/endpoint |
||
body |
object | Payload to be sent; object containing key/value pairs. |
||
headers |
object | Header parameters to send in request; object containing key/value pairs. |
||
onlyRes |
boolean |
<optional> |
false | Flag to indicate whether to send back HTTP response status only or also send back data |
- Source:
Throws:
-
error message with HTTP status code if applicable on 4xx/5xx/network errors
- Type
- Error
Returns:
-
returnObj.data - response data.
- Type
- object
-
returnObj.res - response status.
- Type
- object
(async) generateCodeChallenge(codeVerifier)
Generate the code challenge
Parameters:
| Name | Type | Description |
|---|---|---|
codeVerifier |
string | conde verifier to generate challenge |
Returns:
Promise
generateCodeVerifier(size) → {string}
Get a random string
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
size |
string | 128 | (Optional) |
Returns:
- Type
- string
gte(arg1, lb) → {string}
Greater-than-equal filter - column value is greater than or equal to the parameter value
Wrapper for between()
eg:
gte("CustomerId",10) - returns range string with column name
gte(10) - returns range string w/o column
Parameters:
| Name | Type | Description |
|---|---|---|
arg1 |
string | name of column to apply filter to, or lower bound |
lb |
string | number | lower bound value of the filter when column name given |
- Source:
Returns:
constructed URL segment for filtering the given column, or bare range string
- Type
- string
(async) handleResponse(response) → {object}
Helper function to handle requests response.
Parameters:
| Name | Type | Description |
|---|---|---|
response |
* |
- Source:
Returns:
data
- Type
- object
lte(arg1, ub) → {string}
Less-than-equal filter - column value is less than or equal to the parameter value
Wrapper for between()
eg:
lte("CustomerId",10) - returns range string with column name
lte(10) - returns range string w/o column
Parameters:
| Name | Type | Description |
|---|---|---|
arg1 |
string | name of column to apply filter to, or upper bound |
ub |
string | number | upper bound value of the filter when column name given |
- Source:
Returns:
constructed URL segment for filtering the given column, or bare range string
- Type
- string
not(colFilter) → {string}
Negates a filter expression - can nest any, eq, and, between, gte, lte expressions
eg: not(eq("CustomerId",1))
Parameters:
| Name | Type | Description |
|---|---|---|
colFilter |
string | a string containing column filter (can contain concatenated filters) |
- Source:
Returns:
negated version of URL segment for filtering the given column(s)
- Type
- string
sha256(plain) → {ArrayBuffer}
Shortcut function to the hasher's object interface.
Parameters:
| Name | Type | Description |
|---|---|---|
plain |
string | The message to hash. |
Returns:
The hash.
- Type
- ArrayBuffer