dyo-tools 0.2.0 → 0.3.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.
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/core/DTAction.d.ts +10 -0
- package/dist/core/DTAction.js +24 -0
- package/dist/core/DTAction.js.map +1 -0
- package/dist/core/DTBunch.d.ts +6 -7
- package/dist/core/DTBunch.js +16 -13
- package/dist/core/DTBunch.js.map +1 -1
- package/dist/core/DTComponentPhysical.d.ts +6 -4
- package/dist/core/DTComponentPhysical.js +6 -0
- package/dist/core/DTComponentPhysical.js.map +1 -1
- package/dist/core/DTElement.d.ts +5 -0
- package/dist/core/DTElement.js +12 -2
- package/dist/core/DTElement.js.map +1 -1
- package/dist/core/DTManager.d.ts +3 -1
- package/dist/core/DTManager.js +24 -14
- package/dist/core/DTManager.js.map +1 -1
- package/dist/core/DTMaster.d.ts +24 -0
- package/dist/core/DTMaster.js +133 -0
- package/dist/core/DTMaster.js.map +1 -0
- package/dist/core/DTModule.d.ts +14 -0
- package/dist/core/DTModule.js +39 -0
- package/dist/core/DTModule.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/libs/player/DTPlayer.element.d.ts +5 -0
- package/dist/libs/player/DTPlayer.element.js +11 -0
- package/dist/libs/player/DTPlayer.element.js.map +1 -0
- package/dist/libs/player/DTPlayer.manager.d.ts +11 -0
- package/dist/libs/player/DTPlayer.manager.js +42 -0
- package/dist/libs/player/DTPlayer.manager.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/core.d.ts +103 -0
- package/dist/types/core.js +15 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.d.ts +2 -98
- package/dist/types/index.js +16 -12
- package/dist/types/index.js.map +1 -1
- package/dist/types/player.d.ts +5 -0
- package/dist/types/player.js +3 -0
- package/dist/types/player.js.map +1 -0
- package/docs/assets/highlight.css +29 -29
- package/docs/assets/main.js +59 -58
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -1
- package/docs/assets/style.css +1414 -1367
- package/docs/classes/core_DTAction.DYOToolsAction.html +89 -0
- package/docs/classes/core_DTBunch.DYOToolsBunch.html +254 -0
- package/docs/classes/core_DTComponent.DYOToolsComponent.html +76 -0
- package/docs/classes/core_DTComponentPhysical.DYOToolsComponentPhysical.html +110 -0
- package/docs/classes/core_DTComponentWithMeta.DYOToolsComponentWithMeta.html +96 -0
- package/docs/classes/core_DTElement.DYOToolsElement.html +135 -0
- package/docs/classes/core_DTError.DYOToolsError.html +37 -0
- package/docs/classes/core_DTManager.DYOToolsManager.html +237 -0
- package/docs/classes/core_DTMaster.DYOToolsMaster.html +150 -0
- package/docs/classes/core_DTModule.DYOToolsModule.html +92 -0
- package/docs/classes/libs_DYOFinder.DYOFinder.html +34 -0
- package/docs/classes/libs_player_DTPlayer_element.DYOToolsPlayer.html +134 -0
- package/docs/classes/libs_player_DTPlayer_manager.DYOToolsPlayerManager.html +243 -0
- package/docs/enums/types_core.FilterOperatorType.html +10 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +1 -46
- package/docs/interfaces/types_core.DTBunchFilters.html +6 -0
- package/docs/interfaces/types_core.DTBunchOptions.html +19 -0
- package/docs/interfaces/types_core.DTBunchToObject.html +7 -0
- package/docs/interfaces/types_core.DTComponentOptions.html +5 -0
- package/docs/interfaces/types_core.DTComponentToObject.html +4 -0
- package/docs/interfaces/types_core.DTElementToObject.html +7 -0
- package/docs/interfaces/types_core.DTManagerFilters.html +6 -0
- package/docs/interfaces/types_core.DTManagerOptions.html +8 -0
- package/docs/interfaces/types_core.DTManagerToObject.html +5 -0
- package/docs/interfaces/types_core.DTMasterToObject.html +8 -0
- package/docs/interfaces/types_core.DTModuleToObject.html +6 -0
- package/docs/interfaces/types_core.DYOFinderConfigurationPropDefault.html +4 -0
- package/docs/interfaces/types_core.DYOFinderConfigurationPropObjectSearch.html +4 -0
- package/docs/interfaces/types_core.DYOFinderFilterOperatorAdvanced.html +5 -0
- package/docs/interfaces/types_core.DYOFinderFilterOperatorBase.html +5 -0
- package/docs/interfaces/types_player.DTPlayerManagerSimpleConfiguration.html +3 -0
- package/docs/modules/constants.html +6 -0
- package/docs/modules/core_DTAction.html +2 -0
- package/docs/modules/core_DTBunch.html +2 -0
- package/docs/modules/core_DTComponent.html +2 -0
- package/docs/modules/core_DTComponentPhysical.html +2 -0
- package/docs/modules/core_DTComponentWithMeta.html +2 -0
- package/docs/modules/core_DTElement.html +2 -0
- package/docs/modules/core_DTError.html +2 -0
- package/docs/modules/core_DTManager.html +2 -0
- package/docs/modules/core_DTMaster.html +2 -0
- package/docs/modules/core_DTModule.html +2 -0
- package/docs/modules/libs_DYOFinder.html +2 -0
- package/docs/modules/libs_player_DTPlayer_element.html +2 -0
- package/docs/modules/libs_player_DTPlayer_manager.html +2 -0
- package/docs/modules/types.html +29 -0
- package/docs/modules/types_core.html +28 -0
- package/docs/modules/types_player.html +2 -0
- package/docs/types/types_core.DTAcceptedMetaData.html +2 -0
- package/docs/types/types_core.DTManagerItemType.html +1 -0
- package/docs/types/types_core.DTManagerItemsType.html +2 -0
- package/docs/types/types_core.DYOFinderComponentType.html +1 -0
- package/docs/types/types_core.DYOFinderConfiguration.html +2 -0
- package/docs/types/types_core.DYOFinderConfigurationProp.html +1 -0
- package/docs/types/types_core.DYOFinderFilterOperator.html +1 -0
- package/docs/types/types_core.DYOFinderFilterOperatorArgument.html +1 -0
- package/docs/types/types_core.DYOFinderFilters.html +1 -0
- package/docs/types/types_core.StandardPrimitiveType.html +2 -0
- package/docs/types/types_core.StandardPrimitiveTypeWithArray.html +1 -0
- package/docs/variables/constants.bunchDefaultOptions.html +2 -0
- package/docs/variables/constants.componentBunchDefaultFinderConfiguration.html +1 -0
- package/docs/variables/constants.componentManagerDefaultFinderConfiguration.html +1 -0
- package/docs/variables/constants.componentPhysicalDefaultFinderConfiguration.html +1 -0
- package/docs/variables/constants.managerDefaultOptions.html +2 -0
- package/package.json +16 -17
- package/src/constants.ts +85 -85
- package/src/core/DTAction.ts +52 -0
- package/src/core/DTBunch.ts +467 -461
- package/src/core/DTComponent.ts +225 -225
- package/src/core/DTComponentPhysical.ts +53 -39
- package/src/core/DTComponentWithMeta.ts +65 -65
- package/src/core/DTElement.ts +102 -69
- package/src/core/DTError.ts +78 -78
- package/src/core/DTManager.ts +465 -446
- package/src/core/DTMaster.ts +318 -0
- package/src/core/DTModule.ts +90 -0
- package/src/index.ts +17 -9
- package/src/libs/DYOFinder.ts +175 -175
- package/src/libs/player/DTPlayer.element.ts +9 -0
- package/src/libs/player/DTPlayer.manager.ts +84 -0
- package/src/types/core.ts +169 -0
- package/src/types/index.ts +2 -162
- package/src/types/player.ts +6 -0
- package/test/core/DTAction.double.ts +78 -0
- package/test/core/DTAction.spec.ts +76 -0
- package/test/core/DTBunch.double.ts +18 -10
- package/test/core/DTBunch.spec.ts +70 -68
- package/test/core/DTComponentPhysical.double.ts +3 -3
- package/test/core/DTComponentPhysical.spec.ts +25 -11
- package/test/core/DTElement.double.ts +21 -5
- package/test/core/DTElement.spec.ts +52 -8
- package/test/core/DTError.double.ts +1 -1
- package/test/core/DTManager.double.ts +29 -5
- package/test/core/DTManager.spec.ts +80 -17
- package/test/core/DTMaster.double.ts +141 -0
- package/test/core/DTMaster.spec.ts +584 -0
- package/test/core/DTModule.double.ts +80 -0
- package/test/core/DTModule.spec.ts +138 -0
- package/test/core/copy.spec.ts +20 -4
- package/test/{core/DTPlayer.double.ts → libs/player/DTPlayer.element.double.ts} +15 -24
- package/test/libs/player/DTPlayer.element.spec.ts +28 -0
- package/test/libs/player/DTPlayer.manager.double.ts +92 -0
- package/test/libs/player/DTPlayer.manager.spec.ts +178 -0
- package/LICENSE +0 -21
- package/cucumber.js +0 -9
- package/dist/core/DTPlayer.d.ts +0 -8
- package/dist/core/DTPlayer.js +0 -30
- package/dist/core/DTPlayer.js.map +0 -1
- package/e2e/0.2.0/epic1.feature +0 -29
- package/e2e/0.2.0/epic2.feature +0 -22
- package/e2e/0.2.0/epic3.feature +0 -25
- package/e2e/0.2.0/resources/dominion.js +0 -195
- package/e2e/0.2.0/resources/utils.js +0 -27
- package/e2e/0.2.0/support/steps.js +0 -108
- package/e2e/future/epic4.feature +0 -39
- package/e2e/future/resources/dominion.js +0 -238
- package/e2e/future/resources/utils.js +0 -27
- package/src/core/DTPlayer.ts +0 -57
- package/test/core/DTPlayer.spec.ts +0 -80
package/src/core/DTElement.ts
CHANGED
|
@@ -1,69 +1,102 @@
|
|
|
1
|
-
import { DTAcceptedMetaData, DTElementToObject } from '../types';
|
|
2
|
-
import DYOToolsComponentPhysical from './DTComponentPhysical';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
1
|
+
import { DTAcceptedMetaData, DTElementToObject } from '../types';
|
|
2
|
+
import DYOToolsComponentPhysical from './DTComponentPhysical';
|
|
3
|
+
import DYOToolsBunch from './DTBunch';
|
|
4
|
+
|
|
5
|
+
export default class DYOToolsElement<
|
|
6
|
+
IComponentMeta extends DTAcceptedMetaData,
|
|
7
|
+
> extends DYOToolsComponentPhysical<IComponentMeta> {
|
|
8
|
+
/**
|
|
9
|
+
* Defining component type to "element".
|
|
10
|
+
*/
|
|
11
|
+
protected _componentType = 'element';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Component current **Container**.
|
|
15
|
+
*
|
|
16
|
+
* A container is a parent component which "contains" the current instance.
|
|
17
|
+
* **Context** and **container** are different components, with different purpose.
|
|
18
|
+
* For DYOToolsElement instances, a container is a DYOToolsBunch instance.
|
|
19
|
+
* @protected
|
|
20
|
+
*/
|
|
21
|
+
protected _container: DYOToolsBunch;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Getter for _container property.
|
|
25
|
+
*/
|
|
26
|
+
getContainer(): DYOToolsBunch | undefined {
|
|
27
|
+
return this._container;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Setter for _container property.
|
|
32
|
+
*/
|
|
33
|
+
setContainer(container: DYOToolsBunch): void {
|
|
34
|
+
this._container = container;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Remove the current container of Element instance.
|
|
39
|
+
*/
|
|
40
|
+
removeContainer(): void {
|
|
41
|
+
this._container = undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create and return a new DTElement instance by applying from current instance :
|
|
46
|
+
* - Copy _key property
|
|
47
|
+
* - Copy _meta property
|
|
48
|
+
*
|
|
49
|
+
* @returns New DTElement instance copied.
|
|
50
|
+
*/
|
|
51
|
+
copy(): DYOToolsElement<IComponentMeta> {
|
|
52
|
+
const copyElement = new DYOToolsElement<IComponentMeta>(this._key, this._options);
|
|
53
|
+
copyElement.setManyMeta({ ...this.getManyMeta() });
|
|
54
|
+
|
|
55
|
+
return copyElement;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Return JSON Object representation of the Element instance.
|
|
60
|
+
*
|
|
61
|
+
* JSON Object returned has the following structure :
|
|
62
|
+
* * **id** : _id property of the Element.
|
|
63
|
+
* * **key** : _key property of the Element.
|
|
64
|
+
* * **type** : _componentType property of the Element.
|
|
65
|
+
* * **owner** : String representation of the current _owner property of the Element (only if defined).
|
|
66
|
+
* * **meta** : JSON Object of all current metadata in _meta property of the Element (only if not empty).
|
|
67
|
+
*
|
|
68
|
+
* @returns JSON Object representation of the Element.
|
|
69
|
+
*/
|
|
70
|
+
toObject(): DTElementToObject<IComponentMeta> {
|
|
71
|
+
const objectElement: DTElementToObject<IComponentMeta> = {
|
|
72
|
+
id: this._id,
|
|
73
|
+
key: this._key,
|
|
74
|
+
type: this._componentType,
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
if (this._owner) {
|
|
78
|
+
objectElement.owner = this._owner.toString();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (this._meta && Object.keys(this._meta).length > 0) {
|
|
82
|
+
objectElement.meta = { ...this.getManyMeta() };
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return objectElement;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Return String representation of the Element instance.
|
|
90
|
+
*
|
|
91
|
+
* @returns String representation of the Element.
|
|
92
|
+
*/
|
|
93
|
+
toString(): string {
|
|
94
|
+
let ownerKey = '';
|
|
95
|
+
if (this._owner) {
|
|
96
|
+
ownerKey = ` - Owner: ${this._owner}`;
|
|
97
|
+
}
|
|
98
|
+
const domainLabel = this._domain ? ` ${this._domain}` : '';
|
|
99
|
+
|
|
100
|
+
return `Component${domainLabel} ${this._key} - Type: Element${ownerKey}`;
|
|
101
|
+
}
|
|
102
|
+
}
|
package/src/core/DTError.ts
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import DYOToolsComponent from './DTComponent';
|
|
2
|
-
|
|
3
|
-
export default class DYOToolsError extends Error {
|
|
4
|
-
/**
|
|
5
|
-
* Error code.
|
|
6
|
-
*
|
|
7
|
-
* Available error codes are :
|
|
8
|
-
* * **id_conflict** : _id property conflict between two DTComponent in the same context.
|
|
9
|
-
* * **key_conflict** : _key property conflict between two DTComponent in the same context.
|
|
10
|
-
*/
|
|
11
|
-
protected code: string;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Error trigger date.
|
|
15
|
-
*/
|
|
16
|
-
protected timestamp: Date;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* DTComponent which trigger the error during its current execution process.
|
|
20
|
-
*/
|
|
21
|
-
protected initiator?: DYOToolsComponent;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* DTComponent which is directly involved in the error trigger.
|
|
25
|
-
*/
|
|
26
|
-
protected convicted?: DYOToolsComponent;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Set all property for a new DTError.
|
|
30
|
-
*
|
|
31
|
-
* @param code
|
|
32
|
-
* @param message
|
|
33
|
-
* @param initiator
|
|
34
|
-
* @param convicted
|
|
35
|
-
*/
|
|
36
|
-
constructor(code: string, message: string, initiator?: DYOToolsComponent, convicted?: DYOToolsComponent) {
|
|
37
|
-
super(message);
|
|
38
|
-
this.code = code;
|
|
39
|
-
this.timestamp = new Date();
|
|
40
|
-
this.initiator = initiator;
|
|
41
|
-
this.convicted = convicted;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Getter for code property.
|
|
46
|
-
*/
|
|
47
|
-
getCode(): string {
|
|
48
|
-
return this.code;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Getter for message property (inherited from Error).
|
|
53
|
-
*/
|
|
54
|
-
getMessage(): string {
|
|
55
|
-
return this.message;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Getter for timestamp property.
|
|
60
|
-
*/
|
|
61
|
-
getTimestamp(): Date {
|
|
62
|
-
return this.timestamp;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Getter for initiator property.
|
|
67
|
-
*/
|
|
68
|
-
getInitiator(): DYOToolsComponent {
|
|
69
|
-
return this.initiator;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Getter for convicted property.
|
|
74
|
-
*/
|
|
75
|
-
getConvicted(): DYOToolsComponent {
|
|
76
|
-
return this.convicted;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
1
|
+
import DYOToolsComponent from './DTComponent';
|
|
2
|
+
|
|
3
|
+
export default class DYOToolsError extends Error {
|
|
4
|
+
/**
|
|
5
|
+
* Error code.
|
|
6
|
+
*
|
|
7
|
+
* Available error codes are :
|
|
8
|
+
* * **id_conflict** : _id property conflict between two DTComponent in the same context.
|
|
9
|
+
* * **key_conflict** : _key property conflict between two DTComponent in the same context.
|
|
10
|
+
*/
|
|
11
|
+
protected code: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Error trigger date.
|
|
15
|
+
*/
|
|
16
|
+
protected timestamp: Date;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* DTComponent which trigger the error during its current execution process.
|
|
20
|
+
*/
|
|
21
|
+
protected initiator?: DYOToolsComponent;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* DTComponent which is directly involved in the error trigger.
|
|
25
|
+
*/
|
|
26
|
+
protected convicted?: DYOToolsComponent;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Set all property for a new DTError.
|
|
30
|
+
*
|
|
31
|
+
* @param code
|
|
32
|
+
* @param message
|
|
33
|
+
* @param initiator
|
|
34
|
+
* @param convicted
|
|
35
|
+
*/
|
|
36
|
+
constructor(code: string, message: string, initiator?: DYOToolsComponent, convicted?: DYOToolsComponent) {
|
|
37
|
+
super(message);
|
|
38
|
+
this.code = code;
|
|
39
|
+
this.timestamp = new Date();
|
|
40
|
+
this.initiator = initiator;
|
|
41
|
+
this.convicted = convicted;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Getter for code property.
|
|
46
|
+
*/
|
|
47
|
+
getCode(): string {
|
|
48
|
+
return this.code;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Getter for message property (inherited from Error).
|
|
53
|
+
*/
|
|
54
|
+
getMessage(): string {
|
|
55
|
+
return this.message;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Getter for timestamp property.
|
|
60
|
+
*/
|
|
61
|
+
getTimestamp(): Date {
|
|
62
|
+
return this.timestamp;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Getter for initiator property.
|
|
67
|
+
*/
|
|
68
|
+
getInitiator(): DYOToolsComponent {
|
|
69
|
+
return this.initiator;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Getter for convicted property.
|
|
74
|
+
*/
|
|
75
|
+
getConvicted(): DYOToolsComponent {
|
|
76
|
+
return this.convicted;
|
|
77
|
+
}
|
|
78
|
+
}
|