@rebasepro/server-postgresql 0.1.0 → 0.1.2
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.es.js +107 -1070
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +38 -1001
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -5
- package/examples/sdk-demo/node_modules/esbuild/LICENSE.md +0 -21
- package/examples/sdk-demo/node_modules/esbuild/README.md +0 -3
- package/examples/sdk-demo/node_modules/esbuild/bin/esbuild +0 -223
- package/examples/sdk-demo/node_modules/esbuild/install.js +0 -289
- package/examples/sdk-demo/node_modules/esbuild/lib/main.d.ts +0 -716
- package/examples/sdk-demo/node_modules/esbuild/lib/main.js +0 -2242
- package/examples/sdk-demo/node_modules/esbuild/package.json +0 -49
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pool, Client } from "pg";
|
|
2
2
|
import { drizzle } from "drizzle-orm/node-postgres";
|
|
3
|
-
import { sql, inArray, eq
|
|
3
|
+
import { sql, inArray, eq, and, or, ilike, asc, desc, gt, lt, getTableName as getTableName$1, count, relations, isTable } from "drizzle-orm";
|
|
4
4
|
import { pgSchema, timestamp, varchar, boolean, uuid, jsonb, primaryKey, unique } from "drizzle-orm/pg-core";
|
|
5
5
|
import { createHash, randomUUID } from "crypto";
|
|
6
6
|
import * as fs from "fs";
|
|
@@ -132,9 +132,6 @@ const toSnakeCase = (str) => {
|
|
|
132
132
|
return regExpMatchArray.map((x) => x.toLowerCase()).join("_");
|
|
133
133
|
};
|
|
134
134
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
135
|
-
function getDefaultExportFromCjs(x) {
|
|
136
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
137
|
-
}
|
|
138
135
|
function commonjsRequire(path2) {
|
|
139
136
|
throw new Error('Could not dynamically require "' + path2 + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
140
137
|
}
|
|
@@ -921,7 +918,23 @@ var object_hash = { exports: {} };
|
|
|
921
918
|
}, { buffer: 3, lYpoI2: 11 }] }, {}, [1])(1);
|
|
922
919
|
});
|
|
923
920
|
})(object_hash);
|
|
924
|
-
function
|
|
921
|
+
function deepClone(value) {
|
|
922
|
+
if (value === null || value === void 0) return value;
|
|
923
|
+
if (typeof value === "function") return value;
|
|
924
|
+
if (typeof value !== "object") return value;
|
|
925
|
+
if (Array.isArray(value)) {
|
|
926
|
+
return value.map((item) => deepClone(item));
|
|
927
|
+
}
|
|
928
|
+
if (Object.getPrototypeOf(value) !== Object.prototype) {
|
|
929
|
+
return value;
|
|
930
|
+
}
|
|
931
|
+
const result = {};
|
|
932
|
+
for (const key of Object.keys(value)) {
|
|
933
|
+
result[key] = deepClone(value[key]);
|
|
934
|
+
}
|
|
935
|
+
return result;
|
|
936
|
+
}
|
|
937
|
+
function isObject(item) {
|
|
925
938
|
return !!item && typeof item === "object" && !Array.isArray(item);
|
|
926
939
|
}
|
|
927
940
|
function isPlainObject(obj) {
|
|
@@ -932,13 +945,13 @@ function isPlainObject(obj) {
|
|
|
932
945
|
return proto === Object.prototype;
|
|
933
946
|
}
|
|
934
947
|
function mergeDeep(target, source, ignoreUndefined = false) {
|
|
935
|
-
if (!isObject
|
|
948
|
+
if (!isObject(target)) {
|
|
936
949
|
return target;
|
|
937
950
|
}
|
|
938
951
|
const output = {
|
|
939
952
|
...target
|
|
940
953
|
};
|
|
941
|
-
if (!isObject
|
|
954
|
+
if (!isObject(source)) {
|
|
942
955
|
return output;
|
|
943
956
|
}
|
|
944
957
|
for (const key in source) {
|
|
@@ -979,7 +992,7 @@ function mergeDeep(target, source, ignoreUndefined = false) {
|
|
|
979
992
|
} else {
|
|
980
993
|
output[key] = sourceValue;
|
|
981
994
|
}
|
|
982
|
-
} else if (isObject
|
|
995
|
+
} else if (isObject(sourceValue)) {
|
|
983
996
|
output[key] = sourceValue;
|
|
984
997
|
} else {
|
|
985
998
|
output[key] = sourceValue;
|
|
@@ -1425,7 +1438,7 @@ function findRelation(resolvedRelations, key) {
|
|
|
1425
1438
|
}
|
|
1426
1439
|
var logic = { exports: {} };
|
|
1427
1440
|
(function(module, exports$1) {
|
|
1428
|
-
(function(
|
|
1441
|
+
(function(root, factory) {
|
|
1429
1442
|
{
|
|
1430
1443
|
module.exports = factory();
|
|
1431
1444
|
}
|
|
@@ -1793,7 +1806,7 @@ var logic = { exports: {} };
|
|
|
1793
1806
|
});
|
|
1794
1807
|
})(logic);
|
|
1795
1808
|
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
1796
|
-
const { hasOwnProperty
|
|
1809
|
+
const { hasOwnProperty } = Object.prototype;
|
|
1797
1810
|
function combineComparators(comparatorA, comparatorB) {
|
|
1798
1811
|
return function isEqual(a, b, state) {
|
|
1799
1812
|
return comparatorA(a, b, state) && comparatorB(a, b, state);
|
|
@@ -1823,12 +1836,12 @@ function getStrictProperties(object) {
|
|
|
1823
1836
|
}
|
|
1824
1837
|
const hasOwn = (
|
|
1825
1838
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1826
|
-
Object.hasOwn || ((object, property) => hasOwnProperty
|
|
1839
|
+
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property))
|
|
1827
1840
|
);
|
|
1828
1841
|
const PREACT_VNODE = "__v";
|
|
1829
1842
|
const PREACT_OWNER = "__o";
|
|
1830
1843
|
const REACT_OWNER = "_owner";
|
|
1831
|
-
const { getOwnPropertyDescriptor, keys
|
|
1844
|
+
const { getOwnPropertyDescriptor, keys } = Object;
|
|
1832
1845
|
const sameValueEqual = (
|
|
1833
1846
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1834
1847
|
Object.is || function sameValueEqual2(a, b) {
|
|
@@ -1906,9 +1919,9 @@ function areMapsEqual(a, b, state) {
|
|
|
1906
1919
|
return true;
|
|
1907
1920
|
}
|
|
1908
1921
|
function areObjectsEqual(a, b, state) {
|
|
1909
|
-
const properties = keys
|
|
1922
|
+
const properties = keys(a);
|
|
1910
1923
|
let index = properties.length;
|
|
1911
|
-
if (keys
|
|
1924
|
+
if (keys(b).length !== index) {
|
|
1912
1925
|
return false;
|
|
1913
1926
|
}
|
|
1914
1927
|
while (index-- > 0) {
|
|
@@ -2211,982 +2224,6 @@ function createCustomEqual(options = {}) {
|
|
|
2211
2224
|
const equals = createCustomInternalComparator ? createCustomInternalComparator(comparator) : createInternalEqualityComparator(comparator);
|
|
2212
2225
|
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
2213
2226
|
}
|
|
2214
|
-
function listCacheClear$1() {
|
|
2215
|
-
this.__data__ = [];
|
|
2216
|
-
this.size = 0;
|
|
2217
|
-
}
|
|
2218
|
-
var _listCacheClear = listCacheClear$1;
|
|
2219
|
-
function eq$2(value, other) {
|
|
2220
|
-
return value === other || value !== value && other !== other;
|
|
2221
|
-
}
|
|
2222
|
-
var eq_1 = eq$2;
|
|
2223
|
-
var eq$1 = eq_1;
|
|
2224
|
-
function assocIndexOf$4(array, key) {
|
|
2225
|
-
var length = array.length;
|
|
2226
|
-
while (length--) {
|
|
2227
|
-
if (eq$1(array[length][0], key)) {
|
|
2228
|
-
return length;
|
|
2229
|
-
}
|
|
2230
|
-
}
|
|
2231
|
-
return -1;
|
|
2232
|
-
}
|
|
2233
|
-
var _assocIndexOf = assocIndexOf$4;
|
|
2234
|
-
var assocIndexOf$3 = _assocIndexOf;
|
|
2235
|
-
var arrayProto = Array.prototype;
|
|
2236
|
-
var splice = arrayProto.splice;
|
|
2237
|
-
function listCacheDelete$1(key) {
|
|
2238
|
-
var data = this.__data__, index = assocIndexOf$3(data, key);
|
|
2239
|
-
if (index < 0) {
|
|
2240
|
-
return false;
|
|
2241
|
-
}
|
|
2242
|
-
var lastIndex = data.length - 1;
|
|
2243
|
-
if (index == lastIndex) {
|
|
2244
|
-
data.pop();
|
|
2245
|
-
} else {
|
|
2246
|
-
splice.call(data, index, 1);
|
|
2247
|
-
}
|
|
2248
|
-
--this.size;
|
|
2249
|
-
return true;
|
|
2250
|
-
}
|
|
2251
|
-
var _listCacheDelete = listCacheDelete$1;
|
|
2252
|
-
var assocIndexOf$2 = _assocIndexOf;
|
|
2253
|
-
function listCacheGet$1(key) {
|
|
2254
|
-
var data = this.__data__, index = assocIndexOf$2(data, key);
|
|
2255
|
-
return index < 0 ? void 0 : data[index][1];
|
|
2256
|
-
}
|
|
2257
|
-
var _listCacheGet = listCacheGet$1;
|
|
2258
|
-
var assocIndexOf$1 = _assocIndexOf;
|
|
2259
|
-
function listCacheHas$1(key) {
|
|
2260
|
-
return assocIndexOf$1(this.__data__, key) > -1;
|
|
2261
|
-
}
|
|
2262
|
-
var _listCacheHas = listCacheHas$1;
|
|
2263
|
-
var assocIndexOf = _assocIndexOf;
|
|
2264
|
-
function listCacheSet$1(key, value) {
|
|
2265
|
-
var data = this.__data__, index = assocIndexOf(data, key);
|
|
2266
|
-
if (index < 0) {
|
|
2267
|
-
++this.size;
|
|
2268
|
-
data.push([key, value]);
|
|
2269
|
-
} else {
|
|
2270
|
-
data[index][1] = value;
|
|
2271
|
-
}
|
|
2272
|
-
return this;
|
|
2273
|
-
}
|
|
2274
|
-
var _listCacheSet = listCacheSet$1;
|
|
2275
|
-
var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
|
|
2276
|
-
function ListCache$4(entries) {
|
|
2277
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2278
|
-
this.clear();
|
|
2279
|
-
while (++index < length) {
|
|
2280
|
-
var entry = entries[index];
|
|
2281
|
-
this.set(entry[0], entry[1]);
|
|
2282
|
-
}
|
|
2283
|
-
}
|
|
2284
|
-
ListCache$4.prototype.clear = listCacheClear;
|
|
2285
|
-
ListCache$4.prototype["delete"] = listCacheDelete;
|
|
2286
|
-
ListCache$4.prototype.get = listCacheGet;
|
|
2287
|
-
ListCache$4.prototype.has = listCacheHas;
|
|
2288
|
-
ListCache$4.prototype.set = listCacheSet;
|
|
2289
|
-
var _ListCache = ListCache$4;
|
|
2290
|
-
var ListCache$3 = _ListCache;
|
|
2291
|
-
function stackClear$1() {
|
|
2292
|
-
this.__data__ = new ListCache$3();
|
|
2293
|
-
this.size = 0;
|
|
2294
|
-
}
|
|
2295
|
-
var _stackClear = stackClear$1;
|
|
2296
|
-
function stackDelete$1(key) {
|
|
2297
|
-
var data = this.__data__, result = data["delete"](key);
|
|
2298
|
-
this.size = data.size;
|
|
2299
|
-
return result;
|
|
2300
|
-
}
|
|
2301
|
-
var _stackDelete = stackDelete$1;
|
|
2302
|
-
function stackGet$1(key) {
|
|
2303
|
-
return this.__data__.get(key);
|
|
2304
|
-
}
|
|
2305
|
-
var _stackGet = stackGet$1;
|
|
2306
|
-
function stackHas$1(key) {
|
|
2307
|
-
return this.__data__.has(key);
|
|
2308
|
-
}
|
|
2309
|
-
var _stackHas = stackHas$1;
|
|
2310
|
-
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
2311
|
-
var _freeGlobal = freeGlobal$1;
|
|
2312
|
-
var freeGlobal = _freeGlobal;
|
|
2313
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2314
|
-
var root$8 = freeGlobal || freeSelf || Function("return this")();
|
|
2315
|
-
var _root = root$8;
|
|
2316
|
-
var root$7 = _root;
|
|
2317
|
-
var Symbol$4 = root$7.Symbol;
|
|
2318
|
-
var _Symbol = Symbol$4;
|
|
2319
|
-
var Symbol$3 = _Symbol;
|
|
2320
|
-
var objectProto$c = Object.prototype;
|
|
2321
|
-
var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
|
|
2322
|
-
var nativeObjectToString$1 = objectProto$c.toString;
|
|
2323
|
-
var symToStringTag$1 = Symbol$3 ? Symbol$3.toStringTag : void 0;
|
|
2324
|
-
function getRawTag$1(value) {
|
|
2325
|
-
var isOwn = hasOwnProperty$9.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
2326
|
-
try {
|
|
2327
|
-
value[symToStringTag$1] = void 0;
|
|
2328
|
-
var unmasked = true;
|
|
2329
|
-
} catch (e) {
|
|
2330
|
-
}
|
|
2331
|
-
var result = nativeObjectToString$1.call(value);
|
|
2332
|
-
if (unmasked) {
|
|
2333
|
-
if (isOwn) {
|
|
2334
|
-
value[symToStringTag$1] = tag;
|
|
2335
|
-
} else {
|
|
2336
|
-
delete value[symToStringTag$1];
|
|
2337
|
-
}
|
|
2338
|
-
}
|
|
2339
|
-
return result;
|
|
2340
|
-
}
|
|
2341
|
-
var _getRawTag = getRawTag$1;
|
|
2342
|
-
var objectProto$b = Object.prototype;
|
|
2343
|
-
var nativeObjectToString = objectProto$b.toString;
|
|
2344
|
-
function objectToString$1(value) {
|
|
2345
|
-
return nativeObjectToString.call(value);
|
|
2346
|
-
}
|
|
2347
|
-
var _objectToString = objectToString$1;
|
|
2348
|
-
var Symbol$2 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
|
|
2349
|
-
var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
|
|
2350
|
-
var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
|
|
2351
|
-
function baseGetTag$4(value) {
|
|
2352
|
-
if (value == null) {
|
|
2353
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
2354
|
-
}
|
|
2355
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2356
|
-
}
|
|
2357
|
-
var _baseGetTag = baseGetTag$4;
|
|
2358
|
-
function isObject$5(value) {
|
|
2359
|
-
var type = typeof value;
|
|
2360
|
-
return value != null && (type == "object" || type == "function");
|
|
2361
|
-
}
|
|
2362
|
-
var isObject_1 = isObject$5;
|
|
2363
|
-
var baseGetTag$3 = _baseGetTag, isObject$4 = isObject_1;
|
|
2364
|
-
var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
2365
|
-
function isFunction$2(value) {
|
|
2366
|
-
if (!isObject$4(value)) {
|
|
2367
|
-
return false;
|
|
2368
|
-
}
|
|
2369
|
-
var tag = baseGetTag$3(value);
|
|
2370
|
-
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
|
2371
|
-
}
|
|
2372
|
-
var isFunction_1 = isFunction$2;
|
|
2373
|
-
var root$6 = _root;
|
|
2374
|
-
var coreJsData$1 = root$6["__core-js_shared__"];
|
|
2375
|
-
var _coreJsData = coreJsData$1;
|
|
2376
|
-
var coreJsData = _coreJsData;
|
|
2377
|
-
var maskSrcKey = function() {
|
|
2378
|
-
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
2379
|
-
return uid ? "Symbol(src)_1." + uid : "";
|
|
2380
|
-
}();
|
|
2381
|
-
function isMasked$1(func) {
|
|
2382
|
-
return !!maskSrcKey && maskSrcKey in func;
|
|
2383
|
-
}
|
|
2384
|
-
var _isMasked = isMasked$1;
|
|
2385
|
-
var funcProto$1 = Function.prototype;
|
|
2386
|
-
var funcToString$1 = funcProto$1.toString;
|
|
2387
|
-
function toSource$2(func) {
|
|
2388
|
-
if (func != null) {
|
|
2389
|
-
try {
|
|
2390
|
-
return funcToString$1.call(func);
|
|
2391
|
-
} catch (e) {
|
|
2392
|
-
}
|
|
2393
|
-
try {
|
|
2394
|
-
return func + "";
|
|
2395
|
-
} catch (e) {
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
return "";
|
|
2399
|
-
}
|
|
2400
|
-
var _toSource = toSource$2;
|
|
2401
|
-
var isFunction$1 = isFunction_1, isMasked = _isMasked, isObject$3 = isObject_1, toSource$1 = _toSource;
|
|
2402
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
2403
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
2404
|
-
var funcProto = Function.prototype, objectProto$a = Object.prototype;
|
|
2405
|
-
var funcToString = funcProto.toString;
|
|
2406
|
-
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
2407
|
-
var reIsNative = RegExp(
|
|
2408
|
-
"^" + funcToString.call(hasOwnProperty$8).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
2409
|
-
);
|
|
2410
|
-
function baseIsNative$1(value) {
|
|
2411
|
-
if (!isObject$3(value) || isMasked(value)) {
|
|
2412
|
-
return false;
|
|
2413
|
-
}
|
|
2414
|
-
var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
|
|
2415
|
-
return pattern.test(toSource$1(value));
|
|
2416
|
-
}
|
|
2417
|
-
var _baseIsNative = baseIsNative$1;
|
|
2418
|
-
function getValue$1(object, key) {
|
|
2419
|
-
return object == null ? void 0 : object[key];
|
|
2420
|
-
}
|
|
2421
|
-
var _getValue = getValue$1;
|
|
2422
|
-
var baseIsNative = _baseIsNative, getValue = _getValue;
|
|
2423
|
-
function getNative$7(object, key) {
|
|
2424
|
-
var value = getValue(object, key);
|
|
2425
|
-
return baseIsNative(value) ? value : void 0;
|
|
2426
|
-
}
|
|
2427
|
-
var _getNative = getNative$7;
|
|
2428
|
-
var getNative$6 = _getNative, root$5 = _root;
|
|
2429
|
-
var Map$4 = getNative$6(root$5, "Map");
|
|
2430
|
-
var _Map = Map$4;
|
|
2431
|
-
var getNative$5 = _getNative;
|
|
2432
|
-
var nativeCreate$4 = getNative$5(Object, "create");
|
|
2433
|
-
var _nativeCreate = nativeCreate$4;
|
|
2434
|
-
var nativeCreate$3 = _nativeCreate;
|
|
2435
|
-
function hashClear$1() {
|
|
2436
|
-
this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
|
|
2437
|
-
this.size = 0;
|
|
2438
|
-
}
|
|
2439
|
-
var _hashClear = hashClear$1;
|
|
2440
|
-
function hashDelete$1(key) {
|
|
2441
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
2442
|
-
this.size -= result ? 1 : 0;
|
|
2443
|
-
return result;
|
|
2444
|
-
}
|
|
2445
|
-
var _hashDelete = hashDelete$1;
|
|
2446
|
-
var nativeCreate$2 = _nativeCreate;
|
|
2447
|
-
var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
|
|
2448
|
-
var objectProto$9 = Object.prototype;
|
|
2449
|
-
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
2450
|
-
function hashGet$1(key) {
|
|
2451
|
-
var data = this.__data__;
|
|
2452
|
-
if (nativeCreate$2) {
|
|
2453
|
-
var result = data[key];
|
|
2454
|
-
return result === HASH_UNDEFINED$1 ? void 0 : result;
|
|
2455
|
-
}
|
|
2456
|
-
return hasOwnProperty$7.call(data, key) ? data[key] : void 0;
|
|
2457
|
-
}
|
|
2458
|
-
var _hashGet = hashGet$1;
|
|
2459
|
-
var nativeCreate$1 = _nativeCreate;
|
|
2460
|
-
var objectProto$8 = Object.prototype;
|
|
2461
|
-
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
2462
|
-
function hashHas$1(key) {
|
|
2463
|
-
var data = this.__data__;
|
|
2464
|
-
return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$6.call(data, key);
|
|
2465
|
-
}
|
|
2466
|
-
var _hashHas = hashHas$1;
|
|
2467
|
-
var nativeCreate = _nativeCreate;
|
|
2468
|
-
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2469
|
-
function hashSet$1(key, value) {
|
|
2470
|
-
var data = this.__data__;
|
|
2471
|
-
this.size += this.has(key) ? 0 : 1;
|
|
2472
|
-
data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
|
|
2473
|
-
return this;
|
|
2474
|
-
}
|
|
2475
|
-
var _hashSet = hashSet$1;
|
|
2476
|
-
var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
|
|
2477
|
-
function Hash$1(entries) {
|
|
2478
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2479
|
-
this.clear();
|
|
2480
|
-
while (++index < length) {
|
|
2481
|
-
var entry = entries[index];
|
|
2482
|
-
this.set(entry[0], entry[1]);
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
Hash$1.prototype.clear = hashClear;
|
|
2486
|
-
Hash$1.prototype["delete"] = hashDelete;
|
|
2487
|
-
Hash$1.prototype.get = hashGet;
|
|
2488
|
-
Hash$1.prototype.has = hashHas;
|
|
2489
|
-
Hash$1.prototype.set = hashSet;
|
|
2490
|
-
var _Hash = Hash$1;
|
|
2491
|
-
var Hash = _Hash, ListCache$2 = _ListCache, Map$3 = _Map;
|
|
2492
|
-
function mapCacheClear$1() {
|
|
2493
|
-
this.size = 0;
|
|
2494
|
-
this.__data__ = {
|
|
2495
|
-
"hash": new Hash(),
|
|
2496
|
-
"map": new (Map$3 || ListCache$2)(),
|
|
2497
|
-
"string": new Hash()
|
|
2498
|
-
};
|
|
2499
|
-
}
|
|
2500
|
-
var _mapCacheClear = mapCacheClear$1;
|
|
2501
|
-
function isKeyable$1(value) {
|
|
2502
|
-
var type = typeof value;
|
|
2503
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
2504
|
-
}
|
|
2505
|
-
var _isKeyable = isKeyable$1;
|
|
2506
|
-
var isKeyable = _isKeyable;
|
|
2507
|
-
function getMapData$4(map, key) {
|
|
2508
|
-
var data = map.__data__;
|
|
2509
|
-
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2510
|
-
}
|
|
2511
|
-
var _getMapData = getMapData$4;
|
|
2512
|
-
var getMapData$3 = _getMapData;
|
|
2513
|
-
function mapCacheDelete$1(key) {
|
|
2514
|
-
var result = getMapData$3(this, key)["delete"](key);
|
|
2515
|
-
this.size -= result ? 1 : 0;
|
|
2516
|
-
return result;
|
|
2517
|
-
}
|
|
2518
|
-
var _mapCacheDelete = mapCacheDelete$1;
|
|
2519
|
-
var getMapData$2 = _getMapData;
|
|
2520
|
-
function mapCacheGet$1(key) {
|
|
2521
|
-
return getMapData$2(this, key).get(key);
|
|
2522
|
-
}
|
|
2523
|
-
var _mapCacheGet = mapCacheGet$1;
|
|
2524
|
-
var getMapData$1 = _getMapData;
|
|
2525
|
-
function mapCacheHas$1(key) {
|
|
2526
|
-
return getMapData$1(this, key).has(key);
|
|
2527
|
-
}
|
|
2528
|
-
var _mapCacheHas = mapCacheHas$1;
|
|
2529
|
-
var getMapData = _getMapData;
|
|
2530
|
-
function mapCacheSet$1(key, value) {
|
|
2531
|
-
var data = getMapData(this, key), size = data.size;
|
|
2532
|
-
data.set(key, value);
|
|
2533
|
-
this.size += data.size == size ? 0 : 1;
|
|
2534
|
-
return this;
|
|
2535
|
-
}
|
|
2536
|
-
var _mapCacheSet = mapCacheSet$1;
|
|
2537
|
-
var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
|
|
2538
|
-
function MapCache$1(entries) {
|
|
2539
|
-
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2540
|
-
this.clear();
|
|
2541
|
-
while (++index < length) {
|
|
2542
|
-
var entry = entries[index];
|
|
2543
|
-
this.set(entry[0], entry[1]);
|
|
2544
|
-
}
|
|
2545
|
-
}
|
|
2546
|
-
MapCache$1.prototype.clear = mapCacheClear;
|
|
2547
|
-
MapCache$1.prototype["delete"] = mapCacheDelete;
|
|
2548
|
-
MapCache$1.prototype.get = mapCacheGet;
|
|
2549
|
-
MapCache$1.prototype.has = mapCacheHas;
|
|
2550
|
-
MapCache$1.prototype.set = mapCacheSet;
|
|
2551
|
-
var _MapCache = MapCache$1;
|
|
2552
|
-
var ListCache$1 = _ListCache, Map$2 = _Map, MapCache = _MapCache;
|
|
2553
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
2554
|
-
function stackSet$1(key, value) {
|
|
2555
|
-
var data = this.__data__;
|
|
2556
|
-
if (data instanceof ListCache$1) {
|
|
2557
|
-
var pairs = data.__data__;
|
|
2558
|
-
if (!Map$2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
2559
|
-
pairs.push([key, value]);
|
|
2560
|
-
this.size = ++data.size;
|
|
2561
|
-
return this;
|
|
2562
|
-
}
|
|
2563
|
-
data = this.__data__ = new MapCache(pairs);
|
|
2564
|
-
}
|
|
2565
|
-
data.set(key, value);
|
|
2566
|
-
this.size = data.size;
|
|
2567
|
-
return this;
|
|
2568
|
-
}
|
|
2569
|
-
var _stackSet = stackSet$1;
|
|
2570
|
-
var ListCache = _ListCache, stackClear = _stackClear, stackDelete = _stackDelete, stackGet = _stackGet, stackHas = _stackHas, stackSet = _stackSet;
|
|
2571
|
-
function Stack$1(entries) {
|
|
2572
|
-
var data = this.__data__ = new ListCache(entries);
|
|
2573
|
-
this.size = data.size;
|
|
2574
|
-
}
|
|
2575
|
-
Stack$1.prototype.clear = stackClear;
|
|
2576
|
-
Stack$1.prototype["delete"] = stackDelete;
|
|
2577
|
-
Stack$1.prototype.get = stackGet;
|
|
2578
|
-
Stack$1.prototype.has = stackHas;
|
|
2579
|
-
Stack$1.prototype.set = stackSet;
|
|
2580
|
-
var _Stack = Stack$1;
|
|
2581
|
-
function arrayEach$1(array, iteratee) {
|
|
2582
|
-
var index = -1, length = array == null ? 0 : array.length;
|
|
2583
|
-
while (++index < length) {
|
|
2584
|
-
if (iteratee(array[index], index, array) === false) {
|
|
2585
|
-
break;
|
|
2586
|
-
}
|
|
2587
|
-
}
|
|
2588
|
-
return array;
|
|
2589
|
-
}
|
|
2590
|
-
var _arrayEach = arrayEach$1;
|
|
2591
|
-
var getNative$4 = _getNative;
|
|
2592
|
-
var defineProperty$1 = function() {
|
|
2593
|
-
try {
|
|
2594
|
-
var func = getNative$4(Object, "defineProperty");
|
|
2595
|
-
func({}, "", {});
|
|
2596
|
-
return func;
|
|
2597
|
-
} catch (e) {
|
|
2598
|
-
}
|
|
2599
|
-
}();
|
|
2600
|
-
var _defineProperty = defineProperty$1;
|
|
2601
|
-
var defineProperty = _defineProperty;
|
|
2602
|
-
function baseAssignValue$2(object, key, value) {
|
|
2603
|
-
if (key == "__proto__" && defineProperty) {
|
|
2604
|
-
defineProperty(object, key, {
|
|
2605
|
-
"configurable": true,
|
|
2606
|
-
"enumerable": true,
|
|
2607
|
-
"value": value,
|
|
2608
|
-
"writable": true
|
|
2609
|
-
});
|
|
2610
|
-
} else {
|
|
2611
|
-
object[key] = value;
|
|
2612
|
-
}
|
|
2613
|
-
}
|
|
2614
|
-
var _baseAssignValue = baseAssignValue$2;
|
|
2615
|
-
var baseAssignValue$1 = _baseAssignValue, eq = eq_1;
|
|
2616
|
-
var objectProto$7 = Object.prototype;
|
|
2617
|
-
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
2618
|
-
function assignValue$2(object, key, value) {
|
|
2619
|
-
var objValue = object[key];
|
|
2620
|
-
if (!(hasOwnProperty$5.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
|
|
2621
|
-
baseAssignValue$1(object, key, value);
|
|
2622
|
-
}
|
|
2623
|
-
}
|
|
2624
|
-
var _assignValue = assignValue$2;
|
|
2625
|
-
var assignValue$1 = _assignValue, baseAssignValue = _baseAssignValue;
|
|
2626
|
-
function copyObject$4(source, props, object, customizer) {
|
|
2627
|
-
var isNew = !object;
|
|
2628
|
-
object || (object = {});
|
|
2629
|
-
var index = -1, length = props.length;
|
|
2630
|
-
while (++index < length) {
|
|
2631
|
-
var key = props[index];
|
|
2632
|
-
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
|
|
2633
|
-
if (newValue === void 0) {
|
|
2634
|
-
newValue = source[key];
|
|
2635
|
-
}
|
|
2636
|
-
if (isNew) {
|
|
2637
|
-
baseAssignValue(object, key, newValue);
|
|
2638
|
-
} else {
|
|
2639
|
-
assignValue$1(object, key, newValue);
|
|
2640
|
-
}
|
|
2641
|
-
}
|
|
2642
|
-
return object;
|
|
2643
|
-
}
|
|
2644
|
-
var _copyObject = copyObject$4;
|
|
2645
|
-
function baseTimes$1(n, iteratee) {
|
|
2646
|
-
var index = -1, result = Array(n);
|
|
2647
|
-
while (++index < n) {
|
|
2648
|
-
result[index] = iteratee(index);
|
|
2649
|
-
}
|
|
2650
|
-
return result;
|
|
2651
|
-
}
|
|
2652
|
-
var _baseTimes = baseTimes$1;
|
|
2653
|
-
function isObjectLike$5(value) {
|
|
2654
|
-
return value != null && typeof value == "object";
|
|
2655
|
-
}
|
|
2656
|
-
var isObjectLike_1 = isObjectLike$5;
|
|
2657
|
-
var baseGetTag$2 = _baseGetTag, isObjectLike$4 = isObjectLike_1;
|
|
2658
|
-
var argsTag$2 = "[object Arguments]";
|
|
2659
|
-
function baseIsArguments$1(value) {
|
|
2660
|
-
return isObjectLike$4(value) && baseGetTag$2(value) == argsTag$2;
|
|
2661
|
-
}
|
|
2662
|
-
var _baseIsArguments = baseIsArguments$1;
|
|
2663
|
-
var baseIsArguments = _baseIsArguments, isObjectLike$3 = isObjectLike_1;
|
|
2664
|
-
var objectProto$6 = Object.prototype;
|
|
2665
|
-
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
|
2666
|
-
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
2667
|
-
var isArguments$1 = baseIsArguments(/* @__PURE__ */ function() {
|
|
2668
|
-
return arguments;
|
|
2669
|
-
}()) ? baseIsArguments : function(value) {
|
|
2670
|
-
return isObjectLike$3(value) && hasOwnProperty$4.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
|
|
2671
|
-
};
|
|
2672
|
-
var isArguments_1 = isArguments$1;
|
|
2673
|
-
var isArray$3 = Array.isArray;
|
|
2674
|
-
var isArray_1 = isArray$3;
|
|
2675
|
-
var isBuffer$2 = { exports: {} };
|
|
2676
|
-
function stubFalse() {
|
|
2677
|
-
return false;
|
|
2678
|
-
}
|
|
2679
|
-
var stubFalse_1 = stubFalse;
|
|
2680
|
-
isBuffer$2.exports;
|
|
2681
|
-
(function(module, exports$1) {
|
|
2682
|
-
var root2 = _root, stubFalse2 = stubFalse_1;
|
|
2683
|
-
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
2684
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2685
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2686
|
-
var Buffer2 = moduleExports ? root2.Buffer : void 0;
|
|
2687
|
-
var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
|
|
2688
|
-
var isBuffer2 = nativeIsBuffer || stubFalse2;
|
|
2689
|
-
module.exports = isBuffer2;
|
|
2690
|
-
})(isBuffer$2, isBuffer$2.exports);
|
|
2691
|
-
var isBufferExports = isBuffer$2.exports;
|
|
2692
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
2693
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2694
|
-
function isIndex$1(value, length) {
|
|
2695
|
-
var type = typeof value;
|
|
2696
|
-
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
2697
|
-
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2698
|
-
}
|
|
2699
|
-
var _isIndex = isIndex$1;
|
|
2700
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2701
|
-
function isLength$2(value) {
|
|
2702
|
-
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
2703
|
-
}
|
|
2704
|
-
var isLength_1 = isLength$2;
|
|
2705
|
-
var baseGetTag$1 = _baseGetTag, isLength$1 = isLength_1, isObjectLike$2 = isObjectLike_1;
|
|
2706
|
-
var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", errorTag$1 = "[object Error]", funcTag$1 = "[object Function]", mapTag$4 = "[object Map]", numberTag$2 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$2 = "[object RegExp]", setTag$4 = "[object Set]", stringTag$2 = "[object String]", weakMapTag$2 = "[object WeakMap]";
|
|
2707
|
-
var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$3 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
|
|
2708
|
-
var typedArrayTags = {};
|
|
2709
|
-
typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
|
|
2710
|
-
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] = typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] = typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] = typedArrayTags[weakMapTag$2] = false;
|
|
2711
|
-
function baseIsTypedArray$1(value) {
|
|
2712
|
-
return isObjectLike$2(value) && isLength$1(value.length) && !!typedArrayTags[baseGetTag$1(value)];
|
|
2713
|
-
}
|
|
2714
|
-
var _baseIsTypedArray = baseIsTypedArray$1;
|
|
2715
|
-
function baseUnary$3(func) {
|
|
2716
|
-
return function(value) {
|
|
2717
|
-
return func(value);
|
|
2718
|
-
};
|
|
2719
|
-
}
|
|
2720
|
-
var _baseUnary = baseUnary$3;
|
|
2721
|
-
var _nodeUtil = { exports: {} };
|
|
2722
|
-
_nodeUtil.exports;
|
|
2723
|
-
(function(module, exports$1) {
|
|
2724
|
-
var freeGlobal2 = _freeGlobal;
|
|
2725
|
-
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
2726
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2727
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2728
|
-
var freeProcess = moduleExports && freeGlobal2.process;
|
|
2729
|
-
var nodeUtil2 = function() {
|
|
2730
|
-
try {
|
|
2731
|
-
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
2732
|
-
if (types) {
|
|
2733
|
-
return types;
|
|
2734
|
-
}
|
|
2735
|
-
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
2736
|
-
} catch (e) {
|
|
2737
|
-
}
|
|
2738
|
-
}();
|
|
2739
|
-
module.exports = nodeUtil2;
|
|
2740
|
-
})(_nodeUtil, _nodeUtil.exports);
|
|
2741
|
-
var _nodeUtilExports = _nodeUtil.exports;
|
|
2742
|
-
var baseIsTypedArray = _baseIsTypedArray, baseUnary$2 = _baseUnary, nodeUtil$2 = _nodeUtilExports;
|
|
2743
|
-
var nodeIsTypedArray = nodeUtil$2 && nodeUtil$2.isTypedArray;
|
|
2744
|
-
var isTypedArray$1 = nodeIsTypedArray ? baseUnary$2(nodeIsTypedArray) : baseIsTypedArray;
|
|
2745
|
-
var isTypedArray_1 = isTypedArray$1;
|
|
2746
|
-
var baseTimes = _baseTimes, isArguments = isArguments_1, isArray$2 = isArray_1, isBuffer$1 = isBufferExports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
|
|
2747
|
-
var objectProto$5 = Object.prototype;
|
|
2748
|
-
var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
|
|
2749
|
-
function arrayLikeKeys$2(value, inherited) {
|
|
2750
|
-
var isArr = isArray$2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
|
|
2751
|
-
for (var key in value) {
|
|
2752
|
-
if ((inherited || hasOwnProperty$3.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
2753
|
-
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
2754
|
-
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
2755
|
-
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
2756
|
-
isIndex(key, length)))) {
|
|
2757
|
-
result.push(key);
|
|
2758
|
-
}
|
|
2759
|
-
}
|
|
2760
|
-
return result;
|
|
2761
|
-
}
|
|
2762
|
-
var _arrayLikeKeys = arrayLikeKeys$2;
|
|
2763
|
-
var objectProto$4 = Object.prototype;
|
|
2764
|
-
function isPrototype$3(value) {
|
|
2765
|
-
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$4;
|
|
2766
|
-
return value === proto;
|
|
2767
|
-
}
|
|
2768
|
-
var _isPrototype = isPrototype$3;
|
|
2769
|
-
function overArg$2(func, transform) {
|
|
2770
|
-
return function(arg) {
|
|
2771
|
-
return func(transform(arg));
|
|
2772
|
-
};
|
|
2773
|
-
}
|
|
2774
|
-
var _overArg = overArg$2;
|
|
2775
|
-
var overArg$1 = _overArg;
|
|
2776
|
-
var nativeKeys$1 = overArg$1(Object.keys, Object);
|
|
2777
|
-
var _nativeKeys = nativeKeys$1;
|
|
2778
|
-
var isPrototype$2 = _isPrototype, nativeKeys = _nativeKeys;
|
|
2779
|
-
var objectProto$3 = Object.prototype;
|
|
2780
|
-
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
|
2781
|
-
function baseKeys$1(object) {
|
|
2782
|
-
if (!isPrototype$2(object)) {
|
|
2783
|
-
return nativeKeys(object);
|
|
2784
|
-
}
|
|
2785
|
-
var result = [];
|
|
2786
|
-
for (var key in Object(object)) {
|
|
2787
|
-
if (hasOwnProperty$2.call(object, key) && key != "constructor") {
|
|
2788
|
-
result.push(key);
|
|
2789
|
-
}
|
|
2790
|
-
}
|
|
2791
|
-
return result;
|
|
2792
|
-
}
|
|
2793
|
-
var _baseKeys = baseKeys$1;
|
|
2794
|
-
var isFunction = isFunction_1, isLength = isLength_1;
|
|
2795
|
-
function isArrayLike$2(value) {
|
|
2796
|
-
return value != null && isLength(value.length) && !isFunction(value);
|
|
2797
|
-
}
|
|
2798
|
-
var isArrayLike_1 = isArrayLike$2;
|
|
2799
|
-
var arrayLikeKeys$1 = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike$1 = isArrayLike_1;
|
|
2800
|
-
function keys$3(object) {
|
|
2801
|
-
return isArrayLike$1(object) ? arrayLikeKeys$1(object) : baseKeys(object);
|
|
2802
|
-
}
|
|
2803
|
-
var keys_1 = keys$3;
|
|
2804
|
-
var copyObject$3 = _copyObject, keys$2 = keys_1;
|
|
2805
|
-
function baseAssign$1(object, source) {
|
|
2806
|
-
return object && copyObject$3(source, keys$2(source), object);
|
|
2807
|
-
}
|
|
2808
|
-
var _baseAssign = baseAssign$1;
|
|
2809
|
-
function nativeKeysIn$1(object) {
|
|
2810
|
-
var result = [];
|
|
2811
|
-
if (object != null) {
|
|
2812
|
-
for (var key in Object(object)) {
|
|
2813
|
-
result.push(key);
|
|
2814
|
-
}
|
|
2815
|
-
}
|
|
2816
|
-
return result;
|
|
2817
|
-
}
|
|
2818
|
-
var _nativeKeysIn = nativeKeysIn$1;
|
|
2819
|
-
var isObject$2 = isObject_1, isPrototype$1 = _isPrototype, nativeKeysIn = _nativeKeysIn;
|
|
2820
|
-
var objectProto$2 = Object.prototype;
|
|
2821
|
-
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
|
2822
|
-
function baseKeysIn$1(object) {
|
|
2823
|
-
if (!isObject$2(object)) {
|
|
2824
|
-
return nativeKeysIn(object);
|
|
2825
|
-
}
|
|
2826
|
-
var isProto = isPrototype$1(object), result = [];
|
|
2827
|
-
for (var key in object) {
|
|
2828
|
-
if (!(key == "constructor" && (isProto || !hasOwnProperty$1.call(object, key)))) {
|
|
2829
|
-
result.push(key);
|
|
2830
|
-
}
|
|
2831
|
-
}
|
|
2832
|
-
return result;
|
|
2833
|
-
}
|
|
2834
|
-
var _baseKeysIn = baseKeysIn$1;
|
|
2835
|
-
var arrayLikeKeys = _arrayLikeKeys, baseKeysIn = _baseKeysIn, isArrayLike = isArrayLike_1;
|
|
2836
|
-
function keysIn$3(object) {
|
|
2837
|
-
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
2838
|
-
}
|
|
2839
|
-
var keysIn_1 = keysIn$3;
|
|
2840
|
-
var copyObject$2 = _copyObject, keysIn$2 = keysIn_1;
|
|
2841
|
-
function baseAssignIn$1(object, source) {
|
|
2842
|
-
return object && copyObject$2(source, keysIn$2(source), object);
|
|
2843
|
-
}
|
|
2844
|
-
var _baseAssignIn = baseAssignIn$1;
|
|
2845
|
-
var _cloneBuffer = { exports: {} };
|
|
2846
|
-
_cloneBuffer.exports;
|
|
2847
|
-
(function(module, exports$1) {
|
|
2848
|
-
var root2 = _root;
|
|
2849
|
-
var freeExports = exports$1 && !exports$1.nodeType && exports$1;
|
|
2850
|
-
var freeModule = freeExports && true && module && !module.nodeType && module;
|
|
2851
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
2852
|
-
var Buffer2 = moduleExports ? root2.Buffer : void 0, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : void 0;
|
|
2853
|
-
function cloneBuffer2(buffer, isDeep) {
|
|
2854
|
-
if (isDeep) {
|
|
2855
|
-
return buffer.slice();
|
|
2856
|
-
}
|
|
2857
|
-
var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
2858
|
-
buffer.copy(result);
|
|
2859
|
-
return result;
|
|
2860
|
-
}
|
|
2861
|
-
module.exports = cloneBuffer2;
|
|
2862
|
-
})(_cloneBuffer, _cloneBuffer.exports);
|
|
2863
|
-
var _cloneBufferExports = _cloneBuffer.exports;
|
|
2864
|
-
function copyArray$1(source, array) {
|
|
2865
|
-
var index = -1, length = source.length;
|
|
2866
|
-
array || (array = Array(length));
|
|
2867
|
-
while (++index < length) {
|
|
2868
|
-
array[index] = source[index];
|
|
2869
|
-
}
|
|
2870
|
-
return array;
|
|
2871
|
-
}
|
|
2872
|
-
var _copyArray = copyArray$1;
|
|
2873
|
-
function arrayFilter$1(array, predicate) {
|
|
2874
|
-
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
2875
|
-
while (++index < length) {
|
|
2876
|
-
var value = array[index];
|
|
2877
|
-
if (predicate(value, index, array)) {
|
|
2878
|
-
result[resIndex++] = value;
|
|
2879
|
-
}
|
|
2880
|
-
}
|
|
2881
|
-
return result;
|
|
2882
|
-
}
|
|
2883
|
-
var _arrayFilter = arrayFilter$1;
|
|
2884
|
-
function stubArray$2() {
|
|
2885
|
-
return [];
|
|
2886
|
-
}
|
|
2887
|
-
var stubArray_1 = stubArray$2;
|
|
2888
|
-
var arrayFilter = _arrayFilter, stubArray$1 = stubArray_1;
|
|
2889
|
-
var objectProto$1 = Object.prototype;
|
|
2890
|
-
var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
|
|
2891
|
-
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
|
2892
|
-
var getSymbols$3 = !nativeGetSymbols$1 ? stubArray$1 : function(object) {
|
|
2893
|
-
if (object == null) {
|
|
2894
|
-
return [];
|
|
2895
|
-
}
|
|
2896
|
-
object = Object(object);
|
|
2897
|
-
return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
|
|
2898
|
-
return propertyIsEnumerable.call(object, symbol);
|
|
2899
|
-
});
|
|
2900
|
-
};
|
|
2901
|
-
var _getSymbols = getSymbols$3;
|
|
2902
|
-
var copyObject$1 = _copyObject, getSymbols$2 = _getSymbols;
|
|
2903
|
-
function copySymbols$1(source, object) {
|
|
2904
|
-
return copyObject$1(source, getSymbols$2(source), object);
|
|
2905
|
-
}
|
|
2906
|
-
var _copySymbols = copySymbols$1;
|
|
2907
|
-
function arrayPush$2(array, values) {
|
|
2908
|
-
var index = -1, length = values.length, offset = array.length;
|
|
2909
|
-
while (++index < length) {
|
|
2910
|
-
array[offset + index] = values[index];
|
|
2911
|
-
}
|
|
2912
|
-
return array;
|
|
2913
|
-
}
|
|
2914
|
-
var _arrayPush = arrayPush$2;
|
|
2915
|
-
var overArg = _overArg;
|
|
2916
|
-
var getPrototype$2 = overArg(Object.getPrototypeOf, Object);
|
|
2917
|
-
var _getPrototype = getPrototype$2;
|
|
2918
|
-
var arrayPush$1 = _arrayPush, getPrototype$1 = _getPrototype, getSymbols$1 = _getSymbols, stubArray = stubArray_1;
|
|
2919
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
2920
|
-
var getSymbolsIn$2 = !nativeGetSymbols ? stubArray : function(object) {
|
|
2921
|
-
var result = [];
|
|
2922
|
-
while (object) {
|
|
2923
|
-
arrayPush$1(result, getSymbols$1(object));
|
|
2924
|
-
object = getPrototype$1(object);
|
|
2925
|
-
}
|
|
2926
|
-
return result;
|
|
2927
|
-
};
|
|
2928
|
-
var _getSymbolsIn = getSymbolsIn$2;
|
|
2929
|
-
var copyObject = _copyObject, getSymbolsIn$1 = _getSymbolsIn;
|
|
2930
|
-
function copySymbolsIn$1(source, object) {
|
|
2931
|
-
return copyObject(source, getSymbolsIn$1(source), object);
|
|
2932
|
-
}
|
|
2933
|
-
var _copySymbolsIn = copySymbolsIn$1;
|
|
2934
|
-
var arrayPush = _arrayPush, isArray$1 = isArray_1;
|
|
2935
|
-
function baseGetAllKeys$2(object, keysFunc, symbolsFunc) {
|
|
2936
|
-
var result = keysFunc(object);
|
|
2937
|
-
return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
|
|
2938
|
-
}
|
|
2939
|
-
var _baseGetAllKeys = baseGetAllKeys$2;
|
|
2940
|
-
var baseGetAllKeys$1 = _baseGetAllKeys, getSymbols = _getSymbols, keys$1 = keys_1;
|
|
2941
|
-
function getAllKeys$1(object) {
|
|
2942
|
-
return baseGetAllKeys$1(object, keys$1, getSymbols);
|
|
2943
|
-
}
|
|
2944
|
-
var _getAllKeys = getAllKeys$1;
|
|
2945
|
-
var baseGetAllKeys = _baseGetAllKeys, getSymbolsIn = _getSymbolsIn, keysIn$1 = keysIn_1;
|
|
2946
|
-
function getAllKeysIn$1(object) {
|
|
2947
|
-
return baseGetAllKeys(object, keysIn$1, getSymbolsIn);
|
|
2948
|
-
}
|
|
2949
|
-
var _getAllKeysIn = getAllKeysIn$1;
|
|
2950
|
-
var getNative$3 = _getNative, root$4 = _root;
|
|
2951
|
-
var DataView$1 = getNative$3(root$4, "DataView");
|
|
2952
|
-
var _DataView = DataView$1;
|
|
2953
|
-
var getNative$2 = _getNative, root$3 = _root;
|
|
2954
|
-
var Promise$2 = getNative$2(root$3, "Promise");
|
|
2955
|
-
var _Promise = Promise$2;
|
|
2956
|
-
var getNative$1 = _getNative, root$2 = _root;
|
|
2957
|
-
var Set$2 = getNative$1(root$2, "Set");
|
|
2958
|
-
var _Set = Set$2;
|
|
2959
|
-
var getNative = _getNative, root$1 = _root;
|
|
2960
|
-
var WeakMap$2 = getNative(root$1, "WeakMap");
|
|
2961
|
-
var _WeakMap = WeakMap$2;
|
|
2962
|
-
var DataView = _DataView, Map$1 = _Map, Promise$1 = _Promise, Set$1 = _Set, WeakMap$1 = _WeakMap, baseGetTag = _baseGetTag, toSource = _toSource;
|
|
2963
|
-
var mapTag$3 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$3 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
|
|
2964
|
-
var dataViewTag$2 = "[object DataView]";
|
|
2965
|
-
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
|
|
2966
|
-
var getTag$3 = baseGetTag;
|
|
2967
|
-
if (DataView && getTag$3(new DataView(new ArrayBuffer(1))) != dataViewTag$2 || Map$1 && getTag$3(new Map$1()) != mapTag$3 || Promise$1 && getTag$3(Promise$1.resolve()) != promiseTag || Set$1 && getTag$3(new Set$1()) != setTag$3 || WeakMap$1 && getTag$3(new WeakMap$1()) != weakMapTag$1) {
|
|
2968
|
-
getTag$3 = function(value) {
|
|
2969
|
-
var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
|
|
2970
|
-
if (ctorString) {
|
|
2971
|
-
switch (ctorString) {
|
|
2972
|
-
case dataViewCtorString:
|
|
2973
|
-
return dataViewTag$2;
|
|
2974
|
-
case mapCtorString:
|
|
2975
|
-
return mapTag$3;
|
|
2976
|
-
case promiseCtorString:
|
|
2977
|
-
return promiseTag;
|
|
2978
|
-
case setCtorString:
|
|
2979
|
-
return setTag$3;
|
|
2980
|
-
case weakMapCtorString:
|
|
2981
|
-
return weakMapTag$1;
|
|
2982
|
-
}
|
|
2983
|
-
}
|
|
2984
|
-
return result;
|
|
2985
|
-
};
|
|
2986
|
-
}
|
|
2987
|
-
var _getTag = getTag$3;
|
|
2988
|
-
var objectProto = Object.prototype;
|
|
2989
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2990
|
-
function initCloneArray$1(array) {
|
|
2991
|
-
var length = array.length, result = new array.constructor(length);
|
|
2992
|
-
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
2993
|
-
result.index = array.index;
|
|
2994
|
-
result.input = array.input;
|
|
2995
|
-
}
|
|
2996
|
-
return result;
|
|
2997
|
-
}
|
|
2998
|
-
var _initCloneArray = initCloneArray$1;
|
|
2999
|
-
var root = _root;
|
|
3000
|
-
var Uint8Array$2 = root.Uint8Array;
|
|
3001
|
-
var _Uint8Array = Uint8Array$2;
|
|
3002
|
-
var Uint8Array$1 = _Uint8Array;
|
|
3003
|
-
function cloneArrayBuffer$3(arrayBuffer) {
|
|
3004
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
3005
|
-
new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
|
|
3006
|
-
return result;
|
|
3007
|
-
}
|
|
3008
|
-
var _cloneArrayBuffer = cloneArrayBuffer$3;
|
|
3009
|
-
var cloneArrayBuffer$2 = _cloneArrayBuffer;
|
|
3010
|
-
function cloneDataView$1(dataView, isDeep) {
|
|
3011
|
-
var buffer = isDeep ? cloneArrayBuffer$2(dataView.buffer) : dataView.buffer;
|
|
3012
|
-
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
3013
|
-
}
|
|
3014
|
-
var _cloneDataView = cloneDataView$1;
|
|
3015
|
-
var reFlags = /\w*$/;
|
|
3016
|
-
function cloneRegExp$1(regexp) {
|
|
3017
|
-
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
3018
|
-
result.lastIndex = regexp.lastIndex;
|
|
3019
|
-
return result;
|
|
3020
|
-
}
|
|
3021
|
-
var _cloneRegExp = cloneRegExp$1;
|
|
3022
|
-
var Symbol$1 = _Symbol;
|
|
3023
|
-
var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
|
|
3024
|
-
function cloneSymbol$1(symbol) {
|
|
3025
|
-
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
|
3026
|
-
}
|
|
3027
|
-
var _cloneSymbol = cloneSymbol$1;
|
|
3028
|
-
var cloneArrayBuffer$1 = _cloneArrayBuffer;
|
|
3029
|
-
function cloneTypedArray$1(typedArray, isDeep) {
|
|
3030
|
-
var buffer = isDeep ? cloneArrayBuffer$1(typedArray.buffer) : typedArray.buffer;
|
|
3031
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
3032
|
-
}
|
|
3033
|
-
var _cloneTypedArray = cloneTypedArray$1;
|
|
3034
|
-
var cloneArrayBuffer = _cloneArrayBuffer, cloneDataView = _cloneDataView, cloneRegExp = _cloneRegExp, cloneSymbol = _cloneSymbol, cloneTypedArray = _cloneTypedArray;
|
|
3035
|
-
var boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]";
|
|
3036
|
-
var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
|
|
3037
|
-
function initCloneByTag$1(object, tag, isDeep) {
|
|
3038
|
-
var Ctor = object.constructor;
|
|
3039
|
-
switch (tag) {
|
|
3040
|
-
case arrayBufferTag$1:
|
|
3041
|
-
return cloneArrayBuffer(object);
|
|
3042
|
-
case boolTag$1:
|
|
3043
|
-
case dateTag$1:
|
|
3044
|
-
return new Ctor(+object);
|
|
3045
|
-
case dataViewTag$1:
|
|
3046
|
-
return cloneDataView(object, isDeep);
|
|
3047
|
-
case float32Tag$1:
|
|
3048
|
-
case float64Tag$1:
|
|
3049
|
-
case int8Tag$1:
|
|
3050
|
-
case int16Tag$1:
|
|
3051
|
-
case int32Tag$1:
|
|
3052
|
-
case uint8Tag$1:
|
|
3053
|
-
case uint8ClampedTag$1:
|
|
3054
|
-
case uint16Tag$1:
|
|
3055
|
-
case uint32Tag$1:
|
|
3056
|
-
return cloneTypedArray(object, isDeep);
|
|
3057
|
-
case mapTag$2:
|
|
3058
|
-
return new Ctor();
|
|
3059
|
-
case numberTag$1:
|
|
3060
|
-
case stringTag$1:
|
|
3061
|
-
return new Ctor(object);
|
|
3062
|
-
case regexpTag$1:
|
|
3063
|
-
return cloneRegExp(object);
|
|
3064
|
-
case setTag$2:
|
|
3065
|
-
return new Ctor();
|
|
3066
|
-
case symbolTag$1:
|
|
3067
|
-
return cloneSymbol(object);
|
|
3068
|
-
}
|
|
3069
|
-
}
|
|
3070
|
-
var _initCloneByTag = initCloneByTag$1;
|
|
3071
|
-
var isObject$1 = isObject_1;
|
|
3072
|
-
var objectCreate = Object.create;
|
|
3073
|
-
var baseCreate$1 = /* @__PURE__ */ function() {
|
|
3074
|
-
function object() {
|
|
3075
|
-
}
|
|
3076
|
-
return function(proto) {
|
|
3077
|
-
if (!isObject$1(proto)) {
|
|
3078
|
-
return {};
|
|
3079
|
-
}
|
|
3080
|
-
if (objectCreate) {
|
|
3081
|
-
return objectCreate(proto);
|
|
3082
|
-
}
|
|
3083
|
-
object.prototype = proto;
|
|
3084
|
-
var result = new object();
|
|
3085
|
-
object.prototype = void 0;
|
|
3086
|
-
return result;
|
|
3087
|
-
};
|
|
3088
|
-
}();
|
|
3089
|
-
var _baseCreate = baseCreate$1;
|
|
3090
|
-
var baseCreate = _baseCreate, getPrototype = _getPrototype, isPrototype = _isPrototype;
|
|
3091
|
-
function initCloneObject$1(object) {
|
|
3092
|
-
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
3093
|
-
}
|
|
3094
|
-
var _initCloneObject = initCloneObject$1;
|
|
3095
|
-
var getTag$2 = _getTag, isObjectLike$1 = isObjectLike_1;
|
|
3096
|
-
var mapTag$1 = "[object Map]";
|
|
3097
|
-
function baseIsMap$1(value) {
|
|
3098
|
-
return isObjectLike$1(value) && getTag$2(value) == mapTag$1;
|
|
3099
|
-
}
|
|
3100
|
-
var _baseIsMap = baseIsMap$1;
|
|
3101
|
-
var baseIsMap = _baseIsMap, baseUnary$1 = _baseUnary, nodeUtil$1 = _nodeUtilExports;
|
|
3102
|
-
var nodeIsMap = nodeUtil$1 && nodeUtil$1.isMap;
|
|
3103
|
-
var isMap$1 = nodeIsMap ? baseUnary$1(nodeIsMap) : baseIsMap;
|
|
3104
|
-
var isMap_1 = isMap$1;
|
|
3105
|
-
var getTag$1 = _getTag, isObjectLike = isObjectLike_1;
|
|
3106
|
-
var setTag$1 = "[object Set]";
|
|
3107
|
-
function baseIsSet$1(value) {
|
|
3108
|
-
return isObjectLike(value) && getTag$1(value) == setTag$1;
|
|
3109
|
-
}
|
|
3110
|
-
var _baseIsSet = baseIsSet$1;
|
|
3111
|
-
var baseIsSet = _baseIsSet, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
|
|
3112
|
-
var nodeIsSet = nodeUtil && nodeUtil.isSet;
|
|
3113
|
-
var isSet$1 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
3114
|
-
var isSet_1 = isSet$1;
|
|
3115
|
-
var Stack = _Stack, arrayEach = _arrayEach, assignValue = _assignValue, baseAssign = _baseAssign, baseAssignIn = _baseAssignIn, cloneBuffer = _cloneBufferExports, copyArray = _copyArray, copySymbols = _copySymbols, copySymbolsIn = _copySymbolsIn, getAllKeys = _getAllKeys, getAllKeysIn = _getAllKeysIn, getTag = _getTag, initCloneArray = _initCloneArray, initCloneByTag = _initCloneByTag, initCloneObject = _initCloneObject, isArray = isArray_1, isBuffer = isBufferExports, isMap = isMap_1, isObject = isObject_1, isSet = isSet_1, keys = keys_1, keysIn = keysIn_1;
|
|
3116
|
-
var CLONE_DEEP_FLAG$1 = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG$1 = 4;
|
|
3117
|
-
var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
|
|
3118
|
-
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
3119
|
-
var cloneableTags = {};
|
|
3120
|
-
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
3121
|
-
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
3122
|
-
function baseClone$1(value, bitmask, customizer, key, object, stack) {
|
|
3123
|
-
var result, isDeep = bitmask & CLONE_DEEP_FLAG$1, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
|
3124
|
-
if (customizer) {
|
|
3125
|
-
result = object ? customizer(value, key, object, stack) : customizer(value);
|
|
3126
|
-
}
|
|
3127
|
-
if (result !== void 0) {
|
|
3128
|
-
return result;
|
|
3129
|
-
}
|
|
3130
|
-
if (!isObject(value)) {
|
|
3131
|
-
return value;
|
|
3132
|
-
}
|
|
3133
|
-
var isArr = isArray(value);
|
|
3134
|
-
if (isArr) {
|
|
3135
|
-
result = initCloneArray(value);
|
|
3136
|
-
if (!isDeep) {
|
|
3137
|
-
return copyArray(value, result);
|
|
3138
|
-
}
|
|
3139
|
-
} else {
|
|
3140
|
-
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
3141
|
-
if (isBuffer(value)) {
|
|
3142
|
-
return cloneBuffer(value, isDeep);
|
|
3143
|
-
}
|
|
3144
|
-
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
3145
|
-
result = isFlat || isFunc ? {} : initCloneObject(value);
|
|
3146
|
-
if (!isDeep) {
|
|
3147
|
-
return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
|
|
3148
|
-
}
|
|
3149
|
-
} else {
|
|
3150
|
-
if (!cloneableTags[tag]) {
|
|
3151
|
-
return object ? value : {};
|
|
3152
|
-
}
|
|
3153
|
-
result = initCloneByTag(value, tag, isDeep);
|
|
3154
|
-
}
|
|
3155
|
-
}
|
|
3156
|
-
stack || (stack = new Stack());
|
|
3157
|
-
var stacked = stack.get(value);
|
|
3158
|
-
if (stacked) {
|
|
3159
|
-
return stacked;
|
|
3160
|
-
}
|
|
3161
|
-
stack.set(value, result);
|
|
3162
|
-
if (isSet(value)) {
|
|
3163
|
-
value.forEach(function(subValue) {
|
|
3164
|
-
result.add(baseClone$1(subValue, bitmask, customizer, subValue, value, stack));
|
|
3165
|
-
});
|
|
3166
|
-
} else if (isMap(value)) {
|
|
3167
|
-
value.forEach(function(subValue, key2) {
|
|
3168
|
-
result.set(key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
|
|
3169
|
-
});
|
|
3170
|
-
}
|
|
3171
|
-
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
3172
|
-
var props = isArr ? void 0 : keysFunc(value);
|
|
3173
|
-
arrayEach(props || value, function(subValue, key2) {
|
|
3174
|
-
if (props) {
|
|
3175
|
-
key2 = subValue;
|
|
3176
|
-
subValue = value[key2];
|
|
3177
|
-
}
|
|
3178
|
-
assignValue(result, key2, baseClone$1(subValue, bitmask, customizer, key2, value, stack));
|
|
3179
|
-
});
|
|
3180
|
-
return result;
|
|
3181
|
-
}
|
|
3182
|
-
var _baseClone = baseClone$1;
|
|
3183
|
-
var baseClone = _baseClone;
|
|
3184
|
-
var CLONE_DEEP_FLAG = 1, CLONE_SYMBOLS_FLAG = 4;
|
|
3185
|
-
function cloneDeep(value) {
|
|
3186
|
-
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
3187
|
-
}
|
|
3188
|
-
var cloneDeep_1 = cloneDeep;
|
|
3189
|
-
const cloneDeep$1 = /* @__PURE__ */ getDefaultExportFromCjs(cloneDeep_1);
|
|
3190
2227
|
class CollectionRegistry {
|
|
3191
2228
|
// Normalized runtime layer (used by Data Grid / UI)
|
|
3192
2229
|
collectionsByTableName = /* @__PURE__ */ new Map();
|
|
@@ -3234,7 +2271,7 @@ class CollectionRegistry {
|
|
|
3234
2271
|
...c
|
|
3235
2272
|
}));
|
|
3236
2273
|
normalizedCollections.forEach((c, index) => {
|
|
3237
|
-
const raw =
|
|
2274
|
+
const raw = deepClone(collections[index]);
|
|
3238
2275
|
this.rootCollections.push(c);
|
|
3239
2276
|
this.rawRootCollections.push(raw);
|
|
3240
2277
|
const normalized = this.normalizeCollection(c);
|
|
@@ -3254,7 +2291,7 @@ class CollectionRegistry {
|
|
|
3254
2291
|
if (!subCollection) return;
|
|
3255
2292
|
this._registerRecursively(this.normalizeCollection({
|
|
3256
2293
|
...subCollection
|
|
3257
|
-
}),
|
|
2294
|
+
}), deepClone(subCollection));
|
|
3258
2295
|
});
|
|
3259
2296
|
}
|
|
3260
2297
|
});
|
|
@@ -3262,7 +2299,7 @@ class CollectionRegistry {
|
|
|
3262
2299
|
return true;
|
|
3263
2300
|
}
|
|
3264
2301
|
register(collection, rawCollection) {
|
|
3265
|
-
const raw = rawCollection ?
|
|
2302
|
+
const raw = rawCollection ? deepClone(rawCollection) : deepClone(collection);
|
|
3266
2303
|
this.rootCollections.push(collection);
|
|
3267
2304
|
this.rawRootCollections.push(raw);
|
|
3268
2305
|
this._registerRecursively(collection, raw);
|
|
@@ -3286,7 +2323,7 @@ class CollectionRegistry {
|
|
|
3286
2323
|
if (!subCollection) return;
|
|
3287
2324
|
this._registerRecursively(this.normalizeCollection({
|
|
3288
2325
|
...subCollection
|
|
3289
|
-
}),
|
|
2326
|
+
}), deepClone(subCollection));
|
|
3290
2327
|
});
|
|
3291
2328
|
}
|
|
3292
2329
|
}
|
|
@@ -3747,7 +2784,7 @@ class DrizzleConditionBuilder {
|
|
|
3747
2784
|
static buildSingleFilterCondition(column, op, value) {
|
|
3748
2785
|
switch (op) {
|
|
3749
2786
|
case "==":
|
|
3750
|
-
return eq
|
|
2787
|
+
return eq(column, value);
|
|
3751
2788
|
case "!=":
|
|
3752
2789
|
return sql`${column} != ${value}`;
|
|
3753
2790
|
case ">":
|
|
@@ -3877,7 +2914,7 @@ class DrizzleConditionBuilder {
|
|
|
3877
2914
|
throw new Error(`Join path did not result in connecting to parent table. Current: ${currentTableName}, Parent: ${parentTableName}`);
|
|
3878
2915
|
}
|
|
3879
2916
|
}
|
|
3880
|
-
const finalCondition = Array.isArray(parentEntityId) ? inArray(parentIdColumn, parentEntityId) : eq
|
|
2917
|
+
const finalCondition = Array.isArray(parentEntityId) ? inArray(parentIdColumn, parentEntityId) : eq(parentIdColumn, parentEntityId);
|
|
3881
2918
|
return {
|
|
3882
2919
|
joins,
|
|
3883
2920
|
finalCondition
|
|
@@ -3903,7 +2940,7 @@ class DrizzleConditionBuilder {
|
|
|
3903
2940
|
throw new Error(`Join columns not found: ${fromTableName}.${fromColName} = ${toTableName}.${toColName}`);
|
|
3904
2941
|
}
|
|
3905
2942
|
joinTable = fromTable;
|
|
3906
|
-
condition = eq
|
|
2943
|
+
condition = eq(left, right);
|
|
3907
2944
|
} else if (currentTable === fromTable) {
|
|
3908
2945
|
const left = toTable[toColName];
|
|
3909
2946
|
const right = currentTable[fromColName];
|
|
@@ -3917,7 +2954,7 @@ class DrizzleConditionBuilder {
|
|
|
3917
2954
|
throw new Error(`Join columns not found: ${toTableName}.${toColName} = ${fromTableName}.${fromColName}`);
|
|
3918
2955
|
}
|
|
3919
2956
|
joinTable = toTable;
|
|
3920
|
-
condition = eq
|
|
2957
|
+
condition = eq(left, right);
|
|
3921
2958
|
} else {
|
|
3922
2959
|
throw new Error(`Join step does not match current table. Current table does not match from: ${fromTableName} or to: ${toTableName}`);
|
|
3923
2960
|
}
|
|
@@ -3948,19 +2985,19 @@ class DrizzleConditionBuilder {
|
|
|
3948
2985
|
if (currentTable === targetTable) {
|
|
3949
2986
|
return {
|
|
3950
2987
|
joinTable: targetTable,
|
|
3951
|
-
condition: eq
|
|
2988
|
+
condition: eq(targetTableIdCol, junctionTargetCol),
|
|
3952
2989
|
additionalJoins: [{
|
|
3953
2990
|
table: junctionTable,
|
|
3954
|
-
condition: eq
|
|
2991
|
+
condition: eq(currentTableIdCol, junctionSourceCol)
|
|
3955
2992
|
}]
|
|
3956
2993
|
};
|
|
3957
2994
|
} else {
|
|
3958
2995
|
return {
|
|
3959
2996
|
joinTable: junctionTable,
|
|
3960
|
-
condition: eq
|
|
2997
|
+
condition: eq(currentTableIdCol, junctionSourceCol),
|
|
3961
2998
|
additionalJoins: [{
|
|
3962
2999
|
table: targetTable,
|
|
3963
|
-
condition: eq
|
|
3000
|
+
condition: eq(targetTableIdCol, junctionTargetCol)
|
|
3964
3001
|
}]
|
|
3965
3002
|
};
|
|
3966
3003
|
}
|
|
@@ -3985,11 +3022,11 @@ class DrizzleConditionBuilder {
|
|
|
3985
3022
|
if (!junctionTargetCol) {
|
|
3986
3023
|
throw new Error(`Target column '${through.targetColumn}' not found in junction table '${through.table}'`);
|
|
3987
3024
|
}
|
|
3988
|
-
const condition = Array.isArray(parentEntityId) ? inArray(junctionSourceCol, parentEntityId) : eq
|
|
3025
|
+
const condition = Array.isArray(parentEntityId) ? inArray(junctionSourceCol, parentEntityId) : eq(junctionSourceCol, parentEntityId);
|
|
3989
3026
|
return {
|
|
3990
3027
|
join: {
|
|
3991
3028
|
table: junctionTable,
|
|
3992
|
-
condition: eq
|
|
3029
|
+
condition: eq(targetIdColumn, junctionTargetCol)
|
|
3993
3030
|
},
|
|
3994
3031
|
condition
|
|
3995
3032
|
};
|
|
@@ -4010,11 +3047,11 @@ class DrizzleConditionBuilder {
|
|
|
4010
3047
|
if (!junctionTargetCol) {
|
|
4011
3048
|
throw new Error(`Target column '${through.targetColumn}' not found in junction table '${through.table}'`);
|
|
4012
3049
|
}
|
|
4013
|
-
const condition = Array.isArray(parentEntityId) ? inArray(junctionSourceCol, parentEntityId) : eq
|
|
3050
|
+
const condition = Array.isArray(parentEntityId) ? inArray(junctionSourceCol, parentEntityId) : eq(junctionSourceCol, parentEntityId);
|
|
4014
3051
|
return {
|
|
4015
3052
|
join: {
|
|
4016
3053
|
table: junctionTable,
|
|
4017
|
-
condition: eq
|
|
3054
|
+
condition: eq(targetIdColumn, junctionTargetCol)
|
|
4018
3055
|
},
|
|
4019
3056
|
condition
|
|
4020
3057
|
};
|
|
@@ -4030,15 +3067,15 @@ class DrizzleConditionBuilder {
|
|
|
4030
3067
|
if (!idCol) {
|
|
4031
3068
|
throw new Error('No primary key or "id" column found in target table');
|
|
4032
3069
|
}
|
|
4033
|
-
return Array.isArray(parentEntityId) ? inArray(idCol, parentEntityId) : eq
|
|
3070
|
+
return Array.isArray(parentEntityId) ? inArray(idCol, parentEntityId) : eq(idCol, parentEntityId);
|
|
4034
3071
|
}
|
|
4035
|
-
return Array.isArray(parentEntityId) ? inArray(targetIdCol, parentEntityId) : eq
|
|
3072
|
+
return Array.isArray(parentEntityId) ? inArray(targetIdCol, parentEntityId) : eq(targetIdCol, parentEntityId);
|
|
4036
3073
|
} else if (relation.direction === "inverse" && relation.foreignKeyOnTarget) {
|
|
4037
3074
|
const foreignKeyCol = targetTable[relation.foreignKeyOnTarget];
|
|
4038
3075
|
if (!foreignKeyCol) {
|
|
4039
3076
|
throw new Error(`Foreign key column '${relation.foreignKeyOnTarget}' not found in target table. This might be a many-to-many relationship that requires a junction table. Consider using 'through' property or ensure the corresponding owning relation exists with junction table configuration.`);
|
|
4040
3077
|
}
|
|
4041
|
-
return Array.isArray(parentEntityId) ? inArray(foreignKeyCol, parentEntityId) : eq
|
|
3078
|
+
return Array.isArray(parentEntityId) ? inArray(foreignKeyCol, parentEntityId) : eq(foreignKeyCol, parentEntityId);
|
|
4042
3079
|
} else if (relation.direction === "inverse" && relation.cardinality === "many" && relation.inverseRelationName) {
|
|
4043
3080
|
throw new Error(`Inverse many-to-many relation '${relation.relationName}' requires a junction table. Either specify 'through' property or ensure the corresponding owning relation exists with junction table configuration.`);
|
|
4044
3081
|
} else if (relation.direction === "inverse" && relation.cardinality === "one" && relation.inverseRelationName) {
|
|
@@ -4048,7 +3085,7 @@ class DrizzleConditionBuilder {
|
|
|
4048
3085
|
throw new Error(`Auto-inferred foreign key column '${inferredForeignKeyName}' not found in target table for inverse relation '${relation.relationName}'. Please specify 'foreignKeyOnTarget' explicitly.`);
|
|
4049
3086
|
}
|
|
4050
3087
|
console.debug(`🔍 [DrizzleConditionBuilder] Auto-inferred foreign key '${inferredForeignKeyName}' for inverse relation '${relation.relationName}'`);
|
|
4051
|
-
return Array.isArray(parentEntityId) ? inArray(foreignKeyCol, parentEntityId) : eq
|
|
3088
|
+
return Array.isArray(parentEntityId) ? inArray(foreignKeyCol, parentEntityId) : eq(foreignKeyCol, parentEntityId);
|
|
4052
3089
|
} else {
|
|
4053
3090
|
throw new Error(`Relation '${relation.relationName}' lacks proper configuration. For many-to-many relations, use 'through' property. For simple relations, use 'localKey' or 'foreignKeyOnTarget'.`);
|
|
4054
3091
|
}
|
|
@@ -4089,7 +3126,7 @@ class DrizzleConditionBuilder {
|
|
|
4089
3126
|
* Build a unique field check condition
|
|
4090
3127
|
*/
|
|
4091
3128
|
static buildUniqueFieldCondition(fieldColumn, value, idColumn, excludeId) {
|
|
4092
|
-
const conditions = [eq
|
|
3129
|
+
const conditions = [eq(fieldColumn, value)];
|
|
4093
3130
|
if (excludeId && idColumn) {
|
|
4094
3131
|
conditions.push(sql`${idColumn} != ${excludeId}`);
|
|
4095
3132
|
}
|
|
@@ -4164,7 +3201,7 @@ class DrizzleConditionBuilder {
|
|
|
4164
3201
|
if (currentTable !== parentTable) {
|
|
4165
3202
|
throw new Error("Join path did not result in connecting to parent table");
|
|
4166
3203
|
}
|
|
4167
|
-
const allConditions = [eq
|
|
3204
|
+
const allConditions = [eq(parentIdColumn, parentEntityId)];
|
|
4168
3205
|
if (additionalFilters) {
|
|
4169
3206
|
allConditions.push(...additionalFilters);
|
|
4170
3207
|
}
|
|
@@ -4186,11 +3223,11 @@ class DrizzleConditionBuilder {
|
|
|
4186
3223
|
if (!junctionTargetCol) {
|
|
4187
3224
|
throw new Error(`Target column '${through.targetColumn}' not found in junction table '${through.table}'`);
|
|
4188
3225
|
}
|
|
4189
|
-
const baseConditions = [eq
|
|
3226
|
+
const baseConditions = [eq(junctionSourceCol, parentEntityId)];
|
|
4190
3227
|
if (additionalFilters && additionalFilters.length > 0) {
|
|
4191
3228
|
baseConditions.push(...additionalFilters);
|
|
4192
3229
|
}
|
|
4193
|
-
return baseCountQuery.innerJoin(junctionTable, eq
|
|
3230
|
+
return baseCountQuery.innerJoin(junctionTable, eq(targetIdColumn, junctionTargetCol)).where(and(...baseConditions));
|
|
4194
3231
|
}
|
|
4195
3232
|
/**
|
|
4196
3233
|
* Build inverse junction table conditions for count queries
|
|
@@ -4208,11 +3245,11 @@ class DrizzleConditionBuilder {
|
|
|
4208
3245
|
if (!junctionTargetCol) {
|
|
4209
3246
|
throw new Error(`Target column '${through.targetColumn}' not found in junction table '${through.table}'`);
|
|
4210
3247
|
}
|
|
4211
|
-
const baseConditions = [eq
|
|
3248
|
+
const baseConditions = [eq(junctionSourceCol, parentEntityId)];
|
|
4212
3249
|
if (additionalFilters && additionalFilters.length > 0) {
|
|
4213
3250
|
baseConditions.push(...additionalFilters);
|
|
4214
3251
|
}
|
|
4215
|
-
return baseCountQuery.innerJoin(junctionTable, eq
|
|
3252
|
+
return baseCountQuery.innerJoin(junctionTable, eq(targetIdColumn, junctionTargetCol)).where(and(...baseConditions));
|
|
4216
3253
|
}
|
|
4217
3254
|
/**
|
|
4218
3255
|
* Helper method to extract table names from columns
|
|
@@ -4604,7 +3641,7 @@ async function parseDataFromServer(data, collection, db, registry) {
|
|
|
4604
3641
|
if (targetTable && currentEntityId) {
|
|
4605
3642
|
const foreignKeyColumn = targetTable[relation.foreignKeyOnTarget];
|
|
4606
3643
|
if (foreignKeyColumn) {
|
|
4607
|
-
const relatedEntities = await db.select().from(targetTable).where(eq
|
|
3644
|
+
const relatedEntities = await db.select().from(targetTable).where(eq(foreignKeyColumn, currentEntityId)).limit(relation.cardinality === "one" ? 1 : 100);
|
|
4608
3645
|
if (relatedEntities.length > 0) {
|
|
4609
3646
|
if (relation.cardinality === "one") {
|
|
4610
3647
|
const targetPks = getPrimaryKeys(targetCollection, registry);
|
|
@@ -4651,12 +3688,12 @@ async function parseDataFromServer(data, collection, db, registry) {
|
|
|
4651
3688
|
console.warn(`Join columns not found: ${fromColumn} -> ${toColumn}`);
|
|
4652
3689
|
break;
|
|
4653
3690
|
}
|
|
4654
|
-
query = query.innerJoin(joinTable, eq
|
|
3691
|
+
query = query.innerJoin(joinTable, eq(fromCol, toCol));
|
|
4655
3692
|
currentTable = joinTable;
|
|
4656
3693
|
}
|
|
4657
3694
|
if (pks.length === 1) {
|
|
4658
3695
|
const sourceIdField = sourceTable[pks[0].fieldName];
|
|
4659
|
-
query = query.where(eq
|
|
3696
|
+
query = query.where(eq(sourceIdField, currentEntityId));
|
|
4660
3697
|
} else {
|
|
4661
3698
|
console.warn(`Join path resolution for composite primary keys is not yet fully supported: ${collection.slug}`);
|
|
4662
3699
|
}
|
|
@@ -4664,7 +3701,7 @@ async function parseDataFromServer(data, collection, db, registry) {
|
|
|
4664
3701
|
let combinedWhere;
|
|
4665
3702
|
if (pks.length === 1) {
|
|
4666
3703
|
const sourceIdField = sourceTable[pks[0].fieldName];
|
|
4667
|
-
combinedWhere = DrizzleConditionBuilder.combineConditionsWithAnd([eq
|
|
3704
|
+
combinedWhere = DrizzleConditionBuilder.combineConditionsWithAnd([eq(sourceIdField, currentEntityId), ...additionalFilters].filter(Boolean));
|
|
4668
3705
|
}
|
|
4669
3706
|
const joinResults = await query.where(combinedWhere).limit(relation.cardinality === "one" ? 1 : 100);
|
|
4670
3707
|
if (joinResults.length > 0) {
|
|
@@ -4698,16 +3735,16 @@ function parsePropertyFromServer(value, property, collection, propertyKey) {
|
|
|
4698
3735
|
switch (property.type) {
|
|
4699
3736
|
case "string": {
|
|
4700
3737
|
if (typeof value === "string") return value;
|
|
4701
|
-
let
|
|
3738
|
+
let isBuffer = false;
|
|
4702
3739
|
let buf = null;
|
|
4703
3740
|
if (Buffer.isBuffer(value)) {
|
|
4704
|
-
|
|
3741
|
+
isBuffer = true;
|
|
4705
3742
|
buf = value;
|
|
4706
3743
|
} else if (typeof value === "object" && value !== null && value.type === "Buffer" && Array.isArray(value.data)) {
|
|
4707
|
-
|
|
3744
|
+
isBuffer = true;
|
|
4708
3745
|
buf = Buffer.from(value.data);
|
|
4709
3746
|
}
|
|
4710
|
-
if (
|
|
3747
|
+
if (isBuffer && buf) {
|
|
4711
3748
|
let isPrintable = true;
|
|
4712
3749
|
for (let i = 0; i < buf.length; i++) {
|
|
4713
3750
|
const b = buf[i];
|
|
@@ -4811,16 +3848,16 @@ function parsePropertyFromServer(value, property, collection, propertyKey) {
|
|
|
4811
3848
|
return null;
|
|
4812
3849
|
}
|
|
4813
3850
|
default: {
|
|
4814
|
-
let
|
|
3851
|
+
let isBuffer = false;
|
|
4815
3852
|
let buf = null;
|
|
4816
3853
|
if (Buffer.isBuffer(value)) {
|
|
4817
|
-
|
|
3854
|
+
isBuffer = true;
|
|
4818
3855
|
buf = value;
|
|
4819
3856
|
} else if (typeof value === "object" && value !== null && value.type === "Buffer" && Array.isArray(value.data)) {
|
|
4820
|
-
|
|
3857
|
+
isBuffer = true;
|
|
4821
3858
|
buf = Buffer.from(value.data);
|
|
4822
3859
|
}
|
|
4823
|
-
if (
|
|
3860
|
+
if (isBuffer && buf) {
|
|
4824
3861
|
let isPrintable = true;
|
|
4825
3862
|
for (let i = 0; i < buf.length; i++) {
|
|
4826
3863
|
const b = buf[i];
|
|
@@ -4915,11 +3952,11 @@ class RelationService {
|
|
|
4915
3952
|
if (!fromCol || !toCol) {
|
|
4916
3953
|
throw new Error(`Join columns not found: ${fromColumn} -> ${toColumn}`);
|
|
4917
3954
|
}
|
|
4918
|
-
query2 = query2.innerJoin(joinTable, eq
|
|
3955
|
+
query2 = query2.innerJoin(joinTable, eq(fromCol, toCol));
|
|
4919
3956
|
currentTable = joinTable;
|
|
4920
3957
|
}
|
|
4921
3958
|
const parentIdField = parentTable[getPrimaryKeys(parentCollection, this.registry)[0].fieldName];
|
|
4922
|
-
query2 = query2.where(eq
|
|
3959
|
+
query2 = query2.where(eq(parentIdField, parsedParentId));
|
|
4923
3960
|
if (options.limit) {
|
|
4924
3961
|
query2 = query2.limit(options.limit);
|
|
4925
3962
|
}
|
|
@@ -5038,7 +4075,7 @@ class RelationService {
|
|
|
5038
4075
|
if (!fromCol || !toCol) {
|
|
5039
4076
|
throw new Error(`Join columns not found: ${fromColumn} -> ${toColumn}`);
|
|
5040
4077
|
}
|
|
5041
|
-
query2 = query2.innerJoin(joinTable, eq
|
|
4078
|
+
query2 = query2.innerJoin(joinTable, eq(fromCol, toCol));
|
|
5042
4079
|
currentTable = joinTable;
|
|
5043
4080
|
}
|
|
5044
4081
|
const parentIdField = parentTable[getPrimaryKeys(parentCollection, this.registry)[0].fieldName];
|
|
@@ -5169,7 +4206,7 @@ class RelationService {
|
|
|
5169
4206
|
const fromCol = currentTable[fromColName];
|
|
5170
4207
|
const toCol = joinTable[toColName];
|
|
5171
4208
|
if (!fromCol || !toCol) throw new Error(`Join columns not found: ${fromColumn} -> ${toColumn}`);
|
|
5172
|
-
query2 = query2.innerJoin(joinTable, eq
|
|
4209
|
+
query2 = query2.innerJoin(joinTable, eq(fromCol, toCol));
|
|
5173
4210
|
currentTable = joinTable;
|
|
5174
4211
|
}
|
|
5175
4212
|
const parentIdField = parentTable[getPrimaryKeys(parentCollection, this.registry)[0].fieldName];
|
|
@@ -5204,7 +4241,7 @@ class RelationService {
|
|
|
5204
4241
|
console.warn(`[batchFetchRelatedEntitiesMany] Junction columns not found in '${relation.through.table}'`);
|
|
5205
4242
|
return /* @__PURE__ */ new Map();
|
|
5206
4243
|
}
|
|
5207
|
-
const query2 = this.db.select().from(junctionTable).innerJoin(targetTable, eq
|
|
4244
|
+
const query2 = this.db.select().from(junctionTable).innerJoin(targetTable, eq(targetJunctionCol, targetIdField)).where(inArray(sourceJunctionCol, parsedParentIds));
|
|
5208
4245
|
const results2 = await query2;
|
|
5209
4246
|
const resultMap2 = /* @__PURE__ */ new Map();
|
|
5210
4247
|
const targetTableName = getTableName(targetCollection);
|
|
@@ -5302,7 +4339,7 @@ class RelationService {
|
|
|
5302
4339
|
const parentIdInfo = parentPks[0];
|
|
5303
4340
|
const parsedParentIdObj = parseIdValues(entityId, parentPks);
|
|
5304
4341
|
const parsedParentId = parsedParentIdObj[parentIdInfo.fieldName];
|
|
5305
|
-
await tx.delete(junctionTable).where(eq
|
|
4342
|
+
await tx.delete(junctionTable).where(eq(sourceJunctionColumn, parsedParentId));
|
|
5306
4343
|
if (targetEntityIds.length > 0) {
|
|
5307
4344
|
const targetPks = getPrimaryKeys(targetCollection, this.registry);
|
|
5308
4345
|
const targetIdInfo = targetPks[0];
|
|
@@ -5331,7 +4368,7 @@ class RelationService {
|
|
|
5331
4368
|
const parentIdInfo = parentPks[0];
|
|
5332
4369
|
const parsedParentIdObj = parseIdValues(entityId, parentPks);
|
|
5333
4370
|
const parsedParentId = parsedParentIdObj[parentIdInfo.fieldName];
|
|
5334
|
-
await tx.delete(junctionTable).where(eq
|
|
4371
|
+
await tx.delete(junctionTable).where(eq(sourceJunctionColumn, parsedParentId));
|
|
5335
4372
|
if (targetEntityIds.length > 0) {
|
|
5336
4373
|
const targetPks = getPrimaryKeys(targetCollection, this.registry);
|
|
5337
4374
|
const targetIdInfo = targetPks[0];
|
|
@@ -5364,14 +4401,14 @@ class RelationService {
|
|
|
5364
4401
|
const parsedTargetIds = targetEntityIds.map((id) => parseIdValues(id, targetPks)[targetIdInfo.fieldName]);
|
|
5365
4402
|
await tx.update(targetTable).set({
|
|
5366
4403
|
[relation.foreignKeyOnTarget]: null
|
|
5367
|
-
}).where(and(eq
|
|
4404
|
+
}).where(and(eq(fkCol, parsedParentId), sql`${targetIdCol} NOT IN (${sql.join(parsedTargetIds)})`));
|
|
5368
4405
|
await tx.update(targetTable).set({
|
|
5369
4406
|
[relation.foreignKeyOnTarget]: parsedParentId
|
|
5370
4407
|
}).where(inArray(targetIdCol, parsedTargetIds));
|
|
5371
4408
|
} else {
|
|
5372
4409
|
await tx.update(targetTable).set({
|
|
5373
4410
|
[relation.foreignKeyOnTarget]: null
|
|
5374
|
-
}).where(eq
|
|
4411
|
+
}).where(eq(fkCol, parsedParentId));
|
|
5375
4412
|
}
|
|
5376
4413
|
} else {
|
|
5377
4414
|
console.warn(`Many relation '${key}' in collection '${collection.slug}' lacks write configuration and will be skipped during save.`);
|
|
@@ -5430,17 +4467,17 @@ class RelationService {
|
|
|
5430
4467
|
if (newValue === null || newValue === void 0) {
|
|
5431
4468
|
await tx.update(targetTable).set({
|
|
5432
4469
|
[relation.foreignKeyOnTarget]: null
|
|
5433
|
-
}).where(eq
|
|
4470
|
+
}).where(eq(foreignKeyColumn, parsedSourceId));
|
|
5434
4471
|
} else {
|
|
5435
4472
|
const parsedNewTargetIdObj = parseIdValues(newValue, targetPks);
|
|
5436
4473
|
const parsedNewTargetId = parsedNewTargetIdObj[targetIdInfo.fieldName];
|
|
5437
4474
|
const targetIdField = targetTable[targetIdInfo.fieldName];
|
|
5438
4475
|
await tx.update(targetTable).set({
|
|
5439
4476
|
[relation.foreignKeyOnTarget]: null
|
|
5440
|
-
}).where(eq
|
|
4477
|
+
}).where(eq(foreignKeyColumn, parsedSourceId));
|
|
5441
4478
|
await tx.update(targetTable).set({
|
|
5442
4479
|
[relation.foreignKeyOnTarget]: parsedSourceId
|
|
5443
|
-
}).where(eq
|
|
4480
|
+
}).where(eq(targetIdField, parsedNewTargetId));
|
|
5444
4481
|
}
|
|
5445
4482
|
} catch (e) {
|
|
5446
4483
|
console.warn(`Failed to update inverse relation '${relation.relationName}':`, e);
|
|
@@ -5495,7 +4532,7 @@ class RelationService {
|
|
|
5495
4532
|
const sourceIdInfo = sourcePks[0];
|
|
5496
4533
|
const parsedSourceIdObj = parseIdValues(sourceEntityId, sourcePks);
|
|
5497
4534
|
const parsedSourceId = parsedSourceIdObj[sourceIdInfo.fieldName];
|
|
5498
|
-
await tx.delete(junctionTable).where(eq
|
|
4535
|
+
await tx.delete(junctionTable).where(eq(sourceJunctionColumn, parsedSourceId));
|
|
5499
4536
|
if (newValue && Array.isArray(newValue) && newValue.length > 0) {
|
|
5500
4537
|
const targetPks = getPrimaryKeys(targetCollection, this.registry);
|
|
5501
4538
|
const targetIdInfo = targetPks[0];
|
|
@@ -5546,7 +4583,7 @@ class RelationService {
|
|
|
5546
4583
|
const sourceIdInfo = sourcePks[0];
|
|
5547
4584
|
const parsedSourceIdObj = parseIdValues(sourceEntityId, sourcePks);
|
|
5548
4585
|
const parsedSourceId = parsedSourceIdObj[sourceIdInfo.fieldName];
|
|
5549
|
-
await tx.delete(junctionTable).where(eq
|
|
4586
|
+
await tx.delete(junctionTable).where(eq(sourceJunctionColumn, parsedSourceId));
|
|
5550
4587
|
if (newValue && Array.isArray(newValue) && newValue.length > 0) {
|
|
5551
4588
|
const targetPks = getPrimaryKeys(targetCollection, this.registry);
|
|
5552
4589
|
const targetIdInfo = targetPks[0];
|
|
@@ -5601,14 +4638,14 @@ class RelationService {
|
|
|
5601
4638
|
}
|
|
5602
4639
|
const parentRows = await tx.select({
|
|
5603
4640
|
val: parentSourceCol
|
|
5604
|
-
}).from(parentTable).where(eq
|
|
4641
|
+
}).from(parentTable).where(eq(parentIdCol, parsedParentId)).limit(1);
|
|
5605
4642
|
if (parentRows.length === 0) continue;
|
|
5606
4643
|
const parentFKValue = parentRows[0].val;
|
|
5607
4644
|
if (newTargetId === null || newTargetId === void 0) {
|
|
5608
4645
|
if (parentFKValue !== null && parentFKValue !== void 0) {
|
|
5609
4646
|
await tx.update(targetTable).set({
|
|
5610
4647
|
[targetFKColName]: null
|
|
5611
|
-
}).where(eq
|
|
4648
|
+
}).where(eq(targetFKCol, parentFKValue));
|
|
5612
4649
|
}
|
|
5613
4650
|
continue;
|
|
5614
4651
|
}
|
|
@@ -5617,14 +4654,14 @@ class RelationService {
|
|
|
5617
4654
|
if (parentFKValue !== null && parentFKValue !== void 0) {
|
|
5618
4655
|
await tx.update(targetTable).set({
|
|
5619
4656
|
[targetFKColName]: null
|
|
5620
|
-
}).where(eq
|
|
4657
|
+
}).where(eq(targetFKCol, parentFKValue));
|
|
5621
4658
|
} else {
|
|
5622
4659
|
console.warn(`Cannot set joinPath relation '${relation.relationName}' because parent FK value is null/undefined`);
|
|
5623
4660
|
continue;
|
|
5624
4661
|
}
|
|
5625
4662
|
await tx.update(targetTable).set({
|
|
5626
4663
|
[targetFKColName]: parentFKValue
|
|
5627
|
-
}).where(eq
|
|
4664
|
+
}).where(eq(targetIdCol, parsedTargetId));
|
|
5628
4665
|
}
|
|
5629
4666
|
}
|
|
5630
4667
|
/**
|
|
@@ -6009,7 +5046,7 @@ class EntityFetchService {
|
|
|
6009
5046
|
const collection = getCollectionByPath(collectionPath, this.registry);
|
|
6010
5047
|
const searchConditions = DrizzleConditionBuilder.buildSearchConditions(options.searchString, collection.properties, table);
|
|
6011
5048
|
if (searchConditions.length === 0) {
|
|
6012
|
-
queryOpts.where = and(eq
|
|
5049
|
+
queryOpts.where = and(eq(idField, -99999999));
|
|
6013
5050
|
return queryOpts;
|
|
6014
5051
|
}
|
|
6015
5052
|
allConditions.push(DrizzleConditionBuilder.combineConditionsWithOr(searchConditions));
|
|
@@ -6056,9 +5093,9 @@ class EntityFetchService {
|
|
|
6056
5093
|
const startAfterId = cursor.id ?? cursor[idInfo.fieldName];
|
|
6057
5094
|
if (startAfterOrderValue !== void 0 && startAfterId !== void 0) {
|
|
6058
5095
|
if (options.order === "asc") {
|
|
6059
|
-
return [or(gt(orderByField, startAfterOrderValue), and(eq
|
|
5096
|
+
return [or(gt(orderByField, startAfterOrderValue), and(eq(orderByField, startAfterOrderValue), gt(idField, startAfterId)))];
|
|
6060
5097
|
} else {
|
|
6061
|
-
return [or(lt(orderByField, startAfterOrderValue), and(eq
|
|
5098
|
+
return [or(lt(orderByField, startAfterOrderValue), and(eq(orderByField, startAfterOrderValue), lt(idField, startAfterId)))];
|
|
6062
5099
|
}
|
|
6063
5100
|
}
|
|
6064
5101
|
}
|
|
@@ -6092,7 +5129,7 @@ class EntityFetchService {
|
|
|
6092
5129
|
try {
|
|
6093
5130
|
const withConfig = this.buildWithConfig(collection);
|
|
6094
5131
|
const row = await qb.findFirst({
|
|
6095
|
-
where: eq
|
|
5132
|
+
where: eq(idField, parsedId),
|
|
6096
5133
|
with: withConfig
|
|
6097
5134
|
});
|
|
6098
5135
|
if (!row) return void 0;
|
|
@@ -6107,7 +5144,7 @@ class EntityFetchService {
|
|
|
6107
5144
|
console.warn(`[EntityFetchService] db.query.findFirst failed for ${collectionPath}, falling back to db.select:`, e);
|
|
6108
5145
|
}
|
|
6109
5146
|
}
|
|
6110
|
-
const result = await this.db.select().from(table).where(eq
|
|
5147
|
+
const result = await this.db.select().from(table).where(eq(idField, parsedId)).limit(1);
|
|
6111
5148
|
if (result.length === 0) return void 0;
|
|
6112
5149
|
const raw = result[0];
|
|
6113
5150
|
const values = await parseDataFromServer(raw, collection, this.db, this.registry);
|
|
@@ -6511,7 +5548,7 @@ class EntityFetchService {
|
|
|
6511
5548
|
try {
|
|
6512
5549
|
const withConfig = include && include.length > 0 ? this.buildWithConfig(collection, include) : void 0;
|
|
6513
5550
|
const row = await qb.findFirst({
|
|
6514
|
-
where: eq
|
|
5551
|
+
where: eq(idField, parsedId),
|
|
6515
5552
|
...withConfig ? {
|
|
6516
5553
|
with: withConfig
|
|
6517
5554
|
} : {}
|
|
@@ -6528,7 +5565,7 @@ class EntityFetchService {
|
|
|
6528
5565
|
console.warn(`[fetchEntityForRest] db.query.findFirst failed for ${collectionPath}, falling back:`, e);
|
|
6529
5566
|
}
|
|
6530
5567
|
}
|
|
6531
|
-
const result = await this.db.select().from(table).where(eq
|
|
5568
|
+
const result = await this.db.select().from(table).where(eq(idField, parsedId)).limit(1);
|
|
6532
5569
|
if (result.length === 0) return null;
|
|
6533
5570
|
const raw = result[0];
|
|
6534
5571
|
const flatEntity = {
|
|
@@ -6737,7 +5774,7 @@ class EntityPersistService {
|
|
|
6737
5774
|
}
|
|
6738
5775
|
const parsedIdObj = parseIdValues(entityId, idInfoArray);
|
|
6739
5776
|
const parsedId = parsedIdObj[idInfo.fieldName];
|
|
6740
|
-
await this.db.delete(table).where(eq
|
|
5777
|
+
await this.db.delete(table).where(eq(idField, parsedId));
|
|
6741
5778
|
}
|
|
6742
5779
|
/**
|
|
6743
5780
|
* Save an entity (create or update)
|
|
@@ -6861,7 +5898,7 @@ class EntityPersistService {
|
|
|
6861
5898
|
const conditions = [];
|
|
6862
5899
|
for (const info of idInfoArray) {
|
|
6863
5900
|
const field = table[info.fieldName];
|
|
6864
|
-
conditions.push(eq
|
|
5901
|
+
conditions.push(eq(field, idValues[info.fieldName]));
|
|
6865
5902
|
}
|
|
6866
5903
|
await updateQuery.where(and(...conditions));
|
|
6867
5904
|
}
|
|
@@ -10628,11 +9665,11 @@ class UserService {
|
|
|
10628
9665
|
return user;
|
|
10629
9666
|
}
|
|
10630
9667
|
async getUserById(id) {
|
|
10631
|
-
const [user] = await this.db.select().from(users).where(eq
|
|
9668
|
+
const [user] = await this.db.select().from(users).where(eq(users.id, id));
|
|
10632
9669
|
return user || null;
|
|
10633
9670
|
}
|
|
10634
9671
|
async getUserByEmail(email) {
|
|
10635
|
-
const [user] = await this.db.select().from(users).where(eq
|
|
9672
|
+
const [user] = await this.db.select().from(users).where(eq(users.email, email.toLowerCase()));
|
|
10636
9673
|
return user || null;
|
|
10637
9674
|
}
|
|
10638
9675
|
async getUserByIdentity(provider, providerId) {
|
|
@@ -10688,11 +9725,11 @@ class UserService {
|
|
|
10688
9725
|
const [user] = await this.db.update(users).set({
|
|
10689
9726
|
...data,
|
|
10690
9727
|
updatedAt: /* @__PURE__ */ new Date()
|
|
10691
|
-
}).where(eq
|
|
9728
|
+
}).where(eq(users.id, id)).returning();
|
|
10692
9729
|
return user || null;
|
|
10693
9730
|
}
|
|
10694
9731
|
async deleteUser(id) {
|
|
10695
|
-
await this.db.delete(users).where(eq
|
|
9732
|
+
await this.db.delete(users).where(eq(users.id, id));
|
|
10696
9733
|
}
|
|
10697
9734
|
async listUsers() {
|
|
10698
9735
|
return this.db.select().from(users);
|
|
@@ -10761,7 +9798,7 @@ class UserService {
|
|
|
10761
9798
|
await this.db.update(users).set({
|
|
10762
9799
|
passwordHash,
|
|
10763
9800
|
updatedAt: /* @__PURE__ */ new Date()
|
|
10764
|
-
}).where(eq
|
|
9801
|
+
}).where(eq(users.id, id));
|
|
10765
9802
|
}
|
|
10766
9803
|
/**
|
|
10767
9804
|
* Set email verification status
|
|
@@ -10771,7 +9808,7 @@ class UserService {
|
|
|
10771
9808
|
emailVerified: verified,
|
|
10772
9809
|
emailVerificationToken: null,
|
|
10773
9810
|
updatedAt: /* @__PURE__ */ new Date()
|
|
10774
|
-
}).where(eq
|
|
9811
|
+
}).where(eq(users.id, id));
|
|
10775
9812
|
}
|
|
10776
9813
|
/**
|
|
10777
9814
|
* Set email verification token
|
|
@@ -10781,13 +9818,13 @@ class UserService {
|
|
|
10781
9818
|
emailVerificationToken: token,
|
|
10782
9819
|
emailVerificationSentAt: token ? /* @__PURE__ */ new Date() : null,
|
|
10783
9820
|
updatedAt: /* @__PURE__ */ new Date()
|
|
10784
|
-
}).where(eq
|
|
9821
|
+
}).where(eq(users.id, id));
|
|
10785
9822
|
}
|
|
10786
9823
|
/**
|
|
10787
9824
|
* Find user by email verification token
|
|
10788
9825
|
*/
|
|
10789
9826
|
async getUserByVerificationToken(token) {
|
|
10790
|
-
const [user] = await this.db.select().from(users).where(eq
|
|
9827
|
+
const [user] = await this.db.select().from(users).where(eq(users.emailVerificationToken, token));
|
|
10791
9828
|
return user || null;
|
|
10792
9829
|
}
|
|
10793
9830
|
/**
|
|
@@ -10960,14 +9997,14 @@ class RefreshTokenService {
|
|
|
10960
9997
|
createdAt: refreshTokens.createdAt,
|
|
10961
9998
|
userAgent: refreshTokens.userAgent,
|
|
10962
9999
|
ipAddress: refreshTokens.ipAddress
|
|
10963
|
-
}).from(refreshTokens).where(eq
|
|
10000
|
+
}).from(refreshTokens).where(eq(refreshTokens.tokenHash, tokenHash));
|
|
10964
10001
|
return token || null;
|
|
10965
10002
|
}
|
|
10966
10003
|
async deleteByHash(tokenHash) {
|
|
10967
|
-
await this.db.delete(refreshTokens).where(eq
|
|
10004
|
+
await this.db.delete(refreshTokens).where(eq(refreshTokens.tokenHash, tokenHash));
|
|
10968
10005
|
}
|
|
10969
10006
|
async deleteAllForUser(userId) {
|
|
10970
|
-
await this.db.delete(refreshTokens).where(eq
|
|
10007
|
+
await this.db.delete(refreshTokens).where(eq(refreshTokens.userId, userId));
|
|
10971
10008
|
}
|
|
10972
10009
|
async listForUser(userId) {
|
|
10973
10010
|
const tokens = await this.db.select({
|
|
@@ -10978,7 +10015,7 @@ class RefreshTokenService {
|
|
|
10978
10015
|
createdAt: refreshTokens.createdAt,
|
|
10979
10016
|
userAgent: refreshTokens.userAgent,
|
|
10980
10017
|
ipAddress: refreshTokens.ipAddress
|
|
10981
|
-
}).from(refreshTokens).where(eq
|
|
10018
|
+
}).from(refreshTokens).where(eq(refreshTokens.userId, userId)).orderBy(refreshTokens.createdAt);
|
|
10982
10019
|
return tokens;
|
|
10983
10020
|
}
|
|
10984
10021
|
async deleteById(id, userId) {
|
|
@@ -11010,7 +10047,7 @@ class PasswordResetTokenService {
|
|
|
11010
10047
|
const [token] = await this.db.select({
|
|
11011
10048
|
userId: passwordResetTokens.userId,
|
|
11012
10049
|
expiresAt: passwordResetTokens.expiresAt
|
|
11013
|
-
}).from(passwordResetTokens).where(eq
|
|
10050
|
+
}).from(passwordResetTokens).where(eq(passwordResetTokens.tokenHash, tokenHash));
|
|
11014
10051
|
if (!token) return null;
|
|
11015
10052
|
const result = await this.db.execute(sql`
|
|
11016
10053
|
SELECT user_id, expires_at
|
|
@@ -11032,13 +10069,13 @@ class PasswordResetTokenService {
|
|
|
11032
10069
|
async markAsUsed(tokenHash) {
|
|
11033
10070
|
await this.db.update(passwordResetTokens).set({
|
|
11034
10071
|
usedAt: /* @__PURE__ */ new Date()
|
|
11035
|
-
}).where(eq
|
|
10072
|
+
}).where(eq(passwordResetTokens.tokenHash, tokenHash));
|
|
11036
10073
|
}
|
|
11037
10074
|
/**
|
|
11038
10075
|
* Delete all tokens for a user
|
|
11039
10076
|
*/
|
|
11040
10077
|
async deleteAllForUser(userId) {
|
|
11041
|
-
await this.db.delete(passwordResetTokens).where(eq
|
|
10078
|
+
await this.db.delete(passwordResetTokens).where(eq(passwordResetTokens.userId, userId));
|
|
11042
10079
|
}
|
|
11043
10080
|
/**
|
|
11044
10081
|
* Clean up expired tokens
|