@nymphjs/nymph 1.0.0-beta.0 → 1.0.0-beta.2

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.
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
12
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
4
  };
@@ -24,134 +15,129 @@ function QueriesTest(nymph, it) {
24
15
  let testGuid;
25
16
  let refGuid;
26
17
  let createdMultiple = false;
27
- function createTestEntities() {
28
- return __awaiter(this, void 0, void 0, function* () {
29
- if (testGuid != null) {
30
- return;
31
- }
32
- testEntity = yield testArtifacts_1.TestModel.factory();
33
- testEntity.name = 'Entity Test ' + new Date().toLocaleString();
34
- testEntity.null = null;
35
- testEntity.string = 'test';
36
- testEntity.array = ['full', 'of', 'values', 500];
37
- testEntity.match = `Hello, my name is Edward McCheese. It is a pleasure to meet you. As you can see, I have several hats of the most pleasant nature.
18
+ async function createTestEntities() {
19
+ if (testGuid != null) {
20
+ return;
21
+ }
22
+ testEntity = await testArtifacts_1.TestModel.factory();
23
+ testEntity.name = 'Entity Test ' + new Date().toLocaleString();
24
+ testEntity.null = null;
25
+ testEntity.string = 'test';
26
+ testEntity.array = ['full', 'of', 'values', 500];
27
+ testEntity.match = `Hello, my name is Edward McCheese. It is a pleasure to meet you. As you can see, I have several hats of the most pleasant nature.
38
28
 
39
29
  This one's email address is nice_hat-wednesday+newyork@im-a-hat.hat.
40
30
  This one's phone number is (555) 555-1818.
41
31
  This one's zip code is 92064.`;
42
- testEntity.number = 30;
43
- testEntity.numberString = '30';
44
- testEntity.timestamp = Date.now();
45
- expect(yield testEntity.$save()).toEqual(true);
46
- expect(testEntity.guid).not.toBeNull();
47
- testGuid = testEntity.guid;
48
- const entityReferenceTest = new testArtifacts_1.TestModel();
49
- entityReferenceTest.string = 'wrong';
50
- entityReferenceTest.timestamp = (0, strtotime_1.default)('-2 days') * 1000;
51
- expect(yield entityReferenceTest.$save()).toEqual(true);
52
- refGuid = entityReferenceTest.guid;
53
- testEntity.reference = entityReferenceTest;
54
- testEntity.refArray = [entityReferenceTest];
55
- expect(yield testEntity.$save()).toEqual(true);
56
- entityReferenceTest.test = 'good';
57
- expect(yield entityReferenceTest.$save()).toEqual(true);
58
- testEntity = nymph.driver.getEntitySync({ class: testArtifacts_1.TestModel }, testGuid);
59
- expect(testEntity).toBeInstanceOf(testArtifacts_1.TestModel);
60
- expect(testEntity.guid).toEqual(testGuid);
61
- testEntity = (yield nymph.getEntity({ class: testArtifacts_1.TestModel }, testGuid));
62
- expect(testEntity).toBeInstanceOf(testArtifacts_1.TestModel);
63
- expect(testEntity.guid).toEqual(testGuid);
64
- });
32
+ testEntity.number = 30;
33
+ testEntity.numberString = '30';
34
+ testEntity.timestamp = Date.now();
35
+ expect(await testEntity.$save()).toEqual(true);
36
+ expect(testEntity.guid).not.toBeNull();
37
+ testGuid = testEntity.guid;
38
+ const entityReferenceTest = new testArtifacts_1.TestModel();
39
+ entityReferenceTest.string = 'wrong';
40
+ entityReferenceTest.timestamp = (0, strtotime_1.default)('-2 days') * 1000;
41
+ expect(await entityReferenceTest.$save()).toEqual(true);
42
+ refGuid = entityReferenceTest.guid;
43
+ testEntity.reference = entityReferenceTest;
44
+ testEntity.refArray = [entityReferenceTest];
45
+ expect(await testEntity.$save()).toEqual(true);
46
+ entityReferenceTest.test = 'good';
47
+ expect(await entityReferenceTest.$save()).toEqual(true);
48
+ testEntity = nymph.driver.getEntitySync({ class: testArtifacts_1.TestModel }, testGuid);
49
+ expect(testEntity).toBeInstanceOf(testArtifacts_1.TestModel);
50
+ expect(testEntity.guid).toEqual(testGuid);
51
+ testEntity = (await nymph.getEntity({ class: testArtifacts_1.TestModel }, testGuid));
52
+ expect(testEntity).toBeInstanceOf(testArtifacts_1.TestModel);
53
+ expect(testEntity.guid).toEqual(testGuid);
65
54
  }
66
- function createMultipleTestEntities() {
67
- return __awaiter(this, void 0, void 0, function* () {
68
- if (!createdMultiple) {
69
- createdMultiple = true;
70
- for (let i = 0; i < 100; i++) {
71
- const testEntity = yield testArtifacts_1.TestModel.factory();
72
- testEntity.name = `Multi Test ${i}`;
73
- testEntity.$removeTag('test');
74
- testEntity.$addTag('multiTest');
75
- expect(yield testEntity.$save()).toEqual(true);
76
- yield new Promise((res) => setTimeout(() => res(1), 5));
77
- }
55
+ async function createMultipleTestEntities() {
56
+ if (!createdMultiple) {
57
+ createdMultiple = true;
58
+ for (let i = 0; i < 100; i++) {
59
+ const testEntity = await testArtifacts_1.TestModel.factory();
60
+ testEntity.name = `Multi Test ${i}`;
61
+ testEntity.$removeTag('test');
62
+ testEntity.$addTag('multiTest');
63
+ expect(await testEntity.$save()).toEqual(true);
64
+ await new Promise((res) => setTimeout(() => res(1), 5));
78
65
  }
79
- });
66
+ }
80
67
  }
81
- it('delete old test data', () => __awaiter(this, void 0, void 0, function* () {
82
- let all = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
68
+ it('delete old test data', async () => {
69
+ let all = await nymph.getEntities({ class: testArtifacts_1.TestModel });
83
70
  expect(Array.isArray(all)).toEqual(true);
84
71
  for (const cur of all) {
85
- expect(yield cur.$delete()).toEqual(true);
72
+ expect(await cur.$delete()).toEqual(true);
86
73
  }
87
- all = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
74
+ all = await nymph.getEntities({ class: testArtifacts_1.TestModel });
88
75
  expect(all.length).toEqual(0);
89
- }));
90
- it('create entity', () => __awaiter(this, void 0, void 0, function* () {
91
- yield createTestEntities();
92
- }));
93
- it('update mdate on save', () => __awaiter(this, void 0, void 0, function* () {
94
- var _a;
95
- yield createTestEntities();
96
- const oldMdate = (_a = testEntity.mdate) !== null && _a !== void 0 ? _a : Infinity;
97
- yield new Promise((resolve) => setTimeout(() => resolve(true), 100));
98
- yield testEntity.$save();
76
+ });
77
+ it('create entity', async () => {
78
+ await createTestEntities();
79
+ });
80
+ it('update mdate on save', async () => {
81
+ await createTestEntities();
82
+ const oldMdate = testEntity.mdate ?? Infinity;
83
+ await new Promise((resolve) => setTimeout(() => resolve(true), 100));
84
+ await testEntity.$save();
99
85
  expect(testEntity.mdate).toBeGreaterThan(oldMdate);
100
- }));
101
- it('create multiple entities', () => __awaiter(this, void 0, void 0, function* () {
86
+ });
87
+ it('create multiple entities', async () => {
102
88
  return createMultipleTestEntities();
103
- }));
104
- it('by guid', () => __awaiter(this, void 0, void 0, function* () {
105
- yield createTestEntities();
106
- let resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, testGuid);
89
+ });
90
+ it('by guid', async () => {
91
+ await createTestEntities();
92
+ let resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, testGuid);
107
93
  expect(testEntity.$is(resultEntity)).toEqual(true);
108
- resultEntity = yield testArtifacts_1.TestModel.factory(testGuid);
94
+ resultEntity = await testArtifacts_1.TestModel.factory(testGuid);
109
95
  expect(testEntity.$is(resultEntity)).toEqual(true);
110
- resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, (0, guid_1.guid)());
96
+ resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, (0, guid_1.guid)());
111
97
  expect(testEntity.$is(resultEntity)).toEqual(false);
112
- }));
113
- it('transactions', () => __awaiter(this, void 0, void 0, function* () {
114
- yield createTestEntities();
115
- expect(yield nymph.inTransaction()).toEqual(false);
116
- let transaction = yield nymph.startTransaction('test');
98
+ });
99
+ it('transactions', async () => {
100
+ await createTestEntities();
101
+ expect(await nymph.inTransaction()).toEqual(false);
102
+ let transaction = await nymph.startTransaction('test');
117
103
  testEntity.$nymph = transaction;
118
- if (!(yield transaction.inTransaction())) {
104
+ if (!(await transaction.inTransaction())) {
119
105
  console.log('This Nymph driver or database seems to not support transactions. Skipping transaction tests.');
120
- yield transaction.rollback('test');
106
+ await transaction.rollback('test');
121
107
  return;
122
108
  }
123
109
  testEntity.string = 'bad value';
124
- expect(yield testEntity.$save()).toEqual(true);
125
- yield transaction.rollback('test');
126
- expect(yield transaction.inTransaction()).toEqual(false);
127
- yield testEntity.$refresh();
110
+ expect(await testEntity.$save()).toEqual(true);
111
+ await transaction.rollback('test');
112
+ expect(await transaction.inTransaction()).toEqual(false);
113
+ await testEntity.$refresh();
128
114
  expect(testEntity.string).toEqual('test');
129
- transaction = yield nymph.startTransaction('test');
115
+ transaction = await nymph.startTransaction('test');
130
116
  testEntity.$nymph = transaction;
131
- expect(yield transaction.inTransaction()).toEqual(true);
132
- expect(yield testEntity.$delete()).toEqual(true);
133
- const resultEntity = yield transaction.getEntity({ class: testArtifacts_1.TestModel }, testGuid);
117
+ expect(await transaction.inTransaction()).toEqual(true);
118
+ expect(await testEntity.$delete()).toEqual(true);
119
+ const resultEntity = await transaction.getEntity({ class: testArtifacts_1.TestModel }, testGuid);
134
120
  expect(resultEntity).toBeNull();
135
- yield transaction.rollback('test');
136
- expect(yield transaction.inTransaction()).toEqual(false);
137
- testEntity = (yield transaction.getEntity({ class: testArtifacts_1.TestModel }, testGuid));
121
+ await transaction.rollback('test');
122
+ expect(await transaction.inTransaction()).toEqual(false);
123
+ testEntity = (await transaction.getEntity({ class: testArtifacts_1.TestModel }, testGuid));
138
124
  expect(testEntity.guid).toEqual(testGuid);
139
- transaction = yield nymph.startTransaction('test');
125
+ transaction = await nymph.startTransaction('test');
140
126
  testEntity.$nymph = transaction;
141
- expect(yield transaction.inTransaction()).toEqual(true);
127
+ expect(await transaction.inTransaction()).toEqual(true);
142
128
  testEntity.string = 'fish';
143
- expect(yield testEntity.$save()).toEqual(true);
144
- yield transaction.commit('test');
129
+ expect(await testEntity.$save()).toEqual(true);
130
+ await transaction.commit('test');
145
131
  testEntity.$nymph = nymph;
146
- expect(yield transaction.inTransaction()).toEqual(false);
147
- yield testEntity.$refresh();
132
+ expect(await transaction.inTransaction()).toEqual(false);
133
+ await testEntity.$refresh();
148
134
  expect(testEntity.string).toEqual('fish');
149
135
  testEntity.string = 'test';
150
- expect(yield testEntity.$save()).toEqual(true);
151
- }));
152
- it('options', () => __awaiter(this, void 0, void 0, function* () {
153
- yield createTestEntities();
154
- const resultEntities = yield nymph.getEntities({
136
+ expect(await testEntity.$save()).toEqual(true);
137
+ });
138
+ it('options', async () => {
139
+ await createTestEntities();
140
+ const resultEntities = await nymph.getEntities({
155
141
  class: testArtifacts_1.TestModel,
156
142
  reverse: true,
157
143
  offset: 1,
@@ -160,177 +146,177 @@ This one's zip code is 92064.`;
160
146
  }, { type: '&', tag: 'test' });
161
147
  expect(resultEntities.length).toEqual(1);
162
148
  expect(testEntity.$is(resultEntities[0])).toEqual(true);
163
- }));
164
- it('guid and tags', () => __awaiter(this, void 0, void 0, function* () {
165
- yield createTestEntities();
166
- const resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, tag: 'test' });
149
+ });
150
+ it('guid and tags', async () => {
151
+ await createTestEntities();
152
+ const resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, tag: 'test' });
167
153
  expect(testEntity.$is(resultEntity)).toEqual(true);
168
- }));
169
- it('or selector', () => __awaiter(this, void 0, void 0, function* () {
170
- yield createTestEntities();
171
- const resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '|', guid: [testGuid, (0, guid_1.guid)()] });
154
+ });
155
+ it('or selector', async () => {
156
+ await createTestEntities();
157
+ const resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '|', guid: [testGuid, (0, guid_1.guid)()] });
172
158
  expect(testEntity.$is(resultEntity)).toEqual(true);
