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