dyo-tools 0.1.0 → 0.2.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/.c8rc.json +4 -0
- package/.eslintignore +2 -0
- package/.eslintrc.json +47 -0
- package/LICENSE +21 -0
- package/Makefile +34 -0
- package/README.md +0 -7
- package/babel.config.js +1 -0
- package/cucumber-report.html +48 -0
- package/cucumber.js +9 -0
- package/dist/constants.d.ts +6 -0
- package/dist/constants.js +63 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/DTBunch.d.ts +11 -15
- package/dist/core/DTBunch.js +27 -106
- package/dist/core/DTBunch.js.map +1 -1
- package/dist/core/DTComponent.d.ts +13 -5
- package/dist/core/DTComponent.js +39 -1
- package/dist/core/DTComponent.js.map +1 -1
- package/dist/core/DTComponentPhysical.d.ts +10 -0
- package/dist/core/DTComponentPhysical.js +16 -0
- package/dist/core/DTComponentPhysical.js.map +1 -0
- package/dist/core/DTComponentWithMeta.d.ts +2 -2
- package/dist/core/DTComponentWithMeta.js.map +1 -1
- package/dist/core/DTElement.d.ts +2 -7
- package/dist/core/DTElement.js +3 -12
- package/dist/core/DTElement.js.map +1 -1
- package/dist/core/DTManager.d.ts +31 -0
- package/dist/core/DTManager.js +180 -0
- package/dist/core/DTManager.js.map +1 -0
- package/dist/core/DTPlayer.js +1 -1
- package/dist/core/DTPlayer.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/libs/DYOFinder.d.ts +10 -0
- package/dist/libs/DYOFinder.js +96 -0
- package/dist/libs/DYOFinder.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1321
- package/dist/types/index.d.ts +64 -24
- package/dist/types/index.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +29 -0
- package/docs/assets/main.js +58 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1367 -0
- package/docs/index.html +46 -0
- package/e2e/0.2.0/epic1.feature +29 -0
- package/e2e/0.2.0/epic2.feature +22 -0
- package/e2e/0.2.0/epic3.feature +25 -0
- package/e2e/0.2.0/resources/dominion.js +195 -0
- package/e2e/0.2.0/resources/utils.js +27 -0
- package/e2e/0.2.0/support/steps.js +108 -0
- package/e2e/future/epic4.feature +39 -0
- package/e2e/future/resources/dominion.js +238 -0
- package/e2e/future/resources/utils.js +27 -0
- package/jest.config.js +6 -0
- package/package.json +33 -23
- package/src/constants.ts +85 -0
- package/src/core/DTBunch.ts +461 -0
- package/src/core/DTComponent.ts +225 -0
- package/src/core/DTComponentPhysical.ts +39 -0
- package/src/core/DTComponentWithMeta.ts +65 -0
- package/src/core/DTElement.ts +69 -0
- package/src/core/DTError.ts +78 -0
- package/src/core/DTManager.ts +446 -0
- package/src/core/DTPlayer.ts +57 -0
- package/src/index.ts +9 -0
- package/src/libs/DYOFinder.ts +175 -0
- package/src/types/index.ts +162 -0
- package/test/core/DTBunch.double.ts +253 -0
- package/test/core/DTBunch.spec.ts +895 -0
- package/test/core/DTComponent.double.ts +164 -0
- package/test/core/DTComponent.spec.ts +295 -0
- package/test/core/DTComponentPhysical.double.ts +76 -0
- package/test/core/DTComponentPhysical.spec.ts +64 -0
- package/test/core/DTComponentWithMeta.double.ts +115 -0
- package/test/core/DTComponentWithMeta.spec.ts +124 -0
- package/test/core/DTElement.double.ts +147 -0
- package/test/core/DTElement.spec.ts +102 -0
- package/test/core/DTError.double.ts +92 -0
- package/test/core/DTError.spec.ts +89 -0
- package/test/core/DTManager.double.ts +192 -0
- package/test/core/DTManager.spec.ts +902 -0
- package/test/core/DTPlayer.double.ts +64 -0
- package/test/core/DTPlayer.spec.ts +80 -0
- package/test/core/copy.spec.ts +227 -0
- package/test/libs/DYOFinder.double.ts +152 -0
- package/test/libs/DYOFinder.spec.ts +194 -0
- package/tsconfig.dev.json +22 -0
- package/tsconfig.json +21 -0
- package/dist/utils/filters.d.ts +0 -6
- package/dist/utils/filters.js +0 -39
- package/dist/utils/filters.js.map +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
const {DTElement, DTManager, DTBunch, DTPlayer} = require("../../../dist/src");
|
|
2
|
+
|
|
3
|
+
/****************** CARDS REFERENCE ************************/
|
|
4
|
+
const cards = {
|
|
5
|
+
"COPPER": {
|
|
6
|
+
meta: {
|
|
7
|
+
type: 'treasure',
|
|
8
|
+
cost: 0,
|
|
9
|
+
treasurePoints: 1
|
|
10
|
+
},
|
|
11
|
+
events: {
|
|
12
|
+
play: (ctx) => {
|
|
13
|
+
ctx.getOwner.setMeta('coin', 1);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"SILVER": {
|
|
18
|
+
meta: {
|
|
19
|
+
type: 'treasure',
|
|
20
|
+
cost: 3,
|
|
21
|
+
treasurePoints: 2
|
|
22
|
+
},
|
|
23
|
+
events: {
|
|
24
|
+
play: (ctx) => {
|
|
25
|
+
ctx.getOwner.setMeta('coin', 2);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"GOLD": {
|
|
30
|
+
meta: {
|
|
31
|
+
type: 'treasure',
|
|
32
|
+
cost: 6,
|
|
33
|
+
treasurePoints: 3
|
|
34
|
+
},
|
|
35
|
+
events: {
|
|
36
|
+
play: (ctx) => {
|
|
37
|
+
ctx.getOwner.setMeta('coin', 3);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"ESTATE": {
|
|
42
|
+
meta: {
|
|
43
|
+
type: 'victory',
|
|
44
|
+
cost: 2,
|
|
45
|
+
victoryPoints: 1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"DUCHY": {
|
|
49
|
+
meta: {
|
|
50
|
+
type: 'victory',
|
|
51
|
+
cost: 5,
|
|
52
|
+
treasurePoints: 3
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"PROVINCE": {
|
|
56
|
+
meta: {
|
|
57
|
+
type: 'victory',
|
|
58
|
+
cost: 8,
|
|
59
|
+
treasurePoints: 6
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"SMITHY": {
|
|
63
|
+
meta: {
|
|
64
|
+
type: 'action',
|
|
65
|
+
cost: 4,
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"WORKSHOP": {
|
|
69
|
+
meta: {
|
|
70
|
+
type: 'action',
|
|
71
|
+
cost: 3,
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"MILITIA": {
|
|
75
|
+
meta: {
|
|
76
|
+
type: 'action',
|
|
77
|
+
cost: 4,
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/****************** BUILDERS ************************/
|
|
83
|
+
|
|
84
|
+
const buildCard = (key) => {
|
|
85
|
+
const element = new DTElement(key);
|
|
86
|
+
element.setManyMeta(cards[key].meta);
|
|
87
|
+
if (cards[key].events) {
|
|
88
|
+
for (let actionKey of Object.keys(cards[key].events)) {
|
|
89
|
+
element.addEvent(actionKey, cards[key].events[actionKey]);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return element;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const duplicateCard = (card, nb) => {
|
|
96
|
+
const items = [card];
|
|
97
|
+
let i = 1;
|
|
98
|
+
while (i <= nb) {
|
|
99
|
+
items.push(card.copy());
|
|
100
|
+
i++;
|
|
101
|
+
}
|
|
102
|
+
return items;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const initializeDominionManager = () => {
|
|
106
|
+
const scopes = [
|
|
107
|
+
'supply',
|
|
108
|
+
'hand',
|
|
109
|
+
'playZone',
|
|
110
|
+
'discard',
|
|
111
|
+
'deck'
|
|
112
|
+
];
|
|
113
|
+
const library = [
|
|
114
|
+
...duplicateCard(buildCard('COPPER'), 13),
|
|
115
|
+
...duplicateCard(buildCard('ESTATE'), 5)
|
|
116
|
+
];
|
|
117
|
+
const manager = new DTManager('dominionCard', library, scopes, { errors: true });
|
|
118
|
+
|
|
119
|
+
// Initialize Supply zone
|
|
120
|
+
const copperPile = new DTBunch('copperPile', duplicateCard(buildCard('COPPER'), 11));
|
|
121
|
+
copperPile.setMeta('cost', cards["COPPER"].cost);
|
|
122
|
+
const silverPile = new DTBunch('silverPile', duplicateCard(buildCard('SILVER'), 11));
|
|
123
|
+
silverPile.setMeta('cost', cards["SILVER"].cost);
|
|
124
|
+
const goldPile = new DTBunch('goldPile', duplicateCard(buildCard('GOLD'), 11));
|
|
125
|
+
goldPile.setMeta('cost', cards["GOLD"].cost);
|
|
126
|
+
|
|
127
|
+
const estatePile = new DTBunch('estatePile', duplicateCard(buildCard('ESTATE'), 7));
|
|
128
|
+
estatePile.setMeta('cost', cards["ESTATE"].cost);
|
|
129
|
+
const duchyPile = new DTBunch('duchyPile', duplicateCard(buildCard('DUCHY'), 7));
|
|
130
|
+
duchyPile.setMeta('cost', cards["DUCHY"].cost);
|
|
131
|
+
const provincePile = new DTBunch('provincePile', duplicateCard(buildCard('PROVINCE'), 7));
|
|
132
|
+
provincePile.setMeta('cost', cards["PROVINCE"].cost);
|
|
133
|
+
|
|
134
|
+
const militiaPile = new DTBunch('militiaPile', duplicateCard(buildCard('MILITIA'), 7));
|
|
135
|
+
militiaPile.setMeta('cost', cards["MILITIA"].cost);
|
|
136
|
+
const smithyPile = new DTBunch('smithyPile', duplicateCard(buildCard('SMITHY'), 7));
|
|
137
|
+
smithyPile.setMeta('cost', cards["SMITHY"].cost);
|
|
138
|
+
const workshopPile = new DTBunch('workshopPile', duplicateCard(buildCard('WORKSHOP'), 7));
|
|
139
|
+
workshopPile.setMeta('cost', cards["WORKSHOP"].cost);
|
|
140
|
+
|
|
141
|
+
manager.addMany([
|
|
142
|
+
copperPile,
|
|
143
|
+
silverPile,
|
|
144
|
+
goldPile,
|
|
145
|
+
estatePile,
|
|
146
|
+
duchyPile,
|
|
147
|
+
provincePile,
|
|
148
|
+
militiaPile,
|
|
149
|
+
smithyPile,
|
|
150
|
+
workshopPile
|
|
151
|
+
], 'supply');
|
|
152
|
+
|
|
153
|
+
// Initialize players
|
|
154
|
+
const players = [
|
|
155
|
+
new DTPlayer('PRIAM'),
|
|
156
|
+
new DTPlayer('ECTESIAM'),
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
// Initialize players deck, discard and hand
|
|
160
|
+
let current = {};
|
|
161
|
+
for (let player of players) {
|
|
162
|
+
const deck = new DTBunch('deck');
|
|
163
|
+
deck.setOwner(player);
|
|
164
|
+
manager.add(deck, 'deck');
|
|
165
|
+
|
|
166
|
+
const discard = new DTBunch('discard');
|
|
167
|
+
discard.setOwner(player);
|
|
168
|
+
manager.add(discard, 'discard');
|
|
169
|
+
|
|
170
|
+
const hand = new DTBunch('hand');
|
|
171
|
+
hand.setOwner(player);
|
|
172
|
+
manager.add(hand, 'hand');
|
|
173
|
+
|
|
174
|
+
const playZone = new DTBunch('playZone');
|
|
175
|
+
playZone.setOwner(player);
|
|
176
|
+
manager.add(playZone, 'playZone');
|
|
177
|
+
|
|
178
|
+
const playerCards = new DTBunch('playerCards', [], { virtualContext: true });
|
|
179
|
+
playerCards.setOwner(player);
|
|
180
|
+
manager.add(playerCards);
|
|
181
|
+
|
|
182
|
+
if (player.getKey() === 'PRIAM') {
|
|
183
|
+
current = {
|
|
184
|
+
player,
|
|
185
|
+
deck,
|
|
186
|
+
hand,
|
|
187
|
+
playZone
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Initialize actions
|
|
193
|
+
const fakeShuffle = (bunch) => {
|
|
194
|
+
const estates = bunch.find({ key: { $eq: 'ESTATE' }});
|
|
195
|
+
const coppers = bunch.find({ key: { $eq: 'COPPER' }});
|
|
196
|
+
|
|
197
|
+
bunch.removeAll();
|
|
198
|
+
bunch.addMany([
|
|
199
|
+
coppers[0],
|
|
200
|
+
estates[0],
|
|
201
|
+
coppers[1],
|
|
202
|
+
estates[1],
|
|
203
|
+
coppers[2],
|
|
204
|
+
estates[2],
|
|
205
|
+
coppers[3],
|
|
206
|
+
coppers[4],
|
|
207
|
+
coppers[5],
|
|
208
|
+
coppers[6],
|
|
209
|
+
])
|
|
210
|
+
};
|
|
211
|
+
const fakeShuffleAction = new DTSimpleAction('shuffle', fakeShuffle, {
|
|
212
|
+
target: 'bunch',
|
|
213
|
+
scopes: ['deck']
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const drawAction = new DTTransferAction('draw', {
|
|
217
|
+
scopes: ['deck'],
|
|
218
|
+
destinationScope: 'hand'
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const playAction = new DTTransferAction('play', {
|
|
222
|
+
scopes: ['hand'],
|
|
223
|
+
destinationScope: 'playZone'
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
manager.addAction(fakeShuffleAction);
|
|
227
|
+
manager.addAction(drawAction);
|
|
228
|
+
manager.addAction(playAction);
|
|
229
|
+
|
|
230
|
+
// Return
|
|
231
|
+
return {
|
|
232
|
+
manager,
|
|
233
|
+
current,
|
|
234
|
+
players
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
module.exports = initializeDominionManager
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
const transformDataTableToBunchFinderArgs = (table) => {
|
|
3
|
+
const validArgs = ['key', 'id', 'owner', 'scope'];
|
|
4
|
+
const finalArgs = {};
|
|
5
|
+
|
|
6
|
+
for (let [arg, value] of Object.entries(table.rowsHash())) {
|
|
7
|
+
if (validArgs.includes(arg)) {
|
|
8
|
+
finalArgs[arg] = { $eq: value };
|
|
9
|
+
} else {
|
|
10
|
+
if (!finalArgs.meta) {
|
|
11
|
+
finalArgs.meta = {};
|
|
12
|
+
}
|
|
13
|
+
finalArgs.meta[arg] = { $eq: value };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return finalArgs;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const extractKeysElement = (elements) => {
|
|
21
|
+
return elements.map((element) => element.getKey());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = {
|
|
25
|
+
transformDataTableToBunchFinderArgs,
|
|
26
|
+
extractKeysElement
|
|
27
|
+
}
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,42 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dyo-tools",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
7
|
+
"build:prod": "tsc -p tsconfig.json",
|
|
8
|
+
"build:dev": "tsc -p tsconfig.dev.json",
|
|
8
9
|
"start": "node dist/index.js",
|
|
9
10
|
"lint": "eslint src/ --ext .ts",
|
|
10
11
|
"lint:fix": "eslint src/ --ext .ts --fix",
|
|
12
|
+
"typecheck": "tsc --noEmit -p tsconfig.dev.json",
|
|
11
13
|
"test": "jest",
|
|
12
14
|
"test:coverage": "c8 --check-coverage npm test",
|
|
13
|
-
"test:coverage:verify": "c8 --check-coverage --
|
|
15
|
+
"test:coverage:verify": "c8 --check-coverage --lines 97 --functions 97 --branches 97 --statements 97 npm test",
|
|
16
|
+
"e2e": "cucumber-js --config cucumber.js",
|
|
17
|
+
"typedoc": "typedoc --tsconfig tsconfig.dev.json src/**/*.ts"
|
|
14
18
|
},
|
|
15
19
|
"repository": {
|
|
16
20
|
"type": "git",
|
|
17
|
-
"url": "https://
|
|
21
|
+
"url": "git+https://gitlab.com/dyo-system/dyo-tools.git"
|
|
18
22
|
},
|
|
19
|
-
"author": "
|
|
20
|
-
"license": "
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=12.13.0"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://gitlab.com/dyo-system/dyo-tools/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://gitlab.com/dyo-system/dyo-tools#readme",
|
|
23
32
|
"devDependencies": {
|
|
24
|
-
"@babel/preset-env": "^7.
|
|
25
|
-
"@types/jest": "^27.
|
|
26
|
-
"@types/uuid": "^
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
28
|
-
"@typescript-eslint/parser": "^5.
|
|
29
|
-
"c8": "^
|
|
30
|
-
"eslint": "^8.
|
|
33
|
+
"@babel/preset-env": "^7.22.5",
|
|
34
|
+
"@types/jest": "^27.5.2",
|
|
35
|
+
"@types/uuid": "^9.0.2",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
37
|
+
"@typescript-eslint/parser": "^5.59.11",
|
|
38
|
+
"c8": "^8.0.0",
|
|
39
|
+
"eslint": "^8.42.0",
|
|
31
40
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
32
|
-
"eslint-config-airbnb-typescript": "^
|
|
33
|
-
"eslint-plugin-import": "^2.
|
|
34
|
-
"jest": "^27.
|
|
35
|
-
"ts-jest": "^27.1.
|
|
36
|
-
"typedoc": "^0.
|
|
37
|
-
"typescript": "
|
|
41
|
+
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
42
|
+
"eslint-plugin-import": "^2.27.5",
|
|
43
|
+
"jest": "^27.5.1",
|
|
44
|
+
"ts-jest": "^27.1.5",
|
|
45
|
+
"typedoc": "^0.24.8",
|
|
46
|
+
"typescript": "4.8.4"
|
|
38
47
|
},
|
|
39
48
|
"dependencies": {
|
|
40
|
-
"
|
|
49
|
+
"@cucumber/cucumber": "^9.1.2",
|
|
50
|
+
"uuid": "^9.0.0"
|
|
41
51
|
}
|
|
42
52
|
}
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DTAcceptedMetaData,
|
|
3
|
+
DTBunchOptions,
|
|
4
|
+
DTManagerOptions,
|
|
5
|
+
DYOFinderConfiguration,
|
|
6
|
+
FilterOperatorType,
|
|
7
|
+
StandardPrimitiveType,
|
|
8
|
+
} from './types';
|
|
9
|
+
import {
|
|
10
|
+
DTBunch, DTComponentPhysical, DTElement, DTManager,
|
|
11
|
+
} from './index';
|
|
12
|
+
|
|
13
|
+
/* ********************** CORE CONSTANTS ********************** */
|
|
14
|
+
/** DTBunch constants * */
|
|
15
|
+
export const bunchDefaultOptions: DTBunchOptions = {
|
|
16
|
+
errors: false,
|
|
17
|
+
uniqueKey: false,
|
|
18
|
+
inheritOwner: false,
|
|
19
|
+
replaceIndex: false,
|
|
20
|
+
virtualContext: false,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** DTManager constants * */
|
|
24
|
+
export const managerDefaultOptions: DTManagerOptions = {
|
|
25
|
+
errors: false,
|
|
26
|
+
libraryDeletion: false,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** DYOFinder configuration constants * */
|
|
30
|
+
const baseOperators = [
|
|
31
|
+
FilterOperatorType.EQ,
|
|
32
|
+
FilterOperatorType.IN,
|
|
33
|
+
FilterOperatorType.NIN,
|
|
34
|
+
FilterOperatorType.NE,
|
|
35
|
+
];
|
|
36
|
+
const advancedOperators = [
|
|
37
|
+
...baseOperators,
|
|
38
|
+
FilterOperatorType.GTE,
|
|
39
|
+
FilterOperatorType.LTE,
|
|
40
|
+
FilterOperatorType.CONTAINS,
|
|
41
|
+
FilterOperatorType.NCONTAINS,
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export const componentPhysicalDefaultFinderConfiguration: DYOFinderConfiguration = {
|
|
45
|
+
id: {
|
|
46
|
+
operators: baseOperators,
|
|
47
|
+
getValue: (item: DTComponentPhysical<DTAcceptedMetaData>) => item.getId(),
|
|
48
|
+
objectSearch: false,
|
|
49
|
+
},
|
|
50
|
+
key: {
|
|
51
|
+
operators: baseOperators,
|
|
52
|
+
getValue: (item: DTComponentPhysical<DTAcceptedMetaData>) => item.getKey(),
|
|
53
|
+
objectSearch: false,
|
|
54
|
+
},
|
|
55
|
+
owner: {
|
|
56
|
+
operators: baseOperators,
|
|
57
|
+
getValue: (item: DTComponentPhysical<DTAcceptedMetaData>) => (item.getOwner() ? item.getOwner().getId() : null),
|
|
58
|
+
objectSearch: false,
|
|
59
|
+
},
|
|
60
|
+
meta: {
|
|
61
|
+
operators: advancedOperators,
|
|
62
|
+
getValue: (item: DTComponentPhysical<DTAcceptedMetaData>) => item.getManyMeta(),
|
|
63
|
+
objectSearch: true,
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const componentManagerDefaultFinderConfiguration: DYOFinderConfiguration = {
|
|
68
|
+
...componentPhysicalDefaultFinderConfiguration,
|
|
69
|
+
scope: {
|
|
70
|
+
operators: baseOperators,
|
|
71
|
+
getValue(item: DTBunch<DTElement<DTAcceptedMetaData>>, ctx: DTManager<DTElement<DTAcceptedMetaData>>): StandardPrimitiveType {
|
|
72
|
+
return ctx.getScope(item.getId());
|
|
73
|
+
},
|
|
74
|
+
objectSearch: false,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export const componentBunchDefaultFinderConfiguration: DYOFinderConfiguration = {
|
|
79
|
+
...componentPhysicalDefaultFinderConfiguration,
|
|
80
|
+
context: {
|
|
81
|
+
operators: baseOperators,
|
|
82
|
+
getValue: (item: DTComponentPhysical<DTAcceptedMetaData>) => (item.getContext() ? item.getContext().getId() : null),
|
|
83
|
+
objectSearch: false,
|
|
84
|
+
},
|
|
85
|
+
};
|