173
- }));
174
- it('wrong or selector', () => __awaiter(this, void 0, void 0, function* () {
175
- yield createTestEntities();
176
- const resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '|', guid: [(0, guid_1.guid)(), (0, guid_1.guid)()] });
159
+ });
160
+ it('wrong or selector', async () => {
161
+ await createTestEntities();
162
+ const resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '|', guid: [(0, guid_1.guid)(), (0, guid_1.guid)()] });
177
163
  expect(testEntity.$is(resultEntity)).toEqual(false);
178
- }));
179
- it('not guid', () => __awaiter(this, void 0, void 0, function* () {
180
- yield createTestEntities();
181
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', '!guid': (0, guid_1.guid)(), tag: 'test' });
164
+ });
165
+ it('not guid', async () => {
166
+ await createTestEntities();
167
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', '!guid': (0, guid_1.guid)(), tag: 'test' });
182
168
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
183
- }));
184
- it('not tags', () => __awaiter(this, void 0, void 0, function* () {
185
- yield createTestEntities();
186
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, '!tag': ['barbecue', 'pickles'] });
169
+ });
170
+ it('not tags', async () => {
171
+ await createTestEntities();
172
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, '!tag': ['barbecue', 'pickles'] });
187
173
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
188
- }));
189
- it('guid and wrong tags', () => __awaiter(this, void 0, void 0, function* () {
190
- yield createTestEntities();
191
- const resultEntity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, tag: ['pickles'] });
174
+ });
175
+ it('guid and wrong tags', async () => {
176
+ await createTestEntities();
177
+ const resultEntity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid, tag: ['pickles'] });
192
178
  expect(resultEntity).toBeNull();
