@futdevpro/fsm-dynamo 1.5.38 → 1.5.43
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/README.md +1 -1
- package/package.json +2 -2
- package/src/_collections/_constants/country-codes-ISO-3166.json +3239 -0
- package/src/_collections/_constants/country-phone-codes.json +1203 -0
- package/src/_collections/_constants/country-sub-divisions-ISO-3166.json +4994 -0
- package/src/_collections/_constants/country-subdivisions/afghanistan.json +138 -0
- package/src/_collections/_constants/country-subdivisions/albania.json +50 -0
- package/src/_collections/_constants/country-subdivisions/algeria.json +194 -0
- package/src/_collections/_constants/country-subdivisions/andorra.json +30 -0
- package/src/_collections/_constants/country-subdivisions/angola.json +74 -0
- package/src/_collections/_constants/country-subdivisions/antigua-and-barbuda.json +34 -0
- package/src/_collections/_constants/country-subdivisions/argentina.json +98 -0
- package/src/_collections/_constants/country-subdivisions/armenia.json +46 -0
- package/src/_collections/_constants/country-subdivisions/australia.json +34 -0
- package/src/_collections/_constants/country-subdivisions/austria.json +38 -0
- package/src/_collections/_constants/country-subdivisions/azerbaijan.json +6 -0
- package/src/_collections/_constants/country-subdivisions/bahamas.json +126 -0
- package/src/_collections/_constants/country-subdivisions/bahrain.json +22 -0
- package/src/_collections/_constants/country-subdivisions/bangladesh.json +30 -0
- package/src/_collections/_constants/country-subdivisions/barbados.json +46 -0
- package/src/_collections/_constants/country-subdivisions/belarus.json +30 -0
- package/src/_collections/_constants/country-subdivisions/belgium.json +14 -0
- package/src/_collections/_constants/country-subdivisions/belize.json +26 -0
- package/src/_collections/_constants/country-subdivisions/benin.json +50 -0
- package/src/_collections/_constants/country-subdivisions/bhutan.json +82 -0
- package/src/_collections/_constants/country-subdivisions/bolivia.json +38 -0
- package/src/_collections/_constants/country-subdivisions/bosnia-and-herzegovina.json +14 -0
- package/src/_collections/_constants/country-subdivisions/botswana.json +66 -0
- package/src/_collections/_constants/country-subdivisions/brazil.json +110 -0
- package/src/_collections/_constants/country-subdivisions/brunei-darussalam.json +18 -0
- package/src/_collections/_constants/country-subdivisions/bulgaria.json +114 -0
- package/src/_collections/_constants/country-subdivisions/burkina-faso.json +54 -0
- package/src/_collections/_constants/country-subdivisions/burundi.json +70 -0
- package/src/_collections/_constants/country-subdivisions/cambodia.json +98 -0
- package/src/_collections/_constants/country-subdivisions/cameroon.json +42 -0
- package/src/_collections/_constants/country-subdivisions/canada.json +80 -0
- package/src/_collections/_constants/country-subdivisions/cape-verde.json +10 -0
- package/src/_collections/_constants/country-subdivisions/central-african-republic.json +70 -0
- package/src/_collections/_constants/country-subdivisions/chad.json +90 -0
- package/src/_collections/_constants/country-subdivisions/chile.json +62 -0
- package/src/_collections/_constants/country-subdivisions/china.json +206 -0
- package/src/_collections/_constants/country-subdivisions/colombia.json +134 -0
- package/src/_collections/_constants/country-subdivisions/comoros.json +14 -0
- package/src/_collections/_constants/country-subdivisions/congo-the-democratic-republic-of-the.json +46 -0
- package/src/_collections/_constants/country-subdivisions/congo.json +50 -0
- package/src/_collections/_constants/country-subdivisions/costa-rica.json +30 -0
- package/src/_collections/_constants/country-subdivisions/cote-d-ivoire-republic-of.json +78 -0
- package/src/_collections/_constants/country-subdivisions/croatia.json +86 -0
- package/src/_collections/_constants/country-subdivisions/cuba.json +66 -0
- package/src/_collections/_constants/country-subdivisions/cyprus.json +26 -0
- package/src/_collections/_constants/country-subdivisions/czech-republic.json +58 -0
- package/src/_collections/_constants/country-subdivisions/denmark.json +22 -0
- package/src/_collections/_constants/country-subdivisions/djibouti.json +26 -0
- package/src/_collections/_constants/country-subdivisions/dominica.json +42 -0
- package/src/_collections/_constants/country-subdivisions/dominican-republic.json +42 -0
- package/src/_collections/_constants/country-subdivisions/ecuador.json +98 -0
- package/src/_collections/_constants/country-subdivisions/egypt.json +118 -0
- package/src/_collections/_constants/country-subdivisions/el-salvador.json +58 -0
- package/src/_collections/_constants/country-subdivisions/equatorial-guinea.json +10 -0
- package/src/_collections/_constants/country-subdivisions/eritrea.json +26 -0
- package/src/_collections/_constants/country-subdivisions/estonia.json +62 -0
- package/src/_collections/_constants/country-subdivisions/ethiopia.json +46 -0
- package/src/_collections/_constants/country-subdivisions/fiji.json +22 -0
- package/src/_collections/_constants/country-subdivisions/finland.json +78 -0
- package/src/_collections/_constants/country-subdivisions/france.json +134 -0
- package/src/_collections/_constants/country-subdivisions/gabon.json +38 -0
- package/src/_collections/_constants/country-subdivisions/gambia.json +26 -0
- package/src/_collections/_constants/country-subdivisions/georgia.json +50 -0
- package/src/_collections/_constants/country-subdivisions/germany.json +66 -0
- package/src/_collections/_constants/country-subdivisions/ghana.json +42 -0
- package/src/_collections/_constants/country-subdivisions/greece.json +54 -0
- package/src/_collections/_constants/country-subdivisions/greenland.json +18 -0
- package/src/_collections/_constants/country-subdivisions/grenada.json +30 -0
- package/src/_collections/_constants/country-subdivisions/guatemala.json +90 -0
- package/src/_collections/_constants/country-subdivisions/guinea-bissau.json +14 -0
- package/src/_collections/_constants/country-subdivisions/guinea.json +34 -0
- package/src/_collections/_constants/country-subdivisions/guyana.json +42 -0
- package/src/_collections/_constants/country-subdivisions/haiti.json +42 -0
- package/src/_collections/_constants/country-subdivisions/honduras.json +74 -0
- package/src/_collections/_constants/country-subdivisions/hong-kong.json +5 -0
- package/src/_collections/_constants/country-subdivisions/hungary.json +174 -0
- package/src/_collections/_constants/country-subdivisions/iceland.json +38 -0
- package/src/_collections/_constants/country-subdivisions/india.json +182 -0
- package/src/_collections/_constants/country-subdivisions/indonesia.json +30 -0
- package/src/_collections/_constants/country-subdivisions/iran-islamic-republic-of.json +126 -0
- package/src/_collections/_constants/country-subdivisions/iraq.json +74 -0
- package/src/_collections/_constants/country-subdivisions/ireland.json +18 -0
- package/src/_collections/_constants/country-subdivisions/israel.json +26 -0
- package/src/_collections/_constants/country-subdivisions/italy.json +82 -0
- package/src/_collections/_constants/country-subdivisions/jamaica.json +58 -0
- package/src/_collections/_constants/country-subdivisions/japan.json +190 -0
- package/src/_collections/_constants/country-subdivisions/jordan.json +50 -0
- package/src/_collections/_constants/country-subdivisions/kazakhstan.json +66 -0
- package/src/_collections/_constants/country-subdivisions/kenya.json +34 -0
- package/src/_collections/_constants/country-subdivisions/kiribati.json +14 -0
- package/src/_collections/_constants/country-subdivisions/korea-democratic-people-s-republic-of.json +46 -0
- package/src/_collections/_constants/country-subdivisions/korea-republic-of.json +70 -0
- package/src/_collections/_constants/country-subdivisions/kuwait.json +26 -0
- package/src/_collections/_constants/country-subdivisions/kyrgyzstan.json +34 -0
- package/src/_collections/_constants/country-subdivisions/lao-people-s-democratic-republic.json +74 -0
- package/src/_collections/_constants/country-subdivisions/latvia.json +478 -0
- package/src/_collections/_constants/country-subdivisions/lebanon.json +34 -0
- package/src/_collections/_constants/country-subdivisions/lesotho.json +42 -0
- package/src/_collections/_constants/country-subdivisions/liechtenstein.json +46 -0
- package/src/_collections/_constants/country-subdivisions/lithuania.json +42 -0
- package/src/_collections/_constants/country-subdivisions/luxembourg.json +14 -0
- package/src/_collections/_constants/country-subdivisions/macedonia-the-former-yugoslav-republic-of.json +338 -0
- package/src/_collections/_constants/country-subdivisions/madagascar.json +26 -0
- package/src/_collections/_constants/country-subdivisions/malawi.json +14 -0
- package/src/_collections/_constants/country-subdivisions/malaysia.json +82 -0
- package/src/_collections/_constants/country-subdivisions/maldives.json +34 -0
- package/src/_collections/_constants/country-subdivisions/mali.json +38 -0
- package/src/_collections/_constants/country-subdivisions/malta.json +274 -0
- package/src/_collections/_constants/country-subdivisions/marshall-islands.json +10 -0
- package/src/_collections/_constants/country-subdivisions/mauritania.json +54 -0
- package/src/_collections/_constants/country-subdivisions/mauritius.json +70 -0
- package/src/_collections/_constants/country-subdivisions/mexico.json +162 -0
- package/src/_collections/_constants/country-subdivisions/micronesia-federated-states-of.json +18 -0
- package/src/_collections/_constants/country-subdivisions/moldova-republic-of.json +150 -0
- package/src/_collections/_constants/country-subdivisions/monaco.json +70 -0
- package/src/_collections/_constants/country-subdivisions/mongolia.json +90 -0
- package/src/_collections/_constants/country-subdivisions/montenegro.json +94 -0
- package/src/_collections/_constants/country-subdivisions/morocco.json +66 -0
- package/src/_collections/_constants/country-subdivisions/mozambique.json +46 -0
- package/src/_collections/_constants/country-subdivisions/myanmar.json +58 -0
- package/src/_collections/_constants/country-subdivisions/namibia.json +58 -0
- package/src/_collections/_constants/country-subdivisions/nauru.json +58 -0
- package/src/_collections/_constants/country-subdivisions/nepal.json +22 -0
- package/src/_collections/_constants/country-subdivisions/netherlands.json +92 -0
- package/src/_collections/_constants/country-subdivisions/new-zealand.json +112 -0
- package/src/_collections/_constants/country-subdivisions/nicaragua.json +70 -0
- package/src/_collections/_constants/country-subdivisions/niger.json +34 -0
- package/src/_collections/_constants/country-subdivisions/nigeria.json +150 -0
- package/src/_collections/_constants/country-subdivisions/norway.json +86 -0
- package/src/_collections/_constants/country-subdivisions/oman.json +38 -0
- package/src/_collections/_constants/country-subdivisions/pakistan.json +34 -0
- package/src/_collections/_constants/country-subdivisions/palau.json +66 -0
- package/src/_collections/_constants/country-subdivisions/palestinian-territory-occupied.json +66 -0
- package/src/_collections/_constants/country-subdivisions/panama.json +54 -0
- package/src/_collections/_constants/country-subdivisions/papua-new-guinea.json +82 -0
- package/src/_collections/_constants/country-subdivisions/paraguay.json +74 -0
- package/src/_collections/_constants/country-subdivisions/peru.json +106 -0
- package/src/_collections/_constants/country-subdivisions/philippines.json +70 -0
- package/src/_collections/_constants/country-subdivisions/poland.json +66 -0
- package/src/_collections/_constants/country-subdivisions/portugal.json +82 -0
- package/src/_collections/_constants/country-subdivisions/qatar.json +30 -0
- package/src/_collections/_constants/country-subdivisions/romania.json +170 -0
- package/src/_collections/_constants/country-subdivisions/russian-federation.json +500 -0
- package/src/_collections/_constants/country-subdivisions/rwanda.json +22 -0
- package/src/_collections/_constants/country-subdivisions/saint-helena-ascension-and-tristan-da-cunha.json +14 -0
- package/src/_collections/_constants/country-subdivisions/saint-kitts-and-nevis.json +10 -0
- package/src/_collections/_constants/country-subdivisions/saint-lucia.json +46 -0
- package/src/_collections/_constants/country-subdivisions/saint-vincent-and-the-grenadines.json +26 -0
- package/src/_collections/_constants/country-subdivisions/samoa.json +46 -0
- package/src/_collections/_constants/country-subdivisions/san-marino.json +38 -0
- package/src/_collections/_constants/country-subdivisions/sao-tome-and-principe.json +10 -0
- package/src/_collections/_constants/country-subdivisions/saudi-arabia.json +54 -0
- package/src/_collections/_constants/country-subdivisions/senegal.json +58 -0
- package/src/_collections/_constants/country-subdivisions/serbia.json +10 -0
- package/src/_collections/_constants/country-subdivisions/seychelles.json +102 -0
- package/src/_collections/_constants/country-subdivisions/sierra-leone.json +18 -0
- package/src/_collections/_constants/country-subdivisions/singapore.json +22 -0
- package/src/_collections/_constants/country-subdivisions/slovakia.json +34 -0
- package/src/_collections/_constants/country-subdivisions/slovenia.json +842 -0
- package/src/_collections/_constants/country-subdivisions/solomon-islands.json +42 -0
- package/src/_collections/_constants/country-subdivisions/somalia.json +74 -0
- package/src/_collections/_constants/country-subdivisions/south-africa.json +38 -0
- package/src/_collections/_constants/country-subdivisions/south-sudan.json +42 -0
- package/src/_collections/_constants/country-subdivisions/spain.json +347 -0
- package/src/_collections/_constants/country-subdivisions/sri-lanka.json +38 -0
- package/src/_collections/_constants/country-subdivisions/sudan.json +70 -0
- package/src/_collections/_constants/country-subdivisions/suriname.json +42 -0
- package/src/_collections/_constants/country-subdivisions/swaziland.json +18 -0
- package/src/_collections/_constants/country-subdivisions/sweden.json +86 -0
- package/src/_collections/_constants/country-subdivisions/switzerland.json +106 -0
- package/src/_collections/_constants/country-subdivisions/syrian-arab-republic.json +58 -0
- package/src/_collections/_constants/country-subdivisions/taiwan-province-of-china.json +94 -0
- package/src/_collections/_constants/country-subdivisions/tajikistan.json +18 -0
- package/src/_collections/_constants/country-subdivisions/tanzania-united-republic-of.json +106 -0
- package/src/_collections/_constants/country-subdivisions/thailand.json +314 -0
- package/src/_collections/_constants/country-subdivisions/timor-leste.json +54 -0
- package/src/_collections/_constants/country-subdivisions/togo.json +22 -0
- package/src/_collections/_constants/country-subdivisions/tonga.json +22 -0
- package/src/_collections/_constants/country-subdivisions/trinidad-and-tobago.json +66 -0
- package/src/_collections/_constants/country-subdivisions/tunisia.json +98 -0
- package/src/_collections/_constants/country-subdivisions/turkey.json +326 -0
- package/src/_collections/_constants/country-subdivisions/turkmenistan.json +26 -0
- package/src/_collections/_constants/country-subdivisions/tuvalu.json +34 -0
- package/src/_collections/_constants/country-subdivisions/uganda.json +18 -0
- package/src/_collections/_constants/country-subdivisions/ukraine.json +110 -0
- package/src/_collections/_constants/country-subdivisions/united-arab-emirates.json +30 -0
- package/src/_collections/_constants/country-subdivisions/united-kingdom.json +1197 -0
- package/src/_collections/_constants/country-subdivisions/united-states-minor-outlying-islands.json +38 -0
- package/src/_collections/_constants/country-subdivisions/united-states.json +287 -0
- package/src/_collections/_constants/country-subdivisions/uruguay.json +78 -0
- package/src/_collections/_constants/country-subdivisions/uzbekistan.json +58 -0
- package/src/_collections/_constants/country-subdivisions/vanuatu.json +26 -0
- package/src/_collections/_constants/country-subdivisions/venezuela.json +102 -0
- package/src/_collections/_constants/country-subdivisions/viet-nam.json +258 -0
- package/src/_collections/_constants/country-subdivisions/yemen.json +86 -0
- package/src/_collections/_constants/country-subdivisions/zambia.json +38 -0
- package/src/_collections/_constants/country-subdivisions/zimbabwe.json +42 -0
- package/src/_collections/_tools/dynamo-location.ts +46 -0
- package/src/_collections/_tools/dynamo-log.ts +60 -0
- package/src/_collections/_tools/dynamo-random.ts +64 -0
- package/src/_collections/_tools/dynamo-regions.ts +60 -0
- package/src/_collections/_tools/dynamo-round-list.ts +42 -0
- package/src/_collections/_tools/dynamo-shared.service.ts +151 -0
- package/src/_collections/_tools/dynamo-time.ts +47 -0
- package/src/_collections/_tools/dynamo-trigonometry.ts +63 -0
- package/src/_collections/_tools/utilities.ts +67 -0
- package/src/_collections/_tools/vector.ts +119 -0
- package/src/_collections/index.ts +12 -3
- package/src/_enums/region.enum.ts +9 -0
- package/src/_enums/sub-region.enum.ts +26 -0
- package/src/_models/control-models/country-iso.ts +16 -0
- package/src/_models/control-models/country-phone-code.ts +7 -0
- package/src/_models/control-models/dynamo-error.ts +15 -2
- package/src/_models/control-models/random-weight.ts +7 -0
- package/src/_models/control-models/subdivision-collection.ts +10 -0
- package/src/_models/control-models/subdivision-region-data.ts +49 -0
- package/src/_models/index.ts +10 -4
- package/src/_modules/shared-service.index.ts +1 -1
- package/lib/_collections/dynamo-shared.service.d.ts +0 -87
- package/lib/_collections/dynamo-shared.service.d.ts.map +0 -1
- package/lib/_collections/dynamo-shared.service.js +0 -261
- package/lib/_collections/dynamo-shared.service.js.map +0 -1
- package/lib/_collections/index.d.ts +0 -2
- package/lib/_collections/index.d.ts.map +0 -1
- package/lib/_collections/index.js +0 -6
- package/lib/_collections/index.js.map +0 -1
- package/lib/_constants/index.d.ts +0 -4
- package/lib/_constants/index.d.ts.map +0 -1
- package/lib/_constants/index.js +0 -9
- package/lib/_constants/index.js.map +0 -1
- package/lib/_constants/module-settings/test-module-settings.d.ts +0 -3
- package/lib/_constants/module-settings/test-module-settings.d.ts.map +0 -1
- package/lib/_constants/module-settings/test-module-settings.js +0 -16
- package/lib/_constants/module-settings/test-module-settings.js.map +0 -1
- package/lib/_constants/module-settings/usage-module-settings.d.ts +0 -3
- package/lib/_constants/module-settings/usage-module-settings.d.ts.map +0 -1
- package/lib/_constants/module-settings/usage-module-settings.js +0 -13
- package/lib/_constants/module-settings/usage-module-settings.js.map +0 -1
- package/lib/_constants/times.d.ts +0 -8
- package/lib/_constants/times.d.ts.map +0 -1
- package/lib/_constants/times.js +0 -11
- package/lib/_constants/times.js.map +0 -1
- package/lib/_enums/data-model-type.enum.d.ts +0 -6
- package/lib/_enums/data-model-type.enum.d.ts.map +0 -1
- package/lib/_enums/data-model-type.enum.js +0 -10
- package/lib/_enums/data-model-type.enum.js.map +0 -1
- package/lib/_enums/index.d.ts +0 -3
- package/lib/_enums/index.d.ts.map +0 -1
- package/lib/_enums/index.js +0 -7
- package/lib/_enums/index.js.map +0 -1
- package/lib/_enums/log-style.enum.d.ts +0 -26
- package/lib/_enums/log-style.enum.d.ts.map +0 -1
- package/lib/_enums/log-style.enum.js +0 -30
- package/lib/_enums/log-style.enum.js.map +0 -1
- package/lib/_models/control-models/daily-usage-data.d.ts +0 -18
- package/lib/_models/control-models/daily-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/daily-usage-data.js +0 -22
- package/lib/_models/control-models/daily-usage-data.js.map +0 -1
- package/lib/_models/control-models/dynamo-daily-usage-data.d.ts +0 -18
- package/lib/_models/control-models/dynamo-daily-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-daily-usage-data.js +0 -22
- package/lib/_models/control-models/dynamo-daily-usage-data.js.map +0 -1
- package/lib/_models/control-models/dynamo-error.d.ts +0 -263
- package/lib/_models/control-models/dynamo-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-error.js +0 -102
- package/lib/_models/control-models/dynamo-error.js.map +0 -1
- package/lib/_models/control-models/dynamo-module-settings.d.ts +0 -7
- package/lib/_models/control-models/dynamo-module-settings.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-module-settings.js +0 -3
- package/lib/_models/control-models/dynamo-module-settings.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-params.d.ts +0 -14
- package/lib/_models/control-models/dynamo-nts-data-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-params.js +0 -19
- package/lib/_models/control-models/dynamo-nts-data-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-property-params.d.ts +0 -45
- package/lib/_models/control-models/dynamo-nts-data-property-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-property-params.js +0 -61
- package/lib/_models/control-models/dynamo-nts-data-property-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-error.d.ts +0 -19
- package/lib/_models/control-models/dynamo-nts-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-error.js +0 -190
- package/lib/_models/control-models/dynamo-nts-error.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-module-settings.d.ts +0 -7
- package/lib/_models/control-models/dynamo-nts-module-settings.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-module-settings.js +0 -3
- package/lib/_models/control-models/dynamo-nts-module-settings.js.map +0 -1
- package/lib/_models/control-models/dynamo-poll.d.ts +0 -31
- package/lib/_models/control-models/dynamo-poll.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-poll.js +0 -90
- package/lib/_models/control-models/dynamo-poll.js.map +0 -1
- package/lib/_models/control-models/dynamo-usage-action.d.ts +0 -9
- package/lib/_models/control-models/dynamo-usage-action.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-usage-action.js +0 -13
- package/lib/_models/control-models/dynamo-usage-action.js.map +0 -1
- package/lib/_models/control-models/dynamo-usage-data.d.ts +0 -14
- package/lib/_models/control-models/dynamo-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-usage-data.js +0 -16
- package/lib/_models/control-models/dynamo-usage-data.js.map +0 -1
- package/lib/_models/control-models/dynamobe-data-params.d.ts +0 -14
- package/lib/_models/control-models/dynamobe-data-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-data-params.js +0 -19
- package/lib/_models/control-models/dynamobe-data-params.js.map +0 -1
- package/lib/_models/control-models/dynamobe-data-property-params.d.ts +0 -28
- package/lib/_models/control-models/dynamobe-data-property-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-data-property-params.js +0 -57
- package/lib/_models/control-models/dynamobe-data-property-params.js.map +0 -1
- package/lib/_models/control-models/dynamobe-error.d.ts +0 -19
- package/lib/_models/control-models/dynamobe-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-error.js +0 -188
- package/lib/_models/control-models/dynamobe-error.js.map +0 -1
- package/lib/_models/control-models/geo-ip-location.d.ts +0 -26
- package/lib/_models/control-models/geo-ip-location.d.ts.map +0 -1
- package/lib/_models/control-models/geo-ip-location.js +0 -3
- package/lib/_models/control-models/geo-ip-location.js.map +0 -1
- package/lib/_models/control-models/location-coordinates.d.ts +0 -5
- package/lib/_models/control-models/location-coordinates.d.ts.map +0 -1
- package/lib/_models/control-models/location-coordinates.js +0 -3
- package/lib/_models/control-models/location-coordinates.js.map +0 -1
- package/lib/_models/control-models/usage-action.d.ts +0 -9
- package/lib/_models/control-models/usage-action.d.ts.map +0 -1
- package/lib/_models/control-models/usage-action.js +0 -13
- package/lib/_models/control-models/usage-action.js.map +0 -1
- package/lib/_models/control-models/usage-data.d.ts +0 -14
- package/lib/_models/control-models/usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/usage-data.js +0 -16
- package/lib/_models/control-models/usage-data.js.map +0 -1
- package/lib/_models/data-models/custom-data.d.ts +0 -16
- package/lib/_models/data-models/custom-data.d.ts.map +0 -1
- package/lib/_models/data-models/custom-data.js +0 -28
- package/lib/_models/data-models/custom-data.js.map +0 -1
- package/lib/_models/data-models/dynamo-custom-data.d.ts +0 -16
- package/lib/_models/data-models/dynamo-custom-data.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-custom-data.js +0 -28
- package/lib/_models/data-models/dynamo-custom-data.js.map +0 -1
- package/lib/_models/data-models/dynamo-metadata.d.ts +0 -17
- package/lib/_models/data-models/dynamo-metadata.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-metadata.js +0 -17
- package/lib/_models/data-models/dynamo-metadata.js.map +0 -1
- package/lib/_models/data-models/dynamo-usage-session.d.ts +0 -34
- package/lib/_models/data-models/dynamo-usage-session.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-usage-session.js +0 -53
- package/lib/_models/data-models/dynamo-usage-session.js.map +0 -1
- package/lib/_models/data-models/metadata.d.ts +0 -17
- package/lib/_models/data-models/metadata.d.ts.map +0 -1
- package/lib/_models/data-models/metadata.js +0 -17
- package/lib/_models/data-models/metadata.js.map +0 -1
- package/lib/_models/data-models/usage-session.d.ts +0 -34
- package/lib/_models/data-models/usage-session.d.ts.map +0 -1
- package/lib/_models/data-models/usage-session.js +0 -53
- package/lib/_models/data-models/usage-session.js.map +0 -1
- package/lib/_models/index.d.ts +0 -13
- package/lib/_models/index.d.ts.map +0 -1
- package/lib/_models/index.js +0 -19
- package/lib/_models/index.js.map +0 -1
- package/lib/_modules/data-models.index.d.ts +0 -3
- package/lib/_modules/data-models.index.d.ts.map +0 -1
- package/lib/_modules/data-models.index.js +0 -7
- package/lib/_modules/data-models.index.js.map +0 -1
- package/lib/_modules/data-module.index.d.ts +0 -5
- package/lib/_modules/data-module.index.d.ts.map +0 -1
- package/lib/_modules/data-module.index.js +0 -9
- package/lib/_modules/data-module.index.js.map +0 -1
- package/lib/_modules/data-modules.index.d.ts +0 -6
- package/lib/_modules/data-modules.index.d.ts.map +0 -1
- package/lib/_modules/data-modules.index.js +0 -10
- package/lib/_modules/data-modules.index.js.map +0 -1
- package/lib/_modules/error-module.index.d.ts +0 -2
- package/lib/_modules/error-module.index.d.ts.map +0 -1
- package/lib/_modules/error-module.index.js +0 -6
- package/lib/_modules/error-module.index.js.map +0 -1
- package/lib/_modules/shared-service.index.d.ts +0 -8
- package/lib/_modules/shared-service.index.d.ts.map +0 -1
- package/lib/_modules/shared-service.index.js +0 -12
- package/lib/_modules/shared-service.index.js.map +0 -1
- package/lib/_modules/test-module.index.d.ts +0 -3
- package/lib/_modules/test-module.index.d.ts.map +0 -1
- package/lib/_modules/test-module.index.js +0 -7
- package/lib/_modules/test-module.index.js.map +0 -1
- package/lib/_modules/usage-module.index.d.ts +0 -6
- package/lib/_modules/usage-module.index.d.ts.map +0 -1
- package/lib/_modules/usage-module.index.js +0 -10
- package/lib/_modules/usage-module.index.js.map +0 -1
- package/lib/data-models.d.ts +0 -3
- package/lib/data-models.d.ts.map +0 -1
- package/lib/data-models.js +0 -7
- package/lib/data-models.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -12
- package/lib/index.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -2761
- package/src/_collections/dynamo-shared.service.ts +0 -277
- package/src/version.json +0 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
|
|
2
|
+
import { clone } from './utilities';
|
|
3
|
+
|
|
4
|
+
export class Dynamo_Shared {
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* returns remapped object list by path list
|
|
8
|
+
* @param objList object list to map
|
|
9
|
+
* @param paths string list of path etc.:
|
|
10
|
+
* ```ts
|
|
11
|
+
* [ [ 'first', 'sub', 'label' ], [ 'first', 'dif', 'name' ] ]
|
|
12
|
+
* ```
|
|
13
|
+
* will be...
|
|
14
|
+
* from
|
|
15
|
+
* ```ts
|
|
16
|
+
* {
|
|
17
|
+
* first: {
|
|
18
|
+
* sub: {
|
|
19
|
+
* label: 'vlmi'
|
|
20
|
+
* },
|
|
21
|
+
* dif: {
|
|
22
|
+
* name: 'asd'
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }[]
|
|
26
|
+
* ```
|
|
27
|
+
* to
|
|
28
|
+
* ```
|
|
29
|
+
* { label: 'vlmi', name: 'asd' }[]
|
|
30
|
+
* ```
|
|
31
|
+
* @returns remapped object list (the final obj will use the deepest keys)
|
|
32
|
+
*/
|
|
33
|
+
static mapObjList(objList: object[], paths: string[][]): object[] {
|
|
34
|
+
let newObjList = [...objList];
|
|
35
|
+
newObjList = newObjList.map(obj => {
|
|
36
|
+
const newObj = {};
|
|
37
|
+
paths.forEach((path: string[]) => {
|
|
38
|
+
newObj[path[path.length - 1]] = this.getNestedData(obj, path);
|
|
39
|
+
});
|
|
40
|
+
return newObj;
|
|
41
|
+
});
|
|
42
|
+
return newObjList;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* returns nested value from object
|
|
47
|
+
* @param parentObj data source object
|
|
48
|
+
* @param nestedDataKeys path of value as string list
|
|
49
|
+
* etc.: ['nestLvl1', 'nestLvl2', 'nestLvl3'] as parentObj.nestLvl1.nestLvl2.nestLvl3
|
|
50
|
+
* @returns data from object by path
|
|
51
|
+
*/
|
|
52
|
+
static getNestedData(parentObj: object, nestedDataKeys: string[]): any {
|
|
53
|
+
let newData = clone(parentObj); // {...parentObj};
|
|
54
|
+
nestedDataKeys.forEach((dk: string) => {
|
|
55
|
+
if (newData) {
|
|
56
|
+
newData = newData[dk];
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return newData;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* recursive function that nests data
|
|
64
|
+
* @param newData the object that that is needed to be updated
|
|
65
|
+
* @param nestKeys the path where the data should be updated
|
|
66
|
+
* @param dataToSet the actual value that will be setted
|
|
67
|
+
* @returns modified data
|
|
68
|
+
*/
|
|
69
|
+
static nestData(parentObj: object, nestKeys: string[], dataToSet: any): object {
|
|
70
|
+
const newData = clone(parentObj); // {...parentObj};
|
|
71
|
+
if (nestKeys.length > 1) {
|
|
72
|
+
const keys = [...nestKeys];
|
|
73
|
+
const nextNestKey = keys.shift();
|
|
74
|
+
newData[nextNestKey] = this.nestData(newData[nextNestKey], keys, dataToSet);
|
|
75
|
+
} else {
|
|
76
|
+
newData[nestKeys[0]] = dataToSet;
|
|
77
|
+
}
|
|
78
|
+
return newData;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* recursive function that adds to nested data
|
|
83
|
+
* @param newData the object that that is needed to be updated
|
|
84
|
+
* @param nestKeys the path where the data should be updated
|
|
85
|
+
* @param dataToAdd the actual value that will be setted
|
|
86
|
+
* @returns modified data
|
|
87
|
+
*/
|
|
88
|
+
static addToNestedData(parentObj: object, nestKeys: string[], dataToAdd: any): object {
|
|
89
|
+
const newData = clone(parentObj); // {...parentObj};
|
|
90
|
+
if (nestKeys.length > 1) {
|
|
91
|
+
const keys = [...nestKeys];
|
|
92
|
+
const nextNestKey = keys.shift();
|
|
93
|
+
newData[nextNestKey] = this.addToNestedData(newData[nextNestKey], keys, dataToAdd);
|
|
94
|
+
} else {
|
|
95
|
+
newData[nestKeys[0]] += dataToAdd;
|
|
96
|
+
}
|
|
97
|
+
return newData;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* recursive function that pushes to nested data
|
|
102
|
+
* @param newData the object that that is needed to be updated
|
|
103
|
+
* @param nestKeys the path where the data should be updated
|
|
104
|
+
* @param dataToPush the actual value that will be setted
|
|
105
|
+
* @returns modified data
|
|
106
|
+
*/
|
|
107
|
+
static pushToNestedData(parentObj: object, nestKeys: string[], dataToPush: any): object {
|
|
108
|
+
const newData = clone(parentObj); // {...parentObj};
|
|
109
|
+
if (nestKeys.length > 1) {
|
|
110
|
+
const keys = [...nestKeys];
|
|
111
|
+
const nextNestKey = keys.shift();
|
|
112
|
+
newData[nextNestKey] = this.pushToNestedData(newData[nextNestKey], keys, dataToPush);
|
|
113
|
+
} else {
|
|
114
|
+
if (Array.isArray(newData[nestKeys[0]])) {
|
|
115
|
+
newData[nestKeys[0]].push(dataToPush);
|
|
116
|
+
} else {
|
|
117
|
+
newData[nestKeys[0]] = [dataToPush];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return newData;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* recursive function that nests data on recursive data structure etc.: xData: { ..., 'nestedListKey': xData[] }
|
|
125
|
+
* @param newData the object that that is needed to be updated
|
|
126
|
+
* @param nestedListKey the location of nested dataList
|
|
127
|
+
* @param nestIndexes path to the subject ect.: xData.listKey[1].listKey[4].listKey[0] will be [1, 4, 0]
|
|
128
|
+
* @param dataToSet the actual value that will be setted on location
|
|
129
|
+
* @returns modified data
|
|
130
|
+
*/
|
|
131
|
+
static nestRecursiveListedData<T>(parentObj: T, nestedListKey: string, nestIndexes: number[], dataToSet: any): T {
|
|
132
|
+
const newData = clone(parentObj); // parentObj; // {...parentObj};
|
|
133
|
+
if (nestIndexes.length > 1) {
|
|
134
|
+
const indexes = [...nestIndexes];
|
|
135
|
+
const nextLevelKey = indexes.shift();
|
|
136
|
+
newData[nestedListKey][nextLevelKey] = this.nestRecursiveListedData(
|
|
137
|
+
newData[nestedListKey][nextLevelKey], nestedListKey, indexes, dataToSet);
|
|
138
|
+
} else {
|
|
139
|
+
newData[nestedListKey][nestIndexes[0]] = dataToSet;
|
|
140
|
+
}
|
|
141
|
+
return newData;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static addMetadataToSchema(schema: any): any {
|
|
145
|
+
schema.__created = { type: Date };
|
|
146
|
+
schema.__createdBy = { type: String };
|
|
147
|
+
schema.__lastModified = { type: Date };
|
|
148
|
+
schema.__lastModifiedBy = { type: String };
|
|
149
|
+
return schema;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import { day, hour, month, week, year } from '../../_constants/times';
|
|
3
|
+
|
|
4
|
+
export class Dynamo_Time {
|
|
5
|
+
|
|
6
|
+
static getAge(birthDate: Date | number | string) {
|
|
7
|
+
return this.getYear(+new Date() - +new Date(birthDate));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static getYear(date: Date | number | string) {
|
|
11
|
+
if (typeof date === 'string') {
|
|
12
|
+
date = new Date(date);
|
|
13
|
+
}
|
|
14
|
+
return (+date / year);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static getHour(date: Date | number | string) {
|
|
18
|
+
if (typeof date === 'string') {
|
|
19
|
+
date = new Date(date);
|
|
20
|
+
}
|
|
21
|
+
return (+date / hour);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static getDateByAge(age: number) {
|
|
25
|
+
return new Date(+new Date() - (year * age));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static oneHourAgo(): Date {
|
|
29
|
+
return new Date(+new Date() - hour);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static oneDayAgo(): Date {
|
|
33
|
+
return new Date(+new Date() - day);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static oneWeekAgo(): Date {
|
|
37
|
+
return new Date(+new Date() - week);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static oneMonthAgo(): Date {
|
|
41
|
+
return new Date(+new Date() - month);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static oneYearAgo(): Date {
|
|
45
|
+
return new Date(+new Date() - year);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
|
|
2
|
+
export class Dynamo_Trigonometry {
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Befogó
|
|
6
|
+
* a Befogó mérete az átfogó, és a befogóval szemközti szög alapján
|
|
7
|
+
* a szemközti szög értéke opcionális
|
|
8
|
+
* (amennyiben nem adjuk meg, 45 fokos szöggel számolunk)
|
|
9
|
+
* @param c átfogó
|
|
10
|
+
* @param angle a befogó oldallal szemközti szög (fokban)
|
|
11
|
+
* @returns befogó
|
|
12
|
+
*/
|
|
13
|
+
static getClamp(c: number, angle?: number): number {
|
|
14
|
+
angle = angle !== undefined ? angle : 45;
|
|
15
|
+
return Math.sin(this.angleToRadians(angle)) * c;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Befogó
|
|
20
|
+
* a Befogó mérete az átfogó és a másik befogó alapján
|
|
21
|
+
* @param a befogó
|
|
22
|
+
* @param c átfogó
|
|
23
|
+
* @returns befogó
|
|
24
|
+
*/
|
|
25
|
+
static getClampByClampAndHypotenuse(a: number, c: number): number {
|
|
26
|
+
if (a > c) {
|
|
27
|
+
throw { errorMessage: `getClampByClampAndHypotenuse error hypotenuse is smaller than clamp (a:${a} > c:${c})` };
|
|
28
|
+
}
|
|
29
|
+
return Math.sqrt((c * c) - (a * a));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Átfogó
|
|
34
|
+
* az Átfogó mérete a befogók alapján
|
|
35
|
+
* a második befogó értéke opcionális
|
|
36
|
+
* (amennyiben nem adjuk meg, egyenlő szárú háromszöggel számolunk)
|
|
37
|
+
* @param a egyik befogó
|
|
38
|
+
* @param b másik befogó
|
|
39
|
+
* @returns átfogó
|
|
40
|
+
*/
|
|
41
|
+
static getHypotenuse(a: number, b?: number): number {
|
|
42
|
+
b = b !== undefined ? b : a;
|
|
43
|
+
return Math.sqrt((a * a) + (b * b));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Szög fokmértéket átalakítja radiánsra
|
|
48
|
+
* @param angle szög fok
|
|
49
|
+
* @returns szög radiáns
|
|
50
|
+
*/
|
|
51
|
+
static angleToRadians(angle: number): number {
|
|
52
|
+
return angle * Math.PI / 180;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Szög radiáns mértéket átalakítja fokra
|
|
57
|
+
* @param radians szög radiáns
|
|
58
|
+
* @returns szög fok
|
|
59
|
+
*/
|
|
60
|
+
static radiansToAngle(radians: number): number {
|
|
61
|
+
return radians / Math.PI * 180;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export function clone<T>(object: T): T {
|
|
4
|
+
try {
|
|
5
|
+
return object ? JSON.parse(JSON.stringify(object)) as T : object;
|
|
6
|
+
} catch (error) {
|
|
7
|
+
console.error('clone() failed. This might be happening becouse the object you trying to clone, containes object hooks for its own objects, therefore its creating an object loop. See further information in the detailed error:');
|
|
8
|
+
throw error;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function sameObjects<T>(objA: T, objB: T): boolean {
|
|
13
|
+
return JSON.stringify(objA) === JSON.stringify(objB);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* sets values if its existing on To, even if its null (but if undefined)
|
|
18
|
+
* @param setOn
|
|
19
|
+
* @param setTo
|
|
20
|
+
*/
|
|
21
|
+
export function setExisitngValuesOnly(setOn: any, setTo: any): void {
|
|
22
|
+
for (const key in setTo) {
|
|
23
|
+
if (setTo[key] != undefined) {
|
|
24
|
+
setOn[key] = setTo[key];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function delay(ms: number): Promise<void> {
|
|
30
|
+
return new Promise(resolve => setTimeout(resolve, ms) );
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* You might be use getSortForTrueFn instead for a shorter expression
|
|
35
|
+
*
|
|
36
|
+
* @param a
|
|
37
|
+
* @param b
|
|
38
|
+
* @param check
|
|
39
|
+
* @returns
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* codes.sort((a,b) => sortForTrue(a,b,(c: Code) => c.haveImg));
|
|
43
|
+
*/
|
|
44
|
+
export function sortForTrue<T>(a: T, b: T, check: (a: T) => boolean): 0 | 1 | -1 {
|
|
45
|
+
const isA = check(a);
|
|
46
|
+
return isA === check(b) ? 0 : isA ? -1 : 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param checkFor
|
|
52
|
+
* @returns
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* codes.sort(getSortForTrueFn((c: Code) => c.haveImg));
|
|
56
|
+
*/
|
|
57
|
+
export function getSortForTrueFn<T>(checkFor: (a: T) => boolean): (a: T, b: T) => 0 | 1 | -1 {
|
|
58
|
+
return (a: T, b: T) => sortForTrue<T>(a, b, checkFor);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function JSONListify<T>(JSONList): T[] {
|
|
62
|
+
const result: T[] = [];
|
|
63
|
+
for (let i = 0; JSONList[i]; i++) {
|
|
64
|
+
result.push(JSONList[i] as T);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
|
|
2
|
+
import { Dynamo_Trigonometry } from './dynamo-trigonometry';
|
|
3
|
+
|
|
4
|
+
export class Vector2 {
|
|
5
|
+
private _x: number;
|
|
6
|
+
set x (value: number) {
|
|
7
|
+
this._x = value;
|
|
8
|
+
this.calcMagnitude();
|
|
9
|
+
};
|
|
10
|
+
get x (): number {
|
|
11
|
+
return this._x;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
private _y: number;
|
|
15
|
+
set y (value: number) {
|
|
16
|
+
this._y = value;
|
|
17
|
+
this.calcMagnitude();
|
|
18
|
+
};
|
|
19
|
+
get y (): number {
|
|
20
|
+
return this._y;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private _magintude: number;
|
|
24
|
+
get magintude (): number {
|
|
25
|
+
return this._magintude;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor(x: number, y: number) {
|
|
29
|
+
this._x = x;
|
|
30
|
+
this._y = y;
|
|
31
|
+
this.calcMagnitude();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
static readonly zero: Vector2 = new Vector2(0, 0);
|
|
35
|
+
static readonly left: Vector2 = new Vector2(-1, 0);
|
|
36
|
+
static readonly right: Vector2 = new Vector2(1, 0);
|
|
37
|
+
static readonly up: Vector2 = new Vector2(0, 1);
|
|
38
|
+
static readonly down: Vector2 = new Vector2(0, -1);
|
|
39
|
+
|
|
40
|
+
static distance(a: Vector2, b: Vector2): number {
|
|
41
|
+
return this.minus(a, b).magintude;
|
|
42
|
+
}
|
|
43
|
+
distanceTo(to: Vector2): number {
|
|
44
|
+
return Vector2.distance(this, to);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
static minus(a: Vector2, b: Vector2): Vector2 {
|
|
48
|
+
return this.plus(a, this.negative(b));
|
|
49
|
+
}
|
|
50
|
+
minus(vector: Vector2): void {
|
|
51
|
+
this.newVector(Vector2.minus(this, vector));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static plus(a: Vector2, b: Vector2): Vector2 {
|
|
55
|
+
return new Vector2(a.x + b.x, a.y + b.y);
|
|
56
|
+
}
|
|
57
|
+
plus(vector: Vector2): void {
|
|
58
|
+
this.newVector(Vector2.plus(this, vector));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static multiply(v: Vector2, n: number): Vector2 {
|
|
62
|
+
return new Vector2(v.x * n, v.y * n);
|
|
63
|
+
}
|
|
64
|
+
multiply(n: number): void {
|
|
65
|
+
this.newVector(Vector2.multiply(this, n));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static negative(v: Vector2): Vector2 {
|
|
69
|
+
return new Vector2(-v.x, -v.y);
|
|
70
|
+
}
|
|
71
|
+
getNegative(): Vector2 {
|
|
72
|
+
return Vector2.negative(this);
|
|
73
|
+
}
|
|
74
|
+
negate(): void {
|
|
75
|
+
this.newVector(Vector2.negative(this));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static rebase(v: Vector2, baseFrom: Vector2, baseTo: Vector2): Vector2 {
|
|
79
|
+
return this.plus(v, this.minus(baseTo, baseFrom));
|
|
80
|
+
}
|
|
81
|
+
rebase(baseFrom: Vector2, baseTo: Vector2): void {
|
|
82
|
+
this.newVector(Vector2.rebase(this, baseFrom, baseTo));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static rotate(vector: Vector2, angle: number): Vector2 {
|
|
86
|
+
const rad = Dynamo_Trigonometry.angleToRadians(angle);
|
|
87
|
+
return this.rotateRad(vector, rad);
|
|
88
|
+
}
|
|
89
|
+
static rotateRad(vector: Vector2, rad: number): Vector2 {
|
|
90
|
+
const cos = Math.cos(rad);
|
|
91
|
+
const sin = Math.sin(rad);
|
|
92
|
+
const newX = (vector.x * cos) - (vector.y * sin);
|
|
93
|
+
const newY = (vector.x * sin) + (vector.y * cos);
|
|
94
|
+
return new Vector2(newX, newY);
|
|
95
|
+
}
|
|
96
|
+
rotate(angle: number): void {
|
|
97
|
+
this.newVector(Vector2.rotate(this, angle));
|
|
98
|
+
}
|
|
99
|
+
rotateRad(rad: number): void {
|
|
100
|
+
this.newVector(Vector2.rotateRad(this, rad));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
private newVector(newV: Vector2): void {
|
|
104
|
+
this.newXY(newV.x, newV.y);
|
|
105
|
+
}
|
|
106
|
+
newXY(newX: number, newY: number): void {
|
|
107
|
+
this._x = newX;
|
|
108
|
+
this._y = newY;
|
|
109
|
+
this.calcMagnitude();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private calcMagnitude() {
|
|
113
|
+
this._magintude = Dynamo_Trigonometry.getHypotenuse(this._x, this._y);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
clone() {
|
|
117
|
+
return new Vector2(this._x, this._y);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
|
|
2
|
-
//
|
|
3
|
-
export * from './dynamo-shared.service';
|
|
4
|
-
|
|
2
|
+
// TOOLS
|
|
3
|
+
export * from './_tools/dynamo-shared.service';
|
|
4
|
+
export * from './_tools/dynamo-regions';
|
|
5
|
+
export * from './_tools/dynamo-location';
|
|
6
|
+
export * from './_tools/dynamo-log';
|
|
7
|
+
export * from './_tools/dynamo-random';
|
|
8
|
+
export * from './_tools/dynamo-location';
|
|
9
|
+
export * from './_tools/dynamo-round-list';
|
|
10
|
+
export * from './_tools/dynamo-time';
|
|
11
|
+
export * from './_tools/dynamo-trigonometry';
|
|
12
|
+
export * from './_tools/utilities';
|
|
13
|
+
export * from './_tools/vector';
|
|
5
14
|
|
|
6
15
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
export enum SubRegion {
|
|
3
|
+
northernEurope = 'Northern Europe',
|
|
4
|
+
southernEurope = 'Southern Europe',
|
|
5
|
+
westernEurope = 'Western Europe',
|
|
6
|
+
easternEurope = 'Eastern Europe',
|
|
7
|
+
|
|
8
|
+
northernAfrica = 'Northern Africa',
|
|
9
|
+
subSaharanAfrica = 'Sub-Saharan Africa',
|
|
10
|
+
|
|
11
|
+
northernAmerica = 'Northern America',
|
|
12
|
+
latinAmericaAndTheCaribbean = 'Latin America and the Caribbean',
|
|
13
|
+
|
|
14
|
+
southEasternAsia = 'South-eastern Asia',
|
|
15
|
+
easternAsia = 'Eastern Asia',
|
|
16
|
+
southernAsia = 'Southern Asia',
|
|
17
|
+
|
|
18
|
+
westernAsia = 'Western Asia',
|
|
19
|
+
centralAsia = 'Central Asia',
|
|
20
|
+
|
|
21
|
+
australiaAndNewZealand = 'Australia and New Zealand',
|
|
22
|
+
melanesia = 'Melanesia',
|
|
23
|
+
micronesia = 'Micronesia',
|
|
24
|
+
polynesia = 'Polynesia',
|
|
25
|
+
}
|
|
26
|
+
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Region } from '../../_enums/region.enum';
|
|
2
|
+
import { SubRegion } from '../../_enums/sub-region.enum';
|
|
3
|
+
|
|
4
|
+
export interface CountryISO {
|
|
5
|
+
name: string;
|
|
6
|
+
iso2: string;
|
|
7
|
+
iso3: string;
|
|
8
|
+
countryCode: string;
|
|
9
|
+
fullIso: string;
|
|
10
|
+
region: Region;
|
|
11
|
+
regionCode: string;
|
|
12
|
+
subRegion: SubRegion;
|
|
13
|
+
subRegionCode: string;
|
|
14
|
+
subdivisionRegion: string;
|
|
15
|
+
subdivisionRegionCode: string;
|
|
16
|
+
}
|
|
@@ -100,9 +100,9 @@ export class Dynamo_Error {
|
|
|
100
100
|
}
|
|
101
101
|
if (set.error.userMessages) {
|
|
102
102
|
if (Array.isArray(set.error.userMessages)) {
|
|
103
|
-
if (set.error.userMessages[0] == this.userMessages[0]) {
|
|
103
|
+
/* if (set.error.userMessages[0] == this.userMessages[0]) {
|
|
104
104
|
set.error.userMessages.shift();
|
|
105
|
-
}
|
|
105
|
+
} */
|
|
106
106
|
this.userMessages.push(...set.error.userMessages);
|
|
107
107
|
} else {
|
|
108
108
|
this.userMessages.push(set.error.userMessages);
|
|
@@ -116,6 +116,19 @@ export class Dynamo_Error {
|
|
|
116
116
|
this.message = set?.message ?? this.messages[0];
|
|
117
117
|
this.error = set?.error ?? this.errors[0] ?? new Error(this.message);
|
|
118
118
|
|
|
119
|
+
if (0 < this.errorCodes.length && this.errorCode === this.errorCodes[0]) {
|
|
120
|
+
this.errorCodes.shift();
|
|
121
|
+
}
|
|
122
|
+
if (0 < this.userMessages.length && this.userMessage === this.userMessages[0]) {
|
|
123
|
+
this.userMessages.shift();
|
|
124
|
+
}
|
|
125
|
+
if (0 < this.messages.length && this.message === this.messages[0]) {
|
|
126
|
+
this.messages.shift();
|
|
127
|
+
}
|
|
128
|
+
if (0 < this.errors.length && this.error === this.errors[0]) {
|
|
129
|
+
this.errors.shift();
|
|
130
|
+
}
|
|
131
|
+
|
|
119
132
|
if (set.addECToUserMsg) {
|
|
120
133
|
this.userMessage += `\nErrorCode: ${this.errorCode}`
|
|
121
134
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CountryISO } from './country-iso';
|
|
2
|
+
|
|
3
|
+
export interface SubdivisionRegionData extends CountryISO {
|
|
4
|
+
type?: SubdivisionRegionType;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export enum SubdivisionRegionType {
|
|
9
|
+
parish,
|
|
10
|
+
emirate,
|
|
11
|
+
province,
|
|
12
|
+
dependency,
|
|
13
|
+
county,
|
|
14
|
+
city,
|
|
15
|
+
region,
|
|
16
|
+
state,
|
|
17
|
+
territory,
|
|
18
|
+
autonomousRepublic,
|
|
19
|
+
municipate,
|
|
20
|
+
rayon,
|
|
21
|
+
division,
|
|
22
|
+
district,
|
|
23
|
+
governorate,
|
|
24
|
+
department,
|
|
25
|
+
specialMunicipality,
|
|
26
|
+
federalDistrict,
|
|
27
|
+
island,
|
|
28
|
+
town,
|
|
29
|
+
oblast,
|
|
30
|
+
commune,
|
|
31
|
+
prefecture,
|
|
32
|
+
economicPrefecture,
|
|
33
|
+
canton,
|
|
34
|
+
autonomousRegion,
|
|
35
|
+
specialAdministrativeRegion,
|
|
36
|
+
capitalDistrict,
|
|
37
|
+
geographicalRegion,
|
|
38
|
+
capitalCity,
|
|
39
|
+
ruralMunicipality,
|
|
40
|
+
urbanMunicipality,
|
|
41
|
+
autonomousCommunity,
|
|
42
|
+
autonomousCity,
|
|
43
|
+
administration,
|
|
44
|
+
regionalState,
|
|
45
|
+
metropolitanRegion,
|
|
46
|
+
overseasCollectivity,
|
|
47
|
+
// ... reduce specials // non-finished
|
|
48
|
+
}
|
|
49
|
+
|
package/src/_models/index.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
// MODELS
|
|
3
3
|
// Control models
|
|
4
|
+
export * from './control-models/country-iso';
|
|
5
|
+
export * from './control-models/country-phone-code';
|
|
4
6
|
export * from './control-models/dynamo-daily-usage-data';
|
|
7
|
+
export * from './control-models/dynamo-error';
|
|
5
8
|
export * from './control-models/dynamo-nts-data-params';
|
|
6
9
|
export * from './control-models/dynamo-nts-data-property-params';
|
|
7
|
-
export * from './control-models/dynamo-
|
|
8
|
-
export * from './control-models/
|
|
9
|
-
export * from './control-models/location-coordinates';
|
|
10
|
+
export * from './control-models/dynamo-nts-module-settings';
|
|
11
|
+
export * from './control-models/dynamo-poll';
|
|
10
12
|
export * from './control-models/dynamo-usage-action';
|
|
11
13
|
export * from './control-models/dynamo-usage-data';
|
|
12
|
-
export * from './control-models/
|
|
14
|
+
export * from './control-models/geo-ip-location';
|
|
15
|
+
export * from './control-models/location-coordinates';
|
|
16
|
+
export * from './control-models/random-weight';
|
|
17
|
+
export * from './control-models/subdivision-collection';
|
|
18
|
+
export * from './control-models/subdivision-region-data';
|
|
13
19
|
// Data models
|
|
14
20
|
export * from './data-models/dynamo-custom-data';
|
|
15
21
|
export * from './data-models/dynamo-metadata';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
// SHARED SERVICE MODULE
|
|
3
|
-
export * from '../_collections/dynamo-shared.service';
|
|
3
|
+
export * from '../_collections/_tools/dynamo-shared.service';
|
|
4
4
|
export * from '../_constants/times';
|
|
5
5
|
export * from '../_enums/log-style.enum';
|
|
6
6
|
export * from '../_models/control-models/dynamo-error';
|