@zenflux/core 0.1.0 → 0.1.2

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 (62) hide show
  1. package/dist/src/bases/controller-base.d.ts +54 -0
  2. package/dist/src/bases/index.d.ts +2 -0
  3. package/dist/src/bases/object-base.d.ts +31 -0
  4. package/dist/src/clients/http.d.ts +40 -0
  5. package/dist/src/command-bases/command-base.d.ts +29 -0
  6. package/dist/src/command-bases/command-internal.d.ts +8 -0
  7. package/dist/src/command-bases/command-public.d.ts +8 -0
  8. package/dist/src/command-bases/command-restful.d.ts +21 -0
  9. package/dist/src/command-bases/index.d.ts +7 -0
  10. package/dist/src/errors/command-already-registered.d.ts +10 -0
  11. package/dist/src/errors/command-not-found.d.ts +9 -0
  12. package/dist/src/errors/controller-already-registered.d.ts +10 -0
  13. package/dist/src/errors/controller-already-set.d.ts +10 -0
  14. package/dist/src/errors/force-method-implementation.d.ts +13 -0
  15. package/dist/src/errors/index-public.d.ts +1 -0
  16. package/dist/src/errors/index.d.ts +5 -0
  17. package/dist/src/exports-index.d.ts +6 -0
  18. package/dist/src/exports.d.ts +29 -0
  19. package/dist/src/index.d.ts +9 -0
  20. package/dist/src/interfaces/commands.d.ts +13 -0
  21. package/dist/src/interfaces/config.d.ts +20 -0
  22. package/dist/src/interfaces/index.d.ts +7 -0
  23. package/dist/src/interfaces/logger.d.ts +19 -0
  24. package/dist/src/interfaces/restful.d.ts +18 -0
  25. package/dist/src/managers/commands.d.ts +67 -0
  26. package/dist/src/managers/controllers.d.ts +12 -0
  27. package/dist/src/managers/export.d.ts +15 -0
  28. package/dist/src/managers/index.d.ts +7 -0
  29. package/dist/src/managers/internal.d.ts +8 -0
  30. package/dist/src/managers/restful.d.ts +25 -0
  31. package/dist/tsconfig.tsbuildinfo +1 -0
  32. package/dist/zenflux-core.cjs +154 -0
  33. package/dist/zenflux-core.d.ts +8 -0
  34. package/dist/zenflux-core.mjs +145 -0
  35. package/dist/zenflux.config.d.ts +3 -0
  36. package/package.json +12 -5
  37. package/src/bases/controller-base.ts +5 -5
  38. package/src/bases/index.ts +2 -2
  39. package/src/bases/object-base.ts +1 -1
  40. package/src/clients/http.ts +3 -3
  41. package/src/command-bases/command-base.ts +4 -4
  42. package/src/command-bases/command-internal.ts +1 -1
  43. package/src/command-bases/command-public.ts +1 -1
  44. package/src/command-bases/command-restful.ts +3 -3
  45. package/src/command-bases/index.ts +4 -4
  46. package/src/errors/command-already-registered.ts +1 -1
  47. package/src/errors/controller-already-registered.ts +1 -1
  48. package/src/errors/controller-already-set.ts +1 -1
  49. package/src/errors/force-method-implementation.ts +1 -1
  50. package/src/errors/index-public.ts +1 -1
  51. package/src/errors/index.ts +5 -5
  52. package/src/exports-index.ts +5 -5
  53. package/src/exports.ts +2 -2
  54. package/src/index.ts +2 -2
  55. package/src/interfaces/index.ts +4 -4
  56. package/src/interfaces/restful.ts +1 -1
  57. package/src/managers/commands.ts +7 -7
  58. package/src/managers/controllers.ts +3 -3
  59. package/src/managers/export.ts +5 -5
  60. package/src/managers/index.ts +4 -4
  61. package/src/managers/internal.ts +1 -1
  62. package/src/managers/restful.ts +5 -5
@@ -2,7 +2,7 @@ export type TErrorHandlerCallbackType = ( data: any ) => boolean;
2
2
 
3
3
  export type TResponseFilterCallbackType = ( text: string ) => string;
4
4
 
5
- export type TResponseHandlerCallbackType = ( text: string) => boolean;
5
+ export type TResponseHandlerCallbackType = ( text: string ) => boolean;
6
6
 
7
7
  export type TPossibleHandlersType = TErrorHandlerCallbackType | TResponseFilterCallbackType | TResponseHandlerCallbackType;
8
8
 
@@ -2,10 +2,10 @@
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  * @description Responsible for manging/running/hooking commands.
4
4
  */
5
- import { ObjectBase } from "@z-core/bases/object-base";
5
+ import { ObjectBase } from "@zenflux/core/src/bases/object-base";
6
6
 
7
- import { CommandNotFound } from "@z-core/errors/command-not-found";
8
- import { CommandAlreadyRegistered } from "@z-core/errors/command-already-registered";
7
+ import { CommandNotFound } from "@zenflux/core/src/errors/command-not-found";
8
+ import { CommandAlreadyRegistered } from "@zenflux/core/src/errors/command-already-registered";
9
9
 
