@cloudnux/local-cloud-provider 0.12.0 → 0.14.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 +37 -2
- package/dist/dev-console-plugin/index.js +452 -249
- package/dist/dev-console-plugin/index.js.map +1 -1
- package/dist/index.js +191 -102
- package/dist/index.js.map +1 -1
- package/dist/queue-plugin/index.d.ts +2 -1
- package/dist/queue-plugin/index.js +187 -102
- package/dist/queue-plugin/index.js.map +1 -1
- package/dist/schedule-plugin/index.js +193 -118
- package/dist/schedule-plugin/index.js.map +1 -1
- package/dist/websocket-plugin/index.d.ts +10 -3
- package/dist/websocket-plugin/index.js +1063 -11
- package/dist/websocket-plugin/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,3 +1,1009 @@
|
|
|
1
|
+
// src/logging/pretty-writer.ts
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { EOL as EOL2 } from "os";
|
|
4
|
+
|
|
5
|
+
// ../../../node_modules/lodash-es/_freeGlobal.js
|
|
6
|
+
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
7
|
+
var freeGlobal_default = freeGlobal;
|
|
8
|
+
|
|
9
|
+
// ../../../node_modules/lodash-es/_root.js
|
|
10
|
+
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
11
|
+
var root = freeGlobal_default || freeSelf || Function("return this")();
|
|
12
|
+
var root_default = root;
|
|
13
|
+
|
|
14
|
+
// ../../../node_modules/lodash-es/_Symbol.js
|
|
15
|
+
var Symbol = root_default.Symbol;
|
|
16
|
+
var Symbol_default = Symbol;
|
|
17
|
+
|
|
18
|
+
// ../../../node_modules/lodash-es/_getRawTag.js
|
|
19
|
+
var objectProto = Object.prototype;
|
|
20
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
21
|
+
var nativeObjectToString = objectProto.toString;
|
|
22
|
+
var symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
23
|
+
function getRawTag(value) {
|
|
24
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
25
|
+
try {
|
|
26
|
+
value[symToStringTag] = void 0;
|
|
27
|
+
var unmasked = true;
|
|
28
|
+
} catch (e) {
|
|
29
|
+
}
|
|
30
|
+
var result = nativeObjectToString.call(value);
|
|
31
|
+
if (unmasked) {
|
|
32
|
+
if (isOwn) {
|
|
33
|
+
value[symToStringTag] = tag;
|
|
34
|
+
} else {
|
|
35
|
+
delete value[symToStringTag];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
var getRawTag_default = getRawTag;
|
|
41
|
+
|
|
42
|
+
// ../../../node_modules/lodash-es/_objectToString.js
|
|
43
|
+
var objectProto2 = Object.prototype;
|
|
44
|
+
var nativeObjectToString2 = objectProto2.toString;
|
|
45
|
+
function objectToString(value) {
|
|
46
|
+
return nativeObjectToString2.call(value);
|
|
47
|
+
}
|
|
48
|
+
var objectToString_default = objectToString;
|
|
49
|
+
|
|
50
|
+
// ../../../node_modules/lodash-es/_baseGetTag.js
|
|
51
|
+
var nullTag = "[object Null]";
|
|
52
|
+
var undefinedTag = "[object Undefined]";
|
|
53
|
+
var symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
54
|
+
function baseGetTag(value) {
|
|
55
|
+
if (value == null) {
|
|
56
|
+
return value === void 0 ? undefinedTag : nullTag;
|
|
57
|
+
}
|
|
58
|
+
return symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
|
|
59
|
+
}
|
|
60
|
+
var baseGetTag_default = baseGetTag;
|
|
61
|
+
|
|
62
|
+
// ../../../node_modules/lodash-es/isObjectLike.js
|
|
63
|
+
function isObjectLike(value) {
|
|
64
|
+
return value != null && typeof value == "object";
|
|
65
|
+
}
|
|
66
|
+
var isObjectLike_default = isObjectLike;
|
|
67
|
+
|
|
68
|
+
// ../../../node_modules/lodash-es/isSymbol.js
|
|
69
|
+
var symbolTag = "[object Symbol]";
|
|
70
|
+
function isSymbol(value) {
|
|
71
|
+
return typeof value == "symbol" || isObjectLike_default(value) && baseGetTag_default(value) == symbolTag;
|
|
72
|
+
}
|
|
73
|
+
var isSymbol_default = isSymbol;
|
|
74
|
+
|
|
75
|
+
// ../../../node_modules/lodash-es/_arrayMap.js
|
|
76
|
+
function arrayMap(array2, iteratee) {
|
|
77
|
+
var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
78
|
+
while (++index < length) {
|
|
79
|
+
result[index] = iteratee(array2[index], index, array2);
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
var arrayMap_default = arrayMap;
|
|
84
|
+
|
|
85
|
+
// ../../../node_modules/lodash-es/isArray.js
|
|
86
|
+
var isArray = Array.isArray;
|
|
87
|
+
var isArray_default = isArray;
|
|
88
|
+
|
|
89
|
+
// ../../../node_modules/lodash-es/_baseToString.js
|
|
90
|
+
var INFINITY = 1 / 0;
|
|
91
|
+
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0;
|
|
92
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
93
|
+
function baseToString(value) {
|
|
94
|
+
if (typeof value == "string") {
|
|
95
|
+
return value;
|
|
96
|
+
}
|
|
97
|
+
if (isArray_default(value)) {
|
|
98
|
+
return arrayMap_default(value, baseToString) + "";
|
|
99
|
+
}
|
|
100
|
+
if (isSymbol_default(value)) {
|
|
101
|
+
return symbolToString ? symbolToString.call(value) : "";
|
|
102
|
+
}
|
|
103
|
+
var result = value + "";
|
|
104
|
+
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
105
|
+
}
|
|
106
|
+
var baseToString_default = baseToString;
|
|
107
|
+
|
|
108
|
+
// ../../../node_modules/lodash-es/_trimmedEndIndex.js
|
|
109
|
+
var reWhitespace = /\s/;
|
|
110
|
+
function trimmedEndIndex(string) {
|
|
111
|
+
var index = string.length;
|
|
112
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
113
|
+
}
|
|
114
|
+
return index;
|
|
115
|
+
}
|
|
116
|
+
var trimmedEndIndex_default = trimmedEndIndex;
|
|
117
|
+
|
|
118
|
+
// ../../../node_modules/lodash-es/_baseTrim.js
|
|
119
|
+
var reTrimStart = /^\s+/;
|
|
120
|
+
function baseTrim(string) {
|
|
121
|
+
return string ? string.slice(0, trimmedEndIndex_default(string) + 1).replace(reTrimStart, "") : string;
|
|
122
|
+
}
|
|
123
|
+
var baseTrim_default = baseTrim;
|
|
124
|
+
|
|
125
|
+
// ../../../node_modules/lodash-es/isObject.js
|
|
126
|
+
function isObject(value) {
|
|
127
|
+
var type = typeof value;
|
|
128
|
+
return value != null && (type == "object" || type == "function");
|
|
129
|
+
}
|
|
130
|
+
var isObject_default = isObject;
|
|
131
|
+
|
|
132
|
+
// ../../../node_modules/lodash-es/isFunction.js
|
|
133
|
+
var asyncTag = "[object AsyncFunction]";
|
|
134
|
+
var funcTag = "[object Function]";
|
|
135
|
+
var genTag = "[object GeneratorFunction]";
|
|
136
|
+
var proxyTag = "[object Proxy]";
|
|
137
|
+
function isFunction(value) {
|
|
138
|
+
if (!isObject_default(value)) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
var tag = baseGetTag_default(value);
|
|
142
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
143
|
+
}
|
|
144
|
+
var isFunction_default = isFunction;
|
|
145
|
+
|
|
146
|
+
// ../../../node_modules/lodash-es/_coreJsData.js
|
|
147
|
+
var coreJsData = root_default["__core-js_shared__"];
|
|
148
|
+
var coreJsData_default = coreJsData;
|
|
149
|
+
|
|
150
|
+
// ../../../node_modules/lodash-es/_isMasked.js
|
|
151
|
+
var maskSrcKey = function() {
|
|
152
|
+
var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
|
|
153
|
+
return uid ? "Symbol(src)_1." + uid : "";
|
|
154
|
+
}();
|
|
155
|
+
function isMasked(func) {
|
|
156
|
+
return !!maskSrcKey && maskSrcKey in func;
|
|
157
|
+
}
|
|
158
|
+
var isMasked_default = isMasked;
|
|
159
|
+
|
|
160
|
+
// ../../../node_modules/lodash-es/_toSource.js
|
|
161
|
+
var funcProto = Function.prototype;
|
|
162
|
+
var funcToString = funcProto.toString;
|
|
163
|
+
function toSource(func) {
|
|
164
|
+
if (func != null) {
|
|
165
|
+
try {
|
|
166
|
+
return funcToString.call(func);
|
|
167
|
+
} catch (e) {
|
|
168
|
+
}
|
|
169
|
+
try {
|
|
170
|
+
return func + "";
|
|
171
|
+
} catch (e) {
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return "";
|
|
175
|
+
}
|
|
176
|
+
var toSource_default = toSource;
|
|
177
|
+
|
|
178
|
+
// ../../../node_modules/lodash-es/_baseIsNative.js
|
|
179
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
180
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
181
|
+
var funcProto2 = Function.prototype;
|
|
182
|
+
var objectProto3 = Object.prototype;
|
|
183
|
+
var funcToString2 = funcProto2.toString;
|
|
184
|
+
var hasOwnProperty2 = objectProto3.hasOwnProperty;
|
|
185
|
+
var reIsNative = RegExp(
|
|
186
|
+
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
187
|
+
);
|
|
188
|
+
function baseIsNative(value) {
|
|
189
|
+
if (!isObject_default(value) || isMasked_default(value)) {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
|
|
193
|
+
return pattern.test(toSource_default(value));
|
|
194
|
+
}
|
|
195
|
+
var baseIsNative_default = baseIsNative;
|
|
196
|
+
|
|
197
|
+
// ../../../node_modules/lodash-es/_getValue.js
|
|
198
|
+
function getValue(object, key) {
|
|
199
|
+
return object == null ? void 0 : object[key];
|
|
200
|
+
}
|
|
201
|
+
var getValue_default = getValue;
|
|
202
|
+
|
|
203
|
+
// ../../../node_modules/lodash-es/_getNative.js
|
|
204
|
+
function getNative(object, key) {
|
|
205
|
+
var value = getValue_default(object, key);
|
|
206
|
+
return baseIsNative_default(value) ? value : void 0;
|
|
207
|
+
}
|
|
208
|
+
var getNative_default = getNative;
|
|
209
|
+
|
|
210
|
+
// ../../../node_modules/lodash-es/_baseFindIndex.js
|
|
211
|
+
function baseFindIndex(array2, predicate, fromIndex, fromRight) {
|
|
212
|
+
var length = array2.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
213
|
+
while (fromRight ? index-- : ++index < length) {
|
|
214
|
+
if (predicate(array2[index], index, array2)) {
|
|
215
|
+
return index;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return -1;
|
|
219
|
+
}
|
|
220
|
+
var baseFindIndex_default = baseFindIndex;
|
|
221
|
+
|
|
222
|
+
// ../../../node_modules/lodash-es/_baseIsNaN.js
|
|
223
|
+
function baseIsNaN(value) {
|
|
224
|
+
return value !== value;
|
|
225
|
+
}
|
|
226
|
+
var baseIsNaN_default = baseIsNaN;
|
|
227
|
+
|
|
228
|
+
// ../../../node_modules/lodash-es/_strictIndexOf.js
|
|
229
|
+
function strictIndexOf(array2, value, fromIndex) {
|
|
230
|
+
var index = fromIndex - 1, length = array2.length;
|
|
231
|
+
while (++index < length) {
|
|
232
|
+
if (array2[index] === value) {
|
|
233
|
+
return index;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return -1;
|
|
237
|
+
}
|
|
238
|
+
var strictIndexOf_default = strictIndexOf;
|
|
239
|
+
|
|
240
|
+
// ../../../node_modules/lodash-es/_baseIndexOf.js
|
|
241
|
+
function baseIndexOf(array2, value, fromIndex) {
|
|
242
|
+
return value === value ? strictIndexOf_default(array2, value, fromIndex) : baseFindIndex_default(array2, baseIsNaN_default, fromIndex);
|
|
243
|
+
}
|
|
244
|
+
var baseIndexOf_default = baseIndexOf;
|
|
245
|
+
|
|
246
|
+
// ../../../node_modules/lodash-es/_isIndex.js
|
|
247
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
248
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
249
|
+
function isIndex(value, length) {
|
|
250
|
+
var type = typeof value;
|
|
251
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
252
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
253
|
+
}
|
|
254
|
+
var isIndex_default = isIndex;
|
|
255
|
+
|
|
256
|
+
// ../../../node_modules/lodash-es/eq.js
|
|
257
|
+
function eq(value, other) {
|
|
258
|
+
return value === other || value !== value && other !== other;
|
|
259
|
+
}
|
|
260
|
+
var eq_default = eq;
|
|
261
|
+
|
|
262
|
+
// ../../../node_modules/lodash-es/isLength.js
|
|
263
|
+
var MAX_SAFE_INTEGER2 = 9007199254740991;
|
|
264
|
+
function isLength(value) {
|
|
265
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER2;
|
|
266
|
+
}
|
|
267
|
+
var isLength_default = isLength;
|
|
268
|
+
|
|
269
|
+
// ../../../node_modules/lodash-es/_baseIsArguments.js
|
|
270
|
+
var argsTag = "[object Arguments]";
|
|
271
|
+
function baseIsArguments(value) {
|
|
272
|
+
return isObjectLike_default(value) && baseGetTag_default(value) == argsTag;
|
|
273
|
+
}
|
|
274
|
+
var baseIsArguments_default = baseIsArguments;
|
|
275
|
+
|
|
276
|
+
// ../../../node_modules/lodash-es/isArguments.js
|
|
277
|
+
var objectProto4 = Object.prototype;
|
|
278
|
+
var hasOwnProperty3 = objectProto4.hasOwnProperty;
|
|
279
|
+
var propertyIsEnumerable = objectProto4.propertyIsEnumerable;
|
|
280
|
+
var isArguments = baseIsArguments_default(/* @__PURE__ */ function() {
|
|
281
|
+
return arguments;
|
|
282
|
+
}()) ? baseIsArguments_default : function(value) {
|
|
283
|
+
return isObjectLike_default(value) && hasOwnProperty3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
284
|
+
};
|
|
285
|
+
var isArguments_default = isArguments;
|
|
286
|
+
|
|
287
|
+
// ../../../node_modules/lodash-es/_isKey.js
|
|
288
|
+
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
|
|
289
|
+
var reIsPlainProp = /^\w*$/;
|
|
290
|
+
function isKey(value, object) {
|
|
291
|
+
if (isArray_default(value)) {
|
|
292
|
+
return false;
|
|
293
|
+
}
|
|
294
|
+
var type = typeof value;
|
|
295
|
+
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol_default(value)) {
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
|
|
299
|
+
}
|
|
300
|
+
var isKey_default = isKey;
|
|
301
|
+
|
|
302
|
+
// ../../../node_modules/lodash-es/_nativeCreate.js
|
|
303
|
+
var nativeCreate = getNative_default(Object, "create");
|
|
304
|
+
var nativeCreate_default = nativeCreate;
|
|
305
|
+
|
|
306
|
+
// ../../../node_modules/lodash-es/_hashClear.js
|
|
307
|
+
function hashClear() {
|
|
308
|
+
this.__data__ = nativeCreate_default ? nativeCreate_default(null) : {};
|
|
309
|
+
this.size = 0;
|
|
310
|
+
}
|
|
311
|
+
var hashClear_default = hashClear;
|
|
312
|
+
|
|
313
|
+
// ../../../node_modules/lodash-es/_hashDelete.js
|
|
314
|
+
function hashDelete(key) {
|
|
315
|
+
var result = this.has(key) && delete this.__data__[key];
|
|
316
|
+
this.size -= result ? 1 : 0;
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
var hashDelete_default = hashDelete;
|
|
320
|
+
|
|
321
|
+
// ../../../node_modules/lodash-es/_hashGet.js
|
|
322
|
+
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
323
|
+
var objectProto5 = Object.prototype;
|
|
324
|
+
var hasOwnProperty4 = objectProto5.hasOwnProperty;
|
|
325
|
+
function hashGet(key) {
|
|
326
|
+
var data = this.__data__;
|
|
327
|
+
if (nativeCreate_default) {
|
|
328
|
+
var result = data[key];
|
|
329
|
+
return result === HASH_UNDEFINED ? void 0 : result;
|
|
330
|
+
}
|
|
331
|
+
return hasOwnProperty4.call(data, key) ? data[key] : void 0;
|
|
332
|
+
}
|
|
333
|
+
var hashGet_default = hashGet;
|
|
334
|
+
|
|
335
|
+
// ../../../node_modules/lodash-es/_hashHas.js
|
|
336
|
+
var objectProto6 = Object.prototype;
|
|
337
|
+
var hasOwnProperty5 = objectProto6.hasOwnProperty;
|
|
338
|
+
function hashHas(key) {
|
|
339
|
+
var data = this.__data__;
|
|
340
|
+
return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty5.call(data, key);
|
|
341
|
+
}
|
|
342
|
+
var hashHas_default = hashHas;
|
|
343
|
+
|
|
344
|
+
// ../../../node_modules/lodash-es/_hashSet.js
|
|
345
|
+
var HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
346
|
+
function hashSet(key, value) {
|
|
347
|
+
var data = this.__data__;
|
|
348
|
+
this.size += this.has(key) ? 0 : 1;
|
|
349
|
+
data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value;
|
|
350
|
+
return this;
|
|
351
|
+
}
|
|
352
|
+
var hashSet_default = hashSet;
|
|
353
|
+
|
|
354
|
+
// ../../../node_modules/lodash-es/_Hash.js
|
|
355
|
+
function Hash(entries) {
|
|
356
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
357
|
+
this.clear();
|
|
358
|
+
while (++index < length) {
|
|
359
|
+
var entry = entries[index];
|
|
360
|
+
this.set(entry[0], entry[1]);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
Hash.prototype.clear = hashClear_default;
|
|
364
|
+
Hash.prototype["delete"] = hashDelete_default;
|
|
365
|
+
Hash.prototype.get = hashGet_default;
|
|
366
|
+
Hash.prototype.has = hashHas_default;
|
|
367
|
+
Hash.prototype.set = hashSet_default;
|
|
368
|
+
var Hash_default = Hash;
|
|
369
|
+
|
|
370
|
+
// ../../../node_modules/lodash-es/_listCacheClear.js
|
|
371
|
+
function listCacheClear() {
|
|
372
|
+
this.__data__ = [];
|
|
373
|
+
this.size = 0;
|
|
374
|
+
}
|
|
375
|
+
var listCacheClear_default = listCacheClear;
|
|
376
|
+
|
|
377
|
+
// ../../../node_modules/lodash-es/_assocIndexOf.js
|
|
378
|
+
function assocIndexOf(array2, key) {
|
|
379
|
+
var length = array2.length;
|
|
380
|
+
while (length--) {
|
|
381
|
+
if (eq_default(array2[length][0], key)) {
|
|
382
|
+
return length;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
return -1;
|
|
386
|
+
}
|
|
387
|
+
var assocIndexOf_default = assocIndexOf;
|
|
388
|
+
|
|
389
|
+
// ../../../node_modules/lodash-es/_listCacheDelete.js
|
|
390
|
+
var arrayProto = Array.prototype;
|
|
391
|
+
var splice = arrayProto.splice;
|
|
392
|
+
function listCacheDelete(key) {
|
|
393
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
394
|
+
if (index < 0) {
|
|
395
|
+
return false;
|
|
396
|
+
}
|
|
397
|
+
var lastIndex = data.length - 1;
|
|
398
|
+
if (index == lastIndex) {
|
|
399
|
+
data.pop();
|
|
400
|
+
} else {
|
|
401
|
+
splice.call(data, index, 1);
|
|
402
|
+
}
|
|
403
|
+
--this.size;
|
|
404
|
+
return true;
|
|
405
|
+
}
|
|
406
|
+
var listCacheDelete_default = listCacheDelete;
|
|
407
|
+
|
|
408
|
+
// ../../../node_modules/lodash-es/_listCacheGet.js
|
|
409
|
+
function listCacheGet(key) {
|
|
410
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
411
|
+
return index < 0 ? void 0 : data[index][1];
|
|
412
|
+
}
|
|
413
|
+
var listCacheGet_default = listCacheGet;
|
|
414
|
+
|
|
415
|
+
// ../../../node_modules/lodash-es/_listCacheHas.js
|
|
416
|
+
function listCacheHas(key) {
|
|
417
|
+
return assocIndexOf_default(this.__data__, key) > -1;
|
|
418
|
+
}
|
|
419
|
+
var listCacheHas_default = listCacheHas;
|
|
420
|
+
|
|
421
|
+
// ../../../node_modules/lodash-es/_listCacheSet.js
|
|
422
|
+
function listCacheSet(key, value) {
|
|
423
|
+
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
424
|
+
if (index < 0) {
|
|
425
|
+
++this.size;
|
|
426
|
+
data.push([key, value]);
|
|
427
|
+
} else {
|
|
428
|
+
data[index][1] = value;
|
|
429
|
+
}
|
|
430
|
+
return this;
|
|
431
|
+
}
|
|
432
|
+
var listCacheSet_default = listCacheSet;
|
|
433
|
+
|
|
434
|
+
// ../../../node_modules/lodash-es/_ListCache.js
|
|
435
|
+
function ListCache(entries) {
|
|
436
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
437
|
+
this.clear();
|
|
438
|
+
while (++index < length) {
|
|
439
|
+
var entry = entries[index];
|
|
440
|
+
this.set(entry[0], entry[1]);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
ListCache.prototype.clear = listCacheClear_default;
|
|
444
|
+
ListCache.prototype["delete"] = listCacheDelete_default;
|
|
445
|
+
ListCache.prototype.get = listCacheGet_default;
|
|
446
|
+
ListCache.prototype.has = listCacheHas_default;
|
|
447
|
+
ListCache.prototype.set = listCacheSet_default;
|
|
448
|
+
var ListCache_default = ListCache;
|
|
449
|
+
|
|
450
|
+
// ../../../node_modules/lodash-es/_Map.js
|
|
451
|
+
var Map2 = getNative_default(root_default, "Map");
|
|
452
|
+
var Map_default = Map2;
|
|
453
|
+
|
|
454
|
+
// ../../../node_modules/lodash-es/_mapCacheClear.js
|
|
455
|
+
function mapCacheClear() {
|
|
456
|
+
this.size = 0;
|
|
457
|
+
this.__data__ = {
|
|
458
|
+
"hash": new Hash_default(),
|
|
459
|
+
"map": new (Map_default || ListCache_default)(),
|
|
460
|
+
"string": new Hash_default()
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
var mapCacheClear_default = mapCacheClear;
|
|
464
|
+
|
|
465
|
+
// ../../../node_modules/lodash-es/_isKeyable.js
|
|
466
|
+
function isKeyable(value) {
|
|
467
|
+
var type = typeof value;
|
|
468
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
469
|
+
}
|
|
470
|
+
var isKeyable_default = isKeyable;
|
|
471
|
+
|
|
472
|
+
// ../../../node_modules/lodash-es/_getMapData.js
|
|
473
|
+
function getMapData(map, key) {
|
|
474
|
+
var data = map.__data__;
|
|
475
|
+
return isKeyable_default(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
476
|
+
}
|
|
477
|
+
var getMapData_default = getMapData;
|
|
478
|
+
|
|
479
|
+
// ../../../node_modules/lodash-es/_mapCacheDelete.js
|
|
480
|
+
function mapCacheDelete(key) {
|
|
481
|
+
var result = getMapData_default(this, key)["delete"](key);
|
|
482
|
+
this.size -= result ? 1 : 0;
|
|
483
|
+
return result;
|
|
484
|
+
}
|
|
485
|
+
var mapCacheDelete_default = mapCacheDelete;
|
|
486
|
+
|
|
487
|
+
// ../../../node_modules/lodash-es/_mapCacheGet.js
|
|
488
|
+
function mapCacheGet(key) {
|
|
489
|
+
return getMapData_default(this, key).get(key);
|
|
490
|
+
}
|
|
491
|
+
var mapCacheGet_default = mapCacheGet;
|
|
492
|
+
|
|
493
|
+
// ../../../node_modules/lodash-es/_mapCacheHas.js
|
|
494
|
+
function mapCacheHas(key) {
|
|
495
|
+
return getMapData_default(this, key).has(key);
|
|
496
|
+
}
|
|
497
|
+
var mapCacheHas_default = mapCacheHas;
|
|
498
|
+
|
|
499
|
+
// ../../../node_modules/lodash-es/_mapCacheSet.js
|
|
500
|
+
function mapCacheSet(key, value) {
|
|
501
|
+
var data = getMapData_default(this, key), size = data.size;
|
|
502
|
+
data.set(key, value);
|
|
503
|
+
this.size += data.size == size ? 0 : 1;
|
|
504
|
+
return this;
|
|
505
|
+
}
|
|
506
|
+
var mapCacheSet_default = mapCacheSet;
|
|
507
|
+
|
|
508
|
+
// ../../../node_modules/lodash-es/_MapCache.js
|
|
509
|
+
function MapCache(entries) {
|
|
510
|
+
var index = -1, length = entries == null ? 0 : entries.length;
|
|
511
|
+
this.clear();
|
|
512
|
+
while (++index < length) {
|
|
513
|
+
var entry = entries[index];
|
|
514
|
+
this.set(entry[0], entry[1]);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
MapCache.prototype.clear = mapCacheClear_default;
|
|
518
|
+
MapCache.prototype["delete"] = mapCacheDelete_default;
|
|
519
|
+
MapCache.prototype.get = mapCacheGet_default;
|
|
520
|
+
MapCache.prototype.has = mapCacheHas_default;
|
|
521
|
+
MapCache.prototype.set = mapCacheSet_default;
|
|
522
|
+
var MapCache_default = MapCache;
|
|
523
|
+
|
|
524
|
+
// ../../../node_modules/lodash-es/memoize.js
|
|
525
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
526
|
+
function memoize(func, resolver) {
|
|
527
|
+
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
528
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
529
|
+
}
|
|
530
|
+
var memoized = function() {
|
|
531
|
+
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
532
|
+
if (cache.has(key)) {
|
|
533
|
+
return cache.get(key);
|
|
534
|
+
}
|
|
535
|
+
var result = func.apply(this, args);
|
|
536
|
+
memoized.cache = cache.set(key, result) || cache;
|
|
537
|
+
return result;
|
|
538
|
+
};
|
|
539
|
+
memoized.cache = new (memoize.Cache || MapCache_default)();
|
|
540
|
+
return memoized;
|
|
541
|
+
}
|
|
542
|
+
memoize.Cache = MapCache_default;
|
|
543
|
+
var memoize_default = memoize;
|
|
544
|
+
|
|
545
|
+
// ../../../node_modules/lodash-es/_memoizeCapped.js
|
|
546
|
+
var MAX_MEMOIZE_SIZE = 500;
|
|
547
|
+
function memoizeCapped(func) {
|
|
548
|
+
var result = memoize_default(func, function(key) {
|
|
549
|
+
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
550
|
+
cache.clear();
|
|
551
|
+
}
|
|
552
|
+
return key;
|
|
553
|
+
});
|
|
554
|
+
var cache = result.cache;
|
|
555
|
+
return result;
|
|
556
|
+
}
|
|
557
|
+
var memoizeCapped_default = memoizeCapped;
|
|
558
|
+
|
|
559
|
+
// ../../../node_modules/lodash-es/_stringToPath.js
|
|
560
|
+
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
561
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
562
|
+
var stringToPath = memoizeCapped_default(function(string) {
|
|
563
|
+
var result = [];
|
|
564
|
+
if (string.charCodeAt(0) === 46) {
|
|
565
|
+
result.push("");
|
|
566
|
+
}
|
|
567
|
+
string.replace(rePropName, function(match, number, quote, subString) {
|
|
568
|
+
result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
569
|
+
});
|
|
570
|
+
return result;
|
|
571
|
+
});
|
|
572
|
+
var stringToPath_default = stringToPath;
|
|
573
|
+
|
|
574
|
+
// ../../../node_modules/lodash-es/toString.js
|
|
575
|
+
function toString(value) {
|
|
576
|
+
return value == null ? "" : baseToString_default(value);
|
|
577
|
+
}
|
|
578
|
+
var toString_default = toString;
|
|
579
|
+
|
|
580
|
+
// ../../../node_modules/lodash-es/_castPath.js
|
|
581
|
+
function castPath(value, object) {
|
|
582
|
+
if (isArray_default(value)) {
|
|
583
|
+
return value;
|
|
584
|
+
}
|
|
585
|
+
return isKey_default(value, object) ? [value] : stringToPath_default(toString_default(value));
|
|
586
|
+
}
|
|
587
|
+
var castPath_default = castPath;
|
|
588
|
+
|
|
589
|
+
// ../../../node_modules/lodash-es/_toKey.js
|
|
590
|
+
var INFINITY2 = 1 / 0;
|
|
591
|
+
function toKey(value) {
|
|
592
|
+
if (typeof value == "string" || isSymbol_default(value)) {
|
|
593
|
+
return value;
|
|
594
|
+
}
|
|
595
|
+
var result = value + "";
|
|
596
|
+
return result == "0" && 1 / value == -INFINITY2 ? "-0" : result;
|
|
597
|
+
}
|
|
598
|
+
var toKey_default = toKey;
|
|
599
|
+
|
|
600
|
+
// ../../../node_modules/lodash-es/_baseSlice.js
|
|
601
|
+
function baseSlice(array2, start, end) {
|
|
602
|
+
var index = -1, length = array2.length;
|
|
603
|
+
if (start < 0) {
|
|
604
|
+
start = -start > length ? 0 : length + start;
|
|
605
|
+
}
|
|
606
|
+
end = end > length ? length : end;
|
|
607
|
+
if (end < 0) {
|
|
608
|
+
end += length;
|
|
609
|
+
}
|
|
610
|
+
length = start > end ? 0 : end - start >>> 0;
|
|
611
|
+
start >>>= 0;
|
|
612
|
+
var result = Array(length);
|
|
613
|
+
while (++index < length) {
|
|
614
|
+
result[index] = array2[index + start];
|
|
615
|
+
}
|
|
616
|
+
return result;
|
|
617
|
+
}
|
|
618
|
+
var baseSlice_default = baseSlice;
|
|
619
|
+
|
|
620
|
+
// ../../../node_modules/lodash-es/_castSlice.js
|
|
621
|
+
function castSlice(array2, start, end) {
|
|
622
|
+
var length = array2.length;
|
|
623
|
+
end = end === void 0 ? length : end;
|
|
624
|
+
return !start && end >= length ? array2 : baseSlice_default(array2, start, end);
|
|
625
|
+
}
|
|
626
|
+
var castSlice_default = castSlice;
|
|
627
|
+
|
|
628
|
+
// ../../../node_modules/lodash-es/_hasUnicode.js
|
|
629
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
630
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
631
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
632
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
633
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
634
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
635
|
+
var rsZWJ = "\\u200d";
|
|
636
|
+
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
637
|
+
function hasUnicode(string) {
|
|
638
|
+
return reHasUnicode.test(string);
|
|
639
|
+
}
|
|
640
|
+
var hasUnicode_default = hasUnicode;
|
|
641
|
+
|
|
642
|
+
// ../../../node_modules/lodash-es/_asciiToArray.js
|
|
643
|
+
function asciiToArray(string) {
|
|
644
|
+
return string.split("");
|
|
645
|
+
}
|
|
646
|
+
var asciiToArray_default = asciiToArray;
|
|
647
|
+
|
|
648
|
+
// ../../../node_modules/lodash-es/_unicodeToArray.js
|
|
649
|
+
var rsAstralRange2 = "\\ud800-\\udfff";
|
|
650
|
+
var rsComboMarksRange2 = "\\u0300-\\u036f";
|
|
651
|
+
var reComboHalfMarksRange2 = "\\ufe20-\\ufe2f";
|
|
652
|
+
var rsComboSymbolsRange2 = "\\u20d0-\\u20ff";
|
|
653
|
+
var rsComboRange2 = rsComboMarksRange2 + reComboHalfMarksRange2 + rsComboSymbolsRange2;
|
|
654
|
+
var rsVarRange2 = "\\ufe0e\\ufe0f";
|
|
655
|
+
var rsAstral = "[" + rsAstralRange2 + "]";
|
|
656
|
+
var rsCombo = "[" + rsComboRange2 + "]";
|
|
657
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
658
|
+
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
659
|
+
var rsNonAstral = "[^" + rsAstralRange2 + "]";
|
|
660
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
661
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
662
|
+
var rsZWJ2 = "\\u200d";
|
|
663
|
+
var reOptMod = rsModifier + "?";
|
|
664
|
+
var rsOptVar = "[" + rsVarRange2 + "]?";
|
|
665
|
+
var rsOptJoin = "(?:" + rsZWJ2 + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
666
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
667
|
+
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
668
|
+
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
669
|
+
function unicodeToArray(string) {
|
|
670
|
+
return string.match(reUnicode) || [];
|
|
671
|
+
}
|
|
672
|
+
var unicodeToArray_default = unicodeToArray;
|
|
673
|
+
|
|
674
|
+
// ../../../node_modules/lodash-es/_stringToArray.js
|
|
675
|
+
function stringToArray(string) {
|
|
676
|
+
return hasUnicode_default(string) ? unicodeToArray_default(string) : asciiToArray_default(string);
|
|
677
|
+
}
|
|
678
|
+
var stringToArray_default = stringToArray;
|
|
679
|
+
|
|
680
|
+
// ../../../node_modules/lodash-es/_hasPath.js
|
|
681
|
+
function hasPath(object, path, hasFunc) {
|
|
682
|
+
path = castPath_default(path, object);
|
|
683
|
+
var index = -1, length = path.length, result = false;
|
|
684
|
+
while (++index < length) {
|
|
685
|
+
var key = toKey_default(path[index]);
|
|
686
|
+
if (!(result = object != null && hasFunc(object, key))) {
|
|
687
|
+
break;
|
|
688
|
+
}
|
|
689
|
+
object = object[key];
|
|
690
|
+
}
|
|
691
|
+
if (result || ++index != length) {
|
|
692
|
+
return result;
|
|
693
|
+
}
|
|
694
|
+
length = object == null ? 0 : object.length;
|
|
695
|
+
return !!length && isLength_default(length) && isIndex_default(key, length) && (isArray_default(object) || isArguments_default(object));
|
|
696
|
+
}
|
|
697
|
+
var hasPath_default = hasPath;
|
|
698
|
+
|
|
699
|
+
// ../../../node_modules/lodash-es/_baseHas.js
|
|
700
|
+
var objectProto7 = Object.prototype;
|
|
701
|
+
var hasOwnProperty6 = objectProto7.hasOwnProperty;
|
|
702
|
+
function baseHas(object, key) {
|
|
703
|
+
return object != null && hasOwnProperty6.call(object, key);
|
|
704
|
+
}
|
|
705
|
+
var baseHas_default = baseHas;
|
|
706
|
+
|
|
707
|
+
// ../../../node_modules/lodash-es/has.js
|
|
708
|
+
function has(object, path) {
|
|
709
|
+
return object != null && hasPath_default(object, path, baseHas_default);
|
|
710
|
+
}
|
|
711
|
+
var has_default = has;
|
|
712
|
+
|
|
713
|
+
// ../../../node_modules/lodash-es/_charsEndIndex.js
|
|
714
|
+
function charsEndIndex(strSymbols, chrSymbols) {
|
|
715
|
+
var index = strSymbols.length;
|
|
716
|
+
while (index-- && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
717
|
+
}
|
|
718
|
+
return index;
|
|
719
|
+
}
|
|
720
|
+
var charsEndIndex_default = charsEndIndex;
|
|
721
|
+
|
|
722
|
+
// ../../../node_modules/lodash-es/_charsStartIndex.js
|
|
723
|
+
function charsStartIndex(strSymbols, chrSymbols) {
|
|
724
|
+
var index = -1, length = strSymbols.length;
|
|
725
|
+
while (++index < length && baseIndexOf_default(chrSymbols, strSymbols[index], 0) > -1) {
|
|
726
|
+
}
|
|
727
|
+
return index;
|
|
728
|
+
}
|
|
729
|
+
var charsStartIndex_default = charsStartIndex;
|
|
730
|
+
|
|
731
|
+
// ../../../node_modules/lodash-es/trim.js
|
|
732
|
+
function trim(string, chars, guard) {
|
|
733
|
+
string = toString_default(string);
|
|
734
|
+
if (string && (guard || chars === void 0)) {
|
|
735
|
+
return baseTrim_default(string);
|
|
736
|
+
}
|
|
737
|
+
if (!string || !(chars = baseToString_default(chars))) {
|
|
738
|
+
return string;
|
|
739
|
+
}
|
|
740
|
+
var strSymbols = stringToArray_default(string), chrSymbols = stringToArray_default(chars), start = charsStartIndex_default(strSymbols, chrSymbols), end = charsEndIndex_default(strSymbols, chrSymbols) + 1;
|
|
741
|
+
return castSlice_default(strSymbols, start, end).join("");
|
|
742
|
+
}
|
|
743
|
+
var trim_default = trim;
|
|
744
|
+
|
|
745
|
+
// ../../utils/src/config/env.ts
|
|
746
|
+
function _env(key, defaultValue) {
|
|
747
|
+
return has_default(process.env, key) ? process.env[key] ?? "" : defaultValue ?? "";
|
|
748
|
+
}
|
|
749
|
+
function int(key, defaultValue) {
|
|
750
|
+
if (!has_default(process.env, key)) {
|
|
751
|
+
return defaultValue ?? 0;
|
|
752
|
+
}
|
|
753
|
+
const value = process.env[key] ?? "0";
|
|
754
|
+
return parseInt(value, 10);
|
|
755
|
+
}
|
|
756
|
+
function float(key, defaultValue) {
|
|
757
|
+
if (!has_default(process.env, key)) {
|
|
758
|
+
return defaultValue ?? 0;
|
|
759
|
+
}
|
|
760
|
+
const value = process.env[key] ?? "0";
|
|
761
|
+
return parseFloat(value);
|
|
762
|
+
}
|
|
763
|
+
function bool(key, defaultValue) {
|
|
764
|
+
if (!has_default(process.env, key)) {
|
|
765
|
+
return defaultValue ?? false;
|
|
766
|
+
}
|
|
767
|
+
const value = process.env[key];
|
|
768
|
+
return value === "true";
|
|
769
|
+
}
|
|
770
|
+
function json(key, defaultValue) {
|
|
771
|
+
if (!has_default(process.env, key)) {
|
|
772
|
+
return defaultValue ?? {};
|
|
773
|
+
}
|
|
774
|
+
const value = process.env[key] ?? "{}";
|
|
775
|
+
try {
|
|
776
|
+
return JSON.parse(value);
|
|
777
|
+
} catch (error) {
|
|
778
|
+
throw new Error(`Invalid json environment variable ${key}: ${error.message}`);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
function array(key, defaultValue) {
|
|
782
|
+
if (!has_default(process.env, key)) {
|
|
783
|
+
return defaultValue ?? [];
|
|
784
|
+
}
|
|
785
|
+
let value = process.env[key] ?? "";
|
|
786
|
+
if (value.startsWith("[") && value.endsWith("]")) {
|
|
787
|
+
value = value.substring(1, value.length - 1);
|
|
788
|
+
}
|
|
789
|
+
return value.split(",").map((v) => {
|
|
790
|
+
return trim_default(trim_default(v, " "), '"');
|
|
791
|
+
});
|
|
792
|
+
}
|
|
793
|
+
function date(key, defaultValue) {
|
|
794
|
+
if (!has_default(process.env, key)) {
|
|
795
|
+
return defaultValue ?? /* @__PURE__ */ new Date();
|
|
796
|
+
}
|
|
797
|
+
const value = process.env[key] ?? Date();
|
|
798
|
+
return new Date(value);
|
|
799
|
+
}
|
|
800
|
+
var utils = {
|
|
801
|
+
int,
|
|
802
|
+
float,
|
|
803
|
+
bool,
|
|
804
|
+
json,
|
|
805
|
+
array,
|
|
806
|
+
date,
|
|
807
|
+
/**
|
|
808
|
+
* Gets a value from env that matches oneOf provided values
|
|
809
|
+
* @param {string} key
|
|
810
|
+
* @param {string[]} expectedValues
|
|
811
|
+
* @param {string|undefined} defaultValue
|
|
812
|
+
* @returns {string|undefined}
|
|
813
|
+
*/
|
|
814
|
+
oneOf(key, expectedValues, defaultValue) {
|
|
815
|
+
if (!expectedValues) {
|
|
816
|
+
throw new Error(`env.oneOf requires expectedValues`);
|
|
817
|
+
}
|
|
818
|
+
if (defaultValue && !expectedValues.includes(defaultValue)) {
|
|
819
|
+
throw new Error(`env.oneOf requires defaultValue to be included in expectedValues`);
|
|
820
|
+
}
|
|
821
|
+
const rawValue = env(key, defaultValue);
|
|
822
|
+
return expectedValues.includes(rawValue) ? rawValue : defaultValue ?? "";
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
var env = Object.assign(_env, utils);
|
|
826
|
+
|
|
827
|
+
// ../../utils/src/logging/types.ts
|
|
828
|
+
var logLevels = {
|
|
829
|
+
fatal: -1,
|
|
830
|
+
error: 0,
|
|
831
|
+
warn: 1,
|
|
832
|
+
info: 2,
|
|
833
|
+
debug: 3,
|
|
834
|
+
trace: 4
|
|
835
|
+
};
|
|
836
|
+
|
|
837
|
+
// ../../utils/src/logging/error-to-string.ts
|
|
838
|
+
var safeJsonStringify = (value) => {
|
|
839
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
840
|
+
return JSON.stringify(value, (key, currentValue) => {
|
|
841
|
+
if (key === "constructor") return void 0;
|
|
842
|
+
if (typeof currentValue === "object" && currentValue !== null) {
|
|
843
|
+
if (seen.has(currentValue)) return "[Circular]";
|
|
844
|
+
seen.add(currentValue);
|
|
845
|
+
}
|
|
846
|
+
return currentValue;
|
|
847
|
+
});
|
|
848
|
+
};
|
|
849
|
+
var hasOwnConstructorProp = (value) => {
|
|
850
|
+
if (typeof value !== "object" || value === null) return false;
|
|
851
|
+
return Object.prototype.hasOwnProperty.call(value, "constructor");
|
|
852
|
+
};
|
|
853
|
+
var errorToString = (error) => {
|
|
854
|
+
if (error === null) return "Null error";
|
|
855
|
+
if (error === void 0) return "Undefined error";
|
|
856
|
+
if (error instanceof Error) {
|
|
857
|
+
return [
|
|
858
|
+
`Name: ${error.name}`,
|
|
859
|
+
`Message: ${error.message}`,
|
|
860
|
+
`Stack: ${error.stack || "No stack trace available"}`,
|
|
861
|
+
// Handle additional properties that might exist on custom errors
|
|
862
|
+
...Object.entries(error).filter(
|
|
863
|
+
([key, value]) => !["name", "message", "stack"].includes(key) && !hasOwnConstructorProp(value)
|
|
864
|
+
).map(([key, value]) => `${key}: ${safeJsonStringify(value)}`)
|
|
865
|
+
].join("\n");
|
|
866
|
+
}
|
|
867
|
+
if (typeof error === "string") return error;
|
|
868
|
+
if (typeof error === "object") {
|
|
869
|
+
try {
|
|
870
|
+
return JSON.stringify(
|
|
871
|
+
error,
|
|
872
|
+
(key, value) => {
|
|
873
|
+
if (key === "constructor") return void 0;
|
|
874
|
+
return value;
|
|
875
|
+
},
|
|
876
|
+
2
|
|
877
|
+
);
|
|
878
|
+
} catch {
|
|
879
|
+
return `[Object that cannot be stringified: ${Object.prototype.toString.call(error)}]`;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
return String(error);
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
// ../../utils/src/logging/writer.ts
|
|
886
|
+
import { EOL } from "os";
|
|
887
|
+
var jsonWriter = (entry) => {
|
|
888
|
+
process.stdout.write(JSON.stringify(entry) + EOL);
|
|
889
|
+
};
|
|
890
|
+
var _writer = jsonWriter;
|
|
891
|
+
function setWriter(writer) {
|
|
892
|
+
_writer = writer;
|
|
893
|
+
}
|
|
894
|
+
function getWriter() {
|
|
895
|
+
return _writer;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
// ../../utils/src/logging/index.ts
|
|
899
|
+
var levelValues = {
|
|
900
|
+
fatal: 70,
|
|
901
|
+
error: 60,
|
|
902
|
+
warn: 50,
|
|
903
|
+
info: 40,
|
|
904
|
+
debug: 30,
|
|
905
|
+
trace: 20
|
|
906
|
+
};
|
|
907
|
+
var currentLogLevel = 2;
|
|
908
|
+
var _module = "default";
|
|
909
|
+
var _requestId = "";
|
|
910
|
+
function writeLine(level, mergeObject, msg, bindings) {
|
|
911
|
+
getWriter()({
|
|
912
|
+
level: levelValues[level],
|
|
913
|
+
levelName: level,
|
|
914
|
+
time: Date.now(),
|
|
915
|
+
module: bindings.module || _module,
|
|
916
|
+
reqId: bindings.reqId || _requestId,
|
|
917
|
+
msg: level === "error" || level === "fatal" ? errorToString(msg) : msg,
|
|
918
|
+
...mergeObject ? { meta: mergeObject } : {}
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
function createLogger(bindings = {}) {
|
|
922
|
+
const currentLogLevelName = env("LOG_LEVEL")?.toLowerCase() ?? "info";
|
|
923
|
+
currentLogLevel = logLevels[currentLogLevelName] ?? logLevels.info;
|
|
924
|
+
return {
|
|
925
|
+
level: currentLogLevelName,
|
|
926
|
+
fatal: (mergeObject, msg) => {
|
|
927
|
+
if (currentLogLevel >= logLevels.fatal) {
|
|
928
|
+
typeof mergeObject === "string" || mergeObject instanceof Error ? writeLine("fatal", null, mergeObject, bindings) : writeLine("fatal", mergeObject, msg ?? "", bindings);
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
error: (mergeObject, msg) => {
|
|
932
|
+
if (currentLogLevel >= logLevels.error) {
|
|
933
|
+
typeof mergeObject === "string" || mergeObject instanceof Error ? writeLine("error", null, mergeObject, bindings) : writeLine("error", mergeObject, msg ?? "", bindings);
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
warn: (mergeObject, msg) => {
|
|
937
|
+
if (currentLogLevel >= logLevels.warn) {
|
|
938
|
+
typeof mergeObject === "string" ? writeLine("warn", null, mergeObject, bindings) : writeLine("warn", mergeObject, msg ?? "", bindings);
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
info: (mergeObject, msg) => {
|
|
942
|
+
if (currentLogLevel >= logLevels.info) {
|
|
943
|
+
typeof mergeObject === "string" ? writeLine("info", null, mergeObject, bindings) : writeLine("info", mergeObject, msg ?? "", bindings);
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
debug: (mergeObject, msg) => {
|
|
947
|
+
if (currentLogLevel >= logLevels.debug) {
|
|
948
|
+
typeof mergeObject === "string" ? writeLine("debug", null, mergeObject, bindings) : writeLine("debug", mergeObject, msg ?? "", bindings);
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
trace: (mergeObject, msg) => {
|
|
952
|
+
if (currentLogLevel >= logLevels.trace) {
|
|
953
|
+
typeof mergeObject === "string" ? writeLine("trace", null, mergeObject, bindings) : writeLine("trace", mergeObject, msg ?? "", bindings);
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
silent: () => {
|
|
957
|
+
},
|
|
958
|
+
child: (childBindings) => createLogger({ ...bindings, ...childBindings })
|
|
959
|
+
};
|
|
960
|
+
}
|
|
961
|
+
var logger = createLogger();
|
|
962
|
+
|
|
963
|
+
// src/logging/pretty-writer.ts
|
|
964
|
+
var levelColor = {
|
|
965
|
+
fatal: chalk.bgRed.white,
|
|
966
|
+
error: chalk.red,
|
|
967
|
+
warn: chalk.yellow,
|
|
968
|
+
info: chalk.cyan,
|
|
969
|
+
debug: chalk.gray,
|
|
970
|
+
trace: chalk.white
|
|
971
|
+
};
|
|
972
|
+
function formatTime(ms) {
|
|
973
|
+
return new Date(ms).toTimeString().slice(0, 8);
|
|
974
|
+
}
|
|
975
|
+
function formatMeta(meta) {
|
|
976
|
+
const { req, res, ...rest } = meta;
|
|
977
|
+
const lines = [];
|
|
978
|
+
if (req) {
|
|
979
|
+
const reqParts = [`${req.method} ${req.url}`];
|
|
980
|
+
if (req.remoteAddress) reqParts.push(`from ${req.remoteAddress}:${req.remotePort ?? ""}`);
|
|
981
|
+
if (req.headers) reqParts.push(`headers=${JSON.stringify(req.headers, null, 2)}`);
|
|
982
|
+
if (req.body !== void 0) reqParts.push(`body=${typeof req.body === "string" ? req.body : JSON.stringify(req.body, null, 2)}`);
|
|
983
|
+
lines.push(chalk.dim(" req: " + reqParts.join(" ")));
|
|
984
|
+
}
|
|
985
|
+
if (res) {
|
|
986
|
+
const resParts = [`${res.statusCode}`];
|
|
987
|
+
if (res.headers) resParts.push(`headers=${JSON.stringify(res.headers, null, 2)}`);
|
|
988
|
+
if (res.body !== void 0) resParts.push(`body=${typeof res.body === "string" ? res.body : JSON.stringify(res.body, null, 2)}`);
|
|
989
|
+
lines.push(chalk.dim(" res: " + resParts.join(" ")));
|
|
990
|
+
}
|
|
991
|
+
if (Object.keys(rest).length) {
|
|
992
|
+
lines.push(chalk.dim(" " + JSON.stringify(rest, null, 2)));
|
|
993
|
+
}
|
|
994
|
+
return lines.length ? EOL2 + lines.join(EOL2) : "";
|
|
995
|
+
}
|
|
996
|
+
var prettyWriter = (entry) => {
|
|
997
|
+
const color = levelColor[entry.levelName] ?? chalk.white;
|
|
998
|
+
const time = chalk.dim(formatTime(entry.time));
|
|
999
|
+
const level = color(entry.levelName.toUpperCase().padEnd(5));
|
|
1000
|
+
const module = chalk.magenta(entry.module);
|
|
1001
|
+
const reqId = entry.reqId ? chalk.dim(`[${entry.reqId}]`) + " " : "";
|
|
1002
|
+
const meta = entry.meta ? formatMeta(entry.meta) : "";
|
|
1003
|
+
process.stdout.write(`${time} ${level} ${module} ${reqId}- ${entry.msg}${meta}${EOL2}`);
|
|
1004
|
+
};
|
|
1005
|
+
setWriter(prettyWriter);
|
|
1006
|
+
|
|
1
1007
|
// src/websocket-plugin/plugin.ts
|
|
2
1008
|
import crypto from "crypto";
|
|
3
1009
|
import fsPlugin from "fastify-plugin";
|
|
@@ -13,12 +1019,25 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
13
1019
|
const connections = /* @__PURE__ */ new Map();
|
|
14
1020
|
const handlers = [];
|
|
15
1021
|
const registeredPaths = /* @__PURE__ */ new Set();
|
|
1022
|
+
const pathModuleMap = /* @__PURE__ */ new Map();
|
|
16
1023
|
await app.register(websocketPlugin);
|
|
17
1024
|
function ensureRouteForPath(path) {
|
|
18
1025
|
if (registeredPaths.has(path)) return;
|
|
19
1026
|
registeredPaths.add(path);
|
|
20
|
-
app.get(path, {
|
|
21
|
-
|
|
1027
|
+
app.get(path, {
|
|
1028
|
+
websocket: true,
|
|
1029
|
+
preHandler: async (request, reply) => {
|
|
1030
|
+
const connectionId = crypto.randomUUID();
|
|
1031
|
+
request._wsConnectionId = connectionId;
|
|
1032
|
+
const connectHandlers = handlers.filter((h) => h.path === path && h.event === "connect");
|
|
1033
|
+
for (const h of connectHandlers) {
|
|
1034
|
+
await h.handler(connectionId, "connect", null, request, reply);
|
|
1035
|
+
}
|
|
1036
|
+
if (reply.statusCode !== 200)
|
|
1037
|
+
return reply;
|
|
1038
|
+
}
|
|
1039
|
+
}, (socket, request) => {
|
|
1040
|
+
const connectionId = request._wsConnectionId ?? crypto.randomUUID();
|
|
22
1041
|
const connection = {
|
|
23
1042
|
connectionId,
|
|
24
1043
|
socket,
|
|
@@ -27,15 +1046,15 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
27
1046
|
};
|
|
28
1047
|
connections.set(connectionId, connection);
|
|
29
1048
|
const pathHandlers = () => handlers.filter((h) => h.path === path);
|
|
30
|
-
const connectHandlers = pathHandlers().filter((h) => h.event === "connect");
|
|
31
|
-
for (const h of connectHandlers) {
|
|
32
|
-
h.handler(connectionId, "connect").catch(() => {
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
1049
|
socket.on("message", (raw) => {
|
|
36
1050
|
const data = raw.toString();
|
|
37
1051
|
const currentHandlers = pathHandlers();
|
|
38
|
-
|
|
1052
|
+
let routeKey;
|
|
1053
|
+
try {
|
|
1054
|
+
const parsed = JSON.parse(data);
|
|
1055
|
+
routeKey = parsed?.[config.routeKeyField];
|
|
1056
|
+
} catch {
|
|
1057
|
+
}
|
|
39
1058
|
let matched = false;
|
|
40
1059
|
if (routeKey) {
|
|
41
1060
|
const routeHandlers = currentHandlers.filter(
|
|
@@ -43,7 +1062,8 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
43
1062
|
);
|
|
44
1063
|
for (const h of routeHandlers) {
|
|
45
1064
|
matched = true;
|
|
46
|
-
h.handler(connectionId, "message", data).catch(() => {
|
|
1065
|
+
h.handler(connectionId, "message", data, request).catch((e) => {
|
|
1066
|
+
logger.error(e);
|
|
47
1067
|
});
|
|
48
1068
|
}
|
|
49
1069
|
}
|
|
@@ -52,7 +1072,8 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
52
1072
|
(h) => h.event === "message" && !h.route
|
|
53
1073
|
);
|
|
54
1074
|
for (const h of defaultHandlers) {
|
|
55
|
-
h.handler(connectionId, "message", data).catch(() => {
|
|
1075
|
+
h.handler(connectionId, "message", data, request).catch((e) => {
|
|
1076
|
+
logger.error(e);
|
|
56
1077
|
});
|
|
57
1078
|
}
|
|
58
1079
|
}
|
|
@@ -60,7 +1081,8 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
60
1081
|
socket.on("close", () => {
|
|
61
1082
|
const disconnectHandlers = pathHandlers().filter((h) => h.event === "disconnect");
|
|
62
1083
|
for (const h of disconnectHandlers) {
|
|
63
|
-
h.handler(connectionId, "disconnect").catch(() => {
|
|
1084
|
+
h.handler(connectionId, "disconnect", null, request).catch((e) => {
|
|
1085
|
+
logger.error(e);
|
|
64
1086
|
});
|
|
65
1087
|
}
|
|
66
1088
|
connections.delete(connectionId);
|
|
@@ -70,6 +1092,9 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
70
1092
|
const manager = {
|
|
71
1093
|
registerHandler(handler) {
|
|
72
1094
|
handlers.push(handler);
|
|
1095
|
+
if (!pathModuleMap.has(handler.path)) {
|
|
1096
|
+
pathModuleMap.set(handler.path, handler.module);
|
|
1097
|
+
}
|
|
73
1098
|
ensureRouteForPath(handler.path);
|
|
74
1099
|
},
|
|
75
1100
|
getConnections(path) {
|
|
@@ -79,6 +1104,13 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
79
1104
|
}
|
|
80
1105
|
return allConnections;
|
|
81
1106
|
},
|
|
1107
|
+
getRegisteredPaths(module) {
|
|
1108
|
+
const all = Array.from(pathModuleMap.entries()).map(([path, mod]) => ({ path, module: mod }));
|
|
1109
|
+
if (module) {
|
|
1110
|
+
return all.filter((p) => p.module === module);
|
|
1111
|
+
}
|
|
1112
|
+
return all;
|
|
1113
|
+
},
|
|
82
1114
|
async sendToClient(connectionId, data) {
|
|
83
1115
|
const connection = connections.get(connectionId);
|
|
84
1116
|
if (!connection) {
|
|
@@ -86,6 +1118,13 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
86
1118
|
}
|
|
87
1119
|
const payload = typeof data === "string" ? data : JSON.stringify(data);
|
|
88
1120
|
connection.socket.send(payload);
|
|
1121
|
+
},
|
|
1122
|
+
async disconnect(connectionId) {
|
|
1123
|
+
const connection = connections.get(connectionId);
|
|
1124
|
+
if (!connection) {
|
|
1125
|
+
throw new Error(`WebSocket connection ${connectionId} not found`);
|
|
1126
|
+
}
|
|
1127
|
+
connection.socket.close();
|
|
89
1128
|
}
|
|
90
1129
|
};
|
|
91
1130
|
app.decorate("websockets", manager);
|
|
@@ -93,4 +1132,17 @@ var websocketsPlugin = fsPlugin(async (app, options) => {
|
|
|
93
1132
|
export {
|
|
94
1133
|
websocketsPlugin
|
|
95
1134
|
};
|
|
1135
|
+
/*! Bundled license information:
|
|
1136
|
+
|
|
1137
|
+
lodash-es/lodash.js:
|
|
1138
|
+
(**
|
|
1139
|
+
* @license
|
|
1140
|
+
* Lodash (Custom Build) <https://lodash.com/>
|
|
1141
|
+
* Build: `lodash modularize exports="es" -o ./`
|
|
1142
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
1143
|
+
* Released under MIT license <https://lodash.com/license>
|
|
1144
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
1145
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
1146
|
+
*)
|
|
1147
|
+
*/
|
|
96
1148
|
//# sourceMappingURL=index.js.map
|