@reldens/skills 0.43.0 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CLAUDE.md +488 -0
  2. package/README.md +322 -10
  3. package/lib/server.js +1 -24
  4. package/lib/skill.js +4 -4
  5. package/package.json +3 -4
  6. package/lib/server/data-server-validator.js +0 -29
  7. package/lib/server/storage/class-path-generator.js +0 -48
  8. package/lib/server/storage/conditions-generator.js +0 -29
  9. package/lib/server/storage/levels-generator.js +0 -41
  10. package/lib/server/storage/models/mikro-orm/class-path-level-labels-model.js +0 -86
  11. package/lib/server/storage/models/mikro-orm/class-path-level-skills-model.js +0 -98
  12. package/lib/server/storage/models/mikro-orm/class-path-model.js +0 -105
  13. package/lib/server/storage/models/mikro-orm/level-model.js +0 -88
  14. package/lib/server/storage/models/mikro-orm/level-modifiers-model.js +0 -119
  15. package/lib/server/storage/models/mikro-orm/levels-set-model.js +0 -79
  16. package/lib/server/storage/models/mikro-orm/owners-class-path-model.js +0 -79
  17. package/lib/server/storage/models/mikro-orm/registered-models-mikro-orm.js +0 -39
  18. package/lib/server/storage/models/mikro-orm/skill-attack-model.js +0 -156
  19. package/lib/server/storage/models/mikro-orm/skill-group-relation-model.js +0 -82
  20. package/lib/server/storage/models/mikro-orm/skill-model.js +0 -236
  21. package/lib/server/storage/models/mikro-orm/skill-owner-conditions-model.js +0 -83
  22. package/lib/server/storage/models/mikro-orm/skill-owner-effects-model.js +0 -119
  23. package/lib/server/storage/models/mikro-orm/skill-physical-data-model.js +0 -83
  24. package/lib/server/storage/models/mikro-orm/skill-target-effects-model.js +0 -125
  25. package/lib/server/storage/models/mikro-orm/skills-groups-model.js +0 -77
  26. package/lib/server/storage/models/objection-js/class-path-level-labels-model.js +0 -44
  27. package/lib/server/storage/models/objection-js/class-path-level-skills-model.js +0 -53
  28. package/lib/server/storage/models/objection-js/class-path-model.js +0 -85
  29. package/lib/server/storage/models/objection-js/level-model.js +0 -44
  30. package/lib/server/storage/models/objection-js/level-modifiers-model.js +0 -35
  31. package/lib/server/storage/models/objection-js/levels-set-model.js +0 -44
  32. package/lib/server/storage/models/objection-js/owners-class-path-model.js +0 -35
  33. package/lib/server/storage/models/objection-js/registered-models-objection-js.js +0 -39
  34. package/lib/server/storage/models/objection-js/skill-attack-model.js +0 -35
  35. package/lib/server/storage/models/objection-js/skill-group-relation-model.js +0 -44
  36. package/lib/server/storage/models/objection-js/skill-model.js +0 -89
  37. package/lib/server/storage/models/objection-js/skill-owner-conditions-model.js +0 -35
  38. package/lib/server/storage/models/objection-js/skill-owner-effects-model.js +0 -35
  39. package/lib/server/storage/models/objection-js/skill-physical-data-model.js +0 -35
  40. package/lib/server/storage/models/objection-js/skill-target-effects-model.js +0 -35
  41. package/lib/server/storage/models/objection-js/skills-groups-model.js +0 -35
  42. package/lib/server/storage/models-manager.js +0 -111
  43. package/lib/server/storage/modifiers-generator.js +0 -28
  44. package/lib/server/storage/skills-generator.js +0 -102
  45. package/lib/server/storage-observer.js +0 -89
