@rr0/cms 0.1.16 → 0.1.18
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 +20 -2
- package/dist/DefaultContentVisitor.d.ts +1 -3
- package/dist/OpenGraphCommand.js +1 -1
- package/dist/OpenGraphCommand.test.js +14 -0
- package/dist/RR0Build.d.ts +56 -0
- package/dist/RR0Build.js +253 -0
- package/dist/RR0Build.test.js +106 -0
- package/dist/RR0Context.d.ts +6 -4
- package/dist/RR0Context.js +4 -0
- package/dist/TableReplaceCommand.js +2 -1
- package/dist/anchor/AnchorReplaceCommandTest.js +23 -0
- package/dist/anchor/AnchorReplacerTest.js +60 -0
- package/dist/anchor/CaseAnchorHandler.js +1 -1
- package/dist/anchor/DataAnchorHandler.d.ts +1 -2
- package/dist/book/Book.d.ts +1 -1
- package/dist/book/BookDirectoryStep.d.ts +3 -3
- package/dist/book/BookDirectoryStep.js +2 -1
- package/dist/book/BookService.d.ts +3 -3
- package/dist/book/BookService.js +2 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/lang/LanguageReplaceCommant.test.js +17 -0
- package/dist/lang/RR0Messages.d.ts +1 -0
- package/dist/lang/RR0Messages_en.d.ts +1 -0
- package/dist/lang/RR0Messages_en.js +2 -1
- package/dist/lang/RR0Messages_fr.d.ts +1 -0
- package/dist/lang/RR0Messages_fr.js +2 -1
- package/dist/org/Cities.js +12 -20
- package/dist/org/CountryMessageList_en.js +2 -1
- package/dist/org/CountryMessageList_fr.js +2 -1
- package/dist/org/Organization.d.ts +1 -2
- package/dist/org/OrganizationFactory.d.ts +1 -2
- package/dist/org/OrganizationFactory.js +1 -1
- package/dist/org/OrganizationService.d.ts +5 -1
- package/dist/org/OrganizationService.js +5 -1
- package/dist/org/au/Australia_en.d.ts +1 -1
- package/dist/org/au/Australia_fr.d.ts +1 -1
- package/dist/org/au/region/vic/Victoria.d.ts +1 -1
- package/dist/org/au/region/vic/Victoria.js +1 -1
- package/dist/org/au/region/vic/VictoriaMessages_en.d.ts +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_en.js +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_fr.d.ts +2 -2
- package/dist/org/au/region/vic/VictoriaMessages_fr.js +2 -2
- package/dist/org/cn/China.d.ts +6 -0
- package/dist/org/cn/China.js +6 -0
- package/dist/org/cn/ChinaMessages.d.ts +1 -0
- package/dist/org/cn/ChinaMessages_cn.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_cn.js +5 -0
- package/dist/org/cn/ChinaMessages_en.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_en.js +5 -0
- package/dist/org/cn/ChinaMessages_fr.d.ts +3 -0
- package/dist/org/cn/ChinaMessages_fr.js +5 -0
- package/dist/org/cn/region/ChinaCities.d.ts +2 -0
- package/dist/org/cn/region/ChinaCities.js +4 -0
- package/dist/org/cn/region/ChinaRegion.d.ts +4 -0
- package/dist/org/cn/region/ChinaRegion.js +5 -0
- package/dist/org/cn/region/ChinaRegionCode.d.ts +3 -0
- package/dist/org/cn/region/ChinaRegionCode.js +4 -0
- package/dist/org/cn/region/ChinaRegions.d.ts +2 -0
- package/dist/org/cn/region/ChinaRegions.js +4 -0
- package/dist/org/cn/region/n/NorthChina.d.ts +2 -0
- package/dist/org/cn/region/n/NorthChina.js +4 -0
- package/dist/org/cn/region/n/NorthChinaDepartmentCode.d.ts +3 -0
- package/dist/org/cn/region/n/NorthChinaDepartmentCode.js +4 -0
- package/dist/org/cn/region/n/NorthChinaMessages_cn.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_cn.js +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_en.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_en.js +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_fr.d.ts +6 -0
- package/dist/org/cn/region/n/NorthChinaMessages_fr.js +6 -0
- package/dist/org/cn/region/n/ji/Hebei.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Hebei.js +5 -0
- package/dist/org/cn/region/n/ji/HebeiCities.d.ts +2 -0
- package/dist/org/cn/region/n/ji/HebeiCities.js +4 -0
- package/dist/org/cn/region/n/ji/HebeiCityCode.d.ts +3 -0
- package/dist/org/cn/region/n/ji/HebeiCityCode.js +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_cn.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_cn.js +6 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_en.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_en.js +6 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_fr.d.ts +4 -0
- package/dist/org/cn/region/n/ji/HebeiMessages_fr.js +6 -0
- package/dist/org/cn/region/n/ji/Tianjin/Tianjin.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/Tianjin.js +5 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_cn.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_cn.js +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_en.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_en.js +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_fr.d.ts +2 -0
- package/dist/org/cn/region/n/ji/Tianjin/TianjinMessages_fr.js +3 -0
- package/dist/org/country/CountryMessages.test.d.ts +1 -0
- package/dist/org/country/CountryMessages.test.js +20 -0
- package/dist/org/country/CountryService.test.d.ts +1 -0
- package/dist/org/country/CountryService.test.js +11 -0
- package/dist/org/country/region/RegionMessages.test.d.ts +1 -0
- package/dist/org/country/region/RegionMessages.test.js +17 -0
- package/dist/org/country/region/RegionService.test.d.ts +1 -0
- package/dist/org/country/region/RegionService.test.js +13 -0
- package/dist/org/country/region/department/DeparmentMessages.test.d.ts +1 -0
- package/dist/org/country/region/department/DeparmentMessages.test.js +22 -0
- package/dist/org/country/region/department/DepartmentService.test.d.ts +1 -0
- package/dist/org/country/region/department/DepartmentService.test.js +13 -0
- package/dist/org/country/region/department/city/CityMessages.test.d.ts +1 -0
- package/dist/org/country/region/department/city/CityMessages.test.js +34 -0
- package/dist/org/country/region/department/city/CityService.test.d.ts +1 -0
- package/dist/org/country/region/department/city/CityService.test.js +19 -0
- package/dist/org/do/DominicanRepublicMessages.d.ts +1 -1
- package/dist/org/do/DominicanRepublic_en.d.ts +2 -2
- package/dist/org/do/DominicanRepublic_fr.d.ts +2 -2
- package/dist/org/eu/fr/FranceMessages.test.d.ts +1 -0
- package/dist/org/eu/fr/FranceMessages.test.js +11 -0
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.test.d.ts +1 -0
- package/dist/org/eu/fr/cnes/geipan/geipan/GeipanDatasource.test.js +30 -0
- package/dist/org/us/region/UsaCountyCode.d.ts +7 -1
- package/dist/org/us/region/UsaCountyCode.js +7 -1
- package/dist/org/us/region/mn/MinnesotaCities.js +2 -2
- package/dist/org/us/region/mn/MinnesotaCounties.js +2 -2
- package/dist/org/us/region/mn/Minnesota_en.d.ts +2 -2
- package/dist/org/us/region/mn/Minnesota_en.js +2 -2
- package/dist/org/us/region/mn/Minnesota_fr.d.ts +2 -2
- package/dist/org/us/region/mn/Minnesota_fr.js +2 -2
- package/dist/org/us/region/mn/{kalamazoo/Kalamazoo.d.ts → hennepin/Hennepin.d.ts} +1 -1
- package/dist/org/us/region/mn/{kalamazoo/Kalamazoo.js → hennepin/Hennepin.js} +1 -1
- package/dist/org/us/region/mn/{kalamazoo/KalamazooCities.d.ts → hennepin/HennepinCities.d.ts} +1 -1
- package/dist/org/us/region/mn/hennepin/HennepinCities.js +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinCityCode.d.ts +3 -0
- package/dist/org/us/region/mn/hennepin/HennepinCityCode.js +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_en.d.ts +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_en.js +6 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mn/hennepin/HennepinMessages_fr.js +6 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/Minneapolis.d.ts +1 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/Minneapolis.js +5 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/MinneapolisMessages.d.ts +2 -0
- package/dist/org/us/region/mn/hennepin/Minneapolis/MinneapolisMessages.js +2 -0
- package/dist/org/us/region/mo/MissouriCities.js +2 -2
- package/dist/org/us/region/mo/MissouriCounties.js +2 -2
- package/dist/org/us/region/mo/Missouri_en.d.ts +2 -2
- package/dist/org/us/region/mo/Missouri_en.js +2 -2
- package/dist/org/us/region/mo/Missouri_fr.d.ts +2 -2
- package/dist/org/us/region/mo/Missouri_fr.js +2 -2
- package/dist/org/us/region/{mn/kalamazoo/galesburg/Galesburg.d.ts → mo/pike/Louisiana/Louisiana.d.ts} +1 -1
- package/dist/org/us/region/mo/pike/Louisiana/Louisiana.js +5 -0
- package/dist/org/us/region/{mn/kalamazoo/galesburg/GalesburgMessages.d.ts → mo/pike/Louisiana/LouisianaMessages.d.ts} +1 -1
- package/dist/org/us/region/{ms/kalamazoo/galesburg/GalesburgMessages.js → mo/pike/Louisiana/LouisianaMessages.js} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/Kalamazoo.d.ts → pike/Pike.d.ts} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/Kalamazoo.js → pike/Pike.js} +1 -1
- package/dist/org/us/region/mo/{kalamazoo/KalamazooCities.d.ts → pike/PikeCities.d.ts} +1 -1
- package/dist/org/us/region/mo/pike/PikeCities.js +4 -0
- package/dist/org/us/region/mo/pike/PikeCityCode.d.ts +3 -0
- package/dist/org/us/region/mo/pike/PikeCityCode.js +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_en.d.ts +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_en.js +6 -0
- package/dist/org/us/region/mo/pike/PikeMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mo/pike/PikeMessages_fr.js +6 -0
- package/dist/org/us/region/ms/MississippiCities.js +2 -2
- package/dist/org/us/region/ms/MississippiCounties.js +2 -2
- package/dist/org/us/region/ms/Mississippi_en.d.ts +2 -2
- package/dist/org/us/region/ms/Mississippi_en.js +2 -2
- package/dist/org/us/region/ms/Mississippi_fr.d.ts +2 -2
- package/dist/org/us/region/ms/Mississippi_fr.js +2 -2
- package/dist/org/us/region/ms/{kalamazoo/Kalamazoo.d.ts → hinds/Hinds.d.ts} +1 -1
- package/dist/org/us/region/ms/{kalamazoo/Kalamazoo.js → hinds/Hinds.js} +1 -1
- package/dist/org/us/region/ms/{kalamazoo/KalamazooCities.d.ts → hinds/HindsCities.d.ts} +1 -1
- package/dist/org/us/region/ms/hinds/HindsCities.js +4 -0
- package/dist/org/us/region/ms/hinds/HindsCityCode.d.ts +3 -0
- package/dist/org/us/region/ms/hinds/HindsCityCode.js +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_en.d.ts +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_en.js +6 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_fr.d.ts +4 -0
- package/dist/org/us/region/ms/hinds/HindsMessages_fr.js +6 -0
- package/dist/org/us/region/ms/hinds/Jackson/Jackson.d.ts +1 -0
- package/dist/org/us/region/ms/hinds/Jackson/Jackson.js +5 -0
- package/dist/org/us/region/ms/{kalamazoo/galesburg/GalesburgMessages.d.ts → hinds/Jackson/JacksonMessages.d.ts} +1 -1
- package/dist/org/us/region/ms/hinds/Jackson/JacksonMessages.js +2 -0
- package/dist/org/us/region/mt/MontanaCities.js +2 -2
- package/dist/org/us/region/mt/MontanaCounties.js +2 -2
- package/dist/org/us/region/mt/Montana_en.d.ts +2 -2
- package/dist/org/us/region/mt/Montana_en.js +2 -2
- package/dist/org/us/region/mt/Montana_fr.d.ts +2 -2
- package/dist/org/us/region/mt/Montana_fr.js +2 -2
- package/dist/org/us/region/mt/{kalamazoo/Kalamazoo.d.ts → cascade/Cascade.d.ts} +1 -1
- package/dist/org/us/region/mt/{kalamazoo/Kalamazoo.js → cascade/Cascade.js} +1 -1
- package/dist/org/us/region/mt/{kalamazoo/KalamazooCities.d.ts → cascade/CascadeCities.d.ts} +1 -1
- package/dist/org/us/region/mt/cascade/CascadeCities.js +4 -0
- package/dist/org/us/region/mt/cascade/CascadeCityCode.d.ts +3 -0
- package/dist/org/us/region/mt/cascade/CascadeCityCode.js +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_en.d.ts +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_en.js +6 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_fr.d.ts +4 -0
- package/dist/org/us/region/mt/cascade/CascadeMessages_fr.js +6 -0
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFalls.d.ts +1 -0
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFalls.js +5 -0
- package/dist/org/us/region/mt/{kalamazoo/galesburg/GalesburgMessages.d.ts → cascade/GreatFalls/GreatFallsMessages.d.ts} +1 -1
- package/dist/org/us/region/mt/cascade/GreatFalls/GreatFallsMessages.js +2 -0
- package/dist/org/us/region/nh/NewHampshireCities.js +2 -2
- package/dist/org/us/region/nh/NewHampshireCounties.js +2 -2
- package/dist/org/us/region/nh/NewHampshire_en.d.ts +2 -2
- package/dist/org/us/region/nh/NewHampshire_en.js +2 -2
- package/dist/org/us/region/nh/NewHampshire_fr.d.ts +2 -2
- package/dist/org/us/region/nh/NewHampshire_fr.js +2 -2
- package/dist/org/us/region/nh/rockingham/Portsmouth/Portsmouth.d.ts +1 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/Portsmouth.js +5 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/PortsmouthMessages.d.ts +2 -0
- package/dist/org/us/region/nh/rockingham/Portsmouth/PortsmouthMessages.js +2 -0
- package/dist/org/us/region/nh/rockingham/Rockingham.d.ts +2 -0
- package/dist/org/us/region/nh/{kalamazoo/Kalamazoo.js → rockingham/Rockingham.js} +1 -1
- package/dist/org/us/region/nh/rockingham/RockinghamCities.d.ts +2 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCities.js +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCityCode.d.ts +3 -0
- package/dist/org/us/region/nh/rockingham/RockinghamCityCode.js +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_en.d.ts +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_en.js +6 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_fr.d.ts +4 -0
- package/dist/org/us/region/nh/rockingham/RockinghamMessages_fr.js +6 -0
- package/dist/org/us/region/nv/NevadaCities.js +2 -2
- package/dist/org/us/region/nv/NevadaCounties.js +2 -2
- package/dist/org/us/region/nv/Nevada_en.d.ts +2 -2
- package/dist/org/us/region/nv/Nevada_en.js +2 -2
- package/dist/org/us/region/nv/Nevada_fr.d.ts +2 -2
- package/dist/org/us/region/nv/Nevada_fr.js +2 -2
- package/dist/org/us/region/nv/clark/Clark.d.ts +2 -0
- package/dist/org/us/region/nv/{kalamazoo/Kalamazoo.js → clark/Clark.js} +1 -1
- package/dist/org/us/region/nv/clark/ClarkCities.d.ts +2 -0
- package/dist/org/us/region/nv/clark/ClarkCities.js +4 -0
- package/dist/org/us/region/nv/clark/ClarkCityCode.d.ts +3 -0
- package/dist/org/us/region/nv/clark/ClarkCityCode.js +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_en.d.ts +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_en.js +6 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_fr.d.ts +4 -0
- package/dist/org/us/region/nv/clark/ClarkMessages_fr.js +6 -0
- package/dist/org/us/region/nv/clark/LasVegas/LasVegas.d.ts +1 -0
- package/dist/org/us/region/nv/clark/LasVegas/LasVegas.js +5 -0
- package/dist/org/us/region/{mo/kalamazoo/galesburg/GalesburgMessages.d.ts → nv/clark/LasVegas/LasVegasMessages.d.ts} +1 -1
- package/dist/org/us/region/nv/clark/LasVegas/LasVegasMessages.js +2 -0
- package/dist/people/People.d.ts +1 -2
- package/dist/people/People.test.d.ts +1 -0
- package/dist/people/People.test.js +34 -0
- package/dist/people/PeopleDirectoryStep.d.ts +2 -2
- package/dist/people/PeopleDirectoryStepFactory.d.ts +27 -14
- package/dist/people/PeopleDirectoryStepFactory.js +66 -44
- package/dist/people/PeopleFactory.d.ts +1 -2
- package/dist/people/PeopleFactory.js +1 -1
- package/dist/people/PeopleFactory.test.d.ts +1 -0
- package/dist/people/PeopleFactory.test.js +81 -0
- package/dist/people/PeopleRegexReplaceCommand.test.d.ts +1 -0
- package/dist/people/PeopleRegexReplaceCommand.test.js +17 -0
- package/dist/people/PeopleReplacer.test.d.ts +1 -0
- package/dist/people/PeopleReplacer.test.js +58 -0
- package/dist/people/PeopleService.d.ts +1 -1
- package/dist/people/PeopleService.js +1 -1
- package/dist/people/author/AuthorReplaceCommandTest.d.ts +1 -0
- package/dist/people/author/AuthorReplaceCommandTest.js +49 -0
- package/dist/place/Place.d.ts +1 -2
- package/dist/place/PlaceReplacer.test.d.ts +1 -0
- package/dist/place/PlaceReplacer.test.js +91 -0
- package/dist/place/PlaceService.js +2 -2
- package/dist/place/PlaceService.test.d.ts +1 -0
- package/dist/place/PlaceService.test.js +28 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.d.ts +2 -3
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.js +0 -4
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.test.d.ts +1 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseDirectoryStep.test.js +34 -0
- package/dist/science/crypto/ufo/enquete/dossier/CaseFactory.d.ts +1 -2
- package/dist/science/crypto/ufo/enquete/dossier/CaseFactory.js +1 -1
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.d.ts +1 -1
- package/dist/science/crypto/ufo/enquete/dossier/CaseService.js +1 -1
- package/dist/search/SearchIndexStep.js +2 -2
- package/dist/search/SearchVisitor.js +1 -1
- package/dist/source/PersistentSourceRegistry.d.ts +2 -2
- package/dist/source/PersistentSourceRegistry.js +8 -3
- package/dist/source/SourceFactory.d.ts +2 -2
- package/dist/source/SourceFactory.js +1 -1
- package/dist/source/SourceIndexStep.js +2 -2
- package/dist/source/SourceRegistry.d.ts +2 -2
- package/dist/source/SourceRenderer.d.ts +1 -1
- package/dist/source/SourceRenderer.js +1 -1
- package/dist/source/index.d.ts +0 -3
- package/dist/source/index.js +0 -3
- package/dist/tech/info/soft/API.d.ts +1 -1
- package/dist/tech/info/soft/APIFactory.d.ts +1 -2
- package/dist/tech/info/soft/APIFactory.js +1 -1
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacerTest.d.ts +1 -0
- package/dist/tech/info/soft/proj/impl/lang/CodeReplacerTest.js +50 -0
- package/dist/test/RR0TestUtil.d.ts +21 -0
- package/dist/test/RR0TestUtil.js +72 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/test/index.js +1 -0
- package/dist/time/EventRenderer.d.ts +3 -3
- package/dist/time/EventRenderer.js +1 -1
- package/dist/time/EventReplacerFactory.d.ts +1 -2
- package/dist/time/Time.js +1 -1
- package/dist/time/Time.test.d.ts +1 -0
- package/dist/time/Time.test.js +48 -0
- package/dist/time/TimeEventRenderer.test.d.ts +1 -0
- package/dist/time/TimeEventRenderer.test.js +56 -0
- package/dist/time/TimeService.d.ts +1 -2
- package/dist/time/TimeService.js +1 -1
- package/dist/time/TimeTagReplaceCommand.test.d.ts +1 -0
- package/dist/time/TimeTagReplaceCommand.test.js +17 -0
- package/dist/time/TimeTestUtil.d.ts +1 -1
- package/dist/time/TimeTestUtil.js +2 -2
- package/dist/time/TimeUrlBuilder.test.d.ts +1 -0
- package/dist/time/TimeUrlBuilder.test.js +46 -0
- package/dist/time/TitleReplaceCommand.test.d.ts +1 -0
- package/dist/time/TitleReplaceCommand.test.js +44 -0
- package/dist/time/datasource/ChronologyReplacer.test.d.ts +1 -0
- package/dist/time/datasource/ChronologyReplacer.test.js +29 -0
- package/dist/time/datasource/CsvMapper.test.d.ts +1 -0
- package/dist/time/datasource/CsvMapper.test.js +50 -0
- package/dist/time/datasource/DatasourceTestCase.d.ts +1 -1
- package/dist/time/datasource/DatasourceTestCase.js +3 -3
- package/dist/time/datasource/FileSource.d.ts +2 -1
- package/dist/time/datasource/FileSource.js +1 -1
- package/dist/time/datasource/JsonMapper.test.d.ts +1 -0
- package/dist/time/datasource/JsonMapper.test.js +23 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCaseSummaryRR0Mapper.test.js +72 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCsv.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceCsv.test.js +44 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.test.d.ts +1 -0
- package/dist/time/datasource/baseovnifrance/BaseOvniFranceDatasource.test.js +30 -0
- package/dist/time/datasource/fufora/FuforaDatasource.test.d.ts +1 -0
- package/dist/time/datasource/fufora/FuforaDatasource.test.js +30 -0
- package/dist/time/datasource/nuforc/NuforcDatasource.test.d.ts +1 -0
- package/dist/time/datasource/nuforc/NuforcDatasource.test.js +30 -0
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.test.d.ts +1 -0
- package/dist/time/datasource/nuforc/NuforcRR0Mapper.test.js +110 -0
- package/dist/time/datasource/rr0/RR0CaseSummary.d.ts +1 -2
- package/dist/time/datasource/rr0/RR0Datasource.test.d.ts +19 -0
- package/dist/time/datasource/rr0/RR0Datasource.test.js +82 -0
- package/dist/time/datasource/rr0/RR0HttpDatasource.d.ts +1 -1
- package/dist/time/datasource/sceau/SceauDatasource.test.d.ts +17 -0
- package/dist/time/datasource/sceau/SceauDatasource.test.js +84 -0
- package/dist/time/datasource/ufo-search/UfoSearchCaseRR0Mapper.js +1 -1
- package/dist/time/datasource/ufo-search/UfoSearchDatasource.test.d.ts +1 -0
- package/dist/time/datasource/ufo-search/UfoSearchDatasource.test.js +30 -0
- package/dist/time/datasource/ufo-search/UfoSearchFileDatasource.js +2 -2
- package/dist/time/datasource/urecat/UrecatDatasource.test.d.ts +1 -0
- package/dist/time/datasource/urecat/UrecatDatasource.test.js +56 -0
- package/dist/time/datasource/urecat/UrecatHttpDatasource.js +1 -1
- package/dist/time/html/TimeRenderer.js +1 -1
- package/dist/time/html/TimeReplacer.test.d.ts +1 -0
- package/dist/time/html/TimeReplacer.test.js +225 -0
- package/dist/time/text/RelativeTimeTextBuilder.js +53 -102
- package/dist/time/text/RelativeTimeTextBuilder.test.d.ts +1 -0
- package/dist/time/text/RelativeTimeTextBuilder.test.js +125 -0
- package/dist/time/text/TimeTextBuilder.d.ts +4 -5
- package/dist/time/text/TimeTextBuilder.js +8 -21
- package/dist/time/text/TimeTextBuilder.test.d.ts +1 -0
- package/dist/time/text/TimeTextBuilder.test.js +63 -0
- package/dist/util/cli/CLI.test.d.ts +1 -0
- package/dist/util/cli/CLI.test.js +13 -0
- package/dist/util/html/HtmlTable.test.d.ts +1 -0
- package/dist/util/html/HtmlTable.test.js +11 -0
- package/dist/util/string/StringUtil.test.d.ts +1 -0
- package/dist/util/string/StringUtil.test.js +22 -0
- package/dist/util/url/UrlUtil.test.d.ts +1 -0
- package/dist/util/url/UrlUtil.test.js +14 -0
- package/package.json +11 -6
- package/dist/build.js +0 -299
- package/dist/data/AbstractDataFactory.d.ts +0 -16
- package/dist/data/AbstractDataFactory.js +0 -60
- package/dist/data/AbstractDataService.d.ts +0 -12
- package/dist/data/AbstractDataService.js +0 -13
- package/dist/data/AllDataService.d.ts +0 -16
- package/dist/data/AllDataService.js +0 -54
- package/dist/data/RR0Data.d.ts +0 -81
- package/dist/data/RR0DataFactory.d.ts +0 -7
- package/dist/data/TypedDataFactory.d.ts +0 -14
- package/dist/data/TypedDataFactory.js +0 -29
- package/dist/data/index.d.ts +0 -6
- package/dist/data/index.js +0 -6
- package/dist/event/RR0Event.d.ts +0 -7
- package/dist/event/RR0EventFactory.d.ts +0 -7
- package/dist/event/RR0EventFactory.js +0 -21
- package/dist/event/index.d.ts +0 -2
- package/dist/event/index.js +0 -2
- package/dist/org/us/region/mn/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mn/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mn/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mn/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mn/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/mo/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mo/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mo/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mo/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/mo/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mo/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/ms/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/ms/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/ms/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/ms/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/ms/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mt/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/mt/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/mt/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/mt/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/mt/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/mt/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/nh/kalamazoo/Kalamazoo.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/KalamazooCities.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/nh/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/nh/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/nh/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/nh/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/nh/kalamazoo/galesburg/GalesburgMessages.d.ts +0 -2
- package/dist/org/us/region/nh/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/org/us/region/nv/kalamazoo/Kalamazoo.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/KalamazooCities.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/KalamazooCities.js +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooCityCode.d.ts +0 -3
- package/dist/org/us/region/nv/kalamazoo/KalamazooCityCode.js +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_en.d.ts +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_en.js +0 -6
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_fr.d.ts +0 -4
- package/dist/org/us/region/nv/kalamazoo/KalamazooMessages_fr.js +0 -6
- package/dist/org/us/region/nv/kalamazoo/galesburg/Galesburg.d.ts +0 -1
- package/dist/org/us/region/nv/kalamazoo/galesburg/Galesburg.js +0 -5
- package/dist/org/us/region/nv/kalamazoo/galesburg/GalesburgMessages.d.ts +0 -2
- package/dist/org/us/region/nv/kalamazoo/galesburg/GalesburgMessages.js +0 -2
- package/dist/source/Article.d.ts +0 -4
- package/dist/source/ArticleFactory.d.ts +0 -7
- package/dist/source/ArticleFactory.js +0 -11
- package/dist/source/Source.d.ts +0 -45
- package/tsconfig.json +0 -23
- package/tsconfig.prod.json +0 -10
- /package/dist/{build.d.ts → OpenGraphCommand.test.d.ts} +0 -0
- /package/dist/{data/RR0Data.js → RR0Build.test.d.ts} +0 -0
- /package/dist/{data/RR0DataFactory.js → anchor/AnchorReplaceCommandTest.d.ts} +0 -0
- /package/dist/{event/RR0Event.js → anchor/AnchorReplacerTest.d.ts} +0 -0
- /package/dist/{source/Article.js → lang/LanguageReplaceCommant.test.d.ts} +0 -0
- /package/dist/{source/Source.js → org/cn/ChinaMessages.js} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { TimeContext } from "@rr0/time";
|
|
2
|
+
import { RR0ContextImpl } from "../../RR0Context.js";
|
|
3
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
4
|
+
import { rr0TestUtil } from "../../test";
|
|
5
|
+
import { TimeTextBuilder } from "./TimeTextBuilder.js";
|
|
6
|
+
describe("timeTextBuilder", () => {
|
|
7
|
+
const config = rr0TestUtil.config;
|
|
8
|
+
const timeTextBuilder = new TimeTextBuilder(rr0TestUtil.intlOptions);
|
|
9
|
+
test("prints year", () => {
|
|
10
|
+
{
|
|
11
|
+
const context = new RR0ContextImpl("fr", new TimeContext(), config);
|
|
12
|
+
context.time.setYear(2003);
|
|
13
|
+
expect(timeTextBuilder.build(context)).toBe("2003");
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
test("prints month", () => {
|
|
17
|
+
{
|
|
18
|
+
const context = new RR0ContextImpl("fr", new TimeContext(), config);
|
|
19
|
+
context.time.setYear(2003);
|
|
20
|
+
context.time.setMonth(9);
|
|
21
|
+
expect(timeTextBuilder.build(context)).toBe("septembre 2003");
|
|
22
|
+
}
|
|
23
|
+
{
|
|
24
|
+
const context = new RR0ContextImpl("en", new TimeContext(), config);
|
|
25
|
+
context.time.setYear(2003);
|
|
26
|
+
context.time.setMonth(9);
|
|
27
|
+
expect(timeTextBuilder.build(context)).toBe("September 2003");
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
test("prints day", () => {
|
|
31
|
+
{
|
|
32
|
+
const context = new RR0ContextImpl("fr", new TimeContext(), config);
|
|
33
|
+
context.time.setYear(2003);
|
|
34
|
+
context.time.setMonth(9);
|
|
35
|
+
context.time.setDayOfMonth(23);
|
|
36
|
+
expect(timeTextBuilder.build(context)).toBe("mardi 23 septembre 2003");
|
|
37
|
+
}
|
|
38
|
+
{
|
|
39
|
+
const context = new RR0ContextImpl("en", new TimeContext(), config);
|
|
40
|
+
context.time.setYear(2003);
|
|
41
|
+
context.time.setMonth(9);
|
|
42
|
+
context.time.setDayOfMonth(23);
|
|
43
|
+
expect(timeTextBuilder.build(context)).toBe("Tuesday, September 23, 2003");
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
test("prints hour", () => {
|
|
47
|
+
{
|
|
48
|
+
const context = new RR0ContextImpl("fr", new TimeContext(), config);
|
|
49
|
+
context.time.setYear(2003);
|
|
50
|
+
context.time.setMonth(9);
|
|
51
|
+
context.time.setDayOfMonth(23);
|
|
52
|
+
context.time.setHour(16);
|
|
53
|
+
expect(timeTextBuilder.build(context)).toBe("mardi 23 septembre 2003 à 16 h");
|
|
54
|
+
}
|
|
55
|
+
{
|
|
56
|
+
const context = new RR0ContextImpl("en", new TimeContext(), config);
|
|
57
|
+
context.time.setYear(2003);
|
|
58
|
+
context.time.setMonth(9);
|
|
59
|
+
context.time.setDayOfMonth(23);
|
|
60
|
+
expect(timeTextBuilder.build(context)).toBe("Tuesday, September 23, 2003");
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
2
|
+
import { CLI } from "./CLI.js";
|
|
3
|
+
describe("CLI", () => {
|
|
4
|
+
test("args", () => {
|
|
5
|
+
const cli = new CLI([
|
|
6
|
+
"/bin/node", "program.js", "-argString", "Hello", "-argBool", "true", "-argNum", "12"
|
|
7
|
+
]);
|
|
8
|
+
const args = cli.getArgs();
|
|
9
|
+
expect(args.argString).toBe("Hello");
|
|
10
|
+
expect(args.argBool).toBe("true");
|
|
11
|
+
expect(args.argNum).toBe("12");
|
|
12
|
+
});
|
|
13
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
2
|
+
import { HtmlTable } from "./HtmlTable.js";
|
|
3
|
+
describe("HtmlTable", () => {
|
|
4
|
+
test("default day of month title with handler", async () => {
|
|
5
|
+
const objects = [
|
|
6
|
+
{ key1: "value11", key2: "value12" },
|
|
7
|
+
{ key1: "value21", key2: "value22" }
|
|
8
|
+
];
|
|
9
|
+
expect(HtmlTable.create(objects)).toBe("<table><thead><tr><th>key1</th><th>key2</th></tr></thead><tbody><tr><td>value11</td><td>value12</td></tr><tr><td>value21</td><td>value22</td></tr></tbody></table>");
|
|
10
|
+
});
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
2
|
+
import { StringUtil } from "./StringUtil.js";
|
|
3
|
+
describe("StringUtil", () => {
|
|
4
|
+
test("textToCamel", () => {
|
|
5
|
+
expect(StringUtil.textToCamel("Jérôme ça va ?")).toBe("JeromeCaVa");
|
|
6
|
+
});
|
|
7
|
+
test("camelToText", () => {
|
|
8
|
+
expect(StringUtil.camelToText("dir")).toBe("Dir");
|
|
9
|
+
expect(StringUtil.camelToText("dirToTitle")).toBe("Dir To Title");
|
|
10
|
+
expect(StringUtil.camelToText("Project1947")).toBe("Project 1947");
|
|
11
|
+
expect(StringUtil.camelToText("STS48")).toBe("STS 48");
|
|
12
|
+
expect(StringUtil.camelToText("camelCase")).toBe("Camel Case");
|
|
13
|
+
expect(StringUtil.camelToText("superSimpleExample")).toBe("Super Simple Example");
|
|
14
|
+
expect(StringUtil.camelToText("AltschulerMartinD")).toBe("Altschuler Martin D.");
|
|
15
|
+
//expect(camelToText("BakerRogerML")).toBe("Baker Roger M. L.")
|
|
16
|
+
/*expect(camelToText("goodNumber90text")).toBe("Good Number 90 Text")
|
|
17
|
+
expect(camelToText("aGoodIPAddress")).toBe("A Good IP Address")
|
|
18
|
+
expect(camelToText("camelTOPCase")).toBe("Camel TOP Case")
|
|
19
|
+
expect(camelToText("bad132Number90text")).toBe("Bad 132 Number 90 Text")
|
|
20
|
+
expect(camelToText("aP2PConnection")).toBe("A P2P Connection")*/
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UrlUtil } from "./UrlUtil.js";
|
|
2
|
+
import { describe, expect, test } from "@javarome/testscript";
|
|
3
|
+
describe("UrlUtil", function () {
|
|
4
|
+
test("absolute", () => {
|
|
5
|
+
expect(UrlUtil.absolute("time")).toBe("/time/");
|
|
6
|
+
expect(UrlUtil.absolute("time/")).toBe("/time/");
|
|
7
|
+
expect(UrlUtil.absolute("/time")).toBe("/time/");
|
|
8
|
+
});
|
|
9
|
+
test("join", () => {
|
|
10
|
+
expect(UrlUtil.join("time", "1/9/7/0/03/index.html")).toBe("time/1/9/7/0/03/index.html");
|
|
11
|
+
expect(UrlUtil.join("rr0.org/time", "1/9/7/0/03/index.html")).toBe("rr0.org/time/1/9/7/0/03/index.html");
|
|
12
|
+
expect(UrlUtil.join("https://rr0.org/time", "1/9/7/0/03/index.html")).toBe("https://rr0.org/time/1/9/7/0/03/index.html");
|
|
13
|
+
});
|
|
14
|
+
});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@rr0/cms",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"author": "Jérôme Beau <rr0@rr0.org> (https://rr0.org)",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.18",
|
|
6
6
|
"description": "RR0 Content Management System (CMS)",
|
|
7
7
|
"exports": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
@@ -15,34 +15,39 @@
|
|
|
15
15
|
"type": "git",
|
|
16
16
|
"url": "git+https://github.com/RR0/cms.git"
|
|
17
17
|
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
18
21
|
"scripts": {
|
|
19
22
|
"prebuild": "npm install",
|
|
20
23
|
"build": "rm -Rf dist && tsc --project tsconfig.prod.json",
|
|
21
24
|
"prepublishOnly": "npm run build",
|
|
22
25
|
"test": "testscript",
|
|
23
|
-
"test-one": "rm -Rf out && tsx src/time/
|
|
26
|
+
"test-one": "rm -Rf out && tsx src/time/datasource/JsonMapper.test.ts",
|
|
24
27
|
"test-ci": "rm -Rf out && testscript"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
30
|
"@googlemaps/google-maps-services-js": "^3.4.0",
|
|
28
31
|
"@rr0/common": "^1.1.3",
|
|
29
32
|
"@rr0/lang": "^0.1.12",
|
|
30
|
-
"@rr0/time": "^0.
|
|
33
|
+
"@rr0/time": "^0.8.4",
|
|
31
34
|
"@rr0/place": "^0.3.2",
|
|
35
|
+
"@rr0/data": "^0.1.2",
|
|
36
|
+
"@javarome/fileutil": "^0.3.6",
|
|
37
|
+
"ssg-api": "^1.16.10",
|
|
32
38
|
"canvas": "^2.11.2",
|
|
33
39
|
"csv-parser": "^3.0.0",
|
|
34
40
|
"glob": "^11.0.0",
|
|
35
41
|
"image-size": "^1.1.1",
|
|
36
42
|
"jsdom": "^24.1.0",
|
|
37
|
-
"selenium-webdriver": "^4.22.0"
|
|
38
|
-
"ssg-api": "^1.16.3"
|
|
43
|
+
"selenium-webdriver": "^4.22.0"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
46
|
"@types/jsdom": "^21.1.7",
|
|
42
47
|
"typescript": "^5.6.3",
|
|
43
48
|
"@types/node": "^22.7.4",
|
|
44
49
|
"tsx": "4.17.0",
|
|
45
|
-
"@javarome/testscript": "^0.13.
|
|
50
|
+
"@javarome/testscript": "^0.13.1"
|
|
46
51
|
},
|
|
47
52
|
"keywords": [
|
|
48
53
|
"cms",
|
package/dist/build.js
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { CaseSummaryRenderer, ChronologyReplacerFactory, CsvMapper, EventReplacer, EventReplacerFactory, HttpSource, RR0Mapping, SsiTitleReplaceCommand, Time, TimeElementFactory, TimeLinkDefaultHandler, TimeReplacer, TimeReplacerFactory, TimeService, TimeTextBuilder, TimeUrlBuilder } from "./time";
|
|
2
|
-
import { CaseDirectoryStep, CaseFactory, CaseService } from "./science/index.js";
|
|
3
|
-
import { GooglePlaceService, PlaceReplacerFactory } from "./place/index.js";
|
|
4
|
-
import { OrganizationFactory, OrganizationService } from "./org/index.js";
|
|
5
|
-
import { RR0ContextImpl } from "./RR0Context.js";
|
|
6
|
-
import { CLI, HtmlTable } from "./util/index.js";
|
|
7
|
-
import { AngularExpressionReplaceCommand, ClassDomReplaceCommand, CopyStep, DomReplaceCommand, FileContents, FileUtil, HtAccessToNetlifyConfigReplaceCommand, Ssg, SsiEchoVarReplaceCommand, SsiIfReplaceCommand, SsiIncludeReplaceCommand, SsiLastModifiedReplaceCommand, SsiSetVarReplaceCommand, StringEchoVarReplaceCommand } from "ssg-api";
|
|
8
|
-
import { LanguageReplaceCommand } from "./lang/index.js";
|
|
9
|
-
import { AuthorReplaceCommand, PeopleDirectoryStepFactory, PeopleFactory, PeopleReplacerFactory, PeopleService, WitnessReplacerFactory } from "./people";
|
|
10
|
-
import { PersistentSourceRegistry, SourceFileCounter, SourceIndexStep, SourceRenderer, SourceReplacer, SourceReplacerFactory } from "./source";
|
|
11
|
-
import { NoteFileCounter, NoteRenderer, NoteReplacer, NoteReplacerFactory } from "./note/index.js";
|
|
12
|
-
import { AnchorReplaceCommand, CaseAnchorHandler, DataAnchorHandler } from "./anchor/index.js";
|
|
13
|
-
import { MetaLinkReplaceCommand } from "./MetaLinkReplaceCommand.js";
|
|
14
|
-
import { OutlineReplaceCommand } from "./outline/index.js";
|
|
15
|
-
import { ImageCommand } from "./ImageCommand.js";
|
|
16
|
-
import { SearchIndexStep, SearchVisitor } from "./search/index.js";
|
|
17
|
-
import { BaseReplaceCommand } from "./BaseReplaceCommand.js";
|
|
18
|
-
import { OpenGraphCommand } from "./OpenGraphCommand.js";
|
|
19
|
-
import { DescriptionReplaceCommand } from "./DescriptionReplaceCommand.js";
|
|
20
|
-
import { BookContentVisitor, BookDirectoryStep } from "./book/index.js";
|
|
21
|
-
import path from "path";
|
|
22
|
-
import { IndexedReplacerFactory } from "./index/IndexedReplacerFactory.js";
|
|
23
|
-
import { APIFactory, CodeReplacerFactory } from "./tech/index.js";
|
|
24
|
-
import { RR0ContentStep } from "./RR0ContentStep.js";
|
|
25
|
-
import { AllDataService, TypedDataFactory } from "./data/index.js";
|
|
26
|
-
import { UnitReplaceCommand } from "./value/index.js";
|
|
27
|
-
import { DefaultContentVisitor } from "./DefaultContentVisitor.js";
|
|
28
|
-
import { RR0EventFactory } from "./event/index.js";
|
|
29
|
-
import fs from "fs";
|
|
30
|
-
import { rr0DefaultCopyright } from "./RR0DefaultCopyright.js";
|
|
31
|
-
import { glob } from "glob";
|
|
32
|
-
import { TimeContext } from "@rr0/time";
|
|
33
|
-
console.time("ssg");
|
|
34
|
-
let args = new CLI().getArgs();
|
|
35
|
-
const configFile = args.config;
|
|
36
|
-
if (configFile) {
|
|
37
|
-
args = JSON.parse(FileContents.read(configFile).contents);
|
|
38
|
-
}
|
|
39
|
-
const cliContents = args.contents;
|
|
40
|
-
console.debug("contents", cliContents);
|
|
41
|
-
const mandatoryRoots = ["people/*.html", "science/crypto/ufo/enquete/dossier/*.html"];
|
|
42
|
-
const contentRoots = cliContents
|
|
43
|
-
? cliContents.concat(mandatoryRoots)
|
|
44
|
-
: [
|
|
45
|
-
"croyance/**/*.html",
|
|
46
|
-
"index.html", "404.html", "googlebe03dcf00678bb7c.html", "Contact.html", "Copyright.html", "preambule.html", "FAQ.html", "Referencement.html",
|
|
47
|
-
"time/**/*.html",
|
|
48
|
-
"book/**/*.html",
|
|
49
|
-
"droit/**/*.html",
|
|
50
|
-
"org/**/*.html",
|
|
51
|
-
"people/**/*.html",
|
|
52
|
-
"place/**/*.html",
|
|
53
|
-
"politique/**/*.html",
|
|
54
|
-
"science/**/*.html",
|
|
55
|
-
"tech/**/*.html",
|
|
56
|
-
"udb/*.html",
|
|
57
|
-
"js/**/*.html"
|
|
58
|
-
];
|
|
59
|
-
const copiesArg = args.copies;
|
|
60
|
-
const copies = copiesArg ? copiesArg : [
|
|
61
|
-
"favicon.ico", "manifest.json", "opensearch.xml", "apple-touch-icon.png", "apple-touch-icon_400x400.png", "screenshot1.jpg",
|
|
62
|
-
"rr0.css", "map.css", "diagram.css", "print.css", "figure.css", "section.css", "table.css", "nav.css",
|
|
63
|
-
// "**/*.png", "**/*.jpg", "**/*.gif", "**/*.webp", "!out/**/*",
|
|
64
|
-
"**/*.cmmn", "**/*.bpmn",
|
|
65
|
-
"tech/info/soft/reseau/protocole/index.js", "tech/info/soft/reseau/protocole/ports.json", "tech/info/soft/reseau/protocole/index.css",
|
|
66
|
-
"tech/info/soft/data/doc/index.js", "tech/info/soft/data/doc/index.json", "tech/info/soft/data/doc/index.css",
|
|
67
|
-
"people/index.js", "people/index.css", "people/witness/index.css",
|
|
68
|
-
"search/SearchComponent.mjs", "search/index.json", "search/search.css",
|
|
69
|
-
"source/index.css", "note/index.css",
|
|
70
|
-
"link.css", "quote.css",
|
|
71
|
-
"time/DualRangeComponent.mjs",
|
|
72
|
-
"index/index.js", "lang/form.js", "lang/form.css", "lang/speech.js", "lang/speech.css",
|
|
73
|
-
"croyance/divin/theisme/mono/livre/islam/coran/index.js"
|
|
74
|
-
];
|
|
75
|
-
const outDir = "out";
|
|
76
|
-
const config = {
|
|
77
|
-
getOutputPath(context) {
|
|
78
|
-
return path.join(outDir, context.file.name);
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const outputFunc = async (context, outFile) => {
|
|
82
|
-
try {
|
|
83
|
-
context.file.contents = context.file.serialize();
|
|
84
|
-
context.log("Writing", outFile.name);
|
|
85
|
-
await outFile.write();
|
|
86
|
-
context.file.contents = outFile.contents;
|
|
87
|
-
}
|
|
88
|
-
catch (e) {
|
|
89
|
-
context.error(outFile.name, e);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
const timeFormat = {
|
|
93
|
-
year: "numeric",
|
|
94
|
-
month: "long",
|
|
95
|
-
day: "numeric",
|
|
96
|
-
weekday: "long",
|
|
97
|
-
hour: "2-digit",
|
|
98
|
-
minute: "2-digit"
|
|
99
|
-
};
|
|
100
|
-
const timeContext = new TimeContext();
|
|
101
|
-
const context = new RR0ContextImpl("fr", timeContext, config);
|
|
102
|
-
context.setVar("mail", "rr0@rr0.org");
|
|
103
|
-
const siteBaseUrl = "https://rr0.org/";
|
|
104
|
-
const eventFactory = new RR0EventFactory();
|
|
105
|
-
const sightingFactory = new TypedDataFactory(eventFactory, "sighting", ["index"]);
|
|
106
|
-
const orgFactory = new OrganizationFactory(eventFactory);
|
|
107
|
-
const caseFactory = new CaseFactory(eventFactory);
|
|
108
|
-
const peopleFactory = new PeopleFactory(eventFactory);
|
|
109
|
-
const apiFactory = new APIFactory(eventFactory);
|
|
110
|
-
const bookFactory = new TypedDataFactory(eventFactory, "book");
|
|
111
|
-
const articleFactory = new TypedDataFactory(eventFactory, "article");
|
|
112
|
-
const dataService = new AllDataService([orgFactory, caseFactory, peopleFactory, bookFactory, articleFactory, sightingFactory, apiFactory]);
|
|
113
|
-
dataService.getFromDir("", ["people", "case"]).then(data => {
|
|
114
|
-
console.debug(data);
|
|
115
|
-
});
|
|
116
|
-
const timeOptions = {
|
|
117
|
-
root: "src/time",
|
|
118
|
-
files: []
|
|
119
|
-
};
|
|
120
|
-
const timeTextBuilder = new TimeTextBuilder(timeFormat);
|
|
121
|
-
const timeUrlBuilder = new TimeUrlBuilder({ rootDir: timeOptions.root });
|
|
122
|
-
const timeService = new TimeService(dataService, timeTextBuilder, timeUrlBuilder, timeOptions);
|
|
123
|
-
const googleMapsApiKey = process.env.GOOGLE_MAPS_API_KEY;
|
|
124
|
-
if (!googleMapsApiKey) {
|
|
125
|
-
throw Error("GOOGLE_MAPS_API_KEY is required");
|
|
126
|
-
}
|
|
127
|
-
context.setVar("mapsApiKey", googleMapsApiKey);
|
|
128
|
-
const placeService = new GooglePlaceService("place", googleMapsApiKey);
|
|
129
|
-
const orgService = new OrganizationService([], "org", undefined);
|
|
130
|
-
async function getTimeFiles() {
|
|
131
|
-
const minusYearFiles = await glob("time/-?/?/?/?/index.html");
|
|
132
|
-
const year1Files = await glob("time/?/index.html");
|
|
133
|
-
const year2Files = await glob("time/?/?/index.html");
|
|
134
|
-
const year3Files = await glob("time/?/?/?/index.html");
|
|
135
|
-
const year4Files = await glob("time/?/?/?/?/index.html");
|
|
136
|
-
const monthFiles = await glob("time/?/?/?/?/??/index.html");
|
|
137
|
-
const dayFiles = await glob("time/?/?/?/?/??/??/index.html");
|
|
138
|
-
return year1Files.concat(year2Files).concat(year3Files).concat(year4Files).concat(minusYearFiles).concat(monthFiles).concat(dayFiles).sort();
|
|
139
|
-
}
|
|
140
|
-
getTimeFiles().then(async (timeFiles) => {
|
|
141
|
-
context.setVar("timeFilesCount", timeFiles.length);
|
|
142
|
-
const timeElementFactory = new TimeElementFactory(timeService.renderer);
|
|
143
|
-
const timeReplacer = new TimeReplacer(timeElementFactory);
|
|
144
|
-
const caseFiles = await caseFactory.getFiles();
|
|
145
|
-
const caseService = new CaseService(dataService, caseFactory, timeElementFactory, caseFiles);
|
|
146
|
-
const peopleFiles = await peopleFactory.getFiles();
|
|
147
|
-
const peopleService = new PeopleService(dataService, peopleFactory, peopleFiles);
|
|
148
|
-
const peopleList = await peopleService.getAll();
|
|
149
|
-
context.setVar("peopleFilesCount", peopleList.length);
|
|
150
|
-
const bookMeta = new Map();
|
|
151
|
-
const bookLinks = new Map();
|
|
152
|
-
const ufoCasesStep = await CaseDirectoryStep.create(outputFunc, config, caseService);
|
|
153
|
-
const peopleDirectoryFactory = new PeopleDirectoryStepFactory(outputFunc, config, peopleService);
|
|
154
|
-
const peopleSteps = await peopleDirectoryFactory.create();
|
|
155
|
-
// Publish case.json files so that vraiufo.com will find them
|
|
156
|
-
copies.push(...(ufoCasesStep.config.rootDirs).map(dir => path.join(dir, "case.json")));
|
|
157
|
-
await FileUtil.writeFile(path.join(outDir, "casesDirs.json"), JSON.stringify(ufoCasesStep.config.rootDirs), "utf-8");
|
|
158
|
-
copies.push(...(peopleSteps.reduce((rootDirs, peopleStep) => {
|
|
159
|
-
rootDirs.push(...peopleStep.config.rootDirs);
|
|
160
|
-
return rootDirs;
|
|
161
|
-
}, [])).map(dir => path.join(dir, "people.json")));
|
|
162
|
-
await FileUtil.writeFile(path.join(outDir, "peopleDirs.json"), JSON.stringify(peopleList.map(people => people.dirName)), "utf-8");
|
|
163
|
-
const searchVisitor = new SearchVisitor({ notIndexedUrls: ["404.html", "Referencement.html"], indexWords: false }, timeTextBuilder);
|
|
164
|
-
const sourceRenderer = new SourceRenderer(timeTextBuilder);
|
|
165
|
-
const sourceRegistryFileName = "source/index.json";
|
|
166
|
-
const baseUrl = "https://rr0.org";
|
|
167
|
-
const http = new HttpSource();
|
|
168
|
-
const sourceFactory = new PersistentSourceRegistry(dataService, http, baseUrl, sourceRegistryFileName, timeFormat);
|
|
169
|
-
const noteCounter = new NoteFileCounter();
|
|
170
|
-
const noteRenderer = new NoteRenderer(noteCounter);
|
|
171
|
-
const caseRenderer = new CaseSummaryRenderer(noteRenderer, sourceFactory, sourceRenderer, timeElementFactory);
|
|
172
|
-
// const actions: ChronologyReplacerActions = {read: ["backup", "fetch"], write: ["backup", "pages"]}
|
|
173
|
-
// const actions: ChronologyReplacerActions = {read: [], write: ["backup"]}
|
|
174
|
-
const actions = { read: ["fetch"], write: ["backup"] };
|
|
175
|
-
const rr0Mapping = new RR0Mapping(actions);
|
|
176
|
-
const databaseAggregationCommand = new DomReplaceCommand(".contents ul", new ChronologyReplacerFactory(timeService, [rr0Mapping /*new GeipanRR0Mapping(actions)
|
|
177
|
-
/*, baseOvniFranceRR0Mapping, fuforaRR0Mapping, nuforcRR0Mapping, urecatRR0Mapping*/
|
|
178
|
-
], caseRenderer));
|
|
179
|
-
const timeDefaultHandler = (context) => {
|
|
180
|
-
let title;
|
|
181
|
-
title = Time.titleFromFile(context, context.file.name, timeTextBuilder);
|
|
182
|
-
return title;
|
|
183
|
-
};
|
|
184
|
-
const pageReplaceCommands = [
|
|
185
|
-
new BaseReplaceCommand("/"),
|
|
186
|
-
new LanguageReplaceCommand(),
|
|
187
|
-
new SsiEchoVarReplaceCommand("copyright", [rr0DefaultCopyright]),
|
|
188
|
-
new StringEchoVarReplaceCommand(),
|
|
189
|
-
new AngularExpressionReplaceCommand(),
|
|
190
|
-
new SsiIfReplaceCommand(),
|
|
191
|
-
new SsiSetVarReplaceCommand("title", (_match, ...args) => `<title>${args[0]}</title>`),
|
|
192
|
-
new SsiSetVarReplaceCommand("url", (_match, ...args) => `<meta name="url" content="${args[0]}"/>`),
|
|
193
|
-
new SsiLastModifiedReplaceCommand(timeFormat),
|
|
194
|
-
new SsiTitleReplaceCommand([timeDefaultHandler]),
|
|
195
|
-
new DescriptionReplaceCommand("UFO data for french-reading people", "abstract"),
|
|
196
|
-
new AuthorReplaceCommand(timeService)
|
|
197
|
-
];
|
|
198
|
-
// const sourceCounter = new SourceFileCounter()
|
|
199
|
-
const sourceCounter = new SourceFileCounter();
|
|
200
|
-
const sourceReplacer = new SourceReplacer(sourceRenderer, sourceFactory, sourceCounter);
|
|
201
|
-
const sourceReplacerFactory = new SourceReplacerFactory(sourceReplacer);
|
|
202
|
-
const noteReplacer = new NoteReplacer(noteRenderer);
|
|
203
|
-
const noteReplacerFactory = new NoteReplacerFactory(noteReplacer);
|
|
204
|
-
const eventReplacer = new EventReplacer(caseRenderer, dataService);
|
|
205
|
-
const contentsReplaceCommand = [
|
|
206
|
-
new ClassDomReplaceCommand(new EventReplacerFactory(eventReplacer), "event"),
|
|
207
|
-
new ClassDomReplaceCommand(sourceReplacerFactory, "source"),
|
|
208
|
-
new DomReplaceCommand("time", new TimeReplacerFactory(timeReplacer)),
|
|
209
|
-
new DomReplaceCommand("code", new CodeReplacerFactory()),
|
|
210
|
-
new ClassDomReplaceCommand(new PeopleReplacerFactory(peopleService), "people"),
|
|
211
|
-
new ClassDomReplaceCommand(new PlaceReplacerFactory(), "place"),
|
|
212
|
-
new ClassDomReplaceCommand(new WitnessReplacerFactory(), "temoin", "temoin1", "temoin2", "temoin3"),
|
|
213
|
-
new ClassDomReplaceCommand(noteReplacerFactory, "note"),
|
|
214
|
-
new ClassDomReplaceCommand(new IndexedReplacerFactory(), "indexed"),
|
|
215
|
-
new UnitReplaceCommand(),
|
|
216
|
-
new MetaLinkReplaceCommand(new TimeLinkDefaultHandler(timeService, timeTextBuilder)),
|
|
217
|
-
databaseAggregationCommand
|
|
218
|
-
];
|
|
219
|
-
const ssg = new Ssg(config);
|
|
220
|
-
const getOutputPath = (context) => path.join(outDir, context.file.name);
|
|
221
|
-
const force = args.force === "true";
|
|
222
|
-
const toProcess = new Set(["people/index.html", "people/witness/index.html", "people/militaires.html", "people/scientifiques.html", "people/astronomes.html", "people/politicians.html", "people/dirigeants.html", "people/pilotes.html", "people/contactes.html", "people/ufologues.html", "tech/info/Personnes.html", "people/Contributeurs.html"]);
|
|
223
|
-
const csvTransformer = new class {
|
|
224
|
-
transform(context, file) {
|
|
225
|
-
const fileName = file.name;
|
|
226
|
-
if (!fileName.endsWith(".csv")) {
|
|
227
|
-
return undefined;
|
|
228
|
-
}
|
|
229
|
-
const csv = fs.readFileSync(fileName, { encoding: "utf-8" });
|
|
230
|
-
const headers = [];
|
|
231
|
-
const obj = new CsvMapper().parse(csv, headers);
|
|
232
|
-
return HtmlTable.create(obj, headers);
|
|
233
|
-
}
|
|
234
|
-
}();
|
|
235
|
-
const htAccessToNetlifyConfig = {
|
|
236
|
-
replacements: [new HtAccessToNetlifyConfigReplaceCommand(siteBaseUrl)],
|
|
237
|
-
roots: [".htaccess"],
|
|
238
|
-
getOutputPath(_context) {
|
|
239
|
-
return path.join(outDir, "netlify.toml");
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
const includeStep = new RR0ContentStep([htAccessToNetlifyConfig, {
|
|
243
|
-
roots: contentRoots,
|
|
244
|
-
replacements: [new SsiIncludeReplaceCommand([csvTransformer])],
|
|
245
|
-
getOutputPath
|
|
246
|
-
}], outputFunc, [], [], force, "content includes", toProcess);
|
|
247
|
-
ssg.add(includeStep);
|
|
248
|
-
ssg.add(ufoCasesStep);
|
|
249
|
-
ssg.add(...peopleSteps);
|
|
250
|
-
if (contentRoots) {
|
|
251
|
-
const contentVisitor = new DefaultContentVisitor(dataService, caseRenderer, timeElementFactory);
|
|
252
|
-
const contentVisitors = [contentVisitor, searchVisitor];
|
|
253
|
-
if (args.books) {
|
|
254
|
-
contentVisitors.push(new BookContentVisitor(bookMeta, bookLinks));
|
|
255
|
-
}
|
|
256
|
-
const contentReplacements = [
|
|
257
|
-
...pageReplaceCommands,
|
|
258
|
-
...contentsReplaceCommand,
|
|
259
|
-
new OutlineReplaceCommand(),
|
|
260
|
-
new AnchorReplaceCommand(siteBaseUrl, [new CaseAnchorHandler(caseService, timeTextBuilder), new DataAnchorHandler(dataService)]),
|
|
261
|
-
new ImageCommand(outDir, 275, 500),
|
|
262
|
-
new OpenGraphCommand(outDir, timeFiles, baseUrl, timeTextBuilder)
|
|
263
|
-
];
|
|
264
|
-
ssg.add(new RR0ContentStep([{ roots: contentRoots, replacements: contentReplacements, getOutputPath }], outputFunc, [], contentVisitors, force, "contents replacements", toProcess));
|
|
265
|
-
}
|
|
266
|
-
if (args.books) {
|
|
267
|
-
ssg.add(await BookDirectoryStep.create(outputFunc, config, bookMeta, bookLinks));
|
|
268
|
-
}
|
|
269
|
-
const reindex = args.reindex;
|
|
270
|
-
if (reindex === null || reindex === void 0 ? void 0 : reindex.includes("search")) {
|
|
271
|
-
ssg.add(new SearchIndexStep("search/index.json", searchVisitor));
|
|
272
|
-
}
|
|
273
|
-
if (reindex === null || reindex === void 0 ? void 0 : reindex.includes("sources")) {
|
|
274
|
-
ssg.add(new SourceIndexStep(sourceRegistryFileName, sourceFactory));
|
|
275
|
-
}
|
|
276
|
-
if (copies) {
|
|
277
|
-
const copyConfig = {
|
|
278
|
-
getOutputPath,
|
|
279
|
-
sourcePatterns: copies,
|
|
280
|
-
options: { ignore: ["node_modules/**", "out/**"] }
|
|
281
|
-
};
|
|
282
|
-
ssg.add(new CopyStep(copyConfig));
|
|
283
|
-
}
|
|
284
|
-
try {
|
|
285
|
-
const result = await ssg.start(context);
|
|
286
|
-
context.log("Completed", result);
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
try {
|
|
290
|
-
context.error(err, context.file.name);
|
|
291
|
-
}
|
|
292
|
-
catch (e) {
|
|
293
|
-
context.error(err);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
finally {
|
|
297
|
-
console.timeEnd("ssg");
|
|
298
|
-
}
|
|
299
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RR0Data } from "./RR0Data.js";
|
|
2
|
-
import { RR0DataFactory } from "./RR0DataFactory.js";
|
|
3
|
-
import { RR0EventFactory } from "../event/RR0EventFactory.js";
|
|
4
|
-
import { RR0Event } from "../event/RR0Event.js";
|
|
5
|
-
import { TimeContext } from "@rr0/time";
|
|
6
|
-
export declare class AbstractDataFactory<T extends RR0Data> implements RR0DataFactory<T> {
|
|
7
|
-
protected eventFactory: RR0EventFactory;
|
|
8
|
-
static readonly defaultImageFileNames: string[];
|
|
9
|
-
/**
|
|
10
|
-
* @param eventFactory The factory to create sub-events.
|
|
11
|
-
*/
|
|
12
|
-
constructor(eventFactory: RR0EventFactory);
|
|
13
|
-
createTimeFromString(timeStr: string): TimeContext | undefined;
|
|
14
|
-
createFromData(data: RR0Data): T;
|
|
15
|
-
protected parseEvents(events: RR0Data[], defaultParent: RR0Data): RR0Event[];
|
|
16
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import fs from "fs";
|
|
3
|
-
import { TimeContext } from "@rr0/time";
|
|
4
|
-
export class AbstractDataFactory {
|
|
5
|
-
/**
|
|
6
|
-
* @param eventFactory The factory to create sub-events.
|
|
7
|
-
*/
|
|
8
|
-
constructor(eventFactory) {
|
|
9
|
-
this.eventFactory = eventFactory;
|
|
10
|
-
}
|
|
11
|
-
createTimeFromString(timeStr) {
|
|
12
|
-
if (timeStr instanceof TimeContext) {
|
|
13
|
-
return timeStr;
|
|
14
|
-
}
|
|
15
|
-
if (timeStr) {
|
|
16
|
-
const time = new TimeContext();
|
|
17
|
-
time.updateFromStr(timeStr);
|
|
18
|
-
return time;
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return undefined;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
createFromData(data) {
|
|
25
|
-
data.time = this.createTimeFromString(data.time);
|
|
26
|
-
const events = data.events || [];
|
|
27
|
-
const birthTime = data.birthTime;
|
|
28
|
-
if (birthTime) {
|
|
29
|
-
delete data.birthTime;
|
|
30
|
-
events.push({ type: "birth", time: birthTime, events: [] });
|
|
31
|
-
}
|
|
32
|
-
const deathTime = data.deathTime;
|
|
33
|
-
if (deathTime) {
|
|
34
|
-
delete data.deathTime;
|
|
35
|
-
events.push({ type: "death", time: deathTime, events: [] });
|
|
36
|
-
}
|
|
37
|
-
if (!data.image) {
|
|
38
|
-
let hasDefaultFile = false;
|
|
39
|
-
for (const defaultImageFile of AbstractDataFactory.defaultImageFileNames) {
|
|
40
|
-
hasDefaultFile = fs.existsSync(path.join(data.dirName, defaultImageFile));
|
|
41
|
-
if (hasDefaultFile) {
|
|
42
|
-
events.push({ type: "image", url: defaultImageFile, name: data.name, events: [] });
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
data.events = this.parseEvents(events, data);
|
|
48
|
-
return data;
|
|
49
|
-
}
|
|
50
|
-
parseEvents(events = [], defaultParent) {
|
|
51
|
-
const parsed = [];
|
|
52
|
-
for (const event of events) {
|
|
53
|
-
event.parent = event.parent || defaultParent;
|
|
54
|
-
const resolvedEvent = this.eventFactory.createFromData(event);
|
|
55
|
-
parsed.push(resolvedEvent);
|
|
56
|
-
}
|
|
57
|
-
return parsed;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
AbstractDataFactory.defaultImageFileNames = ["portrait.jpg", "portrait.gif", "portrait.png", "portrait.webp"];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AllDataService } from "./AllDataService.js";
|
|
2
|
-
import { TypedDataFactory } from "./TypedDataFactory.js";
|
|
3
|
-
import { RR0Data } from "./RR0Data.js";
|
|
4
|
-
import { RR0Case } from "../science/crypto/ufo/enquete/dossier/RR0Case.js";
|
|
5
|
-
export declare abstract class AbstractDataService<T extends RR0Data> {
|
|
6
|
-
protected readonly dataService: AllDataService;
|
|
7
|
-
protected factory: TypedDataFactory<T>;
|
|
8
|
-
readonly files: string[];
|
|
9
|
-
protected constructor(dataService: AllDataService, factory: TypedDataFactory<T>, files: string[]);
|
|
10
|
-
get type(): string;
|
|
11
|
-
get(path: string): Promise<RR0Case[] | undefined>;
|
|
12
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class AbstractDataService {
|
|
2
|
-
constructor(dataService, factory, files) {
|
|
3
|
-
this.dataService = dataService;
|
|
4
|
-
this.factory = factory;
|
|
5
|
-
this.files = files;
|
|
6
|
-
}
|
|
7
|
-
get type() {
|
|
8
|
-
return this.factory.type;
|
|
9
|
-
}
|
|
10
|
-
async get(path) {
|
|
11
|
-
return this.dataService.getFromDir(path, [this.type, undefined], [this.type + ".json"]);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { RR0Data } from "./RR0Data.js";
|
|
2
|
-
import { TypedDataFactory } from "./TypedDataFactory.js";
|
|
3
|
-
/**
|
|
4
|
-
* Fetch RR0 data from JSON files.
|
|
5
|
-
*/
|
|
6
|
-
export declare class AllDataService {
|
|
7
|
-
readonly factories: TypedDataFactory<RR0Data>[];
|
|
8
|
-
readonly pathToData: Map<string, RR0Data[]>;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param factories The factories to instantiate different RR0Data types.
|
|
12
|
-
*/
|
|
13
|
-
constructor(factories: TypedDataFactory<RR0Data>[]);
|
|
14
|
-
getFromDir<T extends RR0Data = RR0Data>(dirName: string, types: string[], fileNames?: string[]): Promise<T[]>;
|
|
15
|
-
protected read<T extends RR0Data = RR0Data>(dirName: string, fileNames: string[]): Promise<T[]>;
|
|
16
|
-
}
|