tsyringe#inject TypeScript Examples

The following examples show how to use tsyringe#inject. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CreateAppointmentService.ts    From gobarber-api with MIT License 6 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    private appointmentsRepository: IAppoitmentsRepository,

    @inject('NotificationsRepository')
    private notificationsRepository: INotificationsRepository,

    @inject('CacheProvider')
    private cacheProvider: ICacheProvider,
  ) {}
Example #2
Source File: CreateOrderService.ts    From rocketseat-gostack-11-desafios with MIT License 6 votes vote down vote up
constructor(
    @inject('OrdersRepository')
    private ordersRepository: IOrdersRepository,

    @inject('ProductsRepository')
    private productsRepository: IProductsRepository,

    @inject('CustomersRepository')
    private customersRepository: ICustomersRepository,
  ) {}
Example #3
Source File: CreateAppointmentService.ts    From hotseat-api with MIT License 6 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    private appointmentsRepository: IAppointmentsRepository,

    @inject('NotificationsRepository')
    private notificationsRepository: INotificationsRepository,

    @inject('CacheProvider')
    private cacheProvider: ICacheProvider,
  ) {}
Example #4
Source File: UserInfo.ts    From ADR-Gateway with MIT License 6 votes vote down vote up
ForwardRequest = async (dh: DataholderOidcResponse, consent: ConsentRequestLog, req: express.Request, res:express.Response) =>{

        let url = new URL(await dh.userinfo_endpoint)

        let headers = <any>{
            "content-type":"application/json",
            "accept":"application/json",
            Authorization: `Bearer ${consent.accessToken}`
        }

        let options:AxiosRequestConfig = {
            method: "GET",
            url: url.toString(),
            headers: headers,
            responseType:"json"
        }

        this.clientCertInjector.inject(options,consent.softwareProductId);

        try {
            let dhRes = await axios.request(options);
            if (dhRes.status == 200) {
                return res.json(dhRes.data)
            } else {
                throw 'Unexpected userInfo access error'
            }
        } catch (e) {
            throw new UserInfoAccessError(e);
        }

    }
Example #5
Source File: UpdatePointService.ts    From ecoleta with MIT License 6 votes vote down vote up
constructor(
    @inject('PointsRepository')
    private pointsRepository: IPointsRepository,

    @inject('PointItemsRepository')
    private pointItemsRepository: IPointItemsRepository,

    @inject('ItemsRepository')
    private itemsRepository: IItemsRepository,
  ) {}
Example #6
Source File: vscode-control.ts    From vs-code-conan with MIT License 6 votes vote down vote up
constructor(context: vscode.ExtensionContext, 
        state: AppState,
        @inject("Executor") executor?:Executor) {
        if(!executor){
            throw Error("executor has to be defined");
        }
        this.executor = executor;
        this.commands=container.resolve(Commands);
        this._state = CommandController.updateState(state);
        this.context = context;
        state.activeProfile = ALL;
    }
Example #7
Source File: CreateAppointmentService.ts    From gobarber-project with MIT License 6 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    private appointmentsRepository: IAppointmentsRepository,

    @inject('NotificationsRepository')
    private notificationsRepository: INotificationsRepository,

    @inject('CacheProvider')
    private cacheProvider: ICacheProvider,
  ) {}
Example #8
Source File: CreateAppointmentService.ts    From GoBarber with MIT License 6 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    appointmentsRepository: IAppointmentsRepository,

    @inject('NotificationsRepository')
    notificationsRepository: INotificationsRepository,

    @inject('CacheProvider')
    cacheProvider: ICacheProvider,
  ) {
    this.appointmentsRepository = appointmentsRepository;
    this.notificationsRepository = notificationsRepository;
    this.cacheProvider = cacheProvider;
  }
Example #9
Source File: ListProviderAppointmentsService.ts    From gobarber-api with MIT License 5 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    private appointmentsRepository: IAppointmentRepository,

    @inject('CacheProvider')
    private cacheProvider: ICacheProvider,
  ) {}
Example #10
Source File: CreateCustomerService.ts    From rocketseat-gostack-11-desafios with MIT License 5 votes vote down vote up
constructor(
    @inject('CustomersRepository')
    private customersRepository: ICustomersRepository,
  ) {}
Example #11
Source File: ListProviderAppointmentsService.ts    From hotseat-api with MIT License 5 votes vote down vote up
constructor(
    @inject('AppointmentsRepository')
    private appointmentsRepository: IAppointmentsRepository,

    @inject('CacheProvider')
    private cacheProvider: ICacheProvider,
  ) {}
Example #12
Source File: worker.ts    From ADR-Gateway with MIT License 5 votes vote down vote up
// taskTimings:{fn: (...args:any) => Promise<void>, lastStart?:Date}[] = []

    constructor(
        @inject("Logger") private logger:winston.Logger,
        private consentManager:ConsentRequestLogManager,
        private connector:DefaultConnector,
    ) {}
Example #13
Source File: CreateItemService.ts    From ecoleta with MIT License 5 votes vote down vote up
constructor(
    @inject('ItemsRepository')
    private itemsRepository: IItemsRepository,
  ) {}