@decaf-ts/core 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +297 -0
- package/dist/core.bundle.min.js +2 -0
- package/dist/core.bundle.min.js.LICENSE.txt +14 -0
- package/dist/esm/core.bundle.min.esm.js +2 -0
- package/dist/esm/core.bundle.min.esm.js.LICENSE.txt +14 -0
- package/lib/esm/identity/decorators.d.ts +29 -0
- package/lib/esm/identity/decorators.js +1 -0
- package/lib/esm/identity/index.d.ts +1 -0
- package/lib/esm/identity/index.js +1 -0
- package/lib/esm/index.d.ts +23 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/interfaces/Builder.d.ts +16 -0
- package/lib/esm/interfaces/Builder.js +0 -0
- package/lib/esm/interfaces/Executor.d.ts +17 -0
- package/lib/esm/interfaces/Executor.js +0 -0
- package/lib/esm/interfaces/IAdapter.d.ts +5 -0
- package/lib/esm/interfaces/IAdapter.js +0 -0
- package/lib/esm/interfaces/Observable.d.ts +31 -0
- package/lib/esm/interfaces/Observable.js +0 -0
- package/lib/esm/interfaces/Observer.d.ts +16 -0
- package/lib/esm/interfaces/Observer.js +0 -0
- package/lib/esm/interfaces/RawExecutor.d.ts +19 -0
- package/lib/esm/interfaces/RawExecutor.js +0 -0
- package/lib/esm/interfaces/Sequence.d.ts +16 -0
- package/lib/esm/interfaces/Sequence.js +0 -0
- package/lib/esm/interfaces/SequenceOptions.d.ts +10 -0
- package/lib/esm/interfaces/SequenceOptions.js +0 -0
- package/lib/esm/interfaces/index.d.ts +8 -0
- package/lib/esm/interfaces/index.js +1 -0
- package/lib/esm/model/BaseModel.d.ts +7 -0
- package/lib/esm/model/BaseModel.js +1 -0
- package/lib/esm/model/index.d.ts +1 -0
- package/lib/esm/model/index.js +1 -0
- package/lib/esm/persistence/Adapter.d.ts +39 -0
- package/lib/esm/persistence/Adapter.js +1 -0
- package/lib/esm/persistence/constants.d.ts +1 -0
- package/lib/esm/persistence/constants.js +1 -0
- package/lib/esm/persistence/decorators.d.ts +3 -0
- package/lib/esm/persistence/decorators.js +1 -0
- package/lib/esm/persistence/index.d.ts +4 -0
- package/lib/esm/persistence/index.js +1 -0
- package/lib/esm/persistence/utils.d.ts +1 -0
- package/lib/esm/persistence/utils.js +1 -0
- package/lib/esm/repository/Repository.d.ts +33 -0
- package/lib/esm/repository/Repository.js +1 -0
- package/lib/esm/repository/errors.d.ts +12 -0
- package/lib/esm/repository/errors.js +1 -0
- package/lib/esm/repository/index.d.ts +2 -0
- package/lib/esm/repository/index.js +1 -0
- package/lib/identity/decorators.cjs +1 -0
- package/lib/identity/decorators.d.ts +29 -0
- package/lib/identity/index.cjs +1 -0
- package/lib/identity/index.d.ts +1 -0
- package/lib/index.cjs +1 -0
- package/lib/index.d.ts +23 -0
- package/lib/interfaces/Builder.cjs +1 -0
- package/lib/interfaces/Builder.d.ts +16 -0
- package/lib/interfaces/Executor.cjs +1 -0
- package/lib/interfaces/Executor.d.ts +17 -0
- package/lib/interfaces/IAdapter.cjs +1 -0
- package/lib/interfaces/IAdapter.d.ts +5 -0
- package/lib/interfaces/Observable.cjs +1 -0
- package/lib/interfaces/Observable.d.ts +31 -0
- package/lib/interfaces/Observer.cjs +1 -0
- package/lib/interfaces/Observer.d.ts +16 -0
- package/lib/interfaces/RawExecutor.cjs +1 -0
- package/lib/interfaces/RawExecutor.d.ts +19 -0
- package/lib/interfaces/Sequence.cjs +1 -0
- package/lib/interfaces/Sequence.d.ts +16 -0
- package/lib/interfaces/SequenceOptions.cjs +1 -0
- package/lib/interfaces/SequenceOptions.d.ts +10 -0
- package/lib/interfaces/index.cjs +1 -0
- package/lib/interfaces/index.d.ts +8 -0
- package/lib/model/BaseModel.cjs +1 -0
- package/lib/model/BaseModel.d.ts +7 -0
- package/lib/model/index.cjs +1 -0
- package/lib/model/index.d.ts +1 -0
- package/lib/persistence/Adapter.cjs +1 -0
- package/lib/persistence/Adapter.d.ts +39 -0
- package/lib/persistence/constants.cjs +1 -0
- package/lib/persistence/constants.d.ts +1 -0
- package/lib/persistence/decorators.cjs +1 -0
- package/lib/persistence/decorators.d.ts +3 -0
- package/lib/persistence/index.cjs +1 -0
- package/lib/persistence/index.d.ts +4 -0
- package/lib/persistence/utils.cjs +1 -0
- package/lib/persistence/utils.d.ts +1 -0
- package/lib/repository/Repository.cjs +1 -0
- package/lib/repository/Repository.d.ts +33 -0
- package/lib/repository/errors.cjs +1 -0
- package/lib/repository/errors.d.ts +12 -0
- package/lib/repository/index.cjs +1 -0
- package/lib/repository/index.d.ts +2 -0
- package/package.json +106 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Tiago Venceslau
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+

|
|
2
|
+
## Typescript Template
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+

|
|
7
|
+

|
|
8
|
+

