summaryrefslogtreecommitdiff
path: root/src/node_modules/inversify
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_modules/inversify')
-rw-r--r--src/node_modules/inversify/.auditignore2
-rw-r--r--src/node_modules/inversify/CHANGELOG.md19
-rw-r--r--src/node_modules/inversify/CODE_OF_CONDUCT.md46
-rw-r--r--src/node_modules/inversify/LICENSE22
-rw-r--r--src/node_modules/inversify/README.md306
-rw-r--r--src/node_modules/inversify/amd/annotation/decorator_utils.js58
-rw-r--r--src/node_modules/inversify/amd/annotation/inject.js29
-rw-r--r--src/node_modules/inversify/amd/annotation/injectable.js15
-rw-r--r--src/node_modules/inversify/amd/annotation/multi_inject.js16
-rw-r--r--src/node_modules/inversify/amd/annotation/named.js16
-rw-r--r--src/node_modules/inversify/amd/annotation/optional.js16
-rw-r--r--src/node_modules/inversify/amd/annotation/post_construct.js14
-rw-r--r--src/node_modules/inversify/amd/annotation/tagged.js16
-rw-r--r--src/node_modules/inversify/amd/annotation/target_name.js11
-rw-r--r--src/node_modules/inversify/amd/annotation/unmanaged.js11
-rw-r--r--src/node_modules/inversify/amd/bindings/binding.js36
-rw-r--r--src/node_modules/inversify/amd/bindings/binding_count.js10
-rw-r--r--src/node_modules/inversify/amd/constants/error_msgs.js62
-rw-r--r--src/node_modules/inversify/amd/constants/literal_types.js27
-rw-r--r--src/node_modules/inversify/amd/constants/metadata_keys.js15
-rw-r--r--src/node_modules/inversify/amd/container/container.js315
-rw-r--r--src/node_modules/inversify/amd/container/container_module.js20
-rw-r--r--src/node_modules/inversify/amd/container/container_snapshot.js16
-rw-r--r--src/node_modules/inversify/amd/container/lookup.js80
-rw-r--r--src/node_modules/inversify/amd/interfaces/interfaces.js4
-rw-r--r--src/node_modules/inversify/amd/inversify.js30
-rw-r--r--src/node_modules/inversify/amd/planning/context.js18
-rw-r--r--src/node_modules/inversify/amd/planning/metadata.js20
-rw-r--r--src/node_modules/inversify/amd/planning/metadata_reader.js22
-rw-r--r--src/node_modules/inversify/amd/planning/plan.js12
-rw-r--r--src/node_modules/inversify/amd/planning/planner.js145
-rw-r--r--src/node_modules/inversify/amd/planning/queryable_string.js29
-rw-r--r--src/node_modules/inversify/amd/planning/reflection_utils.js120
-rw-r--r--src/node_modules/inversify/amd/planning/request.js25
-rw-r--r--src/node_modules/inversify/amd/planning/target.js88
-rw-r--r--src/node_modules/inversify/amd/resolution/instantiation.js49
-rw-r--r--src/node_modules/inversify/amd/resolution/resolver.js95
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_in_syntax.js23
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_in_when_on_syntax.js71
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_on_syntax.js15
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_to_syntax.js71
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_when_on_syntax.js61
-rw-r--r--src/node_modules/inversify/amd/syntax/binding_when_syntax.js98
-rw-r--r--src/node_modules/inversify/amd/syntax/constraint_helpers.js40
-rw-r--r--src/node_modules/inversify/amd/utils/binding_utils.js15
-rw-r--r--src/node_modules/inversify/amd/utils/exceptions.js9
-rw-r--r--src/node_modules/inversify/amd/utils/id.js9
-rw-r--r--src/node_modules/inversify/amd/utils/serialization.js104
-rw-r--r--src/node_modules/inversify/appveyor.yml34
-rw-r--r--src/node_modules/inversify/dts/annotation/decorator_utils.d.ts5
-rw-r--r--src/node_modules/inversify/dts/annotation/inject.d.ts9
-rw-r--r--src/node_modules/inversify/dts/annotation/injectable.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/multi_inject.d.ts3
-rw-r--r--src/node_modules/inversify/dts/annotation/named.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/optional.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/post_construct.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/tagged.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/target_name.d.ts2
-rw-r--r--src/node_modules/inversify/dts/annotation/unmanaged.d.ts2
-rw-r--r--src/node_modules/inversify/dts/bindings/binding.d.ts19
-rw-r--r--src/node_modules/inversify/dts/bindings/binding_count.d.ts6
-rw-r--r--src/node_modules/inversify/dts/constants/error_msgs.d.ts27
-rw-r--r--src/node_modules/inversify/dts/constants/literal_types.d.ts5
-rw-r--r--src/node_modules/inversify/dts/constants/metadata_keys.d.ts11
-rw-r--r--src/node_modules/inversify/dts/container/container.d.ts38
-rw-r--r--src/node_modules/inversify/dts/container/container_module.d.ts11
-rw-r--r--src/node_modules/inversify/dts/container/container_snapshot.d.ts7
-rw-r--r--src/node_modules/inversify/dts/container/lookup.d.ts14
-rw-r--r--src/node_modules/inversify/dts/interfaces/interfaces.d.ts239
-rw-r--r--src/node_modules/inversify/dts/inversify.d.ts21
-rw-r--r--src/node_modules/inversify/dts/planning/context.d.ts11
-rw-r--r--src/node_modules/inversify/dts/planning/metadata.d.ts8
-rw-r--r--src/node_modules/inversify/dts/planning/metadata_reader.d.ts6
-rw-r--r--src/node_modules/inversify/dts/planning/plan.d.ts7
-rw-r--r--src/node_modules/inversify/dts/planning/planner.d.ts5
-rw-r--r--src/node_modules/inversify/dts/planning/queryable_string.d.ts11
-rw-r--r--src/node_modules/inversify/dts/planning/reflection_utils.d.ts5
-rw-r--r--src/node_modules/inversify/dts/planning/request.d.ts14
-rw-r--r--src/node_modules/inversify/dts/planning/target.d.ts21
-rw-r--r--src/node_modules/inversify/dts/resolution/instantiation.d.ts3
-rw-r--r--src/node_modules/inversify/dts/resolution/resolver.d.ts3
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_in_syntax.d.ts9
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_in_when_on_syntax.d.ts28
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_on_syntax.d.ts7
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_to_syntax.d.ts18
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_when_on_syntax.d.ts24
-rw-r--r--src/node_modules/inversify/dts/syntax/binding_when_syntax.d.ts21
-rw-r--r--src/node_modules/inversify/dts/syntax/constraint_helpers.d.ts6
-rw-r--r--src/node_modules/inversify/dts/utils/binding_utils.d.ts2
-rw-r--r--src/node_modules/inversify/dts/utils/exceptions.d.ts1
-rw-r--r--src/node_modules/inversify/dts/utils/guid.d.ts2
-rw-r--r--src/node_modules/inversify/dts/utils/id.d.ts2
-rw-r--r--src/node_modules/inversify/dts/utils/serialization.d.ts7
-rw-r--r--src/node_modules/inversify/dts/utils/template.d.ts1
-rw-r--r--src/node_modules/inversify/es/annotation/decorator_utils.js54
-rw-r--r--src/node_modules/inversify/es/annotation/inject.js29
-rw-r--r--src/node_modules/inversify/es/annotation/injectable.js13
-rw-r--r--src/node_modules/inversify/es/annotation/multi_inject.js15
-rw-r--r--src/node_modules/inversify/es/annotation/named.js15
-rw-r--r--src/node_modules/inversify/es/annotation/optional.js15
-rw-r--r--src/node_modules/inversify/es/annotation/post_construct.js13
-rw-r--r--src/node_modules/inversify/es/annotation/tagged.js14
-rw-r--r--src/node_modules/inversify/es/annotation/target_name.js10
-rw-r--r--src/node_modules/inversify/es/annotation/unmanaged.js10
-rw-r--r--src/node_modules/inversify/es/bindings/binding.js34
-rw-r--r--src/node_modules/inversify/es/bindings/binding_count.js6
-rw-r--r--src/node_modules/inversify/es/constants/error_msgs.js58
-rw-r--r--src/node_modules/inversify/es/constants/literal_types.js21
-rw-r--r--src/node_modules/inversify/es/constants/metadata_keys.js11
-rw-r--r--src/node_modules/inversify/es/container/container.js323
-rw-r--r--src/node_modules/inversify/es/container/container_module.js17
-rw-r--r--src/node_modules/inversify/es/container/container_snapshot.js12
-rw-r--r--src/node_modules/inversify/es/container/lookup.js77
-rw-r--r--src/node_modules/inversify/es/interfaces/interfaces.js0
-rw-r--r--src/node_modules/inversify/es/inversify.js20
-rw-r--r--src/node_modules/inversify/es/planning/context.js15
-rw-r--r--src/node_modules/inversify/es/planning/metadata.js17
-rw-r--r--src/node_modules/inversify/es/planning/metadata_reader.js19
-rw-r--r--src/node_modules/inversify/es/planning/plan.js8
-rw-r--r--src/node_modules/inversify/es/planning/planner.js151
-rw-r--r--src/node_modules/inversify/es/planning/queryable_string.js25
-rw-r--r--src/node_modules/inversify/es/planning/reflection_utils.js120
-rw-r--r--src/node_modules/inversify/es/planning/request.js22
-rw-r--r--src/node_modules/inversify/es/planning/target.js88
-rw-r--r--src/node_modules/inversify/es/resolution/instantiation.js48
-rw-r--r--src/node_modules/inversify/es/resolution/resolver.js96
-rw-r--r--src/node_modules/inversify/es/syntax/binding_in_syntax.js21
-rw-r--r--src/node_modules/inversify/es/syntax/binding_in_when_on_syntax.js70
-rw-r--r--src/node_modules/inversify/es/syntax/binding_on_syntax.js12
-rw-r--r--src/node_modules/inversify/es/syntax/binding_to_syntax.js71
-rw-r--r--src/node_modules/inversify/es/syntax/binding_when_on_syntax.js59
-rw-r--r--src/node_modules/inversify/es/syntax/binding_when_syntax.js96
-rw-r--r--src/node_modules/inversify/es/syntax/constraint_helpers.js35
-rw-r--r--src/node_modules/inversify/es/utils/binding_utils.js11
-rw-r--r--src/node_modules/inversify/es/utils/exceptions.js5
-rw-r--r--src/node_modules/inversify/es/utils/id.js5
-rw-r--r--src/node_modules/inversify/es/utils/serialization.js97
-rw-r--r--src/node_modules/inversify/lib/annotation/decorator_utils.js58
-rw-r--r--src/node_modules/inversify/lib/annotation/inject.js31
-rw-r--r--src/node_modules/inversify/lib/annotation/injectable.js15
-rw-r--r--src/node_modules/inversify/lib/annotation/multi_inject.js17
-rw-r--r--src/node_modules/inversify/lib/annotation/named.js17
-rw-r--r--src/node_modules/inversify/lib/annotation/optional.js17
-rw-r--r--src/node_modules/inversify/lib/annotation/post_construct.js15
-rw-r--r--src/node_modules/inversify/lib/annotation/tagged.js16
-rw-r--r--src/node_modules/inversify/lib/annotation/target_name.js12
-rw-r--r--src/node_modules/inversify/lib/annotation/unmanaged.js12
-rw-r--r--src/node_modules/inversify/lib/bindings/binding.js36
-rw-r--r--src/node_modules/inversify/lib/bindings/binding_count.js8
-rw-r--r--src/node_modules/inversify/lib/constants/error_msgs.js60
-rw-r--r--src/node_modules/inversify/lib/constants/literal_types.js25
-rw-r--r--src/node_modules/inversify/lib/constants/metadata_keys.js13
-rw-r--r--src/node_modules/inversify/lib/container/container.js325
-rw-r--r--src/node_modules/inversify/lib/container/container_module.js19
-rw-r--r--src/node_modules/inversify/lib/container/container_snapshot.js14
-rw-r--r--src/node_modules/inversify/lib/container/lookup.js79
-rw-r--r--src/node_modules/inversify/lib/interfaces/interfaces.js2
-rw-r--r--src/node_modules/inversify/lib/inversify.js47
-rw-r--r--src/node_modules/inversify/lib/planning/context.js17
-rw-r--r--src/node_modules/inversify/lib/planning/metadata.js19
-rw-r--r--src/node_modules/inversify/lib/planning/metadata_reader.js21
-rw-r--r--src/node_modules/inversify/lib/planning/plan.js10
-rw-r--r--src/node_modules/inversify/lib/planning/planner.js155
-rw-r--r--src/node_modules/inversify/lib/planning/queryable_string.js27
-rw-r--r--src/node_modules/inversify/lib/planning/reflection_utils.js124
-rw-r--r--src/node_modules/inversify/lib/planning/request.js24
-rw-r--r--src/node_modules/inversify/lib/planning/target.js90
-rw-r--r--src/node_modules/inversify/lib/resolution/instantiation.js50
-rw-r--r--src/node_modules/inversify/lib/resolution/resolver.js98
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_in_syntax.js23
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js72
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_on_syntax.js14
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_to_syntax.js73
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_when_on_syntax.js61
-rw-r--r--src/node_modules/inversify/lib/syntax/binding_when_syntax.js98
-rw-r--r--src/node_modules/inversify/lib/syntax/constraint_helpers.js40
-rw-r--r--src/node_modules/inversify/lib/utils/binding_utils.js13
-rw-r--r--src/node_modules/inversify/lib/utils/exceptions.js8
-rw-r--r--src/node_modules/inversify/lib/utils/id.js7
-rw-r--r--src/node_modules/inversify/lib/utils/serialization.js103
-rw-r--r--src/node_modules/inversify/package.json80
181 files changed, 6959 insertions, 0 deletions
diff --git a/src/node_modules/inversify/.auditignore b/src/node_modules/inversify/.auditignore
new file mode 100644
index 0000000..f30365b
--- /dev/null
+++ b/src/node_modules/inversify/.auditignore
@@ -0,0 +1,2 @@
+https://nodesecurity.io/advisories/118
+https://nodesecurity.io/advisories/577 \ No newline at end of file
diff --git a/src/node_modules/inversify/CHANGELOG.md b/src/node_modules/inversify/CHANGELOG.md
new file mode 100644
index 0000000..663fa01
--- /dev/null
+++ b/src/node_modules/inversify/CHANGELOG.md
@@ -0,0 +1,19 @@
+# Changelog
+All notable changes to this project from 4.14.0 forward will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+
+## [4.14.0] - 2018-10-16
+### Added
+- Updating constructor injection wiki document with concrete injection example #922
+
+### Changed
+- Change GUID to incremented counter for better performance #882
+
+### Fixed
+- fix broken compilation by adding `.toString()` so symbols serialization #893
+- Fix problem with applying options on Container.resolve (fix #914) #915
+- Fixed documentation issues
diff --git a/src/node_modules/inversify/CODE_OF_CONDUCT.md b/src/node_modules/inversify/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..513206e
--- /dev/null
+++ b/src/node_modules/inversify/CODE_OF_CONDUCT.md
@@ -0,0 +1,46 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+
+## Our Standards
+
+Examples of behavior that contributes to creating a positive environment include:
+
+* Using welcoming and inclusive language
+* Being respectful of differing viewpoints and experiences
+* Gracefully accepting constructive criticism
+* Focusing on what is best for the community
+* Showing empathy towards other community members
+
+Examples of unacceptable behavior by participants include:
+
+* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* Trolling, insulting/derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or electronic address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a professional setting
+
+## Our Responsibilities
+
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+
+## Scope
+
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at remo.jansen@wolksoftware.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+
+[homepage]: http://contributor-covenant.org
+[version]: http://contributor-covenant.org/version/1/4/
diff --git a/src/node_modules/inversify/LICENSE b/src/node_modules/inversify/LICENSE
new file mode 100644
index 0000000..a4d712b
--- /dev/null
+++ b/src/node_modules/inversify/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015-2017 Remo H. Jansen
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/src/node_modules/inversify/README.md b/src/node_modules/inversify/README.md
new file mode 100644
index 0000000..750f98f
--- /dev/null
+++ b/src/node_modules/inversify/README.md
@@ -0,0 +1,306 @@
+# InversifyJS
+
+[![Join the chat at https://gitter.im/inversify/InversifyJS](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/inversify/InversifyJS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+[![Build Status](https://secure.travis-ci.org/inversify/InversifyJS.svg?branch=master)](https://travis-ci.org/inversify/InversifyJS)
+[![Windows Build status](https://ci.appveyor.com/api/projects/status/cd9ekn86p8y2t7h4/branch/master?svg=true)](https://ci.appveyor.com/project/remojansen/inversifyjs/branch/master)
+[![Test Coverage](https://codeclimate.com/github/inversify/InversifyJS/badges/coverage.svg)](https://codeclimate.com/github/inversify/InversifyJS/coverage)
+[![npm version](https://badge.fury.io/js/inversify.svg)](http://badge.fury.io/js/inversify)
+[![Dependencies](https://david-dm.org/inversify/InversifyJS.svg)](https://david-dm.org/inversify/InversifyJS#info=dependencies)
+[![img](https://david-dm.org/inversify/InversifyJS/dev-status.svg)](https://david-dm.org/inversify/InversifyJS/#info=devDependencies)
+[![img](https://david-dm.org/inversify/InversifyJS/peer-status.svg)](https://david-dm.org/inversify/InversifyJS/#info=peerDependenciess)
+[![Known Vulnerabilities](https://snyk.io/test/github/inversify/InversifyJS/badge.svg)](https://snyk.io/test/github/inversify/InversifyJS)
+[![Twitter Follow](https://img.shields.io/twitter/follow/InversifyJS.svg?style=flat&maxAge=86400)](https://twitter.com/inversifyjs)
+
+[![NPM](https://nodei.co/npm/inversify.png?downloads=true&downloadRank=true)](https://nodei.co/npm/inversify/)
+[![NPM](https://nodei.co/npm-dl/inversify.png?months=9&height=3)](https://nodei.co/npm/inversify/)
+
+![](https://raw.githubusercontent.com/inversify/inversify.github.io/master/img/cover.jpg)
+
+A powerful and lightweight inversion of control container for JavaScript & Node.js apps powered by TypeScript.
+
+## About
+InversifyJS is a lightweight inversion of control (IoC) container for TypeScript and JavaScript apps.
+An IoC container uses a class constructor to identify and inject its dependencies.
+InversifyJS has a friendly API and encourages the usage of the best OOP and IoC practices.
+
+## Motivation
+JavaScript now supports object oriented (OO) programming with class based inheritance. These features are great but the truth is that they are also
+[dangerous](https://medium.com/@dan_abramov/how-to-use-classes-and-sleep-at-night-9af8de78ccb4).
+
+We need a good OO design ([SOLID](https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)), [Composite Reuse](https://en.wikipedia.org/wiki/Composition_over_inheritance), etc.) to protect ourselves from these threats. The problem is that OO design is difficult and that is exactly why we created InversifyJS.
+
+InversifyJS is a tool that helps JavaScript developers write code with good OO design.
+
+## Philosophy
+InversifyJS has been developed with 4 main goals:
+
+1. Allow JavaScript developers to write code that adheres to the SOLID principles.
+
+2. Facilitate and encourage the adherence to the best OOP and IoC practices.
+
+3. Add as little runtime overhead as possible.
+
+4. Provide a [state of the art development experience](https://github.com/inversify/InversifyJS/blob/master/wiki/ecosystem.md).
+
+## Testimonies
+
+**[Nate Kohari](https://twitter.com/nkohari)** - Author of [Ninject](https://github.com/ninject/Ninject)
+
+> *"Nice work! I've taken a couple shots at creating DI frameworks for JavaScript and TypeScript, but the lack of RTTI really hinders things.*
+> *The ES7 metadata gets us part of the way there (as you've discovered). Keep up the great work!"*
+
+**[Michel Weststrate](https://twitter.com/mweststrate)** - Author of [MobX](https://github.com/mobxjs/mobx)
+> *Dependency injection like InversifyJS works nicely*
+
+## Some companies using InversifyJS
+
+[<img src="https://avatars0.githubusercontent.com/u/6154722?s=200&v=4" width="100" />](https://opensource.microsoft.com/)[<img src="https://avatars2.githubusercontent.com/u/69631?s=200&v=4" width="100" />](https://code.facebook.com/projects/1021334114569758/nuclide/)[<img src="https://avatars0.githubusercontent.com/u/2232217?s=200&v=4" width="100" />](https://aws.github.io/aws-amplify/)[<img src="https://avatars0.githubusercontent.com/u/1520648?s=200&v=4" width="100" />](https://www.plainconcepts.com/)[<img src="https://avatars3.githubusercontent.com/u/6962987?s=200&v=4" width="100" />](https://api.slack.com/)[<img src="https://pbs.twimg.com/profile_images/827249559046909954/SyaBPcH8_400x400.jpg" width="100" />](http://acia.aon.com/index.php/home/) [<img src="https://avatars3.githubusercontent.com/u/114767?s=200&v=4" width="100" />](https://www.lonelyplanet.com/) [<img src="https://avatars0.githubusercontent.com/u/25283328?s=200&v=4" width="100" />](https://jincor.com/) [<img src="https://avatars1.githubusercontent.com/u/1957282?s=200&v=4" width="100" />](https://www.web-computing.de/) [<img src="https://avatars1.githubusercontent.com/u/17648048?s=200&v=4" width="100" />](https://dcos.io/) [<img src="https://avatars0.githubusercontent.com/u/16970371?s=200&v=4" width="100" />](https://typefox.io/) [<img src="https://avatars0.githubusercontent.com/u/18010308?s=200&v=4" width="100" />](https://code4.ro/) [<img src="https://user-images.githubusercontent.com/10656223/33888109-fae0852e-df43-11e7-97f6-9db543da0bde.png" width="100">](http://www.baidu.com/) [<img src="https://avatars2.githubusercontent.com/u/8085382?s=200&v=4" width="100" />](https://www.imdada.cn/) [<img src="https://avatars2.githubusercontent.com/u/17041151?s=200&v=4" width="100" />](https://www.ato.gov.au/) [<img src="https://avatars1.githubusercontent.com/u/14963540?s=200&v=4" width="100" />](https://www.kaneoh.com/) [<img src="https://avatars0.githubusercontent.com/u/26021686?s=200&v=4" width="100" />](https://particl.io/) [<img src="https://avatars2.githubusercontent.com/u/24523195?s=200&v=4" width="100" />](https://slackmap.com/) [<img src="https://avatars3.githubusercontent.com/u/16556899?s=200&v=4" width="100" />](https://www.go1.com/) [<img src="https://avatars3.githubusercontent.com/u/23475730?s=200&v=4" width="100" />](http://www.stellwagengroup.com/stellwagen-technology/) [<img src="https://avatars1.githubusercontent.com/u/15262567?s=200&v=4" width="100" />](https://www.edrlab.org/) [<img src="https://avatars1.githubusercontent.com/u/10072104?s=200&v=4" width="100" />](https://www.goodgamestudios.com/) [<img src="https://avatars2.githubusercontent.com/u/13613760?s=200&v=4" width="100" />](https://freshfox.at/) [<img src="https://avatars1.githubusercontent.com/u/864482?s=200&v=4" width="100" />](https://schubergphilis.com/)
+
+## Installation
+
+You can get the latest release and the type definitions using npm:
+
+```
+$ npm install inversify reflect-metadata --save
+```
+
+The InversifyJS type definitions are included in the inversify npm package.
+
+> :warning: **Important!** InversifyJS requires TypeScript >= 2.0 and the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib`
+compilation options in your `tsconfig.json` file.
+
+```js
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["es6"],
+ "types": ["reflect-metadata"],
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "experimentalDecorators": true,
+ "emitDecoratorMetadata": true
+ }
+}
+```
+
+InversifyJS requires a modern JavaScript engine with support for:
+
+- [Reflect metadata](https://rbuckton.github.io/reflect-metadata/)
+- [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
+- [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) (Only required if using [provider injection](https://github.com/inversify/InversifyJS/blob/master/wiki/provider_injection.md))
+- [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) (Only required if using [activation handlers](https://github.com/inversify/InversifyJS/blob/master/wiki/activation_handler.md))
+
+If your environment doesn't support one of these you will need to import a shim or polyfill.
+
+> :warning: **The `reflect-metadata` polyfill should be imported only once in your entire application** because the Reflect object is mean to be a global singleton. More details about this can be found [here](https://github.com/inversify/InversifyJS/issues/262#issuecomment-227593844).
+
+Check out the [Environment support and polyfills](https://github.com/inversify/InversifyJS/blob/master/wiki/environment.md)
+page in the wiki and the [Basic example](https://github.com/inversify/inversify-basic-example) to learn more.
+
+## The Basics
+Let’s take a look at the basic usage and APIs of InversifyJS with TypeScript:
+
+### Step 1: Declare your interfaces and types
+
+Our goal is to write code that adheres to the [dependency inversion principle](https://en.wikipedia.org/wiki/Dependency_inversion_principle).
+This means that we should "depend upon Abstractions and do not depend upon concretions".
+Let's start by declaring some interfaces (abstractions).
+
+```ts
+// file interfaces.ts
+
+export interface Warrior {
+ fight(): string;
+ sneak(): string;
+}
+
+export interface Weapon {
+ hit(): string;
+}
+
+export interface ThrowableWeapon {
+ throw(): string;
+}
+```
+
+InversifyJS need to use the type as identifiers at runtime. We use symbols as identifiers but you can also use classes and or string literals.
+
+```ts
+// file types.ts
+
+const TYPES = {
+ Warrior: Symbol.for("Warrior"),
+ Weapon: Symbol.for("Weapon"),
+ ThrowableWeapon: Symbol.for("ThrowableWeapon")
+};
+
+export { TYPES };
+
+```
+
+> **Note**: It is recommended to use Symbols but InversifyJS also support the usage of Classes and string literals (please refer to the features section to learn more).
+
+### Step 2: Declare dependencies using the `@injectable` & `@inject` decorators
+Let's continue by declaring some classes (concretions). The classes are implementations of the interfaces that we just declared. All the classes must be annotated with the `@injectable` decorator.
+
+When a class has a dependency on an interface we also need to use the `@inject` decorator to define an identifier for the interface that will be available at runtime. In this case we will use the Symbols `Symbol.for("Weapon")` and `Symbol.for("ThrowableWeapon")` as runtime identifiers.
+
+```ts
+// file entities.ts
+
+import { injectable, inject } from "inversify";
+import "reflect-metadata";
+import { Weapon, ThrowableWeapon, Warrior } from "./interfaces"
+import { TYPES } from "./types";
+
+@injectable()
+class Katana implements Weapon {
+ public hit() {
+ return "cut!";
+ }
+}
+
+@injectable()
+class Shuriken implements ThrowableWeapon {
+ public throw() {
+ return "hit!";
+ }
+}
+
+@injectable()
+class Ninja implements Warrior {
+
+ private _katana: Weapon;
+ private _shuriken: ThrowableWeapon;
+
+ public constructor(
+ @inject(TYPES.Weapon) katana: Weapon,
+ @inject(TYPES.ThrowableWeapon) shuriken: ThrowableWeapon
+ ) {
+ this._katana = katana;
+ this._shuriken = shuriken;
+ }
+
+ public fight() { return this._katana.hit(); }
+ public sneak() { return this._shuriken.throw(); }
+
+}
+
+export { Ninja, Katana, Shuriken };
+```
+
+If you prefer it you can use property injection instead of constructor injection so you don't have to declare the class constructor:
+
+```ts
+@injectable()
+class Ninja implements Warrior {
+ @inject(TYPES.Weapon) private _katana: Weapon;
+ @inject(TYPES.ThrowableWeapon) private _shuriken: ThrowableWeapon;
+ public fight() { return this._katana.hit(); }
+ public sneak() { return this._shuriken.throw(); }
+}
+```
+
+### Step 3: Create and configure a Container
+We recommend to do this in a file named `inversify.config.ts`. This is the only place in which there is some coupling.
+In the rest of your application your classes should be free of references to other classes.
+```ts
+// file inversify.config.ts
+
+import { Container } from "inversify";
+import { TYPES } from "./types";
+import { Warrior, Weapon, ThrowableWeapon } from "./interfaces";
+import { Ninja, Katana, Shuriken } from "./entities";
+
+const myContainer = new Container();
+myContainer.bind<Warrior>(TYPES.Warrior).to(Ninja);
+myContainer.bind<Weapon>(TYPES.Weapon).to(Katana);
+myContainer.bind<ThrowableWeapon>(TYPES.ThrowableWeapon).to(Shuriken);
+
+export { myContainer };
+```
+
+### Step 4: Resolve dependencies
+You can use the method `get<T>` from the `Container` class to resolve a dependency.
+Remember that you should do this only in your [composition root](http://blog.ploeh.dk/2011/07/28/CompositionRoot/)
+to avoid the [service locator anti-pattern](http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/).
+
+```ts
+import { myContainer } from "./inversify.config";
+import { TYPES } from "./types";
+import { Warrior } from "./interfaces";
+
+const ninja = myContainer.get<Warrior>(TYPES.Warrior);
+
+expect(ninja.fight()).eql("cut!"); // true
+expect(ninja.sneak()).eql("hit!"); // true
+```
+
+As we can see the `Katana` and `Shuriken` were successfully resolved and injected into `Ninja`.
+
+InversifyJS supports ES5 and ES6 and can work without TypeScript.
+Head to the [**JavaScript example**](https://github.com/inversify/InversifyJS/blob/master/wiki/basic_js_example.md) to learn more!
+
+## The InversifyJS Features and API
+Let's take a look to the InversifyJS features!
+
+- [Support for classes](https://github.com/inversify/InversifyJS/blob/master/wiki/classes_as_id.md)
+- [Support for Symbols](https://github.com/inversify/InversifyJS/blob/master/wiki/symbols_as_id.md)
+- [Container API](https://github.com/inversify/InversifyJS/blob/master/wiki/container_api.md)
+- [Declaring container modules](https://github.com/inversify/InversifyJS/blob/master/wiki/container_modules.md)
+- [Container snapshots](https://github.com/inversify/InversifyJS/blob/master/wiki/container_snapshots.md)
+- [Controlling the scope of the dependencies](https://github.com/inversify/InversifyJS/blob/master/wiki/scope.md)
+- [Declaring optional dependencies](https://github.com/inversify/InversifyJS/blob/master/wiki/optional_dependencies.md)
+- [Injecting a constant or dynamic value](https://github.com/inversify/InversifyJS/blob/master/wiki/value_injection.md)
+- [Injecting a class constructor](https://github.com/inversify/InversifyJS/blob/master/wiki/constructor_injection.md)
+- [Injecting a Factory](https://github.com/inversify/InversifyJS/blob/master/wiki/factory_injection.md)
+- [Auto factory](https://github.com/inversify/InversifyJS/blob/master/wiki/auto_factory.md)
+- [Injecting a Provider (asynchronous Factory)](https://github.com/inversify/InversifyJS/blob/master/wiki/provider_injection.md)
+- [Activation handler](https://github.com/inversify/InversifyJS/blob/master/wiki/activation_handler.md)
+- [Post Construct decorator](https://github.com/inversify/InversifyJS/blob/master/wiki/post_construct.md)
+- [Middleware](https://github.com/inversify/InversifyJS/blob/master/wiki/middleware.md)
+- [Multi-injection](https://github.com/inversify/InversifyJS/blob/master/wiki/multi_injection.md)
+- [Tagged bindings](https://github.com/inversify/InversifyJS/blob/master/wiki/tagged_bindings.md)
+- [Create your own tag decorators](https://github.com/inversify/InversifyJS/blob/master/wiki/custom_tag_decorators.md)
+- [Named bindings](https://github.com/inversify/InversifyJS/blob/master/wiki/named_bindings.md)
+- [Default target](https://github.com/inversify/InversifyJS/blob/master/wiki/default_targets.md)
+- [Support for hierarchical DI systems](https://github.com/inversify/InversifyJS/blob/master/wiki/hierarchical_di.md)
+- [Contextual bindings & @targetName](https://github.com/inversify/InversifyJS/blob/master/wiki/contextual_bindings.md)
+- [Property injection](https://github.com/inversify/InversifyJS/blob/master/wiki/property_injection.md)
+- [Circular dependencies](https://github.com/inversify/InversifyJS/blob/master/wiki/circular_dependencies.md)
+- [Inheritance](https://github.com/inversify/InversifyJS/blob/master/wiki/inheritance.md)
+
+Please refer to the [wiki](https://github.com/inversify/InversifyJS/blob/master/wiki/readme.md) for additional details.
+
+## Ecosystem
+In order to provide a state of the art development experience we are also working on:
+
+- [Middleware extensions](https://github.com/inversify/InversifyJS/blob/master/wiki/ecosystem.md#extensions).
+- [Development tools](https://github.com/inversify/InversifyJS/blob/master/wiki/ecosystem.md#development-tools).
+- [Examples](https://github.com/inversify/InversifyJS/blob/master/wiki/ecosystem.md#examples).
+
+Please refer to the [ecosystem wiki page](https://github.com/inversify/InversifyJS/blob/master/wiki/ecosystem.md) to learn more.
+
+## Support
+If you are experience any kind of issues we will be happy to help. You can report an issue using the [issues page](https://github.com/inversify/InversifyJS/issues) or the [chat](https://gitter.im/inversify/InversifyJS). You can also ask questions at [Stack overflow](http://stackoverflow.com/tags/inversifyjs) using the `inversifyjs` tag.
+
+If you want to share your thoughts with the development team or join us you will be able to do so using the [official the mailing list](https://groups.google.com/forum/#!forum/inversifyjs). You can check out the
+[wiki](https://github.com/inversify/InversifyJS/blob/master/wiki/readme.md) to learn more about InversifyJS internals.
+
+## Acknowledgements
+
+Thanks a lot to all the [contributors](https://github.com/inversify/InversifyJS/graphs/contributors), all the developers out there using InversifyJS and all those that help us to spread the word by sharing content about InversifyJS online. Without your feedback and support this project would not be possible.
+
+## License
+
+License under the MIT License (MIT)
+
+Copyright © 2015-2017 [Remo H. Jansen](http://www.remojansen.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/node_modules/inversify/amd/annotation/decorator_utils.js b/src/node_modules/inversify/amd/annotation/decorator_utils.js
new file mode 100644
index 0000000..ebb91f4
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/decorator_utils.js
@@ -0,0 +1,58 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/metadata_keys"], function (require, exports, ERROR_MSGS, METADATA_KEY) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED;
+ _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);
+ }
+ exports.tagParameter = tagParameter;
+ function tagProperty(annotationTarget, propertyName, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED_PROP;
+ _tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);
+ }
+ exports.tagProperty = tagProperty;
+ function _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {
+ var paramsOrPropertiesMetadata = {};
+ var isParameterDecorator = (typeof parameterIndex === "number");
+ var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;
+ if (isParameterDecorator && propertyName !== undefined) {
+ throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);
+ }
+ if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
+ paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
+ }
+ var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
+ if (!Array.isArray(paramOrPropertyMetadata)) {
+ paramOrPropertyMetadata = [];
+ }
+ else {
+ for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {
+ var m = paramOrPropertyMetadata_1[_i];
+ if (m.key === metadata.key) {
+ throw new Error(ERROR_MSGS.DUPLICATED_METADATA + " " + m.key.toString());
+ }
+ }
+ }
+ paramOrPropertyMetadata.push(metadata);
+ paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
+ Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
+ }
+ function _decorate(decorators, target) {
+ Reflect.decorate(decorators, target);
+ }
+ function _param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); };
+ }
+ function decorate(decorator, target, parameterIndex) {
+ if (typeof parameterIndex === "number") {
+ _decorate([_param(parameterIndex, decorator)], target);
+ }
+ else if (typeof parameterIndex === "string") {
+ Reflect.decorate([decorator], target, parameterIndex);
+ }
+ else {
+ _decorate([decorator], target);
+ }
+ }
+ exports.decorate = decorate;
+});
diff --git a/src/node_modules/inversify/amd/annotation/inject.js b/src/node_modules/inversify/amd/annotation/inject.js
new file mode 100644
index 0000000..64d2c7a
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/inject.js
@@ -0,0 +1,29 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, error_msgs_1, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var LazyServiceIdentifer = (function () {
+ function LazyServiceIdentifer(cb) {
+ this._cb = cb;
+ }
+ LazyServiceIdentifer.prototype.unwrap = function () {
+ return this._cb();
+ };
+ return LazyServiceIdentifer;
+ }());
+ exports.LazyServiceIdentifer = LazyServiceIdentifer;
+ function inject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ if (serviceIdentifier === undefined) {
+ throw new Error(error_msgs_1.UNDEFINED_INJECT_ANNOTATION(target.name));
+ }
+ var metadata = new metadata_1.Metadata(METADATA_KEY.INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+ }
+ exports.inject = inject;
+});
diff --git a/src/node_modules/inversify/amd/annotation/injectable.js b/src/node_modules/inversify/amd/annotation/injectable.js
new file mode 100644
index 0000000..1d4761c
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/injectable.js
@@ -0,0 +1,15 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/metadata_keys"], function (require, exports, ERRORS_MSGS, METADATA_KEY) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function injectable() {
+ return function (target) {
+ if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {
+ throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
+ }
+ var types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
+ Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
+ return target;
+ };
+ }
+ exports.injectable = injectable;
+});
diff --git a/src/node_modules/inversify/amd/annotation/multi_inject.js b/src/node_modules/inversify/amd/annotation/multi_inject.js
new file mode 100644
index 0000000..2c13804
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/multi_inject.js
@@ -0,0 +1,16 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function multiInject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.MULTI_INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+ }
+ exports.multiInject = multiInject;
+});
diff --git a/src/node_modules/inversify/amd/annotation/named.js b/src/node_modules/inversify/amd/annotation/named.js
new file mode 100644
index 0000000..1cee8ac
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/named.js
@@ -0,0 +1,16 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function named(name) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, name);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+ }
+ exports.named = named;
+});
diff --git a/src/node_modules/inversify/amd/annotation/optional.js b/src/node_modules/inversify/amd/annotation/optional.js
new file mode 100644
index 0000000..77f51be
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/optional.js
@@ -0,0 +1,16 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function optional() {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+ }
+ exports.optional = optional;
+});
diff --git a/src/node_modules/inversify/amd/annotation/post_construct.js b/src/node_modules/inversify/amd/annotation/post_construct.js
new file mode 100644
index 0000000..af6d56d
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/post_construct.js
@@ -0,0 +1,14 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/metadata_keys", "../planning/metadata"], function (require, exports, ERRORS_MSGS, METADATA_KEY, metadata_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function postConstruct() {
+ return function (target, propertyKey, descriptor) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.POST_CONSTRUCT, propertyKey);
+ if (Reflect.hasOwnMetadata(METADATA_KEY.POST_CONSTRUCT, target.constructor)) {
+ throw new Error(ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS);
+ }
+ Reflect.defineMetadata(METADATA_KEY.POST_CONSTRUCT, metadata, target.constructor);
+ };
+ }
+ exports.postConstruct = postConstruct;
+});
diff --git a/src/node_modules/inversify/amd/annotation/tagged.js b/src/node_modules/inversify/amd/annotation/tagged.js
new file mode 100644
index 0000000..fd602f9
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/tagged.js
@@ -0,0 +1,16 @@
+define(["require", "exports", "../planning/metadata", "./decorator_utils"], function (require, exports, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function tagged(metadataKey, metadataValue) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(metadataKey, metadataValue);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+ }
+ exports.tagged = tagged;
+});
diff --git a/src/node_modules/inversify/amd/annotation/target_name.js b/src/node_modules/inversify/amd/annotation/target_name.js
new file mode 100644
index 0000000..70d6569
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/target_name.js
@@ -0,0 +1,11 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function targetName(name) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.NAME_TAG, name);
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ };
+ }
+ exports.targetName = targetName;
+});
diff --git a/src/node_modules/inversify/amd/annotation/unmanaged.js b/src/node_modules/inversify/amd/annotation/unmanaged.js
new file mode 100644
index 0000000..5a09a00
--- /dev/null
+++ b/src/node_modules/inversify/amd/annotation/unmanaged.js
@@ -0,0 +1,11 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata", "./decorator_utils"], function (require, exports, METADATA_KEY, metadata_1, decorator_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function unmanaged() {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.UNMANAGED_TAG, true);
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ };
+ }
+ exports.unmanaged = unmanaged;
+});
diff --git a/src/node_modules/inversify/amd/bindings/binding.js b/src/node_modules/inversify/amd/bindings/binding.js
new file mode 100644
index 0000000..f08f9c7
--- /dev/null
+++ b/src/node_modules/inversify/amd/bindings/binding.js
@@ -0,0 +1,36 @@
+define(["require", "exports", "../constants/literal_types", "../utils/id"], function (require, exports, literal_types_1, id_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Binding = (function () {
+ function Binding(serviceIdentifier, scope) {
+ this.id = id_1.id();
+ this.activated = false;
+ this.serviceIdentifier = serviceIdentifier;
+ this.scope = scope;
+ this.type = literal_types_1.BindingTypeEnum.Invalid;
+ this.constraint = function (request) { return true; };
+ this.implementationType = null;
+ this.cache = null;
+ this.factory = null;
+ this.provider = null;
+ this.onActivation = null;
+ this.dynamicValue = null;
+ }
+ Binding.prototype.clone = function () {
+ var clone = new Binding(this.serviceIdentifier, this.scope);
+ clone.activated = false;
+ clone.implementationType = this.implementationType;
+ clone.dynamicValue = this.dynamicValue;
+ clone.scope = this.scope;
+ clone.type = this.type;
+ clone.factory = this.factory;
+ clone.provider = this.provider;
+ clone.constraint = this.constraint;
+ clone.onActivation = this.onActivation;
+ clone.cache = this.cache;
+ return clone;
+ };
+ return Binding;
+ }());
+ exports.Binding = Binding;
+});
diff --git a/src/node_modules/inversify/amd/bindings/binding_count.js b/src/node_modules/inversify/amd/bindings/binding_count.js
new file mode 100644
index 0000000..3505947
--- /dev/null
+++ b/src/node_modules/inversify/amd/bindings/binding_count.js
@@ -0,0 +1,10 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingCount = {
+ MultipleBindingsAvailable: 2,
+ NoBindingsAvailable: 0,
+ OnlyOneBindingAvailable: 1
+ };
+ exports.BindingCount = BindingCount;
+});
diff --git a/src/node_modules/inversify/amd/constants/error_msgs.js b/src/node_modules/inversify/amd/constants/error_msgs.js
new file mode 100644
index 0000000..60d1c4b
--- /dev/null
+++ b/src/node_modules/inversify/amd/constants/error_msgs.js
@@ -0,0 +1,62 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
+ exports.DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
+ exports.NULL_ARGUMENT = "NULL argument";
+ exports.KEY_NOT_FOUND = "Key Not Found";
+ exports.AMBIGUOUS_MATCH = "Ambiguous match found for serviceIdentifier:";
+ exports.CANNOT_UNBIND = "Could not unbind serviceIdentifier:";
+ exports.NOT_REGISTERED = "No matching bindings found for serviceIdentifier:";
+ exports.MISSING_INJECTABLE_ANNOTATION = "Missing required @injectable annotation in:";
+ exports.MISSING_INJECT_ANNOTATION = "Missing required @inject or @multiInject annotation in:";
+ exports.UNDEFINED_INJECT_ANNOTATION = function (name) {
+ return "@inject called with undefined this could mean that the class " + name + " has " +
+ "a circular dependency problem. You can use a LazyServiceIdentifer to " +
+ "overcome this limitation.";
+ };
+ exports.CIRCULAR_DEPENDENCY = "Circular dependency found:";
+ exports.NOT_IMPLEMENTED = "Sorry, this feature is not fully implemented yet.";
+ exports.INVALID_BINDING_TYPE = "Invalid binding type:";
+ exports.NO_MORE_SNAPSHOTS_AVAILABLE = "No snapshot available to restore.";
+ exports.INVALID_MIDDLEWARE_RETURN = "Invalid return type in middleware. Middleware must return!";
+ exports.INVALID_FUNCTION_BINDING = "Value provided to function binding must be a function!";
+ exports.INVALID_TO_SELF_VALUE = "The toSelf function can only be applied when a constructor is " +
+ "used as service identifier";
+ exports.INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
+ "must be applied to the parameters of a class constructor or a class property.";
+ exports.ARGUMENTS_LENGTH_MISMATCH = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "The number of constructor arguments in the derived class " +
+ (values[0] + " must be >= than the number of constructor arguments of its base class.");
+ };
+ exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = "Invalid Container constructor argument. Container options " +
+ "must be an object.";
+ exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = "Invalid Container option. Default scope must " +
+ "be a string ('singleton' or 'transient').";
+ exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = "Invalid Container option. Auto bind injectable must " +
+ "be a boolean";
+ exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = "Invalid Container option. Skip base check must " +
+ "be a boolean";
+ exports.MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class";
+ exports.POST_CONSTRUCT_ERROR = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "@postConstruct error in class " + values[0] + ": " + values[1];
+ };
+ exports.CIRCULAR_DEPENDENCY_IN_FACTORY = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "It looks like there is a circular dependency " +
+ ("in one of the '" + values[0] + "' bindings. Please investigate bindings with") +
+ ("service identifier '" + values[1] + "'.");
+ };
+ exports.STACK_OVERFLOW = "Maximum call stack size exceeded";
+});
diff --git a/src/node_modules/inversify/amd/constants/literal_types.js b/src/node_modules/inversify/amd/constants/literal_types.js
new file mode 100644
index 0000000..e1e5c86
--- /dev/null
+++ b/src/node_modules/inversify/amd/constants/literal_types.js
@@ -0,0 +1,27 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingScopeEnum = {
+ Request: "Request",
+ Singleton: "Singleton",
+ Transient: "Transient"
+ };
+ exports.BindingScopeEnum = BindingScopeEnum;
+ var BindingTypeEnum = {
+ ConstantValue: "ConstantValue",
+ Constructor: "Constructor",
+ DynamicValue: "DynamicValue",
+ Factory: "Factory",
+ Function: "Function",
+ Instance: "Instance",
+ Invalid: "Invalid",
+ Provider: "Provider"
+ };
+ exports.BindingTypeEnum = BindingTypeEnum;
+ var TargetTypeEnum = {
+ ClassProperty: "ClassProperty",
+ ConstructorArgument: "ConstructorArgument",
+ Variable: "Variable"
+ };
+ exports.TargetTypeEnum = TargetTypeEnum;
+});
diff --git a/src/node_modules/inversify/amd/constants/metadata_keys.js b/src/node_modules/inversify/amd/constants/metadata_keys.js
new file mode 100644
index 0000000..16e3f72
--- /dev/null
+++ b/src/node_modules/inversify/amd/constants/metadata_keys.js
@@ -0,0 +1,15 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.NAMED_TAG = "named";
+ exports.NAME_TAG = "name";
+ exports.UNMANAGED_TAG = "unmanaged";
+ exports.OPTIONAL_TAG = "optional";
+ exports.INJECT_TAG = "inject";
+ exports.MULTI_INJECT_TAG = "multi_inject";
+ exports.TAGGED = "inversify:tagged";
+ exports.TAGGED_PROP = "inversify:tagged_props";
+ exports.PARAM_TYPES = "inversify:paramtypes";
+ exports.DESIGN_PARAM_TYPES = "design:paramtypes";
+ exports.POST_CONSTRUCT = "post_construct";
+});
diff --git a/src/node_modules/inversify/amd/container/container.js b/src/node_modules/inversify/amd/container/container.js
new file mode 100644
index 0000000..18d1cb5
--- /dev/null
+++ b/src/node_modules/inversify/amd/container/container.js
@@ -0,0 +1,315 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+define(["require", "exports", "../bindings/binding", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys", "../planning/metadata_reader", "../planning/planner", "../resolution/resolver", "../syntax/binding_to_syntax", "../utils/id", "../utils/serialization", "./container_snapshot", "./lookup"], function (require, exports, binding_1, ERROR_MSGS, literal_types_1, METADATA_KEY, metadata_reader_1, planner_1, resolver_1, binding_to_syntax_1, id_1, serialization_1, container_snapshot_1, lookup_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Container = (function () {
+ function Container(containerOptions) {
+ var options = containerOptions || {};
+ if (typeof options !== "object") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);
+ }
+ if (options.defaultScope === undefined) {
+ options.defaultScope = literal_types_1.BindingScopeEnum.Transient;
+ }
+ else if (options.defaultScope !== literal_types_1.BindingScopeEnum.Singleton &&
+ options.defaultScope !== literal_types_1.BindingScopeEnum.Transient &&
+ options.defaultScope !== literal_types_1.BindingScopeEnum.Request) {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);
+ }
+ if (options.autoBindInjectable === undefined) {
+ options.autoBindInjectable = false;
+ }
+ else if (typeof options.autoBindInjectable !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);
+ }
+ if (options.skipBaseClassChecks === undefined) {
+ options.skipBaseClassChecks = false;
+ }
+ else if (typeof options.skipBaseClassChecks !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);
+ }
+ this.options = {
+ autoBindInjectable: options.autoBindInjectable,
+ defaultScope: options.defaultScope,
+ skipBaseClassChecks: options.skipBaseClassChecks
+ };
+ this.id = id_1.id();
+ this._bindingDictionary = new lookup_1.Lookup();
+ this._snapshots = [];
+ this._middleware = null;
+ this.parent = null;
+ this._metadataReader = new metadata_reader_1.MetadataReader();
+ }
+ Container.merge = function (container1, container2) {
+ var container = new Container();
+ var bindingDictionary = planner_1.getBindingDictionary(container);
+ var bindingDictionary1 = planner_1.getBindingDictionary(container1);
+ var bindingDictionary2 = planner_1.getBindingDictionary(container2);
+ function copyDictionary(origin, destination) {
+ origin.traverse(function (key, value) {
+ value.forEach(function (binding) {
+ destination.add(binding.serviceIdentifier, binding.clone());
+ });
+ });
+ }
+ copyDictionary(bindingDictionary1, bindingDictionary);
+ copyDictionary(bindingDictionary2, bindingDictionary);
+ return container;
+ };
+ Container.prototype.load = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var getHelpers = this._getContainerModuleHelpersFactory();
+ for (var _a = 0, modules_1 = modules; _a < modules_1.length; _a++) {
+ var currentModule = modules_1[_a];
+ var containerModuleHelpers = getHelpers(currentModule.id);
+ currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
+ }
+ };
+ Container.prototype.loadAsync = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ return __awaiter(this, void 0, void 0, function () {
+ var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
+ return __generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ getHelpers = this._getContainerModuleHelpersFactory();
+ _a = 0, modules_2 = modules;
+ _b.label = 1;
+ case 1:
+ if (!(_a < modules_2.length)) return [3, 4];
+ currentModule = modules_2[_a];
+ containerModuleHelpers = getHelpers(currentModule.id);
+ return [4, currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction)];
+ case 2:
+ _b.sent();
+ _b.label = 3;
+ case 3:
+ _a++;
+ return [3, 1];
+ case 4: return [2];
+ }
+ });
+ });
+ };
+ Container.prototype.unload = function () {
+ var _this = this;
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var conditionFactory = function (expected) { return function (item) {
+ return item.moduleId === expected;
+ }; };
+ modules.forEach(function (module) {
+ var condition = conditionFactory(module.id);
+ _this._bindingDictionary.removeByCondition(condition);
+ });
+ };
+ Container.prototype.bind = function (serviceIdentifier) {
+ var scope = this.options.defaultScope || literal_types_1.BindingScopeEnum.Transient;
+ var binding = new binding_1.Binding(serviceIdentifier, scope);
+ this._bindingDictionary.add(serviceIdentifier, binding);
+ return new binding_to_syntax_1.BindingToSyntax(binding);
+ };
+ Container.prototype.rebind = function (serviceIdentifier) {
+ this.unbind(serviceIdentifier);
+ return this.bind(serviceIdentifier);
+ };
+ Container.prototype.unbind = function (serviceIdentifier) {
+ try {
+ this._bindingDictionary.remove(serviceIdentifier);
+ }
+ catch (e) {
+ throw new Error(ERROR_MSGS.CANNOT_UNBIND + " " + serialization_1.getServiceIdentifierAsString(serviceIdentifier));
+ }
+ };
+ Container.prototype.unbindAll = function () {
+ this._bindingDictionary = new lookup_1.Lookup();
+ };
+ Container.prototype.isBound = function (serviceIdentifier) {
+ var bound = this._bindingDictionary.hasKey(serviceIdentifier);
+ if (!bound && this.parent) {
+ bound = this.parent.isBound(serviceIdentifier);
+ }
+ return bound;
+ };
+ Container.prototype.isBoundNamed = function (serviceIdentifier, named) {
+ return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.isBoundTagged = function (serviceIdentifier, key, value) {
+ var bound = false;
+ if (this._bindingDictionary.hasKey(serviceIdentifier)) {
+ var bindings = this._bindingDictionary.get(serviceIdentifier);
+ var request_1 = planner_1.createMockRequest(this, serviceIdentifier, key, value);
+ bound = bindings.some(function (b) { return b.constraint(request_1); });
+ }
+ if (!bound && this.parent) {
+ bound = this.parent.isBoundTagged(serviceIdentifier, key, value);
+ }
+ return bound;
+ };
+ Container.prototype.snapshot = function () {
+ this._snapshots.push(container_snapshot_1.ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware));
+ };
+ Container.prototype.restore = function () {
+ var snapshot = this._snapshots.pop();
+ if (snapshot === undefined) {
+ throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);
+ }
+ this._bindingDictionary = snapshot.bindings;
+ this._middleware = snapshot.middleware;
+ };
+ Container.prototype.createChild = function (containerOptions) {
+ var child = new Container(containerOptions || this.options);
+ child.parent = this;
+ return child;
+ };
+ Container.prototype.applyMiddleware = function () {
+ var middlewares = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ middlewares[_i] = arguments[_i];
+ }
+ var initial = (this._middleware) ? this._middleware : this._planAndResolve();
+ this._middleware = middlewares.reduce(function (prev, curr) { return curr(prev); }, initial);
+ };
+ Container.prototype.applyCustomMetadataReader = function (metadataReader) {
+ this._metadataReader = metadataReader;
+ };
+ Container.prototype.get = function (serviceIdentifier) {
+ return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getNamed = function (serviceIdentifier, named) {
+ return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.getAll = function (serviceIdentifier) {
+ return this._get(true, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getAllTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getAllNamed = function (serviceIdentifier, named) {
+ return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.resolve = function (constructorFunction) {
+ var tempContainer = this.createChild();
+ tempContainer.bind(constructorFunction).toSelf();
+ return tempContainer.get(constructorFunction);
+ };
+ Container.prototype._getContainerModuleHelpersFactory = function () {
+ var _this = this;
+ var setModuleId = function (bindingToSyntax, moduleId) {
+ bindingToSyntax._binding.moduleId = moduleId;
+ };
+ var getBindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _bind = _this.bind.bind(_this);
+ var bindingToSyntax = _bind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ var getUnbindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _unbind = _this.unbind.bind(_this);
+ _unbind(serviceIdentifier);
+ };
+ };
+ var getIsboundFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _isBound = _this.isBound.bind(_this);
+ return _isBound(serviceIdentifier);
+ };
+ };
+ var getRebindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _rebind = _this.rebind.bind(_this);
+ var bindingToSyntax = _rebind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ return function (mId) { return ({
+ bindFunction: getBindFunction(mId),
+ isboundFunction: getIsboundFunction(mId),
+ rebindFunction: getRebindFunction(mId),
+ unbindFunction: getUnbindFunction(mId)
+ }); };
+ };
+ Container.prototype._get = function (avoidConstraints, isMultiInject, targetType, serviceIdentifier, key, value) {
+ var result = null;
+ var defaultArgs = {
+ avoidConstraints: avoidConstraints,
+ contextInterceptor: function (context) { return context; },
+ isMultiInject: isMultiInject,
+ key: key,
+ serviceIdentifier: serviceIdentifier,
+ targetType: targetType,
+ value: value
+ };
+ if (this._middleware) {
+ result = this._middleware(defaultArgs);
+ if (result === undefined || result === null) {
+ throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);
+ }
+ }
+ else {
+ result = this._planAndResolve()(defaultArgs);
+ }
+ return result;
+ };
+ Container.prototype._planAndResolve = function () {
+ var _this = this;
+ return function (args) {
+ var context = planner_1.plan(_this._metadataReader, _this, args.isMultiInject, args.targetType, args.serviceIdentifier, args.key, args.value, args.avoidConstraints);
+ context = args.contextInterceptor(context);
+ var result = resolver_1.resolve(context);
+ return result;
+ };
+ };
+ return Container;
+ }());
+ exports.Container = Container;
+});
diff --git a/src/node_modules/inversify/amd/container/container_module.js b/src/node_modules/inversify/amd/container/container_module.js
new file mode 100644
index 0000000..d649bff
--- /dev/null
+++ b/src/node_modules/inversify/amd/container/container_module.js
@@ -0,0 +1,20 @@
+define(["require", "exports", "../utils/id"], function (require, exports, id_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var ContainerModule = (function () {
+ function ContainerModule(registry) {
+ this.id = id_1.id();
+ this.registry = registry;
+ }
+ return ContainerModule;
+ }());
+ exports.ContainerModule = ContainerModule;
+ var AsyncContainerModule = (function () {
+ function AsyncContainerModule(registry) {
+ this.id = id_1.id();
+ this.registry = registry;
+ }
+ return AsyncContainerModule;
+ }());
+ exports.AsyncContainerModule = AsyncContainerModule;
+});
diff --git a/src/node_modules/inversify/amd/container/container_snapshot.js b/src/node_modules/inversify/amd/container/container_snapshot.js
new file mode 100644
index 0000000..3774b44
--- /dev/null
+++ b/src/node_modules/inversify/amd/container/container_snapshot.js
@@ -0,0 +1,16 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var ContainerSnapshot = (function () {
+ function ContainerSnapshot() {
+ }
+ ContainerSnapshot.of = function (bindings, middleware) {
+ var snapshot = new ContainerSnapshot();
+ snapshot.bindings = bindings;
+ snapshot.middleware = middleware;
+ return snapshot;
+ };
+ return ContainerSnapshot;
+ }());
+ exports.ContainerSnapshot = ContainerSnapshot;
+});
diff --git a/src/node_modules/inversify/amd/container/lookup.js b/src/node_modules/inversify/amd/container/lookup.js
new file mode 100644
index 0000000..293b47c
--- /dev/null
+++ b/src/node_modules/inversify/amd/container/lookup.js
@@ -0,0 +1,80 @@
+define(["require", "exports", "../constants/error_msgs"], function (require, exports, ERROR_MSGS) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Lookup = (function () {
+ function Lookup() {
+ this._map = new Map();
+ }
+ Lookup.prototype.getMap = function () {
+ return this._map;
+ };
+ Lookup.prototype.add = function (serviceIdentifier, value) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (value === null || value === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ entry.push(value);
+ this._map.set(serviceIdentifier, entry);
+ }
+ else {
+ this._map.set(serviceIdentifier, [value]);
+ }
+ };
+ Lookup.prototype.get = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ return entry;
+ }
+ else {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.remove = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (!this._map.delete(serviceIdentifier)) {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.removeByCondition = function (condition) {
+ var _this = this;
+ this._map.forEach(function (entries, key) {
+ var updatedEntries = entries.filter(function (entry) { return !condition(entry); });
+ if (updatedEntries.length > 0) {
+ _this._map.set(key, updatedEntries);
+ }
+ else {
+ _this._map.delete(key);
+ }
+ });
+ };
+ Lookup.prototype.hasKey = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ return this._map.has(serviceIdentifier);
+ };
+ Lookup.prototype.clone = function () {
+ var copy = new Lookup();
+ this._map.forEach(function (value, key) {
+ value.forEach(function (b) { return copy.add(key, b.clone()); });
+ });
+ return copy;
+ };
+ Lookup.prototype.traverse = function (func) {
+ this._map.forEach(function (value, key) {
+ func(key, value);
+ });
+ };
+ return Lookup;
+ }());
+ exports.Lookup = Lookup;
+});
diff --git a/src/node_modules/inversify/amd/interfaces/interfaces.js b/src/node_modules/inversify/amd/interfaces/interfaces.js
new file mode 100644
index 0000000..2ae92b6
--- /dev/null
+++ b/src/node_modules/inversify/amd/interfaces/interfaces.js
@@ -0,0 +1,4 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+});
diff --git a/src/node_modules/inversify/amd/inversify.js b/src/node_modules/inversify/amd/inversify.js
new file mode 100644
index 0000000..f10d3e3
--- /dev/null
+++ b/src/node_modules/inversify/amd/inversify.js
@@ -0,0 +1,30 @@
+define(["require", "exports", "./constants/metadata_keys", "./container/container", "./constants/literal_types", "./container/container_module", "./annotation/injectable", "./annotation/tagged", "./annotation/named", "./annotation/inject", "./annotation/optional", "./annotation/unmanaged", "./annotation/multi_inject", "./annotation/target_name", "./annotation/post_construct", "./planning/metadata_reader", "./utils/id", "./annotation/decorator_utils", "./syntax/constraint_helpers", "./utils/serialization", "./utils/binding_utils"], function (require, exports, keys, container_1, literal_types_1, container_module_1, injectable_1, tagged_1, named_1, inject_1, optional_1, unmanaged_1, multi_inject_1, target_name_1, post_construct_1, metadata_reader_1, id_1, decorator_utils_1, constraint_helpers_1, serialization_1, binding_utils_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.METADATA_KEY = keys;
+ exports.Container = container_1.Container;
+ exports.BindingScopeEnum = literal_types_1.BindingScopeEnum;
+ exports.BindingTypeEnum = literal_types_1.BindingTypeEnum;
+ exports.TargetTypeEnum = literal_types_1.TargetTypeEnum;
+ exports.AsyncContainerModule = container_module_1.AsyncContainerModule;
+ exports.ContainerModule = container_module_1.ContainerModule;
+ exports.injectable = injectable_1.injectable;
+ exports.tagged = tagged_1.tagged;
+ exports.named = named_1.named;
+ exports.inject = inject_1.inject;
+ exports.LazyServiceIdentifer = inject_1.LazyServiceIdentifer;
+ exports.optional = optional_1.optional;
+ exports.unmanaged = unmanaged_1.unmanaged;
+ exports.multiInject = multi_inject_1.multiInject;
+ exports.targetName = target_name_1.targetName;
+ exports.postConstruct = post_construct_1.postConstruct;
+ exports.MetadataReader = metadata_reader_1.MetadataReader;
+ exports.id = id_1.id;
+ exports.decorate = decorator_utils_1.decorate;
+ exports.traverseAncerstors = constraint_helpers_1.traverseAncerstors;
+ exports.taggedConstraint = constraint_helpers_1.taggedConstraint;
+ exports.namedConstraint = constraint_helpers_1.namedConstraint;
+ exports.typeConstraint = constraint_helpers_1.typeConstraint;
+ exports.getServiceIdentifierAsString = serialization_1.getServiceIdentifierAsString;
+ exports.multiBindToService = binding_utils_1.multiBindToService;
+});
diff --git a/src/node_modules/inversify/amd/planning/context.js b/src/node_modules/inversify/amd/planning/context.js
new file mode 100644
index 0000000..cf2a0b5
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/context.js
@@ -0,0 +1,18 @@
+define(["require", "exports", "../utils/id"], function (require, exports, id_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Context = (function () {
+ function Context(container) {
+ this.id = id_1.id();
+ this.container = container;
+ }
+ Context.prototype.addPlan = function (plan) {
+ this.plan = plan;
+ };
+ Context.prototype.setCurrentRequest = function (currentRequest) {
+ this.currentRequest = currentRequest;
+ };
+ return Context;
+ }());
+ exports.Context = Context;
+});
diff --git a/src/node_modules/inversify/amd/planning/metadata.js b/src/node_modules/inversify/amd/planning/metadata.js
new file mode 100644
index 0000000..a503345
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/metadata.js
@@ -0,0 +1,20 @@
+define(["require", "exports", "../constants/metadata_keys"], function (require, exports, METADATA_KEY) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Metadata = (function () {
+ function Metadata(key, value) {
+ this.key = key;
+ this.value = value;
+ }
+ Metadata.prototype.toString = function () {
+ if (this.key === METADATA_KEY.NAMED_TAG) {
+ return "named: " + this.value.toString() + " ";
+ }
+ else {
+ return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }";
+ }
+ };
+ return Metadata;
+ }());
+ exports.Metadata = Metadata;
+});
diff --git a/src/node_modules/inversify/amd/planning/metadata_reader.js b/src/node_modules/inversify/amd/planning/metadata_reader.js
new file mode 100644
index 0000000..f6bb8e7
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/metadata_reader.js
@@ -0,0 +1,22 @@
+define(["require", "exports", "../constants/metadata_keys"], function (require, exports, METADATA_KEY) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var MetadataReader = (function () {
+ function MetadataReader() {
+ }
+ MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {
+ var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc);
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);
+ return {
+ compilerGeneratedMetadata: compilerGeneratedMetadata,
+ userGeneratedMetadata: userGeneratedMetadata || {}
+ };
+ };
+ MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) {
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || [];
+ return userGeneratedMetadata;
+ };
+ return MetadataReader;
+ }());
+ exports.MetadataReader = MetadataReader;
+});
diff --git a/src/node_modules/inversify/amd/planning/plan.js b/src/node_modules/inversify/amd/planning/plan.js
new file mode 100644
index 0000000..2c8cae3
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/plan.js
@@ -0,0 +1,12 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Plan = (function () {
+ function Plan(parentContext, rootRequest) {
+ this.parentContext = parentContext;
+ this.rootRequest = rootRequest;
+ }
+ return Plan;
+ }());
+ exports.Plan = Plan;
+});
diff --git a/src/node_modules/inversify/amd/planning/planner.js b/src/node_modules/inversify/amd/planning/planner.js
new file mode 100644
index 0000000..7e0f5ce
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/planner.js
@@ -0,0 +1,145 @@
+define(["require", "exports", "../bindings/binding_count", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys", "../utils/exceptions", "../utils/serialization", "./context", "./metadata", "./plan", "./reflection_utils", "./request", "./target"], function (require, exports, binding_count_1, ERROR_MSGS, literal_types_1, METADATA_KEY, exceptions_1, serialization_1, context_1, metadata_1, plan_1, reflection_utils_1, request_1, target_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function getBindingDictionary(cntnr) {
+ return cntnr._bindingDictionary;
+ }
+ exports.getBindingDictionary = getBindingDictionary;
+ function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
+ var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;
+ var injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier);
+ var target = new target_1.Target(targetType, name, serviceIdentifier, injectMetadata);
+ if (key !== undefined) {
+ var tagMetadata = new metadata_1.Metadata(key, value);
+ target.metadata.push(tagMetadata);
+ }
+ return target;
+ }
+ function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {
+ var bindings = getBindings(context.container, target.serviceIdentifier);
+ var activeBindings = [];
+ if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&
+ context.container.options.autoBindInjectable &&
+ typeof target.serviceIdentifier === "function" &&
+ metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {
+ context.container.bind(target.serviceIdentifier).toSelf();
+ bindings = getBindings(context.container, target.serviceIdentifier);
+ }
+ if (!avoidConstraints) {
+ activeBindings = bindings.filter(function (binding) {
+ var request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target);
+ return binding.constraint(request);
+ });
+ }
+ else {
+ activeBindings = bindings;
+ }
+ _validateActiveBindingCount(target.serviceIdentifier, activeBindings, target, context.container);
+ return activeBindings;
+ }
+ function _validateActiveBindingCount(serviceIdentifier, bindings, target, container) {
+ switch (bindings.length) {
+ case binding_count_1.BindingCount.NoBindingsAvailable:
+ if (target.isOptional()) {
+ return bindings;
+ }
+ else {
+ var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.NOT_REGISTERED;
+ msg += serialization_1.listMetadataForTarget(serviceIdentifierString, target);
+ msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ case binding_count_1.BindingCount.OnlyOneBindingAvailable:
+ if (!target.isArray()) {
+ return bindings;
+ }
+ case binding_count_1.BindingCount.MultipleBindingsAvailable:
+ default:
+ if (!target.isArray()) {
+ var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.AMBIGUOUS_MATCH + " " + serviceIdentifierString;
+ msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ else {
+ return bindings;
+ }
+ }
+ }
+ function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {
+ var activeBindings;
+ var childRequest;
+ if (parentRequest === null) {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);
+ childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target);
+ var thePlan = new plan_1.Plan(context, childRequest);
+ context.addPlan(thePlan);
+ }
+ else {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);
+ childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);
+ }
+ activeBindings.forEach(function (binding) {
+ var subChildRequest = null;
+ if (target.isArray()) {
+ subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);
+ }
+ else {
+ if (binding.cache) {
+ return;
+ }
+ subChildRequest = childRequest;
+ }
+ if (binding.type === literal_types_1.BindingTypeEnum.Instance && binding.implementationType !== null) {
+ var dependencies = reflection_utils_1.getDependencies(metadataReader, binding.implementationType);
+ if (!context.container.options.skipBaseClassChecks) {
+ var baseClassDependencyCount = reflection_utils_1.getBaseClassDependencyCount(metadataReader, binding.implementationType);
+ if (dependencies.length < baseClassDependencyCount) {
+ var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(reflection_utils_1.getFunctionName(binding.implementationType));
+ throw new Error(error);
+ }
+ }
+ dependencies.forEach(function (dependency) {
+ _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);
+ });
+ }
+ });
+ }
+ function getBindings(container, serviceIdentifier) {
+ var bindings = [];
+ var bindingDictionary = getBindingDictionary(container);
+ if (bindingDictionary.hasKey(serviceIdentifier)) {
+ bindings = bindingDictionary.get(serviceIdentifier);
+ }
+ else if (container.parent !== null) {
+ bindings = getBindings(container.parent, serviceIdentifier);
+ }
+ return bindings;
+ }
+ function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
+ if (avoidConstraints === void 0) { avoidConstraints = false; }
+ var context = new context_1.Context(container);
+ var target = _createTarget(isMultiInject, targetType, serviceIdentifier, "", key, value);
+ try {
+ _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
+ return context;
+ }
+ catch (error) {
+ if (exceptions_1.isStackOverflowExeption(error)) {
+ if (context.plan) {
+ serialization_1.circularDependencyToException(context.plan.rootRequest);
+ }
+ }
+ throw error;
+ }
+ }
+ exports.plan = plan;
+ function createMockRequest(container, serviceIdentifier, key, value) {
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, "", serviceIdentifier, new metadata_1.Metadata(key, value));
+ var context = new context_1.Context(container);
+ var request = new request_1.Request(serviceIdentifier, context, null, [], target);
+ return request;
+ }
+ exports.createMockRequest = createMockRequest;
+});
diff --git a/src/node_modules/inversify/amd/planning/queryable_string.js b/src/node_modules/inversify/amd/planning/queryable_string.js
new file mode 100644
index 0000000..dd9aad9
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/queryable_string.js
@@ -0,0 +1,29 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var QueryableString = (function () {
+ function QueryableString(str) {
+ this.str = str;
+ }
+ QueryableString.prototype.startsWith = function (searchString) {
+ return this.str.indexOf(searchString) === 0;
+ };
+ QueryableString.prototype.endsWith = function (searchString) {
+ var reverseString = "";
+ var reverseSearchString = searchString.split("").reverse().join("");
+ reverseString = this.str.split("").reverse().join("");
+ return this.startsWith.call({ str: reverseString }, reverseSearchString);
+ };
+ QueryableString.prototype.contains = function (searchString) {
+ return (this.str.indexOf(searchString) !== -1);
+ };
+ QueryableString.prototype.equals = function (compareString) {
+ return this.str === compareString;
+ };
+ QueryableString.prototype.value = function () {
+ return this.str;
+ };
+ return QueryableString;
+ }());
+ exports.QueryableString = QueryableString;
+});
diff --git a/src/node_modules/inversify/amd/planning/reflection_utils.js b/src/node_modules/inversify/amd/planning/reflection_utils.js
new file mode 100644
index 0000000..1381ec6
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/reflection_utils.js
@@ -0,0 +1,120 @@
+define(["require", "exports", "../annotation/inject", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys", "../utils/serialization", "./target"], function (require, exports, inject_1, ERROR_MSGS, literal_types_1, METADATA_KEY, serialization_1, target_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.getFunctionName = serialization_1.getFunctionName;
+ function getDependencies(metadataReader, func) {
+ var constructorName = serialization_1.getFunctionName(func);
+ var targets = getTargets(metadataReader, constructorName, func, false);
+ return targets;
+ }
+ exports.getDependencies = getDependencies;
+ function getTargets(metadataReader, constructorName, func, isBaseClass) {
+ var metadata = metadataReader.getConstructorMetadata(func);
+ var serviceIdentifiers = metadata.compilerGeneratedMetadata;
+ if (serviceIdentifiers === undefined) {
+ var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION + " " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var constructorArgsMetadata = metadata.userGeneratedMetadata;
+ var keys = Object.keys(constructorArgsMetadata);
+ var hasUserDeclaredUnknownInjections = (func.length === 0 && keys.length > 0);
+ var iterations = (hasUserDeclaredUnknownInjections) ? keys.length : func.length;
+ var constructorTargets = getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations);
+ var propertyTargets = getClassPropsAsTargets(metadataReader, func);
+ var targets = constructorTargets.concat(propertyTargets);
+ return targets;
+ }
+ function getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata) {
+ var targetMetadata = constructorArgsMetadata[index.toString()] || [];
+ var metadata = formatTargetMetadata(targetMetadata);
+ var isManaged = metadata.unmanaged !== true;
+ var serviceIdentifier = serviceIdentifiers[index];
+ var injectIdentifier = (metadata.inject || metadata.multiInject);
+ serviceIdentifier = (injectIdentifier) ? (injectIdentifier) : serviceIdentifier;
+ if (serviceIdentifier instanceof inject_1.LazyServiceIdentifer) {
+ serviceIdentifier = serviceIdentifier.unwrap();
+ }
+ if (isManaged) {
+ var isObject = serviceIdentifier === Object;
+ var isFunction = serviceIdentifier === Function;
+ var isUndefined = serviceIdentifier === undefined;
+ var isUnknownType = (isObject || isFunction || isUndefined);
+ if (!isBaseClass && isUnknownType) {
+ var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION + " argument " + index + " in class " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ return target;
+ }
+ return null;
+ }
+ function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations) {
+ var targets = [];
+ for (var i = 0; i < iterations; i++) {
+ var index = i;
+ var target = getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata);
+ if (target !== null) {
+ targets.push(target);
+ }
+ }
+ return targets;
+ }
+ function getClassPropsAsTargets(metadataReader, constructorFunc) {
+ var classPropsMetadata = metadataReader.getPropertiesMetadata(constructorFunc);
+ var targets = [];
+ var keys = Object.keys(classPropsMetadata);
+ for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
+ var key = keys_1[_i];
+ var targetMetadata = classPropsMetadata[key];
+ var metadata = formatTargetMetadata(classPropsMetadata[key]);
+ var targetName = metadata.targetName || key;
+ var serviceIdentifier = (metadata.inject || metadata.multiInject);
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.ClassProperty, targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ targets.push(target);
+ }
+ var baseConstructor = Object.getPrototypeOf(constructorFunc.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseTargets = getClassPropsAsTargets(metadataReader, baseConstructor);
+ targets = targets.concat(baseTargets);
+ }
+ return targets;
+ }
+ function getBaseClassDependencyCount(metadataReader, func) {
+ var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseConstructorName = serialization_1.getFunctionName(baseConstructor);
+ var targets = getTargets(metadataReader, baseConstructorName, baseConstructor, true);
+ var metadata = targets.map(function (t) {
+ return t.metadata.filter(function (m) {
+ return m.key === METADATA_KEY.UNMANAGED_TAG;
+ });
+ });
+ var unmanagedCount = [].concat.apply([], metadata).length;
+ var dependencyCount = targets.length - unmanagedCount;
+ if (dependencyCount > 0) {
+ return dependencyCount;
+ }
+ else {
+ return getBaseClassDependencyCount(metadataReader, baseConstructor);
+ }
+ }
+ else {
+ return 0;
+ }
+ }
+ exports.getBaseClassDependencyCount = getBaseClassDependencyCount;
+ function formatTargetMetadata(targetMetadata) {
+ var targetMetadataMap = {};
+ targetMetadata.forEach(function (m) {
+ targetMetadataMap[m.key.toString()] = m.value;
+ });
+ return {
+ inject: targetMetadataMap[METADATA_KEY.INJECT_TAG],
+ multiInject: targetMetadataMap[METADATA_KEY.MULTI_INJECT_TAG],
+ targetName: targetMetadataMap[METADATA_KEY.NAME_TAG],
+ unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG]
+ };
+ }
+});
diff --git a/src/node_modules/inversify/amd/planning/request.js b/src/node_modules/inversify/amd/planning/request.js
new file mode 100644
index 0000000..ee8c396
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/request.js
@@ -0,0 +1,25 @@
+define(["require", "exports", "../utils/id"], function (require, exports, id_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Request = (function () {
+ function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
+ this.id = id_1.id();
+ this.serviceIdentifier = serviceIdentifier;
+ this.parentContext = parentContext;
+ this.parentRequest = parentRequest;
+ this.target = target;
+ this.childRequests = [];
+ this.bindings = (Array.isArray(bindings) ? bindings : [bindings]);
+ this.requestScope = parentRequest === null
+ ? new Map()
+ : null;
+ }
+ Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
+ var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
+ this.childRequests.push(child);
+ return child;
+ };
+ return Request;
+ }());
+ exports.Request = Request;
+});
diff --git a/src/node_modules/inversify/amd/planning/target.js b/src/node_modules/inversify/amd/planning/target.js
new file mode 100644
index 0000000..f0b2488
--- /dev/null
+++ b/src/node_modules/inversify/amd/planning/target.js
@@ -0,0 +1,88 @@
+define(["require", "exports", "../constants/metadata_keys", "../utils/id", "./metadata", "./queryable_string"], function (require, exports, METADATA_KEY, id_1, metadata_1, queryable_string_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var Target = (function () {
+ function Target(type, name, serviceIdentifier, namedOrTagged) {
+ this.id = id_1.id();
+ this.type = type;
+ this.serviceIdentifier = serviceIdentifier;
+ this.name = new queryable_string_1.QueryableString(name || "");
+ this.metadata = new Array();
+ var metadataItem = null;
+ if (typeof namedOrTagged === "string") {
+ metadataItem = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);
+ }
+ else if (namedOrTagged instanceof metadata_1.Metadata) {
+ metadataItem = namedOrTagged;
+ }
+ if (metadataItem !== null) {
+ this.metadata.push(metadataItem);
+ }
+ }
+ Target.prototype.hasTag = function (key) {
+ for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key) {
+ return true;
+ }
+ }
+ return false;
+ };
+ Target.prototype.isArray = function () {
+ return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);
+ };
+ Target.prototype.matchesArray = function (name) {
+ return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);
+ };
+ Target.prototype.isNamed = function () {
+ return this.hasTag(METADATA_KEY.NAMED_TAG);
+ };
+ Target.prototype.isTagged = function () {
+ return this.metadata.some(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ };
+ Target.prototype.isOptional = function () {
+ return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);
+ };
+ Target.prototype.getNamedTag = function () {
+ if (this.isNamed()) {
+ return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];
+ }
+ return null;
+ };
+ Target.prototype.getCustomTags = function () {
+ if (this.isTagged()) {
+ return this.metadata.filter(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ }
+ return null;
+ };
+ Target.prototype.matchesNamedTag = function (name) {
+ return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);
+ };
+ Target.prototype.matchesTag = function (key) {
+ var _this = this;
+ return function (value) {
+ for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key && m.value === value) {
+ return true;
+ }
+ }
+ return false;
+ };
+ };
+ return Target;
+ }());
+ exports.Target = Target;
+});
diff --git a/src/node_modules/inversify/amd/resolution/instantiation.js b/src/node_modules/inversify/amd/resolution/instantiation.js
new file mode 100644
index 0000000..f7b10bb
--- /dev/null
+++ b/src/node_modules/inversify/amd/resolution/instantiation.js
@@ -0,0 +1,49 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/literal_types", "../constants/metadata_keys"], function (require, exports, error_msgs_1, literal_types_1, METADATA_KEY) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function _injectProperties(instance, childRequests, resolveRequest) {
+ var propertyInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null &&
+ childRequest.target.type === literal_types_1.TargetTypeEnum.ClassProperty);
+ });
+ var propertyInjections = propertyInjectionsRequests.map(resolveRequest);
+ propertyInjectionsRequests.forEach(function (r, index) {
+ var propertyName = "";
+ propertyName = r.target.name.value();
+ var injection = propertyInjections[index];
+ instance[propertyName] = injection;
+ });
+ return instance;
+ }
+ function _createInstance(Func, injections) {
+ return new (Func.bind.apply(Func, [void 0].concat(injections)))();
+ }
+ function _postConstruct(constr, result) {
+ if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
+ var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
+ try {
+ result[data.value]();
+ }
+ catch (e) {
+ throw new Error(error_msgs_1.POST_CONSTRUCT_ERROR(constr.name, e.message));
+ }
+ }
+ }
+ function resolveInstance(constr, childRequests, resolveRequest) {
+ var result = null;
+ if (childRequests.length > 0) {
+ var constructorInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null && childRequest.target.type === literal_types_1.TargetTypeEnum.ConstructorArgument);
+ });
+ var constructorInjections = constructorInjectionsRequests.map(resolveRequest);
+ result = _createInstance(constr, constructorInjections);
+ result = _injectProperties(result, childRequests, resolveRequest);
+ }
+ else {
+ result = new constr();
+ }
+ _postConstruct(constr, result);
+ return result;
+ }
+ exports.resolveInstance = resolveInstance;
+});
diff --git a/src/node_modules/inversify/amd/resolution/resolver.js b/src/node_modules/inversify/amd/resolution/resolver.js
new file mode 100644
index 0000000..6551d5b
--- /dev/null
+++ b/src/node_modules/inversify/amd/resolution/resolver.js
@@ -0,0 +1,95 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/literal_types", "../utils/exceptions", "../utils/serialization", "./instantiation"], function (require, exports, ERROR_MSGS, literal_types_1, exceptions_1, serialization_1, instantiation_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var invokeFactory = function (factoryType, serviceIdentifier, fn) {
+ try {
+ return fn();
+ }
+ catch (error) {
+ if (exceptions_1.isStackOverflowExeption(error)) {
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryType, serviceIdentifier.toString()));
+ }
+ else {
+ throw error;
+ }
+ }
+ };
+ var _resolveRequest = function (requestScope) {
+ return function (request) {
+ request.parentContext.setCurrentRequest(request);
+ var bindings = request.bindings;
+ var childRequests = request.childRequests;
+ var targetIsAnArray = request.target && request.target.isArray();
+ var targetParentIsNotAnArray = !request.parentRequest ||
+ !request.parentRequest.target ||
+ !request.target ||
+ !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);
+ if (targetIsAnArray && targetParentIsNotAnArray) {
+ return childRequests.map(function (childRequest) {
+ var _f = _resolveRequest(requestScope);
+ return _f(childRequest);
+ });
+ }
+ else {
+ var result = null;
+ if (request.target.isOptional() && bindings.length === 0) {
+ return undefined;
+ }
+ var binding_1 = bindings[0];
+ var isSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Singleton;
+ var isRequestSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Request;
+ if (isSingleton && binding_1.activated) {
+ return binding_1.cache;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ requestScope.has(binding_1.id)) {
+ return requestScope.get(binding_1.id);
+ }
+ if (binding_1.type === literal_types_1.BindingTypeEnum.ConstantValue) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Function) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Constructor) {
+ result = binding_1.implementationType;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.DynamicValue && binding_1.dynamicValue !== null) {
+ result = invokeFactory("toDynamicValue", binding_1.serviceIdentifier, function () { return binding_1.dynamicValue(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Factory && binding_1.factory !== null) {
+ result = invokeFactory("toFactory", binding_1.serviceIdentifier, function () { return binding_1.factory(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Provider && binding_1.provider !== null) {
+ result = invokeFactory("toProvider", binding_1.serviceIdentifier, function () { return binding_1.provider(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Instance && binding_1.implementationType !== null) {
+ result = instantiation_1.resolveInstance(binding_1.implementationType, childRequests, _resolveRequest(requestScope));
+ }
+ else {
+ var serviceIdentifier = serialization_1.getServiceIdentifierAsString(request.serviceIdentifier);
+ throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + " " + serviceIdentifier);
+ }
+ if (typeof binding_1.onActivation === "function") {
+ result = binding_1.onActivation(request.parentContext, result);
+ }
+ if (isSingleton) {
+ binding_1.cache = result;
+ binding_1.activated = true;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ !requestScope.has(binding_1.id)) {
+ requestScope.set(binding_1.id, result);
+ }
+ return result;
+ }
+ };
+ };
+ function resolve(context) {
+ var _f = _resolveRequest(context.plan.rootRequest.requestScope);
+ return _f(context.plan.rootRequest);
+ }
+ exports.resolve = resolve;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_in_syntax.js b/src/node_modules/inversify/amd/syntax/binding_in_syntax.js
new file mode 100644
index 0000000..eb25c8f
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_in_syntax.js
@@ -0,0 +1,23 @@
+define(["require", "exports", "../constants/literal_types", "./binding_when_on_syntax"], function (require, exports, literal_types_1, binding_when_on_syntax_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingInSyntax = (function () {
+ function BindingInSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingInSyntax.prototype.inRequestScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Request;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inSingletonScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inTransientScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Transient;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ return BindingInSyntax;
+ }());
+ exports.BindingInSyntax = BindingInSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_in_when_on_syntax.js b/src/node_modules/inversify/amd/syntax/binding_in_when_on_syntax.js
new file mode 100644
index 0000000..0e16a7f
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_in_when_on_syntax.js
@@ -0,0 +1,71 @@
+define(["require", "exports", "./binding_in_syntax", "./binding_on_syntax", "./binding_when_syntax"], function (require, exports, binding_in_syntax_1, binding_on_syntax_1, binding_when_syntax_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingInWhenOnSyntax = (function () {
+ function BindingInWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ this._bindingInSyntax = new binding_in_syntax_1.BindingInSyntax(binding);
+ }
+ BindingInWhenOnSyntax.prototype.inRequestScope = function () {
+ return this._bindingInSyntax.inRequestScope();
+ };
+ BindingInWhenOnSyntax.prototype.inSingletonScope = function () {
+ return this._bindingInSyntax.inSingletonScope();
+ };
+ BindingInWhenOnSyntax.prototype.inTransientScope = function () {
+ return this._bindingInSyntax.inTransientScope();
+ };
+ BindingInWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingInWhenOnSyntax;
+ }());
+ exports.BindingInWhenOnSyntax = BindingInWhenOnSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_on_syntax.js b/src/node_modules/inversify/amd/syntax/binding_on_syntax.js
new file mode 100644
index 0000000..fc6b518
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_on_syntax.js
@@ -0,0 +1,15 @@
+define(["require", "exports", "./binding_when_syntax"], function (require, exports, binding_when_syntax_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingOnSyntax = (function () {
+ function BindingOnSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingOnSyntax.prototype.onActivation = function (handler) {
+ this._binding.onActivation = handler;
+ return new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ };
+ return BindingOnSyntax;
+ }());
+ exports.BindingOnSyntax = BindingOnSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_to_syntax.js b/src/node_modules/inversify/amd/syntax/binding_to_syntax.js
new file mode 100644
index 0000000..b6e08f5
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_to_syntax.js
@@ -0,0 +1,71 @@
+define(["require", "exports", "../constants/error_msgs", "../constants/literal_types", "./binding_in_when_on_syntax", "./binding_when_on_syntax"], function (require, exports, ERROR_MSGS, literal_types_1, binding_in_when_on_syntax_1, binding_when_on_syntax_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingToSyntax = (function () {
+ function BindingToSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingToSyntax.prototype.to = function (constructor) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Instance;
+ this._binding.implementationType = constructor;
+ return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toSelf = function () {
+ if (typeof this._binding.serviceIdentifier !== "function") {
+ throw new Error("" + ERROR_MSGS.INVALID_TO_SELF_VALUE);
+ }
+ var self = this._binding.serviceIdentifier;
+ return this.to(self);
+ };
+ BindingToSyntax.prototype.toConstantValue = function (value) {
+ this._binding.type = literal_types_1.BindingTypeEnum.ConstantValue;
+ this._binding.cache = value;
+ this._binding.dynamicValue = null;
+ this._binding.implementationType = null;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toDynamicValue = function (func) {
+ this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue;
+ this._binding.cache = null;
+ this._binding.dynamicValue = func;
+ this._binding.implementationType = null;
+ return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toConstructor = function (constructor) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Constructor;
+ this._binding.implementationType = constructor;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFactory = function (factory) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Factory;
+ this._binding.factory = factory;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFunction = function (func) {
+ if (typeof func !== "function") {
+ throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);
+ }
+ var bindingWhenOnSyntax = this.toConstantValue(func);
+ this._binding.type = literal_types_1.BindingTypeEnum.Function;
+ return bindingWhenOnSyntax;
+ };
+ BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Factory;
+ this._binding.factory = function (context) {
+ var autofactory = function () { return context.container.get(serviceIdentifier); };
+ return autofactory;
+ };
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toProvider = function (provider) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Provider;
+ this._binding.provider = provider;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toService = function (service) {
+ this.toDynamicValue(function (context) { return context.container.get(service); });
+ };
+ return BindingToSyntax;
+ }());
+ exports.BindingToSyntax = BindingToSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_when_on_syntax.js b/src/node_modules/inversify/amd/syntax/binding_when_on_syntax.js
new file mode 100644
index 0000000..d811eeb
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_when_on_syntax.js
@@ -0,0 +1,61 @@
+define(["require", "exports", "./binding_on_syntax", "./binding_when_syntax"], function (require, exports, binding_on_syntax_1, binding_when_syntax_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingWhenOnSyntax = (function () {
+ function BindingWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ }
+ BindingWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingWhenOnSyntax;
+ }());
+ exports.BindingWhenOnSyntax = BindingWhenOnSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/binding_when_syntax.js b/src/node_modules/inversify/amd/syntax/binding_when_syntax.js
new file mode 100644
index 0000000..e1dbe97
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/binding_when_syntax.js
@@ -0,0 +1,98 @@
+define(["require", "exports", "./binding_on_syntax", "./constraint_helpers"], function (require, exports, binding_on_syntax_1, constraint_helpers_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var BindingWhenSyntax = (function () {
+ function BindingWhenSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingWhenSyntax.prototype.when = function (constraint) {
+ this._binding.constraint = constraint;
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetNamed = function (name) {
+ this._binding.constraint = constraint_helpers_1.namedConstraint(name);
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetIsDefault = function () {
+ this._binding.constraint = function (request) {
+ var targetIsDefault = (request.target !== null) &&
+ (!request.target.isNamed()) &&
+ (!request.target.isTagged());
+ return targetIsDefault;
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetTagged = function (tag, value) {
+ this._binding.constraint = constraint_helpers_1.taggedConstraint(tag)(value);
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenInjectedInto = function (parent) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.typeConstraint(parent)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.namedConstraint(name)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.taggedConstraint(tag)(value)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ return BindingWhenSyntax;
+ }());
+ exports.BindingWhenSyntax = BindingWhenSyntax;
+});
diff --git a/src/node_modules/inversify/amd/syntax/constraint_helpers.js b/src/node_modules/inversify/amd/syntax/constraint_helpers.js
new file mode 100644
index 0000000..e745a44
--- /dev/null
+++ b/src/node_modules/inversify/amd/syntax/constraint_helpers.js
@@ -0,0 +1,40 @@
+define(["require", "exports", "../constants/metadata_keys", "../planning/metadata"], function (require, exports, METADATA_KEY, metadata_1) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var traverseAncerstors = function (request, constraint) {
+ var parent = request.parentRequest;
+ if (parent !== null) {
+ return constraint(parent) ? true : traverseAncerstors(parent, constraint);
+ }
+ else {
+ return false;
+ }
+ };
+ exports.traverseAncerstors = traverseAncerstors;
+ var taggedConstraint = function (key) { return function (value) {
+ var constraint = function (request) {
+ return request !== null && request.target !== null && request.target.matchesTag(key)(value);
+ };
+ constraint.metaData = new metadata_1.Metadata(key, value);
+ return constraint;
+ }; };
+ exports.taggedConstraint = taggedConstraint;
+ var namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG);
+ exports.namedConstraint = namedConstraint;
+ var typeConstraint = function (type) { return function (request) {
+ var binding = null;
+ if (request !== null) {
+ binding = request.bindings[0];
+ if (typeof type === "string") {
+ var serviceIdentifier = binding.serviceIdentifier;
+ return serviceIdentifier === type;
+ }
+ else {
+ var constructor = request.bindings[0].implementationType;
+ return type === constructor;
+ }
+ }
+ return false;
+ }; };
+ exports.typeConstraint = typeConstraint;
+});
diff --git a/src/node_modules/inversify/amd/utils/binding_utils.js b/src/node_modules/inversify/amd/utils/binding_utils.js
new file mode 100644
index 0000000..b1823ce
--- /dev/null
+++ b/src/node_modules/inversify/amd/utils/binding_utils.js
@@ -0,0 +1,15 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ exports.multiBindToService = function (container) {
+ return function (service) {
+ return function () {
+ var types = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ types[_i] = arguments[_i];
+ }
+ return types.forEach(function (t) { return container.bind(t).toService(service); });
+ };
+ };
+ };
+});
diff --git a/src/node_modules/inversify/amd/utils/exceptions.js b/src/node_modules/inversify/amd/utils/exceptions.js
new file mode 100644
index 0000000..a3ea586
--- /dev/null
+++ b/src/node_modules/inversify/amd/utils/exceptions.js
@@ -0,0 +1,9 @@
+define(["require", "exports", "../constants/error_msgs"], function (require, exports, ERROR_MSGS) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function isStackOverflowExeption(error) {
+ return (error instanceof RangeError ||
+ error.message === ERROR_MSGS.STACK_OVERFLOW);
+ }
+ exports.isStackOverflowExeption = isStackOverflowExeption;
+});
diff --git a/src/node_modules/inversify/amd/utils/id.js b/src/node_modules/inversify/amd/utils/id.js
new file mode 100644
index 0000000..f7d0fba
--- /dev/null
+++ b/src/node_modules/inversify/amd/utils/id.js
@@ -0,0 +1,9 @@
+define(["require", "exports"], function (require, exports) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ var idCounter = 0;
+ function id() {
+ return idCounter++;
+ }
+ exports.id = id;
+});
diff --git a/src/node_modules/inversify/amd/utils/serialization.js b/src/node_modules/inversify/amd/utils/serialization.js
new file mode 100644
index 0000000..5ae3e44
--- /dev/null
+++ b/src/node_modules/inversify/amd/utils/serialization.js
@@ -0,0 +1,104 @@
+define(["require", "exports", "../constants/error_msgs"], function (require, exports, ERROR_MSGS) {
+ "use strict";
+ Object.defineProperty(exports, "__esModule", { value: true });
+ function getServiceIdentifierAsString(serviceIdentifier) {
+ if (typeof serviceIdentifier === "function") {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier.name;
+ }
+ else if (typeof serviceIdentifier === "symbol") {
+ return serviceIdentifier.toString();
+ }
+ else {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier;
+ }
+ }
+ exports.getServiceIdentifierAsString = getServiceIdentifierAsString;
+ function listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {
+ var registeredBindingsList = "";
+ var registeredBindings = getBindings(container, serviceIdentifier);
+ if (registeredBindings.length !== 0) {
+ registeredBindingsList = "\nRegistered bindings:";
+ registeredBindings.forEach(function (binding) {
+ var name = "Object";
+ if (binding.implementationType !== null) {
+ name = getFunctionName(binding.implementationType);
+ }
+ registeredBindingsList = registeredBindingsList + "\n " + name;
+ if (binding.constraint.metaData) {
+ registeredBindingsList = registeredBindingsList + " - " + binding.constraint.metaData;
+ }
+ });
+ }
+ return registeredBindingsList;
+ }
+ exports.listRegisteredBindingsForServiceIdentifier = listRegisteredBindingsForServiceIdentifier;
+ function alreadyDependencyChain(request, serviceIdentifier) {
+ if (request.parentRequest === null) {
+ return false;
+ }
+ else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {
+ return true;
+ }
+ else {
+ return alreadyDependencyChain(request.parentRequest, serviceIdentifier);
+ }
+ }
+ function dependencyChainToString(request) {
+ function _createStringArr(req, result) {
+ if (result === void 0) { result = []; }
+ var serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);
+ result.push(serviceIdentifier);
+ if (req.parentRequest !== null) {
+ return _createStringArr(req.parentRequest, result);
+ }
+ return result;
+ }
+ var stringArr = _createStringArr(request);
+ return stringArr.reverse().join(" --> ");
+ }
+ function circularDependencyToException(request) {
+ request.childRequests.forEach(function (childRequest) {
+ if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) {
+ var services = dependencyChainToString(childRequest);
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + " " + services);
+ }
+ else {
+ circularDependencyToException(childRequest);
+ }
+ });
+ }
+ exports.circularDependencyToException = circularDependencyToException;
+ function listMetadataForTarget(serviceIdentifierString, target) {
+ if (target.isTagged() || target.isNamed()) {
+ var m_1 = "";
+ var namedTag = target.getNamedTag();
+ var otherTags = target.getCustomTags();
+ if (namedTag !== null) {
+ m_1 += namedTag.toString() + "\n";
+ }
+ if (otherTags !== null) {
+ otherTags.forEach(function (tag) {
+ m_1 += tag.toString() + "\n";
+ });
+ }
+ return " " + serviceIdentifierString + "\n " + serviceIdentifierString + " - " + m_1;
+ }
+ else {
+ return " " + serviceIdentifierString;
+ }
+ }
+ exports.listMetadataForTarget = listMetadataForTarget;
+ function getFunctionName(v) {
+ if (v.name) {
+ return v.name;
+ }
+ else {
+ var name_1 = v.toString();
+ var match = name_1.match(/^function\s*([^\s(]+)/);
+ return match ? match[1] : "Anonymous function: " + name_1;
+ }
+ }
+ exports.getFunctionName = getFunctionName;
+});
diff --git a/src/node_modules/inversify/appveyor.yml b/src/node_modules/inversify/appveyor.yml
new file mode 100644
index 0000000..b5bc452
--- /dev/null
+++ b/src/node_modules/inversify/appveyor.yml
@@ -0,0 +1,34 @@
+# AppVeyor file
+# http://www.appveyor.com/docs/appveyor-yml
+
+# Build version format
+version: "{build}"
+
+# Test against this version of Node.js
+environment:
+ NODE_ENV: test
+
+ matrix:
+ - nodejs_version: "9.3.0"
+
+build: off
+
+branches:
+ only:
+ - master
+
+install:
+ - ps: Install-Product node $env:nodejs_version
+ - npm install -g npm
+ - npm config set progress=false
+ - npm install
+
+# Fix line endings on Windows
+init:
+ - git config --global core.autocrlf true
+
+test_script:
+ # Output useful info for debugging.
+ - node --version && npm --version
+ - ps: "npm --version # PowerShell" # Pass comment to PS for easier debugging
+ - cmd: npm run test
diff --git a/src/node_modules/inversify/dts/annotation/decorator_utils.d.ts b/src/node_modules/inversify/dts/annotation/decorator_utils.d.ts
new file mode 100644
index 0000000..2ec7769
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/decorator_utils.d.ts
@@ -0,0 +1,5 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function tagParameter(annotationTarget: any, propertyName: string, parameterIndex: number, metadata: interfaces.Metadata): void;
+declare function tagProperty(annotationTarget: any, propertyName: string, metadata: interfaces.Metadata): void;
+declare function decorate(decorator: (ClassDecorator | ParameterDecorator | MethodDecorator), target: any, parameterIndex?: number | string): void;
+export { decorate, tagParameter, tagProperty };
diff --git a/src/node_modules/inversify/dts/annotation/inject.d.ts b/src/node_modules/inversify/dts/annotation/inject.d.ts
new file mode 100644
index 0000000..86bc6f2
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/inject.d.ts
@@ -0,0 +1,9 @@
+import { interfaces } from "../interfaces/interfaces";
+export declare type ServiceIdentifierOrFunc = interfaces.ServiceIdentifier<any> | LazyServiceIdentifer;
+export declare class LazyServiceIdentifer<T = any> {
+ private _cb;
+ constructor(cb: () => interfaces.ServiceIdentifier<T>);
+ unwrap(): string | symbol | interfaces.Newable<T> | interfaces.Abstract<T>;
+}
+declare function inject(serviceIdentifier: ServiceIdentifierOrFunc): (target: any, targetKey: string, index?: number | undefined) => void;
+export { inject };
diff --git a/src/node_modules/inversify/dts/annotation/injectable.d.ts b/src/node_modules/inversify/dts/annotation/injectable.d.ts
new file mode 100644
index 0000000..d679438
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/injectable.d.ts
@@ -0,0 +1,2 @@
+declare function injectable(): (target: any) => any;
+export { injectable };
diff --git a/src/node_modules/inversify/dts/annotation/multi_inject.d.ts b/src/node_modules/inversify/dts/annotation/multi_inject.d.ts
new file mode 100644
index 0000000..362014f
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/multi_inject.d.ts
@@ -0,0 +1,3 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function multiInject(serviceIdentifier: interfaces.ServiceIdentifier<any>): (target: any, targetKey: string, index?: number | undefined) => void;
+export { multiInject };
diff --git a/src/node_modules/inversify/dts/annotation/named.d.ts b/src/node_modules/inversify/dts/annotation/named.d.ts
new file mode 100644
index 0000000..9278743
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/named.d.ts
@@ -0,0 +1,2 @@
+declare function named(name: string | number | symbol): (target: any, targetKey: string, index?: number | undefined) => void;
+export { named };
diff --git a/src/node_modules/inversify/dts/annotation/optional.d.ts b/src/node_modules/inversify/dts/annotation/optional.d.ts
new file mode 100644
index 0000000..ff6a04b
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/optional.d.ts
@@ -0,0 +1,2 @@
+declare function optional(): (target: any, targetKey: string, index?: number | undefined) => void;
+export { optional };
diff --git a/src/node_modules/inversify/dts/annotation/post_construct.d.ts b/src/node_modules/inversify/dts/annotation/post_construct.d.ts
new file mode 100644
index 0000000..cba8035
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/post_construct.d.ts
@@ -0,0 +1,2 @@
+declare function postConstruct(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
+export { postConstruct };
diff --git a/src/node_modules/inversify/dts/annotation/tagged.d.ts b/src/node_modules/inversify/dts/annotation/tagged.d.ts
new file mode 100644
index 0000000..34aed65
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/tagged.d.ts
@@ -0,0 +1,2 @@
+declare function tagged(metadataKey: string | number | symbol, metadataValue: any): (target: any, targetKey: string, index?: number | undefined) => void;
+export { tagged };
diff --git a/src/node_modules/inversify/dts/annotation/target_name.d.ts b/src/node_modules/inversify/dts/annotation/target_name.d.ts
new file mode 100644
index 0000000..2edf0b9
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/target_name.d.ts
@@ -0,0 +1,2 @@
+declare function targetName(name: string): (target: any, targetKey: string, index: number) => void;
+export { targetName };
diff --git a/src/node_modules/inversify/dts/annotation/unmanaged.d.ts b/src/node_modules/inversify/dts/annotation/unmanaged.d.ts
new file mode 100644
index 0000000..4f7879f
--- /dev/null
+++ b/src/node_modules/inversify/dts/annotation/unmanaged.d.ts
@@ -0,0 +1,2 @@
+declare function unmanaged(): (target: any, targetKey: string, index: number) => void;
+export { unmanaged };
diff --git a/src/node_modules/inversify/dts/bindings/binding.d.ts b/src/node_modules/inversify/dts/bindings/binding.d.ts
new file mode 100644
index 0000000..b065c21
--- /dev/null
+++ b/src/node_modules/inversify/dts/bindings/binding.d.ts
@@ -0,0 +1,19 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Binding<T> implements interfaces.Binding<T> {
+ id: number;
+ moduleId: string;
+ activated: boolean;
+ serviceIdentifier: interfaces.ServiceIdentifier<T>;
+ implementationType: interfaces.Newable<T> | null;
+ cache: T | null;
+ dynamicValue: ((context: interfaces.Context) => T) | null;
+ scope: interfaces.BindingScope;
+ type: interfaces.BindingType;
+ factory: interfaces.FactoryCreator<T> | null;
+ provider: interfaces.ProviderCreator<T> | null;
+ constraint: (request: interfaces.Request) => boolean;
+ onActivation: ((context: interfaces.Context, injectable: T) => T) | null;
+ constructor(serviceIdentifier: interfaces.ServiceIdentifier<T>, scope: interfaces.BindingScope);
+ clone(): interfaces.Binding<T>;
+}
+export { Binding };
diff --git a/src/node_modules/inversify/dts/bindings/binding_count.d.ts b/src/node_modules/inversify/dts/bindings/binding_count.d.ts
new file mode 100644
index 0000000..9a872a3
--- /dev/null
+++ b/src/node_modules/inversify/dts/bindings/binding_count.d.ts
@@ -0,0 +1,6 @@
+declare const BindingCount: {
+ MultipleBindingsAvailable: number;
+ NoBindingsAvailable: number;
+ OnlyOneBindingAvailable: number;
+};
+export { BindingCount };
diff --git a/src/node_modules/inversify/dts/constants/error_msgs.d.ts b/src/node_modules/inversify/dts/constants/error_msgs.d.ts
new file mode 100644
index 0000000..81d3c82
--- /dev/null
+++ b/src/node_modules/inversify/dts/constants/error_msgs.d.ts
@@ -0,0 +1,27 @@
+export declare const DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
+export declare const DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
+export declare const NULL_ARGUMENT = "NULL argument";
+export declare const KEY_NOT_FOUND = "Key Not Found";
+export declare const AMBIGUOUS_MATCH = "Ambiguous match found for serviceIdentifier:";
+export declare const CANNOT_UNBIND = "Could not unbind serviceIdentifier:";
+export declare const NOT_REGISTERED = "No matching bindings found for serviceIdentifier:";
+export declare const MISSING_INJECTABLE_ANNOTATION = "Missing required @injectable annotation in:";
+export declare const MISSING_INJECT_ANNOTATION = "Missing required @inject or @multiInject annotation in:";
+export declare const UNDEFINED_INJECT_ANNOTATION: (name: string) => string;
+export declare const CIRCULAR_DEPENDENCY = "Circular dependency found:";
+export declare const NOT_IMPLEMENTED = "Sorry, this feature is not fully implemented yet.";
+export declare const INVALID_BINDING_TYPE = "Invalid binding type:";
+export declare const NO_MORE_SNAPSHOTS_AVAILABLE = "No snapshot available to restore.";
+export declare const INVALID_MIDDLEWARE_RETURN = "Invalid return type in middleware. Middleware must return!";
+export declare const INVALID_FUNCTION_BINDING = "Value provided to function binding must be a function!";
+export declare const INVALID_TO_SELF_VALUE: string;
+export declare const INVALID_DECORATOR_OPERATION: string;
+export declare const ARGUMENTS_LENGTH_MISMATCH: (...values: any[]) => string;
+export declare const CONTAINER_OPTIONS_MUST_BE_AN_OBJECT: string;
+export declare const CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE: string;
+export declare const CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE: string;
+export declare const CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK: string;
+export declare const MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class";
+export declare const POST_CONSTRUCT_ERROR: (...values: any[]) => string;
+export declare const CIRCULAR_DEPENDENCY_IN_FACTORY: (...values: any[]) => string;
+export declare const STACK_OVERFLOW = "Maximum call stack size exceeded";
diff --git a/src/node_modules/inversify/dts/constants/literal_types.d.ts b/src/node_modules/inversify/dts/constants/literal_types.d.ts
new file mode 100644
index 0000000..4fdb2ec
--- /dev/null
+++ b/src/node_modules/inversify/dts/constants/literal_types.d.ts
@@ -0,0 +1,5 @@
+import { interfaces } from "../interfaces/interfaces";
+declare const BindingScopeEnum: interfaces.BindingScopeEnum;
+declare const BindingTypeEnum: interfaces.BindingTypeEnum;
+declare const TargetTypeEnum: interfaces.TargetTypeEnum;
+export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum };
diff --git a/src/node_modules/inversify/dts/constants/metadata_keys.d.ts b/src/node_modules/inversify/dts/constants/metadata_keys.d.ts
new file mode 100644
index 0000000..f6bfaac
--- /dev/null
+++ b/src/node_modules/inversify/dts/constants/metadata_keys.d.ts
@@ -0,0 +1,11 @@
+export declare const NAMED_TAG = "named";
+export declare const NAME_TAG = "name";
+export declare const UNMANAGED_TAG = "unmanaged";
+export declare const OPTIONAL_TAG = "optional";
+export declare const INJECT_TAG = "inject";
+export declare const MULTI_INJECT_TAG = "multi_inject";
+export declare const TAGGED = "inversify:tagged";
+export declare const TAGGED_PROP = "inversify:tagged_props";
+export declare const PARAM_TYPES = "inversify:paramtypes";
+export declare const DESIGN_PARAM_TYPES = "design:paramtypes";
+export declare const POST_CONSTRUCT = "post_construct";
diff --git a/src/node_modules/inversify/dts/container/container.d.ts b/src/node_modules/inversify/dts/container/container.d.ts
new file mode 100644
index 0000000..5877ca3
--- /dev/null
+++ b/src/node_modules/inversify/dts/container/container.d.ts
@@ -0,0 +1,38 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Container implements interfaces.Container {
+ id: number;
+ parent: interfaces.Container | null;
+ readonly options: interfaces.ContainerOptions;
+ private _middleware;
+ private _bindingDictionary;
+ private _snapshots;
+ private _metadataReader;
+ static merge(container1: interfaces.Container, container2: interfaces.Container): interfaces.Container;
+ constructor(containerOptions?: interfaces.ContainerOptions);
+ load(...modules: interfaces.ContainerModule[]): void;
+ loadAsync(...modules: interfaces.AsyncContainerModule[]): Promise<void>;
+ unload(...modules: interfaces.ContainerModule[]): void;
+ bind<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): interfaces.BindingToSyntax<T>;
+ rebind<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): interfaces.BindingToSyntax<T>;
+ unbind(serviceIdentifier: interfaces.ServiceIdentifier<any>): void;
+ unbindAll(): void;
+ isBound(serviceIdentifier: interfaces.ServiceIdentifier<any>): boolean;
+ isBoundNamed(serviceIdentifier: interfaces.ServiceIdentifier<any>, named: string | number | symbol): boolean;
+ isBoundTagged(serviceIdentifier: interfaces.ServiceIdentifier<any>, key: string | number | symbol, value: any): boolean;
+ snapshot(): void;
+ restore(): void;
+ createChild(containerOptions?: interfaces.ContainerOptions): Container;
+ applyMiddleware(...middlewares: interfaces.Middleware[]): void;
+ applyCustomMetadataReader(metadataReader: interfaces.MetadataReader): void;
+ get<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): T;
+ getTagged<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: any): T;
+ getNamed<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol): T;
+ getAll<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): T[];
+ getAllTagged<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: any): T[];
+ getAllNamed<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol): T[];
+ resolve<T>(constructorFunction: interfaces.Newable<T>): T;
+ private _getContainerModuleHelpersFactory();
+ private _get<T>(avoidConstraints, isMultiInject, targetType, serviceIdentifier, key?, value?);
+ private _planAndResolve<T>();
+}
+export { Container };
diff --git a/src/node_modules/inversify/dts/container/container_module.d.ts b/src/node_modules/inversify/dts/container/container_module.d.ts
new file mode 100644
index 0000000..92b8698
--- /dev/null
+++ b/src/node_modules/inversify/dts/container/container_module.d.ts
@@ -0,0 +1,11 @@
+import { interfaces } from "../interfaces/interfaces";
+export declare class ContainerModule implements interfaces.ContainerModule {
+ id: number;
+ registry: interfaces.ContainerModuleCallBack;
+ constructor(registry: interfaces.ContainerModuleCallBack);
+}
+export declare class AsyncContainerModule implements interfaces.AsyncContainerModule {
+ id: number;
+ registry: interfaces.AsyncContainerModuleCallBack;
+ constructor(registry: interfaces.AsyncContainerModuleCallBack);
+}
diff --git a/src/node_modules/inversify/dts/container/container_snapshot.d.ts b/src/node_modules/inversify/dts/container/container_snapshot.d.ts
new file mode 100644
index 0000000..b5629a3
--- /dev/null
+++ b/src/node_modules/inversify/dts/container/container_snapshot.d.ts
@@ -0,0 +1,7 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class ContainerSnapshot implements interfaces.ContainerSnapshot {
+ bindings: interfaces.Lookup<interfaces.Binding<any>>;
+ middleware: interfaces.Next | null;
+ static of(bindings: interfaces.Lookup<interfaces.Binding<any>>, middleware: interfaces.Next | null): ContainerSnapshot;
+}
+export { ContainerSnapshot };
diff --git a/src/node_modules/inversify/dts/container/lookup.d.ts b/src/node_modules/inversify/dts/container/lookup.d.ts
new file mode 100644
index 0000000..0a445f9
--- /dev/null
+++ b/src/node_modules/inversify/dts/container/lookup.d.ts
@@ -0,0 +1,14 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Lookup<T extends interfaces.Clonable<T>> implements interfaces.Lookup<T> {
+ private _map;
+ constructor();
+ getMap(): Map<string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>, T[]>;
+ add(serviceIdentifier: interfaces.ServiceIdentifier<any>, value: T): void;
+ get(serviceIdentifier: interfaces.ServiceIdentifier<any>): T[];
+ remove(serviceIdentifier: interfaces.ServiceIdentifier<any>): void;
+ removeByCondition(condition: (item: T) => boolean): void;
+ hasKey(serviceIdentifier: interfaces.ServiceIdentifier<any>): boolean;
+ clone(): interfaces.Lookup<T>;
+ traverse(func: (key: interfaces.ServiceIdentifier<any>, value: T[]) => void): void;
+}
+export { Lookup };
diff --git a/src/node_modules/inversify/dts/interfaces/interfaces.d.ts b/src/node_modules/inversify/dts/interfaces/interfaces.d.ts
new file mode 100644
index 0000000..094f05a
--- /dev/null
+++ b/src/node_modules/inversify/dts/interfaces/interfaces.d.ts
@@ -0,0 +1,239 @@
+declare namespace interfaces {
+ type BindingScope = "Singleton" | "Transient" | "Request";
+ type BindingType = "ConstantValue" | "Constructor" | "DynamicValue" | "Factory" | "Function" | "Instance" | "Invalid" | "Provider";
+ type TargetType = "ConstructorArgument" | "ClassProperty" | "Variable";
+ interface BindingScopeEnum {
+ Request: interfaces.BindingScope;
+ Singleton: interfaces.BindingScope;
+ Transient: interfaces.BindingScope;
+ }
+ interface BindingTypeEnum {
+ ConstantValue: interfaces.BindingType;
+ Constructor: interfaces.BindingType;
+ DynamicValue: interfaces.BindingType;
+ Factory: interfaces.BindingType;
+ Function: interfaces.BindingType;
+ Instance: interfaces.BindingType;
+ Invalid: interfaces.BindingType;
+ Provider: interfaces.BindingType;
+ }
+ interface TargetTypeEnum {
+ ConstructorArgument: interfaces.TargetType;
+ ClassProperty: interfaces.TargetType;
+ Variable: interfaces.TargetType;
+ }
+ interface Newable<T> {
+ new (...args: any[]): T;
+ }
+ interface Abstract<T> {
+ prototype: T;
+ }
+ type ServiceIdentifier<T> = (string | symbol | Newable<T> | Abstract<T>);
+ interface Clonable<T> {
+ clone(): T;
+ }
+ interface Binding<T> extends Clonable<Binding<T>> {
+ id: number;
+ moduleId: string;
+ activated: boolean;
+ serviceIdentifier: ServiceIdentifier<T>;
+ constraint: ConstraintFunction;
+ dynamicValue: ((context: interfaces.Context) => T) | null;
+ scope: BindingScope;
+ type: BindingType;
+ implementationType: Newable<T> | null;
+ factory: FactoryCreator<any> | null;
+ provider: ProviderCreator<any> | null;
+ onActivation: ((context: interfaces.Context, injectable: T) => T) | null;
+ cache: T | null;
+ }
+ type Factory<T> = (...args: any[]) => (((...args: any[]) => T) | T);
+ type FactoryCreator<T> = (context: Context) => Factory<T>;
+ type Provider<T> = (...args: any[]) => (((...args: any[]) => Promise<T>) | Promise<T>);
+ type ProviderCreator<T> = (context: Context) => Provider<T>;
+ interface NextArgs {
+ avoidConstraints: boolean;
+ contextInterceptor: ((contexts: Context) => Context);
+ isMultiInject: boolean;
+ targetType: TargetType;
+ serviceIdentifier: interfaces.ServiceIdentifier<any>;
+ key?: string | number | symbol;
+ value?: any;
+ }
+ type Next = (args: NextArgs) => (any | any[]);
+ type Middleware = (next: Next) => Next;
+ type ContextInterceptor = (context: interfaces.Context) => interfaces.Context;
+ interface Context {
+ id: number;
+ container: Container;
+ plan: Plan;
+ currentRequest: Request;
+ addPlan(plan: Plan): void;
+ setCurrentRequest(request: Request): void;
+ }
+ interface ReflectResult {
+ [key: string]: Metadata[];
+ }
+ interface Metadata {
+ key: string | number | symbol;
+ value: any;
+ }
+ interface Plan {
+ parentContext: Context;
+ rootRequest: Request;
+ }
+ interface QueryableString {
+ startsWith(searchString: string): boolean;
+ endsWith(searchString: string): boolean;
+ contains(searchString: string): boolean;
+ equals(compareString: string): boolean;
+ value(): string;
+ }
+ type ResolveRequestHandler = (request: interfaces.Request) => any;
+ type RequestScope = Map<any, any> | null;
+ interface Request {
+ id: number;
+ serviceIdentifier: ServiceIdentifier<any>;
+ parentContext: Context;
+ parentRequest: Request | null;
+ childRequests: Request[];
+ target: Target;
+ bindings: Binding<any>[];
+ requestScope: RequestScope;
+ addChildRequest(serviceIdentifier: ServiceIdentifier<any>, bindings: (Binding<any> | Binding<any>[]), target: Target): Request;
+ }
+ interface Target {
+ id: number;
+ serviceIdentifier: ServiceIdentifier<any>;
+ type: TargetType;
+ name: QueryableString;
+ metadata: Metadata[];
+ getNamedTag(): interfaces.Metadata | null;
+ getCustomTags(): interfaces.Metadata[] | null;
+ hasTag(key: string | number | symbol): boolean;
+ isArray(): boolean;
+ matchesArray(name: interfaces.ServiceIdentifier<any>): boolean;
+ isNamed(): boolean;
+ isTagged(): boolean;
+ isOptional(): boolean;
+ matchesNamedTag(name: string): boolean;
+ matchesTag(key: string | number | symbol): (value: any) => boolean;
+ }
+ interface ContainerOptions {
+ autoBindInjectable?: boolean;
+ defaultScope?: BindingScope;
+ skipBaseClassChecks?: boolean;
+ }
+ interface Container {
+ id: number;
+ parent: Container | null;
+ options: ContainerOptions;
+ bind<T>(serviceIdentifier: ServiceIdentifier<T>): BindingToSyntax<T>;
+ rebind<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): interfaces.BindingToSyntax<T>;
+ unbind(serviceIdentifier: ServiceIdentifier<any>): void;
+ unbindAll(): void;
+ isBound(serviceIdentifier: ServiceIdentifier<any>): boolean;
+ isBoundNamed(serviceIdentifier: ServiceIdentifier<any>, named: string | number | symbol): boolean;
+ isBoundTagged(serviceIdentifier: ServiceIdentifier<any>, key: string | number | symbol, value: any): boolean;
+ get<T>(serviceIdentifier: ServiceIdentifier<T>): T;
+ getNamed<T>(serviceIdentifier: ServiceIdentifier<T>, named: string | number | symbol): T;
+ getTagged<T>(serviceIdentifier: ServiceIdentifier<T>, key: string | number | symbol, value: any): T;
+ getAll<T>(serviceIdentifier: ServiceIdentifier<T>): T[];
+ resolve<T>(constructorFunction: interfaces.Newable<T>): T;
+ load(...modules: ContainerModule[]): void;
+ loadAsync(...modules: AsyncContainerModule[]): Promise<void>;
+ unload(...modules: ContainerModule[]): void;
+ applyCustomMetadataReader(metadataReader: MetadataReader): void;
+ applyMiddleware(...middleware: Middleware[]): void;
+ snapshot(): void;
+ restore(): void;
+ createChild(): Container;
+ }
+ type Bind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
+ type Rebind = <T>(serviceIdentifier: ServiceIdentifier<T>) => BindingToSyntax<T>;
+ type Unbind = <T>(serviceIdentifier: ServiceIdentifier<T>) => void;
+ type IsBound = <T>(serviceIdentifier: ServiceIdentifier<T>) => boolean;
+ interface ContainerModule {
+ id: number;
+ registry: ContainerModuleCallBack;
+ }
+ interface AsyncContainerModule {
+ id: number;
+ registry: AsyncContainerModuleCallBack;
+ }
+ type ContainerModuleCallBack = (bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => void;
+ type AsyncContainerModuleCallBack = (bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind) => Promise<void>;
+ interface ContainerSnapshot {
+ bindings: Lookup<Binding<any>>;
+ middleware: Next | null;
+ }
+ interface Lookup<T> extends Clonable<Lookup<T>> {
+ add(serviceIdentifier: ServiceIdentifier<any>, value: T): void;
+ getMap(): Map<interfaces.ServiceIdentifier<any>, T[]>;
+ get(serviceIdentifier: ServiceIdentifier<any>): T[];
+ remove(serviceIdentifier: interfaces.ServiceIdentifier<any>): void;
+ removeByCondition(condition: (item: T) => boolean): void;
+ hasKey(serviceIdentifier: ServiceIdentifier<any>): boolean;
+ clone(): Lookup<T>;
+ traverse(func: (key: interfaces.ServiceIdentifier<any>, value: T[]) => void): void;
+ }
+ interface BindingOnSyntax<T> {
+ onActivation(fn: (context: Context, injectable: T) => T): BindingWhenSyntax<T>;
+ }
+ interface BindingWhenSyntax<T> {
+ when(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
+ whenTargetNamed(name: string | number | symbol): BindingOnSyntax<T>;
+ whenTargetIsDefault(): BindingOnSyntax<T>;
+ whenTargetTagged(tag: string | number | symbol, value: any): BindingOnSyntax<T>;
+ whenInjectedInto(parent: (Function | string)): BindingOnSyntax<T>;
+ whenParentNamed(name: string | number | symbol): BindingOnSyntax<T>;
+ whenParentTagged(tag: string | number | symbol, value: any): BindingOnSyntax<T>;
+ whenAnyAncestorIs(ancestor: (Function | string)): BindingOnSyntax<T>;
+ whenNoAncestorIs(ancestor: (Function | string)): BindingOnSyntax<T>;
+ whenAnyAncestorNamed(name: string | number | symbol): BindingOnSyntax<T>;
+ whenAnyAncestorTagged(tag: string | number | symbol, value: any): BindingOnSyntax<T>;
+ whenNoAncestorNamed(name: string | number | symbol): BindingOnSyntax<T>;
+ whenNoAncestorTagged(tag: string | number | symbol, value: any): BindingOnSyntax<T>;
+ whenAnyAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
+ whenNoAncestorMatches(constraint: (request: Request) => boolean): BindingOnSyntax<T>;
+ }
+ interface BindingWhenOnSyntax<T> extends BindingWhenSyntax<T>, BindingOnSyntax<T> {
+ }
+ interface BindingInSyntax<T> {
+ inSingletonScope(): BindingWhenOnSyntax<T>;
+ inTransientScope(): BindingWhenOnSyntax<T>;
+ inRequestScope(): BindingWhenOnSyntax<T>;
+ }
+ interface BindingInWhenOnSyntax<T> extends BindingInSyntax<T>, BindingWhenOnSyntax<T> {
+ }
+ interface BindingToSyntax<T> {
+ to(constructor: {
+ new (...args: any[]): T;
+ }): BindingInWhenOnSyntax<T>;
+ toSelf(): BindingInWhenOnSyntax<T>;
+ toConstantValue(value: T): BindingWhenOnSyntax<T>;
+ toDynamicValue(func: (context: Context) => T): BindingInWhenOnSyntax<T>;
+ toConstructor<T2>(constructor: Newable<T2>): BindingWhenOnSyntax<T>;
+ toFactory<T2>(factory: FactoryCreator<T2>): BindingWhenOnSyntax<T>;
+ toFunction(func: T): BindingWhenOnSyntax<T>;
+ toAutoFactory<T2>(serviceIdentifier: ServiceIdentifier<T2>): BindingWhenOnSyntax<T>;
+ toProvider<T2>(provider: ProviderCreator<T2>): BindingWhenOnSyntax<T>;
+ toService(service: ServiceIdentifier<T>): void;
+ }
+ interface ConstraintFunction extends Function {
+ metaData?: Metadata;
+ (request: Request | null): boolean;
+ }
+ interface MetadataReader {
+ getConstructorMetadata(constructorFunc: Function): ConstructorMetadata;
+ getPropertiesMetadata(constructorFunc: Function): MetadataMap;
+ }
+ interface MetadataMap {
+ [propertyNameOrArgumentIndex: string]: Metadata[];
+ }
+ interface ConstructorMetadata {
+ compilerGeneratedMetadata: Function[] | undefined;
+ userGeneratedMetadata: MetadataMap;
+ }
+}
+export { interfaces };
diff --git a/src/node_modules/inversify/dts/inversify.d.ts b/src/node_modules/inversify/dts/inversify.d.ts
new file mode 100644
index 0000000..5ead7f7
--- /dev/null
+++ b/src/node_modules/inversify/dts/inversify.d.ts
@@ -0,0 +1,21 @@
+import * as keys from "./constants/metadata_keys";
+export declare const METADATA_KEY: typeof keys;
+export { Container } from "./container/container";
+export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum } from "./constants/literal_types";
+export { AsyncContainerModule, ContainerModule } from "./container/container_module";
+export { injectable } from "./annotation/injectable";
+export { tagged } from "./annotation/tagged";
+export { named } from "./annotation/named";
+export { inject, LazyServiceIdentifer } from "./annotation/inject";
+export { optional } from "./annotation/optional";
+export { unmanaged } from "./annotation/unmanaged";
+export { multiInject } from "./annotation/multi_inject";
+export { targetName } from "./annotation/target_name";
+export { postConstruct } from "./annotation/post_construct";
+export { MetadataReader } from "./planning/metadata_reader";
+export { id } from "./utils/id";
+export { interfaces } from "./interfaces/interfaces";
+export { decorate } from "./annotation/decorator_utils";
+export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers";
+export { getServiceIdentifierAsString } from "./utils/serialization";
+export { multiBindToService } from "./utils/binding_utils";
diff --git a/src/node_modules/inversify/dts/planning/context.d.ts b/src/node_modules/inversify/dts/planning/context.d.ts
new file mode 100644
index 0000000..5eabf26
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/context.d.ts
@@ -0,0 +1,11 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Context implements interfaces.Context {
+ id: number;
+ container: interfaces.Container;
+ plan: interfaces.Plan;
+ currentRequest: interfaces.Request;
+ constructor(container: interfaces.Container);
+ addPlan(plan: interfaces.Plan): void;
+ setCurrentRequest(currentRequest: interfaces.Request): void;
+}
+export { Context };
diff --git a/src/node_modules/inversify/dts/planning/metadata.d.ts b/src/node_modules/inversify/dts/planning/metadata.d.ts
new file mode 100644
index 0000000..e9435e0
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/metadata.d.ts
@@ -0,0 +1,8 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Metadata implements interfaces.Metadata {
+ key: string | number | symbol;
+ value: any;
+ constructor(key: string | number | symbol, value: any);
+ toString(): string;
+}
+export { Metadata };
diff --git a/src/node_modules/inversify/dts/planning/metadata_reader.d.ts b/src/node_modules/inversify/dts/planning/metadata_reader.d.ts
new file mode 100644
index 0000000..e595789
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/metadata_reader.d.ts
@@ -0,0 +1,6 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class MetadataReader implements interfaces.MetadataReader {
+ getConstructorMetadata(constructorFunc: Function): interfaces.ConstructorMetadata;
+ getPropertiesMetadata(constructorFunc: Function): interfaces.MetadataMap;
+}
+export { MetadataReader };
diff --git a/src/node_modules/inversify/dts/planning/plan.d.ts b/src/node_modules/inversify/dts/planning/plan.d.ts
new file mode 100644
index 0000000..400a81a
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/plan.d.ts
@@ -0,0 +1,7 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Plan implements interfaces.Plan {
+ parentContext: interfaces.Context;
+ rootRequest: interfaces.Request;
+ constructor(parentContext: interfaces.Context, rootRequest: interfaces.Request);
+}
+export { Plan };
diff --git a/src/node_modules/inversify/dts/planning/planner.d.ts b/src/node_modules/inversify/dts/planning/planner.d.ts
new file mode 100644
index 0000000..3459a4e
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/planner.d.ts
@@ -0,0 +1,5 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function getBindingDictionary(cntnr: any): interfaces.Lookup<interfaces.Binding<any>>;
+declare function plan(metadataReader: interfaces.MetadataReader, container: interfaces.Container, isMultiInject: boolean, targetType: interfaces.TargetType, serviceIdentifier: interfaces.ServiceIdentifier<any>, key?: string | number | symbol, value?: any, avoidConstraints?: boolean): interfaces.Context;
+declare function createMockRequest(container: interfaces.Container, serviceIdentifier: interfaces.ServiceIdentifier<any>, key: string | number | symbol, value: any): interfaces.Request;
+export { plan, createMockRequest, getBindingDictionary };
diff --git a/src/node_modules/inversify/dts/planning/queryable_string.d.ts b/src/node_modules/inversify/dts/planning/queryable_string.d.ts
new file mode 100644
index 0000000..54abbff
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/queryable_string.d.ts
@@ -0,0 +1,11 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class QueryableString implements interfaces.QueryableString {
+ private str;
+ constructor(str: string);
+ startsWith(searchString: string): boolean;
+ endsWith(searchString: string): boolean;
+ contains(searchString: string): boolean;
+ equals(compareString: string): boolean;
+ value(): string;
+}
+export { QueryableString };
diff --git a/src/node_modules/inversify/dts/planning/reflection_utils.d.ts b/src/node_modules/inversify/dts/planning/reflection_utils.d.ts
new file mode 100644
index 0000000..0fc46f6
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/reflection_utils.d.ts
@@ -0,0 +1,5 @@
+import { interfaces } from "../interfaces/interfaces";
+import { getFunctionName } from "../utils/serialization";
+declare function getDependencies(metadataReader: interfaces.MetadataReader, func: Function): interfaces.Target[];
+declare function getBaseClassDependencyCount(metadataReader: interfaces.MetadataReader, func: Function): number;
+export { getDependencies, getBaseClassDependencyCount, getFunctionName };
diff --git a/src/node_modules/inversify/dts/planning/request.d.ts b/src/node_modules/inversify/dts/planning/request.d.ts
new file mode 100644
index 0000000..b01ba81
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/request.d.ts
@@ -0,0 +1,14 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class Request implements interfaces.Request {
+ id: number;
+ serviceIdentifier: interfaces.ServiceIdentifier<any>;
+ parentContext: interfaces.Context;
+ parentRequest: interfaces.Request | null;
+ bindings: interfaces.Binding<any>[];
+ childRequests: interfaces.Request[];
+ target: interfaces.Target;
+ requestScope: interfaces.RequestScope;
+ constructor(serviceIdentifier: interfaces.ServiceIdentifier<any>, parentContext: interfaces.Context, parentRequest: interfaces.Request | null, bindings: (interfaces.Binding<any> | interfaces.Binding<any>[]), target: interfaces.Target);
+ addChildRequest(serviceIdentifier: interfaces.ServiceIdentifier<any>, bindings: (interfaces.Binding<any> | interfaces.Binding<any>[]), target: interfaces.Target): interfaces.Request;
+}
+export { Request };
diff --git a/src/node_modules/inversify/dts/planning/target.d.ts b/src/node_modules/inversify/dts/planning/target.d.ts
new file mode 100644
index 0000000..65ee18c
--- /dev/null
+++ b/src/node_modules/inversify/dts/planning/target.d.ts
@@ -0,0 +1,21 @@
+import { interfaces } from "../interfaces/interfaces";
+import { Metadata } from "./metadata";
+declare class Target implements interfaces.Target {
+ id: number;
+ type: interfaces.TargetType;
+ serviceIdentifier: interfaces.ServiceIdentifier<any>;
+ name: interfaces.QueryableString;
+ metadata: Metadata[];
+ constructor(type: interfaces.TargetType, name: string, serviceIdentifier: interfaces.ServiceIdentifier<any>, namedOrTagged?: (string | Metadata));
+ hasTag(key: string): boolean;
+ isArray(): boolean;
+ matchesArray(name: interfaces.ServiceIdentifier<any>): boolean;
+ isNamed(): boolean;
+ isTagged(): boolean;
+ isOptional(): boolean;
+ getNamedTag(): interfaces.Metadata | null;
+ getCustomTags(): interfaces.Metadata[] | null;
+ matchesNamedTag(name: string): boolean;
+ matchesTag(key: string): (value: any) => boolean;
+}
+export { Target };
diff --git a/src/node_modules/inversify/dts/resolution/instantiation.d.ts b/src/node_modules/inversify/dts/resolution/instantiation.d.ts
new file mode 100644
index 0000000..ad60187
--- /dev/null
+++ b/src/node_modules/inversify/dts/resolution/instantiation.d.ts
@@ -0,0 +1,3 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function resolveInstance(constr: interfaces.Newable<any>, childRequests: interfaces.Request[], resolveRequest: interfaces.ResolveRequestHandler): any;
+export { resolveInstance };
diff --git a/src/node_modules/inversify/dts/resolution/resolver.d.ts b/src/node_modules/inversify/dts/resolution/resolver.d.ts
new file mode 100644
index 0000000..2c5f1c0
--- /dev/null
+++ b/src/node_modules/inversify/dts/resolution/resolver.d.ts
@@ -0,0 +1,3 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function resolve<T>(context: interfaces.Context): T;
+export { resolve };
diff --git a/src/node_modules/inversify/dts/syntax/binding_in_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_in_syntax.d.ts
new file mode 100644
index 0000000..67e154a
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_in_syntax.d.ts
@@ -0,0 +1,9 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingInSyntax<T> implements interfaces.BindingInSyntax<T> {
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ inRequestScope(): interfaces.BindingWhenOnSyntax<T>;
+ inSingletonScope(): interfaces.BindingWhenOnSyntax<T>;
+ inTransientScope(): interfaces.BindingWhenOnSyntax<T>;
+}
+export { BindingInSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/binding_in_when_on_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_in_when_on_syntax.d.ts
new file mode 100644
index 0000000..0f92f1b
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_in_when_on_syntax.d.ts
@@ -0,0 +1,28 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingInWhenOnSyntax<T> implements interfaces.BindingInSyntax<T>, interfaces.BindingWhenSyntax<T>, interfaces.BindingOnSyntax<T> {
+ private _bindingInSyntax;
+ private _bindingWhenSyntax;
+ private _bindingOnSyntax;
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ inRequestScope(): interfaces.BindingWhenOnSyntax<T>;
+ inSingletonScope(): interfaces.BindingWhenOnSyntax<T>;
+ inTransientScope(): interfaces.BindingWhenOnSyntax<T>;
+ when(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenTargetNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenTargetIsDefault(): interfaces.BindingOnSyntax<T>;
+ whenTargetTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenInjectedInto(parent: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenParentNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenParentTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ onActivation(handler: (context: interfaces.Context, injectable: T) => T): interfaces.BindingWhenSyntax<T>;
+}
+export { BindingInWhenOnSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/binding_on_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_on_syntax.d.ts
new file mode 100644
index 0000000..54bf70a
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_on_syntax.d.ts
@@ -0,0 +1,7 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingOnSyntax<T> implements interfaces.BindingOnSyntax<T> {
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ onActivation(handler: (context: interfaces.Context, injectable: T) => T): interfaces.BindingWhenSyntax<T>;
+}
+export { BindingOnSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/binding_to_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_to_syntax.d.ts
new file mode 100644
index 0000000..78f994d
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_to_syntax.d.ts
@@ -0,0 +1,18 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingToSyntax<T> implements interfaces.BindingToSyntax<T> {
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ to(constructor: {
+ new (...args: any[]): T;
+ }): interfaces.BindingInWhenOnSyntax<T>;
+ toSelf(): interfaces.BindingInWhenOnSyntax<T>;
+ toConstantValue(value: T): interfaces.BindingWhenOnSyntax<T>;
+ toDynamicValue(func: (context: interfaces.Context) => T): interfaces.BindingInWhenOnSyntax<T>;
+ toConstructor<T2>(constructor: interfaces.Newable<T2>): interfaces.BindingWhenOnSyntax<T>;
+ toFactory<T2>(factory: interfaces.FactoryCreator<T2>): interfaces.BindingWhenOnSyntax<T>;
+ toFunction(func: T): interfaces.BindingWhenOnSyntax<T>;
+ toAutoFactory<T2>(serviceIdentifier: interfaces.ServiceIdentifier<T2>): interfaces.BindingWhenOnSyntax<T>;
+ toProvider<T2>(provider: interfaces.ProviderCreator<T2>): interfaces.BindingWhenOnSyntax<T>;
+ toService(service: string | symbol | interfaces.Newable<T> | interfaces.Abstract<T>): void;
+}
+export { BindingToSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/binding_when_on_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_when_on_syntax.d.ts
new file mode 100644
index 0000000..87e1093
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_when_on_syntax.d.ts
@@ -0,0 +1,24 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingWhenOnSyntax<T> implements interfaces.BindingWhenSyntax<T>, interfaces.BindingOnSyntax<T> {
+ private _bindingWhenSyntax;
+ private _bindingOnSyntax;
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ when(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenTargetNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenTargetIsDefault(): interfaces.BindingOnSyntax<T>;
+ whenTargetTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenInjectedInto(parent: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenParentNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenParentTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorNamed(name: string): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorTagged(tag: string, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ onActivation(handler: (context: interfaces.Context, injectable: T) => T): interfaces.BindingWhenSyntax<T>;
+}
+export { BindingWhenOnSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/binding_when_syntax.d.ts b/src/node_modules/inversify/dts/syntax/binding_when_syntax.d.ts
new file mode 100644
index 0000000..7dab4a7
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/binding_when_syntax.d.ts
@@ -0,0 +1,21 @@
+import { interfaces } from "../interfaces/interfaces";
+declare class BindingWhenSyntax<T> implements interfaces.BindingWhenSyntax<T> {
+ private _binding;
+ constructor(binding: interfaces.Binding<T>);
+ when(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenTargetNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
+ whenTargetIsDefault(): interfaces.BindingOnSyntax<T>;
+ whenTargetTagged(tag: string | number | symbol, value: any): interfaces.BindingOnSyntax<T>;
+ whenInjectedInto(parent: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenParentNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
+ whenParentTagged(tag: string | number | symbol, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorIs(ancestor: (Function | string)): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorNamed(name: string | number | symbol): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorTagged(tag: string | number | symbol, value: any): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorTagged(tag: string | number | symbol, value: any): interfaces.BindingOnSyntax<T>;
+ whenAnyAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+ whenNoAncestorMatches(constraint: (request: interfaces.Request) => boolean): interfaces.BindingOnSyntax<T>;
+}
+export { BindingWhenSyntax };
diff --git a/src/node_modules/inversify/dts/syntax/constraint_helpers.d.ts b/src/node_modules/inversify/dts/syntax/constraint_helpers.d.ts
new file mode 100644
index 0000000..209f1e7
--- /dev/null
+++ b/src/node_modules/inversify/dts/syntax/constraint_helpers.d.ts
@@ -0,0 +1,6 @@
+import { interfaces } from "../interfaces/interfaces";
+declare const traverseAncerstors: (request: interfaces.Request, constraint: interfaces.ConstraintFunction) => boolean;
+declare const taggedConstraint: (key: PropertyKey) => (value: any) => interfaces.ConstraintFunction;
+declare const namedConstraint: (value: any) => interfaces.ConstraintFunction;
+declare const typeConstraint: (type: string | Function) => (request: interfaces.Request | null) => boolean;
+export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint };
diff --git a/src/node_modules/inversify/dts/utils/binding_utils.d.ts b/src/node_modules/inversify/dts/utils/binding_utils.d.ts
new file mode 100644
index 0000000..ff1d1f8
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/binding_utils.d.ts
@@ -0,0 +1,2 @@
+import { interfaces } from "../inversify";
+export declare const multiBindToService: (container: interfaces.Container) => (service: string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>) => (...types: (string | symbol | interfaces.Newable<any> | interfaces.Abstract<any>)[]) => void;
diff --git a/src/node_modules/inversify/dts/utils/exceptions.d.ts b/src/node_modules/inversify/dts/utils/exceptions.d.ts
new file mode 100644
index 0000000..d1df327
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/exceptions.d.ts
@@ -0,0 +1 @@
+export declare function isStackOverflowExeption(error: Error): boolean;
diff --git a/src/node_modules/inversify/dts/utils/guid.d.ts b/src/node_modules/inversify/dts/utils/guid.d.ts
new file mode 100644
index 0000000..11a7975
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/guid.d.ts
@@ -0,0 +1,2 @@
+declare function guid(): string;
+export { guid };
diff --git a/src/node_modules/inversify/dts/utils/id.d.ts b/src/node_modules/inversify/dts/utils/id.d.ts
new file mode 100644
index 0000000..663904c
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/id.d.ts
@@ -0,0 +1,2 @@
+declare function id(): number;
+export { id };
diff --git a/src/node_modules/inversify/dts/utils/serialization.d.ts b/src/node_modules/inversify/dts/utils/serialization.d.ts
new file mode 100644
index 0000000..fe20ec4
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/serialization.d.ts
@@ -0,0 +1,7 @@
+import { interfaces } from "../interfaces/interfaces";
+declare function getServiceIdentifierAsString(serviceIdentifier: interfaces.ServiceIdentifier<any>): string;
+declare function listRegisteredBindingsForServiceIdentifier(container: interfaces.Container, serviceIdentifier: string, getBindings: <T>(container: interfaces.Container, serviceIdentifier: interfaces.ServiceIdentifier<T>) => interfaces.Binding<T>[]): string;
+declare function circularDependencyToException(request: interfaces.Request): void;
+declare function listMetadataForTarget(serviceIdentifierString: string, target: interfaces.Target): string;
+declare function getFunctionName(v: any): string;
+export { getFunctionName, getServiceIdentifierAsString, listRegisteredBindingsForServiceIdentifier, listMetadataForTarget, circularDependencyToException };
diff --git a/src/node_modules/inversify/dts/utils/template.d.ts b/src/node_modules/inversify/dts/utils/template.d.ts
new file mode 100644
index 0000000..46e6d7e
--- /dev/null
+++ b/src/node_modules/inversify/dts/utils/template.d.ts
@@ -0,0 +1 @@
+export declare function template(strings: TemplateStringsArray, ...keys: any[]): (...values: any[]) => string;
diff --git a/src/node_modules/inversify/es/annotation/decorator_utils.js b/src/node_modules/inversify/es/annotation/decorator_utils.js
new file mode 100644
index 0000000..f0c93a2
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/decorator_utils.js
@@ -0,0 +1,54 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+import * as METADATA_KEY from "../constants/metadata_keys";
+function tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED;
+ _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);
+}
+function tagProperty(annotationTarget, propertyName, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED_PROP;
+ _tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);
+}
+function _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {
+ var paramsOrPropertiesMetadata = {};
+ var isParameterDecorator = (typeof parameterIndex === "number");
+ var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;
+ if (isParameterDecorator && propertyName !== undefined) {
+ throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);
+ }
+ if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
+ paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
+ }
+ var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
+ if (!Array.isArray(paramOrPropertyMetadata)) {
+ paramOrPropertyMetadata = [];
+ }
+ else {
+ for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {
+ var m = paramOrPropertyMetadata_1[_i];
+ if (m.key === metadata.key) {
+ throw new Error(ERROR_MSGS.DUPLICATED_METADATA + " " + m.key.toString());
+ }
+ }
+ }
+ paramOrPropertyMetadata.push(metadata);
+ paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
+ Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
+}
+function _decorate(decorators, target) {
+ Reflect.decorate(decorators, target);
+}
+function _param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); };
+}
+function decorate(decorator, target, parameterIndex) {
+ if (typeof parameterIndex === "number") {
+ _decorate([_param(parameterIndex, decorator)], target);
+ }
+ else if (typeof parameterIndex === "string") {
+ Reflect.decorate([decorator], target, parameterIndex);
+ }
+ else {
+ _decorate([decorator], target);
+ }
+}
+export { decorate, tagParameter, tagProperty };
diff --git a/src/node_modules/inversify/es/annotation/inject.js b/src/node_modules/inversify/es/annotation/inject.js
new file mode 100644
index 0000000..6a880b1
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/inject.js
@@ -0,0 +1,29 @@
+import { UNDEFINED_INJECT_ANNOTATION } from "../constants/error_msgs";
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter, tagProperty } from "./decorator_utils";
+var LazyServiceIdentifer = (function () {
+ function LazyServiceIdentifer(cb) {
+ this._cb = cb;
+ }
+ LazyServiceIdentifer.prototype.unwrap = function () {
+ return this._cb();
+ };
+ return LazyServiceIdentifer;
+}());
+export { LazyServiceIdentifer };
+function inject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ if (serviceIdentifier === undefined) {
+ throw new Error(UNDEFINED_INJECT_ANNOTATION(target.name));
+ }
+ var metadata = new Metadata(METADATA_KEY.INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+export { inject };
diff --git a/src/node_modules/inversify/es/annotation/injectable.js b/src/node_modules/inversify/es/annotation/injectable.js
new file mode 100644
index 0000000..0598aaf
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/injectable.js
@@ -0,0 +1,13 @@
+import * as ERRORS_MSGS from "../constants/error_msgs";
+import * as METADATA_KEY from "../constants/metadata_keys";
+function injectable() {
+ return function (target) {
+ if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {
+ throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
+ }
+ var types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
+ Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
+ return target;
+ };
+}
+export { injectable };
diff --git a/src/node_modules/inversify/es/annotation/multi_inject.js b/src/node_modules/inversify/es/annotation/multi_inject.js
new file mode 100644
index 0000000..787374d
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/multi_inject.js
@@ -0,0 +1,15 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter, tagProperty } from "./decorator_utils";
+function multiInject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(METADATA_KEY.MULTI_INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+export { multiInject };
diff --git a/src/node_modules/inversify/es/annotation/named.js b/src/node_modules/inversify/es/annotation/named.js
new file mode 100644
index 0000000..d09f940
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/named.js
@@ -0,0 +1,15 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter, tagProperty } from "./decorator_utils";
+function named(name) {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(METADATA_KEY.NAMED_TAG, name);
+ if (typeof index === "number") {
+ tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+export { named };
diff --git a/src/node_modules/inversify/es/annotation/optional.js b/src/node_modules/inversify/es/annotation/optional.js
new file mode 100644
index 0000000..e99a21d
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/optional.js
@@ -0,0 +1,15 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter, tagProperty } from "./decorator_utils";
+function optional() {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(METADATA_KEY.OPTIONAL_TAG, true);
+ if (typeof index === "number") {
+ tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+export { optional };
diff --git a/src/node_modules/inversify/es/annotation/post_construct.js b/src/node_modules/inversify/es/annotation/post_construct.js
new file mode 100644
index 0000000..5b1ce09
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/post_construct.js
@@ -0,0 +1,13 @@
+import * as ERRORS_MSGS from "../constants/error_msgs";
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+function postConstruct() {
+ return function (target, propertyKey, descriptor) {
+ var metadata = new Metadata(METADATA_KEY.POST_CONSTRUCT, propertyKey);
+ if (Reflect.hasOwnMetadata(METADATA_KEY.POST_CONSTRUCT, target.constructor)) {
+ throw new Error(ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS);
+ }
+ Reflect.defineMetadata(METADATA_KEY.POST_CONSTRUCT, metadata, target.constructor);
+ };
+}
+export { postConstruct };
diff --git a/src/node_modules/inversify/es/annotation/tagged.js b/src/node_modules/inversify/es/annotation/tagged.js
new file mode 100644
index 0000000..104c123
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/tagged.js
@@ -0,0 +1,14 @@
+import { Metadata } from "../planning/metadata";
+import { tagParameter, tagProperty } from "./decorator_utils";
+function tagged(metadataKey, metadataValue) {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(metadataKey, metadataValue);
+ if (typeof index === "number") {
+ tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+export { tagged };
diff --git a/src/node_modules/inversify/es/annotation/target_name.js b/src/node_modules/inversify/es/annotation/target_name.js
new file mode 100644
index 0000000..02785eb
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/target_name.js
@@ -0,0 +1,10 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter } from "./decorator_utils";
+function targetName(name) {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(METADATA_KEY.NAME_TAG, name);
+ tagParameter(target, targetKey, index, metadata);
+ };
+}
+export { targetName };
diff --git a/src/node_modules/inversify/es/annotation/unmanaged.js b/src/node_modules/inversify/es/annotation/unmanaged.js
new file mode 100644
index 0000000..e158351
--- /dev/null
+++ b/src/node_modules/inversify/es/annotation/unmanaged.js
@@ -0,0 +1,10 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+import { tagParameter } from "./decorator_utils";
+function unmanaged() {
+ return function (target, targetKey, index) {
+ var metadata = new Metadata(METADATA_KEY.UNMANAGED_TAG, true);
+ tagParameter(target, targetKey, index, metadata);
+ };
+}
+export { unmanaged };
diff --git a/src/node_modules/inversify/es/bindings/binding.js b/src/node_modules/inversify/es/bindings/binding.js
new file mode 100644
index 0000000..c040275
--- /dev/null
+++ b/src/node_modules/inversify/es/bindings/binding.js
@@ -0,0 +1,34 @@
+import { BindingTypeEnum } from "../constants/literal_types";
+import { id } from "../utils/id";
+var Binding = (function () {
+ function Binding(serviceIdentifier, scope) {
+ this.id = id();
+ this.activated = false;
+ this.serviceIdentifier = serviceIdentifier;
+ this.scope = scope;
+ this.type = BindingTypeEnum.Invalid;
+ this.constraint = function (request) { return true; };
+ this.implementationType = null;
+ this.cache = null;
+ this.factory = null;
+ this.provider = null;
+ this.onActivation = null;
+ this.dynamicValue = null;
+ }
+ Binding.prototype.clone = function () {
+ var clone = new Binding(this.serviceIdentifier, this.scope);
+ clone.activated = false;
+ clone.implementationType = this.implementationType;
+ clone.dynamicValue = this.dynamicValue;
+ clone.scope = this.scope;
+ clone.type = this.type;
+ clone.factory = this.factory;
+ clone.provider = this.provider;
+ clone.constraint = this.constraint;
+ clone.onActivation = this.onActivation;
+ clone.cache = this.cache;
+ return clone;
+ };
+ return Binding;
+}());
+export { Binding };
diff --git a/src/node_modules/inversify/es/bindings/binding_count.js b/src/node_modules/inversify/es/bindings/binding_count.js
new file mode 100644
index 0000000..cd1b080
--- /dev/null
+++ b/src/node_modules/inversify/es/bindings/binding_count.js
@@ -0,0 +1,6 @@
+var BindingCount = {
+ MultipleBindingsAvailable: 2,
+ NoBindingsAvailable: 0,
+ OnlyOneBindingAvailable: 1
+};
+export { BindingCount };
diff --git a/src/node_modules/inversify/es/constants/error_msgs.js b/src/node_modules/inversify/es/constants/error_msgs.js
new file mode 100644
index 0000000..24c9a1d
--- /dev/null
+++ b/src/node_modules/inversify/es/constants/error_msgs.js
@@ -0,0 +1,58 @@
+export var DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
+export var DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
+export var NULL_ARGUMENT = "NULL argument";
+export var KEY_NOT_FOUND = "Key Not Found";
+export var AMBIGUOUS_MATCH = "Ambiguous match found for serviceIdentifier:";
+export var CANNOT_UNBIND = "Could not unbind serviceIdentifier:";
+export var NOT_REGISTERED = "No matching bindings found for serviceIdentifier:";
+export var MISSING_INJECTABLE_ANNOTATION = "Missing required @injectable annotation in:";
+export var MISSING_INJECT_ANNOTATION = "Missing required @inject or @multiInject annotation in:";
+export var UNDEFINED_INJECT_ANNOTATION = function (name) {
+ return "@inject called with undefined this could mean that the class " + name + " has " +
+ "a circular dependency problem. You can use a LazyServiceIdentifer to " +
+ "overcome this limitation.";
+};
+export var CIRCULAR_DEPENDENCY = "Circular dependency found:";
+export var NOT_IMPLEMENTED = "Sorry, this feature is not fully implemented yet.";
+export var INVALID_BINDING_TYPE = "Invalid binding type:";
+export var NO_MORE_SNAPSHOTS_AVAILABLE = "No snapshot available to restore.";
+export var INVALID_MIDDLEWARE_RETURN = "Invalid return type in middleware. Middleware must return!";
+export var INVALID_FUNCTION_BINDING = "Value provided to function binding must be a function!";
+export var INVALID_TO_SELF_VALUE = "The toSelf function can only be applied when a constructor is " +
+ "used as service identifier";
+export var INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
+ "must be applied to the parameters of a class constructor or a class property.";
+export var ARGUMENTS_LENGTH_MISMATCH = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "The number of constructor arguments in the derived class " +
+ (values[0] + " must be >= than the number of constructor arguments of its base class.");
+};
+export var CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = "Invalid Container constructor argument. Container options " +
+ "must be an object.";
+export var CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = "Invalid Container option. Default scope must " +
+ "be a string ('singleton' or 'transient').";
+export var CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = "Invalid Container option. Auto bind injectable must " +
+ "be a boolean";
+export var CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = "Invalid Container option. Skip base check must " +
+ "be a boolean";
+export var MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class";
+export var POST_CONSTRUCT_ERROR = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "@postConstruct error in class " + values[0] + ": " + values[1];
+};
+export var CIRCULAR_DEPENDENCY_IN_FACTORY = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "It looks like there is a circular dependency " +
+ ("in one of the '" + values[0] + "' bindings. Please investigate bindings with") +
+ ("service identifier '" + values[1] + "'.");
+};
+export var STACK_OVERFLOW = "Maximum call stack size exceeded";
diff --git a/src/node_modules/inversify/es/constants/literal_types.js b/src/node_modules/inversify/es/constants/literal_types.js
new file mode 100644
index 0000000..cf3bafb
--- /dev/null
+++ b/src/node_modules/inversify/es/constants/literal_types.js
@@ -0,0 +1,21 @@
+var BindingScopeEnum = {
+ Request: "Request",
+ Singleton: "Singleton",
+ Transient: "Transient"
+};
+var BindingTypeEnum = {
+ ConstantValue: "ConstantValue",
+ Constructor: "Constructor",
+ DynamicValue: "DynamicValue",
+ Factory: "Factory",
+ Function: "Function",
+ Instance: "Instance",
+ Invalid: "Invalid",
+ Provider: "Provider"
+};
+var TargetTypeEnum = {
+ ClassProperty: "ClassProperty",
+ ConstructorArgument: "ConstructorArgument",
+ Variable: "Variable"
+};
+export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum };
diff --git a/src/node_modules/inversify/es/constants/metadata_keys.js b/src/node_modules/inversify/es/constants/metadata_keys.js
new file mode 100644
index 0000000..508914d
--- /dev/null
+++ b/src/node_modules/inversify/es/constants/metadata_keys.js
@@ -0,0 +1,11 @@
+export var NAMED_TAG = "named";
+export var NAME_TAG = "name";
+export var UNMANAGED_TAG = "unmanaged";
+export var OPTIONAL_TAG = "optional";
+export var INJECT_TAG = "inject";
+export var MULTI_INJECT_TAG = "multi_inject";
+export var TAGGED = "inversify:tagged";
+export var TAGGED_PROP = "inversify:tagged_props";
+export var PARAM_TYPES = "inversify:paramtypes";
+export var DESIGN_PARAM_TYPES = "design:paramtypes";
+export var POST_CONSTRUCT = "post_construct";
diff --git a/src/node_modules/inversify/es/container/container.js b/src/node_modules/inversify/es/container/container.js
new file mode 100644
index 0000000..1c45e42
--- /dev/null
+++ b/src/node_modules/inversify/es/container/container.js
@@ -0,0 +1,323 @@
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+import { Binding } from "../bindings/binding";
+import * as ERROR_MSGS from "../constants/error_msgs";
+import { BindingScopeEnum, TargetTypeEnum } from "../constants/literal_types";
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { MetadataReader } from "../planning/metadata_reader";
+import { createMockRequest, getBindingDictionary, plan } from "../planning/planner";
+import { resolve } from "../resolution/resolver";
+import { BindingToSyntax } from "../syntax/binding_to_syntax";
+import { id } from "../utils/id";
+import { getServiceIdentifierAsString } from "../utils/serialization";
+import { ContainerSnapshot } from "./container_snapshot";
+import { Lookup } from "./lookup";
+var Container = (function () {
+ function Container(containerOptions) {
+ var options = containerOptions || {};
+ if (typeof options !== "object") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);
+ }
+ if (options.defaultScope === undefined) {
+ options.defaultScope = BindingScopeEnum.Transient;
+ }
+ else if (options.defaultScope !== BindingScopeEnum.Singleton &&
+ options.defaultScope !== BindingScopeEnum.Transient &&
+ options.defaultScope !== BindingScopeEnum.Request) {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);
+ }
+ if (options.autoBindInjectable === undefined) {
+ options.autoBindInjectable = false;
+ }
+ else if (typeof options.autoBindInjectable !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);
+ }
+ if (options.skipBaseClassChecks === undefined) {
+ options.skipBaseClassChecks = false;
+ }
+ else if (typeof options.skipBaseClassChecks !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);
+ }
+ this.options = {
+ autoBindInjectable: options.autoBindInjectable,
+ defaultScope: options.defaultScope,
+ skipBaseClassChecks: options.skipBaseClassChecks
+ };
+ this.id = id();
+ this._bindingDictionary = new Lookup();
+ this._snapshots = [];
+ this._middleware = null;
+ this.parent = null;
+ this._metadataReader = new MetadataReader();
+ }
+ Container.merge = function (container1, container2) {
+ var container = new Container();
+ var bindingDictionary = getBindingDictionary(container);
+ var bindingDictionary1 = getBindingDictionary(container1);
+ var bindingDictionary2 = getBindingDictionary(container2);
+ function copyDictionary(origin, destination) {
+ origin.traverse(function (key, value) {
+ value.forEach(function (binding) {
+ destination.add(binding.serviceIdentifier, binding.clone());
+ });
+ });
+ }
+ copyDictionary(bindingDictionary1, bindingDictionary);
+ copyDictionary(bindingDictionary2, bindingDictionary);
+ return container;
+ };
+ Container.prototype.load = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var getHelpers = this._getContainerModuleHelpersFactory();
+ for (var _a = 0, modules_1 = modules; _a < modules_1.length; _a++) {
+ var currentModule = modules_1[_a];
+ var containerModuleHelpers = getHelpers(currentModule.id);
+ currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
+ }
+ };
+ Container.prototype.loadAsync = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ return __awaiter(this, void 0, void 0, function () {
+ var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
+ return __generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ getHelpers = this._getContainerModuleHelpersFactory();
+ _a = 0, modules_2 = modules;
+ _b.label = 1;
+ case 1:
+ if (!(_a < modules_2.length)) return [3, 4];
+ currentModule = modules_2[_a];
+ containerModuleHelpers = getHelpers(currentModule.id);
+ return [4, currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction)];
+ case 2:
+ _b.sent();
+ _b.label = 3;
+ case 3:
+ _a++;
+ return [3, 1];
+ case 4: return [2];
+ }
+ });
+ });
+ };
+ Container.prototype.unload = function () {
+ var _this = this;
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var conditionFactory = function (expected) { return function (item) {
+ return item.moduleId === expected;
+ }; };
+ modules.forEach(function (module) {
+ var condition = conditionFactory(module.id);
+ _this._bindingDictionary.removeByCondition(condition);
+ });
+ };
+ Container.prototype.bind = function (serviceIdentifier) {
+ var scope = this.options.defaultScope || BindingScopeEnum.Transient;
+ var binding = new Binding(serviceIdentifier, scope);
+ this._bindingDictionary.add(serviceIdentifier, binding);
+ return new BindingToSyntax(binding);
+ };
+ Container.prototype.rebind = function (serviceIdentifier) {
+ this.unbind(serviceIdentifier);
+ return this.bind(serviceIdentifier);
+ };
+ Container.prototype.unbind = function (serviceIdentifier) {
+ try {
+ this._bindingDictionary.remove(serviceIdentifier);
+ }
+ catch (e) {
+ throw new Error(ERROR_MSGS.CANNOT_UNBIND + " " + getServiceIdentifierAsString(serviceIdentifier));
+ }
+ };
+ Container.prototype.unbindAll = function () {
+ this._bindingDictionary = new Lookup();
+ };
+ Container.prototype.isBound = function (serviceIdentifier) {
+ var bound = this._bindingDictionary.hasKey(serviceIdentifier);
+ if (!bound && this.parent) {
+ bound = this.parent.isBound(serviceIdentifier);
+ }
+ return bound;
+ };
+ Container.prototype.isBoundNamed = function (serviceIdentifier, named) {
+ return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.isBoundTagged = function (serviceIdentifier, key, value) {
+ var bound = false;
+ if (this._bindingDictionary.hasKey(serviceIdentifier)) {
+ var bindings = this._bindingDictionary.get(serviceIdentifier);
+ var request_1 = createMockRequest(this, serviceIdentifier, key, value);
+ bound = bindings.some(function (b) { return b.constraint(request_1); });
+ }
+ if (!bound && this.parent) {
+ bound = this.parent.isBoundTagged(serviceIdentifier, key, value);
+ }
+ return bound;
+ };
+ Container.prototype.snapshot = function () {
+ this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware));
+ };
+ Container.prototype.restore = function () {
+ var snapshot = this._snapshots.pop();
+ if (snapshot === undefined) {
+ throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);
+ }
+ this._bindingDictionary = snapshot.bindings;
+ this._middleware = snapshot.middleware;
+ };
+ Container.prototype.createChild = function (containerOptions) {
+ var child = new Container(containerOptions || this.options);
+ child.parent = this;
+ return child;
+ };
+ Container.prototype.applyMiddleware = function () {
+ var middlewares = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ middlewares[_i] = arguments[_i];
+ }
+ var initial = (this._middleware) ? this._middleware : this._planAndResolve();
+ this._middleware = middlewares.reduce(function (prev, curr) { return curr(prev); }, initial);
+ };
+ Container.prototype.applyCustomMetadataReader = function (metadataReader) {
+ this._metadataReader = metadataReader;
+ };
+ Container.prototype.get = function (serviceIdentifier) {
+ return this._get(false, false, TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, false, TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getNamed = function (serviceIdentifier, named) {
+ return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.getAll = function (serviceIdentifier) {
+ return this._get(true, true, TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getAllTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, true, TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getAllNamed = function (serviceIdentifier, named) {
+ return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.resolve = function (constructorFunction) {
+ var tempContainer = this.createChild();
+ tempContainer.bind(constructorFunction).toSelf();
+ return tempContainer.get(constructorFunction);
+ };
+ Container.prototype._getContainerModuleHelpersFactory = function () {
+ var _this = this;
+ var setModuleId = function (bindingToSyntax, moduleId) {
+ bindingToSyntax._binding.moduleId = moduleId;
+ };
+ var getBindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _bind = _this.bind.bind(_this);
+ var bindingToSyntax = _bind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ var getUnbindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _unbind = _this.unbind.bind(_this);
+ _unbind(serviceIdentifier);
+ };
+ };
+ var getIsboundFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _isBound = _this.isBound.bind(_this);
+ return _isBound(serviceIdentifier);
+ };
+ };
+ var getRebindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _rebind = _this.rebind.bind(_this);
+ var bindingToSyntax = _rebind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ return function (mId) { return ({
+ bindFunction: getBindFunction(mId),
+ isboundFunction: getIsboundFunction(mId),
+ rebindFunction: getRebindFunction(mId),
+ unbindFunction: getUnbindFunction(mId)
+ }); };
+ };
+ Container.prototype._get = function (avoidConstraints, isMultiInject, targetType, serviceIdentifier, key, value) {
+ var result = null;
+ var defaultArgs = {
+ avoidConstraints: avoidConstraints,
+ contextInterceptor: function (context) { return context; },
+ isMultiInject: isMultiInject,
+ key: key,
+ serviceIdentifier: serviceIdentifier,
+ targetType: targetType,
+ value: value
+ };
+ if (this._middleware) {
+ result = this._middleware(defaultArgs);
+ if (result === undefined || result === null) {
+ throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);
+ }
+ }
+ else {
+ result = this._planAndResolve()(defaultArgs);
+ }
+ return result;
+ };
+ Container.prototype._planAndResolve = function () {
+ var _this = this;
+ return function (args) {
+ var context = plan(_this._metadataReader, _this, args.isMultiInject, args.targetType, args.serviceIdentifier, args.key, args.value, args.avoidConstraints);
+ context = args.contextInterceptor(context);
+ var result = resolve(context);
+ return result;
+ };
+ };
+ return Container;
+}());
+export { Container };
diff --git a/src/node_modules/inversify/es/container/container_module.js b/src/node_modules/inversify/es/container/container_module.js
new file mode 100644
index 0000000..f9cdccc
--- /dev/null
+++ b/src/node_modules/inversify/es/container/container_module.js
@@ -0,0 +1,17 @@
+import { id } from "../utils/id";
+var ContainerModule = (function () {
+ function ContainerModule(registry) {
+ this.id = id();
+ this.registry = registry;
+ }
+ return ContainerModule;
+}());
+export { ContainerModule };
+var AsyncContainerModule = (function () {
+ function AsyncContainerModule(registry) {
+ this.id = id();
+ this.registry = registry;
+ }
+ return AsyncContainerModule;
+}());
+export { AsyncContainerModule };
diff --git a/src/node_modules/inversify/es/container/container_snapshot.js b/src/node_modules/inversify/es/container/container_snapshot.js
new file mode 100644
index 0000000..36841f8
--- /dev/null
+++ b/src/node_modules/inversify/es/container/container_snapshot.js
@@ -0,0 +1,12 @@
+var ContainerSnapshot = (function () {
+ function ContainerSnapshot() {
+ }
+ ContainerSnapshot.of = function (bindings, middleware) {
+ var snapshot = new ContainerSnapshot();
+ snapshot.bindings = bindings;
+ snapshot.middleware = middleware;
+ return snapshot;
+ };
+ return ContainerSnapshot;
+}());
+export { ContainerSnapshot };
diff --git a/src/node_modules/inversify/es/container/lookup.js b/src/node_modules/inversify/es/container/lookup.js
new file mode 100644
index 0000000..9caa5ef
--- /dev/null
+++ b/src/node_modules/inversify/es/container/lookup.js
@@ -0,0 +1,77 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+var Lookup = (function () {
+ function Lookup() {
+ this._map = new Map();
+ }
+ Lookup.prototype.getMap = function () {
+ return this._map;
+ };
+ Lookup.prototype.add = function (serviceIdentifier, value) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (value === null || value === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ entry.push(value);
+ this._map.set(serviceIdentifier, entry);
+ }
+ else {
+ this._map.set(serviceIdentifier, [value]);
+ }
+ };
+ Lookup.prototype.get = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ return entry;
+ }
+ else {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.remove = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (!this._map.delete(serviceIdentifier)) {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.removeByCondition = function (condition) {
+ var _this = this;
+ this._map.forEach(function (entries, key) {
+ var updatedEntries = entries.filter(function (entry) { return !condition(entry); });
+ if (updatedEntries.length > 0) {
+ _this._map.set(key, updatedEntries);
+ }
+ else {
+ _this._map.delete(key);
+ }
+ });
+ };
+ Lookup.prototype.hasKey = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ return this._map.has(serviceIdentifier);
+ };
+ Lookup.prototype.clone = function () {
+ var copy = new Lookup();
+ this._map.forEach(function (value, key) {
+ value.forEach(function (b) { return copy.add(key, b.clone()); });
+ });
+ return copy;
+ };
+ Lookup.prototype.traverse = function (func) {
+ this._map.forEach(function (value, key) {
+ func(key, value);
+ });
+ };
+ return Lookup;
+}());
+export { Lookup };
diff --git a/src/node_modules/inversify/es/interfaces/interfaces.js b/src/node_modules/inversify/es/interfaces/interfaces.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/node_modules/inversify/es/interfaces/interfaces.js
diff --git a/src/node_modules/inversify/es/inversify.js b/src/node_modules/inversify/es/inversify.js
new file mode 100644
index 0000000..2125bc0
--- /dev/null
+++ b/src/node_modules/inversify/es/inversify.js
@@ -0,0 +1,20 @@
+import * as keys from "./constants/metadata_keys";
+export var METADATA_KEY = keys;
+export { Container } from "./container/container";
+export { BindingScopeEnum, BindingTypeEnum, TargetTypeEnum } from "./constants/literal_types";
+export { AsyncContainerModule, ContainerModule } from "./container/container_module";
+export { injectable } from "./annotation/injectable";
+export { tagged } from "./annotation/tagged";
+export { named } from "./annotation/named";
+export { inject, LazyServiceIdentifer } from "./annotation/inject";
+export { optional } from "./annotation/optional";
+export { unmanaged } from "./annotation/unmanaged";
+export { multiInject } from "./annotation/multi_inject";
+export { targetName } from "./annotation/target_name";
+export { postConstruct } from "./annotation/post_construct";
+export { MetadataReader } from "./planning/metadata_reader";
+export { id } from "./utils/id";
+export { decorate } from "./annotation/decorator_utils";
+export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint } from "./syntax/constraint_helpers";
+export { getServiceIdentifierAsString } from "./utils/serialization";
+export { multiBindToService } from "./utils/binding_utils";
diff --git a/src/node_modules/inversify/es/planning/context.js b/src/node_modules/inversify/es/planning/context.js
new file mode 100644
index 0000000..d2fc88b
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/context.js
@@ -0,0 +1,15 @@
+import { id } from "../utils/id";
+var Context = (function () {
+ function Context(container) {
+ this.id = id();
+ this.container = container;
+ }
+ Context.prototype.addPlan = function (plan) {
+ this.plan = plan;
+ };
+ Context.prototype.setCurrentRequest = function (currentRequest) {
+ this.currentRequest = currentRequest;
+ };
+ return Context;
+}());
+export { Context };
diff --git a/src/node_modules/inversify/es/planning/metadata.js b/src/node_modules/inversify/es/planning/metadata.js
new file mode 100644
index 0000000..3bece6a
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/metadata.js
@@ -0,0 +1,17 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+var Metadata = (function () {
+ function Metadata(key, value) {
+ this.key = key;
+ this.value = value;
+ }
+ Metadata.prototype.toString = function () {
+ if (this.key === METADATA_KEY.NAMED_TAG) {
+ return "named: " + this.value.toString() + " ";
+ }
+ else {
+ return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }";
+ }
+ };
+ return Metadata;
+}());
+export { Metadata };
diff --git a/src/node_modules/inversify/es/planning/metadata_reader.js b/src/node_modules/inversify/es/planning/metadata_reader.js
new file mode 100644
index 0000000..4e8b334
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/metadata_reader.js
@@ -0,0 +1,19 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+var MetadataReader = (function () {
+ function MetadataReader() {
+ }
+ MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {
+ var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc);
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);
+ return {
+ compilerGeneratedMetadata: compilerGeneratedMetadata,
+ userGeneratedMetadata: userGeneratedMetadata || {}
+ };
+ };
+ MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) {
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || [];
+ return userGeneratedMetadata;
+ };
+ return MetadataReader;
+}());
+export { MetadataReader };
diff --git a/src/node_modules/inversify/es/planning/plan.js b/src/node_modules/inversify/es/planning/plan.js
new file mode 100644
index 0000000..ef8309d
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/plan.js
@@ -0,0 +1,8 @@
+var Plan = (function () {
+ function Plan(parentContext, rootRequest) {
+ this.parentContext = parentContext;
+ this.rootRequest = rootRequest;
+ }
+ return Plan;
+}());
+export { Plan };
diff --git a/src/node_modules/inversify/es/planning/planner.js b/src/node_modules/inversify/es/planning/planner.js
new file mode 100644
index 0000000..8c5b74f
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/planner.js
@@ -0,0 +1,151 @@
+import { BindingCount } from "../bindings/binding_count";
+import * as ERROR_MSGS from "../constants/error_msgs";
+import { BindingTypeEnum, TargetTypeEnum } from "../constants/literal_types";
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { isStackOverflowExeption } from "../utils/exceptions";
+import { circularDependencyToException, getServiceIdentifierAsString, listMetadataForTarget, listRegisteredBindingsForServiceIdentifier } from "../utils/serialization";
+import { Context } from "./context";
+import { Metadata } from "./metadata";
+import { Plan } from "./plan";
+import { getBaseClassDependencyCount, getDependencies, getFunctionName } from "./reflection_utils";
+import { Request } from "./request";
+import { Target } from "./target";
+function getBindingDictionary(cntnr) {
+ return cntnr._bindingDictionary;
+}
+function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
+ var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;
+ var injectMetadata = new Metadata(metadataKey, serviceIdentifier);
+ var target = new Target(targetType, name, serviceIdentifier, injectMetadata);
+ if (key !== undefined) {
+ var tagMetadata = new Metadata(key, value);
+ target.metadata.push(tagMetadata);
+ }
+ return target;
+}
+function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {
+ var bindings = getBindings(context.container, target.serviceIdentifier);
+ var activeBindings = [];
+ if (bindings.length === BindingCount.NoBindingsAvailable &&
+ context.container.options.autoBindInjectable &&
+ typeof target.serviceIdentifier === "function" &&
+ metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {
+ context.container.bind(target.serviceIdentifier).toSelf();
+ bindings = getBindings(context.container, target.serviceIdentifier);
+ }
+ if (!avoidConstraints) {
+ activeBindings = bindings.filter(function (binding) {
+ var request = new Request(binding.serviceIdentifier, context, parentRequest, binding, target);
+ return binding.constraint(request);
+ });
+ }
+ else {
+ activeBindings = bindings;
+ }
+ _validateActiveBindingCount(target.serviceIdentifier, activeBindings, target, context.container);
+ return activeBindings;
+}
+function _validateActiveBindingCount(serviceIdentifier, bindings, target, container) {
+ switch (bindings.length) {
+ case BindingCount.NoBindingsAvailable:
+ if (target.isOptional()) {
+ return bindings;
+ }
+ else {
+ var serviceIdentifierString = getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.NOT_REGISTERED;
+ msg += listMetadataForTarget(serviceIdentifierString, target);
+ msg += listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ case BindingCount.OnlyOneBindingAvailable:
+ if (!target.isArray()) {
+ return bindings;
+ }
+ case BindingCount.MultipleBindingsAvailable:
+ default:
+ if (!target.isArray()) {
+ var serviceIdentifierString = getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.AMBIGUOUS_MATCH + " " + serviceIdentifierString;
+ msg += listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ else {
+ return bindings;
+ }
+ }
+}
+function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {
+ var activeBindings;
+ var childRequest;
+ if (parentRequest === null) {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);
+ childRequest = new Request(serviceIdentifier, context, null, activeBindings, target);
+ var thePlan = new Plan(context, childRequest);
+ context.addPlan(thePlan);
+ }
+ else {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);
+ childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);
+ }
+ activeBindings.forEach(function (binding) {
+ var subChildRequest = null;
+ if (target.isArray()) {
+ subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);
+ }
+ else {
+ if (binding.cache) {
+ return;
+ }
+ subChildRequest = childRequest;
+ }
+ if (binding.type === BindingTypeEnum.Instance && binding.implementationType !== null) {
+ var dependencies = getDependencies(metadataReader, binding.implementationType);
+ if (!context.container.options.skipBaseClassChecks) {
+ var baseClassDependencyCount = getBaseClassDependencyCount(metadataReader, binding.implementationType);
+ if (dependencies.length < baseClassDependencyCount) {
+ var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(getFunctionName(binding.implementationType));
+ throw new Error(error);
+ }
+ }
+ dependencies.forEach(function (dependency) {
+ _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);
+ });
+ }
+ });
+}
+function getBindings(container, serviceIdentifier) {
+ var bindings = [];
+ var bindingDictionary = getBindingDictionary(container);
+ if (bindingDictionary.hasKey(serviceIdentifier)) {
+ bindings = bindingDictionary.get(serviceIdentifier);
+ }
+ else if (container.parent !== null) {
+ bindings = getBindings(container.parent, serviceIdentifier);
+ }
+ return bindings;
+}
+function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
+ if (avoidConstraints === void 0) { avoidConstraints = false; }
+ var context = new Context(container);
+ var target = _createTarget(isMultiInject, targetType, serviceIdentifier, "", key, value);
+ try {
+ _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
+ return context;
+ }
+ catch (error) {
+ if (isStackOverflowExeption(error)) {
+ if (context.plan) {
+ circularDependencyToException(context.plan.rootRequest);
+ }
+ }
+ throw error;
+ }
+}
+function createMockRequest(container, serviceIdentifier, key, value) {
+ var target = new Target(TargetTypeEnum.Variable, "", serviceIdentifier, new Metadata(key, value));
+ var context = new Context(container);
+ var request = new Request(serviceIdentifier, context, null, [], target);
+ return request;
+}
+export { plan, createMockRequest, getBindingDictionary };
diff --git a/src/node_modules/inversify/es/planning/queryable_string.js b/src/node_modules/inversify/es/planning/queryable_string.js
new file mode 100644
index 0000000..37fc84d
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/queryable_string.js
@@ -0,0 +1,25 @@
+var QueryableString = (function () {
+ function QueryableString(str) {
+ this.str = str;
+ }
+ QueryableString.prototype.startsWith = function (searchString) {
+ return this.str.indexOf(searchString) === 0;
+ };
+ QueryableString.prototype.endsWith = function (searchString) {
+ var reverseString = "";
+ var reverseSearchString = searchString.split("").reverse().join("");
+ reverseString = this.str.split("").reverse().join("");
+ return this.startsWith.call({ str: reverseString }, reverseSearchString);
+ };
+ QueryableString.prototype.contains = function (searchString) {
+ return (this.str.indexOf(searchString) !== -1);
+ };
+ QueryableString.prototype.equals = function (compareString) {
+ return this.str === compareString;
+ };
+ QueryableString.prototype.value = function () {
+ return this.str;
+ };
+ return QueryableString;
+}());
+export { QueryableString };
diff --git a/src/node_modules/inversify/es/planning/reflection_utils.js b/src/node_modules/inversify/es/planning/reflection_utils.js
new file mode 100644
index 0000000..f3ff0ce
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/reflection_utils.js
@@ -0,0 +1,120 @@
+import { LazyServiceIdentifer } from "../annotation/inject";
+import * as ERROR_MSGS from "../constants/error_msgs";
+import { TargetTypeEnum } from "../constants/literal_types";
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { getFunctionName } from "../utils/serialization";
+import { Target } from "./target";
+function getDependencies(metadataReader, func) {
+ var constructorName = getFunctionName(func);
+ var targets = getTargets(metadataReader, constructorName, func, false);
+ return targets;
+}
+function getTargets(metadataReader, constructorName, func, isBaseClass) {
+ var metadata = metadataReader.getConstructorMetadata(func);
+ var serviceIdentifiers = metadata.compilerGeneratedMetadata;
+ if (serviceIdentifiers === undefined) {
+ var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION + " " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var constructorArgsMetadata = metadata.userGeneratedMetadata;
+ var keys = Object.keys(constructorArgsMetadata);
+ var hasUserDeclaredUnknownInjections = (func.length === 0 && keys.length > 0);
+ var iterations = (hasUserDeclaredUnknownInjections) ? keys.length : func.length;
+ var constructorTargets = getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations);
+ var propertyTargets = getClassPropsAsTargets(metadataReader, func);
+ var targets = constructorTargets.concat(propertyTargets);
+ return targets;
+}
+function getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata) {
+ var targetMetadata = constructorArgsMetadata[index.toString()] || [];
+ var metadata = formatTargetMetadata(targetMetadata);
+ var isManaged = metadata.unmanaged !== true;
+ var serviceIdentifier = serviceIdentifiers[index];
+ var injectIdentifier = (metadata.inject || metadata.multiInject);
+ serviceIdentifier = (injectIdentifier) ? (injectIdentifier) : serviceIdentifier;
+ if (serviceIdentifier instanceof LazyServiceIdentifer) {
+ serviceIdentifier = serviceIdentifier.unwrap();
+ }
+ if (isManaged) {
+ var isObject = serviceIdentifier === Object;
+ var isFunction = serviceIdentifier === Function;
+ var isUndefined = serviceIdentifier === undefined;
+ var isUnknownType = (isObject || isFunction || isUndefined);
+ if (!isBaseClass && isUnknownType) {
+ var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION + " argument " + index + " in class " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var target = new Target(TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ return target;
+ }
+ return null;
+}
+function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations) {
+ var targets = [];
+ for (var i = 0; i < iterations; i++) {
+ var index = i;
+ var target = getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata);
+ if (target !== null) {
+ targets.push(target);
+ }
+ }
+ return targets;
+}
+function getClassPropsAsTargets(metadataReader, constructorFunc) {
+ var classPropsMetadata = metadataReader.getPropertiesMetadata(constructorFunc);
+ var targets = [];
+ var keys = Object.keys(classPropsMetadata);
+ for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
+ var key = keys_1[_i];
+ var targetMetadata = classPropsMetadata[key];
+ var metadata = formatTargetMetadata(classPropsMetadata[key]);
+ var targetName = metadata.targetName || key;
+ var serviceIdentifier = (metadata.inject || metadata.multiInject);
+ var target = new Target(TargetTypeEnum.ClassProperty, targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ targets.push(target);
+ }
+ var baseConstructor = Object.getPrototypeOf(constructorFunc.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseTargets = getClassPropsAsTargets(metadataReader, baseConstructor);
+ targets = targets.concat(baseTargets);
+ }
+ return targets;
+}
+function getBaseClassDependencyCount(metadataReader, func) {
+ var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseConstructorName = getFunctionName(baseConstructor);
+ var targets = getTargets(metadataReader, baseConstructorName, baseConstructor, true);
+ var metadata = targets.map(function (t) {
+ return t.metadata.filter(function (m) {
+ return m.key === METADATA_KEY.UNMANAGED_TAG;
+ });
+ });
+ var unmanagedCount = [].concat.apply([], metadata).length;
+ var dependencyCount = targets.length - unmanagedCount;
+ if (dependencyCount > 0) {
+ return dependencyCount;
+ }
+ else {
+ return getBaseClassDependencyCount(metadataReader, baseConstructor);
+ }
+ }
+ else {
+ return 0;
+ }
+}
+function formatTargetMetadata(targetMetadata) {
+ var targetMetadataMap = {};
+ targetMetadata.forEach(function (m) {
+ targetMetadataMap[m.key.toString()] = m.value;
+ });
+ return {
+ inject: targetMetadataMap[METADATA_KEY.INJECT_TAG],
+ multiInject: targetMetadataMap[METADATA_KEY.MULTI_INJECT_TAG],
+ targetName: targetMetadataMap[METADATA_KEY.NAME_TAG],
+ unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG]
+ };
+}
+export { getDependencies, getBaseClassDependencyCount, getFunctionName };
diff --git a/src/node_modules/inversify/es/planning/request.js b/src/node_modules/inversify/es/planning/request.js
new file mode 100644
index 0000000..d67c63f
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/request.js
@@ -0,0 +1,22 @@
+import { id } from "../utils/id";
+var Request = (function () {
+ function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
+ this.id = id();
+ this.serviceIdentifier = serviceIdentifier;
+ this.parentContext = parentContext;
+ this.parentRequest = parentRequest;
+ this.target = target;
+ this.childRequests = [];
+ this.bindings = (Array.isArray(bindings) ? bindings : [bindings]);
+ this.requestScope = parentRequest === null
+ ? new Map()
+ : null;
+ }
+ Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
+ var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
+ this.childRequests.push(child);
+ return child;
+ };
+ return Request;
+}());
+export { Request };
diff --git a/src/node_modules/inversify/es/planning/target.js b/src/node_modules/inversify/es/planning/target.js
new file mode 100644
index 0000000..77c51c4
--- /dev/null
+++ b/src/node_modules/inversify/es/planning/target.js
@@ -0,0 +1,88 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { id } from "../utils/id";
+import { Metadata } from "./metadata";
+import { QueryableString } from "./queryable_string";
+var Target = (function () {
+ function Target(type, name, serviceIdentifier, namedOrTagged) {
+ this.id = id();
+ this.type = type;
+ this.serviceIdentifier = serviceIdentifier;
+ this.name = new QueryableString(name || "");
+ this.metadata = new Array();
+ var metadataItem = null;
+ if (typeof namedOrTagged === "string") {
+ metadataItem = new Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);
+ }
+ else if (namedOrTagged instanceof Metadata) {
+ metadataItem = namedOrTagged;
+ }
+ if (metadataItem !== null) {
+ this.metadata.push(metadataItem);
+ }
+ }
+ Target.prototype.hasTag = function (key) {
+ for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key) {
+ return true;
+ }
+ }
+ return false;
+ };
+ Target.prototype.isArray = function () {
+ return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);
+ };
+ Target.prototype.matchesArray = function (name) {
+ return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);
+ };
+ Target.prototype.isNamed = function () {
+ return this.hasTag(METADATA_KEY.NAMED_TAG);
+ };
+ Target.prototype.isTagged = function () {
+ return this.metadata.some(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ };
+ Target.prototype.isOptional = function () {
+ return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);
+ };
+ Target.prototype.getNamedTag = function () {
+ if (this.isNamed()) {
+ return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];
+ }
+ return null;
+ };
+ Target.prototype.getCustomTags = function () {
+ if (this.isTagged()) {
+ return this.metadata.filter(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ }
+ return null;
+ };
+ Target.prototype.matchesNamedTag = function (name) {
+ return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);
+ };
+ Target.prototype.matchesTag = function (key) {
+ var _this = this;
+ return function (value) {
+ for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key && m.value === value) {
+ return true;
+ }
+ }
+ return false;
+ };
+ };
+ return Target;
+}());
+export { Target };
diff --git a/src/node_modules/inversify/es/resolution/instantiation.js b/src/node_modules/inversify/es/resolution/instantiation.js
new file mode 100644
index 0000000..01935b7
--- /dev/null
+++ b/src/node_modules/inversify/es/resolution/instantiation.js
@@ -0,0 +1,48 @@
+import { POST_CONSTRUCT_ERROR } from "../constants/error_msgs";
+import { TargetTypeEnum } from "../constants/literal_types";
+import * as METADATA_KEY from "../constants/metadata_keys";
+function _injectProperties(instance, childRequests, resolveRequest) {
+ var propertyInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null &&
+ childRequest.target.type === TargetTypeEnum.ClassProperty);
+ });
+ var propertyInjections = propertyInjectionsRequests.map(resolveRequest);
+ propertyInjectionsRequests.forEach(function (r, index) {
+ var propertyName = "";
+ propertyName = r.target.name.value();
+ var injection = propertyInjections[index];
+ instance[propertyName] = injection;
+ });
+ return instance;
+}
+function _createInstance(Func, injections) {
+ return new (Func.bind.apply(Func, [void 0].concat(injections)))();
+}
+function _postConstruct(constr, result) {
+ if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
+ var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
+ try {
+ result[data.value]();
+ }
+ catch (e) {
+ throw new Error(POST_CONSTRUCT_ERROR(constr.name, e.message));
+ }
+ }
+}
+function resolveInstance(constr, childRequests, resolveRequest) {
+ var result = null;
+ if (childRequests.length > 0) {
+ var constructorInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null && childRequest.target.type === TargetTypeEnum.ConstructorArgument);
+ });
+ var constructorInjections = constructorInjectionsRequests.map(resolveRequest);
+ result = _createInstance(constr, constructorInjections);
+ result = _injectProperties(result, childRequests, resolveRequest);
+ }
+ else {
+ result = new constr();
+ }
+ _postConstruct(constr, result);
+ return result;
+}
+export { resolveInstance };
diff --git a/src/node_modules/inversify/es/resolution/resolver.js b/src/node_modules/inversify/es/resolution/resolver.js
new file mode 100644
index 0000000..02e052d
--- /dev/null
+++ b/src/node_modules/inversify/es/resolution/resolver.js
@@ -0,0 +1,96 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+import { BindingScopeEnum, BindingTypeEnum } from "../constants/literal_types";
+import { isStackOverflowExeption } from "../utils/exceptions";
+import { getServiceIdentifierAsString } from "../utils/serialization";
+import { resolveInstance } from "./instantiation";
+var invokeFactory = function (factoryType, serviceIdentifier, fn) {
+ try {
+ return fn();
+ }
+ catch (error) {
+ if (isStackOverflowExeption(error)) {
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryType, serviceIdentifier.toString()));
+ }
+ else {
+ throw error;
+ }
+ }
+};
+var _resolveRequest = function (requestScope) {
+ return function (request) {
+ request.parentContext.setCurrentRequest(request);
+ var bindings = request.bindings;
+ var childRequests = request.childRequests;
+ var targetIsAnArray = request.target && request.target.isArray();
+ var targetParentIsNotAnArray = !request.parentRequest ||
+ !request.parentRequest.target ||
+ !request.target ||
+ !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);
+ if (targetIsAnArray && targetParentIsNotAnArray) {
+ return childRequests.map(function (childRequest) {
+ var _f = _resolveRequest(requestScope);
+ return _f(childRequest);
+ });
+ }
+ else {
+ var result = null;
+ if (request.target.isOptional() && bindings.length === 0) {
+ return undefined;
+ }
+ var binding_1 = bindings[0];
+ var isSingleton = binding_1.scope === BindingScopeEnum.Singleton;
+ var isRequestSingleton = binding_1.scope === BindingScopeEnum.Request;
+ if (isSingleton && binding_1.activated) {
+ return binding_1.cache;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ requestScope.has(binding_1.id)) {
+ return requestScope.get(binding_1.id);
+ }
+ if (binding_1.type === BindingTypeEnum.ConstantValue) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === BindingTypeEnum.Function) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === BindingTypeEnum.Constructor) {
+ result = binding_1.implementationType;
+ }
+ else if (binding_1.type === BindingTypeEnum.DynamicValue && binding_1.dynamicValue !== null) {
+ result = invokeFactory("toDynamicValue", binding_1.serviceIdentifier, function () { return binding_1.dynamicValue(request.parentContext); });
+ }
+ else if (binding_1.type === BindingTypeEnum.Factory && binding_1.factory !== null) {
+ result = invokeFactory("toFactory", binding_1.serviceIdentifier, function () { return binding_1.factory(request.parentContext); });
+ }
+ else if (binding_1.type === BindingTypeEnum.Provider && binding_1.provider !== null) {
+ result = invokeFactory("toProvider", binding_1.serviceIdentifier, function () { return binding_1.provider(request.parentContext); });
+ }
+ else if (binding_1.type === BindingTypeEnum.Instance && binding_1.implementationType !== null) {
+ result = resolveInstance(binding_1.implementationType, childRequests, _resolveRequest(requestScope));
+ }
+ else {
+ var serviceIdentifier = getServiceIdentifierAsString(request.serviceIdentifier);
+ throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + " " + serviceIdentifier);
+ }
+ if (typeof binding_1.onActivation === "function") {
+ result = binding_1.onActivation(request.parentContext, result);
+ }
+ if (isSingleton) {
+ binding_1.cache = result;
+ binding_1.activated = true;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ !requestScope.has(binding_1.id)) {
+ requestScope.set(binding_1.id, result);
+ }
+ return result;
+ }
+ };
+};
+function resolve(context) {
+ var _f = _resolveRequest(context.plan.rootRequest.requestScope);
+ return _f(context.plan.rootRequest);
+}
+export { resolve };
diff --git a/src/node_modules/inversify/es/syntax/binding_in_syntax.js b/src/node_modules/inversify/es/syntax/binding_in_syntax.js
new file mode 100644
index 0000000..bbd4bad
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_in_syntax.js
@@ -0,0 +1,21 @@
+import { BindingScopeEnum } from "../constants/literal_types";
+import { BindingWhenOnSyntax } from "./binding_when_on_syntax";
+var BindingInSyntax = (function () {
+ function BindingInSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingInSyntax.prototype.inRequestScope = function () {
+ this._binding.scope = BindingScopeEnum.Request;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inSingletonScope = function () {
+ this._binding.scope = BindingScopeEnum.Singleton;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inTransientScope = function () {
+ this._binding.scope = BindingScopeEnum.Transient;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ return BindingInSyntax;
+}());
+export { BindingInSyntax };
diff --git a/src/node_modules/inversify/es/syntax/binding_in_when_on_syntax.js b/src/node_modules/inversify/es/syntax/binding_in_when_on_syntax.js
new file mode 100644
index 0000000..211542a
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_in_when_on_syntax.js
@@ -0,0 +1,70 @@
+import { BindingInSyntax } from "./binding_in_syntax";
+import { BindingOnSyntax } from "./binding_on_syntax";
+import { BindingWhenSyntax } from "./binding_when_syntax";
+var BindingInWhenOnSyntax = (function () {
+ function BindingInWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new BindingOnSyntax(this._binding);
+ this._bindingInSyntax = new BindingInSyntax(binding);
+ }
+ BindingInWhenOnSyntax.prototype.inRequestScope = function () {
+ return this._bindingInSyntax.inRequestScope();
+ };
+ BindingInWhenOnSyntax.prototype.inSingletonScope = function () {
+ return this._bindingInSyntax.inSingletonScope();
+ };
+ BindingInWhenOnSyntax.prototype.inTransientScope = function () {
+ return this._bindingInSyntax.inTransientScope();
+ };
+ BindingInWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingInWhenOnSyntax;
+}());
+export { BindingInWhenOnSyntax };
diff --git a/src/node_modules/inversify/es/syntax/binding_on_syntax.js b/src/node_modules/inversify/es/syntax/binding_on_syntax.js
new file mode 100644
index 0000000..80a847b
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_on_syntax.js
@@ -0,0 +1,12 @@
+import { BindingWhenSyntax } from "./binding_when_syntax";
+var BindingOnSyntax = (function () {
+ function BindingOnSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingOnSyntax.prototype.onActivation = function (handler) {
+ this._binding.onActivation = handler;
+ return new BindingWhenSyntax(this._binding);
+ };
+ return BindingOnSyntax;
+}());
+export { BindingOnSyntax };
diff --git a/src/node_modules/inversify/es/syntax/binding_to_syntax.js b/src/node_modules/inversify/es/syntax/binding_to_syntax.js
new file mode 100644
index 0000000..4918d30
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_to_syntax.js
@@ -0,0 +1,71 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+import { BindingTypeEnum } from "../constants/literal_types";
+import { BindingInWhenOnSyntax } from "./binding_in_when_on_syntax";
+import { BindingWhenOnSyntax } from "./binding_when_on_syntax";
+var BindingToSyntax = (function () {
+ function BindingToSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingToSyntax.prototype.to = function (constructor) {
+ this._binding.type = BindingTypeEnum.Instance;
+ this._binding.implementationType = constructor;
+ return new BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toSelf = function () {
+ if (typeof this._binding.serviceIdentifier !== "function") {
+ throw new Error("" + ERROR_MSGS.INVALID_TO_SELF_VALUE);
+ }
+ var self = this._binding.serviceIdentifier;
+ return this.to(self);
+ };
+ BindingToSyntax.prototype.toConstantValue = function (value) {
+ this._binding.type = BindingTypeEnum.ConstantValue;
+ this._binding.cache = value;
+ this._binding.dynamicValue = null;
+ this._binding.implementationType = null;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toDynamicValue = function (func) {
+ this._binding.type = BindingTypeEnum.DynamicValue;
+ this._binding.cache = null;
+ this._binding.dynamicValue = func;
+ this._binding.implementationType = null;
+ return new BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toConstructor = function (constructor) {
+ this._binding.type = BindingTypeEnum.Constructor;
+ this._binding.implementationType = constructor;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFactory = function (factory) {
+ this._binding.type = BindingTypeEnum.Factory;
+ this._binding.factory = factory;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFunction = function (func) {
+ if (typeof func !== "function") {
+ throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);
+ }
+ var bindingWhenOnSyntax = this.toConstantValue(func);
+ this._binding.type = BindingTypeEnum.Function;
+ return bindingWhenOnSyntax;
+ };
+ BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) {
+ this._binding.type = BindingTypeEnum.Factory;
+ this._binding.factory = function (context) {
+ var autofactory = function () { return context.container.get(serviceIdentifier); };
+ return autofactory;
+ };
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toProvider = function (provider) {
+ this._binding.type = BindingTypeEnum.Provider;
+ this._binding.provider = provider;
+ return new BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toService = function (service) {
+ this.toDynamicValue(function (context) { return context.container.get(service); });
+ };
+ return BindingToSyntax;
+}());
+export { BindingToSyntax };
diff --git a/src/node_modules/inversify/es/syntax/binding_when_on_syntax.js b/src/node_modules/inversify/es/syntax/binding_when_on_syntax.js
new file mode 100644
index 0000000..4bf0127
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_when_on_syntax.js
@@ -0,0 +1,59 @@
+import { BindingOnSyntax } from "./binding_on_syntax";
+import { BindingWhenSyntax } from "./binding_when_syntax";
+var BindingWhenOnSyntax = (function () {
+ function BindingWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new BindingOnSyntax(this._binding);
+ }
+ BindingWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingWhenOnSyntax;
+}());
+export { BindingWhenOnSyntax };
diff --git a/src/node_modules/inversify/es/syntax/binding_when_syntax.js b/src/node_modules/inversify/es/syntax/binding_when_syntax.js
new file mode 100644
index 0000000..b45e728
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/binding_when_syntax.js
@@ -0,0 +1,96 @@
+import { BindingOnSyntax } from "./binding_on_syntax";
+import { namedConstraint, taggedConstraint, traverseAncerstors, typeConstraint } from "./constraint_helpers";
+var BindingWhenSyntax = (function () {
+ function BindingWhenSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingWhenSyntax.prototype.when = function (constraint) {
+ this._binding.constraint = constraint;
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetNamed = function (name) {
+ this._binding.constraint = namedConstraint(name);
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetIsDefault = function () {
+ this._binding.constraint = function (request) {
+ var targetIsDefault = (request.target !== null) &&
+ (!request.target.isNamed()) &&
+ (!request.target.isTagged());
+ return targetIsDefault;
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetTagged = function (tag, value) {
+ this._binding.constraint = taggedConstraint(tag)(value);
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenInjectedInto = function (parent) {
+ this._binding.constraint = function (request) {
+ return typeConstraint(parent)(request.parentRequest);
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return namedConstraint(name)(request.parentRequest);
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return taggedConstraint(tag)(value)(request.parentRequest);
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return traverseAncerstors(request, typeConstraint(ancestor));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return !traverseAncerstors(request, typeConstraint(ancestor));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return traverseAncerstors(request, namedConstraint(name));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return !traverseAncerstors(request, namedConstraint(name));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return traverseAncerstors(request, taggedConstraint(tag)(value));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return !traverseAncerstors(request, taggedConstraint(tag)(value));
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return traverseAncerstors(request, constraint);
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return !traverseAncerstors(request, constraint);
+ };
+ return new BindingOnSyntax(this._binding);
+ };
+ return BindingWhenSyntax;
+}());
+export { BindingWhenSyntax };
diff --git a/src/node_modules/inversify/es/syntax/constraint_helpers.js b/src/node_modules/inversify/es/syntax/constraint_helpers.js
new file mode 100644
index 0000000..29a7740
--- /dev/null
+++ b/src/node_modules/inversify/es/syntax/constraint_helpers.js
@@ -0,0 +1,35 @@
+import * as METADATA_KEY from "../constants/metadata_keys";
+import { Metadata } from "../planning/metadata";
+var traverseAncerstors = function (request, constraint) {
+ var parent = request.parentRequest;
+ if (parent !== null) {
+ return constraint(parent) ? true : traverseAncerstors(parent, constraint);
+ }
+ else {
+ return false;
+ }
+};
+var taggedConstraint = function (key) { return function (value) {
+ var constraint = function (request) {
+ return request !== null && request.target !== null && request.target.matchesTag(key)(value);
+ };
+ constraint.metaData = new Metadata(key, value);
+ return constraint;
+}; };
+var namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG);
+var typeConstraint = function (type) { return function (request) {
+ var binding = null;
+ if (request !== null) {
+ binding = request.bindings[0];
+ if (typeof type === "string") {
+ var serviceIdentifier = binding.serviceIdentifier;
+ return serviceIdentifier === type;
+ }
+ else {
+ var constructor = request.bindings[0].implementationType;
+ return type === constructor;
+ }
+ }
+ return false;
+}; };
+export { traverseAncerstors, taggedConstraint, namedConstraint, typeConstraint };
diff --git a/src/node_modules/inversify/es/utils/binding_utils.js b/src/node_modules/inversify/es/utils/binding_utils.js
new file mode 100644
index 0000000..3df9d8f
--- /dev/null
+++ b/src/node_modules/inversify/es/utils/binding_utils.js
@@ -0,0 +1,11 @@
+export var multiBindToService = function (container) {
+ return function (service) {
+ return function () {
+ var types = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ types[_i] = arguments[_i];
+ }
+ return types.forEach(function (t) { return container.bind(t).toService(service); });
+ };
+ };
+};
diff --git a/src/node_modules/inversify/es/utils/exceptions.js b/src/node_modules/inversify/es/utils/exceptions.js
new file mode 100644
index 0000000..e458934
--- /dev/null
+++ b/src/node_modules/inversify/es/utils/exceptions.js
@@ -0,0 +1,5 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+export function isStackOverflowExeption(error) {
+ return (error instanceof RangeError ||
+ error.message === ERROR_MSGS.STACK_OVERFLOW);
+}
diff --git a/src/node_modules/inversify/es/utils/id.js b/src/node_modules/inversify/es/utils/id.js
new file mode 100644
index 0000000..2976c9f
--- /dev/null
+++ b/src/node_modules/inversify/es/utils/id.js
@@ -0,0 +1,5 @@
+var idCounter = 0;
+function id() {
+ return idCounter++;
+}
+export { id };
diff --git a/src/node_modules/inversify/es/utils/serialization.js b/src/node_modules/inversify/es/utils/serialization.js
new file mode 100644
index 0000000..9cda0d0
--- /dev/null
+++ b/src/node_modules/inversify/es/utils/serialization.js
@@ -0,0 +1,97 @@
+import * as ERROR_MSGS from "../constants/error_msgs";
+function getServiceIdentifierAsString(serviceIdentifier) {
+ if (typeof serviceIdentifier === "function") {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier.name;
+ }
+ else if (typeof serviceIdentifier === "symbol") {
+ return serviceIdentifier.toString();
+ }
+ else {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier;
+ }
+}
+function listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {
+ var registeredBindingsList = "";
+ var registeredBindings = getBindings(container, serviceIdentifier);
+ if (registeredBindings.length !== 0) {
+ registeredBindingsList = "\nRegistered bindings:";
+ registeredBindings.forEach(function (binding) {
+ var name = "Object";
+ if (binding.implementationType !== null) {
+ name = getFunctionName(binding.implementationType);
+ }
+ registeredBindingsList = registeredBindingsList + "\n " + name;
+ if (binding.constraint.metaData) {
+ registeredBindingsList = registeredBindingsList + " - " + binding.constraint.metaData;
+ }
+ });
+ }
+ return registeredBindingsList;
+}
+function alreadyDependencyChain(request, serviceIdentifier) {
+ if (request.parentRequest === null) {
+ return false;
+ }
+ else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {
+ return true;
+ }
+ else {
+ return alreadyDependencyChain(request.parentRequest, serviceIdentifier);
+ }
+}
+function dependencyChainToString(request) {
+ function _createStringArr(req, result) {
+ if (result === void 0) { result = []; }
+ var serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);
+ result.push(serviceIdentifier);
+ if (req.parentRequest !== null) {
+ return _createStringArr(req.parentRequest, result);
+ }
+ return result;
+ }
+ var stringArr = _createStringArr(request);
+ return stringArr.reverse().join(" --> ");
+}
+function circularDependencyToException(request) {
+ request.childRequests.forEach(function (childRequest) {
+ if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) {
+ var services = dependencyChainToString(childRequest);
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + " " + services);
+ }
+ else {
+ circularDependencyToException(childRequest);
+ }
+ });
+}
+function listMetadataForTarget(serviceIdentifierString, target) {
+ if (target.isTagged() || target.isNamed()) {
+ var m_1 = "";
+ var namedTag = target.getNamedTag();
+ var otherTags = target.getCustomTags();
+ if (namedTag !== null) {
+ m_1 += namedTag.toString() + "\n";
+ }
+ if (otherTags !== null) {
+ otherTags.forEach(function (tag) {
+ m_1 += tag.toString() + "\n";
+ });
+ }
+ return " " + serviceIdentifierString + "\n " + serviceIdentifierString + " - " + m_1;
+ }
+ else {
+ return " " + serviceIdentifierString;
+ }
+}
+function getFunctionName(v) {
+ if (v.name) {
+ return v.name;
+ }
+ else {
+ var name_1 = v.toString();
+ var match = name_1.match(/^function\s*([^\s(]+)/);
+ return match ? match[1] : "Anonymous function: " + name_1;
+ }
+}
+export { getFunctionName, getServiceIdentifierAsString, listRegisteredBindingsForServiceIdentifier, listMetadataForTarget, circularDependencyToException };
diff --git a/src/node_modules/inversify/lib/annotation/decorator_utils.js b/src/node_modules/inversify/lib/annotation/decorator_utils.js
new file mode 100644
index 0000000..629d08a
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/decorator_utils.js
@@ -0,0 +1,58 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+var METADATA_KEY = require("../constants/metadata_keys");
+function tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED;
+ _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);
+}
+exports.tagParameter = tagParameter;
+function tagProperty(annotationTarget, propertyName, metadata) {
+ var metadataKey = METADATA_KEY.TAGGED_PROP;
+ _tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);
+}
+exports.tagProperty = tagProperty;
+function _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {
+ var paramsOrPropertiesMetadata = {};
+ var isParameterDecorator = (typeof parameterIndex === "number");
+ var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;
+ if (isParameterDecorator && propertyName !== undefined) {
+ throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);
+ }
+ if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
+ paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);
+ }
+ var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];
+ if (!Array.isArray(paramOrPropertyMetadata)) {
+ paramOrPropertyMetadata = [];
+ }
+ else {
+ for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {
+ var m = paramOrPropertyMetadata_1[_i];
+ if (m.key === metadata.key) {
+ throw new Error(ERROR_MSGS.DUPLICATED_METADATA + " " + m.key.toString());
+ }
+ }
+ }
+ paramOrPropertyMetadata.push(metadata);
+ paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;
+ Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);
+}
+function _decorate(decorators, target) {
+ Reflect.decorate(decorators, target);
+}
+function _param(paramIndex, decorator) {
+ return function (target, key) { decorator(target, key, paramIndex); };
+}
+function decorate(decorator, target, parameterIndex) {
+ if (typeof parameterIndex === "number") {
+ _decorate([_param(parameterIndex, decorator)], target);
+ }
+ else if (typeof parameterIndex === "string") {
+ Reflect.decorate([decorator], target, parameterIndex);
+ }
+ else {
+ _decorate([decorator], target);
+ }
+}
+exports.decorate = decorate;
diff --git a/src/node_modules/inversify/lib/annotation/inject.js b/src/node_modules/inversify/lib/annotation/inject.js
new file mode 100644
index 0000000..d3c6502
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/inject.js
@@ -0,0 +1,31 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var error_msgs_1 = require("../constants/error_msgs");
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+var LazyServiceIdentifer = (function () {
+ function LazyServiceIdentifer(cb) {
+ this._cb = cb;
+ }
+ LazyServiceIdentifer.prototype.unwrap = function () {
+ return this._cb();
+ };
+ return LazyServiceIdentifer;
+}());
+exports.LazyServiceIdentifer = LazyServiceIdentifer;
+function inject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ if (serviceIdentifier === undefined) {
+ throw new Error(error_msgs_1.UNDEFINED_INJECT_ANNOTATION(target.name));
+ }
+ var metadata = new metadata_1.Metadata(METADATA_KEY.INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+exports.inject = inject;
diff --git a/src/node_modules/inversify/lib/annotation/injectable.js b/src/node_modules/inversify/lib/annotation/injectable.js
new file mode 100644
index 0000000..f1e4f73
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/injectable.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERRORS_MSGS = require("../constants/error_msgs");
+var METADATA_KEY = require("../constants/metadata_keys");
+function injectable() {
+ return function (target) {
+ if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {
+ throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);
+ }
+ var types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];
+ Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);
+ return target;
+ };
+}
+exports.injectable = injectable;
diff --git a/src/node_modules/inversify/lib/annotation/multi_inject.js b/src/node_modules/inversify/lib/annotation/multi_inject.js
new file mode 100644
index 0000000..f7e7fd8
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/multi_inject.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function multiInject(serviceIdentifier) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.MULTI_INJECT_TAG, serviceIdentifier);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+exports.multiInject = multiInject;
diff --git a/src/node_modules/inversify/lib/annotation/named.js b/src/node_modules/inversify/lib/annotation/named.js
new file mode 100644
index 0000000..0c14304
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/named.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function named(name) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, name);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+exports.named = named;
diff --git a/src/node_modules/inversify/lib/annotation/optional.js b/src/node_modules/inversify/lib/annotation/optional.js
new file mode 100644
index 0000000..afe0df8
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/optional.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function optional() {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+exports.optional = optional;
diff --git a/src/node_modules/inversify/lib/annotation/post_construct.js b/src/node_modules/inversify/lib/annotation/post_construct.js
new file mode 100644
index 0000000..007c011
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/post_construct.js
@@ -0,0 +1,15 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERRORS_MSGS = require("../constants/error_msgs");
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+function postConstruct() {
+ return function (target, propertyKey, descriptor) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.POST_CONSTRUCT, propertyKey);
+ if (Reflect.hasOwnMetadata(METADATA_KEY.POST_CONSTRUCT, target.constructor)) {
+ throw new Error(ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS);
+ }
+ Reflect.defineMetadata(METADATA_KEY.POST_CONSTRUCT, metadata, target.constructor);
+ };
+}
+exports.postConstruct = postConstruct;
diff --git a/src/node_modules/inversify/lib/annotation/tagged.js b/src/node_modules/inversify/lib/annotation/tagged.js
new file mode 100644
index 0000000..be07ff5
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/tagged.js
@@ -0,0 +1,16 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function tagged(metadataKey, metadataValue) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(metadataKey, metadataValue);
+ if (typeof index === "number") {
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ }
+ else {
+ decorator_utils_1.tagProperty(target, targetKey, metadata);
+ }
+ };
+}
+exports.tagged = tagged;
diff --git a/src/node_modules/inversify/lib/annotation/target_name.js b/src/node_modules/inversify/lib/annotation/target_name.js
new file mode 100644
index 0000000..9111c05
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/target_name.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function targetName(name) {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.NAME_TAG, name);
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ };
+}
+exports.targetName = targetName;
diff --git a/src/node_modules/inversify/lib/annotation/unmanaged.js b/src/node_modules/inversify/lib/annotation/unmanaged.js
new file mode 100644
index 0000000..31b2a40
--- /dev/null
+++ b/src/node_modules/inversify/lib/annotation/unmanaged.js
@@ -0,0 +1,12 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var decorator_utils_1 = require("./decorator_utils");
+function unmanaged() {
+ return function (target, targetKey, index) {
+ var metadata = new metadata_1.Metadata(METADATA_KEY.UNMANAGED_TAG, true);
+ decorator_utils_1.tagParameter(target, targetKey, index, metadata);
+ };
+}
+exports.unmanaged = unmanaged;
diff --git a/src/node_modules/inversify/lib/bindings/binding.js b/src/node_modules/inversify/lib/bindings/binding.js
new file mode 100644
index 0000000..cd87d83
--- /dev/null
+++ b/src/node_modules/inversify/lib/bindings/binding.js
@@ -0,0 +1,36 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var literal_types_1 = require("../constants/literal_types");
+var id_1 = require("../utils/id");
+var Binding = (function () {
+ function Binding(serviceIdentifier, scope) {
+ this.id = id_1.id();
+ this.activated = false;
+ this.serviceIdentifier = serviceIdentifier;
+ this.scope = scope;
+ this.type = literal_types_1.BindingTypeEnum.Invalid;
+ this.constraint = function (request) { return true; };
+ this.implementationType = null;
+ this.cache = null;
+ this.factory = null;
+ this.provider = null;
+ this.onActivation = null;
+ this.dynamicValue = null;
+ }
+ Binding.prototype.clone = function () {
+ var clone = new Binding(this.serviceIdentifier, this.scope);
+ clone.activated = false;
+ clone.implementationType = this.implementationType;
+ clone.dynamicValue = this.dynamicValue;
+ clone.scope = this.scope;
+ clone.type = this.type;
+ clone.factory = this.factory;
+ clone.provider = this.provider;
+ clone.constraint = this.constraint;
+ clone.onActivation = this.onActivation;
+ clone.cache = this.cache;
+ return clone;
+ };
+ return Binding;
+}());
+exports.Binding = Binding;
diff --git a/src/node_modules/inversify/lib/bindings/binding_count.js b/src/node_modules/inversify/lib/bindings/binding_count.js
new file mode 100644
index 0000000..d9c80a2
--- /dev/null
+++ b/src/node_modules/inversify/lib/bindings/binding_count.js
@@ -0,0 +1,8 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var BindingCount = {
+ MultipleBindingsAvailable: 2,
+ NoBindingsAvailable: 0,
+ OnlyOneBindingAvailable: 1
+};
+exports.BindingCount = BindingCount;
diff --git a/src/node_modules/inversify/lib/constants/error_msgs.js b/src/node_modules/inversify/lib/constants/error_msgs.js
new file mode 100644
index 0000000..d23e991
--- /dev/null
+++ b/src/node_modules/inversify/lib/constants/error_msgs.js
@@ -0,0 +1,60 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.DUPLICATED_INJECTABLE_DECORATOR = "Cannot apply @injectable decorator multiple times.";
+exports.DUPLICATED_METADATA = "Metadata key was used more than once in a parameter:";
+exports.NULL_ARGUMENT = "NULL argument";
+exports.KEY_NOT_FOUND = "Key Not Found";
+exports.AMBIGUOUS_MATCH = "Ambiguous match found for serviceIdentifier:";
+exports.CANNOT_UNBIND = "Could not unbind serviceIdentifier:";
+exports.NOT_REGISTERED = "No matching bindings found for serviceIdentifier:";
+exports.MISSING_INJECTABLE_ANNOTATION = "Missing required @injectable annotation in:";
+exports.MISSING_INJECT_ANNOTATION = "Missing required @inject or @multiInject annotation in:";
+exports.UNDEFINED_INJECT_ANNOTATION = function (name) {
+ return "@inject called with undefined this could mean that the class " + name + " has " +
+ "a circular dependency problem. You can use a LazyServiceIdentifer to " +
+ "overcome this limitation.";
+};
+exports.CIRCULAR_DEPENDENCY = "Circular dependency found:";
+exports.NOT_IMPLEMENTED = "Sorry, this feature is not fully implemented yet.";
+exports.INVALID_BINDING_TYPE = "Invalid binding type:";
+exports.NO_MORE_SNAPSHOTS_AVAILABLE = "No snapshot available to restore.";
+exports.INVALID_MIDDLEWARE_RETURN = "Invalid return type in middleware. Middleware must return!";
+exports.INVALID_FUNCTION_BINDING = "Value provided to function binding must be a function!";
+exports.INVALID_TO_SELF_VALUE = "The toSelf function can only be applied when a constructor is " +
+ "used as service identifier";
+exports.INVALID_DECORATOR_OPERATION = "The @inject @multiInject @tagged and @named decorators " +
+ "must be applied to the parameters of a class constructor or a class property.";
+exports.ARGUMENTS_LENGTH_MISMATCH = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "The number of constructor arguments in the derived class " +
+ (values[0] + " must be >= than the number of constructor arguments of its base class.");
+};
+exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = "Invalid Container constructor argument. Container options " +
+ "must be an object.";
+exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = "Invalid Container option. Default scope must " +
+ "be a string ('singleton' or 'transient').";
+exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = "Invalid Container option. Auto bind injectable must " +
+ "be a boolean";
+exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = "Invalid Container option. Skip base check must " +
+ "be a boolean";
+exports.MULTIPLE_POST_CONSTRUCT_METHODS = "Cannot apply @postConstruct decorator multiple times in the same class";
+exports.POST_CONSTRUCT_ERROR = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "@postConstruct error in class " + values[0] + ": " + values[1];
+};
+exports.CIRCULAR_DEPENDENCY_IN_FACTORY = function () {
+ var values = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ values[_i] = arguments[_i];
+ }
+ return "It looks like there is a circular dependency " +
+ ("in one of the '" + values[0] + "' bindings. Please investigate bindings with") +
+ ("service identifier '" + values[1] + "'.");
+};
+exports.STACK_OVERFLOW = "Maximum call stack size exceeded";
diff --git a/src/node_modules/inversify/lib/constants/literal_types.js b/src/node_modules/inversify/lib/constants/literal_types.js
new file mode 100644
index 0000000..106eb5e
--- /dev/null
+++ b/src/node_modules/inversify/lib/constants/literal_types.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var BindingScopeEnum = {
+ Request: "Request",
+ Singleton: "Singleton",
+ Transient: "Transient"
+};
+exports.BindingScopeEnum = BindingScopeEnum;
+var BindingTypeEnum = {
+ ConstantValue: "ConstantValue",
+ Constructor: "Constructor",
+ DynamicValue: "DynamicValue",
+ Factory: "Factory",
+ Function: "Function",
+ Instance: "Instance",
+ Invalid: "Invalid",
+ Provider: "Provider"
+};
+exports.BindingTypeEnum = BindingTypeEnum;
+var TargetTypeEnum = {
+ ClassProperty: "ClassProperty",
+ ConstructorArgument: "ConstructorArgument",
+ Variable: "Variable"
+};
+exports.TargetTypeEnum = TargetTypeEnum;
diff --git a/src/node_modules/inversify/lib/constants/metadata_keys.js b/src/node_modules/inversify/lib/constants/metadata_keys.js
new file mode 100644
index 0000000..36968b0
--- /dev/null
+++ b/src/node_modules/inversify/lib/constants/metadata_keys.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.NAMED_TAG = "named";
+exports.NAME_TAG = "name";
+exports.UNMANAGED_TAG = "unmanaged";
+exports.OPTIONAL_TAG = "optional";
+exports.INJECT_TAG = "inject";
+exports.MULTI_INJECT_TAG = "multi_inject";
+exports.TAGGED = "inversify:tagged";
+exports.TAGGED_PROP = "inversify:tagged_props";
+exports.PARAM_TYPES = "inversify:paramtypes";
+exports.DESIGN_PARAM_TYPES = "design:paramtypes";
+exports.POST_CONSTRUCT = "post_construct";
diff --git a/src/node_modules/inversify/lib/container/container.js b/src/node_modules/inversify/lib/container/container.js
new file mode 100644
index 0000000..83d372e
--- /dev/null
+++ b/src/node_modules/inversify/lib/container/container.js
@@ -0,0 +1,325 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+ return new (P || (P = Promise))(function (resolve, reject) {
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+ function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
+ });
+};
+var __generator = (this && this.__generator) || function (thisArg, body) {
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
+ function verb(n) { return function (v) { return step([n, v]); }; }
+ function step(op) {
+ if (f) throw new TypeError("Generator is already executing.");
+ while (_) try {
+ if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
+ if (y = 0, t) op = [0, t.value];
+ switch (op[0]) {
+ case 0: case 1: t = op; break;
+ case 4: _.label++; return { value: op[1], done: false };
+ case 5: _.label++; y = op[1]; op = [0]; continue;
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
+ default:
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
+ if (t[2]) _.ops.pop();
+ _.trys.pop(); continue;
+ }
+ op = body.call(thisArg, _);
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
+ }
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_1 = require("../bindings/binding");
+var ERROR_MSGS = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_reader_1 = require("../planning/metadata_reader");
+var planner_1 = require("../planning/planner");
+var resolver_1 = require("../resolution/resolver");
+var binding_to_syntax_1 = require("../syntax/binding_to_syntax");
+var id_1 = require("../utils/id");
+var serialization_1 = require("../utils/serialization");
+var container_snapshot_1 = require("./container_snapshot");
+var lookup_1 = require("./lookup");
+var Container = (function () {
+ function Container(containerOptions) {
+ var options = containerOptions || {};
+ if (typeof options !== "object") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);
+ }
+ if (options.defaultScope === undefined) {
+ options.defaultScope = literal_types_1.BindingScopeEnum.Transient;
+ }
+ else if (options.defaultScope !== literal_types_1.BindingScopeEnum.Singleton &&
+ options.defaultScope !== literal_types_1.BindingScopeEnum.Transient &&
+ options.defaultScope !== literal_types_1.BindingScopeEnum.Request) {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);
+ }
+ if (options.autoBindInjectable === undefined) {
+ options.autoBindInjectable = false;
+ }
+ else if (typeof options.autoBindInjectable !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);
+ }
+ if (options.skipBaseClassChecks === undefined) {
+ options.skipBaseClassChecks = false;
+ }
+ else if (typeof options.skipBaseClassChecks !== "boolean") {
+ throw new Error("" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);
+ }
+ this.options = {
+ autoBindInjectable: options.autoBindInjectable,
+ defaultScope: options.defaultScope,
+ skipBaseClassChecks: options.skipBaseClassChecks
+ };
+ this.id = id_1.id();
+ this._bindingDictionary = new lookup_1.Lookup();
+ this._snapshots = [];
+ this._middleware = null;
+ this.parent = null;
+ this._metadataReader = new metadata_reader_1.MetadataReader();
+ }
+ Container.merge = function (container1, container2) {
+ var container = new Container();
+ var bindingDictionary = planner_1.getBindingDictionary(container);
+ var bindingDictionary1 = planner_1.getBindingDictionary(container1);
+ var bindingDictionary2 = planner_1.getBindingDictionary(container2);
+ function copyDictionary(origin, destination) {
+ origin.traverse(function (key, value) {
+ value.forEach(function (binding) {
+ destination.add(binding.serviceIdentifier, binding.clone());
+ });
+ });
+ }
+ copyDictionary(bindingDictionary1, bindingDictionary);
+ copyDictionary(bindingDictionary2, bindingDictionary);
+ return container;
+ };
+ Container.prototype.load = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var getHelpers = this._getContainerModuleHelpersFactory();
+ for (var _a = 0, modules_1 = modules; _a < modules_1.length; _a++) {
+ var currentModule = modules_1[_a];
+ var containerModuleHelpers = getHelpers(currentModule.id);
+ currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);
+ }
+ };
+ Container.prototype.loadAsync = function () {
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ return __awaiter(this, void 0, void 0, function () {
+ var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;
+ return __generator(this, function (_b) {
+ switch (_b.label) {
+ case 0:
+ getHelpers = this._getContainerModuleHelpersFactory();
+ _a = 0, modules_2 = modules;
+ _b.label = 1;
+ case 1:
+ if (!(_a < modules_2.length)) return [3, 4];
+ currentModule = modules_2[_a];
+ containerModuleHelpers = getHelpers(currentModule.id);
+ return [4, currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction)];
+ case 2:
+ _b.sent();
+ _b.label = 3;
+ case 3:
+ _a++;
+ return [3, 1];
+ case 4: return [2];
+ }
+ });
+ });
+ };
+ Container.prototype.unload = function () {
+ var _this = this;
+ var modules = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ modules[_i] = arguments[_i];
+ }
+ var conditionFactory = function (expected) { return function (item) {
+ return item.moduleId === expected;
+ }; };
+ modules.forEach(function (module) {
+ var condition = conditionFactory(module.id);
+ _this._bindingDictionary.removeByCondition(condition);
+ });
+ };
+ Container.prototype.bind = function (serviceIdentifier) {
+ var scope = this.options.defaultScope || literal_types_1.BindingScopeEnum.Transient;
+ var binding = new binding_1.Binding(serviceIdentifier, scope);
+ this._bindingDictionary.add(serviceIdentifier, binding);
+ return new binding_to_syntax_1.BindingToSyntax(binding);
+ };
+ Container.prototype.rebind = function (serviceIdentifier) {
+ this.unbind(serviceIdentifier);
+ return this.bind(serviceIdentifier);
+ };
+ Container.prototype.unbind = function (serviceIdentifier) {
+ try {
+ this._bindingDictionary.remove(serviceIdentifier);
+ }
+ catch (e) {
+ throw new Error(ERROR_MSGS.CANNOT_UNBIND + " " + serialization_1.getServiceIdentifierAsString(serviceIdentifier));
+ }
+ };
+ Container.prototype.unbindAll = function () {
+ this._bindingDictionary = new lookup_1.Lookup();
+ };
+ Container.prototype.isBound = function (serviceIdentifier) {
+ var bound = this._bindingDictionary.hasKey(serviceIdentifier);
+ if (!bound && this.parent) {
+ bound = this.parent.isBound(serviceIdentifier);
+ }
+ return bound;
+ };
+ Container.prototype.isBoundNamed = function (serviceIdentifier, named) {
+ return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.isBoundTagged = function (serviceIdentifier, key, value) {
+ var bound = false;
+ if (this._bindingDictionary.hasKey(serviceIdentifier)) {
+ var bindings = this._bindingDictionary.get(serviceIdentifier);
+ var request_1 = planner_1.createMockRequest(this, serviceIdentifier, key, value);
+ bound = bindings.some(function (b) { return b.constraint(request_1); });
+ }
+ if (!bound && this.parent) {
+ bound = this.parent.isBoundTagged(serviceIdentifier, key, value);
+ }
+ return bound;
+ };
+ Container.prototype.snapshot = function () {
+ this._snapshots.push(container_snapshot_1.ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware));
+ };
+ Container.prototype.restore = function () {
+ var snapshot = this._snapshots.pop();
+ if (snapshot === undefined) {
+ throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);
+ }
+ this._bindingDictionary = snapshot.bindings;
+ this._middleware = snapshot.middleware;
+ };
+ Container.prototype.createChild = function (containerOptions) {
+ var child = new Container(containerOptions || this.options);
+ child.parent = this;
+ return child;
+ };
+ Container.prototype.applyMiddleware = function () {
+ var middlewares = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ middlewares[_i] = arguments[_i];
+ }
+ var initial = (this._middleware) ? this._middleware : this._planAndResolve();
+ this._middleware = middlewares.reduce(function (prev, curr) { return curr(prev); }, initial);
+ };
+ Container.prototype.applyCustomMetadataReader = function (metadataReader) {
+ this._metadataReader = metadataReader;
+ };
+ Container.prototype.get = function (serviceIdentifier) {
+ return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getNamed = function (serviceIdentifier, named) {
+ return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.getAll = function (serviceIdentifier) {
+ return this._get(true, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);
+ };
+ Container.prototype.getAllTagged = function (serviceIdentifier, key, value) {
+ return this._get(false, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);
+ };
+ Container.prototype.getAllNamed = function (serviceIdentifier, named) {
+ return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);
+ };
+ Container.prototype.resolve = function (constructorFunction) {
+ var tempContainer = this.createChild();
+ tempContainer.bind(constructorFunction).toSelf();
+ return tempContainer.get(constructorFunction);
+ };
+ Container.prototype._getContainerModuleHelpersFactory = function () {
+ var _this = this;
+ var setModuleId = function (bindingToSyntax, moduleId) {
+ bindingToSyntax._binding.moduleId = moduleId;
+ };
+ var getBindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _bind = _this.bind.bind(_this);
+ var bindingToSyntax = _bind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ var getUnbindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _unbind = _this.unbind.bind(_this);
+ _unbind(serviceIdentifier);
+ };
+ };
+ var getIsboundFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _isBound = _this.isBound.bind(_this);
+ return _isBound(serviceIdentifier);
+ };
+ };
+ var getRebindFunction = function (moduleId) {
+ return function (serviceIdentifier) {
+ var _rebind = _this.rebind.bind(_this);
+ var bindingToSyntax = _rebind(serviceIdentifier);
+ setModuleId(bindingToSyntax, moduleId);
+ return bindingToSyntax;
+ };
+ };
+ return function (mId) { return ({
+ bindFunction: getBindFunction(mId),
+ isboundFunction: getIsboundFunction(mId),
+ rebindFunction: getRebindFunction(mId),
+ unbindFunction: getUnbindFunction(mId)
+ }); };
+ };
+ Container.prototype._get = function (avoidConstraints, isMultiInject, targetType, serviceIdentifier, key, value) {
+ var result = null;
+ var defaultArgs = {
+ avoidConstraints: avoidConstraints,
+ contextInterceptor: function (context) { return context; },
+ isMultiInject: isMultiInject,
+ key: key,
+ serviceIdentifier: serviceIdentifier,
+ targetType: targetType,
+ value: value
+ };
+ if (this._middleware) {
+ result = this._middleware(defaultArgs);
+ if (result === undefined || result === null) {
+ throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);
+ }
+ }
+ else {
+ result = this._planAndResolve()(defaultArgs);
+ }
+ return result;
+ };
+ Container.prototype._planAndResolve = function () {
+ var _this = this;
+ return function (args) {
+ var context = planner_1.plan(_this._metadataReader, _this, args.isMultiInject, args.targetType, args.serviceIdentifier, args.key, args.value, args.avoidConstraints);
+ context = args.contextInterceptor(context);
+ var result = resolver_1.resolve(context);
+ return result;
+ };
+ };
+ return Container;
+}());
+exports.Container = Container;
diff --git a/src/node_modules/inversify/lib/container/container_module.js b/src/node_modules/inversify/lib/container/container_module.js
new file mode 100644
index 0000000..64d3f84
--- /dev/null
+++ b/src/node_modules/inversify/lib/container/container_module.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var id_1 = require("../utils/id");
+var ContainerModule = (function () {
+ function ContainerModule(registry) {
+ this.id = id_1.id();
+ this.registry = registry;
+ }
+ return ContainerModule;
+}());
+exports.ContainerModule = ContainerModule;
+var AsyncContainerModule = (function () {
+ function AsyncContainerModule(registry) {
+ this.id = id_1.id();
+ this.registry = registry;
+ }
+ return AsyncContainerModule;
+}());
+exports.AsyncContainerModule = AsyncContainerModule;
diff --git a/src/node_modules/inversify/lib/container/container_snapshot.js b/src/node_modules/inversify/lib/container/container_snapshot.js
new file mode 100644
index 0000000..eef2b5e
--- /dev/null
+++ b/src/node_modules/inversify/lib/container/container_snapshot.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ContainerSnapshot = (function () {
+ function ContainerSnapshot() {
+ }
+ ContainerSnapshot.of = function (bindings, middleware) {
+ var snapshot = new ContainerSnapshot();
+ snapshot.bindings = bindings;
+ snapshot.middleware = middleware;
+ return snapshot;
+ };
+ return ContainerSnapshot;
+}());
+exports.ContainerSnapshot = ContainerSnapshot;
diff --git a/src/node_modules/inversify/lib/container/lookup.js b/src/node_modules/inversify/lib/container/lookup.js
new file mode 100644
index 0000000..912504d
--- /dev/null
+++ b/src/node_modules/inversify/lib/container/lookup.js
@@ -0,0 +1,79 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+var Lookup = (function () {
+ function Lookup() {
+ this._map = new Map();
+ }
+ Lookup.prototype.getMap = function () {
+ return this._map;
+ };
+ Lookup.prototype.add = function (serviceIdentifier, value) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (value === null || value === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ entry.push(value);
+ this._map.set(serviceIdentifier, entry);
+ }
+ else {
+ this._map.set(serviceIdentifier, [value]);
+ }
+ };
+ Lookup.prototype.get = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ var entry = this._map.get(serviceIdentifier);
+ if (entry !== undefined) {
+ return entry;
+ }
+ else {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.remove = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ if (!this._map.delete(serviceIdentifier)) {
+ throw new Error(ERROR_MSGS.KEY_NOT_FOUND);
+ }
+ };
+ Lookup.prototype.removeByCondition = function (condition) {
+ var _this = this;
+ this._map.forEach(function (entries, key) {
+ var updatedEntries = entries.filter(function (entry) { return !condition(entry); });
+ if (updatedEntries.length > 0) {
+ _this._map.set(key, updatedEntries);
+ }
+ else {
+ _this._map.delete(key);
+ }
+ });
+ };
+ Lookup.prototype.hasKey = function (serviceIdentifier) {
+ if (serviceIdentifier === null || serviceIdentifier === undefined) {
+ throw new Error(ERROR_MSGS.NULL_ARGUMENT);
+ }
+ return this._map.has(serviceIdentifier);
+ };
+ Lookup.prototype.clone = function () {
+ var copy = new Lookup();
+ this._map.forEach(function (value, key) {
+ value.forEach(function (b) { return copy.add(key, b.clone()); });
+ });
+ return copy;
+ };
+ Lookup.prototype.traverse = function (func) {
+ this._map.forEach(function (value, key) {
+ func(key, value);
+ });
+ };
+ return Lookup;
+}());
+exports.Lookup = Lookup;
diff --git a/src/node_modules/inversify/lib/interfaces/interfaces.js b/src/node_modules/inversify/lib/interfaces/interfaces.js
new file mode 100644
index 0000000..c8ad2e5
--- /dev/null
+++ b/src/node_modules/inversify/lib/interfaces/interfaces.js
@@ -0,0 +1,2 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
diff --git a/src/node_modules/inversify/lib/inversify.js b/src/node_modules/inversify/lib/inversify.js
new file mode 100644
index 0000000..9a2a4be
--- /dev/null
+++ b/src/node_modules/inversify/lib/inversify.js
@@ -0,0 +1,47 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var keys = require("./constants/metadata_keys");
+exports.METADATA_KEY = keys;
+var container_1 = require("./container/container");
+exports.Container = container_1.Container;
+var literal_types_1 = require("./constants/literal_types");
+exports.BindingScopeEnum = literal_types_1.BindingScopeEnum;
+exports.BindingTypeEnum = literal_types_1.BindingTypeEnum;
+exports.TargetTypeEnum = literal_types_1.TargetTypeEnum;
+var container_module_1 = require("./container/container_module");
+exports.AsyncContainerModule = container_module_1.AsyncContainerModule;
+exports.ContainerModule = container_module_1.ContainerModule;
+var injectable_1 = require("./annotation/injectable");
+exports.injectable = injectable_1.injectable;
+var tagged_1 = require("./annotation/tagged");
+exports.tagged = tagged_1.tagged;
+var named_1 = require("./annotation/named");
+exports.named = named_1.named;
+var inject_1 = require("./annotation/inject");
+exports.inject = inject_1.inject;
+exports.LazyServiceIdentifer = inject_1.LazyServiceIdentifer;
+var optional_1 = require("./annotation/optional");
+exports.optional = optional_1.optional;
+var unmanaged_1 = require("./annotation/unmanaged");
+exports.unmanaged = unmanaged_1.unmanaged;
+var multi_inject_1 = require("./annotation/multi_inject");
+exports.multiInject = multi_inject_1.multiInject;
+var target_name_1 = require("./annotation/target_name");
+exports.targetName = target_name_1.targetName;
+var post_construct_1 = require("./annotation/post_construct");
+exports.postConstruct = post_construct_1.postConstruct;
+var metadata_reader_1 = require("./planning/metadata_reader");
+exports.MetadataReader = metadata_reader_1.MetadataReader;
+var id_1 = require("./utils/id");
+exports.id = id_1.id;
+var decorator_utils_1 = require("./annotation/decorator_utils");
+exports.decorate = decorator_utils_1.decorate;
+var constraint_helpers_1 = require("./syntax/constraint_helpers");
+exports.traverseAncerstors = constraint_helpers_1.traverseAncerstors;
+exports.taggedConstraint = constraint_helpers_1.taggedConstraint;
+exports.namedConstraint = constraint_helpers_1.namedConstraint;
+exports.typeConstraint = constraint_helpers_1.typeConstraint;
+var serialization_1 = require("./utils/serialization");
+exports.getServiceIdentifierAsString = serialization_1.getServiceIdentifierAsString;
+var binding_utils_1 = require("./utils/binding_utils");
+exports.multiBindToService = binding_utils_1.multiBindToService;
diff --git a/src/node_modules/inversify/lib/planning/context.js b/src/node_modules/inversify/lib/planning/context.js
new file mode 100644
index 0000000..ceb5afc
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/context.js
@@ -0,0 +1,17 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var id_1 = require("../utils/id");
+var Context = (function () {
+ function Context(container) {
+ this.id = id_1.id();
+ this.container = container;
+ }
+ Context.prototype.addPlan = function (plan) {
+ this.plan = plan;
+ };
+ Context.prototype.setCurrentRequest = function (currentRequest) {
+ this.currentRequest = currentRequest;
+ };
+ return Context;
+}());
+exports.Context = Context;
diff --git a/src/node_modules/inversify/lib/planning/metadata.js b/src/node_modules/inversify/lib/planning/metadata.js
new file mode 100644
index 0000000..6e2fbc4
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/metadata.js
@@ -0,0 +1,19 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var Metadata = (function () {
+ function Metadata(key, value) {
+ this.key = key;
+ this.value = value;
+ }
+ Metadata.prototype.toString = function () {
+ if (this.key === METADATA_KEY.NAMED_TAG) {
+ return "named: " + this.value.toString() + " ";
+ }
+ else {
+ return "tagged: { key:" + this.key.toString() + ", value: " + this.value + " }";
+ }
+ };
+ return Metadata;
+}());
+exports.Metadata = Metadata;
diff --git a/src/node_modules/inversify/lib/planning/metadata_reader.js b/src/node_modules/inversify/lib/planning/metadata_reader.js
new file mode 100644
index 0000000..9370551
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/metadata_reader.js
@@ -0,0 +1,21 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var MetadataReader = (function () {
+ function MetadataReader() {
+ }
+ MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {
+ var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc);
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);
+ return {
+ compilerGeneratedMetadata: compilerGeneratedMetadata,
+ userGeneratedMetadata: userGeneratedMetadata || {}
+ };
+ };
+ MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) {
+ var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || [];
+ return userGeneratedMetadata;
+ };
+ return MetadataReader;
+}());
+exports.MetadataReader = MetadataReader;
diff --git a/src/node_modules/inversify/lib/planning/plan.js b/src/node_modules/inversify/lib/planning/plan.js
new file mode 100644
index 0000000..18b1943
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/plan.js
@@ -0,0 +1,10 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var Plan = (function () {
+ function Plan(parentContext, rootRequest) {
+ this.parentContext = parentContext;
+ this.rootRequest = rootRequest;
+ }
+ return Plan;
+}());
+exports.Plan = Plan;
diff --git a/src/node_modules/inversify/lib/planning/planner.js b/src/node_modules/inversify/lib/planning/planner.js
new file mode 100644
index 0000000..c05eec9
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/planner.js
@@ -0,0 +1,155 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_count_1 = require("../bindings/binding_count");
+var ERROR_MSGS = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var METADATA_KEY = require("../constants/metadata_keys");
+var exceptions_1 = require("../utils/exceptions");
+var serialization_1 = require("../utils/serialization");
+var context_1 = require("./context");
+var metadata_1 = require("./metadata");
+var plan_1 = require("./plan");
+var reflection_utils_1 = require("./reflection_utils");
+var request_1 = require("./request");
+var target_1 = require("./target");
+function getBindingDictionary(cntnr) {
+ return cntnr._bindingDictionary;
+}
+exports.getBindingDictionary = getBindingDictionary;
+function _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {
+ var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;
+ var injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier);
+ var target = new target_1.Target(targetType, name, serviceIdentifier, injectMetadata);
+ if (key !== undefined) {
+ var tagMetadata = new metadata_1.Metadata(key, value);
+ target.metadata.push(tagMetadata);
+ }
+ return target;
+}
+function _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {
+ var bindings = getBindings(context.container, target.serviceIdentifier);
+ var activeBindings = [];
+ if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&
+ context.container.options.autoBindInjectable &&
+ typeof target.serviceIdentifier === "function" &&
+ metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {
+ context.container.bind(target.serviceIdentifier).toSelf();
+ bindings = getBindings(context.container, target.serviceIdentifier);
+ }
+ if (!avoidConstraints) {
+ activeBindings = bindings.filter(function (binding) {
+ var request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target);
+ return binding.constraint(request);
+ });
+ }
+ else {
+ activeBindings = bindings;
+ }
+ _validateActiveBindingCount(target.serviceIdentifier, activeBindings, target, context.container);
+ return activeBindings;
+}
+function _validateActiveBindingCount(serviceIdentifier, bindings, target, container) {
+ switch (bindings.length) {
+ case binding_count_1.BindingCount.NoBindingsAvailable:
+ if (target.isOptional()) {
+ return bindings;
+ }
+ else {
+ var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.NOT_REGISTERED;
+ msg += serialization_1.listMetadataForTarget(serviceIdentifierString, target);
+ msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ case binding_count_1.BindingCount.OnlyOneBindingAvailable:
+ if (!target.isArray()) {
+ return bindings;
+ }
+ case binding_count_1.BindingCount.MultipleBindingsAvailable:
+ default:
+ if (!target.isArray()) {
+ var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);
+ var msg = ERROR_MSGS.AMBIGUOUS_MATCH + " " + serviceIdentifierString;
+ msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);
+ throw new Error(msg);
+ }
+ else {
+ return bindings;
+ }
+ }
+}
+function _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {
+ var activeBindings;
+ var childRequest;
+ if (parentRequest === null) {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);
+ childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target);
+ var thePlan = new plan_1.Plan(context, childRequest);
+ context.addPlan(thePlan);
+ }
+ else {
+ activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);
+ childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);
+ }
+ activeBindings.forEach(function (binding) {
+ var subChildRequest = null;
+ if (target.isArray()) {
+ subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);
+ }
+ else {
+ if (binding.cache) {
+ return;
+ }
+ subChildRequest = childRequest;
+ }
+ if (binding.type === literal_types_1.BindingTypeEnum.Instance && binding.implementationType !== null) {
+ var dependencies = reflection_utils_1.getDependencies(metadataReader, binding.implementationType);
+ if (!context.container.options.skipBaseClassChecks) {
+ var baseClassDependencyCount = reflection_utils_1.getBaseClassDependencyCount(metadataReader, binding.implementationType);
+ if (dependencies.length < baseClassDependencyCount) {
+ var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(reflection_utils_1.getFunctionName(binding.implementationType));
+ throw new Error(error);
+ }
+ }
+ dependencies.forEach(function (dependency) {
+ _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);
+ });
+ }
+ });
+}
+function getBindings(container, serviceIdentifier) {
+ var bindings = [];
+ var bindingDictionary = getBindingDictionary(container);
+ if (bindingDictionary.hasKey(serviceIdentifier)) {
+ bindings = bindingDictionary.get(serviceIdentifier);
+ }
+ else if (container.parent !== null) {
+ bindings = getBindings(container.parent, serviceIdentifier);
+ }
+ return bindings;
+}
+function plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {
+ if (avoidConstraints === void 0) { avoidConstraints = false; }
+ var context = new context_1.Context(container);
+ var target = _createTarget(isMultiInject, targetType, serviceIdentifier, "", key, value);
+ try {
+ _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);
+ return context;
+ }
+ catch (error) {
+ if (exceptions_1.isStackOverflowExeption(error)) {
+ if (context.plan) {
+ serialization_1.circularDependencyToException(context.plan.rootRequest);
+ }
+ }
+ throw error;
+ }
+}
+exports.plan = plan;
+function createMockRequest(container, serviceIdentifier, key, value) {
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, "", serviceIdentifier, new metadata_1.Metadata(key, value));
+ var context = new context_1.Context(container);
+ var request = new request_1.Request(serviceIdentifier, context, null, [], target);
+ return request;
+}
+exports.createMockRequest = createMockRequest;
diff --git a/src/node_modules/inversify/lib/planning/queryable_string.js b/src/node_modules/inversify/lib/planning/queryable_string.js
new file mode 100644
index 0000000..8eeec2f
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/queryable_string.js
@@ -0,0 +1,27 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var QueryableString = (function () {
+ function QueryableString(str) {
+ this.str = str;
+ }
+ QueryableString.prototype.startsWith = function (searchString) {
+ return this.str.indexOf(searchString) === 0;
+ };
+ QueryableString.prototype.endsWith = function (searchString) {
+ var reverseString = "";
+ var reverseSearchString = searchString.split("").reverse().join("");
+ reverseString = this.str.split("").reverse().join("");
+ return this.startsWith.call({ str: reverseString }, reverseSearchString);
+ };
+ QueryableString.prototype.contains = function (searchString) {
+ return (this.str.indexOf(searchString) !== -1);
+ };
+ QueryableString.prototype.equals = function (compareString) {
+ return this.str === compareString;
+ };
+ QueryableString.prototype.value = function () {
+ return this.str;
+ };
+ return QueryableString;
+}());
+exports.QueryableString = QueryableString;
diff --git a/src/node_modules/inversify/lib/planning/reflection_utils.js b/src/node_modules/inversify/lib/planning/reflection_utils.js
new file mode 100644
index 0000000..8c71f3c
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/reflection_utils.js
@@ -0,0 +1,124 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var inject_1 = require("../annotation/inject");
+var ERROR_MSGS = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var METADATA_KEY = require("../constants/metadata_keys");
+var serialization_1 = require("../utils/serialization");
+exports.getFunctionName = serialization_1.getFunctionName;
+var target_1 = require("./target");
+function getDependencies(metadataReader, func) {
+ var constructorName = serialization_1.getFunctionName(func);
+ var targets = getTargets(metadataReader, constructorName, func, false);
+ return targets;
+}
+exports.getDependencies = getDependencies;
+function getTargets(metadataReader, constructorName, func, isBaseClass) {
+ var metadata = metadataReader.getConstructorMetadata(func);
+ var serviceIdentifiers = metadata.compilerGeneratedMetadata;
+ if (serviceIdentifiers === undefined) {
+ var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION + " " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var constructorArgsMetadata = metadata.userGeneratedMetadata;
+ var keys = Object.keys(constructorArgsMetadata);
+ var hasUserDeclaredUnknownInjections = (func.length === 0 && keys.length > 0);
+ var iterations = (hasUserDeclaredUnknownInjections) ? keys.length : func.length;
+ var constructorTargets = getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations);
+ var propertyTargets = getClassPropsAsTargets(metadataReader, func);
+ var targets = constructorTargets.concat(propertyTargets);
+ return targets;
+}
+function getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata) {
+ var targetMetadata = constructorArgsMetadata[index.toString()] || [];
+ var metadata = formatTargetMetadata(targetMetadata);
+ var isManaged = metadata.unmanaged !== true;
+ var serviceIdentifier = serviceIdentifiers[index];
+ var injectIdentifier = (metadata.inject || metadata.multiInject);
+ serviceIdentifier = (injectIdentifier) ? (injectIdentifier) : serviceIdentifier;
+ if (serviceIdentifier instanceof inject_1.LazyServiceIdentifer) {
+ serviceIdentifier = serviceIdentifier.unwrap();
+ }
+ if (isManaged) {
+ var isObject = serviceIdentifier === Object;
+ var isFunction = serviceIdentifier === Function;
+ var isUndefined = serviceIdentifier === undefined;
+ var isUnknownType = (isObject || isFunction || isUndefined);
+ if (!isBaseClass && isUnknownType) {
+ var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION + " argument " + index + " in class " + constructorName + ".";
+ throw new Error(msg);
+ }
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ return target;
+ }
+ return null;
+}
+function getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations) {
+ var targets = [];
+ for (var i = 0; i < iterations; i++) {
+ var index = i;
+ var target = getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata);
+ if (target !== null) {
+ targets.push(target);
+ }
+ }
+ return targets;
+}
+function getClassPropsAsTargets(metadataReader, constructorFunc) {
+ var classPropsMetadata = metadataReader.getPropertiesMetadata(constructorFunc);
+ var targets = [];
+ var keys = Object.keys(classPropsMetadata);
+ for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {
+ var key = keys_1[_i];
+ var targetMetadata = classPropsMetadata[key];
+ var metadata = formatTargetMetadata(classPropsMetadata[key]);
+ var targetName = metadata.targetName || key;
+ var serviceIdentifier = (metadata.inject || metadata.multiInject);
+ var target = new target_1.Target(literal_types_1.TargetTypeEnum.ClassProperty, targetName, serviceIdentifier);
+ target.metadata = targetMetadata;
+ targets.push(target);
+ }
+ var baseConstructor = Object.getPrototypeOf(constructorFunc.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseTargets = getClassPropsAsTargets(metadataReader, baseConstructor);
+ targets = targets.concat(baseTargets);
+ }
+ return targets;
+}
+function getBaseClassDependencyCount(metadataReader, func) {
+ var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;
+ if (baseConstructor !== Object) {
+ var baseConstructorName = serialization_1.getFunctionName(baseConstructor);
+ var targets = getTargets(metadataReader, baseConstructorName, baseConstructor, true);
+ var metadata = targets.map(function (t) {
+ return t.metadata.filter(function (m) {
+ return m.key === METADATA_KEY.UNMANAGED_TAG;
+ });
+ });
+ var unmanagedCount = [].concat.apply([], metadata).length;
+ var dependencyCount = targets.length - unmanagedCount;
+ if (dependencyCount > 0) {
+ return dependencyCount;
+ }
+ else {
+ return getBaseClassDependencyCount(metadataReader, baseConstructor);
+ }
+ }
+ else {
+ return 0;
+ }
+}
+exports.getBaseClassDependencyCount = getBaseClassDependencyCount;
+function formatTargetMetadata(targetMetadata) {
+ var targetMetadataMap = {};
+ targetMetadata.forEach(function (m) {
+ targetMetadataMap[m.key.toString()] = m.value;
+ });
+ return {
+ inject: targetMetadataMap[METADATA_KEY.INJECT_TAG],
+ multiInject: targetMetadataMap[METADATA_KEY.MULTI_INJECT_TAG],
+ targetName: targetMetadataMap[METADATA_KEY.NAME_TAG],
+ unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG]
+ };
+}
diff --git a/src/node_modules/inversify/lib/planning/request.js b/src/node_modules/inversify/lib/planning/request.js
new file mode 100644
index 0000000..ad1c50c
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/request.js
@@ -0,0 +1,24 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var id_1 = require("../utils/id");
+var Request = (function () {
+ function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
+ this.id = id_1.id();
+ this.serviceIdentifier = serviceIdentifier;
+ this.parentContext = parentContext;
+ this.parentRequest = parentRequest;
+ this.target = target;
+ this.childRequests = [];
+ this.bindings = (Array.isArray(bindings) ? bindings : [bindings]);
+ this.requestScope = parentRequest === null
+ ? new Map()
+ : null;
+ }
+ Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
+ var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
+ this.childRequests.push(child);
+ return child;
+ };
+ return Request;
+}());
+exports.Request = Request;
diff --git a/src/node_modules/inversify/lib/planning/target.js b/src/node_modules/inversify/lib/planning/target.js
new file mode 100644
index 0000000..a97d228
--- /dev/null
+++ b/src/node_modules/inversify/lib/planning/target.js
@@ -0,0 +1,90 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var id_1 = require("../utils/id");
+var metadata_1 = require("./metadata");
+var queryable_string_1 = require("./queryable_string");
+var Target = (function () {
+ function Target(type, name, serviceIdentifier, namedOrTagged) {
+ this.id = id_1.id();
+ this.type = type;
+ this.serviceIdentifier = serviceIdentifier;
+ this.name = new queryable_string_1.QueryableString(name || "");
+ this.metadata = new Array();
+ var metadataItem = null;
+ if (typeof namedOrTagged === "string") {
+ metadataItem = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);
+ }
+ else if (namedOrTagged instanceof metadata_1.Metadata) {
+ metadataItem = namedOrTagged;
+ }
+ if (metadataItem !== null) {
+ this.metadata.push(metadataItem);
+ }
+ }
+ Target.prototype.hasTag = function (key) {
+ for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key) {
+ return true;
+ }
+ }
+ return false;
+ };
+ Target.prototype.isArray = function () {
+ return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);
+ };
+ Target.prototype.matchesArray = function (name) {
+ return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);
+ };
+ Target.prototype.isNamed = function () {
+ return this.hasTag(METADATA_KEY.NAMED_TAG);
+ };
+ Target.prototype.isTagged = function () {
+ return this.metadata.some(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ };
+ Target.prototype.isOptional = function () {
+ return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);
+ };
+ Target.prototype.getNamedTag = function () {
+ if (this.isNamed()) {
+ return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];
+ }
+ return null;
+ };
+ Target.prototype.getCustomTags = function () {
+ if (this.isTagged()) {
+ return this.metadata.filter(function (m) {
+ return (m.key !== METADATA_KEY.INJECT_TAG) &&
+ (m.key !== METADATA_KEY.MULTI_INJECT_TAG) &&
+ (m.key !== METADATA_KEY.NAME_TAG) &&
+ (m.key !== METADATA_KEY.UNMANAGED_TAG) &&
+ (m.key !== METADATA_KEY.NAMED_TAG);
+ });
+ }
+ return null;
+ };
+ Target.prototype.matchesNamedTag = function (name) {
+ return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);
+ };
+ Target.prototype.matchesTag = function (key) {
+ var _this = this;
+ return function (value) {
+ for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {
+ var m = _a[_i];
+ if (m.key === key && m.value === value) {
+ return true;
+ }
+ }
+ return false;
+ };
+ };
+ return Target;
+}());
+exports.Target = Target;
diff --git a/src/node_modules/inversify/lib/resolution/instantiation.js b/src/node_modules/inversify/lib/resolution/instantiation.js
new file mode 100644
index 0000000..28a11de
--- /dev/null
+++ b/src/node_modules/inversify/lib/resolution/instantiation.js
@@ -0,0 +1,50 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var error_msgs_1 = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var METADATA_KEY = require("../constants/metadata_keys");
+function _injectProperties(instance, childRequests, resolveRequest) {
+ var propertyInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null &&
+ childRequest.target.type === literal_types_1.TargetTypeEnum.ClassProperty);
+ });
+ var propertyInjections = propertyInjectionsRequests.map(resolveRequest);
+ propertyInjectionsRequests.forEach(function (r, index) {
+ var propertyName = "";
+ propertyName = r.target.name.value();
+ var injection = propertyInjections[index];
+ instance[propertyName] = injection;
+ });
+ return instance;
+}
+function _createInstance(Func, injections) {
+ return new (Func.bind.apply(Func, [void 0].concat(injections)))();
+}
+function _postConstruct(constr, result) {
+ if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {
+ var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);
+ try {
+ result[data.value]();
+ }
+ catch (e) {
+ throw new Error(error_msgs_1.POST_CONSTRUCT_ERROR(constr.name, e.message));
+ }
+ }
+}
+function resolveInstance(constr, childRequests, resolveRequest) {
+ var result = null;
+ if (childRequests.length > 0) {
+ var constructorInjectionsRequests = childRequests.filter(function (childRequest) {
+ return (childRequest.target !== null && childRequest.target.type === literal_types_1.TargetTypeEnum.ConstructorArgument);
+ });
+ var constructorInjections = constructorInjectionsRequests.map(resolveRequest);
+ result = _createInstance(constr, constructorInjections);
+ result = _injectProperties(result, childRequests, resolveRequest);
+ }
+ else {
+ result = new constr();
+ }
+ _postConstruct(constr, result);
+ return result;
+}
+exports.resolveInstance = resolveInstance;
diff --git a/src/node_modules/inversify/lib/resolution/resolver.js b/src/node_modules/inversify/lib/resolution/resolver.js
new file mode 100644
index 0000000..d43934b
--- /dev/null
+++ b/src/node_modules/inversify/lib/resolution/resolver.js
@@ -0,0 +1,98 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var exceptions_1 = require("../utils/exceptions");
+var serialization_1 = require("../utils/serialization");
+var instantiation_1 = require("./instantiation");
+var invokeFactory = function (factoryType, serviceIdentifier, fn) {
+ try {
+ return fn();
+ }
+ catch (error) {
+ if (exceptions_1.isStackOverflowExeption(error)) {
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryType, serviceIdentifier.toString()));
+ }
+ else {
+ throw error;
+ }
+ }
+};
+var _resolveRequest = function (requestScope) {
+ return function (request) {
+ request.parentContext.setCurrentRequest(request);
+ var bindings = request.bindings;
+ var childRequests = request.childRequests;
+ var targetIsAnArray = request.target && request.target.isArray();
+ var targetParentIsNotAnArray = !request.parentRequest ||
+ !request.parentRequest.target ||
+ !request.target ||
+ !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);
+ if (targetIsAnArray && targetParentIsNotAnArray) {
+ return childRequests.map(function (childRequest) {
+ var _f = _resolveRequest(requestScope);
+ return _f(childRequest);
+ });
+ }
+ else {
+ var result = null;
+ if (request.target.isOptional() && bindings.length === 0) {
+ return undefined;
+ }
+ var binding_1 = bindings[0];
+ var isSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Singleton;
+ var isRequestSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Request;
+ if (isSingleton && binding_1.activated) {
+ return binding_1.cache;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ requestScope.has(binding_1.id)) {
+ return requestScope.get(binding_1.id);
+ }
+ if (binding_1.type === literal_types_1.BindingTypeEnum.ConstantValue) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Function) {
+ result = binding_1.cache;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Constructor) {
+ result = binding_1.implementationType;
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.DynamicValue && binding_1.dynamicValue !== null) {
+ result = invokeFactory("toDynamicValue", binding_1.serviceIdentifier, function () { return binding_1.dynamicValue(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Factory && binding_1.factory !== null) {
+ result = invokeFactory("toFactory", binding_1.serviceIdentifier, function () { return binding_1.factory(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Provider && binding_1.provider !== null) {
+ result = invokeFactory("toProvider", binding_1.serviceIdentifier, function () { return binding_1.provider(request.parentContext); });
+ }
+ else if (binding_1.type === literal_types_1.BindingTypeEnum.Instance && binding_1.implementationType !== null) {
+ result = instantiation_1.resolveInstance(binding_1.implementationType, childRequests, _resolveRequest(requestScope));
+ }
+ else {
+ var serviceIdentifier = serialization_1.getServiceIdentifierAsString(request.serviceIdentifier);
+ throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + " " + serviceIdentifier);
+ }
+ if (typeof binding_1.onActivation === "function") {
+ result = binding_1.onActivation(request.parentContext, result);
+ }
+ if (isSingleton) {
+ binding_1.cache = result;
+ binding_1.activated = true;
+ }
+ if (isRequestSingleton &&
+ requestScope !== null &&
+ !requestScope.has(binding_1.id)) {
+ requestScope.set(binding_1.id, result);
+ }
+ return result;
+ }
+ };
+};
+function resolve(context) {
+ var _f = _resolveRequest(context.plan.rootRequest.requestScope);
+ return _f(context.plan.rootRequest);
+}
+exports.resolve = resolve;
diff --git a/src/node_modules/inversify/lib/syntax/binding_in_syntax.js b/src/node_modules/inversify/lib/syntax/binding_in_syntax.js
new file mode 100644
index 0000000..8494e36
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_in_syntax.js
@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var literal_types_1 = require("../constants/literal_types");
+var binding_when_on_syntax_1 = require("./binding_when_on_syntax");
+var BindingInSyntax = (function () {
+ function BindingInSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingInSyntax.prototype.inRequestScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Request;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inSingletonScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingInSyntax.prototype.inTransientScope = function () {
+ this._binding.scope = literal_types_1.BindingScopeEnum.Transient;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ return BindingInSyntax;
+}());
+exports.BindingInSyntax = BindingInSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js b/src/node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js
new file mode 100644
index 0000000..fba0d06
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js
@@ -0,0 +1,72 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_in_syntax_1 = require("./binding_in_syntax");
+var binding_on_syntax_1 = require("./binding_on_syntax");
+var binding_when_syntax_1 = require("./binding_when_syntax");
+var BindingInWhenOnSyntax = (function () {
+ function BindingInWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ this._bindingInSyntax = new binding_in_syntax_1.BindingInSyntax(binding);
+ }
+ BindingInWhenOnSyntax.prototype.inRequestScope = function () {
+ return this._bindingInSyntax.inRequestScope();
+ };
+ BindingInWhenOnSyntax.prototype.inSingletonScope = function () {
+ return this._bindingInSyntax.inSingletonScope();
+ };
+ BindingInWhenOnSyntax.prototype.inTransientScope = function () {
+ return this._bindingInSyntax.inTransientScope();
+ };
+ BindingInWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingInWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingInWhenOnSyntax;
+}());
+exports.BindingInWhenOnSyntax = BindingInWhenOnSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/binding_on_syntax.js b/src/node_modules/inversify/lib/syntax/binding_on_syntax.js
new file mode 100644
index 0000000..d47728d
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_on_syntax.js
@@ -0,0 +1,14 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_when_syntax_1 = require("./binding_when_syntax");
+var BindingOnSyntax = (function () {
+ function BindingOnSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingOnSyntax.prototype.onActivation = function (handler) {
+ this._binding.onActivation = handler;
+ return new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ };
+ return BindingOnSyntax;
+}());
+exports.BindingOnSyntax = BindingOnSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/binding_to_syntax.js b/src/node_modules/inversify/lib/syntax/binding_to_syntax.js
new file mode 100644
index 0000000..fd00a74
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_to_syntax.js
@@ -0,0 +1,73 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+var literal_types_1 = require("../constants/literal_types");
+var binding_in_when_on_syntax_1 = require("./binding_in_when_on_syntax");
+var binding_when_on_syntax_1 = require("./binding_when_on_syntax");
+var BindingToSyntax = (function () {
+ function BindingToSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingToSyntax.prototype.to = function (constructor) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Instance;
+ this._binding.implementationType = constructor;
+ return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toSelf = function () {
+ if (typeof this._binding.serviceIdentifier !== "function") {
+ throw new Error("" + ERROR_MSGS.INVALID_TO_SELF_VALUE);
+ }
+ var self = this._binding.serviceIdentifier;
+ return this.to(self);
+ };
+ BindingToSyntax.prototype.toConstantValue = function (value) {
+ this._binding.type = literal_types_1.BindingTypeEnum.ConstantValue;
+ this._binding.cache = value;
+ this._binding.dynamicValue = null;
+ this._binding.implementationType = null;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toDynamicValue = function (func) {
+ this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue;
+ this._binding.cache = null;
+ this._binding.dynamicValue = func;
+ this._binding.implementationType = null;
+ return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toConstructor = function (constructor) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Constructor;
+ this._binding.implementationType = constructor;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFactory = function (factory) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Factory;
+ this._binding.factory = factory;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toFunction = function (func) {
+ if (typeof func !== "function") {
+ throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);
+ }
+ var bindingWhenOnSyntax = this.toConstantValue(func);
+ this._binding.type = literal_types_1.BindingTypeEnum.Function;
+ return bindingWhenOnSyntax;
+ };
+ BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Factory;
+ this._binding.factory = function (context) {
+ var autofactory = function () { return context.container.get(serviceIdentifier); };
+ return autofactory;
+ };
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toProvider = function (provider) {
+ this._binding.type = literal_types_1.BindingTypeEnum.Provider;
+ this._binding.provider = provider;
+ return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);
+ };
+ BindingToSyntax.prototype.toService = function (service) {
+ this.toDynamicValue(function (context) { return context.container.get(service); });
+ };
+ return BindingToSyntax;
+}());
+exports.BindingToSyntax = BindingToSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/binding_when_on_syntax.js b/src/node_modules/inversify/lib/syntax/binding_when_on_syntax.js
new file mode 100644
index 0000000..ea690ee
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_when_on_syntax.js
@@ -0,0 +1,61 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_on_syntax_1 = require("./binding_on_syntax");
+var binding_when_syntax_1 = require("./binding_when_syntax");
+var BindingWhenOnSyntax = (function () {
+ function BindingWhenOnSyntax(binding) {
+ this._binding = binding;
+ this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);
+ this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ }
+ BindingWhenOnSyntax.prototype.when = function (constraint) {
+ return this._bindingWhenSyntax.when(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) {
+ return this._bindingWhenSyntax.whenTargetNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () {
+ return this._bindingWhenSyntax.whenTargetIsDefault();
+ };
+ BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenTargetTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) {
+ return this._bindingWhenSyntax.whenInjectedInto(parent);
+ };
+ BindingWhenOnSyntax.prototype.whenParentNamed = function (name) {
+ return this._bindingWhenSyntax.whenParentNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenParentTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenAnyAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {
+ return this._bindingWhenSyntax.whenNoAncestorNamed(name);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);
+ };
+ BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);
+ };
+ BindingWhenOnSyntax.prototype.onActivation = function (handler) {
+ return this._bindingOnSyntax.onActivation(handler);
+ };
+ return BindingWhenOnSyntax;
+}());
+exports.BindingWhenOnSyntax = BindingWhenOnSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/binding_when_syntax.js b/src/node_modules/inversify/lib/syntax/binding_when_syntax.js
new file mode 100644
index 0000000..75bbcff
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/binding_when_syntax.js
@@ -0,0 +1,98 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var binding_on_syntax_1 = require("./binding_on_syntax");
+var constraint_helpers_1 = require("./constraint_helpers");
+var BindingWhenSyntax = (function () {
+ function BindingWhenSyntax(binding) {
+ this._binding = binding;
+ }
+ BindingWhenSyntax.prototype.when = function (constraint) {
+ this._binding.constraint = constraint;
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetNamed = function (name) {
+ this._binding.constraint = constraint_helpers_1.namedConstraint(name);
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetIsDefault = function () {
+ this._binding.constraint = function (request) {
+ var targetIsDefault = (request.target !== null) &&
+ (!request.target.isNamed()) &&
+ (!request.target.isTagged());
+ return targetIsDefault;
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenTargetTagged = function (tag, value) {
+ this._binding.constraint = constraint_helpers_1.taggedConstraint(tag)(value);
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenInjectedInto = function (parent) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.typeConstraint(parent)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.namedConstraint(name)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenParentTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.taggedConstraint(tag)(value)(request.parentRequest);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorIs = function (ancestor) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorNamed = function (name) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorTagged = function (tag, value) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenAnyAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return constraint_helpers_1.traverseAncerstors(request, constraint);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ BindingWhenSyntax.prototype.whenNoAncestorMatches = function (constraint) {
+ this._binding.constraint = function (request) {
+ return !constraint_helpers_1.traverseAncerstors(request, constraint);
+ };
+ return new binding_on_syntax_1.BindingOnSyntax(this._binding);
+ };
+ return BindingWhenSyntax;
+}());
+exports.BindingWhenSyntax = BindingWhenSyntax;
diff --git a/src/node_modules/inversify/lib/syntax/constraint_helpers.js b/src/node_modules/inversify/lib/syntax/constraint_helpers.js
new file mode 100644
index 0000000..8b04e0f
--- /dev/null
+++ b/src/node_modules/inversify/lib/syntax/constraint_helpers.js
@@ -0,0 +1,40 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var METADATA_KEY = require("../constants/metadata_keys");
+var metadata_1 = require("../planning/metadata");
+var traverseAncerstors = function (request, constraint) {
+ var parent = request.parentRequest;
+ if (parent !== null) {
+ return constraint(parent) ? true : traverseAncerstors(parent, constraint);
+ }
+ else {
+ return false;
+ }
+};
+exports.traverseAncerstors = traverseAncerstors;
+var taggedConstraint = function (key) { return function (value) {
+ var constraint = function (request) {
+ return request !== null && request.target !== null && request.target.matchesTag(key)(value);
+ };
+ constraint.metaData = new metadata_1.Metadata(key, value);
+ return constraint;
+}; };
+exports.taggedConstraint = taggedConstraint;
+var namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG);
+exports.namedConstraint = namedConstraint;
+var typeConstraint = function (type) { return function (request) {
+ var binding = null;
+ if (request !== null) {
+ binding = request.bindings[0];
+ if (typeof type === "string") {
+ var serviceIdentifier = binding.serviceIdentifier;
+ return serviceIdentifier === type;
+ }
+ else {
+ var constructor = request.bindings[0].implementationType;
+ return type === constructor;
+ }
+ }
+ return false;
+}; };
+exports.typeConstraint = typeConstraint;
diff --git a/src/node_modules/inversify/lib/utils/binding_utils.js b/src/node_modules/inversify/lib/utils/binding_utils.js
new file mode 100644
index 0000000..0b06cf7
--- /dev/null
+++ b/src/node_modules/inversify/lib/utils/binding_utils.js
@@ -0,0 +1,13 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.multiBindToService = function (container) {
+ return function (service) {
+ return function () {
+ var types = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ types[_i] = arguments[_i];
+ }
+ return types.forEach(function (t) { return container.bind(t).toService(service); });
+ };
+ };
+};
diff --git a/src/node_modules/inversify/lib/utils/exceptions.js b/src/node_modules/inversify/lib/utils/exceptions.js
new file mode 100644
index 0000000..2e23366
--- /dev/null
+++ b/src/node_modules/inversify/lib/utils/exceptions.js
@@ -0,0 +1,8 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+function isStackOverflowExeption(error) {
+ return (error instanceof RangeError ||
+ error.message === ERROR_MSGS.STACK_OVERFLOW);
+}
+exports.isStackOverflowExeption = isStackOverflowExeption;
diff --git a/src/node_modules/inversify/lib/utils/id.js b/src/node_modules/inversify/lib/utils/id.js
new file mode 100644
index 0000000..4bfd813
--- /dev/null
+++ b/src/node_modules/inversify/lib/utils/id.js
@@ -0,0 +1,7 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var idCounter = 0;
+function id() {
+ return idCounter++;
+}
+exports.id = id;
diff --git a/src/node_modules/inversify/lib/utils/serialization.js b/src/node_modules/inversify/lib/utils/serialization.js
new file mode 100644
index 0000000..810c047
--- /dev/null
+++ b/src/node_modules/inversify/lib/utils/serialization.js
@@ -0,0 +1,103 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ERROR_MSGS = require("../constants/error_msgs");
+function getServiceIdentifierAsString(serviceIdentifier) {
+ if (typeof serviceIdentifier === "function") {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier.name;
+ }
+ else if (typeof serviceIdentifier === "symbol") {
+ return serviceIdentifier.toString();
+ }
+ else {
+ var _serviceIdentifier = serviceIdentifier;
+ return _serviceIdentifier;
+ }
+}
+exports.getServiceIdentifierAsString = getServiceIdentifierAsString;
+function listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {
+ var registeredBindingsList = "";
+ var registeredBindings = getBindings(container, serviceIdentifier);
+ if (registeredBindings.length !== 0) {
+ registeredBindingsList = "\nRegistered bindings:";
+ registeredBindings.forEach(function (binding) {
+ var name = "Object";
+ if (binding.implementationType !== null) {
+ name = getFunctionName(binding.implementationType);
+ }
+ registeredBindingsList = registeredBindingsList + "\n " + name;
+ if (binding.constraint.metaData) {
+ registeredBindingsList = registeredBindingsList + " - " + binding.constraint.metaData;
+ }
+ });
+ }
+ return registeredBindingsList;
+}
+exports.listRegisteredBindingsForServiceIdentifier = listRegisteredBindingsForServiceIdentifier;
+function alreadyDependencyChain(request, serviceIdentifier) {
+ if (request.parentRequest === null) {
+ return false;
+ }
+ else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {
+ return true;
+ }
+ else {
+ return alreadyDependencyChain(request.parentRequest, serviceIdentifier);
+ }
+}
+function dependencyChainToString(request) {
+ function _createStringArr(req, result) {
+ if (result === void 0) { result = []; }
+ var serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);
+ result.push(serviceIdentifier);
+ if (req.parentRequest !== null) {
+ return _createStringArr(req.parentRequest, result);
+ }
+ return result;
+ }
+ var stringArr = _createStringArr(request);
+ return stringArr.reverse().join(" --> ");
+}
+function circularDependencyToException(request) {
+ request.childRequests.forEach(function (childRequest) {
+ if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) {
+ var services = dependencyChainToString(childRequest);
+ throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + " " + services);
+ }
+ else {
+ circularDependencyToException(childRequest);
+ }
+ });
+}
+exports.circularDependencyToException = circularDependencyToException;
+function listMetadataForTarget(serviceIdentifierString, target) {
+ if (target.isTagged() || target.isNamed()) {
+ var m_1 = "";
+ var namedTag = target.getNamedTag();
+ var otherTags = target.getCustomTags();
+ if (namedTag !== null) {
+ m_1 += namedTag.toString() + "\n";
+ }
+ if (otherTags !== null) {
+ otherTags.forEach(function (tag) {
+ m_1 += tag.toString() + "\n";
+ });
+ }
+ return " " + serviceIdentifierString + "\n " + serviceIdentifierString + " - " + m_1;
+ }
+ else {
+ return " " + serviceIdentifierString;
+ }
+}
+exports.listMetadataForTarget = listMetadataForTarget;
+function getFunctionName(v) {
+ if (v.name) {
+ return v.name;
+ }
+ else {
+ var name_1 = v.toString();
+ var match = name_1.match(/^function\s*([^\s(]+)/);
+ return match ? match[1] : "Anonymous function: " + name_1;
+ }
+}
+exports.getFunctionName = getFunctionName;
diff --git a/src/node_modules/inversify/package.json b/src/node_modules/inversify/package.json
new file mode 100644
index 0000000..e585f19
--- /dev/null
+++ b/src/node_modules/inversify/package.json
@@ -0,0 +1,80 @@
+{
+ "name": "inversify",
+ "version": "5.0.1",
+ "description": "A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.",
+ "main": "lib/inversify.js",
+ "jsnext:main": "es/inversify.js",
+ "types": "./dts/inversify.d.ts",
+ "directories": {
+ "test": "gulp"
+ },
+ "scripts": {
+ "test": "gulp",
+ "publish-please": "publish-please",
+ "prepublish": "publish-please guard"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/inversify/InversifyJS.git"
+ },
+ "keywords": [
+ "ioc",
+ "di",
+ "javascript",
+ "typescript",
+ "node",
+ "dependency injection",
+ "dependency inversion",
+ "inversion of control container"
+ ],
+ "author": "Remo H. Jansen",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/inversify/InversifyJS/issues"
+ },
+ "homepage": "http://inversify.io",
+ "engines": {},
+ "devDependencies": {
+ "@types/chai": "4.1.4",
+ "@types/harmony-proxy": "1.0.29",
+ "@types/mocha": "5.2.3",
+ "@types/sinon": "5.0.5",
+ "bluebird": "3.5.2",
+ "browserify": "16.2.3",
+ "chai": "4.1.2",
+ "del": "3.0.0",
+ "es6-symbol": "3.1.1",
+ "gulp": "3.9.1",
+ "gulp-istanbul": "1.1.3",
+ "gulp-mocha": "6.0.0",
+ "gulp-rename": "1.4.0",
+ "gulp-sourcemaps": "2.6.3",
+ "gulp-tslint": "8.1.3",
+ "gulp-typescript": "4.0.2",
+ "gulp-uglify": "3.0.1",
+ "harmonize": "2.0.0",
+ "harmony-proxy": "1.0.1",
+ "istanbul": "0.4.5",
+ "karma": "3.0.0",
+ "karma-chai": "0.1.0",
+ "karma-chrome-launcher": "2.2.0",
+ "karma-commonjs": "1.0.0",
+ "karma-es6-shim": "1.0.0",
+ "karma-firefox-launcher": "1.1.0",
+ "karma-ie-launcher": "1.0.0",
+ "karma-mocha": "1.3.0",
+ "karma-mocha-reporter": "2.2.5",
+ "karma-phantomjs-launcher": "1.0.4",
+ "karma-sinon": "1.0.5",
+ "mocha": "5.2.0",
+ "performance-now": "2.1.0",
+ "publish-please": "4.1.0",
+ "reflect-metadata": "0.1.12",
+ "run-sequence": "2.2.1",
+ "sinon": "6.0.1",
+ "tslint": "5.9.1",
+ "typescript": "^2.8.3",
+ "vinyl-buffer": "1.0.1",
+ "vinyl-source-stream": "2.0.0"
+ }
+}