From 7c3c22fcb0e5020092a0a7fcf4276d2e529418d2 Mon Sep 17 00:00:00 2001 From: "H. C. Kruse" Date: Sat, 13 Dec 2025 13:41:07 +0100 Subject: [PATCH 01/30] wip: v3 --- .dockerignore | 6 - .env.ci | 15 - .gitattributes | 14 +- .gitignore | 35 +- .gitmodules | 6 - .phpcs.xml | 35 - Dockerfile | 104 - LICENSE | 21 - app/Console/Commands/AbstractQueueCommand.php | 81 - app/Console/Commands/PopulateData.php | 69 - .../Rsi/CommLink/AbstractCommLinkCommand.php | 33 - .../Rsi/CommLink/CommLinkSchedule.php | 42 - .../CommLink/Download/DownloadCommLink.php | 102 - .../Download/DownloadCommLinkImages.php | 42 - .../CommLink/Download/ReDownloadCommLinks.php | 51 - .../CommLink/Image/ComputeSimilarImageIds.php | 57 - .../Rsi/CommLink/Image/CreateImageHashes.php | 73 - .../CommLink/Image/CreateImageMetadata.php | 57 - .../Rsi/CommLink/Image/SyncImageIds.php | 40 - .../Commands/Rsi/CommLink/ImportCommLink.php | 72 - .../Rsi/CommLink/TranslateCommLinks.php | 48 - .../CommLink/Wiki/CreateCommLinkWikiPages.php | 36 - .../CreateCommLinkWikiTranslationPages.php | 36 - .../Commands/SC/ComputeItemBaseIds.php | 30 - app/Console/Commands/SC/ImportClothing.php | 38 - app/Console/Commands/SC/ImportFactions.php | 56 - app/Console/Commands/SC/ImportItems.php | 126 - app/Console/Commands/SC/ImportMissions.php | 299 - .../Commands/SC/ImportPersonalWeapons.php | 38 - app/Console/Commands/SC/ImportShops.php | 38 - .../Commands/SC/ImportVehicleItems.php | 38 - app/Console/Commands/SC/ImportVehicles.php | 126 - app/Console/Commands/SC/TranslateItems.php | 43 - .../SC/Wiki/AbstractCreateWikiPage.php | 153 - .../SC/Wiki/CreateCharArmorWikiPages.php | 180 - .../SC/Wiki/CreateClothingWikiPages.php | 44 - .../SC/Wiki/CreateCommodityWikiPages.php | 238 - .../Commands/SC/Wiki/CreateFoodWikiPages.php | 93 - .../SC/Wiki/CreateShipItemWikiPages.php | 153 - .../Wiki/CreateWeaponAttachmentWikiPages.php | 125 - .../SC/Wiki/CreateWeaponWikiPages.php | 180 - .../Commands/SC/Wiki/UploadItemImages.php | 248 - .../Galactapedia/ImportArticleProperties.php | 4 +- .../Galactapedia/ImportArticles.php | 4 +- .../Galactapedia/TranslateArticles.php | 4 +- .../Galactapedia/Wiki/ApproveArticles.php | 51 - .../Galactapedia/Wiki/CreateWikiPages.php | 37 - .../Galactapedia/Wiki/UploadImages.php | 48 - .../ShipMatrix/DownloadShipMatrix.php | 64 - .../ShipMatrix/ImportShipMatrix.php | 45 - .../StarCitizen/Starmap/TranslateSystems.php | 4 +- .../StarCitizen/Vehicle/ImportLoaner.php | 6 +- .../StarCitizen/Vehicle/ImportMsrp.php | 6 +- .../StarCitizen/Vehicle/ImportShipMatrix.php | 37 + .../Commands/Transcript/ImportMetadata.php | 35 - .../Transcript/TranslateTranscripts.php | 39 - app/Console/Kernel.php | 286 - app/Contracts/HasChangelogsInterface.php | 21 - .../Web/User/AuthRepositoryInterface.php | 37 - app/Events/ApiRouteCalled.php | 28 - app/Events/ModelUpdating.php | 33 - app/Events/Rsi/CommLink/CommLinksChanged.php | 33 - .../Rsi/CommLink/NewCommLinksDownloaded.php | 33 - .../ShipMatrix/ShipMatrixStructureChanged.php | 16 - app/Exceptions/Handler.php | 129 - app/Exceptions/InvalidDataException.php | 13 - .../Controllers/Api/AbstractApiController.php | 336 - .../CommLink/Category/CategoryController.php | 95 - .../CommLink/Channel/ChannelController.php | 95 - .../V1/Rsi/CommLink/CommLinkController.php | 151 - .../Rsi/CommLink/CommLinkSearchController.php | 387 - .../Rsi/CommLink/Series/SeriesController.php | 95 - .../Rsi/Transcript/TranscriptController.php | 180 - .../Galactapedia/GalactapediaController.php | 206 - .../Manufacturer/ManufacturerController.php | 212 - .../CelestialObjectController.php | 68 - .../Starsystem/StarsystemController.php | 201 - .../V1/StarCitizen/Stat/StatController.php | 67 - .../StarCitizen/Vehicle/VehicleController.php | 223 - .../CharArmor/CharArmorController.php | 58 - .../CharArmorController.php | 58 - .../ClothingController.php | 58 - .../V1/StarCitizenUnpacked/FoodController.php | 58 - .../Item/ItemController.php | 249 - .../Ship/CoolerController.php | 59 - .../Ship/ItemController.php | 106 - .../Ship/PowerPlantController.php | 59 - .../Ship/QuantumDriveController.php | 59 - .../Ship/ShieldController.php | 59 - .../Ship/WeaponController.php | 59 - .../Shop/ShopController.php | 340 - .../WeaponPersonal/AttachmentController.php | 57 - .../WeaponPersonalController.php | 60 - .../Api/V2/AbstractApiV2Controller.php | 227 - .../V2/Rsi/CommLink/CommLinkController.php | 137 - .../Rsi/CommLink/CommLinkSearchController.php | 375 - .../Api/V2/Rsi/CommLink/ImageController.php | 117 - .../Api/V2/SC/Char/ArmorController.php | 137 - .../Api/V2/SC/Char/ClothesController.php | 110 - .../PersonalWeaponController.php | 136 - .../WeaponAttachmentController.php | 101 - .../Api/V2/SC/FactionController.php | 95 - .../Controllers/Api/V2/SC/FoodController.php | 105 - .../Controllers/Api/V2/SC/ItemController.php | 223 - .../Api/V2/SC/ManufacturerController.php | 145 - .../Api/V2/SC/MissionController.php | 102 - .../Api/V2/SC/MissionGiverController.php | 88 - .../Controllers/Api/V2/SC/ShopController.php | 110 - .../Api/V2/SC/Vehicle/VehicleController.php | 236 - .../V2/SC/Vehicle/VehicleItemController.php | 124 - .../V2/SC/Vehicle/VehicleWeaponController.php | 113 - .../V2/StarCitizen/GalactapediaController.php | 194 - .../Starmap/CelestialObjectController.php | 79 - .../Starmap/StarsystemController.php | 78 - .../Api/V2/StarCitizen/StatController.php | 62 - .../Api/V3/SC/Vehicle/VehicleController.php | 188 - app/Http/Controllers/Controller.php | 24 +- .../Web/Account/AccountController.php | 79 - .../Controllers/Web/Auth/LoginController.php | 131 - .../Web/Changelog/ChangelogController.php | 66 - .../Controllers/Web/DashboardController.php | 153 - .../Controllers/Web/Job/JobController.php | 72 - .../Web/Job/Rsi/CommLink/JobController.php | 112 - .../Controllers/Web/Job/SC/JobController.php | 114 - .../Galactapedia/JobController.php | 97 - .../Job/StarCitizen/Vehicle/JobController.php | 78 - .../Web/Job/Wiki/CommLink/JobController.php | 67 - .../CommLink/Category/CategoryController.php | 64 - .../CommLink/Channel/ChannelController.php | 64 - .../Web/Rsi/CommLink/CommLinkController.php | 229 - .../Rsi/CommLink/CommLinkSearchController.php | 151 - .../Rsi/CommLink/Image/ImageController.php | 205 - .../Web/Rsi/CommLink/Image/TagController.php | 108 - .../Rsi/CommLink/Series/SeriesController.php | 64 - .../Web/Rsi/Stat/StatController.php | 62 - .../Galactapedia/GalactapediaController.php | 55 - .../Manufacturer/ManufacturerController.php | 112 - .../ProductionNoteController.php | 97 - .../ProductionStatusController.php | 96 - .../CelestialObjectController.php | 25 - .../Starsystem/StarsystemController.php | 35 - .../Vehicle/Focus/FocusController.php | 97 - .../GroundVehicle/GroundVehicleController.php | 99 - .../Vehicle/Ship/ShipController.php | 95 - .../Vehicle/Size/SizeController.php | 97 - .../Vehicle/Type/TypeController.php | 97 - .../Item/ItemController.php | 31 - .../StarCitizenUnpacked/VehicleController.php | 19 - .../Web/Transcript/TranscriptController.php | 117 - .../Controllers/Web/User/UserController.php | 135 - app/Http/Filters/ImageTagFilter.php | 20 - app/Http/Filters/ItemVariantsFilter.php | 19 - app/Http/Kernel.php | 96 - app/Http/Middleware/CheckUserState.php | 44 - app/Http/Middleware/EncryptCookies.php | 20 - app/Http/Middleware/ForceJsonResponse.php | 22 - app/Http/Middleware/FormatApiResponse.php | 28 - app/Http/Middleware/SetPreferredLocale.php | 33 - app/Http/Middleware/TrimStrings.php | 20 - app/Http/Middleware/TrustProxies.php | 33 - app/Http/Middleware/VerifyCsrfToken.php | 20 - .../Web/RedirectIfAuthenticated.php | 30 - app/Http/Requests/AbstractSearchRequest.php | 28 - .../Requests/Rsi/CommLink/CommLinkRequest.php | 38 - .../Rsi/CommLink/CommLinkSearchRequest.php | 29 - .../CommLink/Image/AddImageTagsRequest.php | 33 - .../Rsi/CommLink/Image/ImageSearchRequest.php | 9 - .../Rsi/CommLink/Image/ImageUploadRequest.php | 49 - .../Rsi/CommLink/Image/NewImageTagRequest.php | 36 - .../Rsi/CommLink/Image/TagUpdateRequest.php | 40 - .../ReverseImageLinkSearchRequest.php | 36 - .../CommLink/ReverseImageSearchRequest.php | 33 - .../GalactapediaSearchRequest.php | 9 - .../ManufacturerSearchRequest.php | 9 - .../ManufacturerTranslationRequest.php | 45 - .../StarCitizen/Starmap/StarsystemRequest.php | 9 - .../Vehicle/VehicleSearchRequest.php | 9 - .../StarCitizenUnpacked/ItemSearchRequest.php | 9 - .../Requests/System/TranslationRequest.php | 43 - .../Transcript/TranscriptUpdateRequest.php | 30 - app/Http/Resources/AbstractBaseResource.php | 2 +- .../Item/ItemDescriptionDataResource.php | 4 +- .../Game/Item/ItemDimensionResource.php | 108 + .../Game/Item/ItemDurabilityResource.php | 35 + .../Game/Item/ItemHeatConnectionResource.php | 73 + .../Game/Item/ItemInventoryResource.php | 64 + .../Resources/Game/Item/ItemPortResource.php | 100 + .../Item/ItemPortTypeResource.php | 11 +- .../Game/Item/ItemPowerConnectionResource.php | 54 + .../ItemSpecification/ClothingResource.php | 142 + .../Manufacturer/ManufacturerLinkResource.php | 31 + .../Manufacturer/ManufacturerResource.php | 20 +- .../AmmunitionDamageFalloffResource.php | 38 - .../AmmunitionPiercabilityResource.php | 33 - .../SC/Ammunition/AmmunitionResource.php | 48 - .../ClothingRadiationResistanceResource.php | 40 - .../SC/Char/ClothingResistanceResource.php | 42 - .../Resources/SC/Char/ClothingResource.php | 91 - .../PersonalWeapon/BarrelAttachResource.php | 28 - .../Char/PersonalWeapon/GrenadeResource.php | 42 - .../Char/PersonalWeapon/IronSightResource.php | 40 - .../SC/Char/PersonalWeapon/KnifeResource.php | 42 - .../PersonalWeaponAttachmentResource.php | 58 - .../PersonalWeaponMagazineResource.php | 32 - .../PersonalWeapon/PersonalWeaponResource.php | 80 - .../SC/Faction/FactionLinkResource.php | 31 - .../SC/Faction/FactionRelationResource.php | 32 - .../Resources/SC/Faction/FactionResource.php | 43 - app/Http/Resources/SC/FoodResource.php | 64 - .../SC/Item/ItemContainerResource.php | 54 - .../SC/Item/ItemDimensionResource.php | 57 - .../SC/Item/ItemDistortionDataResource.php | 39 - .../SC/Item/ItemDurabilityDataResource.php | 33 - .../SC/Item/ItemHeatDataResource.php | 65 - .../Resources/SC/Item/ItemPortResource.php | 57 - .../SC/Item/ItemPowerDataResource.php | 49 - app/Http/Resources/SC/Item/ItemResource.php | 501 - .../Item/ItemWeaponModifierDataResource.php | 135 - .../SC/ItemSpecification/ArmorResource.php | 44 - .../SC/ItemSpecification/BombResource.php | 46 - .../SC/ItemSpecification/CoolerResource.php | 31 - .../SC/ItemSpecification/EmpResource.php | 33 - .../FlightControllerResource.php | 35 - .../ItemSpecification/FuelIntakeResource.php | 29 - .../SC/ItemSpecification/FuelTankResource.php | 31 - .../ItemSpecification/HackingChipResource.php | 31 - .../MiningLaserModifierResource.php | 31 - .../MiningLaser/MiningLaserResource.php | 74 - .../MiningModuleResource.php | 38 - .../SC/ItemSpecification/MissileResource.php | 56 - .../ItemSpecification/PowerPlantResource.php | 27 - .../QuantumDrive/QuantumDriveModeResource.php | 51 - .../QuantumDrive/QuantumDriveResource.php | 51 - .../QuantumInterdictionGeneratorResource.php | 35 - .../SalvageModifierResource.php | 31 - .../SelfDestructResource.php | 37 - .../SC/ItemSpecification/ShieldResource.php | 39 - .../SC/ItemSpecification/ThrusterResource.php | 33 - .../ItemSpecification/TractorBeamResource.php | 45 - .../Manufacturer/ManufacturerLinkResource.php | 47 - .../MeleeCombatConfigResource.php | 49 - .../MeleeCombatConfig/MeleeDamageResource.php | 30 - .../Resources/SC/Mission/DeadlineResource.php | 31 - .../SC/Mission/GiverLinkResource.php | 29 - .../Resources/SC/Mission/GiverResource.php | 58 - .../SC/Mission/MissionLinkResource.php | 29 - .../Resources/SC/Mission/MissionResource.php | 140 - .../Resources/SC/Mission/RewardResource.php | 33 - .../Resources/SC/Shop/ShopItemResource.php | 85 - .../Resources/SC/Shop/ShopLinkResource.php | 40 - app/Http/Resources/SC/Shop/ShopResource.php | 57 - .../SC/Vehicle/HardpointItemResource.php | 79 - .../SC/Vehicle/HardpointItemResourceV3.php | 79 - .../SC/Vehicle/HardpointResource.php | 101 - .../SC/Vehicle/HardpointResourceV3.php | 103 - .../Resources/SC/Vehicle/VehicleCargoGrid.php | 69 - .../SC/Vehicle/VehicleItemLinkResource.php | 51 - .../SC/Vehicle/VehicleItemResource.php | 155 - .../SC/Vehicle/VehicleLinkResource.php | 46 - .../SC/Vehicle/VehiclePartResource.php | 33 - .../Resources/SC/Vehicle/VehicleResource.php | 599 - .../SC/Vehicle/VehicleResourceV3.php | 549 - .../Weapon/VehicleWeaponRegenResource.php | 33 - .../Vehicle/Weapon/VehicleWeaponResource.php | 81 - .../SC/Weapon/WeaponModeResource.php | 38 - app/Jobs/AbstractBaseDownloadData.php | 112 - .../CommLink/Download/DownloadCommLink.php | 115 - .../Download/DownloadMissingCommLinks.php | 162 - .../Download/Image/DownloadCommLinkImage.php | 115 - .../Download/Image/DownloadCommLinkImages.php | 45 - .../Download/ReDownloadDbCommLinks.php | 67 - .../CommLink/Image/ComputeSimilarImageIds.php | 50 - .../Rsi/CommLink/Image/CreateImageHash.php | 240 - .../Rsi/CommLink/Image/CreateImageHashes.php | 84 - .../CommLink/Image/CreateImageMetadata.php | 61 - .../CommLink/Image/CreateImageMetadatum.php | 91 - .../Rsi/CommLink/Import/ImportCommLink.php | 420 - .../Rsi/CommLink/Import/ImportCommLinks.php | 104 - app/Jobs/Rsi/CommLink/SyncImageId.php | 81 - app/Jobs/Rsi/CommLink/SyncImageIds.php | 54 - .../CommLink/Translate/TranslateCommLink.php | 106 - .../CommLink/Translate/TranslateCommLinks.php | 92 - app/Jobs/SC/ComputeItemBaseIds.php | 67 - .../SC/Import/AbstractItemCreationJob.php | 18 - app/Jobs/SC/Import/Ammunition.php | 70 - app/Jobs/SC/Import/Clothing.php | 74 - app/Jobs/SC/Import/Food.php | 57 - app/Jobs/SC/Import/Grenade.php | 45 - app/Jobs/SC/Import/HackingChip.php | 45 - app/Jobs/SC/Import/Item.php | 352 - .../SC/Import/ItemSpecificationCreator.php | 97 - app/Jobs/SC/Import/Knife.php | 79 - app/Jobs/SC/Import/MiningLaser.php | 47 - app/Jobs/SC/Import/MiningModule.php | 43 - app/Jobs/SC/Import/PersonalWeapon.php | 98 - app/Jobs/SC/Import/ShopItems.php | 104 - app/Jobs/SC/Import/Vehicle.php | 507 - app/Jobs/SC/Import/VehicleItem.php | 508 - app/Jobs/SC/Import/WeaponAttachment.php | 67 - app/Jobs/SC/Import/WeaponModifier.php | 83 - app/Jobs/SC/TranslateItem.php | 77 - .../StarCitizen/Stat/Import/ImportStat.php | 2 +- .../Vehicle/CheckShipMatrixStructure.php | 64 - .../Vehicle/DownloadShipMatrix.php | 103 - .../Vehicle/Import/ImportShipMatrix.php | 97 - .../Vehicle/{Import => }/ImportLoaner.php | 2 +- .../Vehicle/{Import => }/ImportMsrp.php | 2 +- .../StarCitizen/Vehicle/ImportShipMatrix.php | 151 + .../Vehicle/{Import => }/ImportVehicle.php | 13 +- app/Jobs/TrackApiRouteCall.php | 51 - app/Jobs/Transcript/ImportMetadata.php | 103 - .../Translate/TranslateTranscript.php | 99 - .../Translate/TranslateTranscripts.php | 61 - app/Jobs/Wiki/ApproveRevisions.php | 202 - .../Wiki/CommLink/CreateCommLinkWikiPage.php | 120 - .../Wiki/CommLink/CreateCommLinkWikiPages.php | 141 - .../CreateCommLinkWikiTranslationPages.php | 88 - .../UpdateCommLinkProofReadStatus.php | 99 - .../CreateGalactapediaWikiPage.php | 508 - .../CreateGalactapediaWikiPages.php | 73 - .../UploadGalactapediaWikiImages.php | 142 - .../Transcript/CreateTranscriptWikiPage.php | 90 - .../Transcript/CreateTranscriptWikiPages.php | 89 - .../UpdateTranscriptProofReadStatus.php | 98 - app/Listeners/AddApiRouteTrackingJob.php | 24 - app/Listeners/LogSuccessfulLogin.php | 24 - app/Listeners/ModelUpdating.php | 149 - .../SendCommLinksChangedNotification.php | 28 - ...SendNewCommLinksDownloadedNotification.php | 38 - ...ShipMatrixStructureChangedNotification.php | 24 - app/Mail/Rsi/CommLink/CommLinksChanged.php | 48 - .../Rsi/CommLink/NewCommLinksDownloaded.php | 45 - .../ShipMatrixStructureChanged.php | 25 - app/Models/Account/User/User.php | 121 - app/Models/Account/User/UserGroup.php | 65 - app/Models/Account/User/UserSetting.php | 51 - app/Models/Language.php | 42 + .../Rsi/CommLink/{Category => }/Category.php | 3 +- .../Rsi/CommLink/{Channel => }/Channel.php | 3 +- app/Models/Rsi/CommLink/CommLink.php | 25 - app/Models/Rsi/CommLink/Image/Image.php | 2 +- app/Models/Rsi/CommLink/{Link => }/Link.php | 3 +- .../Rsi/CommLink/{Series => }/Series.php | 3 +- app/Models/SC/Ammunition/Ammunition.php | 52 - app/Models/SC/Ammunition/AmmunitionDamage.php | 24 - .../SC/Ammunition/AmmunitionDamageFalloff.php | 33 - .../SC/Ammunition/AmmunitionPiercability.php | 28 - app/Models/SC/Char/Clothing/Armor.php | 22 - app/Models/SC/Char/Clothing/Clothes.php | 28 - app/Models/SC/Char/Clothing/Clothing.php | 136 - .../SC/Char/Clothing/ClothingResistance.php | 27 - .../SC/Char/Clothing/RadiationResistance.php | 24 - app/Models/SC/Char/Grenade.php | 32 - .../SC/Char/PersonalWeapon/Attachment.php | 38 - .../SC/Char/PersonalWeapon/BarrelAttach.php | 28 - .../SC/Char/PersonalWeapon/IronSight.php | 51 - app/Models/SC/Char/PersonalWeapon/Knife.php | 49 - .../SC/Char/PersonalWeapon/PersonalWeapon.php | 110 - .../PersonalWeaponAmmunition.php | 49 - .../PersonalWeaponAmmunitionDamage.php | 32 - .../PersonalWeapon/PersonalWeaponMagazine.php | 36 - .../PersonalWeapon/PersonalWeaponMode.php | 44 - app/Models/SC/CommodityItem.php | 88 - app/Models/SC/EntityTag.php | 29 - app/Models/SC/Faction/Faction.php | 33 - app/Models/SC/Faction/FactionRelation.php | 29 - app/Models/SC/Food/Food.php | 51 - app/Models/SC/Food/FoodEffect.php | 19 - app/Models/SC/Item/Interaction.php | 19 - app/Models/SC/Item/Item.php | 500 - app/Models/SC/Item/ItemContainer.php | 51 - app/Models/SC/Item/ItemDimension.php | 32 - app/Models/SC/Item/ItemDistortionData.php | 35 - app/Models/SC/Item/ItemDurabilityData.php | 29 - app/Models/SC/Item/ItemHeatData.php | 66 - app/Models/SC/Item/ItemPort.php | 94 - app/Models/SC/Item/ItemPortTag.php | 37 - app/Models/SC/Item/ItemPortType.php | 35 - app/Models/SC/Item/ItemPortTypeSubType.php | 29 - app/Models/SC/Item/ItemPowerData.php | 51 - app/Models/SC/Item/ItemSubType.php | 17 - app/Models/SC/Item/ItemTag.php | 35 - app/Models/SC/Item/ItemTranslation.php | 31 - app/Models/SC/Item/ItemType.php | 17 - app/Models/SC/Item/ItemWeaponModifierData.php | 92 - app/Models/SC/Item/Tag.php | 19 - app/Models/SC/ItemSpecification/Armor.php | 51 - app/Models/SC/ItemSpecification/Bomb/Bomb.php | 53 - .../SC/ItemSpecification/Bomb/BombDamage.php | 26 - app/Models/SC/ItemSpecification/Cooler.php | 39 - app/Models/SC/ItemSpecification/Emp.php | 41 - .../SC/ItemSpecification/FlightController.php | 73 - .../SC/ItemSpecification/FuelIntake.php | 26 - app/Models/SC/ItemSpecification/FuelTank.php | 28 - .../SC/ItemSpecification/HackingChip.php | 26 - .../SC/ItemSpecification/MiningLaser.php | 79 - .../SC/ItemSpecification/MiningModule.php | 59 - .../SC/ItemSpecification/Missile/Missile.php | 67 - .../Missile/MissileDamage.php | 32 - .../SC/ItemSpecification/PowerPlant.php | 35 - .../QuantumDrive/QuantumDrive.php | 49 - .../QuantumDrive/QuantumDriveMode.php | 54 - .../QuantumInterdictionGenerator.php | 43 - .../SC/ItemSpecification/SalvageModifier.php | 39 - .../SC/ItemSpecification/SelfDestruct.php | 45 - app/Models/SC/ItemSpecification/Shield.php | 36 - app/Models/SC/ItemSpecification/Thruster.php | 40 - .../SC/ItemSpecification/TractorBeam.php | 53 - app/Models/SC/Manufacturer.php | 102 - .../MeleeCombatConfig/MeleeCombatConfig.php | 46 - .../MeleeCombatConfigDamage.php | 24 - app/Models/SC/Mission/Deadline.php | 26 - app/Models/SC/Mission/Giver.php | 47 - app/Models/SC/Mission/GiverTranslation.php | 19 - app/Models/SC/Mission/Mission.php | 161 - app/Models/SC/Mission/Reward.php | 28 - app/Models/SC/Mission/Translation.php | 19 - app/Models/SC/Mission/Type.php | 18 - app/Models/SC/Reputation/Reward.php | 20 - app/Models/SC/Reputation/RewardBonus.php | 11 - app/Models/SC/Reputation/Scope.php | 32 - app/Models/SC/Reputation/Standing.php | 25 - app/Models/SC/Shop/Shop.php | 72 - app/Models/SC/Shop/ShopItem.php | 128 - app/Models/SC/Shop/ShopItemRental.php | 50 - app/Models/SC/Vehicle/Hardpoint.php | 87 - app/Models/SC/Vehicle/Vehicle.php | 486 - app/Models/SC/Vehicle/VehicleCargoGrid.php | 51 - app/Models/SC/Vehicle/VehicleHandling.php | 50 - app/Models/SC/Vehicle/VehicleItem.php | 93 - app/Models/SC/Vehicle/VehiclePart.php | 68 - .../SC/Vehicle/Weapon/VehicleWeapon.php | 72 - .../Weapon/VehicleWeaponAmmunition.php | 49 - .../Weapon/VehicleWeaponAmmunitionDamage.php | 32 - .../SC/Vehicle/Weapon/VehicleWeaponMode.php | 44 - .../Weapon/VehicleWeaponRegeneration.php | 37 - .../StarCitizen/Galactapedia/Article.php | 23 +- .../Galactapedia/ArticleProperty.php | 9 - .../StarCitizen/Galactapedia/Category.php | 9 - app/Models/StarCitizen/Galactapedia/Tag.php | 9 - .../StarCitizen/Galactapedia/Template.php | 9 - .../StarCitizen/Manufacturer/Manufacturer.php | 21 - .../ProductionNote/ProductionNote.php | 4 + .../CelestialObject/CelestialObject.php | 10 - .../CelestialObjectSubtype.php | 2 - .../Starmap/Jumppoint/Jumppoint.php | 10 - .../Starmap/Starsystem/Starsystem.php | 10 - app/Models/StarCitizen/{Stat => }/Stat.php | 2 +- .../Vehicle/{Component => }/Component.php | 2 +- .../{GroundVehicle => }/GroundVehicle.php | 2 +- .../StarCitizen/Vehicle/{Ship => }/Ship.php | 2 +- .../StarCitizen/Vehicle/Vehicle/Vehicle.php | 39 +- .../Vehicle/Vehicle/VehicleSku.php | 3 - app/Models/StarCitizenUnpacked/CargoGrid.php | 47 - .../CharArmor/CharArmor.php | 64 - .../CharArmor/CharArmorAttachment.php | 35 - .../CharArmor/CharArmorResistance.php | 37 - app/Models/StarCitizenUnpacked/Clothing.php | 35 - .../StarCitizenUnpacked/CommodityItem.php | 56 - .../StarCitizenUnpacked/CounterMeasure.php | 27 - app/Models/StarCitizenUnpacked/Food/Food.php | 50 - .../StarCitizenUnpacked/Food/FoodEffect.php | 28 - app/Models/StarCitizenUnpacked/FuelIntake.php | 27 - app/Models/StarCitizenUnpacked/FuelTank.php | 29 - app/Models/StarCitizenUnpacked/Item.php | 234 - .../StarCitizenUnpacked/ItemTranslation.php | 37 - app/Models/StarCitizenUnpacked/ItemVolume.php | 30 - .../StarCitizenUnpacked/PersonalInventory.php | 25 - app/Models/StarCitizenUnpacked/Radar.php | 29 - .../AbstractShipItemSpecification.php | 20 - .../StarCitizenUnpacked/ShipItem/Cooler.php | 28 - .../ShipItem/MiningLaser.php | 48 - .../ShipItem/PowerPlant.php | 24 - .../ShipItem/QuantumDrive/QuantumDrive.php | 46 - .../QuantumDrive/QuantumDriveMode.php | 54 - .../ShipItem/SelfDestruct.php | 34 - .../ShipItem/Shield/Shield.php | 53 - .../ShipItem/Shield/ShieldAbsorption.php | 33 - .../StarCitizenUnpacked/ShipItem/ShipItem.php | 130 - .../ShipItem/ShipItemDistortionData.php | 39 - .../ShipItem/ShipItemDurabilityData.php | 33 - .../ShipItem/ShipItemHeatData.php | 65 - .../ShipItem/ShipItemPowerData.php | 49 - .../ShipItem/Weapon/Missile.php | 43 - .../ShipItem/Weapon/MissileDamage.php | 32 - .../ShipItem/Weapon/MissileRack.php | 27 - .../ShipItem/Weapon/Weapon.php | 54 - .../ShipItem/Weapon/WeaponDamage.php | 33 - .../ShipItem/Weapon/WeaponMode.php | 59 - app/Models/StarCitizenUnpacked/Shop/Shop.php | 67 - .../StarCitizenUnpacked/Shop/ShopItem.php | 130 - .../Shop/ShopItemRental.php | 55 - app/Models/StarCitizenUnpacked/Thruster.php | 30 - app/Models/StarCitizenUnpacked/Turret.php | 29 - app/Models/StarCitizenUnpacked/Vehicle.php | 206 - .../StarCitizenUnpacked/VehicleHardpoint.php | 80 - .../WeaponPersonal/Attachment.php | 52 - .../WeaponPersonal/MagazineAttachment.php | 30 - .../WeaponPersonal/OpticAttachment.php | 27 - .../WeaponPersonal/WeaponPersonal.php | 110 - .../WeaponPersonalAmmunition.php | 49 - .../WeaponPersonalAmmunitionDamage.php | 32 - .../WeaponPersonalAttachment.php | 28 - .../WeaponPersonalAttachmentPort.php | 34 - .../WeaponPersonal/WeaponPersonalMagazine.php | 32 - .../WeaponPersonal/WeaponPersonalMode.php | 43 - app/Models/System/ModelChangelog.php | 236 - app/Models/System/Session.php | 12 - .../Translation/AbstractTranslation.php | 9 - app/Models/Transcript/Transcript.php | 89 - .../Transcript/TranscriptTranslation.php | 22 - .../Rsi/CommLink/CommLinksChanged.php | 64 - .../Rsi/CommLink/NewCommLinksDownloaded.php | 64 - .../ShipMatrix/ShipMatrixStructureChanged.php | 59 - app/Policies/Web/AbstractBaseUserPolicy.php | 26 - app/Policies/Web/Account/AccountPolicy.php | 34 - .../Web/Changelog/ChangelogPolicy.php | 29 - app/Policies/Web/DashboardPolicy.php | 26 - app/Policies/Web/Job/JobPolicy.php | 73 - .../Web/Rsi/CommLink/CommLinkPolicy.php | 48 - app/Policies/Web/Rsi/Stat/StatPolicy.php | 20 - .../Manufacturer/ManufacturerPolicy.php | 37 - .../Web/StarCitizen/Starmap/StarmapPolicy.php | 34 - .../Web/StarCitizen/Vehicle/VehiclePolicy.php | 37 - .../Web/Transcript/TranscriptPolicy.php | 39 - app/Policies/Web/TranslationPolicy.php | 51 - app/Policies/Web/User/UserPolicy.php | 51 - app/Providers/AppServiceProvider.php | 67 +- app/Providers/AuthServiceProvider.php | 120 - app/Providers/BroadcastServiceProvider.php | 34 - app/Providers/EventServiceProvider.php | 55 - app/Providers/RouteServiceProvider.php | 98 - .../User/AuthRepositoryServiceProvider.php | 29 - app/Repositories/AbstractBaseRepository.php | 10 - app/Repositories/Web/AuthRepository.php | 184 - app/Repositories/Web/AuthRepositoryStub.php | 82 - .../WikiText/Renderer/EmphasisRenderer.php | 25 - .../Renderer/Galactapedia/LinkRenderer.php | 99 - .../WikiText/Renderer/HeadingRenderer.php | 47 - .../WikiText/Renderer/ImageRenderer.php | 34 - .../WikiText/Renderer/LinkRenderer.php | 29 - .../WikiText/Renderer/ParagraphRenderer.php | 17 - .../WikiText/Renderer/StrongRenderer.php | 28 - .../Renderer/ThematicBreakRenderer.php | 25 - app/Services/CommonMark/WikiTextRenderer.php | 58 - .../PDQHash/MalformedPDQHashException.php | 11 - .../Implementations/PDQHash/PDQHash.php | 201 - .../ImageHash/Implementations/PDQHasher.php | 852 - .../Implementations/PerceptualHash2.php | 1426 - app/Services/ManufacturerFixer.php | 49 - app/Services/Mapper/SmwSubObjectMapper.php | 55 - .../Parser/CommLink/AbstractBaseElement.php | 41 - app/Services/Parser/CommLink/Content.php | 218 - .../CommLink/Content/AlexandriaExtractor.php | 127 - .../Content/ContentExtractorFactory.php | 39 - .../Content/ContentExtractorInterface.php | 35 - .../CommLink/Content/DefaultExtractor.php | 57 - .../CommLink/Content/GFeatureExtractor.php | 98 - .../Content/LayoutSystemExtractor.php | 75 - .../Traits/GBannerAdvancedExtractorTrait.php | 63 - .../Content/Traits/GExploreExtractorTrait.php | 54 - .../Content/Traits/GGridExtractorTrait.php | 62 - .../Traits/GIntroductionExtractorTrait.php | 49 - .../Content/Traits/GSkusExtractorTrait.php | 65 - .../Traits/GTumbrilFeaturesExtractorrait.php | 57 - .../CommLink/Content/VueArticleExtractor.php | 72 - app/Services/Parser/CommLink/Image.php | 459 - app/Services/Parser/CommLink/Link.php | 98 - app/Services/Parser/CommLink/Metadata.php | 391 - .../Parser/SC/AbstractCommodityItem.php | 184 - app/Services/Parser/SC/Clothing.php | 168 - app/Services/Parser/SC/Food.php | 49 - app/Services/Parser/SC/Grenade.php | 38 - app/Services/Parser/SC/HackingChip.php | 34 - app/Services/Parser/SC/Item.php | 315 - app/Services/Parser/SC/ItemBaseData.php | 135 - app/Services/Parser/SC/Labels.php | 4 +- app/Services/Parser/SC/Manufacturers.php | 42 - app/Services/Parser/SC/MiningLaser.php | 70 - app/Services/Parser/SC/MiningModule.php | 60 - app/Services/Parser/SC/Shops/Inventory.php | 152 - app/Services/Parser/SC/Shops/Shops.php | 245 - .../AbstractItemSpecification.php | 23 - app/Services/Parser/SC/VehicleItems/Armor.php | 32 - app/Services/Parser/SC/VehicleItems/Bomb.php | 41 - .../Parser/SC/VehicleItems/CargoGrid.php | 39 - .../Parser/SC/VehicleItems/Cooler.php | 26 - .../Parser/SC/VehicleItems/CounterMeasure.php | 27 - app/Services/Parser/SC/VehicleItems/Emp.php | 29 - .../SC/VehicleItems/FlightController.php | 45 - .../Parser/SC/VehicleItems/FuelIntake.php | 27 - .../Parser/SC/VehicleItems/FuelTank.php | 39 - .../Parser/SC/VehicleItems/Missile.php | 45 - .../Parser/SC/VehicleItems/MissileRack.php | 29 - .../Parser/SC/VehicleItems/PowerPlant.php | 29 - .../Parser/SC/VehicleItems/QuantumDrive.php | 69 - .../QuantumInterdictionGenerator.php | 30 - app/Services/Parser/SC/VehicleItems/Radar.php | 28 - .../SC/VehicleItems/SalvageModifier.php | 28 - .../Parser/SC/VehicleItems/SelfDestruct.php | 31 - .../Parser/SC/VehicleItems/Shield.php | 57 - .../Parser/SC/VehicleItems/Thruster.php | 29 - .../Parser/SC/VehicleItems/TractorBeam.php | 41 - .../Parser/SC/VehicleItems/VehicleItem.php | 86 - .../Parser/SC/VehicleItems/Weapon.php | 65 - app/Services/Parser/SC/Weapon.php | 371 - app/Services/Parser/SC/WeaponAttachment.php | 115 - app/Services/Parser/SC/WeaponModifier.php | 59 - app/Services/Parser/ShipMatrix/Component.php | 2 +- .../Parser/ShipMatrix/ProductionNote.php | 20 +- .../Parser/ShipMatrix/ProductionStatus.php | 22 +- .../Parser/ShipMatrix/Vehicle/Focus.php | 8 +- .../Parser/ShipMatrix/Vehicle/Size.php | 22 +- .../Parser/ShipMatrix/Vehicle/Type.php | 22 +- app/Services/Parser/Starmap/Affiliation.php | 52 - .../Parser/Starmap/CelestialSubtype.php | 38 - app/Services/RsiDownloadClient.php | 25 + app/Services/TranslateSectionizer.php | 37 - app/Services/TranslateText.php | 104 - app/Services/UploadWikiImage.php | 180 - app/Services/WrappedWiki.php | 85 - app/Support/Items/RelatedItemsBuilder.php | 217 - .../Includes/IncludedPassthrough.php | 19 - app/Traits/CreateRelationChangelogTrait.php | 48 - app/Traits/DiffTranslationChangelogTrait.php | 53 - app/Traits/GetWikiCsrfTokenTrait.php | 94 - app/Traits/HasModelChangelogTrait.php | 22 - app/Traits/HasVehicleRelationsTrait.php | 4 +- app/Traits/Jobs/CreateEnglishSubpageTrait.php | 27 - .../Jobs/GetCommLinkWikiPageInfoTrait.php | 101 - app/Traits/LoginWikiBotAccountTrait.php | 30 - app/Traits/LoginWikiUserAccountTrait.php | 38 - .../Api/LocalizableTransformerInterface.php | 15 - .../Api/V1/AbstractV1Transformer.php | 81 - .../CommLink/Category/CategoryTransformer.php | 32 - .../CommLink/Channel/ChannelTransformer.php | 34 - .../Rsi/CommLink/CommLinkLinkTransformer.php | 28 - .../V1/Rsi/CommLink/CommLinkTransformer.php | 156 - .../CommLink/Image/ImageHashTransformer.php | 38 - .../Rsi/CommLink/Image/ImageTransformer.php | 71 - .../V1/Rsi/CommLink/Link/LinkTransformer.php | 30 - .../Rsi/CommLink/Series/SeriesTransformer.php | 32 - .../Translation/TranslationTransformer.php | 34 - .../Rsi/Transcript/TranscriptTransformer.php | 50 - .../Rsi/Transcript/TranslationTransformer.php | 23 - .../AbstractTranslationTransformer.php | 148 - .../Galactapedia/ArticleTransformer.php | 177 - .../Galactapedia/CategoryTransformer.php | 30 - .../Galactapedia/PropertyTransformer.php | 30 - .../RelatedArticleTransformer.php | 37 - .../Galactapedia/TagTransformer.php | 30 - .../Galactapedia/TranslationTransformer.php | 34 - .../Manufacturer/ManufacturerTransformer.php | 105 - .../Starmap/AffiliationTransformer.php | 21 - .../Starmap/CelestialObjectTransformer.php | 142 - .../Starmap/JumppointTransformer.php | 115 - .../Starmap/StarsystemLinkTransformer.php | 32 - .../Starmap/StarsystemTransformer.php | 172 - .../Starmap/SubtypeTransformer.php | 35 - .../V1/StarCitizen/Stat/StatTransformer.php | 34 - .../Vehicle/ComponentTransformer.php | 46 - .../Vehicle/VehicleLinkTransformer.php | 35 - .../Vehicle/VehicleTransformer.php | 393 - .../AbstractCommodityTransformer.php | 22 - .../CharArmorAttachmentTransformer.php | 20 - .../CharArmor/CharArmorLinkTransformer.php | 20 - .../CharArmorResistanceTransformer.php | 20 - .../CharArmor/CharArmorTransformer.php | 116 - .../ClothingLinkTransformer.php | 19 - .../ClothingTransformer.php | 55 - .../Food/FoodLinkTransformer.php | 20 - .../Food/FoodTransformer.php | 45 - .../StarCitizenUnpacked/ItemTransformer.php | 131 - .../PersonalInventoryTransformer.php | 17 - .../ShipItem/CargoGridTransformer.php | 28 - .../ShipItem/CoolerTransformer.php | 20 - .../ShipItem/CounterMeasureTransformer.php | 19 - .../ShipItem/FuelIntakeTransformer.php | 19 - .../ShipItem/FuelTankTransformer.php | 20 - .../ShipItem/MiningLaserTransformer.php | 31 - .../ShipItem/MissileRackTransformer.php | 19 - .../ShipItem/PowerPlantTransformer.php | 18 - .../QuantumDriveModeTransformer.php | 30 - .../QuantumDrive/QuantumDriveTransformer.php | 37 - .../ShipItem/RadarTransformer.php | 20 - .../ShipItem/SelfDestructTransformer.php | 23 - .../Shield/ShieldAbsorptionTransformer.php | 21 - .../ShipItem/Shield/ShieldTransformer.php | 41 - .../ShipItemDistortionDataTransformer.php | 22 - .../ShipItemDurabilityDataTransformer.php | 19 - .../ShipItem/ShipItemHeatDataTransformer.php | 35 - .../ShipItem/ShipItemPowerDataTransformer.php | 27 - .../ShipItem/ShipItemTransformer.php | 289 - .../ShipItem/ThrusterTransformer.php | 21 - .../ShipItem/TurretTransformer.php | 19 - .../Weapon/MissileDamageTransformer.php | 19 - .../ShipItem/Weapon/MissileTransformer.php | 30 - .../Weapon/WeaponDamageTransformer.php | 20 - .../ShipItem/Weapon/WeaponModeTransformer.php | 33 - .../ShipItem/Weapon/WeaponTransformer.php | 46 - .../Shop/ShopItemTransformer.php | 87 - .../Shop/ShopTransformer.php | 66 - .../VehicleHardpointTransformer.php | 60 - .../VehicleTransformer.php | 263 - ...ponPersonalAmmunitionDamageTransformer.php | 20 - .../WeaponPersonalAmmunitionTransformer.php | 21 - ...aponPersonalAttachmentPortsTransformer.php | 23 - .../WeaponPersonalAttachmentsTransformer.php | 53 - .../WeaponPersonalLinkTransformer.php | 20 - .../WeaponPersonalModeTransformer.php | 33 - .../WeaponPersonalTransformer.php | 86 - app/helpers.php | 35 - artisan | 49 +- bootstrap/app.php | 70 +- composer.json | 119 +- composer.lock | 5888 +- config/api.php | 11 - config/app.php | 153 +- config/auth.php | 60 +- config/broadcasting.php | 58 - config/cache.php | 67 +- config/compile.php | 35 - config/database.php | 153 +- config/filesystems.php | 70 +- config/hashing.php | 20 - config/item_sets.php | 13 - config/logging.php | 96 +- config/mail.php | 162 +- config/mediawiki.php | 26 - config/query-builder.php | 43 - config/queue.php | 99 +- config/schedule.php | 33 - config/services.php | 67 +- config/session.php | 112 +- config/trustedproxy.php | 57 - config/view.php | 33 - database/.gitignore | 2 +- .../factories/Account/User/UserFactory.php | 61 - .../Account/User/UserGroupFactory.php | 99 - .../Rsi/CommLink/Category/CategoryFactory.php | 45 - .../Rsi/CommLink/Channel/ChannelFactory.php | 45 - .../Rsi/CommLink/CommLinkFactory.php | 61 - .../CommLink/CommLinkTranslationFactory.php | 44 - .../Rsi/CommLink/Image/ImageFactory.php | 42 - .../CommLink/Image/ImageMetadataFactory.php | 32 - .../Rsi/CommLink/Link/LinkFactory.php | 42 - .../Rsi/CommLink/Series/SeriesFactory.php | 45 - .../Manufacturer/ManufacturerFactory.php | 51 - .../ManufacturerTranslationFactory.php | 46 - .../ProductionNote/ProductionNoteFactory.php | 45 - .../ProductionNoteTranslationFactory.php | 31 - .../ProductionStatusFactory.php | 47 - .../ProductionStatusTranslationFactory.php | 31 - .../Starmap/CelestialObjectFactory.php | 30 - .../StarCitizen/Starmap/JumppointFactory.php | 30 - .../StarCitizen/Starmap/StarsystemFactory.php | 30 - .../StarCitizen/Stat/StatFactory.php | 40 - .../Vehicle/Component/ComponentFactory.php | 127 - .../Vehicle/Focus/FocusFactory.php | 47 - .../Vehicle/Focus/FocusTranslationFactory.php | 31 - .../StarCitizen/Vehicle/Size/SizeFactory.php | 47 - .../Vehicle/Size/SizeTranslationFactory.php | 31 - .../StarCitizen/Vehicle/Type/TypeFactory.php | 47 - .../Vehicle/Type/TypeTranslationFactory.php | 31 - .../Vehicle/Vehicle/VehicleFactory.php | 133 - .../Vehicle/VehicleTranslationFactory.php | 63 - database/factories/System/LanguageFactory.php | 30 - ...017_03_20_122456_create_sessions_table.php | 37 - .../2017_08_10_215600_create_users_table.php | 48 - ..._08_10_215601_create_user_groups_table.php | 41 - ...10_215602_create_user_user_group_table.php | 43 - ...9_13_213113_create_user_settings_table.php | 42 - ...8_08_30_100005_create_comm_links_table.php | 52 - ...06_create_comm_link_translations_table.php | 48 - ...create_comm_link_comm_link_image_table.php | 42 - ..._create_comm_link_comm_link_link_table.php | 42 - ...143344_create_comm_links_changed_table.php | 40 - ...0001_create_comm_link_categories_table.php | 38 - ...100000_create_comm_link_channels_table.php | 38 - ...0_100002_create_comm_link_images_table.php | 40 - ...01_create_comm_link_image_hashes_table.php | 53 - ..._create_comm_link_image_metadata_table.php | 50 - ...3125_create_comm_link_image_tags_table.php | 31 - ...73141_create_comm_link_image_tag_table.php | 32 - ...30_100003_create_comm_link_links_table.php | 38 - ...0_100002_create_comm_link_series_table.php | 38 - ...4_090000_create_sc_manufacturers_table.php | 30 - ...023_05_05_134631_create_sc_shops_table.php | 33 - ...05_05_134638_create_sc_shop_item_table.php | 63 - ..._22_194116_create_sc_entity_tags_table.php | 28 - ...95644_create_sc_item_ammunitions_table.php | 33 - ...reate_sc_item_ammunition_damages_table.php | 33 - ..._item_ammunition_damage_falloffs_table.php | 35 - ...c_item_ammunition_piercabilities_table.php | 32 - ...6_create_sc_clothing_resistances_table.php | 36 - ...c_clothing_radiation_resistances_table.php | 35 - ...023_05_04_093440_create_sc_foods_table.php | 39 - ...04_093550_create_sc_food_effects_table.php | 28 - ..._04_093621_create_sc_food_effect_table.php | 37 - ..._create_sc_personal_weapon_modes_table.php | 39 - ...e_sc_personal_weapon_ammunitions_table.php | 37 - ...c_item_personal_weapon_magazines_table.php | 35 - ...rsonal_weapon_ammunition_damages_table.php | 38 - ..._13_191203_create_sc_item_knifes_table.php | 33 - ...1_create_sc_melee_combat_configs_table.php | 35 - ...1_create_sc_melee_combat_damages_table.php | 37 - ..._05_01_133242_create_sc_factions_table.php | 33 - ...3303_create_sc_faction_relations_table.php | 30 - ...4_095924_create_sc_item_grenades_table.php | 36 - ...reate_sc_item_flight_controllers_table.php | 38 - ..._103819_create_sc_item_thrusters_table.php | 39 - ...06_114538_create_sc_item_coolers_table.php | 36 - ...4556_create_sc_item_power_plants_table.php | 34 - ...609_create_sc_item_self_destrucs_table.php | 40 - ...07_192649_create_sc_item_shields_table.php | 40 - ...193119_create_sc_item_fuel_tanks_table.php | 38 - ...3654_create_sc_item_fuel_intakes_table.php | 36 - ...446_create_sc_item_mining_lasers_table.php | 40 - ...05_10_193111_create_sc_item_emps_table.php | 39 - ...05_10_193130_create_sc_item_qigs_table.php | 40 - ..._24_113227_create_sc_item_armors_table.php | 44 - ...1324_create_sc_item_tractorbeams_table.php | 47 - ...create_sc_item_salvage_modifiers_table.php | 40 - ...14158_create_sc_item_iron_sights_table.php | 41 - ...259_create_sc_item_hacking_chips_table.php | 38 - .../2024_03_02_165734_sc_item_bombs_table.php | 40 - ...3_02_165830_sc_item_bomb_damages_table.php | 36 - ...8_135542_create_sc_item_missiles_table.php | 36 - ...4_create_sc_item_missile_damages_table.php | 36 - ...16_create_sc_item_quantum_drives_table.php | 45 - ...eate_sc_item_quantum_drive_modes_table.php | 49 - ...023_05_04_090225_create_sc_items_table.php | 40 - ...5_04_090341_create_sc_item_ports_table.php | 39 - ...090513_create_sc_item_dimensions_table.php | 39 - ...1000_create_sc_item_translations_table.php | 41 - ...091517_create_sc_item_containers_table.php | 39 - ...091248_create_sc_item_power_data_table.php | 44 - ..._091301_create_sc_item_heat_data_table.php | 52 - ...0_create_sc_item_distortion_data_table.php | 40 - ...3_create_sc_item_durability_data_table.php | 38 - ..._create_sc_item_description_data_table.php | 36 - ...06_09_215747_create_sc_item_tags_table.php | 28 - ..._06_09_215749_create_sc_item_tag_table.php | 38 - ...9_215758_create_sc_item_port_tag_table.php | 33 - ...4428_create_sc_item_interactions_table.php | 28 - ...04433_create_sc_item_interaction_table.php | 37 - ...ate_sc_item_weapon_modifier_data_table.php | 70 - ...4_03_15_135349_create_item_types_table.php | 28 - ..._15_135350_create_item_port_type_table.php | 30 - ..._15_135354_create_item_sub_types_table.php | 28 - ...5_create_item_port_type_sub_type_table.php | 28 - ...194242_create_sc_item_entity_tag_table.php | 37 - ..._05_01_152514_create_sc_missions_table.php | 75 - ...152524_create_sc_mission_rewards_table.php | 33 - ...2548_create_sc_mission_deadlines_table.php | 32 - ...ate_sc_mission_required_missions_table.php | 27 - ...2_create_sc_mission_translations_table.php | 30 - ...e_sc_mission_associated_missions_table.php | 27 - ...1_175948_create_sc_mission_types_table.php | 29 - ..._175955_create_sc_mission_givers_table.php | 35 - ...te_sc_mission_giver_translations_table.php | 30 - ...237_create_sc_reputation_rewards_table.php | 31 - ...2_create_sc_reputation_standings_table.php | 36 - ...5358_create_sc_reputation_scopes_table.php | 34 - ...ate_sc_reputation_scope_standing_table.php | 27 - ...023_05_05_134631_create_sc_shops_table.php | 33 - ...05_05_134638_create_sc_shop_item_table.php | 63 - ...0345_create_sc_shop_item_rentals_table.php | 50 - ..._05_04_100304_create_sc_vehicles_table.php | 64 - ...615_create_sc_vehicle_hardpoints_table.php | 45 - ...3214_create_sc_vehicle_handlings_table.php | 41 - ...1_131028_create_sc_vehicle_parts_table.php | 42 - ...32_create_sc_vehicle_cargo_grids_table.php | 47 - ...074448_create_sc_vehicle_weapons_table.php | 35 - ...te_sc_vehicle_weapon_ammunitions_table.php | 37 - ...ehicle_weapon_ammunition_damages_table.php | 38 - ...1_create_sc_vehicle_weapon_modes_table.php | 39 - ...e_sc_vehicle_weapon_regeneration_table.php | 38 - ..._04_15_000000_create_sc_unpacked_items.php | 38 - ...5633_create_sc_unpacked_vehicles_table.php | 84 - ...te_sc_unpacked_item_translations_table.php | 45 - ...e_sc_unpacked_vehicle_hardpoints_table.php | 49 - ...eate_sc_unpacked_vehicle_turrets_table.php | 49 - ...e_sc_unpacked_vehicle_fuel_tanks_table.php | 48 - ...te_sc_unpacked_vehicle_thrusters_table.php | 49 - ..._unpacked_vehicle_self_destructs_table.php | 51 - ...sc_unpacked_vehicle_fuel_intakes_table.php | 47 - ...npacked_vehicle_counter_measures_table.php | 47 - ...reate_sc_unpacked_vehicle_radars_table.php | 48 - ...c_unpacked_vehicle_mining_lasers_table.php | 59 - ..._create_sc_unpacked_item_volumes_table.php | 40 - ...4601_create_sc_unpacked_clothing_table.php | 44 - ..._sc_unpacked_vehicle_cargo_grids_table.php | 52 - ..._unpacked_vehicle_personal_inventories.php | 46 - ...42_create_sc_unpacked_char_armor_table.php | 43 - ...ate_sc_unpacked_char_armor_attachments.php | 34 - ...eate_sc_unpacked_char_armor_attachment.php | 42 - ..._unpacked_char_armor_resistances_table.php | 39 - ..._150936_create_sc_unpacked_foods_table.php | 40 - ..._create_sc_unpacked_food_effects_table.php | 32 - ...6_create_sc_unpacked_food_effect_table.php | 31 - ...ate_sc_unpacked_personal_weapons_table.php | 46 - ...c_unpacked_personal_weapon_modes_table.php | 46 - ...cked_personal_weapon_ammunitions_table.php | 41 - ...packed_personal_weapon_magazines_table.php | 39 - ...personal_weapon_attachment_ports_table.php | 41 - ...cked_personal_weapon_attachments_table.php | 43 - ...rsonal_weapon_ammunition_damages_table.php | 44 - ...cked_personal_weapon_optic_attachments.php | 39 - ...d_personal_weapon_magazine_attachments.php | 38 - ...acked_personal_weapon_attachment_table.php | 31 - ...21_create_sc_unpacked_ship_items_table.php | 43 - ...sc_unpacked_ship_item_power_data_table.php | 53 - ..._sc_unpacked_ship_item_heat_data_table.php | 65 - ...packed_ship_item_distortion_data_table.php | 47 - ...packed_ship_item_durability_data_table.php | 42 - ..._create_sc_unpacked_ship_coolers_table.php | 48 - ...te_sc_unpacked_ship_power_plants_table.php | 46 - ..._sc_unpacked_ship_quantum_drives_table.php | 56 - ...npacked_ship_quantum_drive_modes_table.php | 55 - ..._create_sc_unpacked_ship_shields_table.php | 55 - ...unpacked_ship_shield_absorptions_table.php | 42 - ..._create_sc_unpacked_ship_weapons_table.php | 50 - ...te_sc_unpacked_ship_weapon_modes_table.php | 45 - ..._sc_unpacked_ship_weapon_damages_table.php | 44 - ...create_sc_unpacked_ship_missiles_table.php | 48 - ...e_sc_unpacked_ship_missile_racks_table.php | 47 - ..._160000_create_sc_unpacked_shops_table.php | 39 - ...310_create_sc_unpacked_shop_item_table.php | 62 - ...ate_sc_unpacked_shop_item_rental_table.php | 54 - .../2018_03_16_140517_create_stats_table.php | 42 - ...6_create_galactapedia_categories_table.php | 33 - ...142_create_galactapedia_articles_table.php | 33 - ...alactapedia_article_translations_table.php | 39 - ..._galactapedia_article_properties_table.php | 34 - ..._galactapedia_article_categories_table.php | 31 - ..._195253_create_galactapedia_tags_table.php | 32 - ...create_galactapedia_article_tags_table.php | 31 - ...ate_galactapedia_article_relates_table.php | 33 - ...44_create_galactapedia_templates_table.php | 30 - ...e_galactapedia_article_templates_table.php | 33 - ...1_01_000000_create_manufacturers_table.php | 41 - ...create_manufacturer_translations_table.php | 44 - ...2_000000_create_production_notes_table.php | 35 - ...ate_production_note_translations_table.php | 43 - ...00000_create_production_statuses_table.php | 36 - ...e_production_status_translations_table.php | 43 - ...08_04_000001_create_affiliations_table.php | 40 - ...create_celestial_object_subtypes_table.php | 37 - ..._000002_create_celestial_objects_table.php | 87 - ...te_celestial_object_translations_table.php | 40 - ...ate_celestial_object_affiliation_table.php | 42 - ...8_08_07_000001_create_jumppoints_table.php | 51 - ..._08_05_000001_create_starsystems_table.php | 60 - ...2_create_starsystem_translations_table.php | 40 - ...23_create_starsystem_affiliation_table.php | 42 - ...01_04_000000_create_vehicle_foci_table.php | 36 - ...reate_vehicle_focus_translations_table.php | 43 - ...1_05_000001_create_vehicle_sizes_table.php | 36 - ...create_vehicle_size_translations_table.php | 43 - ...1_06_000001_create_vehicle_types_table.php | 33 - ...create_vehicle_type_translations_table.php | 43 - ...018_02_01_000000_create_vehicles_table.php | 67 - ...0001_create_vehicle_translations_table.php | 43 - ...002_create_vehicle_vehicle_focus_table.php | 40 - ...124433_create_vehicle_components_table.php | 47 - ..._124902_create_vehicle_component_table.php | 55 - ...25_153213_create_vehicle_loaners_table.php | 38 - ...01_07_132833_create_vehicle_skus_table.php | 37 - ...17_01_01_000000_create_languages_table.php | 38 - .../2017_03_23_122820_create_jobs_table.php | 38 - ..._04_23_174806_create_failed_jobs_table.php | 35 - ...7_183906_create_model_changelogs_table.php | 46 - ..._10_19_213903_create_transcripts_table.php | 41 - ...3_create_transcript_translations_table.php | 38 - ...08_101328_create_new_transcripts_table.php | 43 - ...ate_new_transcripts_translations_table.php | 55 - database/migrations/update/.gitkeep | 0 ...2024_01_02_175450_add_fulltext_indices.php | 63 - ...ase_image_id_to_comm_link_images_table.php | 30 - ...q_hash_to_comm_link_image_hashes_table.php | 51 - ..._health_attribute_to_sc_vehicles_table.php | 29 - ...d_attribute_to_sc_item_heat_data_table.php | 29 - ...2023_06_17_101824_add_sc_table_indices.php | 58 - ...0_add_mass_attribute_to_sc_items_table.php | 29 - ...ibute_to_sc_item_distortion_data_table.php | 32 - ...5_add_params_to_sc_item_missiles_table.php | 42 - ..._add_base_version_id_to_sc_items_table.php | 28 - ...uid_to_personal_weapon_magazines_table.php | 28 - ...ition_uuid_to_sc_vehicle_weapons_table.php | 28 - ...20_add_nullable_to_sc_fuel_tanks_table.php | 32 - ...dd_cargo_capacity_to_sc_vehicles_table.php | 28 - ...pdate_sc_item_flight_controllers_table.php | 57 - ..._shield_face_type_to_sc_vehicles_table.php | 29 - ...o_star_citizen_unpacked_vehicles_table.php | 35 - ...o_star_citizen_unpacked_vehicles_table.php | 36 - ...n_star_citizen_unpacked_vehicles_table.php | 48 - ...yaw_roll_to_sc_unpacked_vehicles_table.php | 48 - ...c_unpacked_personal_weapon_attachments.php | 95 - ...packed_personal_weapon_magazines_table.php | 39 - ...tribute_to_galactapedia_articles_table.php | 37 - ...tribute_to_galactapedia_articles_table.php | 37 - ...e_unique_name_index_from_manufacturers.php | 45 - ...ce_nullable_in_celestial_objects_table.php | 32 - ...1_add_msrp_attribute_to_vehicles_table.php | 38 - ...1409_add_pledge_link_to_vehicles_table.php | 28 - ...cale_code_attribute_in_languages_table.php | 93 - ...2303_remove_email_key_from_users_table.php | 38 - ...40_add_language_to_user_settings_table.php | 34 - .../seeders/Accounts/UserGroupTableSeeder.php | 63 - database/seeders/DatabaseSeeder.php | 20 +- .../StarCitizen/ProductionNoteTableSeeder.php | 1 + .../ProductionStatusTableSeeder.php | 3 + .../StarCitizen/Vehicle/SizeTableSeeder.php | 3 + .../StarCitizen/Vehicle/TypeTableSeeder.php | 3 + docker-build.sh | 2 - docker-compose.yml | 80 - docker/ofelia.ini | 37 - docker/schedule.sh | 9 - docker/start.sh | 33 - docker/vhost.conf | 13 - lang/de.json | 16 - .../admin/starmap/jumppointtunnels/index.php | 13 - lang/de/auth.php | 19 - lang/de/crud.php | 12 - lang/de/pagination.php | 19 - lang/de/passwords.php | 22 - lang/de/validation.php | 126 - lang/en.json | 373 - .../admin/starmap/celestialobjects/index.php | 20 - .../admin/starmap/jumppointtunnels/index.php | 13 - lang/en/auth.php | 19 - lang/en/crud.php | 12 - lang/en/pagination.php | 19 - lang/en/passwords.php | 22 - lang/en/validation.php | 119 - package-lock.json | 11551 +- package.json | 40 +- phpunit.xml | 55 +- public/.htaccess | 19 +- public/css/app.css | 9 - .../css/skin/lightgray/content.inline.min.css | 1 - public/css/skin/lightgray/content.min.css | 1 - .../css/skin/lightgray/content.mobile.min.css | 1 - .../skin/lightgray/fonts/tinymce-mobile.woff | Bin 4624 -> 0 bytes .../skin/lightgray/fonts/tinymce-small.eot | Bin 9492 -> 0 bytes .../skin/lightgray/fonts/tinymce-small.svg | 63 - .../skin/lightgray/fonts/tinymce-small.ttf | Bin 9304 -> 0 bytes .../skin/lightgray/fonts/tinymce-small.woff | Bin 9380 -> 0 bytes public/css/skin/lightgray/fonts/tinymce.eot | Bin 18808 -> 0 bytes public/css/skin/lightgray/fonts/tinymce.svg | 131 - public/css/skin/lightgray/fonts/tinymce.ttf | Bin 18644 -> 0 bytes public/css/skin/lightgray/fonts/tinymce.woff | Bin 18720 -> 0 bytes public/css/skin/lightgray/img/anchor.gif | Bin 53 -> 0 bytes public/css/skin/lightgray/img/loader.gif | Bin 2608 -> 0 bytes public/css/skin/lightgray/img/object.gif | Bin 152 -> 0 bytes public/css/skin/lightgray/img/trans.gif | Bin 43 -> 0 bytes public/css/skin/lightgray/skin.min.css | 1 - public/css/skin/lightgray/skin.mobile.min.css | 2 - public/favicon.ico | Bin 1150 -> 0 bytes public/index.php | 62 +- public/js/Chart.min.js | 7 - public/js/app.js | 2 - public/js/app.js.LICENSE.txt | 62 - public/media/images/api_index.jpg | Bin 96748 -> 0 bytes public/media/images/errors/400.jpg | Bin 539506 -> 0 bytes public/media/images/errors/401.jpg | Bin 3986548 -> 0 bytes public/media/images/errors/403.jpg | Bin 317282 -> 0 bytes public/media/images/errors/404.jpg | Bin 153542 -> 0 bytes public/media/images/errors/500.jpg | Bin 819986 -> 0 bytes public/media/images/errors/503.jpg | Bin 1477604 -> 0 bytes public/mix-manifest.json | 4 - public/web.config | 23 - readme.md | 302 +- resources/assets/fontawesome/js/README.md | 33 - .../assets/fontawesome/js/fontawesome.js | 1443 - .../assets/fontawesome/js/fontawesome.min.js | 797 - .../assets/fontawesome/js/packs/brands.js | 383 - .../assets/fontawesome/js/packs/brands.min.js | 332 - .../assets/fontawesome/js/packs/light.js | 702 - .../assets/fontawesome/js/packs/light.min.js | 651 - .../assets/fontawesome/js/packs/regular.js | 702 - .../fontawesome/js/packs/regular.min.js | 651 - .../assets/fontawesome/js/packs/solid.js | 703 - .../assets/fontawesome/js/packs/solid.min.js | 651 - resources/assets/fontawesome/js/v4-shims.js | 74 - .../assets/fontawesome/js/v4-shims.min.js | 30 - .../assets/fonts/orbitron-light-webfont.ttf | Bin 19632 -> 0 bytes .../assets/fonts/orbitron-medium-webfont.ttf | Bin 19472 -> 0 bytes resources/assets/js/app.js | 65 - resources/assets/js/bootstrap.js | 59 - .../components/CelestialObjectGenerator.vue | 720 - .../js/components/CommLinkLiveSearch.vue | 126 - .../js/components/GalactapediaLiveSearch.vue | 119 - .../assets/js/components/ImageUploadModal.vue | 68 - .../assets/js/components/ItemLiveSearch.vue | 164 - .../assets/js/components/ItemPriceTable.vue | 52 - resources/assets/js/icon.js | 180 - resources/assets/js/snarkdown.js | 109 - resources/assets/sass/_alert.scss | 30 - resources/assets/sass/_button.scss | 22 - resources/assets/sass/_card.scss | 79 - resources/assets/sass/_custom.scss | 132 - resources/assets/sass/_defaults.scss | 17 - resources/assets/sass/_image-card.scss | 91 - resources/assets/sass/_modern-login.scss | 32 - resources/assets/sass/_modern-root.scss | 115 - resources/assets/sass/_modern-scrollbar.scss | 24 - resources/assets/sass/_modern.scss | 422 - resources/assets/sass/_nav.scss | 79 - resources/assets/sass/_text.scss | 42 - resources/assets/sass/_variables.scss | 19 - resources/assets/sass/app.scss | 19 - resources/views/components/card.blade.php | 38 - .../views/components/changelog_list.blade.php | 49 - .../comm_links/create_tag_form.blade.php | 19 - .../comm_links/image_info_card.blade.php | 153 - .../components/edit_delete_block.blade.php | 58 - .../components/edit_translation.blade.php | 30 - .../components/elements/container.blade.php | 5 - .../views/components/elements/icon.blade.php | 3 - .../views/components/elements/input.blade.php | 12 - resources/views/components/errors.blade.php | 9 - .../components/forms/fields/DELETE.blade.php | 1 - .../components/forms/fields/PATCH.blade.php | 1 - .../components/forms/fields/PUT.blade.php | 1 - .../forms/fields/method_field.blade.php | 1 - .../components/forms/form-group.blade.php | 49 - .../views/components/forms/form.blade.php | 11 - resources/views/components/heading.blade.php | 43 - .../components/init_dataTables.blade.php | 5 - resources/views/components/messages.blade.php | 19 - .../components/navs/nav_element.blade.php | 12 - .../components/navs/sidebar_section.blade.php | 18 - .../views/components/navs/top_nav.blade.php | 21 - .../shorturls/expired_at_field.blade.php | 9 - .../components/sidebar_imprint.blade.php | 9 - .../starcitizenunpacked/shop_table.blade.php | 38 - .../starmap/celestial_object.blade.php | 1 - .../components/translation_table.blade.php | 45 - .../views/components/upload_modal.blade.php | 153 - .../components/vehicle_components.blade.php | 20 - .../rsi/comm_link/comm_link_changed.blade.php | 42 - .../new_comm_link_downloaded.blade.php | 18 - .../shipmatrix/structure_changed.blade.php | 12 - resources/views/errors/400.blade.php | 23 - resources/views/errors/401.blade.php | 23 - resources/views/errors/403.blade.php | 23 - resources/views/errors/404.blade.php | 23 - resources/views/errors/500.blade.php | 23 - resources/views/errors/503.blade.php | 15 - .../views/errors/layouts/default.blade.php | 110 - resources/views/layouts/base.blade.php | 20 - resources/views/layouts/default.blade.php | 66 - resources/views/layouts/full_width.blade.php | 51 - .../vendor/mail/html/notification.blade.php | 8 - .../views/vendor/mail/html/themes/default.css | 332 - .../vendor/mail/text/notification.blade.php | 2 - resources/views/web/account/index.blade.php | 110 - resources/views/web/auth/login.blade.php | 29 - resources/views/web/changelog/index.blade.php | 141 - resources/views/web/dashboard.blade.php | 368 - .../views/web/jobs/failed_index.blade.php | 69 - resources/views/web/layouts/config.blade.php | 97 - resources/views/web/layouts/default.blade.php | 9 - .../views/web/layouts/default_wide.blade.php | 9 - .../views/web/layouts/full_width.blade.php | 11 - resources/views/web/menu/app_links.blade.php | 29 - resources/views/web/menu/comm_links.blade.php | 106 - .../views/web/menu/documentation.blade.php | 30 - .../views/web/menu/galactapedia.blade.php | 14 - .../views/web/menu/login_logout.blade.php | 78 - resources/views/web/menu/main.blade.php | 112 - resources/views/web/menu/starmap.blade.php | 29 - resources/views/web/menu/stats.blade.php | 14 - .../views/web/menu/transcripts.blade.php | 15 - .../views/web/menu/translations.blade.php | 29 - resources/views/web/menu/universe.blade.php | 44 - resources/views/web/menu/user.blade.php | 51 - resources/views/web/menu/vehicles.blade.php | 76 - .../rsi/comm_links/categories/index.blade.php | 20 - .../rsi/comm_links/channels/index.blade.php | 20 - .../views/web/rsi/comm_links/edit.blade.php | 161 - .../rsi/comm_links/images/edit-tags.blade.php | 77 - .../web/rsi/comm_links/images/index.blade.php | 100 - .../web/rsi/comm_links/images/show.blade.php | 127 - .../views/web/rsi/comm_links/index.blade.php | 146 - .../web/rsi/comm_links/preview.blade.php | 47 - .../views/web/rsi/comm_links/search.blade.php | 156 - .../web/rsi/comm_links/series/index.blade.php | 20 - .../views/web/rsi/comm_links/show.blade.php | 244 - .../web/rsi/comm_links/tags/edit.blade.php | 37 - .../web/rsi/comm_links/tags/index.blade.php | 80 - resources/views/web/rsi/stats/index.blade.php | 150 - .../starcitizen/galactapedia/index.blade.php | 124 - .../starcitizen/galactapedia/show.blade.php | 221 - .../starcitizen/manufacturers/edit.blade.php | 129 - .../starcitizen/manufacturers/index.blade.php | 108 - .../production_notes/edit.blade.php | 7 - .../production_notes/index.blade.php | 14 - .../production_statuses/edit.blade.php | 7 - .../production_statuses/index.blade.php | 14 - .../starmap/celestial_objects/index.blade.php | 99 - .../starmap/jumppointtunnels/index.blade.php | 98 - .../starmap/starsystems/index.blade.php | 103 - .../starmap/starsystems/show.blade.php | 194 - .../starcitizen/vehicles/foci/edit.blade.php | 7 - .../starcitizen/vehicles/foci/index.blade.php | 14 - .../vehicles/ground_vehicles/edit.blade.php | 264 - .../vehicles/ground_vehicles/index.blade.php | 95 - .../starcitizen/vehicles/ships/edit.blade.php | 337 - .../vehicles/ships/index.blade.php | 99 - .../starcitizen/vehicles/sizes/edit.blade.php | 7 - .../vehicles/sizes/index.blade.php | 14 - .../starcitizen/vehicles/types/edit.blade.php | 7 - .../vehicles/types/index.blade.php | 14 - .../starcitizenunpacked/item/index.blade.php | 18 - .../starcitizenunpacked/item/show.blade.php | 87 - .../vehicle/index.blade.php | 88 - .../views/web/transcripts/edit.blade.php | 133 - .../views/web/transcripts/index.blade.php | 112 - .../views/web/transcripts/show.blade.php | 138 - resources/views/web/users/edit.blade.php | 167 - resources/views/web/users/index.blade.php | 108 - routes/api/api_v1.php | 690 - routes/api/api_v2.php | 136 - routes/api/api_v3.php | 20 - routes/console.php | 16 +- routes/web/user.php | 273 - server.php | 19 - storage/app/.gitignore | 7 +- storage/app/api/ScToolBoxLocales | 2 +- storage/app/api/scunpacked-data | 2 +- storage/framework/.gitignore | 10 +- storage/framework/cache/.gitignore | 1 + .../framework/testing/ChrisRobertsWCfilm1.jpg | Bin 16831 -> 0 bytes .../comm_links/12663/2020-11-22_222222.html | 1359 - .../scunpacked/items/987_jacket_01_01_01.json | 2013 - .../scunpacked/items/arma_barrel_comp_s1.json | 1594 - .../clda_utility_heavy_backpack_01_01_01.json | 2395 - .../items/qdrv_wetk_s03_balandin_scitem.json | 2015 - .../framework/testing/scunpacked/labels.json | 78756 -------- .../testing/scunpacked/manufacturers.json | 3752 - .../framework/testing/scunpacked/ships.json | 33461 ---- .../ships/aegs_avenger_stalker-raw.json | 142944 --------------- .../ships/aegs_avenger_stalker.json | 114 - tests/CreatesApplication.php | 63 - tests/Feature/Api/ItemApiTest.php | 77 - .../CommLink/CommLinksScheduleTest.php | 148 - .../Download/DownloadCommLinkTest.php | 86 - .../Image/DownloadCommLinkImagesTest.php | 25 - .../Download/ReDownloadCommLinksTest.php | 49 - .../CommLink/Image/CreateImageHashesTest.php | 41 - .../Image/CreateImageMetadataTest.php | 32 - .../CommLink/Image/SyncImageIdsTest.php | 57 - .../CommLink/Import/ImportCommLinkTest.php | 49 - .../Translate/TranslateCommLinksTest.php | 41 - .../Wiki/CreateCommLinkWikiPagesTest.php | 26 - .../Download/DownloadShipMatrixTest.php | 49 - .../Import/ImportShipMatrixTest.php | 26 - .../Starmap/Download/DownloadStarmapTest.php | 58 - .../Starmap/Import/ImportStarmapTest.php | 31 - .../Stat/Download/DownloadStatsTest.php | 47 - .../Commands/Stat/Import/ImportStatsTest.php | 26 - .../Feature/Controller/Api/V1/ApiTestCase.php | 158 - .../Category/CategoryControllerTest.php | 155 - .../Channel/ChannelControllerTest.php | 155 - .../Rsi/CommLink/CommLinkControllerTest.php | 199 - .../CommLink/CommLinkSearchControllerTest.php | 238 - .../CommLink/Image/ImageControllerTest.php | 347 - .../CommLink/Series/SeriesControllerTest.php | 155 - .../ManufacturerControllerTest.php | 278 - .../V1/StarCitizen/StarCitizenTestCase.php | 259 - .../Api/V1/StarCitizen/StatControllerTest.php | 103 - .../Vehicle/GroundVehicleControllerTest.php | 163 - .../Vehicle/ShipControllerTest.php | 230 - .../Vehicle/VehicleControllerTestCase.php | 157 - .../Controller/Api/V2/ItemControllerTest.php | 73 - .../Api/V2/ItemRelatedItemsTest.php | 33 - .../Api/V2/VehicleControllerTest.php | 73 - .../Account/AccountControllerBlockedTest.php | 32 - .../AccountControllerBureaucratTest.php | 32 - .../AccountControllerMitarbeiterTest.php | 32 - .../Account/AccountControllerSichterTest.php | 32 - .../Account/AccountControllerSysopTest.php | 32 - .../Web/Account/AccountControllerTestCase.php | 62 - .../Web/Account/AccountControllerUserTest.php | 32 - .../Controller/Web/Auth/UserAuthTest.php | 64 - .../ChangelogControllerBureaucratTest.php | 26 - .../ChangelogControllerSysopTest.php | 26 - .../Changelog/ChangelogControllerUserTest.php | 26 - .../Web/Changelog/ChangelogTestCase.php | 29 - .../DashboardControllerBlockedTest.php | 32 - .../DashboardControllerBureaucratTest.php | 30 - .../DashboardControllerMitarbeiterTest.php | 30 - .../DashboardControllerSichterTest.php | 30 - .../DashboardControllerSysopTest.php | 30 - .../Dashboard/DashboardControllerTestCase.php | 38 - .../Dashboard/DashboardControllerUserTest.php | 30 - .../CategoryControllerBlockedTest.php | 36 - .../CategoryControllerBureaucratTest.php | 36 - .../CategoryControllerMitarbeiterTest.php | 36 - .../CategoryControllerSichterTest.php | 36 - .../Category/CategoryControllerSysopTest.php | 36 - .../Category/CategoryControllerTestCase.php | 71 - .../Category/CategoryControllerUserTest.php | 36 - .../Channel/ChannelControllerBlockedTest.php | 36 - .../ChannelControllerBureaucratTest.php | 36 - .../ChannelControllerMitarbeiterTest.php | 36 - .../Channel/ChannelControllerSichterTest.php | 36 - .../Channel/ChannelControllerSysopTest.php | 36 - .../Channel/ChannelControllerTestCase.php | 71 - .../Channel/ChannelControllerUserTest.php | 36 - .../CommLinkControllerBlockedTest.php | 43 - .../CommLinkControllerBureaucratTest.php | 43 - .../CommLinkControllerMitarbeiterTest.php | 43 - .../CommLinkControllerSichterTest.php | 43 - .../CommLink/CommLinkControllerSysopTest.php | 43 - .../CommLink/CommLinkControllerTestCase.php | 220 - .../CommLink/CommLinkControllerUserTest.php | 43 - .../Image/ImageControllerBlockedTest.php | 34 - .../Image/ImageControllerBureaucratTest.php | 34 - .../Image/ImageControllerMitarbeiterTest.php | 34 - .../Image/ImageControllerSichterTest.php | 34 - .../Image/ImageControllerSysopTest.php | 34 - .../Image/ImageControllerTestCase.php | 54 - .../Image/ImageControllerUserTest.php | 34 - .../Search/CommLinkControllerUserTest.php | 87 - .../CommLinkSearchControllerTestCase.php | 39 - .../Series/SeriesControllerBlockedTest.php | 36 - .../Series/SeriesControllerBureaucratTest.php | 36 - .../SeriesControllerMitarbeiterTest.php | 36 - .../Series/SeriesControllerSichterTest.php | 36 - .../Series/SeriesControllerSysopTest.php | 36 - .../Series/SeriesControllerTestCase.php | 71 - .../Series/SeriesControllerUserTest.php | 36 - .../ManufacturerControllerBlockedTest.php | 40 - .../ManufacturerControllerBureaucratTest.php | 38 - .../ManufacturerControllerMitarbeiterTest.php | 38 - .../ManufacturerControllerSichterTest.php | 38 - .../ManufacturerControllerSysopTest.php | 38 - .../ManufacturerControllerTestCase.php | 153 - .../ManufacturerControllerUserTest.php | 38 - .../ProductionNoteControllerBlockedTest.php | 40 - ...ProductionNoteControllerBureaucratTest.php | 38 - ...roductionNoteControllerMitarbeiterTest.php | 38 - .../ProductionNoteControllerSichterTest.php | 38 - .../ProductionNoteControllerSysopTest.php | 38 - .../ProductionNoteControllerTestCase.php | 136 - .../ProductionNoteControllerUserTest.php | 38 - .../ProductionStatusControllerBlockedTest.php | 40 - ...oductionStatusControllerBureaucratTest.php | 38 - ...ductionStatusControllerMitarbeiterTest.php | 38 - .../ProductionStatusControllerSichterTest.php | 38 - .../ProductionStatusControllerSysopTest.php | 38 - .../ProductionStatusControllerTestCase.php | 136 - .../ProductionStatusControllerUserTest.php | 38 - .../Web/StarCitizen/StarCitizenTestCase.php | 23 - .../Focus/FocusControllerBlockedTest.php | 40 - .../Focus/FocusControllerBureaucratTest.php | 38 - .../Focus/FocusControllerMitarbeiterTest.php | 38 - .../Focus/FocusControllerSichterTest.php | 38 - .../Focus/FocusControllerSysopTest.php | 38 - .../Vehicle/Focus/FocusControllerTestCase.php | 136 - .../Vehicle/Focus/FocusControllerUserTest.php | 38 - .../GroundVehicleControllerBlockedTest.php | 40 - .../GroundVehicleControllerSichterTest.php | 38 - .../GroundVehicleControllerSysopTest.php | 38 - .../GroundVehicleControllerTestCase.php | 152 - .../GroundVehicleControllerUserTest.php | 38 - .../Ship/ShipControllerBlockedTest.php | 40 - .../Ship/ShipControllerBureaucratTest.php | 38 - .../Ship/ShipControllerMitarbeiterTest.php | 38 - .../Ship/ShipControllerSichterTest.php | 38 - .../Vehicle/Ship/ShipControllerSysopTest.php | 38 - .../Vehicle/Ship/ShipControllerTestCase.php | 154 - .../Vehicle/Ship/ShipControllerUserTest.php | 38 - .../Size/SizeControllerBlockedTest.php | 40 - .../Size/SizeControllerBureaucratTest.php | 38 - .../Size/SizeControllerMitarbeiterTest.php | 38 - .../Size/SizeControllerSichterTest.php | 38 - .../Vehicle/Size/SizeControllerSysopTest.php | 38 - .../Vehicle/Size/SizeControllerTestCase.php | 136 - .../Vehicle/Size/SizeControllerUserTest.php | 38 - .../Type/TypeControllerBlockedTest.php | 40 - .../Type/TypeControllerBureaucratTest.php | 38 - .../Type/TypeControllerMitarbeiterTest.php | 38 - .../Type/TypeControllerSichterTest.php | 38 - .../Vehicle/Type/TypeControllerSysopTest.php | 38 - .../Vehicle/Type/TypeControllerTestCase.php | 136 - .../Vehicle/Type/TypeControllerUserTest.php | 38 - .../Web/User/UserControllerBlockedTest.php | 43 - .../Web/User/UserControllerBureaucratTest.php | 41 - .../User/UserControllerMitarbeiterTest.php | 41 - .../Web/User/UserControllerSichterTest.php | 41 - .../Web/User/UserControllerSysopTest.php | 41 - .../Web/User/UserControllerTestCase.php | 139 - .../Web/User/UserControllerUserTest.php | 41 - tests/Feature/Controller/Web/UserTestCase.php | 39 - .../StarCitizen/Stat/DownloadStatsJobTest.php | 97 - .../Stat/Import/ImportStatJobTest.php | 72 - .../Vehicle/DownloadShipMatrixTest.php | 96 - .../Vehicle/Import/ImportShipMatrixTest.php | 75 - .../Vehicle/Import/ImportVehicleTest.php | 78 - .../Download/DownloadCommLinkTest.php | 63 - .../CommLink/Import/ImportCommLinkTest.php | 58 - .../Rsi/CommLink/CommLinkChangedTest.php | 72 - .../SendNewCommLinkNotificationTest.php | 72 - .../Content/ContentExtractorFactoryTest.php | 120 - .../Services/Parser/CommLink/ImageTest.php | 162 - .../Parser/CommLink/ParseCommLinkTest.php | 303 - .../Parser/ShipMatrix/ParseVehicleTest.php | 99 - .../Parser/Starmap/ParseStarsystemTest.php | 70 - tests/TestCase.php | 12 +- tests/Unit/.gitkeep | 0 .../app/Models/SC/Item/ItemTranslation.php | 16 +- ...sc_unpacked_ship_missile_damages_table.php | 0 ...d_flag_to_comm_link_translations_table.php | 0 v2/storage/framework/cache/.gitignore | 2 + .../GroundVehicleControllerBureaucratTest.php | 2 +- ...GroundVehicleControllerMitarbeiterTest.php | 2 +- webpack.mix.js | 15 - 1422 files changed, 6553 insertions(+), 375699 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .env.ci delete mode 100644 .gitmodules delete mode 100644 .phpcs.xml delete mode 100644 Dockerfile delete mode 100644 LICENSE delete mode 100644 app/Console/Commands/AbstractQueueCommand.php delete mode 100644 app/Console/Commands/PopulateData.php delete mode 100644 app/Console/Commands/Rsi/CommLink/AbstractCommLinkCommand.php delete mode 100644 app/Console/Commands/Rsi/CommLink/CommLinkSchedule.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Download/DownloadCommLink.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Download/DownloadCommLinkImages.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Download/ReDownloadCommLinks.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Image/ComputeSimilarImageIds.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Image/CreateImageHashes.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Image/CreateImageMetadata.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Image/SyncImageIds.php delete mode 100644 app/Console/Commands/Rsi/CommLink/ImportCommLink.php delete mode 100644 app/Console/Commands/Rsi/CommLink/TranslateCommLinks.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiPages.php delete mode 100644 app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiTranslationPages.php delete mode 100644 app/Console/Commands/SC/ComputeItemBaseIds.php delete mode 100644 app/Console/Commands/SC/ImportClothing.php delete mode 100644 app/Console/Commands/SC/ImportFactions.php delete mode 100644 app/Console/Commands/SC/ImportItems.php delete mode 100644 app/Console/Commands/SC/ImportMissions.php delete mode 100644 app/Console/Commands/SC/ImportPersonalWeapons.php delete mode 100644 app/Console/Commands/SC/ImportShops.php delete mode 100644 app/Console/Commands/SC/ImportVehicleItems.php delete mode 100644 app/Console/Commands/SC/ImportVehicles.php delete mode 100644 app/Console/Commands/SC/TranslateItems.php delete mode 100644 app/Console/Commands/SC/Wiki/AbstractCreateWikiPage.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateCharArmorWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateClothingWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateCommodityWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateFoodWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateShipItemWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateWeaponAttachmentWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/CreateWeaponWikiPages.php delete mode 100644 app/Console/Commands/SC/Wiki/UploadItemImages.php delete mode 100644 app/Console/Commands/StarCitizen/Galactapedia/Wiki/ApproveArticles.php delete mode 100644 app/Console/Commands/StarCitizen/Galactapedia/Wiki/CreateWikiPages.php delete mode 100644 app/Console/Commands/StarCitizen/Galactapedia/Wiki/UploadImages.php delete mode 100644 app/Console/Commands/StarCitizen/ShipMatrix/DownloadShipMatrix.php delete mode 100644 app/Console/Commands/StarCitizen/ShipMatrix/ImportShipMatrix.php create mode 100644 app/Console/Commands/StarCitizen/Vehicle/ImportShipMatrix.php delete mode 100644 app/Console/Commands/Transcript/ImportMetadata.php delete mode 100644 app/Console/Commands/Transcript/TranslateTranscripts.php delete mode 100644 app/Console/Kernel.php delete mode 100644 app/Contracts/HasChangelogsInterface.php delete mode 100644 app/Contracts/Web/User/AuthRepositoryInterface.php delete mode 100644 app/Events/ApiRouteCalled.php delete mode 100644 app/Events/ModelUpdating.php delete mode 100644 app/Events/Rsi/CommLink/CommLinksChanged.php delete mode 100644 app/Events/Rsi/CommLink/NewCommLinksDownloaded.php delete mode 100644 app/Events/StarCitizen/ShipMatrix/ShipMatrixStructureChanged.php delete mode 100644 app/Exceptions/Handler.php delete mode 100644 app/Exceptions/InvalidDataException.php delete mode 100644 app/Http/Controllers/Api/AbstractApiController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/CommLink/Category/CategoryController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/CommLink/Channel/ChannelController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkSearchController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/CommLink/Series/SeriesController.php delete mode 100644 app/Http/Controllers/Api/V1/Rsi/Transcript/TranscriptController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Galactapedia/GalactapediaController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Manufacturer/ManufacturerController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Starmap/Starsystem/StarsystemController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Stat/StatController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizen/Vehicle/VehicleController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmorController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/ClothingController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/FoodController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Item/ItemController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/CoolerController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ItemController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/PowerPlantController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/QuantumDriveController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ShieldController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/WeaponController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/Shop/ShopController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/AttachmentController.php delete mode 100644 app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalController.php delete mode 100644 app/Http/Controllers/Api/V2/AbstractApiV2Controller.php delete mode 100644 app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkController.php delete mode 100644 app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkSearchController.php delete mode 100644 app/Http/Controllers/Api/V2/Rsi/CommLink/ImageController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Char/ArmorController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Char/ClothesController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/PersonalWeaponController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/WeaponAttachmentController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/FactionController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/FoodController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/ItemController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/ManufacturerController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/MissionController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/MissionGiverController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/ShopController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Vehicle/VehicleController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Vehicle/VehicleItemController.php delete mode 100644 app/Http/Controllers/Api/V2/SC/Vehicle/VehicleWeaponController.php delete mode 100644 app/Http/Controllers/Api/V2/StarCitizen/GalactapediaController.php delete mode 100644 app/Http/Controllers/Api/V2/StarCitizen/Starmap/CelestialObjectController.php delete mode 100644 app/Http/Controllers/Api/V2/StarCitizen/Starmap/StarsystemController.php delete mode 100644 app/Http/Controllers/Api/V2/StarCitizen/StatController.php delete mode 100644 app/Http/Controllers/Api/V3/SC/Vehicle/VehicleController.php delete mode 100644 app/Http/Controllers/Web/Account/AccountController.php delete mode 100644 app/Http/Controllers/Web/Auth/LoginController.php delete mode 100644 app/Http/Controllers/Web/Changelog/ChangelogController.php delete mode 100644 app/Http/Controllers/Web/DashboardController.php delete mode 100644 app/Http/Controllers/Web/Job/JobController.php delete mode 100644 app/Http/Controllers/Web/Job/Rsi/CommLink/JobController.php delete mode 100644 app/Http/Controllers/Web/Job/SC/JobController.php delete mode 100644 app/Http/Controllers/Web/Job/StarCitizen/Galactapedia/JobController.php delete mode 100644 app/Http/Controllers/Web/Job/StarCitizen/Vehicle/JobController.php delete mode 100644 app/Http/Controllers/Web/Job/Wiki/CommLink/JobController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/Category/CategoryController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/Channel/ChannelController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/CommLinkController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/CommLinkSearchController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/Image/ImageController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/Image/TagController.php delete mode 100644 app/Http/Controllers/Web/Rsi/CommLink/Series/SeriesController.php delete mode 100644 app/Http/Controllers/Web/Rsi/Stat/StatController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Galactapedia/GalactapediaController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Manufacturer/ManufacturerController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/ProductionNote/ProductionNoteController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/ProductionStatus/ProductionStatusController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Starmap/Starsystem/StarsystemController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Vehicle/Focus/FocusController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Vehicle/Ship/ShipController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Vehicle/Size/SizeController.php delete mode 100644 app/Http/Controllers/Web/StarCitizen/Vehicle/Type/TypeController.php delete mode 100644 app/Http/Controllers/Web/StarCitizenUnpacked/Item/ItemController.php delete mode 100644 app/Http/Controllers/Web/StarCitizenUnpacked/VehicleController.php delete mode 100644 app/Http/Controllers/Web/Transcript/TranscriptController.php delete mode 100644 app/Http/Controllers/Web/User/UserController.php delete mode 100644 app/Http/Filters/ImageTagFilter.php delete mode 100644 app/Http/Filters/ItemVariantsFilter.php delete mode 100644 app/Http/Kernel.php delete mode 100644 app/Http/Middleware/CheckUserState.php delete mode 100644 app/Http/Middleware/EncryptCookies.php delete mode 100644 app/Http/Middleware/ForceJsonResponse.php delete mode 100644 app/Http/Middleware/FormatApiResponse.php delete mode 100644 app/Http/Middleware/SetPreferredLocale.php delete mode 100644 app/Http/Middleware/TrimStrings.php delete mode 100644 app/Http/Middleware/TrustProxies.php delete mode 100644 app/Http/Middleware/VerifyCsrfToken.php delete mode 100644 app/Http/Middleware/Web/RedirectIfAuthenticated.php delete mode 100644 app/Http/Requests/AbstractSearchRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/CommLinkRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/CommLinkSearchRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/Image/AddImageTagsRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/Image/ImageSearchRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/Image/ImageUploadRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/Image/NewImageTagRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/Image/TagUpdateRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/ReverseImageLinkSearchRequest.php delete mode 100644 app/Http/Requests/Rsi/CommLink/ReverseImageSearchRequest.php delete mode 100644 app/Http/Requests/StarCitizen/Galactapedia/GalactapediaSearchRequest.php delete mode 100644 app/Http/Requests/StarCitizen/Manufacturer/ManufacturerSearchRequest.php delete mode 100644 app/Http/Requests/StarCitizen/Manufacturer/ManufacturerTranslationRequest.php delete mode 100644 app/Http/Requests/StarCitizen/Starmap/StarsystemRequest.php delete mode 100644 app/Http/Requests/StarCitizen/Vehicle/VehicleSearchRequest.php delete mode 100644 app/Http/Requests/StarCitizenUnpacked/ItemSearchRequest.php delete mode 100644 app/Http/Requests/System/TranslationRequest.php delete mode 100644 app/Http/Requests/Transcript/TranscriptUpdateRequest.php rename app/Http/Resources/{SC => Game}/Item/ItemDescriptionDataResource.php (89%) create mode 100644 app/Http/Resources/Game/Item/ItemDimensionResource.php create mode 100644 app/Http/Resources/Game/Item/ItemDurabilityResource.php create mode 100644 app/Http/Resources/Game/Item/ItemHeatConnectionResource.php create mode 100644 app/Http/Resources/Game/Item/ItemInventoryResource.php create mode 100644 app/Http/Resources/Game/Item/ItemPortResource.php rename app/Http/Resources/{SC => Game}/Item/ItemPortTypeResource.php (66%) create mode 100644 app/Http/Resources/Game/Item/ItemPowerConnectionResource.php create mode 100644 app/Http/Resources/Game/ItemSpecification/ClothingResource.php create mode 100644 app/Http/Resources/Game/Manufacturer/ManufacturerLinkResource.php rename app/Http/Resources/{SC => Game}/Manufacturer/ManufacturerResource.php (72%) delete mode 100644 app/Http/Resources/SC/Ammunition/AmmunitionDamageFalloffResource.php delete mode 100644 app/Http/Resources/SC/Ammunition/AmmunitionPiercabilityResource.php delete mode 100644 app/Http/Resources/SC/Ammunition/AmmunitionResource.php delete mode 100644 app/Http/Resources/SC/Char/ClothingRadiationResistanceResource.php delete mode 100644 app/Http/Resources/SC/Char/ClothingResistanceResource.php delete mode 100644 app/Http/Resources/SC/Char/ClothingResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/BarrelAttachResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/GrenadeResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/IronSightResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/KnifeResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponAttachmentResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponMagazineResource.php delete mode 100644 app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponResource.php delete mode 100644 app/Http/Resources/SC/Faction/FactionLinkResource.php delete mode 100644 app/Http/Resources/SC/Faction/FactionRelationResource.php delete mode 100644 app/Http/Resources/SC/Faction/FactionResource.php delete mode 100644 app/Http/Resources/SC/FoodResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemContainerResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemDimensionResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemDistortionDataResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemDurabilityDataResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemHeatDataResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemPortResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemPowerDataResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemResource.php delete mode 100644 app/Http/Resources/SC/Item/ItemWeaponModifierDataResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/ArmorResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/BombResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/CoolerResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/EmpResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/FlightControllerResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/FuelIntakeResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/FuelTankResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/HackingChipResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserModifierResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/MiningModuleResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/MissileResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/PowerPlantResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveModeResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/QuantumInterdictionGeneratorResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/SalvageModifierResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/SelfDestructResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/ShieldResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/ThrusterResource.php delete mode 100644 app/Http/Resources/SC/ItemSpecification/TractorBeamResource.php delete mode 100644 app/Http/Resources/SC/Manufacturer/ManufacturerLinkResource.php delete mode 100644 app/Http/Resources/SC/MeleeCombatConfig/MeleeCombatConfigResource.php delete mode 100644 app/Http/Resources/SC/MeleeCombatConfig/MeleeDamageResource.php delete mode 100644 app/Http/Resources/SC/Mission/DeadlineResource.php delete mode 100644 app/Http/Resources/SC/Mission/GiverLinkResource.php delete mode 100644 app/Http/Resources/SC/Mission/GiverResource.php delete mode 100644 app/Http/Resources/SC/Mission/MissionLinkResource.php delete mode 100644 app/Http/Resources/SC/Mission/MissionResource.php delete mode 100644 app/Http/Resources/SC/Mission/RewardResource.php delete mode 100644 app/Http/Resources/SC/Shop/ShopItemResource.php delete mode 100644 app/Http/Resources/SC/Shop/ShopLinkResource.php delete mode 100644 app/Http/Resources/SC/Shop/ShopResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/HardpointItemResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/HardpointItemResourceV3.php delete mode 100644 app/Http/Resources/SC/Vehicle/HardpointResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/HardpointResourceV3.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleCargoGrid.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleItemLinkResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleItemResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleLinkResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehiclePartResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/VehicleResourceV3.php delete mode 100644 app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponRegenResource.php delete mode 100644 app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponResource.php delete mode 100644 app/Http/Resources/SC/Weapon/WeaponModeResource.php delete mode 100644 app/Jobs/AbstractBaseDownloadData.php delete mode 100644 app/Jobs/Rsi/CommLink/Download/DownloadCommLink.php delete mode 100644 app/Jobs/Rsi/CommLink/Download/DownloadMissingCommLinks.php delete mode 100644 app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImage.php delete mode 100644 app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImages.php delete mode 100644 app/Jobs/Rsi/CommLink/Download/ReDownloadDbCommLinks.php delete mode 100644 app/Jobs/Rsi/CommLink/Image/ComputeSimilarImageIds.php delete mode 100644 app/Jobs/Rsi/CommLink/Image/CreateImageHash.php delete mode 100644 app/Jobs/Rsi/CommLink/Image/CreateImageHashes.php delete mode 100644 app/Jobs/Rsi/CommLink/Image/CreateImageMetadata.php delete mode 100644 app/Jobs/Rsi/CommLink/Image/CreateImageMetadatum.php delete mode 100644 app/Jobs/Rsi/CommLink/Import/ImportCommLink.php delete mode 100644 app/Jobs/Rsi/CommLink/Import/ImportCommLinks.php delete mode 100644 app/Jobs/Rsi/CommLink/SyncImageId.php delete mode 100644 app/Jobs/Rsi/CommLink/SyncImageIds.php delete mode 100644 app/Jobs/Rsi/CommLink/Translate/TranslateCommLink.php delete mode 100644 app/Jobs/Rsi/CommLink/Translate/TranslateCommLinks.php delete mode 100644 app/Jobs/SC/ComputeItemBaseIds.php delete mode 100644 app/Jobs/SC/Import/AbstractItemCreationJob.php delete mode 100644 app/Jobs/SC/Import/Ammunition.php delete mode 100644 app/Jobs/SC/Import/Clothing.php delete mode 100644 app/Jobs/SC/Import/Food.php delete mode 100644 app/Jobs/SC/Import/Grenade.php delete mode 100644 app/Jobs/SC/Import/HackingChip.php delete mode 100644 app/Jobs/SC/Import/Item.php delete mode 100644 app/Jobs/SC/Import/ItemSpecificationCreator.php delete mode 100644 app/Jobs/SC/Import/Knife.php delete mode 100644 app/Jobs/SC/Import/MiningLaser.php delete mode 100644 app/Jobs/SC/Import/MiningModule.php delete mode 100644 app/Jobs/SC/Import/PersonalWeapon.php delete mode 100644 app/Jobs/SC/Import/ShopItems.php delete mode 100644 app/Jobs/SC/Import/Vehicle.php delete mode 100644 app/Jobs/SC/Import/VehicleItem.php delete mode 100644 app/Jobs/SC/Import/WeaponAttachment.php delete mode 100644 app/Jobs/SC/Import/WeaponModifier.php delete mode 100644 app/Jobs/SC/TranslateItem.php delete mode 100644 app/Jobs/StarCitizen/Vehicle/CheckShipMatrixStructure.php delete mode 100644 app/Jobs/StarCitizen/Vehicle/DownloadShipMatrix.php delete mode 100644 app/Jobs/StarCitizen/Vehicle/Import/ImportShipMatrix.php rename app/Jobs/StarCitizen/Vehicle/{Import => }/ImportLoaner.php (99%) rename app/Jobs/StarCitizen/Vehicle/{Import => }/ImportMsrp.php (98%) create mode 100644 app/Jobs/StarCitizen/Vehicle/ImportShipMatrix.php rename app/Jobs/StarCitizen/Vehicle/{Import => }/ImportVehicle.php (95%) delete mode 100644 app/Jobs/TrackApiRouteCall.php delete mode 100644 app/Jobs/Transcript/ImportMetadata.php delete mode 100644 app/Jobs/Transcript/Translate/TranslateTranscript.php delete mode 100644 app/Jobs/Transcript/Translate/TranslateTranscripts.php delete mode 100644 app/Jobs/Wiki/ApproveRevisions.php delete mode 100644 app/Jobs/Wiki/CommLink/CreateCommLinkWikiPage.php delete mode 100644 app/Jobs/Wiki/CommLink/CreateCommLinkWikiPages.php delete mode 100644 app/Jobs/Wiki/CommLink/CreateCommLinkWikiTranslationPages.php delete mode 100644 app/Jobs/Wiki/CommLink/UpdateCommLinkProofReadStatus.php delete mode 100644 app/Jobs/Wiki/Galactapedia/CreateGalactapediaWikiPage.php delete mode 100644 app/Jobs/Wiki/Galactapedia/CreateGalactapediaWikiPages.php delete mode 100644 app/Jobs/Wiki/Galactapedia/UploadGalactapediaWikiImages.php delete mode 100644 app/Jobs/Wiki/Transcript/CreateTranscriptWikiPage.php delete mode 100644 app/Jobs/Wiki/Transcript/CreateTranscriptWikiPages.php delete mode 100644 app/Jobs/Wiki/Transcript/UpdateTranscriptProofReadStatus.php delete mode 100644 app/Listeners/AddApiRouteTrackingJob.php delete mode 100644 app/Listeners/LogSuccessfulLogin.php delete mode 100644 app/Listeners/ModelUpdating.php delete mode 100644 app/Listeners/Rsi/CommLink/SendCommLinksChangedNotification.php delete mode 100644 app/Listeners/Rsi/CommLink/SendNewCommLinksDownloadedNotification.php delete mode 100644 app/Listeners/StarCitizen/ShipMatrix/SendShipMatrixStructureChangedNotification.php delete mode 100644 app/Mail/Rsi/CommLink/CommLinksChanged.php delete mode 100644 app/Mail/Rsi/CommLink/NewCommLinksDownloaded.php delete mode 100644 app/Mail/StarCitizen/ShipMatrixStructureChanged.php delete mode 100644 app/Models/Account/User/User.php delete mode 100644 app/Models/Account/User/UserGroup.php delete mode 100644 app/Models/Account/User/UserSetting.php create mode 100644 app/Models/Language.php rename app/Models/Rsi/CommLink/{Category => }/Category.php (87%) rename app/Models/Rsi/CommLink/{Channel => }/Channel.php (87%) rename app/Models/Rsi/CommLink/{Link => }/Link.php (86%) rename app/Models/Rsi/CommLink/{Series => }/Series.php (87%) delete mode 100644 app/Models/SC/Ammunition/Ammunition.php delete mode 100644 app/Models/SC/Ammunition/AmmunitionDamage.php delete mode 100644 app/Models/SC/Ammunition/AmmunitionDamageFalloff.php delete mode 100644 app/Models/SC/Ammunition/AmmunitionPiercability.php delete mode 100644 app/Models/SC/Char/Clothing/Armor.php delete mode 100644 app/Models/SC/Char/Clothing/Clothes.php delete mode 100644 app/Models/SC/Char/Clothing/Clothing.php delete mode 100644 app/Models/SC/Char/Clothing/ClothingResistance.php delete mode 100644 app/Models/SC/Char/Clothing/RadiationResistance.php delete mode 100644 app/Models/SC/Char/Grenade.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/Attachment.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/BarrelAttach.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/IronSight.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/Knife.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/PersonalWeapon.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/PersonalWeaponAmmunition.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/PersonalWeaponAmmunitionDamage.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/PersonalWeaponMagazine.php delete mode 100644 app/Models/SC/Char/PersonalWeapon/PersonalWeaponMode.php delete mode 100644 app/Models/SC/CommodityItem.php delete mode 100644 app/Models/SC/EntityTag.php delete mode 100644 app/Models/SC/Faction/Faction.php delete mode 100644 app/Models/SC/Faction/FactionRelation.php delete mode 100644 app/Models/SC/Food/Food.php delete mode 100644 app/Models/SC/Food/FoodEffect.php delete mode 100644 app/Models/SC/Item/Interaction.php delete mode 100644 app/Models/SC/Item/Item.php delete mode 100644 app/Models/SC/Item/ItemContainer.php delete mode 100644 app/Models/SC/Item/ItemDimension.php delete mode 100644 app/Models/SC/Item/ItemDistortionData.php delete mode 100644 app/Models/SC/Item/ItemDurabilityData.php delete mode 100644 app/Models/SC/Item/ItemHeatData.php delete mode 100644 app/Models/SC/Item/ItemPort.php delete mode 100644 app/Models/SC/Item/ItemPortTag.php delete mode 100644 app/Models/SC/Item/ItemPortType.php delete mode 100644 app/Models/SC/Item/ItemPortTypeSubType.php delete mode 100644 app/Models/SC/Item/ItemPowerData.php delete mode 100644 app/Models/SC/Item/ItemSubType.php delete mode 100644 app/Models/SC/Item/ItemTag.php delete mode 100644 app/Models/SC/Item/ItemTranslation.php delete mode 100644 app/Models/SC/Item/ItemType.php delete mode 100644 app/Models/SC/Item/ItemWeaponModifierData.php delete mode 100644 app/Models/SC/Item/Tag.php delete mode 100644 app/Models/SC/ItemSpecification/Armor.php delete mode 100644 app/Models/SC/ItemSpecification/Bomb/Bomb.php delete mode 100644 app/Models/SC/ItemSpecification/Bomb/BombDamage.php delete mode 100644 app/Models/SC/ItemSpecification/Cooler.php delete mode 100644 app/Models/SC/ItemSpecification/Emp.php delete mode 100644 app/Models/SC/ItemSpecification/FlightController.php delete mode 100644 app/Models/SC/ItemSpecification/FuelIntake.php delete mode 100644 app/Models/SC/ItemSpecification/FuelTank.php delete mode 100644 app/Models/SC/ItemSpecification/HackingChip.php delete mode 100644 app/Models/SC/ItemSpecification/MiningLaser.php delete mode 100644 app/Models/SC/ItemSpecification/MiningModule.php delete mode 100644 app/Models/SC/ItemSpecification/Missile/Missile.php delete mode 100644 app/Models/SC/ItemSpecification/Missile/MissileDamage.php delete mode 100644 app/Models/SC/ItemSpecification/PowerPlant.php delete mode 100644 app/Models/SC/ItemSpecification/QuantumDrive/QuantumDrive.php delete mode 100644 app/Models/SC/ItemSpecification/QuantumDrive/QuantumDriveMode.php delete mode 100644 app/Models/SC/ItemSpecification/QuantumInterdictionGenerator.php delete mode 100644 app/Models/SC/ItemSpecification/SalvageModifier.php delete mode 100644 app/Models/SC/ItemSpecification/SelfDestruct.php delete mode 100644 app/Models/SC/ItemSpecification/Shield.php delete mode 100644 app/Models/SC/ItemSpecification/Thruster.php delete mode 100644 app/Models/SC/ItemSpecification/TractorBeam.php delete mode 100644 app/Models/SC/Manufacturer.php delete mode 100644 app/Models/SC/MeleeCombatConfig/MeleeCombatConfig.php delete mode 100644 app/Models/SC/MeleeCombatConfig/MeleeCombatConfigDamage.php delete mode 100644 app/Models/SC/Mission/Deadline.php delete mode 100644 app/Models/SC/Mission/Giver.php delete mode 100644 app/Models/SC/Mission/GiverTranslation.php delete mode 100644 app/Models/SC/Mission/Mission.php delete mode 100644 app/Models/SC/Mission/Reward.php delete mode 100644 app/Models/SC/Mission/Translation.php delete mode 100644 app/Models/SC/Mission/Type.php delete mode 100644 app/Models/SC/Reputation/Reward.php delete mode 100644 app/Models/SC/Reputation/RewardBonus.php delete mode 100644 app/Models/SC/Reputation/Scope.php delete mode 100644 app/Models/SC/Reputation/Standing.php delete mode 100644 app/Models/SC/Shop/Shop.php delete mode 100644 app/Models/SC/Shop/ShopItem.php delete mode 100644 app/Models/SC/Shop/ShopItemRental.php delete mode 100644 app/Models/SC/Vehicle/Hardpoint.php delete mode 100644 app/Models/SC/Vehicle/Vehicle.php delete mode 100644 app/Models/SC/Vehicle/VehicleCargoGrid.php delete mode 100644 app/Models/SC/Vehicle/VehicleHandling.php delete mode 100644 app/Models/SC/Vehicle/VehicleItem.php delete mode 100644 app/Models/SC/Vehicle/VehiclePart.php delete mode 100644 app/Models/SC/Vehicle/Weapon/VehicleWeapon.php delete mode 100644 app/Models/SC/Vehicle/Weapon/VehicleWeaponAmmunition.php delete mode 100644 app/Models/SC/Vehicle/Weapon/VehicleWeaponAmmunitionDamage.php delete mode 100644 app/Models/SC/Vehicle/Weapon/VehicleWeaponMode.php delete mode 100644 app/Models/SC/Vehicle/Weapon/VehicleWeaponRegeneration.php rename app/Models/StarCitizen/{Stat => }/Stat.php (90%) rename app/Models/StarCitizen/Vehicle/{Component => }/Component.php (91%) rename app/Models/StarCitizen/Vehicle/{GroundVehicle => }/GroundVehicle.php (90%) rename app/Models/StarCitizen/Vehicle/{Ship => }/Ship.php (91%) delete mode 100644 app/Models/StarCitizenUnpacked/CargoGrid.php delete mode 100644 app/Models/StarCitizenUnpacked/CharArmor/CharArmor.php delete mode 100644 app/Models/StarCitizenUnpacked/CharArmor/CharArmorAttachment.php delete mode 100644 app/Models/StarCitizenUnpacked/CharArmor/CharArmorResistance.php delete mode 100644 app/Models/StarCitizenUnpacked/Clothing.php delete mode 100644 app/Models/StarCitizenUnpacked/CommodityItem.php delete mode 100644 app/Models/StarCitizenUnpacked/CounterMeasure.php delete mode 100644 app/Models/StarCitizenUnpacked/Food/Food.php delete mode 100644 app/Models/StarCitizenUnpacked/Food/FoodEffect.php delete mode 100644 app/Models/StarCitizenUnpacked/FuelIntake.php delete mode 100644 app/Models/StarCitizenUnpacked/FuelTank.php delete mode 100644 app/Models/StarCitizenUnpacked/Item.php delete mode 100644 app/Models/StarCitizenUnpacked/ItemTranslation.php delete mode 100644 app/Models/StarCitizenUnpacked/ItemVolume.php delete mode 100644 app/Models/StarCitizenUnpacked/PersonalInventory.php delete mode 100644 app/Models/StarCitizenUnpacked/Radar.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/AbstractShipItemSpecification.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Cooler.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/MiningLaser.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/PowerPlant.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/QuantumDrive/QuantumDrive.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/QuantumDrive/QuantumDriveMode.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/SelfDestruct.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Shield/Shield.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Shield/ShieldAbsorption.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/ShipItem.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/ShipItemDistortionData.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/ShipItemDurabilityData.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/ShipItemHeatData.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/ShipItemPowerData.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/Missile.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/MissileDamage.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/MissileRack.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/Weapon.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/WeaponDamage.php delete mode 100644 app/Models/StarCitizenUnpacked/ShipItem/Weapon/WeaponMode.php delete mode 100644 app/Models/StarCitizenUnpacked/Shop/Shop.php delete mode 100644 app/Models/StarCitizenUnpacked/Shop/ShopItem.php delete mode 100644 app/Models/StarCitizenUnpacked/Shop/ShopItemRental.php delete mode 100644 app/Models/StarCitizenUnpacked/Thruster.php delete mode 100644 app/Models/StarCitizenUnpacked/Turret.php delete mode 100644 app/Models/StarCitizenUnpacked/Vehicle.php delete mode 100644 app/Models/StarCitizenUnpacked/VehicleHardpoint.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/Attachment.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/MagazineAttachment.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/OpticAttachment.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonal.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAmmunition.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAmmunitionDamage.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAttachment.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAttachmentPort.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalMagazine.php delete mode 100644 app/Models/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalMode.php delete mode 100644 app/Models/System/ModelChangelog.php delete mode 100644 app/Models/System/Session.php delete mode 100644 app/Models/Transcript/Transcript.php delete mode 100644 app/Models/Transcript/TranscriptTranslation.php delete mode 100644 app/Notifications/Rsi/CommLink/CommLinksChanged.php delete mode 100644 app/Notifications/Rsi/CommLink/NewCommLinksDownloaded.php delete mode 100644 app/Notifications/StarCitizen/ShipMatrix/ShipMatrixStructureChanged.php delete mode 100644 app/Policies/Web/AbstractBaseUserPolicy.php delete mode 100644 app/Policies/Web/Account/AccountPolicy.php delete mode 100644 app/Policies/Web/Changelog/ChangelogPolicy.php delete mode 100644 app/Policies/Web/DashboardPolicy.php delete mode 100644 app/Policies/Web/Job/JobPolicy.php delete mode 100644 app/Policies/Web/Rsi/CommLink/CommLinkPolicy.php delete mode 100644 app/Policies/Web/Rsi/Stat/StatPolicy.php delete mode 100644 app/Policies/Web/StarCitizen/Manufacturer/ManufacturerPolicy.php delete mode 100644 app/Policies/Web/StarCitizen/Starmap/StarmapPolicy.php delete mode 100644 app/Policies/Web/StarCitizen/Vehicle/VehiclePolicy.php delete mode 100644 app/Policies/Web/Transcript/TranscriptPolicy.php delete mode 100644 app/Policies/Web/TranslationPolicy.php delete mode 100644 app/Policies/Web/User/UserPolicy.php delete mode 100644 app/Providers/AuthServiceProvider.php delete mode 100644 app/Providers/BroadcastServiceProvider.php delete mode 100644 app/Providers/EventServiceProvider.php delete mode 100644 app/Providers/RouteServiceProvider.php delete mode 100644 app/Providers/Web/User/AuthRepositoryServiceProvider.php delete mode 100644 app/Repositories/AbstractBaseRepository.php delete mode 100644 app/Repositories/Web/AuthRepository.php delete mode 100644 app/Repositories/Web/AuthRepositoryStub.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/EmphasisRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/Galactapedia/LinkRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/HeadingRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/ImageRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/LinkRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/ParagraphRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/StrongRenderer.php delete mode 100644 app/Services/CommonMark/WikiText/Renderer/ThematicBreakRenderer.php delete mode 100644 app/Services/CommonMark/WikiTextRenderer.php delete mode 100644 app/Services/ImageHash/Implementations/PDQHash/MalformedPDQHashException.php delete mode 100644 app/Services/ImageHash/Implementations/PDQHash/PDQHash.php delete mode 100644 app/Services/ImageHash/Implementations/PDQHasher.php delete mode 100644 app/Services/ImageHash/Implementations/PerceptualHash2.php delete mode 100644 app/Services/ManufacturerFixer.php delete mode 100644 app/Services/Mapper/SmwSubObjectMapper.php delete mode 100644 app/Services/Parser/CommLink/AbstractBaseElement.php delete mode 100644 app/Services/Parser/CommLink/Content.php delete mode 100644 app/Services/Parser/CommLink/Content/AlexandriaExtractor.php delete mode 100644 app/Services/Parser/CommLink/Content/ContentExtractorFactory.php delete mode 100644 app/Services/Parser/CommLink/Content/ContentExtractorInterface.php delete mode 100644 app/Services/Parser/CommLink/Content/DefaultExtractor.php delete mode 100644 app/Services/Parser/CommLink/Content/GFeatureExtractor.php delete mode 100644 app/Services/Parser/CommLink/Content/LayoutSystemExtractor.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GBannerAdvancedExtractorTrait.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GExploreExtractorTrait.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GGridExtractorTrait.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GIntroductionExtractorTrait.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GSkusExtractorTrait.php delete mode 100644 app/Services/Parser/CommLink/Content/Traits/GTumbrilFeaturesExtractorrait.php delete mode 100644 app/Services/Parser/CommLink/Content/VueArticleExtractor.php delete mode 100644 app/Services/Parser/CommLink/Image.php delete mode 100644 app/Services/Parser/CommLink/Link.php delete mode 100644 app/Services/Parser/CommLink/Metadata.php delete mode 100644 app/Services/Parser/SC/AbstractCommodityItem.php delete mode 100644 app/Services/Parser/SC/Clothing.php delete mode 100644 app/Services/Parser/SC/Food.php delete mode 100644 app/Services/Parser/SC/Grenade.php delete mode 100644 app/Services/Parser/SC/HackingChip.php delete mode 100644 app/Services/Parser/SC/Item.php delete mode 100644 app/Services/Parser/SC/ItemBaseData.php delete mode 100644 app/Services/Parser/SC/Manufacturers.php delete mode 100644 app/Services/Parser/SC/MiningLaser.php delete mode 100644 app/Services/Parser/SC/MiningModule.php delete mode 100644 app/Services/Parser/SC/Shops/Inventory.php delete mode 100644 app/Services/Parser/SC/Shops/Shops.php delete mode 100644 app/Services/Parser/SC/VehicleItems/AbstractItemSpecification.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Armor.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Bomb.php delete mode 100644 app/Services/Parser/SC/VehicleItems/CargoGrid.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Cooler.php delete mode 100644 app/Services/Parser/SC/VehicleItems/CounterMeasure.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Emp.php delete mode 100644 app/Services/Parser/SC/VehicleItems/FlightController.php delete mode 100644 app/Services/Parser/SC/VehicleItems/FuelIntake.php delete mode 100644 app/Services/Parser/SC/VehicleItems/FuelTank.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Missile.php delete mode 100644 app/Services/Parser/SC/VehicleItems/MissileRack.php delete mode 100644 app/Services/Parser/SC/VehicleItems/PowerPlant.php delete mode 100644 app/Services/Parser/SC/VehicleItems/QuantumDrive.php delete mode 100644 app/Services/Parser/SC/VehicleItems/QuantumInterdictionGenerator.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Radar.php delete mode 100644 app/Services/Parser/SC/VehicleItems/SalvageModifier.php delete mode 100644 app/Services/Parser/SC/VehicleItems/SelfDestruct.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Shield.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Thruster.php delete mode 100644 app/Services/Parser/SC/VehicleItems/TractorBeam.php delete mode 100644 app/Services/Parser/SC/VehicleItems/VehicleItem.php delete mode 100644 app/Services/Parser/SC/VehicleItems/Weapon.php delete mode 100644 app/Services/Parser/SC/Weapon.php delete mode 100644 app/Services/Parser/SC/WeaponAttachment.php delete mode 100644 app/Services/Parser/SC/WeaponModifier.php delete mode 100644 app/Services/Parser/Starmap/Affiliation.php delete mode 100644 app/Services/Parser/Starmap/CelestialSubtype.php create mode 100644 app/Services/RsiDownloadClient.php delete mode 100644 app/Services/TranslateSectionizer.php delete mode 100644 app/Services/TranslateText.php delete mode 100644 app/Services/UploadWikiImage.php delete mode 100644 app/Services/WrappedWiki.php delete mode 100644 app/Support/Items/RelatedItemsBuilder.php delete mode 100644 app/Support/QueryBuilder/Includes/IncludedPassthrough.php delete mode 100644 app/Traits/CreateRelationChangelogTrait.php delete mode 100644 app/Traits/DiffTranslationChangelogTrait.php delete mode 100644 app/Traits/GetWikiCsrfTokenTrait.php delete mode 100644 app/Traits/HasModelChangelogTrait.php delete mode 100644 app/Traits/Jobs/CreateEnglishSubpageTrait.php delete mode 100644 app/Traits/Jobs/GetCommLinkWikiPageInfoTrait.php delete mode 100644 app/Traits/LoginWikiBotAccountTrait.php delete mode 100644 app/Traits/LoginWikiUserAccountTrait.php delete mode 100644 app/Transformers/Api/LocalizableTransformerInterface.php delete mode 100644 app/Transformers/Api/V1/AbstractV1Transformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Category/CategoryTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Channel/ChannelTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/CommLinkLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/CommLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Image/ImageHashTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Image/ImageTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Link/LinkTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Series/SeriesTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/CommLink/Translation/TranslationTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/Transcript/TranscriptTransformer.php delete mode 100644 app/Transformers/Api/V1/Rsi/Transcript/TranslationTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/AbstractTranslationTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/ArticleTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/CategoryTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/PropertyTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/RelatedArticleTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/TagTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Galactapedia/TranslationTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Manufacturer/ManufacturerTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/AffiliationTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/CelestialObjectTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/JumppointTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/StarsystemLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/StarsystemTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Starmap/SubtypeTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Stat/StatTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Vehicle/ComponentTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Vehicle/VehicleLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizen/Vehicle/VehicleTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/AbstractCommodityTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorAttachmentTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorResistanceTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ClothingLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ClothingTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/Food/FoodLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/Food/FoodTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ItemTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/PersonalInventoryTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/CargoGridTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/CoolerTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/CounterMeasureTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/FuelIntakeTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/FuelTankTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/MiningLaserTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/MissileRackTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/PowerPlantTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/QuantumDrive/QuantumDriveModeTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/QuantumDrive/QuantumDriveTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/RadarTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/SelfDestructTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Shield/ShieldAbsorptionTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Shield/ShieldTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ShipItemDistortionDataTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ShipItemDurabilityDataTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ShipItemHeatDataTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ShipItemPowerDataTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ShipItemTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/ThrusterTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/TurretTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Weapon/MissileDamageTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Weapon/MissileTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Weapon/WeaponDamageTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Weapon/WeaponModeTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/ShipItem/Weapon/WeaponTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/Shop/ShopItemTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/Shop/ShopTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/VehicleHardpointTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/VehicleTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAmmunitionDamageTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAmmunitionTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAttachmentPortsTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalAttachmentsTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalLinkTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalModeTransformer.php delete mode 100644 app/Transformers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalTransformer.php delete mode 100644 app/helpers.php mode change 100644 => 100755 artisan delete mode 100644 config/api.php delete mode 100644 config/broadcasting.php delete mode 100644 config/compile.php delete mode 100644 config/hashing.php delete mode 100644 config/item_sets.php delete mode 100644 config/mediawiki.php delete mode 100644 config/query-builder.php delete mode 100644 config/schedule.php delete mode 100644 config/trustedproxy.php delete mode 100644 config/view.php delete mode 100644 database/factories/Account/User/UserFactory.php delete mode 100644 database/factories/Account/User/UserGroupFactory.php delete mode 100644 database/factories/Rsi/CommLink/Category/CategoryFactory.php delete mode 100644 database/factories/Rsi/CommLink/Channel/ChannelFactory.php delete mode 100644 database/factories/Rsi/CommLink/CommLinkFactory.php delete mode 100644 database/factories/Rsi/CommLink/CommLinkTranslationFactory.php delete mode 100644 database/factories/Rsi/CommLink/Image/ImageFactory.php delete mode 100644 database/factories/Rsi/CommLink/Image/ImageMetadataFactory.php delete mode 100644 database/factories/Rsi/CommLink/Link/LinkFactory.php delete mode 100644 database/factories/Rsi/CommLink/Series/SeriesFactory.php delete mode 100644 database/factories/StarCitizen/Manufacturer/ManufacturerFactory.php delete mode 100644 database/factories/StarCitizen/Manufacturer/ManufacturerTranslationFactory.php delete mode 100644 database/factories/StarCitizen/ProductionNote/ProductionNoteFactory.php delete mode 100644 database/factories/StarCitizen/ProductionNote/ProductionNoteTranslationFactory.php delete mode 100644 database/factories/StarCitizen/ProductionStatus/ProductionStatusFactory.php delete mode 100644 database/factories/StarCitizen/ProductionStatus/ProductionStatusTranslationFactory.php delete mode 100644 database/factories/StarCitizen/Starmap/CelestialObjectFactory.php delete mode 100644 database/factories/StarCitizen/Starmap/JumppointFactory.php delete mode 100644 database/factories/StarCitizen/Starmap/StarsystemFactory.php delete mode 100644 database/factories/StarCitizen/Stat/StatFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Component/ComponentFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Focus/FocusFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Focus/FocusTranslationFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Size/SizeFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Size/SizeTranslationFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Type/TypeFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Type/TypeTranslationFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Vehicle/VehicleFactory.php delete mode 100644 database/factories/StarCitizen/Vehicle/Vehicle/VehicleTranslationFactory.php delete mode 100644 database/factories/System/LanguageFactory.php delete mode 100644 database/migrations/base_structure/accounts/2017_03_20_122456_create_sessions_table.php delete mode 100644 database/migrations/base_structure/accounts/users/2017_08_10_215600_create_users_table.php delete mode 100644 database/migrations/base_structure/accounts/users/2017_08_10_215601_create_user_groups_table.php delete mode 100644 database/migrations/base_structure/accounts/users/2017_08_10_215602_create_user_user_group_table.php delete mode 100644 database/migrations/base_structure/accounts/users/2018_09_13_213113_create_user_settings_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/2018_08_30_100005_create_comm_links_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/2018_08_30_100006_create_comm_link_translations_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/2018_08_30_100008_create_comm_link_comm_link_image_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/2018_08_30_100009_create_comm_link_comm_link_link_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/2018_09_12_143344_create_comm_links_changed_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/category/2018_08_30_100001_create_comm_link_categories_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/channel/2018_08_30_100000_create_comm_link_channels_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/image/2018_08_30_100002_create_comm_link_images_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/image/2020_09_12_140901_create_comm_link_image_hashes_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/image/2020_09_15_143508_create_comm_link_image_metadata_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/image/2023_12_20_173125_create_comm_link_image_tags_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/image/2023_12_20_173141_create_comm_link_image_tag_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/link/2018_08_30_100003_create_comm_link_links_table.php delete mode 100644 database/migrations/base_structure/rsi/comm_link/series/2018_08_30_100002_create_comm_link_series_table.php delete mode 100644 database/migrations/base_structure/sc/2023_05_04_090000_create_sc_manufacturers_table.php delete mode 100644 database/migrations/base_structure/sc/2023_05_05_134631_create_sc_shops_table.php delete mode 100644 database/migrations/base_structure/sc/2023_05_05_134638_create_sc_shop_item_table.php delete mode 100644 database/migrations/base_structure/sc/2024_04_22_194116_create_sc_entity_tags_table.php delete mode 100644 database/migrations/base_structure/sc/ammunition/2024_03_11_195644_create_sc_item_ammunitions_table.php delete mode 100644 database/migrations/base_structure/sc/ammunition/2024_03_11_200119_create_sc_item_ammunition_damages_table.php delete mode 100644 database/migrations/base_structure/sc/ammunition/2024_03_11_200124_create_sc_item_ammunition_damage_falloffs_table.php delete mode 100644 database/migrations/base_structure/sc/ammunition/2024_03_11_200131_create_sc_item_ammunition_piercabilities_table.php delete mode 100644 database/migrations/base_structure/sc/char/2023_05_04_094036_create_sc_clothing_resistances_table.php delete mode 100644 database/migrations/base_structure/sc/char/2025_11_25_175718_create_sc_clothing_radiation_resistances_table.php delete mode 100644 database/migrations/base_structure/sc/char/food/2023_05_04_093440_create_sc_foods_table.php delete mode 100644 database/migrations/base_structure/sc/char/food/2023_05_04_093550_create_sc_food_effects_table.php delete mode 100644 database/migrations/base_structure/sc/char/food/2023_05_04_093621_create_sc_food_effect_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/2023_05_04_094534_create_sc_personal_weapon_modes_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/2023_05_04_094707_create_sc_personal_weapon_ammunitions_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/2023_05_04_094819_create_sc_item_personal_weapon_magazines_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/2023_05_04_095019_create_sc_personal_weapon_ammunition_damages_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/knife/2024_04_13_191203_create_sc_item_knifes_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/knife/2024_04_13_191651_create_sc_melee_combat_configs_table.php delete mode 100644 database/migrations/base_structure/sc/char/weapon/knife/2024_04_13_192321_create_sc_melee_combat_damages_table.php delete mode 100644 database/migrations/base_structure/sc/factions/2024_05_01_133242_create_sc_factions_table.php delete mode 100644 database/migrations/base_structure/sc/factions/2024_05_01_133303_create_sc_faction_relations_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_04_095924_create_sc_item_grenades_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_06_085335_create_sc_item_flight_controllers_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_06_103819_create_sc_item_thrusters_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_06_114538_create_sc_item_coolers_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_06_114556_create_sc_item_power_plants_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_06_114609_create_sc_item_self_destrucs_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_07_192649_create_sc_item_shields_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_07_193119_create_sc_item_fuel_tanks_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_07_193654_create_sc_item_fuel_intakes_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_08_182446_create_sc_item_mining_lasers_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_10_193111_create_sc_item_emps_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_10_193130_create_sc_item_qigs_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_05_24_113227_create_sc_item_armors_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_11_25_211324_create_sc_item_tractorbeams_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2023_11_26_103552_create_sc_item_salvage_modifiers_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2024_03_03_114158_create_sc_item_iron_sights_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/2024_03_09_113259_create_sc_item_hacking_chips_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/bomb/2024_03_02_165734_sc_item_bombs_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/bomb/2024_03_02_165830_sc_item_bomb_damages_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/missile/2023_05_08_135542_create_sc_item_missiles_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/missile/2023_05_08_135654_create_sc_item_missile_damages_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/quantum_drive/2023_05_07_191416_create_sc_item_quantum_drives_table.php delete mode 100644 database/migrations/base_structure/sc/item_specifications/quantum_drive/2023_05_07_191429_create_sc_item_quantum_drive_modes_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_04_090225_create_sc_items_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_04_090341_create_sc_item_ports_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_04_090513_create_sc_item_dimensions_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_04_091000_create_sc_item_translations_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_04_091517_create_sc_item_containers_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_06_091248_create_sc_item_power_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_06_091301_create_sc_item_heat_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_06_091320_create_sc_item_distortion_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_06_091333_create_sc_item_durability_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_05_18_083317_create_sc_item_description_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_06_09_215747_create_sc_item_tags_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_06_09_215749_create_sc_item_tag_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_06_09_215758_create_sc_item_port_tag_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_07_26_104428_create_sc_item_interactions_table.php delete mode 100644 database/migrations/base_structure/sc/items/2023_07_26_104433_create_sc_item_interaction_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_03_09_125854_create_sc_item_weapon_modifier_data_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_03_15_135349_create_item_types_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_03_15_135350_create_item_port_type_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_03_15_135354_create_item_sub_types_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_03_15_135355_create_item_port_type_sub_type_table.php delete mode 100644 database/migrations/base_structure/sc/items/2024_04_22_194242_create_sc_item_entity_tag_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_152514_create_sc_missions_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_152524_create_sc_mission_rewards_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_152548_create_sc_mission_deadlines_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_153127_create_sc_mission_required_missions_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_162532_create_sc_mission_translations_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_163548_create_sc_mission_associated_missions_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_175948_create_sc_mission_types_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_175955_create_sc_mission_givers_table.php delete mode 100644 database/migrations/base_structure/sc/missions/2024_05_01_180032_create_sc_mission_giver_translations_table.php delete mode 100644 database/migrations/base_structure/sc/reputation/2024_05_01_135237_create_sc_reputation_rewards_table.php delete mode 100644 database/migrations/base_structure/sc/reputation/2024_05_01_135252_create_sc_reputation_standings_table.php delete mode 100644 database/migrations/base_structure/sc/reputation/2024_05_01_135358_create_sc_reputation_scopes_table.php delete mode 100644 database/migrations/base_structure/sc/reputation/2024_05_01_135411_create_sc_reputation_scope_standing_table.php delete mode 100644 database/migrations/base_structure/sc/shops/2023_05_05_134631_create_sc_shops_table.php delete mode 100644 database/migrations/base_structure/sc/shops/2023_05_05_134638_create_sc_shop_item_table.php delete mode 100644 database/migrations/base_structure/sc/shops/2023_05_09_140345_create_sc_shop_item_rentals_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/2023_05_04_100304_create_sc_vehicles_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/2023_05_05_204615_create_sc_vehicle_hardpoints_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/2023_05_28_193214_create_sc_vehicle_handlings_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/2023_06_01_131028_create_sc_vehicle_parts_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/2025_05_29_102932_create_sc_vehicle_cargo_grids_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/weapon/2023_05_08_074448_create_sc_vehicle_weapons_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/weapon/2023_05_08_074509_create_sc_vehicle_weapon_ammunitions_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/weapon/2023_05_08_074520_create_sc_vehicle_weapon_ammunition_damages_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/weapon/2023_05_08_074531_create_sc_vehicle_weapon_modes_table.php delete mode 100644 database/migrations/base_structure/sc/vehicles/weapon/2023_05_08_074539_create_sc_vehicle_weapon_regeneration_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_04_15_000000_create_sc_unpacked_items.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_04_16_115633_create_sc_unpacked_vehicles_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_04_21_164620_create_sc_unpacked_item_translations_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_02_090429_create_sc_unpacked_vehicle_hardpoints_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_02_103840_create_sc_unpacked_vehicle_turrets_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_07_134341_create_sc_unpacked_vehicle_fuel_tanks_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_07_195701_create_sc_unpacked_vehicle_thrusters_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_08_094952_create_sc_unpacked_vehicle_self_destructs_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_10_091124_create_sc_unpacked_vehicle_fuel_intakes_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_11_103854_create_sc_unpacked_vehicle_counter_measures_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_11_121024_create_sc_unpacked_vehicle_radars_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_14_132233_create_sc_unpacked_vehicle_mining_lasers_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_18_130001_create_sc_unpacked_item_volumes_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2021_12_31_094601_create_sc_unpacked_clothing_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2022_05_22_174403_create_sc_unpacked_vehicle_cargo_grids_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/2022_05_28_191051_create_sc_unpacked_vehicle_personal_inventories.php delete mode 100644 database/migrations/base_structure/sc_unpacked/char_armor/2021_04_21_154242_create_sc_unpacked_char_armor_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/char_armor/2021_04_21_155314_create_sc_unpacked_char_armor_attachments.php delete mode 100644 database/migrations/base_structure/sc_unpacked/char_armor/2021_04_21_155422_create_sc_unpacked_char_armor_attachment.php delete mode 100644 database/migrations/base_structure/sc_unpacked/char_armor/2021_04_21_155430_create_sc_unpacked_char_armor_resistances_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/food/2022_08_27_150936_create_sc_unpacked_foods_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/food/2022_08_27_151037_create_sc_unpacked_food_effects_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/food/2022_08_27_151046_create_sc_unpacked_food_effect_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_04_16_184354_create_sc_unpacked_personal_weapons_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_04_16_185952_create_sc_unpacked_personal_weapon_modes_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_05_03_083254_create_sc_unpacked_personal_weapon_ammunitions_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_05_03_083254_create_sc_unpacked_personal_weapon_magazines_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_05_03_090000_create_sc_unpacked_personal_weapon_attachment_ports_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_05_03_090010_create_sc_unpacked_personal_weapon_attachments_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2021_05_03_100000_create_sc_unpacked_personal_weapon_ammunition_damages_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2022_08_24_172248_create_sc_unpacked_personal_weapon_optic_attachments.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2022_08_24_172249_create_sc_unpacked_personal_weapon_magazine_attachments.php delete mode 100644 database/migrations/base_structure/sc_unpacked/personal_weapon/2022_08_24_195229_create_sc_unpacked_personal_weapon_attachment_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164221_create_sc_unpacked_ship_items_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164222_create_sc_unpacked_ship_item_power_data_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164230_create_sc_unpacked_ship_item_heat_data_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164240_create_sc_unpacked_ship_item_distortion_data_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164250_create_sc_unpacked_ship_item_durability_data_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164358_create_sc_unpacked_ship_coolers_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/2021_04_28_164359_create_sc_unpacked_ship_power_plants_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/quantum_drive/2021_04_28_164401_create_sc_unpacked_ship_quantum_drives_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/quantum_drive/2021_04_28_164420_create_sc_unpacked_ship_quantum_drive_modes_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/shield/2021_04_28_164400_create_sc_unpacked_ship_shields_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/shield/2021_04_28_164410_create_sc_unpacked_ship_shield_absorptions_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_04_30_080000_create_sc_unpacked_ship_weapons_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_04_30_080010_create_sc_unpacked_ship_weapon_modes_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_04_30_080020_create_sc_unpacked_ship_weapon_damages_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_04_30_100000_create_sc_unpacked_ship_missiles_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_12_02_125107_create_sc_unpacked_ship_missile_racks_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/shop/2021_04_21_160000_create_sc_unpacked_shops_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/shop/2021_04_21_160310_create_sc_unpacked_shop_item_table.php delete mode 100644 database/migrations/base_structure/sc_unpacked/shop/2021_10_26_112619_create_sc_unpacked_shop_item_rental_table.php delete mode 100644 database/migrations/base_structure/starcitizen/2018_03_16_140517_create_stats_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_02_202306_create_galactapedia_categories_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_02_205142_create_galactapedia_articles_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_02_205328_create_galactapedia_article_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_194400_create_galactapedia_article_properties_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_195236_create_galactapedia_article_categories_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_195253_create_galactapedia_tags_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_195302_create_galactapedia_article_tags_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_202437_create_galactapedia_article_relates_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_202544_create_galactapedia_templates_table.php delete mode 100644 database/migrations/base_structure/starcitizen/galactapedia/2021_02_07_202605_create_galactapedia_article_templates_table.php delete mode 100644 database/migrations/base_structure/starcitizen/manufacturer/2018_01_01_000000_create_manufacturers_table.php delete mode 100644 database/migrations/base_structure/starcitizen/manufacturer/2018_01_01_000001_create_manufacturer_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/production_note/2018_01_02_000000_create_production_notes_table.php delete mode 100644 database/migrations/base_structure/starcitizen/production_note/2018_01_02_000001_create_production_note_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/production_status/2018_01_03_000000_create_production_statuses_table.php delete mode 100644 database/migrations/base_structure/starcitizen/production_status/2018_01_03_000001_create_production_status_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/2018_08_04_000001_create_affiliations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/celestialobject/2018_08_06_000001_create_celestial_object_subtypes_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/celestialobject/2018_08_06_000002_create_celestial_objects_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/celestialobject/2018_08_06_000003_create_celestial_object_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/celestialobject/2020_09_27_142958_create_celestial_object_affiliation_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/jumppoint/2018_08_07_000001_create_jumppoints_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/starsystem/2018_08_05_000001_create_starsystems_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/starsystem/2018_08_05_000002_create_starsystem_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/starmap/starsystem/2020_09_27_142923_create_starsystem_affiliation_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/focus/2018_01_04_000000_create_vehicle_foci_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/focus/2018_01_04_000001_create_vehicle_focus_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/size/2018_01_05_000001_create_vehicle_sizes_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/size/2018_01_05_000002_create_vehicle_size_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/type/2018_01_06_000001_create_vehicle_types_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/type/2018_01_06_000002_create_vehicle_type_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2018_02_01_000000_create_vehicles_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2018_02_01_000001_create_vehicle_translations_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2018_02_01_000002_create_vehicle_vehicle_focus_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2020_09_18_124433_create_vehicle_components_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2020_09_18_124902_create_vehicle_component_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2023_05_25_153213_create_vehicle_loaners_table.php delete mode 100644 database/migrations/base_structure/starcitizen/vehicle/vehicle/2024_01_07_132833_create_vehicle_skus_table.php delete mode 100644 database/migrations/base_structure/system/2017_01_01_000000_create_languages_table.php delete mode 100644 database/migrations/base_structure/system/2017_03_23_122820_create_jobs_table.php delete mode 100644 database/migrations/base_structure/system/2017_04_23_174806_create_failed_jobs_table.php delete mode 100644 database/migrations/base_structure/system/2018_07_27_183906_create_model_changelogs_table.php delete mode 100644 database/migrations/base_structure/transcript/2019_10_19_213903_create_transcripts_table.php delete mode 100644 database/migrations/base_structure/transcript/2019_10_19_213933_create_transcript_translations_table.php delete mode 100644 database/migrations/base_structure/transcript/2022_01_08_101328_create_new_transcripts_table.php delete mode 100644 database/migrations/base_structure/transcript/2022_01_08_102115_create_new_transcripts_translations_table.php delete mode 100644 database/migrations/update/.gitkeep delete mode 100644 database/migrations/update/2024_01_02_175450_add_fulltext_indices.php delete mode 100644 database/migrations/update/rsi/comm_link/image/2023_12_23_162543_add_base_image_id_to_comm_link_images_table.php delete mode 100644 database/migrations/update/rsi/comm_link/image/2023_12_23_194807_add_pdq_hash_to_comm_link_image_hashes_table.php delete mode 100644 database/migrations/update/sc/2023_05_16_215535_add_health_attribute_to_sc_vehicles_table.php delete mode 100644 database/migrations/update/sc/2023_05_23_154355_add_ir_temp_threshold_attribute_to_sc_item_heat_data_table.php delete mode 100644 database/migrations/update/sc/2023_06_17_101824_add_sc_table_indices.php delete mode 100644 database/migrations/update/sc/2023_07_19_111340_add_mass_attribute_to_sc_items_table.php delete mode 100644 database/migrations/update/sc/2023_07_24_163037_add_decay_delay_attribute_to_sc_item_distortion_data_table.php delete mode 100644 database/migrations/update/sc/2023_11_25_213235_add_params_to_sc_item_missiles_table.php delete mode 100644 database/migrations/update/sc/2024_03_02_092126_add_base_version_id_to_sc_items_table.php delete mode 100644 database/migrations/update/sc/2024_03_11_203046_add_ammunition_uuid_to_personal_weapon_magazines_table.php delete mode 100644 database/migrations/update/sc/2024_03_12_203123_add_ammunition_uuid_to_sc_vehicle_weapons_table.php delete mode 100644 database/migrations/update/sc/2024_12_22_111420_add_nullable_to_sc_fuel_tanks_table.php delete mode 100644 database/migrations/update/sc/2025_05_26_203647_add_cargo_capacity_to_sc_vehicles_table.php delete mode 100644 database/migrations/update/sc/2025_05_26_212526_update_sc_item_flight_controllers_table.php delete mode 100644 database/migrations/update/sc/2025_05_27_194600_add_shield_face_type_to_sc_vehicles_table.php delete mode 100644 database/migrations/update/sc_unpacked/2021_10_26_095453_add_uuid_to_star_citizen_unpacked_vehicles_table.php delete mode 100644 database/migrations/update/sc_unpacked/2021_11_19_190107_add_dimension_attributes_to_star_citizen_unpacked_vehicles_table.php delete mode 100644 database/migrations/update/sc_unpacked/2021_12_11_094730_update_health_attributes_on_star_citizen_unpacked_vehicles_table.php delete mode 100644 database/migrations/update/sc_unpacked/2021_12_11_173230_add_pitch_yaw_roll_to_sc_unpacked_vehicles_table.php delete mode 100644 database/migrations/update/sc_unpacked/2022_08_24_171653_update_attributes_on_sc_unpacked_personal_weapon_attachments.php delete mode 100644 database/migrations/update/sc_unpacked/2022_08_24_195651_drop_star_citizen_unpacked_personal_weapon_magazines_table.php delete mode 100644 database/migrations/update/starcitizen/galactapedia/2021_05_17_091528_add_disabled_attribute_to_galactapedia_articles_table.php delete mode 100644 database/migrations/update/starcitizen/galactapedia/2021_12_29_094000_add_in_wiki_attribute_to_galactapedia_articles_table.php delete mode 100644 database/migrations/update/starcitizen/manufacturer/2020_09_16_123333_remove_unique_name_index_from_manufacturers.php delete mode 100644 database/migrations/update/starcitizen/starmap/celestialobject/2021_10_26_133450_make_appearance_nullable_in_celestial_objects_table.php delete mode 100644 database/migrations/update/starcitizen/vehicle/2020_12_09_193411_add_msrp_attribute_to_vehicles_table.php delete mode 100644 database/migrations/update/starcitizen/vehicle/2024_01_07_131409_add_pledge_link_to_vehicles_table.php delete mode 100644 database/migrations/update/system/2024_05_09_103833_change_locale_code_attribute_in_languages_table.php delete mode 100644 database/migrations/update/users/2022_05_05_222303_remove_email_key_from_users_table.php delete mode 100644 database/migrations/update/users/2023_02_24_100340_add_language_to_user_settings_table.php delete mode 100644 database/seeders/Accounts/UserGroupTableSeeder.php delete mode 100644 docker-build.sh delete mode 100644 docker-compose.yml delete mode 100644 docker/ofelia.ini delete mode 100644 docker/schedule.sh delete mode 100644 docker/start.sh delete mode 100644 docker/vhost.conf delete mode 100644 lang/de.json delete mode 100644 lang/de/admin/starmap/jumppointtunnels/index.php delete mode 100644 lang/de/auth.php delete mode 100644 lang/de/crud.php delete mode 100644 lang/de/pagination.php delete mode 100644 lang/de/passwords.php delete mode 100644 lang/de/validation.php delete mode 100644 lang/en.json delete mode 100644 lang/en/admin/starmap/celestialobjects/index.php delete mode 100644 lang/en/admin/starmap/jumppointtunnels/index.php delete mode 100644 lang/en/auth.php delete mode 100644 lang/en/crud.php delete mode 100644 lang/en/pagination.php delete mode 100644 lang/en/passwords.php delete mode 100644 lang/en/validation.php delete mode 100644 public/css/app.css delete mode 100644 public/css/skin/lightgray/content.inline.min.css delete mode 100644 public/css/skin/lightgray/content.min.css delete mode 100644 public/css/skin/lightgray/content.mobile.min.css delete mode 100644 public/css/skin/lightgray/fonts/tinymce-mobile.woff delete mode 100644 public/css/skin/lightgray/fonts/tinymce-small.eot delete mode 100644 public/css/skin/lightgray/fonts/tinymce-small.svg delete mode 100644 public/css/skin/lightgray/fonts/tinymce-small.ttf delete mode 100644 public/css/skin/lightgray/fonts/tinymce-small.woff delete mode 100644 public/css/skin/lightgray/fonts/tinymce.eot delete mode 100644 public/css/skin/lightgray/fonts/tinymce.svg delete mode 100644 public/css/skin/lightgray/fonts/tinymce.ttf delete mode 100644 public/css/skin/lightgray/fonts/tinymce.woff delete mode 100644 public/css/skin/lightgray/img/anchor.gif delete mode 100644 public/css/skin/lightgray/img/loader.gif delete mode 100644 public/css/skin/lightgray/img/object.gif delete mode 100644 public/css/skin/lightgray/img/trans.gif delete mode 100644 public/css/skin/lightgray/skin.min.css delete mode 100644 public/css/skin/lightgray/skin.mobile.min.css delete mode 100644 public/js/Chart.min.js delete mode 100644 public/js/app.js delete mode 100644 public/js/app.js.LICENSE.txt delete mode 100644 public/media/images/api_index.jpg delete mode 100644 public/media/images/errors/400.jpg delete mode 100644 public/media/images/errors/401.jpg delete mode 100644 public/media/images/errors/403.jpg delete mode 100644 public/media/images/errors/404.jpg delete mode 100644 public/media/images/errors/500.jpg delete mode 100644 public/media/images/errors/503.jpg delete mode 100644 public/mix-manifest.json delete mode 100644 public/web.config delete mode 100644 resources/assets/fontawesome/js/README.md delete mode 100644 resources/assets/fontawesome/js/fontawesome.js delete mode 100644 resources/assets/fontawesome/js/fontawesome.min.js delete mode 100644 resources/assets/fontawesome/js/packs/brands.js delete mode 100644 resources/assets/fontawesome/js/packs/brands.min.js delete mode 100644 resources/assets/fontawesome/js/packs/light.js delete mode 100644 resources/assets/fontawesome/js/packs/light.min.js delete mode 100644 resources/assets/fontawesome/js/packs/regular.js delete mode 100644 resources/assets/fontawesome/js/packs/regular.min.js delete mode 100644 resources/assets/fontawesome/js/packs/solid.js delete mode 100644 resources/assets/fontawesome/js/packs/solid.min.js delete mode 100644 resources/assets/fontawesome/js/v4-shims.js delete mode 100644 resources/assets/fontawesome/js/v4-shims.min.js delete mode 100644 resources/assets/fonts/orbitron-light-webfont.ttf delete mode 100644 resources/assets/fonts/orbitron-medium-webfont.ttf delete mode 100644 resources/assets/js/app.js delete mode 100644 resources/assets/js/bootstrap.js delete mode 100644 resources/assets/js/components/CelestialObjectGenerator.vue delete mode 100644 resources/assets/js/components/CommLinkLiveSearch.vue delete mode 100644 resources/assets/js/components/GalactapediaLiveSearch.vue delete mode 100644 resources/assets/js/components/ImageUploadModal.vue delete mode 100644 resources/assets/js/components/ItemLiveSearch.vue delete mode 100644 resources/assets/js/components/ItemPriceTable.vue delete mode 100644 resources/assets/js/icon.js delete mode 100644 resources/assets/js/snarkdown.js delete mode 100644 resources/assets/sass/_alert.scss delete mode 100644 resources/assets/sass/_button.scss delete mode 100644 resources/assets/sass/_card.scss delete mode 100644 resources/assets/sass/_custom.scss delete mode 100644 resources/assets/sass/_defaults.scss delete mode 100644 resources/assets/sass/_image-card.scss delete mode 100644 resources/assets/sass/_modern-login.scss delete mode 100644 resources/assets/sass/_modern-root.scss delete mode 100644 resources/assets/sass/_modern-scrollbar.scss delete mode 100644 resources/assets/sass/_modern.scss delete mode 100644 resources/assets/sass/_nav.scss delete mode 100644 resources/assets/sass/_text.scss delete mode 100644 resources/assets/sass/_variables.scss delete mode 100644 resources/assets/sass/app.scss delete mode 100644 resources/views/components/card.blade.php delete mode 100644 resources/views/components/changelog_list.blade.php delete mode 100644 resources/views/components/comm_links/create_tag_form.blade.php delete mode 100644 resources/views/components/comm_links/image_info_card.blade.php delete mode 100644 resources/views/components/edit_delete_block.blade.php delete mode 100644 resources/views/components/edit_translation.blade.php delete mode 100644 resources/views/components/elements/container.blade.php delete mode 100644 resources/views/components/elements/icon.blade.php delete mode 100644 resources/views/components/elements/input.blade.php delete mode 100644 resources/views/components/errors.blade.php delete mode 100644 resources/views/components/forms/fields/DELETE.blade.php delete mode 100644 resources/views/components/forms/fields/PATCH.blade.php delete mode 100644 resources/views/components/forms/fields/PUT.blade.php delete mode 100644 resources/views/components/forms/fields/method_field.blade.php delete mode 100644 resources/views/components/forms/form-group.blade.php delete mode 100644 resources/views/components/forms/form.blade.php delete mode 100644 resources/views/components/heading.blade.php delete mode 100644 resources/views/components/init_dataTables.blade.php delete mode 100644 resources/views/components/messages.blade.php delete mode 100644 resources/views/components/navs/nav_element.blade.php delete mode 100644 resources/views/components/navs/sidebar_section.blade.php delete mode 100644 resources/views/components/navs/top_nav.blade.php delete mode 100644 resources/views/components/shorturls/expired_at_field.blade.php delete mode 100644 resources/views/components/sidebar_imprint.blade.php delete mode 100644 resources/views/components/starcitizenunpacked/shop_table.blade.php delete mode 100644 resources/views/components/starmap/celestial_object.blade.php delete mode 100644 resources/views/components/translation_table.blade.php delete mode 100644 resources/views/components/upload_modal.blade.php delete mode 100644 resources/views/components/vehicle_components.blade.php delete mode 100644 resources/views/emails/rsi/comm_link/comm_link_changed.blade.php delete mode 100644 resources/views/emails/rsi/comm_link/new_comm_link_downloaded.blade.php delete mode 100644 resources/views/emails/starcitizen/shipmatrix/structure_changed.blade.php delete mode 100644 resources/views/errors/400.blade.php delete mode 100644 resources/views/errors/401.blade.php delete mode 100644 resources/views/errors/403.blade.php delete mode 100644 resources/views/errors/404.blade.php delete mode 100644 resources/views/errors/500.blade.php delete mode 100644 resources/views/errors/503.blade.php delete mode 100644 resources/views/errors/layouts/default.blade.php delete mode 100644 resources/views/layouts/base.blade.php delete mode 100644 resources/views/layouts/default.blade.php delete mode 100644 resources/views/layouts/full_width.blade.php delete mode 100644 resources/views/vendor/mail/html/notification.blade.php delete mode 100644 resources/views/vendor/mail/html/themes/default.css delete mode 100644 resources/views/vendor/mail/text/notification.blade.php delete mode 100644 resources/views/web/account/index.blade.php delete mode 100644 resources/views/web/auth/login.blade.php delete mode 100644 resources/views/web/changelog/index.blade.php delete mode 100644 resources/views/web/dashboard.blade.php delete mode 100644 resources/views/web/jobs/failed_index.blade.php delete mode 100644 resources/views/web/layouts/config.blade.php delete mode 100644 resources/views/web/layouts/default.blade.php delete mode 100644 resources/views/web/layouts/default_wide.blade.php delete mode 100644 resources/views/web/layouts/full_width.blade.php delete mode 100644 resources/views/web/menu/app_links.blade.php delete mode 100644 resources/views/web/menu/comm_links.blade.php delete mode 100644 resources/views/web/menu/documentation.blade.php delete mode 100644 resources/views/web/menu/galactapedia.blade.php delete mode 100644 resources/views/web/menu/login_logout.blade.php delete mode 100644 resources/views/web/menu/main.blade.php delete mode 100644 resources/views/web/menu/starmap.blade.php delete mode 100644 resources/views/web/menu/stats.blade.php delete mode 100644 resources/views/web/menu/transcripts.blade.php delete mode 100644 resources/views/web/menu/translations.blade.php delete mode 100644 resources/views/web/menu/universe.blade.php delete mode 100644 resources/views/web/menu/user.blade.php delete mode 100644 resources/views/web/menu/vehicles.blade.php delete mode 100644 resources/views/web/rsi/comm_links/categories/index.blade.php delete mode 100644 resources/views/web/rsi/comm_links/channels/index.blade.php delete mode 100644 resources/views/web/rsi/comm_links/edit.blade.php delete mode 100644 resources/views/web/rsi/comm_links/images/edit-tags.blade.php delete mode 100644 resources/views/web/rsi/comm_links/images/index.blade.php delete mode 100644 resources/views/web/rsi/comm_links/images/show.blade.php delete mode 100644 resources/views/web/rsi/comm_links/index.blade.php delete mode 100644 resources/views/web/rsi/comm_links/preview.blade.php delete mode 100644 resources/views/web/rsi/comm_links/search.blade.php delete mode 100644 resources/views/web/rsi/comm_links/series/index.blade.php delete mode 100644 resources/views/web/rsi/comm_links/show.blade.php delete mode 100644 resources/views/web/rsi/comm_links/tags/edit.blade.php delete mode 100644 resources/views/web/rsi/comm_links/tags/index.blade.php delete mode 100644 resources/views/web/rsi/stats/index.blade.php delete mode 100644 resources/views/web/starcitizen/galactapedia/index.blade.php delete mode 100644 resources/views/web/starcitizen/galactapedia/show.blade.php delete mode 100644 resources/views/web/starcitizen/manufacturers/edit.blade.php delete mode 100644 resources/views/web/starcitizen/manufacturers/index.blade.php delete mode 100644 resources/views/web/starcitizen/production_notes/edit.blade.php delete mode 100644 resources/views/web/starcitizen/production_notes/index.blade.php delete mode 100644 resources/views/web/starcitizen/production_statuses/edit.blade.php delete mode 100644 resources/views/web/starcitizen/production_statuses/index.blade.php delete mode 100644 resources/views/web/starcitizen/starmap/celestial_objects/index.blade.php delete mode 100644 resources/views/web/starcitizen/starmap/jumppointtunnels/index.blade.php delete mode 100644 resources/views/web/starcitizen/starmap/starsystems/index.blade.php delete mode 100644 resources/views/web/starcitizen/starmap/starsystems/show.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/foci/edit.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/foci/index.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/ground_vehicles/edit.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/ground_vehicles/index.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/ships/edit.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/ships/index.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/sizes/edit.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/sizes/index.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/types/edit.blade.php delete mode 100644 resources/views/web/starcitizen/vehicles/types/index.blade.php delete mode 100644 resources/views/web/starcitizenunpacked/item/index.blade.php delete mode 100644 resources/views/web/starcitizenunpacked/item/show.blade.php delete mode 100644 resources/views/web/starcitizenunpacked/vehicle/index.blade.php delete mode 100644 resources/views/web/transcripts/edit.blade.php delete mode 100644 resources/views/web/transcripts/index.blade.php delete mode 100644 resources/views/web/transcripts/show.blade.php delete mode 100644 resources/views/web/users/edit.blade.php delete mode 100644 resources/views/web/users/index.blade.php delete mode 100644 routes/api/api_v1.php delete mode 100644 routes/api/api_v2.php delete mode 100644 routes/api/api_v3.php delete mode 100644 routes/web/user.php delete mode 100644 server.php delete mode 100644 storage/framework/testing/ChrisRobertsWCfilm1.jpg delete mode 100644 storage/framework/testing/comm_links/12663/2020-11-22_222222.html delete mode 100755 storage/framework/testing/scunpacked/items/987_jacket_01_01_01.json delete mode 100755 storage/framework/testing/scunpacked/items/arma_barrel_comp_s1.json delete mode 100755 storage/framework/testing/scunpacked/items/clda_utility_heavy_backpack_01_01_01.json delete mode 100755 storage/framework/testing/scunpacked/items/qdrv_wetk_s03_balandin_scitem.json delete mode 100755 storage/framework/testing/scunpacked/labels.json delete mode 100755 storage/framework/testing/scunpacked/manufacturers.json delete mode 100755 storage/framework/testing/scunpacked/ships.json delete mode 100755 storage/framework/testing/scunpacked/ships/aegs_avenger_stalker-raw.json delete mode 100755 storage/framework/testing/scunpacked/ships/aegs_avenger_stalker.json delete mode 100644 tests/CreatesApplication.php delete mode 100644 tests/Feature/Api/ItemApiTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/CommLinksScheduleTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Download/DownloadCommLinkTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Download/Image/DownloadCommLinkImagesTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Download/ReDownloadCommLinksTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Image/CreateImageHashesTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Image/CreateImageMetadataTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Image/SyncImageIdsTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Import/ImportCommLinkTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Translate/TranslateCommLinksTest.php delete mode 100644 tests/Feature/Console/Commands/CommLink/Wiki/CreateCommLinkWikiPagesTest.php delete mode 100644 tests/Feature/Console/Commands/ShipMatrix/Download/DownloadShipMatrixTest.php delete mode 100644 tests/Feature/Console/Commands/ShipMatrix/Import/ImportShipMatrixTest.php delete mode 100644 tests/Feature/Console/Commands/Starmap/Download/DownloadStarmapTest.php delete mode 100644 tests/Feature/Console/Commands/Starmap/Import/ImportStarmapTest.php delete mode 100644 tests/Feature/Console/Commands/Stat/Download/DownloadStatsTest.php delete mode 100644 tests/Feature/Console/Commands/Stat/Import/ImportStatsTest.php delete mode 100644 tests/Feature/Controller/Api/V1/ApiTestCase.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/Category/CategoryControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/Channel/ChannelControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/CommLinkControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/CommLinkSearchControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/Image/ImageControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/Rsi/CommLink/Series/SeriesControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/ManufacturerControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/StarCitizenTestCase.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/StatControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/Vehicle/GroundVehicleControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/Vehicle/ShipControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V1/StarCitizen/Vehicle/VehicleControllerTestCase.php delete mode 100644 tests/Feature/Controller/Api/V2/ItemControllerTest.php delete mode 100644 tests/Feature/Controller/Api/V2/ItemRelatedItemsTest.php delete mode 100644 tests/Feature/Controller/Api/V2/VehicleControllerTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Account/AccountControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Auth/UserAuthTest.php delete mode 100644 tests/Feature/Controller/Web/Changelog/ChangelogControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Changelog/ChangelogControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Changelog/ChangelogControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Changelog/ChangelogTestCase.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Dashboard/DashboardControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Category/CategoryControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Channel/ChannelControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/CommLinkControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Image/ImageControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Search/CommLinkControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Search/CommLinkSearchControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/Rsi/CommLink/Series/SeriesControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Manufacturer/ManufacturerControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionNote/ProductionNoteControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/ProductionStatus/ProductionStatusControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/StarCitizenTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Focus/FocusControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Ship/ShipControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Size/SizeControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/StarCitizen/Vehicle/Type/TypeControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerBlockedTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerBureaucratTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerMitarbeiterTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerSichterTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerSysopTest.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerTestCase.php delete mode 100644 tests/Feature/Controller/Web/User/UserControllerUserTest.php delete mode 100644 tests/Feature/Controller/Web/UserTestCase.php delete mode 100644 tests/Feature/Jobs/Api/StarCitizen/Stat/DownloadStatsJobTest.php delete mode 100644 tests/Feature/Jobs/Api/StarCitizen/Stat/Import/ImportStatJobTest.php delete mode 100644 tests/Feature/Jobs/Api/StarCitizen/Vehicle/DownloadShipMatrixTest.php delete mode 100644 tests/Feature/Jobs/Api/StarCitizen/Vehicle/Import/ImportShipMatrixTest.php delete mode 100644 tests/Feature/Jobs/Api/StarCitizen/Vehicle/Import/ImportVehicleTest.php delete mode 100644 tests/Feature/Jobs/Rsi/CommLink/Download/DownloadCommLinkTest.php delete mode 100644 tests/Feature/Jobs/Rsi/CommLink/Import/ImportCommLinkTest.php delete mode 100644 tests/Feature/Notification/Rsi/CommLink/CommLinkChangedTest.php delete mode 100644 tests/Feature/Notification/Rsi/CommLink/SendNewCommLinkNotificationTest.php delete mode 100644 tests/Feature/Services/Parser/CommLink/Content/ContentExtractorFactoryTest.php delete mode 100644 tests/Feature/Services/Parser/CommLink/ImageTest.php delete mode 100644 tests/Feature/Services/Parser/CommLink/ParseCommLinkTest.php delete mode 100644 tests/Feature/Services/Parser/ShipMatrix/ParseVehicleTest.php delete mode 100644 tests/Feature/Services/Parser/Starmap/ParseStarsystemTest.php delete mode 100644 tests/Unit/.gitkeep rename app/Models/SC/Item/ItemDescriptionData.php => v2/app/Models/SC/Item/ItemTranslation.php (55%) rename {database => v2/database}/migrations/base_structure/sc_unpacked/ship_item/weapon/2021_04_30_1100000_create_sc_unpacked_ship_missile_damages_table.php (100%) rename {database => v2/database}/migrations/update/rsi/comm_link/2018_10_16_134659_add_proofread_flag_to_comm_link_translations_table.php (100%) create mode 100644 v2/storage/framework/cache/.gitignore rename {tests => v2/tests}/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerBureaucratTest.php (91%) rename {tests => v2/tests}/Feature/Controller/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleControllerMitarbeiterTest.php (91%) delete mode 100644 webpack.mix.js diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 92b8825a9..000000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -.git -.github -node_modules -vendor -resources/assets -bootstrap/cache/* \ No newline at end of file diff --git a/.env.ci b/.env.ci deleted file mode 100644 index 2358c2a34..000000000 --- a/.env.ci +++ /dev/null @@ -1,15 +0,0 @@ -APP_NAME=API_CI -APP_ENV=local -APP_KEY= -APP_DEBUG=true -APP_URL=http://127.0.0.1:8000 - -DB_CONNECTION=sqlite -DB_DATABASE=db.sqlite -QUEUE_DRIVER=sync - -ADMIN_AUTH_USE_STUB=true - - -SC_DATA_VERSION=9.99.9 -SC_DATA_PATH=framework/testing/scunpacked \ No newline at end of file diff --git a/.gitattributes b/.gitattributes index a8763f8ef..fcb21d396 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,11 @@ -* text=auto -*.css linguist-vendored -*.scss linguist-vendored +* text=auto eol=lf + +*.blade.php diff=html +*.css diff=css +*.html diff=html +*.md diff=markdown +*.php diff=php + +/.github export-ignore +CHANGELOG.md export-ignore +.styleci.yml export-ignore diff --git a/.gitignore b/.gitignore index 9c1406b61..0e4753201 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,29 @@ +*.log +.DS_Store +.env +.env.backup +.env.production +.phpactor.json +.phpunit.result.cache +/.fleet +/.idea +/.nova +/.phpunit.cache +/.vscode +/.zed +/auth.json /node_modules +/public/build +/public/hot /public/storage /storage/*.key +/storage/pail /vendor -/.idea Homestead.json Homestead.yaml -.env -.env.example -composer.phar -/Vagrantfile -/_ide_helper.php -/.phpstorm.meta.php -/.phpunit.result.cache -/packages -/.php_cs.cache -./.php-cs-fixer.cache -./*.cache \ No newline at end of file +Thumbs.db +/v2 +CLAUDE.md +.junie +.claude +AGENTS.md diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 50f17df67..000000000 --- a/.gitmodules +++ /dev/null @@ -1,6 +0,0 @@ -[submodule "storage/app/api/scunpacked-data"] - path = storage/app/api/scunpacked-data - url = https://github.com/StarCitizenWiki/scunpacked-data.git -[submodule "storage/app/api/ScToolBoxLocales"] - path = storage/app/api/ScToolBoxLocales - url = https://github.com/StarCitizenToolBox/LocalizationData diff --git a/.phpcs.xml b/.phpcs.xml deleted file mode 100644 index 79393d441..000000000 --- a/.phpcs.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - PSR12 - minor customizations - - - - - - - - - - - - - - - - - - ./app - - - \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index bf530a02e..000000000 --- a/Dockerfile +++ /dev/null @@ -1,104 +0,0 @@ -### Stage 1: build PHP extensions on PHP 8.4 -FROM php:8.4-apache AS extensions - -LABEL stage=intermediate - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - libicu-dev \ - zlib1g-dev \ - libzip-dev \ - libpng-dev \ - libjpeg62-turbo-dev \ - libwebp-dev \ - libfreetype6-dev \ - libgmp-dev \ - libpq-dev \ - libxml2-dev \ - libonig-dev; \ - rm -rf /var/lib/apt/lists/* - -RUN set -eux; \ - docker-php-ext-install -j"$(nproc)" bcmath gmp intl opcache pdo_mysql zip - -RUN set -eux; \ - docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp; \ - docker-php-ext-install -j"$(nproc)" gd - -RUN set -eux; \ - { \ - echo 'opcache.enable=1'; \ - echo 'opcache.memory_consumption=256'; \ - echo 'opcache.interned_strings_buffer=16'; \ - echo 'opcache.max_accelerated_files=16000'; \ - echo 'opcache.validate_timestamps=0'; \ - echo 'opcache.load_comments=Off'; \ - echo 'opcache.save_comments=1'; \ - echo 'opcache.fast_shutdown=0'; \ - } > /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini - -### Stage 2: composer install on PHP 8.4 -FROM php:8.4-apache AS api - -LABEL stage=intermediate -WORKDIR /api - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends zip unzip git; \ - rm -rf /var/lib/apt/lists/* - -COPY --from=composer:2 /usr/bin/composer /usr/bin/composer - -COPY --chown=www-data:www-data composer.json composer.lock /api/ - -RUN chown -R www-data:www-data /api && mkdir -p /api/vendor && chown -R www-data:www-data /api/vendor -USER www-data - -RUN set -eux; \ - composer install --no-dev --ignore-platform-reqs --no-ansi --no-autoloader --no-interaction --no-scripts - -COPY --chown=www-data:www-data / /api - -RUN rm -rf storage/app/api/scunpacked-data storage/app/api/ScToolBoxLocales - -RUN composer dump-autoload --optimize --classmap-authoritative - -### Stage 3: final runtime image on PHP 8.4 -FROM php:8.4-apache - -USER root -WORKDIR /var/www/html - -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ffmpeg \ - libfreetype6 \ - libjpeg62-turbo \ - libwebp7 \ - libpng16-16 \ - libzip5; \ - rm -rf /var/lib/apt/lists/* - -COPY --chown=www-data:www-data --from=api /api /var/www/html -COPY --from=extensions /usr/local/etc/php/conf.d/ /usr/local/etc/php/conf.d/ -COPY --from=extensions /usr/local/lib/php/extensions/ /usr/local/lib/php/extensions/ - -COPY ./docker/vhost.conf /etc/apache2/sites-available/000-default.conf -COPY --chown=www-data:www-data --chmod=770 ./docker/start.sh /usr/local/bin/start -COPY --chown=www-data:www-data --chmod=770 ./docker/schedule.sh /usr/local/bin/schedule - -RUN set -eux; \ - echo 'memory_limit = 1G' > /usr/local/etc/php/conf.d/docker-php-memlimit.ini; \ - echo 'max_execution_time = 60' > /usr/local/etc/php/conf.d/docker-php-executiontime.ini; \ - a2enmod rewrite - -USER www-data - -RUN set -eux; \ - php artisan storage:link; \ - php artisan optimize - -CMD ["/usr/local/bin/start"] diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 52b6789ea..000000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2016 Star Citizen Wiki - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/app/Console/Commands/AbstractQueueCommand.php b/app/Console/Commands/AbstractQueueCommand.php deleted file mode 100644 index f9e0215a1..000000000 --- a/app/Console/Commands/AbstractQueueCommand.php +++ /dev/null @@ -1,81 +0,0 @@ -output === null) { - return; - } - - parent::info($string, $verbosity); - } - - /** - * {@inheritDoc} - */ - public function error($string, $verbosity = null): void - { - if ($this->output === null) { - return; - } - - parent::error($string, $verbosity); - } - - /** - * Creates a progressbar if output is not null - * - * @param int $size Progressbar size - */ - public function createProgressBar(int $size): void - { - if ($this->output === null) { - return; - } - - $this->bar = $this->output->createProgressBar($size); - } - - /** - * Advances the bar - */ - public function advanceBar(): void - { - if ($this->output === null || $this->bar === null) { - return; - } - - $this->bar->advance(); - } - - /** - * Finishes the bar - */ - public function finishBar(): void - { - if ($this->output === null || $this->bar === null) { - return; - } - - $this->bar->finish(); - } -} diff --git a/app/Console/Commands/PopulateData.php b/app/Console/Commands/PopulateData.php deleted file mode 100644 index a57166136..000000000 --- a/app/Console/Commands/PopulateData.php +++ /dev/null @@ -1,69 +0,0 @@ -createProgressBar(6); - - if ($this->option('seed')) { - Artisan::call('db:seed'); - } - $this->bar->advance(); - - if (! $this->option('skipCommLinks')) { - $this->info('Downloading and importing all missing Comm-Links.'); - Artisan::call('comm-links:schedule'); - } - $this->bar->advance(); - - if (! $this->option('skipGalactapedia')) { - $this->info('Downloading and importing all Galactapedia articles.'); - Artisan::call('galactapedia:import-categories'); - Artisan::call('galactapedia:import-articles'); - Artisan::call('galactapedia:import-properties'); - } - $this->bar->advance(); - - Artisan::call('ship-matrix:download --import'); - $this->bar->advance(); - - if (! $this->option('skipStarmap')) { - $this->info('Downloading and importing starmap.'); - Artisan::call('starmap:download --import'); - } - $this->bar->advance(); - - if (! $this->option('skipScUnpacked')) { - $this->info('Importing all Star Citizen Items.'); - Artisan::call('sc:import-items'); - } - $this->bar->finish(); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/AbstractCommLinkCommand.php b/app/Console/Commands/Rsi/CommLink/AbstractCommLinkCommand.php deleted file mode 100644 index 84ea58f00..000000000 --- a/app/Console/Commands/Rsi/CommLink/AbstractCommLinkCommand.php +++ /dev/null @@ -1,33 +0,0 @@ -argument('offset'); - - if ($offset <= 0) { - return self::FIRST_COMM_LINK_ID; - } - - if ($offset > 0 && $offset < self::FIRST_COMM_LINK_ID) { - $offset = self::FIRST_COMM_LINK_ID + $offset; - } - - return $offset; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/CommLinkSchedule.php b/app/Console/Commands/Rsi/CommLink/CommLinkSchedule.php deleted file mode 100644 index c65989a2f..000000000 --- a/app/Console/Commands/Rsi/CommLink/CommLinkSchedule.php +++ /dev/null @@ -1,42 +0,0 @@ -chain( - [ - new ImportCommLinks(30), - ] - ); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLink.php b/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLink.php deleted file mode 100644 index e69148838..000000000 --- a/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLink.php +++ /dev/null @@ -1,102 +0,0 @@ -dispatcher = $dispatcher; - } - - /** - * Execute the console command. - */ - public function handle(): int - { - collect($this->argument('id'))->filter( - static function ($id) { - return is_numeric($id); - } - ) - ->filter( - static function ($id) { - return (int) $id >= self::FIRST_COMM_LINK_ID; - } - ) - ->tap( - function (Collection $collection) { - $this->createProgressBar($collection->count()); - } - ) - ->each( - function (int $id) { - $skipExisting = true; - - if ($this->option('overwrite') === true) { - $skipExisting = false; - } - - $this->info('Downloading specified Comm-Links'); - $this->dispatcher->dispatch(new DownloadCommLinkJob($id, $skipExisting)); - $this->advanceBar(); - } - ); - - $this->finishBar(); - - if ($this->option('import') === true) { - $this->dispatchImportJob(); - } - - return CommLinkCommand::SUCCESS; - } - - /** - * Import jobs to run after downloading comm link files - */ - private function dispatchImportJob(): void - { - $this->info("\nImporting Comm-Links"); - $this->dispatcher->dispatch(new ImportCommLinks(30)); - $this->dispatcher->dispatch(new CreateImageMetadata); - $this->dispatcher->dispatch(new CreateImageHashes); - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLinkImages.php b/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLinkImages.php deleted file mode 100644 index d8e4c8f28..000000000 --- a/app/Console/Commands/Rsi/CommLink/Download/DownloadCommLinkImages.php +++ /dev/null @@ -1,42 +0,0 @@ -option('skip'); - if ($skip === true || $skip === 'true' || $skip === '1') { - $skip = true; - } else { - $skip = false; - } - - ReDownloadDbCommLinks::withChain( - [ - new ImportCommLinks(-1), - ] - )->onQueue('redownload_comm_links')->dispatch($skip); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Image/ComputeSimilarImageIds.php b/app/Console/Commands/Rsi/CommLink/Image/ComputeSimilarImageIds.php deleted file mode 100644 index 0ad19f3a9..000000000 --- a/app/Console/Commands/Rsi/CommLink/Image/ComputeSimilarImageIds.php +++ /dev/null @@ -1,57 +0,0 @@ -whereNull('base_image_id') - //->whereRelation('metadata', 'size', '>=', 250 * 1024) - ->with([ - 'metadata' => fn ($query) => $query->orderBy('size', 'DESC'), - ]); - - if ($this->option('recent') === true) { - $images->where('created_at', '>=', Carbon::now()->subWeek()); - } - - $images->orderBy('created_at') - ->chunk(25, function (Collection $images) { - $images->each(function (Image $image) { - $image->refresh(); - - if ($image->base_image_id !== null) { - return; - } - - \App\Jobs\Rsi\CommLink\Image\ComputeSimilarImageIds::dispatch($image)->onQueue('comm_link_images'); - }); - }); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Image/CreateImageHashes.php b/app/Console/Commands/Rsi/CommLink/Image/CreateImageHashes.php deleted file mode 100644 index aaae35a73..000000000 --- a/app/Console/Commands/Rsi/CommLink/Image/CreateImageHashes.php +++ /dev/null @@ -1,73 +0,0 @@ -info('Starting calculation of image hashes'); - - $images = $this->getImages(); - - $this->createProgressBar($images->count()); - - $images->chunk( - 100, - function (Collection $images) { - $images->each( - function (Image $image) { - CreateImageHash::dispatch($image)->onQueue('comm_link_images'); - $this->advanceBar(); - } - ); - } - ); - - $this->finishBar(); - - return QueueCommand::SUCCESS; - } - - /** - * The images to create hashes for - * Image needs to have an attached comm link and metadata - */ - private function getImages(): Builder - { - return Image::query() - ->where(function (Builder $query) { - $query->whereRelation('metadata', 'mime', 'LIKE', 'video%') - ->orWhereRelation('metadata', 'mime', 'LIKE', 'image%'); - }) - ->whereHas('commLinks') - ->doesntHave('hash') - ->where('src', 'NOT LIKE', '%.svg') - ->where('src', 'NOT LIKE', '%.tiff'); - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Image/CreateImageMetadata.php b/app/Console/Commands/Rsi/CommLink/Image/CreateImageMetadata.php deleted file mode 100644 index c5fd5311e..000000000 --- a/app/Console/Commands/Rsi/CommLink/Image/CreateImageMetadata.php +++ /dev/null @@ -1,57 +0,0 @@ -info('Starting creation of image metadata.'); - - $query = Image::query() - ->whereHas('commLinks') - ->whereDoesntHave('metadata'); - - $this->createProgressBar($query->count()); - - $query->chunk( - 100, - function (Collection $images) { - $images->each( - function (Image $image) { - CreateImageMetadatum::dispatch($image); - $this->advanceBar(); - } - ); - } - ); - - $this->finishBar(); - - return QueueCommand::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Image/SyncImageIds.php b/app/Console/Commands/Rsi/CommLink/Image/SyncImageIds.php deleted file mode 100644 index c959607f2..000000000 --- a/app/Console/Commands/Rsi/CommLink/Image/SyncImageIds.php +++ /dev/null @@ -1,40 +0,0 @@ -info('Dispatching Comm-Link Image Sync'); - - $offset = $this->parseOffset(); - - $this->info("Starting at Comm-Link ID {$offset}"); - - \App\Jobs\Rsi\CommLink\SyncImageIds::dispatch($offset); - - return CommLinkCommand::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/ImportCommLink.php b/app/Console/Commands/Rsi/CommLink/ImportCommLink.php deleted file mode 100644 index 6c5c5d091..000000000 --- a/app/Console/Commands/Rsi/CommLink/ImportCommLink.php +++ /dev/null @@ -1,72 +0,0 @@ -option('all') === true) { - ImportCommLinksJob::dispatch(-1); - - return Command::SUCCESS; - } - - if ($this->argument('id') === null) { - $this->error('Missing Comm-Link ID argument.'); - - return Command::FAILURE; - } - - $id = (int) $this->argument('id'); - - try { - $commLink = CommLink::query()->where('cig_id', $id)->firstOrFail(); - } catch (ModelNotFoundException $e) { - return Artisan::call('comm-links:download', [ - 'id' => $id, - '--import' => true, - ]); - } - - if (count(Storage::disk('comm_links')->files($id)) === 0) { - $this->error('Comm-Link does not exist on \'comm_links\' disk.'); - - return Command::FAILURE; - } - - $file = basename(Arr::last(Storage::disk('comm_links')->files($id))); - - dispatch(new ImportCommLinkJob($id, $file, $commLink, true)); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/TranslateCommLinks.php b/app/Console/Commands/Rsi/CommLink/TranslateCommLinks.php deleted file mode 100644 index b3f41a65a..000000000 --- a/app/Console/Commands/Rsi/CommLink/TranslateCommLinks.php +++ /dev/null @@ -1,48 +0,0 @@ -info('Dispatching Comm-Link Translation'); - - $modifiedTime = (int) $this->argument('modifiedTime'); - - if ($modifiedTime > 0) { - $this->info("Including Comm-Links that were created in the last '{$modifiedTime}' minutes"); - } elseif ($modifiedTime === -1) { - $this->info('Including all Comm-Links'); - } - - TranslateCommLinksJob::dispatch($this->filterDirectories('comm_links', $modifiedTime)->toArray()); - - return CommLinkCommand::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiPages.php b/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiPages.php deleted file mode 100644 index a2fa2d235..000000000 --- a/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiPages.php +++ /dev/null @@ -1,36 +0,0 @@ -info('Dispatching Comm-Link Wiki Page Creation'); - - \App\Jobs\Wiki\CommLink\CreateCommLinkWikiPages::dispatch(); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiTranslationPages.php b/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiTranslationPages.php deleted file mode 100644 index 1e6a373e4..000000000 --- a/app/Console/Commands/Rsi/CommLink/Wiki/CreateCommLinkWikiTranslationPages.php +++ /dev/null @@ -1,36 +0,0 @@ -info('Dispatching Comm-Link Wiki Translation Page Creation'); - - \App\Jobs\Wiki\CommLink\CreateCommLinkWikiTranslationPages::dispatch(); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/SC/ComputeItemBaseIds.php b/app/Console/Commands/SC/ComputeItemBaseIds.php deleted file mode 100644 index ec3c5ae5e..000000000 --- a/app/Console/Commands/SC/ComputeItemBaseIds.php +++ /dev/null @@ -1,30 +0,0 @@ -call( - 'sc:import-items', - [ - '--skipVehicles', - '--type' => 'Char_Clothing_Torso_1,Char_Clothing_Legs,Char_Clothing_Torso_0,Char_Clothing_Feet,Char_Clothing_Hat,Char_Armor_Backpack,Char_Clothing_Hands,Char_Armor_Helmet,Char_Armor_Arms,Char_Armor_Torso,Char_Armor_Legs,Char_Armor_Undersuit,Char_Clothing_Torso_2,Char_Clothing_Backpack', - ] - ); - } -} diff --git a/app/Console/Commands/SC/ImportFactions.php b/app/Console/Commands/SC/ImportFactions.php deleted file mode 100644 index 5f190e7a3..000000000 --- a/app/Console/Commands/SC/ImportFactions.php +++ /dev/null @@ -1,56 +0,0 @@ -withProgressBar(File::allFiles(scdata('factions')), function (string $file) { - $data = File::json($file); - - if (str_starts_with($data['description'], '@')) { - $data['description'] = null; - } - - /** @var Faction $model */ - $model = Faction::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'name' => $data['displayName'], - 'class_name' => $data['ClassName'], - 'description' => $data['description'], - 'game_token' => $data['gameToken'], - 'default_reaction' => $data['defaultReaction'], - ]); - - collect($data['factionRelationships'])->each(function ($factionRelationship) use ($model) { - $model->relations()->updateOrCreate([ - 'other_faction_uuid' => $factionRelationship['faction'], - 'relation' => $factionRelationship['reactionType'], - ]); - }); - }); - } -} diff --git a/app/Console/Commands/SC/ImportItems.php b/app/Console/Commands/SC/ImportItems.php deleted file mode 100644 index b03b80ec7..000000000 --- a/app/Console/Commands/SC/ImportItems.php +++ /dev/null @@ -1,126 +0,0 @@ -getData(); - - $files = File::allFiles(scdata('items')) + Storage::allFiles(scdata('ships')); - - // Debug - // $files = collect($files)->filter(fn ($file) => $file->isFile() && str_contains($file->getFilename(), 'klwe_sniper_energy_01')); - - if ($this->option('skipItems') === false) { - collect($files) - ->filter(function (string $file) { - return ! str_contains($file, '-raw.json'); - }) - ->tap(function (Collection $chunks) { - $this->info(sprintf( - 'Importing %d items in chunks of 25 (%d).', - $chunks->count(), - (int) ($chunks->count() / 25) - )); - }) - ->chunk(25) - ->tap(function (Collection $chunks) { - $this->createProgressBar($chunks->count()); - }) - ->each(function (Collection $chunk) use ($manufacturers) { - $this->bar->advance(); - - $chunk->map(function (string $file) use ($manufacturers) { - return [ - 'file' => $file, - 'item' => (new Item($file, $manufacturers))->getData(), - ]; - }) - ->filter(function (array $data) { - return $data['item'] !== null; - }) - ->filter(function (array $data) { - $item = $data['item']; - - return isset($item['name']) && ! in_array($item['name'], $this->ignoredNames, true); - }) - ->filter(function (array $data) { - if (! $this->option('type') !== null) { - return true; - } - - $types = array_map( - 'strtolower', - array_map('trim', explode(',', $this->option('type'))) - ); - - return in_array(strtolower($data['item']['type']), $types, true); - }) - ->map(function (array $data) { - \App\Jobs\SC\Import\Item::dispatch($data['item']); - - return [ - 'item' => $data['item'], - 'file' => $data['file'], - ]; - }) - ->each(function (array $data) { - ['item' => $item, 'file' => $path] = $data; - ItemSpecificationCreator::createSpecification($item, $path); - }); - }); - } - - if ($this->option('skipVehicles') === false) { - $this->info("\n\nImporting Vehicles"); - Artisan::call('sc:import-vehicles'); - } - - Artisan::call('sc:compute-item-base-ids'); - - $this->info('Done.'); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/SC/ImportMissions.php b/app/Console/Commands/SC/ImportMissions.php deleted file mode 100644 index 0dc55b339..000000000 --- a/app/Console/Commands/SC/ImportMissions.php +++ /dev/null @@ -1,299 +0,0 @@ -importRewards(); - $this->importStandings(); - $this->importScopes(); - $this->importTypes(); - $this->importGiver(); - $this->importMissions(); - $this->syncMissions(); - } - - private function importRewards(): void - { - $this->withProgressBar(File::allFiles(scdata('reputation/rewards')), function (string $file) { - $data = File::json($file); - - if (isset($data['missionGiverBonuses'])) { - // TODO: Import Bonuses - return; - } - - Reward::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'editor_name' => $data['editorName'], - 'reputation_amount' => $data['reputationAmount'], - 'class_name' => $data['ClassName'], - ]); - }); - } - - private function importStandings(): void - { - $this->withProgressBar(File::allFiles(scdata('reputation/standings')), function (string $file) { - $data = File::json($file); - - if (str_starts_with($data['displayName'], '@')) { - $data['displayName'] = null; - } - - if (str_starts_with($data['perkDescription'], '@')) { - $data['perkDescription'] = null; - } - - if ($data['description'] === 'desc' || str_starts_with($data['description'], '@')) { - $data['description'] = null; - } - - Standing::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'name' => $data['name'], - 'description' => $data['description'], - 'display_name' => $data['displayName'], - 'perk_description' => $data['perkDescription'], - 'min_reputation' => $data['minReputation'], - 'drift_reputation' => $data['driftReputation'], - 'drift_time_hours' => $data['driftTimeHours'], - 'gated' => $data['gated'], - ]); - }); - } - - private function importScopes(): void - { - $this->withProgressBar(File::allFiles(scdata('reputation/scopes')), function (string $file) { - $data = File::json($file); - - if ($data['description'] === 'desc' || str_starts_with($data['description'], '@')) { - $data['description'] = null; - } - - /** @var Scope $scope */ - $scope = Scope::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'scope_name' => $data['scopeName'], - 'display_name' => $data['displayName'], - 'description' => $data['description'], - 'class_name' => $data['ClassName'], - 'initial_reputation' => $data['standingMap']['reputationCeiling'], - 'reputation_ceiling' => $data['standingMap']['initialReputation'], - ]); - - $ids = collect($data['standingMap']['standings'])->map(function (array $standing) { - return Standing::query()->where('uuid', $standing['value'])->first()?->id; - })->filter(fn ($id) => $id !== null); - - $scope->standings()->sync($ids); - }); - } - - private function importTypes(): void - { - $this->withProgressBar(File::allFiles(scdata('missions/types')), function (string $file) { - $data = File::json($file); - - Type::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'name' => $data['LocalisedTypeName'], - ]); - }); - } - - private function importGiver(): void - { - $this->withProgressBar(File::allFiles(scdata('missions/missiongiver')), function (string $file) { - $data = File::json($file); - - $texts = [ - 'displayName', - 'description', - 'headquarters', - ]; - - foreach ($texts as $text) { - if (str_starts_with($data[$text], '@')) { - $data[$text] = null; - } - } - - /** @var Giver $giver */ - $giver = Giver::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'name' => $data['displayName'], - 'headquarters' => $data['headquarters'], - 'invitation_timeout' => $data['invitationTimeout'], - 'visit_timeout' => $data['visitTimeout'], - 'short_cooldown' => $data['shortCooldown'], - 'medium_cooldown' => $data['mediumCooldown'], - 'long_cooldown' => $data['longCooldown'], - ]); - - if (! empty($data['description'])) { - $giver->translations()->updateOrCreate([ - 'locale_code' => Language::ENGLISH, - ], [ - 'translation' => $data['description'], - ]); - } - }); - } - - private function importMissions(): void - { - $this->withProgressBar(File::allFiles(scdata('missions')), function (string $file) { - $data = File::json($file); - - if (empty($data['title'])) { - return; - } - - /** @var Mission $mission */ - $mission = Mission::query()->updateOrCreate([ - 'uuid' => $data['__ref'], - ], [ - 'not_for_release' => $data['notForRelease'], - 'title' => $data['title'], - 'title_hud' => $data['titleHUD'], - 'mission_giver' => $data['missionGiver'], - 'comms_channel_name' => $data['commsChannelName'], - 'locality_available' => $data['localityAvailable'], - 'location_mission_available' => $data['locationMissionAvailable'], - 'initially_active' => $data['initiallyActive'], - 'notify_on_available' => $data['notifyOnAvailable'], - 'show_as_offer' => $data['showAsOffer'], - 'mission_buy_in_amount' => $data['missionBuyInAmount'], - 'refund_buy_in_on_withdraw' => $data['refundBuyInOnWithdraw'], - 'has_complete_button' => $data['hasCompleteButton'], - 'handles_abandon_request' => $data['handlesAbandonRequest'], - 'mission_module_per_player' => $data['missionModulePerPlayer'], - 'max_instances' => $data['maxInstances'], - 'max_players_per_instance' => $data['maxPlayersPerInstance'], - 'max_instances_per_player' => $data['maxInstancesPerPlayer'], - 'can_be_shared' => $data['canBeShared'], - 'once_only' => $data['onceOnly'], - 'tutorial' => $data['tutorial'], - 'display_allied_markers' => $data['displayAlliedMarkers'], - 'available_in_prison' => $data['availableInPrison'], - 'fail_if_sent_to_prison' => $data['failIfSentToPrison'], - 'fail_if_became_criminal' => $data['failIfBecameCriminal'], - 'fail_if_leave_prison' => $data['failIfLeavePrison'], - 'request_only' => $data['requestOnly'], - 'respawn_time' => $data['respawnTime'], - 'respawn_time_variation' => $data['respawnTimeVariation'], - 'instance_has_life_time' => $data['instanceHasLifeTime'], - 'show_life_time_in_mobi_glas' => $data['showLifeTimeInMobiGlas'], - 'instance_life_time' => $data['instanceLifeTime'], - 'instance_life_time_variation' => $data['instanceLifeTimeVariation'], - 'can_reaccept_after_abandoning' => $data['canReacceptAfterAbandoning'], - 'abandoned_cooldown_time' => $data['abandonedCooldownTime'], - 'abandoned_cooldown_time_variation' => $data['abandonedCooldownTimeVariation'], - 'can_reaccept_after_failing' => $data['canReacceptAfterFailing'], - 'has_personal_cooldown' => $data['hasPersonalCooldown'], - 'personal_cooldown_time' => $data['personalCooldownTime'], - 'personal_cooldown_time_variation' => $data['personalCooldownTimeVariation'], - 'module_handles_own_shutdown' => $data['moduleHandlesOwnShutdown'], - 'linked_mission' => $data['linkedMission'], - 'lawful_mission' => $data['lawfulMission'], - 'invitation_mission' => $data['invitationMission'], - 'version' => config('api.sc_data_version'), - 'type_id' => Type::query()->where('uuid', $data['type'])->first()?->id, - 'giver_id' => Giver::query()->where('uuid', $data['missionGiverRecord'])->first()?->id, - ]); - - if (! str_starts_with($data['description'], '@')) { - $mission->translations()->updateOrCreate([ - 'locale_code' => Language::ENGLISH, - ], [ - 'translation' => $data['description'], - ]); - } - - if (! empty($data['missionReward'])) { - $mission->reward()->updateOrCreate([ - 'mission_id' => $mission->id, - ], [ - 'amount' => $data['missionReward']['reward'], - 'max' => $data['missionReward']['max'], - 'plus_bonuses' => $data['missionReward']['plusBonusses'], - 'currency' => $data['missionReward']['currencyType'], - 'reputation_bonus' => $data['missionReward']['reputationBonus'], - ]); - } - - if (! empty($data['missionDeadline'])) { - $mission->deadline()->updateOrCreate([ - 'mission_id' => $mission->id, - ], [ - 'mission_completion_time' => $data['missionDeadline']['missionCompletionTime'], - 'mission_auto_end' => $data['missionDeadline']['missionAutoEnd'], - 'mission_result_after_timer_end' => $data['missionDeadline']['missionResultAfterTimerEnd'], - 'mission_end_reason' => $data['missionDeadline']['missionEndReason'], - ]); - } - }); - } - - private function syncMissions(): void - { - $this->withProgressBar(File::allFiles(scdata('missions')), function (string $file) { - $data = File::json($file); - - /** @var Mission $mission */ - $mission = Mission::query()->where('uuid', $data['__ref'])->first(); - - if ($mission === null) { - return; - } - - $ids = collect($data['requiredMissions'])->map(function (array $standing) { - return Mission::query()->where('uuid', $standing['value'])->first()?->id; - })->filter(fn ($id) => $id !== null); - - $mission->requiredMissions()->sync($ids); - - $ids = collect($data['associatedMissions'])->map(function (array $standing) { - return Mission::query()->where('uuid', $standing['value'])->first()?->id; - })->filter(fn ($id) => $id !== null); - - $mission->associatedMissions()->sync($ids); - }); - } -} diff --git a/app/Console/Commands/SC/ImportPersonalWeapons.php b/app/Console/Commands/SC/ImportPersonalWeapons.php deleted file mode 100644 index c3dd8a704..000000000 --- a/app/Console/Commands/SC/ImportPersonalWeapons.php +++ /dev/null @@ -1,38 +0,0 @@ -call( - 'sc:import-items', - [ - '--skipVehicles', - '--type' => 'WeaponPersonal', - ] - ); - } -} diff --git a/app/Console/Commands/SC/ImportShops.php b/app/Console/Commands/SC/ImportShops.php deleted file mode 100644 index a96044066..000000000 --- a/app/Console/Commands/SC/ImportShops.php +++ /dev/null @@ -1,38 +0,0 @@ -info('Importing Shops'); - ShopItems::dispatch(); - $this->info('Done'); - - return Command::SUCCESS; - } -} diff --git a/app/Console/Commands/SC/ImportVehicleItems.php b/app/Console/Commands/SC/ImportVehicleItems.php deleted file mode 100644 index d2d10747d..000000000 --- a/app/Console/Commands/SC/ImportVehicleItems.php +++ /dev/null @@ -1,38 +0,0 @@ -call( - 'sc:import-items', - [ - '--skipVehicles', - '--type' => 'Armor,Battery,BombLauncher,Cooler,CoolerController,EMP,ExternalFuelTank,FlightController,FuelIntake,FuelTank,MainThruster,ManneuverThruster,Missile,MissileController,MissileLauncher,Paints,PowerPlant,QuantumDrive,QuantumFuelTank,QuantumInterdictionGenerator,Radar,SelfDestruct,Shield,ShieldController,ToolArm,Turret,TurretBase,UtilityTurret,WeaponDefensive,WeaponGun,WeaponMining,WeaponMount,WheeledController', - ] - ); - } -} diff --git a/app/Console/Commands/SC/ImportVehicles.php b/app/Console/Commands/SC/ImportVehicles.php deleted file mode 100644 index daf543d84..000000000 --- a/app/Console/Commands/SC/ImportVehicles.php +++ /dev/null @@ -1,126 +0,0 @@ -error('ships.json not found. Did you clone scunpacked?'); - - return Command::FAILURE; - } - - try { - $vehicles = json_decode($vehicles, true, 512, JSON_THROW_ON_ERROR); - } catch (JsonException $e) { - $this->error($e->getMessage()); - - return Command::FAILURE; - } - - collect($vehicles) - ->tap(function (Collection $chunks) { - $this->info(sprintf( - 'Importing %d vehicles in chunks of 5 (%d).', - $chunks->count(), - (int) ($chunks->count() / 5) - )); - }) - ->chunk(5) - ->tap(function (Collection $chunks) { - $this->createProgressBar($chunks->count()); - }) - ->each(function (Collection $chunk) { - $this->bar->advance(); - $chunk - ->filter(function (array $vehicle) { - return isset($vehicle['ClassName']) && $this->isNotIgnoredClass($vehicle['ClassName']); - }) - ->map(function (array $vehicle) { - $vehicle['filePathRaw'] = scdata(sprintf( - 'ships/%s-raw.json', - strtolower($vehicle['ClassName']) - )); - - $vehicle['filePath'] = scdata(sprintf( - 'ships/%s.json', - strtolower($vehicle['ClassName']) - )); - - return $vehicle; - })->each(function (array $vehicle) { - Vehicle::dispatch($vehicle); - }); - }); - - return Command::SUCCESS; - } - - private function isNotIgnoredClass(string $class): bool - { - $tests = [ - '_Hangar', - 'Active1', - 'BIS29', - 'Bombless', - 'CINEMATIC_ONLY', - //'F7A_Mk1', - 'Fleetweek', - 'fw22nfz', - 'Indestructible', - 'Krugeri', - 'modifiers', - 'NO_CUSTOM', - 'NoCrimesAgainst', - 'Prison', - 'Showdown', - 'SM_TE', - 'Test', - 'Tutorial', - 'Unmanned', - ]; - - $isGood = true; - - foreach ($tests as $toTest) { - $isGood = $isGood && stripos($class, $toTest) === false; - } - - $isGood = $isGood && $class !== 'TEST_Boat'; - - return $isGood; - } -} diff --git a/app/Console/Commands/SC/TranslateItems.php b/app/Console/Commands/SC/TranslateItems.php deleted file mode 100644 index 14ae57125..000000000 --- a/app/Console/Commands/SC/TranslateItems.php +++ /dev/null @@ -1,43 +0,0 @@ -info('Translating Items'); - $items = Item::query()->whereHas('translations'); - $this->createProgressBar($items->count()); - - $items->each(function (Item $item) { - TranslateItem::dispatch($item); - $this->advanceBar(); - }); - - return 0; - } -} diff --git a/app/Console/Commands/SC/Wiki/AbstractCreateWikiPage.php b/app/Console/Commands/SC/Wiki/AbstractCreateWikiPage.php deleted file mode 100644 index 692daac37..000000000 --- a/app/Console/Commands/SC/Wiki/AbstractCreateWikiPage.php +++ /dev/null @@ -1,153 +0,0 @@ - -|image = {{Find image}} -|name = -|manufacturer = -}} -ITEM; - - protected string $template; - - final public function uploadWiki($model, string $summary): void - { - try { - $token = $this->getCsrfToken('services.wiki_translations'); - $response = MediaWikiApi::edit($this->getPageName($model)) - ->withAuthentication() - ->text($this->getPageText($model)) - ->csrfToken($token) - ->summary($summary) - ->request([ - 'timeout' => 600, - ]); - } catch (ErrorException|GuzzleException $e) { - $this->error($e->getMessage()); - - return; - } - - // $this->createEnglishSubpage($this->getPageName($model), $token); - - if ($response->hasErrors() && $response->getErrors()['code'] !== 'articleexists') { - $this->error(implode(', ', $response->getErrors())); - } - } - - abstract protected function prepareTemplate($model): string; - - abstract protected function getPageName($model): string; - - abstract protected function getManufacturerCode($model): string; - - protected function getUUID($model): string - { - return $model->uuid; - } - - protected function getPageText($model): string - { - $name = $this->getPageName($model); - - $itemTemplate = $this->itemTemplate; - $itemTemplate = str_replace('', $this->getUUID($model), $itemTemplate); - $itemTemplate = str_replace('', $name, $itemTemplate); - $itemTemplate = str_replace('', $this->getManufacturerCode($model), $itemTemplate); - - $originalTemplate = $this->template; - - if (config('services.wiki_pages.refname') === null || config('services.wiki_pages.version') === null) { - throw new RuntimeException('Missing config'); - } - - $this->template = str_replace( - '', - config('services.wiki_pages.refname'), - $this->template - ); - $this->template = str_replace( - '', - config('services.wiki_pages.version'), - $this->template - ); - - $this->template = str_replace( - '', - Carbon::now()->format('Y-m-d'), - $this->template - ); - $this->template = str_replace( - '', - $this->getManufacturerCode($model), - $this->template - ); - $this->template = str_replace( - '', - $name, - $this->template - ); - - $this->template = sprintf("%s\n%s", $itemTemplate, $this->template); - - $text = $this->prepareTemplate($model); - $this->reset(); - $this->template = $originalTemplate; - - return $text; - } - - protected function fixText(string $type, string &$text, array $additions = []): string - { - $needles = [ - 'a', - 'e', - 'i', - 'o', - 'u', - 'panzerung', - ...$additions, - ]; - - if (Str::endsWith($type, $needles)) { - $text = str_replace('ist ein ', 'ist eine ', $text); - $text = str_replace('(r)', '', $text); - } else { - $text = str_replace('(r)', 'r', $text); - } - - return $text; - } - - private function reset(): void - { - $this->template = <<<'ITEM' -{{Item -|uuid = -|image = -|name = -|manufacturer = -}} -ITEM; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateCharArmorWikiPages.php b/app/Console/Commands/SC/Wiki/CreateCharArmorWikiPages.php deleted file mode 100644 index 2aab816c4..000000000 --- a/app/Console/Commands/SC/Wiki/CreateCharArmorWikiPages.php +++ /dev/null @@ -1,180 +0,0 @@ -''' ist ein hergestellt von [[{{subst:MFURN|}}]].{{Cite game|build=[[Star Citizen Alpha |Alpha ]]|accessdate=}} -== Beschreibung == -{{Item description}} -== Itemports == -{{Item ports}} -== Erwerb == -{{Item availability}} -== Model == -=== Varianten === -{{Item variants}} -{{Quellen}} -{{Navplate manufacturers|}} -TEMPLATE; - - protected array $typeMapping = [ - 'Char_Armor_Arms' => 'Armpanzerung', - 'Char_Armor_Torso' => 'Oberkörperpanzerung', - 'Char_Armor_Legs' => 'Beinpanzerung', - 'Char_Armor_Helmet' => 'Helm', - 'Char_Armor_Backpack' => 'Rucksack', - 'Char_Armor_Undersuit' => 'Unteranzug', - // Clothing - 'Char_Clothing_Torso_1' => 'Jacke', - 'Char_Clothing_Legs' => 'Hose', - 'Char_Clothing_Torso_0' => 'Shirt', - 'Char_Clothing_Feet' => 'Schuh', - 'Char_Clothing_Hat' => 'Hut', - 'Char_Clothing_Hands' => 'Handschuh', - 'Char_Clothing_Torso_2' => 'Gürtel', - 'Char_Clothing_Backpack' => 'Rucksack', - ]; - - protected array $subTypeMapping = [ - 'Heavy' => 'schwere(r)', - 'Medium' => 'mittlere(r)', - 'Light' => 'leichte(r)', - 'Personal' => 'persönliche(r)', - // Clothing - 'Female' => 'weibliche(r)', - 'Male' => 'männliche(r)', - 'Medical' => 'medizinische(r)', - ]; - - /** - * Execute the console command. - */ - public function handle(): int - { - $this->withProgressBar( - Armor::all(), - function (Armor $armor) { - $this->uploadWiki($armor, 'Automatische Erstellung von Kleidungs- und Rüstungsseiten'); - } - ); - - return 0; - } - - protected function prepareTemplate($model): string - { - $name = $this->getPageName($model); - $type = $this->typeMapping[$model->type] ?? $model->type; - - $pageContent = $this->template; - - $pageContent = str_replace( - ' ', - $model->sub_type === 'UNDEFINED' - ? '' - : strtolower($this->subTypeMapping[$model->sub_type] ?? $model->sub_type).' ', - $pageContent - ); - - $pageContent = str_replace( - '', - $type, - $pageContent - ); - - if (self::getSuffix($model) !== null || (str_contains($model->class_name, '_01_15') && str_contains($name, 'Black/Silver'))) { - $info = sprintf(" Dieses Item wird im Spiel als '''%s''' angezeigt.", $model->name); - - $pageContent = str_replace( - '', - $info, - $pageContent - ); - } else { - $pageContent = str_replace('', '', $pageContent); - } - - $this->fixText($type, $pageContent, ['panzerung']); - - if (str_contains($model->class_name, '_01_15') && str_contains($name, 'Black/Silver')) { - $pageContent .= "\n[[Category:Gegenstand mit nicht eindeutigem Namen im Spiel]]"; - } - - return $pageContent; - } - - protected static function getSuffix(Armor|Clothes $armor): ?string - { - $suffix = match (true) { - str_contains($armor->class_name, '_hd_sec') => ' Hurston Security', - str_contains($armor->class_name, '_irn') => ' Iron', - str_contains($armor->class_name, '_gld') => ' Gold', - str_contains($armor->class_name, '_microtech') => ' microTech', - str_contains($armor->class_name, '_carrack') && ! str_contains($armor->name, 'Carrack') => ' Carrack Edition', - str_contains($armor->class_name, '_9tails') => ' (Nine Tails)', - str_contains($armor->class_name, '_xenothreat') => ' (Xenothreat)', - default => null - }; - - if (! str_contains(strtolower($armor->name), strtolower(trim($suffix ?? '', ' ()')))) { - return $suffix; - } - - return null; - } - - protected function getPageName($model): string - { - $suffix = self::getSuffix($model) ?? ''; - - $name = $model->name.($suffix); - if (str_contains($model->class_name, '_01_15') && str_contains($name, 'Black/Silver')) { - $name = str_replace('Black', 'Tan', $name); - } - - if ($model->name === 'Venture Helmet White' && $model->class_name === 'rsi_explorer_armor_light_helmet_01_01_10') { - $name = str_replace('White', 'White/Red', $name); - } - - $name = str_replace("$suffix$suffix", $suffix, $name); - $name = preg_replace('/^\s*-\s*/', '', $name); - - return $name; - } - - protected function getManufacturerCode($model): string - { - return $model->manufacturer->code; - } - - public static function getNameForModel($model): string - { - return (new self)->getPageText($model); - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateClothingWikiPages.php b/app/Console/Commands/SC/Wiki/CreateClothingWikiPages.php deleted file mode 100644 index 6b9cdc9f5..000000000 --- a/app/Console/Commands/SC/Wiki/CreateClothingWikiPages.php +++ /dev/null @@ -1,44 +0,0 @@ -withProgressBar( - Clothes::all(), - function (Clothes $armor) { - $this->uploadWiki($armor, 'Automatische Erstellung von Kleidungs- und Rüstungsseiten'); - } - ); - - return 0; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateCommodityWikiPages.php b/app/Console/Commands/SC/Wiki/CreateCommodityWikiPages.php deleted file mode 100644 index f3e8945c2..000000000 --- a/app/Console/Commands/SC/Wiki/CreateCommodityWikiPages.php +++ /dev/null @@ -1,238 +0,0 @@ -with(['items']) - ->get() - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'IAE Expo') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'removed') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'Teach\'s') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'Levski') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'Rentals') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'New Deal') === false; - }) - ->filter(function (Shop $shop) { - return strpos($shop->name_raw, 'Astro Armada') === false; - }) - ->filter(function (Shop $shop) { - return $shop->position !== 'Unknown Position'; - }) - ->filter(function (Shop $shop) { - return $shop->name !== 'Unknown Name'; - }); - - $this->createProgressBar($data->count()); - - $data->each(function (Shop $shop) { - $this->uploadWiki($shop); - - $this->advanceBar(); - }); - - if (config('services.wiki_approve_revs.access_secret') !== null) { - $this->approvePages($data); - } - - return 0; - } - - public function uploadWiki(Shop $shop) - { - $items = $shop - ->items - ->filter(function (Item $item) { - return ! str_contains($item->name, '[PLACEHOLDER]'); - }) - ->filter(function (Item $item) { - return ! in_array($item->type, $this->ignoredTypes, true); - }) - ->filter(function (Item $item) { - return ! str_contains($item->type, 'Char_Clothing'); - }) - ->sortBy('name') - ->map(function (Item $item) use ($shop) { - return SmwSubObjectMapper::map( - $this->mapItem($item, $shop), - ' ', - [], - str_replace(['.', '[PH]'], '', $item->name) - ); - }) - ->implode("\n"); - - $title = sprintf('Spieldaten/Handelswaren/%s/%s', $shop->position, $shop->name); - - if (empty(trim($items))) { - dump('Delete: '.$title); - try { - $token = $this->getCsrfToken('services.wiki_translations'); - MediaWikiApi::action('delete', 'POST') - ->withAuthentication() - ->addParam('title', $title) - ->csrfToken($token) - ->addParam('reason', 'Deleting empty commodity page') - ->request(); - - return; - } catch (ErrorException|GuzzleException $e) { - $this->error($e->getMessage()); - - return; - } - } - - // phpcs:disable - $format = <<<'FORMAT' - -{{Alert|color=info|title=Information|content=Diese Seite enthält Daten über Kauf- und Mietpreise von Handelswaren in Star Citizen.
Diese Daten werden automatisch durch die Star Citizen Wiki API verwaltet.}} -%s - -[[Kategorie:Instandhaltung]] -[[Kategorie:Alpha %s]] -
-FORMAT; - // phpcs:enable - - try { - $token = $this->getCsrfToken('services.wiki_translations'); - $response = MediaWikiApi::edit($title) - ->withAuthentication() - ->text(sprintf($format, $items, config('api.sc_data_version'))) - ->csrfToken($token) - ->summary('Updating Commodity Prices') - ->request(); - } catch (ErrorException|GuzzleException $e) { - $this->error($e->getMessage()); - - return; - } - - if ($response->hasErrors()) { - $this->error(implode(', ', $response->getErrors())); - } - } - - private function approvePages(Collection $data): void - { - $this->info('Approving Pages'); - $this->createProgressBar($data->count()); - - $data->map(function (Shop $shop) { - return sprintf('Spieldaten/Handelswaren/%s/%s', $shop->position, $shop->name); - }) - ->each(function ($page) { - $this->loginWikiBotAccount('services.wiki_approve_revs'); - - dispatch(new ApproveRevisions([$page], false)); - $this->advanceBar(); - }); - } - - private function mapItem(Item $item, Shop $shop): array - { - $formatter = new NumberFormatter(config('app.locale'), NumberFormatter::TYPE_DEFAULT); - - return [ - 'UUID' => $item->uuid, - 'Name' => str_replace('[PH]', '', $item->name), - 'Basispreis' => $formatter->format($item->shop_data->base_price).'aUEC', - 'Preis' => $formatter->format($item->shop_data->offsetted_price).'aUEC', - 'Minimalpreis' => $formatter->format($item->shop_data->priceRange['min']).'aUEC', - 'Maximalpreis' => $formatter->format($item->shop_data->priceRange['max']).'aUEC', - 'Preisoffset' => $formatter->format($item->shop_data->base_price_offset), - 'Rabatt' => $formatter->format($item->shop_data->max_discount), - 'Premium' => $formatter->format($item->shop_data->max_premium), - 'Bestand' => $formatter->format($item->shop_data->inventory), - 'Maximalbestand' => $formatter->format($item->shop_data->max_inventory), - 'Wiederauffüllungsrate' => $formatter->format($item->shop_data->refresh_rate), - 'Typ' => $item->type.'@en', - 'Kaufbar' => $item->shop_data->buyable, - 'Verkaufbar' => $item->shop_data->sellable, - 'Mietbar' => $item->shop_data->rentable, - 'Händler' => $shop->name, - 'Ort' => $shop->position, - 'Spielversion' => $item->version, - ]; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateFoodWikiPages.php b/app/Console/Commands/SC/Wiki/CreateFoodWikiPages.php deleted file mode 100644 index bf74adb97..000000000 --- a/app/Console/Commands/SC/Wiki/CreateFoodWikiPages.php +++ /dev/null @@ -1,93 +0,0 @@ -''' ist ein Lebensmittel. Es wird hergestellt von [[{{subst:MFURN|}}]].{{Cite game|build=[[Star Citizen Alpha |Alpha ]]|accessdate=}} -== Beschreibung == -{{Item description}} -== Erwerb == -{{Item availability}} -== Quellen == - -{{Navplate food and drinks}} -TEMPLATE; - - /** - * Execute the console command. - */ - public function handle(): int - { - $this->withProgressBar( - Food::query() - ->whereRelation('item', 'name', 'NOT LIKE', '%PLACEHOLDER%') - ->whereRelation('item', 'class_name', 'NOT LIKE', '%test%') - ->get(), - function (Food $food) { - $this->uploadWiki($food, 'Automatische Erstellung von Lebensmitteln'); - } - ); - - return 0; - } - - /** - * @param Food $model - */ - protected function prepareTemplate($model): string - { - $pageContent = $this->template; - - $effects = ''; - if ($model->nutritional_density_rating && $model->hydration_efficacy_index) { - $effects = ', welches [[NDR|hunger]] und [[HEI|durst]] stillt'; - } elseif ($model->hydration_efficacy_index) { - $effects = ', welches den [[HEI|durst]] stillt'; - } elseif ($model->nutritional_density_rating) { - $effects = ', welches den [[NDR|hunger]] sättigt'; - } - - $pageContent = str_replace( - '', - $effects, - $pageContent - ); - - return $pageContent; - } - - protected function getPageName($model): string - { - return $model->item->name; - } - - protected function getManufacturerCode($model): string - { - return $model->item->manufacturer->code; - } - - protected function getUUID($model): string - { - return $model->item->uuid; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateShipItemWikiPages.php b/app/Console/Commands/SC/Wiki/CreateShipItemWikiPages.php deleted file mode 100644 index 07aeb20ae..000000000 --- a/app/Console/Commands/SC/Wiki/CreateShipItemWikiPages.php +++ /dev/null @@ -1,153 +0,0 @@ -''' ist ein Größe hergestellt von [[{{subst:MFURN|}}]].{{Cite game|build=[[Star Citizen Alpha |Alpha ]]|accessdate=}} -== Beschreibung == -{{Item description}} -== Erwerb == -{{Item availability}} -== Standardausrüstung von == -{{Standardausrüstung}} -{{Quellen}} -{{Navplate manufacturers|}} -{{ Navplate}} -TEMPLATE; - - protected array $typeMapping = [ - 'BombLauncher' => 'Bombenwerfer', - 'Cooler' => 'Kühler', - 'EMP' => 'EMP-Generator', - 'Missile' => 'Rakete', - 'MissileLauncher' => 'Raketenwerfer', - 'PowerPlant' => 'Generator', - 'QuantumDrive' => 'Quantenantrieb', - 'QuantumInterdictionGenerator' => 'Quantum Enforcement Device', - 'SalvageModifier' => 'Bergungsmodifikator', - 'Shield' => 'Schildgenerator', - 'TowingBeam' => 'Abschleppstrahl', - 'TractorBeam' => 'Traktorstrahl', - 'WeaponGun' => 'Fahrzeugwaffe', - 'WeaponMining' => 'Bergbaulaser', - 'WeaponDefensive' => 'Defensivmittel', - ]; - - protected array $classMappings = [ - 'Civilian' => 'Zivil', - 'Competition' => 'Wettkampf', - 'Military' => 'Militär', - 'Industrial' => 'Industrie', - 'Stealth' => 'Stealth', - ]; - - /** - * Execute the console command. - */ - public function handle(): int - { - $this->withProgressBar( - VehicleItem::query() - ->where('sc_items.name', '<>', '<= PLACEHOLDER =>') - ->whereIn('type', [ - 'BombLauncher', - 'Cooler', - 'EMP', - 'Missile', - 'MissileLauncher', - 'PowerPlant', - 'QuantumDrive', - 'QuantumInterdictionGenerator', - 'SalvageModifier', - 'Shield', - 'TowingBeam', - 'TractorBeam', - 'WeaponGun', - 'WeaponMining', - 'Radar', - ]) - ->get(), - function (VehicleItem $item) { - $this->uploadWiki($item, 'Automatische Erstellung von Fahrzeugitems'); - } - ); - - return 0; - } - - protected function prepareTemplate($model): string - { - $pageContent = $this->template; - $type = ($this->typeMapping[$model->type] ?? $model->type); - - $pageContent = str_replace( - '', - $model->size.((! $model->grade && ! $model->class) ? ' ' : ''), - $pageContent - ); - - $pageContent = str_replace( - '', - $model->grade ? ', Grad '.$model->grade.', ' : '', - $pageContent - ); - - $pageContent = str_replace( - '', - $model->class ? ($this->classMappings[$model->class] ?? $model->class).'-' : '', - $pageContent - ); - - $pageContent = str_replace( - ' ', - $type.' ', - $pageContent - ); - - $this->fixText($type, $pageContent); - - return $pageContent; - } - - /** - * @param VehicleItem $model - */ - protected function getPageName($model): string - { - $name = $model->name; - - if (in_array($name, ['Liberator', 'Odyssey', 'Nova', 'Vulcan', 'Eclipse', 'Centurion', 'Citadel', 'Castra', 'Mercury'])) { - $name = sprintf('%s (%s)', $name, ($this->typeMapping[$model->type] ?? $model->type)); - } - - return $name; - } - - /** - * @param VehicleItem $model - */ - protected function getManufacturerCode($model): string - { - return $model->manufacturer->code; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateWeaponAttachmentWikiPages.php b/app/Console/Commands/SC/Wiki/CreateWeaponAttachmentWikiPages.php deleted file mode 100644 index f9e9a8736..000000000 --- a/app/Console/Commands/SC/Wiki/CreateWeaponAttachmentWikiPages.php +++ /dev/null @@ -1,125 +0,0 @@ -''' ist ein Größe hergestellt von [[{{subst:MFURN|}}]].{{Cite game|build=[[Star Citizen Alpha |Alpha ]]|accessdate=}} -== Beschreibung == -{{Item description}} -== Erwerb == -{{Item availability}} -{{Quellen}} -{{Navplate manufacturers|}} -TEMPLATE; - - protected array $typeMapping = [ - 'Ballistic Compensator' => 'ballistischer Kompensator', - 'Flash Hider' => 'Mündungsfeuerdämpfer', - 'Energy Stabilizer' => 'Energie-Stabilisator', - 'Suppressor' => 'Schalldämpfer', - 'Projection' => 'Projektionsvisier', - 'Reflex' => 'Reflexvisier', - 'Telescopic' => 'Zielfernrohr', - 'Monitor' => 'Monitorvisier', - 'Flashlight' => 'Taschenlampe', - 'Laser Pointer' => 'Laserpointer', - - // Raw Subtype - 'Magazine' => 'Magazin', - 'Utility' => 'Waffenaufsatz', - 'IronSight' => 'Zielfernrohr', - ]; - - /** - * Execute the console command. - */ - public function handle(): int - { - $this->withProgressBar( - Attachment::query() - ->where('sc_items.name', '<>', '<= PLACEHOLDER =>') - ->whereIn('sub_type', [ - 'Magazine', - 'Barrel', - 'IronSight', - 'Utility', - 'BottomAttachment', - ]) - ->get(), - function (Attachment $item) { - $this->uploadWiki($item, 'Automatische Erstellung von Waffenbefestigungen'); - } - ); - - return 0; - } - - /** - * @param Attachment $model - */ - protected function prepareTemplate($model): string - { - $pageContent = $this->template; - $type = ($this->typeMapping[$model->attachment_type] ?? $this->typeMapping[$model->sub_type] ?? $model->sub_type); - - if ($model->size === null) { - $pageContent = str_replace( - 'Größe ', - '', - $pageContent - ); - } else { - $pageContent = str_replace( - '', - (string) ($model->getAttributes()['size'] ?? $model->size ?? 0), - $pageContent - ); - } - - $pageContent = str_replace( - ' ', - $type.' ', - $pageContent - ); - - $this->fixText($type, $pageContent); - - return $pageContent; - } - - /** - * @param Attachment $model - */ - protected function getPageName($model): string - { - return $model->name; - } - - /** - * @param Attachment $model - */ - protected function getManufacturerCode($model): string - { - return $model->manufacturer->code; - } -} diff --git a/app/Console/Commands/SC/Wiki/CreateWeaponWikiPages.php b/app/Console/Commands/SC/Wiki/CreateWeaponWikiPages.php deleted file mode 100644 index ad8343b2b..000000000 --- a/app/Console/Commands/SC/Wiki/CreateWeaponWikiPages.php +++ /dev/null @@ -1,180 +0,0 @@ -''' ist ein Größe hergestellt von [[{{subst:MFURN|}}]].{{Cite game|build=[[Star Citizen Alpha 3.22.1|Alpha 3.22.1]]|accessdate=}} -== Beschreibung == -{{Item description}} -== Itemports == -{{Item ports}} -== Statistik == -{{Weapon damage stats}} -== Erwerb == -{{Item availability}} -== Model == -=== Varianten === -{{Item variants}} -{{Quellen}} -{{Navplate manufacturers|}} -{{Navplate personal weapons}} -TEMPLATE; - - protected array $typeMapping = [ - 'Knife' => 'Messer', - 'Railgun' => 'Railgun', - 'Missile Launcher' => 'Raketenwerfer', - 'Grenade Launcher' => 'Granatwerfer', - 'Grenade' => 'Granate', - 'LMG' => 'leichtes Maschinengewehr', - 'Pistol' => 'Pistole', - 'Assault Rifle' => 'Sturmgewehr', - 'Shotgun' => 'Schrotflinte', - 'SMG' => 'Maschinenpistole', - 'Sniper Rifle' => 'Scharfschützengewehr', - 'Medical Device' => 'Medizinalgerät', - 'Utility' => 'Hilfsmittel', - 'Tractor Beam' => 'Traktorstrahl', - 'Frag Pistol' => 'Splitterpistole', - 'Toy Pistol' => 'Spielzeugpistole', - 'Large' => 'große Waffe', - 'Medium' => 'mittlere Waffe', - 'Small' => 'kleine Waffe', - 'Gadget' => 'Hilfsmittel', - ]; - - protected array $classMapping = [ - 'Ballistic' => 'Ballistik', - 'Energy (Laser)' => 'Laserenergie', - 'Laser' => 'Laser', - 'Energy (Plasma)' => 'Plasmaenergie', - 'Electron' => 'Elektronen', - ]; - - /** - * Execute the console command. - */ - public function handle(): int - { - $this->withProgressBar( - PersonalWeapon::all(), - function (PersonalWeapon $item) { - $this->uploadWiki($item, 'Automatische Erstellung von Waffenseiten'); - } - ); - - return 0; - } - - /** - * @param PersonalWeapon $model - */ - protected function prepareTemplate($model): string - { - $pageContent = $this->template; - $type = ($this->typeMapping[$model->weapon_type] ?? $this->typeMapping[$model->sub_type] ?? $model->sub_type); - - $pageContent = str_replace( - '', - (string) $model->size, - $pageContent - ); - - $pageContent = str_replace( - '', - isset($this->classMapping[$model->weapon_class]) ? $this->classMapping[$model->weapon_class].' ' : '', - $pageContent - ); - - $pageContent = str_replace( - '', - $type, - $pageContent - ); - - $this->fixText($type, $pageContent); - - if ($type === 'Messer') { - $pageContent = str_replace("== Statistik ==\n{{Weapon damage stats}}\n", '', $pageContent); - } - - $descriptionDataTargets = [ - 'Magazine Size' => 'Magazingröße', - 'Rate Of Fire' => 'Feuerrate', - 'Effective Range' => 'effektive Reichweite', - ]; - $dataFragments = []; - - foreach ($descriptionDataTargets as $target => $desc) { - $data = $model->getDescriptionDatum($target); - if ($data !== null) { - $line = sprintf('%s von %s', $desc, $data); - if ($target === 'Magazine Size') { - if ($data === 'Integrated Battery') { - $line = 'integrierte Batterie'; - } else { - $line .= ' Schuss'; - } - } - $dataFragments[] = $line; - } - } - - if (! empty($dataFragments)) { - $last = array_pop($dataFragments); - $dataFragments = sprintf( - ' Die Waffe besitzt eine %s, und eine %s.', - implode(', eine ', $dataFragments), - $last - ); - } else { - $dataFragments = ''; - } - - $pageContent = str_replace( - '', - $dataFragments, - $pageContent - ); - - $this->fixText($type, $pageContent); - - return $pageContent; - } - - /** - * @param PersonalWeapon $model - */ - protected function getPageName($model): string - { - return $model->name; - } - - /** - * @param PersonalWeapon $model - */ - protected function getManufacturerCode($model): string - { - return $model->manufacturer->code; - } -} diff --git a/app/Console/Commands/SC/Wiki/UploadItemImages.php b/app/Console/Commands/SC/Wiki/UploadItemImages.php deleted file mode 100644 index 0f0a6bbc3..000000000 --- a/app/Console/Commands/SC/Wiki/UploadItemImages.php +++ /dev/null @@ -1,248 +0,0 @@ - 'Armpanzerung', - 'Char_Armor_Torso' => 'Oberkörperpanzerung', - 'Char_Armor_Legs' => 'Beinpanzerung', - 'Char_Armor_Helmet' => 'Helm', - 'Char_Armor_Backpack' => 'Rucksack', - 'Char_Armor_Undersuit' => 'Unteranzug', - 'Char_Clothing_Torso_1' => 'Jacke', - 'Char_Clothing_Legs' => 'Hose', - 'Char_Clothing_Torso_0' => 'Shirt', - 'Char_Clothing_Feet' => 'Schuh', - 'Char_Clothing_Hat' => 'Hut', - 'Char_Clothing_Hands' => 'Handschuh', - 'Char_Clothing_Torso_2' => 'Gürtel', - 'Char_Clothing_Backpack' => 'Rucksack', - - 'Cooler' => 'Kühler', - 'Power Plant' => 'Generator', - 'Quantum Drive' => 'Quantenantrieb', - 'Shield Generator' => 'Schildgenerator', - 'WeaponGun' => 'Fahrzeugwaffe', - - 'Magazine' => 'Magazin', - 'Ballistic Compensator' => 'Ballistischer Kompensator', - 'Flash Hider' => 'Mündungsfeuerdämpfer', - 'Energy Stabilizer' => 'Energie-Stabilisator', - 'Suppressor' => 'Schalldämpfer', - 'Scope' => 'Zielfernrohr', - 'MedGel Refill' => 'MedGel-Nachfüllpackung', - 'Multi-Tool Attachment' => 'Multi-Tool-Aufsatz', - 'Battery' => 'Batterie', - 'Flashlight' => 'Taschenlampe', - 'Laser Pointer' => 'Laserpointer', - - 'Light Backpack' => 'Leichter Rucksack', - 'Medium Backpack' => 'Mittlerer Rucksack', - 'Heavy Backpack' => 'Schwerer Rucksack', - - 'Backpack' => 'Rucksack', - 'Bandana' => 'Bandana', - 'Beanie' => 'Mütze', - 'Boots' => 'Stiefel', - 'Gloves' => 'Handschuh', - 'Gown' => 'Kittel', - 'Hat' => 'Hut', - 'Head Cover' => 'Kopfbedeckung', - 'Jacket' => 'Jacke', - 'Pants' => 'Hose', - 'Shirt' => 'Hemd', - 'Shoes' => 'Schuh', - 'Slippers' => 'Hausschuhe', - 'Sweater' => 'Pullover', - 'T-Shirt' => 'T-Shirt', - 'Unknown Type' => 'Unbekannter Typ', - - 'Food' => 'Lebensmittel', - 'Drink' => 'Getränk', - ]; - - /** - * Upload images for armor parts, personal weapons and ship items - */ - public function handle(): int - { - $this->http = Http::baseUrl(config('services.item_thumbnail_url')); - $this->upload = new UploadWikiImage(true); - - $this->info('Uploading Char Armor Images...'); - $this->withProgressBar(Armor::all(), function (Armor $armor) { - $this->work($armor, true); - }); - - $this->info('Uploading Clothing Images...'); - $this->withProgressBar(Clothes::all(), function (Clothes $armor) { - $this->work($armor, true); - }); - - $this->info('Uploading Weapon Personal Images...'); - $this->withProgressBar(PersonalWeapon::all(), function (PersonalWeapon $armor) { - $this->work($armor, true); - }); - - $this->info('Uploading Weapon Attachment Images...'); - $this->withProgressBar(Attachment::all(), function (Attachment $armor) { - $this->work($armor, true); - }); - - $this->info('Uploading Food Images...'); - $this->withProgressBar(Food::all(), function (Food $armor) { - $this->work($armor, true); - }); - - $this->info('Uploading Ship Item Images...'); - $this->withProgressBar(VehicleItem::all(), function (VehicleItem $armor) { - $this->work($armor, true); - }); - - $this->info('Done'); - - return 0; - } - - private function work($item, bool $normalizeCategory = false): void - { - if ($item instanceof CommodityItem) { - $item = $item->item; - } - - $url = sprintf('%s.jpg', $item->uuid); - - $this->headResponse = $this->http->head($url); - if (! $this->headResponse->successful()) { - return; - } - - $name = preg_replace('/[^\w-]/', ' ', $item->name); - $name = trim(preg_replace('/\s+/', ' ', $name)); - - if ($item instanceof Clothing) { - $name = CreateCharArmorWikiPages::getNameForModel($item); - } - - if (str_contains($name, '+')) { - $name = str_replace('+', ' (Plus)', $name); - } - - $source = sprintf('%s%s', config('services.item_thumbnail_url'), $url); - - $metadata = [ - 'filesize' => $this->headResponse->header('Content-Length'), - 'date' => $this->headResponse->header('Last-Modified'), - 'sources' => $source, - ]; - - $categories = [ - sprintf('{{subst:MFURN|%s}}', $item->manufacturer->code), - ]; - - if ($normalizeCategory) { - $this->normalizeCategory($item, $name, $metadata, $categories); - } else { - $categories[] = $name; - } - - if (! isset($metadata['description'])) { - $metadata['description'] = sprintf( - '[[%s]] vom Hersteller [[{{subst:MFURN|%s}}]]', - $name, - $item->manufacturer->code, - ); - } - - if (isset($this->typeTranslations[$item->type])) { - $categories[] = $this->typeTranslations[$item->type]; - - $type = $this->typeTranslations[$item->type]; - if ($item->type === 'WeaponGun') { - $type = 'Fahrzeugwaffe'; - } - - $metadata['description'] = sprintf( - '%s [[%s]] vom Hersteller [[{{subst:MFURN|%s}}]]', - $type, - $name, - $item->manufacturer->code, - ); - } - - $categories = collect($categories)->map(function ($category) { - return sprintf('[[Kategorie:%s]]', $category); - })->implode("\n"); - - try { - $this->upload->upload(sprintf('%s.jpg', $name), $source, $metadata, $categories); - } catch (Exception $e) { - $this->error($e->getMessage()); - } - } - - /** - * Removes the color from the items name - * Adds categories and a description - * - * @param CommodityItem $item - */ - private function normalizeCategory($item, string $name, array &$metadata, array &$categories): void - { - if (isset($this->typeTranslations[$item->type])) { - $categories[] = $this->typeTranslations[$item->type]; - - $metadata['description'] = sprintf( - '%s [[%s]] vom Hersteller [[{{subst:MFURN|%s}}]]', - $this->typeTranslations[$item->type], - $name, - $item->manufacturer->code, - ); - } - } -} diff --git a/app/Console/Commands/StarCitizen/Galactapedia/ImportArticleProperties.php b/app/Console/Commands/StarCitizen/Galactapedia/ImportArticleProperties.php index 35ab074a5..2aa432fa9 100644 --- a/app/Console/Commands/StarCitizen/Galactapedia/ImportArticleProperties.php +++ b/app/Console/Commands/StarCitizen/Galactapedia/ImportArticleProperties.php @@ -4,11 +4,11 @@ namespace App\Console\Commands\StarCitizen\Galactapedia; -use App\Console\Commands\AbstractQueueCommand; use App\Jobs\StarCitizen\Galactapedia\ImportArticleProperty; use App\Models\StarCitizen\Galactapedia\Article; +use Illuminate\Console\Command; -class ImportArticleProperties extends AbstractQueueCommand +class ImportArticleProperties extends Command { /** * The name and signature of the console command. diff --git a/app/Console/Commands/StarCitizen/Galactapedia/ImportArticles.php b/app/Console/Commands/StarCitizen/Galactapedia/ImportArticles.php index 457b5eefd..7d79a1a9c 100644 --- a/app/Console/Commands/StarCitizen/Galactapedia/ImportArticles.php +++ b/app/Console/Commands/StarCitizen/Galactapedia/ImportArticles.php @@ -4,9 +4,9 @@ namespace App\Console\Commands\StarCitizen\Galactapedia; -use App\Console\Commands\AbstractQueueCommand; +use Illuminate\Console\Command; -class ImportArticles extends AbstractQueueCommand +class ImportArticles extends Command { /** * The name and signature of the console command. diff --git a/app/Console/Commands/StarCitizen/Galactapedia/TranslateArticles.php b/app/Console/Commands/StarCitizen/Galactapedia/TranslateArticles.php index b2af12714..7361f41ca 100644 --- a/app/Console/Commands/StarCitizen/Galactapedia/TranslateArticles.php +++ b/app/Console/Commands/StarCitizen/Galactapedia/TranslateArticles.php @@ -4,14 +4,14 @@ namespace App\Console\Commands\StarCitizen\Galactapedia; -use App\Console\Commands\AbstractQueueCommand; use App\Jobs\StarCitizen\Galactapedia\TranslateArticle; use App\Models\StarCitizen\Galactapedia\Article; use App\Models\System\Language; +use Illuminate\Console\Command; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Collection; -class TranslateArticles extends AbstractQueueCommand +class TranslateArticles extends Command { /** * The name and signature of the console command. diff --git a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/ApproveArticles.php b/app/Console/Commands/StarCitizen/Galactapedia/Wiki/ApproveArticles.php deleted file mode 100644 index 3d171c68d..000000000 --- a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/ApproveArticles.php +++ /dev/null @@ -1,51 +0,0 @@ -get() - ->map(function (Article $article) { - return $article->title; - }) - ->chunk(25) - ->each(function (Collection $chunk) { - dispatch(new ApproveRevisions($chunk->toArray(), false, true)); - }); - - return 0; - } -} diff --git a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/CreateWikiPages.php b/app/Console/Commands/StarCitizen/Galactapedia/Wiki/CreateWikiPages.php deleted file mode 100644 index 25500f4f0..000000000 --- a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/CreateWikiPages.php +++ /dev/null @@ -1,37 +0,0 @@ -info('Dispatching Galactapedia Wiki Page Creation'); - - dispatch(new CreateGalactapediaWikiPages); - - return 0; - } -} diff --git a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/UploadImages.php b/app/Console/Commands/StarCitizen/Galactapedia/Wiki/UploadImages.php deleted file mode 100644 index e2dd2327f..000000000 --- a/app/Console/Commands/StarCitizen/Galactapedia/Wiki/UploadImages.php +++ /dev/null @@ -1,48 +0,0 @@ -info('Dispatching Galactapedia image upload'); - - $articles = Article::all(); - - $this->createProgressBar($articles->count()); - - Article::all()->chunk(100)->each(function (Collection $collection) { - $collection->each(function (Article $article) { - UploadGalactapediaWikiImages::dispatch($article); - $this->advanceBar(); - }); - }); - - return 0; - } -} diff --git a/app/Console/Commands/StarCitizen/ShipMatrix/DownloadShipMatrix.php b/app/Console/Commands/StarCitizen/ShipMatrix/DownloadShipMatrix.php deleted file mode 100644 index f95cb34d6..000000000 --- a/app/Console/Commands/StarCitizen/ShipMatrix/DownloadShipMatrix.php +++ /dev/null @@ -1,64 +0,0 @@ -dispatcher = $dispatcher; - } - - /** - * Execute the console command. - */ - public function handle(): int - { - if ($this->option('import') === true) { - $this->info('Downloading Ship Matrix and starting import'); - DownloadShipMatrixJob::withChain( - [ - new CheckShipMatrixStructure, - new ImportShipMatrix, - ] - )->dispatch(); - } else { - $this->info('Dispatching Ship Matrix Download Job'); - $this->dispatcher->dispatch(new DownloadShipMatrixJob); - } - - return 0; - } -} diff --git a/app/Console/Commands/StarCitizen/ShipMatrix/ImportShipMatrix.php b/app/Console/Commands/StarCitizen/ShipMatrix/ImportShipMatrix.php deleted file mode 100644 index 60a07549d..000000000 --- a/app/Console/Commands/StarCitizen/ShipMatrix/ImportShipMatrix.php +++ /dev/null @@ -1,45 +0,0 @@ -info('Dispatching Ship Matrix Parsing Job'); - - $file = $this->option('file'); - if ($file !== null) { - $file = explode('vehicles', $this->option('file'))[1] ?? null; - } - - ImportShipMatrixJob::dispatch($file); - - return 0; - } -} diff --git a/app/Console/Commands/StarCitizen/Starmap/TranslateSystems.php b/app/Console/Commands/StarCitizen/Starmap/TranslateSystems.php index e84f51097..3bc10f0ee 100644 --- a/app/Console/Commands/StarCitizen/Starmap/TranslateSystems.php +++ b/app/Console/Commands/StarCitizen/Starmap/TranslateSystems.php @@ -4,9 +4,9 @@ namespace App\Console\Commands\StarCitizen\Starmap; -use App\Console\Commands\AbstractQueueCommand as QueueCommand; +use Illuminate\Console\Command; -class TranslateSystems extends QueueCommand +class TranslateSystems extends Command { /** * The name and signature of the console command. diff --git a/app/Console/Commands/StarCitizen/Vehicle/ImportLoaner.php b/app/Console/Commands/StarCitizen/Vehicle/ImportLoaner.php index 6204d8bf8..34118bf65 100644 --- a/app/Console/Commands/StarCitizen/Vehicle/ImportLoaner.php +++ b/app/Console/Commands/StarCitizen/Vehicle/ImportLoaner.php @@ -2,9 +2,9 @@ namespace App\Console\Commands\StarCitizen\Vehicle; -use App\Console\Commands\AbstractQueueCommand; +use Illuminate\Console\Command; -class ImportLoaner extends AbstractQueueCommand +class ImportLoaner extends Command { /** * The name and signature of the console command. @@ -27,7 +27,7 @@ public function handle(): int { $this->info('Importing Loaners'); - \App\Jobs\StarCitizen\Vehicle\Import\ImportLoaner::dispatch(); + \App\Jobs\StarCitizen\Vehicle\ImportLoaner::dispatch(); return 0; } diff --git a/app/Console/Commands/StarCitizen/Vehicle/ImportMsrp.php b/app/Console/Commands/StarCitizen/Vehicle/ImportMsrp.php index 360b9500c..4353daab3 100644 --- a/app/Console/Commands/StarCitizen/Vehicle/ImportMsrp.php +++ b/app/Console/Commands/StarCitizen/Vehicle/ImportMsrp.php @@ -2,10 +2,10 @@ namespace App\Console\Commands\StarCitizen\Vehicle; -use App\Console\Commands\AbstractQueueCommand; -use App\Jobs\StarCitizen\Vehicle\Import\ImportMsrp as ImportMsrpJob; +use App\Jobs\StarCitizen\Vehicle\ImportMsrp as ImportMsrpJob; +use Illuminate\Console\Command; -class ImportMsrp extends AbstractQueueCommand +class ImportMsrp extends Command { /** * The name and signature of the console command. diff --git a/app/Console/Commands/StarCitizen/Vehicle/ImportShipMatrix.php b/app/Console/Commands/StarCitizen/Vehicle/ImportShipMatrix.php new file mode 100644 index 000000000..13643d718 --- /dev/null +++ b/app/Console/Commands/StarCitizen/Vehicle/ImportShipMatrix.php @@ -0,0 +1,37 @@ +info('Dispatching Ship Matrix Download and Import Job'); + + ImportShipMatrixJob::dispatch(); + + return 0; + } +} diff --git a/app/Console/Commands/Transcript/ImportMetadata.php b/app/Console/Commands/Transcript/ImportMetadata.php deleted file mode 100644 index b69194bd3..000000000 --- a/app/Console/Commands/Transcript/ImportMetadata.php +++ /dev/null @@ -1,35 +0,0 @@ -option('chunkAll')); - - return 0; - } -} diff --git a/app/Console/Commands/Transcript/TranslateTranscripts.php b/app/Console/Commands/Transcript/TranslateTranscripts.php deleted file mode 100644 index c9df7f754..000000000 --- a/app/Console/Commands/Transcript/TranslateTranscripts.php +++ /dev/null @@ -1,39 +0,0 @@ -info('Dispatching Transcript Translation'); - if (! $this->hasArgument('limit')) { - dispatch(new \App\Jobs\Transcript\Translate\TranslateTranscripts); - } else { - dispatch(new \App\Jobs\Transcript\Translate\TranslateTranscripts((int) $this->argument('limit'))); - } - - return 0; - } -} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php deleted file mode 100644 index 2e08f6c38..000000000 --- a/app/Console/Kernel.php +++ /dev/null @@ -1,286 +0,0 @@ -schedule = $schedule; - - $this->scheduleStatJobs(); - - if (config('schedule.ship_matrix.enabled')) { - $this->scheduleVehicleJobs(); - } - - if (config('schedule.comm_links.enabled')) { - $this->scheduleCommLinkJobs(); - } - - if (config('schedule.starmap.enabled')) { - $this->scheduleStarmapJobs(); - } - - if (config('schedule.galactapedia.enabled')) { - $this->scheduleGalactapediaJobs(); - } - } - - /** - * Register the Closure based commands for the application. - */ - protected function commands(): void - { - require base_path('routes/console.php'); - } - - /** - * Stat related Jobs. - */ - private function scheduleStatJobs(): void - { - $this->schedule - ->command(DownloadStats::class, ['--import']) - ->dailyAt('20:00'); - } - - /** - * Comm-Link related Jobs. - */ - private function scheduleCommLinkJobs(): void - { - /* Check for new Comm-Links */ - $this->schedule - ->command(CommLinkSchedule::class) - ->everyFifteenMinutes(); - - /* Run CommLink Notification only once each day */ - $this->schedule->call(function () { - NewCommLinksDownloaded::dispatch(); - })->dailyAt('18:00'); - - /* Re-Download all Comm-Links monthly */ - $this->schedule - ->command(ReDownloadCommLinks::class, ['--skip=false']) - ->monthly() - ->after( - function () { - CommLinksChangedEvent::dispatch(); - } - ); - - /* Download Comm-Link Images */ - if (config('schedule.comm_links.download_local') === true) { - $this->schedule->command(DownloadCommLinkImages::class)->daily()->withoutOverlapping(); - } - - /* Update Proof Read Status */ - $this->schedule - ->job(UpdateCommLinkProofReadStatus::class) - ->daily() - ->withoutOverlapping(); - } - - /** - * Ship Matrix related Jobs. - */ - private function scheduleVehicleJobs(): void - { - $hours = config('schedule.ship_matrix.at', []); - // Ensure first and second key exists - $hours = array_merge([1, 13], $hours); - - $this->schedule - ->command(DownloadShipMatrix::class, ['--import']) - ->twiceDaily( - $hours[0], - $hours[1], - ); - - $this->schedule - ->command(ImportMsrp::class) - ->daily(); - - $this->schedule - ->command(ImportLoaner::class) - ->daily(); - } - - /** - * Starmap download and import job - */ - private function scheduleStarmapJobs(): void - { - $this->schedule - ->command(DownloadStarmap::class, ['--import']) - ->monthly(); - } - - /** - * Galactapedia Jobs - */ - private function scheduleGalactapediaJobs(): void - { - $this->schedule - ->command(ImportCategories::class) - ->onSuccess(function () { - $this->call(ImportArticles::class); - }) - ->dailyAt('2:00') - ->withoutOverlapping(); - - $this->schedule - ->command(ImportArticleProperties::class) - ->dailyAt('2:30') - ->withoutOverlapping(); - - $this->schedule - ->command(TranslateArticles::class) - ->dailyAt('3:00') - ->withoutOverlapping(); - - if (config('schedule.galactapedia.create_wiki_pages')) { - $this->schedule - ->command(CreateWikiPages::class) - ->dailyAt('3:30') - ->withoutOverlapping(); - } - } -} diff --git a/app/Contracts/HasChangelogsInterface.php b/app/Contracts/HasChangelogsInterface.php deleted file mode 100644 index 82b554d0b..000000000 --- a/app/Contracts/HasChangelogsInterface.php +++ /dev/null @@ -1,21 +0,0 @@ -request = $request; - } -} diff --git a/app/Events/ModelUpdating.php b/app/Events/ModelUpdating.php deleted file mode 100644 index 7b4748ad6..000000000 --- a/app/Events/ModelUpdating.php +++ /dev/null @@ -1,33 +0,0 @@ -model = $model; - } -} diff --git a/app/Events/Rsi/CommLink/CommLinksChanged.php b/app/Events/Rsi/CommLink/CommLinksChanged.php deleted file mode 100644 index 280d0aa3d..000000000 --- a/app/Events/Rsi/CommLink/CommLinksChanged.php +++ /dev/null @@ -1,33 +0,0 @@ -commLinks = CommLinksChangedModel::query()->where('type', 'update')->get(); - - CommLinksChangedModel::query()->where('type', 'update')->delete(); - } -} diff --git a/app/Events/Rsi/CommLink/NewCommLinksDownloaded.php b/app/Events/Rsi/CommLink/NewCommLinksDownloaded.php deleted file mode 100644 index 5f8c991de..000000000 --- a/app/Events/Rsi/CommLink/NewCommLinksDownloaded.php +++ /dev/null @@ -1,33 +0,0 @@ -commLinks = CommLinkChangedModel::query()->where('type', 'creation')->get(); - - CommLinkChangedModel::query()->where('type', 'creation')->delete(); - } -} diff --git a/app/Events/StarCitizen/ShipMatrix/ShipMatrixStructureChanged.php b/app/Events/StarCitizen/ShipMatrix/ShipMatrixStructureChanged.php deleted file mode 100644 index 3c069b5eb..000000000 --- a/app/Events/StarCitizen/ShipMatrix/ShipMatrixStructureChanged.php +++ /dev/null @@ -1,16 +0,0 @@ -is('api*')) { - return $this->returnApiResponse($request, $exception); - } - - return parent::render($request, $exception); - } - - /** - * Convert an authentication exception into an unauthenticated response. - * - * @param \Illuminate\Http\Request $request The HTTP Request - * @param \Illuminate\Auth\AuthenticationException $exception The Auth Exception - * @return \Illuminate\Http\Response - */ - protected function unauthenticated($request, AuthenticationException $exception) - { - if ($request->expectsJson()) { - return response()->json(['error' => 'Unauthenticated.'], 401); - } - - return redirect()->guest('login'); - } - - /** - * @param \Illuminate\Http\Request $request - */ - protected function wantsJson($request): bool - { - return $request->wantsJson() || $request->query('format', null) === 'json'; - } - - /** - * Get the status code from the exception. - */ - protected function getStatusCode(Throwable $exception): int - { - $statusCode = null; - - if ($exception instanceof ValidationException) { - $statusCode = $exception->status; - } elseif ($exception instanceof HttpExceptionInterface) { - $statusCode = $exception->getStatusCode(); - } else { - // By default throw 500 - $statusCode = 500; - } - - // Be extra defensive - if ($statusCode < 100 || $statusCode > 599) { - $statusCode = 500; - } - - return $statusCode; - } - - private function returnApiResponse($request, Throwable $exception) - { - $request->headers->set('Accept', 'application/json'); - - if (config('app.debug')) { - return parent::render($request, $exception); - } - - return new Response([ - 'code' => $this->getStatusCode($exception), - 'message' => $exception->getMessage(), - ], $this->getStatusCode($exception)); - } -} diff --git a/app/Exceptions/InvalidDataException.php b/app/Exceptions/InvalidDataException.php deleted file mode 100644 index 32a39df26..000000000 --- a/app/Exceptions/InvalidDataException.php +++ /dev/null @@ -1,13 +0,0 @@ -request = $request; - $this->manager = new Manager; - $this->manager->parseIncludes($request->get('include', '')); - - $this->processRequestParams(); - } - - /** - * Processes all possible Request Parameters - */ - protected function processRequestParams(): void - { - $this->processLimit(); - //$this->processIncludes(); - $this->processLocale(); - } - - /** - * Processes the 'limit' Request-Parameter - */ - private function processLimit(): void - { - if ($this->request->has(self::LIMIT) && $this->request->get(self::LIMIT, null) !== null) { - $itemLimit = (int) $this->request->get(self::LIMIT); - - if ($itemLimit > 0) { - $this->limit = $itemLimit; - } elseif ($itemLimit === 0) { - $this->limit = 0; - } else { - $this->errors[self::LIMIT] = static::INVALID_LIMIT_STRING; - } - } - } - - /** - * Processes the 'locale' Request-Parameter - */ - private function processLocale(): void - { - if ($this->request->has(self::LOCALE) && $this->request->get(self::LOCALE, null) !== null) { - $this->setLocale($this->request->get(self::LOCALE)); - } - } - - /** - * Set the Locale - */ - protected function setLocale(string $localeCode): void - { - if (in_array($localeCode, config('language.codes'), true)) { - $this->localeCode = $localeCode; - - if ($this->transformer instanceof LocalizableTransformerInterface) { - $this->transformer->setLocale($localeCode); - } - } else { - $this->errors[self::LOCALE] = sprintf(static::INVALID_LOCALE_STRING, $localeCode); - } - } - - /** - * Disables the pagination by setting the limit to 0 - * - * @return $this - */ - protected function disablePagination(): self - { - $this->limit = 0; - - return $this; - } - - /** - * Creates the API Response, Collection if no pagination, Paginator if a limit is set - * Item if a single model is given - * - * @param Builder|Model|Collection $query - */ - protected function getResponse($query): Response - { - if ($query === null) { - $query = collect(); - } - - if ($query instanceof Model) { - $resource = new Item($query, $this->transformer); - $resource->setMeta($this->getMeta()); - - $datum = $this->manager->createData($resource); - - return new Response($datum, 200); - } - - if ($this->limit === 0 || $query instanceof Collection) { - if ($query instanceof Builder) { - $query = $query->get(); - } - - $resource = new \League\Fractal\Resource\Collection($query, $this->transformer); - $resource->setMeta($this->getMeta()); - - return new Response($this->manager->createData($resource), 200); - } - - $paginate = $query->paginate($this->limit); - - ApiRouteCalled::dispatch([ - 'url' => $this->request->fullUrl(), - 'user-agent' => $this->request->userAgent() ?? 'Star Citizen Wiki API', - 'forwarded-for' => $this->request->header('X-Forwarded-For', '127.0.0.1'), - ]); - - $resource = new \League\Fractal\Resource\Collection( - $query->get(), - $this->transformer - ); - $resource->setMeta($this->getMeta()); - $resource->setPaginator(new IlluminatePaginatorAdapter($paginate)); - - return new Response($this->manager->createData($resource), 200); - } - - /** - * Generates the Meta Array - * - * @return array Meta Array - */ - protected function getMeta(): array - { - $meta = [ - 'processed_at' => Carbon::now()->toDateTimeString(), - ]; - - if (! empty($this->errors)) { - $meta['errors'] = $this->errors; - } - - if (! empty($this->transformer->getAvailableIncludes())) { - $meta['valid_relations'] = array_map( - 'Illuminate\Support\Str::snake', - $this->transformer->getAvailableIncludes() - ); - } - - return array_merge($meta, $this->extraMeta); - } - - /** - * Processes the 'include' Model Relations Request-Parameter - */ - private function processIncludes(): void - { - if ($this->request->has('include') && $this->request->get('include', null) !== null) { - $this->checkIncludes($this->request->get('include', [])); - } - } - - /** - * Processes the given 'include' model relation key - * - * @param string|array $relations - */ - protected function checkIncludes($relations): void - { - if (! is_array($relations)) { - $relations = explode(',', $relations); - } - - collect($relations)->transform( - static function ($relation) { - return trim($relation); - } - ) - ->transform( - static function ($relation) { - return Str::camel($relation); - } - ) - ->each( - function ($relation) { - if (! in_array($relation, $this->transformer->getAvailableIncludes(), true)) { - $this->errors['include'][] = sprintf(static::INVALID_RELATION_STRING, Str::snake($relation)); - } - } - ); - } - - /** - * Cleans the name for query use - */ - protected function cleanQueryName(string $name): string - { - return str_replace('_', ' ', urldecode($name)); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/CommLink/Category/CategoryController.php b/app/Http/Controllers/Api/V1/Rsi/CommLink/Category/CategoryController.php deleted file mode 100644 index 3ca2ed538..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/CommLink/Category/CategoryController.php +++ /dev/null @@ -1,95 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/comm-links/categories', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Categories', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_category') - ) - ), - ] - )] - public function index(): Response - { - $categories = Category::query()->orderBy('name'); - - return $this->getResponse($categories); - } - - #[OA\Get( - path: '/api/comm-links/categories/{category}', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter( - name: 'category', - description: 'Name or slug of the category', - in: 'path', - required: true, - ), - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/comm_link_category', - response: 200, - description: 'A singular Comm-Link Category', - ), - new OA\Response( - response: 404, - description: 'No Category with specified name found.', - ), - ] - )] - public function show(string $category): Response - { - try { - $category = Category::query() - ->where('name', $category) - ->orWhere('slug', $category) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $category)], 404); - } - - $this->transformer = new CommLinkTransformer; - - return $this->getResponse($category->commLinks()->orderByDesc('cig_id')); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/CommLink/Channel/ChannelController.php b/app/Http/Controllers/Api/V1/Rsi/CommLink/Channel/ChannelController.php deleted file mode 100644 index eeab6986e..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/CommLink/Channel/ChannelController.php +++ /dev/null @@ -1,95 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/comm-links/channels', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Channels', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_channel') - ) - ), - ] - )] - public function index(): Response - { - $categories = Channel::query()->orderBy('name'); - - return $this->getResponse($categories); - } - - #[OA\Get( - path: '/api/comm-links/channels/{channel}', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter( - name: 'category', - description: 'Name or slug of the category', - in: 'path', - required: true, - ), - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/comm_link_channel', - response: 200, - description: 'A singular Comm-Link Channel', - ), - new OA\Response( - response: 404, - description: 'No Channel with specified name found.', - ), - ] - )] - public function show(string $channel): Response - { - try { - $channel = Channel::query() - ->where('name', $channel) - ->orWhere('slug', $channel) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $channel)], 404); - } - - $this->transformer = new CommLinkTransformer; - - return $this->getResponse($channel->commLinks()->orderByDesc('cig_id')); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkController.php b/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkController.php deleted file mode 100644 index 6fbe8f89f..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkController.php +++ /dev/null @@ -1,151 +0,0 @@ -transformer = $transformer; - - // Don't include translation per default - $this->transformer->setDefaultIncludes(array_slice($this->transformer->getAvailableIncludes(), 0, 2)); - - parent::__construct($request); - } - - #[OA\Get( - path: '/api/comm-links', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'comm_link_includes', - description: 'Available Comm-Link includes', - collectionFormat: 'csv', - enum: [ - 'english', - 'german', - 'images', - 'links', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Comm-Links', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link') - ) - ), - ] - )] - public function index(): Response - { - return $this->getResponse(CommLink::query()->orderByDesc('cig_id')); - } - - #[OA\Get( - path: '/api/comm-links/{id}', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'comm_link_includes', - description: 'Available Comm-Link includes', - collectionFormat: 'csv', - enum: [ - 'english', - 'german', - 'images', - 'links', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'id', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'comm_link_id', - description: 'Comm-Link ID, starting from 12663', - type: 'integer', - format: 'int64', - minimum: 12663 - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/comm_link', - response: 200, - description: 'A singular Comm-Link', - ), - new OA\Response( - response: 404, - description: 'No Comm-Link with specified ID found.', - ), - ] - )] - public function show(Request $request) - { - try { - ['comm_link' => $commLink] = Validator::validate( - [ - 'comm_link' => $request->comm_link, - ], - [ - 'comm_link' => 'required|int|min:12663', - ] - ); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - try { - $commLink = CommLink::query()->where('cig_id', $commLink)->firstOrFail(); - $commLink->append(['prev', 'next']); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $commLink)], 404); - } - - $this->extraMeta = [ - 'prev_id' => optional($commLink->prev)->cig_id ?? -1, - 'next_id' => optional($commLink->next)->cig_id ?? -1, - ]; - - return $this->getResponse($commLink); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkSearchController.php b/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkSearchController.php deleted file mode 100644 index e05b105a6..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/CommLink/CommLinkSearchController.php +++ /dev/null @@ -1,387 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - #[OA\Post( - path: '/api/comm-links/search', - requestBody: new OA\RequestBody( - description: '(Partial) Comm-Link Title or ID', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'query', - type: 'json', - ), - example: '{"query": "Banu Merchantman"}', - ), - ] - ), - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/comm_link', - response: 200, - description: 'A singular Comm-Link', - ), - new OA\Response( - response: 404, - description: 'No Comm-Link with found.', - ), - ], - )] - public function searchByTitle(Request $request) - { - try { - $request->validate((new CommLinkSearchRequest)->rules()); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $query = $request->get('keyword') ?? $request->get('query'); - - return $this->disablePagination() - ->getResponse( - CommLink::query() - ->where('title', 'LIKE', sprintf('%%%s%%', $query)) - ->orWhere('cig_id', 'LIKE', "%{$query}%") - ->limit(100) - ); - } - - #[OA\Post( - path: '/api/comm-links/reverse-image-link-search', - requestBody: new OA\RequestBody( - description: 'Url to an image hosted on (media.)robertsspaceindustries.com', - required: true, - content: [ - 'url' => new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'url', - type: 'json', - ), - example: '{"url": "https://robertsspaceindustries.com/i/cc75a45005a236c6e015dfc2782a2f55ed1e84a2/ADdPNihJzmPbNuTnFsH1DqUeqBRpXdSXVVtgJTyDDgscGKrzJuoFjResiiucPBBDeyrBscqRyZz4qxNsSbWvqUwdG/alien-week-2022-front.webp"}', - ), - ] - ), - tags: ['Comm-Links', 'RSI-Website'], - responses: [ - new OA\Response( - response: 200, - description: 'List of Comm-Links that use that image', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_link') - ) - ), - new OA\Response( - response: 404, - description: 'No Comm-Link found.', - ), - ], - )] - public function reverseImageLinkSearch(Request $request) - { - try { - $request->validate((new ReverseImageLinkSearchRequest)->rules()); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - /** @var Image $image */ - $image = Image::query() - ->where( - 'dir', - $this->getDirHashFromImageUrl($request->get('url', '')) - ) - ->firstOr( - ['*'], - function () { - return []; - } - ); - - return $this->disablePagination() - ->getResponse(optional($image)->commLinks); - } - - #[OA\Post( - path: '/api/comm-links/reverse-image-search', - requestBody: new OA\RequestBody( - required: true, - content: [ - 'image' => new OA\MediaType( - mediaType: 'application/octet-stream', - schema: new OA\Schema( - schema: 'image', - description: 'The image to reverse-search', - type: 'string', - format: 'binary', - ), - ), - ] - ), - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter( - name: 'similarity', - in: 'query', - required: true, - schema: new OA\Schema( - schema: 'image_similarity', - type: 'integer', - maximum: 100, - minimum: 1, - ) - ), - new OA\Parameter( - name: 'method', - in: 'query', - required: true, - schema: new OA\Schema( - schema: 'image_search_method', - collectionFormat: 'csv', - default: 'perceptual', - enum: [ - 'perceptual', - 'difference', - 'average', - ] - ) - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Comm-Links that use that image', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_link') - ) - ), - new OA\Response( - response: 404, - description: 'No Comm-Link found.', - ), - ], - )] - public function reverseImageSearch(Request $request) - { - $this->checkExtensionsLoaded(); - try { - $request->validate((new ReverseImageSearchRequest)->rules()); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $this->transformer = new ImageHashTransformer; - $this->transformer->includeAllAvailableIncludes(); - - $hashConfig = $this->getHashConfigForMethod($request->get('method')); - $hashConfig['similarity'] = (int) $request->get('similarity'); - $hashData = $this->hashImage($hashConfig['hasher'], $request->file('image')); - - return $this->disablePagination() - ->getResponse( - $this->getHashesFromDatabase($hashConfig, $hashData) - ->map( - function (object $data) { - $id = $data->comm_link_image_id; - $image = Image::query()->find($id); - $image->similarity = round((1 - $data->distance / 64) * 100); - - return $image; - } - ) - ->sortByDesc('similarity') - ); - } - - /** - * Returns the RSI directory hash of an image url - * - * @param string $url The RSI Media URl - * @return string The directory hash of the image - */ - private function getDirHashFromImageUrl(string $url): string - { - return ImageParser::getDirHash( - parse_url( - ImageParser::cleanImgSource($url), - PHP_URL_PATH - ) - ); - } - - /** - * Checks if either GD or Imagick is loaded - * - * @throws HttpException - */ - private function checkExtensionsLoaded(): void - { - if (! extension_loaded('gd') && ! extension_loaded('imagick')) { - app('Log')::error('Required extension "GD" or "Imagick" not available.'); - - $this->response->error('Required extension "GD" or "Imagick" not available.', 501); - } - } - - /** - * Hash config based on hash method - */ - private function getHashConfigForMethod(string $hashMethod): array - { - switch ($hashMethod) { - case 'average': - return [ - 'hasher' => new ImageHash(new AverageHash), - 'prefix' => 'a', - 'table' => 'average_hash', - ]; - - case 'difference': - return [ - 'hasher' => new ImageHash(new DifferenceHash), - 'prefix' => 'd', - 'table' => 'difference_hash', - ]; - - case 'perceptual': - default: - return [ - 'hasher' => new ImageHash(new PerceptualHash2), - 'prefix' => 'p', - 'table' => 'perceptual_hash', - ]; - } - } - - /** - * Hashes an uploaded image - * - * @param ImageHash $hasher The hasher with set hash method - * @param UploadedFile $file The uploaded file - */ - private function hashImage(ImageHash $hasher, $file): array - { - $hash = $hasher->hash($file)->toHex(); - - return [ - 'hash' => $hash, - 'decoded' => array_map('hexdec', (str_split($hash, strlen($hash) / 2))), - ]; - } - - /** - * Return hashes based on database connection type - * - * - * @return Builder[]|Collection|\Illuminate\Support\Collection - */ - private function getHashesFromDatabase(array $hashConfig, array $hashData) - { - // Since SQLITE does not support the BIT_COUNT operation we only search for exact hash matches - if (config('database.default') === 'sqlite') { - return $this->getHashesFromSQLiteStore($hashConfig['table'], $hashData['hash']); - } - - return $this->getHashesFromSQLStore( - $hashConfig['prefix'], - $hashData['decoded'], - $hashConfig['similarity'] - ); - } - - /** - * Get the image hashes that equal the provided hash - * - * @param string $hashMethod Hash method average, distance, perceptual - * @param string $hash The image hash - * @return Builder[]|Collection - */ - private function getHashesFromSQLiteStore(string $hashMethod, string $hash) - { - return ImageHashModel::query() - ->where($hashMethod, $hash) - ->get('comm_link_image_id'); - } - - /** - * Get the image hashes matching the provided hash method and hamming distance - * - * @param string $prefix Hash Attribute prefix - * @param array $decodedHash Image hash split in the middle and hex decoded - * @param int $distance The maximum hamming distance - */ - private function getHashesFromSQLStore( - string $prefix, - array $decodedHash, - int $distance - ): \Illuminate\Support\Collection { - return DB::table('comm_link_image_hashes') - ->select('comm_link_image_id') - ->selectRaw( - 'BIT_COUNT('.$prefix.'_hash_1 ^ ?) + BIT_COUNT('.$prefix.'_hash_2 ^ ?) AS distance', - [ - $decodedHash[0], - $decodedHash[1], - ] - ) - ->havingRaw('distance <= ?', [$distance]) - ->limit(50) - ->get(); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/CommLink/Series/SeriesController.php b/app/Http/Controllers/Api/V1/Rsi/CommLink/Series/SeriesController.php deleted file mode 100644 index c5606dda5..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/CommLink/Series/SeriesController.php +++ /dev/null @@ -1,95 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/comm-links/series', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Series', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_series') - ) - ), - ] - )] - public function index(): Response - { - $categories = Series::query()->orderBy('name'); - - return $this->getResponse($categories); - } - - #[OA\Get( - path: '/api/comm-links/series/{series}', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter( - name: 'category', - description: 'Name or slug of the series', - in: 'path', - required: true, - ), - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/comm_link_series', - response: 200, - description: 'A singular Comm-Link Series', - ), - new OA\Response( - response: 404, - description: 'No Series with specified name found.', - ), - ] - )] - public function show(string $series): Response - { - try { - $series = Series::query() - ->where('name', $series) - ->orWhere('slug', $series) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $series)], 404); - } - - $this->transformer = new CommLinkTransformer; - - return $this->getResponse($series->commLinks()->orderByDesc('cig_id')); - } -} diff --git a/app/Http/Controllers/Api/V1/Rsi/Transcript/TranscriptController.php b/app/Http/Controllers/Api/V1/Rsi/Transcript/TranscriptController.php deleted file mode 100644 index cd311ec74..000000000 --- a/app/Http/Controllers/Api/V1/Rsi/Transcript/TranscriptController.php +++ /dev/null @@ -1,180 +0,0 @@ -transformer = $transformer; - - // Don't include translation per default - $this->transformer->setDefaultIncludes(array_slice($this->transformer->getAvailableIncludes(), 0, 2)); - - parent::__construct($request); - } - - /** - * Returns all Transcripts - * - * @Get("/{?page,limit,include}") - * - * @Versions({"v1"}) - * - * @Parameters({ - * - * @Parameter("page", type="integer", required=false, description="Pagination page", default=1), - * @Parameter( - * "include", - * type="string", - * required=false, - * description="Relations to include. Valid relations are shown in the meta data" - * ), - * @Parameter( - * "limit", - * type="integer", - * required=false, - * description="Items per page, set to 0, to return all items", - * default=10 - * ), - * }) - * - * @Request(headers={"Accept": "application/x.StarCitizenWikiApi.v1+json"}) - * - * @Response(200, body={ - * "data": { - * { - * "title": "Inside Star Citizen: Report Purport | Summer 2021", - * "youtube_id": "9gYBBb_FsCE", - * "youtube_url": "https://www.youtube.com/watch?v=9gYBBb_FsCE", - * "playlist_name": "Inside Star Citizen", - * "upload_date": "2021-09-23", - * "runtime": "1041", - * "runtime_formatted": "00:17:21", - * "thumbnail": "https://i.ytimg.com/vi/9gYBBb_FsCE/maxresdefault.jpg", - * "description": "YouTube Description", - * }, - * { - * "title": "...", - * } - * }, - * "meta": { - * "processed_at": "2020-12-07 14:45:18", - * "valid_relations": { - * "english", - * "german" - * }, - * "pagination": { - * "total": 1550, - * "count": 15, - * "per_page": 15, - * "current_page": 1, - * "total_pages": 104, - * "links": { - * "next": "https:\/\/api.star-citizen.wiki\/api\/transcripts?page=2" - * } - * } - * } - * }) - */ - public function index(): Response - { - return $this->getResponse(Transcript::query()->orderByDesc('upload_date')); - } - - /** - * Returns a singular transcript by its youtube-id - * - * @Get("/{ID}{?include}") - * - * @Versions({"v1"}) - * - * @Parameters({ - * - * @Parameter("ID", type="string", required=true, description="YouTube Video ID"), - * @Parameter( - * "include", - * type="string", - * required=false, - * description="Relations to include. Valid relations are shown in the meta data" - * ), - * }) - * - * @Transaction({ - * - * @Request(headers={"Accept": "application/x.StarCitizenWikiApi.v1+json"}), - * - * @Response(200, body={ - * "data": { - * "title": "Inside Star Citizen: Report Purport | Summer 2021", - * "youtube_id": "9gYBBb_FsCE", - * "youtube_url": "https://www.youtube.com/watch?v=9gYBBb_FsCE", - * "playlist_name": "Inside Star Citizen", - * "upload_date": "2021-09-23", - * "runtime": "1041", - * "runtime_formatted": "00:17:21", - * "thumbnail": "https://i.ytimg.com/vi/9gYBBb_FsCE/maxresdefault.jpg", - * "description": "YouTube Description", - * }, - * "meta": { - * "processed_at": "2020-12-07 14:52:11", - * "valid_relations": { - * "english", - * "german" - * }, - * "prev_id": "zKdN8N44d1g", - * "next_id": null - * } - * }), - * }) - * - * @throws ValidationException - */ - public function show(Request $request): Response - { - ['transcripts' => $transcript] = Validator::validate( - [ - 'transcripts' => $request->transcript, - ], - [ - 'transcripts' => 'required|string|min:11|max:20', - ] - ); - - try { - $transcript = Transcript::query()->where('youtube_id', $transcript)->firstOrFail(); - $transcript->append(['prev', 'next']); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $transcript)], 404); - } - - $this->extraMeta = [ - 'prev_id' => optional($transcript->prev)->youtube_id ?? null, - 'prev_title' => optional($transcript->prev)->title ?? null, - 'next_id' => optional($transcript->next)->youtube_id ?? null, - 'next_title' => optional($transcript->next)->title ?? null, - ]; - - return $this->getResponse($transcript); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Galactapedia/GalactapediaController.php b/app/Http/Controllers/Api/V1/StarCitizen/Galactapedia/GalactapediaController.php deleted file mode 100644 index 21436c518..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Galactapedia/GalactapediaController.php +++ /dev/null @@ -1,206 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/galactapedia', - tags: ['Galactapedia', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'galacapedia_includes', - description: 'Available Galactapedia includes', - collectionFormat: 'csv', - enum: [ - 'english', - 'tags', - 'categories', - 'related_articles', - 'properties', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Galactapedia Articles', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/galactapedia_article') - ) - ), - ] - )] - public function index(): Response - { - return $this->getResponse(Article::query()->orderByDesc('id')); - } - - #[OA\Get( - path: '/api/galactapedia/{id}', - tags: ['Galactapedia', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'galactapedia_include', - in: 'query', - schema: new OA\Schema( - schema: 'galacapedia_includes', - description: 'Available Galactapedia includes', - collectionFormat: 'csv', - enum: [ - 'english', - 'tags', - 'categories', - 'related_articles', - 'properties', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'id', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'galactapedia_id', - description: 'Galactapedia Article ID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/galactapedia_article', - response: 200, - description: 'A singular Article', - ), - new OA\Response( - response: 404, - description: 'No Article with specified ID found.', - ), - ] - )] - public function show(Request $request) - { - try { - ['article' => $article] = Validator::validate( - [ - 'article' => $request->article, - ], - [ - 'article' => 'required|string|min:10|max:12', - ] - ); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $article = urldecode($article); - - try { - $model = Article::query() - ->where('cig_id', $article) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $article)], 404); - } - - $this->transformer->includeAllAvailableIncludes(); - - return $this->getResponse($model); - } - - #[OA\Post( - path: '/api/galactapedia/search', - requestBody: new OA\RequestBody( - description: 'Article (partial) title, template or slug', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'query', - type: 'json', - ), - example: '{"query": "Banu"}', - ), - ] - ), - tags: ['Galactapedia', 'RSI-Website'], - responses: [ - new OA\Response( - response: 200, - description: 'List of articles matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/galactapedia_article') - ) - ), - new OA\Response( - response: 404, - description: 'No Article found.', - ), - ], - )] - public function search(Request $request) - { - $rules = (new GalactapediaSearchRequest)->rules(); - try { - $request->validate($rules); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $query = urldecode($request->get('query')); - $queryBuilder = Article::query() - ->where('title', 'like', "%{$query}%") - ->orWhere('slug', 'like', "%{$query}%") - ->orWhere('cig_id', 'like', "%{$query}%") - ->orWhereHas('templates', function (Builder $builder) use ($query) { - return $builder->where('template', 'like', "%{$query}%"); - }); - - if ($queryBuilder->count() === 0) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Manufacturer/ManufacturerController.php b/app/Http/Controllers/Api/V1/StarCitizen/Manufacturer/ManufacturerController.php deleted file mode 100644 index bd4f3a080..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Manufacturer/ManufacturerController.php +++ /dev/null @@ -1,212 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/manufacturers', - tags: ['Manufacturers', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'manufacturer_includes', - collectionFormat: 'csv', - enum: [ - 'vehicles', - 'ships', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Manufacturers', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/manufacturer') - ) - ), - ] - )] - public function index(): Response - { - return $this->getResponse(Manufacturer::query()); - } - - #[OA\Get( - path: '/api/manufacturer/{code}', - tags: ['Manufacturers', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'manufacturer_includes', - collectionFormat: 'csv', - enum: [ - 'vehicles', - 'ships', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'code', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'manufacturer_code', - description: 'Manufacturer Code, e.g. RSI', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/manufacturer', - response: 200, - description: 'A singular manufacturer', - ), - new OA\Response( - response: 404, - description: 'No Manufacturer with specified CODE found.', - ), - ] - )] - public function show(Request $request) - { - try { - ['manufacturer' => $manufacturer] = Validator::validate( - [ - 'manufacturer' => $request->manufacturer, - ], - [ - 'manufacturer' => 'required|string|min:1|max:255', - ] - ); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $manufacturer = urldecode($manufacturer); - - try { - $model = Manufacturer::query() - ->where('name_short', $manufacturer) - ->orWhere('name', $manufacturer) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $manufacturer)], 404); - } - - return $this->getResponse($model); - } - - #[OA\Post( - path: '/api/manufacturers/search', - requestBody: new OA\RequestBody( - description: 'Name', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'query', - type: 'json', - ), - example: '{"query": "RSI"}', - ), - ] - ), - tags: ['Manufacturers', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'manufacturer_includes', - collectionFormat: 'csv', - enum: [ - 'vehicles', - 'ships', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of manufacturers matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/manufacturer') - ) - ), - new OA\Response( - response: 404, - description: 'No manufacturer found.', - ), - ], - )] - public function search(Request $request) - { - $rules = (new ManufacturerSearchRequest)->rules(); - - try { - $request->validate($rules); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $query = urldecode($request->get('query')); - $queryBuilder = Manufacturer::query() - ->where('name_short', 'like', "%{$query}%") - ->orWhere('name', 'like', "%{$query}%"); - - if ($queryBuilder->count() === 0) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php b/app/Http/Controllers/Api/V1/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php deleted file mode 100644 index aad7b812b..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php +++ /dev/null @@ -1,68 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(CelestialObject::query()); - } - - /** - * @param string|int $code - */ - public function show($code): Response - { - $code = urldecode($code); - - try { - /** @var CelestialObject $celestialObject */ - $celestialObject = CelestialObject::query() - ->where('code', $code) - ->orWhere('cig_id', $code) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $code)], 404); - } - - return $this->getResponse($celestialObject); - } - - /** - * Search Endpoint - */ - public function search(): Response - { - $query = $this->request->get('query', ''); - $query = urldecode($query); - $queryBuilder = CelestialObject::query()->where('name', 'like', "%{$query}%"); - - if ($queryBuilder->count() === 0) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Starmap/Starsystem/StarsystemController.php b/app/Http/Controllers/Api/V1/StarCitizen/Starmap/Starsystem/StarsystemController.php deleted file mode 100644 index 5fb0d4583..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Starmap/Starsystem/StarsystemController.php +++ /dev/null @@ -1,201 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/starmap/starsystems', - tags: ['Starmap', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'starsystem_includes', - collectionFormat: 'csv', - enum: [ - 'celestial_objects', - 'jumppoints', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Starsystems', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/starsystem') - ) - ), - ] - )] - public function index(Request $request): Response - { - if ($request->has('transformer') && $request->get('transformer', null) === 'link') { - $this->transformer = new StarsystemLinkTransformer; - } - - return $this->getResponse(Starsystem::query()->orderBy('name')); - } - - #[OA\Get( - path: '/api/starmap/starsystem/{code}', - tags: ['Starmap', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'starsystem_includes', - collectionFormat: 'csv', - enum: [ - 'celestial_objects', - 'jumppoints', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'code', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'starsystem_code', - description: 'Starsystem Code, e.g. SOL', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/starsystem', - response: 200, - description: 'A singular Starsystem', - ), - new OA\Response( - response: 404, - description: 'No System with specified Code found.', - ), - ] - )] - public function show(Request $request) - { - try { - ['code' => $code] = Validator::validate( - [ - 'code' => $request->code, - ], - [ - 'code' => 'required|string|min:1|max:255', - ] - ); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $code = mb_strtoupper(urldecode($code)); - - try { - /** @var Starsystem $starsystem */ - $starsystem = Starsystem::query() - ->where('code', $code) - ->orWhere('cig_id', $code) - ->orWhere('name', 'LIKE', "%$code%") - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $code)], 404); - } - - return $this->getResponse($starsystem); - } - - // #[OA\Post( - // path: '/api/starmap/starsystems/search', - // requestBody: new OA\RequestBody( - // description: 'Starsystem name', - // required: true, - // content: [ - // new OA\MediaType( - // mediaType: 'application/json', - // schema: new OA\Schema( - // schema: 'query', - // type: 'json', - // ), - // example: '{"query": "SOL"}', - // ) - // ] - // ), - // tags: ['Starmap', 'RSI-Website'], - // responses: [ - // new OA\Response( - // response: 200, - // description: 'List of systems matching the query', - // content: new OA\JsonContent( - // type: 'array', - // items: new OA\Items(ref: '#/components/schemas/starsystem') - // ) - // ), - // new OA\Response( - // response: 404, - // description: 'No System found.', - // ) - // ], - // )] - public function search(Request $request) - { - $rules = (new StarsystemRequest)->rules(); - - try { - $request->validate($rules); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $query = urldecode($this->request->get('query', '')); - $queryBuilder = Starsystem::query()->where('name', 'like', "%{$query}%"); - - if ($queryBuilder->count() === 0) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Stat/StatController.php b/app/Http/Controllers/Api/V1/StarCitizen/Stat/StatController.php deleted file mode 100644 index 600624e51..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Stat/StatController.php +++ /dev/null @@ -1,67 +0,0 @@ -transformer = $transformer; - parent::__construct($request); - } - - #[OA\Get( - path: '/api/stats/latest', - tags: ['Stats', 'RSI-Website'], - responses: [ - new OA\Response( - ref: '#/components/schemas/stat', - response: 200, - description: 'List of stats' - ), - ] - )] - public function latest(): Response - { - $stat = Stat::query()->orderByDesc('created_at')->first(); - - return $this->getResponse($stat); - } - - #[OA\Get( - path: '/api/stats', - tags: ['Stats', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of stats', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/stat') - ) - ), - ] - )] - public function index(): Response - { - $stats = Stat::query()->orderByDesc('created_at'); - - return $this->getResponse($stats); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizen/Vehicle/VehicleController.php b/app/Http/Controllers/Api/V1/StarCitizen/Vehicle/VehicleController.php deleted file mode 100644 index 6c9328137..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizen/Vehicle/VehicleController.php +++ /dev/null @@ -1,223 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - #[OA\Get( - path: '/api/vehicles', - tags: ['Vehicles', 'RSI-Website', 'In-Game'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'vehicle_includes', - description: 'Available Vehicle includes', - collectionFormat: 'csv', - enum: [ - 'components', - 'hardpoints', - 'shops', - 'shops.items', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Vehicles', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle') - ) - ), - ] - )] - public function index(Request $request): Response - { - if ($request->has('transformer') && $request->get('transformer') === 'link') { - $this->transformer = new VehicleLinkTransformer; - if (! $request->has('limit')) { - $this->limit = 100; - } - } - - return $this->getResponse(Vehicle::query()->orderBy('name')); - } - - #[OA\Get( - path: '/api/vehicles/{name}', - tags: ['Vehicles', 'RSI-Website', 'In-Game'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'vehicle_includes', - description: 'Available Vehicle includes', - collectionFormat: 'csv', - enum: [ - 'components', - 'hardpoints', - 'shops', - 'shops.items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'name', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'vehicle_name', - description: '(Partial) Vehicle name', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/vehicle', - response: 200, - description: 'A singular vehicle' - ), - ] - )] - public function show(Request $request) - { - try { - ['vehicle' => $vehicle] = Validator::validate( - [ - 'vehicle' => $request->vehicle, - ], - [ - 'vehicle' => 'required|string|min:1|max:255', - ] - ); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $vehicle = urldecode($vehicle); - - try { - $vehicleModel = Vehicle::query() - ->where('name', 'LIKE', "%{$vehicle}%") - ->orWhere('slug', 'LIKE', "%{$vehicle}%") - ->first(); - - if ($vehicleModel === null) { - $vehicleModel = UnpackedVehicle::query() - ->where('name', 'like', '%'.$vehicle.'%') - ->orWhere('class_name', 'like', '%'.$vehicle.'%') - ->firstOrFail(); - - $locale = $this->transformer->getLocale(); - $this->transformer = new UnpackedVehicleTransformer; - if ($locale !== null) { - $this->transformer->setLocale($locale); - } - } - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $vehicle)], 404); - } - - return $this->getResponse($vehicleModel); - } - - #[OA\Post( - path: '/api/vehicles/search', - requestBody: new OA\RequestBody( - description: 'Vehicle (partial) name or slug', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'query', - type: 'json', - ), - example: '{"query": "Merchant"}', - ), - ] - ), - tags: ['Vehicles', 'RSI-Website', 'In-Game'], - responses: [ - new OA\Response( - response: 200, - description: 'List of vehicles matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle') - ) - ), - new OA\Response( - response: 404, - description: 'No vehicle found.', - ), - ], - )] - public function search(Request $request) - { - $rules = (new VehicleSearchRequest)->rules(); - try { - $request->validate($rules); - } catch (ValidationException $e) { - return new JsonResponse([ - 'code' => $e->status, - 'message' => $e->getMessage(), - ], $e->status); - } - - $query = urldecode($request->get('query')); - $queryBuilder = Vehicle::query() - ->where('name', 'like', "%{$query}%") - ->orWhere('slug', 'like', "%{$query}%"); - - if ($queryBuilder->count() === 0) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorController.php deleted file mode 100644 index b0c39f19e..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmor/CharArmorController.php +++ /dev/null @@ -1,58 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(CharArmor::query()); - } - - public function show(Request $request): Response - { - ['armor' => $armor] = Validator::validate( - [ - 'armor' => $request->armor, - ], - [ - 'armor' => 'required|string|min:1|max:255', - ] - ); - - $armor = $this->cleanQueryName($armor); - - try { - $armor = CharArmor::query() - ->whereHas('item', function (Builder $query) use ($armor) { - return $query->where('name', $armor)->orWhere('uuid', $armor); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $armor)], 404); - } - - return $this->getResponse($armor); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmorController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmorController.php deleted file mode 100644 index fb6cef9b6..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/CharArmorController.php +++ /dev/null @@ -1,58 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Armor::query()); - } - - public function show(Request $request): Response - { - ['armor' => $armor] = Validator::validate( - [ - 'armor' => $request->armor, - ], - [ - 'armor' => 'required|string|min:1|max:255', - ] - ); - - $armor = $this->cleanQueryName($armor); - - try { - $armor = Armor::query() - ->whereHas('item', function (Builder $query) use ($armor) { - return $query->where('name', $armor)->orWhere('uuid', $armor); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $armor)], 404); - } - - return $this->getResponse($armor); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/ClothingController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/ClothingController.php deleted file mode 100644 index 45ac0c969..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/ClothingController.php +++ /dev/null @@ -1,58 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Clothing::query()); - } - - public function show(Request $request): Response - { - ['clothing' => $clothing] = Validator::validate( - [ - 'clothing' => $request->clothing, - ], - [ - 'clothing' => 'required|string|min:1|max:255', - ] - ); - - $clothing = $this->cleanQueryName($clothing); - - try { - $clothing = Clothing::query() - ->whereHas('item', function (Builder $query) use ($clothing) { - return $query->where('name', $clothing)->orWhere('uuid', $clothing); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $clothing)], 404); - } - - return $this->getResponse($clothing); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/FoodController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/FoodController.php deleted file mode 100644 index bd4bde3d2..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/FoodController.php +++ /dev/null @@ -1,58 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Food::query()); - } - - public function show(Request $request): Response - { - ['food' => $food] = Validator::validate( - [ - 'food' => $request->food, - ], - [ - 'food' => 'required|string|min:1|max:255', - ] - ); - - $food = $this->cleanQueryName($food); - - try { - $food = Food::query() - ->whereHas('item', function (Builder $query) use ($food) { - return $query->where('name', $food)->orWhere('uuid', $food); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $food)], 404); - } - - return $this->getResponse($food); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Item/ItemController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Item/ItemController.php deleted file mode 100644 index c20f566d4..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Item/ItemController.php +++ /dev/null @@ -1,249 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - #[OA\Get( - path: '/api/items', - tags: ['In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'item_includes', - description: 'Available Item includes', - collectionFormat: 'csv', - enum: [ - 'shops', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of In-game Items', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/item') - ) - ), - ] - )] - public function index(): \Illuminate\Http\Response - { - return $this->getResponse(Item::query()->orderBy('name')); - } - - #[OA\Get( - path: '/api/items/{item}', - tags: ['In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'item_includes', - description: 'Available Item includes', - collectionFormat: 'csv', - enum: [ - 'shops', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'item', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'item_name_uuid', - description: 'Item name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/item', - response: 200, - description: 'A singular Item', - ), - new OA\Response( - response: 404, - description: 'No Item with specified UUID or name found.', - ), - ] - )] - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = Item::query() - ->where('name', $item) - ->orWhere('uuid', $item) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } - - #[OA\Post( - path: '/api/items/search', - requestBody: new OA\RequestBody( - description: 'Article (partial) name, type, sub-type or uuid', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - schema: 'query', - type: 'json', - ), - example: '{"query": "Arrowhead"}', - ), - ] - ), - tags: ['In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'item_includes', - description: 'Available Item includes', - collectionFormat: 'csv', - enum: [ - 'shops', - 'shops.items', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of items matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/item') - ) - ), - new OA\Response( - response: 404, - description: 'No item found.', - ), - ], - )] - public function search(ItemSearchRequest $request): Response - { - $rules = (new ItemSearchRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - try { - $item = Item::query(); - - if ($request->has('shop') && $request->get('shop') !== null) { - $item - ->whereHas('shopsRaw', function ($query) use ($request) { - $query->where('shop_uuid', $request->get('shop')); - }); - } - - $item->where('name', 'like', "%{$query}%") - ->orWhere('uuid', $query) - ->orWhere('type', $query) - ->orWhere('sub_type', $query); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($item); - } - - #[OA\Get( - path: '/api/items/tradeables', - tags: ['In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'item_includes', - description: 'Available Item includes', - collectionFormat: 'csv', - enum: [ - 'shops', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of tradeable In-game Items', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/item') - ) - ), - ] - )] - public function indexTradeables(): Response - { - return $this->getResponse( - Item::query() - ->whereIn('type', Inventory::EXTRA_TYPES) - ->orderBy('name') - ); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/CoolerController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/CoolerController.php deleted file mode 100644 index fcec32236..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/CoolerController.php +++ /dev/null @@ -1,59 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Cooler::query()); - } - - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = Cooler::query() - ->whereHas('shipItem.item', function (Builder $query) use ($item) { - return $query->where('name', $item) - ->orWhere('uuid', $item); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ItemController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ItemController.php deleted file mode 100644 index 171fa8e3b..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ItemController.php +++ /dev/null @@ -1,106 +0,0 @@ - '81e1a10a-c7bd-401f-92e1-284115dcd6e1', - '153d53e7-c5e0-445c-82ac-6aae2073b565' => '81e1a10a-c7bd-401f-92e1-284115dcd6e1', - - 'Impact I Mining Laser' => '6429e3d3-c813-4dfc-bc68-c95b54123722', - 'af6cede9-7ae7-47a6-ba91-dac5f020f698' => '6429e3d3-c813-4dfc-bc68-c95b54123722', - - 'Hofstede-S1 Mining Laser' => '077a4a94-6296-4a83-a6c4-f215f7efd1df', - 'a5b839fe-c1cc-4cbd-abb6-c9296ad84d46' => '077a4a94-6296-4a83-a6c4-f215f7efd1df', - - 'Klein-S1 Mining Laser' => 'e6b284b9-456a-4444-b5fc-7c33bf5a6945', - 'd04aed0b-3c4a-4aaf-96c6-1abf8b32c12a' => 'e6b284b9-456a-4444-b5fc-7c33bf5a6945', - ]; - - /** - * ShipController constructor. - */ - public function __construct(ShipItemTransformer $transformer, Request $request) - { - $this->transformer = $transformer; - - parent::__construct($request); - } - - /** - * View all items - */ - public function index(): Response - { - return $this->getResponse(ShipItem::query()->orderBy('name')); - } - - /** - * View a singular item - * - * @throws ValidationException - */ - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - if (isset($this->uuidFixes[$item])) { - $item = $this->uuidFixes[$item]; - } - - try { - $item = ShipItem::query() - ->whereRelation('item', 'name', $item) - ->orWhere('uuid', $item) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } - - /** - * View a singular item - */ - public function search(ItemSearchRequest $request): Response - { - $rules = (new ItemSearchRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - try { - $item = ShipItem::query() - ->whereRelation('item', 'name', 'like', "%{$query}%") - ->orWhere('uuid', $query); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $query)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/PowerPlantController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/PowerPlantController.php deleted file mode 100644 index 87e49a8a0..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/PowerPlantController.php +++ /dev/null @@ -1,59 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(PowerPlant::query()); - } - - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = PowerPlant::query() - ->whereHas('shipItem.item', function (Builder $query) use ($item) { - return $query->where('name', $item) - ->orWhere('uuid', $item); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/QuantumDriveController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/QuantumDriveController.php deleted file mode 100644 index 4b218c1f7..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/QuantumDriveController.php +++ /dev/null @@ -1,59 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(QuantumDrive::query()); - } - - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = QuantumDrive::query() - ->whereHas('shipItem.item', function (Builder $query) use ($item) { - return $query->where('name', $item) - ->orWhere('uuid', $item); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ShieldController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ShieldController.php deleted file mode 100644 index 629d6b59b..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/ShieldController.php +++ /dev/null @@ -1,59 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Shield::query()); - } - - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = Shield::query() - ->whereHas('shipItem.item', function (Builder $query) use ($item) { - return $query->where('name', $item) - ->orWhere('uuid', $item); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/WeaponController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/WeaponController.php deleted file mode 100644 index 9e5cad355..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Ship/WeaponController.php +++ /dev/null @@ -1,59 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Weapon::query()); - } - - public function show(Request $request): Response - { - ['item' => $item] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $item = $this->cleanQueryName($item); - - try { - $item = Weapon::query() - ->whereHas('shipItem.item', function (Builder $query) use ($item) { - return $query->where('name', $item) - ->orWhere('uuid', $item); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $item)], 404); - } - - return $this->getResponse($item); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Shop/ShopController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Shop/ShopController.php deleted file mode 100644 index 05936d2ac..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/Shop/ShopController.php +++ /dev/null @@ -1,340 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - #[OA\Get( - path: '/api/shops', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'shop_includes', - description: 'Available Shop includes', - collectionFormat: 'csv', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Shops', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/shop') - ) - ), - ] - )] - public function index(): Response - { - return $this->getResponse(Shop::query() - ->where('version', config(self::SC_DATA_KEY))); - } - - #[OA\Get( - path: '/api/shops/{shop}', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'shop_includes', - description: 'Available Shop includes', - collectionFormat: 'csv', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'shop', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'shop_name', - description: 'Shop name or position', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/shop', - response: 200, - description: 'A singular shop', - ), - new OA\Response( - response: 404, - description: 'No shop with specified name found.', - ), - ] - )] - public function show(Request $request): Response - { - ['shop' => $shop] = Validator::validate( - [ - 'shop' => $request->shop, - ], - [ - 'shop' => 'required|string|min:1|max:255', - ] - ); - - $shop = $this->cleanQueryName($shop); - - try { - $shop = Shop::query() - ->where('name_raw', 'LIKE', sprintf('%%%s%%%%', $shop)) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $shop)], 404); - } - - return $this->getResponse($shop); - } - - #[OA\Get( - path: '/api/shops/position/{position}', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'shop_includes', - description: 'Available Shop includes', - collectionFormat: 'csv', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'position', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'shop_position', - description: 'Shop position', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Shops in that position', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/shop') - ) - ), - new OA\Response( - response: 404, - description: 'No shop with specified position found.', - ), - ] - )] - public function showPosition(Request $request): Response - { - ['position' => $position] = Validator::validate( - [ - 'position' => $request->position, - ], - [ - 'position' => 'required|string|min:1|max:255', - ] - ); - - $position = $this->cleanQueryName($position); - $positions = Shop::query() - ->where('position', 'LIKE', sprintf('%%%s%%%%', $position)) - ->get(); - - if ($positions->isEmpty()) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $position)], 404); - } - - return $this->getResponse($positions); - } - - #[OA\Get( - path: '/api/shops/name/{name}', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'shop_includes', - description: 'Available Shop includes', - collectionFormat: 'csv', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'position', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'name', - description: 'Shop Name', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/shop', - response: 200, - description: 'Shop matching that name' - ), - new OA\Response( - response: 404, - description: 'No shop with specified name found.', - ), - ] - )] - public function showName(Request $request): Response - { - ['name' => $name] = Validator::validate( - [ - 'name' => $request->name, - ], - [ - 'name' => 'required|string|min:1|max:255', - ] - ); - - $name = $this->cleanQueryName($name); - $positions = Shop::query() - ->where('name', 'LIKE', sprintf('%%%s%%%%', $name)) - ->get(); - - if ($positions->isEmpty()) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $name)], 404); - } - - return $this->getResponse($positions); - } - - #[OA\Get( - path: '/api/shops/{position}/{name}', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - schema: 'shop_includes', - description: 'Available Shop includes', - collectionFormat: 'csv', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'position', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'name', - description: 'Shop Name', - type: 'string', - ), - ), - new OA\Parameter( - name: 'name', - in: 'path', - required: true, - schema: new OA\Schema( - schema: 'name', - description: 'Shop Name', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - ref: '#/components/schemas/shop', - response: 200, - description: 'Shop matching that name' - ), - new OA\Response( - response: 404, - description: 'No shop with specified name found.', - ), - ] - )] - public function showShopAtPosition(Request $request): Response - { - ['position' => $position, 'name' => $name] = Validator::validate( - [ - 'position' => $request->position, - 'name' => $request->name, - ], - [ - 'position' => 'required|string|min:1|max:255', - 'name' => 'required|string|min:1|max:255', - ] - ); - - $position = $this->cleanQueryName($position); - $name = $this->cleanQueryName($name); - - try { - $shop = Shop::query() - ->where('position', $position) - ->where('name', $name) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $position)], 404); - } - - return $this->getResponse($shop); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/AttachmentController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/AttachmentController.php deleted file mode 100644 index 61eb5a3e0..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/AttachmentController.php +++ /dev/null @@ -1,57 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(Attachment::query() - ->where('version', config(self::SC_DATA_KEY))); - } - - public function show(Request $request): Response - { - ['attachment' => $attachment] = Validator::validate( - [ - 'attachment' => $request->attachment, - ], - [ - 'attachment' => 'required|string|min:1|max:255', - ] - ); - - $attachment = $this->cleanQueryName($attachment); - - try { - $attachment = Attachment::query() - ->whereHas('item', function (Builder $query) use ($attachment) { - return $query->where('name', 'LIKE', $attachment.'%') - ->orWhere('uuid', $attachment); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $attachment)], 404); - } - - return $this->getResponse($attachment); - } -} diff --git a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalController.php b/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalController.php deleted file mode 100644 index 9d8a7ec60..000000000 --- a/app/Http/Controllers/Api/V1/StarCitizenUnpacked/WeaponPersonal/WeaponPersonalController.php +++ /dev/null @@ -1,60 +0,0 @@ -transformer = $transformer; - - parent::__construct($request); - } - - public function index(): Response - { - return $this->getResponse(WeaponPersonal::query() - ->where('version', config(self::SC_DATA_KEY))); - } - - public function show(Request $request): Response - { - ['weapon' => $weapon] = Validator::validate( - [ - 'weapon' => $request->weapon, - ], - [ - 'weapon' => 'required|string|min:1|max:255', - ] - ); - - $weapon = $this->cleanQueryName($weapon); - - try { - $weapon = WeaponPersonal::query() - ->whereHas('item', function (Builder $query) use ($weapon) { - return $query->where('name', $weapon) - ->orWhere('uuid', $weapon); - }) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - return new Response(['code' => 404, 'message' => sprintf(static::NOT_FOUND_STRING, $weapon)], 404); - } - - return $this->getResponse($weapon); - } -} diff --git a/app/Http/Controllers/Api/V2/AbstractApiV2Controller.php b/app/Http/Controllers/Api/V2/AbstractApiV2Controller.php deleted file mode 100644 index 4b11cdc53..000000000 --- a/app/Http/Controllers/Api/V2/AbstractApiV2Controller.php +++ /dev/null @@ -1,227 +0,0 @@ -request = $request; - - $this->processRequestParams(); - - ApiRouteCalled::dispatch([ - 'url' => $request->fullUrl(), - 'user-agent' => $request->userAgent() ?? 'Star Citizen Wiki API', - 'forwarded-for' => $request->header('X-Forwarded-For', '127.0.0.1'), - ]); - } - - /** - * Processes all possible Request Parameters - */ - protected function processRequestParams(): void - { - $this->processLimit(); - $this->processLocale(); - } - - /** - * Processes the 'limit' Request-Parameter - */ - private function processLimit(): void - { - if ($this->request->input(self::LIMIT) !== null) { - $itemLimit = (int) $this->request->get(self::LIMIT); - - if ($itemLimit > 500) { - $this->limit = 500; - } elseif ($itemLimit >= 0) { - $this->limit = $itemLimit; - } - } - } - - /** - * Processes the 'locale' Request-Parameter - */ - private function processLocale(): void - { - if ($this->request->has(self::LOCALE) && $this->request->get(self::LOCALE, null) !== null) { - $this->setLocale($this->request->get(self::LOCALE)); - } - } - - /** - * Set the Locale - */ - protected function setLocale(string $localeCode): void - { - if (in_array($localeCode, config('language.codes'), true)) { - $this->localeCode = $localeCode; - app()->setLocale(substr($localeCode, 0, 2)); - } - } - - /** - * Cleans the name for query use - */ - protected function cleanQueryName(string $name): string - { - return str_replace('_', ' ', urldecode($name)); - } - - protected function getAllowedIncludes(array $includes) - { - return collect($includes)->map(function ($include) { - if (is_array($include)) { - [$to, $from] = $include; - - return AllowedInclude::relationship($to, $from); - } - - return AllowedInclude::relationship($include); - })->flatten()->toArray(); - } -} diff --git a/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkController.php b/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkController.php deleted file mode 100644 index 6e16648f8..000000000 --- a/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkController.php +++ /dev/null @@ -1,137 +0,0 @@ -allowedIncludes(CommLinkResource::validIncludes()) - ->allowedFilters([ - AllowedFilter::exact('category', 'category.name'), - AllowedFilter::exact('series', 'series.name'), - AllowedFilter::exact('channel', 'channel.name'), - ]) - ->orderByDesc('cig_id') - ->paginate($this->limit) - ->appends(request()->query()); - - return CommLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/comm-links/{id}', - tags: ['Comm-Links', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/comm_link_includes_v2'), - new OA\Parameter( - name: 'id', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Comm-Link ID, starting from 12663', - type: 'integer', - format: 'int64', - minimum: 12663 - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A singular Comm-Link', - content: new OA\JsonContent(ref: '#/components/schemas/comm_link_v2') - ), - new OA\Response( - response: 404, - description: 'No Comm-Link with specified ID found.', - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['comm_link' => $commLink] = Validator::validate( - [ - 'comm_link' => $request->id, - ], - [ - 'comm_link' => 'required|int|min:12663', - ] - ); - - try { - $commLink = QueryBuilder::for(CommLink::class) - ->where('cig_id', $commLink) - ->allowedIncludes(CommLinkResource::validIncludes()) - ->firstOrFail(); - $commLink->append(['prev', 'next']); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Comm-Link with specified ID found.'); - } - - $resource = new CommLinkResource($commLink); - $resource->addMetadata([ - 'prev_id' => optional($commLink->prev)->cig_id ?? -1, - 'next_id' => optional($commLink->next)->cig_id ?? -1, - ]); - - return $resource; - } -} diff --git a/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkSearchController.php b/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkSearchController.php deleted file mode 100644 index 555fedbcd..000000000 --- a/app/Http/Controllers/Api/V2/Rsi/CommLink/CommLinkSearchController.php +++ /dev/null @@ -1,375 +0,0 @@ -validate((new CommLinkSearchRequest)->rules()); - - $query = $request->get('keyword') ?? $request->get('query'); - - $commLinks = QueryBuilder::for(CommLink::class) - ->where('title', 'LIKE', sprintf('%%%s%%', $query)) - ->orWhere('cig_id', 'LIKE', "%{$query}%") - ->limit(100) - ->allowedIncludes(CommLinkResource::validIncludes()) - ->allowedFilters([ - AllowedFilter::exact('category', 'category.name'), - AllowedFilter::exact('series', 'series.name'), - AllowedFilter::exact('channel', 'channel.name'), - ]) - ->get(); - - return CommLinkResource::collection($commLinks); - } - - #[OA\Post( - path: '/api/v2/comm-links/reverse-image-link-search', - requestBody: new OA\RequestBody( - description: 'Url to an image hosted on (media.)robertsspaceindustries.com', - required: true, - content: [ - 'url' => new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - type: 'object', - ), - example: '{"url": "https://robertsspaceindustries.com/i/cc75a45005a236c6e015dfc2782a2f55ed1e84a2/ADdPNihJzmPbNuTnFsH1DqUeqBRpXdSXVVtgJTyDDgscGKrzJuoFjResiiucPBBDeyrBscqRyZz4qxNsSbWvqUwdG/alien-week-2022-front.webp"}', - ), - ] - ), - tags: ['Comm-Links', 'RSI-Website', 'Search'], - responses: [ - new OA\Response( - response: 200, - description: 'List of Comm-Links that use that image', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_link_v2') - ) - ), - new OA\Response( - response: 404, - description: 'No Comm-Link found.', - ), - ], - )] - public function reverseImageLinkSearch(Request $request): AnonymousResourceCollection - { - $request->validate((new ReverseImageLinkSearchRequest)->rules()); - - $image = Image::query(); - - $dir = $this->getDirHashFromImageUrl($request->get('url', '')); - if ($dir === 'i') { - $path = parse_url( - ImageParser::cleanImgSource($request->get('url')), - PHP_URL_PATH - ); - $parts = explode('/', $path); - array_pop($parts); - $path = implode('/', $parts); - - $image->where('src', 'LIKE', $path.'%'); - } else { - $image->where('dir', $dir); - } - - /** @var Image $image */ - $image = $image->firstOr( - ['*'], - function () { - return []; - } - ); - - return CommLinkResource::collection(optional($image)->commLinks); - } - - #[OA\Post( - path: '/api/v2/comm-links/reverse-image-search', - requestBody: new OA\RequestBody( - required: true, - content: [ - 'image' => new OA\MediaType( - mediaType: 'application/octet-stream', - schema: new OA\Schema( - description: 'The image to reverse-search', - type: 'string', - format: 'binary', - ), - ), - ] - ), - tags: ['Comm-Links', 'RSI-Website', 'Search'], - parameters: [ - new OA\Parameter( - name: 'similarity', - in: 'query', - required: true, - schema: new OA\Schema( - type: 'integer', - maximum: 100, - minimum: 1, - ) - ), - new OA\Parameter( - name: 'method', - in: 'query', - required: true, - schema: new OA\Schema( - description: 'Available Comm-Link includes', - type: 'array', - items: new OA\Items( - type: 'string', - default: 'perceptual', - enum: [ - 'perceptual', - 'difference', - 'average', - ] - ), - ), - explode: false, - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of Comm-Links that use that image', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_link_v2') - ) - ), - new OA\Response( - response: 404, - description: 'No Comm-Link found.', - ), - ], - )] - public function reverseImageSearch(Request $request): AnonymousResourceCollection - { - $this->checkExtensionsLoaded(); - - $request->validate((new ReverseImageSearchRequest)->rules()); - - /** @var PDQHash $hash */ - [$hash, $quality] = PDQHasher::computeHashAndQualityFromFilename( - $request->file('image')->get(), - true, - true - ); - - $pdqHash = $hash->to64BitStrings(); - - $hashData = [ - 'perceptual_hash' => (new ImageHash(new PerceptualHash2))->hash($request->file('image'))->toHex(), - 'pdq_hash1' => $pdqHash[0], - 'pdq_hash2' => $pdqHash[1], - 'pdq_hash3' => $pdqHash[2], - 'pdq_hash4' => $pdqHash[3], - ]; - - $data = $this->getResultImages($hashData, (int) $request->get('similarity')); - - return ImageHashResource::collection($data); - } - - public function similarSearch(Request $request) - { - ['image' => $image, 'similarity' => $similarity] = Validator::validate( - [ - 'image' => $request->image, - 'similarity' => $request->similarity, - ], - [ - 'image' => 'required|int|exists:comm_link_images,id', - 'similarity' => 'nullable|int|min:1|max:100', - ] - ); - - /** @var Image $image */ - $image = Image::query()->find($image); - - return ImageHashResource::collection($image->similarImages($similarity ?? 50, 50)); - } - - private function getResultImages(array $hashData, int $similarity = 50) - { - return $this->getHashesFromDatabase($hashData) - ->map( - function (object $data) { - $id = $data->comm_link_image_id; - - $image = Image::query()->find($id); - - if ($data->pdq_distance === null) { - $image->similarity = round((1 - ($data->p_distance / 64)) * 100); - $image->similarity_method = __('Basierend auf Merkmalen des Inhalts'); - } else { - $image->similarity = round((1 - ($data->pdq_distance / 256)) * 100); - $image->similarity_method = ''; //PDQ - } - - $image->pdq_distance = $data->pdq_distance ?? $image->p_distance; - - return $image; - } - ) - ->filter() - ->sortByDesc('similarity') - ->filter(fn (object $image) => $image->similarity >= $similarity); - } - - /** - * Returns the RSI directory hash of an image url - * - * @param string $url The RSI Media URl - * @return string The directory hash of the image - */ - private function getDirHashFromImageUrl(string $url): string - { - return ImageParser::getDirHash( - parse_url( - ImageParser::cleanImgSource($url), - PHP_URL_PATH - ) - ); - } - - /** - * Checks if either GD or Imagick is loaded - * - * @throws HttpException - */ - private function checkExtensionsLoaded(): void - { - if (! extension_loaded('gd') && ! extension_loaded('imagick')) { - app('Log')::error('Required extension "GD" or "Imagick" not available.'); - - throw new HttpException(501, 'Required extension "GD" or "Imagick" not available.'); - } - } - - /** - * Return hashes based on database connection type - * - * - * @return Builder[]|Collection|\Illuminate\Support\Collection - */ - private function getHashesFromDatabase(array $hashData) - { - // Since SQLITE does not support the BIT_COUNT operation we only search for exact hash matches - if (config('database.default') === 'sqlite') { - return $this->getHashesFromSQLiteStore($hashData['perceptual_hash']); - } - - return $this->getHashesFromSQLStore($hashData); - } - - /** - * Get the image hashes that equal the provided hash - * - * @param string $hash The image hash - * @return Builder[]|Collection - */ - private function getHashesFromSQLiteStore(string $hash) - { - return ImageHashModel::query() - ->where('perceptual_hash', $hash) - ->get('comm_link_image_id'); - } - - /** - * Get the image hashes matching the provided hash method and hamming distance - * - * @param array $hashes Image hash split in the middle and hex decoded - */ - private function getHashesFromSQLStore(array $hashes): \Illuminate\Support\Collection - { - return ImageHashModel::query() - ->with('image') - ->select('comm_link_image_hashes.comm_link_image_id') - ->selectRaw( - <<<'SQL' -(BIT_COUNT(CONV(HEX(pdq_hash1), 16, 10) ^ CONV(?, 16, 10)) + -BIT_COUNT(CONV(HEX(pdq_hash2), 16, 10) ^ CONV(?, 16, 10)) + -BIT_COUNT(CONV(HEX(pdq_hash3), 16, 10) ^ CONV(?, 16, 10)) + -BIT_COUNT(CONV(HEX(pdq_hash4), 16, 10) ^ CONV(?, 16, 10))) as pdq_distance, -BIT_COUNT(CONV(HEX(perceptual_hash), 16, 10) ^ CONV(?, 16, 10)) AS p_distance -SQL, - [ - $hashes['pdq_hash1'], - $hashes['pdq_hash2'], - $hashes['pdq_hash3'], - $hashes['pdq_hash4'], - $hashes['perceptual_hash'], - ] - ) - ->join('comm_link_images', 'comm_link_image_hashes.comm_link_image_id', '=', 'comm_link_images.id') - ->join('comm_link_image_metadata', 'comm_link_image_metadata.comm_link_image_id', '=', 'comm_link_images.id') - ->orderBy('pdq_distance') - ->limit(50) - ->get(); - } -} diff --git a/app/Http/Controllers/Api/V2/Rsi/CommLink/ImageController.php b/app/Http/Controllers/Api/V2/Rsi/CommLink/ImageController.php deleted file mode 100644 index e3a699aa4..000000000 --- a/app/Http/Controllers/Api/V2/Rsi/CommLink/ImageController.php +++ /dev/null @@ -1,117 +0,0 @@ -allowedFilters([ - AllowedFilter::custom('tags', new ImageTagFilter), - ]) - ->orderByDesc('id') - ->paginate($this->limit) - ->appends(request()->query()); - - return ImageResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/comm-link-images/random', - tags: ['Comm-Links', 'RSI-Website', 'Images'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(name: 'filter[tags]', in: 'query', schema: new OA\Schema(type: 'string')), - ], - responses: [ - new OA\Response( - response: 200, - description: 'Retrieve a random Comm-Link Image. Limit parameter sets the number of random images', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_image_v2') - ) - ), - ] - )] - public function random(Request $request): AnonymousResourceCollection - { - $query = QueryBuilder::for(Image::class, $request) - ->allowedFilters([ - AllowedFilter::partial('tags', 'tags.name'), - ]) - ->whereRelation('metadata', 'size', '>=', 250 * 1024) - ->inRandomOrder() - ->limit($request->has('limit') ? $this->limit : 1) - ->get(); - - return ImageResource::collection($query); - } - - #[OA\Post( - path: '/api/v2/comm-link-images/search', - tags: ['Comm-Links', 'RSI-Website', 'Images', 'Search'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(name: 'filter[tags]', in: 'query', schema: new OA\Schema(type: 'string')), - ], - responses: [ - new OA\Response( - response: 200, - description: 'Search for a Comm-Link Image by its filename.', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/comm_link_image_v2') - ) - ), - ] - )] - public function search(ImageSearchRequest $request): AnonymousResourceCollection - { - $query = QueryBuilder::for(Image::class, $request) - ->allowedFilters([ - AllowedFilter::partial('tags', 'tags.name'), - ]) - ->whereNull('base_image_id') - ->whereRaw('LOWER(src) LIKE ?', [sprintf('%%%s%%', strtolower($request->get('query')))]) - ->whereRelation('metadata', 'size', '>', 0) - ->limit($this->limit) - ->orderByDesc('created_at') - ->get(); - - return ImageResource::collection($query); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Char/ArmorController.php b/app/Http/Controllers/Api/V2/SC/Char/ArmorController.php deleted file mode 100644 index 88c0c6f4b..000000000 --- a/app/Http/Controllers/Api/V2/SC/Char/ArmorController.php +++ /dev/null @@ -1,137 +0,0 @@ -allowedFilters([ - AllowedFilter::partial('type'), - AllowedFilter::custom('variants', new ItemVariantsFilter), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/armor/{armor}', - tags: ['Clothing', 'In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/clothing_includes_v2'), - new OA\Parameter( - name: 'armor', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Armor name of UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'An Armor Item', - content: new OA\JsonContent(ref: '#/components/schemas/clothing_item_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['clothing' => $identifier] = Validator::validate( - [ - 'clothing' => $request->clothing, - ], - [ - 'clothing' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(Armor::class, $request) - ->where('uuid', $identifier) - ->orWhere('name', $identifier) - ->orderByDesc('version') - ->allowedIncludes(ClothingResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Armor with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Char/ClothesController.php b/app/Http/Controllers/Api/V2/SC/Char/ClothesController.php deleted file mode 100644 index f9be1c5d1..000000000 --- a/app/Http/Controllers/Api/V2/SC/Char/ClothesController.php +++ /dev/null @@ -1,110 +0,0 @@ -where('type', 'LIKE', 'Char_Clothing%') - ->allowedFilters([ - AllowedFilter::partial('type'), - AllowedFilter::custom('variants', new ItemVariantsFilter), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/clothes/{clothing}', - tags: ['Clothing', 'In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/clothing_includes_v2'), - new OA\Parameter( - name: 'clothing', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Clothing name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Clothing Item', - content: new OA\JsonContent(ref: '#/components/schemas/clothing_item_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['clothing' => $identifier] = Validator::validate( - [ - 'clothing' => $request->clothing, - ], - [ - 'clothing' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(Clothes::class, $request) - ->where('type', 'LIKE', 'Char_Clothing%') - ->where('uuid', $identifier) - ->orWhere('name', $identifier) - ->orderByDesc('version') - ->allowedIncludes(ClothingResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Clothing with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/PersonalWeaponController.php b/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/PersonalWeaponController.php deleted file mode 100644 index 4884b7b8d..000000000 --- a/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/PersonalWeaponController.php +++ /dev/null @@ -1,136 +0,0 @@ -allowedFilters([ - AllowedFilter::callback('type', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Item Type') - ->whereRelation('descriptionData', 'value', $value); - }), - AllowedFilter::callback('class', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Class') - ->whereRelation('descriptionData', 'value', $value); - }), - AllowedFilter::custom('variants', new ItemVariantsFilter), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/weapons/{weapon}', - tags: ['In-Game', 'Items', 'Weapons'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - description: 'Available Weapon includes', - type: 'array', - items: new OA\Items( - type: 'string', - enum: [ - 'variants', - 'ports', - 'shops', - 'shops.items', - ] - ), - ), - explode: false, - allowReserved: true - ), - new OA\Parameter( - name: 'weapon', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Weapon name of UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Personal Weapon', - content: new OA\JsonContent(ref: '#/components/schemas/personal_weapon_item_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['weapon' => $identifier] = Validator::validate( - [ - 'weapon' => $request->weapon, - ], - [ - 'weapon' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(PersonalWeapon::class, $request) - ->where('uuid', $identifier) - ->orWhere('name', $identifier) - ->orderByDesc('version') - ->allowedIncludes(PersonalWeaponResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Weapon with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/WeaponAttachmentController.php b/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/WeaponAttachmentController.php deleted file mode 100644 index 9e61330f0..000000000 --- a/app/Http/Controllers/Api/V2/SC/Char/PersonalWeapon/WeaponAttachmentController.php +++ /dev/null @@ -1,101 +0,0 @@ -allowedIncludes(ItemResource::validIncludes()) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/weapon-attachments/{attachment}', - tags: ['In-Game', 'Items', 'Weapons'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter( - name: 'attachment', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Attachment name of UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'An Attachment Item', - content: new OA\JsonContent(ref: '#/components/schemas/personal_weapon_attachment_item_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['attachment' => $identifier] = Validator::validate( - [ - 'attachment' => $request->attachment, - ], - [ - 'attachment' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(Attachment::class, $request) - ->where('uuid', $identifier) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $identifier)) - ->orderByDesc('version') - ->allowedIncludes(ItemResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Attachment with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/FactionController.php b/app/Http/Controllers/Api/V2/SC/FactionController.php deleted file mode 100644 index 5678d7cc6..000000000 --- a/app/Http/Controllers/Api/V2/SC/FactionController.php +++ /dev/null @@ -1,95 +0,0 @@ -paginate($this->limit) - ->appends(request()->query()); - - return FactionLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/factions/{faction}', - tags: ['In-Game', 'Factions'], - parameters: [ - new OA\Parameter( - name: 'faction', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Faction UUID or name', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Faction and its relations', - content: new OA\JsonContent(ref: '#/components/schemas/faction_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['faction' => $identifier] = Validator::validate( - [ - 'faction' => $request->faction, - ], - [ - 'faction' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $faction = QueryBuilder::for(Faction::class, $request) - ->where('uuid', $identifier) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $identifier)) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Faction with specified UUID or Name found.'); - } - - return new FactionResource($faction); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/FoodController.php b/app/Http/Controllers/Api/V2/SC/FoodController.php deleted file mode 100644 index c14da3de0..000000000 --- a/app/Http/Controllers/Api/V2/SC/FoodController.php +++ /dev/null @@ -1,105 +0,0 @@ -whereIn('type', ['Bottle', 'Food', 'Drink']) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/food/{food}', - tags: ['In-Game', 'Items', 'Consumables'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter( - name: 'food', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Food name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Food Item', - content: new OA\JsonContent(ref: '#/components/schemas/food_item_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['food' => $identifier] = Validator::validate( - [ - 'food' => $request->food, - ], - [ - 'food' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(Item::class, $request) - ->whereIn('type', ['Bottle', 'Food', 'Drink']) - ->where(function (Builder $query) use ($identifier) { - $query->where('uuid', $identifier) - ->orWhere('name', $identifier); - }) - ->orderByDesc('version') - ->allowedIncludes(FoodResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Food with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/ItemController.php b/app/Http/Controllers/Api/V2/SC/ItemController.php deleted file mode 100644 index 222659654..000000000 --- a/app/Http/Controllers/Api/V2/SC/ItemController.php +++ /dev/null @@ -1,223 +0,0 @@ -allowedFilters([ - 'type', - 'sub_type', - AllowedFilter::exact('manufacturer', 'manufacturer.name'), - AllowedFilter::custom('variants', new ItemVariantsFilter), - ]) - ->allowedIncludes(array_merge( - ItemResource::validIncludes(), - [AllowedInclude::custom('related_items', new IncludedPassthrough)] - )) - ->paginate($this->limit) - ->appends(request()->query()); - - return ItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/items/{item}', - tags: ['In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter( - name: 'item', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Item name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'An Item', - content: new OA\JsonContent(ref: '#/components/schemas/item_v2') - ), - ] - )] - public function show(Request $request) - { - ['item' => $identifier] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $item = QueryBuilder::for(Item::class, $request) - ->where(function (Builder $query) use ($identifier) { - $query->where('uuid', $identifier) - ->orWhere('name', $identifier); - }) - ->allowedIncludes(array_merge( - ItemResource::validIncludes(), - [AllowedInclude::custom('related_items', new IncludedPassthrough)] - )) - ->with([ - 'dimensions', - 'manufacturer', - 'translations', - 'container', - 'ports', - 'durabilityData', - 'descriptionData', - 'defaultTags', - 'requiredTags', - 'heatData', - 'powerData', - 'distortionData', - 'durabilityData', - 'interactions', - ]) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Item with specified UUID or Name found.'); - } - - if ($item->type === 'NOITEM_Vehicle') { - return redirect(sprintf('/api/v2/vehicles/%s', $item->uuid)); - } - - return new ItemResource($item); - } - - #[OA\Post( - path: '/api/v2/items/search', - requestBody: new OA\RequestBody( - description: 'Item Name or (sub)type', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - type: 'object', - ), - example: '{"query": "Arrow"}', - ), - ] - ), - tags: ['In-Game', 'Items', 'Search'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter(name: 'filter[variants]', in: 'query', schema: new OA\Schema(type: 'boolean')), - new OA\Parameter(name: 'filter[type]', in: 'query', schema: new OA\Schema(type: 'string')), - new OA\Parameter(name: 'filter[sub_type]', in: 'query', schema: new OA\Schema(type: 'string')), - new OA\Parameter(name: 'filter[manufacturer]', in: 'query', schema: new OA\Schema(type: 'string')), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A List of matching Items', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/item_link_v2') - ) - ), - ] - )] - public function search(ItemSearchRequest $request): JsonResource - { - $request->validate([ - 'query' => 'required|string|min:1|max:255', - 'shop' => 'nullable|uuid', - ]); - - $toSearch = $this->cleanQueryName($request->get('query')); - - $items = QueryBuilder::for(Item::class) - ->allowedFilters([ - 'type', - 'sub_type', - AllowedFilter::exact('manufacturer', 'manufacturer.name'), - AllowedFilter::custom('variants', new ItemVariantsFilter), - ]) - ->allowedIncludes(array_merge( - ['shops.items'], - [AllowedInclude::custom('related_items', new IncludedPassthrough)] - )); - - if ($request->has('shop') && $request->get('shop') !== null) { - $items->whereRelation('shops', 'uuid', $request->get('shop')); - } - - $items = $items - ->where(function (Builder $query) use ($toSearch) { - $query->where('name', 'like', "%{$toSearch}%") - ->orWhere('uuid', $toSearch) - ->orWhere('type', $toSearch) - ->orWhere('sub_type', $toSearch); - }) - ->paginate($this->limit) - ->appends(request()->query()); - - if ($items->count() === 0) { - throw new NotFoundHttpException(sprintf(static::NOT_FOUND_STRING, $toSearch)); - } - - return ItemLinkResource::collection($items); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/ManufacturerController.php b/app/Http/Controllers/Api/V2/SC/ManufacturerController.php deleted file mode 100644 index 6746e0caa..000000000 --- a/app/Http/Controllers/Api/V2/SC/ManufacturerController.php +++ /dev/null @@ -1,145 +0,0 @@ -select(['name']) - ->selectRaw('MAX(`code`) as code') - ->groupBy('name') - ->orderBy('name') - ->paginate($this->limit) - ->appends(request()->query()); - - return ManufacturerLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/manufacturers/{manufacturer}', - tags: ['In-Game', 'Manufacturers'], - parameters: [ - new OA\Parameter( - name: 'manufacturer', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Manufacturer name, uuid, or code', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Manufacturer and its products', - content: new OA\JsonContent(ref: '#/components/schemas/manufacturer_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['manufacturer' => $identifier] = Validator::validate( - [ - 'manufacturer' => $request->manufacturer, - ], - [ - 'manufacturer' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $shop = QueryBuilder::for(Manufacturer::class, $request) - ->where('uuid', $identifier) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $identifier)) - ->orWhere('code', 'LIKE', sprintf('%%%s%%', $identifier)) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Manufacturer with specified UUID or Name found.'); - } - - return new ManufacturerResource($shop); - } - - #[OA\Post( - path: '/api/v2/manufacturers/search', - tags: ['In-Game', 'Manufacturers', 'Search'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A List of matching Manufacturers', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/manufacturer_link_v2') - ) - ), - ] - )] - public function search(ItemSearchRequest $request): JsonResource - { - $rules = (new ItemSearchRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - $manufacturers = QueryBuilder::for(Manufacturer::class) - ->where('name', 'like', "%{$query}%") - ->orWhere('uuid', $query) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $query)) - ->orWhere('code', 'LIKE', sprintf('%%%s%%', $query)) - ->groupBy('name') - ->paginate($this->limit) - ->appends(request()->query()); - - if ($manufacturers->count() === 0) { - throw new NotFoundHttpException(sprintf(static::NOT_FOUND_STRING, $query)); - } - - return ManufacturerLinkResource::collection($manufacturers); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/MissionController.php b/app/Http/Controllers/Api/V2/SC/MissionController.php deleted file mode 100644 index e8ce2436d..000000000 --- a/app/Http/Controllers/Api/V2/SC/MissionController.php +++ /dev/null @@ -1,102 +0,0 @@ -allowedFilters([ - AllowedFilter::partial('type', 'type.name'), - AllowedFilter::partial('name', 'title'), - AllowedFilter::partial('giver', 'mission_giver'), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return MissionLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/missions/{mission}', - tags: ['In-Game', 'Missions'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'mission', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Mission UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Mission', - content: new OA\JsonContent(ref: '#/components/schemas/mission_v2') - ), - ] - )] - public function show(Request $request): JsonResource - { - ['mission' => $identifier] = Validator::validate( - [ - 'mission' => $request->mission, - ], - [ - 'mission' => 'required|uuid', - ] - ); - - $model = QueryBuilder::for(Mission::class, $request) - ->where('uuid', $identifier) - ->with([ - 'giver', - 'type', - 'deadline', - 'reward', - 'requiredMissions', - 'associatedMissions', - ]) - ->firstOrFail(); - - return new MissionResource($model); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/MissionGiverController.php b/app/Http/Controllers/Api/V2/SC/MissionGiverController.php deleted file mode 100644 index 799633d40..000000000 --- a/app/Http/Controllers/Api/V2/SC/MissionGiverController.php +++ /dev/null @@ -1,88 +0,0 @@ -paginate($this->limit) - ->appends(request()->query()); - - return GiverLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/mission-givers/{giver}', - tags: ['In-Game', 'Missions'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'giver', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Mission Giver UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Mission Giver', - content: new OA\JsonContent(ref: '#/components/schemas/mission_giver_v2') - ), - ] - )] - public function show(Request $request): JsonResource - { - ['giver' => $identifier] = Validator::validate( - [ - 'giver' => $request->giver, - ], - [ - 'giver' => 'required|uuid', - ] - ); - - $model = QueryBuilder::for(Giver::class, $request) - ->where('uuid', $identifier) - ->with([ - 'missions', - ]) - ->firstOrFail(); - - return new GiverResource($model); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/ShopController.php b/app/Http/Controllers/Api/V2/SC/ShopController.php deleted file mode 100644 index 55816aa22..000000000 --- a/app/Http/Controllers/Api/V2/SC/ShopController.php +++ /dev/null @@ -1,110 +0,0 @@ -withCount('items') - ->paginate($this->limit) - ->appends(request()->query()); - - return ShopLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/shops/{shop}', - tags: ['In-Game', 'Shops'], - parameters: [ - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - description: 'Available Commodity Item includes', - enum: [ - 'items', - ] - ), - allowReserved: true - ), - new OA\Parameter( - name: 'shop', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Shop name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'An Item', - content: new OA\JsonContent(ref: '#/components/schemas/shop_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['shop' => $identifier] = Validator::validate( - [ - 'shop' => $request->shop, - ], - [ - 'shop' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $shop = QueryBuilder::for(Shop::class, $request) - ->with('items') - ->where('uuid', $identifier) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $identifier)) - ->orWhere('name_raw', 'LIKE', sprintf('%%%s%%', $identifier)) - ->allowedIncludes(ShopResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Item with specified UUID or Name found.'); - } - - return new ShopResource($shop); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleController.php b/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleController.php deleted file mode 100644 index 711f1f402..000000000 --- a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleController.php +++ /dev/null @@ -1,236 +0,0 @@ -withoutEagerLoads() - ->with(['manufacturer']) - ->orderBy('name') - ->allowedFilters([ - AllowedFilter::partial('manufacturer', 'manufacturer.name'), - AllowedFilter::exact('chassis_id', 'chassis_id'), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return VehicleLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/vehicles/{name}', - tags: ['Vehicles', 'RSI-Website', 'In-Game'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'filter[hardpoints]', - description: 'Filter hardpoint types, prefix with "!" to remove these hardpoints.', - in: 'query', - schema: new OA\Schema(type: 'string') - ), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - description: 'Available Vehicle includes', - type: 'array', - items: new OA\Items( - type: 'string', - enum: [ - 'components', - 'hardpoints', - 'shops', - ] - ), - ), - explode: false, - allowReserved: true - ), - new OA\Parameter( - name: 'name', - in: 'path', - required: true, - schema: new OA\Schema( - description: '(Partial) Vehicle name', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A singular vehicle', - content: new OA\JsonContent( - oneOf: [ - new OA\Schema(ref: '#/components/schemas/sc_vehicle_v2'), - new OA\Schema(ref: '#/components/schemas/vehicle_v2'), - ], - ) - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['vehicle' => $identifier] = Validator::validate( - [ - 'vehicle' => $request->vehicle, - ], - [ - 'vehicle' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - $underscored = str_replace(' ', '_', $identifier); - - try { - $vehicleModel = QueryBuilder::for(UnpackedVehicle::class) - ->where('name', $identifier) - ->orWhere('class_name', $underscored) - ->orWhere('class_name', 'LIKE', "%_$underscored") - ->orWhere('class_name', $identifier) - ->orWhere('item_uuid', $identifier) - ->with([ - 'armor', - 'flightController', - 'quantumDrives', - 'shields', - 'thrusters', - 'partsWithoutParent', - ]) - ->first(); - - if ($vehicleModel === null) { - $vehicleModel = QueryBuilder::for(Vehicle::class, $request) - ->where('name', $identifier) - ->orWhere('slug', $identifier) - ->orWhereRelation('sc', 'item_uuid', $identifier) - ->firstOrFail(); - - return new VehicleResource($vehicleModel); - } - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Vehicle with specified name found.'.$request->vehicle); - } - - return new \App\Http\Resources\SC\Vehicle\VehicleResource($vehicleModel); - } - - #[OA\Post( - path: '/api/v2/vehicles/search', - requestBody: new OA\RequestBody( - description: 'Vehicle (partial) name or slug', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - type: 'object', - ), - example: '{"query": "Merchant"}', - ), - ] - ), - tags: ['Vehicles', 'RSI-Website', 'In-Game', 'Search'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(name: 'filter[manufacturer]', in: 'query', schema: new OA\Schema(type: 'string')), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of vehicles matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle_link_v2') - ) - ), - new OA\Response( - response: 404, - description: 'No vehicle(s) found.', - ), - ], - )] - public function search(Request $request): AnonymousResourceCollection - { - $rules = (new VehicleSearchRequest)->rules(); - - $request->validate($rules); - - $identifier = $this->cleanQueryName($request->get('query')); - $underscored = str_replace(' ', '_', $identifier); - - $queryBuilder = QueryBuilder::for(UnpackedVehicle::class) - ->where(function (Builder $query) use ($identifier, $underscored) { - $query->Where('class_name', 'LIKE', "%{$underscored}") - ->orWhere('class_name', $identifier) - ->orWhere('item_uuid', $identifier) - ->orWhere('name', 'LIKE', "%{$identifier}%"); - }) - ->allowedFilters([ - AllowedFilter::partial('manufacturer', 'manufacturer.name'), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - if ($queryBuilder->count() === 0) { - $queryBuilder = QueryBuilder::for(Vehicle::class, $request) - ->where('name', 'LIKE', "%{$identifier}%") - ->orWhere('slug', $identifier) - ->orWhereRelation('sc', 'item_uuid', $identifier) - ->paginate($this->limit) - ->appends(request()->query()); - } - - if ($queryBuilder->count() === 0) { - throw new NotFoundHttpException(sprintf(static::NOT_FOUND_STRING, $identifier)); - } - - return VehicleLinkResource::collection($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleItemController.php b/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleItemController.php deleted file mode 100644 index b5dff0293..000000000 --- a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleItemController.php +++ /dev/null @@ -1,124 +0,0 @@ -allowedFilters([ - AllowedFilter::callback('type', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Item Type') - ->whereRelation('descriptionData', 'value', $value); - }), - AllowedFilter::callback('grade', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Grade') - ->whereRelation('descriptionData', 'value', $value); - }), - AllowedFilter::callback('class', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Class') - ->whereRelation('descriptionData', 'value', $value); - }), - ]) - ->allowedIncludes(['shops', 'shops.items']) - ->paginate($this->limit) - ->appends(request()->query()); - - return VehicleItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/vehicle-items/{item}', - tags: ['Vehicles', 'In-Game', 'Items'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter( - name: 'item', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Item name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Vehicle Item', - content: new OA\JsonContent(ref: '#/components/schemas/vehicle_weapon_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['item' => $identifier] = Validator::validate( - [ - 'item' => $request->item, - ], - [ - 'item' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(VehicleItem::class, $request) - ->with([ - 'powerData', - 'distortionData', - 'heatData', - ]) - ->where('uuid', $identifier) - ->orWhere('name', $identifier) - ->orderByDesc('version') - ->allowedIncludes(ItemResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Item with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleWeaponController.php b/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleWeaponController.php deleted file mode 100644 index eed65b27f..000000000 --- a/app/Http/Controllers/Api/V2/SC/Vehicle/VehicleWeaponController.php +++ /dev/null @@ -1,113 +0,0 @@ -where('type', 'WeaponGun') - ->allowedIncludes(VehicleWeaponResource::validIncludes()) - ->allowedFilters([ - AllowedFilter::callback('type', static function (Builder $query, $value) { - $query->whereRelation('descriptionData', 'name', 'Item Type') - ->whereRelation('descriptionData', 'value', $value); - }), - ]) - ->paginate($this->limit) - ->appends(request()->query()); - - return VehicleItemLinkResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/vehicle-weapons/{weapon}', - tags: ['Vehicles', 'In-Game', 'Weapons'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(ref: '#/components/parameters/commodity_includes_v2'), - new OA\Parameter( - name: 'weapon', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Item name or UUID', - type: 'string', - ), - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A Vehicle Weapon', - content: new OA\JsonContent(ref: '#/components/schemas/vehicle_weapon_v2') - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['weapon' => $identifier] = Validator::validate( - [ - 'weapon' => $request->weapon, - ], - [ - 'weapon' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $identifier = QueryBuilder::for(Item::class, $request) - ->where('type', 'WeaponGun') - ->where(function (Builder $query) use ($identifier) { - $query->where('uuid', $identifier) - ->orWhere('name', 'LIKE', sprintf('%%%s%%', $identifier)); - }) - ->orderByDesc('version') - ->allowedIncludes(VehicleWeaponResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Weapon with specified UUID or Name found.'); - } - - return new ItemResource($identifier); - } -} diff --git a/app/Http/Controllers/Api/V2/StarCitizen/GalactapediaController.php b/app/Http/Controllers/Api/V2/StarCitizen/GalactapediaController.php deleted file mode 100644 index 074326a40..000000000 --- a/app/Http/Controllers/Api/V2/StarCitizen/GalactapediaController.php +++ /dev/null @@ -1,194 +0,0 @@ -allowedFilters([ - AllowedFilter::exact('category', 'category.name'), - AllowedFilter::exact('categoryId', 'category.cig_id'), - - AllowedFilter::exact('tag', 'tag.name'), - AllowedFilter::exact('tagId', 'tag.cig_id'), - - AllowedFilter::exact('property', 'property.name'), - AllowedFilter::exact('template', 'template.template'), - ]) - ->orderByDesc('id') - ->paginate($this->limit) - ->appends(request()->query()); - - return ArticleResource::collection($query); - } - - #[OA\Get( - path: '/api/v2/galactapedia/{id}', - tags: ['Galactapedia', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter( - name: 'id', - in: 'path', - required: true, - schema: new OA\Schema( - description: 'Galactapedia Article ID', - type: 'string', - ), - ), - new OA\Parameter( - name: 'include', - in: 'query', - schema: new OA\Schema( - description: 'Available Galactapedia includes', - type: 'array', - items: new OA\Items( - type: 'string', - enum: [ - 'translations', - 'tags', - 'categories', - 'related_articles', - 'properties', - ] - ), - ), - explode: false, - allowReserved: true - ), - ], - responses: [ - new OA\Response( - response: 200, - description: 'A singular Article', - content: new OA\JsonContent(ref: '#/components/schemas/galactapedia_article_v2') - ), - new OA\Response( - response: 404, - description: 'No Article with specified ID found.', - ), - ] - )] - public function show(Request $request): AbstractBaseResource - { - ['article' => $identifier] = Validator::validate( - [ - 'article' => $request->article, - ], - [ - 'article' => 'required|string|min:10|max:12', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - - try { - $model = QueryBuilder::for(Article::class, $request) - ->where('cig_id', $identifier) - ->with(ArticleResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Article with specified ID found.'); - } - - return new ArticleResource($model); - } - - #[OA\Post( - path: '/api/v2/galactapedia/search', - requestBody: new OA\RequestBody( - description: 'Article (partial) title, template or slug', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - type: 'object', - ), - example: '{"query": "Banu"}', - ), - ] - ), - tags: ['Galactapedia', 'RSI-Website', 'Search'], - responses: [ - new OA\Response( - response: 200, - description: 'List of articles matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/galactapedia_article_v2') - ) - ), - new OA\Response( - response: 404, - description: 'No Article found.', - ), - ], - )] - public function search(Request $request): AnonymousResourceCollection - { - $rules = (new GalactapediaSearchRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - $queryBuilder = QueryBuilder::for(Article::class, $request) - ->where('title', 'like', "%{$query}%") - ->orWhere('slug', 'like', "%{$query}%") - ->orWhere('cig_id', $query) - ->orWhereHas('templates', function (Builder $builder) use ($query) { - return $builder->where('template', 'like', "%{$query}%"); - }) - ->paginate($this->limit) - ->appends(request()->query()); - - if ($queryBuilder->count() === 0) { - throw new NotFoundHttpException('No Article(s) for specified query found.'); - } - - return ArticleResource::collection($queryBuilder); - } -} diff --git a/app/Http/Controllers/Api/V2/StarCitizen/Starmap/CelestialObjectController.php b/app/Http/Controllers/Api/V2/StarCitizen/Starmap/CelestialObjectController.php deleted file mode 100644 index 394b51db0..000000000 --- a/app/Http/Controllers/Api/V2/StarCitizen/Starmap/CelestialObjectController.php +++ /dev/null @@ -1,79 +0,0 @@ -allowedIncludes([]) - ->paginate($this->limit) - ->appends(request()->query()); - - return CelestialObjectResource::collection($query); - } - - public function show(Request $request): AbstractBaseResource - { - ['code' => $code] = Validator::validate( - [ - 'code' => $request->code, - ], - [ - 'code' => 'required|string|min:1|max:255', - ] - ); - - $code = mb_strtoupper(urldecode($code)); - - try { - /** @var CelestialObject $starsystem */ - $starsystem = QueryBuilder::for(CelestialObject::class, $request) - ->where('code', $code) - ->orWhere('cig_id', $code) - ->orWhere('name', 'LIKE', "%$code%") - ->allowedIncludes(CelestialObjectResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Celestial Object with specified Code or Name found.'); - } - - return new CelestialObjectResource($starsystem); - } - - public function search(Request $request): AnonymousResourceCollection - { - $rules = (new StarsystemRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - $objects = QueryBuilder::for(CelestialObject::class) - ->where('code', $query) - ->orWhere('cig_id', $query) - ->orWhere('name', 'LIKE', "%$query%") - ->paginate($this->limit) - ->appends(request()->query()); - - if ($objects->count() === 0) { - throw new NotFoundHttpException(sprintf(static::NOT_FOUND_STRING, $query)); - } - - return CelestialObjectResource::collection($objects); - } -} diff --git a/app/Http/Controllers/Api/V2/StarCitizen/Starmap/StarsystemController.php b/app/Http/Controllers/Api/V2/StarCitizen/Starmap/StarsystemController.php deleted file mode 100644 index b0ba8fff6..000000000 --- a/app/Http/Controllers/Api/V2/StarCitizen/Starmap/StarsystemController.php +++ /dev/null @@ -1,78 +0,0 @@ -allowedIncludes([]) - ->paginate($this->limit) - ->appends(request()->query()); - - return StarsystemResource::collection($query); - } - - public function show(Request $request): StarsystemResource - { - ['code' => $code] = Validator::validate( - [ - 'code' => $request->code, - ], - [ - 'code' => 'required|string|min:1|max:255', - ] - ); - - $code = mb_strtoupper(urldecode($code)); - - try { - /** @var Starsystem $starsystem */ - $starsystem = QueryBuilder::for(Starsystem::class, $request) - ->where('code', $code) - ->orWhere('cig_id', $code) - ->orWhere('name', 'LIKE', "%$code%") - ->allowedIncludes(StarsystemResource::validIncludes()) - ->firstOrFail(); - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Starsystem with specified Code or Name found.'); - } - - return new StarsystemResource($starsystem); - } - - public function search(Request $request): AnonymousResourceCollection - { - $rules = (new StarsystemRequest)->rules(); - $request->validate($rules); - - $query = $this->cleanQueryName($request->get('query')); - - $starsystems = QueryBuilder::for(Starsystem::class) - ->where('code', $query) - ->orWhere('cig_id', $query) - ->orWhere('name', 'LIKE', "%$query%") - ->paginate($this->limit) - ->appends(request()->query()); - - if ($starsystems->count() === 0) { - throw new NotFoundHttpException(sprintf(static::NOT_FOUND_STRING, $query)); - } - - return StarsystemResource::collection($starsystems); - } -} diff --git a/app/Http/Controllers/Api/V2/StarCitizen/StatController.php b/app/Http/Controllers/Api/V2/StarCitizen/StatController.php deleted file mode 100644 index 0cf505419..000000000 --- a/app/Http/Controllers/Api/V2/StarCitizen/StatController.php +++ /dev/null @@ -1,62 +0,0 @@ -orderByDesc('created_at')->first(); - - return new StatResource($stat); - } - - #[OA\Get( - path: '/api/v2/stats', - tags: ['Stats', 'RSI-Website'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of stats', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/stat_v2') - ) - ), - ] - )] - public function index(Request $request): AnonymousResourceCollection - { - $query = QueryBuilder::for(Stat::class, $request) - ->orderByDesc('created_at') - ->paginate($this->limit) - ->appends(request()->query()); - - return StatResource::collection($query); - } -} diff --git a/app/Http/Controllers/Api/V3/SC/Vehicle/VehicleController.php b/app/Http/Controllers/Api/V3/SC/Vehicle/VehicleController.php deleted file mode 100644 index 5b002a26d..000000000 --- a/app/Http/Controllers/Api/V3/SC/Vehicle/VehicleController.php +++ /dev/null @@ -1,188 +0,0 @@ - $identifier] = Validator::validate( - [ - 'vehicle' => $request->vehicle, - ], - [ - 'vehicle' => 'required|string|min:1|max:255', - ] - ); - - $identifier = $this->cleanQueryName($identifier); - $underscored = str_replace(' ', '_', $identifier); - - try { - $vehicleModel = QueryBuilder::for(UnpackedVehicle::class) - ->where('name', $identifier) - ->orWhere('class_name', $underscored) - ->orWhere('class_name', 'LIKE', "%_$underscored") - ->orWhere('class_name', $identifier) - ->orWhere('item_uuid', $identifier) - ->with([ - 'armor', - 'flightController', - 'quantumDrives', - 'shields', - 'thrusters', - 'partsWithoutParent', - ]) - ->first(); - - if ($vehicleModel === null) { - $vehicleModel = QueryBuilder::for(Vehicle::class, $request) - ->where('name', $identifier) - ->orWhere('slug', $identifier) - ->orWhereRelation('sc', 'item_uuid', $identifier) - ->firstOrFail(); - - return new VehicleResource($vehicleModel); - } - } catch (ModelNotFoundException $e) { - throw new NotFoundHttpException('No Vehicle with specified name found.'.$request->vehicle); - } - - return new VehicleResourceV3($vehicleModel); - } - - #[OA\Post( - path: '/api/v3/vehicles/search', - requestBody: new OA\RequestBody( - description: 'Vehicle (partial) name or slug', - required: true, - content: [ - new OA\MediaType( - mediaType: 'application/json', - schema: new OA\Schema( - type: 'object', - ), - example: '{"query": "Merchant"}', - ), - ] - ), - tags: ['Vehicles', 'RSI-Website', 'In-Game', 'Search'], - parameters: [ - new OA\Parameter(ref: '#/components/parameters/page'), - new OA\Parameter(ref: '#/components/parameters/limit'), - new OA\Parameter(ref: '#/components/parameters/locale'), - new OA\Parameter(name: 'filter[manufacturer]', in: 'query', schema: new OA\Schema(type: 'string')), - ], - responses: [ - new OA\Response( - response: 200, - description: 'List of vehicles matching the query', - content: new OA\JsonContent( - type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle_link_v2') - ) - ), - new OA\Response( - response: 404, - description: 'No vehicle(s) found.', - ), - ], - )] - public function search(Request $request): AnonymousResourceCollection - { - return parent::search($request); - } -} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index fe6c02fe2..8677cd5ca 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -1,28 +1,8 @@ middleware('auth'); - } - - /** - * @return Factory|View - * - * @throws AuthorizationException - */ - public function index() - { - $this->authorize('web.account.view'); - - return view( - 'web.account.index', - [ - 'user' => Auth::user(), - ] - ); - } - - /** - * @return RedirectResponse - * - * @throws AuthorizationException - */ - public function update(Request $request) - { - $this->authorize('web.account.update'); - - Validator::validate($request->all(), [ - 'language' => 'required|in:en,de', - ]); - - Auth::user()->settings()->updateOrCreate( - [ - 'user_id' => Auth::id(), - ], - [ - 'receive_comm_link_notifications' => $request->has('receive_comm_link_notifications'), - 'receive_api_notifications' => $request->has('api_notifications'), - 'language' => $request->get('language'), - ] - ); - - return redirect()->route('web.account.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Einstellungen')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Auth/LoginController.php b/app/Http/Controllers/Web/Auth/LoginController.php deleted file mode 100644 index 3429ede5e..000000000 --- a/app/Http/Controllers/Web/Auth/LoginController.php +++ /dev/null @@ -1,131 +0,0 @@ -middleware('guest', ['except' => 'logout']); - $this->authRepository = $authRepository; - } - - /** - * Get the path that we should redirect once logged out. - * Adaptable to user needs. - * - * @return string - */ - public function logoutToPath() - { - return '/'; - } - - /** - * Get the login username to be used by the controller. - * - * @return string - */ - public function username() - { - return 'username'; - } - - /** - * @return Factory|View - */ - public function showLoginForm() - { - return view('web.auth.login'); - } - - /** - * Redirect the user to the GitHub authentication page. - * - * @return Response - */ - public function redirectToProvider() - { - return $this->authRepository->startAuth(); - } - - /** - * Obtain the user information from the Provider. - */ - public function handleProviderCallback(Request $request): RedirectResponse - { - $user = $this->authRepository->getUserFromProvider($request); - - $authUser = $this->authRepository->getOrCreateLocalUser($user, 'mediawiki'); - - Auth::login($authUser); - - return $this->authenticated(); - } - - /** - * Redirect to Intended Route or Account. - */ - protected function authenticated(): RedirectResponse - { - return redirect()->intended($this->getRedirectTo()); - } - - public function getRedirectTo(): string - { - if (Auth::user()->isAdmin()) { - return '/dashboard'; - } - - return $this->redirectTo; - } - - /** - * Redirect to Login Form. - */ - protected function loggedOut(Request $request): RedirectResponse - { - return redirect()->route('web.auth.login'); - } -} diff --git a/app/Http/Controllers/Web/Changelog/ChangelogController.php b/app/Http/Controllers/Web/Changelog/ChangelogController.php deleted file mode 100644 index dde9fe21c..000000000 --- a/app/Http/Controllers/Web/Changelog/ChangelogController.php +++ /dev/null @@ -1,66 +0,0 @@ -middleware('auth'); - } - - /** - * @return Factory|View - * - * @throws AuthorizationException - */ - public function index(Request $request) - { - $this->authorize('web.changelogs.view'); - - $query = ModelChangelog::query() - //->where('changelog_type', '!=', ShopItem::class) - ->with('changelog') - ->orderByDesc('id'); - - if ($request->get('model') !== null) { - $query->where( - 'changelog_type', - $request->get('model'), - ); - } - - if ($request->get('type') !== null) { - $query->where( - 'type', - $request->get('type'), - ); - } - - return view( - 'web.changelog.index', - [ - 'changelogs' => $query->paginate($request->get('limit', 25)), - 'models' => ModelChangelog::query()->select('changelog_type')->distinct()->get(), - 'types' => ModelChangelog::query()->select('type')->distinct()->get(), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/DashboardController.php b/app/Http/Controllers/Web/DashboardController.php deleted file mode 100644 index 8d0715cd6..000000000 --- a/app/Http/Controllers/Web/DashboardController.php +++ /dev/null @@ -1,153 +0,0 @@ -middleware('auth')->except('index'); - } - - /** - * Returns the Dashboard View. - */ - public function index(): View - { - $data = []; - if (Auth::user() !== null && Auth::user()->can('web.dashboard.view')) { - $data = [ - 'users' => $this->getUserStats(), - 'deepl' => $this->getDeeplStats(), - 'jobs' => $this->getQueueStats(), - ]; - } - - return view( - 'web.dashboard', - $data - ); - } - - /** - * User Stats - * New Registrations and Logins. - */ - private function getUserStats(): array - { - $today = Carbon::today()->toDateString(); - - return [ - 'overall' => User::query()->count(), - 'last' => User::query()->take(5)->orderBy('created_at', 'desc')->get(), - 'registrations' => [ - 'counts' => [ - 'last_hour' => User::query()->whereDate('created_at', '>', Carbon::now()->subHour())->count(), - 'today' => User::query()->whereDate('created_at', '=', $today)->get()->count(), - ], - ], - 'logins' => [ - 'counts' => [ - 'last_hour' => User::query()->whereDate('last_login', '>', Carbon::now()->subHour())->count(), - 'today' => User::query()->whereDate('last_login', '=', $today)->get()->count(), - ], - ], - ]; - } - - /** - * Deepl Usage Stats. - */ - private function getDeeplStats(): array - { - if (Cache::has(self::DEEPL_STATS_CACHE_KEY)) { - return Cache::get(self::DEEPL_STATS_CACHE_KEY); - } - - try { - if (empty(config('services.deepl.auth_key'))) { - throw new Exception; - } - $deeplUsage = DeepLyFacade::getUsage()->getResponse(); - } catch (Exception $e) { - $deeplUsage = [ - self::DEEPL_CHARACTER_COUNT => -1, - self::DEEPL_CHARACTER_LIMIT => -1, - ]; - } - - $width = ($deeplUsage[self::DEEPL_CHARACTER_COUNT] / $deeplUsage[self::DEEPL_CHARACTER_LIMIT]) * 100; - - $style = 'bg-success'; - if ($width >= 85) { - $style = 'bg-danger'; - } elseif ($width >= 75) { - $style = 'bg-warning'; - } elseif ($width >= 50) { - $style = 'bg-info'; - } - - $stats = [ - 'usage' => [ - 'limit' => $deeplUsage[self::DEEPL_CHARACTER_LIMIT] === -1 ? __( - 'Fehler bei der Datenabfrage' - ) : number_format( - $deeplUsage[self::DEEPL_CHARACTER_LIMIT], - 0, - ',', - '.' - ), - 'count' => number_format($deeplUsage[self::DEEPL_CHARACTER_COUNT], 0, ',', '.'), - ], - 'bar' => [ - 'width' => $width, - 'style' => $style, - ], - ]; - - Cache::put(self::DEEPL_STATS_CACHE_KEY, $stats, 60); - - return $stats; - } - - /** - * Simple Queue Stat Counts. - */ - private function getQueueStats(): array - { - $jobs = DB::table('jobs')->count(); - $jobsActive = DB::table('jobs')->whereNotNull('reserved_at')->count(); - $jobsFailed = DB::table('failed_jobs')->count(); - - return [ - 'all' => number_format($jobs, 0, ',', '.'), - 'active' => number_format($jobsActive, 0, ',', '.'), - 'failed' => number_format($jobsFailed, 0, ',', '.'), - ]; - } -} diff --git a/app/Http/Controllers/Web/Job/JobController.php b/app/Http/Controllers/Web/Job/JobController.php deleted file mode 100644 index 4668b0810..000000000 --- a/app/Http/Controllers/Web/Job/JobController.php +++ /dev/null @@ -1,72 +0,0 @@ -middleware('auth'); - } - - /** - * View failed jobs - * - * - * @throws AuthorizationException - */ - public function viewFailed(): View - { - $this->authorize('web.jobs.view_failed'); - - return view('web.jobs.failed_index') - ->with( - [ - 'failed' => DB::table('failed_jobs') - ->select([ - 'id', - 'connection', - 'queue', - 'payload', - 'exception', - 'failed_at', - ]) - ->orderByDesc('id') - ->get(), - ] - ); - } - - /** - * Truncate the failed job table - * - * - * @throws AuthorizationException - */ - public function truncate(): RedirectResponse - { - $this->authorize('web.jobs.truncate'); - - DB::table('failed_jobs')->truncate(); - - return redirect()->route('web.dashboard')->withMessages( - [ - 'success' => [ - __('Jobs gelöscht'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Job/Rsi/CommLink/JobController.php b/app/Http/Controllers/Web/Job/Rsi/CommLink/JobController.php deleted file mode 100644 index efd1b322b..000000000 --- a/app/Http/Controllers/Web/Job/Rsi/CommLink/JobController.php +++ /dev/null @@ -1,112 +0,0 @@ -middleware('auth'); - } - - /** - * @throws AuthorizationException - */ - public function startCommLinkTranslationJob(): RedirectResponse - { - $this->authorize('web.jobs.start_translation'); - - Artisan::call('comm-links:translate', ['modifiedTime' => -1]); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Übersetzung gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startCommLinkImageDownloadJob(): RedirectResponse - { - $this->authorize('web.jobs.start_image_download'); - - Artisan::call('comm-links:download-images'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Download gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startCommLinkDownloadJob(Request $request): RedirectResponse - { - $this->authorize('web.jobs.start_download'); - - $data = $request->validate( - [ - 'ids' => 'required|string|min:5', - ] - ); - - $ids = collect(explode(',', $data['ids']))->map( - static function ($id) { - return trim($id); - } - )->filter( - static function ($id) { - return is_numeric($id); - } - )->map( - static function ($id) { - return (int) $id; - } - )->filter( - static function (int $id) { - return $id >= 12663; - } - ); - - Artisan::call( - 'comm-links:download', - [ - 'id' => $ids->toArray(), - '--import' => true, - ] - ); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Comm-Link Download gestartet'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Job/SC/JobController.php b/app/Http/Controllers/Web/Job/SC/JobController.php deleted file mode 100644 index eee47fb5d..000000000 --- a/app/Http/Controllers/Web/Job/SC/JobController.php +++ /dev/null @@ -1,114 +0,0 @@ -middleware('auth'); - } - - /** - * @throws AuthorizationException - */ - public function startItemImportJob(): RedirectResponse - { - $this->authorize('web.jobs.sc-import'); - - Artisan::call('sc:import-items'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Import gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startVehicleImportJob(): RedirectResponse - { - $this->authorize('web.jobs.sc-import'); - - Artisan::call('sc:import-vehicles'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Import gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startShopImportJob(): RedirectResponse - { - $this->authorize('web.jobs.sc-import'); - - Artisan::call('sc:import-shops'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Import gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startImageUploadJob(): RedirectResponse - { - $this->authorize('web.jobs.sc-import'); - - Artisan::call('sc:upload-images'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Bild Upload gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startTranslateJob(): RedirectResponse - { - $this->authorize('web.jobs.sc-import'); - - Artisan::call('sc:translate'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Übersetzung gestartet'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Job/StarCitizen/Galactapedia/JobController.php b/app/Http/Controllers/Web/Job/StarCitizen/Galactapedia/JobController.php deleted file mode 100644 index 4e5f934df..000000000 --- a/app/Http/Controllers/Web/Job/StarCitizen/Galactapedia/JobController.php +++ /dev/null @@ -1,97 +0,0 @@ -middleware('auth'); - } - - /** - * @throws AuthorizationException - */ - public function startImportGalactapediaCategoriesJob(): RedirectResponse - { - $this->authorize('web.jobs.import_galactapedia_job'); - - Artisan::call('galactapedia:import-categories'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Galactapedia Kategorieimport gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startImportGalactapediaArticlesJob(): RedirectResponse - { - $this->authorize('web.jobs.import_galactapedia_job'); - - Artisan::call('galactapedia:import-articles'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Galactapedia Artikelimport gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startImportGalactapediaArticlePropertiesJob(): RedirectResponse - { - $this->authorize('web.jobs.import_galactapedia_job'); - - Artisan::call('galactapedia:import-properties'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Galactapedia Import der Artikeleigenschaften gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startCreateWikiPagesJob(): RedirectResponse - { - $this->authorize('web.jobs.import_galactapedia_job'); - - Artisan::call('galactapedia:create-wiki-pages'); - Artisan::call('galactapedia:upload-wiki-images'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Galactapedia Wiki Seiten werden erstellt'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Job/StarCitizen/Vehicle/JobController.php b/app/Http/Controllers/Web/Job/StarCitizen/Vehicle/JobController.php deleted file mode 100644 index 7a1c89f28..000000000 --- a/app/Http/Controllers/Web/Job/StarCitizen/Vehicle/JobController.php +++ /dev/null @@ -1,78 +0,0 @@ -middleware('auth'); - } - - /** - * @throws AuthorizationException - */ - public function startDownloadShipMatrixJob(): RedirectResponse - { - $this->authorize('web.jobs.start_ship_matrix_download'); - - Artisan::call('ship-matrix:download --import'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Download gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startMsrpImportJob(): RedirectResponse - { - $this->authorize('web.jobs.start_msrp_import'); - - Artisan::call('vehicles:import-msrp'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Import gestartet'), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - public function startLoanerImportJob(): RedirectResponse - { - $this->authorize('web.jobs.start_msrp_import'); - - Artisan::call('vehicles:import-loaner'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Import gestartet'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Job/Wiki/CommLink/JobController.php b/app/Http/Controllers/Web/Job/Wiki/CommLink/JobController.php deleted file mode 100644 index c19987d15..000000000 --- a/app/Http/Controllers/Web/Job/Wiki/CommLink/JobController.php +++ /dev/null @@ -1,67 +0,0 @@ -middleware('auth'); - } - - /** - * @throws AuthorizationException - */ - public function startCommLinkWikiPageCreationJob(): RedirectResponse - { - $this->authorize('web.jobs.start_wiki_page_creation'); - - Artisan::call('comm-links:create-wiki-pages'); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Seitenerstellung gestartet'), - ], - ] - ); - } - - /** - * Update Comm-Link Proofread Status - * - * - * @throws AuthorizationException - */ - public function startCommLinkProofReadStatusUpdateJob(): RedirectResponse - { - $this->authorize('web.jobs.start_proofread_update'); - - $this->dispatch(new UpdateCommLinkProofReadStatus); - - return redirect()->route(self::DASHBOARD_ROUTE)->withMessages( - [ - 'success' => [ - __('Update gestartet'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/Category/CategoryController.php b/app/Http/Controllers/Web/Rsi/CommLink/Category/CategoryController.php deleted file mode 100644 index 6809174c0..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/Category/CategoryController.php +++ /dev/null @@ -1,64 +0,0 @@ -middleware('auth'); - } - - /** - * All Categories - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.categories.index', - [ - 'categories' => Category::query()->orderBy('name')->get(), - ] - ); - } - - /** - * Get All Comm-Links in a given Category - * - * - * - * @throws AuthorizationException - */ - public function show(Category $category): View - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $category->commLinks() - ->orderByDesc('cig_id') - ->paginate(20), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/Channel/ChannelController.php b/app/Http/Controllers/Web/Rsi/CommLink/Channel/ChannelController.php deleted file mode 100644 index c4dc37d0e..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/Channel/ChannelController.php +++ /dev/null @@ -1,64 +0,0 @@ -middleware('auth'); - } - - /** - * All Channels - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.channels.index', - [ - 'channels' => Channel::query()->orderBy('name')->get(), - ] - ); - } - - /** - * Get all Comm-Links of a given Channel - * - * - * - * @throws AuthorizationException - */ - public function show(Channel $channel): View - { - $this->authorize('web.rsi.comm-links.view'); - - $links = $channel->commLinks()->orderByDesc('cig_id')->paginate(20); - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $links, - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/CommLinkController.php b/app/Http/Controllers/Web/Rsi/CommLink/CommLinkController.php deleted file mode 100644 index a4bcb8920..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/CommLinkController.php +++ /dev/null @@ -1,229 +0,0 @@ -middleware('auth')->except(['index', 'show']); - } - - /** - * Display a listing of the resource. - */ - public function index(): View - { - $links = CommLink::query()->orderByDesc('cig_id')->paginate(250); - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $links, - ] - ); - } - - /** - * Display the specified resource. - */ - public function show(int $commLinkId): View - { - $commLink = CommLink::query() - ->with( - [ - 'images', - 'links', - 'translations', - 'translationChangelogs', - 'images.commLinks', - ] - ) - ->where('cig_id', $commLinkId) - ->firstOrFail(); - - /** @var Collection $changelogs */ - $changelogs = $commLink->changelogs; - - $changelogs = $changelogs->merge($commLink->translationChangelogs); - - return view( - 'web.rsi.comm_links.show', - [ - 'commLink' => $commLink, - 'changelogs' => $this->diffTranslations($changelogs, $commLink), - 'prev' => $commLink->getPrevAttribute(), - 'next' => $commLink->getNextAttribute(), - ] - ); - } - - /** - * Show the form for editing the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(CommLink $commLink): View - { - $this->middleware('auth'); - $this->authorize(self::COMM_LINK_PERMISSION); - - $versions = $this->getCommLinkVersions($commLink->cig_id); - $versionData = $this->processCommLinkVersions($versions, $commLink->file); - - return view( - 'web.rsi.comm_links.edit', - [ - 'commLink' => $commLink, - 'versions' => $versionData, - 'channels' => Channel::query()->orderBy('name')->get(), - 'categories' => Category::query()->orderBy('name')->get(), - 'series' => Series::query()->orderBy('name')->get(), - ] - ); - } - - /** - * Returns all Comm-Link Version Files in a Comm-Link Folder. - */ - private function getCommLinkVersions(int $commLinkCigId): array - { - $versions = Storage::disk('comm_links')->files($commLinkCigId); - $versions = array_map( - static function ($value) { - $file = preg_split('#(?<=)[/\\\]#', $value)[1]; - - return str_replace('.html', '', $file); - }, - $versions - ); - rsort($versions); - - return $versions; - } - - /** - * Parses Comm-Link Version Names to a Human readable String, creates Data array to use in views. - */ - private function processCommLinkVersions(array $versions, string $currentVersion): array - { - $versionData = []; - collect($versions)->each( - static function ($version) use (&$versionData, $currentVersion) { - $output = Carbon::createFromFormat('Y-m-d_His', $version)->format('d.m.Y H:i'); - - if ("{$version}.html" === $currentVersion) { - $output = sprintf('%s: %s', __('Aktuell'), $output); - } - - $versionData[] = [ - 'output' => $output, - 'file_clean' => $version, - 'file' => "{$version}.html", - ]; - } - ); - - return $versionData; - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(CommLinkRequest $request, CommLink $commLink): RedirectResponse - { - $this->middleware('auth'); - $this->authorize(self::COMM_LINK_PERMISSION); - - $data = $request->validated(); - - $commLink->update( - [ - 'title' => $data['title'], - 'url' => $data['url'], - 'created_at' => $data['created_at'], - 'channel_id' => $data['channel'], - 'category_id' => $data['category'], - 'series_id' => $data['series'], - ] - ); - - $message = __('crud.updated', ['type' => __('Comm-Link')]); - - return redirect()->route('web.rsi.comm-links.show', $commLink->getRouteKey())->withMessages( - [ - 'success' => [ - $message, - ], - ] - ); - } - - /** - * Preview a Comm-Link Version. - * - * - * - * @throws AuthorizationException - * @throws FileNotFoundException - */ - public function preview(CommLink $commLink, string $version): View - { - $this->authorize('web.rsi.comm-links.preview'); - - $content = Storage::disk('comm_links')->get("{$commLink->cig_id}/{$version}.html"); - if ($content === null) { - throw new FileNotFoundException; - } - - $crawler = new Crawler; - $crawler->addHtmlContent($content); - - $contentParser = new Content($crawler); - - return view( - 'web.rsi.comm_links.preview', - [ - 'commLink' => $commLink, - 'version' => $version, - 'preview' => $contentParser->getContent(), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/CommLinkSearchController.php b/app/Http/Controllers/Web/Rsi/CommLink/CommLinkSearchController.php deleted file mode 100644 index 5ad485e02..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/CommLinkSearchController.php +++ /dev/null @@ -1,151 +0,0 @@ -with('apiToken', optional(Auth::user())->api_token); - } - - /** - * @return View|RedirectResponse - */ - public function searchByTitle(CommLinkSearchRequest $request) - { - $data = $request->validated(); - - $query = $data['keyword']; - $links = CommLink::query()->where('title', 'LIKE', "%{$query}%")->get(); - - if ($links->isEmpty()) { - return redirect()->route('web.rsi.comm-links.search')->withMessages( - [ - 'warning' => [ - 'Keine Comm-Links gefunden.', - ], - ] - ); - } - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $links, - ] - ); - } - - /** - * Reverse searches a comm-link by an image url - * - * - * @return Application|Factory|View - */ - public function reverseImageLinkSearchPost(ReverseImageLinkSearchRequest $request) - { - $controller = new \App\Http\Controllers\Api\V2\Rsi\CommLink\CommLinkSearchController($request); - - return $this->handleSearchResult( - $controller->reverseImageLinkSearch($request), - 'web.rsi.comm_links.index', - 'commLinks' - ); - } - - /** - * Reverse searches a comm-link by an actual image file - * - * - * @return Application|Factory|View - */ - public function reverseImageSearchPost(ReverseImageSearchRequest $request) - { - $controller = new \App\Http\Controllers\Api\V2\Rsi\CommLink\CommLinkSearchController($request); - - return $this->handleSearchResult( - $controller->reverseImageSearch($request), - 'web.rsi.comm_links.images.index' - ); - } - - /** - * Search for comm-links based on the relevance of the input - * - * - * @return Application|Factory|View - */ - public function textSearchPost(CommLinkSearchRequest $request) - { - $this->middleware('auth'); - $data = $request->validated(); - - $data = $data['query']; - - $links = CommLink::query() - ->whereRelation('translations', function ($query) use ($data) { - $query->whereFullText('translation', $data); - }) - ->limit(50) - ->get(); - - if ($links->isEmpty()) { - return $this->handleSearchResult($links, 'web.rsi.comm_links.index'); - } - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $links, - 'relevanceSorted' => true, - ] - ); - } - - /** - * Things to do after a search request was done - * - * @return Application|Factory|View - */ - private function handleSearchResult($results, string $view, string $key = 'images') - { - if ($results->isEmpty()) { - return redirect()->route('web.rsi.comm-links.search')->withMessages( - [ - 'warning' => [ - 'Keine Comm-Links gefunden.', - ], - ] - ); - } - - return view( - $view, - [ - $key => $results, - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/Image/ImageController.php b/app/Http/Controllers/Web/Rsi/CommLink/Image/ImageController.php deleted file mode 100644 index f3f729aea..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/Image/ImageController.php +++ /dev/null @@ -1,205 +0,0 @@ -middleware('auth')->only('upload'); - } - - /** - * All downloaded Images, excluding those that could not be found - * - * - * @return Factory|View - */ - public function index(Request $request) - { - $query = Image::query() - ->where('dir', 'NOT LIKE', 'NOT_FOUND') - ->whereNull('base_image_id'); - - $mimes = array_filter($request->get('mime', [])); - $tags = array_filter($request->get('tag', [])); - - if (! empty($mimes)) { - $query->whereHas( - 'metadata', - function (Builder $query) use ($mimes) { - return $query->whereIn('mime', $mimes); - } - ); - } else { - $query->whereHas('metadata'); - } - - if (! empty($tags)) { - $query->whereRelation( - 'tags', - function (Builder $query) use ($tags) { - return $query->whereIn('name', $tags)->orWhereIn('name_en', $tags); - } - ); - } - - if (! Auth::check()) { - $query->whereHas('commLinks'); - } - - return view( - 'web.rsi.comm_links.images.index', - [ - 'images' => $query - ->orderByDesc('id') - ->groupBy('src') - ->paginate(50), - 'mimes' => ImageMetadata::query()->groupBy('mime')->get('mime'), - 'selectedMimes' => $mimes, - 'tags' => Tag::query()->get(), - 'selectedTags' => $tags, - ] - ); - } - - /** - * @return Factory|View - */ - public function indexByTag(Request $request) - { - $tag = Tag::query()->where('name', $request->tag)->orWhere('name_en', $request->tag)->first(); - - return view( - 'web.rsi.comm_links.images.index', - [ - 'images' => optional($tag)->images ?? [], - ] - ); - } - - /** - * @return Factory|View - */ - public function show(Image $image) - { - if (! Auth::check() && $image->commLinks()->count() === 0) { - throw new ModelNotFoundException; - } - - return view( - 'web.rsi.comm_links.images.show', - [ - 'image' => $image, - ] - ); - } - - /** - * @throws GuzzleException - * @throws AuthorizationException|JsonException - */ - public function upload(ImageUploadRequest $request): string - { - $this->authorize('web.rsi.comm-links.view'); - - $params = $request->validated(); - - return (new UploadWikiImage)->uploadCommLinkImage($params); - } - - /** - * Retrieve similar images based on a hash - */ - public function similarImages(Request $request): View - { - $controller = new CommLinkSearchController($request); - - return view( - 'web.rsi.comm_links.images.index', - [ - 'images' => $controller->similarSearch($request), - ] - ); - } - - /** - * View for editing the tags of an image - */ - public function editTags(Image $image): View - { - return view( - 'web.rsi.comm_links.images.edit-tags', - [ - 'tags' => Tag::query()->orderBy('name')->get(), - 'image' => $image, - 'image_tags' => $image->tags->map(fn (Tag $tag) => $tag->name), - ] - ); - } - - /** - * Save tags to an image - */ - public function saveTags(Image $image, AddImageTagsRequest $request): RedirectResponse - { - $data = $request->validated(); - - $ids = collect($data['tags'])->map(function (string $datum) { - if (str_starts_with($datum, 'id:')) { - return (int) str_replace('id:', '', $datum); - } - - return Tag::query()->firstOrCreate(['name' => $datum])->id; - }); - - $image->tags()->sync($ids); - - return redirect()->back(); - } - - /** - * Search for images by filename - */ - public function search(ImageSearchRequest $request): View - { - $request->query->set('limit', 250); - $controller = new \App\Http\Controllers\Api\V2\Rsi\CommLink\ImageController($request); - - return view( - 'web.rsi.comm_links.images.index', - [ - 'images' => $controller->search($request), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/Image/TagController.php b/app/Http/Controllers/Web/Rsi/CommLink/Image/TagController.php deleted file mode 100644 index 04bb0ad46..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/Image/TagController.php +++ /dev/null @@ -1,108 +0,0 @@ -middleware('auth'); - } - - /** - * @return Factory|View - * - * @throws AuthorizationException - */ - public function index(Request $request) - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.tags.index', - [ - 'tags' => Tag::query()->orderByDesc('images_count')->paginate(250), - ] - ); - } - - /** - * @return Factory|View - * - * @throws AuthorizationException - */ - public function edit(Tag $tag) - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.tags.edit', - [ - 'tag' => $tag, - ] - ); - } - - /** - * @return RedirectResponse - * - * @throws AuthorizationException - */ - public function update(Tag $tag, TagUpdateRequest $request) - { - $this->authorize('web.rsi.comm-links.view'); - $data = $request->validated(); - - $tag->update([ - //'name' => $data['name'], - 'name_en' => $data['name_en'], - ]); - - return redirect()->route('web.rsi.comm-links.image-tags.index')->withMessages( - [ - 'success' => [ - __('Tag aktualisiert'), - ], - ] - ); - } - - /** - * Creates a new image tag - * - * @return mixed - */ - public function post(NewImageTagRequest $request) - { - Tag::query()->create([ - 'name' => $request->name, - ]); - - return redirect()->route('web.rsi.comm-links.image-tags.index')->withMessages( - [ - 'success' => [ - __('Tag erstellt'), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/CommLink/Series/SeriesController.php b/app/Http/Controllers/Web/Rsi/CommLink/Series/SeriesController.php deleted file mode 100644 index 17ba3cb68..000000000 --- a/app/Http/Controllers/Web/Rsi/CommLink/Series/SeriesController.php +++ /dev/null @@ -1,64 +0,0 @@ -middleware('auth'); - } - - /** - * All Series - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.series.index', - [ - 'series' => Series::query()->orderBy('name')->get(), - ] - ); - } - - /** - * Get all Comm-Links in a given Series - * - * - * - * @throws AuthorizationException - */ - public function show(Series $series): View - { - $this->authorize('web.rsi.comm-links.view'); - - return view( - 'web.rsi.comm_links.index', - [ - 'commLinks' => $series->commLinks() - ->orderByDesc('cig_id') - ->paginate(20), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/Rsi/Stat/StatController.php b/app/Http/Controllers/Web/Rsi/Stat/StatController.php deleted file mode 100644 index 28600acc4..000000000 --- a/app/Http/Controllers/Web/Rsi/Stat/StatController.php +++ /dev/null @@ -1,62 +0,0 @@ -get('skip', 100); - - if (! is_numeric($every) || $every < 0) { - $every = 100; - } - - if ($request->has('from') && ! $request->has('skip')) { - $every = 0; - } - - $every = (int) $every; - - if ($every === 0 || config('database.default') === 'sqlite') { - $data = Stat::query(); - } else { - $data = Stat::query()->whereRaw('id mod '.$every.' = 0'); - } - - $from = null; - - if ($request->has('from')) { - $from = $request->get('from'); - try { - $from = Carbon::parse($from); - $every = -1; - $data->where('created_at', '>=', $from->format('Y-m-d')); - } catch (InvalidFormatException $e) { - // - } - } - - $data = $data->get(); - - return view( - 'web.rsi.stats.index', - [ - 'labels' => $data->pluck('created_at')->toJson(), - 'funds' => $data->pluck('funds')->toJson(), - 'fans' => $data->pluck('fans')->toJson(), - 'active' => $every, - 'from' => optional($from)->format('Y-m-d'), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Galactapedia/GalactapediaController.php b/app/Http/Controllers/Web/StarCitizen/Galactapedia/GalactapediaController.php deleted file mode 100644 index bbd472f30..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Galactapedia/GalactapediaController.php +++ /dev/null @@ -1,55 +0,0 @@ - Article::query()->orderByDesc('id')->paginate(250), - ] - ); //->with('apiToken', optional(Auth::user())->api_token); - } - - /** - * Shows a singular article - */ - public function show(string $article): View - { - $article = Article::query()->where('cig_id', $article)->firstOrFail(); - - /** @var Collection $changelogs */ - $changelogs = $article->changelogs; - - $changelogs = $changelogs->merge($article->translationChangelogs); - - return view( - 'web.starcitizen.galactapedia.show', - [ - 'article' => $article, - 'wikitext' => (new CreateGalactapediaWikiPage($article, '')) - ->getFormattedText( - Article::normalizeContent($article->german()->translation ?? $article->english()->translation), - null - ), - 'changelogs' => $this->diffTranslations($changelogs, $article), - 'prev' => $article->getPrevAttribute(), - 'next' => $article->getNextAttribute(), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Manufacturer/ManufacturerController.php b/app/Http/Controllers/Web/StarCitizen/Manufacturer/ManufacturerController.php deleted file mode 100644 index fb213b5e3..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Manufacturer/ManufacturerController.php +++ /dev/null @@ -1,112 +0,0 @@ -middleware('auth')->except('index'); - } - - public function index(): View - { - return view( - 'web.starcitizen.manufacturers.index', - [ - 'manufacturers' => Manufacturer::all(), - 'manufacturers_ingame' => \App\Models\SC\Manufacturer::query()->groupBy('name')->orderBy('name')->get(), - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(string $manufacturer): View - { - $this->authorize(self::MANUFACTURER_PERMISSION); - - $manufacturer = Manufacturer::query() - ->where('name', $manufacturer) - ->orWhere('name_short', $manufacturer) - ->firstOrFail(); - - return view( - 'web.starcitizen.manufacturers.edit', - [ - 'manufacturer' => $manufacturer, - 'updateRoute' => self::MANUFACTURER_PERMISSION, - 'changelogs' => $manufacturer->changelogs - ->merge($manufacturer->translationChangelogs) - ->sortByDesc('created_at'), - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(ManufacturerTranslationRequest $request, string $manufacturer): RedirectResponse - { - $this->authorize(self::MANUFACTURER_PERMISSION); - - $data = $request->validated(); - $manufacturer = Manufacturer::query() - ->where('name', $manufacturer) - ->orWhere('name_short', $manufacturer) - ->firstOrFail(); - - $localeCodes = Language::all('locale_code')->keyBy('locale_code'); - - foreach ($localeCodes as $localeCode => $model) { - $manufacturer->translations()->updateOrCreate( - [ - 'locale_code' => $localeCode, - ], - [ - 'description' => $data["description_{$localeCode}"], - 'known_for' => $data["known_for_{$localeCode}"], - ] - ); - } - - return redirect()->route( - 'web.starcitizen.manufacturers.edit', - $manufacturer->getRouteKey() - )->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Hersteller')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/ProductionNote/ProductionNoteController.php b/app/Http/Controllers/Web/StarCitizen/ProductionNote/ProductionNoteController.php deleted file mode 100644 index 1a0cdd037..000000000 --- a/app/Http/Controllers/Web/StarCitizen/ProductionNote/ProductionNoteController.php +++ /dev/null @@ -1,97 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.translations.view'); - - return view( - 'web.starcitizen.production_notes.index', - [ - 'translations' => ProductionNote::all(), - 'languages' => Language::all(), - 'editRoute' => 'web.starcitizen.production-notes.edit', - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(ProductionNote $note): View - { - $this->authorize('web.translations.update'); - - return view( - 'web.starcitizen.production_notes.edit', - [ - 'translation' => $note, - 'updateRoute' => 'web.starcitizen.production-notes.update', - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, ProductionNote $note): RedirectResponse - { - $this->authorize('web.translations.update'); - - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $note->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.production-notes.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Produktionsnotiz')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/ProductionStatus/ProductionStatusController.php b/app/Http/Controllers/Web/StarCitizen/ProductionStatus/ProductionStatusController.php deleted file mode 100644 index 11b983238..000000000 --- a/app/Http/Controllers/Web/StarCitizen/ProductionStatus/ProductionStatusController.php +++ /dev/null @@ -1,96 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.translations.view'); - - return view( - 'web.starcitizen.production_statuses.index', - [ - 'translations' => ProductionStatus::all(), - 'languages' => Language::all(), - 'editRoute' => 'web.starcitizen.production-statuses.edit', - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(ProductionStatus $productionStatus): View - { - $this->authorize('web.translations.update'); - - return view( - 'web.starcitizen.production_statuses.edit', - [ - 'translation' => $productionStatus, - 'updateRoute' => 'web.starcitizen.production-statuses.update', - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, ProductionStatus $productionStatus): RedirectResponse - { - $this->authorize('web.translations.update'); - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $productionStatus->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.production-statuses.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Produktionsstatus')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php b/app/Http/Controllers/Web/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php deleted file mode 100644 index ee627443d..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Starmap/CelestialObject/CelestialObjectController.php +++ /dev/null @@ -1,25 +0,0 @@ - CelestialObject::query()->with('starsystem')->orderBy('code')->get(), - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Starmap/Starsystem/StarsystemController.php b/app/Http/Controllers/Web/StarCitizen/Starmap/Starsystem/StarsystemController.php deleted file mode 100644 index 644174ee9..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Starmap/Starsystem/StarsystemController.php +++ /dev/null @@ -1,35 +0,0 @@ - Starsystem::query()->orderBy('code')->get(), - ] - ); - } - - public function show(Starsystem $starsystem): View - { - return view( - 'web.starcitizen.starmap.starsystems.show', - [ - 'system' => $starsystem, - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Vehicle/Focus/FocusController.php b/app/Http/Controllers/Web/StarCitizen/Vehicle/Focus/FocusController.php deleted file mode 100644 index cb03a06fa..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Vehicle/Focus/FocusController.php +++ /dev/null @@ -1,97 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.translations.view'); - - return view( - 'web.starcitizen.vehicles.foci.index', - [ - 'translations' => Focus::all(), - 'languages' => Language::all(), - 'editRoute' => 'web.starcitizen.vehicles.foci.edit', - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(Focus $focus): View - { - $this->authorize('web.translations.update'); - - return view( - 'web.starcitizen.vehicles.foci.edit', - [ - 'translation' => $focus, - 'updateRoute' => 'web.starcitizen.vehicles.foci.update', - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, Focus $focus): RedirectResponse - { - $this->authorize('web.translations.update'); - - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $focus->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.vehicles.foci.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Fahrzeugfokus')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleController.php b/app/Http/Controllers/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleController.php deleted file mode 100644 index 8510886e4..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Vehicle/GroundVehicle/GroundVehicleController.php +++ /dev/null @@ -1,99 +0,0 @@ -middleware('auth')->except(['index']); - } - - public function index(): View - { - return view( - 'web.starcitizen.vehicles.ground_vehicles.index', - [ - 'groundVehicles' => GroundVehicle::all(), - ] - ); - } - - /** - * Display Ship data, edit Translations - * - * - * - * @throws AuthorizationException - */ - public function edit(GroundVehicle $groundVehicle): View - { - $this->authorize('web.starcitizen.vehicles.update'); - - $groundVehicle->load('components'); - - /** @var Collection $changelogs */ - $changelogs = $groundVehicle->changelogs; - - $changelogs = $changelogs->merge($groundVehicle->translationChangelogs); - - $changelogs = $changelogs->sortByDesc('created_at'); - - return view( - 'web.starcitizen.vehicles.ground_vehicles.edit', - [ - 'groundVehicle' => $groundVehicle, - 'componentGroups' => $groundVehicle->componentsByClass(), - 'changelogs' => $changelogs, - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, GroundVehicle $groundVehicle): RedirectResponse - { - $this->authorize('web.starcitizen.vehicles.update'); - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $groundVehicle->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route( - 'web.starcitizen.vehicles.ground-vehicles.edit', - $groundVehicle->getRouteKey() - )->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Fahrzeug')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Vehicle/Ship/ShipController.php b/app/Http/Controllers/Web/StarCitizen/Vehicle/Ship/ShipController.php deleted file mode 100644 index 82bea32bf..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Vehicle/Ship/ShipController.php +++ /dev/null @@ -1,95 +0,0 @@ -middleware('auth')->except(['index']); - } - - public function index(): View - { - return view( - 'web.starcitizen.vehicles.ships.index', - [ - 'ships' => Ship::all(), - ] - ); - } - - /** - * Display Ship data, edit Translations - * - * - * - * @throws AuthorizationException - */ - public function edit(Ship $ship): View - { - $this->authorize('web.starcitizen.vehicles.update'); - - /** @var Collection $changelogs */ - $changelogs = $ship->changelogs; - - $changelogs = $changelogs->merge($ship->translationChangelogs); - - $changelogs = $changelogs->sortByDesc('created_at'); - - return view( - 'web.starcitizen.vehicles.ships.edit', - [ - 'ship' => $ship, - 'componentGroups' => $ship->componentsByClass(), - 'changelogs' => $changelogs, - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, Ship $ship): RedirectResponse - { - $this->authorize('web.starcitizen.vehicles.update'); - - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $ship->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.vehicles.ships.edit', $ship->getRouteKey())->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Schiff')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Vehicle/Size/SizeController.php b/app/Http/Controllers/Web/StarCitizen/Vehicle/Size/SizeController.php deleted file mode 100644 index 25156d6b2..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Vehicle/Size/SizeController.php +++ /dev/null @@ -1,97 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.translations.view'); - - return view( - 'web.starcitizen.vehicles.sizes.index', - [ - 'translations' => Size::all(), - 'languages' => Language::all(), - 'editRoute' => 'web.starcitizen.vehicles.sizes.edit', - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(Size $size): View - { - $this->authorize('web.translations.update'); - - return view( - 'web.starcitizen.vehicles.sizes.edit', - [ - 'translation' => $size, - 'updateRoute' => 'web.starcitizen.vehicles.sizes.update', - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, Size $size): RedirectResponse - { - $this->authorize('web.translations.update'); - - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $size->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.vehicles.sizes.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Fahrzeuggröße')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizen/Vehicle/Type/TypeController.php b/app/Http/Controllers/Web/StarCitizen/Vehicle/Type/TypeController.php deleted file mode 100644 index e5ac6e0bb..000000000 --- a/app/Http/Controllers/Web/StarCitizen/Vehicle/Type/TypeController.php +++ /dev/null @@ -1,97 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.translations.view'); - - return view( - 'web.starcitizen.vehicles.types.index', - [ - 'translations' => Type::all(), - 'languages' => Language::all(), - 'editRoute' => 'web.starcitizen.vehicles.types.edit', - ] - ); - } - - /** - * Display the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(Type $type): View - { - $this->authorize('web.translations.update'); - - return view( - 'web.starcitizen.vehicles.types.edit', - [ - 'translation' => $type, - 'updateRoute' => 'web.starcitizen.vehicles.types.update', - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranslationRequest $request, Type $type): RedirectResponse - { - $this->authorize('web.translations.update'); - - $data = $request->validated(); - - foreach ($data as $localeCode => $translation) { - $type->translations()->updateOrCreate( - ['locale_code' => $localeCode], - ['translation' => $translation] - ); - } - - return redirect()->route('web.starcitizen.vehicles.types.index')->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Fahrzeugtyp')]), - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/StarCitizenUnpacked/Item/ItemController.php b/app/Http/Controllers/Web/StarCitizenUnpacked/Item/ItemController.php deleted file mode 100644 index 01c2d71e1..000000000 --- a/app/Http/Controllers/Web/StarCitizenUnpacked/Item/ItemController.php +++ /dev/null @@ -1,31 +0,0 @@ - Item::query()->where('uuid', $item)->firstOrFail(), - ] - ); - } - - public function index(): View - { - return view('web.starcitizenunpacked.item.index')->with('apiToken', optional(Auth::user())->api_token); - } -} diff --git a/app/Http/Controllers/Web/StarCitizenUnpacked/VehicleController.php b/app/Http/Controllers/Web/StarCitizenUnpacked/VehicleController.php deleted file mode 100644 index 396936898..000000000 --- a/app/Http/Controllers/Web/StarCitizenUnpacked/VehicleController.php +++ /dev/null @@ -1,19 +0,0 @@ - Vehicle::query()->orderBy('is_ship')->get(), - ]); - } -} diff --git a/app/Http/Controllers/Web/Transcript/TranscriptController.php b/app/Http/Controllers/Web/Transcript/TranscriptController.php deleted file mode 100644 index 11ff393bb..000000000 --- a/app/Http/Controllers/Web/Transcript/TranscriptController.php +++ /dev/null @@ -1,117 +0,0 @@ -middleware('auth'); - } - - /** - * Display a listing of the resource. - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.transcripts.index'); - - $transcripts = Transcript::query()->orderBy('id')->paginate(500); - - return view( - 'web.transcripts.index', - [ - 'transcripts' => $transcripts, - ] - ); - } - - /** - * Display the specified resource. - * - * - * @return Factory|View - * - * @throws AuthorizationException - */ - public function show(Transcript $transcript) - { - $this->authorize('web.transcripts.view'); - - return view( - 'web.transcripts.show', - [ - 'transcript' => $transcript, - 'prev' => $transcript->getPrevAttribute(), - 'next' => $transcript->getNextAttribute(), - ] - ); - } - - /** - * Show the form for editing the specified resource. - * - * - * - * @throws AuthorizationException - */ - public function edit(Transcript $transcript): View - { - $this->authorize(self::TRANSCRIPT_UPDATE_PERMISSION); - - return view( - 'web.transcripts.edit', - [ - 'transcript' => $transcript, - 'prev' => $transcript->getPrevAttribute(), - 'next' => $transcript->getNextAttribute(), - ] - ); - } - - /** - * Update the specified resource in storage. - * - * - * - * @throws AuthorizationException - */ - public function update(TranscriptUpdateRequest $request, Transcript $transcript): RedirectResponse - { - $this->authorize(self::TRANSCRIPT_UPDATE_PERMISSION); - - $validated = $request->validated(); - $transcript->title = trim($validated['title']); - $transcript->playlist_name = trim($validated['playlist_name']); - $transcript->save(); - - $message = __('crud.updated', ['type' => __('Transkript')]); - - return redirect()->route('web.transcripts.edit', $transcript->getRouteKey())->withMessages( - [ - 'success' => [ - $message, - ], - ] - ); - } -} diff --git a/app/Http/Controllers/Web/User/UserController.php b/app/Http/Controllers/Web/User/UserController.php deleted file mode 100644 index fda9fb50f..000000000 --- a/app/Http/Controllers/Web/User/UserController.php +++ /dev/null @@ -1,135 +0,0 @@ -middleware('auth'); - } - - /** - * View all Admins - * - * - * @throws AuthorizationException - */ - public function index(): View - { - $this->authorize('web.users.view'); - - return view( - 'web.users.index', - [ - 'users' => User::query()->withCount('changelogs')->get(), - ] - ); - } - - /** - * Edit Admin - * - * - * - * @throws AuthorizationException - */ - public function edit(User $user): View - { - $this->authorize('web.users.update'); - - return view( - 'web.users.edit', - [ - 'user' => $user, - ] - ); - } - - /** - * Update (Block/Restore) Admin - * - * - * - * @throws AuthorizationException - */ - public function update(Request $request, User $user): RedirectResponse - { - $this->authorize('web.users.update'); - - if ($request->has('block')) { - return $this->block($user); - } - - $data = $request->validate( - [ - self::API_TOKEN => "required|min:60|max:60|string|unique:users,api_token,{$user->id}", - 'language' => 'required|in:en,de', - ] - ); - - $user->update( - [ - self::API_TOKEN => $data[self::API_TOKEN], - ] - ); - - if ($request->has('no_api_throttle')) { - $user->settings()->updateOrCreate( - [ - 'user_id' => $user->id, - ], - [ - 'no_api_throttle' => true, - 'language' => $request->get('language'), - ] - ); - } - - return redirect(route('web.users.edit', $user->getRouteKey()))->withMessages( - [ - 'success' => [ - __('crud.updated', ['type' => __('Benutzer')]), - ], - ] - ); - } - - /** - * @throws AuthorizationException - */ - private function block(User $user): RedirectResponse - { - $this->authorize('web.users.delete'); - - $user->sessions()->delete(); - $user->blocked = true; - $user->save(); - - return redirect(route('web.users.edit', $user->getRouteKey()))->withMessages( - [ - 'warning' => [ - __('crud.blocked', ['type' => __('Benutzer')]), - ], - ] - ); - } -} diff --git a/app/Http/Filters/ImageTagFilter.php b/app/Http/Filters/ImageTagFilter.php deleted file mode 100644 index 23f17c0ad..000000000 --- a/app/Http/Filters/ImageTagFilter.php +++ /dev/null @@ -1,20 +0,0 @@ -whereRelation('tags', 'name', $value) - ->orWhereRelation('tags', 'name_en', $value); - } -} diff --git a/app/Http/Filters/ItemVariantsFilter.php b/app/Http/Filters/ItemVariantsFilter.php deleted file mode 100644 index 86f3c73f0..000000000 --- a/app/Http/Filters/ItemVariantsFilter.php +++ /dev/null @@ -1,19 +0,0 @@ -whereNull('base_id'); - } - } -} diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php deleted file mode 100644 index 23675c544..000000000 --- a/app/Http/Kernel.php +++ /dev/null @@ -1,96 +0,0 @@ - [ - EncryptCookies::class, - AddQueuedCookiesToResponse::class, - StartSession::class, - ShareErrorsFromSession::class, - VerifyCsrfToken::class, - SubstituteBindings::class, - CheckUserState::class, - SetPreferredLocale::class, - ], - - 'api' => [ - ForceJsonResponse::class, - 'bindings', - 'check_user_state', - ], - - 'api.v2' => [ - ForceJsonResponse::class, - 'bindings', - 'check_user_state', - FormatApiResponse::class, - ], - ]; - - /** - * The application's route middleware. - * - * These middleware may be assigned to groups or used individually. - * - * @var array - */ - protected $middlewareAliases = [ - 'auth' => Authenticate::class, - 'auth.basic' => AuthenticateWithBasicAuth::class, - 'bindings' => SubstituteBindings::class, - 'can' => Authorize::class, - 'check_user_state' => CheckUserState::class, - 'guest' => RedirectIfAuthenticated::class, - 'throttle' => ThrottleRequests::class, - ]; -} diff --git a/app/Http/Middleware/CheckUserState.php b/app/Http/Middleware/CheckUserState.php deleted file mode 100644 index 285f6cb87..000000000 --- a/app/Http/Middleware/CheckUserState.php +++ /dev/null @@ -1,44 +0,0 @@ -user(); - - if ($user !== null && $user->blocked) { - app('Log')::notice( - 'Request from blacklisted User', - [ - 'user_id' => $user->id, - 'request_url' => $request->getUri(), - ] - ); - - Auth::logout(); - - abort(403, __('Benutzer ist gesperrt')); - } - - return $next($request); - } -} diff --git a/app/Http/Middleware/EncryptCookies.php b/app/Http/Middleware/EncryptCookies.php deleted file mode 100644 index 79827687a..000000000 --- a/app/Http/Middleware/EncryptCookies.php +++ /dev/null @@ -1,20 +0,0 @@ -headers->set('Accept', 'application/json'); - - return $next($request); - } -} diff --git a/app/Http/Middleware/FormatApiResponse.php b/app/Http/Middleware/FormatApiResponse.php deleted file mode 100644 index 844d8542c..000000000 --- a/app/Http/Middleware/FormatApiResponse.php +++ /dev/null @@ -1,28 +0,0 @@ -setEncodingOptions(JSON_PRETTY_PRINT); - } - - return $response; - } -} diff --git a/app/Http/Middleware/SetPreferredLocale.php b/app/Http/Middleware/SetPreferredLocale.php deleted file mode 100644 index e4195924d..000000000 --- a/app/Http/Middleware/SetPreferredLocale.php +++ /dev/null @@ -1,33 +0,0 @@ -getPreferredLanguage(['de', 'en']); - - if (Auth::user()) { - $language = optional(Auth::user()->settings)->language ?? $language; - } - - app()->setLocale($language); - - return $next($request); - } -} diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php deleted file mode 100644 index 6da6d4a5c..000000000 --- a/app/Http/Middleware/TrimStrings.php +++ /dev/null @@ -1,20 +0,0 @@ -check()) { - return redirect()->intended(route('web.account.index')); - } - - return $next($request); - } -} diff --git a/app/Http/Requests/AbstractSearchRequest.php b/app/Http/Requests/AbstractSearchRequest.php deleted file mode 100644 index e49243a56..000000000 --- a/app/Http/Requests/AbstractSearchRequest.php +++ /dev/null @@ -1,28 +0,0 @@ - 'required|string|min:1|max:255', - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/CommLinkRequest.php b/app/Http/Requests/Rsi/CommLink/CommLinkRequest.php deleted file mode 100644 index ca4c3aed2..000000000 --- a/app/Http/Requests/Rsi/CommLink/CommLinkRequest.php +++ /dev/null @@ -1,38 +0,0 @@ -can('web.rsi.comm-links.update'); - } - - /** - * Get the validation rules that apply to the request. - */ - public function rules(): array - { - return [ - 'title' => 'required|string|min:1|max:255', - 'url' => 'nullable|string|min:15|max:255', - 'created_at' => 'required|date', - 'channel' => 'required|string|exists:comm_link_channels,id', - 'series' => 'required|string|exists:comm_link_series,id', - 'category' => 'required|string|exists:comm_link_categories,id', - //'version' => 'required|string|regex:/\d{4}\-\d{2}\-\d{2}\_\d{6}\.html/', - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/CommLinkSearchRequest.php b/app/Http/Requests/Rsi/CommLink/CommLinkSearchRequest.php deleted file mode 100644 index d8cf6bed2..000000000 --- a/app/Http/Requests/Rsi/CommLink/CommLinkSearchRequest.php +++ /dev/null @@ -1,29 +0,0 @@ - 'required_without_all:query|string|min:3|max:255', - 'query' => 'required_without_all:keyword|string|min:1|max:255', - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/Image/AddImageTagsRequest.php b/app/Http/Requests/Rsi/CommLink/Image/AddImageTagsRequest.php deleted file mode 100644 index 1f4d167f6..000000000 --- a/app/Http/Requests/Rsi/CommLink/Image/AddImageTagsRequest.php +++ /dev/null @@ -1,33 +0,0 @@ -getHighestPermissionLevel() >= UserGroup::MITARBEITER; - } - - /** - * Get the validation rules that apply to the request. - */ - public function rules(): array - { - return [ - 'tags' => [ - 'nullable', - 'array', - ], - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/Image/ImageSearchRequest.php b/app/Http/Requests/Rsi/CommLink/Image/ImageSearchRequest.php deleted file mode 100644 index b7c647e3c..000000000 --- a/app/Http/Requests/Rsi/CommLink/Image/ImageSearchRequest.php +++ /dev/null @@ -1,9 +0,0 @@ -getHighestPermissionLevel() >= UserGroup::USER; - } - - /** - * Get the validation rules that apply to the request. - */ - public function rules(): array - { - return [ - 'filename' => [ - 'required', - 'string', - 'min:3', - 'max:255', - ], - 'image' => [ - 'required', - 'exists:comm_link_images,id', - ], - 'description' => [ - 'required', - 'string', - 'min:10', - 'max:255', - ], - 'categories' => [ - 'required', - 'string', - 'min:3', - 'max:255', - ], - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/Image/NewImageTagRequest.php b/app/Http/Requests/Rsi/CommLink/Image/NewImageTagRequest.php deleted file mode 100644 index e97a92105..000000000 --- a/app/Http/Requests/Rsi/CommLink/Image/NewImageTagRequest.php +++ /dev/null @@ -1,36 +0,0 @@ -getHighestPermissionLevel() >= UserGroup::USER; - } - - /** - * Get the validation rules that apply to the request. - */ - public function rules(): array - { - return [ - 'name' => [ - 'required', - 'string', - 'min:2', - 'max:255', - 'unique:comm_link_image_tags', - ], - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/Image/TagUpdateRequest.php b/app/Http/Requests/Rsi/CommLink/Image/TagUpdateRequest.php deleted file mode 100644 index 8daf06131..000000000 --- a/app/Http/Requests/Rsi/CommLink/Image/TagUpdateRequest.php +++ /dev/null @@ -1,40 +0,0 @@ -|string> - */ - public function rules(): array - { - return [ - 'name' => [ - 'required', - 'string', - 'min:3', - 'max:255', - 'exists:comm_link_image_tags', - ], - 'name_en' => [ - 'required', - 'string', - 'min:3', - 'max:255', - ], - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/ReverseImageLinkSearchRequest.php b/app/Http/Requests/Rsi/CommLink/ReverseImageLinkSearchRequest.php deleted file mode 100644 index 4fabff693..000000000 --- a/app/Http/Requests/Rsi/CommLink/ReverseImageLinkSearchRequest.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'required', - 'url', - 'regex:/https?:\/\/(?:media\.)?robertsspaceindustries.com\/.*/', - ], - ]; - } -} diff --git a/app/Http/Requests/Rsi/CommLink/ReverseImageSearchRequest.php b/app/Http/Requests/Rsi/CommLink/ReverseImageSearchRequest.php deleted file mode 100644 index 2449fe6ad..000000000 --- a/app/Http/Requests/Rsi/CommLink/ReverseImageSearchRequest.php +++ /dev/null @@ -1,33 +0,0 @@ - 'required|file|max:5120', // Limit to 5mb - 'similarity' => 'required|numeric|min:1|max:100', - ]; - } -} diff --git a/app/Http/Requests/StarCitizen/Galactapedia/GalactapediaSearchRequest.php b/app/Http/Requests/StarCitizen/Galactapedia/GalactapediaSearchRequest.php deleted file mode 100644 index 27e62e439..000000000 --- a/app/Http/Requests/StarCitizen/Galactapedia/GalactapediaSearchRequest.php +++ /dev/null @@ -1,9 +0,0 @@ -keyBy('locale_code'); - $rule = '|string|min:1'; - $rules = []; - - foreach ($localeCodes as $code => $language) { - if (config('language.english') === $language->locale_code) { - $rules["description_{$code}"] = 'required'.$rule; - $rules["known_for_{$code}"] = 'required'.$rule; - } else { - $rules["description_{$code}"] = 'present'.$rule; - $rules["known_for_{$code}"] = 'present'.$rule; - } - } - - return $rules; - } -} diff --git a/app/Http/Requests/StarCitizen/Starmap/StarsystemRequest.php b/app/Http/Requests/StarCitizen/Starmap/StarsystemRequest.php deleted file mode 100644 index f59d59781..000000000 --- a/app/Http/Requests/StarCitizen/Starmap/StarsystemRequest.php +++ /dev/null @@ -1,9 +0,0 @@ -keyBy('locale_code'); - $rule = '|string|min:1'; - $rules = []; - - foreach ($localeCodes as $code => $language) { - if (config('language.english') === $language->locale_code) { - $rules[$code] = 'required'.$rule; - } else { - $rules[$code] = 'present'.$rule; - } - } - - return $rules; - } -} diff --git a/app/Http/Requests/Transcript/TranscriptUpdateRequest.php b/app/Http/Requests/Transcript/TranscriptUpdateRequest.php deleted file mode 100644 index 05b2fb196..000000000 --- a/app/Http/Requests/Transcript/TranscriptUpdateRequest.php +++ /dev/null @@ -1,30 +0,0 @@ -can('web.transcripts.update'); - } - - /** - * Get the validation rules that apply to the request. - */ - public function rules(): array - { - return [ - 'title' => 'required|string|min:1|max:255', - 'playlist_name' => 'required|string|min:1|max:255', - ]; - } -} diff --git a/app/Http/Resources/AbstractBaseResource.php b/app/Http/Resources/AbstractBaseResource.php index 0df689249..4cdeeaa1e 100644 --- a/app/Http/Resources/AbstractBaseResource.php +++ b/app/Http/Resources/AbstractBaseResource.php @@ -56,7 +56,7 @@ public function __construct($resource) */ protected function makeApiUrl(string $fragment, ...$routeKey): string { - return sprintf('%s/api/v2/%s%s', config('app.url'), $fragment, ...$routeKey); + return sprintf('%s/api/%s%s', config('app.url'), $fragment, ...$routeKey); } public static function validIncludes(): array diff --git a/app/Http/Resources/SC/Item/ItemDescriptionDataResource.php b/app/Http/Resources/Game/Item/ItemDescriptionDataResource.php similarity index 89% rename from app/Http/Resources/SC/Item/ItemDescriptionDataResource.php rename to app/Http/Resources/Game/Item/ItemDescriptionDataResource.php index 3dccbb01a..0eb6183a9 100644 --- a/app/Http/Resources/SC/Item/ItemDescriptionDataResource.php +++ b/app/Http/Resources/Game/Item/ItemDescriptionDataResource.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace App\Http\Resources\SC\Item; +namespace App\Http\Resources\Game\Item; use App\Http\Resources\AbstractBaseResource; use Illuminate\Http\Request; use OpenApi\Attributes as OA; #[OA\Schema( - schema: 'item_description_data_v2', + schema: 'item_description_data', title: 'Item Description Data', description: 'Data found in the description of an item, e.g. "Carrying Capacity: 2kµSCU".', properties: [ diff --git a/app/Http/Resources/Game/Item/ItemDimensionResource.php b/app/Http/Resources/Game/Item/ItemDimensionResource.php new file mode 100644 index 000000000..15e5bba1b --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemDimensionResource.php @@ -0,0 +1,108 @@ + 0.5, + 'height' => 0.2, + 'length' => 1.1, + ], + nullable: true + ), + ], + type: 'object' +)] +class ItemDimensionResource extends AbstractBaseResource +{ + public function toArray(Request $request): array + { + $stdItem = collect($this->data->get('stdItem')); + + $trueDim = $stdItem->get('Dimension', []); + $dim = $stdItem->has('DimensionOverrides') ? $stdItem->get('DimensionOverrides') : $trueDim; + + $sumDim = Arr::get($dim, 'Width', 0) + Arr::get($dim, 'Height', 0) + Arr::get($dim, 'Length', 0); + $sumTrueDim = Arr::get($trueDim, 'Width', 0) + Arr::get($trueDim, 'Height', 0) + Arr::get($trueDim, 'Length', 0); + + return [ + 'width' => Arr::get($dim, 'Width'), + 'height' => Arr::get($dim, 'Height'), + 'length' => Arr::get($dim, 'Length'), + 'volume' => Arr::get($trueDim, 'Volume'), + $this->mergeWhen($sumDim !== $sumTrueDim, [ + 'true_dimension' => [ + 'width' => Arr::get($trueDim, 'Width'), + 'height' => Arr::get($trueDim, 'Height'), + 'length' => Arr::get($trueDim, 'Length'), + ], + ]), + ]; + } +} diff --git a/app/Http/Resources/Game/Item/ItemDurabilityResource.php b/app/Http/Resources/Game/Item/ItemDurabilityResource.php new file mode 100644 index 000000000..84cb4f572 --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemDurabilityResource.php @@ -0,0 +1,35 @@ + Arr::get($this, 'Health'), + 'max_lifetime' => Arr::get($this, 'Lifetime'), + 'repairable' => Arr::get($this, 'Repairable') === 1, + 'salvageable' => Arr::get($this, 'Salvageable') === 1, + ]; + } +} diff --git a/app/Http/Resources/Game/Item/ItemHeatConnectionResource.php b/app/Http/Resources/Game/Item/ItemHeatConnectionResource.php new file mode 100644 index 000000000..9103914ec --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemHeatConnectionResource.php @@ -0,0 +1,73 @@ + Arr::get($this, 'TemperatureToIR'), + 'ir_temperature_threshold' => Arr::get($this, 'StartIRTemperature'), + 'overpower_heat' => Arr::get($this, 'OverpowerHeat'), + 'overclock_threshold_min_heat' => Arr::get($this, 'OverclockThresholdMinHeat'), + 'overclock_threshold_max_heat' => Arr::get($this, 'OverclockThresholdMaxHeat'), + 'thermal_energy_base' => Arr::get($this, 'ThermalEnergyBase'), + 'thermal_energy_draw' => Arr::get($this, 'ThermalEnergyDraw'), + 'thermal_conductivity' => Arr::get($this, 'ThermalConductivity'), + 'specific_heat_capacity' => Arr::get($this, 'SpecificHeatCapacity'), + 'mass' => Arr::get($this, 'Mass'), + 'surface_area' => Arr::get($this, 'SurfaceArea'), + 'start_cooling_temperature' => Arr::get($this, 'StartCoolingTemperature'), + 'max_cooling_rate' => Arr::get($this, 'MaxCoolingRate'), + 'max_temperature' => Arr::get($this, 'MaxTemperature'), + 'min_temperature' => Arr::get($this, 'MinTemperature'), + 'overheat_temperature' => Arr::get($this, 'OverheatTemperature'), + 'recovery_temperature' => Arr::get($this, 'RecoveryTemperature'), + 'misfire_min_temperature' => Arr::get($this, 'MisfireMinTemperature'), + 'misfire_max_temperature' => Arr::get($this, 'MisfireMaxTemperature'), + 'ir_emission' => max( + 0, + ( + Arr::get($this, 'StartCoolingTemperature', 0) - + Arr::get($this, 'StartIRTemperature', 0) + ) * Arr::get($this, 'TemperatureToIR', 0) + ), + ]; + } +} diff --git a/app/Http/Resources/Game/Item/ItemInventoryResource.php b/app/Http/Resources/Game/Item/ItemInventoryResource.php new file mode 100644 index 000000000..474ce2449 --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemInventoryResource.php @@ -0,0 +1,64 @@ + Arr::get($this, 'UUID'), + 'width' => Arr::get($this, 'x'), + 'height' => Arr::get($this, 'z'), + 'length' => Arr::get($this, 'y'), + 'dimension' => Arr::has($this, ['x', 'z', 'y']) + ? Arr::get($this, 'x') * Arr::get($this, 'z') * Arr::get($this, 'y') + : null, + 'scu' => Arr::get($this, 'SCU'), + 'scu_converted' => Arr::has($this, ['SCU', 'Unit']) + ? Arr::get($this, 'SCU') * (10 ** Arr::get($this, 'Unit')) + : null, + 'unit' => Arr::get($this, 'UnitName'), + 'open' => Arr::get($this, 'IsOpenContainer'), + 'external' => Arr::get($this, 'IsExternalContainer'), + 'closed' => Arr::get($this, 'IsClosedContainer'), + ]; + } +} diff --git a/app/Http/Resources/Game/Item/ItemPortResource.php b/app/Http/Resources/Game/Item/ItemPortResource.php new file mode 100644 index 000000000..d58e04335 --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemPortResource.php @@ -0,0 +1,100 @@ +loadItemForVersion(Arr::get($this, 'EquippedItemUUID')); + } + + return [ + 'name' => Arr::get($this, 'PortName'), + 'display_name' => Arr::get($this, 'DisplayName'), + 'position' => Arr::get($this, 'Position', strtoupper(Arr::get($this, 'PortName', ''))), + 'size' => Arr::get($this, 'Size'), + 'sizes' => [ + 'min' => Arr::get($this, 'MinSize'), + 'max' => Arr::get($this, 'MaxSize'), + ], + 'compatible_types' => Arr::has($this, 'CompatibleTypes') && is_array(Arr::get($this, 'CompatibleTypes')) + ? ItemPortTypeResource::collection(Arr::get($this, 'CompatibleTypes')) + : null, + 'types' => Arr::get($this, 'Types', []), + 'tags' => Arr::get($this, 'Tags', []), + 'required_tags' => Arr::get($this, 'RequiredTags', []), + 'flags' => Arr::get($this, 'Flags', []), + 'uneditable' => Arr::get($this, 'Uneditable'), + $this->mergeWhen($item !== null, [ + 'equipped_item' => new ItemLinkResource($item), + ]), + ]; + } +} diff --git a/app/Http/Resources/SC/Item/ItemPortTypeResource.php b/app/Http/Resources/Game/Item/ItemPortTypeResource.php similarity index 66% rename from app/Http/Resources/SC/Item/ItemPortTypeResource.php rename to app/Http/Resources/Game/Item/ItemPortTypeResource.php index 1263e2507..982395e9b 100644 --- a/app/Http/Resources/SC/Item/ItemPortTypeResource.php +++ b/app/Http/Resources/Game/Item/ItemPortTypeResource.php @@ -2,17 +2,18 @@ declare(strict_types=1); -namespace App\Http\Resources\SC\Item; +namespace App\Http\Resources\Game\Item; use App\Http\Resources\AbstractBaseResource; use Illuminate\Http\Request; +use Illuminate\Support\Arr; use OpenApi\Attributes as OA; #[OA\Schema( - schema: 'item_port_type_v2', + schema: 'item_port_type', title: 'Item Port Compatible Types', properties: [ - new OA\Property(property: 'type', type: 'string'), + new OA\Property(property: 'type', type: 'string', nullable: true), new OA\Property( property: 'sub_types', type: 'array', @@ -27,8 +28,8 @@ class ItemPortTypeResource extends AbstractBaseResource public function toArray(Request $request): array { return [ - 'type' => $this->type, - 'sub_types' => $this->subTypes->pluck('sub_type')->toArray(), + 'type' => Arr::get($this, 'Type'), + 'sub_types' => Arr::get($this, 'SubTypes', []), ]; } } diff --git a/app/Http/Resources/Game/Item/ItemPowerConnectionResource.php b/app/Http/Resources/Game/Item/ItemPowerConnectionResource.php new file mode 100644 index 000000000..c86e4ac37 --- /dev/null +++ b/app/Http/Resources/Game/Item/ItemPowerConnectionResource.php @@ -0,0 +1,54 @@ + Arr::get($this, 'PowerBase'), + 'power_draw' => Arr::get($this, 'PowerDraw'), + // 'time_to_reach_draw_request' => Arr::get($this, 'TimeToReachDrawRequest'), + // 'safeguard_priority' => Arr::get($this, 'SafeguardPriority'), + // 'displayed_in_powered_item_list' => Arr::get($this, 'DisplayedInPoweredItemList'), + 'throttleable' => Arr::get($this, 'IsThrottleable'), + 'overclockable' => Arr::get($this, 'IsOverclockable'), + 'overclock_threshold_min' => Arr::get($this, 'OverclockThresholdMin'), + 'overclock_threshold_max' => Arr::get($this, 'OverclockThresholdMax'), + 'overpower_performance' => Arr::get($this, 'OverpowerPerformance'), + 'overclock_performance' => Arr::get($this, 'OverclockPerformance'), + 'power_to_em' => Arr::get($this, 'PowerToEM'), + 'decay_rate_em' => Arr::get($this, 'DecayRateOfEM'), + 'em_min' => Arr::get($this, 'PowerBase', 0) * Arr::get($this, 'PowerToEM', 0), + 'em_max' => Arr::get($this, 'PowerDraw', 0) * Arr::get($this, 'PowerToEM', 0), + ]; + } +} diff --git a/app/Http/Resources/Game/ItemSpecification/ClothingResource.php b/app/Http/Resources/Game/ItemSpecification/ClothingResource.php new file mode 100644 index 000000000..e2a8fe915 --- /dev/null +++ b/app/Http/Resources/Game/ItemSpecification/ClothingResource.php @@ -0,0 +1,142 @@ +Minimum.', + type: 'double', + example: 2, + nullable: true, + deprecated: true + ), + new OA\Property( + property: 'temp_resistance_max', + description: 'The maximum temperature this resource protects against. Value from TemperatureResistance->Maximum.', + type: 'double', + example: 10, + nullable: true, + deprecated: true + ), + new OA\Property( + property: 'temperature_resistance', + ref: '#/components/schemas/temperature_resistance', + nullable: true, + example: [ + 'minimum' => 2, + 'maximum' => 32, + ] + ), + new OA\Property( + property: 'radiation_resistance', + ref: '#/components/schemas/radiation_resistance', + nullable: true, + example: [ + 'maximum_radiation_capacity' => 0, + 'radiation_dissipation_rate' => 0, + ] + ), + ], + type: 'object' +)] +class ClothingResource extends AbstractBaseResource +{ + public function toArray(Request $request): array + { + $resource = $this->resource; + $classification = Arr::get($resource, 'classification', $this->resource->classification ?? null); + $slot = $this->deriveSlot($classification); + $type = $this->getType( + Arr::get($resource, 'type', ''), + Arr::get($resource, 'name', '') + ); + + return [ + 'slot' => $slot, + 'clothing_type' => $type, + 'type' => $type, + 'temp_resistance_min' => Arr::get($resource, 'data.stdItem.TemperatureResistance.Minimum'), + 'temp_resistance_max' => Arr::get($resource, 'data.stdItem.TemperatureResistance.Maximum'), + 'temperature_resistance' => Arr::has($resource, 'data.stdItem.TemperatureResistance') + ? (new TemperatureResistanceResource(Arr::get($resource, 'data.stdItem.TemperatureResistance')))->toArray($request) + : null, + 'radiation_resistance' => Arr::has($resource, 'data.stdItem.RadiationResistance') + ? (new RadiationResistanceResource(Arr::get($resource, 'data.stdItem.RadiationResistance')))->toArray($request) + : null, + ]; + } + + private function getType(string $type, string $name): string + { + return match (true) { + str_contains($name, 'T-Shirt'), str_contains($name, 'Shirt') !== false => 'T-Shirt', + str_contains($name, 'Jacket') !== false => 'Jacket', + str_contains($name, 'Gloves') !== false => 'Gloves', + str_contains($name, 'Pants') !== false => 'Pants', + str_contains($name, 'Bandana') !== false => 'Bandana', + str_contains($name, 'Beanie') !== false => 'Beanie', + str_contains($name, 'Boots') !== false => 'Boots', + str_contains($name, 'Sweater') !== false => 'Sweater', + str_contains($name, 'Hat') !== false => 'Hat', + str_contains($name, 'Shoes') !== false => 'Shoes', + str_contains($name, 'Head Cover') !== false => 'Head Cover', + str_contains($name, 'Gown') !== false => 'Gown', + str_contains($name, 'Slippers') !== false => 'Slippers', + default => match (true) { + str_contains($type, 'Backpack') !== false => 'Backpack', + str_contains($type, 'Feet') !== false => 'Shoes', + str_contains($type, 'Hands') !== false => 'Gloves', + str_contains($type, 'Hat') !== false => 'Hat', + str_contains($type, 'Legs') !== false => 'Pants', + str_contains($type, 'Torso_0') !== false => 'Shirt', + str_contains($type, 'Torso_1') !== false => 'Jacket', + default => 'Unknown Type', + }, + }; + + } + + private function deriveSlot(?string $classification): ?string + { + if ($classification === null) { + return null; + } + + $parts = explode('.', $classification); + + return $parts !== [] ? Arr::last($parts) : null; + } +} diff --git a/app/Http/Resources/Game/Manufacturer/ManufacturerLinkResource.php b/app/Http/Resources/Game/Manufacturer/ManufacturerLinkResource.php new file mode 100644 index 000000000..96c11dc7c --- /dev/null +++ b/app/Http/Resources/Game/Manufacturer/ManufacturerLinkResource.php @@ -0,0 +1,31 @@ + $this->name, + 'code' => $this->code, + 'link' => $this->makeApiUrl(self::MANUFACTURERS_SHOW, urlencode($this->name)), + ]; + } +} diff --git a/app/Http/Resources/SC/Manufacturer/ManufacturerResource.php b/app/Http/Resources/Game/Manufacturer/ManufacturerResource.php similarity index 72% rename from app/Http/Resources/SC/Manufacturer/ManufacturerResource.php rename to app/Http/Resources/Game/Manufacturer/ManufacturerResource.php index 1d39dd10c..924ea328f 100644 --- a/app/Http/Resources/SC/Manufacturer/ManufacturerResource.php +++ b/app/Http/Resources/Game/Manufacturer/ManufacturerResource.php @@ -2,17 +2,15 @@ declare(strict_types=1); -namespace App\Http\Resources\SC\Manufacturer; +namespace App\Http\Resources\Game\Manufacturer; use App\Http\Resources\AbstractBaseResource; -use App\Http\Resources\SC\Item\ItemLinkResource; -use App\Http\Resources\SC\Vehicle\VehicleLinkResource; use Illuminate\Http\Request; use OpenApi\Attributes as OA; #[OA\Schema( - schema: 'manufacturer_v2', - title: 'Manufacturer', + schema: 'manufacturer', + title: 'In game manufacturer', properties: [ new OA\Property(property: 'name', type: 'string'), new OA\Property(property: 'code', type: 'string'), @@ -20,17 +18,17 @@ new OA\Property( property: 'ships', type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle_link_v2') + items: new OA\Items(ref: '#/components/schemas/vehicle_link') ), new OA\Property( property: 'vehicles', type: 'array', - items: new OA\Items(ref: '#/components/schemas/vehicle_link_v2') + items: new OA\Items(ref: '#/components/schemas/vehicle_link') ), new OA\Property( property: 'items', type: 'array', - items: new OA\Items(ref: '#/components/schemas/item_link_v2') + items: new OA\Items(ref: '#/components/schemas/item_link') ), ], type: 'object' @@ -52,9 +50,9 @@ public function toArray(Request $request): array 'name' => $this->name, 'code' => $this->code, 'uuid' => $this->uuid, - 'ships' => VehicleLinkResource::collection($this->ships()), - 'vehicles' => VehicleLinkResource::collection($this->groundVehicles()), - 'items' => ItemLinkResource::collection($this->items()), + // 'ships' => VehicleLinkResource::collection($this->ships()), + // 'vehicles' => VehicleLinkResource::collection($this->groundVehicles()), + // 'items' => ItemLinkResource::collection($this->items()), ]; } } diff --git a/app/Http/Resources/SC/Ammunition/AmmunitionDamageFalloffResource.php b/app/Http/Resources/SC/Ammunition/AmmunitionDamageFalloffResource.php deleted file mode 100644 index 1a1da5fa5..000000000 --- a/app/Http/Resources/SC/Ammunition/AmmunitionDamageFalloffResource.php +++ /dev/null @@ -1,38 +0,0 @@ - $this->physical ?? null, - 'energy' => $this->energy ?? null, - 'distortion' => $this->distortion ?? null, - 'thermal' => $this->thermal ?? null, - 'biochemical' => $this->biochemical ?? null, - 'stun' => $this->stun ?? null, - ]; - } -} diff --git a/app/Http/Resources/SC/Ammunition/AmmunitionPiercabilityResource.php b/app/Http/Resources/SC/Ammunition/AmmunitionPiercabilityResource.php deleted file mode 100644 index 3dd84d944..000000000 --- a/app/Http/Resources/SC/Ammunition/AmmunitionPiercabilityResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->damage_falloff_level_1 ?? null, - 'damage_falloff_level_2' => $this->damage_falloff_level_2 ?? null, - 'damage_falloff_level_3' => $this->damage_falloff_level_3 ?? null, - 'max_penetration_thickness' => $this->max_penetration_thickness ?? null, - ]; - } -} diff --git a/app/Http/Resources/SC/Ammunition/AmmunitionResource.php b/app/Http/Resources/SC/Ammunition/AmmunitionResource.php deleted file mode 100644 index 8ca2ed15f..000000000 --- a/app/Http/Resources/SC/Ammunition/AmmunitionResource.php +++ /dev/null @@ -1,48 +0,0 @@ - $this->uuid ?? null, - 'size' => $this->size ?? null, - 'lifetime' => $this->lifetime ?? null, - 'speed' => $this->speed ?? null, - 'range' => $this->range ?? null, - 'piercability' => new AmmunitionPiercabilityResource($this->piercability), - 'damage_falloffs' => [ - 'min_distance' => new AmmunitionDamageFalloffResource($this->damageFalloffs()->where('type', 'min_distance')->first() ?? []), - 'per_meter' => new AmmunitionDamageFalloffResource($this->damageFalloffs()->where('type', 'per_meter')->first() ?? []), - 'min_damage' => new AmmunitionDamageFalloffResource($this->damageFalloffs()->where('type', 'min_damage')->first() ?? []), - ], - ]; - } -} diff --git a/app/Http/Resources/SC/Char/ClothingRadiationResistanceResource.php b/app/Http/Resources/SC/Char/ClothingRadiationResistanceResource.php deleted file mode 100644 index 44d5d595a..000000000 --- a/app/Http/Resources/SC/Char/ClothingRadiationResistanceResource.php +++ /dev/null @@ -1,40 +0,0 @@ - $this->maximum_radiation_capacity, - 'radiation_dissipation_rate' => $this->radiation_dissipation_rate, - ]; - } -} diff --git a/app/Http/Resources/SC/Char/ClothingResistanceResource.php b/app/Http/Resources/SC/Char/ClothingResistanceResource.php deleted file mode 100644 index 6f31ecc37..000000000 --- a/app/Http/Resources/SC/Char/ClothingResistanceResource.php +++ /dev/null @@ -1,42 +0,0 @@ - $this->type, - 'threshold' => $this->threshold, - 'multiplier' => $this->multiplier, - ]; - } -} diff --git a/app/Http/Resources/SC/Char/ClothingResource.php b/app/Http/Resources/SC/Char/ClothingResource.php deleted file mode 100644 index c3db0f0ac..000000000 --- a/app/Http/Resources/SC/Char/ClothingResource.php +++ /dev/null @@ -1,91 +0,0 @@ -type, 'Char_Clothing')) { - $typeKey = 'clothing_type'; - } - - return [ - $typeKey => $this->clothing_type, - 'damage_reduction' => $this->damage_reduction, - 'temp_resistance_min' => $this->temp_resistance_min, - 'temp_resistance_max' => $this->temp_resistance_max, - 'radiation_resistance' => ClothingRadiationResistanceResource::make($this->radiation_resistance), - 'resistances' => ClothingResistanceResource::collection($this->damageResistances), - ]; - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/BarrelAttachResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/BarrelAttachResource.php deleted file mode 100644 index 4092f266f..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/BarrelAttachResource.php +++ /dev/null @@ -1,28 +0,0 @@ - $this->type ?? null, - ]; - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/GrenadeResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/GrenadeResource.php deleted file mode 100644 index a36912a2f..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/GrenadeResource.php +++ /dev/null @@ -1,42 +0,0 @@ - $this->aoe, - 'damage_type' => $this->damage_type, - 'damage' => $this->damage, - ]; - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/IronSightResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/IronSightResource.php deleted file mode 100644 index c814d9a50..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/IronSightResource.php +++ /dev/null @@ -1,40 +0,0 @@ - $this->zoom_scale ?? null, - 'optic_type' => $this->optic_type ?? null, - 'default_range' => $this->default_range ?? null, - 'max_range' => $this->max_range ?? null, - 'range_increment' => $this->range_increment ?? null, - 'auto_zeroing_time' => $this->auto_zeroing_time ?? null, - 'zoom_time_scale' => $this->zoom_time_scale ?? null, - ]); - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/KnifeResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/KnifeResource.php deleted file mode 100644 index 861459c92..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/KnifeResource.php +++ /dev/null @@ -1,42 +0,0 @@ - $this->can_be_used_for_take_down, - 'can_block' => $this->can_block, - 'can_be_used_in_prone' => $this->can_be_used_in_prone, - 'can_dodge' => $this->can_dodge, - 'attack_modes' => MeleeCombatConfigResource::collection($this->combatConfig), - ]; - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponAttachmentResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponAttachmentResource.php deleted file mode 100644 index d638dfa54..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponAttachmentResource.php +++ /dev/null @@ -1,58 +0,0 @@ - $this->initial_ammo_count ?? null, - 'max_ammo_count' => $this->max_ammo_count ?? null, - 'type' => $this->getDescriptionDatum('Item Type'), - ]; - } -} diff --git a/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponResource.php b/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponResource.php deleted file mode 100644 index ef5e1e61b..000000000 --- a/app/Http/Resources/SC/Char/PersonalWeapon/PersonalWeaponResource.php +++ /dev/null @@ -1,80 +0,0 @@ - $this->weapon_class, - 'type' => $this->weapon_type, - 'magazine_type' => $this->magazineType, - 'magazine_size' => $this->magazine->max_ammo_count ?? null, - 'effective_range' => $this->effective_range ?? null, - 'damage_per_shot' => $this->ammunition?->damage ?? null, - 'rof' => $this->rof ?? null, - 'modes' => WeaponModeResource::collection($this->whenLoaded('modes')), - 'damages' => WeaponDamageResource::collection($this->damages()), - ]; - - if ($this->sub_type !== 'Knife') { - $data['ammunition'] = new AmmunitionResource($this->ammunition); - } - - return $data; - } -} diff --git a/app/Http/Resources/SC/Faction/FactionLinkResource.php b/app/Http/Resources/SC/Faction/FactionLinkResource.php deleted file mode 100644 index 80e066b42..000000000 --- a/app/Http/Resources/SC/Faction/FactionLinkResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'class_name' => $this->class_name, - 'link' => $this->makeApiUrl(self::FACTIONS_SHOW, $this->uuid), - ]; - } -} diff --git a/app/Http/Resources/SC/Faction/FactionRelationResource.php b/app/Http/Resources/SC/Faction/FactionRelationResource.php deleted file mode 100644 index c03ead1cd..000000000 --- a/app/Http/Resources/SC/Faction/FactionRelationResource.php +++ /dev/null @@ -1,32 +0,0 @@ -faction))->resolve($request) + [ - 'relation' => $this->relation, - ]; - } -} diff --git a/app/Http/Resources/SC/Faction/FactionResource.php b/app/Http/Resources/SC/Faction/FactionResource.php deleted file mode 100644 index cc05d0d76..000000000 --- a/app/Http/Resources/SC/Faction/FactionResource.php +++ /dev/null @@ -1,43 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'description' => $this->description, - 'class_name' => $this->class_name, - 'game_token' => $this->game_token, - 'default_reaction' => $this->default_reaction, - 'relations' => FactionRelationResource::collection($this->relations), - ]; - } -} diff --git a/app/Http/Resources/SC/FoodResource.php b/app/Http/Resources/SC/FoodResource.php deleted file mode 100644 index 7d753dd74..000000000 --- a/app/Http/Resources/SC/FoodResource.php +++ /dev/null @@ -1,64 +0,0 @@ - $this->nutritional_density_rating, - 'hydration_efficacy_index' => $this->hydration_efficacy_index, - 'container_type' => $this->container_type, - 'one_shot_consume' => $this->one_shot_consume, - 'can_be_reclosed' => $this->can_be_reclosed, - 'discard_when_consumed' => $this->discard_when_consumed, - 'effects' => $this->effects->map(function ($effect) { - return $effect->name; - }), - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemContainerResource.php b/app/Http/Resources/SC/Item/ItemContainerResource.php deleted file mode 100644 index ba9f5a72c..000000000 --- a/app/Http/Resources/SC/Item/ItemContainerResource.php +++ /dev/null @@ -1,54 +0,0 @@ -unit) { - 2 => 'cSCU', - 6 => 'µSCU', - default => 'SCU', - }; - - return [ - 'width' => $this->width, - 'height' => $this->height, - 'length' => $this->length, - 'dimension' => $this->dimension, - 'scu' => $this->calculated_scu, - 'scu_converted' => $this->original_converted_scu, - 'unit' => $unit, - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemDimensionResource.php b/app/Http/Resources/SC/Item/ItemDimensionResource.php deleted file mode 100644 index 120472982..000000000 --- a/app/Http/Resources/SC/Item/ItemDimensionResource.php +++ /dev/null @@ -1,57 +0,0 @@ -dimension; - $trueDim = $this->true_dimension; - $sumDim = $dim->width + $dim->height + $dim->length; - $sumTrueDim = $trueDim->width + $trueDim->height + $trueDim->length; - - return [ - 'width' => $dim->width, - 'height' => $dim->height, - 'length' => $dim->length, - 'volume' => $dim->volume ?? $trueDim->volume, - $this->mergeWhen($sumDim !== $sumTrueDim, [ - 'true_dimension' => [ - 'width' => $trueDim->width, - 'height' => $trueDim->height, - 'length' => $trueDim->length, - ], - ]), - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemDistortionDataResource.php b/app/Http/Resources/SC/Item/ItemDistortionDataResource.php deleted file mode 100644 index 83ae0c173..000000000 --- a/app/Http/Resources/SC/Item/ItemDistortionDataResource.php +++ /dev/null @@ -1,39 +0,0 @@ - $this->decay_delay, - 'decay_rate' => $this->decay_rate, - 'maximum' => $this->maximum, - 'overload_ratio' => $this->overload_ratio, - 'warning_ratio' => $this->warning_ratio, - 'recovery_ratio' => $this->recovery_ratio, - 'recovery_time' => $this->recovery_time, - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemDurabilityDataResource.php b/app/Http/Resources/SC/Item/ItemDurabilityDataResource.php deleted file mode 100644 index 890101ab0..000000000 --- a/app/Http/Resources/SC/Item/ItemDurabilityDataResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->health, - 'max_lifetime' => $this->max_lifetime, - 'repairable' => $this->repairable, - 'salvageable' => $this->salvageable, - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemHeatDataResource.php b/app/Http/Resources/SC/Item/ItemHeatDataResource.php deleted file mode 100644 index c5835737c..000000000 --- a/app/Http/Resources/SC/Item/ItemHeatDataResource.php +++ /dev/null @@ -1,65 +0,0 @@ - $this->temperature_to_ir, - 'ir_temperature_threshold' => $this->ir_temperature_threshold, - 'overpower_heat' => $this->overpower_heat, - 'overclock_threshold_min' => $this->overclock_threshold_min, - 'overclock_threshold_max' => $this->overclock_threshold_max, - 'thermal_energy_base' => $this->thermal_energy_base, - 'thermal_energy_draw' => $this->thermal_energy_draw, - 'thermal_conductivity' => $this->thermal_conductivity, - 'specific_heat_capacity' => $this->specific_heat_capacity, - 'mass' => $this->mass, - 'surface_area' => $this->surface_area, - 'start_cooling_temperature' => $this->start_cooling_temperature, - 'max_cooling_rate' => $this->max_cooling_rate, - 'max_temperature' => $this->max_temperature, - 'min_temperature' => $this->min_temperature, - 'overheat_temperature' => $this->overheat_temperature, - 'recovery_temperature' => $this->recovery_temperature, - 'misfire_min_temperature' => $this->misfire_min_temperature, - 'misfire_max_temperature' => $this->misfire_max_temperature, - 'ir_emission' => $this->infrared_emission, - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemPortResource.php b/app/Http/Resources/SC/Item/ItemPortResource.php deleted file mode 100644 index 28692d56d..000000000 --- a/app/Http/Resources/SC/Item/ItemPortResource.php +++ /dev/null @@ -1,57 +0,0 @@ - $this->name, - 'display_name' => $this->display_name, - 'position' => $this->position, - 'sizes' => [ - 'min' => $this->min_size, - 'max' => $this->max_size, - ], - 'compatible_types' => ItemPortTypeResource::collection($this->compatibleTypes), - 'tags' => $this->defaultTags->pluck('name')->toArray(), - 'required_tags' => $this->requiredTags->pluck('name')->toArray(), - 'equipped_item' => new ItemLinkResource($this->item), - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemPowerDataResource.php b/app/Http/Resources/SC/Item/ItemPowerDataResource.php deleted file mode 100644 index 0cef9951e..000000000 --- a/app/Http/Resources/SC/Item/ItemPowerDataResource.php +++ /dev/null @@ -1,49 +0,0 @@ - $this->power_base, - 'power_draw' => $this->power_draw, - 'throttleable' => $this->throttleable, - 'overclockable' => $this->overclockable, - 'overclock_threshold_min' => $this->overclock_threshold_min, - 'overclock_threshold_max' => $this->overclock_threshold_max, - 'overclock_performance' => $this->overclock_performance, - 'overpower_performance' => $this->overpower_performance, - 'power_to_em' => $this->power_to_em, - 'decay_rate_em' => $this->decay_rate_em, - 'em_min' => $this->min_electromagnetic_emission, - 'em_max' => $this->max_electromagnetic_emission, - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemResource.php b/app/Http/Resources/SC/Item/ItemResource.php deleted file mode 100644 index 6e8c8b25d..000000000 --- a/app/Http/Resources/SC/Item/ItemResource.php +++ /dev/null @@ -1,501 +0,0 @@ -uuid === null) { - return []; - } - - $vehicleItem = $this->vehicleItem; - - // Determine if 'related_items' has been requested via include - $includeParam = $request->query('include'); - $includeValues = []; - if (is_string($includeParam)) { - $includeValues = array_map('trim', explode(',', $includeParam)); - } elseif (is_array($includeParam)) { - $includeValues = $includeParam; - } - $includeRelated = in_array('related_items', $includeValues, true); - - return [ - 'uuid' => $this->uuid, - 'name' => $this->name, - 'class_name' => $this->class_name, - 'description' => $this->getTranslation($this, $request), - 'size' => $this->size, - 'mass' => $this->mass, - 'is_base_variant' => $this->base_id === null, - $this->mergeWhen($vehicleItem !== null || $vehicleItem->exists, [ - 'grade' => $vehicleItem->grade, - 'class' => $vehicleItem->class, - ]), - 'description_data' => ItemDescriptionDataResource::collection($this->whenLoaded('descriptionData')), - 'manufacturer_description' => $this->getDescriptionDatum('Manufacturer'), - 'manufacturer' => new ManufacturerLinkResource($this->manufacturer), - 'type' => $this->cleanType(), - 'sub_type' => $this->sub_type, - $this->mergeWhen(...$this->addAttachmentPosition()), - $this->mergeWhen($this->isTurret(), $this->addTurretData()), - $this->mergeWhen(...$this->addSpecification()), - 'dimension' => new ItemDimensionResource($this), - $this->mergeWhen($this->container->exists, [ - 'inventory' => new ItemContainerResource($this->container), - ]), - 'tags' => $this->defaultTags->pluck('name')->toArray(), - 'required_tags' => $this->requiredTags->pluck('name')->toArray(), - 'entity_tags' => $this->entityTags->pluck('tag')->toArray(), - 'interactions' => $this->interactions->pluck('name')->toArray(), - 'ports' => ItemPortResource::collection($this->whenLoaded('ports')), - $this->mergeWhen($this->relationLoaded('heatData'), [ - 'heat' => new ItemHeatDataResource($this->heatData), - ]), - $this->mergeWhen($this->relationLoaded('powerData'), [ - 'power' => new ItemPowerDataResource($this->powerData), - ]), - $this->mergeWhen($this->relationLoaded('distortionData'), [ - 'distortion' => new ItemDistortionDataResource($this->distortionData), - ]), - $this->mergeWhen($this->relationLoaded('durabilityData'), [ - 'durability' => new ItemDurabilityDataResource($this->durabilityData), - ]), - $this->mergeWhen($this->type === 'WeaponAttachment', [ - 'weapon_modifier' => new ItemWeaponModifierDataResource($this->weaponModifierData), - ]), - 'shops' => ShopResource::collection($this->whenLoaded('shops')), - $this->mergeWhen($this->base_id !== null, [ - 'base_variant' => new ItemLinkResource($this->baseVariant), - ]), - 'variants' => ItemLinkResource::collection($this->whenLoaded('variants')), - $this->mergeWhen($includeRelated, [ - 'related_items' => (new RelatedItemsBuilder)->build($this->resource), - ]), - 'updated_at' => $this->updated_at, - 'version' => $this->version, - ]; - } - - protected function addSpecification(): array - { - $specification = $this?->specification; - if (! $specification?->exists || $specification === null) { - return [false, []]; - } - - return match (true) { - $this->type === 'Armor' => [ - $specification->exists, - fn () => ['emp' => new ArmorResource($specification)], - ], - $this->type === 'Bomb' => [ - $specification->exists, - fn () => ['bomb' => new BombResource($specification)], - ], - $this->type === 'Cooler' => [ - $specification->exists, - fn () => ['cooler' => new CoolerResource($specification)], - ], - str_contains($this->type, 'Char_Clothing'), str_contains($this->type, 'Char_Armor') => [ - $specification->exists, - fn () => ['clothing' => new ClothingResource($specification)], - ], - $this->type === 'EMP' => [ - $specification->exists, - fn () => ['emp' => new EmpResource($specification)], - ], - $this->type === 'Food', $this->type === 'Bottle', $this->type === 'Drink' => [ - $specification->exists, - fn () => ['food' => new FoodResource($specification)], - ], - $this->type === 'FlightController' => [ - $specification->exists, - fn () => ['flight_controller' => new FlightControllerResource($specification)], - ], - $this->type === 'FuelTank', $this->type === 'QuantumFuelTank', $this->type === 'ExternalFuelTank' => [ - $specification->exists, - fn () => ['fuel_tank' => new FuelTankResource($specification)], - ], - $this->type === 'FuelIntake' => [ - $specification->exists, - fn () => ['fuel_intake' => new FuelIntakeResource($specification)], - ], - $this->sub_type === 'Hacking' => [ - $specification->exists, - fn () => ['hacking_chip' => new HackingChipResource($specification)], - ], - $this->type === 'MainThruster', $this->type === 'ManneuverThruster' => [ - $specification->exists, - fn () => ['thruster' => new ThrusterResource($specification)], - ], - $this->sub_type === 'Magazine' => [ - $specification->exists, - fn () => ['personal_weapon_magazine' => new PersonalWeaponMagazineResource($specification)], - ], - $this->type === 'Missile', $this->type === 'Torpedo' => [ - $specification->exists, - fn () => ['missile' => new MissileResource($specification)], - ], - $this->type === 'MiningModifier' => [ - $specification->exists, - fn () => ['mining_module' => new MiningModuleResource($specification)], - ], - $this->type === 'PowerPlant' => [ - $specification->exists, - fn () => ['power_plant' => new PowerPlantResource($specification)], - ], - $this->type === 'QuantumInterdictionGenerator' => [ - $specification->exists, - fn () => ['quantum_interdiction_generator' => new QuantumInterdictionGeneratorResource($specification)], - ], - $this->type === 'QuantumDrive' => [ - $specification->exists, - fn () => ['quantum_drive' => new QuantumDriveResource($specification)], - ], - $this->type === 'SalvageModifier' => [ - $specification->exists, - fn () => ['salvage_modifier' => new SalvageModifierResource($specification)], - ], - $this->type === 'SelfDestruct' => [ - $specification->exists, - fn () => ['self_destruct' => new SelfDestructResource($specification)], - ], - $this->type === 'Shield' => [ - $specification->exists, - fn () => ['shield' => new ShieldResource($specification)], - ], - $this->type === 'TractorBeam' || $this->type === 'TowingBeam' => [ - $specification->exists, - fn () => ['tractor_beam' => new TractorBeamResource($specification)], - ], - $this->type === 'WeaponPersonal' && $this->sub_type === 'Grenade' => [ - $specification->exists, - fn () => ['grenade' => new GrenadeResource($specification)], - ], - $this->type === 'WeaponPersonal' && $this->sub_type === 'Knife' => [ - $specification->exists, - fn () => ['knife' => new KnifeResource($specification)], - ], - $this->type === 'WeaponPersonal' => [ - $specification->exists, - fn () => ['personal_weapon' => new PersonalWeaponResource($specification)], - ], - $this->sub_type === 'IronSight' => [ - $specification->exists, - fn () => ['iron_sight' => new IronSightResource($specification)], - ], - $this->type === 'WeaponAttachment' && in_array($this->sub_type, ['Barrel', 'BottomAttachment', 'Utility'], true) => [ - $specification->exists, - fn () => ['barrel_attach' => new BarrelAttachResource($specification)], - ], - $this->type === 'WeaponGun', $this->type === 'WeaponDefensive' => [ - $specification->exists, - fn () => [($this->type === 'WeaponGun' ? - 'vehicle_weapon' : - 'counter_measure') => new VehicleWeaponResource($specification), ], - ], - $this->type === 'WeaponMining' => [ - $specification->exists, - fn () => ['mining_laser' => new MiningLaserResource($specification)], - ], - default => [false, []], - }; - } - - protected function addTurretData(): array - { - $mountName = 'max_mounts'; - if ($this->type === 'MissileLauncher') { - $mountName = 'max_missiles'; - } elseif ($this->type === 'BombLauncher') { - $mountName = 'max_bombs'; - } - - $ports = $this->ports; - - return [ - $mountName => $ports->count(), - 'min_size' => $ports->min('min_size'), - 'max_size' => $ports->max('max_size'), - ]; - } - - private function addAttachmentPosition(): array - { - if ($this->type !== 'WeaponAttachment' || $this->name === '<= PLACEHOLDER =>') { - return [false, []]; - } - - return [ - true, - fn () => [ - 'position' => match ($this->sub_type) { - 'Magazine' => 'Magazine Well', - 'Barrel' => 'Barrel', - 'IronSight' => 'Optic', - 'Utility' => 'Utility', - 'BottomAttachment' => 'Underbarrel', - default => $this->sub_type, - }, - ], - ]; - } -} diff --git a/app/Http/Resources/SC/Item/ItemWeaponModifierDataResource.php b/app/Http/Resources/SC/Item/ItemWeaponModifierDataResource.php deleted file mode 100644 index 2b551b392..000000000 --- a/app/Http/Resources/SC/Item/ItemWeaponModifierDataResource.php +++ /dev/null @@ -1,135 +0,0 @@ - $this->fire_rate_multiplier, - 'damage_multiplier' => $this->damage_multiplier, - 'damage_over_time_multiplier' => $this->damage_over_time_multiplier, - 'projectile_speed_multiplier' => $this->projectile_speed_multiplier, - 'ammo_cost_multiplier' => $this->ammo_cost_multiplier, - 'heat_generation_multiplier' => $this->heat_generation_multiplier, - 'sound_radius_multiplier' => $this->sound_radius_multiplier, - 'charge_time_multiplier' => $this->charge_time_multiplier, - 'recoil' => array_filter([ - 'decay_multiplier' => $this->recoil_decay_multiplier, - 'end_decay_multiplier' => $this->recoil_end_decay_multiplier, - 'fire_recoil_time_multiplier' => $this->recoil_fire_recoil_time_multiplier, - 'fire_recoil_strength_first_multiplier' => $this->recoil_fire_recoil_strength_first_multiplier, - 'fire_recoil_strength_multiplier' => $this->recoil_fire_recoil_strength_multiplier, - 'angle_recoil_strength_multiplier' => $this->recoil_angle_recoil_strength_multiplier, - 'randomness_multiplier' => $this->recoil_randomness_multiplier, - 'randomness_back_push_multiplier' => $this->recoil_randomness_back_push_multiplier, - 'frontal_oscillation_rotation_multiplier' => $this->recoil_frontal_oscillation_rotation_multiplier, - 'frontal_oscillation_strength_multiplier' => $this->recoil_frontal_oscillation_strength_multiplier, - 'frontal_oscillation_decay_multiplier' => $this->recoil_frontal_oscillation_decay_multiplier, - 'frontal_oscillation_randomness_multiplier' => $this->recoil_frontal_oscillation_randomness_multiplier, - 'animated_recoil_multiplier' => $this->recoil_animated_recoil_multiplier, - ]), - 'spread' => array_filter([ - 'min_multiplier' => $this->spread_min_multiplier, - 'max_multiplier' => $this->spread_max_multiplier, - 'first_attack_multiplier' => $this->spread_first_attack_multiplier, - 'attack_multiplier' => $this->spread_attack_multiplier, - 'decay_multiplier' => $this->spread_decay_multiplier, - 'additive_modifier' => $this->spread_additive_modifier, - ]), - 'aim' => array_filter([ - 'zoom_scale' => $this->aim_zoom_scale, - 'zoom_time_scale' => $this->aim_zoom_time_scale, - ]), - 'salvage' => array_filter([ - 'salvage_speed_multiplier' => $this->spread_salvage_speed_multiplier, - 'radius_multiplier' => $this->salvage_radius_multiplier, - 'extraction_efficiency' => $this->salvage_extraction_efficiency, - ]), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/ArmorResource.php b/app/Http/Resources/SC/ItemSpecification/ArmorResource.php deleted file mode 100644 index 81ddcb3d8..000000000 --- a/app/Http/Resources/SC/ItemSpecification/ArmorResource.php +++ /dev/null @@ -1,44 +0,0 @@ - $this->signal_infrared, - 'signal_electromagnetic' => $this->signal_electromagnetic, - 'signal_cross_section' => $this->signal_cross_section, - 'damage_physical' => $this->damage_physical, - 'damage_energy' => $this->damage_energy, - 'damage_distortion' => $this->damage_distortion, - 'damage_thermal' => $this->damage_thermal, - 'damage_biochemical' => $this->damage_biochemical, - 'damage_stun' => $this->damage_stun, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/BombResource.php b/app/Http/Resources/SC/ItemSpecification/BombResource.php deleted file mode 100644 index 7a652bace..000000000 --- a/app/Http/Resources/SC/ItemSpecification/BombResource.php +++ /dev/null @@ -1,46 +0,0 @@ - $this->arm_time, - 'ignite_time' => $this->ignite_time, - 'collision_delay_time' => $this->collision_delay_time, - 'explosion_safety_distance' => $this->explosion_safety_distance, - 'explosion_radius_min' => $this->explosion_radius_min, - 'explosion_radius_max' => $this->explosion_radius_max, - 'damage' => $this->damage ?? 0, - 'damages' => WeaponDamageResource::collection($this->whenLoaded('damages')), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/CoolerResource.php b/app/Http/Resources/SC/ItemSpecification/CoolerResource.php deleted file mode 100644 index 78451f677..000000000 --- a/app/Http/Resources/SC/ItemSpecification/CoolerResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->cooling_rate, - 'suppression_ir_factor' => $this->suppression_ir_factor, - 'suppression_heat_factor' => $this->suppression_heat_factor, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/EmpResource.php b/app/Http/Resources/SC/ItemSpecification/EmpResource.php deleted file mode 100644 index f5a100a88..000000000 --- a/app/Http/Resources/SC/ItemSpecification/EmpResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->charge_duration, - 'emp_radius' => $this->emp_radius, - 'unleash_duration' => $this->unleash_duration, - 'cooldown_duration' => $this->cooldown_duration, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/FlightControllerResource.php b/app/Http/Resources/SC/ItemSpecification/FlightControllerResource.php deleted file mode 100644 index 127814e80..000000000 --- a/app/Http/Resources/SC/ItemSpecification/FlightControllerResource.php +++ /dev/null @@ -1,35 +0,0 @@ - $this->scm_speed, - 'max_speed' => $this->max_speed, - 'pitch' => $this->pitch, - 'yaw' => $this->yaw, - 'roll' => $this->roll, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/FuelIntakeResource.php b/app/Http/Resources/SC/ItemSpecification/FuelIntakeResource.php deleted file mode 100644 index b4ec834b8..000000000 --- a/app/Http/Resources/SC/ItemSpecification/FuelIntakeResource.php +++ /dev/null @@ -1,29 +0,0 @@ - $this->fuel_push_rate, - 'minimum_rate' => $this->minimum_rate, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/FuelTankResource.php b/app/Http/Resources/SC/ItemSpecification/FuelTankResource.php deleted file mode 100644 index e8463a028..000000000 --- a/app/Http/Resources/SC/ItemSpecification/FuelTankResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->fill_rate, - 'drain_rate' => $this->drain_rate, - 'capacity' => $this->capacity, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/HackingChipResource.php b/app/Http/Resources/SC/ItemSpecification/HackingChipResource.php deleted file mode 100644 index ee6343751..000000000 --- a/app/Http/Resources/SC/ItemSpecification/HackingChipResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->max_charges, - 'duration_multiplier' => $this->duration_multiplier, - 'error_chance' => $this->error_chance, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserModifierResource.php b/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserModifierResource.php deleted file mode 100644 index eaae546ed..000000000 --- a/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserModifierResource.php +++ /dev/null @@ -1,31 +0,0 @@ - Str::snake($this->name), - 'display_name' => $this->name, - 'value' => $this->value, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserResource.php b/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserResource.php deleted file mode 100644 index 13316e266..000000000 --- a/app/Http/Resources/SC/ItemSpecification/MiningLaser/MiningLaserResource.php +++ /dev/null @@ -1,74 +0,0 @@ - $this->power_transfer, - 'optimal_range' => $this->optimal_range, - 'maximum_range' => $this->maximum_range, - 'extraction_throughput' => $this->extraction_throughput, - 'module_slots' => $this->module_slots, - 'extraction_laser_power' => $this->extraction_laser_power, - 'mining_laser_power' => $this->mining_laser_power, - 'modifiers' => MiningLaserModifierResource::collection($this->modifiers), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/MiningModuleResource.php b/app/Http/Resources/SC/ItemSpecification/MiningModuleResource.php deleted file mode 100644 index edaf7ac3f..000000000 --- a/app/Http/Resources/SC/ItemSpecification/MiningModuleResource.php +++ /dev/null @@ -1,38 +0,0 @@ - $this->getDescriptionDatum('Item Type'), - 'uses' => (int) $this->uses, - 'duration' => $this->duration, - 'modifiers' => MiningLaserModifierResource::collection($this->modifiers), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/MissileResource.php b/app/Http/Resources/SC/ItemSpecification/MissileResource.php deleted file mode 100644 index b9a91da28..000000000 --- a/app/Http/Resources/SC/ItemSpecification/MissileResource.php +++ /dev/null @@ -1,56 +0,0 @@ - $this->cluster_size, - 'signal_type' => $this->getDescriptionDatum('Tracking Signal'), - 'lock_time' => $this->lock_time, - 'lock_range_max' => $this->lock_range_max, - 'lock_range_min' => $this->lock_range_min, - 'lock_angle' => $this->lock_angle, - 'tracking_signal_min' => $this->tracking_signal_min, - 'speed' => $this->speed, - 'fuel_tank_size' => $this->fuel_tank_size, - 'explosion_radius_min' => $this->explosion_radius_min, - 'explosion_radius_max' => $this->explosion_radius_max, - 'damage_total' => $this->damage ?? 0, - 'damages' => WeaponDamageResource::collection($this->whenLoaded('damages')), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/PowerPlantResource.php b/app/Http/Resources/SC/ItemSpecification/PowerPlantResource.php deleted file mode 100644 index 724c5fd0c..000000000 --- a/app/Http/Resources/SC/ItemSpecification/PowerPlantResource.php +++ /dev/null @@ -1,27 +0,0 @@ - $this->power_output, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveModeResource.php b/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveModeResource.php deleted file mode 100644 index 0d98831fa..000000000 --- a/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveModeResource.php +++ /dev/null @@ -1,51 +0,0 @@ - sprintf('%s_jump', $this->type), - 'drive_speed' => $this->drive_speed, - 'cooldown_time' => $this->cooldown_time, - 'stage_one_accel_rate' => $this->stage_one_accel_rate, - 'stage_two_accel_rate' => $this->stage_two_accel_rate, - 'engage_speed' => $this->engage_speed, - 'interdiction_effect_time' => $this->interdiction_effect_time, - 'calibration_rate' => $this->calibration_rate, - 'min_calibration_requirement' => $this->min_calibration_requirement, - 'max_calibration_requirement' => $this->max_calibration_requirement, - 'calibration_process_angle_limit' => $this->calibration_process_angle_limit, - 'calibration_warning_angle_limit' => $this->calibration_warning_angle_limit, - 'spool_up_time' => $this->spool_up_time, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveResource.php b/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveResource.php deleted file mode 100644 index dd9075403..000000000 --- a/app/Http/Resources/SC/ItemSpecification/QuantumDrive/QuantumDriveResource.php +++ /dev/null @@ -1,51 +0,0 @@ - $this->quantum_fuel_requirement, - 'jump_range' => $this->jump_range, - 'disconnect_range' => $this->disconnect_range, - 'thermal_energy_draw' => [ - 'pre_ramp_up' => $this->pre_ramp_up_thermal_energy_draw, - 'ramp_up' => $this->ramp_up_thermal_energy_draw, - 'in_flight' => $this->in_flight_thermal_energy_draw, - 'ramp_down' => $this->ramp_down_thermal_energy_draw, - 'post_ramp_down' => $this->post_ramp_down_thermal_energy_draw, - ], - 'modes' => QuantumDriveModeResource::collection($this->modes), - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/QuantumInterdictionGeneratorResource.php b/app/Http/Resources/SC/ItemSpecification/QuantumInterdictionGeneratorResource.php deleted file mode 100644 index d3440f6a5..000000000 --- a/app/Http/Resources/SC/ItemSpecification/QuantumInterdictionGeneratorResource.php +++ /dev/null @@ -1,35 +0,0 @@ - $this->jammer_range, - 'interdiction_range' => $this->interdiction_range, - 'charge_duration' => $this->charge_duration, - 'discharge_duration' => $this->discharge_duration, - 'cooldown_duration' => $this->cooldown_duration, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/SalvageModifierResource.php b/app/Http/Resources/SC/ItemSpecification/SalvageModifierResource.php deleted file mode 100644 index fe9295a4d..000000000 --- a/app/Http/Resources/SC/ItemSpecification/SalvageModifierResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->salvage_speed_multiplier, - 'radius_multiplier' => $this->radius_multiplier, - 'extraction_efficiency' => $this->extraction_efficiency, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/SelfDestructResource.php b/app/Http/Resources/SC/ItemSpecification/SelfDestructResource.php deleted file mode 100644 index 807ccb062..000000000 --- a/app/Http/Resources/SC/ItemSpecification/SelfDestructResource.php +++ /dev/null @@ -1,37 +0,0 @@ - $this->damage, - 'radius' => $this->radius, - 'min_radius' => $this->min_radius, - 'phys_radius' => $this->phys_radius, - 'min_phys_radius' => $this->min_phys_radius, - 'time' => $this->time, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/ShieldResource.php b/app/Http/Resources/SC/ItemSpecification/ShieldResource.php deleted file mode 100644 index f9a1d5f6a..000000000 --- a/app/Http/Resources/SC/ItemSpecification/ShieldResource.php +++ /dev/null @@ -1,39 +0,0 @@ - $this->max_shield_health, - 'max_shield_regen' => $this->max_shield_regen, - 'decay_ratio' => $this->decay_ratio, - 'regen_delay' => [ - 'downed' => $this->downed_regen_delay, - 'damage' => $this->damage_regen_delay, - ], - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/ThrusterResource.php b/app/Http/Resources/SC/ItemSpecification/ThrusterResource.php deleted file mode 100644 index 0bdcc4163..000000000 --- a/app/Http/Resources/SC/ItemSpecification/ThrusterResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->thrust_capacity, - 'min_health_thrust_multiplier' => $this->min_health_thrust_multiplier, - 'fuel_burn_per_10k_newton' => $this->fuel_burn_per_10k_newton, - 'type' => $this->type, - ]; - } -} diff --git a/app/Http/Resources/SC/ItemSpecification/TractorBeamResource.php b/app/Http/Resources/SC/ItemSpecification/TractorBeamResource.php deleted file mode 100644 index 60fa7041b..000000000 --- a/app/Http/Resources/SC/ItemSpecification/TractorBeamResource.php +++ /dev/null @@ -1,45 +0,0 @@ - $this->min_force, - 'max_force' => $this->max_force, - 'min_distance' => $this->min_distance, - 'max_distance' => $this->max_distance, - 'full_strength_distance' => $this->full_strength_distance, - 'max_angle' => $this->max_angle, - 'max_volume' => $this->max_volume, - 'volume_force_coefficient' => $this->volume_force_coefficient, - 'tether_break_time' => $this->tether_break_time, - 'safe_range_value_factor' => $this->safe_range_value_factor, - ]; - } -} diff --git a/app/Http/Resources/SC/Manufacturer/ManufacturerLinkResource.php b/app/Http/Resources/SC/Manufacturer/ManufacturerLinkResource.php deleted file mode 100644 index 8444db89d..000000000 --- a/app/Http/Resources/SC/Manufacturer/ManufacturerLinkResource.php +++ /dev/null @@ -1,47 +0,0 @@ -get('include', ''); - if (empty($include)) { - $include = ''; - } - - return [ - 'name' => $this->name, - 'code' => $this->code, - 'link' => $this->makeApiUrl(self::MANUFACTURERS_SHOW, urlencode($this->name)), - $this->mergeWhen(str_contains($include, 'counts'), fn () => [ - 'ships_count' => $this->shipsCount(), - 'vehicles_count' => $this->groundVehiclesCount(), - 'items_count' => $this->itemsCount(), - ]), - ]; - } -} diff --git a/app/Http/Resources/SC/MeleeCombatConfig/MeleeCombatConfigResource.php b/app/Http/Resources/SC/MeleeCombatConfig/MeleeCombatConfigResource.php deleted file mode 100644 index cd4ec45e7..000000000 --- a/app/Http/Resources/SC/MeleeCombatConfig/MeleeCombatConfigResource.php +++ /dev/null @@ -1,49 +0,0 @@ - $this->category, - 'damage' => $this->damage, - 'stun_recovery_modifier' => $this->stun_recovery_modifier, - 'block_stun_reduction_modifier' => $this->block_stun_reduction_modifier, - 'block_stun_stamina_modifier' => $this->block_stun_stamina_modifier, - 'attack_impulse' => $this->attack_impulse, - 'ignore_body_part_impulse_scale' => $this->ignore_body_part_impulse_scale, - 'fullbody_animation' => $this->fullbody_animation, - 'damages' => MeleeDamageResource::collection($this->damages), - ]; - } -} diff --git a/app/Http/Resources/SC/MeleeCombatConfig/MeleeDamageResource.php b/app/Http/Resources/SC/MeleeCombatConfig/MeleeDamageResource.php deleted file mode 100644 index 177115e32..000000000 --- a/app/Http/Resources/SC/MeleeCombatConfig/MeleeDamageResource.php +++ /dev/null @@ -1,30 +0,0 @@ - $this->name, - 'damage' => $this->damage, - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/DeadlineResource.php b/app/Http/Resources/SC/Mission/DeadlineResource.php deleted file mode 100644 index 7101ef89f..000000000 --- a/app/Http/Resources/SC/Mission/DeadlineResource.php +++ /dev/null @@ -1,31 +0,0 @@ - $this->mission_completion_time, - 'mission_auto_end' => $this->mission_auto_end, - 'mission_result_after_timer_end' => $this->mission_result_after_timer_end, - 'mission_end_reason' => $this->mission_end_reason, - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/GiverLinkResource.php b/app/Http/Resources/SC/Mission/GiverLinkResource.php deleted file mode 100644 index 2490df63f..000000000 --- a/app/Http/Resources/SC/Mission/GiverLinkResource.php +++ /dev/null @@ -1,29 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'link' => $this->makeApiUrl(self::MISSION_GIVERS_SHOW, $this->uuid), - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/GiverResource.php b/app/Http/Resources/SC/Mission/GiverResource.php deleted file mode 100644 index 3e5c30991..000000000 --- a/app/Http/Resources/SC/Mission/GiverResource.php +++ /dev/null @@ -1,58 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'headquarters' => $this->headquarters, - 'invitation_timeout' => $this->invitation_timeout, - 'visit_timeout' => $this->visit_timeout, - 'short_cooldown' => $this->short_cooldown, - 'medium_cooldown' => $this->medium_cooldown, - 'long_cooldown' => $this->long_cooldown, - 'description' => $this->getTranslation($this, $request), - 'missions' => $this->whenLoaded('missions', fn () => MissionLinkResource::collection($this->missions)), - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/MissionLinkResource.php b/app/Http/Resources/SC/Mission/MissionLinkResource.php deleted file mode 100644 index d6f9258a5..000000000 --- a/app/Http/Resources/SC/Mission/MissionLinkResource.php +++ /dev/null @@ -1,29 +0,0 @@ - $this->uuid, - 'title' => $this->titleHUD ?? $this->title, - 'link' => $this->makeApiUrl(self::MISSIONS_SHOW, $this->uuid), - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/MissionResource.php b/app/Http/Resources/SC/Mission/MissionResource.php deleted file mode 100644 index f38ca6d5f..000000000 --- a/app/Http/Resources/SC/Mission/MissionResource.php +++ /dev/null @@ -1,140 +0,0 @@ - $this->uuid, - 'not_for_release' => $this->not_for_release, - 'title' => $this->title, - 'title_hud' => $this->title_hud, - 'description' => $this->getTranslation($this, $request), - 'mission_giver' => $this->mission_giver, - $this->mergeWhen($this->giver->uuid !== null, [ - 'mission_giver_record' => new GiverResource($this->giver), - ]), - 'comms_channel_name' => $this->comms_channel_name, - 'type' => $this->type->name, - 'locality_available' => $this->locality_available, - 'location_mission_available' => $this->location_mission_available, - 'initially_active' => $this->initially_active, - 'notify_on_available' => $this->notify_on_available, - 'show_as_offer' => $this->show_as_offer, - 'mission_buy_in_amount' => $this->mission_buy_in_amount, - 'refund_buy_in_on_withdraw' => $this->refund_buy_in_on_withdraw, - 'has_complete_button' => $this->has_complete_button, - 'handles_abandon_request' => $this->handles_abandon_request, - 'mission_module_per_player' => $this->mission_module_per_player, - 'max_instances' => $this->max_instances, - 'max_players_per_instance' => $this->max_players_per_instance, - 'max_instances_per_player' => $this->max_instances_per_player, - 'can_be_shared' => $this->can_be_shared, - 'once_only' => $this->once_only, - 'tutorial' => $this->tutorial, - 'display_allied_markers' => $this->display_allied_markers, - 'available_in_prison' => $this->available_in_prison, - 'fail_if_sent_to_prison' => $this->fail_if_sent_to_prison, - 'fail_if_became_criminal' => $this->fail_if_became_criminal, - 'fail_if_leave_prison' => $this->fail_if_leave_prison, - 'request_only' => $this->request_only, - 'respawn_time' => $this->respawn_time, - 'respawn_time_variation' => $this->respawn_time_variation, - 'instance_has_life_time' => $this->instance_has_life_time, - 'show_life_time_in_mobi_glas' => $this->show_life_time_in_mobi_glas, - 'instance_life_time' => $this->instance_life_time, - 'instance_life_time_variation' => $this->instance_life_time_variation, - 'can_reaccept_after_abandoning' => $this->can_reaccept_after_abandoning, - 'abandoned_cooldown_time' => $this->abandoned_cooldown_time, - 'abandoned_cooldown_time_variation' => $this->abandoned_cooldown_time_variation, - 'can_reaccept_after_failing' => $this->can_reaccept_after_failing, - 'has_personal_cooldown' => $this->has_personal_cooldown, - 'personal_cooldown_time' => $this->personal_cooldown_time, - 'personal_cooldown_time_variation' => $this->personal_cooldown_time_variation, - 'module_handles_own_shutdown' => $this->module_handles_own_shutdown, - 'linked_mission' => $this->makeApiUrl(self::MISSIONS_SHOW, $this->linked_mission), - 'lawful_mission' => $this->lawful_mission, - 'deadline' => DeadlineResource::make($this->deadline)->resolve($request), - 'reward' => RewardResource::make($this->reward)->resolve($request), - 'invitation_mission' => $this->invitation_mission, - 'associated_missions' => MissionLinkResource::collection($this->associatedMissions), - 'required_missions' => MissionLinkResource::collection($this->requiredMissions), - 'version' => $this->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Mission/RewardResource.php b/app/Http/Resources/SC/Mission/RewardResource.php deleted file mode 100644 index cdda51108..000000000 --- a/app/Http/Resources/SC/Mission/RewardResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->amount, - 'max' => $this->max, - 'plus_bonuses' => $this->plus_bonuses, - 'currency' => $this->currency, - 'reputation_bonus' => $this->reputation_bonus, - ]; - } -} diff --git a/app/Http/Resources/SC/Shop/ShopItemResource.php b/app/Http/Resources/SC/Shop/ShopItemResource.php deleted file mode 100644 index 786983f16..000000000 --- a/app/Http/Resources/SC/Shop/ShopItemResource.php +++ /dev/null @@ -1,85 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'type' => $this->cleanType(), - 'sub_type' => $this->sub_type, - 'base_price' => $this->shop_data->base_price, - 'price_calculated' => $this->shop_data->offsetted_price, - 'price_range' => $this->shop_data->price_range, - 'base_price_offset' => $this->shop_data->base_price_offset, - 'max_discount' => $this->shop_data->max_discount, - 'max_premium' => $this->shop_data->max_premium, - 'inventory' => $this->shop_data->inventory, - 'optimal_inventory' => $this->shop_data->optimal_inventory, - 'max_inventory' => $this->shop_data->max_inventory, - 'auto_restock' => $this->shop_data->auto_restock, - 'auto_consume' => $this->shop_data->auto_consume, - 'refresh_rate' => $this->shop_data->refresh_rate, - 'buyable' => $this->shop_data->buyable, - 'sellable' => $this->shop_data->sellable, - 'rentable' => $this->shop_data->rentable, - $this->mergeWhen($this->shop_data->rentable === true, [ - 'rental_price_days' => [ - 'duration_1' => $this->shop_data->price1, - 'duration_3' => $this->shop_data->price3, - 'duration_7' => $this->shop_data->price7, - 'duration_30' => $this->shop_data->price30, - ], - 'rental_percent_days' => [ - 'duration_1' => $this->shop_data->rental->percentage_1, - 'duration_3' => $this->shop_data->rental->percentage_3, - 'duration_7' => $this->shop_data->rental->percentage_7, - 'duration_30' => $this->shop_data->rental->percentage_30, - ], - ]), - 'version' => $this->shop_data->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Shop/ShopLinkResource.php b/app/Http/Resources/SC/Shop/ShopLinkResource.php deleted file mode 100644 index 55cf90dea..000000000 --- a/app/Http/Resources/SC/Shop/ShopLinkResource.php +++ /dev/null @@ -1,40 +0,0 @@ - $this->uuid, - 'name_raw' => $this->name_raw, - 'name' => $this->name, - 'position' => $this->position, - 'profit_margin' => $this->profit_margin, - 'link' => $this->makeApiUrl(self::SHOPS_SHOW, $this->uuid), - 'version' => $this->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Shop/ShopResource.php b/app/Http/Resources/SC/Shop/ShopResource.php deleted file mode 100644 index 807552b68..000000000 --- a/app/Http/Resources/SC/Shop/ShopResource.php +++ /dev/null @@ -1,57 +0,0 @@ -whenLoaded('items'); - if (optional($this->shop_data)->exists) { - $items = $this->items()->where('uuid', $this->shop_data->item_uuid)->get(); - } - - return [ - 'uuid' => $this->uuid, - 'name_raw' => $this->name_raw, - 'name' => $this->name, - 'position' => $this->position, - 'profit_margin' => $this->profit_margin, - 'link' => $this->makeApiUrl(self::SHOPS_SHOW, $this->uuid), - 'version' => $this->version, - 'items' => ShopItemResource::collection($items), - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/HardpointItemResource.php b/app/Http/Resources/SC/Vehicle/HardpointItemResource.php deleted file mode 100644 index 5fed46816..000000000 --- a/app/Http/Resources/SC/Vehicle/HardpointItemResource.php +++ /dev/null @@ -1,79 +0,0 @@ -uuid === null) { - return []; - } - - $vehicleItem = $this->vehicleItem; - - return [ - 'uuid' => $this->uuid, - 'name' => $this->name, - 'class_name' => $this->class_name, - 'link' => $this->makeApiUrl(self::ITEMS_SHOW, $this->uuid), - 'size' => $this->size, - 'mass' => $this->mass, - 'grade' => $vehicleItem->grade, - 'class' => $vehicleItem->class, - 'manufacturer' => new ManufacturerLinkResource($this->manufacturer), - 'type' => $this->cleanType(), - 'sub_type' => $this->sub_type, - $this->mergeWhen($this->isTurret(), fn () => $this->addTurretData()), - $this->mergeWhen(...$this->addSpecification()), - $this->mergeWhen($this->container->exists, fn () => [ - 'inventory' => new ItemContainerResource($this->container), - ]), - 'ports' => ItemPortResource::collection($this->whenLoaded('ports')), - 'updated_at' => $this->updated_at, - 'version' => $this->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/HardpointItemResourceV3.php b/app/Http/Resources/SC/Vehicle/HardpointItemResourceV3.php deleted file mode 100644 index f9a3541e2..000000000 --- a/app/Http/Resources/SC/Vehicle/HardpointItemResourceV3.php +++ /dev/null @@ -1,79 +0,0 @@ -uuid === null) { - return []; - } - - $vehicleItem = $this->vehicleItem; - - return [ - 'uuid' => $this->uuid, - 'name' => $this->name, - 'class_name' => $this->class_name, - 'link' => $this->makeApiUrl(self::ITEMS_SHOW, $this->uuid), - 'size' => $this->size, - 'mass' => $this->mass, - 'grade' => $vehicleItem->grade, - 'class' => $vehicleItem->class, - 'manufacturer' => new ManufacturerLinkResource($this->manufacturer), - 'type' => $this->cleanType(), - 'sub_type' => $this->sub_type, - $this->mergeWhen($this->isTurret(), fn () => $this->addTurretData()), - $this->mergeWhen(...$this->addSpecification()), - $this->mergeWhen($this->container->exists, fn () => [ - 'inventory' => new ItemContainerResource($this->container), - ]), - 'ports' => ItemPortResource::collection($this->whenLoaded('ports')), - 'updated_at' => $this->updated_at, - 'version' => $this->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/HardpointResource.php b/app/Http/Resources/SC/Vehicle/HardpointResource.php deleted file mode 100644 index 505ed50e0..000000000 --- a/app/Http/Resources/SC/Vehicle/HardpointResource.php +++ /dev/null @@ -1,101 +0,0 @@ -equipped_item_uuid); - - if ($hasItem) { - $this->load('item'); - } - - $data = [ - 'name' => $this->hardpoint_name, - 'position' => $this->position, - 'min_size' => $this->min_size, - 'max_size' => $this->max_size, - 'class_name' => $this->class_name, - 'health' => $hasItem ? $this->item?->durabilityData?->health : null, - 'type' => $hasItem ? $this->item?->type : null, - 'sub_type' => $hasItem ? $this->item?->sub_type : null, - $this->mergeWhen(...$this->addItem()), - $this->mergeWhen($this->children !== null && $this->children->count() > 0, fn () => [ - 'children' => self::collection($this->children), - ]), - ]; - - if ($hasItem) { - $data += [ - 'type' => $this->item->type, - 'sub_type' => $this->item->sub_type, - ]; - - if ($this->min_size === 0) { - $data['min_size'] = $this->item->size; - $data['max_size'] = $this->item->size; - } - } - - return $data; - } - - private function addItem(): array - { - if (empty($this->equipped_item_uuid)) { - return [false, []]; - } - - if ( - $this->vehicleItem->exists || - ($this->item !== null && ($this->item->exists || $this->item->isTurret() || $this->item->type === 'Cargo')) - ) { - return [true, fn () => ['item' => new HardpointItemResource($this->item)]]; - } - - return [false, []]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/HardpointResourceV3.php b/app/Http/Resources/SC/Vehicle/HardpointResourceV3.php deleted file mode 100644 index 0a2b684c9..000000000 --- a/app/Http/Resources/SC/Vehicle/HardpointResourceV3.php +++ /dev/null @@ -1,103 +0,0 @@ -equipped_item_uuid); - - if ($hasItem) { - $this->load('item'); - } - - $data = [ - 'name' => $this->hardpoint_name, - 'position' => $this->position, - 'sizes' => [ - 'min' => $this->min_size, - 'max' => $this->max_size, - ], - 'class_name' => $this->class_name, - 'health' => $hasItem ? $this->item?->durabilityData?->health : null, - 'compatible_types' => $hasItem ? array_filter([ - array_filter([ - 'type' => $this->item?->type, - 'sub_types' => array_filter([$this->item?->sub_type]), - ]), - ]) : null, - $this->mergeWhen(...$this->addItem()), - $this->mergeWhen($this->children !== null && $this->children->count() > 0, fn () => [ - 'ports' => self::collection($this->children), - ]), - ]; - - if ($hasItem && $this->min_size === 0) { - $data['sizes']['min'] = $this->item->size; - $data['sizes']['max'] = $this->item->size; - } - - return $data; - } - - private function addItem(): array - { - if (empty($this->equipped_item_uuid)) { - return [false, []]; - } - - if ( - $this->vehicleItem->exists || - ($this->item !== null && ($this->item->exists || $this->item->isTurret() || $this->item->type === 'Cargo')) - ) { - return [true, fn () => ['equipped_item' => new HardpointItemResourceV3($this->item)]]; - } - - return [false, []]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehicleCargoGrid.php b/app/Http/Resources/SC/Vehicle/VehicleCargoGrid.php deleted file mode 100644 index 1259add78..000000000 --- a/app/Http/Resources/SC/Vehicle/VehicleCargoGrid.php +++ /dev/null @@ -1,69 +0,0 @@ - $this->capacity, - 'capacity_name' => $this->unit_name, - 'is_open' => $this->is_open, - 'is_external' => $this->is_external, - 'is_closed' => $this->is_closed, - 'x' => $this->x, - 'y' => $this->y, - 'z' => $this->z, - 'min_size' => [ - 'x' => $this->min_x, - 'y' => $this->min_y, - 'z' => $this->min_z, - ], - 'max_size' => [ - 'x' => $this->max_x, - 'y' => $this->max_y, - 'z' => $this->max_z, - ], - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehicleItemLinkResource.php b/app/Http/Resources/SC/Vehicle/VehicleItemLinkResource.php deleted file mode 100644 index aa6d14fc0..000000000 --- a/app/Http/Resources/SC/Vehicle/VehicleItemLinkResource.php +++ /dev/null @@ -1,51 +0,0 @@ - $this->uuid, - 'name' => $this->name, - 'type' => $this->type, - 'grade' => $this->vehicleItem->grade, - 'class' => $this->vehicleItem->class, - 'manufacturer' => new ManufacturerLinkResource($this->manufacturer), - 'link' => $this->makeApiUrl(self::ITEMS_SHOW, $this->uuid), - 'shops' => ShopResource::collection($this->whenLoaded('shops')), - 'updated_at' => $this->updated_at, - 'version' => $this->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehicleItemResource.php b/app/Http/Resources/SC/Vehicle/VehicleItemResource.php deleted file mode 100644 index ab6342d35..000000000 --- a/app/Http/Resources/SC/Vehicle/VehicleItemResource.php +++ /dev/null @@ -1,155 +0,0 @@ - $this->item_uuid ?? $this->sc?->item_uuid, - 'name' => $this->name, - 'link' => $this->makeApiUrl(self::VEHICLES_SHOW, ($this->item_uuid ?? $this->sc?->item_uuid ?? urlencode($this->name))), - 'updated_at' => $this->updated_at, - 'version' => $this->version ?? $this->sc?->version, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehiclePartResource.php b/app/Http/Resources/SC/Vehicle/VehiclePartResource.php deleted file mode 100644 index bdd5b0f4b..000000000 --- a/app/Http/Resources/SC/Vehicle/VehiclePartResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->name, - 'display_name' => $this->display_name, - 'damage_max' => $this->damage_max, - 'children' => self::collection($this->whenLoaded('children')), - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehicleResource.php b/app/Http/Resources/SC/Vehicle/VehicleResource.php deleted file mode 100644 index db74c35c7..000000000 --- a/app/Http/Resources/SC/Vehicle/VehicleResource.php +++ /dev/null @@ -1,599 +0,0 @@ -get('include', '') ?? '')) - ->map('trim') - ->map('strtolower') - ->toArray(); - - $hardpoints = []; - - if (in_array('hardpoints', $includes, true)) { - if ($request->has('filter') && isset($request->get('filter')['hardpoints'])) { - /** @var HasMany $hardpoints */ - $hardpoints = $this->hardpointsWithoutParent(); - - $filters = collect(explode(',', $request->get('filter')['hardpoints'])) - ->map(fn (string $filter) => trim($filter)); - - $remove = $filters - ->filter(fn (string $filter) => str_starts_with($filter, '!')) - ->map(fn (string $filter) => ltrim($filter, '!')) - ->toArray(); - - $include = $filters - ->filter(fn (string $filter) => ! str_starts_with($filter, '!')) - ->toArray(); - - if (! empty($remove)) { - $hardpoints->whereRelation('item', function (Builder $query) use ($remove) { - $query->whereNotIn('type', $remove); - }); - } elseif (! empty($include)) { - $hardpoints->whereRelation('item', function (Builder $query) use ($include) { - $query->whereIn('type', $include); - }); - } - - $hardpoints = $hardpoints->get(); - } else { - $hardpoints = $this->hardpointsWithoutParent; - } - } - - $manufacturer = $this->item->manufacturer->name; - if ($manufacturer === 'Unknown Manufacturer') { - $manufacturer = $this->description_manufacturer; - } - - $cargoGrids = VehicleCargoGrid::collection($this->cargoGrids); - - $data = [ - 'uuid' => $this->item_uuid, - 'name' => $this->name, - 'slug' => Str::slug($this->name), - 'class_name' => $this->class_name, - 'sizes' => [ - 'length' => (float) $this->length, - 'beam' => (float) $this->width, - 'height' => (float) $this->height, - ], - 'emission' => [ - 'ir' => $this->ir_emission, - 'em_idle' => $this->em_emission['min'] ?? null, - 'em_max' => $this->em_emission['max'] ?? null, - ], - 'mass' => $this->mass, - 'cargo_capacity' => $this->cargo_capacity, - 'cargo_grids' => $cargoGrids, - 'cargo_limits' => self::calculateCargoGridSizeLimits(collect($cargoGrids->resolve())), - // 'cargo_capacity_calculated' => $this->scu, - 'vehicle_inventory' => $this->vehicle_inventory_scu, - 'personal_inventory' => $this->personal_inventory_scu, - - 'crew' => [ - 'min' => $this->crew, - 'max' => null, - 'weapon' => $this->weapon_crew, - 'operation' => $this->operation_crew, - ], - 'health' => $this->health, - 'shield_hp' => $this->shield_hp, - 'shield_face_type' => $this->shield_face_type, - 'speed' => [ - 'scm' => $this->flightController?->scm_speed, - 'max' => $this->flightController?->max_speed ?? $this->handling?->max_speed, - - 'scm_boost_forward' => $this->flightController?->scm_boost_forward, - 'scm_boost_backward' => $this->flightController?->scm_boost_backward, - - 'zero_to_scm' => $this->zero_to_scm, - 'zero_to_max' => $this->handling?->zero_to_max ?? $this->zero_to_max, - 'scm_to_zero' => $this->scm_to_zero, - 'max_to_zero' => $this->handling?->max_to_zero ?? $this->max_to_zero, - // Ground Vehicles - $this->mergeWhen($this->handling !== null, fn () => [ - 'reverse' => $this->handling?->reverse_speed, - ]), - ], - 'afterburner' => [ - 'pitch_boost_multiplier' => $this->flightController?->pitch_boost_multiplier, - 'roll_boost_multiplier' => $this->flightController?->roll_boost_multiplier, - 'yaw_boost_multiplier' => $this->flightController?->yaw_boost_multiplier, - 'capacitor' => $this->flightController?->afterburner_capacitor, - 'idle_cost' => $this->flightController?->afterburner_idle_cost, - 'linear_cost' => $this->flightController?->afterburner_linear_cost, - 'angular_cost' => $this->flightController?->afterburner_angular_cost, - 'regen_per_sec' => $this->flightController?->afterburner_regen_per_sec, - 'regen_delay_after_use' => $this->flightController?->afterburner_regen_delay_after_use, - 'pre_delay_time' => $this->flightController?->afterburner_pre_delay_time, - 'ramp_up_time' => $this->flightController?->afterburner_ramp_up_time, - 'ramp_down_time' => $this->flightController?->afterburner_ramp_down_time, - ], - 'fuel' => [ - 'capacity' => $this->fuel_capacity, - 'intake_rate' => $this->fuel_intake_rate, - 'usage' => [ - 'main' => $this->getFuelUsage(), - 'maneuvering' => $this->getFuelUsage('ManneuverThruster'), - 'retro' => $this->getFuelUsage('RetroThruster'), - 'vtol' => $this->getFuelUsage('VtolThruster'), - ], - ], - $this->mergeWhen(...$this->getQuantumDriveData()), - 'agility' => [ - 'pitch' => $this->flightController?->pitch, - 'yaw' => $this->flightController?->yaw, - 'roll' => $this->flightController?->roll, - // Ground Vehicles - $this->mergeWhen($this->handling !== null, fn () => [ - 'v0_steer_max' => $this->handling?->v0_steer_max, - 'kv_steer_max' => $this->handling?->kv_steer_max, - 'vmax_steer_max' => $this->handling?->vmax_steer_max, - 'deceleration' => [ - 'main' => $this->handling?->deceleration, - ], - ]), - 'acceleration' => [ - 'main' => $this->handling?->acceleration ?? $this->acceleration_main, - 'retro' => $this->acceleration_retro, - 'vtol' => $this->acceleration_vtol, - 'maneuvering' => $this->acceleration_maneuvering, - - 'main_g' => $this->acceleration_g_main, - 'retro_g' => $this->acceleration_g_retro, - 'vtol_g' => $this->acceleration_g_vtol, - 'maneuvering_g' => $this->acceleration_g_maneuvering, - ], - ], - $this->mergeWhen($this->armor?->exists, fn () => [ - 'armor' => new ArmorResource($this->armor), - ]), - 'foci' => [ - [Language::ENGLISH => $this->career], - ], - 'type' => [ - Language::ENGLISH => $this->role, - ], - 'description' => TranslationResourceFactory::getTranslationResource($request, $this), - 'size_class' => $this->size, - 'manufacturer' => [ - 'name' => $manufacturer, - 'code' => $this->item->manufacturer->code, - ], - 'insurance' => [ - 'claim_time' => $this->claim_time, - 'expedite_time' => $this->expedite_time, - 'expedite_cost' => $this->expedite_cost, - ], - $this->mergeWhen(in_array('hardpoints', $includes, true), fn () => [ - 'hardpoints' => HardpointResource::collection($hardpoints), - ]), - $this->mergeWhen(in_array('shops', $includes, true), fn () => [ - 'shops' => ShopResource::collection($this->item->shops), - ]), - 'parts' => VehiclePartResource::collection($this->whenLoaded('partsWithoutParent')), - 'updated_at' => $this->updated_at, - 'version' => $this->item->version, - ]; - - $this->loadShipMatrixData($data, $request); - - return $data; - } - - private function getQuantumDriveData(): array - { - $drives = $this->quantumDrives; - - if ($drives->isEmpty()) { - return [false, []]; - } - - $modes = $drives[0]->modes->keyBy('type'); - $normal = $modes['normal']; - - return [ - true, - fn () => [ - 'quantum' => [ - 'quantum_speed' => $normal->drive_speed, - 'quantum_spool_time' => $normal->spool_up_time, - 'quantum_fuel_capacity' => $this->quantum_fuel_capacity, - 'quantum_range' => $this->quantum_fuel_capacity / ($drives[0]->quantum_fuel_requirement / 1e6), - ], - ], - ]; - } - - /** - * Adds ship-matrix information to the output - */ - private function loadShipMatrixData(array &$data, Request $request): void - { - if (! $this->vehicle->exists) { - return; - } - - $matrixVehicle = (new \App\Http\Resources\StarCitizen\Vehicle\VehicleResource($this->vehicle)) - ->resolve($request); - - $toAdd = [ - 'id', - 'chassis_id', - 'name', - 'slug', - 'foci', - 'production_status', - 'production_note', - 'type', - 'description', - 'size', - 'msrp', - 'pledge_url', - 'components', - 'acceleration.x_axis', - 'acceleration.y_axis', - 'acceleration.z_axis', - 'loaner', - 'skus', - ]; - - foreach ($toAdd as $key) { - if (! empty($matrixVehicle[$key])) { - if (str_contains($key, 'acceleration')) { - $key = explode('.', $key)[1]; - $data['acceleration'][$key] = $matrixVehicle['acceleration'][$key]; - } else { - $data[$key] = $matrixVehicle[$key]; - } - } - } - } - - public static function calculateCargoGridSizeLimits(Collection $cargoGrids): array - { - $minVolumeGrid = $cargoGrids - ->filter(fn ($grid) => isset($grid['min_size']['x'], $grid['min_size']['y'], $grid['min_size']['z'])) - ->sortBy(fn ($grid) => $grid['min_size']['x'] * $grid['min_size']['y'] * $grid['min_size']['z']) - ->first(); - - $maxVolumeGrid = $cargoGrids - ->filter(fn ($grid) => isset($grid['max_size']['x'], $grid['max_size']['y'], $grid['max_size']['z'])) - ->sortByDesc(fn ($grid) => $grid['max_size']['x'] * $grid['max_size']['y'] * $grid['max_size']['z']) - ->first(); - - return [ - 'min_size' => $minVolumeGrid['min_size'] ?? null, - 'max_size' => $maxVolumeGrid['max_size'] ?? null, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/VehicleResourceV3.php b/app/Http/Resources/SC/Vehicle/VehicleResourceV3.php deleted file mode 100644 index 7ce4b13df..000000000 --- a/app/Http/Resources/SC/Vehicle/VehicleResourceV3.php +++ /dev/null @@ -1,549 +0,0 @@ -get('include', '') ?? '')) - ->map('trim') - ->map('strtolower') - ->toArray(); - - $hardpoints = []; - - if (in_array('ports', $includes, true)) { - if ($request->has('filter') && isset($request->get('filter')['ports'])) { - /** @var HasMany $hardpoints */ - $hardpoints = $this->hardpointsWithoutParent(); - - $filters = collect(explode(',', $request->get('filter')['ports'])) - ->map(fn (string $filter) => trim($filter)); - - $remove = $filters - ->filter(fn (string $filter) => str_starts_with($filter, '!')) - ->map(fn (string $filter) => ltrim($filter, '!')) - ->toArray(); - - $include = $filters - ->filter(fn (string $filter) => ! str_starts_with($filter, '!')) - ->toArray(); - - if (! empty($remove)) { - $hardpoints->whereRelation('item', function (Builder $query) use ($remove) { - $query->whereNotIn('type', $remove); - }); - } elseif (! empty($include)) { - $hardpoints->whereRelation('item', function (Builder $query) use ($include) { - $query->whereIn('type', $include); - }); - } - - $hardpoints = $hardpoints->get(); - } else { - $hardpoints = $this->hardpointsWithoutParent; - } - } - - $manufacturer = $this->item->manufacturer->name; - if ($manufacturer === 'Unknown Manufacturer') { - $manufacturer = $this->description_manufacturer; - } - - $cargoGrids = VehicleCargoGrid::collection($this->cargoGrids); - - $data = [ - 'uuid' => $this->item_uuid, - 'name' => $this->name, - 'slug' => Str::slug($this->name), - 'class_name' => $this->class_name, - 'sizes' => [ - 'length' => (float) $this->length, - 'beam' => (float) $this->width, - 'height' => (float) $this->height, - ], - 'emission' => [ - 'ir' => $this->ir_emission, - 'em_idle' => $this->em_emission['min'] ?? null, - 'em_max' => $this->em_emission['max'] ?? null, - ], - 'mass' => $this->mass, - 'cargo_capacity' => $this->cargo_capacity, - 'cargo_grids' => $cargoGrids, - 'cargo_limits' => VehicleResource::calculateCargoGridSizeLimits(collect($cargoGrids->resolve())), - // 'cargo_capacity_calculated' => $this->scu, - 'vehicle_inventory' => $this->vehicle_inventory_scu, - 'personal_inventory' => $this->personal_inventory_scu, - - 'crew' => [ - 'min' => $this->crew, - 'max' => null, - 'weapon' => $this->weapon_crew, - 'operation' => $this->operation_crew, - ], - 'health' => $this->health, - 'shield_hp' => $this->shield_hp, - 'shield_face_type' => $this->shield_face_type, - 'fuel' => [ - 'capacity' => $this->fuel_capacity, - 'intake_rate' => $this->fuel_intake_rate, - 'usage' => [ - 'main' => $this->getFuelUsage(), - 'maneuvering' => $this->getFuelUsage('ManneuverThruster'), - 'retro' => $this->getFuelUsage('RetroThruster'), - 'vtol' => $this->getFuelUsage('VtolThruster'), - ], - ], - $this->mergeWhen(...$this->getQuantumDriveData()), - 'agility' => [ - 'pitch' => $this->flightController?->pitch, - 'yaw' => $this->flightController?->yaw, - 'roll' => $this->flightController?->roll, - // Ground Vehicles - $this->mergeWhen($this->handling !== null, [ - 'v0_steer_max' => $this->handling?->v0_steer_max, - 'kv_steer_max' => $this->handling?->kv_steer_max, - 'vmax_steer_max' => $this->handling?->vmax_steer_max, - 'deceleration' => [ - 'main' => $this->handling?->deceleration, - ], - ]), - 'acceleration' => [ - 'main' => $this->handling?->acceleration ?? $this->acceleration_main, - 'retro' => $this->acceleration_retro, - 'vtol' => $this->acceleration_vtol, - 'maneuvering' => $this->acceleration_maneuvering, - - 'main_g' => $this->acceleration_g_main, - 'retro_g' => $this->acceleration_g_retro, - 'vtol_g' => $this->acceleration_g_vtol, - 'maneuvering_g' => $this->acceleration_g_maneuvering, - ], - ], - $this->mergeWhen($this->armor?->exists, [ - 'armor' => new ArmorResource($this->armor), - ]), - 'foci' => [ - [Language::ENGLISH => $this->career], - ], - 'type' => [ - Language::ENGLISH => $this->role, - ], - 'description' => TranslationResourceFactory::getTranslationResource($request, $this), - 'size_class' => $this->size, - 'manufacturer' => [ - 'name' => $manufacturer, - 'code' => $this->item->manufacturer->code, - ], - 'insurance' => [ - 'claim_time' => $this->claim_time, - 'expedite_time' => $this->expedite_time, - 'expedite_cost' => $this->expedite_cost, - ], - $this->mergeWhen(in_array('ports', $includes, true), [ - 'ports' => HardpointResourceV3::collection($hardpoints), - ]), - $this->mergeWhen(in_array('shops', $includes, true), [ - 'shops' => ShopResource::collection($this->item->shops), - ]), - 'parts' => VehiclePartResource::collection($this->whenLoaded('partsWithoutParent')), - 'updated_at' => $this->updated_at, - 'version' => $this->item->version, - ]; - - $this->loadShipMatrixData($data, $request); - - return $data; - } - - private function getQuantumDriveData(): array - { - $drives = $this->quantumDrives; - - if ($drives->isEmpty()) { - return [false, []]; - } - - $modes = $drives[0]->modes->keyBy('type'); - $normal = $modes['normal']; - - return [ - true, - [ - 'quantum' => [ - 'quantum_speed' => $normal->drive_speed, - 'quantum_spool_time' => $normal->spool_up_time, - 'quantum_fuel_capacity' => $this->quantum_fuel_capacity, - 'quantum_range' => $this->quantum_fuel_capacity / ($drives[0]->quantum_fuel_requirement / 1e6), - ], - ], - ]; - } - - /** - * Adds ship-matrix information to the output - */ - private function loadShipMatrixData(array &$data, Request $request): void - { - if (! $this->vehicle->exists) { - return; - } - - $matrixVehicle = (new \App\Http\Resources\StarCitizen\Vehicle\VehicleResource($this->vehicle)) - ->resolve($request); - - $toAdd = [ - 'id', - 'chassis_id', - 'name', - 'slug', - 'foci', - 'production_status', - 'production_note', - 'type', - 'description', - 'size', - 'msrp', - 'pledge_url', - 'components', - 'acceleration.x_axis', - 'acceleration.y_axis', - 'acceleration.z_axis', - 'loaner', - 'skus', - ]; - - foreach ($toAdd as $key) { - if (! empty($matrixVehicle[$key])) { - if (str_contains($key, 'acceleration')) { - $key = explode('.', $key)[1]; - $data['acceleration'][$key] = $matrixVehicle['acceleration'][$key]; - } else { - $data[$key] = $matrixVehicle[$key]; - } - } - } - } -} diff --git a/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponRegenResource.php b/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponRegenResource.php deleted file mode 100644 index d4028c4f9..000000000 --- a/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponRegenResource.php +++ /dev/null @@ -1,33 +0,0 @@ - $this->requested_regen_per_sec, - 'requested_ammo_load' => $this->requested_ammo_load, - 'cooldown' => $this->cooldown, - 'cost_per_bullet' => $this->cost_per_bullet, - ]; - } -} diff --git a/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponResource.php b/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponResource.php deleted file mode 100644 index 34209a083..000000000 --- a/app/Http/Resources/SC/Vehicle/Weapon/VehicleWeaponResource.php +++ /dev/null @@ -1,81 +0,0 @@ - $this->weapon_class, - 'type' => $this->weapon_type, - 'capacity' => $this->capacity ?? null, - 'range' => $this->ammunition->range ?? null, - 'damage_per_shot' => $this->ammunition->damage ?? null, - 'modes' => WeaponModeResource::collection($this->whenLoaded('modes')), - 'damages' => WeaponDamageResource::collection($this->damages()), - 'regeneration' => new VehicleWeaponRegenResource($this->whenLoaded('regen')), - 'ammunition' => new AmmunitionResource($this->ammunition), - ]; - } -} diff --git a/app/Http/Resources/SC/Weapon/WeaponModeResource.php b/app/Http/Resources/SC/Weapon/WeaponModeResource.php deleted file mode 100644 index 5c28e5142..000000000 --- a/app/Http/Resources/SC/Weapon/WeaponModeResource.php +++ /dev/null @@ -1,38 +0,0 @@ - $this->mode, - 'type' => $this->type, - 'rpm' => $this->rounds_per_minute, - 'ammo_per_shot' => $this->ammo_per_shot, - 'pellets_per_shot' => $this->pellets_per_shot, - 'damage_per_second' => $this->damagePerSecond, - ]; - } -} diff --git a/app/Jobs/AbstractBaseDownloadData.php b/app/Jobs/AbstractBaseDownloadData.php deleted file mode 100644 index 69c8ea003..000000000 --- a/app/Jobs/AbstractBaseDownloadData.php +++ /dev/null @@ -1,112 +0,0 @@ - config('api.rsi_url'), - 'cookies' => self::$cookieJar, - ] - )->timeout(60); - - if ($withTokenHeader === true) { - $client = $client->withHeaders( - [ - 'X-RSI-Token' => self::RSI_TOKEN, - ] - ); - } - - self::$client = $client; - } - - return self::$client; - } - - /** - * Logs a User into the RSI Website. - * - * @return stdClass Response JSON - * - * @throws RuntimeException - */ - protected function getRsiAuthCookie(): stdClass - { - $res = self::$client->post( - 'api/account/signin', - [ - 'form_params' => [ - 'username' => config('services.rsi_account.username'), - 'password' => config('services.rsi_account.password'), - ], - 'cookies' => self::$cookieJar, - ] - ); - - $response = $res->json(); - - if ($response['success'] !== 1 || ! $res->successful()) { - throw new RuntimeException('Login was not successful'); - } - - return $response; - } - - /** - * Add Guzzle Cookies to Goutte. - */ - protected function addGuzzleCookiesToScraper(HttpBrowser $client): HttpBrowser - { - foreach (self::$cookieJar->toArray() as $cookie) { - $client->getCookieJar()->set( - new Cookie($cookie['Name'], $cookie['Value'], null, $cookie['Path'], $cookie['Domain']) - ); - } - - return $client; - } -} diff --git a/app/Jobs/Rsi/CommLink/Download/DownloadCommLink.php b/app/Jobs/Rsi/CommLink/Download/DownloadCommLink.php deleted file mode 100644 index e509c6c6e..000000000 --- a/app/Jobs/Rsi/CommLink/Download/DownloadCommLink.php +++ /dev/null @@ -1,115 +0,0 @@ -commLinkId = $commLinkId; - $this->skipExisting = $skipExisting; - } - - /** - * Execute the job. - */ - public function handle(): void - { - if ($this->skipExisting && Storage::disk(self::DISK)->exists($this->commLinkId)) { - app('Log')::debug( - "Skipping existing Comm-Link {$this->commLinkId}", - [ - 'id' => $this->commLinkId, - ] - ); - - return; - } - - app('Log')::info( - "Downloading Comm-Link with ID {$this->commLinkId}", - [ - 'id' => $this->commLinkId, - ] - ); - - $response = $this->makeClient()->get( - sprintf('%s/%s/%d-IMPORT', self::COMM_LINK_BASE_URL, 'SCW', $this->commLinkId) - ); - - if (! $response->successful()) { - $this->fail(new RequestException($response)); - - return; - } - - $content = $this->removeRsiToken($response->body()); - - if (! Str::contains($content, ['id="post"', 'id="subscribers"', 'id="layout-system"'])) { - app('Log')::info( - "Comm-Link with ID {$this->commLinkId} does not exist", - [ - 'id' => $this->commLinkId, - ] - ); - - return; - } - - $this->writeFile($content); - } - - /** - * Strips the X-RSI Token from the Page. - */ - private function removeRsiToken(string $content): string - { - return preg_replace('/\'token\'\s?\:\s?\'[A-Za-z0-9\+\:\-\_\/]+\'/', '\'token\' : \'\'', $content); - } - - /** - * Write the Comm-Link to disk - */ - private function writeFile(string $content): void - { - Storage::disk(self::DISK)->put( - sprintf('%d/%s.html', $this->commLinkId, Carbon::now()->format('Y-m-d_His')), - $content - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Download/DownloadMissingCommLinks.php b/app/Jobs/Rsi/CommLink/Download/DownloadMissingCommLinks.php deleted file mode 100644 index 7740d8db5..000000000 --- a/app/Jobs/Rsi/CommLink/Download/DownloadMissingCommLinks.php +++ /dev/null @@ -1,162 +0,0 @@ -makeClient()->get(self::COMM_LINK_BASE_URL); - - if (! $response->successful()) { - app('Log')::error('Could not connect to RSI, retrying in 5 minutes.'); - $this->release(300); - - return; - } - - $postIds = $this->extractPostIds($response->body()); - - if (empty($postIds)) { - app('Log')::info('Could not retrieve latest Comm-Link ID, retrying in 1 minute.'); - $this->release(60); - - return; - } - - $latestPostId = max($postIds); - - app('Log')::info( - "Latest Comm-Link ID is: {$latestPostId}", - [ - 'id' => $latestPostId, - ] - ); - - $this->downloadCommLinks($postIds); - } - - /** - * Extracts Post ids from html - * - * - * @return array Ids - */ - private function extractPostIds(string $body): array - { - $postIds = []; - - $crawler = new Crawler; - - $crawler->addHtmlContent($body, 'UTF-8'); - $crawler->filter('#channel .hub-blocks .hub-block') - ->each( - function (Crawler $crawler) use (&$postIds) { - $link = $crawler->filter('a'); - $postIds[] = $this->extractIdFromLink($link); - } - ); - - return $postIds; - } - - /** - * Extract latest Comm-Link id from Website - */ - private function extractIdFromLink(Crawler $link): int - { - $linkHref = $link->attr('href'); - - if ($linkHref === null) { - return 0; - } - - $linkHref = explode('/', $linkHref); - $linkHref = end($linkHref); - $linkHref = explode('-', $linkHref); - - return (int) $linkHref[0]; - } - - /** - * Dispatches download jobs for all missing ids - */ - private function downloadCommLinks(array $postIDs): void - { - $latestPostId = max($postIDs); - - try { - $dbIds = CommLink::query() - ->select('cig_id') - ->take(count($postIDs)) - ->orderByDesc('cig_id') - ->get() - ->pluck('cig_id'); - } catch (ModelNotFoundException $e) { - $dbIds = collect([self::FIRST_COMM_LINK_ID - 1]); - } - - $missing = collect($postIDs)->diff($dbIds); - - $missing->each( - function (int $id) { - dispatch(new DownloadCommLink($id, true)); - } - ); - - $dbId = $dbIds->max(); - if ($dbId > 0) { - app('Log')::info( - "Latest DB Comm-Link ID is: {$dbId}", - [ - 'id' => $dbId, - ] - ); - $dbId++; - } else { - app('Log')::info('No Comm-Links in DB found'); - $dbId = self::FIRST_COMM_LINK_ID; - } - - for ($id = $dbId; $id <= $latestPostId; $id++) { - if (! $missing->contains($id)) { - dispatch(new DownloadCommLink($id, true)); - } - } - } -} diff --git a/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImage.php b/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImage.php deleted file mode 100644 index 30be955ac..000000000 --- a/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImage.php +++ /dev/null @@ -1,115 +0,0 @@ -image = $image; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info( - "Downloading Comm-Link Image {$this->image->name}", - [ - 'id' => $this->image->id, - 'src' => $this->image->src, - ] - ); - - $localDirName = $this->image->dir ?? $this->generateLocalDirName(); - - if (Storage::disk('comm_link_images')->exists(sprintf('%s/%s', $localDirName, $this->image->name))) { - return; - } - - $response = $this->makeClient()->get($this->image->url); - - if ($response->serverError()) { - app('Log')::critical('Could not connect to RSI Website'); - - $this->fail(new RequestException($response)); - - return; - } - - if ($response->clientError()) { - app('Log')::info( - "Could not download Comm-Link Image {$this->image->name}", - [ - 'url' => $this->image->url, - ] - ); - - $this->image->update( - [ - 'local' => false, - 'dir' => 'NOT_FOUND', - ] - ); - - return; - } - - $this->writeImage($response->body(), $localDirName); - - $this->image->update( - [ - 'local' => true, - 'dir' => $localDirName, - ] - ); - } - - private function generateLocalDirName(): string - { - try { - return bin2hex(random_bytes(7)); - } catch (Exception $e) { - return Str::random(14); - } - } - - /** - * Writes the image data to file - */ - private function writeImage(string $data, string $folder): void - { - Storage::disk('comm_link_images')->put( - sprintf('%s/%s', $folder, $this->image->name), - $data - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImages.php b/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImages.php deleted file mode 100644 index 52088ff6e..000000000 --- a/app/Jobs/Rsi/CommLink/Download/Image/DownloadCommLinkImages.php +++ /dev/null @@ -1,45 +0,0 @@ -where('local', false)->chunk( - 100, - function (Collection $images) { - $images->each( - function (Image $image) { - dispatch(new DownloadCommLinkImage($image))->onQueue('comm_link_images'); - } - ); - } - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Download/ReDownloadDbCommLinks.php b/app/Jobs/Rsi/CommLink/Download/ReDownloadDbCommLinks.php deleted file mode 100644 index 0026f798d..000000000 --- a/app/Jobs/Rsi/CommLink/Download/ReDownloadDbCommLinks.php +++ /dev/null @@ -1,67 +0,0 @@ -skipExisting = $skipExisting; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Re-Downloading all DB Comm-Links'); - - $latestDbPost = CommLink::query()->orderByDesc('cig_id')->first(); - if ($latestDbPost === null) { - $this->fail(new InvalidArgumentException('No Comm-Links in DB Found')); - - return; - } - - app('Log')::info( - "Latest DB Comm-Link CIG ID: {$latestDbPost->cig_id}", - [ - 'cig_id' => $latestDbPost->cig_id, - ] - ); - - $this->makeClient(false); - - for ($id = self::FIRST_COMM_LINK_ID; $id <= $latestDbPost->cig_id; $id++) { - dispatch(new DownloadCommLink($id, $this->skipExisting))->delay(($id - self::FIRST_COMM_LINK_ID) * 30); - } - } -} diff --git a/app/Jobs/Rsi/CommLink/Image/ComputeSimilarImageIds.php b/app/Jobs/Rsi/CommLink/Image/ComputeSimilarImageIds.php deleted file mode 100644 index 99664b897..000000000 --- a/app/Jobs/Rsi/CommLink/Image/ComputeSimilarImageIds.php +++ /dev/null @@ -1,50 +0,0 @@ -image = $image; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $this->image->refresh(); - if ($this->image->base_image_id !== null) { - return; - } - - $this->image->similarImages(95, 50)->each(function (Image $duplicate) { - unset($duplicate->similarity, $duplicate->similarity_method, $duplicate->pdq_distance); - - if ($duplicate->base_image_id === $this->image->id) { - return; - } - - $duplicate->update([ - 'base_image_id' => $this->image->id, - ]); - }); - } -} diff --git a/app/Jobs/Rsi/CommLink/Image/CreateImageHash.php b/app/Jobs/Rsi/CommLink/Image/CreateImageHash.php deleted file mode 100644 index 9be11452b..000000000 --- a/app/Jobs/Rsi/CommLink/Image/CreateImageHash.php +++ /dev/null @@ -1,240 +0,0 @@ -image = $image; - - $this->perceptionHasher = new ImageHash(new PerceptualHash2(32)); - $this->differenceHasher = new ImageHash(new DifferenceHash); - $this->averageHasher = new ImageHash(new AverageHash); - } - - /** - * Delete possible temp files when done - */ - public function __destruct() - { - if ($this->deleteTempFile) { - File::delete($this->tempFileUrl); - } - } - - /** - * Execute the job. - */ - public function handle(): void - { - if (! extension_loaded('gd') && ! extension_loaded('imagick')) { - app('Log')::error('Required extension "GD" or "Imagick" not available.'); - $this->fail('Required extension "GD" or "Imagick" not available.'); - - return; - } - - if ($this->image->hash !== null && $this->image->hash->exists && $this->image->hash->pdq_hash1 !== null) { - $this->delete(); - - return; - } - - if ($this->image->local) { - $fileUrl = $this->image->local_path; - } else { - $fileUrl = $this->image->getLocalOrRemoteUrl(); - } - - if (str_contains($this->image->metadata->mime, 'video')) { - if (! $this->image->local) { - $this->fail('Can\'t extract frame from remote file.'); - - return; - } - - $fileUrl = $this->saveVideoFrame(); - if ($fileUrl === null) { - $this->fail(sprintf('Could not extract frame from video %s', $this->image->name)); - - return; - } - - $this->deleteTempFile = true; - $this->tempFileUrl = $fileUrl; - } - - $pdqFromStream = false; - if (! $this->image->local) { - if (Storage::disk('comm_link_images')->exists("{$this->image->dir}/{$this->image->name}")) { - $this->image->update(['local' => true]); - } else { - $pdqFromStream = true; - $fileUrl = $this->downloadFile($fileUrl); - } - } - - // 4xx Error - if ($fileUrl === null) { - return; - } - - try { - $hash = $this->perceptionHasher->hash($fileUrl); - } catch (NotReadableException $e) { - app('Log')::info("Image $fileUrl is not readable", [$fileUrl]); - $this->fail($e); - - return; - } - - $perception = $hash->toHex(); - $difference = $this->differenceHasher->hash($fileUrl)->toHex(); - $average = $this->averageHasher->hash($fileUrl)->toHex(); - - try { - [$hash, $quality] = PDQHasher::computeHashAndQualityFromFilename( - $fileUrl, - true, - $pdqFromStream - ); - } catch (Exception $e) { - $this->fail($e->getMessage()); - - return; - } - - /** @var PDQHash $hash */ - $hash = $hash->to64BitStrings(); - - if ($perception === '' || $difference === '' || $average === '') { - app('Log')::debug("Hash for $fileUrl is empty.", [$fileUrl]); - - return; - } - - $this->image->hash()->updateOrCreate( - [ - 'perceptual_hash' => hex2bin($perception), - 'difference_hash' => hex2bin($difference), - 'average_hash' => hex2bin($average), - 'pdq_hash1' => hex2bin($hash[0]), - 'pdq_hash2' => hex2bin($hash[1]), - 'pdq_hash3' => hex2bin($hash[2]), - 'pdq_hash4' => hex2bin($hash[3]), - 'pdq_quality' => $quality, - ] - ); - } - - /** - * Downloads a file and returns the content - * - * - * @param bool $selfCall Don't retry indefinitely - */ - private function downloadFile(string $url, bool $selfCall = false): ?string - { - $response = $this->makeClient()->get($url); - - if ($response->serverError()) { - app('Log')::debug( - 'Download of Comm-Link image failed. Retrying in 300 seconds.', - [$url, $response->status()] - ); - - $this->release(300); - - return null; - } - - if ($response->clientError()) { - if (! $selfCall && $response->status() === 404) { - $url = str_replace('/source/', '/post/', $url); - - app('Log')::debug('Retrying download with smaller version.', [$url]); - - // Retry with smaller version - return $this->downloadFile($url, true); - } - - app('Log')::info("Download of Comm-Link image resulted in code {$response->status()}", [$url]); - - return null; - } - - return $response->body(); - } - - /** - * Use FFMPEG to retrieve a frame from second 1 - */ - private function saveVideoFrame(): ?string - { - $fp = tmpfile(); - $path = stream_get_meta_data($fp)['uri']; - fclose($fp); - $pathExt = $path.'.jpg'; - - $proc = new Process([ - '/usr/bin/ffmpeg', - '-i', - $this->image->local_path, - '-an', - '-ss', - '1', - '-y', - '-f', - 'mjpeg', - $pathExt, - ]); - - $proc->setTimeout(120); - - $code = $proc->run(); - - return $code === 0 ? $pathExt : null; - } -} diff --git a/app/Jobs/Rsi/CommLink/Image/CreateImageHashes.php b/app/Jobs/Rsi/CommLink/Image/CreateImageHashes.php deleted file mode 100644 index c9e290fbc..000000000 --- a/app/Jobs/Rsi/CommLink/Image/CreateImageHashes.php +++ /dev/null @@ -1,84 +0,0 @@ -commLinkIds = $commLinkIds; - } - - /** - * Execute the job. - */ - public function handle(): void - { - if (! extension_loaded('gd') && ! extension_loaded('imagick')) { - app('Log')::error('Required extension "GD" or "Imagick" not available.'); - - $this->fail('Required extension "GD" or "Imagick" not available.'); - - return; - } - - $query = Image::query() - ->whereHas( - 'commLinks', - function (Builder $query) { - $query->whereIn('cig_id', $this->commLinkIds); - } - ) - ->whereDoesntHave('hash') - ->whereHas( - 'metadata', - function (Builder $query) { - $query->where('size', '<', 1024 * 1024 * 10); // Max 10MB files - } - ) - ->where( - function (Builder $query) { - $query->orWhereRaw('LOWER(src) LIKE \'%.jpg\'') - ->orWhereRaw('LOWER(src) LIKE \'%.jpeg\'') - ->orWhereRaw('LOWER(src) LIKE \'%.png\'') - ->orWhereRaw('LOWER(src) LIKE \'%.webp\''); - } - ); - - $query->chunk( - 100, - function (Collection $images) { - $images->each( - function (Image $image) { - dispatch(new CreateImageHash($image)); - } - ); - } - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Image/CreateImageMetadata.php b/app/Jobs/Rsi/CommLink/Image/CreateImageMetadata.php deleted file mode 100644 index f14cd4979..000000000 --- a/app/Jobs/Rsi/CommLink/Image/CreateImageMetadata.php +++ /dev/null @@ -1,61 +0,0 @@ -commLinkIds = $commLinkIds; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $query = Image::query() - ->whereHas( - 'commLinks', - function (Builder $query) { - $query->whereIn('cig_id', $this->commLinkIds); - } - ) - ->whereDoesntHave('metadata'); - - $query->chunk( - 100, - function (Collection $images) { - $images->each( - function (Image $image) { - dispatch(new CreateImageMetadatum($image)); - } - ); - } - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Image/CreateImageMetadatum.php b/app/Jobs/Rsi/CommLink/Image/CreateImageMetadatum.php deleted file mode 100644 index 5c83b3143..000000000 --- a/app/Jobs/Rsi/CommLink/Image/CreateImageMetadatum.php +++ /dev/null @@ -1,91 +0,0 @@ -image = $image; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $url = $this->image->url; - - $response = $this->makeClient()->head($url); - - if ($response->serverError()) { - app('Log')::debug('Header request failed. Retrying in 300 seconds.', [$url, $response->status()]); - - $this->release(300); - - return; - } - - if ($response->clientError()) { - app('Log')::info("Header request resulted in code {$response->status()}", [$url]); - - if ($this->image->metadata === null) { - $this->image->metadata()->create( - [ - 'mime' => 'undefined', - 'size' => 0, - 'last_modified' => '0001-01-01 00:00:00', - ] - ); - } - - return; - } - - $this->saveMetadata($response); - } - - /** - * Saves response data as metadata - */ - private function saveMetadata(Response $response): void - { - $data = [ - 'mime' => $response->header('content-type'), - 'size' => $response->header('content-length'), - 'last_modified' => Carbon::parse($response->header('last-modified'))->toDateTimeString(), - ]; - - foreach ($data as $key => $datum) { - if ($datum === '') { - unset($data[$key]); - } - } - - if ($this->image->metadata->mime === 'undefined') { - $this->image->metadata()->create($data); - } - } -} diff --git a/app/Jobs/Rsi/CommLink/Import/ImportCommLink.php b/app/Jobs/Rsi/CommLink/Import/ImportCommLink.php deleted file mode 100644 index 7528f4da5..000000000 --- a/app/Jobs/Rsi/CommLink/Import/ImportCommLink.php +++ /dev/null @@ -1,420 +0,0 @@ -commLinkId = $id; - $this->file = $file; - $this->commLinkModel = $commLink; - $this->forceImport = $forceImport; - } - - /** - * Execute the job. - * - * - * @throws FileNotFoundException - */ - public function handle(): void - { - app('Log')::info( - "Parsing Comm-Link with ID {$this->commLinkId}", - [ - 'id' => $this->commLinkId, - 'file' => $this->file, - 'comm_link_already_in_db' => $this->commLinkModel !== null, - 'force_import' => $this->forceImport === true, - ] - ); - - $content = Storage::disk('comm_links')->get($this->filePath()); - if ($content === null) { - throw new FileNotFoundException; - } - - // Check and process dynamic content if needed - if ($this->containsDynamicContent($content)) { - try { - $content = $this->processDynamicContent($content); - // Save the updated content - Storage::disk('comm_links')->put($this->filePath(), $content); - app('Log')::info( - "Successfully processed dynamic content for Comm-Link {$this->commLinkId}", - [ - 'file' => $this->file, - ] - ); - } catch (Exception $e) { - app('Log')::error( - "Failed to process dynamic content for Comm-Link {$this->commLinkId}", - [ - 'error' => $e->getMessage(), - 'file' => $this->file, - ] - ); - } - } - - $this->crawler = new Crawler; - $this->crawler->addHtmlContent($content); - - $post = $this->crawler->filter(self::POST_SELECTOR); - $subscribers = $this->crawler->filter(self::SUBSCRIBERS_SELECTOR); - $specialPage = $this->crawler->filter(self::SPECIAL_PAGE_SELECTOR); - $alexandriaComponents = $this->crawler->filter(self::ALEXANDRIA_SELECTOR); - - // Check if we have any content to parse - if ( - $post->count() === 0 && - $subscribers->count() === 0 && - $specialPage->count() === 0 && - $alexandriaComponents->count() === 0 - ) { - app('Log')::info("Comm-Link with id {$this->commLinkId} has no content"); - - return; - } - - if ($this->commLinkModel === null || $this->forceImport) { - $this->createCommLink(); // Updates or Creates - } else { - $this->checkCommLinkForChanges(); - } - } - - /** - * Check if the content contains dynamic content loading - */ - private function containsDynamicContent(string $content): bool - { - return str_contains($content, self::ALEXANDRIA_URL_PATTERN); - } - - /** - * Process and replace dynamic content - * - * @throws Exception - */ - private function processDynamicContent(string $content): string - { - - $processedContent = $content; - - $crawler = new Crawler; - $crawler->addHtmlContent($content, 'UTF-8'); - $toReplace = []; - $crawler->filter('script')->each(function (Crawler $node, $i) use (&$toReplace) { - if (str_contains($node->html(), self::ALEXANDRIA_URL_PATTERN)) { - $toReplace[] = $node->html(); - } - }); - - $alexandriaContent = ''; - - foreach ($toReplace as $scriptTag) { - if (! preg_match('/https:\/\/robertsspaceindustries\.com\/alexandria\/html[^"\'\s]*/i', $scriptTag, $urlMatches)) { - app('Log')::warning( - "Failed to extract Alexandria URL from script tag in Comm-Link {$this->commLinkId}", - [ - 'script_tag' => substr($scriptTag, 0, 150).'...', - ] - ); - - continue; - } - - $alexandriaUrl = $urlMatches[0]; - - try { - $client = new Client([ - 'timeout' => 30, - ]); - - $response = $client->get($alexandriaUrl); - - if ($response->getStatusCode() !== 200) { - throw new RuntimeException('Alexandria endpoint returned status code: '.$response->getStatusCode()); - } - - $dynamicContent = $response->getBody()->getContents(); - - if (empty($dynamicContent)) { - throw new RuntimeException('Alexandria endpoint returned empty content'); - } - - $processedContent = str_replace($scriptTag, '', $processedContent); - - $alexandriaContent .= $dynamicContent; - - app('Log')::debug( - "Successfully replaced Alexandria content in Comm-Link {$this->commLinkId}", - [ - 'url' => $alexandriaUrl, - 'content_length' => strlen($dynamicContent), - ] - ); - } catch (GuzzleException $e) { - throw new RuntimeException("Failed to fetch dynamic content from {$alexandriaUrl}: {$e->getMessage()}"); - } - } - - return preg_replace('/
.*?<\/div>/s', sprintf('
%s
', $alexandriaContent), $processedContent); - } - - /** - * @return string Path to Comm-Link File - */ - private function filePath(): string - { - return "{$this->commLinkId}/{$this->file}"; - } - - /** - * Updates or Creates a Comm-Link Model and populates it. - */ - private function createCommLink(): void - { - $data = $this->getCommLinkData(); - // Use the file time for new comm-links - $data['created_at'] = $data['created_at_file']; - - /** @var CommLink $commLink */ - $commLink = CommLink::updateOrCreate( - [ - 'cig_id' => $this->commLinkId, - ], - $data - ); - - $this->addEnglishCommLinkTranslation($commLink); - $this->syncImageIds($commLink); - $this->syncLinkIds($commLink); - - CommLinksChanged::create( - [ - 'comm_link_id' => $commLink->id, - 'had_content' => false, - 'type' => 'creation', - ] - ); - } - - /** - * Creates the Comm-Link Dara Array from Metadata. - */ - private function getCommLinkData(): array - { - $metaData = (new Metadata($this->crawler))->getMetaData(); - - $metaData->put( - 'created_at_file', - $this->createTimestampFromFile( - $this->getFirstCommLinkFileName() - ) ?? Metadata::DEFAULT_CREATION_DATE - ); - - return [ - 'title' => $metaData->get('title'), - 'comment_count' => $metaData->get('comment_count'), - 'url' => $metaData->get('url'), - 'file' => $this->file, - 'channel_id' => $metaData->get('channel_id'), - 'category_id' => $metaData->get('category_id'), - 'series_id' => $metaData->get('series_id'), - 'created_at' => $metaData->get('created_at'), - 'created_at_file' => $metaData->get('created_at_file'), - ]; - } - - /** - * Adds or Updates the default english Translation to the Comm-Link. - */ - private function addEnglishCommLinkTranslation(CommLink $commLink): void - { - $contentParser = new Content($this->crawler); - $commLink->translations()->updateOrCreate( - [ - 'locale_code' => Language::ENGLISH, - ], - [ - 'translation' => $contentParser->getContent(), - 'proofread' => true, - ] - ); - } - - /** - * Syncs extracted Comm-Link Image Ids. - */ - private function syncImageIds(CommLink $commLink): void - { - $imageParser = new Image($this->crawler); - $commLink->images()->sync($imageParser->getImageIds()); - } - - /** - * Syncs extracted Comm-Link Link Ids. - */ - private function syncLinkIds(CommLink $commLink): void - { - $linkParser = new Link($this->crawler); - $commLink->links()->sync($linkParser->getLinkIds()); - } - - /** - * Checks if Content of current Comm-Link has Changed - * Updates Metadata. - */ - private function checkCommLinkForChanges(): void - { - $data = $this->getCommLinkData(); - - if ($this->contentHasChanged()) { - $hadContent = true; - if (optional($this->commLinkModel->english())->translation === null) { - $hadContent = false; - } else { - // Don't update the current File if Content has Changed and Translation is not null - unset($data['file']); - } - - $this->addEnglishCommLinkTranslation($this->commLinkModel); - - CommLinksChanged::create( - [ - 'comm_link_id' => $this->commLinkModel->id, - 'had_content' => $hadContent, - 'type' => 'update', - ] - ); - } - - $dateMetadata = Carbon::parse($data['created_at']); - $dateMetadataFile = Carbon::parse($data['created_at_file']); - $dateMetadataFile->setSecond(0); - $dateMetadataFile->setMinutes(0); - - if ($dateMetadata->diffInHours($dateMetadataFile) <= 24 || $data['created_at'] === Metadata::DEFAULT_CREATION_DATE) { - $data['created_at'] = $dateMetadataFile; - } - - $this->commLinkModel->update($data); - $this->syncImageIds($this->commLinkModel); - $this->syncLinkIds($this->commLinkModel); - } - - /** - * Checks if Local Content is Equal to DB Content. - */ - private function contentHasChanged(): bool - { - $contentParser = new Content($this->crawler); - - return $contentParser->getContent() !== (optional($this->commLinkModel->english())->translation ?? ''); - } - - /** - * Returns the first file in a comm-link folder or null - */ - private function getFirstCommLinkFileName(): ?string - { - $filename = Arr::first(Storage::disk(DownloadCommLink::DISK)->allFiles($this->commLinkId)); - - return str_replace(sprintf('%d/', $this->commLinkId), '', $filename); - } - - /** - * Creates a timestamp from a comm-link filename - */ - private function createTimestampFromFile(string $file): ?string - { - try { - return Carbon::createFromFormat('Y-m-d_His\.\h\t\m\l', $file)->format('Y-m-d H:i:s'); - } catch (InvalidFormatException $e) { - return null; - } - } -} diff --git a/app/Jobs/Rsi/CommLink/Import/ImportCommLinks.php b/app/Jobs/Rsi/CommLink/Import/ImportCommLinks.php deleted file mode 100644 index e798ee936..000000000 --- a/app/Jobs/Rsi/CommLink/Import/ImportCommLinks.php +++ /dev/null @@ -1,104 +0,0 @@ -modifiedFolderTime = $modifiedFolderTime; - } - - /** - * Import Comm-Links that where created in the last modifiedFolderTime minutes - * Also create Metadata, Image Hashes, Translations and Wiki Pages for each imported Comm-Link - */ - public function handle(): void - { - $commLinks = CommLink::query()->get(); - $commLinks = $commLinks->keyBy('cig_id'); - - $newCommLinkIds = $this->filterDirectories('comm_links', $this->modifiedFolderTime) - ->each( - function ($commLinkDir) use ($commLinks) { - $file = Arr::last(Storage::disk('comm_links')->files($commLinkDir)); - - if ($file !== null) { - $file = preg_split('/\/|\\\/', $file); - $commLink = $commLinks->get((int) $commLinkDir, null); - - dispatch(new ImportCommLink((int) $commLinkDir, Arr::last($file), $commLink)); - } - } - ) - ->map( - function ($directory) { - return (int) $directory; - } - ) - ->toArray(); - - $this->dispatchChain($newCommLinkIds); - } - - /** - * Create Metadata, Image Hashes, Translations and Wiki Pages - */ - private function dispatchChain(array $commLinkIds): void - { - CreateImageMetadata::withChain( - [ - new CreateImageHashes($commLinkIds), - ] - )->dispatch($commLinkIds); - - if (config('services.deepl.auth_key', null) !== null) { - dispatch(new TranslateCommLinks($commLinkIds)); - } - - $clientNotNull = config('services.mediawiki.client_id') !== null; - $apiUrlNotNull = config('mediawiki.api_url') !== null; - - if ($clientNotNull && $apiUrlNotNull) { - dispatch(new CreateCommLinkWikiPages)->delay(90); - } - - Artisan::call('comm-links:compute-similar-image-ids --recent'); - } -} diff --git a/app/Jobs/Rsi/CommLink/SyncImageId.php b/app/Jobs/Rsi/CommLink/SyncImageId.php deleted file mode 100644 index 9d56d98eb..000000000 --- a/app/Jobs/Rsi/CommLink/SyncImageId.php +++ /dev/null @@ -1,81 +0,0 @@ -commLink = $commLink; - } - - /** - * Execute the job. - * - * @throws FileNotFoundException - */ - public function handle(): void - { - app('Log')::info( - "Syncing Image ids for Comm-Link {$this->commLink->cig_id}", - [ - 'id' => $this->commLink->cig_id, - 'file' => $this->commLink->file, - ] - ); - - $content = Storage::disk('comm_links')->get("{$this->commLink->cig_id}/{$this->commLink->file}"); - if ($content === null) { - throw new FileNotFoundException; - } - - $this->crawler = new Crawler; - $this->crawler->addHtmlContent($content, 'UTF-8'); - - $post = $this->crawler->filter(ImportCommLink::POST_SELECTOR); - $subscribers = $this->crawler->filter(ImportCommLink::SUBSCRIBERS_SELECTOR); - - if ($post->count() === 0 && $subscribers->count() === 0) { - app('Log')::info("Comm-Link with id {$this->commLink->cig_id} has no content"); - - return; - } - - $this->syncImages(); - } - - /** - * Syncs extracted Comm-Link Image Ids. - */ - private function syncImages(): void - { - $imageParser = new Image($this->crawler); - $this->commLink->images()->sync($imageParser->getImageIds()); - } -} diff --git a/app/Jobs/Rsi/CommLink/SyncImageIds.php b/app/Jobs/Rsi/CommLink/SyncImageIds.php deleted file mode 100644 index 7a4093e38..000000000 --- a/app/Jobs/Rsi/CommLink/SyncImageIds.php +++ /dev/null @@ -1,54 +0,0 @@ -offset = $offset; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $commLinks = CommLink::query()->where('cig_id', '>=', $this->offset)->get(); - - $commLinks->each( - function ($commLink) { - if (! Storage::disk('comm_links')->exists((string) $commLink->cig_id)) { - return; - } - - dispatch(new SyncImageId($commLink)); - } - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Translate/TranslateCommLink.php b/app/Jobs/Rsi/CommLink/Translate/TranslateCommLink.php deleted file mode 100644 index 4a9eaf24c..000000000 --- a/app/Jobs/Rsi/CommLink/Translate/TranslateCommLink.php +++ /dev/null @@ -1,106 +0,0 @@ -commLink = $commLink; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Translating Comm-Link with ID {$this->commLink->cig_id}'); - $targetLocale = config('services.deepl.target_locale'); - - if (optional($this->commLink->german())->translation !== null) { - $this->delete(); - - return; - } - - $english = $this->commLink->english()->translation; - $formality = 'less'; - - if (in_array($this->commLink->category->name, $this->formalCategories, true)) { - $formality = 'more'; - } - - $translator = new TranslateText($english); - - // phpcs:disable - try { - $translation = $translator->translate(config('services.deepl.target_locale'), $formality); - } catch ( - QuotaException| - CallException| - AuthenticationException| - InvalidArgumentException| - TextLengthException $e - ) { - $this->fail($e); - - return; - } catch (ConnectException|RateLimitedException $e) { - $this->release(60); - - return; - } - // phpcs:enable - - $this->commLink->translations()->updateOrCreate( - [ - 'locale_code' => sprintf('%s_%s', Str::lower($targetLocale), $targetLocale), - ], - [ - 'translation' => trim(TranslateText::runTextReplacements($translation)), - 'proofread' => false, - ] - ); - } -} diff --git a/app/Jobs/Rsi/CommLink/Translate/TranslateCommLinks.php b/app/Jobs/Rsi/CommLink/Translate/TranslateCommLinks.php deleted file mode 100644 index a79c6e92d..000000000 --- a/app/Jobs/Rsi/CommLink/Translate/TranslateCommLinks.php +++ /dev/null @@ -1,92 +0,0 @@ -commLinkIds = $commLinkIds; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Starting Comm-Link Translations'); - - $this->loginWikiBotAccount('services.wiki_translations'); - - CommLink::query()->whereHas( - 'translations', - function (Builder $query) { - $query->where('locale_code', Language::ENGLISH)->whereRaw("translation <> ''"); - } - ) - ->whereIn('cig_id', $this->commLinkIds) - ->chunk( - 100, - function (Collection $commLinks) { - try { - $pageInfoCollection = $this->getPageInfoForCommLinks($commLinks, true); - } catch (RuntimeException $e) { - app('Log')::error($e->getMessage()); - - if (str_contains($e->getMessage(), 'Guru Meditation')) { - $this->release(60); - } else { - $this->fail($e); - } - - return; - } - - $commLinks->each( - function (CommLink $commLink) use ($pageInfoCollection) { - $wikiPage = $pageInfoCollection->get($commLink->cig_id, []); - - if (isset($wikiPage['missing'])) { - dispatch(new TranslateCommLink($commLink)); - } - } - ); - - usleep(100000); - } - ); - } -} diff --git a/app/Jobs/SC/ComputeItemBaseIds.php b/app/Jobs/SC/ComputeItemBaseIds.php deleted file mode 100644 index 4e8d93604..000000000 --- a/app/Jobs/SC/ComputeItemBaseIds.php +++ /dev/null @@ -1,67 +0,0 @@ -chunk(250, function (Collection $items) { - $items->each(function (Item $item) { - // No '01,02, etc.' found, we currently assume that this means no base variants - if (preg_match('/[a-z-_]+_0\d/i', $item->class_name) === false) { - return; - } - - $idEnd = strpos($item->class_name, '0'); - $class = substr($item->class_name, 0, $idEnd + 2); - $baseClassChecks = [ - $class, - $class.'_01', - $class.'_01_01', - ]; - - $baseModel = Item::query() - ->where('uuid', '<>', $item->uuid) - ->where('type', $item->type); - - // Special backpack handling, they differ in their "set" ids (we assume) but share the same set - if ($item->type === 'Char_Armor_Backpack') { - $baseClass = substr($item->class_name, 0, $idEnd - 1); - - if (str_ends_with($item->name, 'Backpack') && ! str_contains($item->name, '"Expo"')) { - $baseClass = '<>'; // Don't match anything - } - - $baseModel - ->where('class_name', 'LIKE', $baseClass.'%') - ->orderBy('name'); - } else { - $baseModel->whereIn('class_name', $baseClassChecks); - } - - $baseModel = $baseModel->first(); - - $item->update([ - 'base_id' => $baseModel?->id, - ]); - }); - }); - } -} diff --git a/app/Jobs/SC/Import/AbstractItemCreationJob.php b/app/Jobs/SC/Import/AbstractItemCreationJob.php deleted file mode 100644 index 1a8d39cf5..000000000 --- a/app/Jobs/SC/Import/AbstractItemCreationJob.php +++ /dev/null @@ -1,18 +0,0 @@ -labels = new Labels; - } -} diff --git a/app/Jobs/SC/Import/Ammunition.php b/app/Jobs/SC/Import/Ammunition.php deleted file mode 100644 index 3c33e197a..000000000 --- a/app/Jobs/SC/Import/Ammunition.php +++ /dev/null @@ -1,70 +0,0 @@ -withoutGlobalScopes()->updateOrCreate([ - 'uuid' => $this->data['ammunition']['uuid'], - ], [ - 'size' => $this->data['ammunition']['size'], - 'lifetime' => $this->data['ammunition']['lifetime'], - 'speed' => $this->data['ammunition']['speed'], - 'range' => $this->data['ammunition']['range'], - ]); - - collect($this->data['ammunition']['damages'])->each(function ($damageClass) use ($ammunition) { - collect($damageClass)->each(function ($damage) use ($ammunition) { - $ammunition->damages()->updateOrCreate([ - 'type' => $damage['type'], - 'name' => $damage['name'], - ], [ - 'damage' => $damage['damage'], - ]); - }); - }); - - $ammunition->piercability()->updateOrCreate([ - 'ammunition_uuid' => $this->data['ammunition']['uuid'], - ], [ - 'damage_falloff_level_1' => $this->data['ammunition']['piercability']['damage_falloff_level_1'] ?? 0, - 'damage_falloff_level_2' => $this->data['ammunition']['piercability']['damage_falloff_level_2'] ?? 0, - 'damage_falloff_level_3' => $this->data['ammunition']['piercability']['damage_falloff_level_3'] ?? 0, - 'max_penetration_thickness' => $this->data['ammunition']['piercability']['max_penetration_thickness'] ?? 0, - ]); - - collect($this->data['ammunition']['damage_falloffs'])->each(function ($falloff, $key) use ($ammunition) { - $ammunition->damageFalloffs()->updateOrCreate([ - 'type' => $key, - ], [ - 'physical' => $falloff['physical'] ?? 0, - 'energy' => $falloff['energy'] ?? 0, - 'distortion' => $falloff['distortion'] ?? 0, - 'thermal' => $falloff['thermal'] ?? 0, - 'biochemical' => $falloff['biochemical'] ?? 0, - 'stun' => $falloff['stun'] ?? 0, - ]); - }); - } -} diff --git a/app/Jobs/SC/Import/Clothing.php b/app/Jobs/SC/Import/Clothing.php deleted file mode 100644 index 92b22cd32..000000000 --- a/app/Jobs/SC/Import/Clothing.php +++ /dev/null @@ -1,74 +0,0 @@ -loadLabels(); - - try { - $parser = new \App\Services\Parser\SC\Clothing($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - - $item = $parser->getData(); - - try { - /** @var \App\Models\SC\Char\Clothing\Clothing $model */ - $model = \App\Models\SC\Char\Clothing\Clothing::query()->withoutGlobalScopes()->where('uuid', $item['uuid'])->firstOrFail(); - } catch (ModelNotFoundException $e) { - return; - } - - if (isset($item['resistances'])) { - if (! empty($item['damage_reduction'])) { - $model->resistances()->updateOrCreate([ - 'type' => 'damage_reduction', - ], [ - 'multiplier' => str_replace('%', '', $item['damage_reduction']) / 100, - ]); - } - - foreach ($item['resistances'] as $type => $resistance) { - $model->resistances()->updateOrCreate([ - 'type' => $type, - ], [ - 'multiplier' => $resistance['multiplier'] ?? null, - 'threshold' => $resistance['threshold'] ?? null, - ]); - } - } - - if (!empty($item['radiation_resistance'])) { - $model->radiationResistance()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'maximum_radiation_capacity' => $item['radiation_resistance']['maximum_radiation_capacity'], - 'radiation_dissipation_rate' => $item['radiation_resistance']['radiation_dissipation_rate'], - ]); - } - } -} diff --git a/app/Jobs/SC/Import/Food.php b/app/Jobs/SC/Import/Food.php deleted file mode 100644 index fa9ede75f..000000000 --- a/app/Jobs/SC/Import/Food.php +++ /dev/null @@ -1,57 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\Food($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - - /** @var \App\Models\SC\Food\Food $model */ - $model = \App\Models\SC\Food\Food::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'nutritional_density_rating' => $item['nutritional_density_rating'] ?? null, - 'hydration_efficacy_index' => $item['hydration_efficacy_index'] ?? null, - 'container_type' => $item['container_type'] ?? null, - 'one_shot_consume' => $item['one_shot_consume'] ?? null, - 'can_be_reclosed' => $item['can_be_reclosed'] ?? null, - 'discard_when_consumed' => $item['discard_when_consumed'] ?? null, - ]); - - $ids = collect($item['effects'])->map(function (string $effect) { - return FoodEffect::firstOrCreate([ - 'name' => $effect, - ])->id; - }); - - $model->effects()->sync($ids); - } -} diff --git a/app/Jobs/SC/Import/Grenade.php b/app/Jobs/SC/Import/Grenade.php deleted file mode 100644 index 4b29c27c5..000000000 --- a/app/Jobs/SC/Import/Grenade.php +++ /dev/null @@ -1,45 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\Grenade($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - - /** @var \App\Models\SC\Char\Grenade $model */ - \App\Models\SC\Char\Grenade::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'aoe' => $item['aoe'] ?? null, - 'damage_type' => $item['damage_type'] ?? null, - 'damage' => $item['damage'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/Import/HackingChip.php b/app/Jobs/SC/Import/HackingChip.php deleted file mode 100644 index cea5900e9..000000000 --- a/app/Jobs/SC/Import/HackingChip.php +++ /dev/null @@ -1,45 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\HackingChip($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - - /** @var \App\Models\SC\ItemSpecification\HackingChip $model */ - \App\Models\SC\ItemSpecification\HackingChip::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'max_charges' => $item['max_charges'] ?? null, - 'duration_multiplier' => $item['duration_multiplier'] ?? null, - 'error_chance' => $item['error_chance'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/Import/Item.php b/app/Jobs/SC/Import/Item.php deleted file mode 100644 index 8498e26ce..000000000 --- a/app/Jobs/SC/Import/Item.php +++ /dev/null @@ -1,352 +0,0 @@ -data = $data; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $manufacturer = ManufacturerFixer::getByName($this->data['manufacturer']['name']); - if ($manufacturer !== null) { - $this->data['manufacturer']['name'] = $manufacturer['name_fix'] ?? $manufacturer['name']; - $this->data['manufacturer']['code'] = $manufacturer['code']; - } - - $manufacturer = Manufacturer::updateOrCreate([ - 'uuid' => $this->data['manufacturer']['uuid'], - ], [ - 'name' => $this->data['manufacturer']['name'], - 'code' => $this->data['manufacturer']['code'], - ]); - - /** @var \App\Models\SC\Item\Item $itemModel */ - $itemModel = \App\Models\SC\Item\Item::query()->withoutGlobalScopes()->updateOrCreate([ - 'uuid' => $this->data['uuid'], - ], [ - 'name' => $this->data['name'], - 'type' => $this->data['type'], - 'sub_type' => $this->data['sub_type'], - 'manufacturer_description' => $this->data['manufacturer_description'], - 'size' => $this->data['size'], - 'class_name' => $this->data['class_name'], - 'mass' => $this->data['mass'], - 'version' => config('api.sc_data_version'), - 'manufacturer_id' => $manufacturer->id, - ]); - - if (! empty($this->data['description'])) { - $itemModel->translations()->updateOrCreate([ - 'locale_code' => Language::ENGLISH, - ], [ - 'translation' => $this->data['description'], - ]); - } - - if (! empty($this->data['description_zh'])) { - $itemModel->translations()->updateOrCreate([ - 'locale_code' => Language::CHINESE, - ], [ - 'translation' => $this->data['description_zh'], - ]); - } - - $data = collect($this->data['description_data'] ?? [])->filter(function ($value, $key) { - return $key !== 'description'; - })->each(function ($value, $key) use ($itemModel) { - $itemModel->descriptionData()->updateOrCreate([ - 'name' => trim($key), - ], [ - 'value' => trim($value), - ]); - })->keys(); - $itemModel->descriptionData()->whereNotIn('name', $data)->delete(); - - $this->createDimensionModel($itemModel); - $this->createContainerModel($itemModel); - $this->createPorts($itemModel); - $this->createPowerModel($itemModel); - $this->createHeatModel($itemModel); - $this->createDistortionModel($itemModel); - $this->createDurabilityModel($itemModel); - $this->addTags($itemModel, $this->data, 'tags'); - $this->addTags($itemModel, $this->data, 'required_tags', true); - $this->addInteractions($itemModel, $this->data); - $this->addEntityTags($itemModel, $this->data); - } - - private function createDimensionModel(\App\Models\SC\Item\Item $itemModel): void - { - $itemModel->dimensions()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - 'override' => 0, - ], [ - 'width' => $this->data['dimension']['width'], - 'height' => $this->data['dimension']['height'], - 'length' => $this->data['dimension']['length'], - - 'volume' => $this->data['volume'], - ]); - - if ($this->data['dimension_override']['width'] !== null) { - $itemModel->dimensions()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - 'override' => 1, - ], [ - 'width' => $this->data['dimension_override']['width'], - 'height' => $this->data['dimension_override']['height'], - 'length' => $this->data['dimension_override']['length'], - ]); - } - } - - private function createContainerModel(\App\Models\SC\Item\Item $itemModel): void - { - if ($this->data['inventory_container']['scu'] !== null) { - $itemModel->container()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - ], [ - 'width' => $this->data['inventory_container']['width'], - 'height' => $this->data['inventory_container']['height'], - 'length' => $this->data['inventory_container']['length'], - 'scu' => $this->data['inventory_container']['scu'], - 'unit' => $this->data['inventory_container']['unit'], - ]); - } - } - - private function createPorts(\App\Models\SC\Item\Item $itemModel): void - { - if (! empty($this->data['ports'])) { - $availablePorts = collect($this->data['ports'])->each(function (array $port) use ($itemModel) { - /** @var ItemPort $port */ - $portModel = $itemModel->ports()->updateOrCreate([ - 'name' => $port['name'], - ], [ - 'display_name' => $port['display_name'], - 'equipped_item_uuid' => $port['equipped_item_uuid'], - 'min_size' => $port['min_size'], - 'max_size' => $port['max_size'], - 'position' => $port['position'], - ]); - - $this->addTags($portModel, $port, 'tags'); - $this->addTags($portModel, $port, 'required_tags', true); - - $types = collect($port['compatible_types']) - ->map(function (array $type) { - /** @var ItemType $typeModel */ - $typeModel = ItemType::query()->firstOrCreate([ - 'type' => $type['type'], - ]); - - $type['id'] = $typeModel->id; - - return $type; - }) - ->each(function (array $type) use ($portModel) { - /** @var ItemPort $portModel */ - $portModelType = $portModel->compatibleTypes()->updateOrCreate([ - 'item_type_id' => $type['id'], - ]); - - $subTypes = collect($type['sub_types']) - ->map(function (string $subType) { - /** @var ItemSubType $typeModel */ - $typeModel = ItemSubType::query()->firstOrCreate([ - 'sub_type' => $subType, - ]); - - return $typeModel->id; - }) - ->each(function (int $id) use ($portModelType) { - /** @var ItemPortType $portModelType */ - $portModelType->subTypes()->updateOrCreate([ - 'sub_type_id' => $id, - ]); - }); - - /** @var ItemPortType $portModelType */ - $portModelType->subTypes()->whereNotIn('sub_type_id', $subTypes)->delete(); - }) - ->pluck('id'); - - /** @var ItemPort $portModel */ - $portModel->compatibleTypes()->whereNotIn('item_type_id', $types)->delete(); - }) - ->pluck('name'); - - // Remove old ports - $itemModel->ports()->whereNotIn('name', $availablePorts)->delete(); - } - } - - private function createPowerModel(\App\Models\SC\Item\Item $itemModel): void - { - if (! empty($this->data['power'])) { - $itemModel->powerData()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - ], [ - 'power_base' => $this->data['power']['power_base'] ?? null, - 'power_draw' => $this->data['power']['power_draw'] ?? null, - 'throttleable' => $this->data['power']['throttleable'] ?? null, - 'overclockable' => $this->data['power']['overclockable'] ?? null, - 'overclock_threshold_min' => $this->data['power']['overclock_threshold_min'] ?? null, - 'overclock_threshold_max' => $this->data['power']['overclock_threshold_max'] ?? null, - 'overclock_performance' => $this->data['power']['overclock_performance'] ?? null, - 'overpower_performance' => $this->data['power']['overpower_performance'] ?? null, - 'power_to_em' => $this->data['power']['power_to_em'] ?? null, - 'decay_rate_em' => $this->data['power']['decay_rate_em'] ?? null, - ]); - } - } - - private function createHeatModel(\App\Models\SC\Item\Item $itemModel): void - { - if (! empty($this->data['heat'])) { - $itemModel->heatData()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - ], [ - 'temperature_to_ir' => $this->data['heat']['temperature_to_ir'] ?? null, - 'ir_temperature_threshold' => $this->data['heat']['ir_temperature_threshold'] ?? null, - 'overpower_heat' => $this->data['heat']['overpower_heat'] ?? null, - 'overclock_threshold_min' => $this->data['heat']['overclock_threshold_min'] ?? null, - 'overclock_threshold_max' => $this->data['heat']['overclock_threshold_max'] ?? null, - 'thermal_energy_base' => $this->data['heat']['thermal_energy_base'] ?? null, - 'thermal_energy_draw' => $this->data['heat']['thermal_energy_draw'] ?? null, - 'thermal_conductivity' => $this->data['heat']['thermal_conductivity'] ?? null, - 'specific_heat_capacity' => $this->data['heat']['specific_heat_capacity'] ?? null, - 'mass' => $this->data['heat']['mass'] ?? null, - 'surface_area' => $this->data['heat']['surface_area'] ?? null, - 'start_cooling_temperature' => $this->data['heat']['start_cooling_temperature'] ?? null, - 'max_cooling_rate' => $this->data['heat']['max_cooling_rate'] ?? null, - 'max_temperature' => $this->data['heat']['max_temperature'] ?? null, - 'min_temperature' => $this->data['heat']['min_temperature'] ?? null, - 'overheat_temperature' => $this->data['heat']['overheat_temperature'] ?? null, - 'recovery_temperature' => $this->data['heat']['recovery_temperature'] ?? null, - 'misfire_min_temperature' => $this->data['heat']['misfire_min_temperature'] ?? null, - 'misfire_max_temperature' => $this->data['heat']['misfire_max_temperature'] ?? null, - ]); - } - } - - private function createDistortionModel(\App\Models\SC\Item\Item $itemModel): void - { - if (! empty($this->data['distortion'])) { - $itemModel->distortionData()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - ], [ - 'decay_delay' => $this->data['distortion']['decay_delay'] ?? null, - 'decay_rate' => $this->data['distortion']['decay_rate'] ?? null, - 'maximum' => $this->data['distortion']['maximum'] ?? null, - 'warning_ratio' => $this->data['distortion']['warning_ratio'] ?? null, - 'overload_ratio' => $this->data['distortion']['overload_ratio'] ?? null, - 'recovery_ratio' => $this->data['distortion']['recovery_ratio'] ?? null, - 'recovery_time' => $this->data['distortion']['recovery_time'] ?? null, - ]); - } - } - - private function createDurabilityModel(\App\Models\SC\Item\Item $itemModel): void - { - if (! empty($this->data['durability'])) { - $itemModel->durabilityData()->updateOrCreate([ - 'item_uuid' => $this->data['uuid'], - ], [ - 'health' => $this->data['durability']['health'] ?? null, - 'max_lifetime' => $this->data['durability']['lifetime'] ?? null, - 'salvageable' => $this->data['durability']['salvageable'] ?? null, - 'repairable' => $this->data['durability']['repairable'] ?? null, - ]); - } - } - - private function addTags($model, $data, string $key, bool $isRequiredTag = false): void - { - if (empty($data[$key])) { - return; - } - - $tags = collect(explode(' ', $data[$key])) - ->map('trim') - ->map('strtolower') - ->map(function ($tag) { - $tag = Tag::query()->firstOrCreate([ - 'name' => $tag, - ]); - - return $tag->id; - }); - - $model->tags()->syncWithPivotValues($tags, ['is_required_tag' => $isRequiredTag]); - } - - private function addInteractions($model, $data): void - { - if (empty($data['interactions'])) { - return; - } - - $interactions = collect($data['interactions']) - ->map(function ($interaction) { - $interaction = Interaction::query()->firstOrCreate([ - 'name' => $interaction, - ]); - - return $interaction->id; - }); - - $model->interactions()->sync($interactions); - } - - private function addEntityTags(\App\Models\SC\Item\Item $model, $data): void - { - if (empty($data['entity_tags'])) { - return; - } - - $tags = collect($data['entity_tags']) - ->map('trim') - ->map(function ($tag) { - $tag = EntityTag::query()->firstOrCreate([ - 'tag' => $tag, - ]); - - return $tag->id; - }); - - $model->entityTags()->sync($tags); - } -} diff --git a/app/Jobs/SC/Import/ItemSpecificationCreator.php b/app/Jobs/SC/Import/ItemSpecificationCreator.php deleted file mode 100644 index 18a21bbfd..000000000 --- a/app/Jobs/SC/Import/ItemSpecificationCreator.php +++ /dev/null @@ -1,97 +0,0 @@ - Grenade::dispatch($filePath), - 'Knife' => Knife::dispatch($filePath), - default => PersonalWeapon::dispatch($filePath), - }; - break; - case $type === 'WeaponAttachment': - WeaponAttachment::dispatch($filePath); - WeaponModifier::dispatch($filePath); - break; - - case $subType === 'Hacking': - HackingChip::dispatch($filePath); - break; - - // Mining - case stripos($type, 'WeaponMining') !== false: - MiningLaser::dispatch($filePath); - break; - - // Vehicle Items - case stripos($type, 'Arm') !== false: - case stripos($type, 'Armor') !== false: - case stripos($type, 'Battery') !== false: - case stripos($type, 'Bomb') !== false: - case stripos($type, 'Cooler') !== false: - case stripos($type, 'EMP') !== false: - case stripos($type, 'ExternalFuelTank') !== false: - case stripos($type, 'FlightController') !== false: - case stripos($type, 'FuelIntake') !== false: - case stripos($type, 'FuelTank') !== false: - case stripos($type, 'MainThruster') !== false: - case stripos($type, 'ManneuverThruster') !== false: - case stripos($type, 'Missile') !== false: - case stripos($type, 'Mount') !== false: - case stripos($type, 'Paints') !== false: - case stripos($type, 'PowerPlant') !== false: - case stripos($type, 'QuantumDrive') !== false: - case stripos($type, 'QuantumFuelTank') !== false: - case stripos($type, 'QuantumInterdictionGenerator') !== false: - case stripos($type, 'Radar') !== false: - case stripos($type, 'SalvageModifier') !== false: - case stripos($type, 'SelfDestruct') !== false: - case stripos($type, 'Shield') !== false: - case stripos($type, 'TowingBeam') !== false: - case stripos($type, 'TractorBeam') !== false: - case stripos($type, 'Turret') !== false: - case stripos($type, 'WeaponDefensive') !== false: - case stripos($type, 'WeaponGun') !== false: - case stripos($type, 'WheeledController') !== false: - case in_array($type, [ - 'BombLauncher', - 'MiningArm', - 'MissileLauncher', - 'ToolArm', - 'Turret', - 'TurretBase', - 'UtilityTurret', - 'WeaponMount', - ]): - VehicleItem::dispatch($filePath); - break; - - default: - break; - } - } -} diff --git a/app/Jobs/SC/Import/Knife.php b/app/Jobs/SC/Import/Knife.php deleted file mode 100644 index 302341eeb..000000000 --- a/app/Jobs/SC/Import/Knife.php +++ /dev/null @@ -1,79 +0,0 @@ -loadLabels(); - try { - $parser = new Weapon($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - if (empty($item['knife'])) { - return; - } - - $this->createConfig($item['knife']); - - \App\Models\SC\Char\PersonalWeapon\Knife::updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'can_be_used_for_take_down' => $item['knife']['can_be_used_for_take_down'] ?? null, - 'can_block' => $item['knife']['can_block'] ?? null, - 'can_be_used_in_prone' => $item['knife']['can_be_used_in_prone'] ?? null, - 'can_dodge' => $item['knife']['can_dodge'] ?? null, - 'melee_combat_config_uuid' => $item['knife']['melee_combat_config'] ?? null, - ]); - } - - private function createConfig(array $data): void - { - collect($data['attack_config'])->each(function (array $config) use ($data) { - /** @var MeleeCombatConfig $configModel */ - $configModel = MeleeCombatConfig::query()->firstOrCreate([ - 'uuid' => $data['melee_combat_config'], - 'category' => $config['actionCategory'], - ], [ - 'stun_recovery_modifier' => $config['stunRecoveryModifier'], - 'block_stun_reduction_modifier' => $config['blockStunReductionModifier'], - 'block_stun_stamina_modifier' => $config['blockStunStaminaModifier'], - 'attack_impulse' => $config['attackImpulse'], - 'ignore_body_part_impulse_scale' => $config['ignoreBodyPartImpulseScale'], - 'fullbody_animation' => $config['fullbodyAnimation'], - ]); - - collect($config['damageInfo'])->each(function (float $damage, string $key) use ($configModel) { - $configModel->damages()->updateOrCreate([ - 'name' => strtolower(str_replace('Damage', '', $key)), - ], [ - 'damage' => $damage, - ]); - }); - }); - } -} diff --git a/app/Jobs/SC/Import/MiningLaser.php b/app/Jobs/SC/Import/MiningLaser.php deleted file mode 100644 index 0e3eccdd3..000000000 --- a/app/Jobs/SC/Import/MiningLaser.php +++ /dev/null @@ -1,47 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\MiningLaser($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - - /** @var \App\Models\SC\ItemSpecification\MiningLaser $model */ - \App\Models\SC\ItemSpecification\MiningLaser::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'power_transfer' => $item['power_transfer'] ?? null, - 'optimal_range' => $item['optimal_range'] ?? null, - 'maximum_range' => $item['maximum_range'] ?? null, - 'extraction_throughput' => $item['extraction_throughput'] ?? null, - 'module_slots' => $item['module_slots'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/Import/MiningModule.php b/app/Jobs/SC/Import/MiningModule.php deleted file mode 100644 index 4e53901a7..000000000 --- a/app/Jobs/SC/Import/MiningModule.php +++ /dev/null @@ -1,43 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\MiningModule($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $item = $parser->getData(); - - /** @var \App\Models\SC\ItemSpecification\MiningModule $model */ - \App\Models\SC\ItemSpecification\MiningModule::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'type' => $item['type'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/Import/PersonalWeapon.php b/app/Jobs/SC/Import/PersonalWeapon.php deleted file mode 100644 index 221bc649d..000000000 --- a/app/Jobs/SC/Import/PersonalWeapon.php +++ /dev/null @@ -1,98 +0,0 @@ -loadLabels(); - try { - $parser = new Weapon($this->filePath, $this->labels); - } catch (JsonException|FileNotFoundException $e) { - $this->fail($e->getMessage()); - - return; - } - - $item = $parser->getData(); - - try { - $itemModel = PersonalWeaponModel::query()->withoutGlobalScopes()->where('uuid', $item['uuid'])->firstOrFail(); - } catch (ModelNotFoundException $e) { - return; - } - - $this->addAmmunition($item); - $this->addModes($item, $itemModel); - $this->addLoadout($item, $itemModel); - } - - private function addAmmunition(array $data): void - { - if (empty($data['ammunition']['uuid']) || empty($data['uuid'])) { - return; - } - - (new Ammunition($data))->handle(); - } - - private function addModes(array $data, PersonalWeaponModel $weapon): void - { - if (empty($data['modes'])) { - return; - } - - collect($data['modes']) - ->filter(fn ($e) => isset($e['type'])) - ->each(function (array $mode) use ($weapon) { - $weapon->modes()->updateOrCreate([ - 'mode' => $mode['mode'], - ], [ - 'localised' => $mode['localised'], - 'type' => $mode['type'], - 'rounds_per_minute' => $mode['rounds_per_minute'] ?? 0, - 'ammo_per_shot' => $mode['ammo_per_shot'] ?? 0, - 'pellets_per_shot' => $mode['pellets_per_shot'] ?? 0, - ]); - }); - } - - private function addLoadout(array $data, PersonalWeaponModel $weapon): void - { - /** @var Collection $ports */ - $ports = $weapon->ports; - - if ($ports === null || $ports->isEmpty()) { - return; - } - - collect($data['attachments'])->each(function (array $attachment) use ($ports) { - $port = $ports->where('name', $attachment['port'])->first(); - $port?->update([ - 'equipped_item_uuid' => $attachment['uuid'], - ]); - }); - } -} diff --git a/app/Jobs/SC/Import/ShopItems.php b/app/Jobs/SC/Import/ShopItems.php deleted file mode 100644 index 2680e4e68..000000000 --- a/app/Jobs/SC/Import/ShopItems.php +++ /dev/null @@ -1,104 +0,0 @@ -manufacturers = (new Manufacturers)->getData(); - - try { - $shops = new Shops; - } catch (\JsonException|FileNotFoundException $e) { - $this->fail($e->getMessage()); - - return; - } - - $shops->getData() - ->each(function ($shop) { - /** @var Shop $shop */ - $shopModel = Shop::updateOrCreate([ - 'uuid' => $shop['shop']['uuid'], - ], [ - 'name_raw' => $shop['shop']['name_raw'], - 'name' => $shop['shop']['name'], - 'position' => $shop['shop']['position'], - 'profit_margin' => $shop['shop']['profit_margin'], - 'version' => config('api.sc_data_version'), - ]); - - $toSync = $shop['inventory'] - //->unique('uuid') - ->mapWithKeys(function ($inventory) use ($shopModel) { - /** @var Item $itemModel */ - $itemModel = Item::query()->where('uuid', $inventory['uuid'])->first(); - - if ($itemModel === null) { - return ['unknown' => null]; - } - - // TODO: Extract - if ($inventory['rentable'] === true && isset($inventory['rental']) && ! empty($inventory['rental'])) { - ShopItemRental::updateOrCreate([ - 'item_uuid' => $itemModel->uuid, - 'shop_uuid' => $shopModel->uuid, - 'node_uuid' => $inventory['node_uuid'], - ], $inventory['rental'] + ['version' => config('api.sc_data_version')]); - } - - return [ - $itemModel->id => [ - 'item_uuid' => $itemModel->uuid, - 'shop_uuid' => $shopModel->uuid, - 'node_uuid' => $inventory['node_uuid'], - 'base_price' => round($inventory['base_price'], 10), - 'base_price_offset' => $inventory['base_price_offset'], - 'max_discount' => $inventory['max_discount'], - 'max_premium' => $inventory['max_premium'], - 'inventory' => $inventory['inventory'], - 'optimal_inventory' => $inventory['optimal_inventory'], - 'max_inventory' => $inventory['max_inventory'], - 'auto_restock' => $inventory['auto_restock'], - 'auto_consume' => $inventory['auto_consume'], - 'refresh_rate' => round($inventory['refresh_rate'], 10), - 'buyable' => $inventory['buyable'], - 'sellable' => $inventory['sellable'], - 'rentable' => $inventory['rentable'], - 'version' => config('api.sc_data_version'), - ], - ]; - }) - ->filter(function ($item) { - return $item !== null; - }); - - $shopModel->items()->sync($toSync); - }); - } -} diff --git a/app/Jobs/SC/Import/Vehicle.php b/app/Jobs/SC/Import/Vehicle.php deleted file mode 100644 index 8994473ee..000000000 --- a/app/Jobs/SC/Import/Vehicle.php +++ /dev/null @@ -1,507 +0,0 @@ -hardpoints = new Collection; - $this->parts = new Collection; - - $this->minPartDamage = 100; - } - - public function handle(): void - { - $manufacturers = (new Manufacturers)->getData(); - - $vehicle = $this->shipData; - - try { - $rawData = File::get($vehicle['filePathRaw']); - - $vehicle['rawData'] = json_decode($rawData, true, 512, JSON_THROW_ON_ERROR); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e->getMessage()); - } - - if (! isset($vehicle['rawData']['Raw']['Entity']['__ref'])) { - return; - } - - /** @var \App\Models\SC\Vehicle\Vehicle $vehicleModel */ - $vehicleModel = \App\Models\SC\Vehicle\Vehicle::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $vehicle['rawData']['Raw']['Entity']['__ref'], - ], $this->getVehicleModelArray($vehicle) + ['class_name' => $vehicle['ClassName']]); - - if (! $vehicleModel->item === null || ! optional($vehicleModel->item)->exists) { - $itemParser = new \App\Services\Parser\SC\Item( - $vehicle['filePathRaw'], - $manufacturers - ); - - $data = $itemParser->getData(); - - if ($data !== null) { - (new Item($data))->handle(); - } - } else { - $vehicleModel->item->update([ - 'version' => config('api.sc_data_version'), - ]); - } - - // Manually override the Fury Manufacturer - if (in_array($vehicle['rawData']['Raw']['Entity']['__ref'], [ - '96b11061-68ce-4896-9424-fc8804a410ae', - '469d850e-b86b-47fc-9ee2-df81d775ccc8', - ], true) && $vehicleModel->item?->manufacturer_id === 1) { - $mirai = Manufacturer::query()->where('name', 'Mirai')->where('code', '<>', '')->first(); - if ($mirai?->exists ?? false) { - $vehicleModel->item->update([ - 'manufacturer_id' => $mirai->id, - ]); - } - } - - $vehicleModel->refresh(); - if (Arr::get($vehicle, 'Inventory') !== null) { - $vehicleModel->item->container()->updateOrCreate([ - 'item_uuid' => $vehicle['rawData']['Raw']['Entity']['__ref'], - ], [ - 'width' => Arr::get($vehicle, 'Inventory.x'), - 'height' => Arr::get($vehicle, 'Inventory.y'), - 'length' => Arr::get($vehicle, 'Inventory.z'), - 'scu' => Arr::get($vehicle, 'Inventory.SCU'), - 'unit' => Arr::get($vehicle, 'Inventory.unit'), - ]); - } - - $this->createHardpoints($vehicleModel, $vehicle['rawData']); - - $vehicleModel->hardpoints()->whereNotIn('hardpoint_name', $this->hardpoints)->delete(); - $vehicleModel->parts()->whereNotIn('name', $this->parts)->delete(); - $this->createHandlingModel($vehicleModel, $vehicle['rawData']['Raw']); - - if (Arr::get($vehicle, 'CargoGrids') !== null) { - collect(Arr::get($vehicle, 'CargoGrids'))->each(function ($grid) use ($vehicleModel) { - $vehicleModel->cargoGrids()->updateOrCreate([ - 'container_uuid' => $grid['uuid'], - ], [ - 'capacity' => Arr::get($grid, 'SCU'), - 'unit_name' => Arr::get($grid, 'unitName'), - 'x' => Arr::get($grid, 'x'), - 'y' => Arr::get($grid, 'y'), - 'z' => Arr::get($grid, 'z'), - 'min_x' => Arr::get($grid, 'minSize.x'), - 'min_y' => Arr::get($grid, 'minSize.y'), - 'min_z' => Arr::get($grid, 'minSize.z'), - 'max_x' => Arr::get($grid, 'maxSize.x'), - 'max_y' => Arr::get($grid, 'maxSize.y'), - 'max_z' => Arr::get($grid, 'maxSize.z'), - 'is_open' => Arr::get($grid, 'isOpenContainer'), - 'is_external' => Arr::get($grid, 'isExternalContainer'), - 'is_closed' => Arr::get($grid, 'isClosedContainer'), - ]); - }); - } - } - - public function getVehicleModelArray(array $vehicle): array - { - $key = isset($vehicle['FlightCharacteristics']) ? 'FlightCharacteristics' : 'DriveCharacteristics'; - - $data = [ - 'item_uuid' => $vehicle['rawData']['Raw']['Entity']['__ref'], - - 'shipmatrix_id' => $this->tryGetShipmatrixIdForVehicle($vehicle)->id ?? 0, - 'name' => $vehicle['Name'], - 'career' => $vehicle['Career'], - 'role' => $vehicle['Role'], - 'is_ship' => (bool) $vehicle['IsSpaceship'], - 'size' => $vehicle['Size'], - 'width' => $vehicle['Width'] ?? 0, - 'height' => $vehicle['Height'] ?? 0, - 'length' => $vehicle['Length'] ?? 0, - - 'crew' => $vehicle['Crew'] ?? 1, - 'weapon_crew' => $vehicle['WeaponCrew'] ?? 0, - 'operations_crew' => $vehicle['OperationsCrew'] ?? 0, - 'mass' => $vehicle['Mass'], - 'cargo_capacity' => $vehicle['Cargo'], - 'health' => $vehicle['Health'] ?? null, - 'shield_face_type' => $vehicle['ShieldFaceType'] ?? null, - - 'acceleration_main' => $this->numFormat(Arr::get($vehicle, $key.'.Acceleration.Main', 0)), - 'acceleration_retro' => $this->numFormat(Arr::get($vehicle, $key.'.Acceleration.Retro', 0)), - 'acceleration_vtol' => $this->numFormat(Arr::get($vehicle, $key.'.Acceleration.Vtol', 0)), - 'acceleration_maneuvering' => $this->numFormat(Arr::get($vehicle, $key.'.Acceleration.Maneuvering', 0)), - - 'acceleration_g_main' => $this->numFormat(Arr::get($vehicle, $key.'.AccelerationG.Main', 0)), - 'acceleration_g_retro' => $this->numFormat(Arr::get($vehicle, $key.'.AccelerationG.Retro', 0)), - 'acceleration_g_vtol' => $this->numFormat(Arr::get($vehicle, $key.'.AccelerationG.Vtol', 0)), - 'acceleration_g_maneuvering' => $this->numFormat(Arr::get($vehicle, $key.'.AccelerationG.Maneuvering', 0)), - - 'claim_time' => $this->numFormat($vehicle['Insurance']['StandardClaimTime'] ?? 0), - 'expedite_time' => $this->numFormat($vehicle['Insurance']['ExpeditedClaimTime'] ?? 0), - 'expedite_cost' => $this->numFormat($vehicle['Insurance']['ExpeditedCost'] ?? 0), - - 'zero_to_scm' => $this->numFormat($vehicle[$key]['ZeroToScm'] ?? 0), - 'zero_to_max' => $this->numFormat($vehicle[$key]['ZeroToMax'] ?? 0), - - 'scm_to_zero' => $this->numFormat($vehicle[$key]['ScmToZero'] ?? 0), - 'max_to_zero' => $this->numFormat($vehicle[$key]['MaxToZero'] ?? 0), - ]; - - return $data; - } - - /** - * As some in-game ship names differ from the ship matrix, we try to catch this here - * Currently an in-game ship needs to have an accompanying ship-matrix entry - * - * @return Builder|Model|object|null - */ - private function tryGetShipmatrixIdForVehicle(array $vehicle) - { - $name = str_replace('_', ' ', $vehicle['Name']); - $nameFix = explode(' ', $name); - array_shift($nameFix); - $name = implode(' ', $nameFix ?? $vehicle['Name']); - $nameDashed = implode('-', $nameFix ?? $vehicle['Name']); - - $className = explode('_', $vehicle['ClassName']); - array_shift($className); - - switch ($vehicle['Name']) { - case 'Aegis Retaliator': - $name = 'Retaliator Bomber'; - break; - - case 'Anvil C8R Pisces Rescue': - $name = 'C8R Pisces'; - break; - - case 'Anvil F7C-M Hornet Heartseeker': - $name = 'F7C-M Super Hornet Heartseeker'; - break; - - case 'Origin 600i': - $name = '600i Explorer'; - break; - - case 'C.O. Mustang CitizenCon 2948 Edition': - $name = 'Mustang Alpha Vindicator'; - break; - - case 'Crusader A2 Hercules Starlifter': - $name = 'A2 Hercules'; - break; - - case 'Crusader C2 Hercules Starlifter': - $name = 'C2 Hercules'; - break; - - case 'Crusader M2 Hercules Starlifter': - $name = 'M2 Hercules'; - break; - - case 'Crusader Mercury Star Runner': - $name = 'Mercury'; - break; - - case 'Crusader Ares Star Fighter Ion': - $name = 'Ares Ion'; - break; - - case 'Crusader Ares Star Fighter Inferno': - $name = 'Ares Inferno'; - break; - - case 'Drake Dragonfly': - $name = 'Dragonfly Black'; - break; - - case 'Kruger P-72 Archimedes': - $name = 'P-72 Archimedes'; - break; - - case 'Origin M50 Interceptor': - $name = 'M50'; - break; - - case 'Origin 85X Limited': - $name = '85X'; - break; - } - - return $this->queryForName(['name', $name]) ?? - $this->queryForName(['name', 'LIKE', sprintf('%%%s%%', $name)]) ?? - $this->queryForName(['name', $nameDashed]) ?? - $this->queryForName(['name', 'LIKE', sprintf('%%%s%%', $nameDashed)]); - } - - /** - * Just a small query wrapper - */ - private function queryForName(array $config): ?Model - { - return \App\Models\StarCitizen\Vehicle\Vehicle\Vehicle::query()->where(...$config)->first(); - } - - /** - * "Rounds" to a given precision - */ - private function numFormat($data): float|int - { - $num = $data ?? 0; - - if ($num === 'NaN' || $num === 'Infinity') { - return 0; - } - - $negation = ($num < 0) ? (-1) : 1; - $coefficient = 10 ** 3; - - return $negation * floor((abs((float) $num) * $coefficient)) / $coefficient; - } - - private function getItem(string $search): ?\App\Models\SC\Item\Item - { - return \App\Models\SC\Item\Item::query() - ->withoutGlobalScopes() - ->where('uuid', $search) - ->orWhere('class_name', strtolower($search)) - ->first(); - } - - /** - * Creates all hardpoints found on a vehicle - * Iterates through all sup-hardpoints also - */ - private function createHardpoints(\App\Models\SC\Vehicle\Vehicle $vehicle, array $rawData): void - { - $entries = Arr::get( - $rawData, - 'Raw.Entity.Components.SEntityComponentDefaultLoadoutParams.loadout.SItemPortLoadoutManualParams.entries' - ); - - if ($entries === null) { - return; - } - - $hardpoints = []; - $this->mapHardpoints(Arr::get($rawData, 'Vehicle.Parts', []), $hardpoints); - - $hardpoints = array_reverse($hardpoints); - - collect($entries) - ->chunk(5) - ->each(function (Collection $entries) use ($hardpoints, $vehicle) { - $entries - ->each(function ($hardpoint) use ($hardpoints, $vehicle) { - $item = null; - if (! empty($hardpoint['entityClassReference']) && $hardpoint['entityClassReference'] !== '00000000-0000-0000-0000-000000000000') { - $item = $this->getItem($hardpoint['entityClassReference']); - } elseif (! empty($hardpoint['entityClassName'])) { - $item = $this->getItem($hardpoint['entityClassName']); - } - - $itemPortName = strtolower($hardpoint['itemPortName']); - $this->hardpoints->push($hardpoint['itemPortName']); - - /** @var Hardpoint $point */ - $point = $vehicle->hardpoints()->updateOrCreate([ - 'hardpoint_name' => $hardpoint['itemPortName'], - ], [ - 'class_name' => $item?->class_name ?? $hardpoint['entityClassName'] ?? null, - 'equipped_item_uuid' => $item?->uuid ?? $hardpoint['entityClassReference'] ?? null, - 'min_size' => $hardpoints[$itemPortName]['ItemPort']['minSize'] ?? null, - 'max_size' => $hardpoints[$itemPortName]['ItemPort']['maxSize'] ?? null, - ]); - - $this->createSubPoint( - Arr::get($hardpoint, 'loadout.SItemPortLoadoutManualParams.entries', []), - $point, - $vehicle - ); - }); - }); - - // Add Hardpoints only found on the Vehicle.Parts key - collect($hardpoints) - // Create vehicle parts - ->each(function ($hardpoint) use ($vehicle) { - $isBaseBody = $hardpoint['class'] === 'Animated' && isset($hardpoint['scopeContext']); - $isPart = ! empty($hardpoint['name']) && isset($hardpoint['damageMax'])/* && $hardpoint['damageMax'] > $this->minPartDamage*/; - - if ($isBaseBody || $isPart) { - if (! empty($hardpoint['parent'])) { - $hardpoint['parent'] = $vehicle->parts()->where('name', $hardpoint['parent'])->first()->id ?? null; - } - - $vehicle->parts()->updateOrCreate([ - 'name' => $hardpoint['name'], - ], [ - 'parent_id' => $hardpoint['parent'] ?? null, - 'damage_max' => $hardpoint['damageMax'] ?? 0, - ]); - - $this->parts->push($hardpoint['name']); - } - }) - ->whereNotIn('name', $this->hardpoints) - ->filter(function (array $hardpoint) { - return $hardpoint['class'] === 'ItemPort'; - }) - ->filter(function (array $hardpoint) { - return isset($hardpoint['ItemPort']) && ! empty($hardpoint['ItemPort']['flags']) && ($hardpoint['ItemPort']['minSize'] ?? 0) > 0; - }) - ->filter(function (array $hardpoint) { - // Filter out some - return ! Str::contains($hardpoint['name'], [ - '$slot', - '_trail_', - '_SQUIB_', - 'audio', - 'animated', - 'Helper', - 'LandingGear', - 'gameplay', - 'ObjectContainer', - ], true); - }) - ->filter(function (array $hardpoint) { - return ($hardpoint['skipPart'] ?? false) === false; - }) - ->each(function ($hardpoint) use ($vehicle) { - $where = [ - 'hardpoint_name' => $hardpoint['name'], - ]; - - if (str_starts_with($hardpoint['parent'] ?? '', 'hardpoint')) { - $parent = $vehicle->hardpoints()->where('hardpoint_name', $hardpoint['parent'])->first()?->id; - $where['parent_hardpoint_id'] = $parent; - } - - $vehicle->hardpoints()->updateOrCreate($where, [ - 'min_size' => Arr::get($hardpoint, 'ItemPort.minSize'), - 'max_size' => Arr::get($hardpoint, 'ItemPort.maxSize'), - ]); - - $this->hardpoints->push($hardpoint['name']); - }); - } - - /** - * Flat-maps all hardpoints from hardpoint name to hardpoint data - * This is used to get the min and max sizes later on - */ - private function mapHardpoints(array $parts, array &$out, ?string $parent = null): void - { - foreach ($parts as $part) { - if (! isset($part['name']) || $part === 'xmlParts') { - continue; - } - - if ($parent !== null) { - $part['parent'] = $parent; - } - - if (isset($part['Parts'])) { - $this->mapHardpoints($part['Parts'], $out, $part['name']); - unset($part['Parts']); - } - - unset( - $part['ItemPort']['Connections'], - $part['ItemPort']['ControllerDef'], - $part['ItemPort']['Types'], - $part['Effects'], - $part['DamageBehaviors'], - ); - $out[strtolower($part['name'])] = $part; - } - } - - /** - * This runs on each child hardpoint found on a hardpoint recursively - */ - private function createSubPoint(array $entries, Hardpoint $parent, \App\Models\SC\Vehicle\Vehicle $vehicle): void - { - foreach ($entries as $subPoint) { - if (empty($subPoint['entityClassName']) && empty($subPoint['entityClassReference'])) { - continue; - } - - $item = $this->getItem($subPoint['entityClassReference']) ?? $this->getItem($subPoint['entityClassName']); - - $this->hardpoints->push($subPoint['itemPortName']); - $point = $vehicle->hardpoints()->updateOrCreate([ - 'hardpoint_name' => $subPoint['itemPortName'], - 'parent_hardpoint_id' => $parent->id, - ], [ - 'class_name' => $item?->class_name ?? $subPoint['entityClassName'], - 'equipped_item_uuid' => $item?->uuid, - ]); - - $subEntries = Arr::get($subPoint, 'loadout.SItemPortLoadoutManualParams.entries'); - - if (! empty($subEntries)) { - $this->createSubPoint($subEntries, $point, $vehicle); - } - } - } - - private function createHandlingModel(\App\Models\SC\Vehicle\Vehicle $vehicle, array $rawData): void - { - $handlingData = Arr::get($rawData, 'Vehicle.MovementParams.ArcadeWheeled'); - if ($handlingData === null) { - return; - } - - $vehicle->handling()->updateOrCreate([ - 'max_speed' => Arr::get($handlingData, 'Handling.Power.topSpeed'), - 'reverse_speed' => Arr::get($handlingData, 'Handling.Power.reverseSpeed'), - 'acceleration' => Arr::get($handlingData, 'Handling.Power.acceleration'), - 'deceleration' => Arr::get($handlingData, 'Handling.Power.decceleration'), - 'v0_steer_max' => Arr::get($handlingData, 'v0SteerMax'), - 'kv_steer_max' => Arr::get($handlingData, 'kvSteerMax'), - 'vmax_steer_max' => Arr::get($handlingData, 'vMaxSteerMax'), - ]); - } -} diff --git a/app/Jobs/SC/Import/VehicleItem.php b/app/Jobs/SC/Import/VehicleItem.php deleted file mode 100644 index efc0b86d5..000000000 --- a/app/Jobs/SC/Import/VehicleItem.php +++ /dev/null @@ -1,508 +0,0 @@ -loadLabels(); - - try { - $parser = new \App\Services\Parser\SC\VehicleItems\VehicleItem($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - - $item = $parser->getData(); - - try { - $itemModel = \App\Models\SC\Item\Item::query()->withoutGlobalScopes()->where('uuid', $item['uuid'])->firstOrFail(); - } catch (ModelNotFoundException $e) { - return; - } - - $this->createModelSpecification($item, $itemModel); - } - - private function createModelSpecification(array $item, \App\Models\SC\Item\Item $itemModel): void - { - switch ($itemModel->type) { - case 'Armor': - $this->createArmor($item); - break; - - case 'Bomb': - $this->createBomb($item); - break; - - case 'FlightController': - $this->createFlightController($item); - break; - - case 'Cooler': - $this->createCooler($item); - break; - - case 'EMP': - $this->createEmp($item); - break; - - case 'PowerPlant': - $this->createPowerPlant($item); - break; - - case 'Shield': - $this->createShield($item); - break; - - case 'QuantumDrive': - $this->createQuantumDrive($item); - break; - - case 'QuantumInterdictionGenerator': - $this->createQuantumInterdictionGenerator($item); - break; - - case 'FuelTank': - case 'ExternalFuelTank': - case 'QuantumFuelTank': - $this->createFuelTank($item); - break; - - case 'FuelIntake': - $this->createFuelIntake($item); - break; - - case 'WeaponDefensive': - case 'WeaponGun': - $this->createWeapon($item); - break; - - case 'Missile': - $this->createMissile($item); - break; - - case 'MainThruster': - case 'ManneuverThruster': - $this->createThruster($item); - break; - - case 'SelfDestruct': - $this->createSelfDestruct($item); - break; - - case 'TowingBeam': - case 'TractorBeam': - $this->createTractorBeam($item); - break; - - case 'SalvageModifier': - $this->createSalvageModifier($item); - break; - } - } - - private function createArmor(array $item): void - { - Armor::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'signal_infrared' => $item['armor']['signal_infrared'] ?? null, - 'signal_electromagnetic' => $item['armor']['signal_electromagnetic'] ?? null, - 'signal_cross_section' => $item['armor']['signal_cross_section'] ?? null, - 'damage_physical' => $item['armor']['damage_physical'] ?? null, - 'damage_energy' => $item['armor']['damage_energy'] ?? null, - 'damage_distortion' => $item['armor']['damage_distortion'] ?? null, - 'damage_thermal' => $item['armor']['damage_thermal'] ?? null, - 'damage_biochemical' => $item['armor']['damage_biochemical'] ?? null, - 'damage_stun' => $item['armor']['damage_stun'] ?? null, - ]); - } - - private function createFlightController(array $item): void - { - FlightController::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'scm_speed' => $item['flight_controller']['scm_speed'] ?? null, - 'max_speed' => $item['flight_controller']['max_speed'] ?? null, - 'pitch' => $item['flight_controller']['pitch'] ?? null, - 'yaw' => $item['flight_controller']['yaw'] ?? null, - 'roll' => $item['flight_controller']['roll'] ?? null, - - 'scm_boost_forward' => $item['flight_controller']['scm_boost_forward'] ?? null, - 'scm_boost_backward' => $item['flight_controller']['scm_boost_backward'] ?? null, - 'pitch_boost_multiplier' => $item['flight_controller']['pitch_boost_multiplier'] ?? null, - 'roll_boost_multiplier' => $item['flight_controller']['roll_boost_multiplier'] ?? null, - 'yaw_boost_multiplier' => $item['flight_controller']['yaw_boost_multiplier'] ?? null, - 'afterburner_capacitor' => $item['flight_controller']['afterburner_capacitor'] ?? null, - 'afterburner_idle_cost' => $item['flight_controller']['afterburner_idle_cost'] ?? null, - 'afterburner_linear_cost' => $item['flight_controller']['afterburner_linear_cost'] ?? null, - 'afterburner_angular_cost' => $item['flight_controller']['afterburner_angular_cost'] ?? null, - 'afterburner_regen_per_sec' => $item['flight_controller']['afterburner_regen_per_sec'] ?? null, - 'afterburner_regen_delay_after_use' => $item['flight_controller']['afterburner_regen_delay_after_use'] ?? null, - 'afterburner_pre_delay_time' => $item['flight_controller']['afterburner_pre_delay_time'] ?? null, - 'afterburner_ramp_up_time' => $item['flight_controller']['afterburner_ramp_up_time'] ?? null, - 'afterburner_ramp_down_time' => $item['flight_controller']['afterburner_ramp_down_time'] ?? null, - ]); - } - - private function createEmp(array $item): void - { - Emp::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'charge_duration' => $item['emp']['charge_duration'] ?? null, - 'emp_radius' => $item['emp']['emp_radius'] ?? null, - 'unleash_duration' => $item['emp']['unleash_duration'] ?? null, - 'cooldown_duration' => $item['emp']['cooldown_duration'] ?? null, - ]); - } - - private function createQuantumInterdictionGenerator(array $item): void - { - QuantumInterdictionGenerator::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'jammer_range' => $item['qig']['jammer_range'] ?? null, - 'interdiction_range' => $item['qig']['interdiction_range'] ?? null, - 'charge_duration' => $item['qig']['charge_duration'] ?? null, - 'discharge_duration' => $item['qig']['discharge_duration'] ?? null, - 'cooldown_duration' => $item['qig']['cooldown_duration'] ?? null, - ]); - } - - private function createCooler(array $item): void - { - Cooler::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'cooling_rate' => $item['cooler']['cooling_rate'], - 'suppression_ir_factor' => $item['cooler']['suppression_ir_factor'], - 'suppression_heat_factor' => $item['cooler']['suppression_heat_factor'], - ]); - } - - private function createPowerPlant(array $item): void - { - PowerPlant::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'power_output' => $item['power_plant']['power_output'] ?? 0, - ]); - } - - private function createShield(array $item): void - { - /** @var Shield $shield */ - $shield = Shield::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'max_shield_health' => $item['shield']['max_shield_health'], - 'max_shield_regen' => $item['shield']['max_shield_regen'], - 'decay_ratio' => $item['shield']['decay_ratio'], - 'downed_regen_delay' => $item['shield']['downed_regen_delay'], - 'damage_regen_delay' => $item['shield']['damage_regen_delay'], - 'max_reallocation' => 0, //$item['shield']['max_reallocation'], - 'reallocation_rate' => 0, //$item['shield']['reallocation_rate'], - ]); - - // foreach ($item['shield']['absorptions'] as $type => $absorption) { - // $shield->absorptions()->updateOrCreate([ - // 'ship_shield_id' => $shield->id, - // 'type' => $type - // ], [ - // 'min' => $absorption['min'] ?? 0, - // 'max' => $absorption['max'] ?? 0, - // ]); - // } - } - - private function createQuantumDrive(array $item): void - { - /** @var QuantumDrive $drive */ - $drive = QuantumDrive::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'quantum_fuel_requirement' => $item['quantum_drive']['quantum_fuel_requirement'], - 'jump_range' => $item['quantum_drive']['jump_range'], - 'disconnect_range' => $item['quantum_drive']['disconnect_range'], - 'pre_ramp_up_thermal_energy_draw' => $item['quantum_drive']['pre_ramp_up_thermal_energy_draw'], - 'ramp_up_thermal_energy_draw' => $item['quantum_drive']['ramp_up_thermal_energy_draw'], - 'in_flight_thermal_energy_draw' => $item['quantum_drive']['in_flight_thermal_energy_draw'], - 'ramp_down_thermal_energy_draw' => $item['quantum_drive']['ramp_down_thermal_energy_draw'], - 'post_ramp_down_thermal_energy_draw' => $item['quantum_drive']['post_ramp_down_thermal_energy_draw'], - ]); - - foreach ($item['quantum_drive']['modes'] as $type => $mode) { - $drive->modes()->updateOrCreate([ - 'type' => $type, - ], [ - 'drive_speed' => $mode['drive_speed'], - 'cooldown_time' => $mode['cooldown_time'], - 'stage_one_accel_rate' => $mode['stage_one_accel_rate'], - 'stage_two_accel_rate' => $mode['stage_two_accel_rate'], - 'engage_speed' => $mode['engage_speed'], - 'interdiction_effect_time' => $mode['interdiction_effect_time'], - 'calibration_rate' => $mode['calibration_rate'], - 'min_calibration_requirement' => $mode['min_calibration_requirement'], - 'max_calibration_requirement' => $mode['max_calibration_requirement'], - 'calibration_process_angle_limit' => $mode['calibration_process_angle_limit'], - 'calibration_warning_angle_limit' => $mode['calibration_warning_angle_limit'], - 'spool_up_time' => $mode['spool_up_time'], - ]); - } - } - - private function createFuelTank(array $item): void - { - FuelTank::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'fill_rate' => $item['fuel_tank']['fill_rate'] ?? null, - 'drain_rate' => $item['fuel_tank']['drain_rate'] ?? null, - 'capacity' => $item['fuel_tank']['capacity'] ?? null, - ]); - } - - private function createFuelIntake(array $item): void - { - if ($item['fuel_intake'] === null) { - return; - } - - FuelIntake::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'fuel_push_rate' => $item['fuel_intake']['fuel_push_rate'] ?? null, - 'minimum_rate' => $item['fuel_intake']['minimum_rate'] ?? null, - ]); - } - - private function createWeapon(array $item): void - { - if (empty($item['weapon'])) { - return; - } - - /** @var VehicleWeapon $weapon */ - $weapon = VehicleWeapon::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'weapon_type' => Arr::get($item, 'weapon.weapon_type'), - 'weapon_class' => Arr::get($item, 'weapon.weapon_class'), - 'capacity' => Arr::get($item, 'weapon.capacity'), - 'ammunition_uuid' => $item['weapon']['ammunition']['uuid'] ?? null, - ]); - - if (! empty($item['weapon']['ammunition']['uuid'])) { - (new Ammunition($item['weapon']))->handle(); - } - - collect($item['weapon']['modes'])->each(function (array $mode) use ($weapon) { - $weapon->modes()->updateOrCreate([ - 'mode' => $mode['mode'], - ], [ - 'localised' => $mode['localised'] ?? null, - 'type' => $mode['type'] ?? null, - 'rounds_per_minute' => $mode['rounds_per_minute'] ?? null, - 'ammo_per_shot' => $mode['ammo_per_shot'] ?? null, - 'pellets_per_shot' => $mode['pellets_per_shot'] ?? null, - ]); - }); - - if (! empty($item['weapon']['regen_consumption'])) { - $weapon->regen()->updateOrCreate([ - 'weapon_id' => $weapon->id, - ], [ - 'requested_regen_per_sec' => $item['weapon']['regen_consumption']['requested_regen_per_sec'], - 'requested_ammo_load' => $item['weapon']['regen_consumption']['requested_ammo_load'], - 'cooldown' => $item['weapon']['regen_consumption']['cooldown'], - 'cost_per_bullet' => $item['weapon']['regen_consumption']['cost_per_bullet'], - ]); - } - } - - private function createMissile(array $item): void - { - if (! isset($item['missile']['signal_type'])) { - return; - } - - $lockRangeMax = $item['missile']['lock_range_max'] ?? null; - if ($lockRangeMax !== null) { - $lockRangeMax = max(0, $lockRangeMax); - } - $lockRangeMin = $item['missile']['lock_range_min'] ?? null; - if ($lockRangeMin !== null) { - $lockRangeMin = max(0, $lockRangeMin); - } - - $missile = Missile::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'signal_type' => $item['missile']['signal_type'], - 'lock_time' => $item['missile']['lock_time'] ?? null, - 'lock_range_max' => $lockRangeMax, - 'lock_range_min' => $lockRangeMin, - 'lock_angle' => $item['missile']['lock_angle'] ?? null, - 'tracking_signal_min' => $item['missile']['tracking_signal_min'] ?? null, - 'speed' => $item['missile']['speed'] ?? null, - 'fuel_tank_size' => $item['missile']['fuel_tank_size'] ?? null, - 'explosion_radius_min' => $item['missile']['explosion_radius_min'] ?? null, - 'explosion_radius_max' => $item['missile']['explosion_radius_max'] ?? null, - ]); - - if (isset($item['missile']['damages'])) { - foreach ($item['missile']['damages'] as $name => $damage) { - $missile->damages()->updateOrCreate([ - 'missile_id' => $missile->id, - 'name' => $name, - ], [ - 'damage' => $damage, - ]); - } - } - } - - private function createBomb(array $item): void - { - if (! isset($item['bomb']['arm_time'])) { - return; - } - - $bomb = Bomb::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'arm_time' => $item['bomb']['arm_time'] ?? null, - 'ignite_time' => $item['bomb']['ignite_time'] ?? null, - 'collision_delay_time' => $item['bomb']['collision_delay_time'] ?? null, - 'explosion_safety_distance' => $item['bomb']['explosion_safety_distance'] ?? null, - 'explosion_radius_min' => $item['bomb']['explosion_radius_min'] ?? null, - 'explosion_radius_max' => $item['bomb']['explosion_radius_max'] ?? null, - ]); - - if (isset($item['bomb']['damages'])) { - foreach ($item['bomb']['damages'] as $name => $damage) { - $bomb->damages()->updateOrCreate([ - 'bomb_id' => $bomb->id, - 'name' => $name, - ], [ - 'damage' => $damage, - ]); - } - } - } - - private function createThruster(array $item): void - { - if ($item['thruster'] === null) { - return; - } - - Thruster::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'thrust_capacity' => $item['thruster']['thrust_capacity'] ?? null, - 'min_health_thrust_multiplier' => $item['thruster']['min_health_thrust_multiplier'] ?? null, - 'fuel_burn_per_10k_newton' => $item['thruster']['fuel_burn_per_10k_newton'] ?? null, - 'type' => $item['thruster']['type'], - ]); - } - - private function createSelfDestruct(array $item): void - { - SelfDestruct::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'damage' => $item['self_destruct']['damage'] ?? null, - 'radius' => $item['self_destruct']['radius'] ?? null, - 'min_radius' => $item['self_destruct']['min_radius'] ?? null, - 'phys_radius' => $item['self_destruct']['phys_radius'] ?? null, - 'min_phys_radius' => $item['self_destruct']['min_phys_radius'] ?? null, - 'time' => $item['self_destruct']['time'] ?? null, - ]); - } - - private function createRadar(array $item, VehicleItemModel $shipItem): Model - { - return $shipItem->specification()->updateOrCreate([ - 'uuid' => $item['uuid'], - ], [ - 'detection_lifetime' => $item['radar']['detection_lifetime'] ?? 0, - 'altitude_ceiling' => $item['radar']['altitude_ceiling'] ?? 0, - 'enable_cross_section_occlusion' => $item['radar']['enable_cross_section_occlusion'] ?? 0, - 'ship_item_id' => $shipItem->id, - ]); - } - - private function createTractorBeam(array $item): void - { - TractorBeam::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'min_force' => $item['tractor_beam']['min_force'] ?? null, - 'max_force' => $item['tractor_beam']['max_force'] ?? null, - 'min_distance' => $item['tractor_beam']['min_distance'] ?? null, - 'max_distance' => $item['tractor_beam']['max_distance'] ?? null, - 'full_strength_distance' => $item['tractor_beam']['full_strength_distance'] ?? null, - 'max_angle' => $item['tractor_beam']['max_angle'] ?? null, - 'max_volume' => $item['tractor_beam']['max_volume'] ?? null, - 'volume_force_coefficient' => $item['tractor_beam']['volume_force_coefficient'] ?? null, - 'tether_break_time' => $item['tractor_beam']['tether_break_time'] ?? null, - 'safe_range_value_factor' => $item['tractor_beam']['safe_range_value_factor'] ?? null, - ]); - } - - private function createSalvageModifier(array $item): void - { - SalvageModifier::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'salvage_speed_multiplier' => $item['salvage_modifier']['salvage_speed_multiplier'] ?? null, - 'radius_multiplier' => $item['salvage_modifier']['radius_multiplier'] ?? null, - 'extraction_efficiency' => $item['salvage_modifier']['extraction_efficiency'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/Import/WeaponAttachment.php b/app/Jobs/SC/Import/WeaponAttachment.php deleted file mode 100644 index aa5749b99..000000000 --- a/app/Jobs/SC/Import/WeaponAttachment.php +++ /dev/null @@ -1,67 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\WeaponAttachment($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - - $item = $parser->getData(); - - if ($item === null) { - return; - } - - if (! empty($item['ammo'])) { - PersonalWeaponMagazine::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'initial_ammo_count' => $item['ammo']['initial_ammo_count'] ?? null, - 'max_ammo_count' => $item['ammo']['max_ammo_count'] ?? null, - 'type' => $item['item_type'] ?? null, - 'ammunition_uuid' => $item['ammo']['ammunition_uuid'], - ]); - } - - if (! empty($item['iron_sight'])) { - IronSight::query()->withoutGlobalScopes()->updateOrCreate([ - 'item_uuid' => $item['uuid'], - ], [ - 'default_range' => $item['iron_sight']['default_range'], - 'max_range' => $item['iron_sight']['max_range'], - 'range_increment' => $item['iron_sight']['range_increment'], - 'auto_zeroing_time' => $item['iron_sight']['auto_zeroing_time'], - 'zoom_scale' => $item['iron_sight']['zoom_scale'], - 'zoom_time_scale' => $item['iron_sight']['zoom_time_scale'], - ]); - } - } -} diff --git a/app/Jobs/SC/Import/WeaponModifier.php b/app/Jobs/SC/Import/WeaponModifier.php deleted file mode 100644 index 06f2bcd17..000000000 --- a/app/Jobs/SC/Import/WeaponModifier.php +++ /dev/null @@ -1,83 +0,0 @@ -loadLabels(); - try { - $parser = new \App\Services\Parser\SC\WeaponModifier($this->filePath, $this->labels); - } catch (FileNotFoundException|JsonException $e) { - $this->fail($e); - - return; - } - $data = $parser->getData(); - - if ($data === null) { - return; - } - - /** @var ItemWeaponModifierData $model */ - ItemWeaponModifierData::updateOrCreate([ - 'item_uuid' => $data['uuid'], - ], [ - 'fire_rate_multiplier' => $data['fire_rate_multiplier'] ?? null, - 'damage_multiplier' => $data['damage_multiplier'] ?? null, - 'damage_over_time_multiplier' => $data['damage_over_time_multiplier'] ?? null, - 'projectile_speed_multiplier' => $data['projectile_speed_multiplier'] ?? null, - 'ammo_cost_multiplier' => $data['ammo_cost_multiplier'] ?? null, - 'heat_generation_multiplier' => $data['heat_generation_multiplier'] ?? null, - 'sound_radius_multiplier' => $data['sound_radius_multiplier'] ?? null, - 'charge_time_multiplier' => $data['charge_time_multiplier'] ?? null, - - 'recoil_decay_multiplier' => $data['recoil_decay_multiplier'] ?? null, - 'recoil_end_decay_multiplier' => $data['recoil_end_decay_multiplier'] ?? null, - 'recoil_fire_recoil_time_multiplier' => $data['recoil_fire_recoil_time_multiplier'] ?? null, - 'recoil_fire_recoil_strength_first_multiplier' => $data['recoil_fire_recoil_strength_first_multiplier'] ?? null, - 'recoil_fire_recoil_strength_multiplier' => $data['recoil_fire_recoil_strength_multiplier'] ?? null, - 'recoil_angle_recoil_strength_multiplier' => $data['recoil_angle_recoil_strength_multiplier'] ?? null, - 'recoil_randomness_multiplier' => $data['recoil_randomness_multiplier'] ?? null, - 'recoil_randomness_back_push_multiplier' => $data['recoil_randomness_back_push_multiplier'] ?? null, - 'recoil_frontal_oscillation_rotation_multiplier' => $data['recoil_frontal_oscillation_rotation_multiplier'] ?? null, - 'recoil_frontal_oscillation_strength_multiplier' => $data['recoil_frontal_oscillation_strength_multiplier'] ?? null, - 'recoil_frontal_oscillation_decay_multiplier' => $data['recoil_frontal_oscillation_decay_multiplier'] ?? null, - 'recoil_frontal_oscillation_randomness_multiplier' => $data['recoil_frontal_oscillation_randomness_multiplier'] ?? null, - 'recoil_animated_recoil_multiplier' => $data['recoil_animated_recoil_multiplier'] ?? null, - - 'spread_min_multiplier' => $data['spread_min_multiplier'] ?? null, - 'spread_max_multiplier' => $data['spread_max_multiplier'] ?? null, - 'spread_first_attack_multiplier' => $data['spread_first_attack_multiplier'] ?? null, - 'spread_attack_multiplier' => $data['spread_attack_multiplier'] ?? null, - 'spread_decay_multiplier' => $data['spread_decay_multiplier'] ?? null, - 'spread_additive_modifier' => $data['spread_additive_modifier'] ?? null, - - 'aim_zoom_scale' => $data['aim_zoom_scale'] ?? null, - 'aim_zoom_time_scale' => $data['aim_zoom_time_scale'] ?? null, - - 'salvage_speed_multiplier' => $data['salvage_speed_multiplier'] ?? null, - 'salvage_radius_multiplier' => $data['salvage_radius_multiplier'] ?? null, - 'salvage_extraction_efficiency' => $data['salvage_extraction_efficiency'] ?? null, - ]); - } -} diff --git a/app/Jobs/SC/TranslateItem.php b/app/Jobs/SC/TranslateItem.php deleted file mode 100644 index 33f0405f4..000000000 --- a/app/Jobs/SC/TranslateItem.php +++ /dev/null @@ -1,77 +0,0 @@ -item = $item; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info("Translating Item {$this->item->name}"); - $targetLocale = config('services.deepl.target_locale'); - - $english = optional($this->item->english())->translation; - $german = optional($this->item->german())->translation; - - // Delete job german and english translation length don't differ in length by <= 20% - if (empty($english) || ($german !== null && ((strlen($german) / strlen($english)) > 0.80))) { - $this->delete(); - - return; - } - - $translator = new TranslateText($english); - - try { - $translation = $translator->translate(config('services.deepl.target_locale')); - } catch (ConnectException|RateLimitedException $e) { - $this->release(60); - - return; - } catch (Exception $e) { - $this->fail($e); - - return; - } - - $this->item->translations()->updateOrCreate( - [ - 'locale_code' => sprintf('%s_%s', Str::lower($targetLocale), $targetLocale), - ], - [ - 'translation' => trim(TranslateText::runTextReplacements($translation)), - ] - ); - } -} diff --git a/app/Jobs/StarCitizen/Stat/Import/ImportStat.php b/app/Jobs/StarCitizen/Stat/Import/ImportStat.php index 1a7095d97..32db2fff4 100644 --- a/app/Jobs/StarCitizen/Stat/Import/ImportStat.php +++ b/app/Jobs/StarCitizen/Stat/Import/ImportStat.php @@ -4,7 +4,7 @@ namespace App\Jobs\StarCitizen\Stat\Import; -use App\Models\StarCitizen\Stat\Stat; +use App\Models\StarCitizen\Stat; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Filesystem\FileNotFoundException; use Illuminate\Contracts\Queue\ShouldQueue; diff --git a/app/Jobs/StarCitizen/Vehicle/CheckShipMatrixStructure.php b/app/Jobs/StarCitizen/Vehicle/CheckShipMatrixStructure.php deleted file mode 100644 index 32141219c..000000000 --- a/app/Jobs/StarCitizen/Vehicle/CheckShipMatrixStructure.php +++ /dev/null @@ -1,64 +0,0 @@ -shipMatrix = $this->getNewestShipMatrixFilename(); - $this->groundTruth = File::get(storage_path('framework/testing/shipmatrix/aurora_es.json')); - - $this->groundTruth = collect(json_decode($this->groundTruth, true, 512, JSON_THROW_ON_ERROR)); - } catch (FileNotFoundException|RuntimeException|JsonException $e) { - $this->fail($e); - } - - $vehicles = json_decode(Storage::disk('vehicles')->get($this->shipMatrix), true, 512, JSON_THROW_ON_ERROR); - - $diff = $this->groundTruth->diffKeys($vehicles[0]); - - if ($diff->count() !== 0) { - $keys = $diff->keys(); - - app('Log')::error('Ship Matrix structure changed, aborting job. Missing keys:', $keys->toArray()); - ShipMatrixStructureChanged::dispatch(); - - $this->fail('Ship Matrix structure changed. Missing keys: '.$keys->implode(', ')); - } - } -} diff --git a/app/Jobs/StarCitizen/Vehicle/DownloadShipMatrix.php b/app/Jobs/StarCitizen/Vehicle/DownloadShipMatrix.php deleted file mode 100644 index 67ec4f392..000000000 --- a/app/Jobs/StarCitizen/Vehicle/DownloadShipMatrix.php +++ /dev/null @@ -1,103 +0,0 @@ -force = $force; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Starting Ship Matrix Download Job'); - - if (! $this->force && Storage::disk(self::VEHICLES_DISK)->exists($this->getPath())) { - return; - } - - try { - $response = $this->makeClient()->get(self::SHIPS_ENDPOINT)->throw(); - } catch (RequestException $e) { - app('Log')::critical( - 'Could not connect to RSI Ship Matrix', - [ - 'message' => $e->getMessage(), - ] - ); - - $this->fail($e); - - return; - } - - try { - $response = $this->parseResponseBody($response->body()); - } catch (InvalidDataException $e) { - app('Log')::error( - 'Ship Matrix data is not valid json', - [ - 'message' => $e->getMessage(), - ] - ); - - $this->fail($e); - - return; - } - - // Exception will not happen - $responseJsonData = json_encode($response->data, JSON_THROW_ON_ERROR); - - Storage::disk(self::VEHICLES_DISK)->put($this->getPath(), $responseJsonData); - - app('Log')::info('Ship Matrix Download finished'); - } - - /** - * Generates the Shipmatrix Filename - */ - private function getPath(): string - { - $dirName = now()->format('Y-m-d'); - $fileTimeStamp = now()->format('Y-m-d_H-i'); - $filename = "shipmatrix_{$fileTimeStamp}.json"; - - return "{$dirName}/{$filename}"; - } -} diff --git a/app/Jobs/StarCitizen/Vehicle/Import/ImportShipMatrix.php b/app/Jobs/StarCitizen/Vehicle/Import/ImportShipMatrix.php deleted file mode 100644 index 3d224b90c..000000000 --- a/app/Jobs/StarCitizen/Vehicle/Import/ImportShipMatrix.php +++ /dev/null @@ -1,97 +0,0 @@ -shipMatrixFileName = $shipMatrixFileName; - } else { - try { - $this->shipMatrixFileName = $this->getNewestShipMatrixFilename(); - } catch (RuntimeException $e) { - $this->fail($e); - } - } - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Parsing Ship Matrix Download'); - - try { - $content = Storage::disk('vehicles')->get($this->shipMatrixFileName ?? 'HowCanThisBeNull??'); - if ($content === null) { - throw new FileNotFoundException; - } - - $vehicles = json_decode( - $content, - true, - 512, - JSON_THROW_ON_ERROR - ); - } catch (FileNotFoundException $e) { - app('Log')::error( - "File {$this->shipMatrixFileName} not found on Disk vehicles", - [ - 'message' => $e->getMessage(), - ] - ); - - $this->fail($e); - - return; - } catch (JsonException $e) { - app('Log')::error( - "File {$this->shipMatrixFileName} does not contain valid JSON", - [ - 'message' => $e->getMessage(), - ] - ); - - $this->delete(); - - return; - } - - collect($vehicles)->each( - function ($vehicle) { - dispatch(new ImportVehicle(new Collection($vehicle))); - } - ); - } -} diff --git a/app/Jobs/StarCitizen/Vehicle/Import/ImportLoaner.php b/app/Jobs/StarCitizen/Vehicle/ImportLoaner.php similarity index 99% rename from app/Jobs/StarCitizen/Vehicle/Import/ImportLoaner.php rename to app/Jobs/StarCitizen/Vehicle/ImportLoaner.php index 08069ac57..ba0cfbca0 100644 --- a/app/Jobs/StarCitizen/Vehicle/Import/ImportLoaner.php +++ b/app/Jobs/StarCitizen/Vehicle/ImportLoaner.php @@ -1,6 +1,6 @@ downloadShipMatrix(); + $this->cleanupDailyFiles($shipMatrixPath); + $vehicles = $this->loadVehicles($shipMatrixPath); + $this->assertStructure($vehicles); + } catch (Throwable $e) { + app('Log')::error( + 'Ship Matrix download or import failed', + [ + 'message' => $e->getMessage(), + ] + ); + $this->fail($e); + + return; + } + + collect($vehicles)->each( + static function (array $vehicle): void { + dispatch(new ImportVehicle(new Collection($vehicle))); + } + ); + } + + /** + * @throws RuntimeException|RequestException|ConnectionException|JsonException + */ + private function downloadShipMatrix(): string + { + $path = $this->buildPath(); + + $response = RsiDownloadClient::getClient()->get(config('services.rsi_url').self::SHIPS_ENDPOINT); + + $parsed = json_decode($response->body(), false, 512, JSON_THROW_ON_ERROR); + + if (($parsed->success ?? 0) !== 1) { + throw new RuntimeException( + sprintf('RSI data is not valid. Expected success = 1, got %d', $parsed->success ?? 0) + ); + } + + $responseJsonData = json_encode($parsed->data, JSON_THROW_ON_ERROR); + + Storage::disk(self::VEHICLES_DISK)->put($path, $responseJsonData); + + return $path; + } + + /** + * @return array> + * + * @throws FileNotFoundException|JsonException + */ + private function loadVehicles(string $path): array + { + $content = Storage::disk(self::VEHICLES_DISK)->get($path); + + if ($content === null) { + throw new FileNotFoundException("Ship Matrix file {$path} could not be read"); + } + + return json_decode($content, true, 512, JSON_THROW_ON_ERROR); + } + + /** + * @param array> $vehicles + * + * @throws JsonException|RuntimeException + */ + private function assertStructure(array $vehicles): void + { + if ($vehicles === []) { + throw new RuntimeException('Ship Matrix payload is empty'); + } + + $groundTruth = File::get(storage_path('framework/testing/shipmatrix/aurora_es.json')); + $groundTruth = collect(json_decode($groundTruth, true, 512, JSON_THROW_ON_ERROR)); + + $diff = $groundTruth->diffKeys($vehicles[0]); + + if ($diff->count() !== 0) { + $keys = $diff->keys(); + + app('Log')::error('Ship Matrix structure changed, aborting job. Missing keys:', $keys->toArray()); + if (class_exists(ShipMatrixStructureChanged::class)) { + ShipMatrixStructureChanged::dispatch(); + } + + throw new RuntimeException('Ship Matrix structure changed. Missing keys: '.$keys->implode(', ')); + } + } + + private function cleanupDailyFiles(string $keepPath): void + { + $directory = Str::before($keepPath, '/'); + + $files = Storage::disk(self::VEHICLES_DISK)->files($directory); + + collect($files) + ->filter(static fn (string $file): bool => $file !== $keepPath && Str::contains($file, 'shipmatrix')) + ->each(static fn (string $file): bool => Storage::disk(self::VEHICLES_DISK)->delete($file)); + } + + private function buildPath(): string + { + $dirName = now()->format('Y-m-d'); + $fileTimeStamp = now()->format('Y-m-d_H-i'); + $filename = "shipmatrix_{$fileTimeStamp}.json"; + + return "{$dirName}/{$filename}"; + } +} diff --git a/app/Jobs/StarCitizen/Vehicle/Import/ImportVehicle.php b/app/Jobs/StarCitizen/Vehicle/ImportVehicle.php similarity index 95% rename from app/Jobs/StarCitizen/Vehicle/Import/ImportVehicle.php rename to app/Jobs/StarCitizen/Vehicle/ImportVehicle.php index ea70fe30c..e48eaf750 100644 --- a/app/Jobs/StarCitizen/Vehicle/Import/ImportVehicle.php +++ b/app/Jobs/StarCitizen/Vehicle/ImportVehicle.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace App\Jobs\StarCitizen\Vehicle\Import; +namespace App\Jobs\StarCitizen\Vehicle; use App\Models\StarCitizen\Vehicle\Vehicle\Vehicle; use App\Services\Parser\ShipMatrix\Component; @@ -12,7 +12,6 @@ use App\Services\Parser\ShipMatrix\Vehicle\Focus; use App\Services\Parser\ShipMatrix\Vehicle\Size; use App\Services\Parser\ShipMatrix\Vehicle\Type; -use App\Traits\CreateRelationChangelogTrait; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Database\Eloquent\ModelNotFoundException; @@ -22,12 +21,8 @@ use Illuminate\Support\Collection; use Illuminate\Support\Str; -/** - * Class AbstractParseVehicle - */ class ImportVehicle implements ShouldQueue { - use CreateRelationChangelogTrait; use Dispatchable; use InteractsWithQueue; use Queueable; @@ -113,12 +108,6 @@ public function handle(): void 'translation' => strip_tags($this->rawData->get(self::VEHICLE_DESCRIPTION, '') ?? ''), ] ); - - $changes = []; - $changes['foci'] = $this->syncFociIds($vehicle); - $changes['components'] = $this->syncComponents($vehicle); - - $this->createRelationChangelog($changes, $vehicle); } /** diff --git a/app/Jobs/TrackApiRouteCall.php b/app/Jobs/TrackApiRouteCall.php deleted file mode 100644 index 663435ab6..000000000 --- a/app/Jobs/TrackApiRouteCall.php +++ /dev/null @@ -1,51 +0,0 @@ -request = $request; - } - - /** - * Execute the job. - */ - public function handle(): void - { - Http::withHeaders([ - 'User-Agent' => $this->request['user-agent'], - 'X-Forwarded-For' => $this->request['forwarded-for'], - ]) - ->timeout(10) - ->retry(5) - ->post(sprintf('%s/api/event', config('services.plausible.domain')), [ - 'name' => 'pageview', - 'url' => $this->request['url'], - 'domain' => parse_url(config('app.url'))['host'], - ]) - ->onError(fn () => $this->delete()); - } -} diff --git a/app/Jobs/Transcript/ImportMetadata.php b/app/Jobs/Transcript/ImportMetadata.php deleted file mode 100644 index 456d9edad..000000000 --- a/app/Jobs/Transcript/ImportMetadata.php +++ /dev/null @@ -1,103 +0,0 @@ -chunkAll = $chunkAll; - } - - /** - * Execute the job. - */ - public function handle(): void - { - collect(Storage::disk('transcripts')->allFiles()) - ->filter(function (string $path) { - return substr($path, -5) === '.json'; - }) - ->chunk($this->chunkAll ? 2000 : 10) - ->each(function (Collection $chunk) { - $chunk - ->map(function (string $path) { - try { - $content = json_decode( - File::get(Storage::disk('transcripts')->path($path)), - true, - 512, - JSON_THROW_ON_ERROR - ); - } catch (FileNotFoundException|JsonException $e) { - app('Log')::warning($e->getMessage()); - - return null; - } - - $thumbnail = null; - if (count($content['thumbnails']) > 1) { - $thumbnail = array_pop($content['thumbnails']); - if ($thumbnail !== null) { - $thumbnail = explode('?', $thumbnail['url']); - $thumbnail = $thumbnail[0]; - } - } - - $filename = $content['_filename'] ?? null; - if ($filename !== null) { - $filename = explode('/', $filename); - $filename = array_pop($filename); - } - - return [ - 'youtube_id' => $content['id'], - 'title' => $content['title'], - 'playlist_name' => $content['playlist_title'] ?? null, - 'upload_date' => Carbon::parse(str_replace('.', '', $content['upload_date']))->toDateString(), - 'runtime' => $content['duration'], - 'thumbnail' => $thumbnail, - 'youtube_description' => $content['description'], - 'filename' => $filename, - ]; - }) - ->filter(function ($in) { - return ! empty($in); - }) - ->sortBy('upload_date') - ->each(function (array $data) { - $id = $data['youtube_id']; - unset($data['youtube_id']); - - Transcript::query()->firstOrCreate([ - 'youtube_id' => $id, - ], $data); - }); - }); - } -} diff --git a/app/Jobs/Transcript/Translate/TranslateTranscript.php b/app/Jobs/Transcript/Translate/TranslateTranscript.php deleted file mode 100644 index 89508e0e9..000000000 --- a/app/Jobs/Transcript/Translate/TranslateTranscript.php +++ /dev/null @@ -1,99 +0,0 @@ -transcript = $transcript; - } - - /** - * Execute the job. - */ - public function handle(): void - { - if ($this->transcript->english() === null) { - return; - } - - app('Log')::info("Translating Transcript {$this->transcript->url}"); - - $english = $this->transcript->english()->translation; - $translation = ''; - - try { - if (mb_strlen($english) > DeepLy::MAX_TRANSLATION_TEXT_LEN) { - foreach (str_split_unicode($english, DeepLy::MAX_TRANSLATION_TEXT_LEN) as $chunk) { - $chunkTranslation = DeepLyFacade::translate($chunk, config('services.deepl.target_locale'), 'EN'); - $translation .= " {$chunkTranslation}"; - } - } else { - $translation = DeepLyFacade::translate($english, config('services.deepl.target_locale'), 'EN'); - } - } catch (QuotaException $e) { - app('Log')::warning('Deepl Quote exceeded!'); - - $this->fail($e); - - return; - } catch (RateLimitedException $e) { - app('Log')::info('Got rate limit exception. Trying job again in 60 seconds.'); - - $this->release(60); - - return; - } catch (TextLengthException $e) { - app('Log')::warning($e->getMessage()); - - return; - } catch (CallException|AuthenticationException|InvalidArgumentException $e) { - app('Log')::warning(sprintf('%s: %s', 'Translation failed with Message', $e->getMessage())); - - $this->fail($e); - - return; - } - - $this->transcript->translations()->updateOrCreate( - [ - 'locale_code' => 'de_DE', - ], - [ - 'translation' => trim($translation), - 'proofread' => false, - ] - ); - } -} diff --git a/app/Jobs/Transcript/Translate/TranslateTranscripts.php b/app/Jobs/Transcript/Translate/TranslateTranscripts.php deleted file mode 100644 index 4a96d7287..000000000 --- a/app/Jobs/Transcript/Translate/TranslateTranscripts.php +++ /dev/null @@ -1,61 +0,0 @@ -limit = $limit; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info('Starting Transcript Translations'); - - $jobLimit = $this->limit === 0 ? PHP_INT_MAX : $this->limit; - $count = 0; - - Transcript::query()->chunk( - 100, - static function (Collection $transcripts) use ($jobLimit, &$count) { - $transcripts->each( - static function (Transcript $transcript) use ($jobLimit, &$count) { - if ($count < $jobLimit && optional($transcript->german())->translation === null) { - $count++; - dispatch(new TranslateTranscript($transcript)); - } - } - ); - } - ); - } -} diff --git a/app/Jobs/Wiki/ApproveRevisions.php b/app/Jobs/Wiki/ApproveRevisions.php deleted file mode 100644 index 825ee79ac..000000000 --- a/app/Jobs/Wiki/ApproveRevisions.php +++ /dev/null @@ -1,202 +0,0 @@ -pageTitles = $pageTitles; - $this->onlyApproveNew = $onlyApproveNew; - $this->resolveRedirects = $resolveRedirects; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $this->requestCsrfToken(); - $ids = $this->getRevisionIDs(); - $ids = collect($ids['pages'] ?? []) - ->filter( - function ($page) { - if ($this->onlyApproveNew === true) { - // Only approve new pages - return isset($page['new']); - } - - return true; - } - ) - ->map( - function ($page) { - return $page['revisions'] ?? []; - } - ) - ->map( - function ($revisions) { - return Arr::first($revisions, null, []); - } - ) - ->map( - function ($revision) { - return $revision['revid'] ?? 0; - } - ) - ->filter( - function ($id) { - return $id > 0; - } - ); - - $this->approveRevisions($ids); - } - - /** - * Requests an CSRF Token from the Wiki - */ - private function requestCsrfToken(): void - { - try { - $token = $this->getCsrfToken('services.wiki_approve_revs'); - } catch (ErrorException $e) { - app('Log')::info( - sprintf( - '%s: %s', - 'Token retrieval failed', - $e->getMessage() - ) - ); - - $this->release(300); - - return; - } - - if ($token === null) { - $this->release(300); - - return; - } - - $this->token = $token; - } - - /** - * Revision ids from page titles - * - * @return array Page revision ids - */ - private function getRevisionIDs(): array - { - $titles = $this->pageTitles; - - try { - if ($this->resolveRedirects === true) { - $titles = collect($this->pageTitles)->map(function ($title) { - return WrappedWiki::getRedirectTitle($title); - })->toArray(); - } - - $revisions = MediaWikiApi::query() - ->formatVersion(2) - ->json() - ->prop('revisions') - ->prop('info') - ->titles(implode('|', $titles)) - ->addParam('rvprop', 'ids') - ->request(); - } catch (GuzzleException $e) { - $this->release(300); - - return []; - } - - if ($revisions->hasErrors()) { - app('Log')::info( - sprintf( - '%s: %s', - 'Revision retrieval failed', - $revisions->getErrors()['code'] ?? '' - ) - ); - - $this->release(300); - - return []; - } - - return $revisions->getQuery(); - } - - /** - * Approve revisions - */ - private function approveRevisions(Collection $ids): void - { - $ids->each( - function ($id) { - try { - $response = MediaWikiApi::action('approve', 'POST') - ->withAuthentication() - ->csrfToken($this->token) - ->addParam('revid', $id) - ->request(); - if ($response->hasErrors()) { - app('Log')::error( - sprintf( - 'Could not approve revision %s. Message: %s', - $id, - json_encode($response->getErrors()) - ) - ); - } - } catch (GuzzleException $e) { - app('Log')::error( - sprintf( - 'Could not approve revision %s. Message: %s', - $id, - json_encode($e->getMessage()) - ) - ); - } - } - ); - } -} diff --git a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPage.php b/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPage.php deleted file mode 100644 index 2adec9a62..000000000 --- a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPage.php +++ /dev/null @@ -1,120 +0,0 @@ -commLink = $commLink; - $this->token = $token; - $this->template = $template; - } - - /** - * Execute the job. - */ - public function handle(): void - { - $this->createCommLinkPage(config('services.wiki_translations.locale'), "Comm-Link:{$this->commLink->cig_id}"); - - if (config('services.wiki_translations.create_english_subpage') === true) { - $this->createCommLinkPage(Language::ENGLISH, "Comm-Link:{$this->commLink->cig_id}/en"); - } - } - - /** - * Handle the actual creation - * - * @param string $language Text language - * @param string $title MediaWiki Page Title - */ - private function createCommLinkPage(string $language, string $title): void - { - app('Log')::info("Creating Wiki Page '{$title}'"); - - try { - if ($language === 'de_DE') { - $text = optional($this->commLink->german())->translation; - } else { - $text = optional($this->commLink->english())->translation; - } - - if ($text !== null && ! Normalizer::isNormalized($text)) { - $text = Normalizer::normalize($text); - } - - if ($text !== null && config('language.translate_wrap_commlinks')) { - $text = sprintf("\n%s\n", $text); - $this->template = str_replace('{{Comm-Link}}', '{{Comm-Link}}', $this->template); - } - - $response = MediaWikiApi::edit($title)->text( - sprintf( - "%s\n%s", - $this->template, - $text ?? '' - ) - ) - ->summary("Importing Comm-Link Translation {$this->commLink->cig_id}") - ->csrfToken($this->token) - ->markBotEdit() - ->createOnly() - ->request(); - } catch (ConnectException $e) { - $this->release(60); - - return; - } catch (GuzzleException|RuntimeException $e) { - app('Log')::error('Could not get an CSRF Token', $e->getResponse()->getErrors()); - - $this->fail($e); - - return; - } - - if (config('services.wiki_approve_revs.access_secret', null) !== null) { - dispatch(new ApproveRevisions(["Comm-Link:{$this->commLink->cig_id}"])); - } - - app('Log')::debug('Wiki Page Response:', $response->getBody()); - } -} diff --git a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPages.php b/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPages.php deleted file mode 100644 index 121c184e4..000000000 --- a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiPages.php +++ /dev/null @@ -1,141 +0,0 @@ -getCsrfToken('services.wiki_translations'); - } catch (ErrorException $e) { - app('Log')::info( - sprintf( - '%s: %s', - 'Token retrieval failed', - $e->getMessage() - ) - ); - - $this->release(300); - - return; - } - - $commLinkConfig = $this->getCommLinkConfig(); - $commLinkConfig['token'] = $token; - $this->config = $commLinkConfig; - - app('Log')::debug('Current config:', $commLinkConfig); - - $dispatchFunction = function (Collection $commLinks) { - try { - $pageInfoCollection = $this->getPageInfoForCommLinks($commLinks, true); - } catch (RuntimeException $e) { - app('Log')::error($e->getMessage()); - - if (strpos($e->getMessage(), 'Guru Meditation') !== false) { - $this->release(60); - } else { - $this->fail($e); - } - - return; - } - - $localConfig = $this->config; - - $commLinks->each( - static function (CommLink $commLink) use ($pageInfoCollection, $localConfig) { - $wikiPage = $pageInfoCollection->get($commLink->cig_id, []); - - if (isset($wikiPage['missing'])) { - dispatch( - new CreateCommLinkWikiPage( - $commLink, - $localConfig['token'], - $localConfig['template'] - ) - ); - } - } - ); - }; - - CommLink::query()->whereHas( - 'translations', - static function (Builder $query) { - $query->where('locale_code', config('services.wiki_translations.locale')) - ->whereRaw( - "translation <> ''" - ); - } - )->chunk( - 100, - $dispatchFunction - ); - - $commLinkConfig = $this->getCommLinkConfig('Comm-Link:Subscriber-Header'); - $commLinkConfig['token'] = $token; - $this->config = $commLinkConfig; - - CommLink::query()->whereHas( - 'channel', - static function (Builder $query) { - $query->where('name', 'Subscriber'); - } - )->chunk( - 100, - $dispatchFunction - ); - - $commLinkConfig = $this->getCommLinkConfig('Comm-Link:Press-Header'); - $commLinkConfig['token'] = $token; - $this->config = $commLinkConfig; - - CommLink::query()->whereHas( - 'channel', - static function (Builder $query) { - $query->where('name', 'Press'); - } - )->chunk( - 100, - $dispatchFunction - ); - } -} diff --git a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiTranslationPages.php b/app/Jobs/Wiki/CommLink/CreateCommLinkWikiTranslationPages.php deleted file mode 100644 index 66b047538..000000000 --- a/app/Jobs/Wiki/CommLink/CreateCommLinkWikiTranslationPages.php +++ /dev/null @@ -1,88 +0,0 @@ -getCsrfToken('services.wiki_translations'); - } catch (ErrorException $e) { - app('Log')::info( - sprintf( - '%s: %s', - 'Token retrieval failed', - $e->getMessage() - ) - ); - - $this->release(300); - - return; - } - - CommLink::query() - ->whereHas( - 'translations', - static function (Builder $query) { - $query->where('locale_code', config('services.wiki_translations.locale')) - ->whereRaw( - "translation <> ''" - ); - } - )->chunk( - 10, - function (Collection $commlinks) use ($token) { - $commlinks->each(function (CommLink $commLink) use ($token) { - MediaWikiApi::edit("Comm-Link:{$commLink->cig_id}/en") - ->text(sprintf( - "{{Comm-Link}}\n%s", - optional($commLink->english())->translation - )) - ->summary('Importing Comm-Link Translation') - ->csrfToken($token) - ->markBotEdit() - ->request(); - }); - - if (config('services.wiki_approve_revs.access_secret', null) !== null) { - dispatch(new ApproveRevisions($commlinks->map(function (CommLink $commLink) { - return "Comm-Link:{$commLink->cig_id}/en"; - })->toArray())); - } - } - ); - } -} diff --git a/app/Jobs/Wiki/CommLink/UpdateCommLinkProofReadStatus.php b/app/Jobs/Wiki/CommLink/UpdateCommLinkProofReadStatus.php deleted file mode 100644 index dfeca31d0..000000000 --- a/app/Jobs/Wiki/CommLink/UpdateCommLinkProofReadStatus.php +++ /dev/null @@ -1,99 +0,0 @@ -loginWikiBotAccount('services.wiki_translations'); - - $config = $this->getCommLinkConfig(); - - CommLink::query()->whereHas( - 'translations', - static function (Builder $query) { - $query->where(self::LOCALE_CODE, 'de_DE')->whereRaw("translation <> ''"); - } - )->chunk( - 100, - function (Collection $commLinks) use ($config) { - try { - $pageInfoCollection = $this->getPageInfoForCommLinks($commLinks, true); - } catch (RuntimeException $e) { - app('Log')::error($e->getMessage()); - - $this->fail($e); - - return; - } - - $commLinks->each( - static function (CommLink $commLink) use ($pageInfoCollection, $config) { - $wikiPage = $pageInfoCollection->get($commLink->cig_id, []); - - app('Log')::info("Updating Proofread Status for Comm-Link: {$commLink->cig_id}"); - - app('Log')::debug('Wiki Page Data', $wikiPage); - - if (isset($wikiPage[self::CATEGORIES])) { - $proofread = true; - collect($wikiPage[self::CATEGORIES])->each( - static function (array $category) use (&$proofread, $config) { - if (str_contains($category['title'], $config['category'])) { - $proofread = false; - } - } - ); - - $commLink->translations()->where( - [ - self::LOCALE_CODE => 'de_DE', - ] - )->update( - [ - 'proofread' => $proofread, - ] - ); - } - } - ); - } - ); - } -} diff --git a/app/Jobs/Wiki/Galactapedia/CreateGalactapediaWikiPage.php b/app/Jobs/Wiki/Galactapedia/CreateGalactapediaWikiPage.php deleted file mode 100644 index d664a3154..000000000 --- a/app/Jobs/Wiki/Galactapedia/CreateGalactapediaWikiPage.php +++ /dev/null @@ -1,508 +0,0 @@ - 'Menschen', - 'Food and Beverages' => 'Essen und Trinken', - 'Entertainment' => 'Unterhaltung', - 'Law' => 'Recht', - 'Planetary Systems' => 'Planetares System', - 'Education' => 'Bildung', - 'Art' => 'Kunst', - 'Animals' => 'Tier', - 'Space' => 'Weltraum', - 'Ground Transportation' => 'Bodentransport', - 'Culture' => 'Kultur', - 'Music' => 'Musik', - 'Military' => 'Militär', - 'Exploration' => 'Erforschung', - 'Archaeology' => 'Archäologie', - 'Weapons' => 'Waffe', - 'Commerce' => 'Unternehmen', - 'People' => 'Persönlichkeit', - 'Civilizations' => 'Zivilisation', - 'History' => 'Geschichte', - 'Government' => 'Regierung', - 'Fiction' => 'Belletristik', - 'Illegal Activity' => 'Illegale Aktivität', - 'Locations' => 'Standort', - 'Factions' => 'Fraktion', - 'Plants' => 'Pflanze', - 'Politics' => 'Politik', - 'Science and Technology' => 'Wissenschaft und Technik', - 'Settlements' => 'Siedlung', - 'Spacecraft' => 'Raumschiff', - 'Sports' => 'Sport', - 'Holidays' => 'Feiertag', - 'Geography' => 'Geographie', - 'Publications' => 'Publikation', - 'Moons' => 'Mond', - 'Planets' => 'Planet', - ]; - /* jscpd:ignore-end */ - - private Article $article; - - /** - * @var string CSRF Token - */ - private string $token; - - /** - * Response of the thumbnail head request - */ - private ?Response $response = null; - - /** - * The article wiki page title - */ - private string $title = ''; - - /** - * Create a new job instance. - */ - public function __construct(Article $article, string $token) - { - $this->article = $article; - $this->token = $token; - } - - /** - * Execute the job. - */ - public function handle(): void - { - app('Log')::info("Creating Wiki Page '{$this->article->cleanTitle}'"); - - $this->title = WrappedWiki::getRedirectTitle($this->article->cleanTitle); - $wikiText = WrappedWiki::getWikiPageText(Article::normalizeContent($this->title)); - - if (preg_match('/(REDIRECT|WEITERLEITUNG)/', $wikiText ?? '') === 1) { - app('Log')::warning(sprintf( - 'Could not determine redirect title for "%s" (from %s)', - $this->title, - $this->article->cleanTitle - )); - $this->release(7200); - - return; - } - - if ($wikiText === null && WrappedWiki::pageExists($this->title)) { - app('Log')::warning(sprintf('Could not load content for "%s"', $this->title)); - $this->release(7200); - - return; - } - - try { - $text = $this->getFormattedText($this->getArticleText(), $wikiText); - - // Skip if texts are equal or translation markers are present - if (strcmp($text, $wikiText ?? '') === 0 || strpos($wikiText ?? '', '%s[[Category:Galactapedia]]%s -FORMAT; - - $content = $this->createContent($markdown, str_contains($pageContent ?? '', 'galactapedia-box')); - $categories = $this->createCategories(); - $ref = $this->createRef(); - - if ($pageContent !== null) { - if (str_contains($pageContent, 'DISABLE-CATS-->')) { - $categories = ''; - } - - $content = $this->runTextReplacements($content, $pageContent); - - if (strpos($pageContent, '(Getrennter erster Satz)') !== false) { - if (isset($content['repl'])) { - $content['repl'] = sprintf("%s\n(Getrennter erster Satz)", $content['repl']); - } else { - $content['repl'] = "\n(Getrennter erster Satz)"; - } - - $text = explode('. ', $content['content'], 2); - $content['content'] = implode(".\n\n", array_map('trim', $text)); - } - - $contentRef = $content['content'].$ref; - - if ( - config('language.translate_wrap_galactapedia') === true && - strpos('', $contentRef) === false - ) { - $contentRef = sprintf('%s', $contentRef); - } - - $formatted = sprintf( - $format, - '', // Don't replace template - $contentRef, - $categories, - $content['repl'] ?? '' - ); - - return preg_replace( - '/(?:
)?(?:<\/div>)?/s', - $formatted, - $pageContent, - 1 - ); - } - - $contentRef = $content.$ref; - - if ( - config('language.translate_wrap_galactapedia') === true && - strpos('', $contentRef) === false - ) { - $contentRef = sprintf('%s', $contentRef); - } - - return sprintf( - $format, - $this->createTemplate(), - $contentRef, - $categories, - '' - ); - } - - /** - * Creates the galactapedia template with content - */ - private function createTemplate(): string - { - $fileEnding = 'jpg'; - if ($this->response !== null) { - $fileEnding = (str_contains($this->response->header('Content-Type'), 'jpeg') ? 'jpg' : 'png'); - } - - $properties = collect(); - $this->article->properties - ->sortBy('name') - ->each(function (ArticleProperty $property) use ($properties) { - $counter = 0; - - if ($properties->has($property->name)) { - do { - $counter++; - $key = sprintf('%s%d', $property->name, $counter); - } while ($properties->has($key)); - $properties[$key] = $property->content; - } else { - $properties[$property->name] = $property->content; - } - }); - - $properties = $properties->map(function ($item, $key) { - try { - $value = DeepLyFacade::translate($item, config('services.deepl.target_locale'), 'EN'); - } catch (Exception $e) { - app('Log')::warning($e->getMessage()); - $value = $item; - } - - return sprintf( - '|%s=%s', - $key, - $value - ); - }) - ->implode("\n"); - - $relatedArticles = $this->article->related - ->map(function (Article $article) { - return sprintf('[[%s]]', $article->cleanTitle); - }) - ->implode("
\n"); - - $normalizedFileName = str_replace('/', '_', $this->article->cleanTitle); - - // The actual template content - return <<