@orion-js/services 4.0.0-next.3 → 4.0.0-next.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,827 +1,488 @@
1
- // node_modules/.pnpm/reflect-metadata@0.1.14/node_modules/reflect-metadata/Reflect.js
2
- var Reflect;
3
- (function(Reflect2) {
4
- (function(factory) {
5
- var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : Function("return this;")();
6
- var exporter = makeExporter(Reflect2);
7
- if (typeof root.Reflect === "undefined") {
8
- root.Reflect = Reflect2;
9
- } else {
10
- exporter = makeExporter(root.Reflect, exporter);
11
- }
12
- factory(exporter);
13
- function makeExporter(target, previous) {
14
- return function(key, value) {
15
- if (typeof target[key] !== "function") {
16
- Object.defineProperty(target, key, { configurable: true, writable: true, value });
17
- }
18
- if (previous)
19
- previous(key, value);
20
- };
21
- }
22
- })(function(exporter) {
23
- var hasOwn = Object.prototype.hasOwnProperty;
24
- var supportsSymbol = typeof Symbol === "function";
25
- var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
26
- var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
27
- var supportsCreate = typeof Object.create === "function";
28
- var supportsProto = { __proto__: [] } instanceof Array;
29
- var downLevel = !supportsCreate && !supportsProto;
30
- var HashMap = {
31
- // create an object in dictionary mode (a.k.a. "slow" mode in v8)
32
- create: supportsCreate ? function() {
33
- return MakeDictionary(/* @__PURE__ */ Object.create(null));
34
- } : supportsProto ? function() {
35
- return MakeDictionary({ __proto__: null });
36
- } : function() {
37
- return MakeDictionary({});
38
- },
39
- has: downLevel ? function(map, key) {
40
- return hasOwn.call(map, key);
41
- } : function(map, key) {
42
- return key in map;
43
- },
44
- get: downLevel ? function(map, key) {
45
- return hasOwn.call(map, key) ? map[key] : void 0;
46
- } : function(map, key) {
47
- return map[key];
48
- }
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ // ../../node_modules/.pnpm/object-hash@2.2.0/node_modules/object-hash/index.js
34
+ var require_object_hash = __commonJS({
35
+ "../../node_modules/.pnpm/object-hash@2.2.0/node_modules/object-hash/index.js"(exports, module) {
36
+ "use strict";
37
+ var crypto2 = __require("crypto");
38
+ exports = module.exports = objectHash;
39
+ function objectHash(object, options) {
40
+ options = applyDefaults(object, options);
41
+ return hash2(object, options);
42
+ }
43
+ exports.sha1 = function(object) {
44
+ return objectHash(object);
49
45
  };
50
- var functionPrototype = Object.getPrototypeOf(Function);
51
- var usePolyfill = typeof process === "object" && process["env"] && process["env"]["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
52
- var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
53
- var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
54
- var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
55
- var Metadata = new _WeakMap();
56
- function decorate(decorators, target, propertyKey, attributes) {
57
- if (!IsUndefined(propertyKey)) {
58
- if (!IsArray(decorators))
59
- throw new TypeError();
60
- if (!IsObject(target))
61
- throw new TypeError();
62
- if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
63
- throw new TypeError();
64
- if (IsNull(attributes))
65
- attributes = void 0;
66
- propertyKey = ToPropertyKey(propertyKey);
67
- return DecorateProperty(decorators, target, propertyKey, attributes);
68
- } else {
69
- if (!IsArray(decorators))
70
- throw new TypeError();
71
- if (!IsConstructor(target))
72
- throw new TypeError();
73
- return DecorateConstructor(decorators, target);
74
- }
75
- }
76
- exporter("decorate", decorate);
77
- function metadata(metadataKey, metadataValue) {
78
- function decorator(target, propertyKey) {
79
- if (!IsObject(target))
80
- throw new TypeError();
81
- if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
82
- throw new TypeError();
83
- OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
84
- }
85
- return decorator;
86
- }
87
- exporter("metadata", metadata);
88
- function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
89
- if (!IsObject(target))
90
- throw new TypeError();
91
- if (!IsUndefined(propertyKey))
92
- propertyKey = ToPropertyKey(propertyKey);
93
- return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
94
- }
95
- exporter("defineMetadata", defineMetadata);
96
- function hasMetadata(metadataKey, target, propertyKey) {
97
- if (!IsObject(target))
98
- throw new TypeError();
99
- if (!IsUndefined(propertyKey))
100
- propertyKey = ToPropertyKey(propertyKey);
101
- return OrdinaryHasMetadata(metadataKey, target, propertyKey);
102
- }
103
- exporter("hasMetadata", hasMetadata);
104
- function hasOwnMetadata(metadataKey, target, propertyKey) {
105
- if (!IsObject(target))
106
- throw new TypeError();
107
- if (!IsUndefined(propertyKey))
108
- propertyKey = ToPropertyKey(propertyKey);
109
- return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
110
- }
111
- exporter("hasOwnMetadata", hasOwnMetadata);
112
- function getMetadata(metadataKey, target, propertyKey) {
113
- if (!IsObject(target))
114
- throw new TypeError();
115
- if (!IsUndefined(propertyKey))
116
- propertyKey = ToPropertyKey(propertyKey);
117
- return OrdinaryGetMetadata(metadataKey, target, propertyKey);
118
- }
119
- exporter("getMetadata", getMetadata);
120
- function getOwnMetadata(metadataKey, target, propertyKey) {
121
- if (!IsObject(target))
122
- throw new TypeError();
123
- if (!IsUndefined(propertyKey))
124
- propertyKey = ToPropertyKey(propertyKey);
125
- return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
126
- }
127
- exporter("getOwnMetadata", getOwnMetadata);
128
- function getMetadataKeys(target, propertyKey) {
129
- if (!IsObject(target))
130
- throw new TypeError();
131
- if (!IsUndefined(propertyKey))
132
- propertyKey = ToPropertyKey(propertyKey);
133
- return OrdinaryMetadataKeys(target, propertyKey);
134
- }
135
- exporter("getMetadataKeys", getMetadataKeys);
136
- function getOwnMetadataKeys(target, propertyKey) {
137
- if (!IsObject(target))
138
- throw new TypeError();
139
- if (!IsUndefined(propertyKey))
140
- propertyKey = ToPropertyKey(propertyKey);
141
- return OrdinaryOwnMetadataKeys(target, propertyKey);
142
- }
143
- exporter("getOwnMetadataKeys", getOwnMetadataKeys);
144
- function deleteMetadata(metadataKey, target, propertyKey) {
145
- if (!IsObject(target))
146
- throw new TypeError();
147
- if (!IsUndefined(propertyKey))
148
- propertyKey = ToPropertyKey(propertyKey);
149
- var metadataMap = GetOrCreateMetadataMap(
150
- target,
151
- propertyKey,
152
- /*Create*/
153
- false
154
- );
155
- if (IsUndefined(metadataMap))
156
- return false;
157
- if (!metadataMap.delete(metadataKey))
158
- return false;
159
- if (metadataMap.size > 0)
160
- return true;
161
- var targetMetadata = Metadata.get(target);
162
- targetMetadata.delete(propertyKey);
163
- if (targetMetadata.size > 0)
164
- return true;
165
- Metadata.delete(target);
166
- return true;
167
- }
168
- exporter("deleteMetadata", deleteMetadata);
169
- function DecorateConstructor(decorators, target) {
170
- for (var i = decorators.length - 1; i >= 0; --i) {
171
- var decorator = decorators[i];
172
- var decorated = decorator(target);
173
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
174
- if (!IsConstructor(decorated))
175
- throw new TypeError();
176
- target = decorated;
177
- }
46
+ exports.keys = function(object) {
47
+ return objectHash(object, { excludeValues: true, algorithm: "sha1", encoding: "hex" });
48
+ };
49
+ exports.MD5 = function(object) {
50
+ return objectHash(object, { algorithm: "md5", encoding: "hex" });
51
+ };
52
+ exports.keysMD5 = function(object) {
53
+ return objectHash(object, { algorithm: "md5", encoding: "hex", excludeValues: true });
54
+ };
55
+ var hashes = crypto2.getHashes ? crypto2.getHashes().slice() : ["sha1", "md5"];
56
+ hashes.push("passthrough");
57
+ var encodings = ["buffer", "hex", "binary", "base64"];
58
+ function applyDefaults(object, sourceOptions) {
59
+ sourceOptions = sourceOptions || {};
60
+ var options = {};
61
+ options.algorithm = sourceOptions.algorithm || "sha1";
62
+ options.encoding = sourceOptions.encoding || "hex";
63
+ options.excludeValues = sourceOptions.excludeValues ? true : false;
64
+ options.algorithm = options.algorithm.toLowerCase();
65
+ options.encoding = options.encoding.toLowerCase();
66
+ options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true;
67
+ options.respectType = sourceOptions.respectType === false ? false : true;
68
+ options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
69
+ options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
70
+ options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true;
71
+ options.unorderedSets = sourceOptions.unorderedSets === false ? false : true;
72
+ options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true;
73
+ options.replacer = sourceOptions.replacer || void 0;
74
+ options.excludeKeys = sourceOptions.excludeKeys || void 0;
75
+ if (typeof object === "undefined") {
76
+ throw new Error("Object argument required.");
178
77
  }
179
- return target;
180
- }
181
- function DecorateProperty(decorators, target, propertyKey, descriptor) {
182
- for (var i = decorators.length - 1; i >= 0; --i) {
183
- var decorator = decorators[i];
184
- var decorated = decorator(target, propertyKey, descriptor);
185
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
186
- if (!IsObject(decorated))
187
- throw new TypeError();
188
- descriptor = decorated;
78
+ for (var i = 0; i < hashes.length; ++i) {
79
+ if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {
80
+ options.algorithm = hashes[i];
189
81
  }
190
82
  }
191
- return descriptor;
192
- }
193
- function GetOrCreateMetadataMap(O, P, Create) {
194
- var targetMetadata = Metadata.get(O);
195
- if (IsUndefined(targetMetadata)) {
196
- if (!Create)
197
- return void 0;
198
- targetMetadata = new _Map();
199
- Metadata.set(O, targetMetadata);
83
+ if (hashes.indexOf(options.algorithm) === -1) {
84
+ throw new Error('Algorithm "' + options.algorithm + '" not supported. supported values: ' + hashes.join(", "));
200
85
  }
201
- var metadataMap = targetMetadata.get(P);
202
- if (IsUndefined(metadataMap)) {
203
- if (!Create)
204
- return void 0;
205
- metadataMap = new _Map();
206
- targetMetadata.set(P, metadataMap);
86
+ if (encodings.indexOf(options.encoding) === -1 && options.algorithm !== "passthrough") {
87
+ throw new Error('Encoding "' + options.encoding + '" not supported. supported values: ' + encodings.join(", "));
207
88
  }
208
- return metadataMap;
209
- }
210
- function OrdinaryHasMetadata(MetadataKey, O, P) {
211
- var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
212
- if (hasOwn2)
213
- return true;
214
- var parent = OrdinaryGetPrototypeOf(O);
215
- if (!IsNull(parent))
216
- return OrdinaryHasMetadata(MetadataKey, parent, P);
217
- return false;
89
+ return options;
218
90
  }
219
- function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
220
- var metadataMap = GetOrCreateMetadataMap(
221
- O,
222
- P,
223
- /*Create*/
224
- false
225
- );
226
- if (IsUndefined(metadataMap))
91
+ function isNativeFunction(f) {
92
+ if (typeof f !== "function") {
227
93
  return false;
228
- return ToBoolean(metadataMap.has(MetadataKey));
229
- }
230
- function OrdinaryGetMetadata(MetadataKey, O, P) {
231
- var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
232
- if (hasOwn2)
233
- return OrdinaryGetOwnMetadata(MetadataKey, O, P);
234
- var parent = OrdinaryGetPrototypeOf(O);
235
- if (!IsNull(parent))
236
- return OrdinaryGetMetadata(MetadataKey, parent, P);
237
- return void 0;
238
- }
239
- function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
240
- var metadataMap = GetOrCreateMetadataMap(
241
- O,
242
- P,
243
- /*Create*/
244
- false
245
- );
246
- if (IsUndefined(metadataMap))
247
- return void 0;
248
- return metadataMap.get(MetadataKey);
249
- }
250
- function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
251
- var metadataMap = GetOrCreateMetadataMap(
252
- O,
253
- P,
254
- /*Create*/
255
- true
256
- );
257
- metadataMap.set(MetadataKey, MetadataValue);
258
- }
259
- function OrdinaryMetadataKeys(O, P) {
260
- var ownKeys = OrdinaryOwnMetadataKeys(O, P);
261
- var parent = OrdinaryGetPrototypeOf(O);
262
- if (parent === null)
263
- return ownKeys;
264
- var parentKeys = OrdinaryMetadataKeys(parent, P);
265
- if (parentKeys.length <= 0)
266
- return ownKeys;
267
- if (ownKeys.length <= 0)
268
- return parentKeys;
269
- var set = new _Set();
270
- var keys = [];
271
- for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
272
- var key = ownKeys_1[_i];
273
- var hasKey = set.has(key);
274
- if (!hasKey) {
275
- set.add(key);
276
- keys.push(key);
277
- }
278
94
  }
279
- for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
280
- var key = parentKeys_1[_a];
281
- var hasKey = set.has(key);
282
- if (!hasKey) {
283
- set.add(key);
284
- keys.push(key);
285
- }
286
- }
287
- return keys;
95
+ var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
96
+ return exp.exec(Function.prototype.toString.call(f)) != null;
288
97
  }
289
- function OrdinaryOwnMetadataKeys(O, P) {
290
- var keys = [];
291
- var metadataMap = GetOrCreateMetadataMap(
292
- O,
293
- P,
294
- /*Create*/
295
- false
296
- );
297
- if (IsUndefined(metadataMap))
298
- return keys;
299
- var keysObj = metadataMap.keys();
300
- var iterator = GetIterator(keysObj);
301
- var k = 0;
302
- while (true) {
303
- var next = IteratorStep(iterator);
304
- if (!next) {
305
- keys.length = k;
306
- return keys;
307
- }
308
- var nextValue = IteratorValue(next);
309
- try {
310
- keys[k] = nextValue;
311
- } catch (e) {
312
- try {
313
- IteratorClose(iterator);
314
- } finally {
315
- throw e;
316
- }
317
- }
318
- k++;
98
+ function hash2(object, options) {
99
+ var hashingStream;
100
+ if (options.algorithm !== "passthrough") {
101
+ hashingStream = crypto2.createHash(options.algorithm);
102
+ } else {
103
+ hashingStream = new PassThrough();
319
104
  }
320
- }
321
- function Type(x) {
322
- if (x === null)
323
- return 1;
324
- switch (typeof x) {
325
- case "undefined":
326
- return 0;
327
- case "boolean":
328
- return 2;
329
- case "string":
330
- return 3;
331
- case "symbol":
332
- return 4;
333
- case "number":
334
- return 5;
335
- case "object":
336
- return x === null ? 1 : 6;
337
- default:
338
- return 6;
105
+ if (typeof hashingStream.write === "undefined") {
106
+ hashingStream.write = hashingStream.update;
107
+ hashingStream.end = hashingStream.update;
339
108
  }
340
- }
341
- function IsUndefined(x) {
342
- return x === void 0;
343
- }
344
- function IsNull(x) {
345
- return x === null;
346
- }
347
- function IsSymbol(x) {
348
- return typeof x === "symbol";
349
- }
350
- function IsObject(x) {
351
- return typeof x === "object" ? x !== null : typeof x === "function";
352
- }
353
- function ToPrimitive(input, PreferredType) {
354
- switch (Type(input)) {
355
- case 0:
356
- return input;
357
- case 1:
358
- return input;
359
- case 2:
360
- return input;
361
- case 3:
362
- return input;
363
- case 4:
364
- return input;
365
- case 5:
366
- return input;
109
+ var hasher = typeHasher(options, hashingStream);
110
+ hasher.dispatch(object);
111
+ if (!hashingStream.update) {
112
+ hashingStream.end("");
367
113
  }
368
- var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
369
- var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
370
- if (exoticToPrim !== void 0) {
371
- var result = exoticToPrim.call(input, hint);
372
- if (IsObject(result))
373
- throw new TypeError();
374
- return result;
114
+ if (hashingStream.digest) {
115
+ return hashingStream.digest(options.encoding === "buffer" ? void 0 : options.encoding);
375
116
  }
376
- return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
377
- }
378
- function OrdinaryToPrimitive(O, hint) {
379
- if (hint === "string") {
380
- var toString_1 = O.toString;
381
- if (IsCallable(toString_1)) {
382
- var result = toString_1.call(O);
383
- if (!IsObject(result))
384
- return result;
385
- }
386
- var valueOf = O.valueOf;
387
- if (IsCallable(valueOf)) {
388
- var result = valueOf.call(O);
389
- if (!IsObject(result))
390
- return result;
391
- }
392
- } else {
393
- var valueOf = O.valueOf;
394
- if (IsCallable(valueOf)) {
395
- var result = valueOf.call(O);
396
- if (!IsObject(result))
397
- return result;
398
- }
399
- var toString_2 = O.toString;
400
- if (IsCallable(toString_2)) {
401
- var result = toString_2.call(O);
402
- if (!IsObject(result))
403
- return result;
404
- }
117
+ var buf = hashingStream.read();
118
+ if (options.encoding === "buffer") {
119
+ return buf;
405
120
  }
406
- throw new TypeError();
407
- }
408
- function ToBoolean(argument) {
409
- return !!argument;
410
- }
411
- function ToString(argument) {
412
- return "" + argument;
413
- }
414
- function ToPropertyKey(argument) {
415
- var key = ToPrimitive(
416
- argument,
417
- 3
418
- /* String */
419
- );
420
- if (IsSymbol(key))
421
- return key;
422
- return ToString(key);
121
+ return buf.toString(options.encoding);
423
122
  }
424
- function IsArray(argument) {
425
- return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
426
- }
427
- function IsCallable(argument) {
428
- return typeof argument === "function";
429
- }
430
- function IsConstructor(argument) {
431
- return typeof argument === "function";
432
- }
433
- function IsPropertyKey(argument) {
434
- switch (Type(argument)) {
435
- case 3:
436
- return true;
437
- case 4:
438
- return true;
439
- default:
440
- return false;
123
+ exports.writeToStream = function(object, options, stream) {
124
+ if (typeof stream === "undefined") {
125
+ stream = options;
126
+ options = {};
441
127
  }
442
- }
443
- function GetMethod(V, P) {
444
- var func = V[P];
445
- if (func === void 0 || func === null)
446
- return void 0;
447
- if (!IsCallable(func))
448
- throw new TypeError();
449
- return func;
450
- }
451
- function GetIterator(obj) {
452
- var method = GetMethod(obj, iteratorSymbol);
453
- if (!IsCallable(method))
454
- throw new TypeError();
455
- var iterator = method.call(obj);
456
- if (!IsObject(iterator))
457
- throw new TypeError();
458
- return iterator;
459
- }
460
- function IteratorValue(iterResult) {
461
- return iterResult.value;
462
- }
463
- function IteratorStep(iterator) {
464
- var result = iterator.next();
465
- return result.done ? false : result;
466
- }
467
- function IteratorClose(iterator) {
468
- var f = iterator["return"];
469
- if (f)
470
- f.call(iterator);
471
- }
472
- function OrdinaryGetPrototypeOf(O) {
473
- var proto = Object.getPrototypeOf(O);
474
- if (typeof O !== "function" || O === functionPrototype)
475
- return proto;
476
- if (proto !== functionPrototype)
477
- return proto;
478
- var prototype = O.prototype;
479
- var prototypeProto = prototype && Object.getPrototypeOf(prototype);
480
- if (prototypeProto == null || prototypeProto === Object.prototype)
481
- return proto;
482
- var constructor = prototypeProto.constructor;
483
- if (typeof constructor !== "function")
484
- return proto;
485
- if (constructor === O)
486
- return proto;
487
- return constructor;
488
- }
489
- function CreateMapPolyfill() {
490
- var cacheSentinel = {};
491
- var arraySentinel = [];
492
- var MapIterator = (
493
- /** @class */
494
- function() {
495
- function MapIterator2(keys, values, selector) {
496
- this._index = 0;
497
- this._keys = keys;
498
- this._values = values;
499
- this._selector = selector;
128
+ options = applyDefaults(object, options);
129
+ return typeHasher(options, stream).dispatch(object);
130
+ };
131
+ function typeHasher(options, writeTo, context) {
132
+ context = context || [];
133
+ var write = function(str) {
134
+ if (writeTo.update) {
135
+ return writeTo.update(str, "utf8");
136
+ } else {
137
+ return writeTo.write(str, "utf8");
138
+ }
139
+ };
140
+ return {
141
+ dispatch: function(value) {
142
+ if (options.replacer) {
143
+ value = options.replacer(value);
500
144
  }
501
- MapIterator2.prototype["@@iterator"] = function() {
502
- return this;
503
- };
504
- MapIterator2.prototype[iteratorSymbol] = function() {
505
- return this;
506
- };
507
- MapIterator2.prototype.next = function() {
508
- var index = this._index;
509
- if (index >= 0 && index < this._keys.length) {
510
- var result = this._selector(this._keys[index], this._values[index]);
511
- if (index + 1 >= this._keys.length) {
512
- this._index = -1;
513
- this._keys = arraySentinel;
514
- this._values = arraySentinel;
515
- } else {
516
- this._index++;
517
- }
518
- return { value: result, done: false };
519
- }
520
- return { value: void 0, done: true };
521
- };
522
- MapIterator2.prototype.throw = function(error) {
523
- if (this._index >= 0) {
524
- this._index = -1;
525
- this._keys = arraySentinel;
526
- this._values = arraySentinel;
527
- }
528
- throw error;
529
- };
530
- MapIterator2.prototype.return = function(value) {
531
- if (this._index >= 0) {
532
- this._index = -1;
533
- this._keys = arraySentinel;
534
- this._values = arraySentinel;
535
- }
536
- return { value, done: true };
537
- };
538
- return MapIterator2;
539
- }()
540
- );
541
- return (
542
- /** @class */
543
- function() {
544
- function Map2() {
545
- this._keys = [];
546
- this._values = [];
547
- this._cacheKey = cacheSentinel;
548
- this._cacheIndex = -2;
145
+ var type = typeof value;
146
+ if (value === null) {
147
+ type = "null";
549
148
  }
550
- Object.defineProperty(Map2.prototype, "size", {
551
- get: function() {
552
- return this._keys.length;
553
- },
554
- enumerable: true,
555
- configurable: true
556
- });
557
- Map2.prototype.has = function(key) {
558
- return this._find(
559
- key,
560
- /*insert*/
561
- false
562
- ) >= 0;
563
- };
564
- Map2.prototype.get = function(key) {
565
- var index = this._find(
566
- key,
567
- /*insert*/
568
- false
569
- );
570
- return index >= 0 ? this._values[index] : void 0;
571
- };
572
- Map2.prototype.set = function(key, value) {
573
- var index = this._find(
574
- key,
575
- /*insert*/
576
- true
577
- );
578
- this._values[index] = value;
579
- return this;
580
- };
581
- Map2.prototype.delete = function(key) {
582
- var index = this._find(
583
- key,
584
- /*insert*/
585
- false
586
- );
587
- if (index >= 0) {
588
- var size = this._keys.length;
589
- for (var i = index + 1; i < size; i++) {
590
- this._keys[i - 1] = this._keys[i];
591
- this._values[i - 1] = this._values[i];
592
- }
593
- this._keys.length--;
594
- this._values.length--;
595
- if (key === this._cacheKey) {
596
- this._cacheKey = cacheSentinel;
597
- this._cacheIndex = -2;
598
- }
599
- return true;
149
+ return this["_" + type](value);
150
+ },
151
+ _object: function(object) {
152
+ var pattern = /\[object (.*)\]/i;
153
+ var objString = Object.prototype.toString.call(object);
154
+ var objType = pattern.exec(objString);
155
+ if (!objType) {
156
+ objType = "unknown:[" + objString + "]";
157
+ } else {
158
+ objType = objType[1];
159
+ }
160
+ objType = objType.toLowerCase();
161
+ var objectNumber = null;
162
+ if ((objectNumber = context.indexOf(object)) >= 0) {
163
+ return this.dispatch("[CIRCULAR:" + objectNumber + "]");
164
+ } else {
165
+ context.push(object);
166
+ }
167
+ if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
168
+ write("buffer:");
169
+ return write(object);
170
+ }
171
+ if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
172
+ if (this["_" + objType]) {
173
+ this["_" + objType](object);
174
+ } else if (options.ignoreUnknown) {
175
+ return write("[" + objType + "]");
176
+ } else {
177
+ throw new Error('Unknown object type "' + objType + '"');
600
178
  }
601
- return false;
602
- };
603
- Map2.prototype.clear = function() {
604
- this._keys.length = 0;
605
- this._values.length = 0;
606
- this._cacheKey = cacheSentinel;
607
- this._cacheIndex = -2;
608
- };
609
- Map2.prototype.keys = function() {
610
- return new MapIterator(this._keys, this._values, getKey);
611
- };
612
- Map2.prototype.values = function() {
613
- return new MapIterator(this._keys, this._values, getValue);
614
- };
615
- Map2.prototype.entries = function() {
616
- return new MapIterator(this._keys, this._values, getEntry);
617
- };
618
- Map2.prototype["@@iterator"] = function() {
619
- return this.entries();
620
- };
621
- Map2.prototype[iteratorSymbol] = function() {
622
- return this.entries();
623
- };
624
- Map2.prototype._find = function(key, insert) {
625
- if (this._cacheKey !== key) {
626
- this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
179
+ } else {
180
+ var keys = Object.keys(object);
181
+ if (options.unorderedObjects) {
182
+ keys = keys.sort();
627
183
  }
628
- if (this._cacheIndex < 0 && insert) {
629
- this._cacheIndex = this._keys.length;
630
- this._keys.push(key);
631
- this._values.push(void 0);
184
+ if (options.respectType !== false && !isNativeFunction(object)) {
185
+ keys.splice(0, 0, "prototype", "__proto__", "constructor");
632
186
  }
633
- return this._cacheIndex;
634
- };
635
- return Map2;
636
- }()
637
- );
638
- function getKey(key, _) {
639
- return key;
640
- }
641
- function getValue(_, value) {
642
- return value;
643
- }
644
- function getEntry(key, value) {
645
- return [key, value];
646
- }
647
- }
648
- function CreateSetPolyfill() {
649
- return (
650
- /** @class */
651
- function() {
652
- function Set2() {
653
- this._map = new _Map();
187
+ if (options.excludeKeys) {
188
+ keys = keys.filter(function(key) {
189
+ return !options.excludeKeys(key);
190
+ });
191
+ }
192
+ write("object:" + keys.length + ":");
193
+ var self = this;
194
+ return keys.forEach(function(key) {
195
+ self.dispatch(key);
196
+ write(":");
197
+ if (!options.excludeValues) {
198
+ self.dispatch(object[key]);
199
+ }
200
+ write(",");
201
+ });
202
+ }
203
+ },
204
+ _array: function(arr, unordered) {
205
+ unordered = typeof unordered !== "undefined" ? unordered : options.unorderedArrays !== false;
206
+ var self = this;
207
+ write("array:" + arr.length + ":");
208
+ if (!unordered || arr.length <= 1) {
209
+ return arr.forEach(function(entry) {
210
+ return self.dispatch(entry);
211
+ });
654
212
  }
655
- Object.defineProperty(Set2.prototype, "size", {
656
- get: function() {
657
- return this._map.size;
658
- },
659
- enumerable: true,
660
- configurable: true
213
+ var contextAdditions = [];
214
+ var entries = arr.map(function(entry) {
215
+ var strm = new PassThrough();
216
+ var localContext = context.slice();
217
+ var hasher = typeHasher(options, strm, localContext);
218
+ hasher.dispatch(entry);
219
+ contextAdditions = contextAdditions.concat(localContext.slice(context.length));
220
+ return strm.read().toString();
661
221
  });
662
- Set2.prototype.has = function(value) {
663
- return this._map.has(value);
664
- };
665
- Set2.prototype.add = function(value) {
666
- return this._map.set(value, value), this;
667
- };
668
- Set2.prototype.delete = function(value) {
669
- return this._map.delete(value);
670
- };
671
- Set2.prototype.clear = function() {
672
- this._map.clear();
673
- };
674
- Set2.prototype.keys = function() {
675
- return this._map.keys();
676
- };
677
- Set2.prototype.values = function() {
678
- return this._map.values();
679
- };
680
- Set2.prototype.entries = function() {
681
- return this._map.entries();
682
- };
683
- Set2.prototype["@@iterator"] = function() {
684
- return this.keys();
685
- };
686
- Set2.prototype[iteratorSymbol] = function() {
687
- return this.keys();
688
- };
689
- return Set2;
690
- }()
691
- );
692
- }
693
- function CreateWeakMapPolyfill() {
694
- var UUID_SIZE = 16;
695
- var keys = HashMap.create();
696
- var rootKey = CreateUniqueKey();
697
- return (
698
- /** @class */
699
- function() {
700
- function WeakMap2() {
701
- this._key = CreateUniqueKey();
222
+ context = context.concat(contextAdditions);
223
+ entries.sort();
224
+ return this._array(entries, false);
225
+ },
226
+ _date: function(date) {
227
+ return write("date:" + date.toJSON());
228
+ },
229
+ _symbol: function(sym) {
230
+ return write("symbol:" + sym.toString());
231
+ },
232
+ _error: function(err) {
233
+ return write("error:" + err.toString());
234
+ },
235
+ _boolean: function(bool) {
236
+ return write("bool:" + bool.toString());
237
+ },
238
+ _string: function(string) {
239
+ write("string:" + string.length + ":");
240
+ write(string.toString());
241
+ },
242
+ _function: function(fn) {
243
+ write("fn:");
244
+ if (isNativeFunction(fn)) {
245
+ this.dispatch("[native]");
246
+ } else {
247
+ this.dispatch(fn.toString());
702
248
  }
703
- WeakMap2.prototype.has = function(target) {
704
- var table = GetOrCreateWeakMapTable(
705
- target,
706
- /*create*/
707
- false
708
- );
709
- return table !== void 0 ? HashMap.has(table, this._key) : false;
710
- };
711
- WeakMap2.prototype.get = function(target) {
712
- var table = GetOrCreateWeakMapTable(
713
- target,
714
- /*create*/
715
- false
716
- );
717
- return table !== void 0 ? HashMap.get(table, this._key) : void 0;
718
- };
719
- WeakMap2.prototype.set = function(target, value) {
720
- var table = GetOrCreateWeakMapTable(
721
- target,
722
- /*create*/
723
- true
724
- );
725
- table[this._key] = value;
726
- return this;
727
- };
728
- WeakMap2.prototype.delete = function(target) {
729
- var table = GetOrCreateWeakMapTable(
730
- target,
731
- /*create*/
732
- false
733
- );
734
- return table !== void 0 ? delete table[this._key] : false;
735
- };
736
- WeakMap2.prototype.clear = function() {
737
- this._key = CreateUniqueKey();
738
- };
739
- return WeakMap2;
740
- }()
741
- );
742
- function CreateUniqueKey() {
743
- var key;
744
- do
745
- key = "@@WeakMap@@" + CreateUUID();
746
- while (HashMap.has(keys, key));
747
- keys[key] = true;
748
- return key;
749
- }
750
- function GetOrCreateWeakMapTable(target, create) {
751
- if (!hasOwn.call(target, rootKey)) {
752
- if (!create)
753
- return void 0;
754
- Object.defineProperty(target, rootKey, { value: HashMap.create() });
755
- }
756
- return target[rootKey];
757
- }
758
- function FillRandomBytes(buffer, size) {
759
- for (var i = 0; i < size; ++i)
760
- buffer[i] = Math.random() * 255 | 0;
761
- return buffer;
762
- }
763
- function GenRandomBytes(size) {
764
- if (typeof Uint8Array === "function") {
765
- if (typeof crypto !== "undefined")
766
- return crypto.getRandomValues(new Uint8Array(size));
767
- if (typeof msCrypto !== "undefined")
768
- return msCrypto.getRandomValues(new Uint8Array(size));
769
- return FillRandomBytes(new Uint8Array(size), size);
770
- }
771
- return FillRandomBytes(new Array(size), size);
772
- }
773
- function CreateUUID() {
774
- var data = GenRandomBytes(UUID_SIZE);
775
- data[6] = data[6] & 79 | 64;
776
- data[8] = data[8] & 191 | 128;
777
- var result = "";
778
- for (var offset = 0; offset < UUID_SIZE; ++offset) {
779
- var byte = data[offset];
780
- if (offset === 4 || offset === 6 || offset === 8)
781
- result += "-";
782
- if (byte < 16)
783
- result += "0";
784
- result += byte.toString(16).toLowerCase();
249
+ if (options.respectFunctionNames !== false) {
250
+ this.dispatch("function-name:" + String(fn.name));
251
+ }
252
+ if (options.respectFunctionProperties) {
253
+ this._object(fn);
254
+ }
255
+ },
256
+ _number: function(number) {
257
+ return write("number:" + number.toString());
258
+ },
259
+ _xml: function(xml) {
260
+ return write("xml:" + xml.toString());
261
+ },
262
+ _null: function() {
263
+ return write("Null");
264
+ },
265
+ _undefined: function() {
266
+ return write("Undefined");
267
+ },
268
+ _regexp: function(regex) {
269
+ return write("regex:" + regex.toString());
270
+ },
271
+ _uint8array: function(arr) {
272
+ write("uint8array:");
273
+ return this.dispatch(Array.prototype.slice.call(arr));
274
+ },
275
+ _uint8clampedarray: function(arr) {
276
+ write("uint8clampedarray:");
277
+ return this.dispatch(Array.prototype.slice.call(arr));
278
+ },
279
+ _int8array: function(arr) {
280
+ write("uint8array:");
281
+ return this.dispatch(Array.prototype.slice.call(arr));
282
+ },
283
+ _uint16array: function(arr) {
284
+ write("uint16array:");
285
+ return this.dispatch(Array.prototype.slice.call(arr));
286
+ },
287
+ _int16array: function(arr) {
288
+ write("uint16array:");
289
+ return this.dispatch(Array.prototype.slice.call(arr));
290
+ },
291
+ _uint32array: function(arr) {
292
+ write("uint32array:");
293
+ return this.dispatch(Array.prototype.slice.call(arr));
294
+ },
295
+ _int32array: function(arr) {
296
+ write("uint32array:");
297
+ return this.dispatch(Array.prototype.slice.call(arr));
298
+ },
299
+ _float32array: function(arr) {
300
+ write("float32array:");
301
+ return this.dispatch(Array.prototype.slice.call(arr));
302
+ },
303
+ _float64array: function(arr) {
304
+ write("float64array:");
305
+ return this.dispatch(Array.prototype.slice.call(arr));
306
+ },
307
+ _arraybuffer: function(arr) {
308
+ write("arraybuffer:");
309
+ return this.dispatch(new Uint8Array(arr));
310
+ },
311
+ _url: function(url) {
312
+ return write("url:" + url.toString(), "utf8");
313
+ },
314
+ _map: function(map) {
315
+ write("map:");
316
+ var arr = Array.from(map);
317
+ return this._array(arr, options.unorderedSets !== false);
318
+ },
319
+ _set: function(set) {
320
+ write("set:");
321
+ var arr = Array.from(set);
322
+ return this._array(arr, options.unorderedSets !== false);
323
+ },
324
+ _file: function(file) {
325
+ write("file:");
326
+ return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
327
+ },
328
+ _blob: function() {
329
+ if (options.ignoreUnknown) {
330
+ return write("[blob]");
331
+ }
332
+ throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n');
333
+ },
334
+ _domwindow: function() {
335
+ return write("domwindow");
336
+ },
337
+ _bigint: function(number) {
338
+ return write("bigint:" + number.toString());
339
+ },
340
+ /* Node.js standard native objects */
341
+ _process: function() {
342
+ return write("process");
343
+ },
344
+ _timer: function() {
345
+ return write("timer");
346
+ },
347
+ _pipe: function() {
348
+ return write("pipe");
349
+ },
350
+ _tcp: function() {
351
+ return write("tcp");
352
+ },
353
+ _udp: function() {
354
+ return write("udp");
355
+ },
356
+ _tty: function() {
357
+ return write("tty");
358
+ },
359
+ _statwatcher: function() {
360
+ return write("statwatcher");
361
+ },
362
+ _securecontext: function() {
363
+ return write("securecontext");
364
+ },
365
+ _connection: function() {
366
+ return write("connection");
367
+ },
368
+ _zlib: function() {
369
+ return write("zlib");
370
+ },
371
+ _context: function() {
372
+ return write("context");
373
+ },
374
+ _nodescript: function() {
375
+ return write("nodescript");
376
+ },
377
+ _httpparser: function() {
378
+ return write("httpparser");
379
+ },
380
+ _dataview: function() {
381
+ return write("dataview");
382
+ },
383
+ _signal: function() {
384
+ return write("signal");
385
+ },
386
+ _fsevent: function() {
387
+ return write("fsevent");
388
+ },
389
+ _tlswrap: function() {
390
+ return write("tlswrap");
785
391
  }
786
- return result;
787
- }
392
+ };
788
393
  }
789
- function MakeDictionary(obj) {
790
- obj.__ = void 0;
791
- delete obj.__;
792
- return obj;
394
+ function PassThrough() {
395
+ return {
396
+ buf: "",
397
+ write: function(b) {
398
+ this.buf += b;
399
+ },
400
+ end: function(b) {
401
+ this.buf += b;
402
+ },
403
+ read: function() {
404
+ return this.buf;
405
+ }
406
+ };
793
407
  }
794
- });
795
- })(Reflect || (Reflect = {}));
408
+ }
409
+ });
796
410
 
797
- // src/typedi.ts
798
- import { Container } from "typedi";
799
- import { Service, Inject, Container as Container2 } from "typedi";
800
- function getInstance(service) {
801
- return Container.get(service);
411
+ // ../helpers/dist/index.js
412
+ var import_object_hash = __toESM(require_object_hash(), 1);
413
+ import crypto from "crypto";
414
+ var UNMISTAKABLE_CHARS = "23456789ABCDEFGHJKLMNPQRSTWXYZabcdefghjkmnopqrstuvwxyz";
415
+ var hexString = function(digits) {
416
+ var numBytes = Math.ceil(digits / 2);
417
+ var bytes;
418
+ try {
419
+ bytes = crypto.randomBytes(numBytes);
420
+ } catch (e) {
421
+ bytes = crypto.pseudoRandomBytes(numBytes);
422
+ }
423
+ var result = bytes.toString("hex");
424
+ return result.substring(0, digits);
425
+ };
426
+ var fraction = function() {
427
+ var numerator = parseInt(hexString(8), 16);
428
+ return numerator * 23283064365386963e-26;
429
+ };
430
+ var choice = function(arrayOrString) {
431
+ var index = Math.floor(fraction() * arrayOrString.length);
432
+ if (typeof arrayOrString === "string") return arrayOrString.substr(index, 1);
433
+ else return arrayOrString[index];
434
+ };
435
+ var randomString = function(charsCount, alphabet) {
436
+ var digits = [];
437
+ for (var i = 0; i < charsCount; i++) {
438
+ digits[i] = choice(alphabet);
439
+ }
440
+ return digits.join("");
441
+ };
442
+ function generateId(charsCount, chars = UNMISTAKABLE_CHARS) {
443
+ if (!charsCount) {
444
+ charsCount = 17;
445
+ }
446
+ return randomString(charsCount, chars);
447
+ }
448
+
449
+ // src/di.ts
450
+ var instances = /* @__PURE__ */ new Map();
451
+ var serviceMetadata = /* @__PURE__ */ new WeakMap();
452
+ var injectionMetadata = /* @__PURE__ */ new WeakMap();
453
+ function Service() {
454
+ return (_target, context) => {
455
+ serviceMetadata.set(context, {
456
+ id: generateId(12),
457
+ name: context.name
458
+ });
459
+ };
460
+ }
461
+ function Inject(getDependency) {
462
+ return (_, context) => {
463
+ context.addInitializer(function() {
464
+ const metadata = injectionMetadata.get(this) || {};
465
+ metadata[context.name] = getDependency;
466
+ injectionMetadata.set(this, metadata);
467
+ });
468
+ };
469
+ }
470
+ function getInstance(token) {
471
+ if (!instances.has(token)) {
472
+ const instance = new token();
473
+ instances.set(token, instance);
474
+ const injections = injectionMetadata.get(instance);
475
+ if (injections) {
476
+ for (const [propertyKey, getDependency] of Object.entries(injections)) {
477
+ instance[propertyKey] = getInstance(getDependency());
478
+ }
479
+ }
480
+ }
481
+ return instances.get(token);
802
482
  }
803
483
  export {
804
- Container2 as Container,
805
484
  Inject,
806
485
  Service,
807
486
  getInstance
808
487
  };
809
- /*! Bundled license information:
810
-
811
- reflect-metadata/Reflect.js:
812
- (*! *****************************************************************************
813
- Copyright (C) Microsoft. All rights reserved.
814
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
815
- this file except in compliance with the License. You may obtain a copy of the
816
- License at http://www.apache.org/licenses/LICENSE-2.0
817
-
818
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
819
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
820
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
821
- MERCHANTABLITY OR NON-INFRINGEMENT.
822
-
823
- See the Apache Version 2.0 License for specific language governing permissions
824
- and limitations under the License.
825
- ***************************************************************************** *)
826
- */
827
488
  //# sourceMappingURL=index.js.map