How to use the @fullstack-one/di.Inject function in @fullstack-one/di

To help you get started, we’ve selected a few @fullstack-one/di examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github fullstack-build / fullstack-one / packages / queue / lib / index.ts View on Github external
constructor(
    @Inject((type) => BootLoader) bootLoader: BootLoader,
    @Inject((type) => GracefulShutdown) gracefulShutdown: GracefulShutdown,
    @Inject((type) => LoggerFactory) loggerFactory: LoggerFactory,
    @Inject((type) => ORM) private readonly orm: ORM,
    @Inject((type) => Config) config: Config
  ) {
    config.registerConfig("Queue", `${__dirname}/../config`);
    this.logger = loggerFactory.create(this.constructor.name);

    bootLoader.addBootFunction(this.constructor.name, this.boot.bind(this));
    gracefulShutdown.addShutdownFunction(this.constructor.name, this.end.bind(this));
  }
github fullstack-build / fullstack-one / packages / graphql / lib / index.ts View on Github external
constructor(
    @Inject((type) => HookManager) hookManager: HookManager,
    @Inject((type) => LoggerFactory) loggerFactory: LoggerFactory,
    @Inject((type) => Config) config: Config,
    @Inject((type) => BootLoader) bootLoader: BootLoader,
    @Inject((type) => SchemaBuilder) schemaBuilder: SchemaBuilder,
    @Inject((type) => Server) server: Server,
    @Inject((type) => ORM) private readonly orm: ORM
  ) {
    this.graphQlConfig = config.registerConfig("GraphQl", `${__dirname}/../config`);
    this.hookManager = hookManager;

    this.loggerFactory = loggerFactory;
    this.server = server;
    this.schemaBuilder = schemaBuilder;

    this.logger = this.loggerFactory.create(this.constructor.name);
    this.ENVIRONMENT = config.ENVIRONMENT;

    if (operatorsSchemaExtension !== "") this.schemaBuilder.extendSchema(operatorsSchemaExtension);

    bootLoader.addBootFunction(this.constructor.name, this.boot.bind(this));
  }
github fullstack-build / fullstack-one / packages / schema-builder / lib / index.ts View on Github external
constructor(
    @Inject((type) => Config) config,
    @Inject((type) => LoggerFactory) loggerFactory,
    @Inject((type) => BootLoader) bootLoader,
    @Inject((type) => ORM) private readonly orm: ORM
  ) {
    this.loggerFactory = loggerFactory;
    this.config = config;

    this.schemaBuilderConfig = this.config.registerConfig("SchemaBuilder", `${__dirname}/../config`);

    this.logger = this.loggerFactory.create(this.constructor.name);
    this.ENVIRONMENT = this.config.ENVIRONMENT;

    this.orm.addSubscriber(AfterLoadForComputedColumnsSubscriber);

    bootLoader.addBootFunction(this.constructor.name, this.boot.bind(this));
  }
github fullstack-build / fullstack-one / packages / db / lib / ORM / index.ts View on Github external
constructor(
    @Inject((type) => BootLoader) bootLoader: BootLoader,
    @Inject((type) => GracefulShutdown) gracefulShutdown: GracefulShutdown,
    @Inject((type) => LoggerFactory) loggerFactory: LoggerFactory,
    @Inject((type) => Config) config: Config,
    @Inject((type) => EventEmitter) private readonly eventEmitter: EventEmitter,
    @Inject("ENVIRONMENT") environment: IEnvironment
  ) {
    this.logger = loggerFactory.create(this.constructor.name);

    this.config = config.registerConfig("Db", `${__dirname}/../../config`).orm;
    this.environment = environment;
    this.applicationNamePrefix = `${environment.namespace}_orm_`;
    this.applicationName = `${this.applicationNamePrefix}${environment.nodeId}`;

    this.clientManager = getClientManager(environment.nodeId, this.adjustORMPoolSize.bind(this));

    this.addMigrations(Object.values(dbMigrationsObject));

    bootLoader.addBootFunction(this.constructor.name, this.boot.bind(this));
    gracefulShutdown.addShutdownFunction(this.constructor.name, this.end.bind(this));
  }
github fullstack-build / fullstack-one / packages / graphql / dist / index.js View on Github external
link: new apollo_link_schema_1.SchemaLink({
                schema: this.apolloSchema,
                context: {
                    ctx: {},
                    accessToken: null
                }
            })
        });
    }
};
GraphQl = __decorate([
    di_1.Service(),
    __param(0, di_1.Inject((type) => logger_1.LoggerFactory)),
    __param(1, di_1.Inject((type) => config_1.Config)),
    __param(2, di_1.Inject((type) => boot_loader_1.BootLoader)),
    __param(3, di_1.Inject((type) => schema_builder_1.SchemaBuilder)),
    __param(4, di_1.Inject((type) => server_1.Server)),
    __param(5, di_1.Inject((type) => db_1.DbGeneralPool)),
    __metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object])
], GraphQl);
exports.GraphQl = GraphQl;
github fullstack-build / fullstack-one / packages / db / lib / index.ts View on Github external
constructor(
    @Inject((type) => BootLoader) bootLoader: BootLoader,
    @Inject((type) => GracefulShutdown) gracefulShutdown: GracefulShutdown,
    @Inject((type) => LoggerFactory) loggerFactory: LoggerFactory,
    @Inject((type) => Config) config: Config,
    @Inject((type) => EventEmitter) private readonly eventEmitter: EventEmitter,
    @Inject("ENVIRONMENT") environment: IEnvironment
  ) {
    this.logger = loggerFactory.create(this.constructor.name);

    this.config = config.registerConfig("Db", `${__dirname}/../config`);
    this.environment = environment;
    this.applicationNamePrefix = `${environment.namespace}_orm_`;
    this.applicationName = `${this.applicationNamePrefix}${environment.nodeId}`;

    this.clientManager = getClientManager(environment.nodeId, this.adjustORMPoolSize.bind(this));

    this.addMigrations(Object.values(dbMigrationsObject));

    bootLoader.addBootFunction(this.constructor.name, this.boot.bind(this));
    gracefulShutdown.addShutdownFunction(this.constructor.name, this.end.bind(this));
  }
github fullstack-build / fullstack-one / packages / file-storage / lib / index.ts View on Github external
constructor(
    @Inject((type) => Auth) private readonly auth: Auth,
    @Inject((type) => GraphQl) private readonly graphQl: GraphQl,
    @Inject((type) => SchemaBuilder) private readonly schemaBuilder: SchemaBuilder,
    @Inject((type) => BootLoader) bootLoader: BootLoader,
    @Inject((type) => Config) config: Config,
    @Inject((type) => LoggerFactory) loggerFactory: LoggerFactory,
    @Inject((type) => ORM) private readonly orm: ORM
  ) {
    this.fileStorageConfig = config.registerConfig("FileStorage", `${__dirname}/../config`);

    this.logger = loggerFactory.create(this.constructor.name);

    this.orm.addMigrations(migrations);

    this.schemaBuilder.extendSchema(schema);
    this.schemaBuilder.addExtension(getParser());

    this.graphQl.addResolvers(this.getResolvers());

@fullstack-one/di

fullstack.one helper package

MIT
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis

Similar packages