moost 0.2.4 → 0.2.6

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.cjs CHANGED
@@ -208,30 +208,6 @@ function getMoostMate() {
208
208
  return moostMate;
209
209
  }
210
210
 
211
- function getInstanceOwnMethods(instance) {
212
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
213
- const proto = Object.getPrototypeOf(instance);
214
- return [
215
- ...Object.getOwnPropertyNames(proto),
216
- ...Object.getOwnPropertyNames(instance),
217
- ].filter(m => typeof instance[m] === 'function');
218
- }
219
-
220
- const banner = () => `[${"moost"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
221
-
222
- /* istanbul ignore file */
223
- function log(text) {
224
- console.log('' + '' + banner() + text + '');
225
- }
226
- function logError(error) {
227
- console.error('' + '' + banner() + error + '');
228
- }
229
-
230
- function panic(error) {
231
- logError(error);
232
- return new Error(error);
233
- }
234
-
235
211
  function runPipes(pipes, meta, restoreCtx) {
236
212
  return __awaiter(this, void 0, void 0, function* () {
237
213
  let v = undefined;
@@ -297,6 +273,30 @@ function getNewMoostInfact() {
297
273
  });
298
274
  }
299
275
 
276
+ function getInstanceOwnMethods(instance) {
277
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
278
+ const proto = Object.getPrototypeOf(instance);
279
+ return [
280
+ ...Object.getOwnPropertyNames(proto),
281
+ ...Object.getOwnPropertyNames(instance),
282
+ ].filter(m => typeof instance[m] === 'function');
283
+ }
284
+
285
+ const banner = () => `[${"moost"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
286
+
287
+ /* istanbul ignore file */
288
+ function log(text) {
289
+ console.log('' + '' + banner() + text + '');
290
+ }
291
+ function logError(error) {
292
+ console.error('' + '' + banner() + error + '');
293
+ }
294
+
295
+ function panic(error) {
296
+ logError(error);
297
+ return new Error(error);
298
+ }
299
+
300
300
  function getCallableFn(targetInstance, fn, restoreCtx) {
301
301
  return __awaiter(this, void 0, void 0, function* () {
302
302
  const mate$1 = getMoostMate();
@@ -916,7 +916,9 @@ exports.Required = Required;
916
916
  exports.Resolve = Resolve;
917
917
  exports.Validate = Validate;
918
918
  exports.genericTypesCastPipe = genericTypesCastPipe;
919
+ exports.getMoostInfact = getMoostInfact;
919
920
  exports.getMoostMate = getMoostMate;
921
+ exports.getNewMoostInfact = getNewMoostInfact;
920
922
  exports.resolvePipe = resolvePipe;
921
923
  exports.useControllerMeta = useControllerMeta;
922
924
  exports.validatePipe = validatePipe;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,7 @@
1
+ import { Infact } from '@prostojs/infact';
1
2
  import { Mate } from '@prostojs/mate';
3
+ import { TInfactClassMeta } from '@prostojs/infact';
4
+ import { TInfactConstructorParamMeta } from '@prostojs/infact';
2
5
  import { TProstoMetadata } from '@prostojs/mate';
3
6
  import { TProstoParamsMetadata } from '@prostojs/mate';
4
7
  import { TProvideFn } from '@prostojs/infact';
@@ -31,8 +34,12 @@ export declare function Dto(dtoOptions?: TValidoDtoOptions): ClassDecorator;
31
34
 
32
35
  export declare const genericTypesCastPipe: (strict?: boolean) => TPipeFn;
33
36
 
37
+ export declare function getMoostInfact(): Infact<TInfactMoostMeta>;
38
+
34
39
  export declare function getMoostMate(): Mate<TMoostMetadata>;
35
40
 
41
+ export declare function getNewMoostInfact(): Infact<TInfactMoostMeta>;
42
+
36
43
  export declare function Id(value: string): MethodDecorator & ClassDecorator & ParameterDecorator & PropertyDecorator;
37
44
 
38
45
  /**
@@ -184,6 +191,8 @@ declare interface TCommonMoostMeta {
184
191
 
185
192
  declare type TFunction = Function;
186
193
 
194
+ declare type TInfactMoostMeta = TInfactClassMeta<TMoostParamsMetadata & TInfactConstructorParamMeta>;
195
+
187
196
  export declare type TInjectableScope = 'FOR_EVENT' | 'SINGLETON';
188
197
 
189
198
  export declare type TInterceptorAfter = (response: TAny, reply: (response: TAny) => void) => void | Promise<void>;
package/dist/index.mjs CHANGED
@@ -206,30 +206,6 @@ function getMoostMate() {
206
206
  return moostMate;
207
207
  }
208
208
 
209
- function getInstanceOwnMethods(instance) {
210
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
211
- const proto = Object.getPrototypeOf(instance);
212
- return [
213
- ...Object.getOwnPropertyNames(proto),
214
- ...Object.getOwnPropertyNames(instance),
215
- ].filter(m => typeof instance[m] === 'function');
216
- }
217
-
218
- const banner = () => `[${"moost"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
219
-
220
- /* istanbul ignore file */
221
- function log(text) {
222
- console.log('' + '' + banner() + text + '');
223
- }
224
- function logError(error) {
225
- console.error('' + '' + banner() + error + '');
226
- }
227
-
228
- function panic(error) {
229
- logError(error);
230
- return new Error(error);
231
- }
232
-
233
209
  function runPipes(pipes, meta, restoreCtx) {
234
210
  return __awaiter(this, void 0, void 0, function* () {
235
211
  let v = undefined;
@@ -295,6 +271,30 @@ function getNewMoostInfact() {
295
271
  });
296
272
  }
297
273
 
274
+ function getInstanceOwnMethods(instance) {
275
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
276
+ const proto = Object.getPrototypeOf(instance);
277
+ return [
278
+ ...Object.getOwnPropertyNames(proto),
279
+ ...Object.getOwnPropertyNames(instance),
280
+ ].filter(m => typeof instance[m] === 'function');
281
+ }
282
+
283
+ const banner = () => `[${"moost"}][${new Date().toISOString().replace('T', ' ').replace(/\.\d{3}z$/i, '')}] `;
284
+
285
+ /* istanbul ignore file */
286
+ function log(text) {
287
+ console.log('' + '' + banner() + text + '');
288
+ }
289
+ function logError(error) {
290
+ console.error('' + '' + banner() + error + '');
291
+ }
292
+
293
+ function panic(error) {
294
+ logError(error);
295
+ return new Error(error);
296
+ }
297
+
298
298
  function getCallableFn(targetInstance, fn, restoreCtx) {
299
299
  return __awaiter(this, void 0, void 0, function* () {
300
300
  const mate = getMoostMate();
@@ -889,4 +889,4 @@ const validatePipe = (opts) => {
889
889
  return pipe;
890
890
  };
891
891
 
892
- export { Circular, Const, Controller, Dto, Id, ImportController, Inject, Injectable, Intercept, InterceptorHandler, IsArray, IsBoolean, IsNumber, IsString, IsTypeOf, Label, Moost, Optional, Param, Params, Provide, Required, Resolve, TInterceptorPriority, TPipePriority, Validate, genericTypesCastPipe, getMoostMate, resolvePipe, useControllerMeta, validatePipe };
892
+ export { Circular, Const, Controller, Dto, Id, ImportController, Inject, Injectable, Intercept, InterceptorHandler, IsArray, IsBoolean, IsNumber, IsString, IsTypeOf, Label, Moost, Optional, Param, Params, Provide, Required, Resolve, TInterceptorPriority, TPipePriority, Validate, genericTypesCastPipe, getMoostInfact, getMoostMate, getNewMoostInfact, resolvePipe, useControllerMeta, validatePipe };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moost",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "moost",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",