@tsed/core 7.0.0-alpha.1 → 7.0.0-beta.3

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.
Files changed (424) hide show
  1. package/lib/cjs/decorators/configurable.js +18 -0
  2. package/lib/cjs/decorators/configurable.js.map +1 -0
  3. package/lib/cjs/decorators/deprecated.js +43 -0
  4. package/lib/cjs/decorators/deprecated.js.map +1 -0
  5. package/lib/cjs/decorators/enumerable.js +18 -0
  6. package/lib/cjs/decorators/enumerable.js.map +1 -0
  7. package/lib/cjs/decorators/index.js +18 -0
  8. package/lib/cjs/decorators/index.js.map +1 -0
  9. package/lib/cjs/decorators/notConfigurable.js +13 -0
  10. package/lib/cjs/decorators/notConfigurable.js.map +1 -0
  11. package/lib/cjs/decorators/notEnumerable.js +13 -0
  12. package/lib/cjs/decorators/notEnumerable.js.map +1 -0
  13. package/lib/cjs/decorators/readOnly.js +13 -0
  14. package/lib/cjs/decorators/readOnly.js.map +1 -0
  15. package/lib/cjs/decorators/storeFn.js +22 -0
  16. package/lib/cjs/decorators/storeFn.js.map +1 -0
  17. package/lib/cjs/decorators/storeMerge.js +11 -0
  18. package/lib/cjs/decorators/storeMerge.js.map +1 -0
  19. package/lib/cjs/decorators/storeSet.js +11 -0
  20. package/lib/cjs/decorators/storeSet.js.map +1 -0
  21. package/lib/cjs/decorators/writable.js +18 -0
  22. package/lib/cjs/decorators/writable.js.map +1 -0
  23. package/lib/cjs/domain/AnyToPromise.js +148 -0
  24. package/lib/cjs/domain/AnyToPromise.js.map +1 -0
  25. package/lib/cjs/domain/DecoratorTypes.js +15 -0
  26. package/lib/cjs/domain/DecoratorTypes.js.map +1 -0
  27. package/lib/cjs/domain/Env.js +19 -0
  28. package/lib/cjs/domain/Env.js.map +1 -0
  29. package/lib/cjs/domain/Hooks.js +89 -0
  30. package/lib/cjs/domain/Hooks.js.map +1 -0
  31. package/lib/cjs/domain/Metadata.js +508 -0
  32. package/lib/cjs/domain/Metadata.js.map +1 -0
  33. package/lib/cjs/domain/Store.js +157 -0
  34. package/lib/cjs/domain/Store.js.map +1 -0
  35. package/lib/cjs/domain/Type.js +7 -0
  36. package/lib/cjs/domain/Type.js.map +1 -0
  37. package/lib/cjs/domain/index.js +11 -0
  38. package/lib/cjs/domain/index.js.map +1 -0
  39. package/lib/cjs/errors/UnsupportedDecoratorType.js +21 -0
  40. package/lib/cjs/errors/UnsupportedDecoratorType.js.map +1 -0
  41. package/lib/cjs/index.js +9 -0
  42. package/lib/cjs/index.js.map +1 -0
  43. package/lib/cjs/interfaces/AnyDecorator.js +3 -0
  44. package/lib/cjs/interfaces/AnyDecorator.js.map +1 -0
  45. package/lib/cjs/interfaces/DecoratorParameters.js +3 -0
  46. package/lib/cjs/interfaces/DecoratorParameters.js.map +1 -0
  47. package/lib/cjs/interfaces/HashOf.js +3 -0
  48. package/lib/cjs/interfaces/HashOf.js.map +1 -0
  49. package/lib/cjs/interfaces/MetadataTypes.js +3 -0
  50. package/lib/cjs/interfaces/MetadataTypes.js.map +1 -0
  51. package/lib/cjs/interfaces/ValueOf.js +3 -0
  52. package/lib/cjs/interfaces/ValueOf.js.map +1 -0
  53. package/lib/cjs/interfaces/index.js +3 -0
  54. package/lib/cjs/interfaces/index.js.map +1 -0
  55. package/lib/cjs/utils/catchError.js +22 -0
  56. package/lib/cjs/utils/catchError.js.map +1 -0
  57. package/lib/cjs/utils/decorators/decorateMethodsOf.js +23 -0
  58. package/lib/cjs/utils/decorators/decorateMethodsOf.js.map +1 -0
  59. package/lib/cjs/utils/decorators/decoratorArgs.js +9 -0
  60. package/lib/cjs/utils/decorators/decoratorArgs.js.map +1 -0
  61. package/lib/cjs/utils/decorators/decoratorTypeOf.js +23 -0
  62. package/lib/cjs/utils/decorators/decoratorTypeOf.js.map +1 -0
  63. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js +15 -0
  64. package/lib/cjs/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  65. package/lib/cjs/utils/decorators/useDecorators.js +14 -0
  66. package/lib/cjs/utils/decorators/useDecorators.js.map +1 -0
  67. package/lib/cjs/utils/decorators/useMethodDecorators.js +15 -0
  68. package/lib/cjs/utils/decorators/useMethodDecorators.js.map +1 -0
  69. package/lib/cjs/utils/http/getHostInfoFromPort.js +21 -0
  70. package/lib/cjs/utils/http/getHostInfoFromPort.js.map +1 -0
  71. package/lib/cjs/utils/imports/importPackage.js +35 -0
  72. package/lib/cjs/utils/imports/importPackage.js.map +1 -0
  73. package/lib/cjs/utils/index.js +19 -0
  74. package/lib/cjs/utils/index.js.map +1 -0
  75. package/lib/cjs/utils/objects/ancestorOf.js +12 -0
  76. package/lib/cjs/utils/objects/ancestorOf.js.map +1 -0
  77. package/lib/cjs/utils/objects/ancestorsOf.js +22 -0
  78. package/lib/cjs/utils/objects/ancestorsOf.js.map +1 -0
  79. package/lib/cjs/utils/objects/classOf.js +23 -0
  80. package/lib/cjs/utils/objects/classOf.js.map +1 -0
  81. package/lib/cjs/utils/objects/cleanObject.js +24 -0
  82. package/lib/cjs/utils/objects/cleanObject.js.map +1 -0
  83. package/lib/cjs/utils/objects/constructorOf.js +20 -0
  84. package/lib/cjs/utils/objects/constructorOf.js.map +1 -0
  85. package/lib/cjs/utils/objects/createInstance.js +9 -0
  86. package/lib/cjs/utils/objects/createInstance.js.map +1 -0
  87. package/lib/cjs/utils/objects/deepClone.js +57 -0
  88. package/lib/cjs/utils/objects/deepClone.js.map +1 -0
  89. package/lib/cjs/utils/objects/deepMerge.js +63 -0
  90. package/lib/cjs/utils/objects/deepMerge.js.map +1 -0
  91. package/lib/cjs/utils/objects/descriptorOf.js +19 -0
  92. package/lib/cjs/utils/objects/descriptorOf.js.map +1 -0
  93. package/lib/cjs/utils/objects/getClassOrSymbol.js +10 -0
  94. package/lib/cjs/utils/objects/getClassOrSymbol.js.map +1 -0
  95. package/lib/cjs/utils/objects/getConstructorArgNames.js +9 -0
  96. package/lib/cjs/utils/objects/getConstructorArgNames.js.map +1 -0
  97. package/lib/cjs/utils/objects/getEnumerableKeys.js +20 -0
  98. package/lib/cjs/utils/objects/getEnumerableKeys.js.map +1 -0
  99. package/lib/cjs/utils/objects/getValue.js +49 -0
  100. package/lib/cjs/utils/objects/getValue.js.map +1 -0
  101. package/lib/cjs/utils/objects/index.js +46 -0
  102. package/lib/cjs/utils/objects/index.js.map +1 -0
  103. package/lib/cjs/utils/objects/isArray.js +23 -0
  104. package/lib/cjs/utils/objects/isArray.js.map +1 -0
  105. package/lib/cjs/utils/objects/isArrowFn.js +9 -0
  106. package/lib/cjs/utils/objects/isArrowFn.js.map +1 -0
  107. package/lib/cjs/utils/objects/isBoolean.js +17 -0
  108. package/lib/cjs/utils/objects/isBoolean.js.map +1 -0
  109. package/lib/cjs/utils/objects/isClass.js +26 -0
  110. package/lib/cjs/utils/objects/isClass.js.map +1 -0
  111. package/lib/cjs/utils/objects/isCollection.js +22 -0
  112. package/lib/cjs/utils/objects/isCollection.js.map +1 -0
  113. package/lib/cjs/utils/objects/isDate.js +13 -0
  114. package/lib/cjs/utils/objects/isDate.js.map +1 -0
  115. package/lib/cjs/utils/objects/isEmpty.js +14 -0
  116. package/lib/cjs/utils/objects/isEmpty.js.map +1 -0
  117. package/lib/cjs/utils/objects/isEnumerable.js +22 -0
  118. package/lib/cjs/utils/objects/isEnumerable.js.map +1 -0
  119. package/lib/cjs/utils/objects/isFunction.js +8 -0
  120. package/lib/cjs/utils/objects/isFunction.js.map +1 -0
  121. package/lib/cjs/utils/objects/isInheritedFrom.js +26 -0
  122. package/lib/cjs/utils/objects/isInheritedFrom.js.map +1 -0
  123. package/lib/cjs/utils/objects/isNil.js +8 -0
  124. package/lib/cjs/utils/objects/isNil.js.map +1 -0
  125. package/lib/cjs/utils/objects/isNumber.js +17 -0
  126. package/lib/cjs/utils/objects/isNumber.js.map +1 -0
  127. package/lib/cjs/utils/objects/isObject.js +8 -0
  128. package/lib/cjs/utils/objects/isObject.js.map +1 -0
  129. package/lib/cjs/utils/objects/isObservable.js +8 -0
  130. package/lib/cjs/utils/objects/isObservable.js.map +1 -0
  131. package/lib/cjs/utils/objects/isPlainObject.js +18 -0
  132. package/lib/cjs/utils/objects/isPlainObject.js.map +1 -0
  133. package/lib/cjs/utils/objects/isPrimitive.js +30 -0
  134. package/lib/cjs/utils/objects/isPrimitive.js.map +1 -0
  135. package/lib/cjs/utils/objects/isPromise.js +16 -0
  136. package/lib/cjs/utils/objects/isPromise.js.map +1 -0
  137. package/lib/cjs/utils/objects/isProtectedKey.js +12 -0
  138. package/lib/cjs/utils/objects/isProtectedKey.js.map +1 -0
  139. package/lib/cjs/utils/objects/isSerializable.js +13 -0
  140. package/lib/cjs/utils/objects/isSerializable.js.map +1 -0
  141. package/lib/cjs/utils/objects/isStream.js +8 -0
  142. package/lib/cjs/utils/objects/isStream.js.map +1 -0
  143. package/lib/cjs/utils/objects/isString.js +16 -0
  144. package/lib/cjs/utils/objects/isString.js.map +1 -0
  145. package/lib/cjs/utils/objects/isSymbol.js +16 -0
  146. package/lib/cjs/utils/objects/isSymbol.js.map +1 -0
  147. package/lib/cjs/utils/objects/methodsOf.js +25 -0
  148. package/lib/cjs/utils/objects/methodsOf.js.map +1 -0
  149. package/lib/cjs/utils/objects/nameOf.js +32 -0
  150. package/lib/cjs/utils/objects/nameOf.js.map +1 -0
  151. package/lib/cjs/utils/objects/objectKeys.js +9 -0
  152. package/lib/cjs/utils/objects/objectKeys.js.map +1 -0
  153. package/lib/cjs/utils/objects/primitiveOf.js +20 -0
  154. package/lib/cjs/utils/objects/primitiveOf.js.map +1 -0
  155. package/lib/cjs/utils/objects/prototypeOf.js +14 -0
  156. package/lib/cjs/utils/objects/prototypeOf.js.map +1 -0
  157. package/lib/cjs/utils/objects/setValue.js +34 -0
  158. package/lib/cjs/utils/objects/setValue.js.map +1 -0
  159. package/lib/cjs/utils/objects/toMap.js +32 -0
  160. package/lib/cjs/utils/objects/toMap.js.map +1 -0
  161. package/lib/cjs/utils/objects/toStringConstructor.js +12 -0
  162. package/lib/cjs/utils/objects/toStringConstructor.js.map +1 -0
  163. package/lib/cjs/utils/proxyDelegation.js +54 -0
  164. package/lib/cjs/utils/proxyDelegation.js.map +1 -0
  165. package/lib/cjs/utils/uniq.js +16 -0
  166. package/lib/cjs/utils/uniq.js.map +1 -0
  167. package/lib/esm/decorators/configurable.js +14 -0
  168. package/lib/esm/decorators/configurable.js.map +1 -0
  169. package/lib/esm/decorators/deprecated.js +39 -0
  170. package/lib/esm/decorators/deprecated.js.map +1 -0
  171. package/lib/esm/decorators/enumerable.js +14 -0
  172. package/lib/esm/decorators/enumerable.js.map +1 -0
  173. package/lib/esm/decorators/index.js +15 -0
  174. package/lib/esm/decorators/index.js.map +1 -0
  175. package/lib/esm/decorators/notConfigurable.js +9 -0
  176. package/lib/esm/decorators/notConfigurable.js.map +1 -0
  177. package/lib/esm/decorators/notEnumerable.js +9 -0
  178. package/lib/esm/decorators/notEnumerable.js.map +1 -0
  179. package/lib/esm/decorators/readOnly.js +9 -0
  180. package/lib/esm/decorators/readOnly.js.map +1 -0
  181. package/lib/esm/decorators/storeFn.js +18 -0
  182. package/lib/esm/decorators/storeFn.js.map +1 -0
  183. package/lib/esm/decorators/storeMerge.js +7 -0
  184. package/lib/esm/decorators/storeMerge.js.map +1 -0
  185. package/lib/esm/decorators/storeSet.js +7 -0
  186. package/lib/esm/decorators/storeSet.js.map +1 -0
  187. package/lib/esm/decorators/writable.js +14 -0
  188. package/lib/esm/decorators/writable.js.map +1 -0
  189. package/lib/esm/domain/AnyToPromise.js +144 -0
  190. package/lib/esm/domain/AnyToPromise.js.map +1 -0
  191. package/lib/esm/domain/DecoratorTypes.js +12 -0
  192. package/lib/esm/domain/DecoratorTypes.js.map +1 -0
  193. package/lib/esm/domain/Env.js +16 -0
  194. package/lib/esm/domain/Env.js.map +1 -0
  195. package/lib/esm/domain/Hooks.js +85 -0
  196. package/lib/esm/domain/Hooks.js.map +1 -0
  197. package/lib/esm/domain/Metadata.js +504 -0
  198. package/lib/esm/domain/Metadata.js.map +1 -0
  199. package/lib/esm/domain/Store.js +153 -0
  200. package/lib/esm/domain/Store.js.map +1 -0
  201. package/lib/esm/domain/Type.js +4 -0
  202. package/lib/esm/domain/Type.js.map +1 -0
  203. package/lib/esm/domain/index.js +8 -0
  204. package/lib/esm/domain/index.js.map +1 -0
  205. package/lib/esm/errors/UnsupportedDecoratorType.js +17 -0
  206. package/lib/esm/errors/UnsupportedDecoratorType.js.map +1 -0
  207. package/lib/esm/index.js +6 -0
  208. package/lib/esm/index.js.map +1 -0
  209. package/lib/esm/interfaces/AnyDecorator.js +2 -0
  210. package/lib/esm/interfaces/AnyDecorator.js.map +1 -0
  211. package/lib/esm/interfaces/DecoratorParameters.js +2 -0
  212. package/lib/esm/interfaces/DecoratorParameters.js.map +1 -0
  213. package/lib/esm/interfaces/HashOf.js +2 -0
  214. package/lib/esm/interfaces/HashOf.js.map +1 -0
  215. package/lib/esm/interfaces/MetadataTypes.js +2 -0
  216. package/lib/esm/interfaces/MetadataTypes.js.map +1 -0
  217. package/lib/esm/interfaces/ValueOf.js +2 -0
  218. package/lib/esm/interfaces/ValueOf.js.map +1 -0
  219. package/lib/esm/interfaces/index.js +2 -0
  220. package/lib/esm/interfaces/index.js.map +1 -0
  221. package/lib/esm/utils/catchError.js +17 -0
  222. package/lib/esm/utils/catchError.js.map +1 -0
  223. package/lib/esm/utils/decorators/decorateMethodsOf.js +19 -0
  224. package/lib/esm/utils/decorators/decorateMethodsOf.js.map +1 -0
  225. package/lib/esm/utils/decorators/decoratorArgs.js +5 -0
  226. package/lib/esm/utils/decorators/decoratorArgs.js.map +1 -0
  227. package/lib/esm/utils/decorators/decoratorTypeOf.js +19 -0
  228. package/lib/esm/utils/decorators/decoratorTypeOf.js.map +1 -0
  229. package/lib/esm/utils/decorators/inheritedDescriptorOf.js +11 -0
  230. package/lib/esm/utils/decorators/inheritedDescriptorOf.js.map +1 -0
  231. package/lib/esm/utils/decorators/useDecorators.js +10 -0
  232. package/lib/esm/utils/decorators/useDecorators.js.map +1 -0
  233. package/lib/esm/utils/decorators/useMethodDecorators.js +10 -0
  234. package/lib/esm/utils/decorators/useMethodDecorators.js.map +1 -0
  235. package/lib/esm/utils/http/getHostInfoFromPort.js +17 -0
  236. package/lib/esm/utils/http/getHostInfoFromPort.js.map +1 -0
  237. package/lib/esm/utils/imports/importPackage.js +12 -0
  238. package/lib/esm/utils/imports/importPackage.js.map +1 -0
  239. package/lib/esm/utils/index.js +16 -0
  240. package/lib/esm/utils/index.js.map +1 -0
  241. package/lib/esm/utils/objects/ancestorOf.js +7 -0
  242. package/lib/esm/utils/objects/ancestorOf.js.map +1 -0
  243. package/lib/esm/utils/objects/ancestorsOf.js +18 -0
  244. package/lib/esm/utils/objects/ancestorsOf.js.map +1 -0
  245. package/lib/esm/utils/objects/classOf.js +18 -0
  246. package/lib/esm/utils/objects/classOf.js.map +1 -0
  247. package/lib/esm/utils/objects/cleanObject.js +20 -0
  248. package/lib/esm/utils/objects/cleanObject.js.map +1 -0
  249. package/lib/esm/utils/objects/constructorOf.js +15 -0
  250. package/lib/esm/utils/objects/constructorOf.js.map +1 -0
  251. package/lib/esm/utils/objects/createInstance.js +5 -0
  252. package/lib/esm/utils/objects/createInstance.js.map +1 -0
  253. package/lib/esm/utils/objects/deepClone.js +53 -0
  254. package/lib/esm/utils/objects/deepClone.js.map +1 -0
  255. package/lib/esm/utils/objects/deepMerge.js +58 -0
  256. package/lib/esm/utils/objects/deepMerge.js.map +1 -0
  257. package/lib/esm/utils/objects/descriptorOf.js +14 -0
  258. package/lib/esm/utils/objects/descriptorOf.js.map +1 -0
  259. package/lib/esm/utils/objects/getClassOrSymbol.js +6 -0
  260. package/lib/esm/utils/objects/getClassOrSymbol.js.map +1 -0
  261. package/lib/esm/utils/objects/getConstructorArgNames.js +5 -0
  262. package/lib/esm/utils/objects/getConstructorArgNames.js.map +1 -0
  263. package/lib/esm/utils/objects/getEnumerableKeys.js +16 -0
  264. package/lib/esm/utils/objects/getEnumerableKeys.js.map +1 -0
  265. package/lib/esm/utils/objects/getValue.js +45 -0
  266. package/lib/esm/utils/objects/getValue.js.map +1 -0
  267. package/lib/esm/utils/objects/index.js +43 -0
  268. package/lib/esm/utils/objects/index.js.map +1 -0
  269. package/lib/esm/utils/objects/isArray.js +18 -0
  270. package/lib/esm/utils/objects/isArray.js.map +1 -0
  271. package/lib/esm/utils/objects/isArrowFn.js +5 -0
  272. package/lib/esm/utils/objects/isArrowFn.js.map +1 -0
  273. package/lib/esm/utils/objects/isBoolean.js +12 -0
  274. package/lib/esm/utils/objects/isBoolean.js.map +1 -0
  275. package/lib/esm/utils/objects/isClass.js +22 -0
  276. package/lib/esm/utils/objects/isClass.js.map +1 -0
  277. package/lib/esm/utils/objects/isCollection.js +18 -0
  278. package/lib/esm/utils/objects/isCollection.js.map +1 -0
  279. package/lib/esm/utils/objects/isDate.js +9 -0
  280. package/lib/esm/utils/objects/isDate.js.map +1 -0
  281. package/lib/esm/utils/objects/isEmpty.js +10 -0
  282. package/lib/esm/utils/objects/isEmpty.js.map +1 -0
  283. package/lib/esm/utils/objects/isEnumerable.js +18 -0
  284. package/lib/esm/utils/objects/isEnumerable.js.map +1 -0
  285. package/lib/esm/utils/objects/isFunction.js +4 -0
  286. package/lib/esm/utils/objects/isFunction.js.map +1 -0
  287. package/lib/esm/utils/objects/isInheritedFrom.js +22 -0
  288. package/lib/esm/utils/objects/isInheritedFrom.js.map +1 -0
  289. package/lib/esm/utils/objects/isNil.js +4 -0
  290. package/lib/esm/utils/objects/isNil.js.map +1 -0
  291. package/lib/esm/utils/objects/isNumber.js +12 -0
  292. package/lib/esm/utils/objects/isNumber.js.map +1 -0
  293. package/lib/esm/utils/objects/isObject.js +4 -0
  294. package/lib/esm/utils/objects/isObject.js.map +1 -0
  295. package/lib/esm/utils/objects/isObservable.js +4 -0
  296. package/lib/esm/utils/objects/isObservable.js.map +1 -0
  297. package/lib/esm/utils/objects/isPlainObject.js +13 -0
  298. package/lib/esm/utils/objects/isPlainObject.js.map +1 -0
  299. package/lib/esm/utils/objects/isPrimitive.js +24 -0
  300. package/lib/esm/utils/objects/isPrimitive.js.map +1 -0
  301. package/lib/esm/utils/objects/isPromise.js +12 -0
  302. package/lib/esm/utils/objects/isPromise.js.map +1 -0
  303. package/lib/esm/utils/objects/isProtectedKey.js +8 -0
  304. package/lib/esm/utils/objects/isProtectedKey.js.map +1 -0
  305. package/lib/esm/utils/objects/isSerializable.js +9 -0
  306. package/lib/esm/utils/objects/isSerializable.js.map +1 -0
  307. package/lib/esm/utils/objects/isStream.js +4 -0
  308. package/lib/esm/utils/objects/isStream.js.map +1 -0
  309. package/lib/esm/utils/objects/isString.js +11 -0
  310. package/lib/esm/utils/objects/isString.js.map +1 -0
  311. package/lib/esm/utils/objects/isSymbol.js +11 -0
  312. package/lib/esm/utils/objects/isSymbol.js.map +1 -0
  313. package/lib/esm/utils/objects/methodsOf.js +21 -0
  314. package/lib/esm/utils/objects/methodsOf.js.map +1 -0
  315. package/lib/esm/utils/objects/nameOf.js +26 -0
  316. package/lib/esm/utils/objects/nameOf.js.map +1 -0
  317. package/lib/esm/utils/objects/objectKeys.js +5 -0
  318. package/lib/esm/utils/objects/objectKeys.js.map +1 -0
  319. package/lib/esm/utils/objects/primitiveOf.js +16 -0
  320. package/lib/esm/utils/objects/primitiveOf.js.map +1 -0
  321. package/lib/esm/utils/objects/prototypeOf.js +10 -0
  322. package/lib/esm/utils/objects/prototypeOf.js.map +1 -0
  323. package/lib/esm/utils/objects/setValue.js +30 -0
  324. package/lib/esm/utils/objects/setValue.js.map +1 -0
  325. package/lib/esm/utils/objects/toMap.js +28 -0
  326. package/lib/esm/utils/objects/toMap.js.map +1 -0
  327. package/lib/esm/utils/objects/toStringConstructor.js +8 -0
  328. package/lib/esm/utils/objects/toStringConstructor.js.map +1 -0
  329. package/lib/esm/utils/proxyDelegation.js +50 -0
  330. package/lib/esm/utils/proxyDelegation.js.map +1 -0
  331. package/lib/esm/utils/uniq.js +11 -0
  332. package/lib/esm/utils/uniq.js.map +1 -0
  333. package/lib/{decorators → types/decorators}/configurable.d.ts +0 -0
  334. package/lib/{decorators → types/decorators}/deprecated.d.ts +0 -0
  335. package/lib/{decorators → types/decorators}/enumerable.d.ts +0 -0
  336. package/lib/{decorators → types/decorators}/index.d.ts +0 -0
  337. package/lib/{decorators → types/decorators}/notConfigurable.d.ts +0 -0
  338. package/lib/{decorators → types/decorators}/notEnumerable.d.ts +0 -0
  339. package/lib/{decorators → types/decorators}/readOnly.d.ts +0 -0
  340. package/lib/{decorators → types/decorators}/storeFn.d.ts +0 -0
  341. package/lib/{decorators → types/decorators}/storeMerge.d.ts +0 -0
  342. package/lib/{decorators → types/decorators}/storeSet.d.ts +0 -0
  343. package/lib/{decorators → types/decorators}/writable.d.ts +0 -0
  344. package/lib/{domain → types/domain}/AnyToPromise.d.ts +0 -0
  345. package/lib/{domain → types/domain}/DecoratorTypes.d.ts +0 -0
  346. package/lib/{domain → types/domain}/Env.d.ts +0 -0
  347. package/lib/{domain → types/domain}/Hooks.d.ts +0 -0
  348. package/lib/{domain → types/domain}/Metadata.d.ts +0 -0
  349. package/lib/{domain → types/domain}/Store.d.ts +5 -1
  350. package/lib/{domain → types/domain}/Type.d.ts +0 -0
  351. package/lib/{domain → types/domain}/index.d.ts +0 -1
  352. package/lib/{errors → types/errors}/UnsupportedDecoratorType.d.ts +0 -0
  353. package/lib/{index.d.ts → types/index.d.ts} +0 -0
  354. package/lib/{interfaces → types/interfaces}/AnyDecorator.d.ts +0 -0
  355. package/lib/{interfaces → types/interfaces}/DecoratorParameters.d.ts +0 -0
  356. package/lib/{interfaces → types/interfaces}/HashOf.d.ts +0 -0
  357. package/lib/{interfaces → types/interfaces}/MetadataTypes.d.ts +0 -0
  358. package/lib/{interfaces → types/interfaces}/ValueOf.d.ts +0 -0
  359. package/lib/{interfaces → types/interfaces}/index.d.ts +0 -0
  360. package/lib/{utils → types/utils}/catchError.d.ts +0 -0
  361. package/lib/{utils → types/utils}/decorators/decorateMethodsOf.d.ts +0 -0
  362. package/lib/{utils → types/utils}/decorators/decoratorArgs.d.ts +0 -0
  363. package/lib/{utils → types/utils}/decorators/decoratorTypeOf.d.ts +0 -0
  364. package/lib/{utils → types/utils}/decorators/inheritedDescriptorOf.d.ts +0 -0
  365. package/lib/{utils → types/utils}/decorators/useDecorators.d.ts +0 -0
  366. package/lib/{utils → types/utils}/decorators/useMethodDecorators.d.ts +0 -0
  367. package/lib/types/utils/http/getHostInfoFromPort.d.ts +6 -0
  368. package/lib/types/utils/imports/importPackage.d.ts +1 -0
  369. package/lib/{utils → types/utils}/index.d.ts +2 -0
  370. package/lib/{utils/objects/getInheritedClass.d.ts → types/utils/objects/ancestorOf.d.ts} +1 -0
  371. package/lib/{utils/objects/ancestorOf.d.ts → types/utils/objects/ancestorsOf.d.ts} +0 -0
  372. package/lib/{utils → types/utils}/objects/classOf.d.ts +0 -0
  373. package/lib/{utils → types/utils}/objects/cleanObject.d.ts +0 -0
  374. package/lib/{utils → types/utils}/objects/constructorOf.d.ts +0 -0
  375. package/lib/{utils → types/utils}/objects/createInstance.d.ts +0 -0
  376. package/lib/types/utils/objects/deepClone.d.ts +6 -0
  377. package/lib/{utils → types/utils}/objects/deepMerge.d.ts +0 -0
  378. package/lib/{utils → types/utils}/objects/descriptorOf.d.ts +1 -0
  379. package/lib/{utils → types/utils}/objects/getClassOrSymbol.d.ts +0 -0
  380. package/lib/{utils → types/utils}/objects/getConstructorArgNames.d.ts +0 -0
  381. package/lib/{utils → types/utils}/objects/getEnumerableKeys.d.ts +0 -0
  382. package/lib/{utils → types/utils}/objects/getValue.d.ts +0 -0
  383. package/lib/{utils → types/utils}/objects/index.d.ts +3 -1
  384. package/lib/{utils → types/utils}/objects/isArray.d.ts +0 -0
  385. package/lib/types/utils/objects/isArrowFn.d.ts +1 -0
  386. package/lib/{utils → types/utils}/objects/isBoolean.d.ts +0 -0
  387. package/lib/{utils → types/utils}/objects/isClass.d.ts +0 -0
  388. package/lib/{utils → types/utils}/objects/isCollection.d.ts +0 -0
  389. package/lib/{utils → types/utils}/objects/isDate.d.ts +0 -0
  390. package/lib/{utils → types/utils}/objects/isEmpty.d.ts +0 -0
  391. package/lib/{utils → types/utils}/objects/isEnumerable.d.ts +0 -0
  392. package/lib/{utils → types/utils}/objects/isFunction.d.ts +0 -0
  393. package/lib/{utils → types/utils}/objects/isInheritedFrom.d.ts +0 -0
  394. package/lib/{utils → types/utils}/objects/isNil.d.ts +0 -0
  395. package/lib/{utils → types/utils}/objects/isNumber.d.ts +0 -0
  396. package/lib/{utils → types/utils}/objects/isObject.d.ts +0 -0
  397. package/lib/{utils → types/utils}/objects/isObservable.d.ts +0 -0
  398. package/lib/{utils → types/utils}/objects/isPlainObject.d.ts +0 -0
  399. package/lib/{utils → types/utils}/objects/isPrimitive.d.ts +0 -0
  400. package/lib/{utils → types/utils}/objects/isPromise.d.ts +0 -0
  401. package/lib/{utils → types/utils}/objects/isProtectedKey.d.ts +0 -0
  402. package/lib/types/utils/objects/isSerializable.d.ts +1 -0
  403. package/lib/{utils → types/utils}/objects/isStream.d.ts +0 -0
  404. package/lib/{utils → types/utils}/objects/isString.d.ts +0 -0
  405. package/lib/{utils → types/utils}/objects/isSymbol.d.ts +0 -0
  406. package/lib/{utils → types/utils}/objects/methodsOf.d.ts +0 -0
  407. package/lib/{utils → types/utils}/objects/nameOf.d.ts +0 -0
  408. package/lib/{utils → types/utils}/objects/objectKeys.d.ts +0 -0
  409. package/lib/{utils → types/utils}/objects/primitiveOf.d.ts +0 -0
  410. package/lib/{utils → types/utils}/objects/prototypeOf.d.ts +0 -0
  411. package/lib/{utils → types/utils}/objects/setValue.d.ts +0 -0
  412. package/lib/{utils → types/utils}/objects/toMap.d.ts +0 -0
  413. package/lib/{utils → types/utils}/objects/toStringConstructor.d.ts +0 -0
  414. package/lib/{utils → types/utils}/proxyDelegation.d.ts +0 -0
  415. package/lib/{utils → types/utils}/uniq.d.ts +0 -0
  416. package/package.json +11 -7
  417. package/tsconfig.compile.esm.json +23 -0
  418. package/lib/domain/Entity.d.ts +0 -97
  419. package/lib/index.js +0 -2271
  420. package/lib/index.js.map +0 -1
  421. package/lib/index.modern.js +0 -2185
  422. package/lib/index.modern.js.map +0 -1
  423. package/lib/utils/objects/deepClone.d.ts +0 -5
  424. package/lib/utils/objects/isArrowFn.d.ts +0 -1
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Configurable = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const utils_1 = require("../utils");
8
+ /** */
9
+ function Configurable(value = true) {
10
+ return (target, propertyKey) => {
11
+ const descriptor = (0, utils_1.descriptorOf)(target, propertyKey) || { writable: true, enumerable: true };
12
+ descriptor.configurable = value;
13
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
14
+ return descriptor;
15
+ };
16
+ }
17
+ exports.Configurable = Configurable;
18
+ //# sourceMappingURL=configurable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurable.js","sourceRoot":"","sources":["../../../src/decorators/configurable.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oCAAsC;AAEtC,MAAM;AAEN,SAAgB,YAAY,CAAC,QAAiB,IAAI;IAChD,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC3F,UAAU,CAAC,YAAY,GAAG,KAAK,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,oCAQC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Configurable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, enumerable: true};\n descriptor.configurable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Deprecated = void 0;
4
+ /**
5
+ * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.
6
+ *
7
+ * ```typescript
8
+ * provide Foo {
9
+ *
10
+ * @Deprecated("Foo.method: Use Foo.method2 instead")
11
+ * public method() {
12
+ *
13
+ * }
14
+ * ```
15
+ *
16
+ * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.
17
+ * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.
18
+ *
19
+ * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`
20
+ * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.
21
+ *
22
+ * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`
23
+ * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.
24
+ *
25
+ * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,
26
+ * then an exception will be thrown when the deprecated function is called.
27
+ *
28
+ * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`
29
+ * and `process.traceDeprecation`.
30
+ *
31
+ * @param message
32
+ * @returns {Function}
33
+ * @decorator
34
+ */
35
+ function Deprecated(message) {
36
+ return (target, targetKey, descriptor) => {
37
+ const originalMethod = descriptor.value;
38
+ descriptor.value = require("util").deprecate(originalMethod, message);
39
+ return descriptor;
40
+ };
41
+ }
42
+ exports.Deprecated = Deprecated;
43
+ //# sourceMappingURL=deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated.js","sourceRoot":"","sources":["../../../src/decorators/deprecated.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,SAAgB,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,UAAwC,EAAE,EAAE;QACxF,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QAEtE,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,gCAQC","sourcesContent":["import {Type} from \"../domain/Type\";\n\n/**\n * The `@Deprecated()` decorators wraps the given method in such a way that it is marked as deprecated.\n *\n * ```typescript\n * provide Foo {\n *\n * @Deprecated(\"Foo.method: Use Foo.method2 instead\")\n * public method() {\n *\n * }\n * ```\n *\n * When called, @Deprecated() will return a function that will emit a `DeprecationWarning` using the `process.on('warning')` event.\n * By default, this warning will be emitted and printed to `stderr` exactly once, the first time it is called. After the warning is emitted, the wrapped method is called.\n *\n * If either the `--no-deprecation` or `--no-warnings` command line flags are used, or if the `process.noDeprecation`\n * property is set to `true` prior to the first deprecation warning, the `@Deprecated()` decorators does nothing.\n *\n * If the `--trace-deprecation` or `--trace-warnings` command line flags are set, or the `process.traceDeprecation`\n * property is set to `true`, a warning and a stack trace are printed to stderr the first time the deprecated function is called.\n *\n * If the `--throw-deprecation` command line flag is set, or the `process.throwDeprecation` property is set to `true`,\n * then an exception will be thrown when the deprecated function is called.\n *\n * The `--throw-deprecation` command line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation`\n * and `process.traceDeprecation`.\n *\n * @param message\n * @returns {Function}\n * @decorator\n */\nexport function Deprecated(message: string): Function {\n return (target: Type<any>, targetKey: string, descriptor: TypedPropertyDescriptor<any>) => {\n const originalMethod = descriptor.value;\n\n descriptor.value = require(\"util\").deprecate(originalMethod, message);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Enumerable = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const utils_1 = require("../utils");
8
+ /** */
9
+ function Enumerable(value = true) {
10
+ return (target, propertyKey) => {
11
+ const descriptor = (0, utils_1.descriptorOf)(target, propertyKey) || { writable: true, configurable: true };
12
+ descriptor.enumerable = value;
13
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
14
+ return descriptor;
15
+ };
16
+ }
17
+ exports.Enumerable = Enumerable;
18
+ //# sourceMappingURL=enumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enumerable.js","sourceRoot":"","sources":["../../../src/decorators/enumerable.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oCAAsC;AAEtC,MAAM;AAEN,SAAgB,UAAU,CAAC,QAAiB,IAAI;IAC9C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAC,CAAC;QAC7F,UAAU,CAAC,UAAU,GAAG,KAAK,CAAC;QAC9B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,gCAQC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Enumerable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {writable: true, configurable: true};\n descriptor.enumerable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ /**
5
+ * @module common/core
6
+ */
7
+ /** */
8
+ (0, tslib_1.__exportStar)(require("./deprecated"), exports);
9
+ (0, tslib_1.__exportStar)(require("./configurable"), exports);
10
+ (0, tslib_1.__exportStar)(require("./enumerable"), exports);
11
+ (0, tslib_1.__exportStar)(require("./writable"), exports);
12
+ (0, tslib_1.__exportStar)(require("./readOnly"), exports);
13
+ (0, tslib_1.__exportStar)(require("./notConfigurable"), exports);
14
+ (0, tslib_1.__exportStar)(require("./notEnumerable"), exports);
15
+ (0, tslib_1.__exportStar)(require("./storeSet"), exports);
16
+ (0, tslib_1.__exportStar)(require("./storeMerge"), exports);
17
+ (0, tslib_1.__exportStar)(require("./storeFn"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAM;AACN,4DAA6B;AAC7B,8DAA+B;AAC/B,4DAA6B;AAC7B,0DAA2B;AAC3B,0DAA2B;AAC3B,iEAAkC;AAClC,+DAAgC;AAChC,0DAA2B;AAC3B,4DAA6B;AAC7B,yDAA0B","sourcesContent":["/**\n * @module common/core\n */\n/** */\nexport * from \"./deprecated\";\nexport * from \"./configurable\";\nexport * from \"./enumerable\";\nexport * from \"./writable\";\nexport * from \"./readOnly\";\nexport * from \"./notConfigurable\";\nexport * from \"./notEnumerable\";\nexport * from \"./storeSet\";\nexport * from \"./storeMerge\";\nexport * from \"./storeFn\";\n"]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotConfigurable = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const configurable_1 = require("./configurable");
8
+ /** */
9
+ function NotConfigurable() {
10
+ return (0, configurable_1.Configurable)(false);
11
+ }
12
+ exports.NotConfigurable = NotConfigurable;
13
+ //# sourceMappingURL=notConfigurable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notConfigurable.js","sourceRoot":"","sources":["../../../src/decorators/notConfigurable.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,iDAA4C;AAC5C,MAAM;AACN,SAAgB,eAAe;IAC7B,OAAO,IAAA,2BAAY,EAAC,KAAK,CAAC,CAAC;AAC7B,CAAC;AAFD,0CAEC","sourcesContent":["/**\n * @module common/core\n */\nimport {Configurable} from \"./configurable\";\n/** */\nexport function NotConfigurable(): Function {\n return Configurable(false);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NotEnumerable = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const enumerable_1 = require("./enumerable");
8
+ /** */
9
+ function NotEnumerable() {
10
+ return (0, enumerable_1.Enumerable)(false);
11
+ }
12
+ exports.NotEnumerable = NotEnumerable;
13
+ //# sourceMappingURL=notEnumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notEnumerable.js","sourceRoot":"","sources":["../../../src/decorators/notEnumerable.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,6CAAwC;AACxC,MAAM;AACN,SAAgB,aAAa;IAC3B,OAAO,IAAA,uBAAU,EAAC,KAAK,CAAC,CAAC;AAC3B,CAAC;AAFD,sCAEC","sourcesContent":["/**\n * @module common/core\n */\nimport {Enumerable} from \"./enumerable\";\n/** */\nexport function NotEnumerable(): Function {\n return Enumerable(false);\n}\n"]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Readonly = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const writable_1 = require("./writable");
8
+ /** */
9
+ function Readonly() {
10
+ return (0, writable_1.Writable)(false);
11
+ }
12
+ exports.Readonly = Readonly;
13
+ //# sourceMappingURL=readOnly.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readOnly.js","sourceRoot":"","sources":["../../../src/decorators/readOnly.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yCAAoC;AACpC,MAAM;AACN,SAAgB,QAAQ;IACtB,OAAO,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;AACzB,CAAC;AAFD,4BAEC","sourcesContent":["/**\n * @module common/core\n */\nimport {Writable} from \"./writable\";\n/** */\nexport function Readonly(): Function {\n return Writable(false);\n}\n"]}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreFn = void 0;
4
+ const Store_1 = require("../domain/Store");
5
+ /**
6
+ * Create a store correctly configured from the parameters given by the decorator.
7
+ * The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).
8
+ * @param {(store: Store, parameters: DecoratorParameters) => void} fn
9
+ * @returns {Function}
10
+ */
11
+ function StoreFn(fn) {
12
+ return (...parameters) => {
13
+ const store = Store_1.Store.from(...parameters);
14
+ const result = fn(store, parameters);
15
+ if (typeof result === "function") {
16
+ result(...parameters);
17
+ }
18
+ return parameters[2];
19
+ };
20
+ }
21
+ exports.StoreFn = StoreFn;
22
+ //# sourceMappingURL=storeFn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeFn.js","sourceRoot":"","sources":["../../../src/decorators/storeFn.ts"],"names":[],"mappings":";;;AAAA,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,EAA2D;IACjF,OAAO,CAAC,GAAG,UAAiB,EAAO,EAAE;QACnC,MAAM,KAAK,GAAG,aAAK,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QACxC,MAAM,MAAM,GAAQ,EAAE,CAAC,KAAK,EAAE,UAAiC,CAAC,CAAC;QACjE,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;YAChC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC;SACvB;QAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAVD,0BAUC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {DecoratorParameters} from \"../interfaces/DecoratorParameters\";\n\n/**\n * Create a store correctly configured from the parameters given by the decorator.\n * The `fn` can return a decorator that will be initialized with the parameters (target, propertyKey, descriptor).\n * @param {(store: Store, parameters: DecoratorParameters) => void} fn\n * @returns {Function}\n */\nexport function StoreFn(fn: (store: Store, parameters: DecoratorParameters) => void): Function {\n return (...parameters: any[]): any => {\n const store = Store.from(...parameters);\n const result: any = fn(store, parameters as DecoratorParameters);\n if (typeof result === \"function\") {\n result(...parameters);\n }\n\n return parameters[2];\n };\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreMerge = void 0;
4
+ const storeFn_1 = require("./storeFn");
5
+ function StoreMerge(key, value) {
6
+ return (0, storeFn_1.StoreFn)((store) => {
7
+ store.merge(key, value);
8
+ });
9
+ }
10
+ exports.StoreMerge = StoreMerge;
11
+ //# sourceMappingURL=storeMerge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeMerge.js","sourceRoot":"","sources":["../../../src/decorators/storeMerge.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,SAAgB,UAAU,CAAC,GAAQ,EAAE,KAAU;IAC7C,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,gCAIC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreMerge(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.merge(key, value);\n });\n}\n"]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StoreSet = void 0;
4
+ const storeFn_1 = require("./storeFn");
5
+ function StoreSet(key, value) {
6
+ return (0, storeFn_1.StoreFn)((store) => {
7
+ store.set(key, value);
8
+ });
9
+ }
10
+ exports.StoreSet = StoreSet;
11
+ //# sourceMappingURL=storeSet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storeSet.js","sourceRoot":"","sources":["../../../src/decorators/storeSet.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,SAAgB,QAAQ,CAAC,GAAQ,EAAE,KAAU;IAC3C,OAAO,IAAA,iBAAO,EAAC,CAAC,KAAY,EAAE,EAAE;QAC9B,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,4BAIC","sourcesContent":["import {Store} from \"../domain/Store\";\nimport {StoreFn} from \"./storeFn\";\n\nexport function StoreSet(key: any, value: any): Function {\n return StoreFn((store: Store) => {\n store.set(key, value);\n });\n}\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Writable = void 0;
4
+ /**
5
+ * @module common/core
6
+ */
7
+ const utils_1 = require("../utils");
8
+ /** */
9
+ function Writable(value = true) {
10
+ return (target, propertyKey) => {
11
+ const descriptor = (0, utils_1.descriptorOf)(target, propertyKey) || { configurable: true, enumerable: true };
12
+ descriptor.writable = value;
13
+ Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);
14
+ return descriptor;
15
+ };
16
+ }
17
+ exports.Writable = Writable;
18
+ //# sourceMappingURL=writable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writable.js","sourceRoot":"","sources":["../../../src/decorators/writable.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,oCAAsC;AAEtC,MAAM;AAEN,SAAgB,QAAQ,CAAC,QAAiB,IAAI;IAC5C,OAAO,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QAC1C,MAAM,UAAU,GAAG,IAAA,oBAAY,EAAC,MAAM,EAAE,WAAW,CAAC,IAAI,EAAC,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;QAC/F,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC;QAC5B,MAAM,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAEvF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AARD,4BAQC","sourcesContent":["/**\n * @module common/core\n */\nimport {descriptorOf} from \"../utils\";\n\n/** */\n\nexport function Writable(value: boolean = true): Function {\n return (target: any, propertyKey: string) => {\n const descriptor = descriptorOf(target, propertyKey) || {configurable: true, enumerable: true};\n descriptor.writable = value;\n Object.defineProperty((target && target.prototype) || target, propertyKey, descriptor);\n\n return descriptor;\n };\n}\n"]}
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+ var _AnyToPromise_resolves, _AnyToPromise_rejects, _AnyToPromise_hasNextFunction, _AnyToPromise_promise;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.AnyToPromise = exports.AnyToPromiseResponseTypes = exports.AnyToPromiseStatus = void 0;
5
+ const tslib_1 = require("tslib");
6
+ const isObservable_1 = require("../utils/objects/isObservable");
7
+ const isPromise_1 = require("../utils/objects/isPromise");
8
+ const isStream_1 = require("../utils/objects/isStream");
9
+ /**
10
+ * @ignore
11
+ */
12
+ function isResponse(obj) {
13
+ return obj.data && obj.headers && obj.status && obj.statusText;
14
+ }
15
+ /**
16
+ * @ignore
17
+ */
18
+ var AnyToPromiseStatus;
19
+ (function (AnyToPromiseStatus) {
20
+ AnyToPromiseStatus["PENDING"] = "PENDING";
21
+ AnyToPromiseStatus["CANCELED"] = "CANCELED";
22
+ AnyToPromiseStatus["RESOLVED"] = "RESOLVED";
23
+ AnyToPromiseStatus["REJECTED"] = "REJECTED";
24
+ })(AnyToPromiseStatus = exports.AnyToPromiseStatus || (exports.AnyToPromiseStatus = {}));
25
+ var AnyToPromiseResponseTypes;
26
+ (function (AnyToPromiseResponseTypes) {
27
+ AnyToPromiseResponseTypes["STREAM"] = "STREAM";
28
+ AnyToPromiseResponseTypes["BUFFER"] = "BUFFER";
29
+ AnyToPromiseResponseTypes["DATA"] = "DATA";
30
+ })(AnyToPromiseResponseTypes = exports.AnyToPromiseResponseTypes || (exports.AnyToPromiseResponseTypes = {}));
31
+ class AnyToPromise {
32
+ constructor({ hasNextFunction = false } = {}) {
33
+ this.status = AnyToPromiseStatus.PENDING;
34
+ _AnyToPromise_resolves.set(this, void 0);
35
+ _AnyToPromise_rejects.set(this, void 0);
36
+ _AnyToPromise_hasNextFunction.set(this, false);
37
+ _AnyToPromise_promise.set(this, void 0);
38
+ (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_hasNextFunction, hasNextFunction, "f");
39
+ (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_promise, new Promise((resolve, reject) => {
40
+ (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_resolves, resolve, "f");
41
+ (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_rejects, reject, "f");
42
+ }), "f");
43
+ }
44
+ isDone() {
45
+ return this.status !== AnyToPromiseStatus.PENDING;
46
+ }
47
+ get next() {
48
+ (0, tslib_1.__classPrivateFieldSet)(this, _AnyToPromise_hasNextFunction, true, "f");
49
+ return (error) => {
50
+ if (this.isDone()) {
51
+ return;
52
+ }
53
+ return error ? this.reject(error) : this.resolve({ type: AnyToPromiseResponseTypes.DATA });
54
+ };
55
+ }
56
+ /**
57
+ *
58
+ */
59
+ async call(cb) {
60
+ if (this.isDone()) {
61
+ return this;
62
+ }
63
+ try {
64
+ this.handle(cb());
65
+ }
66
+ catch (er) {
67
+ this.reject(er);
68
+ }
69
+ return (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_promise, "f");
70
+ }
71
+ reject(er) {
72
+ if (this.isDone()) {
73
+ return;
74
+ }
75
+ this.done(AnyToPromiseStatus.REJECTED);
76
+ (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_rejects, "f").call(this, er);
77
+ }
78
+ resolve(response = {}) {
79
+ if (this.isDone()) {
80
+ return;
81
+ }
82
+ this.done(AnyToPromiseStatus.RESOLVED);
83
+ (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_resolves, "f").call(this, { ...response, state: AnyToPromiseStatus.RESOLVED });
84
+ }
85
+ destroy() { }
86
+ cancel() {
87
+ if (this.isDone()) {
88
+ return;
89
+ }
90
+ this.done(AnyToPromiseStatus.CANCELED);
91
+ return (0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_resolves, "f").call(this, { state: AnyToPromiseStatus.CANCELED });
92
+ }
93
+ done(status) {
94
+ this.destroy();
95
+ this.status = status;
96
+ }
97
+ handle(process, additionalProps = {}) {
98
+ if (this.isDone()) {
99
+ return;
100
+ }
101
+ if (process) {
102
+ if (this.isCanceledResponse(process)) {
103
+ // ABANDON
104
+ return this.cancel();
105
+ }
106
+ if ((0, isObservable_1.isObservable)(process)) {
107
+ process = process.toPromise();
108
+ }
109
+ if (isResponse(process)) {
110
+ return this.handle(process.data, {
111
+ ...additionalProps,
112
+ status: process.status,
113
+ headers: process.headers
114
+ });
115
+ }
116
+ if ((0, isStream_1.isStream)(process)) {
117
+ return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process });
118
+ }
119
+ if ((0, isStream_1.isStream)(process) || Buffer.isBuffer(process)) {
120
+ return this.resolve({ ...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process });
121
+ }
122
+ if ((0, isPromise_1.isPromise)(process)) {
123
+ return process
124
+ .then((result) => this.handle(result, additionalProps))
125
+ .catch((error) => {
126
+ if (error.response && isResponse(error.response)) {
127
+ return this.handle(error.response);
128
+ }
129
+ return this.reject(error);
130
+ });
131
+ }
132
+ }
133
+ if (!(0, tslib_1.__classPrivateFieldGet)(this, _AnyToPromise_hasNextFunction, "f")) {
134
+ // no next function and empty response
135
+ return this.resolve({
136
+ ...additionalProps,
137
+ data: process,
138
+ type: AnyToPromiseResponseTypes.DATA
139
+ });
140
+ }
141
+ }
142
+ isCanceledResponse(process) {
143
+ return process === AnyToPromiseStatus.CANCELED;
144
+ }
145
+ }
146
+ exports.AnyToPromise = AnyToPromise;
147
+ _AnyToPromise_resolves = new WeakMap(), _AnyToPromise_rejects = new WeakMap(), _AnyToPromise_hasNextFunction = new WeakMap(), _AnyToPromise_promise = new WeakMap();
148
+ //# sourceMappingURL=AnyToPromise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyToPromise.js","sourceRoot":"","sources":["../../../src/domain/AnyToPromise.ts"],"names":[],"mappings":";;;;;AAAA,gEAA2D;AAC3D,0DAAqD;AACrD,wDAAmD;AAEnD;;GAEG;AACH,SAAS,UAAU,CAAC,GAAQ;IAC1B,OAAO,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC;AACjE,CAAC;AAED;;GAEG;AACH,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,yCAAmB,CAAA;IACnB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;IACrB,2CAAqB,CAAA;AACvB,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AAED,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACf,CAAC,EAJW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAIpC;AAUD,MAAa,YAAY;IAUvB,YAAY,EAAC,eAAe,GAAG,KAAK,KAAiC,EAAE;Q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H,CAAC;IAES,kBAAkB,CAAC,OAAY;QACvC,OAAO,OAAO,KAAK,kBAAkB,CAAC,QAAQ,CAAC;IACjD,CAAC;CACF;AAhJD,oCAgJC","sourcesContent":["import {isObservable} from \"../utils/objects/isObservable\";\nimport {isPromise} from \"../utils/objects/isPromise\";\nimport {isStream} from \"../utils/objects/isStream\";\n\n/**\n * @ignore\n */\nfunction isResponse(obj: any) {\n return obj.data && obj.headers && obj.status && obj.statusText;\n}\n\n/**\n * @ignore\n */\nexport enum AnyToPromiseStatus {\n PENDING = \"PENDING\",\n CANCELED = \"CANCELED\",\n RESOLVED = \"RESOLVED\",\n REJECTED = \"REJECTED\"\n}\n\nexport enum AnyToPromiseResponseTypes {\n STREAM = \"STREAM\",\n BUFFER = \"BUFFER\",\n DATA = \"DATA\"\n}\n\nexport interface AnyPromiseResult<T = any> {\n state: AnyToPromiseStatus;\n type: AnyToPromiseResponseTypes;\n status?: number;\n headers?: Record<string, any>;\n data: T;\n}\n\nexport class AnyToPromise<T = any> {\n public status = AnyToPromiseStatus.PENDING;\n public args: any[];\n\n #resolves: any;\n #rejects: any;\n #hasNextFunction = false;\n\n readonly #promise: Promise<AnyPromiseResult<T>>;\n\n constructor({hasNextFunction = false}: {hasNextFunction?: boolean} = {}) {\n this.#hasNextFunction = hasNextFunction;\n\n this.#promise = new Promise((resolve: any, reject: any) => {\n this.#resolves = resolve;\n this.#rejects = reject;\n });\n }\n\n isDone(): boolean {\n return this.status !== AnyToPromiseStatus.PENDING;\n }\n\n get next() {\n this.#hasNextFunction = true;\n\n return (error?: any) => {\n if (this.isDone()) {\n return;\n }\n\n return error ? this.reject(error) : this.resolve({type: AnyToPromiseResponseTypes.DATA});\n };\n }\n\n /**\n *\n */\n async call(cb: Function): Promise<AnyPromiseResult<T>> {\n if (this.isDone()) {\n return this as any;\n }\n\n try {\n this.handle(cb());\n } catch (er) {\n this.reject(er);\n }\n\n return this.#promise;\n }\n\n reject(er: any) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.REJECTED);\n\n this.#rejects(er);\n }\n\n resolve(response: any = {}) {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.RESOLVED);\n\n this.#resolves({...response, state: AnyToPromiseStatus.RESOLVED});\n }\n\n destroy() {}\n\n cancel() {\n if (this.isDone()) {\n return;\n }\n\n this.done(AnyToPromiseStatus.CANCELED);\n\n return this.#resolves({state: AnyToPromiseStatus.CANCELED});\n }\n\n done(status: AnyToPromiseStatus) {\n this.destroy();\n this.status = status;\n }\n\n handle(process: any, additionalProps = {}): any {\n if (this.isDone()) {\n return;\n }\n\n if (process) {\n if (this.isCanceledResponse(process)) {\n // ABANDON\n return this.cancel();\n }\n\n if (isObservable(process)) {\n process = process.toPromise();\n }\n\n if (isResponse(process)) {\n return this.handle(process.data, {\n ...additionalProps,\n status: process.status,\n headers: process.headers\n });\n }\n\n if (isStream(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.STREAM, data: process});\n }\n if (isStream(process) || Buffer.isBuffer(process)) {\n return this.resolve({...additionalProps, type: AnyToPromiseResponseTypes.BUFFER, data: process});\n }\n\n if (isPromise(process)) {\n return process\n .then((result: any) => this.handle(result, additionalProps))\n .catch((error: any) => {\n if (error.response && isResponse(error.response)) {\n return this.handle(error.response);\n }\n return this.reject(error);\n });\n }\n }\n\n if (!this.#hasNextFunction) {\n // no next function and empty response\n return this.resolve({\n ...additionalProps,\n data: process,\n type: AnyToPromiseResponseTypes.DATA\n });\n }\n }\n\n protected isCanceledResponse(process: any) {\n return process === AnyToPromiseStatus.CANCELED;\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecoratorTypes = void 0;
4
+ var DecoratorTypes;
5
+ (function (DecoratorTypes) {
6
+ DecoratorTypes["PARAM"] = "parameter";
7
+ DecoratorTypes["PARAM_CTOR"] = "parameter.constructor";
8
+ DecoratorTypes["PARAM_STC"] = "parameter.static";
9
+ DecoratorTypes["PROP"] = "property";
10
+ DecoratorTypes["PROP_STC"] = "property.static";
11
+ DecoratorTypes["METHOD"] = "method";
12
+ DecoratorTypes["METHOD_STC"] = "method.static";
13
+ DecoratorTypes["CLASS"] = "class";
14
+ })(DecoratorTypes = exports.DecoratorTypes || (exports.DecoratorTypes = {}));
15
+ //# sourceMappingURL=DecoratorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DecoratorTypes.js","sourceRoot":"","sources":["../../../src/domain/DecoratorTypes.ts"],"names":[],"mappings":";;;AAAA,IAAY,cASX;AATD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,sDAAoC,CAAA;IACpC,gDAA8B,CAAA;IAC9B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,mCAAiB,CAAA;IACjB,8CAA4B,CAAA;IAC5B,iCAAe,CAAA;AACjB,CAAC,EATW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QASzB","sourcesContent":["export enum DecoratorTypes {\n PARAM = \"parameter\",\n PARAM_CTOR = \"parameter.constructor\",\n PARAM_STC = \"parameter.static\",\n PROP = \"property\",\n PROP_STC = \"property.static\",\n METHOD = \"method\",\n METHOD_STC = \"method.static\",\n CLASS = \"class\"\n}\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnvTypes = exports.Env = void 0;
4
+ /**
5
+ *
6
+ */
7
+ var Env;
8
+ (function (Env) {
9
+ Env["PROD"] = "production";
10
+ Env["DEV"] = "development";
11
+ Env["TEST"] = "test";
12
+ })(Env = exports.Env || (exports.Env = {}));
13
+ /**
14
+ * Fallback
15
+ * @type {Env}
16
+ */
17
+ // tslint:disable-next-line: variable-name
18
+ exports.EnvTypes = Env;
19
+ //# sourceMappingURL=Env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../src/domain/Env.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,GAIX;AAJD,WAAY,GAAG;IACb,0BAAmB,CAAA;IACnB,0BAAmB,CAAA;IACnB,oBAAa,CAAA;AACf,CAAC,EAJW,GAAG,GAAH,WAAG,KAAH,WAAG,QAId;AAED;;;GAGG;AACH,0CAA0C;AAC7B,QAAA,QAAQ,GAAG,GAAG,CAAC","sourcesContent":["/**\n *\n */\nexport enum Env {\n PROD = \"production\",\n DEV = \"development\",\n TEST = \"test\"\n}\n\n/**\n * Fallback\n * @type {Env}\n */\n// tslint:disable-next-line: variable-name\nexport const EnvTypes = Env;\n"]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Hooks = void 0;
4
+ class Hooks {
5
+ constructor() {
6
+ this.listeners = new Map();
7
+ }
8
+ /**
9
+ * Listen a hook event
10
+ * @param event
11
+ * @param cb
12
+ */
13
+ on(event, cb) {
14
+ if (!this.listeners.has(event)) {
15
+ this.listeners.set(event, []);
16
+ }
17
+ this.listeners.get(event).push(cb);
18
+ return this;
19
+ }
20
+ /**
21
+ * Remove a listener attached to an event
22
+ * @param event
23
+ * @param cb
24
+ */
25
+ off(event, cb) {
26
+ if (this.listeners.has(event)) {
27
+ this.listeners.set(event, this.listeners.get(event).filter((item) => item === cb));
28
+ }
29
+ return this;
30
+ }
31
+ /**
32
+ * Trigger an event and call listener.
33
+ * @param event
34
+ * @param args
35
+ * @param callThis
36
+ */
37
+ emit(event, args = [], callThis = null) {
38
+ if (this.listeners.has(event)) {
39
+ for (const cb of this.listeners.get(event)) {
40
+ cb.call(callThis, ...args);
41
+ }
42
+ }
43
+ }
44
+ /**
45
+ * Trigger an event, listener alter given value and return it.
46
+ * @param event
47
+ * @param value
48
+ * @param args
49
+ * @param callThis
50
+ */
51
+ alter(event, value, args = [], callThis = null) {
52
+ if (this.listeners.has(event)) {
53
+ for (const cb of this.listeners.get(event)) {
54
+ value = cb.call(callThis, value, ...args);
55
+ }
56
+ }
57
+ return value;
58
+ }
59
+ /**
60
+ * Trigger an event and call async listener.
61
+ * @param event
62
+ * @param args
63
+ * @param callThis
64
+ */
65
+ async asyncEmit(event, args = [], callThis = null) {
66
+ if (this.listeners.has(event)) {
67
+ for (const cb of this.listeners.get(event)) {
68
+ await cb.call(callThis, ...args);
69
+ }
70
+ }
71
+ }
72
+ /**
73
+ * Trigger an event, async listener alter given value and return it.
74
+ * @param event
75
+ * @param value
76
+ * @param args
77
+ * @param callThis
78
+ */
79
+ async asyncAlter(event, value, args = [], callThis = null) {
80
+ if (this.listeners.has(event)) {
81
+ for (const cb of this.listeners.get(event)) {
82
+ value = await cb.call(callThis, value, ...args);
83
+ }
84
+ }
85
+ return value;
86
+ }
87
+ }
88
+ exports.Hooks = Hooks;
89
+ //# sourceMappingURL=Hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Hooks.js","sourceRoot":"","sources":["../../../src/domain/Hooks.ts"],"names":[],"mappings":";;;AAAA,MAAa,KAAK;IAAlB;QACU,cAAS,GAA4B,IAAI,GAAG,EAAE,CAAC;IA8FzD,CAAC;IA5FC;;;;OAIG;IACH,EAAE,CAAC,KAAa,EAAE,EAAY;QAC5B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;SAC/B;QAED,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,KAAa,EAAE,EAAY;QAC7B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7B,IAAI,CAAC,SAAS,CAAC,GAAG,CAChB,KAAK,EACL,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,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AU,EAAE,OAAiB,EAAE,EAAE,WAAgB,IAAI;QACnF,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YAC7B,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,EAAE;gBAC3C,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;aACjD;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AA/FD,sBA+FC","sourcesContent":["export class Hooks {\n private listeners: Map<string, Function[]> = new Map();\n\n /**\n * Listen a hook event\n * @param event\n * @param cb\n */\n on(event: string, cb: Function) {\n if (!this.listeners.has(event)) {\n this.listeners.set(event, []);\n }\n\n this.listeners.get(event)!.push(cb);\n\n return this;\n }\n\n /**\n * Remove a listener attached to an event\n * @param event\n * @param cb\n */\n off(event: string, cb: Function) {\n if (this.listeners.has(event)) {\n this.listeners.set(\n event,\n this.listeners.get(event)!.filter((item) => item === cb)\n );\n }\n\n return this;\n }\n\n /**\n * Trigger an event and call listener.\n * @param event\n * @param args\n * @param callThis\n */\n emit(event: string, args: any[] = [], callThis: any = null): void {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n alter(event: string, value: any, args: any[] = [], callThis: any = null): any {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n\n /**\n * Trigger an event and call async listener.\n * @param event\n * @param args\n * @param callThis\n */\n async asyncEmit(event: string, args: any[] = [], callThis: any = null): Promise<void> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n await cb.call(callThis, ...args);\n }\n }\n }\n\n /**\n * Trigger an event, async listener alter given value and return it.\n * @param event\n * @param value\n * @param args\n * @param callThis\n */\n async asyncAlter(event: string, value: any, args: string[] = [], callThis: any = null): Promise<any> {\n if (this.listeners.has(event)) {\n for (const cb of this.listeners.get(event)!) {\n value = await cb.call(callThis, value, ...args);\n }\n }\n\n return value;\n }\n}\n"]}