@cloudnux/local-cloud-provider 0.19.0 → 0.21.0
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/dev-console-plugin/index.d.ts +6 -0
- package/dist/dev-console-plugin/index.js +1048 -16
- package/dist/dev-console-plugin/index.js.map +1 -1
- package/dist/index.js +192 -177
- package/dist/index.js.map +1 -1
- package/dist/queue-plugin/index.d.ts +7 -0
- package/dist/queue-plugin/index.js +37 -2
- package/dist/queue-plugin/index.js.map +1 -1
- package/dist/schedule-plugin/index.js +1 -1
- package/dist/schedule-plugin/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/dev-console-plugin/plugin.ts
|
|
2
|
-
import
|
|
2
|
+
import path4 from "path";
|
|
3
3
|
import fastifyStatic from "@fastify/static";
|
|
4
4
|
import fsPlugin4 from "fastify-plugin";
|
|
5
5
|
import { createRequire } from "module";
|
|
@@ -20,7 +20,7 @@ var DEFAULT_CONFIG = {
|
|
|
20
20
|
tickIntervalMs: 50,
|
|
21
21
|
persistence: {
|
|
22
22
|
enabled: true,
|
|
23
|
-
directory: "./.develop
|
|
23
|
+
directory: "./.develop/.queue-data",
|
|
24
24
|
saveInterval: 6e4,
|
|
25
25
|
saveOnShutdown: false
|
|
26
26
|
}
|
|
@@ -502,6 +502,26 @@ var purgeDlq = async (runtime, queueName) => {
|
|
|
502
502
|
var getMessageHistory = (runtime, queueName, limit = 50) => {
|
|
503
503
|
return runtime.messageHistory.filter((entry) => entry.queueName === queueName).slice(-limit).reverse();
|
|
504
504
|
};
|
|
505
|
+
var subscribeTopic = (runtime, topicName, queueName) => {
|
|
506
|
+
const subscribers = runtime.topics[topicName] ?? (runtime.topics[topicName] = []);
|
|
507
|
+
if (!subscribers.includes(queueName)) {
|
|
508
|
+
subscribers.push(queueName);
|
|
509
|
+
}
|
|
510
|
+
runtime.logging.info({ topicName, queueName }, `Subscribed queue '${queueName}' to topic '${topicName}'`);
|
|
511
|
+
};
|
|
512
|
+
var publishTopic = async (runtime, topicName, body, attributes) => {
|
|
513
|
+
const subscribers = runtime.topics[topicName];
|
|
514
|
+
if (!subscribers || subscribers.length === 0) {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
const results = await Promise.all(
|
|
518
|
+
subscribers.map((queueName) => enqueueMessage(runtime, queueName, body, attributes))
|
|
519
|
+
);
|
|
520
|
+
return results.filter((result) => result !== null);
|
|
521
|
+
};
|
|
522
|
+
var listTopics = (runtime) => {
|
|
523
|
+
return Object.fromEntries(Object.entries(runtime.topics).map(([name, queues]) => [name, [...queues]]));
|
|
524
|
+
};
|
|
505
525
|
var createQueueManager = (runtime) => ({
|
|
506
526
|
addQueue: (queueName, handler, module) => addQueue(runtime, queueName, handler, module),
|
|
507
527
|
removeQueue: (queueName) => removeQueue(runtime, queueName),
|
|
@@ -515,7 +535,10 @@ var createQueueManager = (runtime) => ({
|
|
|
515
535
|
enqueueMessage: (queueName, body, attributes) => enqueueMessage(runtime, queueName, body, attributes),
|
|
516
536
|
processDlq: (queueName) => processDlq(runtime, queueName),
|
|
517
537
|
purgeDlq: (queueName) => purgeDlq(runtime, queueName),
|
|
518
|
-
getMessageHistory: (queueName, limit) => getMessageHistory(runtime, queueName, limit)
|
|
538
|
+
getMessageHistory: (queueName, limit) => getMessageHistory(runtime, queueName, limit),
|
|
539
|
+
subscribeTopic: (topicName, queueName) => subscribeTopic(runtime, topicName, queueName),
|
|
540
|
+
publishTopic: (topicName, body, attributes) => publishTopic(runtime, topicName, body, attributes),
|
|
541
|
+
listTopics: () => listTopics(runtime)
|
|
519
542
|
});
|
|
520
543
|
|
|
521
544
|
// src/queue-plugin/routes.ts
|
|
@@ -549,6 +572,17 @@ var registerQueueRoutes = (app, prefix = "") => {
|
|
|
549
572
|
return reply.status(200).send(result);
|
|
550
573
|
}
|
|
551
574
|
);
|
|
575
|
+
app.post(
|
|
576
|
+
`/${prefix}/topics/:topic`,
|
|
577
|
+
async (request, reply) => {
|
|
578
|
+
const topicName = request.params.topic;
|
|
579
|
+
const results = await app.queues.publishTopic(topicName, request.body, request.headers);
|
|
580
|
+
if (results === null) {
|
|
581
|
+
return reply.status(404).send({ error: "Topic not found" });
|
|
582
|
+
}
|
|
583
|
+
return reply.status(200).send({ topicName, results });
|
|
584
|
+
}
|
|
585
|
+
);
|
|
552
586
|
app.get(
|
|
553
587
|
`/${prefix}/:queue/process-dlq`,
|
|
554
588
|
async (request, reply) => {
|
|
@@ -578,6 +612,7 @@ var queuesPlugin = fsPlugin(async (app, options) => {
|
|
|
578
612
|
const runtime = {
|
|
579
613
|
config: mergeConfig(DEFAULT_CONFIG, options.config),
|
|
580
614
|
queues: {},
|
|
615
|
+
topics: {},
|
|
581
616
|
dirtyQueues: /* @__PURE__ */ new Set(),
|
|
582
617
|
lastSavedAt: Date.now(),
|
|
583
618
|
messageHistory: [],
|
|
@@ -936,7 +971,7 @@ var DEFAULT_CONFIG2 = {
|
|
|
936
971
|
tickIntervalMs: 1e3,
|
|
937
972
|
persistence: {
|
|
938
973
|
enabled: true,
|
|
939
|
-
directory: "./.develop
|
|
974
|
+
directory: "./.develop/.scheduler-data",
|
|
940
975
|
saveInterval: 3e4,
|
|
941
976
|
// 30 seconds
|
|
942
977
|
saveOnShutdown: false
|
|
@@ -1573,16 +1608,16 @@ var websocketsPlugin = fsPlugin3(async (app, options) => {
|
|
|
1573
1608
|
const registeredPaths = /* @__PURE__ */ new Set();
|
|
1574
1609
|
const pathModuleMap = /* @__PURE__ */ new Map();
|
|
1575
1610
|
await app.register(websocketPlugin);
|
|
1576
|
-
function ensureRouteForPath(
|
|
1577
|
-
if (registeredPaths.has(
|
|
1578
|
-
registeredPaths.add(
|
|
1579
|
-
app.get(
|
|
1611
|
+
function ensureRouteForPath(path5) {
|
|
1612
|
+
if (registeredPaths.has(path5)) return;
|
|
1613
|
+
registeredPaths.add(path5);
|
|
1614
|
+
app.get(path5, {
|
|
1580
1615
|
websocket: true,
|
|
1581
1616
|
preHandler: async (request, reply) => {
|
|
1582
1617
|
const connectionId = crypto.randomUUID();
|
|
1583
1618
|
request._wsConnectionId = connectionId;
|
|
1584
1619
|
const reqId = `${request.id}:${connectionId}`;
|
|
1585
|
-
const connectHandlers = handlers.filter((h) => h.path ===
|
|
1620
|
+
const connectHandlers = handlers.filter((h) => h.path === path5 && h.event === "connect");
|
|
1586
1621
|
for (const h of connectHandlers) {
|
|
1587
1622
|
await app.logging.runWithLogContext(
|
|
1588
1623
|
{ module: h.module, reqId },
|
|
@@ -1598,11 +1633,11 @@ var websocketsPlugin = fsPlugin3(async (app, options) => {
|
|
|
1598
1633
|
const connection = {
|
|
1599
1634
|
connectionId,
|
|
1600
1635
|
socket,
|
|
1601
|
-
path:
|
|
1636
|
+
path: path5,
|
|
1602
1637
|
connectedAt: /* @__PURE__ */ new Date()
|
|
1603
1638
|
};
|
|
1604
1639
|
connections.set(connectionId, connection);
|
|
1605
|
-
const pathHandlers = () => handlers.filter((h) => h.path ===
|
|
1640
|
+
const pathHandlers = () => handlers.filter((h) => h.path === path5);
|
|
1606
1641
|
socket.on("message", (raw) => {
|
|
1607
1642
|
const data = raw.toString();
|
|
1608
1643
|
const currentHandlers = pathHandlers();
|
|
@@ -1657,15 +1692,15 @@ var websocketsPlugin = fsPlugin3(async (app, options) => {
|
|
|
1657
1692
|
}
|
|
1658
1693
|
ensureRouteForPath(handler.path);
|
|
1659
1694
|
},
|
|
1660
|
-
getConnections(
|
|
1695
|
+
getConnections(path5) {
|
|
1661
1696
|
const allConnections = Array.from(connections.values());
|
|
1662
|
-
if (
|
|
1663
|
-
return allConnections.filter((c) => c.path ===
|
|
1697
|
+
if (path5) {
|
|
1698
|
+
return allConnections.filter((c) => c.path === path5);
|
|
1664
1699
|
}
|
|
1665
1700
|
return allConnections;
|
|
1666
1701
|
},
|
|
1667
1702
|
getRegisteredPaths(module) {
|
|
1668
|
-
const all = Array.from(pathModuleMap.entries()).map(([
|
|
1703
|
+
const all = Array.from(pathModuleMap.entries()).map(([path5, mod]) => ({ path: path5, module: mod }));
|
|
1669
1704
|
if (module) {
|
|
1670
1705
|
return all.filter((p) => p.module === module);
|
|
1671
1706
|
}
|
|
@@ -1728,6 +1763,904 @@ var RouteRegistry = class _RouteRegistry {
|
|
|
1728
1763
|
};
|
|
1729
1764
|
var routeRegistry = new RouteRegistry();
|
|
1730
1765
|
|
|
1766
|
+
// src/services/email.ts
|
|
1767
|
+
import * as fs3 from "fs";
|
|
1768
|
+
import * as path3 from "path";
|
|
1769
|
+
|
|
1770
|
+
// ../../../node_modules/lodash-es/_freeGlobal.js
|
|
1771
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
1772
|
+
var freeGlobal_default = freeGlobal;
|
|
1773
|
+
|
|
1774
|
+
// ../../../node_modules/lodash-es/_root.js
|
|
1775
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
1776
|
+
var root = freeGlobal_default || freeSelf || Function("return this")();
|
|
1777
|
+
var root_default = root;
|
|
1778
|
+
|
|
1779
|
+
// ../../../node_modules/lodash-es/_Symbol.js
|
|
1780
|
+
var Symbol = root_default.Symbol;
|
|
1781
|
+
var Symbol_default = Symbol;
|
|
1782
|
+
|
|
1783
|
+
// ../../../node_modules/lodash-es/_getRawTag.js
|
|
1784
|
+
var objectProto = Object.prototype;
|
|
1785
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
1786
|
+
var nativeObjectToString = objectProto.toString;
|
|
1787
|
+
var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
1788
|
+
function getRawTag(value) {
|
|
1789
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
1790
|
+
try {
|
|
1791
|
+
value[symToStringTag] = void 0;
|
|
1792
|
+
var unmasked = true;
|
|
1793
|
+
} catch (e) {
|
|
1794
|
+
}
|
|
1795
|
+
var result = nativeObjectToString.call(value);
|
|
1796
|
+
if (unmasked) {
|
|
1797
|
+
if (isOwn) {
|
|
1798
|
+
value[symToStringTag] = tag;
|
|
1799
|
+
} else {
|
|
1800
|
+
delete value[symToStringTag];
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
return result;
|
|
1804
|
+
}
|
|
1805
|
+
var getRawTag_default = getRawTag;
|
|
1806
|
+
|
|
1807
|
+
// ../../../node_modules/lodash-es/_objectToString.js
|
|
1808
|
+
var objectProto2 = Object.prototype;
|
|
1809
|
+
var nativeObjectToString2 = objectProto2.toString;
|
|
1810
|
+
function objectToString(value) {
|
|
1811
|
+
return nativeObjectToString2.call(value);
|
|
1812
|
+
}
|
|
1813
|
+
var objectToString_default = objectToString;
|
|
1814
|
+
|
|
1815
|
+
// ../../../node_modules/lodash-es/_baseGetTag.js
|
|
1816
|
+
var nullTag = "[object Null]";
|
|
1817
|
+
var undefinedTag = "[object Undefined]";
|
|
1818
|
+
var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
1819
|
+
function baseGetTag(value) {
|
|
1820
|
+
if (value == null) {
|
|
1821
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
1822
|
+
}
|
|
1823
|
+
return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
|
|
1824
|
+
}
|
|
1825
|
+
var baseGetTag_default = baseGetTag;
|
|
1826
|
+
|
|
1827
|
+
// ../../../node_modules/lodash-es/isObjectLike.js
|
|
1828
|
+
function isObjectLike(value) {
|
|
1829
|
+
return value != null && typeof value == "object";
|
|
1830
|
+
}
|
|
1831
|
+
var isObjectLike_default = isObjectLike;
|
|
1832
|
+
|
|
1833
|
+
// ../../../node_modules/lodash-es/isSymbol.js
|
|
1834
|
+
var symbolTag = "[object Symbol]";
|
|
1835
|
+
function isSymbol(value) {
|
|
1836
|
+
return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
|
|
1837
|
+
}
|
|
1838
|
+
var isSymbol_default = isSymbol;
|
|
1839
|
+
|
|
1840
|
+
// ../../../node_modules/lodash-es/_arrayMap.js
|
|
1841
|
+
function arrayMap(array2, iteratee) {
|
|
1842
|
+
var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
1843
|
+
while (++index < length) {
|
|
1844
|
+
result[index] = iteratee(array2[index], index, array2);
|
|
1845
|
+
}
|
|
1846
|
+
return result;
|
|
1847
|
+
}
|
|
1848
|
+
var arrayMap_default = arrayMap;
|
|
1849
|
+
|
|
1850
|
+
// ../../../node_modules/lodash-es/isArray.js
|
|
1851
|
+
var isArray = Array.isArray;
|
|
1852
|
+
var isArray_default = isArray;
|
|
1853
|
+
|
|
1854
|
+
// ../../../node_modules/lodash-es/_baseToString.js
|
|
1855
|
+
var INFINITY = 1 / 0;
|
|
1856
|
+
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
|
|
1857
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
1858
|
+
function baseToString(value) {
|
|
1859
|
+
if (typeof value == "string") {
|
|
1860
|
+
return value;
|
|
1861
|
+
}
|
|
1862
|
+
if (isArray_default(value)) {
|
|
1863
|
+
return arrayMap_default(value, baseToString) + "";
|
|
1864
|
+
}
|
|
1865
|
+
if (isSymbol_default(value)) {
|
|
1866
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
1867
|
+
}
|
|
1868
|
+
var result = value + "";
|
|
1869
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
1870
|
+
}
|
|
1871
|
+
var baseToString_default = baseToString;
|
|
1872
|
+
|
|
1873
|
+
// ../../../node_modules/lodash-es/_trimmedEndIndex.js
|
|
1874
|
+
var reWhitespace = /\s/;
|
|
1875
|
+
function trimmedEndIndex(string) {
|
|
1876
|
+
var index = string.length;
|
|
1877
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
1878
|
+
}
|
|
1879
|
+
return index;
|
|
1880
|
+
}
|
|
1881
|
+
var trimmedEndIndex_default = trimmedEndIndex;
|
|
1882
|
+
|
|
1883
|
+
// ../../../node_modules/lodash-es/_baseTrim.js
|
|
1884
|
+
var reTrimStart = /^\s+/;
|
|
1885
|
+
function baseTrim(string) {
|
|
1886
|
+
return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
|
|
1887
|
+
}
|
|
1888
|
+
var baseTrim_default = baseTrim;
|
|
1889
|
+
|
|
1890
|
+
// ../../../node_modules/lodash-es/isObject.js
|
|
1891
|
+
function isObject(value) {
|
|
1892
|
+
var type = typeof value;
|
|
1893
|
+
return value != null && (type == "object" || type == "function");
|
|
1894
|
+
}
|
|
1895
|
+
var isObject_default = isObject;
|
|
1896
|
+
|
|
1897
|
+
// ../../../node_modules/lodash-es/isFunction.js
|
|
1898
|
+
var asyncTag = "[object AsyncFunction]";
|
|
1899
|
+
var funcTag = "[object Function]";
|
|
1900
|
+
var genTag = "[object GeneratorFunction]";
|
|
1901
|
+
var proxyTag = "[object Proxy]";
|
|
1902
|
+
function isFunction(value) {
|
|
1903
|
+
if (!isObject_default(value)) {
|
|
1904
|
+
return false;
|
|
1905
|
+
}
|
|
1906
|
+
var tag = baseGetTag_default(value);
|
|
1907
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
1908
|
+
}
|
|
1909
|
+
var isFunction_default = isFunction;
|
|
1910
|
+
|
|
1911
|
+
// ../../../node_modules/lodash-es/_coreJsData.js
|
|
1912
|
+
var coreJsData = root_default["__core-js_shared__"];
|
|
1913
|
+
var coreJsData_default = coreJsData;
|
|
1914
|
+
|
|
1915
|
+
// ../../../node_modules/lodash-es/_isMasked.js
|
|
1916
|
+
var maskSrcKey = function() {
|
|
1917
|
+
var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
|
|
1918
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
1919
|
+
}();
|
|
1920
|
+
function isMasked(func) {
|
|
1921
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
1922
|
+
}
|
|
1923
|
+
var isMasked_default = isMasked;
|
|
1924
|
+
|
|
1925
|
+
// ../../../node_modules/lodash-es/_toSource.js
|
|
1926
|
+
var funcProto = Function.prototype;
|
|
1927
|
+
var funcToString = funcProto.toString;
|
|
1928
|
+
function toSource(func) {
|
|
1929
|
+
if (func != null) {
|
|
1930
|
+
try {
|
|
1931
|
+
return funcToString.call(func);
|
|
1932
|
+
} catch (e) {
|
|
1933
|
+
}
|
|
1934
|
+
try {
|
|
1935
|
+
return func + "";
|
|
1936
|
+
} catch (e) {
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
return "";
|
|
1940
|
+
}
|
|
1941
|
+
var toSource_default = toSource;
|
|
1942
|
+
|
|
1943
|
+
// ../../../node_modules/lodash-es/_baseIsNative.js
|
|
1944
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
1945
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
1946
|
+
var funcProto2 = Function.prototype;
|
|
1947
|
+
var objectProto3 = Object.prototype;
|
|
1948
|
+
var funcToString2 = funcProto2.toString;
|
|
1949
|
+
var hasOwnProperty2 = objectProto3.hasOwnProperty;
|
|
1950
|
+
var reIsNative = RegExp(
|
|
1951
|
+
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1952
|
+
);
|
|
1953
|
+
function baseIsNative(value) {
|
|
1954
|
+
if (!isObject_default(value) || isMasked_default(value)) {
|
|
1955
|
+
return false;
|
|
1956
|
+
}
|
|
1957
|
+
var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
|
|
1958
|
+
return pattern.test(toSource_default(value));
|
|
1959
|
+
}
|
|
1960
|
+
var baseIsNative_default = baseIsNative;
|
|
1961
|
+
|
|
1962
|
+
// ../../../node_modules/lodash-es/_getValue.js
|
|
1963
|
+
function getValue(object, key) {
|
|
1964
|
+
return object == null ? void 0 : object[key];
|
|
1965
|
+
}
|
|
1966
|
+
var getValue_default = getValue;
|
|
1967
|
+
|
|
1968
|
+
// ../../../node_modules/lodash-es/_getNative.js
|
|
1969
|
+
function getNative(object, key) {
|
|
1970
|
+
var value = getValue_default(object, key);
|
|
1971
|
+
return baseIsNative_default(value) ? value : void 0;
|
|
1972
|
+
}
|
|
1973
|
+
var getNative_default = getNative;
|
|
1974
|
+
|
|
1975
|
+
// ../../../node_modules/lodash-es/_baseFindIndex.js
|
|
1976
|
+
function baseFindIndex(array2, predicate, fromIndex, fromRight) {
|
|
1977
|
+
var length = array2.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
1978
|
+
while (fromRight ? index-- : ++index < length) {
|
|
1979
|
+
if (predicate(array2[index], index, array2)) {
|
|
1980
|
+
return index;
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
return -1;
|
|
1984
|
+
}
|
|
1985
|
+
var baseFindIndex_default = baseFindIndex;
|
|
1986
|
+
|
|
1987
|
+
// ../../../node_modules/lodash-es/_baseIsNaN.js
|
|
1988
|
+
function baseIsNaN(value) {
|
|
1989
|
+
return value !== value;
|
|
1990
|
+
}
|
|
1991
|
+
var baseIsNaN_default = baseIsNaN;
|
|
1992
|
+
|
|
1993
|
+
// ../../../node_modules/lodash-es/_strictIndexOf.js
|
|
1994
|
+
function strictIndexOf(array2, value, fromIndex) {
|
|
1995
|
+
var index = fromIndex - 1, length = array2.length;
|
|
1996
|
+
while (++index < length) {
|
|
1997
|
+
if (array2[index] === value) {
|
|
1998
|
+
return index;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
return -1;
|
|
2002
|
+
}
|
|
2003
|
+
var strictIndexOf_default = strictIndexOf;
|
|
2004
|
+
|
|
2005
|
+
// ../../../node_modules/lodash-es/_baseIndexOf.js
|
|
2006
|
+
function baseIndexOf(array2, value, fromIndex) {
|
|
2007
|
+
return value === value ? strictIndexOf_default(array2, value, fromIndex) : baseFindIndex_default(array2, baseIsNaN_default, fromIndex);
|
|
2008
|
+
}
|
|
2009
|
+
var baseIndexOf_default = baseIndexOf;
|
|
2010
|
+
|
|
2011
|
+
// ../../../node_modules/lodash-es/_isIndex.js
|
|
2012
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
2013
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
2014
|
+
function isIndex(value, length) {
|
|
2015
|
+
var type = typeof value;
|
|
2016
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
2017
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
2018
|
+
}
|
|
2019
|
+
var isIndex_default = isIndex;
|
|
2020
|
+
|
|
2021
|
+
// ../../../node_modules/lodash-es/eq.js
|
|
2022
|
+
function eq(value, other) {
|
|
2023
|
+
return value === other || value !== value && other !== other;
|
|
2024
|
+
}
|
|
2025
|
+
var eq_default = eq;
|
|
2026
|
+
|
|
2027
|
+
// ../../../node_modules/lodash-es/isLength.js
|
|
2028
|
+
var MAX_SAFE_INTEGER2 = 9007199254740991;
|
|
2029
|
+
function isLength(value) {
|
|
2030
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
2031
|
+
}
|
|
2032
|
+
var isLength_default = isLength;
|
|
2033
|
+
|
|
2034
|
+
// ../../../node_modules/lodash-es/_baseIsArguments.js
|
|
2035
|
+
var argsTag = "[object Arguments]";
|
|
2036
|
+
function baseIsArguments(value) {
|
|
2037
|
+
return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
|
|
2038
|
+
}
|
|
2039
|
+
var baseIsArguments_default = baseIsArguments;
|
|
2040
|
+
|
|
2041
|
+
// ../../../node_modules/lodash-es/isArguments.js
|
|
2042
|
+
var objectProto4 = Object.prototype;
|
|
2043
|
+
var hasOwnProperty3 = objectProto4.hasOwnProperty;
|
|
2044
|
+
var propertyIsEnumerable = objectProto4.propertyIsEnumerable;
|
|
2045
|
+
var isArguments = baseIsArguments_default(/* @__PURE__ */ function() {
|
|
2046
|
+
return arguments;
|
|
2047
|
+
}()) ? baseIsArguments_default : function(value) {
|
|
2048
|
+
return isObjectLike_default(value) && hasOwnProperty3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
2049
|
+
};
|
|
2050
|
+
var isArguments_default = isArguments;
|
|
2051
|
+
|
|
2052
|
+
// ../../../node_modules/lodash-es/_isKey.js
|
|
2053
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
2054
|
+
var reIsPlainProp = /^\w*$/;
|
|
2055
|
+
function isKey(value, object) {
|
|
2056
|
+
if (isArray_default(value)) {
|
|
2057
|
+
return false;
|
|
2058
|
+
}
|
|
2059
|
+
var type = typeof value;
|
|
2060
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default(value)) {
|
|
2061
|
+
return true;
|
|
2062
|
+
}
|
|
2063
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
2064
|
+
}
|
|
2065
|
+
var isKey_default = isKey;
|
|
2066
|
+
|
|
2067
|
+
// ../../../node_modules/lodash-es/_nativeCreate.js
|
|
2068
|
+
var nativeCreate = getNative_default(Object, "create");
|
|
2069
|
+
var nativeCreate_default = nativeCreate;
|
|
2070
|
+
|
|
2071
|
+
// ../../../node_modules/lodash-es/_hashClear.js
|
|
2072
|
+
function hashClear() {
|
|
2073
|
+
this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
|
|
2074
|
+
this.size = 0;
|
|
2075
|
+
}
|
|
2076
|
+
var hashClear_default = hashClear;
|
|
2077
|
+
|
|
2078
|
+
// ../../../node_modules/lodash-es/_hashDelete.js
|
|
2079
|
+
function hashDelete(key) {
|
|
2080
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
2081
|
+
this.size -= result ? 1 : 0;
|
|
2082
|
+
return result;
|
|
2083
|
+
}
|
|
2084
|
+
var hashDelete_default = hashDelete;
|
|
2085
|
+
|
|
2086
|
+
// ../../../node_modules/lodash-es/_hashGet.js
|
|
2087
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
2088
|
+
var objectProto5 = Object.prototype;
|
|
2089
|
+
var hasOwnProperty4 = objectProto5.hasOwnProperty;
|
|
2090
|
+
function hashGet(key) {
|
|
2091
|
+
var data = this.__data__;
|
|
2092
|
+
if (nativeCreate_default) {
|
|
2093
|
+
var result = data[key];
|
|
2094
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
2095
|
+
}
|
|
2096
|
+
return hasOwnProperty4.call(data, key) ? data[key] : void 0;
|
|
2097
|
+
}
|
|
2098
|
+
var hashGet_default = hashGet;
|
|
2099
|
+
|
|
2100
|
+
// ../../../node_modules/lodash-es/_hashHas.js
|
|
2101
|
+
var objectProto6 = Object.prototype;
|
|
2102
|
+
var hasOwnProperty5 = objectProto6.hasOwnProperty;
|
|
2103
|
+
function hashHas(key) {
|
|
2104
|
+
var data = this.__data__;
|
|
2105
|
+
return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty5.call(data, key);
|
|
2106
|
+
}
|
|
2107
|
+
var hashHas_default = hashHas;
|
|
2108
|
+
|
|
2109
|
+
// ../../../node_modules/lodash-es/_hashSet.js
|
|
2110
|
+
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
2111
|
+
function hashSet(key, value) {
|
|
2112
|
+
var data = this.__data__;
|
|
2113
|
+
this.size += this.has(key) ? 0 : 1;
|
|
2114
|
+
data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
|
|
2115
|
+
return this;
|
|
2116
|
+
}
|
|
2117
|
+
var hashSet_default = hashSet;
|
|
2118
|
+
|
|
2119
|
+
// ../../../node_modules/lodash-es/_Hash.js
|
|
2120
|
+
function Hash(entries) {
|
|
2121
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2122
|
+
this.clear();
|
|
2123
|
+
while (++index < length) {
|
|
2124
|
+
var entry = entries[index];
|
|
2125
|
+
this.set(entry[0], entry[1]);
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
Hash.prototype.clear = hashClear_default;
|
|
2129
|
+
Hash.prototype["delete"] = hashDelete_default;
|
|
2130
|
+
Hash.prototype.get = hashGet_default;
|
|
2131
|
+
Hash.prototype.has = hashHas_default;
|
|
2132
|
+
Hash.prototype.set = hashSet_default;
|
|
2133
|
+
var Hash_default = Hash;
|
|
2134
|
+
|
|
2135
|
+
// ../../../node_modules/lodash-es/_listCacheClear.js
|
|
2136
|
+
function listCacheClear() {
|
|
2137
|
+
this.__data__ = [];
|
|
2138
|
+
this.size = 0;
|
|
2139
|
+
}
|
|
2140
|
+
var listCacheClear_default = listCacheClear;
|
|
2141
|
+
|
|
2142
|
+
// ../../../node_modules/lodash-es/_assocIndexOf.js
|
|
2143
|
+
function assocIndexOf(array2, key) {
|
|
2144
|
+
var length = array2.length;
|
|
2145
|
+
while (length--) {
|
|
2146
|
+
if (eq_default(array2[length][0], key)) {
|
|
2147
|
+
return length;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
return -1;
|
|
2151
|
+
}
|
|
2152
|
+
var assocIndexOf_default = assocIndexOf;
|
|
2153
|
+
|
|
2154
|
+
// ../../../node_modules/lodash-es/_listCacheDelete.js
|
|
2155
|
+
var arrayProto = Array.prototype;
|
|
2156
|
+
var splice = arrayProto.splice;
|
|
2157
|
+
function listCacheDelete(key) {
|
|
2158
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
2159
|
+
if (index < 0) {
|
|
2160
|
+
return false;
|
|
2161
|
+
}
|
|
2162
|
+
var lastIndex = data.length - 1;
|
|
2163
|
+
if (index == lastIndex) {
|
|
2164
|
+
data.pop();
|
|
2165
|
+
} else {
|
|
2166
|
+
splice.call(data, index, 1);
|
|
2167
|
+
}
|
|
2168
|
+
--this.size;
|
|
2169
|
+
return true;
|
|
2170
|
+
}
|
|
2171
|
+
var listCacheDelete_default = listCacheDelete;
|
|
2172
|
+
|
|
2173
|
+
// ../../../node_modules/lodash-es/_listCacheGet.js
|
|
2174
|
+
function listCacheGet(key) {
|
|
2175
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
2176
|
+
return index < 0 ? void 0 : data[index][1];
|
|
2177
|
+
}
|
|
2178
|
+
var listCacheGet_default = listCacheGet;
|
|
2179
|
+
|
|
2180
|
+
// ../../../node_modules/lodash-es/_listCacheHas.js
|
|
2181
|
+
function listCacheHas(key) {
|
|
2182
|
+
return assocIndexOf_default(this.__data__, key) > -1;
|
|
2183
|
+
}
|
|
2184
|
+
var listCacheHas_default = listCacheHas;
|
|
2185
|
+
|
|
2186
|
+
// ../../../node_modules/lodash-es/_listCacheSet.js
|
|
2187
|
+
function listCacheSet(key, value) {
|
|
2188
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
2189
|
+
if (index < 0) {
|
|
2190
|
+
++this.size;
|
|
2191
|
+
data.push([key, value]);
|
|
2192
|
+
} else {
|
|
2193
|
+
data[index][1] = value;
|
|
2194
|
+
}
|
|
2195
|
+
return this;
|
|
2196
|
+
}
|
|
2197
|
+
var listCacheSet_default = listCacheSet;
|
|
2198
|
+
|
|
2199
|
+
// ../../../node_modules/lodash-es/_ListCache.js
|
|
2200
|
+
function ListCache(entries) {
|
|
2201
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2202
|
+
this.clear();
|
|
2203
|
+
while (++index < length) {
|
|
2204
|
+
var entry = entries[index];
|
|
2205
|
+
this.set(entry[0], entry[1]);
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
ListCache.prototype.clear = listCacheClear_default;
|
|
2209
|
+
ListCache.prototype["delete"] = listCacheDelete_default;
|
|
2210
|
+
ListCache.prototype.get = listCacheGet_default;
|
|
2211
|
+
ListCache.prototype.has = listCacheHas_default;
|
|
2212
|
+
ListCache.prototype.set = listCacheSet_default;
|
|
2213
|
+
var ListCache_default = ListCache;
|
|
2214
|
+
|
|
2215
|
+
// ../../../node_modules/lodash-es/_Map.js
|
|
2216
|
+
var Map2 = getNative_default(root_default, "Map");
|
|
2217
|
+
var Map_default = Map2;
|
|
2218
|
+
|
|
2219
|
+
// ../../../node_modules/lodash-es/_mapCacheClear.js
|
|
2220
|
+
function mapCacheClear() {
|
|
2221
|
+
this.size = 0;
|
|
2222
|
+
this.__data__ = {
|
|
2223
|
+
"hash": new Hash_default(),
|
|
2224
|
+
"map": new (Map_default || ListCache_default)(),
|
|
2225
|
+
"string": new Hash_default()
|
|
2226
|
+
};
|
|
2227
|
+
}
|
|
2228
|
+
var mapCacheClear_default = mapCacheClear;
|
|
2229
|
+
|
|
2230
|
+
// ../../../node_modules/lodash-es/_isKeyable.js
|
|
2231
|
+
function isKeyable(value) {
|
|
2232
|
+
var type = typeof value;
|
|
2233
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
2234
|
+
}
|
|
2235
|
+
var isKeyable_default = isKeyable;
|
|
2236
|
+
|
|
2237
|
+
// ../../../node_modules/lodash-es/_getMapData.js
|
|
2238
|
+
function getMapData(map, key) {
|
|
2239
|
+
var data = map.__data__;
|
|
2240
|
+
return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
2241
|
+
}
|
|
2242
|
+
var getMapData_default = getMapData;
|
|
2243
|
+
|
|
2244
|
+
// ../../../node_modules/lodash-es/_mapCacheDelete.js
|
|
2245
|
+
function mapCacheDelete(key) {
|
|
2246
|
+
var result = getMapData_default(this, key)["delete"](key);
|
|
2247
|
+
this.size -= result ? 1 : 0;
|
|
2248
|
+
return result;
|
|
2249
|
+
}
|
|
2250
|
+
var mapCacheDelete_default = mapCacheDelete;
|
|
2251
|
+
|
|
2252
|
+
// ../../../node_modules/lodash-es/_mapCacheGet.js
|
|
2253
|
+
function mapCacheGet(key) {
|
|
2254
|
+
return getMapData_default(this, key).get(key);
|
|
2255
|
+
}
|
|
2256
|
+
var mapCacheGet_default = mapCacheGet;
|
|
2257
|
+
|
|
2258
|
+
// ../../../node_modules/lodash-es/_mapCacheHas.js
|
|
2259
|
+
function mapCacheHas(key) {
|
|
2260
|
+
return getMapData_default(this, key).has(key);
|
|
2261
|
+
}
|
|
2262
|
+
var mapCacheHas_default = mapCacheHas;
|
|
2263
|
+
|
|
2264
|
+
// ../../../node_modules/lodash-es/_mapCacheSet.js
|
|
2265
|
+
function mapCacheSet(key, value) {
|
|
2266
|
+
var data = getMapData_default(this, key), size = data.size;
|
|
2267
|
+
data.set(key, value);
|
|
2268
|
+
this.size += data.size == size ? 0 : 1;
|
|
2269
|
+
return this;
|
|
2270
|
+
}
|
|
2271
|
+
var mapCacheSet_default = mapCacheSet;
|
|
2272
|
+
|
|
2273
|
+
// ../../../node_modules/lodash-es/_MapCache.js
|
|
2274
|
+
function MapCache(entries) {
|
|
2275
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
2276
|
+
this.clear();
|
|
2277
|
+
while (++index < length) {
|
|
2278
|
+
var entry = entries[index];
|
|
2279
|
+
this.set(entry[0], entry[1]);
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
MapCache.prototype.clear = mapCacheClear_default;
|
|
2283
|
+
MapCache.prototype["delete"] = mapCacheDelete_default;
|
|
2284
|
+
MapCache.prototype.get = mapCacheGet_default;
|
|
2285
|
+
MapCache.prototype.has = mapCacheHas_default;
|
|
2286
|
+
MapCache.prototype.set = mapCacheSet_default;
|
|
2287
|
+
var MapCache_default = MapCache;
|
|
2288
|
+
|
|
2289
|
+
// ../../../node_modules/lodash-es/memoize.js
|
|
2290
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
2291
|
+
function memoize(func, resolver) {
|
|
2292
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
2293
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2294
|
+
}
|
|
2295
|
+
var memoized = function() {
|
|
2296
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
2297
|
+
if (cache.has(key)) {
|
|
2298
|
+
return cache.get(key);
|
|
2299
|
+
}
|
|
2300
|
+
var result = func.apply(this, args);
|
|
2301
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
2302
|
+
return result;
|
|
2303
|
+
};
|
|
2304
|
+
memoized.cache = new (memoize.Cache || MapCache_default)();
|
|
2305
|
+
return memoized;
|
|
2306
|
+
}
|
|
2307
|
+
memoize.Cache = MapCache_default;
|
|
2308
|
+
var memoize_default = memoize;
|
|
2309
|
+
|
|
2310
|
+
// ../../../node_modules/lodash-es/_memoizeCapped.js
|
|
2311
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
2312
|
+
function memoizeCapped(func) {
|
|
2313
|
+
var result = memoize_default(func, function(key) {
|
|
2314
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
2315
|
+
cache.clear();
|
|
2316
|
+
}
|
|
2317
|
+
return key;
|
|
2318
|
+
});
|
|
2319
|
+
var cache = result.cache;
|
|
2320
|
+
return result;
|
|
2321
|
+
}
|
|
2322
|
+
var memoizeCapped_default = memoizeCapped;
|
|
2323
|
+
|
|
2324
|
+
// ../../../node_modules/lodash-es/_stringToPath.js
|
|
2325
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
2326
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
2327
|
+
var stringToPath = memoizeCapped_default(function(string) {
|
|
2328
|
+
var result = [];
|
|
2329
|
+
if (string.charCodeAt(0) === 46) {
|
|
2330
|
+
result.push("");
|
|
2331
|
+
}
|
|
2332
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
2333
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
2334
|
+
});
|
|
2335
|
+
return result;
|
|
2336
|
+
});
|
|
2337
|
+
var stringToPath_default = stringToPath;
|
|
2338
|
+
|
|
2339
|
+
// ../../../node_modules/lodash-es/toString.js
|
|
2340
|
+
function toString(value) {
|
|
2341
|
+
return value == null ? "" : baseToString_default(value);
|
|
2342
|
+
}
|
|
2343
|
+
var toString_default = toString;
|
|
2344
|
+
|
|
2345
|
+
// ../../../node_modules/lodash-es/_castPath.js
|
|
2346
|
+
function castPath(value, object) {
|
|
2347
|
+
if (isArray_default(value)) {
|
|
2348
|
+
return value;
|
|
2349
|
+
}
|
|
2350
|
+
return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
|
|
2351
|
+
}
|
|
2352
|
+
var castPath_default = castPath;
|
|
2353
|
+
|
|
2354
|
+
// ../../../node_modules/lodash-es/_toKey.js
|
|
2355
|
+
var INFINITY2 = 1 / 0;
|
|
2356
|
+
function toKey(value) {
|
|
2357
|
+
if (typeof value == "string" || isSymbol_default(value)) {
|
|
2358
|
+
return value;
|
|
2359
|
+
}
|
|
2360
|
+
var result = value + "";
|
|
2361
|
+
return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
|
|
2362
|
+
}
|
|
2363
|
+
var toKey_default = toKey;
|
|
2364
|
+
|
|
2365
|
+
// ../../../node_modules/lodash-es/_baseSlice.js
|
|
2366
|
+
function baseSlice(array2, start, end) {
|
|
2367
|
+
var index = -1, length = array2.length;
|
|
2368
|
+
if (start < 0) {
|
|
2369
|
+
start = -start > length ? 0 : length + start;
|
|
2370
|
+
}
|
|
2371
|
+
end = end > length ? length : end;
|
|
2372
|
+
if (end < 0) {
|
|
2373
|
+
end += length;
|
|
2374
|
+
}
|
|
2375
|
+
length = start > end ? 0 : end - start >>> 0;
|
|
2376
|
+
start >>>= 0;
|
|
2377
|
+
var result = Array(length);
|
|
2378
|
+
while (++index < length) {
|
|
2379
|
+
result[index] = array2[index + start];
|
|
2380
|
+
}
|
|
2381
|
+
return result;
|
|
2382
|
+
}
|
|
2383
|
+
var baseSlice_default = baseSlice;
|
|
2384
|
+
|
|
2385
|
+
// ../../../node_modules/lodash-es/_castSlice.js
|
|
2386
|
+
function castSlice(array2, start, end) {
|
|
2387
|
+
var length = array2.length;
|
|
2388
|
+
end = end === void 0 ? length : end;
|
|
2389
|
+
return !start && end >= length ? array2 : baseSlice_default(array2, start, end);
|
|
2390
|
+
}
|
|
2391
|
+
var castSlice_default = castSlice;
|
|
2392
|
+
|
|
2393
|
+
// ../../../node_modules/lodash-es/_hasUnicode.js
|
|
2394
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
2395
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
2396
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
2397
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
2398
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
2399
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
2400
|
+
var rsZWJ = "\\u200d";
|
|
2401
|
+
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
2402
|
+
function hasUnicode(string) {
|
|
2403
|
+
return reHasUnicode.test(string);
|
|
2404
|
+
}
|
|
2405
|
+
var hasUnicode_default = hasUnicode;
|
|
2406
|
+
|
|
2407
|
+
// ../../../node_modules/lodash-es/_asciiToArray.js
|
|
2408
|
+
function asciiToArray(string) {
|
|
2409
|
+
return string.split("");
|
|
2410
|
+
}
|
|
2411
|
+
var asciiToArray_default = asciiToArray;
|
|
2412
|
+
|
|
2413
|
+
// ../../../node_modules/lodash-es/_unicodeToArray.js
|
|
2414
|
+
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
2415
|
+
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
2416
|
+
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
2417
|
+
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
2418
|
+
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
2419
|
+
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
2420
|
+
var rsAstral = "[" + rsAstralRange2 + "]";
|
|
2421
|
+
var rsCombo = "[" + rsComboRange2 + "]";
|
|
2422
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
2423
|
+
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
2424
|
+
var rsNonAstral = "[^" + rsAstralRange2 + "]";
|
|
2425
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
2426
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
2427
|
+
var rsZWJ2 = "\\u200d";
|
|
2428
|
+
var reOptMod = rsModifier + "?";
|
|
2429
|
+
var rsOptVar = "[" + rsVarRange2 + "]?";
|
|
2430
|
+
var rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
2431
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
2432
|
+
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
2433
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
2434
|
+
function unicodeToArray(string) {
|
|
2435
|
+
return string.match(reUnicode) || [];
|
|
2436
|
+
}
|
|
2437
|
+
var unicodeToArray_default = unicodeToArray;
|
|
2438
|
+
|
|
2439
|
+
// ../../../node_modules/lodash-es/_stringToArray.js
|
|
2440
|
+
function stringToArray(string) {
|
|
2441
|
+
return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
|
|
2442
|
+
}
|
|
2443
|
+
var stringToArray_default = stringToArray;
|
|
2444
|
+
|
|
2445
|
+
// ../../../node_modules/lodash-es/_hasPath.js
|
|
2446
|
+
function hasPath(object, path5, hasFunc) {
|
|
2447
|
+
path5 = castPath_default(path5, object);
|
|
2448
|
+
var index = -1, length = path5.length, result = false;
|
|
2449
|
+
while (++index < length) {
|
|
2450
|
+
var key = toKey_default(path5[index]);
|
|
2451
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
2452
|
+
break;
|
|
2453
|
+
}
|
|
2454
|
+
object = object[key];
|
|
2455
|
+
}
|
|
2456
|
+
if (result || ++index != length) {
|
|
2457
|
+
return result;
|
|
2458
|
+
}
|
|
2459
|
+
length = object == null ? 0 : object.length;
|
|
2460
|
+
return !!length && isLength_default(length) && isIndex_default(key, length) && (isArray_default(object) || isArguments_default(object));
|
|
2461
|
+
}
|
|
2462
|
+
var hasPath_default = hasPath;
|
|
2463
|
+
|
|
2464
|
+
// ../../../node_modules/lodash-es/_baseHas.js
|
|
2465
|
+
var objectProto7 = Object.prototype;
|
|
2466
|
+
var hasOwnProperty6 = objectProto7.hasOwnProperty;
|
|
2467
|
+
function baseHas(object, key) {
|
|
2468
|
+
return object != null && hasOwnProperty6.call(object, key);
|
|
2469
|
+
}
|
|
2470
|
+
var baseHas_default = baseHas;
|
|
2471
|
+
|
|
2472
|
+
// ../../../node_modules/lodash-es/has.js
|
|
2473
|
+
function has(object, path5) {
|
|
2474
|
+
return object != null && hasPath_default(object, path5, baseHas_default);
|
|
2475
|
+
}
|
|
2476
|
+
var has_default = has;
|
|
2477
|
+
|
|
2478
|
+
// ../../../node_modules/lodash-es/_charsEndIndex.js
|
|
2479
|
+
function charsEndIndex(strSymbols, chrSymbols) {
|
|
2480
|
+
var index = strSymbols.length;
|
|
2481
|
+
while (index-- && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2482
|
+
}
|
|
2483
|
+
return index;
|
|
2484
|
+
}
|
|
2485
|
+
var charsEndIndex_default = charsEndIndex;
|
|
2486
|
+
|
|
2487
|
+
// ../../../node_modules/lodash-es/_charsStartIndex.js
|
|
2488
|
+
function charsStartIndex(strSymbols, chrSymbols) {
|
|
2489
|
+
var index = -1, length = strSymbols.length;
|
|
2490
|
+
while (++index < length && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
2491
|
+
}
|
|
2492
|
+
return index;
|
|
2493
|
+
}
|
|
2494
|
+
var charsStartIndex_default = charsStartIndex;
|
|
2495
|
+
|
|
2496
|
+
// ../../../node_modules/lodash-es/trim.js
|
|
2497
|
+
function trim(string, chars, guard) {
|
|
2498
|
+
string = toString_default(string);
|
|
2499
|
+
if (string && (guard || chars === void 0)) {
|
|
2500
|
+
return baseTrim_default(string);
|
|
2501
|
+
}
|
|
2502
|
+
if (!string || !(chars = baseToString_default(chars))) {
|
|
2503
|
+
return string;
|
|
2504
|
+
}
|
|
2505
|
+
var strSymbols = stringToArray_default(string), chrSymbols = stringToArray_default(chars), start = charsStartIndex_default(strSymbols, chrSymbols), end = charsEndIndex_default(strSymbols, chrSymbols) + 1;
|
|
2506
|
+
return castSlice_default(strSymbols, start, end).join("");
|
|
2507
|
+
}
|
|
2508
|
+
var trim_default = trim;
|
|
2509
|
+
|
|
2510
|
+
// ../../utils/src/config/env.ts
|
|
2511
|
+
function _env(key, defaultValue) {
|
|
2512
|
+
return has_default(process.env, key) ? process.env[key] ?? "" : defaultValue ?? "";
|
|
2513
|
+
}
|
|
2514
|
+
function int(key, defaultValue) {
|
|
2515
|
+
if (!has_default(process.env, key)) {
|
|
2516
|
+
return defaultValue ?? 0;
|
|
2517
|
+
}
|
|
2518
|
+
const value = process.env[key] ?? "0";
|
|
2519
|
+
return parseInt(value, 10);
|
|
2520
|
+
}
|
|
2521
|
+
function float(key, defaultValue) {
|
|
2522
|
+
if (!has_default(process.env, key)) {
|
|
2523
|
+
return defaultValue ?? 0;
|
|
2524
|
+
}
|
|
2525
|
+
const value = process.env[key] ?? "0";
|
|
2526
|
+
return parseFloat(value);
|
|
2527
|
+
}
|
|
2528
|
+
function bool(key, defaultValue) {
|
|
2529
|
+
if (!has_default(process.env, key)) {
|
|
2530
|
+
return defaultValue ?? false;
|
|
2531
|
+
}
|
|
2532
|
+
const value = process.env[key];
|
|
2533
|
+
return value === "true";
|
|
2534
|
+
}
|
|
2535
|
+
function json(key, defaultValue) {
|
|
2536
|
+
if (!has_default(process.env, key)) {
|
|
2537
|
+
return defaultValue ?? {};
|
|
2538
|
+
}
|
|
2539
|
+
const value = process.env[key] ?? "{}";
|
|
2540
|
+
try {
|
|
2541
|
+
return JSON.parse(value);
|
|
2542
|
+
} catch (error) {
|
|
2543
|
+
throw new Error(`Invalid json environment variable ${key}: ${error.message}`);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
function array(key, defaultValue) {
|
|
2547
|
+
if (!has_default(process.env, key)) {
|
|
2548
|
+
return defaultValue ?? [];
|
|
2549
|
+
}
|
|
2550
|
+
let value = process.env[key] ?? "";
|
|
2551
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
2552
|
+
value = value.substring(1, value.length - 1);
|
|
2553
|
+
}
|
|
2554
|
+
return value.split(",").map((v) => {
|
|
2555
|
+
return trim_default(trim_default(v, " "), '"');
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
function date(key, defaultValue) {
|
|
2559
|
+
if (!has_default(process.env, key)) {
|
|
2560
|
+
return defaultValue ?? /* @__PURE__ */ new Date();
|
|
2561
|
+
}
|
|
2562
|
+
const value = process.env[key] ?? Date();
|
|
2563
|
+
return new Date(value);
|
|
2564
|
+
}
|
|
2565
|
+
var utils = {
|
|
2566
|
+
int,
|
|
2567
|
+
float,
|
|
2568
|
+
bool,
|
|
2569
|
+
json,
|
|
2570
|
+
array,
|
|
2571
|
+
date,
|
|
2572
|
+
/**
|
|
2573
|
+
* Gets a value from env that matches oneOf provided values
|
|
2574
|
+
* @param {string} key
|
|
2575
|
+
* @param {string[]} expectedValues
|
|
2576
|
+
* @param {string|undefined} defaultValue
|
|
2577
|
+
* @returns {string|undefined}
|
|
2578
|
+
*/
|
|
2579
|
+
oneOf(key, expectedValues, defaultValue) {
|
|
2580
|
+
if (!expectedValues) {
|
|
2581
|
+
throw new Error(`env.oneOf requires expectedValues`);
|
|
2582
|
+
}
|
|
2583
|
+
if (defaultValue && !expectedValues.includes(defaultValue)) {
|
|
2584
|
+
throw new Error(`env.oneOf requires defaultValue to be included in expectedValues`);
|
|
2585
|
+
}
|
|
2586
|
+
const rawValue = env(key, defaultValue);
|
|
2587
|
+
return expectedValues.includes(rawValue) ? rawValue : defaultValue ?? "";
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
var env = Object.assign(_env, utils);
|
|
2591
|
+
|
|
2592
|
+
// src/services/email.ts
|
|
2593
|
+
import { getService } from "@cloudnux/core-cloud-provider";
|
|
2594
|
+
var { mkdir: mkdir3, writeFile: writeFile3, readdir, readFile: readFile3, unlink } = fs3.promises;
|
|
2595
|
+
var MAX_HISTORY = 100;
|
|
2596
|
+
function resolveBaseDir() {
|
|
2597
|
+
return env("DEV_CLOUD_EMAIL_DIR", path3.join(process.cwd(), ".local-email"));
|
|
2598
|
+
}
|
|
2599
|
+
async function listEntryIds(baseDir) {
|
|
2600
|
+
if (!fs3.existsSync(baseDir)) return [];
|
|
2601
|
+
const files = await readdir(baseDir);
|
|
2602
|
+
return files.filter((file) => file.endsWith(".json")).map((file) => file.slice(0, -".json".length)).sort().reverse();
|
|
2603
|
+
}
|
|
2604
|
+
async function listEmailHistory(limit = MAX_HISTORY) {
|
|
2605
|
+
const baseDir = resolveBaseDir();
|
|
2606
|
+
const ids = (await listEntryIds(baseDir)).slice(0, limit);
|
|
2607
|
+
return Promise.all(ids.map(async (id) => {
|
|
2608
|
+
const raw = await readFile3(path3.join(baseDir, `${id}.json`), "utf8");
|
|
2609
|
+
return JSON.parse(raw);
|
|
2610
|
+
}));
|
|
2611
|
+
}
|
|
2612
|
+
async function getEmailHistoryEntry(id) {
|
|
2613
|
+
try {
|
|
2614
|
+
const raw = await readFile3(path3.join(resolveBaseDir(), `${id}.json`), "utf8");
|
|
2615
|
+
return JSON.parse(raw);
|
|
2616
|
+
} catch {
|
|
2617
|
+
return void 0;
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
async function getEmailRaw(id) {
|
|
2621
|
+
try {
|
|
2622
|
+
return await readFile3(path3.join(resolveBaseDir(), `${id}.eml`), "utf8");
|
|
2623
|
+
} catch {
|
|
2624
|
+
return void 0;
|
|
2625
|
+
}
|
|
2626
|
+
}
|
|
2627
|
+
function extractHeader(headerBlock, name) {
|
|
2628
|
+
const match = headerBlock.match(new RegExp(`^${name}:\\s*(.+)$`, "im"));
|
|
2629
|
+
return match?.[1]?.trim();
|
|
2630
|
+
}
|
|
2631
|
+
function collectParts(part, result) {
|
|
2632
|
+
const boundaryIdx = part.indexOf("\r\n\r\n");
|
|
2633
|
+
const headerBlock = boundaryIdx === -1 ? part : part.slice(0, boundaryIdx);
|
|
2634
|
+
const body = boundaryIdx === -1 ? "" : part.slice(boundaryIdx + 4);
|
|
2635
|
+
const contentType = extractHeader(headerBlock, "Content-Type") ?? "text/plain";
|
|
2636
|
+
const boundaryMatch = contentType.match(/boundary="?([^";]+)"?/i);
|
|
2637
|
+
if (/^multipart\//i.test(contentType) && boundaryMatch) {
|
|
2638
|
+
const boundary = boundaryMatch[1];
|
|
2639
|
+
for (const chunk of body.split(`--${boundary}`)) {
|
|
2640
|
+
const trimmed = chunk.replace(/^\r\n/, "");
|
|
2641
|
+
if (!trimmed || trimmed.startsWith("--")) continue;
|
|
2642
|
+
collectParts(trimmed, result);
|
|
2643
|
+
}
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2646
|
+
if (/^attachment/i.test(extractHeader(headerBlock, "Content-Disposition") ?? "")) return;
|
|
2647
|
+
const encoding = (extractHeader(headerBlock, "Content-Transfer-Encoding") ?? "").toLowerCase();
|
|
2648
|
+
const raw = body.replace(/\r\n$/, "");
|
|
2649
|
+
const decoded = encoding === "base64" ? Buffer.from(raw.replace(/\r?\n/g, ""), "base64").toString("utf8") : raw;
|
|
2650
|
+
if (/^text\/html/i.test(contentType)) {
|
|
2651
|
+
result.html = decoded;
|
|
2652
|
+
} else if (/^text\/plain/i.test(contentType)) {
|
|
2653
|
+
result.text = decoded;
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
async function getEmailBody(id) {
|
|
2657
|
+
const raw = await getEmailRaw(id);
|
|
2658
|
+
if (raw === void 0) return void 0;
|
|
2659
|
+
const result = {};
|
|
2660
|
+
collectParts(raw, result);
|
|
2661
|
+
return result;
|
|
2662
|
+
}
|
|
2663
|
+
|
|
1731
2664
|
// src/dev-console-plugin/plugin.ts
|
|
1732
2665
|
var require2 = createRequire(import.meta.url);
|
|
1733
2666
|
var LogStore = class {
|
|
@@ -2057,6 +2990,63 @@ async function devConsolePluginFunction(fastify, options = {}) {
|
|
|
2057
2990
|
});
|
|
2058
2991
|
}
|
|
2059
2992
|
});
|
|
2993
|
+
const summarizeSubscribers = (subscriberQueues) => subscriberQueues.map((queueName) => {
|
|
2994
|
+
const stats = fastify.queues.getQueueStats(queueName);
|
|
2995
|
+
return {
|
|
2996
|
+
queueName,
|
|
2997
|
+
module: stats?.module,
|
|
2998
|
+
stats: stats ? {
|
|
2999
|
+
incoming: stats.incoming.length,
|
|
3000
|
+
processing: stats.processing.length,
|
|
3001
|
+
dlq: stats.dlq.length
|
|
3002
|
+
} : null
|
|
3003
|
+
};
|
|
3004
|
+
});
|
|
3005
|
+
fastify.get(`/${prefix}/topics`, async (_, reply) => {
|
|
3006
|
+
const queueManager = fastify.queues;
|
|
3007
|
+
if (!queueManager) {
|
|
3008
|
+
return reply.status(503).send({ error: "Queue service not available" });
|
|
3009
|
+
}
|
|
3010
|
+
const topics = Object.entries(queueManager.listTopics()).map(([name, subscriberQueues]) => ({
|
|
3011
|
+
name,
|
|
3012
|
+
subscribers: summarizeSubscribers(subscriberQueues)
|
|
3013
|
+
}));
|
|
3014
|
+
return { topics };
|
|
3015
|
+
});
|
|
3016
|
+
fastify.get(`/${prefix}/topics/:topicName`, async (request, reply) => {
|
|
3017
|
+
const { topicName } = request.params;
|
|
3018
|
+
const queueManager = fastify.queues;
|
|
3019
|
+
if (!queueManager) {
|
|
3020
|
+
return reply.status(503).send({ error: "Queue service not available" });
|
|
3021
|
+
}
|
|
3022
|
+
const subscriberQueues = queueManager.listTopics()[topicName];
|
|
3023
|
+
if (!subscriberQueues) {
|
|
3024
|
+
return reply.status(404).send({ error: "Topic not found" });
|
|
3025
|
+
}
|
|
3026
|
+
return {
|
|
3027
|
+
name: topicName,
|
|
3028
|
+
subscribers: summarizeSubscribers(subscriberQueues)
|
|
3029
|
+
};
|
|
3030
|
+
});
|
|
3031
|
+
fastify.post(`/${prefix}/topics/:topicName/publish`, async (request, reply) => {
|
|
3032
|
+
const { topicName } = request.params;
|
|
3033
|
+
const queueManager = fastify.queues;
|
|
3034
|
+
if (!queueManager) {
|
|
3035
|
+
return reply.status(503).send({ error: "Queue service not available" });
|
|
3036
|
+
}
|
|
3037
|
+
try {
|
|
3038
|
+
const results = await queueManager.publishTopic(topicName, request.body, request.headers);
|
|
3039
|
+
if (results === null) {
|
|
3040
|
+
return reply.status(404).send({ error: "Topic not found" });
|
|
3041
|
+
}
|
|
3042
|
+
return reply.status(200).send({ topicName, results });
|
|
3043
|
+
} catch (error) {
|
|
3044
|
+
return reply.status(500).send({
|
|
3045
|
+
message: "Failed to publish to topic",
|
|
3046
|
+
error
|
|
3047
|
+
});
|
|
3048
|
+
}
|
|
3049
|
+
});
|
|
2060
3050
|
fastify.get(`/${prefix}/schedules`, async (_, reply) => {
|
|
2061
3051
|
const schedulerManager = fastify.scheduler;
|
|
2062
3052
|
if (!schedulerManager) {
|
|
@@ -2221,6 +3211,35 @@ async function devConsolePluginFunction(fastify, options = {}) {
|
|
|
2221
3211
|
return reply.status(404).send({ error: error.message });
|
|
2222
3212
|
}
|
|
2223
3213
|
});
|
|
3214
|
+
fastify.get(`/${prefix}/emails`, async (request) => {
|
|
3215
|
+
const { limit } = request.query;
|
|
3216
|
+
return { emails: await listEmailHistory(limit ? Number(limit) : void 0) };
|
|
3217
|
+
});
|
|
3218
|
+
fastify.get(`/${prefix}/emails/:id`, async (request, reply) => {
|
|
3219
|
+
const { id } = request.params;
|
|
3220
|
+
const email = await getEmailHistoryEntry(id);
|
|
3221
|
+
if (!email) {
|
|
3222
|
+
return reply.status(404).send({ error: "Email not found" });
|
|
3223
|
+
}
|
|
3224
|
+
return { email };
|
|
3225
|
+
});
|
|
3226
|
+
fastify.get(`/${prefix}/emails/:id/raw`, async (request, reply) => {
|
|
3227
|
+
const { id } = request.params;
|
|
3228
|
+
const raw = await getEmailRaw(id);
|
|
3229
|
+
if (!raw) {
|
|
3230
|
+
return reply.status(404).send({ error: "Email not found" });
|
|
3231
|
+
}
|
|
3232
|
+
reply.type("message/rfc822");
|
|
3233
|
+
return raw;
|
|
3234
|
+
});
|
|
3235
|
+
fastify.get(`/${prefix}/emails/:id/body`, async (request, reply) => {
|
|
3236
|
+
const { id } = request.params;
|
|
3237
|
+
const body = await getEmailBody(id);
|
|
3238
|
+
if (!body) {
|
|
3239
|
+
return reply.status(404).send({ error: "Email not found" });
|
|
3240
|
+
}
|
|
3241
|
+
return { body };
|
|
3242
|
+
});
|
|
2224
3243
|
fastify.get(`/${prefix}/logs/stream`, async (request, reply) => {
|
|
2225
3244
|
const { level, module, reqId } = request.query;
|
|
2226
3245
|
const matchesFilters = (log) => {
|
|
@@ -2249,7 +3268,7 @@ async function devConsolePluginFunction(fastify, options = {}) {
|
|
|
2249
3268
|
});
|
|
2250
3269
|
});
|
|
2251
3270
|
if (enableUI) {
|
|
2252
|
-
const devConsolePath =
|
|
3271
|
+
const devConsolePath = path4.dirname(
|
|
2253
3272
|
require2.resolve("@cloudnux/dev-console/dist/index.html")
|
|
2254
3273
|
);
|
|
2255
3274
|
await fastify.register(fastifyStatic, {
|
|
@@ -2269,4 +3288,17 @@ export {
|
|
|
2269
3288
|
devConsolePlugin,
|
|
2270
3289
|
routeRegistry
|
|
2271
3290
|
};
|
|
3291
|
+
/*! Bundled license information:
|
|
3292
|
+
|
|
3293
|
+
lodash-es/lodash.js:
|
|
3294
|
+
(**
|
|
3295
|
+
* @license
|
|
3296
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
3297
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
3298
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
3299
|
+
* Released under MIT license <https://lodash.com/license>
|
|
3300
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
3301
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
3302
|
+
*)
|
|
3303
|
+
*/
|
|
2272
3304
|
//# sourceMappingURL=index.js.map
|