193
- }));
194
- it('tags', () => __awaiter(this, void 0, void 0, function* () {
195
- yield createTestEntities();
196
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' });
179
+ });
180
+ it('tags', async () => {
181
+ await createTestEntities();
182
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' });
197
183
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
198
- }));
199
- it('wrong tags', () => __awaiter(this, void 0, void 0, function* () {
200
- yield createTestEntities();
201
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles' });
184
+ });
185
+ it('wrong tags', async () => {
186
+ await createTestEntities();
187
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles' });
202
188
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
203
- }));
204
- it('inclusive tags', () => __awaiter(this, void 0, void 0, function* () {
205
- yield createTestEntities();
206
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '|', tag: ['pickles', 'test', 'barbecue'] });
189
+ });
190
+ it('inclusive tags', async () => {
191
+ await createTestEntities();
192
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '|', tag: ['pickles', 'test', 'barbecue'] });
207
193
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
208
- }));
209
- it('wrong inclusive tags', () => __awaiter(this, void 0, void 0, function* () {
210
- yield createTestEntities();
211
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '|', tag: ['pickles', 'barbecue'] });
194
+ });
195
+ it('wrong inclusive tags', async () => {
196
+ await createTestEntities();
197
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '|', tag: ['pickles', 'barbecue'] });
212
198
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
213
- }));
214
- it('mixed tags', () => __awaiter(this, void 0, void 0, function* () {
215
- yield createTestEntities();
216
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', tag: ['pickles', 'test', 'barbecue'] });
199
+ });
200
+ it('mixed tags', async () => {
201
+ await createTestEntities();
202
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', tag: ['pickles', 'test', 'barbecue'] });
217
203
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
218
- }));
219
- it('wrong inclusive mixed tags', () => __awaiter(this, void 0, void 0, function* () {
220
- yield createTestEntities();
221
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', tag: ['pickles', 'barbecue'] });
204
+ });
205
+ it('wrong inclusive mixed tags', async () => {
206
+ await createTestEntities();
207
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', tag: ['pickles', 'barbecue'] });
222
208
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
223
- }));
224
- it('wrong exclusive mixed tags', () => __awaiter(this, void 0, void 0, function* () {
225
- yield createTestEntities();
226
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles' }, { type: '|', tag: ['test', 'barbecue'] });
209
+ });
210
+ it('wrong exclusive mixed tags', async () => {
211
+ await createTestEntities();
212
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles' }, { type: '|', tag: ['test', 'barbecue'] });
227
213
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
228
- }));
229
- it('defined', () => __awaiter(this, void 0, void 0, function* () {
230
- yield createTestEntities();
231
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', defined: 'string' });
214
+ });
215
+ it('defined', async () => {
216
+ await createTestEntities();
217
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', defined: 'string' });
232
218
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
233
- }));
234
- it('not defined', () => __awaiter(this, void 0, void 0, function* () {
235
- yield createTestEntities();
236
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!defined': 'pickles' });
219
+ });
220
+ it('not defined', async () => {
221
+ await createTestEntities();
222
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!defined': 'pickles' });
237
223
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
238
- }));
239
- it('defined in a not and clause', () => __awaiter(this, void 0, void 0, function* () {
240
- yield createTestEntities();
241
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '!&', defined: 'pickles' }, { type: '&', tag: 'test' });
224
+ });
225
+ it('defined in a not and clause', async () => {
226
+ await createTestEntities();
227
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '!&', defined: 'pickles' }, { type: '&', tag: 'test' });
242
228
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
243
- }));
244
- it('equal', () => __awaiter(this, void 0, void 0, function* () {
245
- yield createTestEntities();
246
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', equal: ['string', 'test'] });
229
+ });
230
+ it('equal', async () => {
231
+ await createTestEntities();
232
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', equal: ['string', 'test'] });
247
233
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
248
- }));
249
- it('not equal', () => __awaiter(this, void 0, void 0, function* () {
250
- yield createTestEntities();
251
- const referenceEntity = yield testArtifacts_1.TestModel.factory(refGuid);
234
+ });
235
+ it('not equal', async () => {
236
+ await createTestEntities();
237
+ const referenceEntity = await testArtifacts_1.TestModel.factory(refGuid);
252
238
  expect(referenceEntity.guid).toEqual(refGuid);
253
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!equal': ['string', 'wrong'] });
239
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!equal': ['string', 'wrong'] });
254
240
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
255
241
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
256
- }));
257
- it('like', () => __awaiter(this, void 0, void 0, function* () {
258
- yield createTestEntities();
259
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', like: ['string', 't_s%'] });
242
+ });
243
+ it('like', async () => {
244
+ await createTestEntities();
245
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', like: ['string', 't_s%'] });
260
246
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
261
- }));
262
- it('not like', () => __awaiter(this, void 0, void 0, function* () {
263
- yield createTestEntities();
264
- const referenceEntity = yield testArtifacts_1.TestModel.factory(refGuid);
247
+ });
248
+ it('not like', async () => {
249
+ await createTestEntities();
250
+ const referenceEntity = await testArtifacts_1.TestModel.factory(refGuid);
265
251
  expect(referenceEntity.guid).toEqual(refGuid);
266
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!like': ['string', 'wr_n%'] });
252
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!like': ['string', 'wr_n%'] });
267
253
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
268
254
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
269
- }));
270
- it('ilike', () => __awaiter(this, void 0, void 0, function* () {
271
- yield createTestEntities();
272
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ilike: ['string', 'T_s%'] });
255
+ });
256
+ it('ilike', async () => {
257
+ await createTestEntities();
258
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ilike: ['string', 'T_s%'] });
273
259
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
274
- }));
275
- it('not ilike', () => __awaiter(this, void 0, void 0, function* () {
276
- yield createTestEntities();
277
- const referenceEntity = yield testArtifacts_1.TestModel.factory(refGuid);
260
+ });
261
+ it('not ilike', async () => {
262
+ await createTestEntities();
263
+ const referenceEntity = await testArtifacts_1.TestModel.factory(refGuid);
278
264
  expect(referenceEntity.guid).toEqual(refGuid);
279
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!ilike': ['string', 'wr_n%'] });
265
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', '!ilike': ['string', 'wr_n%'] });
280
266
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
281
267
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
282
- }));
283
- it('like with wrong case', () => __awaiter(this, void 0, void 0, function* () {
284
- yield createTestEntities();
285
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', like: ['string', 'T_s%'] });
268
+ });
269
+ it('like with wrong case', async () => {
270
+ await createTestEntities();
271
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', like: ['string', 'T_s%'] });
286
272
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
287
- }));
288
- it('tags and equal', () => __awaiter(this, void 0, void 0, function* () {
289
- yield createTestEntities();
290
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', equal: ['string', 'test'] });
273
+ });
274
+ it('tags and equal', async () => {
275
+ await createTestEntities();
276
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', equal: ['string', 'test'] });
291
277
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
292
- }));
293
- it('wrong tags right equal', () => __awaiter(this, void 0, void 0, function* () {
294
- yield createTestEntities();
295
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles', equal: ['string', 'test'] });
278
+ });
279
+ it('wrong tags right equal', async () => {
280
+ await createTestEntities();
281
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles', equal: ['string', 'test'] });
296
282
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
297
- }));
298
- it('right tags wrong equal', () => __awaiter(this, void 0, void 0, function* () {
299
- yield createTestEntities();
300
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', equal: ['string', 'pickles'] });
283
+ });
284
+ it('right tags wrong equal', async () => {
285
+ await createTestEntities();
286
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', equal: ['string', 'pickles'] });
301
287
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
302
- }));
303
- it('wrong tags wrong equal', () => __awaiter(this, void 0, void 0, function* () {
304
- yield createTestEntities();
305
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles', equal: ['string', 'pickles'] });
288
+ });
289
+ it('wrong tags wrong equal', async () => {
290
+ await createTestEntities();
291
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickles', equal: ['string', 'pickles'] });
306
292
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
307
- }));
308
- it('contain', () => __awaiter(this, void 0, void 0, function* () {
309
- yield createTestEntities();
310
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['array', 'values'] });
293
+ });
294
+ it('contain', async () => {
295
+ await createTestEntities();
296
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['array', 'values'] });
311
297
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
312
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['string', 'test'] });
298
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['string', 'test'] });
313
299
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
314
- }));
315
- it('not contain', () => __awaiter(this, void 0, void 0, function* () {
316
- yield createTestEntities();
317
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', contain: ['array', 'pickles'] });
300
+ });
301
+ it('not contain', async () => {
302
+ await createTestEntities();
303
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', contain: ['array', 'pickles'] });
318
304
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
319
- }));
320
- it('wrong contain', () => __awaiter(this, void 0, void 0, function* () {
321
- yield createTestEntities();
322
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['array', 'pickles'] });
305
+ });
306
+ it('wrong contain', async () => {
307
+ await createTestEntities();
308
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['array', 'pickles'] });
323
309
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
324
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['string', 'pickles'] });
310
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', contain: ['string', 'pickles'] });
325
311
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
326
- }));
327
- it('match', () => __awaiter(this, void 0, void 0, function* () {
328
- yield createTestEntities();
329
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', match: ['match', '.*'] });
312
+ });
313
+ it('match', async () => {
314
+ await createTestEntities();
315
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', match: ['match', '.*'] });
330
316
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
331
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', match: ['match', 'Edward McCheese'] });
317
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', match: ['match', 'Edward McCheese'] });
332
318
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
333
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, {
319
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, {
334
320
  type: '|',
335
321
  match: [
336
322
  ['string', '[0-9]'],
@@ -338,31 +324,31 @@ This one's zip code is 92064.`;
338
324
  ],
339
325
  });
340
326
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
341
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
327
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
342
328
  type: '&',
343
329
  tag: 'test',
344
330
  match: ['match', '[-a-zA-Z0-9+_]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9_]{2,4}'],
345
331
  });
346
332
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
347
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
333
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
348
334
  type: '&',
349
335
  tag: 'test',
350
336
  match: ['match', '\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}'],
351
337
  });