10
10
  import type {
11
11
  TCommandCallbackType,
@@ -17,10 +17,10 @@ import type {
17
17
  ICommandOptionsInterface,
18
18
 
19
19
  ILogger,
20
- } from "@z-core/interfaces";
20
+ } from "@zenflux/core/src/interfaces";
21
21
 
22
- import type { ControllerBase } from "@z-core/bases/controller-base";
23
- import type { CommandBase } from "@z-core/command-bases/command-base";
22
+ import type { ControllerBase } from "@zenflux/core/src/bases/controller-base";
23
+ import type { CommandBase } from "@zenflux/core/src/command-bases/command-base";
24
24
 
25
25
  export class Commands extends ObjectBase {
26
26
  public static readonly trace:string[] = [];
@@ -91,7 +91,7 @@ export class Commands extends ObjectBase {
91
91
  return result;
92
92
  }
93
93
 
94
- public register( commands: { [ key: string ]: typeof CommandBase }, controller: ControllerBase ) {// eslint-disable-line @typescript-eslint/no-unused-vars
94
+ public register( commands: { [ key: string ]: typeof CommandBase }, controller: ControllerBase ) {
95
95
  const result: { [ key: string ]: typeof CommandBase } = {};
96
96
 
97
97
  Object.values( commands ).forEach( ( command ) => {
@@ -2,11 +2,11 @@
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  * @description Responsible for manging controllers, each controller is global singleton instance.
4
4
  */
5
- import { ControllerAlreadyRegistered } from "@z-core/errors/controller-already-registered";
5
+ import { ControllerAlreadyRegistered } from "@zenflux/core/src/errors/controller-already-registered";
6
6
 
7
- import { ObjectBase } from "@z-core/bases/object-base";
7
+ import { ObjectBase } from "@zenflux/core/src/bases/object-base";
8
8
 
9
- import type { ControllerBase } from "@z-core/bases/controller-base";
9
+ import type { ControllerBase } from "@zenflux/core/src/bases/controller-base";
10
10
 
11
11
  export class Controllers extends ObjectBase {
12
12
  private controllers: { [ key: string ]: ControllerBase } = {};
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  */
4
- import { Commands } from "@z-core/managers/commands";
5
- import { Controllers } from "@z-core/managers/controllers";
6
- import { Restful } from "@z-core/managers/restful";
7
- import { Internal } from "@z-core/managers/internal";
4
+ import { Commands } from "@zenflux/core/src/managers/commands";
5
+ import { Controllers } from "@zenflux/core/src/managers/controllers";
6
+ import { Restful } from "@zenflux/core/src/managers/restful";
7
+ import { Internal } from "@zenflux/core/src/managers/internal";
8
8
 
9
- import type { IAPIConfig } from "@z-core/interfaces";
9
+ import type { IAPIConfig } from "@zenflux/core/src/interfaces";
10
10
 
11
11
  export const afterInitializeCallbacks: ( () => void )[] = [];
12
12
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  */
4
- export { Commands } from "@z-core/managers/commands";
5
- export { Controllers } from "@z-core/managers/controllers";
6
- export { Restful } from "@z-core/managers/restful";
7
- export { Internal } from "@z-core/managers/internal";
4
+ export { Commands } from "@zenflux/core/src/managers/commands";
5
+ export { Controllers } from "@zenflux/core/src/managers/controllers";
6
+ export { Restful } from "@zenflux/core/src/managers/restful";
7
+ export { Internal } from "@zenflux/core/src/managers/internal";
@@ -2,7 +2,7 @@
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  * @description Responsible for manging internal commands, To serve commands that are not triggered by user.
4
4
  */
5
- import { Commands } from "@z-core/managers/commands";
5
+ import { Commands } from "@zenflux/core/src/managers/commands";
6
6
 
7
7
  export class Internal extends Commands {
8
8
  public static getName() {
@@ -2,16 +2,16 @@
2
2
  * @author Leonid Vinikov <leonidvinikov@gmail.com>
3
3
  * @description Responsible for manging restful commands which are wrappers for HTTP requests.
4
4
  */
5
- import { Commands } from "@z-core/managers/commands";
5
+ import { Commands } from "@zenflux/core/src/managers/commands";
6
6
 
7
- import { Http } from "@z-core/clients/http";
7
+ import { Http } from "@zenflux/core/src/clients/http";
8
8
 
9
9
  import {
10
10
  E_RESPONSE_HANDLER_TYPE,
11
11
  E_HTTP_METHOD_TYPE
12
- } from "@z-core/interfaces";
12
+ } from "@zenflux/core/src/interfaces";
13
13
 
14
- import type { CommandRestful } from "@z-core/command-bases";
14
+ import type { CommandRestful } from "@zenflux/core/src/command-bases";
15
15
 
16
16
  import type {
17
17
  IAPIConfig,
@@ -22,7 +22,7 @@ import type {
22
22
  TPossibleHandlersType,
23
23
  TResponseFilterCallbackType,
24
24
  TResponseHandlerCallbackType
25
- } from "@z-core/interfaces";
25
+ } from "@zenflux/core/src/interfaces";
26
26
 
27
27
  export class Restful extends Commands {
28
28
  private static client: Http;