import {z} from 'zod' export type Region = 'JP' | 'NA' | 'CN' | 'KR' | 'TW'; export type Trait = 'unknown' | 'genderMale' | 'genderFemale' | 'genderUnknown' | 'classSaber' | 'classLancer' | 'classArcher' | 'classRider' | 'classCaster' | 'classAssassin' | 'classBerserker' | 'classShielder' | 'classRuler' | 'classAlterEgo' | 'classAvenger' | 'classDemonGodPillar' | 'classLoreGrandCaster' | 'classBeastI' | 'classBeastII' | 'classMoonCancer' | 'classBeastIIIR' | 'classForeigner' | 'classBeastIIIL' | 'classBeastUnknown' | 'classPretender' | 'classUOlgaMarie' | 'classUOlgaMarieGrand' | 'classGrandUnBeastUOlgaMarieAlienGod' | 'classAquaFragment' | 'classUOlgaMarieStellar' | 'classUnBeastOlgaMarie' | 'classGrandSaber' | 'classGrandLancer' | 'classGrandArcher' | 'classGrandRider' | 'classGrandCaster' | 'classGrandAssassin' | 'classGrandBerserker' | 'classGrandShielder' | 'classGrandRuler' | 'classGrandAlterego' | 'classGrandAvenger' | 'classGrandMoonCancer' | 'classGrandForeigner' | 'classGrandPretender' | 'classGrandUnBeast' | 'attributeSky' | 'attributeEarth' | 'attributeHuman' | 'attributeStar' | 'attributeBeast' | 'alignmentLawful' | 'alignmentChaotic' | 'alignmentNeutral' | 'alignmentGood' | 'alignmentEvil' | 'alignmentBalanced' | 'alignmentMadness' | 'alignmentSummer' | 'basedOnServant' | 'human' | 'undead' | 'artificialDemon' | 'demonBeast' | 'daemon' | 'demon' | 'soldier' | 'amazoness' | 'skeleton' | 'zombie' | 'ghost' | 'automata' | 'golem' | 'spellBook' | 'homunculus' | 'lamia' | 'centaur' | 'werebeast' | 'chimera' | 'wyvern' | 'dragonType' | 'gazer' | 'handOrDoor' | 'demonGodPillar' | 'oni' | 'hand' | 'door' | 'threatToHumanity' | 'divine' | 'humanoid' | 'dragon' | 'dragonSlayer' | 'roman' | 'wildbeast' | 'atalante' | 'saberface' | 'weakToEnumaElish' | 'riding' | 'arthur' | 'skyOrEarth' | 'skyOrEarthServant' | 'brynhildsBeloved' | 'undeadOrDaemon' | 'undeadOrDemon' | 'demonic' | 'skyOrEarthExceptPseudoAndDemi' | 'skyOrEarthExceptPseudoAndDemiServant' | 'divineOrDaemonOrUndead' | 'divineOrDemonOrUndead' | 'saberClassServant' | 'superGiant' | 'king' | 'greekMythologyMales' | 'illya' | 'feminineLookingServant' | 'argonaut' | 'associatedToTheArgo' | 'genderCaenisServant' | 'hominidaeServant' | 'blessedByKur' | 'demonicBeastServant' | 'canBeInBattle' | 'notBasedOnServant' | 'livingHuman' | 'cardArts' | 'cardBuster' | 'cardQuick' | 'cardExtra' | 'buffPositiveEffect' | 'buffNegativeEffect' | 'buffIncreaseDamage' | 'buffIncreaseDefence' | 'buffDecreaseDamage' | 'buffDecreaseDefence' | 'buffMentalEffect' | 'buffPoison' | 'buffCharm' | 'buffPetrify' | 'buffStun' | 'buffBurn' | 'buffSpecialResistUp' | 'buffSpecialResistDown' | 'buffEvadeAndInvincible' | 'buffSureHit' | 'buffNpSeal' | 'buffEvade' | 'buffInvincible' | 'buffTargetFocus' | 'buffGuts' | 'skillSeal' | 'buffCurse' | 'buffAtkUp' | 'buffPowerModStrUp' | 'buffDamagePlus' | 'buffNpDamageUp' | 'buffCritDamageUp' | 'buffCritRateUp' | 'buffAtkDown' | 'buffPowerModStrDown' | 'buffDamageMinus' | 'buffNpDamageDown' | 'buffCritDamageDown' | 'buffCritRateDown' | 'buffDeathResistDown' | 'buffDefenceUp' | 'buffMaxHpUpPercent' | 'buffMaxHpDownPercent' | 'buffMaxHpUp' | 'buffMaxHpDown' | 'buffImmobilize' | 'buffIncreasePoisonEffectiveness' | 'buffPigify' | 'buffCurseEffectUp' | 'buffTerrorStunChanceAfterTurn' | 'buffConfusion' | 'buffOffensiveMode' | 'buffDefensiveMode' | 'buffLockCardsDeck' | 'buffDisableColorCard' | 'buffChangeField' | 'buffIncreaseDefenceAgainstIndividuality' | 'buffDefUp' | 'buffInvinciblePierce' | 'buffHpRecoveryPerTurn' | 'buffNegativeEffectImmunity' | 'buffNegativeEffectAtTurnEnd' | 'attackPhysical' | 'attackProjectile' | 'attackMagical' | 'criticalHit' | 'faceCard' | 'cardNP' | 'kingproteaGrowth' | 'kingproteaInfiniteProliferation' | 'kingproteaProliferation' | 'kingproteaProliferationNPDefense' | 'fieldSunlight' | 'fieldShore' | 'fieldForest' | 'fieldBurning' | 'fieldCity' | 'shadowServant' | 'aoeNP' | 'stNP' | 'giant' | 'childServant' | 'buffSpecialInvincible' | 'buffSkillRankUp' | 'buffSleep' | 'nobunaga' | 'fieldImaginarySpace' | 'existenceOutsideTheDomain' | 'curse' | 'fieldShoreOrImaginarySpace' | 'shutenOnField' | 'shuten' | 'genji' | 'vengeance' | 'enemyGardenOfSinnersLivingCorpse' | 'enemyGardenOfSinnersApartmentGhostAndSkeleton' | 'enemyGardenOfSinnersBaseModel' | 'enemyGardenOfSinnersVengefulSpiritOfSevenPeople' | 'enemySaberEliWerebeastAndHomunculusAndKnight' | 'enemySaberEliSkeletonAndGhostAndLamia' | 'enemySaberEliBugAndGolem' | 'enemySeraphEater' | 'enemySeraphShapeshifter' | 'enemySeraphTypeI' | 'enemySeraphTypeSakura' | 'enemyHimejiCastleKnightAndGazerAndMassProduction' | 'enemyHimejiCastleDronesAndHomunculusAndAutomata' | 'enemyHimejiCastleSkeletonAndScarecrow' | 'enemyGuda3MiniNobu' | 'enemyDavinciTrueEnemy' | 'enemyDavinciFalseEnemy' | 'enemyCaseFilesRareEnemy' | 'enemyLasVegasBonusEnemy' | 'enemySummerCampRareEnemy' | 'enemyLittleBigTenguTsuwamonoEnemy' | 'eventSaberWars' | 'eventRashomon' | 'eventOnigashima' | 'eventOnigashimaRaid' | 'eventPrisma' | 'eventPrismaWorldEndMatch' | 'eventNeroFest2' | 'eventGuda2' | 'eventNeroFest3' | 'eventSetsubun' | 'eventApocrypha' | 'eventBattleInNewYork1' | 'eventOniland' | 'eventOoku' | 'eventGuda4' | 'eventLasVegas' | 'eventBattleInNewYork2' | 'eventSaberWarsII' | 'eventSummerCamp' | 'eventGuda5' | 'cursedBook' | 'buffCharmFemale' | 'mechanical' | 'fae' | 'hasCostume' | 'weakPointsRevealed' | 'chenGongNpBlock' | 'knightsOfTheRound' | 'divineSpirit' | 'buffNullifyBuff' | 'enemyGudaMiniNobu' | 'burningLove' | 'buffStrongAgainstWildBeast' | 'buffStrongAgainstDragon' | 'fairyTaleServant' | 'classBeastIV' | 'havingAnimalsCharacteristics' | 'like' | 'exaltation' | 'gubijin' | 'yuMeiren' | 'milleniumCastle' | 'protoMerlinNPChargeBlock' | 'valkyrie' | 'immuneToPigify' | 'summerModeServant' | 'shinsengumiServant' | 'ryozanpaku' | 'demonUnused' | 'levitating' | 'obstacleMaker' | 'defender' | 'hasGoddessMetamorphosis' | 'servantsWithSkyAttribute' | 'moon' | 'cardWeak' | 'cardStrong' | 'servant' | 'shadow' | 'chenGongNp' | 'cantBeSacrificed' | 'gutsBlock' | 'classBeastILost' | 'holdingHolyGrail' | 'standardClassServant' | 'classBeast' | 'classBeastVI' | 'classBeastVIBoss' | 'buffBound' | 'buffDamageCut' | 'marking' | 'manuscriptComplete' | 'myFairSoldier' | 'zeroStarServant' | 'oneStarServant' | 'twoStarServant' | 'threeStarServant' | 'fourStarServant' | 'fiveStarServant' | 'wrathOfTheEnshrinedDeity' | 'caitCuCerpriestessAscension0To2' | 'caitCuCerpriestessAscension3To4' | 'fieldAir' | 'caitCuCerpriestessOnTheField' | 'buffNpPerTurn' | 'buffStarPerTurn' | 'burnEffectivenessUp' | 'murasamaAscension0' | 'classUOlgaMarieFlare' | 'elementalsWrath' | 'buffBuffSuccessRateUp' | 'groupServant' | 'takeruDummyTrait' | 'artsBuff' | 'busterBuff' | 'quickBuff' | 'FSNServant' | 'fieldDarkness' | 'magicBullet' | 'protagonistCorrection' | 'normalAokoBuff' | 'magicBulletAtkBuff' | 'demeritFunction' | 'extraBuff' | 'robinCounter' | 'kuonjiAliceHasSkill3' | 'kuonjiAliceStage3' | 'instantDeathFunction' | 'forceInstantDeathFunction' | 'buffGutsOnInstantDeath' | 'robinAllGone' | 'classBeastEresh' | 'alignmentBeast' | 'bunnyServant' | 'buffSpecialDmgAgainstAlignmentGood' | 'buffSpecialDmgAgainstAlignmentEvil' | 'hasSupereffectiveNPAgainstAlignmentGood' | 'hasSupereffectiveNPAgainstAlignmentEvil' | 'happyHalloween' | 'happyHalloweenCounter' | 'protectedByBBDubai' | 'notProtectedByBBDubai' | 'canFlyInSpace' | 'buffSpecialInvinciblePierce' | 'sakuraSeries' | 'buffDefenceDown' | 'fieldHeaven' | 'fieldHell' | 'markOfSin' | 'quickChain' | 'artsChain' | 'busterChain' | 'mightyChain' | 'braveChain' | 'chainError' | 'classBeastDraco'; export type NiceItemType = 'qp' | 'stone' | 'apRecover' | 'apAdd' | 'mana' | 'key' | 'gachaClass' | 'gachaRelic' | 'gachaTicket' | 'limit' | 'skillLvUp' | 'tdLvUp' | 'friendPoint' | 'eventPoint' | 'eventItem' | 'questRewardQp' | 'chargeStone' | 'rpAdd' | 'boostItem' | 'stoneFragments' | 'anonymous' | 'rarePri' | 'costumeRelease' | 'itemSelect' | 'commandCardPrmUp' | 'dice' | 'continueItem' | 'euqipSkillUseItem' | 'svtCoin' | 'friendshipUpItem' | 'purePri' | 'tradeAp' | 'revivalItem' | 'stormpod' | 'battleItem' | 'aniplexPlusChargeStone' | 'purePriShopReset' | 'exchangeSvtCoin' | 'reduceTradeTime' | 'eventPassiveSkillGiven' | 'classBoardResetItem' | 'netmarbleChargeStone'; export type NiceItemBGType = 'zero' | 'bronze' | 'silver' | 'gold' | 'questClearQPReward' | 'aquaBlue' | 'six' | 'unknown'; export type NiceItemUse = 'skill' | 'appendSkill' | 'ascension' | 'costume'; export type Language = 'jp' | 'en'; export type GetApiNiceRegionItemSearchArgs = {region: Region, name?: (string | null) | undefined, individuality?: (Array) | undefined, type?: Array | undefined, background?: Array | undefined, use?: Array | undefined, lang?: (Language | null) | undefined}; export type GetApiNiceRegionItemSearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; export const niceItemType = z.enum(["qp", "stone", "apRecover", "apAdd", "mana", "key", "gachaClass", "gachaRelic", "gachaTicket", "limit", "skillLvUp", "tdLvUp", "friendPoint", "eventPoint", "eventItem", "questRewardQp", "chargeStone", "rpAdd", "boostItem", "stoneFragments", "anonymous", "rarePri", "costumeRelease", "itemSelect", "commandCardPrmUp", "dice", "continueItem", "euqipSkillUseItem", "svtCoin", "friendshipUpItem", "purePri", "tradeAp", "revivalItem", "stormpod", "battleItem", "aniplexPlusChargeStone", "purePriShopReset", "exchangeSvtCoin", "reduceTradeTime", "eventPassiveSkillGiven", "classBoardResetItem", "netmarbleChargeStone"]); export const niceItemUse = z.enum(["skill", "appendSkill", "ascension", "costume"]); export const trait = z.enum(["unknown", "genderMale", "genderFemale", "genderUnknown", "classSaber", "classLancer", "classArcher", "classRider", "classCaster", "classAssassin", "classBerserker", "classShielder", "classRuler", "classAlterEgo", "classAvenger", "classDemonGodPillar", "classLoreGrandCaster", "classBeastI", "classBeastII", "classMoonCancer", "classBeastIIIR", "classForeigner", "classBeastIIIL", "classBeastUnknown", "classPretender", "classUOlgaMarie", "classUOlgaMarieGrand", "classGrandUnBeastUOlgaMarieAlienGod", "classAquaFragment", "classUOlgaMarieStellar", "classUnBeastOlgaMarie", "classGrandSaber", "classGrandLancer", "classGrandArcher", "classGrandRider", "classGrandCaster", "classGrandAssassin", "classGrandBerserker", "classGrandShielder", "classGrandRuler", "classGrandAlterego", "classGrandAvenger", "classGrandMoonCancer", "classGrandForeigner", "classGrandPretender", "classGrandUnBeast", "attributeSky", "attributeEarth", "attributeHuman", "attributeStar", "attributeBeast", "alignmentLawful", "alignmentChaotic", "alignmentNeutral", "alignmentGood", "alignmentEvil", "alignmentBalanced", "alignmentMadness", "alignmentSummer", "basedOnServant", "human", "undead", "artificialDemon", "demonBeast", "daemon", "demon", "soldier", "amazoness", "skeleton", "zombie", "ghost", "automata", "golem", "spellBook", "homunculus", "lamia", "centaur", "werebeast", "chimera", "wyvern", "dragonType", "gazer", "handOrDoor", "demonGodPillar", "oni", "hand", "door", "threatToHumanity", "divine", "humanoid", "dragon", "dragonSlayer", "roman", "wildbeast", "atalante", "saberface", "weakToEnumaElish", "riding", "arthur", "skyOrEarth", "skyOrEarthServant", "brynhildsBeloved", "undeadOrDaemon", "undeadOrDemon", "demonic", "skyOrEarthExceptPseudoAndDemi", "skyOrEarthExceptPseudoAndDemiServant", "divineOrDaemonOrUndead", "divineOrDemonOrUndead", "saberClassServant", "superGiant", "king", "greekMythologyMales", "illya", "feminineLookingServant", "argonaut", "associatedToTheArgo", "genderCaenisServant", "hominidaeServant", "blessedByKur", "demonicBeastServant", "canBeInBattle", "notBasedOnServant", "livingHuman", "cardArts", "cardBuster", "cardQuick", "cardExtra", "buffPositiveEffect", "buffNegativeEffect", "buffIncreaseDamage", "buffIncreaseDefence", "buffDecreaseDamage", "buffDecreaseDefence", "buffMentalEffect", "buffPoison", "buffCharm", "buffPetrify", "buffStun", "buffBurn", "buffSpecialResistUp", "buffSpecialResistDown", "buffEvadeAndInvincible", "buffSureHit", "buffNpSeal", "buffEvade", "buffInvincible", "buffTargetFocus", "buffGuts", "skillSeal", "buffCurse", "buffAtkUp", "buffPowerModStrUp", "buffDamagePlus", "buffNpDamageUp", "buffCritDamageUp", "buffCritRateUp", "buffAtkDown", "buffPowerModStrDown", "buffDamageMinus", "buffNpDamageDown", "buffCritDamageDown", "buffCritRateDown", "buffDeathResistDown", "buffDefenceUp", "buffMaxHpUpPercent", "buffMaxHpDownPercent", "buffMaxHpUp", "buffMaxHpDown", "buffImmobilize", "buffIncreasePoisonEffectiveness", "buffPigify", "buffCurseEffectUp", "buffTerrorStunChanceAfterTurn", "buffConfusion", "buffOffensiveMode", "buffDefensiveMode", "buffLockCardsDeck", "buffDisableColorCard", "buffChangeField", "buffIncreaseDefenceAgainstIndividuality", "buffDefUp", "buffInvinciblePierce", "buffHpRecoveryPerTurn", "buffNegativeEffectImmunity", "buffNegativeEffectAtTurnEnd", "attackPhysical", "attackProjectile", "attackMagical", "criticalHit", "faceCard", "cardNP", "kingproteaGrowth", "kingproteaInfiniteProliferation", "kingproteaProliferation", "kingproteaProliferationNPDefense", "fieldSunlight", "fieldShore", "fieldForest", "fieldBurning", "fieldCity", "shadowServant", "aoeNP", "stNP", "giant", "childServant", "buffSpecialInvincible", "buffSkillRankUp", "buffSleep", "nobunaga", "fieldImaginarySpace", "existenceOutsideTheDomain", "curse", "fieldShoreOrImaginarySpace", "shutenOnField", "shuten", "genji", "vengeance", "enemyGardenOfSinnersLivingCorpse", "enemyGardenOfSinnersApartmentGhostAndSkeleton", "enemyGardenOfSinnersBaseModel", "enemyGardenOfSinnersVengefulSpiritOfSevenPeople", "enemySaberEliWerebeastAndHomunculusAndKnight", "enemySaberEliSkeletonAndGhostAndLamia", "enemySaberEliBugAndGolem", "enemySeraphEater", "enemySeraphShapeshifter", "enemySeraphTypeI", "enemySeraphTypeSakura", "enemyHimejiCastleKnightAndGazerAndMassProduction", "enemyHimejiCastleDronesAndHomunculusAndAutomata", "enemyHimejiCastleSkeletonAndScarecrow", "enemyGuda3MiniNobu", "enemyDavinciTrueEnemy", "enemyDavinciFalseEnemy", "enemyCaseFilesRareEnemy", "enemyLasVegasBonusEnemy", "enemySummerCampRareEnemy", "enemyLittleBigTenguTsuwamonoEnemy", "eventSaberWars", "eventRashomon", "eventOnigashima", "eventOnigashimaRaid", "eventPrisma", "eventPrismaWorldEndMatch", "eventNeroFest2", "eventGuda2", "eventNeroFest3", "eventSetsubun", "eventApocrypha", "eventBattleInNewYork1", "eventOniland", "eventOoku", "eventGuda4", "eventLasVegas", "eventBattleInNewYork2", "eventSaberWarsII", "eventSummerCamp", "eventGuda5", "cursedBook", "buffCharmFemale", "mechanical", "fae", "hasCostume", "weakPointsRevealed", "chenGongNpBlock", "knightsOfTheRound", "divineSpirit", "buffNullifyBuff", "enemyGudaMiniNobu", "burningLove", "buffStrongAgainstWildBeast", "buffStrongAgainstDragon", "fairyTaleServant", "classBeastIV", "havingAnimalsCharacteristics", "like", "exaltation", "gubijin", "yuMeiren", "milleniumCastle", "protoMerlinNPChargeBlock", "valkyrie", "immuneToPigify", "summerModeServant", "shinsengumiServant", "ryozanpaku", "demonUnused", "levitating", "obstacleMaker", "defender", "hasGoddessMetamorphosis", "servantsWithSkyAttribute", "moon", "cardWeak", "cardStrong", "servant", "shadow", "chenGongNp", "cantBeSacrificed", "gutsBlock", "classBeastILost", "holdingHolyGrail", "standardClassServant", "classBeast", "classBeastVI", "classBeastVIBoss", "buffBound", "buffDamageCut", "marking", "manuscriptComplete", "myFairSoldier", "zeroStarServant", "oneStarServant", "twoStarServant", "threeStarServant", "fourStarServant", "fiveStarServant", "wrathOfTheEnshrinedDeity", "caitCuCerpriestessAscension0To2", "caitCuCerpriestessAscension3To4", "fieldAir", "caitCuCerpriestessOnTheField", "buffNpPerTurn", "buffStarPerTurn", "burnEffectivenessUp", "murasamaAscension0", "classUOlgaMarieFlare", "elementalsWrath", "buffBuffSuccessRateUp", "groupServant", "takeruDummyTrait", "artsBuff", "busterBuff", "quickBuff", "FSNServant", "fieldDarkness", "magicBullet", "protagonistCorrection", "normalAokoBuff", "magicBulletAtkBuff", "demeritFunction", "extraBuff", "robinCounter", "kuonjiAliceHasSkill3", "kuonjiAliceStage3", "instantDeathFunction", "forceInstantDeathFunction", "buffGutsOnInstantDeath", "robinAllGone", "classBeastEresh", "alignmentBeast", "bunnyServant", "buffSpecialDmgAgainstAlignmentGood", "buffSpecialDmgAgainstAlignmentEvil", "hasSupereffectiveNPAgainstAlignmentGood", "hasSupereffectiveNPAgainstAlignmentEvil", "happyHalloween", "happyHalloweenCounter", "protectedByBBDubai", "notProtectedByBBDubai", "canFlyInSpace", "buffSpecialInvinciblePierce", "sakuraSeries", "buffDefenceDown", "fieldHeaven", "fieldHell", "markOfSin", "quickChain", "artsChain", "busterChain", "mightyChain", "braveChain", "chainError", "classBeastDraco"]); export const niceTrait = z.object({id: z.number().int(), name: trait, negative: z.boolean().nullable().optional()}); export const niceItemBGType = z.enum(["zero", "bronze", "silver", "gold", "questClearQPReward", "aquaBlue", "six", "unknown"]); export const niceGiftType = z.enum(["servant", "item", "friendship", "userExp", "equip", "eventSvtJoin", "eventSvtGet", "questRewardIcon", "costumeRelease", "costumeGet", "commandCode", "eventPointBuff", "eventBoardGameToken", "eventCommandAssist", "eventHeelPortrait", "battleItem", "privilege", "classSkill"]); export const niceCondType = z.enum(["none", "questClear", "itemGet", "useItemEternity", "useItemTime", "useItemCount", "svtLevel", "svtLimit", "svtGet", "svtFriendship", "svtGroup", "event", "date", "weekday", "purchaseQpShop", "purchaseStoneShop", "warClear", "flag", "svtCountStop", "birthDay", "eventEnd", "svtEventJoin", "missionConditionDetail", "eventMissionClear", "eventMissionAchieve", "questClearNum", "notQuestGroupClear", "raidAlive", "raidDead", "raidDamage", "questChallengeNum", "masterMission", "questGroupClear", "superBossDamage", "superBossDamageAll", "purchaseShop", "questNotClear", "notShopPurchase", "notSvtGet", "notEventShopPurchase", "svtHaving", "notSvtHaving", "questChallengeNumEqual", "questChallengeNumBelow", "questClearNumEqual", "questClearNumBelow", "questClearPhase", "notQuestClearPhase", "eventPointGroupWin", "eventNormaPointClear", "questAvailable", "questGroupAvailableNum", "eventNormaPointNotClear", "notItemGet", "costumeGet", "questResetAvailable", "svtGetBeforeEventEnd", "questClearRaw", "questGroupClearRaw", "eventGroupPointRatioInTerm", "eventGroupRankInTerm", "notEventRaceQuestOrNotAllGroupGoal", "eventGroupTotalWinEachPlayer", "eventScriptPlay", "svtCostumeReleased", "questNotClearAnd", "svtRecoverd", "shopReleased", "eventPoint", "eventRewardDispCount", "equipWithTargetCostume", "raidGroupDead", "notSvtGroup", "notQuestResetAvailable", "notQuestClearRaw", "notQuestGroupClearRaw", "notEventMissionClear", "notEventMissionAchieve", "notCostumeGet", "notSvtCostumeReleased", "notEventRaceQuestOrNotTargetRankGoal", "playerGenderType", "shopGroupLimitNum", "eventGroupPoint", "eventGroupPointBelow", "eventTotalPoint", "eventTotalPointBelow", "eventValue", "eventValueBelow", "eventFlag", "eventStatus", "notEventStatus", "forceFalse", "svtHavingLimitMax", "eventPointBelow", "svtEquipFriendshipHaving", "movieNotDownload", "multipleDate", "svtFriendshipAbove", "svtFriendshipBelow", "movieDownloaded", "routeSelect", "notRouteSelect", "limitCount", "limitCountAbove", "limitCountBelow", "badEndPlay", "commandCodeGet", "notCommandCodeGet", "allUsersBoxGachaCount", "totalTdLevel", "totalTdLevelAbove", "totalTdLevelBelow", "commonRelease", "battleResultWin", "battleResultLose", "eventValueEqual", "boardGameTokenHaving", "boardGameTokenGroupHaving", "eventFlagOn", "eventFlagOff", "questStatusFlagOn", "questStatusFlagOff", "eventValueNotEqual", "limitCountMaxEqual", "limitCountMaxAbove", "limitCountMaxBelow", "boardGameTokenGetNum", "battleLineWinAbove", "battleLineLoseAbove", "battleLineContinueWin", "battleLineContinueLose", "battleLineContinueWinBelow", "battleLineContinueLoseBelow", "battleGroupWinAvove", "battleGroupLoseAvove", "svtLimitClassNum", "overTimeLimitRaidAlive", "onTimeLimitRaidDead", "onTimeLimitRaidDeadNum", "raidBattleProgressAbove", "svtEquipRarityLevelNum", "latestMainScenarioWarClear", "eventMapValueContains", "resetBirthDay", "shopFlagOn", "shopFlagOff", "purchaseValidShopGroup", "svtLevelClassNum", "svtLevelIdNum", "limitCountImageEqual", "limitCountImageAbove", "limitCountImageBelow", "eventTypeStartTimeToEndDate", "existBoxGachaScriptReplaceGiftId", "notExistBoxGachaScriptReplaceGiftId", "limitedPeriodVoiceChangeTypeOn", "startRandomMission", "randomMissionClearNum", "progressValueEqual", "progressValueAbove", "progressValueBelow", "randomMissionTotalClearNum", "weekdays", "eventFortificationRewardNum", "questClearBeforeEventStart", "notQuestClearBeforeEventStart", "eventTutorialFlagOn", "eventTutorialFlagOff", "eventSuperBossValueEqual", "notEventSuperBossValueEqual", "allSvtTargetSkillLvNum", "superBossDamageAbove", "superBossDamageBelow", "eventMissionGroupAchieve", "svtFriendshipClassNumAbove", "notWarClear", "svtSkillLvClassNumAbove", "svtClassLvUpCount", "svtClassSkillLvUpCount", "svtClassLimitUpCount", "svtClassFriendshipCount", "completeHeelPortrait", "notCompleteHeelPortrait", "classBoardSquareReleased", "svtLevelExchangeSvt", "svtLimitExchangeSvt", "skillLvExchangeSvt", "svtFriendshipExchangeSvt", "exchangeSvt", "raidDamageAbove", "raidDamageBelow", "raidGroupDamageAbove", "raidGroupDamageBelow", "raidDamageRateAbove", "raidDamageRateBelow", "raidDamageRateNotAbove", "raidDamageRateNotBelow", "raidGroupDamageRateAbove", "raidGroupDamageRateBelow", "raidGroupDamageRateNotAbove", "raidGroupDamageRateNotBelow", "notQuestGroupClearNum", "raidGroupOpenAbove", "raidGroupOpenBelow", "treasureDeviceAccelerate", "playQuestPhase", "notPlayQuestPhase", "eventStartToEnd", "commonValueAbove", "commonValueBelow", "commonValueEqual", "elapsedTimeAfterQuestClear", "withStartingMember", "latestQuestPhaseEqual", "notLatestQuestPhaseEqual", "purchaseShopNum", "eventTradeTotalNum", "limitedMissionAchieveNumBelow", "limitedMissionAchieveNumAbove", "notSvtVoicePlayed", "battlePointAbove", "battlePointBelow", "beforeSpecifiedDate", "notHaveChargeStone", "haveChargeStone", "battleFunctionTargetAllIndividuality", "battleFunctionTargetOneIndividuality", "beforeQuestClearTime", "afterQuestClearTime", "notBattleFunctionTargetAllIndividuality", "notBattleFunctionTargetOneIndividuality", "eventScriptNotPlay", "eventScriptFlag", "imagePartsGroup", "userLevelAbove", "userLevelBelow", "userLevelEqual", "highestWaveAbove", "highestWaveBelow", "privilegeValid", "privilegeInvalid", "battleActionOpponentIndividuality", "notBattleActionOpponentIndividuality", "treasureDeviceOfSelectedCard", "battleSvtFriendshipAbove", "battleSvtFriendshipBelow", "elapsedTimeAfterSvtGet", "notElapsedTimeAfterQuestClear", "notElapsedTimeAfterSvtGet", "grandSvtSet", "playedMovie", "notPlayedMovie", "notShopGroupLimitNum", "equipGet", "notEquipGet", "svtGetBeforeDate", "svtGetAfterDate", "notQuestAvailable", "notImagePartsGroup", "useEventPassiveSkillGivenItem", "notUseEventPassiveSkillGivenItem", "selfIndividuality", "notSelfIndividuality", "battleValueAbove", "battleValueBelow", "battleValueEqual", "battleValueNotEqual", "battlePointEqual", "battlePointNotEqual", "battleEntryPlayerTotalCountAbove", "battleEntryPlayerTotalCountBelow", "battleEntryPlayerTotalCountEqual", "battleEntryEnemyTotalCountAbove", "battleEntryEnemyTotalCountBelow", "battleEntryEnemyTotalCountEqual", "jobMaxLevelNumAbove", "jobMaxLevelNumBelow", "jobMaxLevelNumEqual", "svtHpReachNum", "svtAtkReachNum", "favoriteSvtIdEqual", "eventBallotSubmitted", "eventBallotNotSubmitted", "svtOfficiallyJoin"]); export const niceBaseGift = z.object({id: z.number().int(), type: niceGiftType, objectId: z.number().int(), priority: z.number().int(), num: z.number().int()}); export const niceGiftAdd = z.object({priority: z.number().int(), replacementGiftIcon: z.string().min(1).max(2083), condType: niceCondType, targetId: z.number().int(), targetNum: z.number().int(), replacementGifts: z.array(niceBaseGift)}); export const niceGift = z.object({id: z.number().int(), type: niceGiftType, objectId: z.number().int(), priority: z.number().int(), num: z.number().int(), giftAdds: z.array(niceGiftAdd)}); export const niceItemSelect = z.object({idx: z.number().int(), gifts: z.array(niceGift), requireNum: z.number().int(), detail: z.string()}); export const niceItemScript = z.object({eventId: z.number().int().nullable().optional(), eventGroupId: z.number().int().nullable().optional(), maxNum: z.number().int().nullable().optional(), validClassIds: z.array(z.number().int()).nullable().optional()}); export const niceItem = z.object({id: z.number().int(), name: z.string(), originalName: z.string(), type: niceItemType, uses: z.array(niceItemUse), detail: z.string(), individuality: z.array(niceTrait), icon: z.string().min(1).max(2083), background: niceItemBGType, value: z.number().int(), eventId: z.number().int(), eventGroupId: z.number().int(), priority: z.number().int(), dropPriority: z.number().int(), startedAt: z.number().int(), endedAt: z.number().int(), itemSelects: z.array(niceItemSelect), script: niceItemScript}); export const getApiNiceRegionItemSearchResponse = z.array(niceItem); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Find and get item data * * GET /nice/{region}/item/search */ export const getApiNiceRegionItemSearch = async (args: GetApiNiceRegionItemSearchArgs, options?: GetApiNiceRegionItemSearchOptions) => { const {baseUrl = "https://api.atlasacademy.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.name != null) query.append("name", String(args.name)) for (const item of args.individuality ?? []) query.append("individuality", String(item)) for (const item of args.type ?? []) query.append("type", String(item)) for (const item of args.background ?? []) query.append("background", String(item)) for (const item of args.use ?? []) query.append("use", String(item)) if (args.lang != null) query.append("lang", String(args.lang)) const url = `${baseUrl.replace(/\/+$/, '')}/nice/${encodeURIComponent(String(args.region))}/item/search${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(getApiNiceRegionItemSearchResponse, await res.json()) };