352
338
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
353
- }));
354
- it('imatch', () => __awaiter(this, void 0, void 0, function* () {
355
- yield createTestEntities();
356
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', imatch: ['match', 'edward mccheese'] });
339
+ });
340
+ it('imatch', async () => {
341
+ await createTestEntities();
342
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', imatch: ['match', 'edward mccheese'] });
357
343
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
358
- }));
359
- it('wrong match', () => __awaiter(this, void 0, void 0, function* () {
360
- yield createTestEntities();
361
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', match: ['match', 'Q'] });
344
+ });
345
+ it('wrong match', async () => {
346
+ await createTestEntities();
347
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', match: ['match', 'Q'] });
362
348
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
363
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickle', match: ['match', '.*'] });
349
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'pickle', match: ['match', '.*'] });
364
350
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
365
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
351
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
366
352
  type: '|',
367
353
  match: [
368
354
  ['string', '[0-9]'],
@@ -370,20 +356,20 @@ This one's zip code is 92064.`;
370
356
  ],
371
357
  });
372
358
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
373
- }));
374
- it('match wrong case', () => __awaiter(this, void 0, void 0, function* () {
375
- yield createTestEntities();
376
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', match: ['match', 'edward mccheese'] });
359
+ });
360
+ it('match wrong case', async () => {
361
+ await createTestEntities();
362
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', match: ['match', 'edward mccheese'] });
377
363
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
378
- }));
379
- it('match and equal inclusive', () => __awaiter(this, void 0, void 0, function* () {
380
- yield createTestEntities();
381
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', equal: ['string', 'pickles'], match: ['string', 'test'] });
364
+ });
365
+ it('match and equal inclusive', async () => {
366
+ await createTestEntities();
367
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '|', equal: ['string', 'pickles'], match: ['string', 'test'] });
382
368
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
383
- }));
384
- it('greater than', () => __awaiter(this, void 0, void 0, function* () {
385
- yield createTestEntities();
386
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
369
+ });
370
+ it('greater than', async () => {
371
+ await createTestEntities();
372
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
387
373
  type: '|',
388
374
  gt: [
389
375
  ['number', 30],
@@ -391,7 +377,7 @@ This one's zip code is 92064.`;
391
377
  ],
392
378
  });
393
379
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
394
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
380
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
395
381
  type: '|',
396
382
  gt: [
397
383
  ['number', 31],
@@ -399,7 +385,7 @@ This one's zip code is 92064.`;
399
385
  ],
400
386
  });
401
387
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
402
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
388
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
403
389
  type: '|',
404
390
  gt: [
405
391
  ['number', 29],
@@ -407,7 +393,7 @@ This one's zip code is 92064.`;
407
393
  ],
408
394
  });
409
395
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
410
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
396
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
411
397
  type: '|',
412
398
  gt: [
413
399
  ['numberString', 30],
@@ -415,7 +401,7 @@ This one's zip code is 92064.`;
415
401
  ],
416
402
  });
417
403
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
418
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
404
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
419
405
  type: '|',
420
406
  gt: [
421
407
  ['numberString', 31],
@@ -423,7 +409,7 @@ This one's zip code is 92064.`;
423
409
  ],
424
410
  });
425
411
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
426
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
412
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
427
413
  type: '|',
428
414
  gt: [
429
415
  ['numberString', 29],
@@ -431,10 +417,10 @@ This one's zip code is 92064.`;
431
417
  ],
432
418
  });
433
419
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
434
- }));
435
- it('greater than or equal', () => __awaiter(this, void 0, void 0, function* () {
436
- yield createTestEntities();
437
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
420
+ });
421
+ it('greater than or equal', async () => {
422
+ await createTestEntities();
423
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
438
424
  type: '|',
439
425
  gte: [
440
426
  ['number', 30],
@@ -442,7 +428,7 @@ This one's zip code is 92064.`;
442
428
  ],
443
429
  });
444
430
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
445
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
431
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
446
432
  type: '|',
447
433
  gte: [
448
434
  ['number', 31],
@@ -450,7 +436,7 @@ This one's zip code is 92064.`;
450
436
  ],
451
437
  });
452
438
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
453
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
439
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
454
440
  type: '|',
455
441
  gte: [
456
442
  ['number', 29],
@@ -458,7 +444,7 @@ This one's zip code is 92064.`;
458
444
  ],
459
445
  });
460
446
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
461
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
447
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
462
448
  type: '|',
463
449
  gte: [
464
450
  ['numberString', 30],
@@ -466,7 +452,7 @@ This one's zip code is 92064.`;
466
452
  ],
467
453
  });
468
454
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
469
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
455
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
470
456
  type: '|',
471
457
  gte: [
472
458
  ['numberString', 31],
@@ -474,7 +460,7 @@ This one's zip code is 92064.`;
474
460
  ],
475
461
  });
476
462
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
477
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
463
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
478
464
  type: '|',
479
465
  gte: [
480
466
  ['numberString', 29],
@@ -482,10 +468,10 @@ This one's zip code is 92064.`;
482
468
  ],
483
469
  });
484
470
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
485
- }));
486
- it('less than', () => __awaiter(this, void 0, void 0, function* () {
487
- yield createTestEntities();
488
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
471
+ });
472
+ it('less than', async () => {
473
+ await createTestEntities();
474
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
489
475
  type: '|',
490
476
  lt: [
491
477
  ['number', 30],
@@ -493,7 +479,7 @@ This one's zip code is 92064.`;
493
479
  ],
494
480
  });
495
481
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
496
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
482
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
497
483
  type: '|',
498
484
  lt: [
499
485
  ['number', 31],
@@ -501,7 +487,7 @@ This one's zip code is 92064.`;
501
487
  ],
502
488
  });
503
489
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
504
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
490
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
505
491
  type: '|',
506
492
  lt: [
507
493
  ['number', 29],
@@ -509,7 +495,7 @@ This one's zip code is 92064.`;
509
495
  ],
510
496
  });
511
497
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
512
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
498
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
513
499
  type: '|',
514
500
  lt: [
515
501
  ['numberString', 30],
@@ -517,7 +503,7 @@ This one's zip code is 92064.`;
517
503
  ],
518
504
  });
519
505
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
520
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
506
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
521
507
  type: '|',
522
508
  lt: [
523
509
  ['numberString', 31],
@@ -525,7 +511,7 @@ This one's zip code is 92064.`;
525
511
  ],
526
512
  });
527
513
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
528
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
514
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
529
515
  type: '|',
530
516
  lt: [
531
517
  ['numberString', 29],
@@ -533,10 +519,10 @@ This one's zip code is 92064.`;
533
519
  ],
534
520
  });
535
521
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
536
- }));
537
- it('less than or equal', () => __awaiter(this, void 0, void 0, function* () {
538
- yield createTestEntities();
539
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
522
+ });
523
+ it('less than or equal', async () => {
524
+ await createTestEntities();
525
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
540
526
  type: '|',
541
527
  lte: [
542
528
  ['number', 30],
@@ -544,7 +530,7 @@ This one's zip code is 92064.`;
544
530
  ],
545
531
  });
546
532
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
547
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
533
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
548
534
  type: '|',
549
535
  lte: [
550
536
  ['number', 31],
@@ -552,7 +538,7 @@ This one's zip code is 92064.`;
552
538
  ],
553
539
  });
554
540
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
555
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
541
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
556
542
  type: '|',
557
543
  lte: [
558
544
  ['number', 29],
@@ -560,7 +546,7 @@ This one's zip code is 92064.`;
560
546
  ],
561
547
  });
562
548
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
563
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
549
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
564
550
  type: '|',
565
551
  lte: [
566
552
  ['numberString', 30],
@@ -568,7 +554,7 @@ This one's zip code is 92064.`;
568
554
  ],
569
555
  });
570
556
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
571
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
557
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
572
558
  type: '|',
573
559
  lte: [
574
560
  ['numberString', 31],
@@ -576,7 +562,7 @@ This one's zip code is 92064.`;
576
562
  ],
577
563
  });
578
564
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
579
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
565
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
580
566
  type: '|',
581
567
  lte: [
582
568
  ['numberString', 29],
@@ -584,36 +570,34 @@ This one's zip code is 92064.`;
584
570
  ],
585
571
  });
