Fixed failing tests
This commit is contained in:
@@ -79,7 +79,7 @@ const archiveCreatureToFile = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
'creatureId': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -9,7 +9,7 @@ const removeArchiveCreature = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
'fileId': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -65,7 +65,7 @@ const restoreCreaturefromFile = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
'fileId': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -16,11 +16,11 @@ let creatureFolderSchema = new SimpleSchema({
|
||||
},
|
||||
'creatures.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
owner: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
index: 1,
|
||||
},
|
||||
archived: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import ColorSchema from '/imports/api/properties/subSchemas/ColorSchema';
|
||||
import ChildSchema from '/imports/api/parenting/ChildSchema';
|
||||
@@ -13,7 +12,7 @@ import type { PropertyType } from '/imports/api/properties/PropertyType.type';
|
||||
const PreComputeCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
_migrationError: {
|
||||
type: String,
|
||||
@@ -44,7 +43,7 @@ const PreComputeCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
// Reference to the library node that this property was copied from
|
||||
libraryNodeId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
optional: true,
|
||||
},
|
||||
// Fill more than one quantity in a slot, like feats and ability score
|
||||
@@ -87,7 +86,7 @@ const DenormalisedOnlyCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
},
|
||||
deactivatingToggleId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
@@ -103,7 +102,7 @@ const DenormalisedOnlyCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
},
|
||||
'triggerIds.before.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
'triggerIds.after': {
|
||||
type: Array,
|
||||
@@ -111,7 +110,7 @@ const DenormalisedOnlyCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
},
|
||||
'triggerIds.after.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
'triggerIds.afterChildren': {
|
||||
type: Array,
|
||||
@@ -119,7 +118,7 @@ const DenormalisedOnlyCreaturePropertySchema = TypedSimpleSchema.from({
|
||||
},
|
||||
'triggerIds.afterChildren.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
// When this is true on any property, the creature needs to be recomputed
|
||||
dirty: {
|
||||
@@ -156,7 +155,6 @@ for (key in propertySchemasIndex) {
|
||||
schema.extend(ColorSchema);
|
||||
schema.extend(ChildSchema);
|
||||
schema.extend(SoftRemovableSchema);
|
||||
// @ts-expect-error don't have types for .attachSchema
|
||||
CreatureProperties.attachSchema(schema, {
|
||||
selector: { type: key }
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ const copyPropertyToLibrary = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
propId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
parentRef: {
|
||||
type: RefSchema,
|
||||
|
||||
@@ -23,7 +23,7 @@ const duplicateProperty = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
}
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -52,7 +52,7 @@ const insertPropertyAsChildOfTag = new ValidatedMethod({
|
||||
},
|
||||
creatureId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
tag: {
|
||||
type: String,
|
||||
|
||||
@@ -23,7 +23,7 @@ const insertPropertyFromLibraryNode = new ValidatedMethod({
|
||||
},
|
||||
'nodeIds.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
parentRef: {
|
||||
type: RefSchema,
|
||||
|
||||
@@ -97,7 +97,7 @@ const CreatureSchema = TypedSimpleSchema.from({
|
||||
},
|
||||
'allowedLibraries.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
allowedLibraryCollections: {
|
||||
type: Array,
|
||||
@@ -106,7 +106,7 @@ const CreatureSchema = TypedSimpleSchema.from({
|
||||
},
|
||||
'allowedLibraryCollections.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
|
||||
// Stats that are computed and denormalised outside of recomputation
|
||||
@@ -163,7 +163,7 @@ const CreatureSchema = TypedSimpleSchema.from({
|
||||
tabletopId: {
|
||||
index: 1,
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
optional: true,
|
||||
},
|
||||
initiativeRoll: {
|
||||
@@ -176,17 +176,14 @@ const CreatureSchema = TypedSimpleSchema.from({
|
||||
type: CreatureSettingsSchema,
|
||||
defaultValue: {},
|
||||
},
|
||||
});
|
||||
|
||||
CreatureSchema.extend(ColorSchema);
|
||||
CreatureSchema.extend(SharingSchema);
|
||||
})
|
||||
.extend(ColorSchema)
|
||||
.extend(SharingSchema);
|
||||
|
||||
export type Creature = Simplify<{ _id: string } & InferType<typeof CreatureSchema>>;
|
||||
|
||||
//set up the collection for creatures
|
||||
const Creatures = new Mongo.Collection<Creature>('creatures');
|
||||
|
||||
//@ts-expect-error attachSchema not defined
|
||||
Creatures.attachSchema(CreatureSchema);
|
||||
|
||||
export default Creatures;
|
||||
|
||||
@@ -11,7 +11,7 @@ const changeAllowedLibraries = new ValidatedMethod({
|
||||
schema: new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
allowedLibraries: {
|
||||
type: Array,
|
||||
@@ -20,7 +20,7 @@ const changeAllowedLibraries = new ValidatedMethod({
|
||||
},
|
||||
'allowedLibraries.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
allowedLibraryCollections: {
|
||||
type: Array,
|
||||
@@ -29,7 +29,7 @@ const changeAllowedLibraries = new ValidatedMethod({
|
||||
},
|
||||
'allowedLibraryCollections.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}),
|
||||
rateLimit: {
|
||||
@@ -58,7 +58,7 @@ const toggleAllUserLibraries = new ValidatedMethod({
|
||||
schema: new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
value: {
|
||||
type: Boolean,
|
||||
|
||||
@@ -21,7 +21,7 @@ const removeCreature = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
charId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -39,7 +39,7 @@ let ExperienceSchema = new SimpleSchema({
|
||||
},
|
||||
creatureId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
index: 1,
|
||||
},
|
||||
});
|
||||
@@ -76,7 +76,7 @@ const insertExperience = new ValidatedMethod({
|
||||
},
|
||||
'creatureIds.$': {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
@@ -105,7 +105,7 @@ const removeExperience = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
experienceId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
@@ -146,7 +146,7 @@ const recomputeExperiences = new ValidatedMethod({
|
||||
validate: new SimpleSchema({
|
||||
creatureId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
},
|
||||
}).validator(),
|
||||
mixins: [RateLimiterMixin],
|
||||
|
||||
@@ -42,7 +42,7 @@ let ExperienceSchema = new SimpleSchema({
|
||||
// ID of the journal this entry belongs to
|
||||
journalId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
index: 1,
|
||||
}
|
||||
});
|
||||
|
||||
@@ -192,7 +192,7 @@ const logRoll = new ValidatedMethod({
|
||||
},
|
||||
creatureId: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
max: 32,
|
||||
optional: true,
|
||||
},
|
||||
}).validator(),
|
||||
|
||||
Reference in New Issue
Block a user