@zanobijs/core 1.0.0-beta.2 → 1.0.0-beta.4

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 (57) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/README.md +199 -5
  3. package/exceptions/constant.message.d.ts +1 -0
  4. package/exceptions/constant.message.js +8 -1
  5. package/exceptions/resolution.exception.d.ts +13 -0
  6. package/exceptions/resolution.exception.js +25 -0
  7. package/factory.d.ts +5 -1
  8. package/factory.js +22 -2
  9. package/index.d.ts +1 -0
  10. package/index.js +1 -0
  11. package/injector/injector.d.ts +6 -0
  12. package/injector/injector.js +25 -0
  13. package/injector/module.d.ts +1 -0
  14. package/injector/module.js +21 -3
  15. package/interfaces/factory.interface.d.ts +4 -0
  16. package/interfaces/factory.interface.js +2 -0
  17. package/interfaces/index.d.ts +1 -0
  18. package/{__test__/mocks → interfaces}/index.js +1 -1
  19. package/package.json +3 -4
  20. package/tsconfig.build.json +1 -1
  21. package/__test__/factory.spec.d.ts +0 -1
  22. package/__test__/factory.spec.js +0 -33
  23. package/__test__/factory.spec.ts +0 -37
  24. package/__test__/injector/injector.spec.d.ts +0 -1
  25. package/__test__/injector/injector.spec.js +0 -32
  26. package/__test__/injector/injector.spec.ts +0 -32
  27. package/__test__/injector/module.spec.d.ts +0 -1
  28. package/__test__/injector/module.spec.js +0 -60
  29. package/__test__/injector/module.spec.ts +0 -66
  30. package/__test__/metadata.spec.d.ts +0 -1
  31. package/__test__/metadata.spec.js +0 -70
  32. package/__test__/metadata.spec.ts +0 -71
  33. package/__test__/mocks/classModule.mock.d.ts +0 -10
  34. package/__test__/mocks/classModule.mock.js +0 -74
  35. package/__test__/mocks/classModule.mock.ts +0 -55
  36. package/__test__/mocks/classWithDependeciesClass.mock.d.ts +0 -13
  37. package/__test__/mocks/classWithDependeciesClass.mock.js +0 -40
  38. package/__test__/mocks/classWithDependeciesClass.mock.ts +0 -21
  39. package/__test__/mocks/classWithDependeciesInject.mock.d.ts +0 -24
  40. package/__test__/mocks/classWithDependeciesInject.mock.js +0 -74
  41. package/__test__/mocks/classWithDependeciesInject.mock.ts +0 -47
  42. package/__test__/mocks/index.d.ts +0 -1
  43. package/__test__/mocks/index.ts +0 -1
  44. package/exceptions/constant.message.ts +0 -1
  45. package/exceptions/index.ts +0 -2
  46. package/exceptions/invalid.module.exception.ts +0 -16
  47. package/factory.ts +0 -69
  48. package/index.ts +0 -2
  49. package/injector/index.ts +0 -2
  50. package/injector/injector.ts +0 -89
  51. package/injector/module.ts +0 -149
  52. package/interface/index.d.ts +0 -0
  53. package/interface/index.js +0 -1
  54. package/interface/index.ts +0 -1
  55. package/metadata.ts +0 -178
  56. package/tsconfig.build.tsbuildinfo +0 -1
  57. package/tsconfig.json +0 -11
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const chai_1 = require("chai");
4
- const injector_1 = require("../../injector");
5
- const classModule_mock_1 = require("../mocks/classModule.mock");
6
- const classWithDependeciesInject_mock_1 = require("../mocks/classWithDependeciesInject.mock");
7
- const classWithDependeciesClass_mock_1 = require("../mocks/classWithDependeciesClass.mock");
8
- describe("Core - Injector - injector", () => {
9
- const injector = new injector_1.Injector(classModule_mock_1.ModuleTestWithInjector);
10
- beforeEach(() => {
11
- process.env.ZANOBI_DEBUG = "false";
12
- });
13
- it("Should respond an object with paramters to inject", () => {
14
- const getInjectData = injector.getInjectData(classWithDependeciesClass_mock_1.ControllerWithDepenClass);
15
- (0, chai_1.expect)(getInjectData).to.is.empty;
16
- });
17
- it("Should respond an object without paramters to inject", () => {
18
- const getInjectData = injector.getInjectData(classWithDependeciesInject_mock_1.ControllerWithDepen2);
19
- (0, chai_1.expect)(getInjectData).to.have.property("apiKey");
20
- });
21
- it("Should respond an object type asClass with paramters to inject", () => {
22
- const getInject = injector.getInjector(classWithDependeciesInject_mock_1.ControllerWithDepen2);
23
- (0, chai_1.expect)(getInject).to.have.property("lifetime");
24
- (0, chai_1.expect)(getInject).to.have.property("inject");
25
- (0, chai_1.expect)(getInject).to.have.property("injector");
26
- });
27
- it("Should respond an object type asClass without injector", () => {
28
- const getInject = injector.getInjector(classWithDependeciesClass_mock_1.ControllerWithDepenClass);
29
- (0, chai_1.expect)(getInject).to.not.have.property("injector");
30
- });
31
- // it("", () => {});
32
- });
@@ -1,32 +0,0 @@
1
- import { expect } from "chai";
2
- import { Injector } from "../../injector";
3
- import { ModuleTestWithInjector } from "../mocks/classModule.mock";
4
- import { ControllerWithDepen2 } from "../mocks/classWithDependeciesInject.mock";
5
- import { ControllerWithDepenClass } from "../mocks/classWithDependeciesClass.mock";
6
-
7
- describe("Core - Injector - injector", () => {
8
- const injector = new Injector(ModuleTestWithInjector);
9
- beforeEach(() => {
10
- process.env.ZANOBI_DEBUG = "false";
11
- });
12
-
13
- it("Should respond an object with paramters to inject", () => {
14
- const getInjectData = injector.getInjectData(ControllerWithDepenClass);
15
- expect(getInjectData).to.is.empty;
16
- });
17
- it("Should respond an object without paramters to inject", () => {
18
- const getInjectData = injector.getInjectData(ControllerWithDepen2);
19
- expect(getInjectData).to.have.property("apiKey");
20
- });
21
- it("Should respond an object type asClass with paramters to inject", () => {
22
- const getInject = injector.getInjector(ControllerWithDepen2);
23
- expect(getInject).to.have.property("lifetime");
24
- expect(getInject).to.have.property("inject");
25
- expect(getInject).to.have.property("injector");
26
- });
27
- it("Should respond an object type asClass without injector", () => {
28
- const getInject = injector.getInjector(ControllerWithDepenClass);
29
- expect(getInject).to.not.have.property("injector");
30
- });
31
- // it("", () => {});
32
- });
@@ -1 +0,0 @@
1
- import "reflect-metadata";
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("reflect-metadata");
4
- const chai_1 = require("chai");
5
- const injector_1 = require("../../injector");
6
- const classModule_mock_1 = require("../mocks/classModule.mock");
7
- describe("Core - Injector - module", () => {
8
- let moduleInstance;
9
- beforeEach(() => {
10
- moduleInstance = new injector_1.Module();
11
- });
12
- describe("setup", () => {
13
- it("should respond that setup no is a module", () => {
14
- try {
15
- const mockModule = {};
16
- moduleInstance.setup(mockModule);
17
- }
18
- catch (error) {
19
- (0, chai_1.expect)(error.message).to.equal("The class must have an annotation @Module()");
20
- }
21
- });
22
- it("should respond no problem with the setup.", () => {
23
- moduleInstance.setup(classModule_mock_1.ModuleTestWithInjector);
24
- (0, chai_1.expect)(moduleInstance.getRegisterClass()).to.is.empty;
25
- });
26
- });
27
- describe("Module initialize", () => {
28
- it("should respond that call getMetadataModule and register on Module", () => {
29
- let metadataCalled = false;
30
- let registerDependencies = false;
31
- let registerDependenciesToAlias = false;
32
- moduleInstance["getMetadataModule"] = () => {
33
- metadataCalled = true;
34
- };
35
- moduleInstance["registerDependencies"] = () => {
36
- registerDependencies = true;
37
- };
38
- moduleInstance["registerDependenciesToAlias"] = () => {
39
- registerDependenciesToAlias = true;
40
- };
41
- moduleInstance.initialize();
42
- (0, chai_1.expect)(metadataCalled).to.be.true;
43
- (0, chai_1.expect)(registerDependencies).to.be.true;
44
- (0, chai_1.expect)(registerDependenciesToAlias).to.be.true;
45
- });
46
- });
47
- describe("Module get information", () => {
48
- it("Should respond apiKey and sContro2 in registered providers", () => {
49
- moduleInstance.setup(classModule_mock_1.ModuleTestWithInjector);
50
- moduleInstance.initialize();
51
- (0, chai_1.expect)(moduleInstance.getRegisterClass()).to.have.property("sContro2");
52
- (0, chai_1.expect)(moduleInstance.getRegisterClass()).to.have.property("apiKey");
53
- });
54
- it("Should respond imports of module", () => {
55
- moduleInstance.setup(classModule_mock_1.ModuleTestWithImports);
56
- moduleInstance.initialize();
57
- (0, chai_1.expect)(moduleInstance.getImports()).to.not.empty;
58
- });
59
- });
60
- });
@@ -1,66 +0,0 @@
1
- import "reflect-metadata";
2
- import { expect } from "chai";
3
- import { Module } from "../../injector";
4
- import { ModuleTestWithImports, ModuleTestWithInjector } from "../mocks/classModule.mock";
5
-
6
- describe("Core - Injector - module", () => {
7
- let moduleInstance: Module;
8
-
9
- beforeEach(() => {
10
- moduleInstance = new Module();
11
- });
12
-
13
- describe("setup", () => {
14
- it("should respond that setup no is a module", () => {
15
- try {
16
- const mockModule = {};
17
- moduleInstance.setup(mockModule);
18
- } catch (error) {
19
- expect(error.message).to.equal(
20
- "The class must have an annotation @Module()",
21
- );
22
- }
23
- });
24
- it("should respond no problem with the setup.", () => {
25
- moduleInstance.setup(ModuleTestWithInjector);
26
- expect(moduleInstance.getRegisterClass()).to.is.empty;
27
- });
28
- });
29
-
30
- describe("Module initialize", () => {
31
- it("should respond that call getMetadataModule and register on Module", () => {
32
- let metadataCalled = false;
33
- let registerDependencies = false;
34
- let registerDependenciesToAlias = false;
35
-
36
- moduleInstance["getMetadataModule"] = () => {
37
- metadataCalled = true;
38
- };
39
- moduleInstance["registerDependencies"] = () => {
40
- registerDependencies = true;
41
- };
42
- moduleInstance["registerDependenciesToAlias"] = () => {
43
- registerDependenciesToAlias = true;
44
- };
45
-
46
- moduleInstance.initialize();
47
-
48
- expect(metadataCalled).to.be.true;
49
- expect(registerDependencies).to.be.true;
50
- expect(registerDependenciesToAlias).to.be.true;
51
- });
52
- });
53
- describe("Module get information", () => {
54
- it("Should respond apiKey and sContro2 in registered providers", () => {
55
- moduleInstance.setup(ModuleTestWithInjector);
56
- moduleInstance.initialize();
57
- expect(moduleInstance.getRegisterClass()).to.have.property("sContro2");
58
- expect(moduleInstance.getRegisterClass()).to.have.property("apiKey");
59
- });
60
- it("Should respond imports of module", () => {
61
- moduleInstance.setup(ModuleTestWithImports);
62
- moduleInstance.initialize();
63
- expect(moduleInstance.getImports()).to.not.empty
64
- });
65
- });
66
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const chai_1 = require("chai");
4
- const metadata_1 = require("../metadata");
5
- const classModule_mock_1 = require("./mocks/classModule.mock");
6
- const classWithDependeciesInject_mock_1 = require("./mocks/classWithDependeciesInject.mock");
7
- const classWithDependeciesClass_mock_1 = require("./mocks/classWithDependeciesClass.mock");
8
- describe("Core - metadata", () => {
9
- class genericClassForTesting {
10
- }
11
- const metadata = metadata_1.Metadata.getInstance();
12
- describe("Is Type", () => {
13
- it("should respond false to is module", () => {
14
- (0, chai_1.expect)(metadata.isTypeModule(genericClassForTesting)).to.be.false;
15
- });
16
- it("should respond false to is imports", () => {
17
- (0, chai_1.expect)(metadata.isTypeImport(genericClassForTesting)).to.be.false;
18
- });
19
- it("should respond false to is controllers", () => {
20
- (0, chai_1.expect)(metadata.isTypeController(genericClassForTesting)).to.be.false;
21
- });
22
- it("should respond false to is services", () => {
23
- (0, chai_1.expect)(metadata.isTypeService(genericClassForTesting)).to.be.false;
24
- });
25
- it("should respond false to is exports", () => {
26
- (0, chai_1.expect)(metadata.isTypeExports(genericClassForTesting)).to.be.false;
27
- });
28
- it("should respond true to is module", () => {
29
- (0, chai_1.expect)(metadata.isTypeModule(classModule_mock_1.ModuleTestEmpty)).to.be.true;
30
- });
31
- it("should respond determine type of service", () => {
32
- (0, chai_1.expect)(metadata.determineType(classWithDependeciesInject_mock_1.ServiceWithDepenParam)).to.be.equal("service");
33
- });
34
- it("should respond determine type of unknown", () => {
35
- class ServiceTest {
36
- }
37
- try {
38
- metadata.determineType(ServiceTest);
39
- }
40
- catch (error) {
41
- (0, chai_1.expect)(error.message).to.be.equal("ServiceTest type is unknown");
42
- }
43
- });
44
- });
45
- describe("Get Metadata", () => {
46
- it("Should respond the metadata of the decorator module", () => {
47
- const metadata2 = metadata_1.Metadata.getInstance();
48
- const resultMetadata = metadata2.getMetadataModule(classModule_mock_1.ModuleTest);
49
- (0, chai_1.expect)(resultMetadata).to.have.property("imports");
50
- (0, chai_1.expect)(resultMetadata).to.have.property("controllers");
51
- (0, chai_1.expect)(resultMetadata).to.have.property("services");
52
- (0, chai_1.expect)(resultMetadata).to.have.property("exports");
53
- });
54
- it("should respond the dependency metadata of a controller", () => {
55
- const resultMetadata = metadata.getAllDependencies(classWithDependeciesClass_mock_1.ControllerWithDepenClass);
56
- (0, chai_1.expect)(resultMetadata).to.have.property("dClass");
57
- (0, chai_1.expect)(resultMetadata).to.have.property("dParam");
58
- (0, chai_1.expect)(resultMetadata).to.have.property("dInject");
59
- (0, chai_1.expect)(resultMetadata.dInject).to.be.empty;
60
- });
61
- it("should respond the dependency metadata of a service", () => {
62
- const resultMetadata = metadata.getAllDependencies(classWithDependeciesInject_mock_1.ServiceWithDepenParam);
63
- (0, chai_1.expect)(resultMetadata).to.have.property("dClass");
64
- (0, chai_1.expect)(resultMetadata).to.have.property("dParam");
65
- (0, chai_1.expect)(resultMetadata).to.have.property("dInject");
66
- (0, chai_1.expect)(resultMetadata.dInject).to.not.be.empty;
67
- });
68
- });
69
- describe("", () => { });
70
- });
@@ -1,71 +0,0 @@
1
- import { expect } from "chai";
2
- import { Metadata } from "../metadata";
3
- import { ModuleTestEmpty, ModuleTest } from "./mocks/classModule.mock";
4
- import { ServiceWithDepenParam } from "./mocks/classWithDependeciesInject.mock";
5
- import { ControllerWithDepenClass } from "./mocks/classWithDependeciesClass.mock";
6
-
7
- describe("Core - metadata", () => {
8
- class genericClassForTesting {}
9
- const metadata = Metadata.getInstance();
10
-
11
- describe("Is Type", () => {
12
- it("should respond false to is module", () => {
13
- expect(metadata.isTypeModule(genericClassForTesting)).to.be.false;
14
- });
15
- it("should respond false to is imports", () => {
16
- expect(metadata.isTypeImport(genericClassForTesting)).to.be.false;
17
- });
18
- it("should respond false to is controllers", () => {
19
- expect(metadata.isTypeController(genericClassForTesting)).to.be.false;
20
- });
21
- it("should respond false to is services", () => {
22
- expect(metadata.isTypeService(genericClassForTesting)).to.be.false;
23
- });
24
- it("should respond false to is exports", () => {
25
- expect(metadata.isTypeExports(genericClassForTesting)).to.be.false;
26
- });
27
- it("should respond true to is module", () => {
28
- expect(metadata.isTypeModule(ModuleTestEmpty)).to.be.true;
29
- });
30
- it("should respond determine type of service", () => {
31
- expect(metadata.determineType(ServiceWithDepenParam)).to.be.equal(
32
- "service",
33
- );
34
- });
35
- it("should respond determine type of unknown", () => {
36
- class ServiceTest {}
37
- try {
38
- metadata.determineType(ServiceTest);
39
- } catch (error) {
40
- expect(error.message).to.be.equal("ServiceTest type is unknown");
41
- }
42
- });
43
- });
44
- describe("Get Metadata", () => {
45
- it("Should respond the metadata of the decorator module", () => {
46
- const metadata2 = Metadata.getInstance();
47
- const resultMetadata = metadata2.getMetadataModule(ModuleTest);
48
- expect(resultMetadata).to.have.property("imports");
49
- expect(resultMetadata).to.have.property("controllers");
50
- expect(resultMetadata).to.have.property("services");
51
- expect(resultMetadata).to.have.property("exports");
52
- });
53
- it("should respond the dependency metadata of a controller", () => {
54
- const resultMetadata = metadata.getAllDependencies(
55
- ControllerWithDepenClass,
56
- );
57
- expect(resultMetadata).to.have.property("dClass");
58
- expect(resultMetadata).to.have.property("dParam");
59
- expect(resultMetadata).to.have.property("dInject");
60
- expect(resultMetadata.dInject).to.be.empty;
61
- });
62
- it("should respond the dependency metadata of a service", () => {
63
- const resultMetadata = metadata.getAllDependencies(ServiceWithDepenParam);
64
- expect(resultMetadata).to.have.property("dClass");
65
- expect(resultMetadata).to.have.property("dParam");
66
- expect(resultMetadata).to.have.property("dInject");
67
- expect(resultMetadata.dInject).to.not.be.empty;
68
- });
69
- });
70
- describe("", () => {});
71
- });
@@ -1,10 +0,0 @@
1
- export declare class ModuleTestEmpty {
2
- }
3
- export declare class ModuleTest {
4
- }
5
- export declare class ModuleTestWithInjector {
6
- }
7
- export declare class ModuleTestWithImports {
8
- }
9
- export declare class ModuleTestAll {
10
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ModuleTestAll = exports.ModuleTestWithImports = exports.ModuleTestWithInjector = exports.ModuleTest = exports.ModuleTestEmpty = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@zanobijs/common");
6
- const classWithDependeciesClass_mock_1 = require("./classWithDependeciesClass.mock");
7
- const classWithDependeciesInject_mock_1 = require("./classWithDependeciesInject.mock");
8
- let ModuleTestEmpty = class ModuleTestEmpty {
9
- };
10
- exports.ModuleTestEmpty = ModuleTestEmpty;
11
- exports.ModuleTestEmpty = ModuleTestEmpty = tslib_1.__decorate([
12
- (0, common_1.Module)({
13
- imports: [],
14
- controllers: [],
15
- services: [],
16
- exports: [],
17
- })
18
- ], ModuleTestEmpty);
19
- let ModuleTest = class ModuleTest {
20
- };
21
- exports.ModuleTest = ModuleTest;
22
- exports.ModuleTest = ModuleTest = tslib_1.__decorate([
23
- (0, common_1.Module)({
24
- imports: [],
25
- controllers: [classWithDependeciesClass_mock_1.ControllerWithDepenClass],
26
- services: [classWithDependeciesClass_mock_1.ServiceToController],
27
- exports: [],
28
- })
29
- ], ModuleTest);
30
- let ModuleTestWithInjector = class ModuleTestWithInjector {
31
- };
32
- exports.ModuleTestWithInjector = ModuleTestWithInjector;
33
- exports.ModuleTestWithInjector = ModuleTestWithInjector = tslib_1.__decorate([
34
- (0, common_1.Module)({
35
- imports: [],
36
- controllers: [classWithDependeciesInject_mock_1.ControllerWithDepen2],
37
- services: [
38
- classWithDependeciesInject_mock_1.ServiceToController2,
39
- {
40
- provider: "API_KEY",
41
- useValue: "isApiKey_qwerty12345"
42
- },
43
- ],
44
- exports: [],
45
- })
46
- ], ModuleTestWithInjector);
47
- let ModuleTestWithImports = class ModuleTestWithImports {
48
- };
49
- exports.ModuleTestWithImports = ModuleTestWithImports;
50
- exports.ModuleTestWithImports = ModuleTestWithImports = tslib_1.__decorate([
51
- (0, common_1.Module)({
52
- imports: [ModuleTestWithInjector],
53
- controllers: [],
54
- services: [],
55
- exports: [],
56
- })
57
- ], ModuleTestWithImports);
58
- let ModuleTestAll = class ModuleTestAll {
59
- };
60
- exports.ModuleTestAll = ModuleTestAll;
61
- exports.ModuleTestAll = ModuleTestAll = tslib_1.__decorate([
62
- (0, common_1.Module)({
63
- imports: [ModuleTestWithInjector],
64
- controllers: [classWithDependeciesInject_mock_1.ControllerWithDepen2],
65
- services: [
66
- classWithDependeciesInject_mock_1.ServiceToController2,
67
- {
68
- provider: "API_SECRET",
69
- useValue: "isApiSecret_cvbdfgert"
70
- },
71
- ],
72
- exports: [],
73
- })
74
- ], ModuleTestAll);
@@ -1,55 +0,0 @@
1
- import { Module } from "@zanobijs/common";
2
- import { ControllerWithDepenClass, ServiceToController } from "./classWithDependeciesClass.mock";
3
- import { ControllerWithDepen2, ServiceToController2 } from "./classWithDependeciesInject.mock";
4
-
5
- @Module({
6
- imports: [],
7
- controllers: [],
8
- services: [],
9
- exports: [],
10
- })
11
- export class ModuleTestEmpty {}
12
-
13
- @Module({
14
- imports: [],
15
- controllers: [ControllerWithDepenClass],
16
- services: [ServiceToController],
17
- exports: [],
18
- })
19
- export class ModuleTest {}
20
-
21
- @Module({
22
- imports: [],
23
- controllers: [ControllerWithDepen2],
24
- services: [
25
- ServiceToController2,
26
- {
27
- provider: "API_KEY",
28
- useValue: "isApiKey_qwerty12345"
29
- },
30
- ],
31
- exports: [],
32
- })
33
- export class ModuleTestWithInjector {}
34
-
35
- @Module({
36
- imports: [ModuleTestWithInjector],
37
- controllers: [],
38
- services: [],
39
- exports: [],
40
- })
41
- export class ModuleTestWithImports {}
42
-
43
- @Module({
44
- imports: [ModuleTestWithInjector],
45
- controllers: [ControllerWithDepen2],
46
- services: [
47
- ServiceToController2,
48
- {
49
- provider: "API_SECRET",
50
- useValue: "isApiSecret_cvbdfgert"
51
- },
52
- ],
53
- exports: [],
54
- })
55
- export class ModuleTestAll {}
@@ -1,13 +0,0 @@
1
- export declare class ServiceToService {
2
- constructor();
3
- }
4
- export declare class Service {
5
- constructor();
6
- }
7
- export declare class ServiceToController {
8
- constructor();
9
- }
10
- export declare class ControllerWithDepenClass {
11
- private servicio;
12
- constructor(servicio: ServiceToController);
13
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ControllerWithDepenClass = exports.ServiceToController = exports.Service = exports.ServiceToService = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@zanobijs/common");
6
- let ServiceToService = class ServiceToService {
7
- constructor() { }
8
- };
9
- exports.ServiceToService = ServiceToService;
10
- exports.ServiceToService = ServiceToService = tslib_1.__decorate([
11
- (0, common_1.Injectable)(),
12
- tslib_1.__metadata("design:paramtypes", [])
13
- ], ServiceToService);
14
- let Service = class Service {
15
- constructor() { }
16
- };
17
- exports.Service = Service;
18
- exports.Service = Service = tslib_1.__decorate([
19
- (0, common_1.Injectable)(),
20
- tslib_1.__metadata("design:paramtypes", [])
21
- ], Service);
22
- let ServiceToController = class ServiceToController {
23
- constructor() { }
24
- };
25
- exports.ServiceToController = ServiceToController;
26
- exports.ServiceToController = ServiceToController = tslib_1.__decorate([
27
- (0, common_1.Injectable)(),
28
- tslib_1.__metadata("design:paramtypes", [])
29
- ], ServiceToController);
30
- let ControllerWithDepenClass = class ControllerWithDepenClass {
31
- servicio;
32
- constructor(servicio) {
33
- this.servicio = servicio;
34
- }
35
- };
36
- exports.ControllerWithDepenClass = ControllerWithDepenClass;
37
- exports.ControllerWithDepenClass = ControllerWithDepenClass = tslib_1.__decorate([
38
- (0, common_1.Controller)(),
39
- tslib_1.__metadata("design:paramtypes", [ServiceToController])
40
- ], ControllerWithDepenClass);
@@ -1,21 +0,0 @@
1
- import { Controller, Injectable } from "@zanobijs/common";
2
-
3
- @Injectable()
4
- export class ServiceToService {
5
- constructor() {}
6
- }
7
-
8
- @Injectable()
9
- export class Service {
10
- constructor() {}
11
- }
12
-
13
- @Injectable()
14
- export class ServiceToController {
15
- constructor() {}
16
- }
17
-
18
- @Controller()
19
- export class ControllerWithDepenClass {
20
- constructor(private servicio: ServiceToController) {}
21
- }
@@ -1,24 +0,0 @@
1
- export declare class ServiceToController2 {
2
- constructor();
3
- getHello(): string;
4
- }
5
- export declare class ServiceWithDepenParam {
6
- private servicio;
7
- private userName;
8
- private userAge;
9
- private userLogin;
10
- private userHobbis;
11
- constructor(servicio: ServiceToController2, userName: string, userAge: number, userLogin: boolean, userHobbis: string[]);
12
- }
13
- export declare class ControllerWithDepen2 {
14
- private sContro2;
15
- private apiKey;
16
- constructor(sContro2: ServiceToController2, apiKey: string);
17
- getApiKey(): string;
18
- getHelloService(): string;
19
- }
20
- export declare class ServiceWithDepen2 {
21
- private serviceWithDepenParam;
22
- private api_key;
23
- constructor(serviceWithDepenParam: ServiceWithDepenParam, api_key: string);
24
- }
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServiceWithDepen2 = exports.ControllerWithDepen2 = exports.ServiceWithDepenParam = exports.ServiceToController2 = void 0;
4
- const tslib_1 = require("tslib");
5
- const common_1 = require("@zanobijs/common");
6
- let ServiceToController2 = class ServiceToController2 {
7
- constructor() { }
8
- getHello() {
9
- return "Hello ServiceToController2";
10
- }
11
- };
12
- exports.ServiceToController2 = ServiceToController2;
13
- exports.ServiceToController2 = ServiceToController2 = tslib_1.__decorate([
14
- (0, common_1.Injectable)(),
15
- tslib_1.__metadata("design:paramtypes", [])
16
- ], ServiceToController2);
17
- let ServiceWithDepenParam = class ServiceWithDepenParam {
18
- servicio;
19
- userName;
20
- userAge;
21
- userLogin;
22
- userHobbis;
23
- constructor(servicio, userName, userAge, userLogin, userHobbis) {
24
- this.servicio = servicio;
25
- this.userName = userName;
26
- this.userAge = userAge;
27
- this.userLogin = userLogin;
28
- this.userHobbis = userHobbis;
29
- }
30
- };
31
- exports.ServiceWithDepenParam = ServiceWithDepenParam;
32
- exports.ServiceWithDepenParam = ServiceWithDepenParam = tslib_1.__decorate([
33
- (0, common_1.Injectable)(),
34
- tslib_1.__param(1, (0, common_1.Inject)("USER_NAME")),
35
- tslib_1.__param(2, (0, common_1.Inject)("USER_AGE")),
36
- tslib_1.__param(3, (0, common_1.Inject)("USER_LOGIN")),
37
- tslib_1.__param(4, (0, common_1.Inject)("USER_LIKE")),
38
- tslib_1.__metadata("design:paramtypes", [ServiceToController2, String, Number, Boolean, Array])
39
- ], ServiceWithDepenParam);
40
- let ControllerWithDepen2 = class ControllerWithDepen2 {
41
- sContro2;
42
- apiKey;
43
- constructor(sContro2, apiKey) {
44
- this.sContro2 = sContro2;
45
- this.apiKey = apiKey;
46
- this.apiKey = apiKey;
47
- }
48
- getApiKey() {
49
- return this.apiKey;
50
- }
51
- getHelloService() {
52
- return this.sContro2.getHello();
53
- }
54
- };
55
- exports.ControllerWithDepen2 = ControllerWithDepen2;
56
- exports.ControllerWithDepen2 = ControllerWithDepen2 = tslib_1.__decorate([
57
- (0, common_1.Controller)(),
58
- tslib_1.__param(1, (0, common_1.Inject)("API_KEY")),
59
- tslib_1.__metadata("design:paramtypes", [ServiceToController2, String])
60
- ], ControllerWithDepen2);
61
- let ServiceWithDepen2 = class ServiceWithDepen2 {
62
- serviceWithDepenParam;
63
- api_key;
64
- constructor(serviceWithDepenParam, api_key) {
65
- this.serviceWithDepenParam = serviceWithDepenParam;
66
- this.api_key = api_key;
67
- }
68
- };
69
- exports.ServiceWithDepen2 = ServiceWithDepen2;
70
- exports.ServiceWithDepen2 = ServiceWithDepen2 = tslib_1.__decorate([
71
- (0, common_1.Injectable)(),
72
- tslib_1.__param(1, (0, common_1.Inject)("API_KEY")),
73
- tslib_1.__metadata("design:paramtypes", [ServiceWithDepenParam, String])
74
- ], ServiceWithDepen2);