para-client-js 1.40.3 → 1.40.6
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/README.md +4 -4
- package/dist/browser/para-client-js.global.iife.js +8 -27
- package/dist/browser/para-client-js.global.iife.js.map +1 -1
- package/dist/index.cjs +58 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +56 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +31 -20
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.
|
|
4
|
-
//#region
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
5
|
var __create = Object.create;
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,8 +28,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
}) : target, mod));
|
|
29
29
|
|
|
30
30
|
//#endregion
|
|
31
|
-
let lodash = require("lodash");
|
|
32
|
-
lodash = __toESM(lodash);
|
|
33
31
|
let assert = require("assert");
|
|
34
32
|
assert = __toESM(assert);
|
|
35
33
|
let superagent = require("superagent");
|
|
@@ -493,7 +491,6 @@ const DEFAULT_ENDPOINT = "https://paraio.com";
|
|
|
493
491
|
const DEFAULT_PATH = "/v1/";
|
|
494
492
|
const JWT_PATH = "/jwt_auth";
|
|
495
493
|
const SEPARATOR = ":";
|
|
496
|
-
const { isEmpty, endsWith, startsWith, noop, isArray, isUndefined, isString, isFunction, merge, isInteger, isBoolean } = lodash.default;
|
|
497
494
|
const { sign } = aws4.default;
|
|
498
495
|
/**
|
|
499
496
|
* JavaScript client for communicating with a Para API server.
|
|
@@ -1443,7 +1440,7 @@ var ParaClient = class {
|
|
|
1443
1440
|
fn(null);
|
|
1444
1441
|
return resolve(null);
|
|
1445
1442
|
}
|
|
1446
|
-
var url = obj.getObjectURI() + "/links
|
|
1443
|
+
var url = obj.getObjectURI() + "/links";
|
|
1447
1444
|
return this.getEntity(this.invokeDelete(url), fn);
|
|
1448
1445
|
}
|
|
1449
1446
|
/**
|
|
@@ -1750,7 +1747,7 @@ var ParaClient = class {
|
|
|
1750
1747
|
* @returns {Promise} a map containing all validation constraints.
|
|
1751
1748
|
*/
|
|
1752
1749
|
async validationConstraints(type, fn) {
|
|
1753
|
-
return this.getEntity(this.invokeGet("_constraints/" + urlEncode(type
|
|
1750
|
+
return this.getEntity(this.invokeGet("_constraints" + (type ? "/" + urlEncode(type) : "")), fn);
|
|
1754
1751
|
}
|
|
1755
1752
|
/**
|
|
1756
1753
|
* Add a new constraint for a given field.
|
|
@@ -2038,6 +2035,60 @@ var ParaClient = class {
|
|
|
2038
2035
|
});
|
|
2039
2036
|
}
|
|
2040
2037
|
};
|
|
2038
|
+
function isUndefined(value) {
|
|
2039
|
+
return value === void 0;
|
|
2040
|
+
}
|
|
2041
|
+
function isArray(value) {
|
|
2042
|
+
return Array.isArray(value);
|
|
2043
|
+
}
|
|
2044
|
+
function isString(value) {
|
|
2045
|
+
return typeof value === "string" || value instanceof String;
|
|
2046
|
+
}
|
|
2047
|
+
function isFunction(value) {
|
|
2048
|
+
return typeof value === "function";
|
|
2049
|
+
}
|
|
2050
|
+
function isBoolean(value) {
|
|
2051
|
+
return typeof value === "boolean" || value instanceof Boolean;
|
|
2052
|
+
}
|
|
2053
|
+
function isInteger(value) {
|
|
2054
|
+
return typeof value == "number";
|
|
2055
|
+
}
|
|
2056
|
+
function startsWith(value, prefix) {
|
|
2057
|
+
if (value == null) return false;
|
|
2058
|
+
return String(value).startsWith(prefix);
|
|
2059
|
+
}
|
|
2060
|
+
function endsWith(value, suffix) {
|
|
2061
|
+
if (value == null) return false;
|
|
2062
|
+
return String(value).endsWith(suffix);
|
|
2063
|
+
}
|
|
2064
|
+
function isEmpty(value) {
|
|
2065
|
+
if (value == null) return true;
|
|
2066
|
+
if (isArray(value) || isString(value)) return value.length === 0;
|
|
2067
|
+
if (value instanceof Map || value instanceof Set) return value.size === 0;
|
|
2068
|
+
if (typeof value === "object") {
|
|
2069
|
+
for (var key in value) if (Object.prototype.hasOwnProperty.call(value, key)) return false;
|
|
2070
|
+
}
|
|
2071
|
+
return true;
|
|
2072
|
+
}
|
|
2073
|
+
function noop() {}
|
|
2074
|
+
function merge(target) {
|
|
2075
|
+
var output = target;
|
|
2076
|
+
if (output == null || typeof output !== "object") output = {};
|
|
2077
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2078
|
+
var source = arguments[i];
|
|
2079
|
+
if (source == null) continue;
|
|
2080
|
+
for (var key in source) {
|
|
2081
|
+
if (!Object.prototype.hasOwnProperty.call(source, key)) continue;
|
|
2082
|
+
var sourceValue = source[key];
|
|
2083
|
+
var targetValue = output[key];
|
|
2084
|
+
if (sourceValue && typeof sourceValue === "object" && !isArray(sourceValue) && !(sourceValue instanceof Date)) {
|
|
2085
|
+
if (!targetValue || typeof targetValue !== "object" || isArray(targetValue)) targetValue = {};
|
|
2086
|
+
output[key] = merge(targetValue, sourceValue);
|
|
2087
|
+
} else output[key] = sourceValue;
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
return output;
|
|
2091
|
+
}
|
|
2041
2092
|
function urlEncode(path) {
|
|
2042
2093
|
return encodeURIComponent(path).replace(/[!'()*]/g, function(c) {
|
|
2043
2094
|
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|