586
572
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
587
- }));
588
- it('not inequality', () => __awaiter(this, void 0, void 0, function* () {
589
- yield createTestEntities();
590
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', gte: ['number', 60] });
573
+ });
574
+ it('not inequality', async () => {
575
+ await createTestEntities();
576
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', gte: ['number', 60] });
591
577
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
592
- }));
593
- it('wrong inequality', () => __awaiter(this, void 0, void 0, function* () {
594
- yield createTestEntities();
595
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', lte: ['number', 29.99] });
578
+ });
579
+ it('wrong inequality', async () => {
580
+ await createTestEntities();
581
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', lte: ['number', 29.99] });
596
582
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
597
- }));
598
- it('greater than cdate', () => __awaiter(this, void 0, void 0, function* () {
599
- var _b;
600
- yield createTestEntities();
601
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['cdate', ((_b = testEntity.cdate) !== null && _b !== void 0 ? _b : 0) - 120] });
583
+ });
584
+ it('greater than cdate', async () => {
585
+ await createTestEntities();
586
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['cdate', (testEntity.cdate ?? 0) - 120] });
602
587
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
603
- }));
604
- it('wrong cdate', () => __awaiter(this, void 0, void 0, function* () {
605
- var _c;
606
- yield createTestEntities();
607
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gte: ['cdate', ((_c = testEntity.cdate) !== null && _c !== void 0 ? _c : 0) + 1] });
588
+ });
589
+ it('wrong cdate', async () => {
590
+ await createTestEntities();
591
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gte: ['cdate', (testEntity.cdate ?? 0) + 1] });
608
592
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
609
- }));
610
- it('time selector', () => __awaiter(this, void 0, void 0, function* () {
611
- yield createTestEntities();
612
- const referenceEntity = yield testArtifacts_1.TestModel.factory(refGuid);
613
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['timestamp', null, '-1 day'] });
593
+ });
594
+ it('time selector', async () => {
595
+ await createTestEntities();
596
+ const referenceEntity = await testArtifacts_1.TestModel.factory(refGuid);
597
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['timestamp', null, '-1 day'] });
614
598
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
615
599
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
616
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
600
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
617
601
  type: '|',
618
602
  gt: [
619
603
  ['timestamp', null, '-1 day'],
@@ -622,55 +606,54 @@ This one's zip code is 92064.`;
622
606
  });
623
607
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
624
608
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
625
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['timestamp', null, '-3 days'] });
609
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['timestamp', null, '-3 days'] });
626
610
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
627
611
  expect(referenceEntity.$inArray(resultEntity)).toEqual(true);
628
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['cdate', null, '-1 day'] });
612
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', gt: ['cdate', null, '-1 day'] });
629
613
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
630
614
  expect(referenceEntity.$inArray(resultEntity)).toEqual(true);
631
- }));
632
- it('wrong time selector', () => __awaiter(this, void 0, void 0, function* () {
633
- yield createTestEntities();
634
- const referenceEntity = yield testArtifacts_1.TestModel.factory(refGuid);
635
- let resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['timestamp', null, '+1 day'] });
615
+ });
616
+ it('wrong time selector', async () => {
617
+ await createTestEntities();
618
+ const referenceEntity = await testArtifacts_1.TestModel.factory(refGuid);
619
+ let resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['timestamp', null, '+1 day'] });
636
620
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
637
621
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
638
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', lt: ['timestamp', null, '-3 days'] });
622
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', lt: ['timestamp', null, '-3 days'] });
639
623
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
640
624
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
641
- resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['cdate', null, '+1 day'] });
625
+ resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test', gt: ['cdate', null, '+1 day'] });
642
626
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
643
627
  expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
644
- }));
645
- it('references', () => __awaiter(this, void 0, void 0, function* () {
646
- var _d, _e;
647
- yield createTestEntities();
648
- expect((_d = testEntity.reference) === null || _d === void 0 ? void 0 : _d.test).toEqual('good');
649
- expect((_e = testEntity.refArray) === null || _e === void 0 ? void 0 : _e[0].test).toEqual('good');
650
- }));
651
- it('ref', () => __awaiter(this, void 0, void 0, function* () {
652
- yield createTestEntities();
653
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', refGuid] });
628
+ });
629
+ it('references', async () => {
630
+ await createTestEntities();
631
+ expect(testEntity.reference?.test).toEqual('good');
632
+ expect(testEntity.refArray?.[0].test).toEqual('good');
633
+ });
634
+ it('ref', async () => {
635
+ await createTestEntities();
636
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', refGuid] });
654
637
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
655
- }));
656
- it('not ref', () => __awaiter(this, void 0, void 0, function* () {
657
- yield createTestEntities();
658
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', ref: ['reference', (0, guid_1.guid)()] });
638
+ });
639
+ it('not ref', async () => {
640
+ await createTestEntities();
641
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', tag: 'test' }, { type: '!&', ref: ['reference', (0, guid_1.guid)()] });
659
642
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
660
- }));
661
- it('wrong ref', () => __awaiter(this, void 0, void 0, function* () {
662
- yield createTestEntities();
663
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', (0, guid_1.guid)()] });
643
+ });
644
+ it('wrong ref', async () => {
645
+ await createTestEntities();
646
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', (0, guid_1.guid)()] });
664
647
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
665
- }));
666
- it('nonexistent ref', () => __awaiter(this, void 0, void 0, function* () {
667
- yield createTestEntities();
668
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['pickle', refGuid] });
648
+ });
649
+ it('nonexistent ref', async () => {
650
+ await createTestEntities();
651
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['pickle', refGuid] });
669
652
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
670
- }));
671
- it('inclusive ref', () => __awaiter(this, void 0, void 0, function* () {
672
- yield createTestEntities();
673
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
653
+ });
654
+ it('inclusive ref', async () => {
655
+ await createTestEntities();
656
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
674
657
  type: '|',
675
658
  ref: [
676
659
  ['reference', refGuid],
@@ -678,10 +661,10 @@ This one's zip code is 92064.`;
678
661
  ],
679
662
  });
680
663
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
681
- }));
682
- it('wrong inclusive ref', () => __awaiter(this, void 0, void 0, function* () {
683
- yield createTestEntities();
684
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
664
+ });
665
+ it('wrong inclusive ref', async () => {
666
+ await createTestEntities();
667
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
685
668
  type: '|',
686
669
  ref: [
687
670
  ['reference', (0, guid_1.guid)()],
@@ -689,15 +672,15 @@ This one's zip code is 92064.`;
689
672
  ],
690
673
  });
691
674
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
692
- }));
693
- it('ref in an array', () => __awaiter(this, void 0, void 0, function* () {
694
- yield createTestEntities();
695
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['refArray', refGuid] });
675
+ });
676
+ it('ref in an array', async () => {
677
+ await createTestEntities();
678
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['refArray', refGuid] });
696
679
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
697
- }));
698
- it('wrong ref in an array', () => __awaiter(this, void 0, void 0, function* () {
699
- yield createTestEntities();
700
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
680
+ });
681
+ it('wrong ref in an array', async () => {
682
+ await createTestEntities();
683
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
701
684
  type: '&',
702
685
  ref: [
703
686
  ['refArray', refGuid],
@@ -705,10 +688,10 @@ This one's zip code is 92064.`;
705
688
  ],
706
689
  });
707
690
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
708
- }));
709
- it('logic operations', () => __awaiter(this, void 0, void 0, function* () {
710
- yield createTestEntities();
711
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
691
+ });
692
+ it('logic operations', async () => {
693
+ await createTestEntities();
694
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
712
695
  type: '&',
713
696
  '!ref': [
714
697
  ['refArray', (0, guid_1.guid)()],
@@ -741,38 +724,37 @@ This one's zip code is 92064.`;
741
724
  ],
742
725
  });
743
726
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
744
- }));
745
- it('count return', () => __awaiter(this, void 0, void 0, function* () {
746
- yield createTestEntities();
747
- const result = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
748
- const resultCount = yield nymph.getEntities({
727
+ });
728
+ it('count return', async () => {
729
+ await createTestEntities();
730
+ const result = await nymph.getEntities({ class: testArtifacts_1.TestModel });
731
+ const resultCount = await nymph.getEntities({
749
732
  class: testArtifacts_1.TestModel,
750
733
  return: 'count',
751
734
  });
752
735
  expect(resultCount).toBeGreaterThanOrEqual(1);
753
736
  expect(resultCount).toEqual(result.length);
754
- const resultSelectors = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', refGuid] });
755
- const resultSelectorsCount = yield nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'count' }, { type: '&', ref: ['reference', refGuid] });
737
+ const resultSelectors = await nymph.getEntities({ class: testArtifacts_1.TestModel }, { type: '&', ref: ['reference', refGuid] });
738
+ const resultSelectorsCount = await nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'count' }, { type: '&', ref: ['reference', refGuid] });
756
739
  expect(resultSelectorsCount).toBeGreaterThanOrEqual(1);
757
740
  expect(resultSelectorsCount).toEqual(resultSelectors.length);
758
- const resultSelectorsLimit = yield nymph.getEntities({
741
+ const resultSelectorsLimit = await nymph.getEntities({
759
742
  class: testArtifacts_1.TestModel,
760
743
  limit: 1,
761
744
  return: 'count',
762
745
  });
763
746
  expect(resultSelectorsLimit).toEqual(1);
764
- const resultSelectorsSingle = yield nymph.getEntity({
747
+ const resultSelectorsSingle = await nymph.getEntity({
765
748
  class: testArtifacts_1.TestModel,
766
749
  return: 'count',
767
750
  });
768
751
  expect(resultSelectorsSingle).toEqual(1);
769
- const resultSelectorsEmpty = yield nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'count' }, { type: '&', ref: ['reference', (0, guid_1.guid)()] });
752
+ const resultSelectorsEmpty = await nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'count' }, { type: '&', ref: ['reference', (0, guid_1.guid)()] });
770
753
  expect(resultSelectorsEmpty).toEqual(0);
771
- }));
772
- it('guid return', () => __awaiter(this, void 0, void 0, function* () {
773
- var _f;
774
- yield createTestEntities();
775
- const resultGuid = yield nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'guid' }, {
754
+ });
755
+ it('guid return', async () => {
756
+ await createTestEntities();
757
+ const resultGuid = await nymph.getEntities({ class: testArtifacts_1.TestModel, return: 'guid' }, {
776
758
  type: '&',
777
759
  '!ref': [
778
760
  ['refArray', (0, guid_1.guid)()],
@@ -804,11 +786,11 @@ This one's zip code is 92064.`;
804
786
  ['array', 500],
805
787
  ],
806
788
  });
807
- expect(resultGuid.indexOf((_f = testEntity.guid) !== null && _f !== void 0 ? _f : '')).toBeGreaterThan(-1);
808
- }));
809
- it('deep selector', () => __awaiter(this, void 0, void 0, function* () {
810
- yield createTestEntities();
811
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
789
+ expect(resultGuid.indexOf(testEntity.guid ?? '')).toBeGreaterThan(-1);
790
+ });
791
+ it('deep selector', async () => {
792
+ await createTestEntities();
793
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
812
794
  type: '&',
813
795
  '!ref': [
814
796
  ['refArray', (0, guid_1.guid)()],
@@ -848,7 +830,7 @@ This one's zip code is 92064.`;
848
830
  ],
849
831
  });
850
832
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
851
- const resultEntity2 = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
833
+ const resultEntity2 = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
852
834
  type: '&',
853
835
  '!ref': [
854
836
  ['refArray', (0, guid_1.guid)()],
@@ -888,7 +870,7 @@ This one's zip code is 92064.`;
888
870
  ],
889
871
  });
