para-client-js 1.40.3 → 1.40.4
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/dist/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import lodash from "lodash";
|
|
2
1
|
import assert from "assert";
|
|
3
2
|
import apiClient from "superagent";
|
|
4
3
|
import aws4 from "aws4";
|
|
@@ -459,7 +458,6 @@ const DEFAULT_ENDPOINT = "https://paraio.com";
|
|
|
459
458
|
const DEFAULT_PATH = "/v1/";
|
|
460
459
|
const JWT_PATH = "/jwt_auth";
|
|
461
460
|
const SEPARATOR = ":";
|
|
462
|
-
const { isEmpty, endsWith, startsWith, noop, isArray, isUndefined, isString, isFunction, merge, isInteger, isBoolean } = lodash;
|
|
463
461
|
const { sign } = aws4;
|
|
464
462
|
/**
|
|
465
463
|
* JavaScript client for communicating with a Para API server.
|
|
@@ -1409,7 +1407,7 @@ var ParaClient = class {
|
|
|
1409
1407
|
fn(null);
|
|
1410
1408
|
return resolve(null);
|
|
1411
1409
|
}
|
|
1412
|
-
var url = obj.getObjectURI() + "/links
|
|
1410
|
+
var url = obj.getObjectURI() + "/links";
|
|
1413
1411
|
return this.getEntity(this.invokeDelete(url), fn);
|
|
1414
1412
|
}
|
|
1415
1413
|
/**
|
|
@@ -1716,7 +1714,7 @@ var ParaClient = class {
|
|
|
1716
1714
|
* @returns {Promise} a map containing all validation constraints.
|
|
1717
1715
|
*/
|
|
1718
1716
|
async validationConstraints(type, fn) {
|
|
1719
|
-
return this.getEntity(this.invokeGet("_constraints/" + urlEncode(type
|
|
1717
|
+
return this.getEntity(this.invokeGet("_constraints" + (type ? "/" + urlEncode(type) : "")), fn);
|
|
1720
1718
|
}
|
|
1721
1719
|
/**
|
|
1722
1720
|
* Add a new constraint for a given field.
|
|
@@ -2004,6 +2002,60 @@ var ParaClient = class {
|
|
|
2004
2002
|
});
|
|
2005
2003
|
}
|
|
2006
2004
|
};
|
|
2005
|
+
function isUndefined(value) {
|
|
2006
|
+
return value === void 0;
|
|
2007
|
+
}
|
|
2008
|
+
function isArray(value) {
|
|
2009
|
+
return Array.isArray(value);
|
|
2010
|
+
}
|
|
2011
|
+
function isString(value) {
|
|
2012
|
+
return typeof value === "string" || value instanceof String;
|
|
2013
|
+
}
|
|
2014
|
+
function isFunction(value) {
|
|
2015
|
+
return typeof value === "function";
|
|
2016
|
+
}
|
|
2017
|
+
function isBoolean(value) {
|
|
2018
|
+
return typeof value === "boolean" || value instanceof Boolean;
|
|
2019
|
+
}
|
|
2020
|
+
function isInteger(value) {
|
|
2021
|
+
return typeof value == "number";
|
|
2022
|
+
}
|
|
2023
|
+
function startsWith(value, prefix) {
|
|
2024
|
+
if (value == null) return false;
|
|
2025
|
+
return String(value).startsWith(prefix);
|
|
2026
|
+
}
|
|
2027
|
+
function endsWith(value, suffix) {
|
|
2028
|
+
if (value == null) return false;
|
|
2029
|
+
return String(value).endsWith(suffix);
|
|
2030
|
+
}
|
|
2031
|
+
function isEmpty(value) {
|
|
2032
|
+
if (value == null) return true;
|
|
2033
|
+
if (isArray(value) || isString(value)) return value.length === 0;
|
|
2034
|
+
if (value instanceof Map || value instanceof Set) return value.size === 0;
|
|
2035
|
+
if (typeof value === "object") {
|
|
2036
|
+
for (var key in value) if (Object.prototype.hasOwnProperty.call(value, key)) return false;
|
|
2037
|
+
}
|
|
2038
|
+
return true;
|
|
2039
|
+
}
|
|
2040
|
+
function noop() {}
|
|
2041
|
+
function merge(target) {
|
|
2042
|
+
var output = target;
|
|
2043
|
+
if (output == null || typeof output !== "object") output = {};
|
|
2044
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2045
|
+
var source = arguments[i];
|
|
2046
|
+
if (source == null) continue;
|
|
2047
|
+
for (var key in source) {
|
|
2048
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
|
|
2049
|
+
var sourceValue = source[key];
|
|
2050
|
+
var targetValue = output[key];
|
|
2051
|
+
if (sourceValue && typeof sourceValue === "object" && !isArray(sourceValue) && !(sourceValue instanceof Date)) {
|
|
2052
|
+
if (!targetValue || typeof targetValue !== "object" || isArray(targetValue)) targetValue = {};
|
|
2053
|
+
output[key] = merge(targetValue, sourceValue);
|
|
2054
|
+
} else output[key] = sourceValue;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
return output;
|
|
2058
|
+
}
|
|
2007
2059
|
function urlEncode(path) {
|
|
2008
2060
|
return encodeURIComponent(path).replace(/[!'()*]/g, function(c) {
|
|
2009
2061
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|