@@ -1,83 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - SkillPhysicalDataModel
4
- *
5
- */
6
-
7
- const { MikroOrmCore } = require('@reldens/storage');
8
- const { EntitySchema } = MikroOrmCore;
9
-
10
- class SkillPhysicalDataModel
11
- {
12
-
13
- beforeDestroyCalled = 0;
14
- afterDestroyCalled = 0;
15
-
16
- constructor(skill_id, magnitude, objectWidth, objectHeight, validateTargetOnHit)
17
- {
18
- this.skill_id = skill_id;
19
- this.magnitude = magnitude;
20
- this.objectWidth = objectWidth;
21
- this.objectHeight = objectHeight;
22
- this.validateTargetOnHit = validateTargetOnHit;
23
- }
24
-
25
- static createByProps(props)
26
- {
27
- const {skill_id, magnitude, objectWidth, objectHeight, validateTargetOnHit} = props;
28
- return new this(skill_id, magnitude, objectWidth, objectHeight, validateTargetOnHit);
29
- }
30
-
31
- static relationMappings()
32
- {
33
- return {
34
- parent_skill: {
35
- type: 'SkillModel',
36
- entityName: 'skill',
37
- reference: 'm:1',
38
- join: {
39
- from: 'skill_id',
40
- to: 'id'
41
- }
42
- }
43
- };
44
- }
45
-
46
- }
47
-
48
- const schema = new EntitySchema({
49
- class: SkillPhysicalDataModel,
50
- properties: {
51
- _id: {
52
- primary: true,
53
- type: 'ObjectID'
54
- },
55
- id: {
56
- type: 'string',
57
- serializedPrimaryKey: true
58
- },
59
- skill_id: {
60
- type: 'SkillModel',
61
- reference: 'm:1',
62
- nullable: true
63
- },
64
- magnitude: {
65
- type: 'number'
66
- },
67
- objectWidth: {
68
- type: 'number'
69
- },
70
- objectHeight: {
71
- type: 'number'
72
- },
73
- validateTargetOnHit: {
74
- type: 'boolean'
75
- }
76
- }
77
- });
78
-
79
- module.exports = {
80
- SkillPhysicalDataModel,
81
- entity: SkillPhysicalDataModel,
82
- schema
83
- };
@@ -1,125 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - SkillEffectModel
4
- *
5
- */
6
-
7
- const { MikroOrmCore } = require('@reldens/storage');
8
- const { EntitySchema } = MikroOrmCore;
9
-
10
- class SkillTargetEffectsModel
11
- {
12
-
13
- beforeDestroyCalled = 0;
14
- afterDestroyCalled = 0;
15
-
16
- constructor(magnitude, skill_id, key, property_key, operation, value, minValue, maxValue, minProperty, maxProperty)
17
- {
18
- this.magnitude = magnitude;
19
- this.skill_id = skill_id;
20
- this.key = key;
21
- this.property_key = property_key;
22
- this.operation = operation;
23
- this.value = value;
24
- this.minValue = minValue;
25
- this.maxValue = maxValue;
26
- this.minProperty = minProperty;
27
- this.maxProperty = maxProperty;
28
- }
29
-
30
- static createByProps(props)
31
- {
32
- const {
33
- magnitude,
34
- skill_id,
35
- key,
36
- property_key,
37
- operation,
38
- value,
39
- minValue,
40
- maxValue,
41
- minProperty,
42
- maxProperty
43
- } = props;
44
- return new this(
45
- magnitude,
46
- skill_id,
47
- key,
48
- property_key,
49
- operation,
50
- value,
51
- minValue,
52
- maxValue,
53
- minProperty,
54
- maxProperty
55
- );
56
- }
57
-
58
- static relationMappings()
59
- {
60
- return {
61
- skill_id: {
62
- type: 'SkillModel',
63
- entityName: 'skill',
64
- reference: 'm:1',
65
- join: {
66
- from: 'skill_id',
67
- to: 'id'
68
- }
69
- }
70
- };
71
- }
72
-
73
- }
74
-
75
- const schema = new EntitySchema({
76
- class: SkillTargetEffectsModel,
77
- properties: {
78
- _id: {
79
- primary: true,
80
- type: 'ObjectID'
81
- },
82
- id: {
83
- type: 'string',
84
- serializedPrimaryKey: true
85
- },
86
- magnitude: {
87
- type: 'number'
88
- },
89
- skill_id: {
90
- type: 'SkillModel',
91
- reference: 'm:1',
92
- nullable: true
93
- },
94
- key: {
95
- type: 'string'
96
- },
97
- property_key: {
98
- type: 'string'
99
- },
100
- operation: {
101
- type: 'string'
102
- },
103
- value: {
104
- type: 'string'
105
- },
106
- minValue: {
107
- type: 'string'
108
- },
109
- maxValue: {
110
- type: 'string'
111
- },
112
- minProperty: {
113
- type: 'string'
114
- },
115
- maxProperty: {
116
- type: 'string'
117
- }
118
- }
119
- });
120
-
121
- module.exports = {
122
- SkillTargetEffectsModel,
123
- entity: SkillTargetEffectsModel,
124
- schema
125
- };
@@ -1,77 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - SkillsGroupsModel
4
- *
5
- */
6
-
7
- const { MikroOrmCore } = require('@reldens/storage');
8
- const { EntitySchema } = MikroOrmCore;
9
-
10
- class SkillsGroupsModel
11
- {
12
-
13
- beforeDestroyCalled = 0;
14
- afterDestroyCalled = 0;
15
-
16
- constructor(key, label, description, sort)
17
- {
18
- this.key = key;
19
- this.label = label;
20
- this.description = description;
21
- this.sort = sort;
22
- }
23
-
24
- static createByProps(props)
25
- {
26
- const {key, label, description, sort} = props;
27
- return new this(key, label, description, sort);
28
- }
29
-
30
- static relationMappings()
31
- {
32
- return {
33
- group_id: {
34
- type: 'SkillGroupRelationModel',
35
- entityName: 'skillGroupRelation',
36
- reference: 'm:1',
37
- join: {
38
- from: 'group_id',
39
- to: 'id'
40
- }
41
- }
42
- };
43
- }
44
-
45
- }
46
-
47
- const schema = new EntitySchema({
48
- class: SkillsGroupsModel,
49
- properties: {
50
- _id: {
51
- primary: true,
52
- type: 'ObjectID'
53
- },
54
- id: {
55
- type: 'string',
56
- serializedPrimaryKey: true
57
- },
58
- key: {
59
- type: 'string'
60
- },
61
- label: {
62
- type: 'string'
63
- },
64
- description: {
65
- type: 'string'
66
- },
67
- sort: {
68
- type: 'number'
69
- }
70
- }
71
- });
72
-
73
- module.exports = {
74
- SkillsGroupsModel,
75
- entity: SkillsGroupsModel,
76
- schema
77
- };
@@ -1,44 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - ClassPathLevelLabelsModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class ClassPathLevelLabelsModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'class_path_level_labels';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { ClassPathModel } = require('./class-path-model');
21
- const { LevelModel } = require('./level-model');
22
- return {
23
- class_path: {
24
- relation: this.BelongsToOneRelation,
25
- modelClass: ClassPathModel,
26
- join: {
27
- from: this.tableName+'.class_path_id',
28
- to: ClassPathModel.tableName+'.id'
29
- }
30
- },
31
- label_level: {
32
- relation: this.BelongsToOneRelation,
33
- modelClass: LevelModel,
34
- join: {
35
- from: this.tableName+'.level_id',
36
- to: LevelModel.tableName+'.id'
37
- }
38
- }
39
- };
40
- }
41
-
42
- }
43
-
44
- module.exports.ClassPathLevelLabelsModel = ClassPathLevelLabelsModel;
@@ -1,53 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - ClassPathLevelSkillsModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class ClassPathLevelSkillsModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'class_path_level_skills';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { ClassPathModel } = require('./class-path-model');
21
- const { LevelModel } = require('./level-model');
22
- const { SkillModel } = require('./skill-model');
23
- return {
24
- class_path: {
25
- relation: this.BelongsToOneRelation,
26
- modelClass: ClassPathModel,
27
- join: {
28
- from: this.tableName+'.class_path_id',
29
- to: ClassPathModel.tableName+'.id'
30
- }
31
- },
32
- class_path_level: {
33
- relation: this.BelongsToOneRelation,
34
- modelClass: LevelModel,
35
- join: {
36
- from: this.tableName+'.level_id',
37
- to: LevelModel.tableName+'.id'
38
- }
39
- },
40
- class_path_level_skill: {
41
- relation: this.BelongsToOneRelation,
42
- modelClass: SkillModel,
43
- join: {
44
- from: this.tableName+'.skill_id',
45
- to: SkillModel.tableName+'.id'
46
- }
47
- },
48
- };
49
- }
50
-
51
- }
52
-
53
- module.exports.ClassPathLevelSkillsModel = ClassPathLevelSkillsModel;
@@ -1,85 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - ClassPathModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class ClassPathModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'class_path';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { LevelsSetModel } = require('./levels-set-model');
21
- const { ClassPathLevelLabelsModel } = require('./class-path-level-labels-model');
22
- const { ClassPathLevelSkillsModel } = require('./class-path-level-skills-model');
23
- const { OwnersClassPathModel } = require('./owners-class-path-model');
24
- return {
25
- skills_levels_set: {
26
- relation: this.HasOneRelation,
27
- modelClass: LevelsSetModel,
28
- join: {
29
- from: this.tableName+'.levels_set_id',
30
- to: LevelsSetModel.tableName+'.id'
31
- }
32
- },
33
- skills_class_path_level_labels: {
34
- relation: this.HasManyRelation,
35
- modelClass: ClassPathLevelLabelsModel,
36
- join: {
37
- from: this.tableName+'.id',
38
- to: ClassPathLevelLabelsModel.tableName+'.class_path_id'
39
- }
40
- },
41
- skills_class_path_level_skills: {
42
- relation: this.HasManyRelation,
43
- modelClass: ClassPathLevelSkillsModel,
44
- join: {
45
- from: this.tableName+'.id',
46
- to: ClassPathLevelSkillsModel.tableName+'.class_path_id'
47
- }
48
- },
49
- class_path_for_owner: {
50
- relation: this.BelongsToOneRelation,
51
- modelClass: OwnersClassPathModel,
52
- join: {
53
- from: this.tableName+'.id',
54
- to: OwnersClassPathModel.tableName+'.class_path_id'
55
- }
56
- }
57
- };
58
- }
59
-
60
- static fullPathData()
61
- {
62
- return this.query()
63
- .withGraphFetched('['
64
- +'skills_levels_set.skills_levels_set_levels.[level_modifiers],'
65
- +'skills_class_path_level_labels.[label_level],'
66
- +'skills_class_path_level_skills.['
67
- +'class_path_level_skill(orderByKey).['
68
- +'skill_attack,'
69
- +'skill_physical_data,'
70
- +'skill_owner_conditions,'
71
- +'skill_owner_effects,'
72
- +'skill_target_effects'
73
- +'],' +
74
- 'class_path_level]'
75
- +']')
76
- .modifiers({
77
- orderByKey(builder){
78
- builder.orderBy('key');
79
- }
80
- });
81
- }
82
-
83
- }
84
-
85
- module.exports.ClassPathModel = ClassPathModel;
@@ -1,44 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - LevelModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class LevelModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'levels';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { LevelsSetModel } = require('./levels-set-model');
21
- const { LevelModifiersModel } = require('./level-modifiers-model');
22
- return {
23
- level_set: {
24
- relation: this.BelongsToOneRelation,
25
- modelClass: LevelsSetModel,
26
- join: {
27
- from: this.tableName+'.level_set_id',
28
- to: LevelsSetModel.tableName+'.id'
29
- }
30
- },
31
- level_modifiers: {
32
- relation: this.HasManyRelation,
33
- modelClass: LevelModifiersModel,
34
- join: {
35
- from: this.tableName+'.id',
36
- to: LevelModifiersModel.tableName+'.level_id'
37
- }
38
- },
39
- };
40
- }
41
-
42
- }
43
-
44
- module.exports.LevelModel = LevelModel;
@@ -1,35 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - LevelModifiersModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class LevelModifiersModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'levels_modifiers';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { LevelModel } = require('./level-model');
21
- return {
22
- level_owner: {
23
- relation: this.BelongsToOneRelation,
24
- modelClass: LevelModel,
25
- join: {
26
- from: this.tableName+'.level_id',
27
- to: LevelModel.tableName+'.id'
28
- }
29
- }
30
- };
31
- }
32
-
33
- }
34
-
35
- module.exports.LevelModifiersModel = LevelModifiersModel;
@@ -1,44 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - LevelsSetModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class LevelsSetModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'levels_set';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { ClassPathModel } = require('./class-path-model');
21
- const { LevelModel } = require('./level-model');
22
- return {
23
- class_path: {
24
- relation: this.BelongsToOneRelation,
25
- modelClass: ClassPathModel,
26
- join: {
27
- from: this.tableName+'.id',
28
- to: ClassPathModel.tableName+'.levels_set_id'
29
- }
30
- },
31
- skills_levels_set_levels: {
32
- relation: this.HasManyRelation,
33
- modelClass: LevelModel,
34
- join: {
35
- from: this.tableName+'.id',
36
- to: LevelModel.tableName+'.level_set_id'
37
- }
38
- }
39
- };
40
- }
41
-
42
- }
43
-
44
- module.exports.LevelsSetModel = LevelsSetModel;
@@ -1,35 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - OwnersClassPathModel
4
- *
5
- */
6
-
7
- const { ObjectionJsRawModel } = require('@reldens/storage');
8
- const SkillsConst = require('../../../../constants');
9
-
10
- class OwnersClassPathModel extends ObjectionJsRawModel
11
- {
12
-
13
- static get tableName()
14
- {
15
- return SkillsConst.MODELS_PREFIX+'owners_class_path';
16
- }
17
-
18
- static get relationMappings()
19
- {
20
- const { ClassPathModel } = require('./class-path-model');
21
- return {
22
- owner_full_class_path: {
23
- relation: this.HasOneRelation,
24
- modelClass: ClassPathModel,
25
- join: {
26
- from: this.tableName+'.class_path_id',
27
- to: ClassPathModel.tableName+'.id'
28
- }
29
- }
30
- };
31
- }
32
-
33
- }
34
-
35
- module.exports.OwnersClassPathModel = OwnersClassPathModel;
@@ -1,39 +0,0 @@
1
- /**
2
- *
3
- * Reldens - Skills - Registered Entities
4
- *
5
- */
6
-
7
- const { ClassPathModel } = require('./class-path-model');
8
- const { ClassPathLevelLabelsModel } = require('./class-path-level-labels-model');
9
- const { ClassPathLevelSkillsModel } = require('./class-path-level-skills-model');
10
- const { LevelModel } = require('./level-model');
11
- const { LevelModifiersModel } = require('./level-modifiers-model');
12
- const { LevelsSetModel } = require('./levels-set-model');
13
- const { OwnersClassPathModel } = require('./owners-class-path-model');
14
- const { SkillModel } = require('./skill-model');
15
- const { SkillAttackModel } = require('./skill-attack-model');
16
- const { SkillTargetEffectsModel } = require('./skill-target-effects-model');
17
- const { SkillPhysicalDataModel } = require('./skill-physical-data-model');
18
- const { SkillGroupRelationModel } = require('./skill-group-relation-model');
19
- const { SkillOwnerConditionsModel } = require('./skill-owner-conditions-model');
20
- const { SkillOwnerEffectsModel } = require('./skill-owner-effects-model');
21
- const { SkillsGroupsModel } = require('./skills-groups-model');
22
-
23
- module.exports.rawRegisteredEntities = {
24
- classPath: ClassPathModel,
25
- classPathLevelLabels: ClassPathLevelLabelsModel,
26
- classPathLevelSkills: ClassPathLevelSkillsModel,
27
- level: LevelModel,
28
- levelModifiers: LevelModifiersModel,
29
- levelsSet: LevelsSetModel,
30
- ownersClassPath: OwnersClassPathModel,
31
- skill: SkillModel,
32
- skillAttack: SkillAttackModel,
33
- skillTargetEffects: SkillTargetEffectsModel,
34
- skillPhysicalData: SkillPhysicalDataModel,
35
- skillGroupRelation: SkillGroupRelationModel,
36
- skillOwnerConditions: SkillOwnerConditionsModel,
37
- skillOwnerEffects: SkillOwnerEffectsModel,
38
- skillGroups: SkillsGroupsModel
39
- };