From ece4a9391acf3ab8d50162966681194639eea858 Mon Sep 17 00:00:00 2001 From: ThaumRystra <9525416+ThaumRystra@users.noreply.github.com> Date: Thu, 28 Sep 2023 21:27:05 +0200 Subject: [PATCH] Removed .js from all imports to smooth ts migration --- app/client/main.js | 10 +- .../creature/archive/ArchiveCreatureFiles.js | 8 +- .../archive/methods/archiveCreatureToFile.js | 14 +- .../api/creature/archive/methods/index.js | 6 +- .../archive/methods/removeArchiveCreature.js | 4 +- .../methods/restoreCreatureFromFile.js | 20 +- .../archive/methods/verifyArchiveSafety.js | 4 +- .../creatureFolders/CreatureFolders.js | 4 +- .../creatureFolders/methods.js/index.js | 8 +- .../methods.js/insertCreatureFolder.js | 14 +- .../methods.js/moveCreatureToFolder.js | 18 +- .../methods.js/removeCreatureFolder.js | 10 +- .../methods.js/reorderCreatureFolder.js | 20 +- .../methods.js/updateCreatureFolderName.js | 12 +- .../creatureProperties/CreatureProperties.ts | 10 +- .../getRootCreatureAncestor.js | 4 +- .../methods/adjustQuantity.js | 4 +- .../methods/copyPropertyToLibrary.js | 6 +- .../methods/damageProperty.js | 2 +- .../methods/duplicateProperty.js | 6 +- .../creatureProperties/methods/equipItem.js | 10 +- .../creatureProperties/methods/flipToggle.js | 4 +- .../methods/getSlotFillFilter.test.js | 2 +- .../creatureProperties/methods/index.js | 28 +- .../methods/insertProperty.js | 8 +- .../methods/insertPropertyFromLibraryNode.js | 8 +- .../methods/pullFromProperty.js | 4 +- .../methods/pushToProperty.js | 4 +- .../methods/restoreProperty.js | 4 +- .../methods/selectAmmoItem.js | 4 +- .../methods/softRemoveProperty.js | 4 +- .../methods/updateCreatureProperty.js | 4 +- .../recomputeCreaturesByProperty.js | 6 +- .../api/creature/creatures/Creatures.js | 10 +- .../creature/creatures/creaturePermissions.js | 18 +- .../creatures/defaultCharacterProperties.js | 12 +- .../methods/assertHasCharacterSlots.js | 4 +- .../methods/changeAllowedLibraries.js | 6 +- .../api/creature/creatures/methods/index.js | 10 +- .../creatures/methods/insertCreature.js | 18 +- .../creatures/methods/removeCreature.js | 10 +- .../creatures/methods/restCreature.js | 4 +- .../creatures/methods/updateCreature.js | 4 +- .../api/creature/experience/Experiences.js | 6 +- .../api/creature/journal/JournalEntry.js | 2 +- app/imports/api/creature/log/CreatureLogs.js | 14 +- .../api/creature/log/LogContentSchema.ts | 6 +- .../mixins/creaturePermissionMixin.js | 20 +- .../mixins/propagateInheritanceUpdateMixin.js | 2 +- .../creature/mixins/recomputeCreatureMixin.js | 6 +- .../api/creature/mixins/setDocToLastMixin.js | 12 +- app/imports/api/docs/Docs.js | 8 +- .../api/engine/actions/ActionContext.ts | 4 +- .../applyPropertyByType/applyAction.ts | 18 +- .../applyPropertyByType/applyAdjustment.js | 6 +- .../applyPropertyByType/applyBranch.js | 6 +- .../actions/applyPropertyByType/applyBuff.js | 18 +- .../applyPropertyByType/applyBuffRemover.js | 6 +- .../applyPropertyByType/applyDamage.js | 18 +- .../applyPropertyByType/applyFolder.js | 2 +- .../applyPropertyByType/applyItemAsAmmo.js | 4 +- .../actions/applyPropertyByType/applyNote.js | 4 +- .../actions/applyPropertyByType/applyRoll.js | 8 +- .../applyPropertyByType/applySavingThrow.js | 10 +- .../applyPropertyByType/applyToggle.js | 4 +- .../applyEffectsToCalculationParseNode.js | 6 +- .../shared/recalculateCalculation.js | 6 +- .../shared/recalculateInlineCalculations.js | 6 +- .../engine/actions/applyTriggers.testFn.js | 2 +- .../api/engine/actions/applyTriggers.ts | 8 +- app/imports/api/engine/actions/doAction.js | 6 +- .../api/engine/actions/doAction.test.js | 12 +- app/imports/api/engine/actions/doCastSpell.js | 10 +- app/imports/api/engine/actions/doCheck.js | 8 +- app/imports/api/engine/actions/index.js | 4 +- .../engine/computation/CreatureComputation.ts | 2 +- .../buildComputation/computeInactiveStatus.ts | 2 +- .../computeToggleDependencies.js | 4 +- .../linkCalculationDependencies.js | 2 +- .../parseCalculationFields.js | 10 +- .../buildComputation/removeSchemaFields.js | 2 +- .../tests/computeInactiveStatus.testFn.js | 4 +- .../tests/computeSlotQuantityFilled.testFn.js | 4 +- .../tests/computeToggleDependencies.testFn.js | 20 +- .../linkCalculationDependencies.testFn.js | 4 +- .../tests/linkInventory.testFn.js | 4 +- .../tests/linkTypeDependencies.testfn.js | 8 +- .../computation/buildCreatureComputation.js | 22 +- .../buildCreatureComputation.test.js | 16 +- .../computeComputation/computeByType.js | 20 +- .../computeByType/computeCalculation.js | 4 +- .../computeByType/computeContainer.js | 4 +- .../computeByType/computePointBuy.js | 2 +- .../computeByType/computeVariable.js | 16 +- .../computeVariable/aggregate/index.js | 14 +- .../computeImplicitVariable.js | 82 +++--- .../computeVariableAsAttribute.js | 2 +- .../computeVariableAsConstant.js | 4 +- .../computeVariable/computeVariableAsSkill.js | 2 +- .../computeVariableAsToggle.js | 4 +- .../computeVariable/getAggregatorResult.js | 12 +- .../tests/computeAction.testFn.js | 6 +- .../tests/computeAttribute.testFn.js | 6 +- .../tests/computeClasses.testFn.js | 20 +- .../tests/computeConstants.testFn.js | 10 +- .../tests/computeDamageMultipliers.testFn.js | 8 +- .../tests/computeEffects.testFn.js | 8 +- .../tests/computeInventory.testFn.js | 6 +- .../tests/computeProficiencies.testFn.js | 6 +- .../tests/computeSkills.testFn.js | 8 +- .../computeComputation/tests/index.js | 18 +- .../computation/computeCreatureComputation.js | 8 +- .../computeCreatureComputation.test.js | 6 +- .../computation/utility/applyFnToKey.test.js | 14 +- .../utility/embedInlineCalculations.js | 4 +- .../utility/evaluateCalculation.js | 2 +- .../writeAlteredProperties.js | 2 +- .../writeComputation/writeErrors.js | 10 +- .../writeComputation/writeScope.js | 4 +- app/imports/api/engine/computeCreature.js | 10 +- app/imports/api/engine/loadCreatures.js | 2 +- app/imports/api/files/UserImages.js | 4 +- app/imports/api/getModifierFields.js | 14 +- app/imports/api/icons/Icons.js | 4 +- app/imports/api/library/Libraries.js | 12 +- app/imports/api/library/LibraryCollections.js | 10 +- app/imports/api/library/LibraryNodes.js | 18 +- .../api/library/getCreatureLibraryIds.js | 4 +- app/imports/api/library/getUserLibraryIds.js | 4 +- .../api/library/methods/copyLibraryNodeTo.js | 6 +- .../library/methods/duplicateLibraryNode.js | 6 +- app/imports/api/library/methods/index.js | 6 +- .../library/methods/updateReferenceNode.js | 4 +- app/imports/api/parenting/ChildSchema.ts | 2 +- app/imports/api/parenting/organizeMethods.ts | 4 +- .../api/parenting/parentingFunctions.test.ts | 4 - app/imports/api/properties/Actions.ts | 8 +- app/imports/api/properties/Adjustments.js | 4 +- app/imports/api/properties/Attributes.js | 6 +- app/imports/api/properties/Branches.js | 4 +- app/imports/api/properties/BuffRemovers.js | 4 +- app/imports/api/properties/Buffs.js | 4 +- app/imports/api/properties/ClassLevels.js | 6 +- app/imports/api/properties/Classes.js | 8 +- app/imports/api/properties/Constants.js | 10 +- app/imports/api/properties/Containers.js | 4 +- .../api/properties/DamageMultipliers.js | 4 +- app/imports/api/properties/Damages.js | 8 +- app/imports/api/properties/Effects.js | 6 +- app/imports/api/properties/Features.js | 4 +- app/imports/api/properties/Folders.js | 4 +- app/imports/api/properties/Items.ts | 4 +- app/imports/api/properties/Notes.js | 4 +- app/imports/api/properties/PointBuys.js | 8 +- app/imports/api/properties/Proficiencies.js | 4 +- app/imports/api/properties/References.js | 2 +- app/imports/api/properties/Rolls.js | 6 +- app/imports/api/properties/SavingThrows.js | 4 +- app/imports/api/properties/Skills.js | 8 +- app/imports/api/properties/Slots.js | 6 +- app/imports/api/properties/SpellLists.js | 4 +- app/imports/api/properties/Spells.ts | 2 +- app/imports/api/properties/Toggles.js | 6 +- app/imports/api/properties/Triggers.js | 4 +- .../computedOnlyPropertySchemasIndex.js | 50 ++-- .../computedPropertySchemasIndex.js | 50 ++-- .../api/properties/propertySchemasIndex.js | 50 ++-- .../api/properties/subSchemas/ErrorSchema.js | 2 +- .../subSchemas/InlineComputationSchema.js | 4 +- .../subSchemas/RollDetailsSchema.js | 2 +- .../subSchemas/RollResultsSchema.js | 2 +- .../subSchemas/TagTargetingSchema.js | 2 +- .../properties/subSchemas/computedField.ts | 4 +- .../subSchemas/inlineCalculationField.ts | 4 +- app/imports/api/sharing/SharingSchema.js | 4 +- app/imports/api/sharing/sharing.js | 4 +- app/imports/api/tabletop/Messages.js | 4 +- app/imports/api/tabletop/Tabletops.js | 6 +- .../methods/addCreaturesToTabletop.js | 20 +- .../api/tabletop/methods/insertTabletop.js | 6 +- .../api/tabletop/methods/removeTabletop.js | 10 +- .../methods/shared/tabletopPermissions.js | 22 +- app/imports/api/users/Invites.js | 74 +++--- app/imports/api/users/Users.js | 12 +- .../api/users/methods/deleteMyAccount.js | 6 +- .../users/methods/updateFileStorageUsed.js | 8 +- app/imports/api/users/patreon/tiers.js | 20 +- .../api/users/patreon/updatePatreonOnLogin.js | 8 +- app/imports/client/serviceWorker.js | 6 +- .../client/ui/components/CoinValue.vue | 2 +- .../client/ui/components/ColorPicker.vue | 4 +- .../client/ui/components/ImageUploadInput.vue | 2 +- .../client/ui/components/ResetSelector.vue | 2 +- .../client/ui/components/ToolbarCard.vue | 4 +- .../ui/components/global/DatePicker.vue | 2 +- .../ui/components/global/IconPicker.vue | 4 +- .../client/ui/components/global/SmartBtn.vue | 2 +- .../ui/components/global/SmartCheckbox.vue | 2 +- .../ui/components/global/SmartCombobox.vue | 2 +- .../ui/components/global/SmartSelect.vue | 2 +- .../ui/components/global/SmartSlider.vue | 2 +- .../ui/components/global/SmartSwitch.vue | 2 +- .../ui/components/global/SmartToggle.vue | 2 +- .../client/ui/components/global/TextArea.vue | 2 +- .../client/ui/components/global/TextField.vue | 2 +- .../client/ui/components/propertyToolbar.vue | 10 +- .../client/ui/components/rolls/Check.vue | 2 +- .../ui/components/snackbars/SnackbarQueue.vue | 2 +- .../client/ui/components/tree/TreeNode.vue | 2 +- .../ui/components/tree/TreeSearchInput.vue | 4 +- .../client/ui/creature/CreatureForm.vue | 6 +- .../client/ui/creature/CreatureFormDialog.vue | 6 +- app/imports/client/ui/creature/RestButton.vue | 2 +- .../ui/creature/archive/ArchiveDialog.vue | 14 +- .../ui/creature/buildTree/BuildTreeNode.vue | 8 +- .../ui/creature/buildTree/FillSlotButton.vue | 2 +- .../character/CharacterCreationDialog.vue | 6 +- .../character/CharacterDeleteDialog.vue | 6 +- .../ui/creature/character/CharacterSheet.vue | 8 +- .../creature/character/CharacterSheetFab.vue | 10 +- .../character/CharacterSheetToolbar.vue | 14 +- .../creature/character/CreatureRootDialog.vue | 16 +- .../characterSheetTabs/ActionsTab.vue | 2 +- .../character/characterSheetTabs/BuildTab.vue | 14 +- .../characterSheetTabs/FeaturesTab.vue | 2 +- .../characterSheetTabs/InventoryTab.vue | 12 +- .../characterSheetTabs/JournalTab.vue | 4 +- .../characterSheetTabs/SpellsTab.vue | 2 +- .../character/characterSheetTabs/StatsTab.vue | 10 +- .../character/characterSheetTabs/TreeTab.vue | 2 +- .../character/errors/CharacterErrors.vue | 4 +- .../CharacterSheetPrinted.vue | 6 +- .../CharacterSheetPrintedToolbar.vue | 8 +- .../PrintedInventory.vue | 10 +- .../printedCharacterSheet/PrintedStats.vue | 4 +- .../components/PrintedAction.vue | 8 +- .../components/PrintedBlockItem.vue | 6 +- .../components/PrintedContainer.vue | 6 +- .../components/PrintedLineItem.vue | 4 +- .../components/PrintedSkill.vue | 2 +- .../components/PrintedSpell.vue | 4 +- .../creatureList/CreatureFolderHeader.vue | 6 +- .../ui/creature/creatureList/CreatureList.vue | 4 +- .../creatureList/CreatureListTile.vue | 4 +- .../creatureList/CreatureStorageStats.vue | 4 +- .../CreaturePropertiesTree.vue | 4 +- .../CreaturePropertyDialog.vue | 34 +-- .../dependencyGraph/DependencyGraphDialog.vue | 6 +- .../creature/experiences/ExperienceForm.vue | 2 +- .../experiences/ExperienceInsertDialog.vue | 4 +- .../experiences/ExperienceListDialog.vue | 2 +- .../ui/creature/slots/LevelUpDialog.vue | 14 +- .../client/ui/creature/slots/SlotCard.vue | 6 +- .../ui/creature/slots/SlotCardsToFill.vue | 4 +- .../ui/creature/slots/SlotFillDialog.vue | 18 +- .../client/ui/dialogStack/DialogBase.vue | 4 +- .../client/ui/dialogStack/DialogStack.vue | 6 +- .../client/ui/dialogStack/HelpDialog.vue | 4 +- .../ui/dialogStack/dialogStackWindowEvents.js | 2 +- app/imports/client/ui/docs/DocEditForm.vue | 6 +- .../client/ui/files/ArchiveFileCard.vue | 8 +- .../client/ui/files/FileStorageStats.vue | 6 +- app/imports/client/ui/icons/IconAdmin.vue | 2 +- app/imports/client/ui/icons/SvgIconByName.vue | 2 +- app/imports/client/ui/icons/importIcons.js | 12 +- app/imports/client/ui/layouts/AppLayout.vue | 2 +- app/imports/client/ui/layouts/Sidebar.vue | 6 +- .../ui/library/InsertLibraryNodeButton.vue | 4 +- .../client/ui/library/LibraryAndNode.vue | 12 +- .../client/ui/library/LibraryBrowser.vue | 6 +- .../LibraryCollectionCreationDialog.vue | 2 +- .../library/LibraryCollectionEditDialog.vue | 6 +- .../ui/library/LibraryCollectionHeader.vue | 2 +- .../ui/library/LibraryCollectionToolbar.vue | 6 +- .../ui/library/LibraryContentsContainer.vue | 8 +- .../client/ui/library/LibraryEditDialog.vue | 6 +- app/imports/client/ui/library/LibraryList.vue | 6 +- .../client/ui/library/LibraryNodeDialog.vue | 20 +- .../library/LibraryNodeExpansionContent.vue | 6 +- .../client/ui/library/LibrarySecondTree.vue | 4 +- .../ui/library/SingleLibraryToolbar.vue | 6 +- app/imports/client/ui/log/CharacterLog.vue | 10 +- app/imports/client/ui/pages/Account.vue | 14 +- app/imports/client/ui/pages/Admin.vue | 6 +- app/imports/client/ui/pages/CharacterList.vue | 12 +- app/imports/client/ui/pages/DocsPage.vue | 2 +- app/imports/client/ui/pages/Documentation.vue | 4 +- app/imports/client/ui/pages/Files.vue | 10 +- .../client/ui/pages/FunctionReference.vue | 2 +- .../client/ui/pages/LaunchCountdown.vue | 2 +- app/imports/client/ui/pages/Library.vue | 8 +- .../client/ui/pages/LibraryBrowser.vue | 6 +- .../client/ui/pages/LibraryCollection.vue | 4 +- app/imports/client/ui/pages/Maintenance.vue | 2 +- .../client/ui/pages/PatreonLevelTooLow.vue | 2 +- app/imports/client/ui/pages/SingleLibrary.vue | 2 +- app/imports/client/ui/pages/Tabletop.vue | 2 +- app/imports/client/ui/pages/Tabletops.vue | 6 +- .../ui/properties/InsertPropertyDialog.vue | 14 +- .../client/ui/properties/PropertyForm.vue | 8 +- .../components/actions/ActionCard.vue | 8 +- .../components/actions/EventButton.vue | 4 +- .../actions/SelectItemToConsume.vue | 2 +- .../components/attributes/AbilityListTile.vue | 6 +- .../components/attributes/AttributeCard.vue | 2 +- .../attributes/AttributeCardContent.vue | 6 +- .../components/attributes/AttributeEffect.vue | 2 +- .../components/attributes/HealthBar.vue | 2 +- .../attributes/HealthBarCardContainer.vue | 4 +- .../components/attributes/HitDiceListTile.vue | 2 +- .../components/attributes/ResourceCard.vue | 2 +- .../components/attributes/SpellSlotCard.vue | 4 +- .../attributes/SpellSlotListTile.vue | 6 +- .../components/effects/InlineEffect.vue | 2 +- .../components/folders/FolderGroupCard.vue | 2 +- .../AttributeGroupComponent.vue | 2 +- .../FolderGroupChildren.vue | 2 +- .../components/folders/tabFoldersMixin.js | 4 +- .../components/inventory/ContainerCard.vue | 2 +- .../components/inventory/ItemList.vue | 4 +- .../components/inventory/ItemListTile.vue | 8 +- .../components/persona/NoteCard.vue | 2 +- .../proficiencies/InlineProficiency.vue | 2 +- .../components/skills/SkillListTile.vue | 6 +- .../components/skills/SkillProficiency.vue | 4 +- .../spells/CastSpellWithSlotDialog.vue | 2 +- .../components/spells/SpellList.vue | 4 +- .../components/spells/SpellListTile.vue | 4 +- .../components/toggles/ToggleCard.vue | 2 +- .../properties/forms/ActionConditionForm.vue | 2 +- .../forms/ActionConditionsListForm.vue | 2 +- .../client/ui/properties/forms/ActionForm.vue | 2 +- .../ui/properties/forms/AdjustmentForm.vue | 4 +- .../forms/AttributeConsumedForm.vue | 4 +- .../ui/properties/forms/AttributeForm.vue | 2 +- .../forms/AttributesConsumedListForm.vue | 2 +- .../client/ui/properties/forms/BranchForm.vue | 2 +- .../client/ui/properties/forms/BuffForm.vue | 2 +- .../ui/properties/forms/BuffRemoverForm.vue | 4 +- .../client/ui/properties/forms/ClassForm.vue | 6 +- .../ui/properties/forms/ClassLevelForm.vue | 2 +- .../ui/properties/forms/ConstantForm.vue | 4 +- .../ui/properties/forms/ContainerForm.vue | 2 +- .../client/ui/properties/forms/DamageForm.vue | 8 +- .../properties/forms/DamageMultiplierForm.vue | 6 +- .../client/ui/properties/forms/EffectForm.vue | 6 +- .../ui/properties/forms/FeatureForm.vue | 2 +- .../client/ui/properties/forms/FolderForm.vue | 2 +- .../ui/properties/forms/ItemConsumedForm.vue | 2 +- .../client/ui/properties/forms/ItemForm.vue | 2 +- .../forms/ItemsConsumedListForm.vue | 2 +- .../client/ui/properties/forms/NoteForm.vue | 2 +- .../ui/properties/forms/PointBuyForm.vue | 6 +- .../ui/properties/forms/PointBuySpendForm.vue | 4 +- .../ui/properties/forms/ProficiencyForm.vue | 4 +- .../ui/properties/forms/ReferenceForm.vue | 4 +- .../ui/properties/forms/ResourcesForm.vue | 2 +- .../client/ui/properties/forms/RollForm.vue | 2 +- .../ui/properties/forms/SavingThrowForm.vue | 4 +- .../client/ui/properties/forms/SkillForm.vue | 4 +- .../client/ui/properties/forms/SlotForm.vue | 4 +- .../client/ui/properties/forms/SpellForm.vue | 2 +- .../ui/properties/forms/SpellListForm.vue | 4 +- .../client/ui/properties/forms/ToggleForm.vue | 2 +- .../ui/properties/forms/TriggerForm.vue | 4 +- .../forms/shared/ProficiencySelect.vue | 2 +- .../properties/forms/shared/TagTargeting.vue | 2 +- .../forms/shared/lists/attributeListMixin.js | 6 +- .../shared/lists/createListOfProperties.js | 2 +- .../forms/shared/lists/saveListMixin.js | 6 +- .../forms/shared/lists/skillListMixin.js | 6 +- .../ui/properties/shared/ProficiencyIcon.vue | 2 +- .../ui/properties/shared/PropertyIcon.vue | 2 +- .../ui/properties/shared/PropertySelector.vue | 2 +- .../ui/properties/shared/PropertyViewer.vue | 4 +- .../shared/SelectablePropertyDialog.vue | 2 +- .../ui/properties/shared/getPropertyTitle.js | 4 +- .../treeNodeViews/AdjustmentTreeNode.vue | 2 +- .../treeNodeViews/BranchTreeNode.vue | 2 +- .../treeNodeViews/ClassLevelTreeNode.vue | 2 +- .../treeNodeViews/DamageTreeNode.vue | 4 +- .../treeNodeViews/DefaultTreeNode.vue | 2 +- .../treeNodeViews/EffectTreeNode.vue | 4 +- .../properties/treeNodeViews/ItemTreeNode.vue | 4 +- .../treeNodeViews/ProficiencyTreeNode.vue | 2 +- .../treeNodeViews/ReferenceTreeNode.vue | 2 +- .../treeNodeViews/SavingThrowTreeNode.vue | 4 +- .../properties/treeNodeViews/TreeNodeView.vue | 2 +- .../treeNodeViews/treeNodeViewMixin.js | 4 +- .../ui/properties/viewers/ActionViewer.vue | 10 +- .../properties/viewers/AdjustmentViewer.vue | 4 +- .../ui/properties/viewers/AttributeViewer.vue | 12 +- .../ui/properties/viewers/BranchViewer.vue | 4 +- .../properties/viewers/BuffRemoverViewer.vue | 4 +- .../ui/properties/viewers/BuffViewer.vue | 4 +- .../properties/viewers/ClassLevelViewer.vue | 2 +- .../ui/properties/viewers/ClassViewer.vue | 4 +- .../ui/properties/viewers/ConstantViewer.vue | 2 +- .../ui/properties/viewers/ContainerViewer.vue | 2 +- .../viewers/DamageMultiplierViewer.vue | 2 +- .../ui/properties/viewers/DamageViewer.vue | 2 +- .../ui/properties/viewers/EffectViewer.vue | 4 +- .../ui/properties/viewers/FeatureViewer.vue | 2 +- .../ui/properties/viewers/FolderViewer.vue | 2 +- .../ui/properties/viewers/ItemViewer.vue | 10 +- .../ui/properties/viewers/NoteViewer.vue | 2 +- .../ui/properties/viewers/PointBuyViewer.vue | 6 +- .../properties/viewers/ProficiencyViewer.vue | 2 +- .../ui/properties/viewers/ReferenceViewer.vue | 2 +- .../ui/properties/viewers/RollViewer.vue | 2 +- .../properties/viewers/SavingThrowViewer.vue | 2 +- .../ui/properties/viewers/SkillViewer.vue | 10 +- .../properties/viewers/SlotFillerViewer.vue | 4 +- .../ui/properties/viewers/SlotViewer.vue | 4 +- .../ui/properties/viewers/SpellListViewer.vue | 2 +- .../ui/properties/viewers/SpellViewer.vue | 2 +- .../ui/properties/viewers/ToggleViewer.vue | 2 +- .../ui/properties/viewers/TriggerViewer.vue | 6 +- .../viewers/shared/PropertyField.vue | 2 +- app/imports/client/ui/router.js | 4 +- app/imports/client/ui/sharing/ShareDialog.vue | 2 +- .../ui/sharing/TransferOwnershipDialog.vue | 2 +- .../ui/tabletop/SelectCreaturesDialog.vue | 2 +- .../client/ui/tabletop/TabletopComponent.vue | 6 +- .../client/ui/tabletop/TabletopLog.vue | 2 +- .../ui/user/DeleteUserAccountDialog.vue | 4 +- app/imports/client/ui/user/InviteDialog.vue | 2 +- .../client/ui/user/TierTooLowDialog.vue | 4 +- .../client/ui/utility/getThemeColor.js | 4 +- app/imports/client/ui/vueSetup.js | 10 +- app/imports/client/ui/vuetify.js | 4 +- app/imports/client/ui/vuexStore.js | 4 +- app/imports/constants/MAINTENANCE_MODE.js | 2 +- .../migrations/archive/migrateArchive.js | 6 +- .../migrations/archive/migrateArchive1To2.js | 2 +- .../migrations/archive/migrateArchiveTo1.js | 2 +- app/imports/migrations/methods/getVersion.js | 2 +- app/imports/migrations/methods/index.js | 6 +- app/imports/migrations/methods/migrateTo.js | 2 +- .../migrations/methods/validateDatabase.js | 2 +- app/imports/migrations/server/dbv1/dbv1.js | 8 +- .../migrations/server/dbv1/dbv1.test.js | 4 +- app/imports/migrations/server/dbv2/dbv2.js | 10 +- .../migrations/server/dbv2/dbv2.test.js | 2 +- app/imports/migrations/server/index.js | 4 +- .../migrations/server/transformFields.test.js | 42 +-- app/imports/parser/functions.js | 4 +- app/imports/parser/grammar.js | 247 +++++++++--------- app/imports/parser/grammar.ne | 2 +- app/imports/parser/parseTree/_index.js | 28 +- app/imports/parser/parseTree/accessor.js | 6 +- app/imports/parser/parseTree/array.js | 28 +- app/imports/parser/parseTree/call.js | 8 +- app/imports/parser/parseTree/not.js | 20 +- app/imports/parser/parseTree/operator.js | 32 +-- app/imports/parser/parseTree/parenthesis.js | 22 +- app/imports/parser/parseTree/roll.js | 54 ++-- app/imports/parser/parseTree/rollArray.js | 2 +- app/imports/parser/parseTree/symbol.js | 4 +- app/imports/parser/parseTree/unaryOperator.js | 22 +- app/imports/parser/parser.js | 14 +- app/imports/parser/resolve.js | 36 +-- app/imports/server/config/SimpleRestConfig.js | 8 +- .../server/config/accountsEmailConfig.js | 10 +- app/imports/server/config/redisCaching.js | 2 +- .../server/cron/deleteSoftRemovedDocuments.js | 4 +- .../server/publications/archiveFiles.js | 2 +- .../server/publications/characterList.js | 56 ++-- app/imports/server/publications/docs.js | 2 +- .../server/publications/experiences.js | 20 +- app/imports/server/publications/icons.js | 2 +- app/imports/server/publications/index.js | 28 +- app/imports/server/publications/library.js | 8 +- .../server/publications/ownedDocuments.js | 12 +- .../server/publications/searchLibraryNodes.js | 12 +- .../server/publications/singleCharacter.js | 12 +- .../server/publications/slotFillers.js | 12 +- app/imports/server/publications/tabletops.js | 24 +- app/imports/server/publications/userImages.js | 2 +- app/imports/server/publications/users.js | 4 +- .../server/rest/apiPublications/creature.js | 8 +- .../server/rest/apiPublications/index.js | 4 +- app/imports/server/rest/index.js | 4 +- app/imports/server/rest/restLogin.js | 2 +- app/server/main.js | 38 +-- 485 files changed, 1844 insertions(+), 1843 deletions(-) diff --git a/app/client/main.js b/app/client/main.js index 6305c8ae..7bb201aa 100644 --- a/app/client/main.js +++ b/app/client/main.js @@ -1,7 +1,7 @@ -import '/imports/api/simpleSchemaConfig.js'; -import '/imports/client/ui/vueSetup.js'; -import '/imports/client/ui/styles/stylesIndex.js'; -import '/imports/client/config.js'; -import '/imports/client/serviceWorker.js'; +import '/imports/api/simpleSchemaConfig'; +import '/imports/client/ui/vueSetup'; +import '/imports/client/ui/styles/stylesIndex'; +import '/imports/client/config'; +import '/imports/client/serviceWorker'; import 'ngraph.graph'; diff --git a/app/imports/api/creature/archive/ArchiveCreatureFiles.js b/app/imports/api/creature/archive/ArchiveCreatureFiles.js index 206f187c..dda1499f 100644 --- a/app/imports/api/creature/archive/ArchiveCreatureFiles.js +++ b/app/imports/api/creature/archive/ArchiveCreatureFiles.js @@ -1,13 +1,13 @@ import SimpleSchema from 'simpl-schema'; -import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed.js'; +import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed'; import { CreaturePropertySchema } from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { CreatureSchema } from '/imports/api/creature/creatures/Creatures.js'; +import { CreatureSchema } from '/imports/api/creature/creatures/Creatures'; let createS3FilesCollection; if (Meteor.isServer) { - createS3FilesCollection = require('/imports/api/files/server/s3FileStorage.js').createS3FilesCollection + createS3FilesCollection = require('/imports/api/files/server/s3FileStorage').createS3FilesCollection } else { - createS3FilesCollection = require('/imports/api/files/client/s3FileStorage.js').createS3FilesCollection + createS3FilesCollection = require('/imports/api/files/client/s3FileStorage').createS3FilesCollection } const ArchiveCreatureFiles = createS3FilesCollection({ diff --git a/app/imports/api/creature/archive/methods/archiveCreatureToFile.js b/app/imports/api/creature/archive/methods/archiveCreatureToFile.js index ca3f212e..469657b4 100644 --- a/app/imports/api/creature/archive/methods/archiveCreatureToFile.js +++ b/app/imports/api/creature/archive/methods/archiveCreatureToFile.js @@ -1,14 +1,14 @@ -import SCHEMA_VERSION from '/imports/constants/SCHEMA_VERSION.js'; +import SCHEMA_VERSION from '/imports/constants/SCHEMA_VERSION'; import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertOwnership } from '/imports/api/creature/creatures/creaturePermissions.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import { assertOwnership } from '/imports/api/creature/creatures/creaturePermissions'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import CreatureLogs from '/imports/api/creature/log/CreatureLogs.js'; -import Experiences from '/imports/api/creature/experience/Experiences.js'; -import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature.js'; -import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles.js'; +import CreatureLogs from '/imports/api/creature/log/CreatureLogs'; +import Experiences from '/imports/api/creature/experience/Experiences'; +import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature'; +import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles'; export function getArchiveObj(creatureId) { // Build the archive document diff --git a/app/imports/api/creature/archive/methods/index.js b/app/imports/api/creature/archive/methods/index.js index 491ba038..abb0d9b6 100644 --- a/app/imports/api/creature/archive/methods/index.js +++ b/app/imports/api/creature/archive/methods/index.js @@ -1,3 +1,3 @@ -import '/imports/api/creature/archive/methods/archiveCreatureToFile.js'; -import '/imports/api/creature/archive/methods/restoreCreatureFromFile.js'; -import '/imports/api/creature/archive/methods/removeArchiveCreature.js'; +import '/imports/api/creature/archive/methods/archiveCreatureToFile'; +import '/imports/api/creature/archive/methods/restoreCreatureFromFile'; +import '/imports/api/creature/archive/methods/removeArchiveCreature'; diff --git a/app/imports/api/creature/archive/methods/removeArchiveCreature.js b/app/imports/api/creature/archive/methods/removeArchiveCreature.js index f4ba608b..c7a20fb2 100644 --- a/app/imports/api/creature/archive/methods/removeArchiveCreature.js +++ b/app/imports/api/creature/archive/methods/removeArchiveCreature.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles.js'; -import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed.js'; +import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles'; +import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed'; const removeArchiveCreature = new ValidatedMethod({ name: 'ArchiveCreatureFiles.methods.removeArchiveCreature', diff --git a/app/imports/api/creature/archive/methods/restoreCreatureFromFile.js b/app/imports/api/creature/archive/methods/restoreCreatureFromFile.js index 516af6e9..416782a0 100644 --- a/app/imports/api/creature/archive/methods/restoreCreatureFromFile.js +++ b/app/imports/api/creature/archive/methods/restoreCreatureFromFile.js @@ -1,20 +1,20 @@ -import SCHEMA_VERSION from '/imports/constants/SCHEMA_VERSION.js'; +import SCHEMA_VERSION from '/imports/constants/SCHEMA_VERSION'; import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import CreatureLogs from '/imports/api/creature/log/CreatureLogs.js'; -import Experiences from '/imports/api/creature/experience/Experiences.js'; -import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature.js'; -import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles.js'; -import assertHasCharactersSlots from '/imports/api/creature/creatures/methods/assertHasCharacterSlots.js'; -import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed.js'; -import verifyArchiveSafety from '/imports/api/creature/archive/methods/verifyArchiveSafety.js'; +import CreatureLogs from '/imports/api/creature/log/CreatureLogs'; +import Experiences from '/imports/api/creature/experience/Experiences'; +import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature'; +import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles'; +import assertHasCharactersSlots from '/imports/api/creature/creatures/methods/assertHasCharacterSlots'; +import { incrementFileStorageUsed } from '/imports/api/users/methods/updateFileStorageUsed'; +import verifyArchiveSafety from '/imports/api/creature/archive/methods/verifyArchiveSafety'; let migrateArchive; if (Meteor.isServer) { - migrateArchive = require('/imports/migrations/archive/migrateArchive.js').default; + migrateArchive = require('/imports/migrations/archive/migrateArchive').default; } function restoreCreature(archive, userId) { diff --git a/app/imports/api/creature/archive/methods/verifyArchiveSafety.js b/app/imports/api/creature/archive/methods/verifyArchiveSafety.js index 734b2582..5b46d7ed 100644 --- a/app/imports/api/creature/archive/methods/verifyArchiveSafety.js +++ b/app/imports/api/creature/archive/methods/verifyArchiveSafety.js @@ -1,7 +1,7 @@ import { slice } from 'lodash'; -import PER_CREATURE_LOG_LIMIT from '/imports/api/creature/log/CreatureLogs.js'; +import PER_CREATURE_LOG_LIMIT from '/imports/api/creature/log/CreatureLogs'; -export default function verifyArchiveSafety({ meta, creature, properties, experiences, logs }){ +export default function verifyArchiveSafety({ meta, creature, properties, experiences, logs }) { const creatureId = creature._id; // Check lengths of arrays diff --git a/app/imports/api/creature/creatureFolders/CreatureFolders.js b/app/imports/api/creature/creatureFolders/CreatureFolders.js index e0e784cc..6339014a 100644 --- a/app/imports/api/creature/creatureFolders/CreatureFolders.js +++ b/app/imports/api/creature/creatureFolders/CreatureFolders.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let CreatureFolders = new Mongo.Collection('creatureFolders'); @@ -35,5 +35,5 @@ let creatureFolderSchema = new SimpleSchema({ CreatureFolders.attachSchema(creatureFolderSchema); -import '/imports/api/creature/creatureFolders/methods.js/index.js'; +import '/imports/api/creature/creatureFolders/methods.js/index'; export default CreatureFolders; diff --git a/app/imports/api/creature/creatureFolders/methods.js/index.js b/app/imports/api/creature/creatureFolders/methods.js/index.js index 26782576..94a5bbc7 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/index.js +++ b/app/imports/api/creature/creatureFolders/methods.js/index.js @@ -1,4 +1,4 @@ -import '/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder.js'; -import '/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName.js'; -import '/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder.js'; -import '/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder.js'; +import '/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder'; +import '/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName'; +import '/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder'; +import '/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder'; diff --git a/app/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder.js b/app/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder.js index 8df44d40..497943b4 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder.js +++ b/app/imports/api/creature/creatureFolders/methods.js/insertCreatureFolder.js @@ -1,4 +1,4 @@ -import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders.js'; +import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; @@ -15,23 +15,23 @@ const insertCreatureFolder = new ValidatedMethod({ let userId = this.userId; if (!userId) { throw new Meteor.Error('creatureFolders.methods.insert.denied', - 'You need to be logged in to insert a folder'); + 'You need to be logged in to insert a folder'); } // Limit folders to 50 per user let existingFolders = CreatureFolders.find({ owner: userId }, { - fields: {order: 1}, - sort: {order :-1} + fields: { order: 1 }, + sort: { order: -1 } }); - if (existingFolders.count() >= 50){ + if (existingFolders.count() >= 50) { throw new Meteor.Error('creatureFolders.methods.insert.denied', - 'You can not have more than 50 folders'); + 'You can not have more than 50 folders'); } // Make the new folder the last in the order let order = 0; let lastFolder = existingFolders.fetch()[0]; - if (lastFolder){ + if (lastFolder) { order = (lastFolder.order || 0) + 1; } // Insert diff --git a/app/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder.js b/app/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder.js index 46f9b696..2fa90c49 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder.js +++ b/app/imports/api/creature/creatureFolders/methods.js/moveCreatureToFolder.js @@ -1,4 +1,4 @@ -import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders.js'; +import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; @@ -10,33 +10,33 @@ const moveCreatureToFolder = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({creatureId, folderId}) { + run({ creatureId, folderId }) { // Ensure logged in let userId = this.userId; if (!userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'You need to be logged in to remove a folder'); + 'You need to be logged in to remove a folder'); } // Check that this folder is owned by the user - if (folderId){ + if (folderId) { let existingFolder = CreatureFolders.findOne(folderId); - if (existingFolder.owner !== userId){ + if (existingFolder.owner !== userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'This folder does not belong to you'); + 'This folder does not belong to you'); } } // Remove from other folders CreatureFolders.update({ owner: userId }, { - $pull: {creatures: creatureId}, + $pull: { creatures: creatureId }, }, { multi: true, }); - if (folderId){ + if (folderId) { // Add to this folder CreatureFolders.update(folderId, { - $addToSet: {creatures: creatureId}, + $addToSet: { creatures: creatureId }, }); } }, diff --git a/app/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder.js b/app/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder.js index 71006cb7..4502fcb6 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder.js +++ b/app/imports/api/creature/creatureFolders/methods.js/removeCreatureFolder.js @@ -1,4 +1,4 @@ -import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders.js'; +import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; @@ -10,18 +10,18 @@ const removeCreatureFolder = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({_id}) { + run({ _id }) { // Ensure logged in let userId = this.userId; if (!userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'You need to be logged in to remove a folder'); + 'You need to be logged in to remove a folder'); } // Check that this folder is owned by the user let existingFolder = CreatureFolders.findOne(_id); - if (existingFolder.owner !== userId){ + if (existingFolder.owner !== userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'This folder does not belong to you'); + 'This folder does not belong to you'); } // Remove return CreatureFolders.remove(_id); diff --git a/app/imports/api/creature/creatureFolders/methods.js/reorderCreatureFolder.js b/app/imports/api/creature/creatureFolders/methods.js/reorderCreatureFolder.js index 92ecb418..3cdc7c5a 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/reorderCreatureFolder.js +++ b/app/imports/api/creature/creatureFolders/methods.js/reorderCreatureFolder.js @@ -1,4 +1,4 @@ -import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders.js'; +import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; @@ -10,31 +10,31 @@ const reorderCreatureFolder = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({_id, order}) { + run({ _id, order }) { // Ensure logged in let userId = this.userId; if (!userId) { throw new Meteor.Error('creatureFolders.methods.reorder.denied', - 'You need to be logged in to reorder a folder'); + 'You need to be logged in to reorder a folder'); } // Check that this folder is owned by the user let existingFolder = CreatureFolders.findOne(_id); - if (existingFolder.owner !== userId){ + if (existingFolder.owner !== userId) { throw new Meteor.Error('creatureFolders.methods.reorder.denied', - 'This folder does not belong to you'); + 'This folder does not belong to you'); } // First give it the new order, it should end in 0.5 putting it between two other docs - CreatureFolders.update(_id, {$set: {order}}); + CreatureFolders.update(_id, { $set: { order } }); this.unblock(); // Reorder all the folders with integer numbers in this new order CreatureFolders.find({ owner: userId }, { - fields: {order: 1,}, - sort: {order: -1} + fields: { order: 1, }, + sort: { order: -1 } }).forEach((folder, index) => { - if (folder.order !== index){ - CreatureFolders.update(_id, {$set: {order: index}}) + if (folder.order !== index) { + CreatureFolders.update(_id, { $set: { order: index } }) } }); }, diff --git a/app/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName.js b/app/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName.js index d798e59a..4fbb2a93 100644 --- a/app/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName.js +++ b/app/imports/api/creature/creatureFolders/methods.js/updateCreatureFolderName.js @@ -1,4 +1,4 @@ -import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders.js'; +import CreatureFolders from '/imports/api/creature/creatureFolders/CreatureFolders'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; @@ -10,21 +10,21 @@ const updateCreatureFolderName = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({_id, name}) { + run({ _id, name }) { // Ensure logged in let userId = this.userId; if (!userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'You need to be logged in to update a folder'); + 'You need to be logged in to update a folder'); } // Check that this folder is owned by the user let existingFolder = CreatureFolders.findOne(_id); - if (existingFolder.owner !== userId){ + if (existingFolder.owner !== userId) { throw new Meteor.Error('creatureFolders.methods.updateName.denied', - 'This folder does not belong to you'); + 'This folder does not belong to you'); } // Update - return CreatureFolders.update(_id, {$set: {name}}); + return CreatureFolders.update(_id, { $set: { name } }); }, }); diff --git a/app/imports/api/creature/creatureProperties/CreatureProperties.ts b/app/imports/api/creature/creatureProperties/CreatureProperties.ts index e42d9a6c..da70b74b 100644 --- a/app/imports/api/creature/creatureProperties/CreatureProperties.ts +++ b/app/imports/api/creature/creatureProperties/CreatureProperties.ts @@ -1,11 +1,11 @@ import { Mongo } from 'meteor/mongo'; import SimpleSchema from 'simpl-schema'; -import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema.js'; +import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema'; import ChildSchema, { TreeDoc } from '/imports/api/parenting/ChildSchema'; -import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema.js'; -import propertySchemasIndex from '/imports/api/properties/computedPropertySchemasIndex.js'; -import { storedIconsSchema } from '/imports/api/icons/Icons.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema'; +import propertySchemasIndex from '/imports/api/properties/computedPropertySchemasIndex'; +import { storedIconsSchema } from '/imports/api/icons/Icons'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const CreatureProperties: Mongo.Collection = new Mongo.Collection('creatureProperties'); diff --git a/app/imports/api/creature/creatureProperties/getRootCreatureAncestor.js b/app/imports/api/creature/creatureProperties/getRootCreatureAncestor.js index c4e2c862..39eadabf 100644 --- a/app/imports/api/creature/creatureProperties/getRootCreatureAncestor.js +++ b/app/imports/api/creature/creatureProperties/getRootCreatureAncestor.js @@ -1,5 +1,5 @@ -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; -export default function getRootCreatureAncestor(property){ +export default function getRootCreatureAncestor(property) { return Creatures.findOne(property.ancestors[0].id); } diff --git a/app/imports/api/creature/creatureProperties/methods/adjustQuantity.js b/app/imports/api/creature/creatureProperties/methods/adjustQuantity.js index 1f2874ef..8ed733c3 100644 --- a/app/imports/api/creature/creatureProperties/methods/adjustQuantity.js +++ b/app/imports/api/creature/creatureProperties/methods/adjustQuantity.js @@ -2,8 +2,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; const adjustQuantity = new ValidatedMethod({ name: 'creatureProperties.adjustQuantity', diff --git a/app/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary.js b/app/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary.js index 0cfcd86a..14ff9151 100644 --- a/app/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary.js +++ b/app/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary.js @@ -2,20 +2,20 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; import { assertEditPermission, assertDocEditPermission, assertCopyPermission -} from '/imports/api/sharing/sharingPermissions.js'; +} from '/imports/api/sharing/sharingPermissions'; import { setLineageOfDocs, getAncestry, renewDocIds } from '/imports/api/parenting/parentingFunctions'; import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; -import Libraries from '/imports/api/library/Libraries.js'; +import Libraries from '/imports/api/library/Libraries'; const DUPLICATE_CHILDREN_LIMIT = 500; const copyPropertyToLibrary = new ValidatedMethod({ diff --git a/app/imports/api/creature/creatureProperties/methods/damageProperty.js b/app/imports/api/creature/creatureProperties/methods/damageProperty.js index fee7a24e..555a35fe 100644 --- a/app/imports/api/creature/creatureProperties/methods/damageProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/damageProperty.js @@ -2,7 +2,7 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { applyTriggers } from '/imports/api/engine/actions/applyTriggers'; import ActionContext from '/imports/api/engine/actions/ActionContext'; diff --git a/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js b/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js index 7dafa0f0..3cfe331e 100644 --- a/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/duplicateProperty.js @@ -2,8 +2,8 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; import { setLineageOfDocs, renewDocIds @@ -12,7 +12,7 @@ import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; var snackbar; if (Meteor.isClient) { snackbar = require( - '/imports/client/ui/components/snackbars/SnackbarQueue.js' + '/imports/client/ui/components/snackbars/SnackbarQueue' ).snackbar } diff --git a/app/imports/api/creature/creatureProperties/methods/equipItem.js b/app/imports/api/creature/creatureProperties/methods/equipItem.js index eb0e8057..8261e882 100644 --- a/app/imports/api/creature/creatureProperties/methods/equipItem.js +++ b/app/imports/api/creature/creatureProperties/methods/equipItem.js @@ -1,11 +1,11 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import { organizeDoc } from '/imports/api/parenting/organizeMethods.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; -import BUILT_IN_TAGS from '/imports/constants/BUILT_IN_TAGS.js'; -import getParentRefByTag from '/imports/api/creature/creatureProperties/methods/getParentRefByTag.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import { organizeDoc } from '/imports/api/parenting/organizeMethods'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; +import BUILT_IN_TAGS from '/imports/constants/BUILT_IN_TAGS'; +import getParentRefByTag from '/imports/api/creature/creatureProperties/methods/getParentRefByTag'; // Equipping or unequipping an item will also change its parent const equipItem = new ValidatedMethod({ diff --git a/app/imports/api/creature/creatureProperties/methods/flipToggle.js b/app/imports/api/creature/creatureProperties/methods/flipToggle.js index 1f60bb2c..29d97f32 100644 --- a/app/imports/api/creature/creatureProperties/methods/flipToggle.js +++ b/app/imports/api/creature/creatureProperties/methods/flipToggle.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; const flipToggle = new ValidatedMethod({ name: 'creatureProperties.flipToggle', diff --git a/app/imports/api/creature/creatureProperties/methods/getSlotFillFilter.test.js b/app/imports/api/creature/creatureProperties/methods/getSlotFillFilter.test.js index d7b33cc0..a237b3c1 100644 --- a/app/imports/api/creature/creatureProperties/methods/getSlotFillFilter.test.js +++ b/app/imports/api/creature/creatureProperties/methods/getSlotFillFilter.test.js @@ -1,5 +1,5 @@ import { assert } from 'chai'; -import getSlotFillFilter from '/imports/api/creature/creatureProperties/methods/getSlotFillFilter.js'; +import getSlotFillFilter from '/imports/api/creature/creatureProperties/methods/getSlotFillFilter'; describe('Slot fill filter', function () { diff --git a/app/imports/api/creature/creatureProperties/methods/index.js b/app/imports/api/creature/creatureProperties/methods/index.js index 94bedae3..e66019cc 100644 --- a/app/imports/api/creature/creatureProperties/methods/index.js +++ b/app/imports/api/creature/creatureProperties/methods/index.js @@ -1,14 +1,14 @@ -import '/imports/api/creature/creatureProperties/methods/adjustQuantity.js'; -import '/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary.js'; -import '/imports/api/creature/creatureProperties/methods/damageProperty.js'; -import '/imports/api/creature/creatureProperties/methods/duplicateProperty.js'; -import '/imports/api/creature/creatureProperties/methods/equipItem.js'; -import '/imports/api/creature/creatureProperties/methods/insertProperty.js'; -import '/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js'; -import '/imports/api/creature/creatureProperties/methods/pullFromProperty.js'; -import '/imports/api/creature/creatureProperties/methods/pushToProperty.js'; -import '/imports/api/creature/creatureProperties/methods/restoreProperty.js'; -import '/imports/api/creature/creatureProperties/methods/selectAmmoItem.js'; -import '/imports/api/creature/creatureProperties/methods/softRemoveProperty.js'; -import '/imports/api/creature/creatureProperties/methods/updateCreatureProperty.js'; -import '/imports/api/creature/creatureProperties/methods/flipToggle.js'; +import '/imports/api/creature/creatureProperties/methods/adjustQuantity'; +import '/imports/api/creature/creatureProperties/methods/copyPropertyToLibrary'; +import '/imports/api/creature/creatureProperties/methods/damageProperty'; +import '/imports/api/creature/creatureProperties/methods/duplicateProperty'; +import '/imports/api/creature/creatureProperties/methods/equipItem'; +import '/imports/api/creature/creatureProperties/methods/insertProperty'; +import '/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode'; +import '/imports/api/creature/creatureProperties/methods/pullFromProperty'; +import '/imports/api/creature/creatureProperties/methods/pushToProperty'; +import '/imports/api/creature/creatureProperties/methods/restoreProperty'; +import '/imports/api/creature/creatureProperties/methods/selectAmmoItem'; +import '/imports/api/creature/creatureProperties/methods/softRemoveProperty'; +import '/imports/api/creature/creatureProperties/methods/updateCreatureProperty'; +import '/imports/api/creature/creatureProperties/methods/flipToggle'; diff --git a/app/imports/api/creature/creatureProperties/methods/insertProperty.js b/app/imports/api/creature/creatureProperties/methods/insertProperty.js index 7647b64a..f070546c 100644 --- a/app/imports/api/creature/creatureProperties/methods/insertProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/insertProperty.js @@ -1,14 +1,14 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; import SimpleSchema from 'simpl-schema'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; import { getAncestry } from '/imports/api/parenting/parentingFunctions'; -import getParentRefByTag from '/imports/api/creature/creatureProperties/methods/getParentRefByTag.js'; +import getParentRefByTag from '/imports/api/creature/creatureProperties/methods/getParentRefByTag'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; -import { getHighestOrder } from '/imports/api/parenting/order.js'; +import { getHighestOrder } from '/imports/api/parenting/order'; const insertProperty = new ValidatedMethod({ name: 'creatureProperties.insert', diff --git a/app/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js b/app/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js index f4b10416..8f52f2a6 100644 --- a/app/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js +++ b/app/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js @@ -2,17 +2,17 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { setLineageOfDocs, getAncestry, renewDocIds } from '/imports/api/parenting/parentingFunctions'; import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; -import { setDocToLastOrder } from '/imports/api/parenting/order.js'; +import { setDocToLastOrder } from '/imports/api/parenting/order'; import { fetchDocByRef } from '/imports/api/parenting/parentingFunctions'; import { union } from 'lodash'; diff --git a/app/imports/api/creature/creatureProperties/methods/pullFromProperty.js b/app/imports/api/creature/creatureProperties/methods/pullFromProperty.js index d4fc9d33..86303ab6 100644 --- a/app/imports/api/creature/creatureProperties/methods/pullFromProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/pullFromProperty.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; const pullFromProperty = new ValidatedMethod({ name: 'creatureProperties.pull', diff --git a/app/imports/api/creature/creatureProperties/methods/pushToProperty.js b/app/imports/api/creature/creatureProperties/methods/pushToProperty.js index 9fadf1ca..e064273e 100644 --- a/app/imports/api/creature/creatureProperties/methods/pushToProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/pushToProperty.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; import { get } from 'lodash'; const pushToProperty = new ValidatedMethod({ diff --git a/app/imports/api/creature/creatureProperties/methods/restoreProperty.js b/app/imports/api/creature/creatureProperties/methods/restoreProperty.js index 810fc30f..37713d56 100644 --- a/app/imports/api/creature/creatureProperties/methods/restoreProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/restoreProperty.js @@ -2,9 +2,9 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { restore } from '/imports/api/parenting/softRemove'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; const restoreProperty = new ValidatedMethod({ name: 'creatureProperties.restore', diff --git a/app/imports/api/creature/creatureProperties/methods/selectAmmoItem.js b/app/imports/api/creature/creatureProperties/methods/selectAmmoItem.js index 7379859f..b6578898 100644 --- a/app/imports/api/creature/creatureProperties/methods/selectAmmoItem.js +++ b/app/imports/api/creature/creatureProperties/methods/selectAmmoItem.js @@ -2,8 +2,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; const selectAmmoItem = new ValidatedMethod({ name: 'creatureProperties.selectAmmoItem', diff --git a/app/imports/api/creature/creatureProperties/methods/softRemoveProperty.js b/app/imports/api/creature/creatureProperties/methods/softRemoveProperty.js index de871b74..7c0753bc 100644 --- a/app/imports/api/creature/creatureProperties/methods/softRemoveProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/softRemoveProperty.js @@ -2,9 +2,9 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { softRemove } from '/imports/api/parenting/softRemove'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; const softRemoveProperty = new ValidatedMethod({ name: 'creatureProperties.softRemove', diff --git a/app/imports/api/creature/creatureProperties/methods/updateCreatureProperty.js b/app/imports/api/creature/creatureProperties/methods/updateCreatureProperty.js index 63739f50..b1f067fc 100644 --- a/app/imports/api/creature/creatureProperties/methods/updateCreatureProperty.js +++ b/app/imports/api/creature/creatureProperties/methods/updateCreatureProperty.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor.js'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; +import getRootCreatureAncestor from '/imports/api/creature/creatureProperties/getRootCreatureAncestor'; const updateCreatureProperty = new ValidatedMethod({ name: 'creatureProperties.update', diff --git a/app/imports/api/creature/creatureProperties/recomputeCreaturesByProperty.js b/app/imports/api/creature/creatureProperties/recomputeCreaturesByProperty.js index a2190860..085ddf07 100644 --- a/app/imports/api/creature/creatureProperties/recomputeCreaturesByProperty.js +++ b/app/imports/api/creature/creatureProperties/recomputeCreaturesByProperty.js @@ -1,10 +1,10 @@ -import computeCreature from '/imports/api/engine/computeCreature.js'; +import computeCreature from '/imports/api/engine/computeCreature'; /** * Recomputes all ancestor creatures of this property */ -export default function recomputeCreaturesByProperty(property){ - for (let ref of property.ancestors){ +export default function recomputeCreaturesByProperty(property) { + for (let ref of property.ancestors) { if (ref.collection === 'creatures') { computeCreature.call(ref.id); } diff --git a/app/imports/api/creature/creatures/Creatures.js b/app/imports/api/creature/creatures/Creatures.js index bd05254e..219da0a5 100644 --- a/app/imports/api/creature/creatures/Creatures.js +++ b/app/imports/api/creature/creatures/Creatures.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; -import deathSaveSchema from '/imports/api/properties/subSchemas/DeathSavesSchema.js' -import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema.js'; -import SharingSchema from '/imports/api/sharing/SharingSchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import deathSaveSchema from '/imports/api/properties/subSchemas/DeathSavesSchema' +import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema'; +import SharingSchema from '/imports/api/sharing/SharingSchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; //set up the collection for creatures let Creatures = new Mongo.Collection('creatures'); @@ -195,4 +195,4 @@ Creatures.attachSchema(CreatureSchema); export default Creatures; export { CreatureSchema }; -import '/imports/api/engine/actions/doAction.js'; +import '/imports/api/engine/actions/doAction'; diff --git a/app/imports/api/creature/creatures/creaturePermissions.js b/app/imports/api/creature/creatures/creaturePermissions.js index 380a5258..1e8c4d2c 100644 --- a/app/imports/api/creature/creatures/creaturePermissions.js +++ b/app/imports/api/creature/creatures/creaturePermissions.js @@ -1,29 +1,29 @@ -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import { assertEditPermission as editPermission, assertViewPermission as viewPermission, assertOwnership as ownership -} from '/imports/api/sharing/sharingPermissions.js'; +} from '/imports/api/sharing/sharingPermissions'; -function getCreature(creature, fields){ - if (typeof creature === 'string'){ - return Creatures.findOne(creature, {fields}); +function getCreature(creature, fields) { + if (typeof creature === 'string') { + return Creatures.findOne(creature, { fields }); } else { return creature; } } -export function assertOwnership(creature, userId){ - creature = getCreature(creature, {owner: 1}); +export function assertOwnership(creature, userId) { + creature = getCreature(creature, { owner: 1 }); ownership(creature, userId); } export function assertEditPermission(creature, userId) { - creature = getCreature(creature, {owner: 1, writers: 1}); + creature = getCreature(creature, { owner: 1, writers: 1 }); editPermission(creature, userId); } export function assertViewPermission(creature, userId) { - creature = getCreature(creature, {owner: 1, readers:1, writers: 1, public: 1}); + creature = getCreature(creature, { owner: 1, readers: 1, writers: 1, public: 1 }); viewPermission(creature, userId); } diff --git a/app/imports/api/creature/creatures/defaultCharacterProperties.js b/app/imports/api/creature/creatures/defaultCharacterProperties.js index e7f05a11..fd0a8b28 100644 --- a/app/imports/api/creature/creatures/defaultCharacterProperties.js +++ b/app/imports/api/creature/creatures/defaultCharacterProperties.js @@ -1,19 +1,19 @@ -import BUILT_IN_TAGS from '/imports/constants/BUILT_IN_TAGS.js'; +import BUILT_IN_TAGS from '/imports/constants/BUILT_IN_TAGS'; -export default function defaultCharacterProperties(creatureId){ +export default function defaultCharacterProperties(creatureId) { if (!creatureId) throw 'creatureId is required'; - const creatureRef = {collection: 'creatures', id: creatureId}; + const creatureRef = { collection: 'creatures', id: creatureId }; let randomSrc = DDP.randomStream('defaultProperties'); const inventoryId = randomSrc.id(); - const inventoryRef = {collection: 'creatureProperties', id: inventoryId}; + const inventoryRef = { collection: 'creatureProperties', id: inventoryId }; return [ { type: 'propertySlot', name: 'Ruleset', - description: {text: 'Choose a starting point for your character, this will define the basic setup of your character sheet. Without a base ruleset, your sheet will be empty.'}, + description: { text: 'Choose a starting point for your character, this will define the basic setup of your character sheet. Without a base ruleset, your sheet will be empty.' }, slotTags: ['base'], tags: [], - quantityExpected: {calculation: '1'}, + quantityExpected: { calculation: '1' }, hideWhenFull: true, spaceLeft: 1, totalFilled: 0, diff --git a/app/imports/api/creature/creatures/methods/assertHasCharacterSlots.js b/app/imports/api/creature/creatures/methods/assertHasCharacterSlots.js index 5b368e5f..2dc31832 100644 --- a/app/imports/api/creature/creatures/methods/assertHasCharacterSlots.js +++ b/app/imports/api/creature/creatures/methods/assertHasCharacterSlots.js @@ -1,5 +1,5 @@ -import { getUserTier } from '/imports/api/users/patreon/tiers.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import { getUserTier } from '/imports/api/users/patreon/tiers'; +import Creatures from '/imports/api/creature/creatures/Creatures'; export default function assertHasCharactersSlots(userId) { if (characterSlotsRemaining(userId) <= 0) { diff --git a/app/imports/api/creature/creatures/methods/changeAllowedLibraries.js b/app/imports/api/creature/creatures/methods/changeAllowedLibraries.js index 05a8e9d6..c95aa533 100644 --- a/app/imports/api/creature/creatures/methods/changeAllowedLibraries.js +++ b/app/imports/api/creature/creatures/methods/changeAllowedLibraries.js @@ -1,9 +1,9 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import SimpleSchema from 'simpl-schema'; -import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js'; +import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin'; const changeAllowedLibraries = new ValidatedMethod({ name: 'creatures.changeAllowedLibraries', diff --git a/app/imports/api/creature/creatures/methods/index.js b/app/imports/api/creature/creatures/methods/index.js index 85aefc77..3e8073b6 100644 --- a/app/imports/api/creature/creatures/methods/index.js +++ b/app/imports/api/creature/creatures/methods/index.js @@ -1,5 +1,5 @@ -import '/imports/api/creature/creatures/methods/insertCreature.js'; -import '/imports/api/creature/creatures/methods/removeCreature.js'; -import '/imports/api/creature/creatures/methods/restCreature.js'; -import '/imports/api/creature/creatures/methods/updateCreature.js'; -import '/imports/api/creature/creatures/methods/changeAllowedLibraries.js'; +import '/imports/api/creature/creatures/methods/insertCreature'; +import '/imports/api/creature/creatures/methods/removeCreature'; +import '/imports/api/creature/creatures/methods/restCreature'; +import '/imports/api/creature/creatures/methods/updateCreature'; +import '/imports/api/creature/creatures/methods/changeAllowedLibraries'; diff --git a/app/imports/api/creature/creatures/methods/insertCreature.js b/app/imports/api/creature/creatures/methods/insertCreature.js index 79373ca5..bddb9136 100644 --- a/app/imports/api/creature/creatures/methods/insertCreature.js +++ b/app/imports/api/creature/creatures/methods/insertCreature.js @@ -1,15 +1,15 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js'; -import Creatures, { CreatureSchema } from '/imports/api/creature/creatures/Creatures.js'; +import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin'; +import Creatures, { CreatureSchema } from '/imports/api/creature/creatures/Creatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import defaultCharacterProperties from '/imports/api/creature/creatures/defaultCharacterProperties.js'; -import insertPropertyFromLibraryNode from '/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode.js'; -import assertHasCharactersSlots from '/imports/api/creature/creatures/methods/assertHasCharacterSlots.js'; -import getSlotFillFilter from '/imports/api/creature/creatureProperties/methods/getSlotFillFilter.js'; -import getCreatureLibraryIds from '/imports/api/library/getCreatureLibraryIds.js'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; -import { insertExperienceForCreature } from '/imports/api/creature/experience/Experiences.js'; +import defaultCharacterProperties from '/imports/api/creature/creatures/defaultCharacterProperties'; +import insertPropertyFromLibraryNode from '/imports/api/creature/creatureProperties/methods/insertPropertyFromLibraryNode'; +import assertHasCharactersSlots from '/imports/api/creature/creatures/methods/assertHasCharacterSlots'; +import getSlotFillFilter from '/imports/api/creature/creatureProperties/methods/getSlotFillFilter'; +import getCreatureLibraryIds from '/imports/api/library/getCreatureLibraryIds'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; +import { insertExperienceForCreature } from '/imports/api/creature/experience/Experiences'; import SimpleSchema from 'simpl-schema'; const insertCreature = new ValidatedMethod({ diff --git a/app/imports/api/creature/creatures/methods/removeCreature.js b/app/imports/api/creature/creatures/methods/removeCreature.js index df0b8e5e..3f6d7279 100644 --- a/app/imports/api/creature/creatures/methods/removeCreature.js +++ b/app/imports/api/creature/creatures/methods/removeCreature.js @@ -1,12 +1,12 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertOwnership } from '/imports/api/creature/creatures/creaturePermissions.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables.js'; +import { assertOwnership } from '/imports/api/creature/creatures/creaturePermissions'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import CreatureLogs from '/imports/api/creature/log/CreatureLogs.js'; -import Experiences from '/imports/api/creature/experience/Experiences.js'; +import CreatureLogs from '/imports/api/creature/log/CreatureLogs'; +import Experiences from '/imports/api/creature/experience/Experiences'; function removeRelatedDocuments(creatureId) { CreatureVariables.remove({ _creatureId: creatureId }); diff --git a/app/imports/api/creature/creatures/methods/restCreature.js b/app/imports/api/creature/creatures/methods/restCreature.js index da06d093..f8a5ddd7 100644 --- a/app/imports/api/creature/creatures/methods/restCreature.js +++ b/app/imports/api/creature/creatures/methods/restCreature.js @@ -2,11 +2,11 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; import { union } from 'lodash'; import ActionContext from '/imports/api/engine/actions/ActionContext'; import { applyTriggers } from '/imports/api/engine/actions/applyTriggers'; -import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty.js'; +import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty'; const restCreature = new ValidatedMethod({ name: 'creature.methods.rest', diff --git a/app/imports/api/creature/creatures/methods/updateCreature.js b/app/imports/api/creature/creatures/methods/updateCreature.js index 4da290bc..58efc7a6 100644 --- a/app/imports/api/creature/creatures/methods/updateCreature.js +++ b/app/imports/api/creature/creatures/methods/updateCreature.js @@ -1,7 +1,7 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; const updateCreature = new ValidatedMethod({ name: 'creatures.update', diff --git a/app/imports/api/creature/experience/Experiences.js b/app/imports/api/creature/experience/Experiences.js index d1c5c527..3bd29a57 100644 --- a/app/imports/api/creature/experience/Experiences.js +++ b/app/imports/api/creature/experience/Experiences.js @@ -1,9 +1,9 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let Experiences = new Mongo.Collection('experiences'); diff --git a/app/imports/api/creature/journal/JournalEntry.js b/app/imports/api/creature/journal/JournalEntry.js index 74b885ea..bb1a5059 100644 --- a/app/imports/api/creature/journal/JournalEntry.js +++ b/app/imports/api/creature/journal/JournalEntry.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let ExperienceSchema = new SimpleSchema({ title: { diff --git a/app/imports/api/creature/log/CreatureLogs.js b/app/imports/api/creature/log/CreatureLogs.js index e3c2b04b..9d6c6a79 100644 --- a/app/imports/api/creature/log/CreatureLogs.js +++ b/app/imports/api/creature/log/CreatureLogs.js @@ -1,18 +1,18 @@ import SimpleSchema from 'simpl-schema'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables'; import LogContentSchema from '/imports/api/creature/log/LogContentSchema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; -import { parse, prettifyParseError } from '/imports/parser/parser.js'; -import resolve, { toString } from '/imports/parser/resolve.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; +import { parse, prettifyParseError } from '/imports/parser/parser'; +import resolve, { toString } from '/imports/parser/resolve'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const PER_CREATURE_LOG_LIMIT = 100; if (Meteor.isServer) { - var sendWebhookAsCreature = require('/imports/server/discord/sendWebhook.js').sendWebhookAsCreature; + var sendWebhookAsCreature = require('/imports/server/discord/sendWebhook').sendWebhookAsCreature; } let CreatureLogs = new Mongo.Collection('creatureLogs'); diff --git a/app/imports/api/creature/log/LogContentSchema.ts b/app/imports/api/creature/log/LogContentSchema.ts index 5d84d5fe..6925eb59 100644 --- a/app/imports/api/creature/log/LogContentSchema.ts +++ b/app/imports/api/creature/log/LogContentSchema.ts @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; -import RollDetailsSchema from '/imports/api/properties/subSchemas/RollDetailsSchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; +import RollDetailsSchema from '/imports/api/properties/subSchemas/RollDetailsSchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; export interface LogContent { name?: string diff --git a/app/imports/api/creature/mixins/creaturePermissionMixin.js b/app/imports/api/creature/mixins/creaturePermissionMixin.js index 18b96fbd..de419e82 100644 --- a/app/imports/api/creature/mixins/creaturePermissionMixin.js +++ b/app/imports/api/creature/mixins/creaturePermissionMixin.js @@ -2,7 +2,7 @@ import { assertEditPermission, assertViewPermission, assertOwnership, -} from '/imports/api/creature/creatures/creaturePermissions.js'; +} from '/imports/api/creature/creatures/creaturePermissions'; // Checks if the method has permission to run on the document. If the document // has a charId, that creature is checked, otherwise if it has an _id and the @@ -13,36 +13,36 @@ import { // Because this mixin injects the charId into argument objects that don't // already contain it, it should always come last in the mixin list, so that it // the outermost wrapper of the run function -export default function creaturePermissionMixin(methodOptions){ +export default function creaturePermissionMixin(methodOptions) { let assertPermission; - if (methodOptions.permission === 'owner'){ + if (methodOptions.permission === 'owner') { assertPermission = assertOwnership; - } else if (methodOptions.permission === 'edit'){ + } else if (methodOptions.permission === 'edit') { assertPermission = assertEditPermission; - } else if (methodOptions.permission === 'view'){ + } else if (methodOptions.permission === 'view') { assertPermission = assertViewPermission; } else { throw "`permission` missing in method options"; } let getCharId; - if (methodOptions.getCharId){ + if (methodOptions.getCharId) { getCharId = methodOptions.getCharId; } else if (methodOptions.collection) { - getCharId = function({_id}){ + getCharId = function ({ _id }) { return methodOptions.collection.findOne(_id, { - fields: {charId: 1} + fields: { charId: 1 } }).charId; }; } else { - getCharId = function(){ + getCharId = function () { throw "`getCharId` or `collection` missing in method options," + " or {charId} missing in call"; }; } let runFunc = methodOptions.run; - methodOptions.run = function(doc, ...rest){ + methodOptions.run = function (doc, ...rest) { // Store the charId on the doc for other mixins if it had to be fetched doc.charId = doc.charId || getCharId.apply(this, arguments); assertPermission(doc.charId, this.userId); diff --git a/app/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js b/app/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js index c238e113..9fd239f8 100644 --- a/app/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js +++ b/app/imports/api/creature/mixins/propagateInheritanceUpdateMixin.js @@ -3,7 +3,7 @@ import { updateDescendants, } from '/imports/api/parenting/parentingFunctions'; import { inheritedFields } from '/imports/api/parenting/ChildSchema'; -import MONGO_OPERATORS from '/imports/constants/MONGO_OPERATORS.js'; +import MONGO_OPERATORS from '/imports/constants/MONGO_OPERATORS'; // This mixin can be safely applied to all update methods which are validated // with the updateSchemaMixin. It will propagate updates to fields which diff --git a/app/imports/api/creature/mixins/recomputeCreatureMixin.js b/app/imports/api/creature/mixins/recomputeCreatureMixin.js index a6b991a7..32caa2f6 100644 --- a/app/imports/api/creature/mixins/recomputeCreatureMixin.js +++ b/app/imports/api/creature/mixins/recomputeCreatureMixin.js @@ -1,8 +1,8 @@ -import computeCreature from '/imports/api/engine/computeCreature.js'; +import computeCreature from '/imports/api/engine/computeCreature'; -export default function recomputeCreatureMixin(methodOptions){ +export default function recomputeCreatureMixin(methodOptions) { let runFunc = methodOptions.run; - methodOptions.run = function({charId}){ + methodOptions.run = function ({ charId }) { const result = runFunc.apply(this, arguments); if ( methodOptions.skipRecompute && diff --git a/app/imports/api/creature/mixins/setDocToLastMixin.js b/app/imports/api/creature/mixins/setDocToLastMixin.js index 53a4a0f9..3e55b5b4 100644 --- a/app/imports/api/creature/mixins/setDocToLastMixin.js +++ b/app/imports/api/creature/mixins/setDocToLastMixin.js @@ -1,11 +1,11 @@ import SimpleSchema from 'simpl-schema'; -import { setDocToLastOrder } from '/imports/api/parenting/order.js'; +import { setDocToLastOrder } from '/imports/api/parenting/order'; -export function setDocToLastMixin(methodOptions){ +export function setDocToLastMixin(methodOptions) { // Make sure the doc has a charId // This mixin should come before simpleSchemaMixin so that it can extend the // schema before it is turned into a validate function - if (methodOptions.validate){ + if (methodOptions.validate) { throw new Meteor.Error(`setDocToLastMixin should come before simpleSchemaMixin`); } methodOptions.schema = new SimpleSchema({ @@ -15,12 +15,12 @@ export function setDocToLastMixin(methodOptions){ }, }).extend(methodOptions.schema); let collection = methodOptions.collection; - if (!collection){ + if (!collection) { throw new Meteor.Error("`collection` required in method options for setDocToLastMixin"); } let runFunc = methodOptions.run; - methodOptions.run = function(doc){ - setDocToLastOrder({collection, doc}); + methodOptions.run = function (doc) { + setDocToLastOrder({ collection, doc }); return runFunc.apply(this, arguments); }; return methodOptions; diff --git a/app/imports/api/docs/Docs.js b/app/imports/api/docs/Docs.js index 6300c896..fcbd042f 100644 --- a/app/imports/api/docs/Docs.js +++ b/app/imports/api/docs/Docs.js @@ -4,10 +4,10 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; import { softRemove } from '/imports/api/parenting/softRemove'; -import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema.js'; -import { storedIconsSchema } from '/imports/api/icons/Icons.js'; -import '/imports/api/library/methods/index.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema'; +import { storedIconsSchema } from '/imports/api/icons/Icons'; +import '/imports/api/library/methods/index'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; import { restore } from '/imports/api/parenting/softRemove'; import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; import { getAncestry } from '/imports/api/parenting/parentingFunctions'; diff --git a/app/imports/api/engine/actions/ActionContext.ts b/app/imports/api/engine/actions/ActionContext.ts index d7e1311a..ee87feb1 100644 --- a/app/imports/api/engine/actions/ActionContext.ts +++ b/app/imports/api/engine/actions/ActionContext.ts @@ -1,7 +1,7 @@ -import { CreatureLogSchema, insertCreatureLogWork } from '/imports/api/creature/log/CreatureLogs.js'; +import { CreatureLogSchema, insertCreatureLogWork } from '/imports/api/creature/log/CreatureLogs'; import { getCreature, getVariables, getPropertiesOfType -} from '/imports/api/engine/loadCreatures.js'; +} from '/imports/api/engine/loadCreatures'; import { groupBy, remove } from 'lodash'; export default class ActionContext { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAction.ts b/app/imports/api/engine/actions/applyPropertyByType/applyAction.ts index 91041ca7..6977142c 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.ts +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.ts @@ -1,17 +1,17 @@ -import recalculateInlineCalculations from './shared/recalculateInlineCalculations.js'; -import recalculateCalculation from './shared/recalculateCalculation.js'; -import rollDice from '/imports/parser/rollDice.js'; +import recalculateInlineCalculations from './shared/recalculateInlineCalculations'; +import recalculateCalculation from './shared/recalculateCalculation'; +import rollDice from '/imports/parser/rollDice'; import applyProperty from '../applyProperty'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; -import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty.js'; -import numberToSignedString from '/imports/api/utility/numberToSignedString.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; +import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty'; +import numberToSignedString from '/imports/api/utility/numberToSignedString'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import { resetProperties } from '/imports/api/creature/creatures/methods/restCreature.js'; +import { resetProperties } from '/imports/api/creature/creatures/methods/restCreature'; import { TreeNode } from '/imports/api/parenting/parentingFunctions'; import { Action } from '/imports/api/properties/Actions'; -import { LogContent } from '/imports/api/creature/log/LogContentSchema.js'; -import { Item } from '/imports/api/properties/Items.js'; +import { LogContent } from '/imports/api/creature/log/LogContentSchema'; +import { Item } from '/imports/api/properties/Items'; interface Ammo extends Item { type: 'ammo' diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js b/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js index 1a4f5c72..e14265d5 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAdjustment.js @@ -1,6 +1,6 @@ -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; -import recalculateCalculation from './shared/recalculateCalculation.js'; -import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; +import recalculateCalculation from './shared/recalculateCalculation'; +import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; export default function applyAdjustment(node, actionContext) { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyBranch.js b/app/imports/api/engine/actions/applyPropertyByType/applyBranch.js index 314333eb..9df876d1 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyBranch.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyBranch.js @@ -1,7 +1,7 @@ import applyProperty from '../applyProperty'; -import recalculateCalculation from './shared/recalculateCalculation.js'; -import rollDice from '/imports/parser/rollDice.js'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import recalculateCalculation from './shared/recalculateCalculation'; +import rollDice from '/imports/parser/rollDice'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; export default function applyBranch(node, actionContext) { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js index c609aa9b..6e2cf6bd 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyBuff.js @@ -3,17 +3,17 @@ import { renewDocIds } from '/imports/api/parenting/parentingFunctions'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import computedSchemas from '/imports/api/properties/computedPropertySchemasIndex.js'; -import applyFnToKey from '/imports/api/engine/computation/utility/applyFnToKey.js'; +import computedSchemas from '/imports/api/properties/computedPropertySchemasIndex'; +import applyFnToKey from '/imports/api/engine/computation/utility/applyFnToKey'; import { get } from 'lodash'; -import resolve, { map, toString } from '/imports/parser/resolve.js'; -import symbol from '/imports/parser/parseTree/symbol.js'; -import logErrors from './shared/logErrors.js'; -import { insertCreatureLog } from '/imports/api/creature/log/CreatureLogs.js'; -import cyrb53 from '/imports/api/engine/computation/utility/cyrb53.js'; +import resolve, { map, toString } from '/imports/parser/resolve'; +import symbol from '/imports/parser/parseTree/symbol'; +import logErrors from './shared/logErrors'; +import { insertCreatureLog } from '/imports/api/creature/log/CreatureLogs'; +import cyrb53 from '/imports/api/engine/computation/utility/cyrb53'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX.js'; -import recalculateInlineCalculations from './shared/recalculateInlineCalculations.js'; +import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX'; +import recalculateInlineCalculations from './shared/recalculateInlineCalculations'; export default function applyBuff(node, actionContext) { applyNodeTriggers(node, 'before', actionContext); diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyBuffRemover.js b/app/imports/api/engine/actions/applyPropertyByType/applyBuffRemover.js index ae3ecf4b..9e19e3d3 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyBuffRemover.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyBuffRemover.js @@ -1,11 +1,11 @@ import { findLast, difference, intersection, filter } from 'lodash'; import applyProperty from '../applyProperty'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import { getProperyAncestors, getPropertiesOfType } from '/imports/api/engine/loadCreatures.js'; +import { getProperyAncestors, getPropertiesOfType } from '/imports/api/engine/loadCreatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import { softRemove } from '/imports/api/parenting/softRemove'; -import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; export default function applyBuffRemover(node, actionContext) { // Apply triggers diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js index 5e96ed42..11735f7e 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyDamage.js @@ -1,16 +1,16 @@ import { some, intersection, difference, remove, includes } from 'lodash'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; -import { insertCreatureLog } from '/imports/api/creature/log/CreatureLogs.js'; -import resolve, { Context, toString } from '/imports/parser/resolve.js'; -import logErrors from './shared/logErrors.js'; -import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js'; -import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; +import { insertCreatureLog } from '/imports/api/creature/log/CreatureLogs'; +import resolve, { Context, toString } from '/imports/parser/resolve'; +import logErrors from './shared/logErrors'; +import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode'; +import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty'; import { getPropertiesOfType -} from '/imports/api/engine/loadCreatures.js'; +} from '/imports/api/engine/loadCreatures'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js'; -import applySavingThrow from '/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js'; +import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags'; +import applySavingThrow from '/imports/api/engine/actions/applyPropertyByType/applySavingThrow'; export default function applyDamage(node, actionContext) { applyNodeTriggers(node, 'before', actionContext); diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js b/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js index c97c22dc..19f2c5f2 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyFolder.js @@ -1,4 +1,4 @@ -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; export default function applyFolder(node, actionContext) { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyItemAsAmmo.js b/app/imports/api/engine/actions/applyPropertyByType/applyItemAsAmmo.js index 17d377e7..a63822b8 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyItemAsAmmo.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyItemAsAmmo.js @@ -1,8 +1,8 @@ -import { getPropertyDecendants } from '/imports/api/engine/loadCreatures.js'; +import { getPropertyDecendants } from '/imports/api/engine/loadCreatures'; import applyProperty from '../applyProperty'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; import { docsToForest as nodeArrayToTree } from '/imports/api/parenting/parentingFunctions'; -import { adjustQuantityWork } from '/imports/api/creature/creatureProperties/methods/adjustQuantity.js'; +import { adjustQuantityWork } from '/imports/api/creature/creatureProperties/methods/adjustQuantity'; export default function applyItemAsAmmo(node, actionContext) { // The item node should come without children, since it is not part of the original action tree diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyNote.js b/app/imports/api/engine/actions/applyPropertyByType/applyNote.js index c227e99e..e690e7cb 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyNote.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyNote.js @@ -1,5 +1,5 @@ -import recalculateInlineCalculations from './shared/recalculateInlineCalculations.js'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import recalculateInlineCalculations from './shared/recalculateInlineCalculations'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; export default function applyNote(node, actionContext) { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js index 2d9b9e19..1289f129 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyRoll.js @@ -1,7 +1,7 @@ -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; -import logErrors from './shared/logErrors.js'; -import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js'; -import resolve, { toString } from '/imports/parser/resolve.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; +import logErrors from './shared/logErrors'; +import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode'; +import resolve, { toString } from '/imports/parser/resolve'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; export default function applyRoll(node, actionContext) { diff --git a/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js b/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js index 1df1a1bb..17269482 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applySavingThrow.js @@ -1,10 +1,10 @@ -import rollDice from '/imports/parser/rollDice.js'; -import recalculateCalculation from './shared/recalculateCalculation.js'; +import rollDice from '/imports/parser/rollDice'; +import recalculateCalculation from './shared/recalculateCalculation'; import applyProperty from '../applyProperty'; -import numberToSignedString from '/imports/api/utility/numberToSignedString.js'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import numberToSignedString from '/imports/api/utility/numberToSignedString'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import { applyUnresolvedEffects } from '/imports/api/engine/actions/doCheck.js'; +import { applyUnresolvedEffects } from '/imports/api/engine/actions/doCheck'; export default function applySavingThrow(node, actionContext) { applyNodeTriggers(node, 'before', actionContext); diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyToggle.js b/app/imports/api/engine/actions/applyPropertyByType/applyToggle.js index a07a77ca..41222e0f 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyToggle.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyToggle.js @@ -1,6 +1,6 @@ -import recalculateCalculation from './shared/recalculateCalculation.js'; +import recalculateCalculation from './shared/recalculateCalculation'; import { applyNodeTriggers } from '/imports/api/engine/actions/applyTriggers'; -import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren.js'; +import applyChildren from '/imports/api/engine/actions/applyPropertyByType/shared/applyChildren'; export default function applyToggle(node, actionContext) { applyNodeTriggers(node, 'before', actionContext); diff --git a/app/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js b/app/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js index 6ee0a765..cf0ae47f 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js +++ b/app/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js @@ -1,6 +1,6 @@ -import operator from '/imports/parser/parseTree/operator.js'; -import { parse } from '/imports/parser/parser.js'; -import logErrors from './logErrors.js'; +import operator from '/imports/parser/parseTree/operator'; +import { parse } from '/imports/parser/parser'; +import logErrors from './logErrors'; export default function applyEffectsToCalculationParseNode(calcObj, actionContext) { calcObj.effects?.forEach(effect => { diff --git a/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation.js b/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation.js index 16f2cfe3..5e4e5c6a 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation.js +++ b/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation.js @@ -1,6 +1,6 @@ -import evaluateCalculation from '/imports/api/engine/computation/utility/evaluateCalculation.js'; -import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode.js'; -import logErrors from './logErrors.js'; +import evaluateCalculation from '/imports/api/engine/computation/utility/evaluateCalculation'; +import applyEffectsToCalculationParseNode from '/imports/api/engine/actions/applyPropertyByType/shared/applyEffectsToCalculationParseNode'; +import logErrors from './logErrors'; export default function recalculateCalculation(calc, actionContext, context) { if (!calc?.parseNode) return; diff --git a/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations.js b/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations.js index 1a2b1cb7..128d81c1 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations.js +++ b/app/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations.js @@ -1,7 +1,7 @@ -import embedInlineCalculations from '/imports/api/engine/computation/utility/embedInlineCalculations.js'; -import recalculateCalculation from './recalculateCalculation.js' +import embedInlineCalculations from '/imports/api/engine/computation/utility/embedInlineCalculations'; +import recalculateCalculation from './recalculateCalculation' -export default function recalculateInlineCalculations(inlineCalcObj, actionContext){ +export default function recalculateInlineCalculations(inlineCalcObj, actionContext) { // Skip if there are no calculations if (!inlineCalcObj?.inlineCalculations?.length) return; // Recalculate each calculation with the current scope diff --git a/app/imports/api/engine/actions/applyTriggers.testFn.js b/app/imports/api/engine/actions/applyTriggers.testFn.js index 9bec8b5f..ad484232 100644 --- a/app/imports/api/engine/actions/applyTriggers.testFn.js +++ b/app/imports/api/engine/actions/applyTriggers.testFn.js @@ -1,5 +1,5 @@ import { triggerMatchTags } from '/imports/api/engine/actions/applyTriggers'; -import clean from '/imports/api/engine/computation/utility/cleanProp.testFn.js'; +import clean from '/imports/api/engine/computation/utility/cleanProp.testFn'; import { assert } from 'chai'; export default function () { diff --git a/app/imports/api/engine/actions/applyTriggers.ts b/app/imports/api/engine/actions/applyTriggers.ts index 03c254de..e1de4586 100644 --- a/app/imports/api/engine/actions/applyTriggers.ts +++ b/app/imports/api/engine/actions/applyTriggers.ts @@ -1,10 +1,10 @@ -import recalculateCalculation from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation.js'; -import recalculateInlineCalculations from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations.js'; -import { getPropertyDecendants } from '/imports/api/engine/loadCreatures.js'; +import recalculateCalculation from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateCalculation'; +import recalculateInlineCalculations from '/imports/api/engine/actions/applyPropertyByType/shared/recalculateInlineCalculations'; +import { getPropertyDecendants } from '/imports/api/engine/loadCreatures'; import { TreeNode, docsToForest as nodeArrayToTree } from '/imports/api/parenting/parentingFunctions'; import applyProperty from '/imports/api/engine/actions/applyProperty'; import { difference, intersection } from 'lodash'; -import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js'; +import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags'; export function applyNodeTriggers(node: TreeNode, timing, actionContext) { const prop = node.doc; diff --git a/app/imports/api/engine/actions/doAction.js b/app/imports/api/engine/actions/doAction.js index a25c5310..e714d2c9 100644 --- a/app/imports/api/engine/actions/doAction.js +++ b/app/imports/api/engine/actions/doAction.js @@ -1,12 +1,12 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; import { docsToForest } from '/imports/api/parenting/parentingFunctions'; import { getProperyAncestors, getPropertyDecendants -} from '/imports/api/engine/loadCreatures.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +} from '/imports/api/engine/loadCreatures'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import applyProperty from './applyProperty'; import ActionContext from '/imports/api/engine/actions/ActionContext'; diff --git a/app/imports/api/engine/actions/doAction.test.js b/app/imports/api/engine/actions/doAction.test.js index 9e5b7c37..8b28545c 100644 --- a/app/imports/api/engine/actions/doAction.test.js +++ b/app/imports/api/engine/actions/doAction.test.js @@ -1,10 +1,10 @@ -import '/imports/api/simpleSchemaConfig.js'; -//import testTypes from './testTypes/index.js'; -import applyTriggers from '/imports/api/engine/actions/applyTriggers.testFn.js'; -import { doActionWork } from './doAction.js'; -import { CreatureLogSchema } from '/imports/api/creature/log/CreatureLogs.js'; +import '/imports/api/simpleSchemaConfig'; +//import testTypes from './testTypes/index'; +import applyTriggers from '/imports/api/engine/actions/applyTriggers.testFn'; +import { doActionWork } from './doAction'; +import { CreatureLogSchema } from '/imports/api/creature/log/CreatureLogs'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; function cleanProp(prop) { let schema = CreatureProperties.simpleSchema(prop); diff --git a/app/imports/api/engine/actions/doCastSpell.js b/app/imports/api/engine/actions/doCastSpell.js index 2d2da615..0586114d 100644 --- a/app/imports/api/engine/actions/doCastSpell.js +++ b/app/imports/api/engine/actions/doCastSpell.js @@ -1,14 +1,14 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import { getProperyAncestors, getPropertyDecendants -} from '/imports/api/engine/loadCreatures.js'; +} from '/imports/api/engine/loadCreatures'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; -import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty.js'; -import { doActionWork } from '/imports/api/engine/actions/doAction.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; +import { damagePropertyWork } from '/imports/api/creature/creatureProperties/methods/damageProperty'; +import { doActionWork } from '/imports/api/engine/actions/doAction'; import ActionContext from '/imports/api/engine/actions/ActionContext'; const doAction = new ValidatedMethod({ diff --git a/app/imports/api/engine/actions/doCheck.js b/app/imports/api/engine/actions/doCheck.js index 56c6e2ea..c20a5250 100644 --- a/app/imports/api/engine/actions/doCheck.js +++ b/app/imports/api/engine/actions/doCheck.js @@ -2,12 +2,12 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions.js'; -import rollDice from '/imports/parser/rollDice.js'; -import numberToSignedString from '/imports/api/utility/numberToSignedString.js'; +import { assertEditPermission } from '/imports/api/creature/creatures/creaturePermissions'; +import rollDice from '/imports/parser/rollDice'; +import numberToSignedString from '/imports/api/utility/numberToSignedString'; import { applyTriggers } from '/imports/api/engine/actions/applyTriggers'; import ActionContext from '/imports/api/engine/actions/ActionContext'; -import evaluateCalculation from '/imports/api/engine/computation/utility/evaluateCalculation.js'; +import evaluateCalculation from '/imports/api/engine/computation/utility/evaluateCalculation'; const doCheck = new ValidatedMethod({ name: 'creatureProperties.doCheck', diff --git a/app/imports/api/engine/actions/index.js b/app/imports/api/engine/actions/index.js index 5cd7a8b4..91e94fcf 100644 --- a/app/imports/api/engine/actions/index.js +++ b/app/imports/api/engine/actions/index.js @@ -1,2 +1,2 @@ -import './doCastSpell.js'; -import './doCheck.js'; +import './doCastSpell'; +import './doCheck'; diff --git a/app/imports/api/engine/computation/CreatureComputation.ts b/app/imports/api/engine/computation/CreatureComputation.ts index 75ec51b3..2f252927 100644 --- a/app/imports/api/engine/computation/CreatureComputation.ts +++ b/app/imports/api/engine/computation/CreatureComputation.ts @@ -1,6 +1,6 @@ import { EJSON } from 'meteor/ejson'; import createGraph, { Graph } from 'ngraph.graph'; -import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags.js'; +import getEffectivePropTags from '/imports/api/engine/computation/utility/getEffectivePropTags'; interface CreatureProperty { _id: string; diff --git a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts index a9c1785b..f698d6f0 100644 --- a/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts +++ b/app/imports/api/engine/computation/buildComputation/computeInactiveStatus.ts @@ -1,5 +1,5 @@ import { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; -import walkDown from '/imports/api/engine/computation/utility/walkdown.js'; +import walkDown from '/imports/api/engine/computation/utility/walkdown'; import { TreeNode } from '/imports/api/parenting/parentingFunctions'; import { isSpell } from '/imports/api/properties/Spells'; diff --git a/app/imports/api/engine/computation/buildComputation/computeToggleDependencies.js b/app/imports/api/engine/computation/buildComputation/computeToggleDependencies.js index d6541df8..aca928f7 100644 --- a/app/imports/api/engine/computation/buildComputation/computeToggleDependencies.js +++ b/app/imports/api/engine/computation/buildComputation/computeToggleDependencies.js @@ -1,5 +1,5 @@ -import walkDown from '/imports/api/engine/computation/utility/walkdown.js'; -import { getEffectTagTargets } from '/imports/api/engine/computation/buildComputation/linkTypeDependencies.js'; +import walkDown from '/imports/api/engine/computation/utility/walkdown'; +import { getEffectTagTargets } from '/imports/api/engine/computation/buildComputation/linkTypeDependencies'; export default function computeToggleDependencies(node, dependencyGraph, computation, forest) { const prop = node.doc diff --git a/app/imports/api/engine/computation/buildComputation/linkCalculationDependencies.js b/app/imports/api/engine/computation/buildComputation/linkCalculationDependencies.js index 66c585da..5ee4766a 100644 --- a/app/imports/api/engine/computation/buildComputation/linkCalculationDependencies.js +++ b/app/imports/api/engine/computation/buildComputation/linkCalculationDependencies.js @@ -1,4 +1,4 @@ -import { traverse } from '/imports/parser/resolve.js'; +import { traverse } from '/imports/parser/resolve'; export default function linkCalculationDependencies(dependencyGraph, prop, { propsById }) { prop._computationDetails.calculations.forEach(calcObj => { diff --git a/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js b/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js index 6ef2b165..122a232a 100644 --- a/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js +++ b/app/imports/api/engine/computation/buildComputation/parseCalculationFields.js @@ -1,9 +1,9 @@ -import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX.js'; -import { prettifyParseError, parse } from '/imports/parser/parser.js'; -import applyFnToKey from '/imports/api/engine/computation/utility/applyFnToKey.js'; +import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX'; +import { prettifyParseError, parse } from '/imports/parser/parser'; +import applyFnToKey from '/imports/api/engine/computation/utility/applyFnToKey'; import { get, set, unset } from 'lodash'; -import errorNode from '/imports/parser/parseTree/error.js'; -import cyrb53 from '/imports/api/engine/computation/utility/cyrb53.js'; +import errorNode from '/imports/parser/parseTree/error'; +import cyrb53 from '/imports/api/engine/computation/utility/cyrb53'; export default function parseCalculationFields(prop, schemas) { discoverInlineCalculationFields(prop, schemas); diff --git a/app/imports/api/engine/computation/buildComputation/removeSchemaFields.js b/app/imports/api/engine/computation/buildComputation/removeSchemaFields.js index d87fe3b3..f0813250 100644 --- a/app/imports/api/engine/computation/buildComputation/removeSchemaFields.js +++ b/app/imports/api/engine/computation/buildComputation/removeSchemaFields.js @@ -1,4 +1,4 @@ -import applyFnToKey from '../utility/applyFnToKey.js'; +import applyFnToKey from '../utility/applyFnToKey'; import { unset } from 'lodash'; export default function removeSchemaFields(schemas, prop) { diff --git a/app/imports/api/engine/computation/buildComputation/tests/computeInactiveStatus.testFn.js b/app/imports/api/engine/computation/buildComputation/tests/computeInactiveStatus.testFn.js index 463a072f..ea8bf122 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/computeInactiveStatus.testFn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/computeInactiveStatus.testFn.js @@ -1,6 +1,6 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; export default function () { let computation = buildComputationFromProps(testProperties); diff --git a/app/imports/api/engine/computation/buildComputation/tests/computeSlotQuantityFilled.testFn.js b/app/imports/api/engine/computation/buildComputation/tests/computeSlotQuantityFilled.testFn.js index e72b334a..1de5205d 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/computeSlotQuantityFilled.testFn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/computeSlotQuantityFilled.testFn.js @@ -1,6 +1,6 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; export default function () { const computation = buildComputationFromProps(testProperties); diff --git a/app/imports/api/engine/computation/buildComputation/tests/computeToggleDependencies.testFn.js b/app/imports/api/engine/computation/buildComputation/tests/computeToggleDependencies.testFn.js index 268ea2ef..3ef3f8d3 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/computeToggleDependencies.testFn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/computeToggleDependencies.testFn.js @@ -1,8 +1,8 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); const hasLink = computation.dependencyGraph.hasLink; assert.include( @@ -37,38 +37,38 @@ var testProperties = [ _id: 'enabledToggleId', type: 'toggle', enabled: true, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'disabledToggleId', type: 'toggle', disabled: true, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'conditionToggleId', type: 'toggle', - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), // Children clean({ _id: 'enabledToggleChildId', type: 'folder', - ancestors: [{id: 'charId'}, {id: 'enabledToggleId'}], + ancestors: [{ id: 'charId' }, { id: 'enabledToggleId' }], }), clean({ _id: 'disabledToggleChildId', type: 'folder', - ancestors: [{id: 'charId'}, {id: 'disabledToggleId'}], + ancestors: [{ id: 'charId' }, { id: 'disabledToggleId' }], }), clean({ _id: 'conditionToggleChildId', type: 'folder', - ancestors: [{id: 'charId'}, {id: 'conditionToggleId'}], + ancestors: [{ id: 'charId' }, { id: 'conditionToggleId' }], }), clean({ _id: 'conditionToggleGrandChildId', type: 'folder', - ancestors: [{id: 'charId'}, {id: 'conditionToggleId'}, {id: 'conditionToggleChildId'}], + ancestors: [{ id: 'charId' }, { id: 'conditionToggleId' }, { id: 'conditionToggleChildId' }], }), ]; diff --git a/app/imports/api/engine/computation/buildComputation/tests/linkCalculationDependencies.testFn.js b/app/imports/api/engine/computation/buildComputation/tests/linkCalculationDependencies.testFn.js index 90b74c61..1145d74e 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/linkCalculationDependencies.testFn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/linkCalculationDependencies.testFn.js @@ -1,6 +1,6 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; export default function () { const computation = buildComputationFromProps(testProperties); diff --git a/app/imports/api/engine/computation/buildComputation/tests/linkInventory.testFn.js b/app/imports/api/engine/computation/buildComputation/tests/linkInventory.testFn.js index 023081e3..e412c8fa 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/linkInventory.testFn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/linkInventory.testFn.js @@ -1,6 +1,6 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; import { applyNestedSetProperties } from '/imports/api/parenting/parentingFunctions'; export default function () { diff --git a/app/imports/api/engine/computation/buildComputation/tests/linkTypeDependencies.testfn.js b/app/imports/api/engine/computation/buildComputation/tests/linkTypeDependencies.testfn.js index b8f9d4f1..201a1952 100644 --- a/app/imports/api/engine/computation/buildComputation/tests/linkTypeDependencies.testfn.js +++ b/app/imports/api/engine/computation/buildComputation/tests/linkTypeDependencies.testfn.js @@ -1,8 +1,8 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import clean from '../../utility/cleanProp.testFn.js'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); const getLink = computation.dependencyGraph.hasLink; const getNode = computation.dependencyGraph.getNode; @@ -22,6 +22,6 @@ var testProperties = [ _id: 'strengthId', type: 'attribute', variableName: 'strength', - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), ]; diff --git a/app/imports/api/engine/computation/buildCreatureComputation.js b/app/imports/api/engine/computation/buildCreatureComputation.js index 44d0edf4..2437d24e 100644 --- a/app/imports/api/engine/computation/buildCreatureComputation.js +++ b/app/imports/api/engine/computation/buildCreatureComputation.js @@ -1,19 +1,19 @@ import { docsToForest } from '/imports/api/parenting/parentingFunctions'; import { DenormalisedOnlyCreaturePropertySchema as denormSchema } from '/imports/api/creature/creatureProperties/CreatureProperties'; -import { getProperties, getCreature, getVariables } from '/imports/api/engine/loadCreatures.js'; -import computedOnlySchemas from '/imports/api/properties/computedOnlyPropertySchemasIndex.js'; -import computedSchemas from '/imports/api/properties/computedPropertySchemasIndex.js'; -import linkInventory from './buildComputation/linkInventory.js'; -import walkDown from './utility/walkdown.js'; -import parseCalculationFields from './buildComputation/parseCalculationFields.js'; +import { getProperties, getCreature, getVariables } from '/imports/api/engine/loadCreatures'; +import computedOnlySchemas from '/imports/api/properties/computedOnlyPropertySchemasIndex'; +import computedSchemas from '/imports/api/properties/computedPropertySchemasIndex'; +import linkInventory from './buildComputation/linkInventory'; +import walkDown from './utility/walkdown'; +import parseCalculationFields from './buildComputation/parseCalculationFields'; import computeInactiveStatus from './buildComputation/computeInactiveStatus'; -import computeToggleDependencies from './buildComputation/computeToggleDependencies.js'; -import linkCalculationDependencies from './buildComputation/linkCalculationDependencies.js'; -import linkTypeDependencies from './buildComputation/linkTypeDependencies.js'; -import computeSlotQuantityFilled from './buildComputation/computeSlotQuantityFilled.js'; +import computeToggleDependencies from './buildComputation/computeToggleDependencies'; +import linkCalculationDependencies from './buildComputation/linkCalculationDependencies'; +import linkTypeDependencies from './buildComputation/linkTypeDependencies'; +import computeSlotQuantityFilled from './buildComputation/computeSlotQuantityFilled'; import CreatureComputation from './CreatureComputation'; -import removeSchemaFields from './buildComputation/removeSchemaFields.js'; +import removeSchemaFields from './buildComputation/removeSchemaFields'; /** * Store index of properties diff --git a/app/imports/api/engine/computation/buildCreatureComputation.test.js b/app/imports/api/engine/computation/buildCreatureComputation.test.js index c77f6712..2a1485ef 100644 --- a/app/imports/api/engine/computation/buildCreatureComputation.test.js +++ b/app/imports/api/engine/computation/buildCreatureComputation.test.js @@ -1,13 +1,13 @@ -import '/imports/api/simpleSchemaConfig.js'; -import { buildComputationFromProps } from './buildCreatureComputation.js'; +import '/imports/api/simpleSchemaConfig'; +import { buildComputationFromProps } from './buildCreatureComputation'; import { assert } from 'chai'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import computeInactiveStatus from './buildComputation/tests/computeInactiveStatus.testFn.js'; -import computeSlotQuantityFilled from './buildComputation/tests/computeSlotQuantityFilled.testFn.js'; -import computeToggleDependencies from './buildComputation/tests/computeToggleDependencies.testFn.js'; -import linkCalculationDependencies from './buildComputation/tests/linkCalculationDependencies.testFn.js'; -import linkInventory from './buildComputation/tests/linkInventory.testFn.js'; -import linkTypeDependencies from './buildComputation/tests/linkTypeDependencies.testFn.js'; +import computeInactiveStatus from './buildComputation/tests/computeInactiveStatus.testFn'; +import computeSlotQuantityFilled from './buildComputation/tests/computeSlotQuantityFilled.testFn'; +import computeToggleDependencies from './buildComputation/tests/computeToggleDependencies.testFn'; +import linkCalculationDependencies from './buildComputation/tests/linkCalculationDependencies.testFn'; +import linkInventory from './buildComputation/tests/linkInventory.testFn'; +import linkTypeDependencies from './buildComputation/tests/linkTypeDependencies.testFn'; describe('buildComputation', function () { it('Builds something at all', function () { diff --git a/app/imports/api/engine/computation/computeComputation/computeByType.js b/app/imports/api/engine/computation/computeComputation/computeByType.js index 0f3d5436..97bbca04 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType.js @@ -1,13 +1,13 @@ -import _variable from './computeByType/computeVariable.js'; -import action from './computeByType/computeAction.js'; -import attribute from './computeByType/computeAttribute.js'; -import skill from './computeByType/computeSkill.js'; -import pointBuy from './computeByType/computePointBuy.js'; -import propertySlot from './computeByType/computeSlot.js'; -import container from './computeByType/computeContainer.js'; -import spellList from './computeByType/computeSpellList.js'; -import toggle from './computeByType/computeToggle.js'; -import _calculation from './computeByType/computeCalculation.js'; +import _variable from './computeByType/computeVariable'; +import action from './computeByType/computeAction'; +import attribute from './computeByType/computeAttribute'; +import skill from './computeByType/computeSkill'; +import pointBuy from './computeByType/computePointBuy'; +import propertySlot from './computeByType/computeSlot'; +import container from './computeByType/computeContainer'; +import spellList from './computeByType/computeSpellList'; +import toggle from './computeByType/computeToggle'; +import _calculation from './computeByType/computeCalculation'; export default Object.freeze({ _variable, diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js index d62d006e..a57a4c25 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeCalculation.js @@ -1,5 +1,5 @@ -import evaluateCalculation from '../../utility/evaluateCalculation.js'; -import { getPropertyName } from '/imports/constants/PROPERTIES.js'; +import evaluateCalculation from '../../utility/evaluateCalculation'; +import { getPropertyName } from '/imports/constants/PROPERTIES'; export default function computeCalculation(computation, node) { const calcObj = node.data; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeContainer.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeContainer.js index 0258692f..c77611cf 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeContainer.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeContainer.js @@ -1,5 +1,5 @@ -import aggregate from './computeVariable/aggregate/index.js'; -import { safeStrip } from '/imports/api/engine/computation/utility/stripFloatingPointOddities.js'; +import aggregate from './computeVariable/aggregate/index'; +import { safeStrip } from '/imports/api/engine/computation/utility/stripFloatingPointOddities'; export default function computeContainer(computation, node) { if (!node.data) node.data = {}; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computePointBuy.js b/app/imports/api/engine/computation/computeComputation/computeByType/computePointBuy.js index a7727247..5e22f138 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computePointBuy.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computePointBuy.js @@ -1,5 +1,5 @@ import { has } from 'lodash'; -import evaluateCalculation from '../../utility/evaluateCalculation.js'; +import evaluateCalculation from '../../utility/evaluateCalculation'; export default function computePointBuy(computation, node) { const prop = node.data; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable.js index 5ef7d0be..abcec34f 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable.js @@ -1,11 +1,11 @@ -import aggregate from './computeVariable/aggregate/index.js'; -import computeVariableAsAttribute from './computeVariable/computeVariableAsAttribute.js'; -import computeVariableAsSkill from './computeVariable/computeVariableAsSkill.js'; -import computeVariableAsConstant from './computeVariable/computeVariableAsConstant.js'; -import computeVariableAsClass from './computeVariable/computeVariableAsClass.js'; -import computeVariableAsToggle from './computeVariable/computeVariableAsToggle.js'; -import computeImplicitVariable from './computeVariable/computeImplicitVariable.js'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; +import aggregate from './computeVariable/aggregate/index'; +import computeVariableAsAttribute from './computeVariable/computeVariableAsAttribute'; +import computeVariableAsSkill from './computeVariable/computeVariableAsSkill'; +import computeVariableAsConstant from './computeVariable/computeVariableAsConstant'; +import computeVariableAsClass from './computeVariable/computeVariableAsClass'; +import computeVariableAsToggle from './computeVariable/computeVariableAsToggle'; +import computeImplicitVariable from './computeVariable/computeImplicitVariable'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; export default function computeVariable(computation, node) { const scope = computation.scope; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/aggregate/index.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/aggregate/index.js index 3a617494..c0e32be6 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/aggregate/index.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/aggregate/index.js @@ -1,10 +1,10 @@ -import definition from './aggregateDefinition.js'; -import damageMultiplier from './aggregateDamageMultiplier.js'; -import effect from './aggregateEffect.js'; -import eventDefinition from './aggregateEventDefinition.js'; -import proficiency from './aggregateProficiency.js'; -import classLevel from './aggregateClassLevel.js'; -import inventory from './aggregateInventory.js'; +import definition from './aggregateDefinition'; +import damageMultiplier from './aggregateDamageMultiplier'; +import effect from './aggregateEffect'; +import eventDefinition from './aggregateEventDefinition'; +import proficiency from './aggregateProficiency'; +import classLevel from './aggregateClassLevel'; +import inventory from './aggregateInventory'; export default Object.freeze({ classLevel, diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeImplicitVariable.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeImplicitVariable.js index 13dcc7f2..bc757c85 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeImplicitVariable.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeImplicitVariable.js @@ -1,61 +1,61 @@ -import getAggregatorResult from './getAggregatorResult.js'; +import getAggregatorResult from './getAggregatorResult'; /* * Variables with effects, proficiencies, or damage multipliers but no defining * properties are added to the scope as implicit variables */ - export default function computeImplicitVariable(node){ - const prop = {}; +export default function computeImplicitVariable(node) { + const prop = {}; // Combine damage multipliers - if (node.data.immunity){ + if (node.data.immunity) { prop.immunity = node.data.immunity; prop.immunities = node.data.immunities; } - if (node.data.resistance){ + if (node.data.resistance) { prop.resistance = node.data.resistance; prop.resistances = node.data.resistances; } - if (node.data.vulnerability){ + if (node.data.vulnerability) { prop.vulnerability = node.data.vulnerability; prop.vulnerabilities = node.data.vulnerabilities; } - const result = getAggregatorResult(node); - if (result !== undefined){ - prop.value = result; - } - if (node.data.proficiency !== undefined){ - prop.proficiency = node.data.proficiency; - } + const result = getAggregatorResult(node); + if (result !== undefined) { + prop.value = result; + } + if (node.data.proficiency !== undefined) { + prop.proficiency = node.data.proficiency; + } - // denormalise class level aggregator - let classLevelAgg = node.data.classLevelAggregator; - if (classLevelAgg){ - prop.level = classLevelAgg.level; - } + // denormalise class level aggregator + let classLevelAgg = node.data.classLevelAggregator; + if (classLevelAgg) { + prop.level = classLevelAgg.level; + } - // denormalise the effect aggregator fields - const aggregator = node.data.effectAggregator; - if (aggregator){ - if (aggregator.advantage && !aggregator.disadvantage){ - prop.advantage = 1; - } else if (aggregator.disadvantage && !aggregator.advantage){ - prop.advantage = -1; - } else { - prop.advantage = 0; - } - // Passive bonus - prop.passiveBonus = aggregator.passiveAdd; - // conditional benefits - prop.conditionalBenefits = aggregator.conditional; - // Roll bonuses - prop.rollBonus = aggregator.rollBonus; - // Forced to fail - prop.fail = aggregator.fail; - // Rollbonus - prop.rollBonuses = aggregator.rollBonus; - } + // denormalise the effect aggregator fields + const aggregator = node.data.effectAggregator; + if (aggregator) { + if (aggregator.advantage && !aggregator.disadvantage) { + prop.advantage = 1; + } else if (aggregator.disadvantage && !aggregator.advantage) { + prop.advantage = -1; + } else { + prop.advantage = 0; + } + // Passive bonus + prop.passiveBonus = aggregator.passiveAdd; + // conditional benefits + prop.conditionalBenefits = aggregator.conditional; + // Roll bonuses + prop.rollBonus = aggregator.rollBonus; + // Forced to fail + prop.fail = aggregator.fail; + // Rollbonus + prop.rollBonuses = aggregator.rollBonus; + } - return prop; - } + return prop; +} diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsAttribute.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsAttribute.js index 395619a9..73cd7112 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsAttribute.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsAttribute.js @@ -1,4 +1,4 @@ -import getAggregatorResult from './getAggregatorResult.js'; +import getAggregatorResult from './getAggregatorResult'; export default function computeVariableAsAttribute(computation, node, prop) { let result = getAggregatorResult(node) || 0; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsConstant.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsConstant.js index 898d2c5e..a441160e 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsConstant.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsConstant.js @@ -1,6 +1,6 @@ -import { parse } from '/imports/parser/parser.js'; +import { parse } from '/imports/parser/parser'; -export default function computeVariableAsConstant(computation, node, prop){ +export default function computeVariableAsConstant(computation, node, prop) { let string = prop.calculation; if (!string) return; let parseNode; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsSkill.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsSkill.js index 336a5ab7..5dd84740 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsSkill.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsSkill.js @@ -1,4 +1,4 @@ -import aggregate from './aggregate/index.js'; +import aggregate from './aggregate/index'; export default function computeVariableAsSkill(computation, node, prop) { // Skills are based on some ability Modifier diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsToggle.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsToggle.js index 0c3c41a9..f546426a 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsToggle.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/computeVariableAsToggle.js @@ -1,6 +1,6 @@ -import getAggregatorResult from './getAggregatorResult.js'; +import getAggregatorResult from './getAggregatorResult'; -export default function computeVariableAsToggle(computation, node, prop){ +export default function computeVariableAsToggle(computation, node, prop) { let result = getAggregatorResult(node, prop) || 0; prop.value = !!result || !!prop.enabled || !!prop.condition?.value; diff --git a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/getAggregatorResult.js b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/getAggregatorResult.js index 3a9f7316..5d3519ce 100644 --- a/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/getAggregatorResult.js +++ b/app/imports/api/engine/computation/computeComputation/computeByType/computeVariable/getAggregatorResult.js @@ -1,6 +1,6 @@ -import stripFloatingPointOddities from '/imports/api/engine/computation/utility/stripFloatingPointOddities.js'; +import stripFloatingPointOddities from '/imports/api/engine/computation/utility/stripFloatingPointOddities'; -export default function getAggregatorResult(node){ +export default function getAggregatorResult(node) { // Work out the base value as the greater of the deining stat value // This baseValue comes from aggregating definitions let statBase = node.data.baseValue; @@ -12,9 +12,9 @@ export default function getAggregatorResult(node){ if (!aggregator) return statBase; let base; - if (!Number.isFinite(aggregator.base)){ + if (!Number.isFinite(aggregator.base)) { base = statBase || 0; - } else if (!Number.isFinite(statBase)){ + } else if (!Number.isFinite(statBase)) { base = aggregator.base || 0; } else { base = Math.max(aggregator.base, statBase); @@ -29,9 +29,9 @@ export default function getAggregatorResult(node){ if (aggregator.set !== undefined) { result = aggregator.set; } - if (!node.data.definingProp?.decimal && Number.isFinite(result)){ + if (!node.data.definingProp?.decimal && Number.isFinite(result)) { result = Math.floor(result); - } else if (Number.isFinite(result)){ + } else if (Number.isFinite(result)) { result = stripFloatingPointOddities(result); } diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeAction.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeAction.testFn.js index b2b97f64..a915d5cd 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeAction.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeAction.testFn.js @@ -1,7 +1,7 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; export default function () { const computation = buildComputationFromProps(testProperties); diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeAttribute.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeAttribute.testFn.js index 31f72d1b..51d717de 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeAttribute.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeAttribute.testFn.js @@ -1,7 +1,7 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; export default function () { const computation = buildComputationFromProps(testProperties); diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeClasses.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeClasses.testFn.js index 2c6bdc8f..102b493c 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeClasses.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeClasses.testFn.js @@ -1,9 +1,9 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); computeCreatureComputation(computation); const scope = id => computation.scope[id]; @@ -20,41 +20,41 @@ var testProperties = [ type: 'class', variableName: 'wizard', classType: 'startingClass', - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'rangerId', type: 'class', variableName: 'ranger', classType: 'multiClass', - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'wiz1Id', type: 'classLevel', variableName: 'wizard', level: 1, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'wiz2Id', type: 'classLevel', variableName: 'wizard', level: 2, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'wiz4Id', type: 'classLevel', variableName: 'wizard', level: 4, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), clean({ _id: 'rang1Id', type: 'classLevel', variableName: 'ranger', level: 1, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), ]; diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeConstants.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeConstants.testFn.js index 94fd414e..f4debd1a 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeConstants.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeConstants.testFn.js @@ -1,9 +1,9 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); computeCreatureComputation(computation); const prop = id => computation.propsById[id]; @@ -23,6 +23,6 @@ var testProperties = [ baseValue: { calculation: 'arrayConstant[3]', }, - ancestors: [{id: 'charId'}], + ancestors: [{ id: 'charId' }], }), ]; diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeDamageMultipliers.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeDamageMultipliers.testFn.js index ee777627..ed71ad98 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeDamageMultipliers.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeDamageMultipliers.testFn.js @@ -1,9 +1,9 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); computeCreatureComputation(computation); const scope = id => computation.scope[id]; diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeEffects.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeEffects.testFn.js index 8650a9e2..81bb9a3d 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeEffects.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeEffects.testFn.js @@ -1,9 +1,9 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); computeCreatureComputation(computation); const prop = id => computation.propsById[id]; diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeInventory.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeInventory.testFn.js index 15d2a516..e1893fe5 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeInventory.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeInventory.testFn.js @@ -1,7 +1,7 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; import { applyNestedSetProperties, compareOrder } from '/imports/api/parenting/parentingFunctions'; export default function () { diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeProficiencies.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeProficiencies.testFn.js index 5b133d81..c15831b1 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeProficiencies.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeProficiencies.testFn.js @@ -1,7 +1,7 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; import { applyNestedSetProperties, compareOrder } from '/imports/api/parenting/parentingFunctions'; export default function () { diff --git a/app/imports/api/engine/computation/computeComputation/tests/computeSkills.testFn.js b/app/imports/api/engine/computation/computeComputation/tests/computeSkills.testFn.js index 2557296a..a8d3e325 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/computeSkills.testFn.js +++ b/app/imports/api/engine/computation/computeComputation/tests/computeSkills.testFn.js @@ -1,9 +1,9 @@ -import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation.js'; +import { buildComputationFromProps } from '/imports/api/engine/computation/buildCreatureComputation'; import { assert } from 'chai'; -import computeCreatureComputation from '../../computeCreatureComputation.js'; -import clean from '../../utility/cleanProp.testFn.js'; +import computeCreatureComputation from '../../computeCreatureComputation'; +import clean from '../../utility/cleanProp.testFn'; -export default function(){ +export default function () { const computation = buildComputationFromProps(testProperties); computeCreatureComputation(computation); const prop = id => computation.propsById[id]; diff --git a/app/imports/api/engine/computation/computeComputation/tests/index.js b/app/imports/api/engine/computation/computeComputation/tests/index.js index 768fee2d..10fc964c 100644 --- a/app/imports/api/engine/computation/computeComputation/tests/index.js +++ b/app/imports/api/engine/computation/computeComputation/tests/index.js @@ -1,12 +1,12 @@ -import computeAction from './computeAction.testFn.js'; -import computeAttribute from './computeAttribute.testFn.js'; -import computeClasses from './computeClasses.testFn.js'; -import computeConstants from './computeConstants.testFn.js'; -import computeInventory from './computeInventory.testFn.js'; -import computeDamageMultipliers from './computeDamageMultipliers.testFn.js'; -import computeEffects from './computeEffects.testFn.js'; -import computeSkills from './computeSkills.testFn.js'; -import computeProficiencies from './computeProficiencies.testFn.js'; +import computeAction from './computeAction.testFn'; +import computeAttribute from './computeAttribute.testFn'; +import computeClasses from './computeClasses.testFn'; +import computeConstants from './computeConstants.testFn'; +import computeInventory from './computeInventory.testFn'; +import computeDamageMultipliers from './computeDamageMultipliers.testFn'; +import computeEffects from './computeEffects.testFn'; +import computeSkills from './computeSkills.testFn'; +import computeProficiencies from './computeProficiencies.testFn'; export default [{ text: 'Computes actions', diff --git a/app/imports/api/engine/computation/computeCreatureComputation.js b/app/imports/api/engine/computation/computeCreatureComputation.js index 1ffe58be..15369790 100644 --- a/app/imports/api/engine/computation/computeCreatureComputation.js +++ b/app/imports/api/engine/computation/computeCreatureComputation.js @@ -1,7 +1,7 @@ -import computeToggles from '/imports/api/engine/computation/computeComputation/computeToggles.js'; -import computeByType from '/imports/api/engine/computation/computeComputation/computeByType.js'; -import embedInlineCalculations from './utility/embedInlineCalculations.js'; -import { removeEmptyCalculations } from './buildComputation/parseCalculationFields.js'; +import computeToggles from '/imports/api/engine/computation/computeComputation/computeToggles'; +import computeByType from '/imports/api/engine/computation/computeComputation/computeByType'; +import embedInlineCalculations from './utility/embedInlineCalculations'; +import { removeEmptyCalculations } from './buildComputation/parseCalculationFields'; import path from 'ngraph.path'; export default function computeCreatureComputation(computation) { diff --git a/app/imports/api/engine/computation/computeCreatureComputation.test.js b/app/imports/api/engine/computation/computeCreatureComputation.test.js index 09876a75..45018d3f 100644 --- a/app/imports/api/engine/computation/computeCreatureComputation.test.js +++ b/app/imports/api/engine/computation/computeCreatureComputation.test.js @@ -1,8 +1,8 @@ -import computeCreatureComputation from './computeCreatureComputation.js'; -import { buildComputationFromProps } from './buildCreatureComputation.js'; +import computeCreatureComputation from './computeCreatureComputation'; +import { buildComputationFromProps } from './buildCreatureComputation'; import { assert } from 'chai'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import computeTests from './computeComputation/tests/index.js'; +import computeTests from './computeComputation/tests/index'; describe('Compute compuation', function () { it('Computes something at all', function () { diff --git a/app/imports/api/engine/computation/utility/applyFnToKey.test.js b/app/imports/api/engine/computation/utility/applyFnToKey.test.js index 5e1b3a3c..4c6680cb 100644 --- a/app/imports/api/engine/computation/utility/applyFnToKey.test.js +++ b/app/imports/api/engine/computation/utility/applyFnToKey.test.js @@ -1,9 +1,9 @@ -import applyFnToKey from './applyFnToKey.js'; +import applyFnToKey from './applyFnToKey'; import { assert } from 'chai'; import { get } from 'lodash'; -describe('apply function to key', function(){ - it('uses a basic key correctly', function(){ +describe('apply function to key', function () { + it('uses a basic key correctly', function () { let obj = getStartingObject(); applyFnToKey(obj, 'fox.name', (doc, key) => { assert.equal(obj, doc); @@ -11,7 +11,7 @@ describe('apply function to key', function(){ assert.equal(get(doc, key), 'foxy'); }); }); - it('uses a single nested key correctly', function(){ + it('uses a single nested key correctly', function () { let obj = getStartingObject(); let foxSounds = []; applyFnToKey(obj, 'fox.sound.$', (doc, key) => { @@ -21,7 +21,7 @@ describe('apply function to key', function(){ assert.include(foxSounds, 'tjoef'); assert.include(foxSounds, 'kek'); }); - it('uses a double nested key correctly', function(){ + it('uses a double nested key correctly', function () { let obj = getStartingObject(); let birdSounds = []; applyFnToKey(obj, 'birds.$.sound.$', (doc, key) => { @@ -33,7 +33,7 @@ describe('apply function to key', function(){ }); }); -function getStartingObject(){ +function getStartingObject() { return { fox: { name: 'foxy', @@ -48,7 +48,7 @@ function getStartingObject(){ sound: [ 'koer', ] - },{ + }, { name: 'parrot', sound: [ 'hello', diff --git a/app/imports/api/engine/computation/utility/embedInlineCalculations.js b/app/imports/api/engine/computation/utility/embedInlineCalculations.js index 096cf921..6cdfc63b 100644 --- a/app/imports/api/engine/computation/utility/embedInlineCalculations.js +++ b/app/imports/api/engine/computation/utility/embedInlineCalculations.js @@ -1,6 +1,6 @@ -import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX.js'; +import INLINE_CALCULATION_REGEX from '/imports/constants/INLINE_CALCULTION_REGEX'; -export default function embedInlineCalculations(inlineCalcObj){ +export default function embedInlineCalculations(inlineCalcObj) { const string = inlineCalcObj.text; const calculations = inlineCalcObj.inlineCalculations; if (!string || !calculations) return; diff --git a/app/imports/api/engine/computation/utility/evaluateCalculation.js b/app/imports/api/engine/computation/utility/evaluateCalculation.js index 6d5f1f82..71fd1e62 100644 --- a/app/imports/api/engine/computation/utility/evaluateCalculation.js +++ b/app/imports/api/engine/computation/utility/evaluateCalculation.js @@ -1,4 +1,4 @@ -import resolve, { toString } from '/imports/parser/resolve.js'; +import resolve, { toString } from '/imports/parser/resolve'; export default function evaluateCalculation(calculation, scope, givenContext) { const parseNode = calculation.parseNode; diff --git a/app/imports/api/engine/computation/writeComputation/writeAlteredProperties.js b/app/imports/api/engine/computation/writeComputation/writeAlteredProperties.js index 4a4dadea..21a7b9fd 100644 --- a/app/imports/api/engine/computation/writeComputation/writeAlteredProperties.js +++ b/app/imports/api/engine/computation/writeComputation/writeAlteredProperties.js @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor' import { EJSON } from 'meteor/ejson'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; -import propertySchemasIndex from '/imports/api/properties/computedOnlyPropertySchemasIndex.js'; +import propertySchemasIndex from '/imports/api/properties/computedOnlyPropertySchemasIndex'; export default function writeAlteredProperties(computation) { let bulkWriteOperations = []; diff --git a/app/imports/api/engine/computation/writeComputation/writeErrors.js b/app/imports/api/engine/computation/writeComputation/writeErrors.js index 66002515..f3088fcb 100644 --- a/app/imports/api/engine/computation/writeComputation/writeErrors.js +++ b/app/imports/api/engine/computation/writeComputation/writeErrors.js @@ -1,9 +1,9 @@ -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; -export default function(creatureId, errors = []){ - if (errors.length){ - Creatures.update(creatureId, {$set: {computeErrors: errors}}); +export default function (creatureId, errors = []) { + if (errors.length) { + Creatures.update(creatureId, { $set: { computeErrors: errors } }); } else { - Creatures.update(creatureId, {$unset: {computeErrors: 1}}); + Creatures.update(creatureId, { $unset: { computeErrors: 1 } }); } } diff --git a/app/imports/api/engine/computation/writeComputation/writeScope.js b/app/imports/api/engine/computation/writeComputation/writeScope.js index 793e1dbe..90a43e99 100644 --- a/app/imports/api/engine/computation/writeComputation/writeScope.js +++ b/app/imports/api/engine/computation/writeComputation/writeScope.js @@ -1,5 +1,5 @@ -import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import { EJSON } from 'meteor/ejson'; export default function writeScope(creatureId, computation) { diff --git a/app/imports/api/engine/computeCreature.js b/app/imports/api/engine/computeCreature.js index b6dba147..ca3e7cc3 100644 --- a/app/imports/api/engine/computeCreature.js +++ b/app/imports/api/engine/computeCreature.js @@ -1,8 +1,8 @@ -import buildCreatureComputation from './computation/buildCreatureComputation.js'; -import computeCreatureComputation from './computation/computeCreatureComputation.js'; -import writeAlteredProperties from './computation/writeComputation/writeAlteredProperties.js'; -import writeScope from './computation/writeComputation/writeScope.js'; -import writeErrors from './computation/writeComputation/writeErrors.js'; +import buildCreatureComputation from './computation/buildCreatureComputation'; +import computeCreatureComputation from './computation/computeCreatureComputation'; +import writeAlteredProperties from './computation/writeComputation/writeAlteredProperties'; +import writeScope from './computation/writeComputation/writeScope'; +import writeErrors from './computation/writeComputation/writeErrors'; export default function computeCreature(creatureId) { if (Meteor.isClient) return; diff --git a/app/imports/api/engine/loadCreatures.js b/app/imports/api/engine/loadCreatures.js index d831e26b..6394d43f 100644 --- a/app/imports/api/engine/loadCreatures.js +++ b/app/imports/api/engine/loadCreatures.js @@ -1,5 +1,5 @@ import { debounce } from 'lodash'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import CreatureVariables from '/imports/api/creature/creatures/CreatureVariables'; import CreatureProperties from '/imports/api/creature/creatureProperties/CreatureProperties'; import computeCreature from './computeCreature'; diff --git a/app/imports/api/files/UserImages.js b/app/imports/api/files/UserImages.js index 057c48a0..51cf9030 100644 --- a/app/imports/api/files/UserImages.js +++ b/app/imports/api/files/UserImages.js @@ -1,8 +1,8 @@ let createS3FilesCollection; if (Meteor.isServer) { - createS3FilesCollection = require('/imports/api/files/server/s3FileStorage.js').createS3FilesCollection + createS3FilesCollection = require('/imports/api/files/server/s3FileStorage').createS3FilesCollection } else { - createS3FilesCollection = require('/imports/api/files/client/s3FileStorage.js').createS3FilesCollection + createS3FilesCollection = require('/imports/api/files/client/s3FileStorage').createS3FilesCollection } const UserImages = createS3FilesCollection({ diff --git a/app/imports/api/getModifierFields.js b/app/imports/api/getModifierFields.js index f26e42af..57548ede 100644 --- a/app/imports/api/getModifierFields.js +++ b/app/imports/api/getModifierFields.js @@ -1,8 +1,8 @@ -import MONGO_OPERATORS from '/imports/constants/MONGO_OPERATORS.js'; +import MONGO_OPERATORS from '/imports/constants/MONGO_OPERATORS'; -const hasAny = function(values){ - for (let value of values){ - if (this.has(value)){ +const hasAny = function (values) { + for (let value of values) { + if (this.has(value)) { return true; } } @@ -11,11 +11,11 @@ const hasAny = function(values){ // Returns a Set of fields the modifier changes // The set has been extended with the "hasAny" function -export default function getModifierFields (modifier) { +export default function getModifierFields(modifier) { let fields = new Set(); - for (let operator of MONGO_OPERATORS){ - if (modifier[operator]) for (let field in modifier[operator]){ + for (let operator of MONGO_OPERATORS) { + if (modifier[operator]) for (let field in modifier[operator]) { const indexOfDot = field.indexOf('.'); if (indexOfDot !== -1) { field = field.substring(0, indexOfDot); diff --git a/app/imports/api/icons/Icons.js b/app/imports/api/icons/Icons.js index 072d2467..eb2f8fe1 100644 --- a/app/imports/api/icons/Icons.js +++ b/app/imports/api/icons/Icons.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertAdmin } from '/imports/api/sharing/sharingPermissions.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import { assertAdmin } from '/imports/api/sharing/sharingPermissions'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let Icons = new Mongo.Collection('icons'); diff --git a/app/imports/api/library/Libraries.js b/app/imports/api/library/Libraries.js index 1cbb723e..25cf4ae9 100644 --- a/app/imports/api/library/Libraries.js +++ b/app/imports/api/library/Libraries.js @@ -1,12 +1,12 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; -import SharingSchema from '/imports/api/sharing/SharingSchema.js'; -import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js'; -import { assertEditPermission, assertOwnership } from '/imports/api/sharing/sharingPermissions.js'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; -import { getUserTier } from '/imports/api/users/patreon/tiers.js' -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import SharingSchema from '/imports/api/sharing/SharingSchema'; +import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin'; +import { assertEditPermission, assertOwnership } from '/imports/api/sharing/sharingPermissions'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; +import { getUserTier } from '/imports/api/users/patreon/tiers' +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; /** * Libraries are trees of library nodes where each node represents a character diff --git a/app/imports/api/library/LibraryCollections.js b/app/imports/api/library/LibraryCollections.js index aff9fe20..b09912db 100644 --- a/app/imports/api/library/LibraryCollections.js +++ b/app/imports/api/library/LibraryCollections.js @@ -1,11 +1,11 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; -import SharingSchema from '/imports/api/sharing/SharingSchema.js'; -import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin.js'; -import { assertEditPermission, assertOwnership } from '/imports/api/sharing/sharingPermissions.js'; -import { getUserTier } from '/imports/api/users/patreon/tiers.js' -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import SharingSchema from '/imports/api/sharing/SharingSchema'; +import simpleSchemaMixin from '/imports/api/creature/mixins/simpleSchemaMixin'; +import { assertEditPermission, assertOwnership } from '/imports/api/sharing/sharingPermissions'; +import { getUserTier } from '/imports/api/users/patreon/tiers' +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; /** * LibraryCollections are groups of libraries that are subscribed together at once diff --git a/app/imports/api/library/LibraryNodes.js b/app/imports/api/library/LibraryNodes.js index 9cdcfb56..0ef34863 100644 --- a/app/imports/api/library/LibraryNodes.js +++ b/app/imports/api/library/LibraryNodes.js @@ -3,17 +3,17 @@ import { Mongo } from 'meteor/mongo'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import SimpleSchema from 'simpl-schema'; -import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema.js'; +import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema'; import ChildSchema, { RefSchema } from '/imports/api/parenting/ChildSchema'; -import propertySchemasIndex from '/imports/api/properties/propertySchemasIndex.js'; -import Libraries from '/imports/api/library/Libraries.js'; -import { assertEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import propertySchemasIndex from '/imports/api/properties/propertySchemasIndex'; +import Libraries from '/imports/api/library/Libraries'; +import { assertEditPermission } from '/imports/api/sharing/sharingPermissions'; import { softRemove } from '/imports/api/parenting/softRemove'; -import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema.js'; -import { storedIconsSchema } from '/imports/api/icons/Icons.js'; -import '/imports/api/library/methods/index.js'; -import { updateReferenceNodeWork } from '/imports/api/library/methods/updateReferenceNode.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import SoftRemovableSchema from '/imports/api/parenting/SoftRemovableSchema'; +import { storedIconsSchema } from '/imports/api/icons/Icons'; +import '/imports/api/library/methods/index'; +import { updateReferenceNodeWork } from '/imports/api/library/methods/updateReferenceNode'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; import { restore } from '/imports/api/parenting/softRemove'; import { getAncestry } from '/imports/api/parenting/parentingFunctions'; import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; diff --git a/app/imports/api/library/getCreatureLibraryIds.js b/app/imports/api/library/getCreatureLibraryIds.js index a951a042..14b6c5e7 100644 --- a/app/imports/api/library/getCreatureLibraryIds.js +++ b/app/imports/api/library/getCreatureLibraryIds.js @@ -1,5 +1,5 @@ -import LibraryCollections from '/imports/api/library/LibraryCollections.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import LibraryCollections from '/imports/api/library/LibraryCollections'; +import Creatures from '/imports/api/creature/creatures/Creatures'; import getUserLibraryIds from './getUserLibraryIds'; import { intersection, union } from 'lodash'; diff --git a/app/imports/api/library/getUserLibraryIds.js b/app/imports/api/library/getUserLibraryIds.js index 55f7498d..ed347b2e 100644 --- a/app/imports/api/library/getUserLibraryIds.js +++ b/app/imports/api/library/getUserLibraryIds.js @@ -1,5 +1,5 @@ -import LibraryCollections from '/imports/api/library/LibraryCollections.js'; -import Libraries from '/imports/api/library/Libraries.js'; +import LibraryCollections from '/imports/api/library/LibraryCollections'; +import Libraries from '/imports/api/library/Libraries'; import { union } from 'lodash'; export default function getUserLibraryIds(userId) { diff --git a/app/imports/api/library/methods/copyLibraryNodeTo.js b/app/imports/api/library/methods/copyLibraryNodeTo.js index cda54150..6d672064 100644 --- a/app/imports/api/library/methods/copyLibraryNodeTo.js +++ b/app/imports/api/library/methods/copyLibraryNodeTo.js @@ -2,11 +2,11 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import SimpleSchema from 'simpl-schema'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; import { assertDocCopyPermission, assertDocEditPermission -} from '/imports/api/sharing/sharingPermissions.js'; +} from '/imports/api/sharing/sharingPermissions'; import { setLineageOfDocs, renewDocIds @@ -17,7 +17,7 @@ import { fetchDocByRef } from '/imports/api/parenting/parentingFunctions'; var snackbar; if (Meteor.isClient) { snackbar = require( - '/imports/client/ui/components/snackbars/SnackbarQueue.js' + '/imports/client/ui/components/snackbars/SnackbarQueue' ).snackbar } diff --git a/app/imports/api/library/methods/duplicateLibraryNode.js b/app/imports/api/library/methods/duplicateLibraryNode.js index 88a6e42b..7e026ac1 100644 --- a/app/imports/api/library/methods/duplicateLibraryNode.js +++ b/app/imports/api/library/methods/duplicateLibraryNode.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import SimpleSchema from 'simpl-schema'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; -import { assertDocEditPermission } from '/imports/api/sharing/sharingPermissions.js'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; +import { assertDocEditPermission } from '/imports/api/sharing/sharingPermissions'; import { setLineageOfDocs, renewDocIds @@ -12,7 +12,7 @@ import { rebuildNestedSets } from '/imports/api/parenting/parentingFunctions'; var snackbar; if (Meteor.isClient) { snackbar = require( - '/imports/client/ui/components/snackbars/SnackbarQueue.js' + '/imports/client/ui/components/snackbars/SnackbarQueue' ).snackbar } diff --git a/app/imports/api/library/methods/index.js b/app/imports/api/library/methods/index.js index e67eec8a..ebc207ae 100644 --- a/app/imports/api/library/methods/index.js +++ b/app/imports/api/library/methods/index.js @@ -1,3 +1,3 @@ -import '/imports/api/library/methods/copyLibraryNodeTo.js'; -import '/imports/api/library/methods/duplicateLibraryNode.js'; -import '/imports/api/library/methods/updateReferenceNode.js'; +import '/imports/api/library/methods/copyLibraryNodeTo'; +import '/imports/api/library/methods/duplicateLibraryNode'; +import '/imports/api/library/methods/updateReferenceNode'; diff --git a/app/imports/api/library/methods/updateReferenceNode.js b/app/imports/api/library/methods/updateReferenceNode.js index 440ff59e..d796a5af 100644 --- a/app/imports/api/library/methods/updateReferenceNode.js +++ b/app/imports/api/library/methods/updateReferenceNode.js @@ -1,11 +1,11 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import SimpleSchema from 'simpl-schema'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import LibraryNodes from '/imports/api/library/LibraryNodes.js'; +import LibraryNodes from '/imports/api/library/LibraryNodes'; import { assertDocEditPermission, assertViewPermission, -} from '/imports/api/sharing/sharingPermissions.js'; +} from '/imports/api/sharing/sharingPermissions'; import { fetchDocByRef } from '/imports/api/parenting/parentingFunctions'; const updateReferenceNode = new ValidatedMethod({ diff --git a/app/imports/api/parenting/ChildSchema.ts b/app/imports/api/parenting/ChildSchema.ts index dd5ffb4d..4c293f8a 100644 --- a/app/imports/api/parenting/ChildSchema.ts +++ b/app/imports/api/parenting/ChildSchema.ts @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const RefSchema = new SimpleSchema({ id: { diff --git a/app/imports/api/parenting/organizeMethods.ts b/app/imports/api/parenting/organizeMethods.ts index e51bb108..48724985 100644 --- a/app/imports/api/parenting/organizeMethods.ts +++ b/app/imports/api/parenting/organizeMethods.ts @@ -4,8 +4,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; import { changeParent, fetchDocByRef, getCollectionByName } from '/imports/api/parenting/parentingFunctions'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; -import { assertDocEditPermission } from '/imports/api/sharing/sharingPermissions.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import { assertDocEditPermission } from '/imports/api/sharing/sharingPermissions'; +import Creatures from '/imports/api/creature/creatures/Creatures'; const organizeDoc = new ValidatedMethod({ name: 'organize.organizeDoc', diff --git a/app/imports/api/parenting/parentingFunctions.test.ts b/app/imports/api/parenting/parentingFunctions.test.ts index 40cc0e3b..f9900200 100644 --- a/app/imports/api/parenting/parentingFunctions.test.ts +++ b/app/imports/api/parenting/parentingFunctions.test.ts @@ -184,7 +184,3 @@ describe('Document tree filters can fetch other documents based on their positio assert.sameMembers(parentIds['dbm'], ['Databases']); }); }); - - - - diff --git a/app/imports/api/properties/Actions.ts b/app/imports/api/properties/Actions.ts index 9b22f221..0f7c6510 100644 --- a/app/imports/api/properties/Actions.ts +++ b/app/imports/api/properties/Actions.ts @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import { storedIconsSchema } from '/imports/api/icons/Icons.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import { storedIconsSchema } from '/imports/api/icons/Icons'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; import { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; import { InlineCalculation } from '/imports/api/properties/subSchemas/inlineCalculationField'; import { CalculatedField } from '/imports/api/properties/subSchemas/computedField'; diff --git a/app/imports/api/properties/Adjustments.js b/app/imports/api/properties/Adjustments.js index 6b2607f5..8521063c 100644 --- a/app/imports/api/properties/Adjustments.js +++ b/app/imports/api/properties/Adjustments.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; const AdjustmentSchema = createPropertySchema({ // The roll that determines how much to change the attribute diff --git a/app/imports/api/properties/Attributes.js b/app/imports/api/properties/Attributes.js index 8835661a..fe5ea9e4 100644 --- a/app/imports/api/properties/Attributes.js +++ b/app/imports/api/properties/Attributes.js @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; /* * Attributes are numbered stats of a character diff --git a/app/imports/api/properties/Branches.js b/app/imports/api/properties/Branches.js index 73716eb6..fbc2a5e2 100644 --- a/app/imports/api/properties/Branches.js +++ b/app/imports/api/properties/Branches.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let BranchSchema = createPropertySchema({ branchType: { diff --git a/app/imports/api/properties/BuffRemovers.js b/app/imports/api/properties/BuffRemovers.js index b96466cb..8adce152 100644 --- a/app/imports/api/properties/BuffRemovers.js +++ b/app/imports/api/properties/BuffRemovers.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let BuffRemoverSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/Buffs.js b/app/imports/api/properties/Buffs.js index 386c402b..dab5594b 100644 --- a/app/imports/api/properties/Buffs.js +++ b/app/imports/api/properties/Buffs.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let BuffSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/ClassLevels.js b/app/imports/api/properties/ClassLevels.js index 5fd8a702..30c75cb5 100644 --- a/app/imports/api/properties/ClassLevels.js +++ b/app/imports/api/properties/ClassLevels.js @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; const ClassLevelSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/Classes.js b/app/imports/api/properties/Classes.js index e6e6471f..8242b1bc 100644 --- a/app/imports/api/properties/Classes.js +++ b/app/imports/api/properties/Classes.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; // Classes are like slots, except they only take class levels and enforce that // lower levels are taken before higher levels @@ -40,7 +40,7 @@ let ClassSchema = createPropertySchema({ 'extraTags.$._id': { type: String, regEx: SimpleSchema.RegEx.Id, - autoValue(){ + autoValue() { if (!this.isSet) return Random.id(); } }, @@ -74,7 +74,7 @@ const ComputedOnlyClassSchema = createPropertySchema({ type: 'computedOnlyField', optional: true, }, - + // Denormalised fields level: { type: SimpleSchema.Integer, diff --git a/app/imports/api/properties/Constants.js b/app/imports/api/properties/Constants.js index ded0f090..9b70bfca 100644 --- a/app/imports/api/properties/Constants.js +++ b/app/imports/api/properties/Constants.js @@ -1,12 +1,12 @@ import SimpleSchema from 'simpl-schema'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; import { parse, prettifyParseError, -} from '/imports/parser/parser.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import resolve, { Context, traverse } from '/imports/parser/resolve.js'; +} from '/imports/parser/parser'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import resolve, { Context, traverse } from '/imports/parser/resolve'; /* * Constants are primitive values that can be used elsewhere in computations diff --git a/app/imports/api/properties/Containers.js b/app/imports/api/properties/Containers.js index 6936bd15..f840a0bf 100644 --- a/app/imports/api/properties/Containers.js +++ b/app/imports/api/properties/Containers.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let ContainerSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/DamageMultipliers.js b/app/imports/api/properties/DamageMultipliers.js index 3c75fbbf..c76f104f 100644 --- a/app/imports/api/properties/DamageMultipliers.js +++ b/app/imports/api/properties/DamageMultipliers.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; /* * DamageMultipliers are multipliers that affect how much damage is taken from diff --git a/app/imports/api/properties/Damages.js b/app/imports/api/properties/Damages.js index b5510444..34ee997c 100644 --- a/app/imports/api/properties/Damages.js +++ b/app/imports/api/properties/Damages.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import { SavingThrowSchema, ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows.js'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import { SavingThrowSchema, ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows'; const DamageSchema = createPropertySchema({ // The roll that determines how much to damage the attribute diff --git a/app/imports/api/properties/Effects.js b/app/imports/api/properties/Effects.js index 77eadbeb..347a4000 100644 --- a/app/imports/api/properties/Effects.js +++ b/app/imports/api/properties/Effects.js @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema'; /* * Effects are reason-value attached to skills and abilities diff --git a/app/imports/api/properties/Features.js b/app/imports/api/properties/Features.js index 91fc95b6..e4b467c1 100644 --- a/app/imports/api/properties/Features.js +++ b/app/imports/api/properties/Features.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let FeatureSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/Folders.js b/app/imports/api/properties/Folders.js index 626b07ed..96bc2840 100644 --- a/app/imports/api/properties/Folders.js +++ b/app/imports/api/properties/Folders.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; // Folders organize a character sheet into a tree, particularly to group things // like 'race' and 'background' diff --git a/app/imports/api/properties/Items.ts b/app/imports/api/properties/Items.ts index ba5cedc3..02e0e0c9 100644 --- a/app/imports/api/properties/Items.ts +++ b/app/imports/api/properties/Items.ts @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; import { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; export interface Item extends CreatureProperty { diff --git a/app/imports/api/properties/Notes.js b/app/imports/api/properties/Notes.js index 1e738b08..4aa66a6e 100644 --- a/app/imports/api/properties/Notes.js +++ b/app/imports/api/properties/Notes.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let NoteSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/PointBuys.js b/app/imports/api/properties/PointBuys.js index fcbb8f6e..5c45aab4 100644 --- a/app/imports/api/properties/PointBuys.js +++ b/app/imports/api/properties/PointBuys.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; /* * PointBuys are reason-value attached to skills and abilities diff --git a/app/imports/api/properties/Proficiencies.js b/app/imports/api/properties/Proficiencies.js index cec32217..fe48b01b 100644 --- a/app/imports/api/properties/Proficiencies.js +++ b/app/imports/api/properties/Proficiencies.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema'; let ProficiencySchema = new SimpleSchema({ name: { diff --git a/app/imports/api/properties/References.js b/app/imports/api/properties/References.js index d6ece6e6..31459cdf 100644 --- a/app/imports/api/properties/References.js +++ b/app/imports/api/properties/References.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let ReferenceSchema = new SimpleSchema({ ref: { diff --git a/app/imports/api/properties/Rolls.js b/app/imports/api/properties/Rolls.js index 7a2c5eeb..b97dc498 100644 --- a/app/imports/api/properties/Rolls.js +++ b/app/imports/api/properties/Rolls.js @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; /** * Rolls are children to actions or other rolls, they are triggered with 0 or diff --git a/app/imports/api/properties/SavingThrows.js b/app/imports/api/properties/SavingThrows.js index d0045187..d53c7273 100644 --- a/app/imports/api/properties/SavingThrows.js +++ b/app/imports/api/properties/SavingThrows.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; // These are the rolls made when saves are called for // For the saving throw bonus or proficiency, see ./Skills.js diff --git a/app/imports/api/properties/Skills.js b/app/imports/api/properties/Skills.js index 7f15df3a..da9d7588 100644 --- a/app/imports/api/properties/Skills.js +++ b/app/imports/api/properties/Skills.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; -import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema.js'; +import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema'; /* * Skills are anything that results in a modifier to be added to a D20 diff --git a/app/imports/api/properties/Slots.js b/app/imports/api/properties/Slots.js index 310ba198..fd41c36c 100644 --- a/app/imports/api/properties/Slots.js +++ b/app/imports/api/properties/Slots.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let SlotSchema = createPropertySchema({ name: { @@ -37,7 +37,7 @@ let SlotSchema = createPropertySchema({ 'extraTags.$._id': { type: String, regEx: SimpleSchema.RegEx.Id, - autoValue(){ + autoValue() { if (!this.isSet) return Random.id(); } }, diff --git a/app/imports/api/properties/SpellLists.js b/app/imports/api/properties/SpellLists.js index 285832eb..e99c6ff5 100644 --- a/app/imports/api/properties/SpellLists.js +++ b/app/imports/api/properties/SpellLists.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; let SpellListSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/Spells.ts b/app/imports/api/properties/Spells.ts index bb62bd93..d378f2ff 100644 --- a/app/imports/api/properties/Spells.ts +++ b/app/imports/api/properties/Spells.ts @@ -1,6 +1,6 @@ import { ActionBase, ActionSchema, ComputedOnlyActionSchema } from '/imports/api/properties/Actions'; import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; import { CreatureProperty } from '/imports/api/creature/creatureProperties/CreatureProperties'; export interface Spell extends ActionBase { diff --git a/app/imports/api/properties/Toggles.js b/app/imports/api/properties/Toggles.js index c5babdc6..e52f6e49 100644 --- a/app/imports/api/properties/Toggles.js +++ b/app/imports/api/properties/Toggles.js @@ -1,7 +1,7 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import TagTargetingSchema from '/imports/api/properties/subSchemas/TagTargetingSchema'; const ToggleSchema = createPropertySchema({ name: { diff --git a/app/imports/api/properties/Triggers.js b/app/imports/api/properties/Triggers.js index 09d777e2..1dea7daa 100644 --- a/app/imports/api/properties/Triggers.js +++ b/app/imports/api/properties/Triggers.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const eventOptions = { doActionProperty: 'Do action', diff --git a/app/imports/api/properties/computedOnlyPropertySchemasIndex.js b/app/imports/api/properties/computedOnlyPropertySchemasIndex.js index 872249e5..a70304ed 100644 --- a/app/imports/api/properties/computedOnlyPropertySchemasIndex.js +++ b/app/imports/api/properties/computedOnlyPropertySchemasIndex.js @@ -1,32 +1,32 @@ import SimpleSchema from 'simpl-schema'; import { ComputedOnlyActionSchema } from '/imports/api/properties/Actions'; -import { ComputedOnlyAdjustmentSchema } from '/imports/api/properties/Adjustments.js'; -import { ComputedOnlyAttributeSchema } from '/imports/api/properties/Attributes.js'; -import { ComputedOnlyBuffSchema } from '/imports/api/properties/Buffs.js'; -import { ComputedOnlyBuffRemoverSchema } from '/imports/api/properties/BuffRemovers.js'; -import { ComputedOnlyBranchSchema } from '/imports/api/properties/Branches.js'; -import { ComputedOnlyClassSchema } from '/imports/api/properties/Classes.js'; -import { ComputedOnlyClassLevelSchema } from '/imports/api/properties/ClassLevels.js'; -import { ComputedOnlyConstantSchema } from '/imports/api/properties/Constants.js'; -import { ComputedOnlyContainerSchema } from '/imports/api/properties/Containers.js'; -import { ComputedOnlyDamageSchema } from '/imports/api/properties/Damages.js'; -import { ComputedOnlyDamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers.js'; -import { ComputedOnlyEffectSchema } from '/imports/api/properties/Effects.js'; -import { ComputedOnlyFeatureSchema } from '/imports/api/properties/Features.js'; -import { ComputedOnlyFolderSchema } from '/imports/api/properties/Folders.js'; +import { ComputedOnlyAdjustmentSchema } from '/imports/api/properties/Adjustments'; +import { ComputedOnlyAttributeSchema } from '/imports/api/properties/Attributes'; +import { ComputedOnlyBuffSchema } from '/imports/api/properties/Buffs'; +import { ComputedOnlyBuffRemoverSchema } from '/imports/api/properties/BuffRemovers'; +import { ComputedOnlyBranchSchema } from '/imports/api/properties/Branches'; +import { ComputedOnlyClassSchema } from '/imports/api/properties/Classes'; +import { ComputedOnlyClassLevelSchema } from '/imports/api/properties/ClassLevels'; +import { ComputedOnlyConstantSchema } from '/imports/api/properties/Constants'; +import { ComputedOnlyContainerSchema } from '/imports/api/properties/Containers'; +import { ComputedOnlyDamageSchema } from '/imports/api/properties/Damages'; +import { ComputedOnlyDamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers'; +import { ComputedOnlyEffectSchema } from '/imports/api/properties/Effects'; +import { ComputedOnlyFeatureSchema } from '/imports/api/properties/Features'; +import { ComputedOnlyFolderSchema } from '/imports/api/properties/Folders'; import { ComputedOnlyItemSchema } from '/imports/api/properties/Items'; -import { ComputedOnlyNoteSchema } from '/imports/api/properties/Notes.js'; -import { ComputedOnlyPointBuySchema } from '/imports/api/properties/PointBuys.js'; -import { ComputedOnlyProficiencySchema } from '/imports/api/properties/Proficiencies.js'; -import { ComputedOnlyReferenceSchema } from '/imports/api/properties/References.js'; -import { ComputedOnlyRollSchema } from '/imports/api/properties/Rolls.js'; -import { ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows.js'; -import { ComputedOnlySkillSchema } from '/imports/api/properties/Skills.js'; -import { ComputedOnlySlotSchema } from '/imports/api/properties/Slots.js'; +import { ComputedOnlyNoteSchema } from '/imports/api/properties/Notes'; +import { ComputedOnlyPointBuySchema } from '/imports/api/properties/PointBuys'; +import { ComputedOnlyProficiencySchema } from '/imports/api/properties/Proficiencies'; +import { ComputedOnlyReferenceSchema } from '/imports/api/properties/References'; +import { ComputedOnlyRollSchema } from '/imports/api/properties/Rolls'; +import { ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows'; +import { ComputedOnlySkillSchema } from '/imports/api/properties/Skills'; +import { ComputedOnlySlotSchema } from '/imports/api/properties/Slots'; import { ComputedOnlySpellSchema } from '/imports/api/properties/Spells'; -import { ComputedOnlySpellListSchema } from '/imports/api/properties/SpellLists.js'; -import { ComputedOnlyToggleSchema } from '/imports/api/properties/Toggles.js'; -import { ComputedOnlyTriggerSchema } from '/imports/api/properties/Triggers.js'; +import { ComputedOnlySpellListSchema } from '/imports/api/properties/SpellLists'; +import { ComputedOnlyToggleSchema } from '/imports/api/properties/Toggles'; +import { ComputedOnlyTriggerSchema } from '/imports/api/properties/Triggers'; const propertySchemasIndex = { action: ComputedOnlyActionSchema, diff --git a/app/imports/api/properties/computedPropertySchemasIndex.js b/app/imports/api/properties/computedPropertySchemasIndex.js index f3ce169b..775aa504 100644 --- a/app/imports/api/properties/computedPropertySchemasIndex.js +++ b/app/imports/api/properties/computedPropertySchemasIndex.js @@ -1,32 +1,32 @@ import SimpleSchema from 'simpl-schema'; import { ComputedActionSchema } from '/imports/api/properties/Actions'; -import { ComputedAdjustmentSchema } from '/imports/api/properties/Adjustments.js'; -import { ComputedAttributeSchema } from '/imports/api/properties/Attributes.js'; -import { ComputedBuffSchema } from '/imports/api/properties/Buffs.js'; -import { ComputedBuffRemoverSchema } from '/imports/api/properties/BuffRemovers.js'; -import { ComputedBranchSchema } from '/imports/api/properties/Branches.js'; -import { ComputedClassSchema } from '/imports/api/properties/Classes.js'; -import { ComputedClassLevelSchema } from '/imports/api/properties/ClassLevels.js'; -import { ConstantSchema } from '/imports/api/properties/Constants.js'; -import { ComputedContainerSchema } from '/imports/api/properties/Containers.js'; -import { ComputedDamageSchema } from '/imports/api/properties/Damages.js'; -import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers.js'; -import { ComputedEffectSchema } from '/imports/api/properties/Effects.js'; -import { ComputedFeatureSchema } from '/imports/api/properties/Features.js'; -import { ComputedFolderSchema } from '/imports/api/properties/Folders.js'; +import { ComputedAdjustmentSchema } from '/imports/api/properties/Adjustments'; +import { ComputedAttributeSchema } from '/imports/api/properties/Attributes'; +import { ComputedBuffSchema } from '/imports/api/properties/Buffs'; +import { ComputedBuffRemoverSchema } from '/imports/api/properties/BuffRemovers'; +import { ComputedBranchSchema } from '/imports/api/properties/Branches'; +import { ComputedClassSchema } from '/imports/api/properties/Classes'; +import { ComputedClassLevelSchema } from '/imports/api/properties/ClassLevels'; +import { ConstantSchema } from '/imports/api/properties/Constants'; +import { ComputedContainerSchema } from '/imports/api/properties/Containers'; +import { ComputedDamageSchema } from '/imports/api/properties/Damages'; +import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers'; +import { ComputedEffectSchema } from '/imports/api/properties/Effects'; +import { ComputedFeatureSchema } from '/imports/api/properties/Features'; +import { ComputedFolderSchema } from '/imports/api/properties/Folders'; import { ComputedItemSchema } from '/imports/api/properties/Items'; -import { ComputedNoteSchema } from '/imports/api/properties/Notes.js'; -import { ComputedPointBuySchema } from '/imports/api/properties/PointBuys.js'; -import { ProficiencySchema } from '/imports/api/properties/Proficiencies.js'; -import { ReferenceSchema } from '/imports/api/properties/References.js'; -import { ComputedRollSchema } from '/imports/api/properties/Rolls.js'; -import { ComputedSavingThrowSchema } from '/imports/api/properties/SavingThrows.js'; -import { ComputedSkillSchema } from '/imports/api/properties/Skills.js'; -import { ComputedSlotSchema } from '/imports/api/properties/Slots.js'; +import { ComputedNoteSchema } from '/imports/api/properties/Notes'; +import { ComputedPointBuySchema } from '/imports/api/properties/PointBuys'; +import { ProficiencySchema } from '/imports/api/properties/Proficiencies'; +import { ReferenceSchema } from '/imports/api/properties/References'; +import { ComputedRollSchema } from '/imports/api/properties/Rolls'; +import { ComputedSavingThrowSchema } from '/imports/api/properties/SavingThrows'; +import { ComputedSkillSchema } from '/imports/api/properties/Skills'; +import { ComputedSlotSchema } from '/imports/api/properties/Slots'; import { ComputedSpellSchema } from '/imports/api/properties/Spells'; -import { ComputedSpellListSchema } from '/imports/api/properties/SpellLists.js'; -import { ComputedToggleSchema } from '/imports/api/properties/Toggles.js'; -import { ComputedTriggerSchema } from '/imports/api/properties/Triggers.js'; +import { ComputedSpellListSchema } from '/imports/api/properties/SpellLists'; +import { ComputedToggleSchema } from '/imports/api/properties/Toggles'; +import { ComputedTriggerSchema } from '/imports/api/properties/Triggers'; const propertySchemasIndex = { action: ComputedActionSchema, diff --git a/app/imports/api/properties/propertySchemasIndex.js b/app/imports/api/properties/propertySchemasIndex.js index dd02e2da..4f56a373 100644 --- a/app/imports/api/properties/propertySchemasIndex.js +++ b/app/imports/api/properties/propertySchemasIndex.js @@ -1,31 +1,31 @@ import SimpleSchema from 'simpl-schema'; import { ActionSchema } from '/imports/api/properties/Actions'; -import { AdjustmentSchema } from '/imports/api/properties/Adjustments.js'; -import { AttributeSchema } from '/imports/api/properties/Attributes.js'; -import { BuffSchema } from '/imports/api/properties/Buffs.js'; -import { BuffRemoverSchema } from '/imports/api/properties/BuffRemovers.js'; -import { BranchSchema } from '/imports/api/properties/Branches.js'; -import { ClassSchema } from '/imports/api/properties/Classes.js'; -import { ClassLevelSchema } from '/imports/api/properties/ClassLevels.js'; -import { ConstantSchema } from '/imports/api/properties/Constants.js'; -import { DamageSchema } from '/imports/api/properties/Damages.js'; -import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers.js'; -import { EffectSchema } from '/imports/api/properties/Effects.js'; -import { FeatureSchema } from '/imports/api/properties/Features.js'; -import { FolderSchema } from '/imports/api/properties/Folders.js'; -import { NoteSchema } from '/imports/api/properties/Notes.js'; -import { PointBuySchema } from '/imports/api/properties/PointBuys.js'; -import { ProficiencySchema } from '/imports/api/properties/Proficiencies.js'; -import { ReferenceSchema } from '/imports/api/properties/References.js'; -import { RollSchema } from '/imports/api/properties/Rolls.js'; -import { SavingThrowSchema } from '/imports/api/properties/SavingThrows.js'; -import { SkillSchema } from '/imports/api/properties/Skills.js'; -import { SlotSchema } from '/imports/api/properties/Slots.js'; -import { SpellListSchema } from '/imports/api/properties/SpellLists.js'; +import { AdjustmentSchema } from '/imports/api/properties/Adjustments'; +import { AttributeSchema } from '/imports/api/properties/Attributes'; +import { BuffSchema } from '/imports/api/properties/Buffs'; +import { BuffRemoverSchema } from '/imports/api/properties/BuffRemovers'; +import { BranchSchema } from '/imports/api/properties/Branches'; +import { ClassSchema } from '/imports/api/properties/Classes'; +import { ClassLevelSchema } from '/imports/api/properties/ClassLevels'; +import { ConstantSchema } from '/imports/api/properties/Constants'; +import { DamageSchema } from '/imports/api/properties/Damages'; +import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers'; +import { EffectSchema } from '/imports/api/properties/Effects'; +import { FeatureSchema } from '/imports/api/properties/Features'; +import { FolderSchema } from '/imports/api/properties/Folders'; +import { NoteSchema } from '/imports/api/properties/Notes'; +import { PointBuySchema } from '/imports/api/properties/PointBuys'; +import { ProficiencySchema } from '/imports/api/properties/Proficiencies'; +import { ReferenceSchema } from '/imports/api/properties/References'; +import { RollSchema } from '/imports/api/properties/Rolls'; +import { SavingThrowSchema } from '/imports/api/properties/SavingThrows'; +import { SkillSchema } from '/imports/api/properties/Skills'; +import { SlotSchema } from '/imports/api/properties/Slots'; +import { SpellListSchema } from '/imports/api/properties/SpellLists'; import { SpellSchema } from '/imports/api/properties/Spells'; -import { ToggleSchema } from '/imports/api/properties/Toggles.js'; -import { TriggerSchema } from '/imports/api/properties/Triggers.js'; -import { ContainerSchema } from '/imports/api/properties/Containers.js'; +import { ToggleSchema } from '/imports/api/properties/Toggles'; +import { TriggerSchema } from '/imports/api/properties/Triggers'; +import { ContainerSchema } from '/imports/api/properties/Containers'; import { ItemSchema } from '/imports/api/properties/Items'; const propertySchemasIndex = { diff --git a/app/imports/api/properties/subSchemas/ErrorSchema.js b/app/imports/api/properties/subSchemas/ErrorSchema.js index 41635874..636281e6 100644 --- a/app/imports/api/properties/subSchemas/ErrorSchema.js +++ b/app/imports/api/properties/subSchemas/ErrorSchema.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const ErrorSchema = new SimpleSchema({ message: { diff --git a/app/imports/api/properties/subSchemas/InlineComputationSchema.js b/app/imports/api/properties/subSchemas/InlineComputationSchema.js index 14a33e75..a52120c2 100644 --- a/app/imports/api/properties/subSchemas/InlineComputationSchema.js +++ b/app/imports/api/properties/subSchemas/InlineComputationSchema.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const InlineComputationSchema = new SimpleSchema({ // The part between bracers {} diff --git a/app/imports/api/properties/subSchemas/RollDetailsSchema.js b/app/imports/api/properties/subSchemas/RollDetailsSchema.js index 44f39e5e..9ea3f279 100644 --- a/app/imports/api/properties/subSchemas/RollDetailsSchema.js +++ b/app/imports/api/properties/subSchemas/RollDetailsSchema.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const RollDetailsSchema = new SimpleSchema({ number: { diff --git a/app/imports/api/properties/subSchemas/RollResultsSchema.js b/app/imports/api/properties/subSchemas/RollResultsSchema.js index 8aea32e9..b15746f3 100644 --- a/app/imports/api/properties/subSchemas/RollResultsSchema.js +++ b/app/imports/api/properties/subSchemas/RollResultsSchema.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import ResultsSchema from '/imports/api/properties/subSchemas/ResultsSchema.js'; +import ResultsSchema from '/imports/api/properties/subSchemas/ResultsSchema'; let RollResultsSchema = new SimpleSchema({ _id: { diff --git a/app/imports/api/properties/subSchemas/TagTargetingSchema.js b/app/imports/api/properties/subSchemas/TagTargetingSchema.js index 8bbe1ddb..ea33d758 100644 --- a/app/imports/api/properties/subSchemas/TagTargetingSchema.js +++ b/app/imports/api/properties/subSchemas/TagTargetingSchema.js @@ -1,5 +1,5 @@ import SimpleSchema from 'simpl-schema'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; const TagTargetingSchema = new SimpleSchema({ // True when targeting by tags instead of stats diff --git a/app/imports/api/properties/subSchemas/computedField.ts b/app/imports/api/properties/subSchemas/computedField.ts index 5f5c13e0..38516cea 100644 --- a/app/imports/api/properties/subSchemas/computedField.ts +++ b/app/imports/api/properties/subSchemas/computedField.ts @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; export interface CalculatedField { calculation?: string, diff --git a/app/imports/api/properties/subSchemas/inlineCalculationField.ts b/app/imports/api/properties/subSchemas/inlineCalculationField.ts index a0e27827..c50ea24d 100644 --- a/app/imports/api/properties/subSchemas/inlineCalculationField.ts +++ b/app/imports/api/properties/subSchemas/inlineCalculationField.ts @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import ErrorSchema from '/imports/api/properties/subSchemas/ErrorSchema'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; import { CalculatedField } from './computedField'; export interface InlineCalculation { diff --git a/app/imports/api/sharing/SharingSchema.js b/app/imports/api/sharing/SharingSchema.js index 629f90bb..695d9674 100644 --- a/app/imports/api/sharing/SharingSchema.js +++ b/app/imports/api/sharing/SharingSchema.js @@ -1,6 +1,6 @@ import SimpleSchema from 'simpl-schema'; -import '/imports/api/sharing/sharing.js'; -import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js'; +import '/imports/api/sharing/sharing'; +import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS'; let SharingSchema = new SimpleSchema({ owner: { diff --git a/app/imports/api/sharing/sharing.js b/app/imports/api/sharing/sharing.js index 84386618..89222dbf 100644 --- a/app/imports/api/sharing/sharing.js +++ b/app/imports/api/sharing/sharing.js @@ -1,10 +1,10 @@ import SimpleSchema from 'simpl-schema'; -import { assertOwnership } from '/imports/api/sharing/sharingPermissions.js'; +import { assertOwnership } from '/imports/api/sharing/sharingPermissions'; import { getCollectionByName, fetchDocByRef } from '/imports/api/parenting/parentingFunctions'; import { RefSchema } from '/imports/api/parenting/ChildSchema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { getUserTier } from '/imports/api/users/patreon/tiers.js'; +import { getUserTier } from '/imports/api/users/patreon/tiers'; const setPublic = new ValidatedMethod({ name: 'sharing.setPublic', diff --git a/app/imports/api/tabletop/Messages.js b/app/imports/api/tabletop/Messages.js index 634f32d9..07cd270a 100644 --- a/app/imports/api/tabletop/Messages.js +++ b/app/imports/api/tabletop/Messages.js @@ -1,8 +1,8 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import Tabletops, { assertUserInTabletop } from '/imports/api/tabletop/Tabletops.js'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import Tabletops, { assertUserInTabletop } from '/imports/api/tabletop/Tabletops'; let Messages = new Mongo.Collection('messages'); diff --git a/app/imports/api/tabletop/Tabletops.js b/app/imports/api/tabletop/Tabletops.js index 5c81986c..21456580 100644 --- a/app/imports/api/tabletop/Tabletops.js +++ b/app/imports/api/tabletop/Tabletops.js @@ -48,8 +48,8 @@ let TabletopSchema = new SimpleSchema({ Tabletops.attachSchema(TabletopSchema); -import '/imports/api/tabletop/methods/removeTabletop.js'; -import '/imports/api/tabletop/methods/insertTabletop.js'; -import '/imports/api/tabletop/methods/addCreaturesToTabletop.js'; +import '/imports/api/tabletop/methods/removeTabletop'; +import '/imports/api/tabletop/methods/insertTabletop'; +import '/imports/api/tabletop/methods/addCreaturesToTabletop'; export default Tabletops; diff --git a/app/imports/api/tabletop/methods/addCreaturesToTabletop.js b/app/imports/api/tabletop/methods/addCreaturesToTabletop.js index b17b953b..babea992 100644 --- a/app/imports/api/tabletop/methods/addCreaturesToTabletop.js +++ b/app/imports/api/tabletop/methods/addCreaturesToTabletop.js @@ -1,10 +1,10 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { assertUserInTabletop } from './shared/tabletopPermissions.js'; -import { assertAdmin } from '/imports/api/sharing/sharingPermissions.js'; -import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import { assertUserInTabletop } from './shared/tabletopPermissions'; +import { assertAdmin } from '/imports/api/sharing/sharingPermissions'; +import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers'; +import Creatures from '/imports/api/creature/creatures/Creatures'; const addCreaturesToTabletop = new ValidatedMethod({ @@ -30,23 +30,23 @@ const addCreaturesToTabletop = new ValidatedMethod({ timeInterval: 5000, }, - run({tabletopId, creatureIds}) { + run({ tabletopId, creatureIds }) { if (!this.userId) { throw new Meteor.Error('tabletops.addCreatures.denied', - 'You need to be logged in to remove a tabletop'); + 'You need to be logged in to remove a tabletop'); } assertUserHasPaidBenefits(this.userId); assertUserInTabletop(tabletopId, this.userId); assertAdmin(this.userId); Creatures.update({ - _id: {$in: creatureIds}, + _id: { $in: creatureIds }, $or: [ - {writers: this.userId}, - {owner: this.userId}, + { writers: this.userId }, + { owner: this.userId }, ], }, { - $set: {tabletop: tabletopId}, + $set: { tabletop: tabletopId }, }, { multi: true, }); diff --git a/app/imports/api/tabletop/methods/insertTabletop.js b/app/imports/api/tabletop/methods/insertTabletop.js index 62ad2156..c213f04e 100644 --- a/app/imports/api/tabletop/methods/insertTabletop.js +++ b/app/imports/api/tabletop/methods/insertTabletop.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Tabletops from '../Tabletops.js'; -import { assertAdmin } from '/imports/api/sharing/sharingPermissions.js'; -import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers.js'; +import Tabletops from '../Tabletops'; +import { assertAdmin } from '/imports/api/sharing/sharingPermissions'; +import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers'; const insertTabletop = new ValidatedMethod({ diff --git a/app/imports/api/tabletop/methods/removeTabletop.js b/app/imports/api/tabletop/methods/removeTabletop.js index 4636eb4b..d3ac2d33 100644 --- a/app/imports/api/tabletop/methods/removeTabletop.js +++ b/app/imports/api/tabletop/methods/removeTabletop.js @@ -1,11 +1,11 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Tabletops from '../Tabletops.js'; -import { assertAdmin } from '/imports/api/sharing/sharingPermissions.js'; -import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers.js'; -import { assertUserIsTabletopOwner } from './shared/tabletopPermissions.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; +import Tabletops from '../Tabletops'; +import { assertAdmin } from '/imports/api/sharing/sharingPermissions'; +import { assertUserHasPaidBenefits } from '/imports/api/users/patreon/tiers'; +import { assertUserIsTabletopOwner } from './shared/tabletopPermissions'; +import Creatures from '/imports/api/creature/creatures/Creatures'; const removeTabletop = new ValidatedMethod({ diff --git a/app/imports/api/tabletop/methods/shared/tabletopPermissions.js b/app/imports/api/tabletop/methods/shared/tabletopPermissions.js index 2f14543d..3a233c95 100644 --- a/app/imports/api/tabletop/methods/shared/tabletopPermissions.js +++ b/app/imports/api/tabletop/methods/shared/tabletopPermissions.js @@ -1,25 +1,25 @@ -import Tabletops from '../../Tabletops.js'; +import Tabletops from '../../Tabletops'; -export function assertUserInTabletop(tabletopId, userId){ +export function assertUserInTabletop(tabletopId, userId) { let tabletop = Tabletops.findOne(tabletopId); - if (!tabletop){ + if (!tabletop) { throw new Meteor.Error('Tabletop does not exist', - 'No tabletop could be found for the given tabletop id'); + 'No tabletop could be found for the given tabletop id'); } - if (tabletop.gameMaster !== userId && !tabletop.players.includes(userId)){ + if (tabletop.gameMaster !== userId && !tabletop.players.includes(userId)) { throw new Meteor.Error('Not in tabletop', - 'The user is not the gamemaster or a player in the given tabletop'); + 'The user is not the gamemaster or a player in the given tabletop'); } } -export function assertUserIsTabletopOwner(tabletopId, userId){ +export function assertUserIsTabletopOwner(tabletopId, userId) { let tabletop = Tabletops.findOne(tabletopId); - if (!tabletop){ + if (!tabletop) { throw new Meteor.Error('Tabletop does not exist', - 'No tabletop could be found for the given tabletop id'); + 'No tabletop could be found for the given tabletop id'); } - if (tabletop.gameMaster !== userId){ + if (tabletop.gameMaster !== userId) { throw new Meteor.Error('Not the owner', - 'The user is not the owner of the given tabletop'); + 'The user is not the owner of the given tabletop'); } } diff --git a/app/imports/api/users/Invites.js b/app/imports/api/users/Invites.js index af98adf2..19799b92 100644 --- a/app/imports/api/users/Invites.js +++ b/app/imports/api/users/Invites.js @@ -1,9 +1,9 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import { getUserTier } from '/imports/api/users/patreon/tiers.js'; +import { getUserTier } from '/imports/api/users/patreon/tiers'; -let Invites= new Mongo.Collection('invites'); +let Invites = new Mongo.Collection('invites'); let InviteSchema = new SimpleSchema({ inviter: { @@ -34,13 +34,13 @@ let InviteSchema = new SimpleSchema({ }, }); -if (Meteor.isServer){ - Accounts.onLogin(function({user}){ +if (Meteor.isServer) { + Accounts.onLogin(function ({ user }) { alignInvitesWithPatreonTier(user); }); } -function alignInvitesWithPatreonTier(user){ +function alignInvitesWithPatreonTier(user) { const tier = getUserTier(user); let availableInvites = tier.invites; let currentlyFundedInvites = []; @@ -48,7 +48,7 @@ function alignInvitesWithPatreonTier(user){ Invites.find({ inviter: user._id }).forEach(invite => { - if (invite.isFunded){ + if (invite.isFunded) { currentlyFundedInvites.push(invite); } else { currenltyUnfundedInvites.push(invite); @@ -63,23 +63,23 @@ function alignInvitesWithPatreonTier(user){ currenltyUnfundedInvites.sort((a, b) => b.dateConfirmed - a.dateConfirmed); // Defund or delete excess invites - while (currentlyFundedInvites.length > availableInvites){ + while (currentlyFundedInvites.length > availableInvites) { let inviteToDefund = currentlyFundedInvites.pop(); - if (inviteToDefund.invitee){ - Invites.update(inviteToDefund._id, {$set: {isFunded: false}}); + if (inviteToDefund.invitee) { + Invites.update(inviteToDefund._id, { $set: { isFunded: false } }); } else { Invites.remove(inviteToDefund._id); } } // Fund unfunded invites or insert new ones - while (currentlyFundedInvites.length < availableInvites){ - if (currenltyUnfundedInvites.length){ + while (currentlyFundedInvites.length < availableInvites) { + if (currenltyUnfundedInvites.length) { let inviteToFund = currenltyUnfundedInvites.pop(); currentlyFundedInvites.push(inviteToFund); - Invites.update(inviteToFund._id, {$set: {isFunded: true}}); + Invites.update(inviteToFund._id, { $set: { isFunded: true } }); } else { - let inviteId = Invites.insert({inviter: user._id, isFunded: true}); - currentlyFundedInvites.push({_id: inviteId}); + let inviteId = Invites.insert({ inviter: user._id, isFunded: true }); + currentlyFundedInvites.push({ _id: inviteId }); } } } @@ -97,17 +97,17 @@ const getInviteToken = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({inviteId}) { + run({ inviteId }) { let invite = Invites.findOne(inviteId); if (this.userId !== invite.inviter) { throw new Meteor.Error('Invites.methods.getToken.denied', - 'You need to be the inviter of the invite to create a token'); + 'You need to be the inviter of the invite to create a token'); } - if (invite.inviteToken){ + if (invite.inviteToken) { return invite.inviteToken; } else { let inviteToken = Random.id(5); - Invites.update(inviteId, {$set: {inviteToken}}) + Invites.update(inviteId, { $set: { inviteToken } }) return inviteToken; } }, @@ -125,32 +125,32 @@ const acceptInviteToken = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({inviteToken}) { + run({ inviteToken }) { if (!this.userId) { throw new Meteor.Error('Invites.methods.acceptToken.denied', - 'You need to be the logged in to accept a token'); + 'You need to be the logged in to accept a token'); } if (Meteor.isClient) return; - let invite = Invites.findOne({inviteToken}); - if (!invite){ + let invite = Invites.findOne({ inviteToken }); + if (!invite) { throw new Meteor.Error('Invites.methods.acceptToken.notFound', - 'No invite could be found for this link, maybe it has already been claimed'); + 'No invite could be found for this link, maybe it has already been claimed'); } // If the invitee is already filled, fix unexpected case by deleting the token - if (invite.invitee){ + if (invite.invitee) { Invites.update(invite._id, { - $unset: {inviteToken: 1} + $unset: { inviteToken: 1 } }); throw new Meteor.Error('Invites.methods.acceptToken.alreadyAccepted', - 'This invite has already been claimed'); + 'This invite has already been claimed'); } - if (this.userId === invite.inviter){ + if (this.userId === invite.inviter) { throw new Meteor.Error('Invites.methods.acceptToken.ownToken', - 'You can\'t accept your own invite'); + 'You can\'t accept your own invite'); } Invites.update(invite._id, { - $set: {invitee: this.userId}, - $unset: {inviteToken: 1}, + $set: { invitee: this.userId }, + $unset: { inviteToken: 1 }, }); }, }); @@ -168,28 +168,28 @@ const revokeInvite = new ValidatedMethod({ numRequests: 5, timeInterval: 5000, }, - run({inviteId}) { + run({ inviteId }) { if (!this.userId) { throw new Meteor.Error('Invites.methods.revokeInvite.denied', - 'You need to be the logged in to revoke a token'); + 'You need to be the logged in to revoke a token'); } if (Meteor.isClient) return; let invite = Invites.findOne(inviteId); - if (!invite){ + if (!invite) { throw new Meteor.Error('Invites.methods.revokeInvite.notFound', - 'No invite could be found for this id'); + 'No invite could be found for this id'); } if (this.userId !== invite.inviter) { throw new Meteor.Error('Invites.methods.revokeInvite.denied', - 'You are not the owner of this invite'); + 'You are not the owner of this invite'); } // If the invitee is empty, the token has already been revoked - if (!invite.invitee){ + if (!invite.invitee) { return; } Invites.update(invite._id, { - $unset: {invitee: 1, dateConfirmed: 1}, + $unset: { invitee: 1, dateConfirmed: 1 }, }); }, }); diff --git a/app/imports/api/users/Users.js b/app/imports/api/users/Users.js index b27edfca..b219eeba 100644 --- a/app/imports/api/users/Users.js +++ b/app/imports/api/users/Users.js @@ -1,12 +1,12 @@ import SimpleSchema from 'simpl-schema'; import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Libraries from '/imports/api/library/Libraries.js'; -import LibraryCollections from '/imports/api/library/LibraryCollections.js'; -import '/imports/api/users/methods/deleteMyAccount.js'; -import '/imports/api/users/methods/addEmail.js'; -import '/imports/api/users/methods/removeEmail.js'; -import '/imports/api/users/methods/updateFileStorageUsed.js'; +import Libraries from '/imports/api/library/Libraries'; +import LibraryCollections from '/imports/api/library/LibraryCollections'; +import '/imports/api/users/methods/deleteMyAccount'; +import '/imports/api/users/methods/addEmail'; +import '/imports/api/users/methods/removeEmail'; +import '/imports/api/users/methods/updateFileStorageUsed'; import { some } from 'lodash'; const defaultLibraries = process.env.DEFAULT_LIBRARIES && process.env.DEFAULT_LIBRARIES.split(',') || []; const defaultLibraryCollections = process.env.DEFAULT_LIBRARY_COLLECTIONS && process.env.DEFAULT_LIBRARY_COLLECTIONS.split(',') || []; diff --git a/app/imports/api/users/methods/deleteMyAccount.js b/app/imports/api/users/methods/deleteMyAccount.js index 5c555855..c452583c 100644 --- a/app/imports/api/users/methods/deleteMyAccount.js +++ b/app/imports/api/users/methods/deleteMyAccount.js @@ -1,8 +1,8 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import Libraries, { removeLibaryWork } from '/imports/api/library/Libraries.js'; -import Creatures from '/imports/api/creature/creatures/Creatures.js'; -import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature.js'; +import Libraries, { removeLibaryWork } from '/imports/api/library/Libraries'; +import Creatures from '/imports/api/creature/creatures/Creatures'; +import { removeCreatureWork } from '/imports/api/creature/creatures/methods/removeCreature'; Meteor.users.deleteMyAccount = new ValidatedMethod({ name: 'users.deleteMyAccount', diff --git a/app/imports/api/users/methods/updateFileStorageUsed.js b/app/imports/api/users/methods/updateFileStorageUsed.js index 4fad2feb..b72a55e2 100644 --- a/app/imports/api/users/methods/updateFileStorageUsed.js +++ b/app/imports/api/users/methods/updateFileStorageUsed.js @@ -1,7 +1,7 @@ import { ValidatedMethod } from 'meteor/mdg:validated-method'; import { RateLimiterMixin } from 'ddp-rate-limiter-mixin'; -import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles.js'; -import UserImages from '/imports/api/files/UserImages.js'; +import ArchiveCreatureFiles from '/imports/api/creature/archive/ArchiveCreatureFiles'; +import UserImages from '/imports/api/files/UserImages'; const fileCollections = [ArchiveCreatureFiles, UserImages]; const updateFileStorageUsed = new ValidatedMethod({ @@ -29,7 +29,7 @@ export default updateFileStorageUsed; export function updateFileStorageUsedWork(userId) { if (!userId) { throw new Meteor.Error('idRequired', - 'No user ID was provided to update file storage used') + 'No user ID was provided to update file storage used') } let sum = 0; @@ -51,7 +51,7 @@ export function incrementFileStorageUsed(userId, amount) { throw new Meteor.Error('idRequired', 'No user ID was provided to update file storage used') } - + const user = Meteor.users.findOne(userId); if (!user) { throw new Meteor.Error('noUser', 'User not found'); diff --git a/app/imports/api/users/patreon/tiers.js b/app/imports/api/users/patreon/tiers.js index edd1d44a..e5f5d2e9 100644 --- a/app/imports/api/users/patreon/tiers.js +++ b/app/imports/api/users/patreon/tiers.js @@ -1,6 +1,6 @@ import { findLast } from 'lodash'; -import getEntitledCents from '/imports/api/users/patreon/getEntitledCents.js'; -import Invites from '/imports/api/users/Invites.js'; +import getEntitledCents from '/imports/api/users/patreon/getEntitledCents'; +import Invites from '/imports/api/users/Invites'; const patreonDisabled = !!Meteor.settings?.public?.disablePatreon; const TIERS = Object.freeze([ @@ -80,14 +80,14 @@ const PATREON_DISABLED_TIER = Object.freeze({ paidBenefits: true, }); -export function getTierByEntitledCents(entitledCents = 0){ +export function getTierByEntitledCents(entitledCents = 0) { if (patreonDisabled) return PATREON_DISABLED_TIER; return findLast(TIERS, tier => entitledCents >= tier.minimumEntitledCents); } -export function getUserTier(user){ +export function getUserTier(user) { if (!user) throw 'user must be provided'; - if (typeof user === 'string'){ + if (typeof user === 'string') { user = Meteor.users.findOne(user, { fields: { 'services.patreon': 1, @@ -99,19 +99,19 @@ export function getUserTier(user){ const entitledCents = getEntitledCents(user); const tier = getTierByEntitledCents(entitledCents); if (tier.paidBenefits) return tier; - let invite = Invites.findOne({invitee: user._id, isFunded: true}); - if (invite){ + let invite = Invites.findOne({ invitee: user._id, isFunded: true }); + if (invite) { return GUEST_TIER; } else { return tier; } } -export function assertUserHasPaidBenefits(user){ +export function assertUserHasPaidBenefits(user) { let tier = getUserTier(user); - if (!tier.paidBenefits){ + if (!tier.paidBenefits) { throw new Meteor.Error('no paid benefits', - `The ${tier.name} tier does not have the required benefits`); + `The ${tier.name} tier does not have the required benefits`); } } diff --git a/app/imports/api/users/patreon/updatePatreonOnLogin.js b/app/imports/api/users/patreon/updatePatreonOnLogin.js index cdff000e..f00d739e 100644 --- a/app/imports/api/users/patreon/updatePatreonOnLogin.js +++ b/app/imports/api/users/patreon/updatePatreonOnLogin.js @@ -1,11 +1,11 @@ -import updatePatreonDetails from '/imports/api/users/patreon/updatePatreonDetails.js'; +import updatePatreonDetails from '/imports/api/users/patreon/updatePatreonDetails'; const ONE_DAY = 24 * 60 * 60 * 1000; -Accounts.onLogin(({user}) => { +Accounts.onLogin(({ user }) => { let patreon = user.services && user.services.patreon; - if (patreon){ + if (patreon) { const timeSinceIdentityUpdate = new Date() - patreon.lastUpdatedIdentity; - if (timeSinceIdentityUpdate > ONE_DAY){ + if (timeSinceIdentityUpdate > ONE_DAY) { updatePatreonDetails(user); } } diff --git a/app/imports/client/serviceWorker.js b/app/imports/client/serviceWorker.js index 5caa9669..44a2d393 100644 --- a/app/imports/client/serviceWorker.js +++ b/app/imports/client/serviceWorker.js @@ -1,5 +1,5 @@ Meteor.startup(() => { - navigator.serviceWorker.register('/sw.js') - .then() - .catch(error => console.log('ServiceWorker registration failed: ', error)); + navigator.serviceWorker.register('/sw') + .then() + .catch(error => console.log('ServiceWorker registration failed: ', error)); }); diff --git a/app/imports/client/ui/components/CoinValue.vue b/app/imports/client/ui/components/CoinValue.vue index d5ccc0f8..21ea3de3 100644 --- a/app/imports/client/ui/components/CoinValue.vue +++ b/app/imports/client/ui/components/CoinValue.vue @@ -19,7 +19,7 @@