|
|
9
|
+
[](http://www.pdmfc.com)
|
|
10
|
+
[](https://github.com/decaf-ts/ts-workspace/actions?query=workflow%3ACodeQL)
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+

|
|
14
|
+

|
|
15
|
+

|
|
16
|
+
|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
|
|
23
|
+

|
|
24
|
+

|
|
25
|
+

|
|
26
|
+
|
|
27
|
+

|
|
28
|
+

|
|
29
|
+
|
|
30
|
+
Defaults to module, but exports to CommonJS and ESM.
|
|
31
|
+
|
|
32
|
+
With documentation, update and release mechanisms and gitlab/github workflows to match;
|
|
33
|
+
|
|
34
|
+
Defines a 'way' to write jsDocs to optimize the output
|
|
35
|
+
|
|
36
|
+
Optimized for github in terms of badges. CI is equivalent between Gitlab and Github.
|
|
37
|
+
|
|
38
|
+
Auto setup on first `npm install`
|
|
39
|
+
|
|
40
|
+
Will accept a `.token` file containing token valid for private npm dependencies, npm and docker registries
|
|
41
|
+
|
|
42
|
+
### ***Initial Setup***
|
|
43
|
+
|
|
44
|
+
#### if you use github
|
|
45
|
+
|
|
46
|
+
create a new project using this one as a template.
|
|
47
|
+
|
|
48
|
+
clone it `git clone <project>` and navigate to the root folder `cd <project>`
|
|
49
|
+
|
|
50
|
+
#### If your project has private dependencies or publishes to private npm registries, create an `.npmrc` containing:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
@<scope1>:registry=https://<ADDRESS>.com/api/v4/packages/npm/
|
|
54
|
+
@<scope2>:registry=https://<ADDRESS>.<DOMAIN>.com/api/v4/packages/npm/
|
|
55
|
+
//<ADDRESS>.<DOMAIN>.com/:_authToken=${TOKEN}
|
|
56
|
+
//<ADDRESS>.<DOMAIN>.com/api/v4/groups/<GROUP_ID>/packages/npm/:_authToken=${TOKEN}
|
|
57
|
+
//<ADDRESS>.<DOMAIN>.com/api/v4/projects/<PROJECT_ID>/packages/npm/:_authToken=${TOKEN}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Changing:
|
|
61
|
+
- <ADDRESS> to `gitlab` or `github` (or other);
|
|
62
|
+
- <DOMAIN> to your domain if any (if you are using plain gitlab or github use empty and take care to remove the extra `.`);
|
|
63
|
+
- <GROUP_ID> to your project's group id (if any). otherwise remove this line
|
|
64
|
+
- <PROJECT_ID> to your project's id
|
|
65
|
+
|
|
66
|
+
and adding a `.token` file containing your access token to the private registries na repositories.
|
|
67
|
+
|
|
68
|
+
### Installation
|
|
69
|
+
|
|
70
|
+
Run `npm install` (or `npm run do-install` if you have private dependencies and a `.token` file) to install the dependencies:
|
|
71
|
+
|
|
72
|
+
If this is the first time you are running this command it will also:
|
|
73
|
+
- update this repository's dependencies to their latest version;
|
|
74
|
+
- creates a `.token` file which you can leave empty unless you have private dependencies or publish to private registries
|
|
75
|
+
- delete this 'first run script' file and npm call from the `package.json`;
|
|
76
|
+
- try to commit the updated `package.json` and deleted files (having ssh access helps here);
|
|
77
|
+
## Linting
|
|
78
|
+
|
|
79
|
+
This repo comes with eslint + prettier preconfigured to the default standards
|
|
80
|
+
## Testing
|
|
81
|
+
|
|
82
|
+
Preconfigured Jest based testing:
|
|
83
|
+
|
|
84
|
+
- unit tests under the `tests/unit` folder;
|
|
85
|
+
- include a default bundle test (helps with circular dependencies and such);
|
|
86
|
+
- integration tests under the `tests/integration` folder;
|
|
87
|
+
- stores converage results under `workdocs/coverage`;
|
|
88
|
+
- publishes coverage result to docs;
|
|
89
|
+
- ignores `cli.ts` from coverage since that is an executable file;
|
|
90
|
+
- defines the coverage threshold in `jest.config.ts`;
|
|
91
|
+
### Releases
|
|
92
|
+
|
|
93
|
+
This repository automates releases in the following manner:
|
|
94
|
+
|
|
95
|
+
- run `npm run release -- <major|minor|patch|version> <message>`:
|
|
96
|
+
- if arguments are missing you will be prompted for them;
|
|
97
|
+
- it will run `npm run prepare-release` npm script;
|
|
98
|
+
- it will commit all changes;
|
|
99
|
+
- it will push the new tag;
|
|
100
|
+
|
|
101
|
+
If publishing to a private repo's npm registry, make sure you add to your `package.json`:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"publishConfig": {
|
|
106
|
+
"<SCOPE>:registry": " https://<REGISTRY>/api/v4/projects/<PROJECT_ID>/packages/npm/"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Where:
|
|
112
|
+
|
|
113
|
+
- `<SCOPE>` - Is the scope of your package;
|
|
114
|
+
- `<REGISTRY>` - your registry host;
|
|
115
|
+
- `<PROJECT_ID>` - you project ID number (easy to grab via UI in gitlab or by
|
|
116
|
+
running `$("meta[name=octolytics-dimension-repository_id]").getAttribute('content')` in the repository page in github)
|
|
117
|
+
;
|
|
118
|
+
|
|
119
|
+
### Publishing
|
|
120
|
+
|
|
121
|
+
Unless the `-no-ci` flag is passed in the commit message to the `npm run release` command, publishing will be handled
|
|
122
|
+
automatically by github/gitlab (triggered by the tag).
|
|
123
|
+
|
|
124
|
+
When the `-no-ci` flag is passed then you can:
|
|
125
|
+
|
|
126
|
+
- run `npm run publish`. This command assumes :
|
|
127
|
+
- you have previously run the `npm run release`;
|
|
128
|
+
- you have you publishing properly configured in `npmrc` and `package.json`;
|
|
129
|
+
- The token for any special access required is stored in the `.token` file;
|
|
130
|
+
|
|
131
|
+
## Continuous Integration/Deployment
|
|
132
|
+
|
|
133
|
+
While the implementationfor gitlab and github are not perfectly matched, they are perfectly usable.
|
|
134
|
+
|
|
135
|
+
The template comes with ci/cd for :
|
|
136
|
+
- gitlab (with caching for performance):
|
|
137
|
+
- stages:
|
|
138
|
+
- dependencies: Installs dependencies (on `package-lock.json` changes, caches node modules);
|
|
139
|
+
- build: builds the code (on `src/*` changes, caches `lib` and `dist`);
|
|
140
|
+
- test: tests the code (on `src/*`, `test/*` changes, caches `workdocs/{resources, badges, coverage}`);
|
|
141
|
+
- deploy:
|
|
142
|
+
- deploys to package registry on a tag (public|private);
|
|
143
|
+
- deploys docker image to docker registry (private);
|
|
144
|
+
- Deploys the documentation to the repository pages;
|
|
145
|
+
- github:
|
|
146
|
+
- jest-test: standard `install -> build -> test` loop;
|
|
147
|
+
- jest-coverage: extracts coverage from the tests;
|
|
148
|
+
- codeql-analysis: Code quality analisys;
|
|
149
|
+
- pages: builds the documentation and deploys to github pages
|
|
150
|
+
- release-on-tag: issues a release when the tag does not contain `-no-ci` string
|
|
151
|
+
- publish-on-release: publishes to package registry when the tag does not contain the `-no-ci` string
|
|
152
|
+
- Requires Variables:
|
|
153
|
+
- CONSECUTIVE_ACTION_TRIGGER: secret to enable actions to trigger other actions;
|
|
154
|
+
- NPM_TOKEN: npm/docker registry token
|
|
155
|
+
## Considerations
|
|
156
|
+
- Setup for a linux based environment (Sorry windows users. use WSL... or just change already);
|
|
157
|
+
- Setup for node 20, but will work at least with 16;
|
|
158
|
+
- Requires docker to build documentation (drawings and PlantUML)
|
|
159
|
+
## Documentation
|
|
160
|
+
|
|
161
|
+
The repository proposes a way to generate documentation that while still not ideal, produces verys consitest results.
|
|
162
|
+
|
|
163
|
+
In the code you see an example on how to properly document each code object, but the overall structure is:
|
|
164
|
+
- each package is a `@module`;
|
|
165
|
+
- Classes and Interfaces are categorized into `@category` and `@subcategory`;
|
|
166
|
+
- All other objects are categorized by `@namespace` and `@memberOf`;
|
|
167
|
+
- Enums and const are declared as `@const` and both must describe their properties as `@property` (when constants are objects);
|
|
168
|
+
- Interfaces must declare their methods `@method`;
|
|
169
|
+
|
|
170
|
+
There are 3 steps the generating the documentation (automated in CI):
|
|
171
|
+
- `npm run drawings` - generates png files from each drawing in the `workdocs/drawings` folder and moves them to the `workdocs/resources` folder (requires Docker);
|
|
172
|
+
- `npm run uml` - generates png files from each PlantUML diagram in the `workdocs/uml` folder and moves them to the `workdocs/resources` folder (requires Docker);
|
|
173
|
+
- `npm run docs` - this has several stages, defined under the `gulp docs` (gulpfile.js):
|
|
174
|
+
- compiles the Readme file via md compile:
|
|
175
|
+
- enables keeping separate files for sections that are then joined into a single file;
|
|
176
|
+
- Allows keeping specific files in the jsdocs tutorial folder so they show up on their own menu;
|
|
177
|
+
- compiles the documentation from the source code using jsdocs:
|
|
178
|
+
- uses the better docs template with the category and component plugins
|
|
179
|
+
- uses the mermaid jsdoc plugin to embue uml diagrams in the docs
|
|
180
|
+
- includes a nav link to the test coverage results;
|
|
181
|
+
- copies the jsdoc and mds to `/docs`;
|
|
182
|
+
- copies the `./workdocs/{drawings, uml, assets, resources}` to `./docs`;
|
|
183
|
+
|
|
184
|
+
The produced `docs` folder contains the resulting documentation;
|
|
185
|
+
### Related
|
|
186
|
+
|
|
187
|
+
[](https://github.com/decaf-ts/ts-workspace)
|
|
188
|
+
### Social
|
|
189
|
+
|
|
190
|
+
[](https://www.linkedin.com/in/decaf-ts/)
|
|
191
|
+
### Scripts
|
|
192
|
+
|
|
193
|
+
The following npm scripts are available for development:
|
|
194
|
+
|
|
195
|
+
- `preinstall` - will run only on the first install to trigger the dep update. will self delete;
|
|
196
|
+
- `do-install` - sets a `TOKEN` environment variable to the contents of `.token` and runs npm install (useful when you
|
|
197
|
+
have private dependencies);
|
|
198
|
+
- `flash-forward` - updates all dependencies. Take care, This may not be desirable is some cases;
|
|
199
|
+
- `reset` - updates all dependencies. Take care, This may not be desirable is some cases;
|
|
200
|
+
- `build` - builds the code (via gulp `gulpfile.js`) in development mode (generates `lib` and `dist` folder);
|
|
201
|
+
- `build:prod` - builds the code (via gulp `gulpfile.js`) in production mode (generates `lib` and `dist` folder);
|
|
202
|
+
- `test` - runs unit tests;
|
|
203
|
+
- `test:integration` - runs it tests;
|
|
204
|
+
- `test:all` - runs all tests;
|
|
205
|
+
- `lint` - runs es lint on the code folder;
|
|
206
|
+
- `lint-fix` - tries to auto-fix the code folder;
|
|
207
|
+
- `prepare-release` - defines the commands to run prior to a new tag (defaults to linting, building production code,
|
|
208
|
+
running tests and documentation generation);
|
|
209
|
+
- `release` - triggers a new tag being pushed to master (via `./bin/tag_release.sh`);
|
|
210
|
+
- `clean-publish` - cleans the package.json for publishing;
|
|
211
|
+
- `coverage` - runs all test, calculates coverage and generates badges for readme;
|
|
212
|
+
- `drawings` - compiles all DrawIO `*.drawio` files in the `workdocs/drawings` folder to png and moves them to
|
|
213
|
+
the `workdocs/resources` folder;
|
|
214
|
+
- `uml` - compiles all PlantUML `*.puml` files in the `workdocs/uml` folder to png and moves them to
|
|
215
|
+
the `workdocs/resources` folder;
|
|
216
|
+
- `docs` - compiles all the coverage, drawings, uml, jsdocs and md docs into a readable web page under `./docs`;
|
|
217
|
+
|
|
218
|
+
### Repository Structure
|
|
219
|
+
|
|
220
|
+
```
|
|
221
|
+
ts-workspace
|
|
222
|
+
│
|
|
223
|
+
│ .gitignore <-- Defines files ignored to git
|
|
224
|
+
│ .npmignore <-- Defines files ignored by npm
|
|
225
|
+
│ .nmprc <-- Defines the Npm registry for this package
|
|
226
|
+
│ .eslintrc.cjs <-- linting for the project
|
|
227
|
+
│ .prettier.config.cjs <-- Code style for the project
|
|
228
|
+
│ .gitlab-ci.yml <-- Gillab CI/CD file
|
|
229
|
+
│ gulpfile.js <-- Gulp build scripts. used for building na other features (eg docs)
|
|
230
|
+
│ jest.config.ts <-- Tests Configuration file
|
|
231
|
+
│ mdCompile.json <-- md Documentation generation configuration file
|
|
232
|
+
│ jsdocs.json <-- jsdoc Documentation generation configuration file
|
|
233
|
+
│ Dockerfile <-- minimal example of a node service Dockerfile
|
|
234
|
+
│ LICENCE.md <-- Licence disclamer
|
|
235
|
+
│ package.json
|
|
236
|
+
│ package-lock.json
|
|
237
|
+
│ README.md <-- Readme File dynamically compiled from 'workdocs' via the 'docs' npm script
|
|
238
|
+
│ tsconfig.json <-- Typescript config file. Is overriden in 'gulpfile.js'
|
|
239
|
+
│
|
|
240
|
+
└───bin
|
|
241
|
+
│ │ tag_release.sh <-- Script to help with releases
|
|
242
|
+
│
|
|
243
|
+
└───docs
|
|
244
|
+
│ │ ... <-- Dinamically generated folder, containing the compiled documentation for this repository. generated via the 'docs' npm script
|
|
245
|
+
│
|
|
246
|
+
└───src
|
|
247
|
+
│ │ ... <-- Source code for this repository
|
|
248
|
+
│
|
|
249
|
+
└───tests
|
|
250
|
+
│ │───unit <-- Unit tests
|
|
251
|
+
│ └───integration <-- Integration tests
|
|
252
|
+
│
|
|
253
|
+
└───workdocs <-- Folder with all pre-compiled documentation
|
|
254
|
+
│ │───assets <-- Documentation asset folder
|
|
255
|
+
│ │───badges <-- Auto generated coverage badges folder
|
|
256
|
+
│ │───coverage <-- Auto generated coverage results
|
|
257
|
+
│ │───drawings <-- DrawIO folder. Drawings (*.drawio) here will be processed to generate documentation (requires docker)
|
|
258
|
+
│ │───uml <-- PlantUML folder. Diagrams (*.puml) here will be processed to generate documentation (requires docker)
|
|
259
|
+
│ │───tutorials <-- Tutorial folder
|
|
260
|
+
│ │ ... <-- Categorized *.md files that are merged to generate the final readme (via md compile)
|
|
261
|
+
│ │ Readme.md <-- Entry point to the README.md
|
|
262
|
+
│
|
|
263
|
+
└───dist
|
|
264
|
+
│ │ ... <-- Dinamically generated folder containing the bundles for distribution
|
|
265
|
+
│
|
|
266
|
+
└───lib
|
|
267
|
+
| ... <-- Dinamically generated folder containing the compiled code
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+

|
|
271
|
+

|
|
272
|
+

|
|
273
|
+

|
|
274
|
+
|
|
275
|
+
## Getting help
|
|
276
|
+
|
|
277
|
+
If you have bug reports, questions or suggestions please [create a new issue](https://github.com/decaf-ts/ts-workspace/issues/new/choose).
|
|
278
|
+
|
|
279
|
+
## Contributing
|
|
280
|
+
|
|
281
|
+
I am grateful for any contributions made to this project. Please read [this](./workdocs/98-Contributing.md) to get started.
|
|
282
|
+
|
|
283
|
+
## Supporting
|
|
284
|
+
|
|
285
|
+
The first and easiest way you can support it is by [Contributing](./workdocs/98-Contributing.md). Even just finding a typo in the documentation is important.
|
|
286
|
+
|
|
287
|
+
Financial support is always welcome and helps keep the both me and the project alive and healthy.
|
|
288
|
+
|
|
289
|
+
So if you can, if this project in any way. either by learning something or simply by helping you save precious time, please consider donating.
|
|
290
|
+
|
|
291
|
+
## License
|
|
292
|
+
|
|
293
|
+
This project is released under the [MIT License](LICENSE.md).
|
|
294
|
+
|
|
295
|
+
#### Disclaimer:
|
|
296
|
+
|
|
297
|
+
badges found [here](https://dev.to/envoy_/150-badges-for-github-pnk), [here](https://github.com/alexandresanlim/Badges4-README.md-Profile#-social-) and [here](https://github.com/Ileriayo/markdown-badges)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see core.bundle.min.js.LICENSE.txt */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("core",[],t):"object"==typeof exports?exports.core=t():e.core=t()}(this,(()=>(()=>{var e={5580:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pkOnCreate=i,t.pk=function(e,t){const r={sequence:e,options:t};return(0,a.apply)((0,o.index)(),(0,n.required)(),(0,o.readonly)(),(0,a.metadata)((0,o.getDBKey)(o.DBKeys.ID),{}),(0,o.onCreate)(i,r))};const n=r(2302),o=r(5922),a=r(32);async function i(e,t,r){if(!e.sequence)return;let n;try{n=await this.adapter.getSequence(r,e.sequence,e.options)}catch(t){throw new o.InternalError(`Failed to instantiate Sequence ${e.sequence.name}: ${t}`)}var a,i,s;a=r,i=t,s=await n.next(),Object.defineProperty(a,i,{enumerable:!0,writable:!1,configurable:!0,value:s})}},2912:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(5580),t)},7729:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(2912),t),o(r(1206),t),o(r(3847),t),o(r(4017),t),o(r(5666),t),t.VERSION="##VERSION##"},5261:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1385:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4622:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1461:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9314:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9437:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5989:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},643:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1206:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(5261),t),o(r(1385),t),o(r(4622),t),o(r(1461),t),o(r(9314),t),o(r(9437),t),o(r(5989),t),o(r(643),t)},9669:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.BaseModel=void 0;const a=r(5922);class i extends a.DBModel{constructor(e){super(e),this.createdOn=void 0,this.updatedOn=void 0}}t.BaseModel=i,n([(0,a.timestamp)(a.DBOperations.CREATE),o("design:type",Date)],i.prototype,"createdOn",void 0),n([(0,a.timestamp)(),o("design:type",Date)],i.prototype,"updatedOn",void 0)},3847:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9669),t)},6946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Adapter=void 0;const n=r(5922),o=r(465),a=r(6568),i=r(879);t.Adapter=class{constructor(){this.observers=[]}observe(e){if(-1!==this.observers.indexOf(e))throw new n.InternalError("Observer already registered");this.observers.push(e)}unObserve(e){const t=this.observers.indexOf(e);if(-1===t)throw new n.InternalError("Failed to find Observer");this.observers.splice(t,1)}async updateObservers(...e){return new Promise(((t,r)=>{Promise.all(this.observers.map((t=>t.refresh(...e)))).then((()=>{t()})).catch((e=>r(new i.ObserverError(e))))}))}static get current(){return this._current}static get(e){const t=o.Injectables.get((0,a.genAdapterInjectableKey)(e));if(!t)throw new n.InternalError(`No Adapter registered under ${e}. Did you use the @adapter decorator?`);return t}static setCurrent(e){const t=this.get(e);if(!t)throw new n.NotFoundError(`No persistence flavour ${e} registered`);this._current=t}}},6176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistenceKeys=void 0,t.PersistenceKeys={REFLECT:"model.persistence.",ADAPTER:"adapter",INJECTABLE:"decaf-adapter-{0}"}},263:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPersistenceKey=s,t.adapter=function(e){return(0,n.injectable)((0,i.genAdapterInjectableKey)(e),!0)},t.uses=function(e){return(0,o.metadata)(s(a.PersistenceKeys.ADAPTER),(0,i.genAdapterInjectableKey)(e))};const n=r(465),o=r(32),a=r(6176),i=r(6568);function s(e){return a.PersistenceKeys.REFLECT+e}},4017:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6946),t),o(r(6176),t),o(r(263),t),o(r(6568),t)},6568:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.genAdapterInjectableKey=function(e){return(0,n.sf)(o.PersistenceKeys.INJECTABLE,e)};const n=r(2302),o=r(6176)},3932:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Repository=void 0;const n=r(5922),o=r(879);class a extends n.Repository{get adapter(){if(!this._adapter)throw new n.InternalError("No adapter found for this repository. did you use the @uses decorator or pass it in the constructor?");return this._adapter}constructor(){super(),this.observers=[]}async create(e,...t){return this.adapter.create(e,...t)}async read(e,...t){return this.adapter.read(e,...t)}async update(e,...t){return this.adapter.update(e,...t)}async delete(e,...t){return this.adapter.delete(e,...t)}observe(e){if(-1!==this.observers.indexOf(e))throw new n.InternalError("Observer already registered");this.observers.push(e)}unObserve(e){const t=this.observers.indexOf(e);if(-1===t)throw new n.InternalError("Failed to find Observer");this.observers.splice(t,1)}async updateObservers(...e){return new Promise(((t,r)=>{Promise.all(this.observers.map((t=>t.refresh(...e)))).then((()=>{t()})).catch((e=>r(new o.ObserverError(e))))}))}}t.Repository=a},879:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ObserverError=void 0;const n=r(5922);class o extends n.BaseError{constructor(e){super(o.name,e)}}t.ObserverError=o},5666:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(879),t),o(r(3932),t)},9501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.id=void 0;const n=r(2302),o=r(32),a=r(3793),i=r(9252),s=r(4367);t.id=function(){return(0,o.apply)((0,a.index)(),(0,n.required)(),(0,i.readonly)(),(0,o.metadata)((0,a.getDBKey)(s.DBKeys.ID),{}))}},5537:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9501),t),o(r(3802),t)},3802:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createOrUpdate=t.findModelId=t.findPrimaryKey=void 0;const n=r(9325),o=r(3793),a=r(4367),i=r(592),s=r(2302),c=r(3036);function u(e){if(e=(0,i.getAllPropertyDecoratorsRecursive)(e,void 0,(0,o.getDBKey)(a.DBKeys.ID)),e=Object.entries(e).reduce(((e,[t,r])=>(r=r.filter((e=>e.key!==s.ModelKeys.TYPE)),r&&r.length&&(e[t]=e[t]||[],e[t].push(...r)),e)),{}),e&&Object.keys(e).length){if(1<Object.keys(e).length)throw new c.InternalError((0,s.sf)(Object.keys(e).join(", ")));var t=Object.keys(e)[0];if(t)return{id:t,props:e[t][0].props.options}}throw new c.InternalError("Could not find ID decorated Property")}t.findPrimaryKey=u,t.findModelId=function(e,t=!1){var r=u(e).id;if((e=e[r])||t)return e;throw new c.NotFoundError((0,s.sf)("No value for the Id is defined under the property {0}",r))},t.createOrUpdate=async function(e,t=void 0,r){return t=t||n.DBModel.findRepository(e.constructor),void 0===e[r=r||u(e).id]?t.create(e):t.update(e)}},5922:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(5537),t),o(r(8403),t),o(r(2828),t),o(r(7781),t),o(r(9191),t),o(r(3162),t)},1101:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7674:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8403:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1101),t),o(r(7674),t)},9325:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DBModel=void 0;const n=r(2302),o=r(3793),a=r(4367),i=r(3036),s=r(465),c=r(6569);class u extends n.Model{constructor(e){super(e)}hasErrors(e,...t){!e||e instanceof u||(t.unshift(e),e=void 0);var r=super.hasErrors(...t);return r||!e?r:(0,c.validateCompare)(e,this,...t)}static findRepository(e){var t=Reflect.getMetadata((0,o.getDBKey)(a.DBKeys.REPOSITORY),e);if(!t)throw new i.InternalError("Could not find any registered repositories for "+e.name);if(t=s.Injectables.get(t))return t;throw new i.NotFoundError("Could not find repository for "+e.name)}}t.DBModel=u},4367:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_TIMESTAMP_FORMAT=t.DefaultSeparator=t.DBKeys=void 0,t.DBKeys={REFLECT:"model.db.",REPOSITORY:"repository",CLASS:"_class",ID:"id",INDEX:"index",UNIQUE:"unique",SERIALIZE:"serialize",READONLY:"readonly",TIMESTAMP:"timestamp",HASH:"hash",COMPOSED:"composed",ORIGINAL:"__originalObj"},t.DefaultSeparator="_",t.DEFAULT_TIMESTAMP_FORMAT="dd/MM/yyyy HH:mm:ss:S"},3793:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.composed=t.composedFromKeys=t.composedFromCreateUpdate=t.hash=t.hashOnCreateUpdate=t.index=t.getDBKey=void 0;const n=r(4367),o=r(32),a=r(2302),i=r(6441),s=r(3036);function c(e){return n.DBKeys.REFLECT+e}function u(e,t,r,n){var o;r[t]&&(o=a.Hashing.hash(r[t]),n&&r[t]===o||(r[t]=o))}function l(){return(0,o.apply)((0,i.onCreateUpdate)(u),(0,o.metadata)(c(n.DBKeys.HASH),{}))}function d(e,t=n.DefaultSeparator,r="values",o="",i=""){return function(n,c){try{var u=e.map((e=>{if(!(e in c))throw new s.InternalError((0,a.sf)("Property {0} not found to compose from",e));if("keys"===r)return e;if(void 0===c[e])throw new s.InternalError((0,a.sf)("Property {0} does not contain a value to compose from",e));return c[e].toString()}));o&&u.unshift(o),i&&u.push(i),c[n]=u.join(t)}catch(n){throw new s.InternalError("Failed to compose value: "+n)}}}function f(e,t=!1,r=n.DefaultSeparator,a="values",s="",u=""){var f={args:e,hashResult:t,separator:r,type:a,prefix:s,suffix:u};return e=[(0,i.onCreateUpdate)(d(e,r,a,s,u)),(0,o.metadata)(c(n.DBKeys.COMPOSED),f)],t&&e.push(l()),(0,o.apply)(...e)}t.getDBKey=c,t.index=function(e,t){return(0,o.metadata)(c(n.DBKeys.INDEX+(e&&e.length?"."+e.join("."):"")),{directions:t,compositions:e})},t.hashOnCreateUpdate=u,t.hash=l,t.composedFromCreateUpdate=d,t.composedFromKeys=function(e,t=!1,r="",o=""){return f(e,t,n.DefaultSeparator,"keys",r,o)},t.composed=function(e,t=!1,r="",o=""){return f(e,t,n.DefaultSeparator,"values",r,o)}},2828:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(4367),t),o(r(9325),t),o(r(3793),t)},6569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateCompare=void 0;const n=r(2302),o=r(32),a=r(3162),i=r(5537);t.validateCompare=function(e,t,...r){var s=[];for(const e in t)t.hasOwnProperty(e)&&-1===r.indexOf(e)&&s.push((0,o.getPropertyDecorators)(a.UpdateValidationKeys.REFLECT,t,e));let c;for(const r of s){var{prop:u,decorators:l}=r;if(l.shift(),l&&l.length){let o;for(const a of l){var d=n.Validation.get(a.key);d?(d=d.updateHasErrors(t[u.toString()],e[u.toString()],...Object.values(a.props)))&&((o=o||{})[a.key]=d):console.error(`Could not find Matching validator for ${a.key} for property `+String(r.prop))}o&&((c=c||{})[r.prop.toString()]=o)}}for(const a of Object.keys(t).filter((e=>!c||!c[e]))){let s;var f=(0,o.getPropertyDecorators)(n.ValidationKeys.REFLECT,t,a).decorators,p=(0,o.getPropertyDecorators)(n.ValidationKeys.REFLECT,t,a).decorators.filter((e=>-1!==[n.ModelKeys.TYPE,n.ValidationKeys.TYPE].indexOf(e.key)));if(p&&p.length){p=(p=p.pop()).props.name?[p.props.name]:Array.isArray(p.props.customTypes)?p.props.customTypes:[p.props.customTypes];var y=Object.values(n.ReservedModels).map((e=>e.toLowerCase()));for(const o of p){if(-1===y.indexOf(o.toLowerCase()))switch(o){case Array.name:case Set.name:if(f.length&&f.find((e=>e.key===n.ValidationKeys.LIST))){let r,n;switch(o){case Array.name:r=t[a],n=e[a];break;case Set.name:r=t[a].values(),n=e[a].values();break;default:throw new Error("Invalid attribute type "+o)}(s=r.map((e=>{const t=(0,i.findModelId)(e,!0);var r;return t?(r=n.find((e=>t===(0,i.findModelId)(e,!0))))?e.hasErrors(r):void 0:"Failed to find model id"})).filter((e=>!!e)))?.length||(s=void 0)}break;default:try{t[a]&&e[a]&&(s=t[a].hasErrors(e[a]))}catch(r){console.warn((0,n.sf)("Model should be validatable but its not"))}}s&&((c=c||{})[a]=s)}}}return c?new n.ModelErrorDefinition(c):void 0}},9121:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Operations=void 0;const n=r(2302),o=r(4300),a=r(6050);class i{constructor(){}static getHandlerName(e){return e.name||(console.warn("Handler name not defined. A name will be generated, but this is not desirable. please avoid using anonymous functions"),n.Hashing.hash(e.toString()))}static genKey(e){return a.OperationKeys.REFLECT+e}static get(e,t,r){return i.registry.get(e,t,r)}static getOpRegistry(){return i.registry||(i.registry=new o.OperationsRegistry),i.registry}static register(e,t,r,n){i.getOpRegistry().register(e,t,r,n)}}t.Operations=i},4300:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OperationsRegistry=void 0;const n=r(9121);t.OperationsRegistry=class{constructor(){this.cache={}}get(e,t,r,n){let o;n=n||[];try{o="string"==typeof e?e:e.constructor.name,n.unshift(...Object.values(this.cache[o][t][r]||[]))}catch(t){if("string"==typeof e||e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return n}let a=Object.getPrototypeOf(e);return a.constructor.name===o&&(a=Object.getPrototypeOf(a)),this.get(a,t,r,n)}register(e,t,r,o){r=r.constructor.name;var a=n.Operations.getHandlerName(e);this.cache[r]||(this.cache[r]={}),this.cache[r][o]||(this.cache[r][o]={}),this.cache[r][o][t]||(this.cache[r][o][t]={}),this.cache[r][o][t][a]||(this.cache[r][o][t][a]=e)}}},6050:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.DBOperations=t.OperationKeys=void 0,(n=r||(t.OperationKeys=r={})).REFLECT="operations.db.",n.CREATE="create",n.READ="read",n.UPDATE="update",n.DELETE="delete",n.ON="on.",n.AFTER="after.",t.DBOperations={CREATE:[r.CREATE],READ:[r.READ],UPDATE:[r.UPDATE],DELETE:[r.DELETE],CREATE_UPDATE:[r.CREATE,r.UPDATE],READ_CREATE:[r.READ,r.CREATE],ALL:[r.CREATE,r.READ,r.UPDATE,r.DELETE]}},6441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.operation=t.after=t.afterDelete=t.afterRead=t.afterCreate=t.afterUpdate=t.afterCreateUpdate=t.on=t.onDelete=t.onRead=t.onCreate=t.onUpdate=t.onCreateUpdate=void 0;const n=r(6050),o=r(9121),a=r(32);function i(e=n.DBOperations.ALL,t,r){return c(n.OperationKeys.ON,e,t,r)}function s(e=n.DBOperations.ALL,t,r){return c(n.OperationKeys.AFTER,e,t,r)}function c(e,t=n.DBOperations.ALL,r,i){return(n,s)=>{const c=n.constructor.name;var u=t.reduce(((t,u)=>{var l=e+u;let d=Reflect.getMetadata(o.Operations.genKey(l),n,s);return d=d||{operation:u,handlers:{}},u=o.Operations.getHandlerName(r),d.handlers[c]&&d.handlers[c][s]&&u in d.handlers[c][s]||(d.handlers[c]=d.handlers[c]||{},d.handlers[c][s]=d.handlers[c][s]||{},d.handlers[c][s][u]={data:i},t.push(function(e,t){return(r,n)=>{o.Operations.register(t,e,r,n)}}(l,r),(0,a.metadata)(o.Operations.genKey(l),d))),t}),[]);return(0,a.apply)(...u)(n,s)}}t.onCreateUpdate=function(e,t){return i(n.DBOperations.CREATE_UPDATE,e,t)},t.onUpdate=function(e,t){return i(n.DBOperations.UPDATE,e,t)},t.onCreate=function(e,t){return i(n.DBOperations.CREATE,e,t)},t.onRead=function(e,t){return i(n.DBOperations.READ,e,t)},t.onDelete=function(e,t){return i(n.DBOperations.DELETE,e,t)},t.on=i,t.afterCreateUpdate=function(e,t){return s(n.DBOperations.CREATE_UPDATE,e,t)},t.afterUpdate=function(e,t){return s(n.DBOperations.UPDATE,e,t)},t.afterCreate=function(e,t){return s(n.DBOperations.CREATE,e,t)},t.afterRead=function(e,t){return s(n.DBOperations.READ,e,t)},t.afterDelete=function(e,t){return s(n.DBOperations.DELETE,e,t)},t.after=s,t.operation=c},7781:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(6050),t),o(r(6441),t),o(r(9121),t),o(r(4300),t),o(r(5970),t)},5970:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BaseRepository=void 0;const n=r(2302),o=r(592),a=r(6050),i=r(3036),s=r(8569),c=r(749),u=r(5537);t.BaseRepository=class{get class(){if(this._class)return this._class;throw new i.InternalError("No class definition found for this repository")}get cache(){return this._cache||(this._cache=new s.DataCache),this._cache}constructor(){const e=this;[this.create,this.read,this.update,this.delete].forEach((t=>{var r=t.name;(0,c.wrapMethod)(e,e[r+"Prefix"],t,e[r+"Suffix"])}))}async create(e){throw new Error("Child classes must implement this.")}async createPrefix(e,...t){return e=new this.class(e),await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.CREATE,a.OperationKeys.ON),[e,...t]}async createSuffix(e){return await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.CREATE,a.OperationKeys.AFTER),e}async read(e){throw new Error("Child classes must implement this")}async readSuffix(e){return await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.READ,a.OperationKeys.AFTER),e}async readPrefix(e,...t){var r=new this.class;return await(0,o.enforceDBDecorators)(this,r,a.OperationKeys.READ,a.OperationKeys.ON),[e,...t]}async update(e){throw new Error("Child classes must implement this")}async updateSuffix(e){return e=new this.class(e),await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.UPDATE,a.OperationKeys.AFTER),e}async updatePrefix(e,...t){var r=(0,u.findModelId)(e);return r=await this.read(r),await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.UPDATE,a.OperationKeys.ON,r),[e,...t]}async delete(e){throw new Error("Child classes must implement this")}async deleteSuffix(e){return await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.DELETE,a.OperationKeys.AFTER),e}async deletePrefix(e,...t){var r=await this.read(e,...t);return await(0,o.enforceDBDecorators)(this,r,a.OperationKeys.DELETE,a.OperationKeys.ON),[e,...t]}toString(){return(0,n.sf)("[{0}] - Repository for {1}",this.constructor.name,this.class.name)}}},8569:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataCache=void 0;const n=r(3036);t.DataCache=class{constructor(){this.cache={}}async get(e){if(e in this.cache)return this.cache[e];throw new n.NotFoundError(`Key ${e} not in dataStore`)}async push(e,t){if(e in this.cache)throw new n.ConflictError(`Key ${e} already in dataStore`);this.cache[e]=t}async put(e,t){this.cache[e]=t}async pop(e){var t=this.get(e);return delete this.cache[e],t}async purge(e){e?await this.pop(e):this.cache={}}}},9553:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Repository=void 0;const n=r(2302),o=r(592),a=r(6050),i=r(3036),s=r(2022),c=r(5537);class u extends s.BaseRepository{constructor(){super()}async create(e){throw new Error("Child classes must implement this.")}async createPrefix(e,...t){e=new this.class(e),await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.CREATE,a.OperationKeys.ON);var r=e.hasErrors();if(r)throw new i.ValidationError(r.toString());let s;try{if(!(s=(0,c.findModelId)(e,!0)))return[e,...t];s&&await this.read(s.toString())}catch(r){if(r instanceof i.NotFoundError)return[e,...t];throw r}throw new i.ConflictError((0,n.sf)("Model with id {0} already exists",s))}async delete(e){throw new Error("Child classes must implement this.")}async deletePrefix(e,...t){var r=new this.class;return await(0,o.enforceDBDecorators)(this,r,a.OperationKeys.DELETE,a.OperationKeys.ON),await this.read(e),[e,...t]}async read(e){throw new Error("Child classes must implement this.")}async update(e){throw new Error("Child classes must implement this.")}async updatePrefix(e,...t){e=new this.class(e);var r=(0,c.findModelId)(e);if(r=await this.read(r),await(0,o.enforceDBDecorators)(this,e,a.OperationKeys.UPDATE,a.OperationKeys.ON,r),r=e.hasErrors(r))throw new i.ValidationError(r.toString());return[e,...t]}}t.Repository=u},8912:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultCascade=t.Cascade=void 0,(n=r||(t.Cascade=r={})).CASCADE="cascade",n.NONE="none",t.DefaultCascade={update:r.CASCADE,delete:r.NONE}},3931:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.repository=void 0;const n=r(465),o=r(32),a=r(3793),i=r(4367),s=r(3036);t.repository=function(e,t){return(r,c)=>{if(c){var u=Reflect.getMetadata((0,a.getDBKey)(i.DBKeys.REPOSITORY),e);if(u)return(0,n.inject)(u)(r,c);throw new s.InternalError("Could not find repository for "+e.name)}return(0,o.metadata)((0,a.getDBKey)(i.DBKeys.REPOSITORY),t||r.name)(e),(0,n.injectable)(t,!0,(t=>{Object.defineProperty(t,i.DBKeys.CLASS,{enumerable:!1,configurable:!1,writable:!1,value:e})}))(r)}}},3036:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictError=t.NotFoundError=t.SerializationError=t.InternalError=t.ValidationError=t.BaseError=void 0;class r extends Error{constructor(e,t){if(t instanceof r)return t;super(`[${e}] `+(t instanceof Error?t.message:t)),t instanceof Error&&(this.stack=t.stack)}}class n extends(t.BaseError=r){constructor(e){super(n.name,e)}}t.ValidationError=n;class o extends r{constructor(e){super(o.name,e)}}t.InternalError=o;class a extends r{constructor(e){super(a.name,e)}}t.SerializationError=a;class i extends r{constructor(e){super(i.name,e)}}t.NotFoundError=i;class s extends r{constructor(e){super(s.name,e)}}t.ConflictError=s},9191:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(2022),t),o(r(8912),t),o(r(8569),t),o(r(3931),t),o(r(3036),t),o(r(9553),t),o(r(2484),t),o(r(592),t),o(r(749),t)},2484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},592:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAllPropertyDecoratorsRecursive=t.getDbDecorators=t.enforceDBDecorators=t.getHandlerArgs=void 0;const n=r(9121),o=r(6050),a=r(32),i=r(3036),s=r(2302);function c(e,t,r){const n=(0,a.getAllPropertyDecorators)(e,o.OperationKeys.REFLECT+(r||""));if(n)return Object.keys(n).reduce(((e,r)=>{var o=n[r].filter((e=>e.key===t));return o&&o.length&&((e=e||{})[r]=o),e}),void 0)}t.getHandlerArgs=function(e,r,n,o){var a=n.constructor.name;if(!a)throw new i.InternalError("Could not determine model class");o=o||{},e.props.handlers[a]&&e.props.handlers[a][r]&&(o={...e.props.handlers[a][r],...o});let s=Object.getPrototypeOf(n);return s===Object.prototype?o:(s.constructor.name===a&&(s=Object.getPrototypeOf(s)),(0,t.getHandlerArgs)(e,r,s,o))},t.enforceDBDecorators=async function(e,r,a,u,l){var d=c(r,a,u);if(d)for(const c in d)for(const v of d[c]){var f=v.key,p=n.Operations.get(r,c,u+f);if(!p||!p.length)throw new i.InternalError(`Could not find registered handler for the operation ${u+f} under property `+c);var y=(0,t.getHandlerArgs)(v,c,r);if(!y||Object.values(y).length!==p.length)throw new i.InternalError((0,s.sf)("Args and handlers length do not match"));for(let t=0;t<p.length;t++){var h=p[t],g=[Object.values(y)[t].data,c,r];if(a===o.OperationKeys.UPDATE){if(!l)throw new i.InternalError("Missing old model for update operation");g.push(l)}await h.apply(e,g)}}},t.getDbDecorators=c,t.getAllPropertyDecoratorsRecursive=function(e,r,...n){const i=r||{};return(r=(0,a.getAllPropertyDecorators)(e,...n))&&function(e){Object.entries(e).forEach((([e,t])=>{var r;i[e]=i[e]||[],[r,...e]=[e,...t],e.forEach((e=>{var t;if((t=i[r].find((t=>t.key===e.key)))&&t.props.operation===e.props.operation){if(e.key!==s.ModelKeys.TYPE){var{handlers:n,operation:a}=e.props;if(a&&a.match(new RegExp(`^(:?${o.OperationKeys.ON}|${o.OperationKeys.AFTER})(:?${o.OperationKeys.CREATE}|${o.OperationKeys.READ}|${o.OperationKeys.UPDATE}|${o.OperationKeys.DELETE})$`))){const e=t.props.handlers;Object.entries(n).forEach((([t,r])=>{t in e?Object.entries(r).forEach((([r,n])=>{r in e[t]?Object.entries(n).forEach((([n,o])=>{n in e[t][r]?console.warn((0,s.sf)("Skipping handler registration for {0} under prop {0} because handler is the same",t,r)):e[t][r][n]=o})):e[t][r]=n})):e[t]=r}))}else i[r].push(e)}}else i[r].push(e)}))}))}(r),Object.getPrototypeOf(e)!==Object.prototype&&(r=Object.getPrototypeOf(e))?(0,t.getAllPropertyDecoratorsRecursive)(r,i,...n):i}},749:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wrapMethod=t.suffixMethod=t.prefixMethod=void 0,t.prefixMethod=function(e,t,r,n){var o=async function(...e){return e=await Promise.resolve(r.call(this,...e)),Promise.resolve(t.apply(this,e))}.bind(e);n=n||t.name,Object.defineProperty(o,"name",{enumerable:!0,configurable:!0,writable:!1,value:n}),e[n]=o},t.suffixMethod=function(e,t,r,n){var o=async function(...e){return e=await Promise.resolve(t.call(this,...e)),r.call(this,...e)}.bind(e);n=n||t.name,Object.defineProperty(o,"name",{enumerable:!0,configurable:!0,writable:!1,value:n}),e[n]=o},t.wrapMethod=function(e,t,r,n,o){var a=async function(...o){return o=await Promise.resolve(t.call(e,...o)),o=await Promise.resolve(r.call(e,...o)),Promise.resolve(n.call(this,o))}.bind(e);o=o||r.name,Object.defineProperty(a,"name",{enumerable:!0,configurable:!0,writable:!1,value:o}),e[o]=a}},6753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OrderDirection=t.UpdateValidationKeys=t.DEFAULT_ERROR_MESSAGES=void 0;const n=r(4367);var o,a;t.DEFAULT_ERROR_MESSAGES={ID:{INVALID:"This Id is invalid",REQUIRED:"The Id is mandatory"},READONLY:{INVALID:"This cannot be updated"},TIMESTAMP:{REQUIRED:"Timestamp is Mandatory",DATE:"The Timestamp must the a valid date",INVALID:"This value must always increase"}},t.UpdateValidationKeys={REFLECT:"db.update.validation.",TIMESTAMP:n.DBKeys.TIMESTAMP,READONLY:n.DBKeys.READONLY},(a=o||(t.OrderDirection=o={})).ASC="asc",a.DSC="desc"},9252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.serializeAfterAll=t.serializeOnCreateUpdate=t.unique=t.uniqueOnCreateUpdate=t.timestamp=t.timestampHandler=t.readonly=t.getDBUpdateKey=void 0;const n=r(2302),o=r(4367),a=r(6753),i=r(6050),s=r(6441),c=r(3036),u=r(32),l=r(3793);function d(e){return a.UpdateValidationKeys.REFLECT+e}function f(e,t,r){r[t]=new Date}async function p(e,t,r){if(r[t]){try{await this.read(r[t])}catch(e){if(e instanceof c.NotFoundError)return}throw new c.ConflictError(`model already exists with ${t} equal to `+JSON.stringify(r[t],void 0,2))}}async function y(e,t,r,o){if(r[t])try{r[t]=JSON.stringify(r[t])}catch(e){throw new c.SerializationError((0,n.sf)("Failed to serialize {0} property on {0} model",t,r.constructor.name))}}async function h(e,t,r){if(r[t]&&"string"==typeof r[t])try{r[t]=JSON.parse(r[t])}catch(e){throw new c.SerializationError((0,n.sf)("Failed to deserialize {0} property on {0} model",t,r.constructor.name))}}t.getDBUpdateKey=d,t.readonly=function(e=a.DEFAULT_ERROR_MESSAGES.READONLY.INVALID){return(0,u.metadata)(d(o.DBKeys.READONLY),{message:e})},t.timestampHandler=f,t.timestamp=function(e=i.DBOperations.CREATE_UPDATE,t=o.DEFAULT_TIMESTAMP_FORMAT){return t=[(0,n.date)(t,a.DEFAULT_ERROR_MESSAGES.TIMESTAMP.DATE),(0,n.required)(a.DEFAULT_ERROR_MESSAGES.TIMESTAMP.REQUIRED),(0,s.on)(e,f)],-1!==e.indexOf(i.OperationKeys.UPDATE)&&t.push((0,u.metadata)(d(o.DBKeys.TIMESTAMP),{message:a.DEFAULT_ERROR_MESSAGES.TIMESTAMP.INVALID})),(0,u.apply)(...t)},t.uniqueOnCreateUpdate=p,t.unique=function(){return(0,u.apply)((0,s.onCreateUpdate)(p),(0,u.metadata)((0,l.getDBKey)(o.DBKeys.UNIQUE),{}))},t.serializeOnCreateUpdate=y,t.serializeAfterAll=h,t.serialize=function(){return(0,u.apply)((0,s.onCreateUpdate)(y),(0,s.after)(i.DBOperations.ALL,h),(0,n.type)([String.name,Object.name]),(0,u.metadata)((0,l.getDBKey)(o.DBKeys.SERIALIZE),{}))}},3162:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(1362),t),o(r(6753),t),o(r(9252),t)},9174:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(i=(a<3?o(i):3<a?o(t,r,i):o(t,r))||i);return 3<a&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadOnlyValidator=void 0;const a=r(2302),i=r(6753),s=r(32);let c=class extends a.Validator{constructor(){super(i.DEFAULT_ERROR_MESSAGES.READONLY.INVALID)}hasErrors(e){}updateHasErrors(e,t,r){return void 0===e||(0,s.isEqual)(e,t)?void 0:this.getMessage(r||this.message)}};t.ReadOnlyValidator=c,t.ReadOnlyValidator=c=n([(0,a.validator)(i.UpdateValidationKeys.READONLY),o("design:paramtypes",[])],c)},8944:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;0<=s;s--)(o=e[s])&&(i=(a<3?o(i):3<a?o(t,r,i):o(t,r))||i);return 3<a&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TimestampValidator=void 0;const a=r(2302),i=r(6753);let s=class extends a.Validator{constructor(){super(i.DEFAULT_ERROR_MESSAGES.TIMESTAMP.INVALID)}hasErrors(e){}updateHasErrors(e,t,r){if(void 0!==e){r=r||this.getMessage(r||this.message);try{e=new Date(e),t=new Date(t)}catch(e){return r}return e<=t?r:void 0}}};t.TimestampValidator=s,t.TimestampValidator=s=n([(0,a.validator)(i.UpdateValidationKeys.TIMESTAMP),o("design:paramtypes",[])],s)},4981:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateValidator=void 0;const n=r(2302);class o extends n.Validator{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){super(e,...t)}}t.UpdateValidator=o},1362:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(9174),t),o(r(8944),t),o(r(4981),t)},2302:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(4072),t),o(r(5030),t),o(r(5643),t),t.VERSION="1.3.0"},3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Model=void 0;const n=r(4744),o=r(4939),a=r(1825),i=r(32),s=r(2709),c=r(2252),u=r(9683),l=r(7675);let d,f;class p{constructor(e){}hasErrors(...e){return(0,s.validate)(this,...e)}equals(e,...t){return(0,i.isEqual)(this,e,...t)}serialize(){return p.serialize(this)}toString(){return this.constructor.name+": "+JSON.stringify(this,void 0,2)}hash(){return p.hash(this)}static deserialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),this.constructor);return t&&t.serializer?n.Serialization.deserialize(e,t.serializer,...t.args||[]):n.Serialization.deserialize(e)}static fromObject(e,t){return(0,o.constructFromObject)(e,t)}static fromModel(e,t){return(0,o.constructFromModel)(e,t)}static setBuilder(e){d=e}static getBuilder(){return d}static getRegistry(){return f||(f=new a.ModelRegistryManager),f}static setRegistry(e){f=e}static register(e,t){return p.getRegistry().register(e,t)}static get(e){return p.getRegistry().get(e)}static build(e={},t){return p.getRegistry().build(e,t)}static getMetadata(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.MODEL),e.constructor);if(!t)throw new Error("could not find metadata for provided "+e.constructor.name);return t}static equals(e,t,...r){return(0,i.isEqual)(e,t,...r)}static hasErrors(e,...t){return(0,s.validate)(e,...t)}static serialize(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.SERIALIZATION),e.constructor);return t&&t.serializer?n.Serialization.serialize(this,t.serializer,...t.args||[]):n.Serialization.serialize(e)}static hash(e){const t=Reflect.getMetadata((0,u.getModelKey)(l.ModelKeys.HASHING),e.constructor);return t&&t.algorithm?c.Hashing.hash(e,t.algorithm,...t.args||[]):c.Hashing.hash(e)}}t.Model=p},3368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelErrorDefinition=void 0,t.ModelErrorDefinition=class{constructor(e){for(const t in e)e.hasOwnProperty(t)&&e[t]&&Object.defineProperty(this,t,{enumerable:!0,configurable:!1,value:e[t],writable:!1})}toString(){const e=this;return Object.keys(e).filter((t=>e.hasOwnProperty(t)&&"function"!=typeof e[t])).reduce(((t,r)=>{let n=Object.keys(e[r]).reduce(((t,n)=>(t?t+=`\n${e[r][n]}`:t=e[r][n],t)),void 0);return n&&(n=`${r} - ${n}`,t?t+=`\n${n}`:t=n),t}),"")}}},1825:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ModelRegistryManager=void 0,t.bulkModelRegister=function(...e){e.forEach((e=>{const t=e.constructor?e.constructor:e;n.Model.register(t,e.name)}))};const n=r(3),o=r(1318),a=r(9683);t.ModelRegistryManager=class{constructor(e=a.isModel){this.cache={},this.testFunction=e}register(e,t){if("function"!=typeof e)throw new Error("Model registering failed. Missing Class name or constructor");t=t||e.name,this.cache[t]=e}get(e){try{return this.cache[e]}catch(e){return}}build(e={},t){if(!t&&!this.testFunction(e))throw new Error("Provided obj is not a Model object");const r=t||n.Model.getMetadata(e);if(!(r in this.cache))throw new Error((0,o.sf)("Provided class {0} is not a registered Model object",r));return new this.cache[r](e)}}},8539:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.jsTypes=t.ReservedModels=t.Primitives=void 0,function(e){e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint"}(r||(t.Primitives=r={})),function(e){e.STRING="string",e.OBJECT="object",e.NUMBER="number",e.BOOLEAN="boolean",e.BIGINT="bigint",e.DATE="date"}(n||(t.ReservedModels=n={})),t.jsTypes=["string","array","number","boolean","symbol","function","object","undefined","null","bigint"]},4939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.constructFromObject=function(e,t){if(!t)return e;for(const r in t)t.hasOwnProperty(r)&&(e.hasOwnProperty(r)||e.prototype&&e.prototype.hasOwnProperty(r))&&(e[r]=t[r]||void 0);return e},t.constructFromModel=function(e,t){if(!t)return e;let r,l;for(const d in t)if(t.hasOwnProperty(d)&&(e.hasOwnProperty(d)||e.prototype&&e.prototype.hasOwnProperty(d))){if(e[d]=t[d],"object"!=typeof e[d])continue;if((0,u.isModel)(e[d])){try{e[d]=n.Model.build(e[d])}catch(e){console.log(e)}continue}const f=(0,c.getPropertyDecorators)(o.ValidationKeys.REFLECT,e,d).decorators;if(r=f.filter((e=>-1!==[i.ModelKeys.TYPE,o.ValidationKeys.TYPE].indexOf(e.key))),!r||!r.length)throw new Error((0,s.sf)("failed to find decorators for property {0}",d));l=r.pop();const p=l.props.name?[l.props.name]:Array.isArray(l.props.customTypes)?l.props.customTypes:[l.props.customTypes],y=Object.values(a.ReservedModels).map((e=>e.toLowerCase()));p.forEach((t=>{if(-1===y.indexOf(t.toLowerCase()))try{switch(t){case"Array":case"Set":if(f.length){const r=f.find((e=>e.key===o.ValidationKeys.LIST));if(r){const o=r.props.class.find((e=>!a.jsTypes.includes(e.toLowerCase())));if("Array"===t&&(e[d]=e[d].map((e=>["object","function"].includes(typeof e)&&o?n.Model.build(e,o):e))),"Set"===t){const t=new Set;for(const r of e[d])["object","function"].includes(typeof r)&&o?t.add(n.Model.build(r,o)):t.add(r);e[d]=t}}}break;default:e[d]&&(e[d]=n.Model.build(e[d],t))}}catch(e){console.log(e)}}))}return e},t.construct=function(e,...t){const r=(...t)=>new e(...t);return r.prototype=e.prototype,r(...t)},t.findLastProtoBeforeObject=function(e){let t=Object.getPrototypeOf(e);if(t===Object.prototype)return e;for(;t!==Object.prototype;){if(t=Object.getPrototypeOf(t),t===Object.prototype)return t;if(Object.getPrototypeOf(t)===Object.prototype)return t}throw new Error("Could not find proper prototype")},t.bindModelPrototype=function(e){if(e instanceof n.Model)return;function t(e,t){Object.setPrototypeOf(e,t)}const r=Object.getPrototypeOf(e);if(r===Object.prototype)return t(e,n.Model.prototype);for(;r!==Object.prototype;){const e=Object.getPrototypeOf(r);if(e===Object.prototype||Object.getPrototypeOf(e)===Object.prototype)return t(r,n.Model.prototype)}throw new Error("Could not find proper prototype to bind")};const n=r(3),o=r(5021),a=r(8539),i=r(7675),s=r(1318),c=r(32),u=r(9683)},754:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.model=function(e,t){return r=>{const c=function(...c){const u=(0,n.construct)(r,...c);(0,n.bindModelPrototype)(u);const l=a.Model.getBuilder();return l&&l(u,c.length?c[0]:void 0),(0,s.metadata)((0,i.getModelKey)(o.ModelKeys.MODEL),e||r.name)(u.constructor),t&&t(u,...c),u};return c.prototype=r.prototype,Object.defineProperty(c,"name",{writable:!1,enumerable:!0,configurable:!1,value:r.prototype.constructor.name}),a.Model.register(c,e),c}};const n=r(4939),o=r(7675),a=r(3),i=r(9683),s=r(32)},5643:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(8539),t),o(r(4939),t),o(r(754),t),o(r(3),t),o(r(3368),t),o(r(1825),t),o(r(1967),t),o(r(9683),t),o(r(2709),t)},1967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9683:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getModelKey=void 0,t.isModel=function(e){try{return!!o.Model.getMetadata(e)}catch(e){return!1}};const n=r(7675),o=r(3);t.getModelKey=e=>n.ModelKeys.REFLECT+e},2709:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(e,...t){const r=[];for(const n in e)e.hasOwnProperty(n)&&-1===t.indexOf(n)&&r.push((0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,n));let l;for(const t of r){const{prop:r,decorators:n}=t;if(!n||!n.length)continue;const o=n[0];let i;n.find((e=>e.key===u.ValidationKeys.TYPE||!!e.props.types?.find((e=>e===o.props.name))))&&n.shift();for(const t of n){const n=c.Validation.get(t.key);if(!n)throw new Error(`Missing validator for ${t.key}`);const o=n.hasErrors(e[r.toString()],...t.key===a.ModelKeys.TYPE?[t.props]:Object.values(t.props));o&&(i=i||{},i[t.key]=o)}i&&(l=l||{},l[t.prop.toString()]=i)}for(const t of Object.keys(e).filter((e=>!l||!l[e]))){let r,n;const c=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators,d=(0,o.getPropertyDecorators)(u.ValidationKeys.REFLECT,e,t).decorators.filter((e=>-1!==[a.ModelKeys.TYPE,u.ValidationKeys.TYPE].indexOf(e.key)));if(!d||!d.length)continue;const f=d.pop(),p=f.props.name?[f.props.name]:Array.isArray(f.props.customTypes)?f.props.customTypes:[f.props.customTypes],y=Object.values(s.ReservedModels).map((e=>e.toLowerCase()));for(const o of p)if(-1===y.indexOf(o.toLowerCase())){const a=Array.isArray(e[t])?u.ValidationKeys.LIST:u.ValidationKeys.TYPE,s=c.find((e=>e.key===a))||{};let l=[];if(s&&s.props){const r=Array.isArray(e[t])?s.props.class:s.props.customTypes;r&&(l=Array.isArray(r)?r.map((e=>`${e}`.toLowerCase())):[r.toLowerCase()])}const d=(e,t,r)=>{const n=t>=0?`at index ${t} `:"";return"object"==typeof r||"function"==typeof r?r.hasErrors?r.hasErrors():`Value in prop ${e} ${n}is not validatable`:l.includes(typeof r)?void 0:`Value in prop ${e} ${n}has no valid type`};switch(o){case Array.name:case Set.name:if(c.length&&c.find((e=>e.key===u.ValidationKeys.LIST))){const n=o===(Array.name?e[t]:e[t].values()).find(((e,r)=>d(t,r,e)));n&&(r=(0,i.sf)(u.DEFAULT_ERROR_MESSAGES.LIST_INSIDE,n.toString()))}break;default:try{e[t]&&(r=d(t,-1,e[t]))}catch(e){console.warn((0,i.sf)("Model should be validatable but its not"))}}r&&(n=n||{},n[t]=r)}n&&(l=l||{},l[t]=n)}return l?new n.ModelErrorDefinition(l):void 0};const n=r(3368),o=r(32),a=r(7675),i=r(1318),s=r(8539),c=r(1375),u=r(5021)},7675:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ModelKeys=void 0,function(e){e.REFLECT="model.definition.",e.TYPE="design:type",e.PARAMS="design:paramtypes",e.RETURN="design:returntype",e.MODEL="model",e.ANCHOR="__modelDefinition",e.HASHING="hashing",e.SERIALIZATION="serialization",e.BINDING="binding"}(r||(t.ModelKeys=r={}))},5243:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dateFromFormat=a,t.bindDateToString=i,t.isValidDate=s,t.twoDigitPad=c,t.formatDate=u,t.parseDate=function(e,t){let r;if(t){if(t instanceof Date)try{r=a(u(t,e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t.toString(),e))}else if("string"==typeof t)r=a(t,e);else if("number"==typeof t)r=a(u(new Date(t),e),e);else{if(!s(t))throw new Error(`Invalid value provided ${t}`);try{r=a(u(new Date(t),e),e)}catch(r){throw new Error((0,o.sf)("Could not convert date {0} to format: {1}",t,e))}}return i(r,e)}},r(8630);const n=r(5021),o=r(1318);function a(e,t){let r=t;r.match(/hh/)?r=r.replace("hh","(?<hour>\\d{2})"):r.match(/h/)?r=r.replace("h","(?<hour>\\d{1,2})"):r.match(/HH/)?r=r.replace("HH","(?<hour>\\d{2})"):r.match(/H/)&&(r=r.replace("H","(?<hour>\\d{1,2})")),r.match(/mm/)?r=r.replace("mm","(?<minutes>\\d{2})"):r.match(/m/)&&(r=r.replace("m","(?<minutes>\\d{1,2})")),r.match(/ss/)?r=r.replace("ss","(?<seconds>\\d{2})"):r.match(/s/)&&(r=r.replace("s","(?<seconds>\\d{1,2})")),r.match(/dd/)?r=r.replace("dd","(?<day>\\d{2})"):r.match(/d/)&&(r=r.replace("d","(?<day>\\d{1,2})")),r.match(/EEEE/)?r=r.replace("EEEE","(?<dayofweek>\\w+)"):r.match(/EEEE/)&&(r=r.replace("EEE","(?<dayofweek>\\w+)")),r.match(/yyyy/)?r=r.replace("yyyy","(?<year>\\d{4})"):r.match(/yy/)&&(r=r.replace("yy","(?<year>\\d{2})")),r.match(/MMMM/)?r=r.replace("MMMM","(?<monthname>\\w+)"):r.match(/MMM/)&&(r=r.replace("MMM","(?<monthnamesmall>\\w+)")),r.match(/MM/)?r=r.replace("MM","(?<month>\\d{2})"):r.match(/M/)&&(r=r.replace("M","(?<month>\\d{1,2})")),r=r.replace("S","(?<milis>\\d{1,3})").replace("aaa","(?<ampm>\\w{2})");const o=new RegExp(r,"g").exec(e);if(!o||!o.groups)return new Date(e);const a=function(e){if(!e)return 0;const t=parseInt(e);return isNaN(t)?0:t},i=a(o.groups.year),s=a(o.groups.day),c=o.groups.ampm;let u=a(o.groups.hour);c&&(u="PM"===c?u+12:u);const l=a(o.groups.minutes),d=a(o.groups.seconds),f=a(o.groups.milis),p=o.groups.monthname,y=o.groups.monthnamesmall;let h=o.groups.month;if(p)h=n.MONTH_NAMES.indexOf(p);else if(y){const t=n.MONTH_NAMES.find((e=>e.toLowerCase().startsWith(y.toLowerCase())));if(!t)return new Date(e);h=n.MONTH_NAMES.indexOf(t)}else h=a(`${h}`);return new Date(i,h-1,s,u,l,d,f)}function i(e,t){if(!e)return;const r=()=>u(e,t);return Object.defineProperty(e,"toISOString",{enumerable:!1,configurable:!1,value:r}),Object.defineProperty(e,"toString",{enumerable:!1,configurable:!1,value:r}),e}function s(e){return e&&"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e)}function c(e){return e<10?"0"+e:e.toString()}function u(e,t="yyyy/MM/dd"){const r=e.getDate(),o=e.getMonth(),a=e.getFullYear(),i=e.getHours(),s=e.getMinutes(),u=e.getSeconds(),l=e.getMilliseconds(),d=i%12,f=c(d),p=c(i),y=c(s),h=c(u),g=i<12?"AM":"PM",v=n.DAYS_OF_WEEK_NAMES[e.getDay()],O=v.substr(0,3),E=c(r),b=o+1,_=c(b),m=n.MONTH_NAMES[o],M=m.substr(0,3),R=a+"",w=R.substr(2,2);return(t=t.replace("hh",f).replace("h",d.toString()).replace("HH",p).replace("H",i.toString()).replace("mm",y).replace("m",s.toString()).replace("ss",h).replace("s",u.toString()).replace("S",l.toString()).replace("dd",E).replace("d",r.toString()).replace("EEEE",v).replace("EEE",O).replace("yyyy",R).replace("yy",w).replace("aaa",g)).indexOf("MMM")>-1?t.replace("MMMM",m).replace("MMM",M):t.replace("MM",_).replace("M",b.toString())}},3042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hashedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.HASHING),{algorithm:e,args:t})},t.serializedBy=function(e,...t){return(0,n.metadata)((0,a.getModelKey)(o.ModelKeys.SERIALIZATION),{serializer:e,args:t})};const n=r(32),o=r(7675),a=r(9683)},2252:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hashing=t.DefaultHashingMethod=void 0,t.hashCode=o,t.hashSerialization=function(e){return o(n.Serialization.serialize(e))},t.hashObj=a;const n=r(4744);function o(e){e=String(e);let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return t.toString()}function a(e){const t=function(e,t){const r=n(t);return"string"==typeof r?n((e||"")+n(t)):0|(e=((e=e||0)<<5)-e+r)},r=o,n=function(e){return void 0===e?"":-1!==["string","number","symbol"].indexOf(typeof e)?r(e.toString()):e instanceof Date?r(e.getTime()):Array.isArray(e)?e.reduce(t,void 0):Object.values(e).reduce(t,void 0)},a=Object.values(e).reduce(t,0);return("number"==typeof a?Math.abs(a):a).toString()}t.DefaultHashingMethod="default";class i{static{this.current=t.DefaultHashingMethod}static{this.cache={default:a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No hashing method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Hashing method ${e} already registered`);this.cache[e]=t,r&&(this.current=e)}static hash(e,t,...r){return t?this.get(t)(e,...r):this.get(this.current)(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Hashing=i},4072:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(7675),t),o(r(5243),t),o(r(3042),t),o(r(2252),t),o(r(2417),t),o(r(4744),t),o(r(1318),t)},2417:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Serialization=t.DefaultSerializationMethod=t.JSONSerializer=void 0;const n=r(3),o=r(7675);class a{preSerialize(e){const t=Object.assign({},e),r=n.Model.getMetadata(e);return t[o.ModelKeys.ANCHOR]=r||e.constructor.name,t}deserialize(e){const t=JSON.parse(e),r=t[o.ModelKeys.ANCHOR];if(!r)throw new Error("Could not find class reference in serialized model");return n.Model.build(t,r)}serialize(e){return JSON.stringify(this.preSerialize(e))}}t.JSONSerializer=a,t.DefaultSerializationMethod="json";class i{static{this.current=t.DefaultSerializationMethod}static{this.cache={json:new a}}constructor(){}static get(e){if(e in this.cache)return this.cache[e];throw new Error(`No serialization method registered under ${e}`)}static register(e,t,r=!1){if(e in this.cache)throw new Error(`Serialization method ${e} already registered`);this.cache[e]=new t,r&&(this.current=e)}static serialize(e,t,...r){return t?this.get(t).serialize(e,...r):this.get(this.current).serialize(e,...r)}static deserialize(e,t,...r){return t?this.get(t).deserialize(e,...r):this.get(this.current).deserialize(e,...r)}static setDefault(e){this.current=this.get(e)}}t.Serialization=i},1318:(e,t)=>{"use strict";function r(e,...t){return e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r].toString():"undefined"}))}Object.defineProperty(t,"__esModule",{value:!0}),t.sf=void 0,t.stringFormat=r,t.sf=r},1375:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validation=void 0;const n=r(3201);class o{static{this.actingValidatorRegistry=void 0}constructor(){}static setRegistry(e,t){t&&o.actingValidatorRegistry&&o.actingValidatorRegistry.getKeys().forEach((r=>{const n=e.get(r);n&&e.register(t(n))})),o.actingValidatorRegistry=e}static getRegistry(){return o.actingValidatorRegistry||(o.actingValidatorRegistry=new n.ValidatorRegistry),o.actingValidatorRegistry}static get(e){return o.getRegistry().get(e)}static register(...e){return o.getRegistry().register(...e)}}t.Validation=o},3576:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.DateValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.DATE){super(e,Number.name,Date.name,String.name)}hasErrors(e,t,r){if(void 0!==e)return"string"==typeof e&&(e=new Date(e)),isNaN(e.getDate())?this.getMessage(r||this.message):void 0}};t.DateValidator=c,t.DateValidator=c=n([(0,s.validator)(i.ValidationKeys.DATE),o("design:paramtypes",[String])],c)},5224:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailValidator=void 0;const a=r(5021),i=r(6174),s=r(8024);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.EMAIL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.EMAIL,r)}};t.EmailValidator=c,t.EmailValidator=c=n([(0,s.validator)(a.ValidationKeys.EMAIL),o("design:paramtypes",[String])],c)},2888:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ListValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.LIST){super(e,Array.name,Set.name)}hasErrors(e,t,r){if(!e||(Array.isArray(e)?!e.length:!e.size))return;t=Array.isArray(t)?t:[t];let n,o=!0;for(let r=0;r<(Array.isArray(e)?e.length:e.size);r++)switch(n=e[r],typeof n){case"object":case"function":o=t.includes(n.constructor?.name);break;default:o=t.some((e=>typeof n===e.toLowerCase()))}return o?void 0:this.getMessage(r||this.message,t)}};t.ListValidator=c,t.ListValidator=c=n([(0,s.validator)(i.ValidationKeys.LIST),o("design:paramtypes",[String])],c)},2382:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxLengthValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length>t?this.getMessage(r||this.message,t):void 0}};t.MaxLengthValidator=c,t.MaxLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX_LENGTH),o("design:paramtypes",[String])],c)},9378:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MaxValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MAX){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Max param defined");return e>t?this.getMessage(r||this.message,t):void 0}}};t.MaxValidator=c,t.MaxValidator=c=n([(0,s.validator)(i.ValidationKeys.MAX),o("design:paramtypes",[String])],c)},2396:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinLengthValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){super(e,String.name,Array.name)}hasErrors(e,t,r){if(void 0!==e)return e.length<t?this.getMessage(r||this.message,t):void 0}};t.MinLengthValidator=c,t.MinLengthValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN_LENGTH),o("design:paramtypes",[String])],c)},9320:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.MinValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.MIN){super(e,"number","Date","string")}hasErrors(e,t,r){if(void 0!==e){if(e instanceof Date&&!(t instanceof Date)&&(t=new Date(t),isNaN(t.getDate())))throw new Error("Invalid Min param defined");return e<t?this.getMessage(r||this.message,t):void 0}}};t.MinValidator=c,t.MinValidator=c=n([(0,s.validator)(i.ValidationKeys.MIN),o("design:paramtypes",[String])],c)},3317:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PasswordValidator=void 0;const a=r(6174),i=r(5021),s=r(8024);let c=class extends a.PatternValidator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PASSWORD){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||i.DEFAULT_ERROR_MESSAGES.PASSWORD,r||this.message)}};t.PasswordValidator=c,t.PasswordValidator=c=n([(0,s.validator)(i.ValidationKeys.PASSWORD),o("design:paramtypes",[Object])],c)},6174:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.PatternValidator=t.regexpParser=void 0;const a=r(7036),i=r(5021),s=r(8024);t.regexpParser=new RegExp("^/(.+)/([gimus]*)$");let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.PATTERN){super(e,"string")}getPattern(e){if(!t.regexpParser.test(e))return new RegExp(e);const r=e.match(t.regexpParser);return new RegExp(r[1],r[2])}hasErrors(e,t,r){if(e){if(!t)throw new Error("Missing Pattern");return(t="string"==typeof t?this.getPattern(t):t).lastIndex=0,t.test(e)?void 0:this.getMessage(r||this.message)}}};t.PatternValidator=c,t.PatternValidator=c=n([(0,s.validator)(i.ValidationKeys.PATTERN),o("design:paramtypes",[String])],c)},8089:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequiredValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.REQUIRED){super(e)}hasErrors(e,t){switch(typeof e){case"boolean":case"number":return void 0===e?this.getMessage(t||this.message):void 0;default:return e?void 0:this.getMessage(t||this.message)}}};t.RequiredValidator=c,t.RequiredValidator=c=n([(0,s.validator)(i.ValidationKeys.REQUIRED),o("design:paramtypes",[String])],c)},6942:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.StepValidator=void 0;const a=r(7036),i=r(5021),s=r(8024);let c=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.STEP){super(e,"number","string")}hasErrors(e,t,r){if(void 0!==e)return Number(e)%Number(t)!=0?this.getMessage(r||this.message,t):void 0}};t.StepValidator=c,t.StepValidator=c=n([(0,s.validator)(i.ValidationKeys.STEP),o("design:paramtypes",[String])],c)},4972:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.TypeValidator=void 0;const a=r(7036),i=r(5021),s=r(8024),c=r(1375),u=r(32),l=r(7675);let d=class extends a.Validator{constructor(e=i.DEFAULT_ERROR_MESSAGES.TYPE){super(e)}hasErrors(e,t,r){if(void 0!==e)return(0,u.evaluateDesignTypes)(e,t)?void 0:this.getMessage(r||this.message,"string"==typeof t?t:Array.isArray(t)?t.join(", "):t.name,typeof e)}};t.TypeValidator=d,t.TypeValidator=d=n([(0,s.validator)(i.ValidationKeys.TYPE),o("design:paramtypes",[String])],d),c.Validation.register({validator:d,validationKey:l.ModelKeys.TYPE,save:!1})},8689:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var o,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(i=(a<3?o(i):a>3?o(t,r,i):o(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},o=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.URLValidator=void 0;const a=r(5021),i=r(6174),s=r(8024);let c=class extends i.PatternValidator{constructor(e=a.DEFAULT_ERROR_MESSAGES.URL){super(e)}hasErrors(e,t,r){return super.hasErrors(e,t||a.DEFAULT_PATTERNS.URL,r)}};t.URLValidator=c,t.URLValidator=c=n([(0,s.validator)(a.ValidationKeys.URL),o("design:paramtypes",[String])],c)},7036:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Validator=void 0;const n=r(5021),o=r(1318),a=r(32);t.Validator=class{constructor(e=n.DEFAULT_ERROR_MESSAGES.DEFAULT,...t){this.message=e,t.length&&(this.acceptedTypes=t),this.acceptedTypes&&(this.hasErrors=this.checkTypeAndHasErrors(this.hasErrors.bind(this)))}getMessage(e,...t){return(0,o.sf)(e,...t)}checkTypeAndHasErrors(e){return function(t,...r){return void 0!==t&&this.acceptedTypes?(0,a.checkTypes)(t,this.acceptedTypes)?e(t,...r):this.getMessage(n.DEFAULT_ERROR_MESSAGES.TYPE,this.acceptedTypes.join(", "),typeof t):e(t,...r)}.bind(this)}}},3201:(e,t)=>{"use strict";function r(e){return e.constructor&&e.hasErrors}Object.defineProperty(t,"__esModule",{value:!0}),t.ValidatorRegistry=void 0,t.isValidator=r,t.ValidatorRegistry=class{constructor(...e){this.cache={},this.customKeyCache={},this.register(...e)}getCustomKeys(){return Object.assign({},this.customKeyCache)}getKeys(){return Object.keys(this.cache)}get(e){if(!(e in this.cache))return;const t=this.cache[e];if(r(t))return t;const n=new(t.default||t);return this.cache[e]=n,n}register(...e){e.forEach((e=>{if(r(e)){if(e.validationKey in this.cache)return;this.cache[e.validationKey]=e}else{const{validationKey:t,validator:r,save:n}=e;if(t in this.cache)return;if(this.cache[t]=r,!n)return;const o={};o[t.toUpperCase()]=t,this.customKeyCache=Object.assign({},this.customKeyCache,o)}}))}}},5021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_PATTERNS=t.DEFAULT_ERROR_MESSAGES=t.DAYS_OF_WEEK_NAMES=t.MONTH_NAMES=t.ValidationKeys=void 0,t.ValidationKeys={REFLECT:"model.validation.",VALIDATOR:"validator",REQUIRED:"required",MIN:"min",MAX:"max",STEP:"step",MIN_LENGTH:"minlength",MAX_LENGTH:"maxlength",PATTERN:"pattern",EMAIL:"email",URL:"url",DATE:"date",TYPE:"type",PASSWORD:"password",LIST:"list"},t.MONTH_NAMES=["January","February","March","April","May","June","July","August","September","October","November","December"],t.DAYS_OF_WEEK_NAMES=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],t.DEFAULT_ERROR_MESSAGES={REQUIRED:"This field is required",MIN:"The minimum value is {0}",MAX:"The maximum value is {0}",MIN_LENGTH:"The minimum length is {0}",MAX_LENGTH:"The maximum length is {0}",PATTERN:"The value does not match the pattern",EMAIL:"The value is not a valid email",URL:"The value is not a valid URL",TYPE:"Invalid type. Expected {0}, received {1}",STEP:"Invalid value. Not a step of {0}",DATE:"Invalid value. not a valid Date",DEFAULT:"There is an Error",PASSWORD:"Must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",LIST:"Invalid list of {0}",LIST_INSIDE:"Elements of list are invalid: {0}",MODEL_NOT_FOUND:"No model registered under {0}"},t.DEFAULT_PATTERNS={EMAIL:/[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?/,URL:/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i,PASSWORD:{CHAR8_ONE_OF_EACH:/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&_\-.,])[A-Za-z\d@$!%*?&_\-.,]{8,}$/g}}},8024:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validator=function(...e){return(0,i.apply)((t=>(e.forEach((e=>{n.Validation.register({validator:t,validationKey:e,save:!0})})),t)),(0,i.metadata)((0,a.getValidationKey)(o.ValidationKeys.VALIDATOR),e))};const n=r(1375),o=r(5021),a=r(2537),i=r(32)},70:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.Validators=void 0;const a=r(3576),i=r(4972),s=r(3317),c=r(6942),u=r(8689),l=r(6174),d=r(9320),f=r(2396),p=r(9378),y=r(2382),h=r(8089),g=r(5224),v=r(2888);o(r(5021),t),o(r(3576),t),o(r(8024),t),o(r(5224),t),o(r(2888),t),o(r(2382),t),o(r(9378),t),o(r(2396),t),o(r(9320),t),o(r(3317),t),o(r(6174),t),o(r(8089),t),o(r(6942),t),o(r(7045),t),o(r(4972),t),o(r(8689),t),o(r(7036),t),o(r(3201),t),t.Validators={DateValidator:a.DateValidator,EmailValidator:g.EmailValidator,ListValidator:v.ListValidator,MaxLengthValidator:y.MaxLengthValidator,MaxValidator:p.MaxValidator,MinLengthValidator:f.MinLengthValidator,MinValidator:d.MinValidator,PasswordValidator:s.PasswordValidator,PatternValidator:l.PatternValidator,RequiredValidator:h.RequiredValidator,StepValidator:c.StepValidator,TypeValidator:i.TypeValidator,URLValidator:u.URLValidator}},7045:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.required=function(e=n.DEFAULT_ERROR_MESSAGES.REQUIRED){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.REQUIRED),{message:e})},t.min=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN),{value:e,message:t,types:[Number.name,Date.name]})},t.max=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX),{value:e,message:t,types:[Number.name,Date.name]})},t.step=function(e,t=n.DEFAULT_ERROR_MESSAGES.STEP){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.STEP),{value:e,message:t,types:[Number.name]})},t.minlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MIN_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MIN_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.maxlength=function(e,t=n.DEFAULT_ERROR_MESSAGES.MAX_LENGTH){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.MAX_LENGTH),{value:e,message:t,types:[String.name,Array.name,Set.name]})},t.pattern=function(e,t=n.DEFAULT_ERROR_MESSAGES.PATTERN){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PATTERN),{value:"string"==typeof e?e:e.toString(),message:t,types:[String.name]})},t.email=function(e=n.DEFAULT_ERROR_MESSAGES.EMAIL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.EMAIL),{pattern:n.DEFAULT_PATTERNS.EMAIL,message:e,types:[String.name]})},t.url=function(e=n.DEFAULT_ERROR_MESSAGES.URL){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.URL),{pattern:n.DEFAULT_PATTERNS.URL,message:e,types:[String.name]})},t.type=function(e,t=n.DEFAULT_ERROR_MESSAGES.TYPE){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.TYPE),{customTypes:e,message:t})},t.date=function(e="dd/MM/yyyy",t=n.DEFAULT_ERROR_MESSAGES.DATE){return(r,c)=>{(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.DATE),{format:e,message:t,types:[Date.name]})(r,c);const u=new WeakMap;Object.defineProperty(r,c,{configurable:!1,set(t){const r=Object.getOwnPropertyDescriptor(this,c);r&&!r.configurable||Object.defineProperty(this,c,{enumerable:!0,configurable:!1,get:()=>u.get(this),set:t=>{let r;try{r=(0,s.parseDate)(e,t),u.set(this,r)}catch(e){console.error((0,o.sf)("Failed to parse date: {0}",e.message||e))}}}),this[c]=t},get(){console.log("here")}})}},t.password=function(e=n.DEFAULT_PATTERNS.PASSWORD.CHAR8_ONE_OF_EACH,t=n.DEFAULT_ERROR_MESSAGES.PASSWORD){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.PASSWORD),{pattern:e,message:t,types:[String.name]})},t.list=c,t.set=function(e,t=n.DEFAULT_ERROR_MESSAGES.LIST){return c(e,"Set",t)},r(8630);const n=r(5021),o=r(1318),a=r(2537),i=r(32),s=r(5243);function c(e,t="Array",r=n.DEFAULT_ERROR_MESSAGES.LIST){return(0,i.metadata)((0,a.getValidationKey)(n.ValidationKeys.LIST),{class:Array.isArray(e)?e.map((e=>e.name)):[e.name],type:t,message:r})}},5030:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),o(r(70),t),o(r(9944),t),o(r(4213),t),o(r(2537),t),o(r(1375),t)},4213:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2537:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValidationKey=function(e){return n.ValidationKeys.REFLECT+e};const n=r(5021)},871:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Injectables=void 0;let n=r(3018);class o{static{this.actingInjectablesRegistry=void 0}constructor(){}static get(e,...t){return o.getRegistry().get(e,...t)}static register(e,...t){return o.getRegistry().register(e,...t)}static build(e,...t){return o.getRegistry().build(e,...t)}static setRegistry(e){o.actingInjectablesRegistry=e}static getRegistry(){return o.actingInjectablesRegistry||(o.actingInjectablesRegistry=new n.InjectableRegistryImp),o.actingInjectablesRegistry}static reset(){this.setRegistry(new n.InjectableRegistryImp)}static selectiveReset(e){let t="string"==typeof e?new RegExp(e):e;o.actingInjectablesRegistry.cache=Object.entries(o.actingInjectablesRegistry.cache).reduce(((e,[r,n])=>(r.match(t)||(e[r]=n),e)),{})}}t.Injectables=o},6030:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InjectablesKeys=void 0,t.InjectablesKeys={REFLECT:"inject.db.",INJECTABLE:"injectable",INJECT:"inject"}},8957:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.inject=t.injectable=void 0;let n=r(6030),o=r(871),a=r(8730),i=e=>n.InjectablesKeys.REFLECT+e,s=(t.injectable=(e=void 0,t=!1,r)=>a=>{let s=e||a.name;function c(...e){let c=o.Injectables.get(s,...e);if(!c){if(o.Injectables.register(a,s,!0,t),!(c=o.Injectables.get(s,...e)))return;if(r)try{r(c)}catch(e){console.error(`Failed to call injectable callback for ${s}: `+e)}}return e=Object.assign({},{class:s}),Reflect.defineMetadata(i(n.InjectablesKeys.INJECTABLE),e,c.constructor),c}return c.prototype=a.prototype,Object.defineProperty(c,"name",{writable:!1,enumerable:!0,configurable:!1,value:a.prototype.constructor.name}),c},(e,t)=>(r,s)=>{let c=new WeakMap,u=e||(0,a.getTypeFromDecorator)(r,s);if(!u)throw new Error("Could not get Type from decorator");Reflect.defineMetadata(i(n.InjectablesKeys.INJECT),{injectable:u},r,s),Object.defineProperty(r,s,{configurable:!0,get(){if(Object.getOwnPropertyDescriptor(r,s).configurable)return Object.defineProperty(this,s,{enumerable:!0,configurable:!1,get(){let e=c.get(this);if(!e){if(!(e=o.Injectables.get(u)))throw new Error(`Could not get Injectable ${u} to inject in ${(r.constructor||r).name}'s `+s);if(t)try{e=t(e,r)}catch(e){console.error(e)}c.set(this,e)}return e}}),this[s]}})});t.inject=s},465:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&("get"in o?t.__esModule:!o.writable&&!o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){e[n=void 0===n?r:n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(6030),t),o(r(8957),t),o(r(871),t),o(r(3018),t),o(r(8730),t),t.VERSION="1.4.3"},3018:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.InjectableRegistryImp=void 0,t.InjectableRegistryImp=class{constructor(){this.cache={}}get(e,...t){try{var r=this.cache[e],n={name:e};return(r.singleton||r.instance)&&r.instance||this.build(n,...t)}catch(e){}}register(e,t=void 0,r=!0,n=!1){var o=e,a=!o.name&&o.constructor;if("function"!=typeof o&&!a)throw new Error("Injectable registering failed. Missing Class name or constructor");t=t||(a&&a.name&&"Function"!==a.name?a:o).name,this.cache[t]&&!n||(this.cache[t]={instance:a?e:void 0,constructor:a?void 0:e,singleton:r})}build(e,...t){var{constructor:r,singleton:n}=this.cache[e.name];return t=new r(...t),this.cache[e.name]={instance:t,constructor:r,singleton:n},t}}},8730:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeKey=void 0,t.getTypeFromDecorator=function(e,r){return"Function"!==(e=Reflect.getMetadata(t.TypeKey,e,r)).name?e.name:void 0},r(8630),t.TypeKey="design:type"},1267:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ReflectionKeys=void 0,function(e){e.TYPE="design:type"}(r||(t.ReflectionKeys=r={}))},5530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.metadata=function(e,t){return(r,n,o)=>{o?Reflect.defineMetadata(e,t,o.value):n?Reflect.defineMetadata(e,t,r,n):Reflect.defineMetadata(e,t,r)}},t.apply=function(...e){return(t,r,n)=>{for(const o of e)t instanceof Function&&!n?o(t):o(t,r,n)}},r(8630)},3032:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isEqual=function e(t,r,...n){if(t===r)return!0;if(t instanceof Date&&r instanceof Date)return t.getTime()===r.getTime();if(!t||!r||"object"!=typeof t&&"object"!=typeof r)return t===r;if(null==t||null==r)return!1;if(typeof t!=typeof r)return!1;if(t.prototype!==r.prototype)return!1;const o=Object.keys(t).filter((e=>-1===n.indexOf(e)));return o.length===Object.keys(r).filter((e=>-1===n.indexOf(e))).length&&o.every((o=>-1!==n.indexOf(o)||e(t[o],r[o],...n)))}},32:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.VERSION=void 0,o(r(1267),t),o(r(5530),t),o(r(3032),t),o(r(2199),t),o(r(3115),t),t.VERSION="0.2.3"},2199:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3115:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPropertyDecorators=a,t.getTypeFromDecorator=function(e,t){const r=a(n.ReflectionKeys.TYPE,e,t,!1);if(!r||!r.decorators)return;const o=r.decorators.shift(),i=o.props?o.props.name:void 0;return"Function"!==i?i:void 0},t.getAllPropertyDecorators=function(e,...t){if(t&&t.length)return Object.getOwnPropertyNames(e).reduce(((r,n)=>(t.forEach(((t,o)=>{const i=a(t,e,n,0!==o);r||(r={}),function(e,t,r){r&&r.length&&(e[t]||(e[t]=[]),e[t].push(...r))}(r,n,i.decorators)})),r)),void 0)},t.getAllProperties=function(e,t=!0,r="Object"){const n=[];let o=e;const a=function(){if(!t)return;const e=Object.getPrototypeOf(o);return e&&e.constructor.name!==r?(o=e,o):void 0};do{Object.getOwnPropertyNames(o).forEach((function(e){-1===n.indexOf(e)&&n.push(e)}))}while(a());return n},t.getClassDecorators=function(e,t){return Reflect.getOwnMetadataKeys(t.constructor).filter((t=>t.toString().startsWith(e))).reduce(((r,n)=>{const o={key:n.substring(e.length),props:Reflect.getMetadata(n,t.constructor)};return r.concat(o)}),[])},t.checkType=i,t.checkTypes=s,t.evaluateDesignTypes=function(e,t){switch(typeof t){case"string":return i(e,t);case"object":return!Array.isArray(t)||s(e,t);case"function":return!t.name||"Object"===t.name||i(e,t.name);default:return!0}},r(8630);const n=r(1267),o=r(3032);function a(e,t,r,i=!1,s=!0,c){const u=function(e,t,r,o=!1,a){const i=Reflect.getMetadataKeys(t,r).filter((t=>o?t.toString().startsWith(e):t===n.ReflectionKeys.TYPE||t.toString().startsWith(e))).reduce(((o,a)=>{const i={key:a!==n.ReflectionKeys.TYPE?a.substring(e.length):a,props:Reflect.getMetadata(a,t,r)};return o.concat(i)}),a||[]);return{prop:r.toString(),decorators:i}}(e,t,r,i,c);return s&&Object.getPrototypeOf(t)!==Object.prototype?a(e,Object.getPrototypeOf(t.constructor),r,!0,s,u.decorators):{prop:u.prop,decorators:function(e){const r={};return e.filter((e=>e.key in r?((0,o.isEqual)(e.props,r[e.key])||console.log(`Found a similar decorator for the ${e.key} property of a ${t.constructor.name} model but with different attributes. The original one will be kept`),!1):(r[e.key.toString()]=e.props,!0)))}(u.decorators)}}function i(e,t){return typeof e===t||e.constructor&&e.constructor.name.toLowerCase()===t.toLowerCase()}function s(e,t){return!t.every((t=>!i(e,t)))}},8630:(e,t,r)=>{var n;!function(e){!function(){var t="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),n=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==t.Reflect&&(n=o(t.Reflect,n)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",a=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!i&&!s,u={create:i?function(){return k(Object.create(null))}:s?function(){return k({__proto__:null})}:function(){return k({})},has:c?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},l=Object.getPrototypeOf(Function),d="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[a]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,L(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,o)},t.prototype.entries=function(){return new r(this._keys,this._values,i)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[a]=function(){return this.entries()},t.prototype._find=function(e,t){if(!L(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(L(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function o(e,t){return t}function i(e,t){return[e,t]}}(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new d}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[a]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=u.create(),t=n();return function(){function e(){this._key=n()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&u.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?u.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=n()},e}();function n(){var t;do{t="@@WeakMap@@"+i()}while(u.has(e,t));return e[t]=!0,t}function o(e,n){if(!r.call(e,t)){if(!n)return;Object.defineProperty(e,t,{value:u.create()})}return e[t]}function a(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function i(){var e=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):a(t,e),t}return a(new Array(e),e)}(16);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var t="",r=0;r<16;++r){var n=e[r];4!==r&&6!==r&&8!==r||(t+="-"),n<16&&(t+="0"),t+=n.toString(16).toLowerCase()}return t}}(),y=n?Symbol.for("@reflect-metadata:registry"):void 0,h=function(){var e;return!w(y)&&P(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[y]),w(e)&&(e=function(){var e,r,n,o;w(y)||void 0===t.Reflect||y in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,o=e.getOwnMetadataKeys,a=e.deleteMetadata,i=new p;return{isProviderFor:function(e,t){var r=i.get(e);return!(w(r)||!r.has(t))||!!o(e,t).length&&(w(r)&&(r=new f,i.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:a}}(t.Reflect));var a=new p,i={registerProvider:s,getProvider:u,setProvider:h};return i;function s(t){if(!Object.isExtensible(i))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case w(r):r=t;break;case r===t:break;case w(n):n=t;break;case n===t:break;default:void 0===o&&(o=new f),o.add(t)}}function c(t,a){if(!w(r)){if(r.isProviderFor(t,a))return r;if(!w(n)){if(n.isProviderFor(t,a))return r;if(!w(o))for(var i=N(o);;){var s=C(i);if(!s)return;var c=x(s);if(c.isProviderFor(t,a))return F(i),c}}}if(!w(e)&&e.isProviderFor(t,a))return e}function u(e,t){var r,n=a.get(e);return w(n)||(r=n.get(t)),w(r)?(w(r=c(e,t))||(w(n)&&(n=new d,a.set(e,n)),n.set(t,r)),r):r}function l(e){if(w(e))throw new TypeError;return r===e||n===e||!w(o)&&o.has(e)}function h(e,t,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(e,t);if(n!==r){if(!w(n))return!1;var o=a.get(e);w(o)&&(o=new d,a.set(e,o)),o.set(t,r)}return!0}}()),!w(y)&&P(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,y,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),g=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!w(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,o){n(r,o,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var o=n(t,r,!1);return!w(o)&&D(o.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var o=n(t,r,!1);if(!w(o))return o.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],o=n(e,t,!1);if(w(o))return r;for(var a=N(o.keys()),i=0;;){var s=C(a);if(!s)return r.length=i,r;var c=x(s);try{r[i]=c}catch(e){try{F(a)}finally{throw e}}i++}},OrdinaryDeleteMetadata:function(e,r,o){var a=n(r,o,!1);if(w(a))return!1;if(!a.delete(e))return!1;if(0===a.size){var i=t.get(r);w(i)||(i.delete(o),0===i.size&&t.delete(i))}return!0}};return h.registerProvider(r),r;function n(n,o,a){var i=t.get(n),s=!1;if(w(i)){if(!a)return;i=new d,t.set(n,i),s=!0}var c=i.get(o);if(w(c)){if(!a)return;if(c=new d,i.set(o,c),!e.setProvider(n,o,r))throw i.delete(o),s&&t.delete(n),new Error("Wrong provider for target.")}return c}}(h);function v(e,t,r){if(O(e,t,r))return!0;var n=U(t);return!j(n)&&v(e,n,r)}function O(e,t,r){var n=B(t,r,!1);return!w(n)&&D(n.OrdinaryHasOwnMetadata(e,t,r))}function E(e,t,r){if(O(e,t,r))return b(e,t,r);var n=U(t);return j(n)?void 0:E(e,n,r)}function b(e,t,r){var n=B(t,r,!1);if(!w(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function _(e,t,r,n){B(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function m(e,t){var r=M(e,t),n=U(e);if(null===n)return r;var o=m(n,t);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new f,i=[],s=0,c=r;s<c.length;s++){var u=c[s];a.has(u)||(a.add(u),i.push(u))}for(var l=0,d=o;l<d.length;l++)u=d[l],a.has(u)||(a.add(u),i.push(u));return i}function M(e,t){var r=B(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function R(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function w(e){return void 0===e}function j(e){return null===e}function P(e){return"object"==typeof e?null!==e:"function"==typeof e}function S(e,t){switch(R(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=V(e,o);if(void 0!==n){var a=n.call(e,r);if(P(a))throw new TypeError;return a}return function(e,t){if("string"===t){var r=e.toString;if(K(r)&&!P(o=r.call(e)))return o;if(K(n=e.valueOf)&&!P(o=n.call(e)))return o}else{var n;if(K(n=e.valueOf)&&!P(o=n.call(e)))return o;var o,a=e.toString;if(K(a)&&!P(o=a.call(e)))return o}throw new TypeError}(e,"default"===r?"number":r)}function D(e){return!!e}function A(e){var t=S(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function T(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function K(e){return"function"==typeof e}function I(e){return"function"==typeof e}function L(e,t){return e===t||e!=e&&t!=t}function V(e,t){var r=e[t];if(null!=r){if(!K(r))throw new TypeError;return r}}function N(e){var t=V(e,a);if(!K(t))throw new TypeError;var r=t.call(e);if(!P(r))throw new TypeError;return r}function x(e){return e.value}function C(e){var t=e.next();return!t.done&&t}function F(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===l)return t;if(t!==l)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var o=n.constructor;return"function"!=typeof o||o===e?t:o}function B(e,t,r){var n=h.getProvider(e,t);if(!w(n))return n;if(r){if(h.setProvider(e,t,g))return g;throw new Error("Illegal state.")}}function k(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(w(r)){if(!T(e))throw new TypeError;if(!I(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!w(n)&&!j(n)){if(!I(n))throw new TypeError;t=n}}return t}(e,t)}if(!T(e))throw new TypeError;if(!P(t))throw new TypeError;if(!P(n)&&!w(n)&&!j(n))throw new TypeError;return j(n)&&(n=void 0),function(e,t,r,n){for(var o=e.length-1;o>=0;--o){var a=(0,e[o])(t,r,n);if(!w(a)&&!j(a)){if(!P(a))throw new TypeError;n=a}}return n}(e,t,r=A(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!P(r))throw new TypeError;if(!w(n)&&!function(e){switch(R(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;_(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!P(r))throw new TypeError;return w(n)||(n=A(n)),_(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!P(t))throw new TypeError;return w(r)||(r=A(r)),v(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!P(t))throw new TypeError;return w(r)||(r=A(r)),O(e,t,r)})),e("getMetadata",(function(e,t,r){if(!P(t))throw new TypeError;return w(r)||(r=A(r)),E(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!P(t))throw new TypeError;return w(r)||(r=A(r)),b(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!P(e))throw new TypeError;return w(t)||(t=A(t)),m(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!P(e))throw new TypeError;return w(t)||(t=A(t)),M(e,t)})),e("deleteMetadata",(function(e,t,r){if(!P(t))throw new TypeError;if(w(r)||(r=A(r)),!P(t))throw new TypeError;w(r)||(r=A(r));var n=B(t,r,!1);return!w(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(n,t),void 0===t.Reflect&&(t.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(7729)})()));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! *****************************************************************************
|
|
2
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
+
|
|
12
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
+
and limitations under the License.
|
|
14
|
+
***************************************************************************** */
|