890
872
  expect(testEntity.$inArray(resultEntity2)).toEqual(true);
891
- const resultEntity3 = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
873
+ const resultEntity3 = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
892
874
  type: '|',
893
875
  selector: [
894
876
  {
@@ -900,7 +882,7 @@ This one's zip code is 92064.`;
900
882
  ],
901
883
  });
902
884
  expect(testEntity.$inArray(resultEntity3)).toEqual(true);
903
- const resultEntity4 = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
885
+ const resultEntity4 = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
904
886
  type: '|',
905
887
  selector: [
906
888
  {
@@ -918,9 +900,9 @@ This one's zip code is 92064.`;
918
900
  ],
919
901
  });
920
902
  expect(testEntity.$inArray(resultEntity4)).toEqual(true);
921
- }));
922
- it('wrong deep selector', () => __awaiter(this, void 0, void 0, function* () {
923
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
903
+ });
904
+ it('wrong deep selector', async () => {
905
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
924
906
  type: '&',
925
907
  selector: [
926
908
  {
@@ -932,10 +914,10 @@ This one's zip code is 92064.`;
932
914
  ],
933
915
  });
934
916
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
935
- }));
936
- it('qref', () => __awaiter(this, void 0, void 0, function* () {
937
- yield createTestEntities();
938
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
917
+ });
918
+ it('qref', async () => {
919
+ await createTestEntities();
920
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
939
921
  type: '&',
940
922
  qref: [
941
923
  'reference',
@@ -943,10 +925,10 @@ This one's zip code is 92064.`;
943
925
  ],
944
926
  });
945
927
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
946
- }));
947
- it('not qref', () => __awaiter(this, void 0, void 0, function* () {
948
- yield createTestEntities();
949
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
928
+ });
929
+ it('not qref', async () => {
930
+ await createTestEntities();
931
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
950
932
  type: '&',
951
933
  '!qref': [
952
934
  'reference',
@@ -954,10 +936,10 @@ This one's zip code is 92064.`;
954
936
  ],
955
937
  });
956
938
  expect(testEntity.$inArray(resultEntity)).toEqual(true);
957
- }));
958
- it('wrong qref class', () => __awaiter(this, void 0, void 0, function* () {
959
- yield createTestEntities();
960
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
939
+ });
940
+ it('wrong qref class', async () => {
941
+ await createTestEntities();
942
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
961
943
  type: '&',
962
944
  qref: [
963
945
  'reference',
@@ -965,10 +947,10 @@ This one's zip code is 92064.`;
965
947
  ],
966
948
  });
967
949
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
968
- }));
969
- it('wrong qref data', () => __awaiter(this, void 0, void 0, function* () {
970
- yield createTestEntities();
971
- const resultEntity = yield nymph.getEntities({ class: testArtifacts_1.TestModel }, {
950
+ });
951
+ it('wrong qref data', async () => {
952
+ await createTestEntities();
953
+ const resultEntity = await nymph.getEntities({ class: testArtifacts_1.TestModel }, {
972
954
  type: '&',
973
955
  qref: [
974
956
  'reference',
@@ -976,20 +958,19 @@ This one's zip code is 92064.`;
976
958
  ],
977
959
  });
978
960
  expect(testEntity.$inArray(resultEntity)).toEqual(false);
979
- }));
980
- it('sort option', () => __awaiter(this, void 0, void 0, function* () {
981
- var _g, _h, _j, _k;
982
- yield createMultipleTestEntities();
961
+ });
962
+ it('sort option', async () => {
963
+ await createMultipleTestEntities();
983
964
  for (const sort of ['cdate', 'mdate']) {
984
- let resultEntities = yield nymph.getEntities({
965
+ let resultEntities = await nymph.getEntities({
985
966
  class: testArtifacts_1.TestModel,
986
967
  sort: sort,
987
968
  });
988
969
  expect(resultEntities.length).toBeGreaterThan(100);
989
970
  for (let i = 0; i < resultEntities.length - 1; i++) {
990
- expect(resultEntities[i + 1][sort]).toBeGreaterThan((_g = resultEntities[i][sort]) !== null && _g !== void 0 ? _g : 0);
971
+ expect(resultEntities[i + 1][sort]).toBeGreaterThan(resultEntities[i][sort] ?? 0);
991
972
  }
992
- let resultGuids = yield nymph.getEntities({
973
+ let resultGuids = await nymph.getEntities({
993
974
  class: testArtifacts_1.TestModel,
994
975
  sort: sort,
995
976
  return: 'guid',
@@ -998,135 +979,129 @@ This one's zip code is 92064.`;
998
979
  for (let i = 0; i < resultGuids.length - 1; i++) {
999
980
  expect(resultGuids[i]).toEqual(resultEntities[i].guid);
1000
981
  }
1001
- resultEntities = yield nymph.getEntities({
982
+ resultEntities = await nymph.getEntities({
1002
983
  class: testArtifacts_1.TestModel,
1003
984
  sort: sort,
1004
985
  reverse: true,
1005
986
  });
1006
987
  expect(resultEntities.length).toBeGreaterThan(100);
1007
988
  for (let i = 0; i < resultEntities.length - 1; i++) {
1008
- expect(resultEntities[i + 1][sort]).toBeLessThan((_h = resultEntities[i][sort]) !== null && _h !== void 0 ? _h : 0);
989
+ expect(resultEntities[i + 1][sort]).toBeLessThan(resultEntities[i][sort] ?? 0);
1009
990
  }
1010
- resultEntities = yield nymph.getEntities({ class: testArtifacts_1.TestModel, sort: sort }, { type: '&', match: ['name', '^Multi Test '] });
991
+ resultEntities = await nymph.getEntities({ class: testArtifacts_1.TestModel, sort: sort }, { type: '&', match: ['name', '^Multi Test '] });
1011
992
  expect(resultEntities.length).toEqual(100);
1012
993
  for (let i = 0; i < resultEntities.length - 1; i++) {
1013
- expect(resultEntities[i + 1][sort]).toBeGreaterThan((_j = resultEntities[i][sort]) !== null && _j !== void 0 ? _j : 0);
994
+ expect(resultEntities[i + 1][sort]).toBeGreaterThan(resultEntities[i][sort] ?? 0);
1014
995
  }
1015
- resultEntities = yield nymph.getEntities({ class: testArtifacts_1.TestModel, sort: sort, reverse: true }, { type: '&', match: ['name', '^Multi Test '] });
996
+ resultEntities = await nymph.getEntities({ class: testArtifacts_1.TestModel, sort: sort, reverse: true }, { type: '&', match: ['name', '^Multi Test '] });
1016
997
  expect(resultEntities.length).toEqual(100);
1017
998
  for (let i = 0; i < resultEntities.length - 1; i++) {
1018
- expect(resultEntities[i + 1][sort]).toBeLessThan((_k = resultEntities[i][sort]) !== null && _k !== void 0 ? _k : 0);
999
+ expect(resultEntities[i + 1][sort]).toBeLessThan(resultEntities[i][sort] ?? 0);
1019
1000
  }
1020
1001
  }
1021
- }));
1022
- it('delete reference', () => __awaiter(this, void 0, void 0, function* () {
1023
- var _l, _m;
1024
- yield createTestEntities();
1025
- expect(yield ((_l = testEntity.reference) === null || _l === void 0 ? void 0 : _l.$delete())).toEqual(true);
1026
- expect((_m = testEntity.reference) === null || _m === void 0 ? void 0 : _m.guid).toBeNull();
1027
- }));
1028
- it('delete', () => __awaiter(this, void 0, void 0, function* () {
1029
- yield createTestEntities();
1030
- expect(yield testEntity.$delete()).toEqual(true);
1002
+ });
1003
+ it('delete reference', async () => {
1004
+ await createTestEntities();
1005
+ expect(await testEntity.reference?.$delete()).toEqual(true);
1006
+ expect(testEntity.reference?.guid).toBeNull();
1007
+ });
1008
+ it('delete', async () => {
1009
+ await createTestEntities();
1010
+ expect(await testEntity.$delete()).toEqual(true);
1031
1011
  expect(testEntity.guid).toBeNull();
1032
- const entity = yield nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid });
1012
+ const entity = await nymph.getEntity({ class: testArtifacts_1.TestModel }, { type: '&', guid: testGuid });
1033
1013
  expect(entity).toBeNull();
1034
- }));
1014
+ });
1035
1015
  }
1036
1016
  exports.QueriesTest = QueriesTest;
1037
1017
  function UIDTest(nymph, it) {
1038
1018
  nymph.addEntityClass(testArtifacts_1.TestModel);
1039
1019
  nymph.addEntityClass(testArtifacts_1.TestBModel);
1040
- it('delete old test data', () => __awaiter(this, void 0, void 0, function* () {
1041
- expect(yield nymph.deleteUID('TestUID')).toEqual(true);
1042
- expect(yield nymph.deleteUID('NewUID')).toEqual(true);
1043
- }));
1044
- it('new UID', () => __awaiter(this, void 0, void 0, function* () {
1045
- expect(yield nymph.newUID('TestUID')).toEqual(1);
1046
- }));
1047
- it('increment UID', () => __awaiter(this, void 0, void 0, function* () {
1048
- expect(yield nymph.newUID('TestUID')).toEqual(2);
1049
- }));
1050
- it('retrieve UID', () => __awaiter(this, void 0, void 0, function* () {
1051
- expect(yield nymph.getUID('TestUID')).toEqual(2);
1052
- }));
1053
- it('rename UID', () => __awaiter(this, void 0, void 0, function* () {
1054
- expect(yield nymph.renameUID('TestUID', 'NewUID')).toEqual(true);
1055
- expect(yield nymph.getUID('TestUID')).toBeNull();
1056
- expect(yield nymph.getUID('NewUID')).toEqual(2);
1057
- expect(yield nymph.renameUID('NewUID', 'TestUID')).toEqual(true);
1058
- expect(yield nymph.getUID('NewUID')).toBeNull();
1059
- expect(yield nymph.getUID('TestUID')).toEqual(2);
1060
- }));
1061
- it('set UID', () => __awaiter(this, void 0, void 0, function* () {
1062
- expect(yield nymph.setUID('TestUID', 5)).toEqual(true);
1063
- expect(yield nymph.getUID('TestUID')).toEqual(5);
1064
- }));
1065
- it('delete UID', () => __awaiter(this, void 0, void 0, function* () {
1066
- expect(yield nymph.deleteUID('TestUID')).toEqual(true);
1067
- expect(yield nymph.getUID('TestUID')).toBeNull();
1068
- }));
1020
+ it('delete old test data', async () => {
1021
+ expect(await nymph.deleteUID('TestUID')).toEqual(true);
1022
+ expect(await nymph.deleteUID('NewUID')).toEqual(true);
1023
+ });
1024
+ it('new UID', async () => {
1025
+ expect(await nymph.newUID('TestUID')).toEqual(1);
1026
+ });
1027
+ it('increment UID', async () => {
1028
+ expect(await nymph.newUID('TestUID')).toEqual(2);
1029
+ });
1030
+ it('retrieve UID', async () => {
1031
+ expect(await nymph.getUID('TestUID')).toEqual(2);
1032
+ });
1033
+ it('rename UID', async () => {
1034
+ expect(await nymph.renameUID('TestUID', 'NewUID')).toEqual(true);
1035
+ expect(await nymph.getUID('TestUID')).toBeNull();
1036
+ expect(await nymph.getUID('NewUID')).toEqual(2);
1037
+ expect(await nymph.renameUID('NewUID', 'TestUID')).toEqual(true);
1038
+ expect(await nymph.getUID('NewUID')).toBeNull();
1039
+ expect(await nymph.getUID('TestUID')).toEqual(2);
1040
+ });
1041
+ it('set UID', async () => {
1042
+ expect(await nymph.setUID('TestUID', 5)).toEqual(true);
1043
+ expect(await nymph.getUID('TestUID')).toEqual(5);
1044
+ });
1045
+ it('delete UID', async () => {
1046
+ expect(await nymph.deleteUID('TestUID')).toEqual(true);
1047
+ expect(await nymph.getUID('TestUID')).toBeNull();
1048
+ });
1069
1049
  }
1070
1050
  exports.UIDTest = UIDTest;
1071
1051
  function ExportImportTest(nymph, it) {
1072
1052
  nymph.addEntityClass(testArtifacts_1.TestModel);
1073
1053
  nymph.addEntityClass(testArtifacts_1.TestBModel);
1074
- function deleteTestData() {
1075
- return __awaiter(this, void 0, void 0, function* () {
1076
- let all = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
1077
- expect(Array.isArray(all)).toEqual(true);
1078
- for (const cur of all) {
1079
- expect(yield cur.$delete()).toEqual(true);
1080
- }
1081
- all = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
1082
- expect(all.length).toEqual(0);
1083
- all = yield nymph.getEntities({ class: testArtifacts_1.TestBModel });
1084
- expect(Array.isArray(all)).toEqual(true);
1085
- for (const cur of all) {
1086
- expect(yield cur.$delete()).toEqual(true);
1087
- }
1088
- all = yield nymph.getEntities({ class: testArtifacts_1.TestBModel });
1089
- expect(all.length).toEqual(0);
1090
- expect(yield nymph.deleteUID('TestUID')).toEqual(true);
1091
- expect(yield nymph.deleteUID('TestUID2')).toEqual(true);
1092
- });
1054
+ async function deleteTestData() {
1055
+ let all = await nymph.getEntities({ class: testArtifacts_1.TestModel });
1056
+ expect(Array.isArray(all)).toEqual(true);
1057
+ for (const cur of all) {
1058
+ expect(await cur.$delete()).toEqual(true);
1059
+ }
1060
+ all = await nymph.getEntities({ class: testArtifacts_1.TestModel });
1061
+ expect(all.length).toEqual(0);
1062
+ all = await nymph.getEntities({ class: testArtifacts_1.TestBModel });
1063
+ expect(Array.isArray(all)).toEqual(true);
1064
+ for (const cur of all) {
1065
+ expect(await cur.$delete()).toEqual(true);
1066
+ }
1067
+ all = await nymph.getEntities({ class: testArtifacts_1.TestBModel });
1068
+ expect(all.length).toEqual(0);
1069
+ expect(await nymph.deleteUID('TestUID')).toEqual(true);
1070
+ expect(await nymph.deleteUID('TestUID2')).toEqual(true);
1093
1071
  }
1094
- function checkEntityDataAndCount() {
1095
- var _a, _b, _c, _d, _e, _f, _g, _h;
1096
- return __awaiter(this, void 0, void 0, function* () {
1097
- expect(yield nymph.getUID('TestUID')).toEqual(2);
1098
- expect(yield nymph.getUID('TestUID2')).toEqual(1);
1099
- const models = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
1100
- const bmodels = yield nymph.getEntities({ class: testArtifacts_1.TestBModel });
1101
- expect(models.length).toEqual(30);
1102
- expect(bmodels.length).toEqual(10);
1103
- const all = [...models, ...bmodels];
1104
- for (const model of all) {
1105
- if ((_a = model.index) === null || _a === void 0 ? void 0 : _a.match(/^\d+a$/)) {
1106
- expect(model.null).toBeNull();
1107
- expect(model.string).toEqual('test');
1108
- expect(model.array).toEqual(['full', 'of', 'values', 500]);
1109
- expect(model.number).toEqual(30);
1110
- expect(model.timestamp).toBeGreaterThanOrEqual((0, strtotime_1.default)('-2 minutes'));
1111
- expect((_b = model.reference) === null || _b === void 0 ? void 0 : _b.guid).not.toBeNull();
1112
- expect((_c = model.reference) === null || _c === void 0 ? void 0 : _c.string).toEqual('another');
1113
- expect((_e = (_d = model.reference) === null || _d === void 0 ? void 0 : _d.index) === null || _e === void 0 ? void 0 : _e.match(/^\d+b$/)).toBeTruthy();
1114
- expect((_f = model.refArray) === null || _f === void 0 ? void 0 : _f[0].guid).not.toBeNull();
1115
- expect((_g = model.refArray) === null || _g === void 0 ? void 0 : _g[0].guid).toEqual((_h = model.reference) === null || _h === void 0 ? void 0 : _h.guid);
1116
- }
1072
+ async function checkEntityDataAndCount() {
1073
+ expect(await nymph.getUID('TestUID')).toEqual(2);
1074
+ expect(await nymph.getUID('TestUID2')).toEqual(1);
1075
+ const models = await nymph.getEntities({ class: testArtifacts_1.TestModel });
1076
+ const bmodels = await nymph.getEntities({ class: testArtifacts_1.TestBModel });
1077
+ expect(models.length).toEqual(30);
1078
+ expect(bmodels.length).toEqual(10);
1079
+ const all = [...models, ...bmodels];
1080
+ for (const model of all) {
1081
+ if (model.index?.match(/^\d+a$/)) {
1082
+ expect(model.null).toBeNull();
1083
+ expect(model.string).toEqual('test');
1084
+ expect(model.array).toEqual(['full', 'of', 'values', 500]);
1085
+ expect(model.number).toEqual(30);
1086
+ expect(model.timestamp).toBeGreaterThanOrEqual((0, strtotime_1.default)('-2 minutes'));
1087
+ expect(model.reference?.guid).not.toBeNull();
1088
+ expect(model.reference?.string).toEqual('another');
1089
+ expect(model.reference?.index?.match(/^\d+b$/)).toBeTruthy();
1090
+ expect(model.refArray?.[0].guid).not.toBeNull();
1091
+ expect(model.refArray?.[0].guid).toEqual(model.reference?.guid);
1117
1092
  }
1118
- });
1093
+ }
1119
1094
  }
1120
- it('delete old test data', () => __awaiter(this, void 0, void 0, function* () {
1121
- yield deleteTestData();
1122
- }));
1123
- it('setup data', () => __awaiter(this, void 0, void 0, function* () {
1124
- expect(yield nymph.newUID('TestUID')).toEqual(1);
1125
- expect(yield nymph.newUID('TestUID')).toEqual(2);
1126
- expect(yield nymph.newUID('TestUID2')).toEqual(1);
1095
+ it('delete old test data', async () => {
1096
+ await deleteTestData();
1097
+ });
1098
+ it('setup data', async () => {
1099
+ expect(await nymph.newUID('TestUID')).toEqual(1);
1100
+ expect(await nymph.newUID('TestUID')).toEqual(2);
1101
+ expect(await nymph.newUID('TestUID2')).toEqual(1);
1127
1102
  for (let i = 0; i < 20; i++) {
1128
1103
  const EntityClass = i < 15 ? testArtifacts_1.TestModel : testArtifacts_1.TestBModel;
1129
- const testEntity = yield EntityClass.factory();
1104
+ const testEntity = await EntityClass.factory();
1130
1105
  testEntity.name = 'Entity Test ' + new Date().toLocaleString();
1131
1106
  testEntity.null = null;
1132
1107
  testEntity.string = 'test';
@@ -1134,33 +1109,33 @@ function ExportImportTest(nymph, it) {
1134
1109
  testEntity.number = 30;
1135
1110
  testEntity.timestamp = Date.now();
1136
1111
  testEntity.index = i + 'a';
1137
- const entityReferenceTest = yield EntityClass.factory();
1112
+ const entityReferenceTest = await EntityClass.factory();
1138
1113
  entityReferenceTest.string = 'another';
1139
1114
  entityReferenceTest.index = i + 'b';
1140
- expect(yield entityReferenceTest.$save()).toEqual(true);
1115
+ expect(await entityReferenceTest.$save()).toEqual(true);
1141
1116
  testEntity.reference = entityReferenceTest;
1142
1117
  testEntity.refArray = [entityReferenceTest];
1143
- expect(yield testEntity.$save()).toEqual(true);
1118
+ expect(await testEntity.$save()).toEqual(true);
1144
1119
  }
1145
- yield checkEntityDataAndCount();
1146
- }));
1147
- it('export data', () => __awaiter(this, void 0, void 0, function* () {
1148
- expect(yield nymph.export(__dirname + '/testentityexport.nex')).toEqual(true);
1149
- }));
1150
- it('delete test data again', () => __awaiter(this, void 0, void 0, function* () {
1151
- yield deleteTestData();
1152
- }));
1153
- it('import data', () => __awaiter(this, void 0, void 0, function* () {
1154
- expect(yield nymph.getUID('TestUID')).toBeNull();
1155
- expect(yield nymph.getUID('TestUID2')).toBeNull();
1156
- const models = yield nymph.getEntities({ class: testArtifacts_1.TestModel });
1157
- const bmodels = yield nymph.getEntities({ class: testArtifacts_1.TestBModel });
1120
+ await checkEntityDataAndCount();
1121
+ });
1122
+ it('export data', async () => {
1123
+ expect(await nymph.export(__dirname + '/testentityexport.nex')).toEqual(true);
1124
+ });
1125
+ it('delete test data again', async () => {
1126
+ await deleteTestData();
1127
+ });
1128
+ it('import data', async () => {
1129
+ expect(await nymph.getUID('TestUID')).toBeNull();
1130
+ expect(await nymph.getUID('TestUID2')).toBeNull();
1131
+ const models = await nymph.getEntities({ class: testArtifacts_1.TestModel });
1132
+ const bmodels = await nymph.getEntities({ class: testArtifacts_1.TestBModel });
1158
1133
  expect(models.length).toEqual(0);
1159
1134
  expect(bmodels.length).toEqual(0);
1160
- expect(yield nymph.import(__dirname + '/testentityexport.nex')).toEqual(true);
1161
- yield checkEntityDataAndCount();
1135
+ expect(await nymph.import(__dirname + '/testentityexport.nex')).toEqual(true);
1136
+ await checkEntityDataAndCount();
1162
1137
  fs_1.default.unlinkSync(__dirname + '/testentityexport.nex');
1163
- }));
1138
+ });
1164
1139
  }
1165
1140
  exports.ExportImportTest = ExportImportTest;
1166
1141
  //# sourceMappingURL=testArtifacts.js.map