@nymphjs/nymph 1.0.0-beta.11 → 1.0.0-beta.111
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/CHANGELOG.md +540 -0
- package/README.md +23 -21
- package/dist/Entity.d.ts +293 -10
- package/dist/Entity.js +560 -148
- package/dist/Entity.js.map +1 -1
- package/dist/Entity.test.js +52 -13
- package/dist/Entity.test.js.map +1 -1
- package/dist/Entity.types.d.ts +256 -23
- package/dist/Entity.types.js +1 -2
- package/dist/Nymph.d.ts +586 -12
- package/dist/Nymph.js +844 -179
- package/dist/Nymph.js.map +1 -1
- package/dist/Nymph.types.d.ts +81 -8
- package/dist/Nymph.types.js +3 -5
- package/dist/Nymph.types.js.map +1 -1
- package/dist/conf/d.d.ts +43 -0
- package/dist/conf/d.js +1 -2
- package/dist/conf/defaults.d.ts +1 -1
- package/dist/conf/defaults.js +26 -3
- package/dist/conf/defaults.js.map +1 -1
- package/dist/conf/index.d.ts +2 -2
- package/dist/conf/index.js +2 -8
- package/dist/conf/index.js.map +1 -1
- package/dist/driver/NymphDriver.d.ts +201 -40
- package/dist/driver/NymphDriver.js +685 -239
- package/dist/driver/NymphDriver.js.map +1 -1
- package/dist/driver/index.d.ts +2 -2
- package/dist/driver/index.js +3 -23
- package/dist/driver/index.js.map +1 -1
- package/dist/driver/testArtifacts.d.ts +2 -2
- package/dist/driver/testArtifacts.js +909 -93
- package/dist/driver/testArtifacts.js.map +1 -1
- package/dist/errors/ClassNotAvailableError.js +1 -5
- package/dist/errors/ClassNotAvailableError.js.map +1 -1
- package/dist/errors/EntityConflictError.js +1 -5
- package/dist/errors/EntityConflictError.js.map +1 -1
- package/dist/errors/EntityInvalidDataError.d.ts +6 -0
- package/dist/errors/EntityInvalidDataError.js +8 -6
- package/dist/errors/EntityInvalidDataError.js.map +1 -1
- package/dist/errors/EntityIsSleepingReferenceError.js +1 -5
- package/dist/errors/EntityIsSleepingReferenceError.js.map +1 -1
- package/dist/errors/EntityUniqueConstraintError.d.ts +3 -0
- package/dist/errors/EntityUniqueConstraintError.js +7 -0
- package/dist/errors/EntityUniqueConstraintError.js.map +1 -0
- package/dist/errors/HttpError.d.ts +5 -0
- package/dist/errors/HttpError.js +11 -0
- package/dist/errors/HttpError.js.map +1 -0
- package/dist/errors/InvalidParametersError.js +1 -5
- package/dist/errors/InvalidParametersError.js.map +1 -1
- package/dist/errors/InvalidStateError.d.ts +3 -0
- package/dist/errors/InvalidStateError.js +7 -0
- package/dist/errors/InvalidStateError.js.map +1 -0
- package/dist/errors/NotConfiguredError.js +1 -5
- package/dist/errors/NotConfiguredError.js.map +1 -1
- package/dist/errors/QueryFailedError.d.ts +2 -1
- package/dist/errors/QueryFailedError.js +5 -6
- package/dist/errors/QueryFailedError.js.map +1 -1
- package/dist/errors/UnableToConnectError.js +1 -5
- package/dist/errors/UnableToConnectError.js.map +1 -1
- package/dist/errors/index.d.ts +11 -8
- package/dist/errors/index.js +11 -24
- package/dist/errors/index.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +14 -34
- package/dist/index.js.map +1 -1
- package/dist/nymphJoiProps.d.ts +1 -1
- package/dist/nymphJoiProps.js +10 -15
- package/dist/nymphJoiProps.js.map +1 -1
- package/dist/testArtifacts.d.ts +19 -6
- package/dist/testArtifacts.js +32 -37
- package/dist/testArtifacts.js.map +1 -1
- package/dist/testMocks.d.ts +27 -12
- package/dist/testMocks.js +40 -29
- package/dist/testMocks.js.map +1 -1
- package/dist/utils.d.ts +4 -4
- package/dist/utils.js +40 -29
- package/dist/utils.js.map +1 -1
- package/jest.config.js +11 -2
- package/package.json +24 -20
- package/src/Entity.test.ts +50 -7
- package/src/Entity.ts +489 -150
- package/src/Entity.types.ts +72 -74
- package/src/Nymph.ts +985 -322
- package/src/Nymph.types.ts +150 -27
- package/src/conf/d.ts +25 -0
- package/src/conf/defaults.ts +34 -1
- package/src/conf/index.ts +2 -2
- package/src/driver/NymphDriver.ts +859 -412
- package/src/driver/index.ts +2 -2
- package/src/driver/testArtifacts.ts +1090 -186
- package/src/errors/EntityUniqueConstraintError.ts +6 -0
- package/src/errors/HttpError.ts +12 -0
- package/src/errors/InvalidStateError.ts +6 -0
- package/src/errors/QueryFailedError.ts +3 -1
- package/src/errors/index.ts +14 -8
- package/src/index.ts +11 -11
- package/src/nymphJoiProps.ts +2 -2
- package/src/testArtifacts.ts +20 -20
- package/src/testMocks.ts +76 -35
- package/src/type/locutus.d.ts +3 -0
- package/src/utils.ts +39 -18
- package/tsconfig.json +5 -3
- package/typedoc.json +4 -0
|
@@ -1,20 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import strtotime from 'locutus/php/datetime/strtotime.js';
|
|
3
5
|
import { guid } from '@nymphjs/guid';
|
|
4
6
|
|
|
5
|
-
import type Nymph from '../Nymph';
|
|
7
|
+
import type Nymph from '../Nymph.js';
|
|
8
|
+
import { EntityUniqueConstraintError } from '../errors/index.js';
|
|
6
9
|
import {
|
|
7
10
|
TestBModel as TestBModelClass,
|
|
8
11
|
TestModel as TestModelClass,
|
|
9
12
|
TestModelData,
|
|
10
|
-
|
|
13
|
+
TestEmptyModel as TestEmptyModelClass,
|
|
14
|
+
} from '../testArtifacts.js';
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
|
|
18
|
+
export function EntitiesTest(
|
|
13
19
|
nymph: Nymph,
|
|
14
|
-
it: (name: string, fn: () => void) => void
|
|
20
|
+
it: (name: string, fn: () => void) => void,
|
|
15
21
|
) {
|
|
16
22
|
const TestModel = nymph.addEntityClass(TestModelClass);
|
|
17
23
|
const TestBModel = nymph.addEntityClass(TestBModelClass);
|
|
24
|
+
const TestEmptyModel = nymph.addEntityClass(TestEmptyModelClass);
|
|
18
25
|
|
|
19
26
|
let testEntity: TestModelClass & TestModelData;
|
|
20
27
|
let testGuid: string;
|
|
@@ -34,12 +41,16 @@ export function QueriesTest(
|
|
|
34
41
|
testEntity.name = 'Entity Test ' + new Date().toLocaleString();
|
|
35
42
|
testEntity.null = null;
|
|
36
43
|
testEntity.string = 'test';
|
|
37
|
-
testEntity.array = [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
testEntity.array = [
|
|
45
|
+
'full',
|
|
46
|
+
'of',
|
|
47
|
+
'values',
|
|
48
|
+
500,
|
|
49
|
+
{ test: true },
|
|
50
|
+
{ nullbyte: '\\\x00\u0000 \x00' },
|
|
51
|
+
];
|
|
52
|
+
testEntity.match = matchValue;
|
|
53
|
+
testEntity.search = searchValue;
|
|
43
54
|
testEntity.number = 30;
|
|
44
55
|
testEntity.numberString = '30';
|
|
45
56
|
testEntity.timestamp = Date.now();
|
|
@@ -59,18 +70,10 @@ This one's zip code is 92064.`;
|
|
|
59
70
|
entityReferenceTest.test = 'good';
|
|
60
71
|
expect(await entityReferenceTest.$save()).toEqual(true);
|
|
61
72
|
|
|
62
|
-
// Test synchronous getEntity.
|
|
63
|
-
testEntity = nymph.driver.getEntitySync(
|
|
64
|
-
{ class: TestModel },
|
|
65
|
-
testGuid
|
|
66
|
-
) as TestModelClass & TestModelData;
|
|
67
|
-
expect(testEntity).toBeInstanceOf(TestModel);
|
|
68
|
-
expect(testEntity.guid).toEqual(testGuid);
|
|
69
|
-
|
|
70
73
|
// Test asynchronous getEntity.
|
|
71
74
|
testEntity = (await nymph.getEntity(
|
|
72
75
|
{ class: TestModel },
|
|
73
|
-
testGuid
|
|
76
|
+
testGuid,
|
|
74
77
|
)) as TestModelClass & TestModelData;
|
|
75
78
|
expect(testEntity).toBeInstanceOf(TestModel);
|
|
76
79
|
expect(testEntity.guid).toEqual(testGuid);
|
|
@@ -84,6 +87,8 @@ This one's zip code is 92064.`;
|
|
|
84
87
|
for (let i = 0; i < 100; i++) {
|
|
85
88
|
const testEntity = await TestModel.factory();
|
|
86
89
|
testEntity.name = `Multi Test ${i}`;
|
|
90
|
+
// Reverse the number for sort testing.
|
|
91
|
+
testEntity.number = 100 - i;
|
|
87
92
|
testEntity.$removeTag('test');
|
|
88
93
|
testEntity.$addTag('multiTest');
|
|
89
94
|
expect(await testEntity.$save()).toEqual(true);
|
|
@@ -94,20 +99,36 @@ This one's zip code is 92064.`;
|
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
it('delete old test data', async () => {
|
|
97
|
-
let
|
|
98
|
-
expect(Array.isArray(
|
|
99
|
-
for (const cur of
|
|
102
|
+
let amodels = await nymph.getEntities({ class: TestModel });
|
|
103
|
+
expect(Array.isArray(amodels)).toEqual(true);
|
|
104
|
+
for (const cur of amodels) {
|
|
100
105
|
expect(await cur.$delete()).toEqual(true);
|
|
101
106
|
}
|
|
102
107
|
|
|
103
|
-
|
|
104
|
-
expect(
|
|
108
|
+
amodels = await nymph.getEntities({ class: TestModel });
|
|
109
|
+
expect(amodels.length).toEqual(0);
|
|
110
|
+
|
|
111
|
+
let bmodels = await nymph.getEntities({ class: TestBModel });
|
|
112
|
+
expect(Array.isArray(bmodels)).toEqual(true);
|
|
113
|
+
for (const cur of bmodels) {
|
|
114
|
+
expect(await cur.$delete()).toEqual(true);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
bmodels = await nymph.getEntities({ class: TestBModel });
|
|
118
|
+
expect(bmodels.length).toEqual(0);
|
|
105
119
|
});
|
|
106
120
|
|
|
107
121
|
it('create entity', async () => {
|
|
108
122
|
await createTestEntities();
|
|
109
123
|
});
|
|
110
124
|
|
|
125
|
+
it("doesn't create empty entity", async () => {
|
|
126
|
+
const testEntity = await TestEmptyModel.factory();
|
|
127
|
+
|
|
128
|
+
expect(await testEntity.$save()).toBeFalsy();
|
|
129
|
+
expect(testEntity.guid).toBeNull();
|
|
130
|
+
});
|
|
131
|
+
|
|
111
132
|
it('update mdate on save', async () => {
|
|
112
133
|
await createTestEntities();
|
|
113
134
|
|
|
@@ -139,6 +160,148 @@ This one's zip code is 92064.`;
|
|
|
139
160
|
expect(testEntity.$is(resultEntity)).toEqual(false);
|
|
140
161
|
});
|
|
141
162
|
|
|
163
|
+
it('guaranteed guid', async () => {
|
|
164
|
+
// Creating entity...
|
|
165
|
+
const testEntity = await TestModel.factory();
|
|
166
|
+
|
|
167
|
+
// Saving entity...
|
|
168
|
+
testEntity.name = 'Entity Test ' + new Date().toLocaleString();
|
|
169
|
+
testEntity.null = null;
|
|
170
|
+
testEntity.string = 'test';
|
|
171
|
+
testEntity.array = [];
|
|
172
|
+
testEntity.match = matchValue;
|
|
173
|
+
testEntity.number = 30;
|
|
174
|
+
testEntity.numberString = '30';
|
|
175
|
+
testEntity.timestamp = Date.now();
|
|
176
|
+
|
|
177
|
+
// Get the guaranteed GUID.
|
|
178
|
+
const testGuid = testEntity.$getGuaranteedGUID();
|
|
179
|
+
|
|
180
|
+
expect(await testEntity.$save()).toEqual(true);
|
|
181
|
+
expect(testEntity.guid).not.toBeNull();
|
|
182
|
+
expect(testEntity.guid).toEqual(testGuid);
|
|
183
|
+
|
|
184
|
+
// Retrieving entity by GUID...
|
|
185
|
+
let resultEntity = await nymph.getEntity({ class: TestModel }, testGuid);
|
|
186
|
+
expect(testEntity.$is(resultEntity)).toEqual(true);
|
|
187
|
+
|
|
188
|
+
// Delete the entity.
|
|
189
|
+
expect(await testEntity.$delete()).toEqual(true);
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
it('create, list, and delete indexes', async () => {
|
|
193
|
+
// Delete existing indexes.
|
|
194
|
+
const existingIndexes = await nymph.getIndexes(TestModel.ETYPE);
|
|
195
|
+
for (let index of existingIndexes) {
|
|
196
|
+
await nymph.deleteIndex(TestModel.ETYPE, index.scope, index.name);
|
|
197
|
+
}
|
|
198
|
+
const existingBIndexes = await nymph.getIndexes(TestBModel.ETYPE);
|
|
199
|
+
for (let index of existingBIndexes) {
|
|
200
|
+
await nymph.deleteIndex(TestBModel.ETYPE, index.scope, index.name);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const sortByName = (arr: { name: string }[]) => {
|
|
204
|
+
arr.sort((a, b) => a.name.localeCompare(b.name));
|
|
205
|
+
return arr;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
expect(
|
|
209
|
+
await nymph.addIndex(TestModel.ETYPE, {
|
|
210
|
+
scope: 'data',
|
|
211
|
+
name: 'testindex',
|
|
212
|
+
property: 'test',
|
|
213
|
+
}),
|
|
214
|
+
).toEqual(true);
|
|
215
|
+
|
|
216
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
217
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
218
|
+
]);
|
|
219
|
+
|
|
220
|
+
expect(
|
|
221
|
+
await nymph.addIndex(TestModel.ETYPE, {
|
|
222
|
+
scope: 'data',
|
|
223
|
+
name: 'secondone',
|
|
224
|
+
property: 'match',
|
|
225
|
+
}),
|
|
226
|
+
).toEqual(true);
|
|
227
|
+
|
|
228
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
229
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
230
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
231
|
+
]);
|
|
232
|
+
|
|
233
|
+
expect(
|
|
234
|
+
await nymph.addIndex(TestModel.ETYPE, {
|
|
235
|
+
scope: 'references',
|
|
236
|
+
name: 'refone',
|
|
237
|
+
property: 'reference',
|
|
238
|
+
}),
|
|
239
|
+
).toEqual(true);
|
|
240
|
+
|
|
241
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
242
|
+
{ scope: 'references', name: 'refone', property: 'reference' },
|
|
243
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
244
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
expect(
|
|
248
|
+
await nymph.addIndex(TestModel.ETYPE, {
|
|
249
|
+
scope: 'tokens',
|
|
250
|
+
name: 'tokenone',
|
|
251
|
+
property: 'search',
|
|
252
|
+
}),
|
|
253
|
+
).toEqual(true);
|
|
254
|
+
|
|
255
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
256
|
+
{ scope: 'references', name: 'refone', property: 'reference' },
|
|
257
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
258
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
259
|
+
{ scope: 'tokens', name: 'tokenone', property: 'search' },
|
|
260
|
+
]);
|
|
261
|
+
|
|
262
|
+
expect(
|
|
263
|
+
await nymph.addIndex(TestBModel.ETYPE, {
|
|
264
|
+
scope: 'data',
|
|
265
|
+
name: 'flooflab',
|
|
266
|
+
property: 'string',
|
|
267
|
+
}),
|
|
268
|
+
).toEqual(true);
|
|
269
|
+
|
|
270
|
+
expect(sortByName(await nymph.getIndexes(TestBModel.ETYPE))).toEqual([
|
|
271
|
+
{ scope: 'data', name: 'flooflab', property: 'string' },
|
|
272
|
+
]);
|
|
273
|
+
|
|
274
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
275
|
+
{ scope: 'references', name: 'refone', property: 'reference' },
|
|
276
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
277
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
278
|
+
{ scope: 'tokens', name: 'tokenone', property: 'search' },
|
|
279
|
+
]);
|
|
280
|
+
|
|
281
|
+
expect(
|
|
282
|
+
await nymph.deleteIndex(TestBModel.ETYPE, 'data', 'flooflab'),
|
|
283
|
+
).toEqual(true);
|
|
284
|
+
|
|
285
|
+
expect(await nymph.getIndexes(TestBModel.ETYPE)).toEqual([]);
|
|
286
|
+
|
|
287
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
288
|
+
{ scope: 'references', name: 'refone', property: 'reference' },
|
|
289
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
290
|
+
{ scope: 'data', name: 'testindex', property: 'test' },
|
|
291
|
+
{ scope: 'tokens', name: 'tokenone', property: 'search' },
|
|
292
|
+
]);
|
|
293
|
+
|
|
294
|
+
expect(
|
|
295
|
+
await nymph.deleteIndex(TestModel.ETYPE, 'data', 'testindex'),
|
|
296
|
+
).toEqual(true);
|
|
297
|
+
|
|
298
|
+
expect(sortByName(await nymph.getIndexes(TestModel.ETYPE))).toEqual([
|
|
299
|
+
{ scope: 'references', name: 'refone', property: 'reference' },
|
|
300
|
+
{ scope: 'data', name: 'secondone', property: 'match' },
|
|
301
|
+
{ scope: 'tokens', name: 'tokenone', property: 'search' },
|
|
302
|
+
]);
|
|
303
|
+
});
|
|
304
|
+
|
|
142
305
|
it('transactions', async () => {
|
|
143
306
|
await createTestEntities();
|
|
144
307
|
|
|
@@ -150,7 +313,7 @@ This one's zip code is 92064.`;
|
|
|
150
313
|
|
|
151
314
|
if (!(await transaction.inTransaction())) {
|
|
152
315
|
console.log(
|
|
153
|
-
'This Nymph driver or database seems to not support transactions. Skipping transaction tests.'
|
|
316
|
+
'This Nymph driver or database seems to not support transactions. Skipping transaction tests.',
|
|
154
317
|
);
|
|
155
318
|
await transaction.rollback('test');
|
|
156
319
|
return;
|
|
@@ -181,7 +344,7 @@ This one's zip code is 92064.`;
|
|
|
181
344
|
expect(await testEntity.$delete()).toEqual(true);
|
|
182
345
|
const resultEntity = await transaction.getEntity(
|
|
183
346
|
{ class: TestModel },
|
|
184
|
-
testGuid
|
|
347
|
+
testGuid,
|
|
185
348
|
);
|
|
186
349
|
expect(resultEntity).toBeNull();
|
|
187
350
|
|
|
@@ -194,13 +357,13 @@ This one's zip code is 92064.`;
|
|
|
194
357
|
// Verify it's back.
|
|
195
358
|
testEntity = (await transaction.getEntity(
|
|
196
359
|
{ class: TestModel },
|
|
197
|
-
testGuid
|
|
360
|
+
testGuid,
|
|
198
361
|
)) as TestModelClass & TestModelData;
|
|
199
362
|
|
|
200
363
|
expect(testEntity.guid).toEqual(testGuid);
|
|
201
364
|
|
|
202
|
-
// Start a new transaction.
|
|
203
|
-
transaction = await nymph.startTransaction('test');
|
|
365
|
+
// Start a new transaction with a dot in the name.
|
|
366
|
+
transaction = await nymph.startTransaction('test.1');
|
|
204
367
|
testEntity.$nymph = transaction;
|
|
205
368
|
|
|
206
369
|
// Verify in a transaction.
|
|
@@ -211,7 +374,7 @@ This one's zip code is 92064.`;
|
|
|
211
374
|
expect(await testEntity.$save()).toEqual(true);
|
|
212
375
|
|
|
213
376
|
// Commit the transaction.
|
|
214
|
-
await transaction.commit('test');
|
|
377
|
+
await transaction.commit('test.1');
|
|
215
378
|
testEntity.$nymph = nymph;
|
|
216
379
|
|
|
217
380
|
// Verify not in a transaction.
|
|
@@ -232,7 +395,7 @@ This one's zip code is 92064.`;
|
|
|
232
395
|
await createTestEntities();
|
|
233
396
|
|
|
234
397
|
// Testing entity order, offset, limit...
|
|
235
|
-
|
|
398
|
+
let resultEntities = await nymph.getEntities(
|
|
236
399
|
{
|
|
237
400
|
class: TestModel,
|
|
238
401
|
reverse: true,
|
|
@@ -240,10 +403,21 @@ This one's zip code is 92064.`;
|
|
|
240
403
|
limit: 1,
|
|
241
404
|
sort: 'cdate',
|
|
242
405
|
},
|
|
243
|
-
{ type: '&', tag: 'test' }
|
|
406
|
+
{ type: '&', tag: 'test' },
|
|
244
407
|
);
|
|
245
408
|
expect(resultEntities.length).toEqual(1);
|
|
246
409
|
expect(testEntity.$is(resultEntities[0])).toEqual(true);
|
|
410
|
+
|
|
411
|
+
// Testing null sort...
|
|
412
|
+
resultEntities = await nymph.getEntities(
|
|
413
|
+
{
|
|
414
|
+
class: TestModel,
|
|
415
|
+
reverse: true,
|
|
416
|
+
sort: null,
|
|
417
|
+
},
|
|
418
|
+
{ type: '&', tag: 'test' },
|
|
419
|
+
);
|
|
420
|
+
expect(testEntity.$inArray(resultEntities)).toEqual(true);
|
|
247
421
|
});
|
|
248
422
|
|
|
249
423
|
it('guid and tags', async () => {
|
|
@@ -252,7 +426,7 @@ This one's zip code is 92064.`;
|
|
|
252
426
|
// Retrieving entity by GUID and tags...
|
|
253
427
|
const resultEntity = await nymph.getEntity(
|
|
254
428
|
{ class: TestModel },
|
|
255
|
-
{ type: '&', guid: testGuid, tag: 'test' }
|
|
429
|
+
{ type: '&', guid: testGuid, tag: 'test' },
|
|
256
430
|
);
|
|
257
431
|
expect(testEntity.$is(resultEntity)).toEqual(true);
|
|
258
432
|
});
|
|
@@ -263,7 +437,7 @@ This one's zip code is 92064.`;
|
|
|
263
437
|
// Retrieving entity by GUID and tags...
|
|
264
438
|
const resultEntity = await nymph.getEntity(
|
|
265
439
|
{ class: TestModel },
|
|
266
|
-
{ type: '|', guid: [testGuid, guid()] }
|
|
440
|
+
{ type: '|', guid: [testGuid, guid()] },
|
|
267
441
|
);
|
|
268
442
|
expect(testEntity.$is(resultEntity)).toEqual(true);
|
|
269
443
|
});
|
|
@@ -274,7 +448,7 @@ This one's zip code is 92064.`;
|
|
|
274
448
|
// Retrieving entity by GUID and tags...
|
|
275
449
|
const resultEntity = await nymph.getEntity(
|
|
276
450
|
{ class: TestModel },
|
|
277
|
-
{ type: '|', guid: [guid(), guid()] }
|
|
451
|
+
{ type: '|', guid: [guid(), guid()] },
|
|
278
452
|
);
|
|
279
453
|
expect(testEntity.$is(resultEntity)).toEqual(false);
|
|
280
454
|
});
|
|
@@ -285,7 +459,7 @@ This one's zip code is 92064.`;
|
|
|
285
459
|
// Retrieving entity by !GUID...
|
|
286
460
|
const resultEntity = await nymph.getEntities(
|
|
287
461
|
{ class: TestModel },
|
|
288
|
-
{ type: '&', '!guid': guid(), tag: 'test' }
|
|
462
|
+
{ type: '&', '!guid': guid(), tag: 'test' },
|
|
289
463
|
);
|
|
290
464
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
291
465
|
});
|
|
@@ -296,7 +470,7 @@ This one's zip code is 92064.`;
|
|
|
296
470
|
// Retrieving entity by !tags...
|
|
297
471
|
const resultEntity = await nymph.getEntities(
|
|
298
472
|
{ class: TestModel },
|
|
299
|
-
{ type: '&', guid: testGuid, '!tag': ['barbecue', 'pickles'] }
|
|
473
|
+
{ type: '&', guid: testGuid, '!tag': ['barbecue', 'pickles'] },
|
|
300
474
|
);
|
|
301
475
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
302
476
|
});
|
|
@@ -307,7 +481,7 @@ This one's zip code is 92064.`;
|
|
|
307
481
|
// Testing GUID and wrong tags...
|
|
308
482
|
const resultEntity = await nymph.getEntity(
|
|
309
483
|
{ class: TestModel },
|
|
310
|
-
{ type: '&', guid: testGuid, tag: ['pickles'] }
|
|
484
|
+
{ type: '&', guid: testGuid, tag: ['pickles'] },
|
|
311
485
|
);
|
|
312
486
|
expect(resultEntity).toBeNull();
|
|
313
487
|
});
|
|
@@ -318,7 +492,7 @@ This one's zip code is 92064.`;
|
|
|
318
492
|
// Retrieving entity by tags...
|
|
319
493
|
const resultEntity = await nymph.getEntities(
|
|
320
494
|
{ class: TestModel },
|
|
321
|
-
{ type: '&', tag: 'test' }
|
|
495
|
+
{ type: '&', tag: 'test' },
|
|
322
496
|
);
|
|
323
497
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
324
498
|
});
|
|
@@ -329,7 +503,7 @@ This one's zip code is 92064.`;
|
|
|
329
503
|
// Testing wrong tags...
|
|
330
504
|
const resultEntity = await nymph.getEntities(
|
|
331
505
|
{ class: TestModel },
|
|
332
|
-
{ type: '&', tag: 'pickles' }
|
|
506
|
+
{ type: '&', tag: 'pickles' },
|
|
333
507
|
);
|
|
334
508
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
335
509
|
});
|
|
@@ -340,7 +514,7 @@ This one's zip code is 92064.`;
|
|
|
340
514
|
// Retrieving entity by tags inclusively...
|
|
341
515
|
const resultEntity = await nymph.getEntities(
|
|
342
516
|
{ class: TestModel },
|
|
343
|
-
{ type: '|', tag: ['pickles', 'test', 'barbecue'] }
|
|
517
|
+
{ type: '|', tag: ['pickles', 'test', 'barbecue'] },
|
|
344
518
|
);
|
|
345
519
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
346
520
|
});
|
|
@@ -351,7 +525,7 @@ This one's zip code is 92064.`;
|
|
|
351
525
|
// Testing wrong inclusive tags...
|
|
352
526
|
const resultEntity = await nymph.getEntities(
|
|
353
527
|
{ class: TestModel },
|
|
354
|
-
{ type: '|', tag: ['pickles', 'barbecue'] }
|
|
528
|
+
{ type: '|', tag: ['pickles', 'barbecue'] },
|
|
355
529
|
);
|
|
356
530
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
357
531
|
});
|
|
@@ -363,7 +537,7 @@ This one's zip code is 92064.`;
|
|
|
363
537
|
const resultEntity = await nymph.getEntities(
|
|
364
538
|
{ class: TestModel },
|
|
365
539
|
{ type: '&', tag: 'test' },
|
|
366
|
-
{ type: '|', tag: ['pickles', 'test', 'barbecue'] }
|
|
540
|
+
{ type: '|', tag: ['pickles', 'test', 'barbecue'] },
|
|
367
541
|
);
|
|
368
542
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
369
543
|
});
|
|
@@ -375,7 +549,7 @@ This one's zip code is 92064.`;
|
|
|
375
549
|
const resultEntity = await nymph.getEntities(
|
|
376
550
|
{ class: TestModel },
|
|
377
551
|
{ type: '&', tag: 'test' },
|
|
378
|
-
{ type: '|', tag: ['pickles', 'barbecue'] }
|
|
552
|
+
{ type: '|', tag: ['pickles', 'barbecue'] },
|
|
379
553
|
);
|
|
380
554
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
381
555
|
});
|
|
@@ -387,7 +561,7 @@ This one's zip code is 92064.`;
|
|
|
387
561
|
const resultEntity = await nymph.getEntities(
|
|
388
562
|
{ class: TestModel },
|
|
389
563
|
{ type: '&', tag: 'pickles' },
|
|
390
|
-
{ type: '|', tag: ['test', 'barbecue'] }
|
|
564
|
+
{ type: '|', tag: ['test', 'barbecue'] },
|
|
391
565
|
);
|
|
392
566
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
393
567
|
});
|
|
@@ -398,7 +572,7 @@ This one's zip code is 92064.`;
|
|
|
398
572
|
// Retrieving entity by defined...
|
|
399
573
|
const resultEntity = await nymph.getEntities(
|
|
400
574
|
{ class: TestModel },
|
|
401
|
-
{ type: '&', defined: 'string' }
|
|
575
|
+
{ type: '&', defined: 'string' },
|
|
402
576
|
);
|
|
403
577
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
404
578
|
});
|
|
@@ -409,7 +583,7 @@ This one's zip code is 92064.`;
|
|
|
409
583
|
// Retrieving entity by !defined...
|
|
410
584
|
const resultEntity = await nymph.getEntities(
|
|
411
585
|
{ class: TestModel },
|
|
412
|
-
{ type: '&', tag: 'test', '!defined': 'pickles' }
|
|
586
|
+
{ type: '&', tag: 'test', '!defined': 'pickles' },
|
|
413
587
|
);
|
|
414
588
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
415
589
|
});
|
|
@@ -421,7 +595,7 @@ This one's zip code is 92064.`;
|
|
|
421
595
|
const resultEntity = await nymph.getEntities(
|
|
422
596
|
{ class: TestModel },
|
|
423
597
|
{ type: '!&', defined: 'pickles' },
|
|
424
|
-
{ type: '&', tag: 'test' }
|
|
598
|
+
{ type: '&', tag: 'test' },
|
|
425
599
|
);
|
|
426
600
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
427
601
|
});
|
|
@@ -430,9 +604,60 @@ This one's zip code is 92064.`;
|
|
|
430
604
|
await createTestEntities();
|
|
431
605
|
|
|
432
606
|
// Retrieving entity by equal...
|
|
433
|
-
|
|
607
|
+
let resultEntity = await nymph.getEntities(
|
|
434
608
|
{ class: TestModel },
|
|
435
|
-
{ type: '&', equal: ['string', 'test'] }
|
|
609
|
+
{ type: '&', equal: ['string', 'test'] },
|
|
610
|
+
);
|
|
611
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
612
|
+
|
|
613
|
+
// Retrieving entity by equal...
|
|
614
|
+
resultEntity = await nymph.getEntities(
|
|
615
|
+
{ class: TestModel },
|
|
616
|
+
{ type: '&', equal: ['null', null] },
|
|
617
|
+
);
|
|
618
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
619
|
+
|
|
620
|
+
// Retrieving entity by equal...
|
|
621
|
+
resultEntity = await nymph.getEntities(
|
|
622
|
+
{ class: TestModel },
|
|
623
|
+
{ type: '&', equal: ['boolean', true] },
|
|
624
|
+
);
|
|
625
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
626
|
+
|
|
627
|
+
// Retrieving entity by equal...
|
|
628
|
+
resultEntity = await nymph.getEntities(
|
|
629
|
+
{ class: TestModel },
|
|
630
|
+
{ type: '&', equal: ['number', 30] },
|
|
631
|
+
);
|
|
632
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
633
|
+
|
|
634
|
+
// Retrieving entity by equal...
|
|
635
|
+
resultEntity = await nymph.getEntities(
|
|
636
|
+
{ class: TestModel },
|
|
637
|
+
{
|
|
638
|
+
type: '&',
|
|
639
|
+
equal: [
|
|
640
|
+
'array',
|
|
641
|
+
[
|
|
642
|
+
'full',
|
|
643
|
+
'of',
|
|
644
|
+
'values',
|
|
645
|
+
500,
|
|
646
|
+
{ test: true },
|
|
647
|
+
{ nullbyte: '\\\x00\u0000 \x00' },
|
|
648
|
+
],
|
|
649
|
+
],
|
|
650
|
+
},
|
|
651
|
+
);
|
|
652
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
653
|
+
|
|
654
|
+
// Retrieving entity by equal...
|
|
655
|
+
resultEntity = await nymph.getEntities(
|
|
656
|
+
{ class: TestModel },
|
|
657
|
+
{
|
|
658
|
+
type: '&',
|
|
659
|
+
equal: ['match', matchValue],
|
|
660
|
+
},
|
|
436
661
|
);
|
|
437
662
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
438
663
|
});
|
|
@@ -446,7 +671,7 @@ This one's zip code is 92064.`;
|
|
|
446
671
|
// Retrieving entity by !equal...
|
|
447
672
|
const resultEntity = await nymph.getEntities(
|
|
448
673
|
{ class: TestModel },
|
|
449
|
-
{ type: '&', tag: 'test', '!equal': ['string', 'wrong'] }
|
|
674
|
+
{ type: '&', tag: 'test', '!equal': ['string', 'wrong'] },
|
|
450
675
|
);
|
|
451
676
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
452
677
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -458,7 +683,7 @@ This one's zip code is 92064.`;
|
|
|
458
683
|
// Retrieving entity by like...
|
|
459
684
|
const resultEntity = await nymph.getEntities(
|
|
460
685
|
{ class: TestModel },
|
|
461
|
-
{ type: '&', like: ['string', 't_s%'] }
|
|
686
|
+
{ type: '&', like: ['string', 't_s%'] },
|
|
462
687
|
);
|
|
463
688
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
464
689
|
});
|
|
@@ -472,7 +697,7 @@ This one's zip code is 92064.`;
|
|
|
472
697
|
// Retrieving entity by !like...
|
|
473
698
|
const resultEntity = await nymph.getEntities(
|
|
474
699
|
{ class: TestModel },
|
|
475
|
-
{ type: '&', tag: 'test', '!like': ['string', 'wr_n%'] }
|
|
700
|
+
{ type: '&', tag: 'test', '!like': ['string', 'wr_n%'] },
|
|
476
701
|
);
|
|
477
702
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
478
703
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -484,7 +709,7 @@ This one's zip code is 92064.`;
|
|
|
484
709
|
// Retrieving entity by ilike...
|
|
485
710
|
const resultEntity = await nymph.getEntities(
|
|
486
711
|
{ class: TestModel },
|
|
487
|
-
{ type: '&', ilike: ['string', 'T_s%'] }
|
|
712
|
+
{ type: '&', ilike: ['string', 'T_s%'] },
|
|
488
713
|
);
|
|
489
714
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
490
715
|
});
|
|
@@ -498,7 +723,7 @@ This one's zip code is 92064.`;
|
|
|
498
723
|
// Retrieving entity by !ilike...
|
|
499
724
|
const resultEntity = await nymph.getEntities(
|
|
500
725
|
{ class: TestModel },
|
|
501
|
-
{ type: '&', tag: 'test', '!ilike': ['string', 'wr_n%'] }
|
|
726
|
+
{ type: '&', tag: 'test', '!ilike': ['string', 'wr_n%'] },
|
|
502
727
|
);
|
|
503
728
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
504
729
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -510,7 +735,7 @@ This one's zip code is 92064.`;
|
|
|
510
735
|
// Retrieving entity by like...
|
|
511
736
|
const resultEntity = await nymph.getEntities(
|
|
512
737
|
{ class: TestModel },
|
|
513
|
-
{ type: '&', like: ['string', 'T_s%'] }
|
|
738
|
+
{ type: '&', like: ['string', 'T_s%'] },
|
|
514
739
|
);
|
|
515
740
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
516
741
|
});
|
|
@@ -521,7 +746,7 @@ This one's zip code is 92064.`;
|
|
|
521
746
|
// Retrieving entity by tags and equal...
|
|
522
747
|
const resultEntity = await nymph.getEntities(
|
|
523
748
|
{ class: TestModel },
|
|
524
|
-
{ type: '&', tag: 'test', equal: ['string', 'test'] }
|
|
749
|
+
{ type: '&', tag: 'test', equal: ['string', 'test'] },
|
|
525
750
|
);
|
|
526
751
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
527
752
|
});
|
|
@@ -532,7 +757,7 @@ This one's zip code is 92064.`;
|
|
|
532
757
|
// Testing wrong tags and right equal...
|
|
533
758
|
const resultEntity = await nymph.getEntities(
|
|
534
759
|
{ class: TestModel },
|
|
535
|
-
{ type: '&', tag: 'pickles', equal: ['string', 'test'] }
|
|
760
|
+
{ type: '&', tag: 'pickles', equal: ['string', 'test'] },
|
|
536
761
|
);
|
|
537
762
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
538
763
|
});
|
|
@@ -543,7 +768,7 @@ This one's zip code is 92064.`;
|
|
|
543
768
|
// Testing right tags and wrong equal...
|
|
544
769
|
const resultEntity = await nymph.getEntities(
|
|
545
770
|
{ class: TestModel },
|
|
546
|
-
{ type: '&', tag: 'test', equal: ['string', 'pickles'] }
|
|
771
|
+
{ type: '&', tag: 'test', equal: ['string', 'pickles'] },
|
|
547
772
|
);
|
|
548
773
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
549
774
|
});
|
|
@@ -554,7 +779,7 @@ This one's zip code is 92064.`;
|
|
|
554
779
|
// Testing wrong tags and wrong equal...
|
|
555
780
|
const resultEntity = await nymph.getEntities(
|
|
556
781
|
{ class: TestModel },
|
|
557
|
-
{ type: '&', tag: 'pickles', equal: ['string', 'pickles'] }
|
|
782
|
+
{ type: '&', tag: 'pickles', equal: ['string', 'pickles'] },
|
|
558
783
|
);
|
|
559
784
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
560
785
|
});
|
|
@@ -565,14 +790,21 @@ This one's zip code is 92064.`;
|
|
|
565
790
|
// Retrieving entity by contain...
|
|
566
791
|
let resultEntity = await nymph.getEntities(
|
|
567
792
|
{ class: TestModel },
|
|
568
|
-
{ type: '&', contain: ['array', 'values'] }
|
|
793
|
+
{ type: '&', contain: ['array', 'values'] },
|
|
569
794
|
);
|
|
570
795
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
571
796
|
|
|
572
|
-
// Retrieving entity by contain
|
|
797
|
+
// Retrieving entity by contain...
|
|
798
|
+
resultEntity = await nymph.getEntities(
|
|
799
|
+
{ class: TestModel },
|
|
800
|
+
{ type: '&', contain: ['array', 500] },
|
|
801
|
+
);
|
|
802
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
803
|
+
|
|
804
|
+
// Retrieving entity by contain...
|
|
573
805
|
resultEntity = await nymph.getEntities(
|
|
574
806
|
{ class: TestModel },
|
|
575
|
-
{ type: '&', contain: ['
|
|
807
|
+
{ type: '&', contain: ['array', { test: true }] },
|
|
576
808
|
);
|
|
577
809
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
578
810
|
});
|
|
@@ -584,7 +816,7 @@ This one's zip code is 92064.`;
|
|
|
584
816
|
const resultEntity = await nymph.getEntities(
|
|
585
817
|
{ class: TestModel },
|
|
586
818
|
{ type: '&', tag: 'test' },
|
|
587
|
-
{ type: '!&', contain: ['array', 'pickles'] }
|
|
819
|
+
{ type: '!&', contain: ['array', 'pickles'] },
|
|
588
820
|
);
|
|
589
821
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
590
822
|
});
|
|
@@ -595,14 +827,14 @@ This one's zip code is 92064.`;
|
|
|
595
827
|
// Testing wrong contain...
|
|
596
828
|
let resultEntity = await nymph.getEntities(
|
|
597
829
|
{ class: TestModel },
|
|
598
|
-
{ type: '&', contain: ['array', 'pickles'] }
|
|
830
|
+
{ type: '&', contain: ['array', 'pickles'] },
|
|
599
831
|
);
|
|
600
832
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
601
833
|
|
|
602
834
|
// Testing wrong contain...
|
|
603
835
|
resultEntity = await nymph.getEntities(
|
|
604
836
|
{ class: TestModel },
|
|
605
|
-
{ type: '&', contain: ['string', 'pickles'] }
|
|
837
|
+
{ type: '&', contain: ['string', 'pickles'] },
|
|
606
838
|
);
|
|
607
839
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
608
840
|
});
|
|
@@ -613,12 +845,12 @@ This one's zip code is 92064.`;
|
|
|
613
845
|
// Retrieving entity by regex match...
|
|
614
846
|
let resultEntity = await nymph.getEntities(
|
|
615
847
|
{ class: TestModel },
|
|
616
|
-
{ type: '&', match: ['match', '.*'] } // anything
|
|
848
|
+
{ type: '&', match: ['match', '.*'] }, // anything
|
|
617
849
|
);
|
|
618
850
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
619
851
|
resultEntity = await nymph.getEntities(
|
|
620
852
|
{ class: TestModel },
|
|
621
|
-
{ type: '&', tag: 'test', match: ['match', 'Edward McCheese'] } // a substring
|
|
853
|
+
{ type: '&', tag: 'test', match: ['match', 'Edward McCheese'] }, // a substring
|
|
622
854
|
);
|
|
623
855
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
624
856
|
resultEntity = await nymph.getEntities(
|
|
@@ -630,7 +862,7 @@ This one's zip code is 92064.`;
|
|
|
630
862
|
['string', '[0-9]'],
|
|
631
863
|
['match', 'Edward McCheese'],
|
|
632
864
|
],
|
|
633
|
-
} // inclusive test
|
|
865
|
+
}, // inclusive test
|
|
634
866
|
);
|
|
635
867
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
636
868
|
resultEntity = await nymph.getEntities(
|
|
@@ -639,7 +871,7 @@ This one's zip code is 92064.`;
|
|
|
639
871
|
type: '&',
|
|
640
872
|
tag: 'test',
|
|
641
873
|
match: ['match', '[-a-zA-Z0-9+_]+@[-a-zA-Z0-9_]+.[-a-zA-Z0-9_]{2,4}'],
|
|
642
|
-
} // a simple email
|
|
874
|
+
}, // a simple email
|
|
643
875
|
);
|
|
644
876
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
645
877
|
resultEntity = await nymph.getEntities(
|
|
@@ -648,7 +880,7 @@ This one's zip code is 92064.`;
|
|
|
648
880
|
type: '&',
|
|
649
881
|
tag: 'test',
|
|
650
882
|
match: ['match', '\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}'],
|
|
651
|
-
} // a phone number
|
|
883
|
+
}, // a phone number
|
|
652
884
|
);
|
|
653
885
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
654
886
|
});
|
|
@@ -659,7 +891,7 @@ This one's zip code is 92064.`;
|
|
|
659
891
|
// Retrieving entity by regex match...
|
|
660
892
|
const resultEntity = await nymph.getEntities(
|
|
661
893
|
{ class: TestModel },
|
|
662
|
-
{ type: '&', tag: 'test', imatch: ['match', 'edward mccheese'] } // a substring
|
|
894
|
+
{ type: '&', tag: 'test', imatch: ['match', 'edward mccheese'] }, // a substring
|
|
663
895
|
);
|
|
664
896
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
665
897
|
});
|
|
@@ -670,12 +902,12 @@ This one's zip code is 92064.`;
|
|
|
670
902
|
// Testing wrong regex match...
|
|
671
903
|
let resultEntity = await nymph.getEntities(
|
|
672
904
|
{ class: TestModel },
|
|
673
|
-
{ type: '&', match: ['match', '
|
|
905
|
+
{ type: '&', match: ['match', '='] },
|
|
674
906
|
);
|
|
675
907
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
676
908
|
resultEntity = await nymph.getEntities(
|
|
677
909
|
{ class: TestModel },
|
|
678
|
-
{ type: '&', tag: 'pickle', match: ['match', '.*'] }
|
|
910
|
+
{ type: '&', tag: 'pickle', match: ['match', '.*'] },
|
|
679
911
|
);
|
|
680
912
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
681
913
|
resultEntity = await nymph.getEntities(
|
|
@@ -686,7 +918,7 @@ This one's zip code is 92064.`;
|
|
|
686
918
|
['string', '[0-9]'],
|
|
687
919
|
['match', ',,'],
|
|
688
920
|
],
|
|
689
|
-
}
|
|
921
|
+
},
|
|
690
922
|
);
|
|
691
923
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
692
924
|
});
|
|
@@ -697,7 +929,7 @@ This one's zip code is 92064.`;
|
|
|
697
929
|
// Retrieving entity by regex match...
|
|
698
930
|
const resultEntity = await nymph.getEntities(
|
|
699
931
|
{ class: TestModel },
|
|
700
|
-
{ type: '&', tag: 'test', match: ['match', 'edward mccheese'] } // a substring
|
|
932
|
+
{ type: '&', tag: 'test', match: ['match', 'edward mccheese'] }, // a substring
|
|
701
933
|
);
|
|
702
934
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
703
935
|
});
|
|
@@ -709,7 +941,192 @@ This one's zip code is 92064.`;
|
|
|
709
941
|
const resultEntity = await nymph.getEntities(
|
|
710
942
|
{ class: TestModel },
|
|
711
943
|
{ type: '&', tag: 'test' },
|
|
712
|
-
{ type: '|', equal: ['string', 'pickles'], match: ['string', 'test'] }
|
|
944
|
+
{ type: '|', equal: ['string', 'pickles'], match: ['string', 'test'] },
|
|
945
|
+
);
|
|
946
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
it('basic search', async () => {
|
|
950
|
+
await createTestEntities();
|
|
951
|
+
|
|
952
|
+
// Retrieving entity by full text search...
|
|
953
|
+
let resultEntity = await nymph.getEntities(
|
|
954
|
+
{ class: TestModel },
|
|
955
|
+
{
|
|
956
|
+
type: '&',
|
|
957
|
+
tag: 'test',
|
|
958
|
+
search: [
|
|
959
|
+
'search',
|
|
960
|
+
'Declaration of the thirteen united States of America',
|
|
961
|
+
],
|
|
962
|
+
}, // a substring
|
|
963
|
+
);
|
|
964
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
965
|
+
resultEntity = await nymph.getEntities(
|
|
966
|
+
{ class: TestModel },
|
|
967
|
+
{ type: '&', tag: 'test' },
|
|
968
|
+
{
|
|
969
|
+
type: '|',
|
|
970
|
+
search: [
|
|
971
|
+
['string', 'pickle'],
|
|
972
|
+
['search', 'Declaration of the thirteen united States of America'],
|
|
973
|
+
],
|
|
974
|
+
}, // inclusive test
|
|
975
|
+
);
|
|
976
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
977
|
+
resultEntity = await nymph.getEntities(
|
|
978
|
+
{ class: TestModel },
|
|
979
|
+
{
|
|
980
|
+
type: '&',
|
|
981
|
+
tag: 'test',
|
|
982
|
+
search: ['search', 'July 4, 1776'],
|
|
983
|
+
}, // a string with a number
|
|
984
|
+
);
|
|
985
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
986
|
+
});
|
|
987
|
+
|
|
988
|
+
it('or search', async () => {
|
|
989
|
+
await createTestEntities();
|
|
990
|
+
|
|
991
|
+
// Retrieving entity by full text search...
|
|
992
|
+
let resultEntity = await nymph.getEntities(
|
|
993
|
+
{ class: TestModel },
|
|
994
|
+
{
|
|
995
|
+
type: '&',
|
|
996
|
+
tag: 'test',
|
|
997
|
+
search: ['search', 'Declaration or pickles'],
|
|
998
|
+
}, // a string with an or
|
|
999
|
+
);
|
|
1000
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
it('series search', async () => {
|
|
1004
|
+
await createTestEntities();
|
|
1005
|
+
|
|
1006
|
+
// Retrieving entity by full text search...
|
|
1007
|
+
let resultEntity = await nymph.getEntities(
|
|
1008
|
+
{ class: TestModel },
|
|
1009
|
+
{
|
|
1010
|
+
type: '&',
|
|
1011
|
+
tag: 'test',
|
|
1012
|
+
search: ['search', '"excited domestic insurrections"'],
|
|
1013
|
+
}, // double quoted substring
|
|
1014
|
+
);
|
|
1015
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1016
|
+
resultEntity = await nymph.getEntities(
|
|
1017
|
+
{ class: TestModel },
|
|
1018
|
+
{
|
|
1019
|
+
type: '&',
|
|
1020
|
+
tag: 'test',
|
|
1021
|
+
search: ['search', "'exciting domestic insurrected'"],
|
|
1022
|
+
}, // single quoted substring
|
|
1023
|
+
);
|
|
1024
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
it('negated search', async () => {
|
|
1028
|
+
await createTestEntities();
|
|
1029
|
+
|
|
1030
|
+
// Retrieving entity by full text search...
|
|
1031
|
+
let resultEntity = await nymph.getEntities(
|
|
1032
|
+
{ class: TestModel },
|
|
1033
|
+
{
|
|
1034
|
+
type: '&',
|
|
1035
|
+
tag: 'test',
|
|
1036
|
+
search: ['search', '-pickle'],
|
|
1037
|
+
}, // negated term
|
|
1038
|
+
);
|
|
1039
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
it('combined search', async () => {
|
|
1043
|
+
await createTestEntities();
|
|
1044
|
+
|
|
1045
|
+
// Retrieving entity by full text search...
|
|
1046
|
+
let resultEntity = await nymph.getEntities(
|
|
1047
|
+
{ class: TestModel },
|
|
1048
|
+
{
|
|
1049
|
+
type: '&',
|
|
1050
|
+
tag: 'test',
|
|
1051
|
+
search: ['search', 'Declaration -pickle'],
|
|
1052
|
+
}, // negated term with positive term
|
|
1053
|
+
);
|
|
1054
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1055
|
+
resultEntity = await nymph.getEntities(
|
|
1056
|
+
{ class: TestModel },
|
|
1057
|
+
{
|
|
1058
|
+
type: '&',
|
|
1059
|
+
tag: 'test',
|
|
1060
|
+
search: ['search', 'Declaration "General Congress"'],
|
|
1061
|
+
}, // terms found in separate areas
|
|
1062
|
+
);
|
|
1063
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1064
|
+
});
|
|
1065
|
+
|
|
1066
|
+
it('wrong search', async () => {
|
|
1067
|
+
await createTestEntities();
|
|
1068
|
+
|
|
1069
|
+
// Testing wrong search...
|
|
1070
|
+
let resultEntity = await nymph.getEntities(
|
|
1071
|
+
{ class: TestModel },
|
|
1072
|
+
{ type: '&', search: ['search', 'pickles'] },
|
|
1073
|
+
);
|
|
1074
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1075
|
+
resultEntity = await nymph.getEntities(
|
|
1076
|
+
{ class: TestModel },
|
|
1077
|
+
{ type: '&', tag: 'pickle', search: ['search', 'Declaration'] },
|
|
1078
|
+
);
|
|
1079
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1080
|
+
resultEntity = await nymph.getEntities(
|
|
1081
|
+
{ class: TestModel },
|
|
1082
|
+
{
|
|
1083
|
+
type: '|',
|
|
1084
|
+
search: [
|
|
1085
|
+
['string', 'pickle'],
|
|
1086
|
+
['search', 'Hawaii'],
|
|
1087
|
+
],
|
|
1088
|
+
},
|
|
1089
|
+
);
|
|
1090
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1091
|
+
});
|
|
1092
|
+
|
|
1093
|
+
it('search with only stop words', async () => {
|
|
1094
|
+
await createTestEntities();
|
|
1095
|
+
|
|
1096
|
+
// Testing wrong search...
|
|
1097
|
+
let resultEntity = await nymph.getEntities(
|
|
1098
|
+
{ class: TestModel },
|
|
1099
|
+
{ type: '&', search: ['search', 'i am'] },
|
|
1100
|
+
);
|
|
1101
|
+
expect(resultEntity).toEqual([]);
|
|
1102
|
+
});
|
|
1103
|
+
|
|
1104
|
+
it('search must be case insensitive', async () => {
|
|
1105
|
+
await createTestEntities();
|
|
1106
|
+
|
|
1107
|
+
// Retrieving entity by full text search...
|
|
1108
|
+
const resultEntity = await nymph.getEntities(
|
|
1109
|
+
{ class: TestModel },
|
|
1110
|
+
{
|
|
1111
|
+
type: '&',
|
|
1112
|
+
tag: 'test',
|
|
1113
|
+
search: [
|
|
1114
|
+
'search',
|
|
1115
|
+
'DECLARATION OF THE THIRTEEN UNITED STATES OF AMERICA',
|
|
1116
|
+
],
|
|
1117
|
+
}, // a substring
|
|
1118
|
+
);
|
|
1119
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
it('search and equal inclusive', async () => {
|
|
1123
|
+
await createTestEntities();
|
|
1124
|
+
|
|
1125
|
+
// Retrieving entity by fts + equal inclusively...
|
|
1126
|
+
const resultEntity = await nymph.getEntities(
|
|
1127
|
+
{ class: TestModel },
|
|
1128
|
+
{ type: '&', tag: 'test' },
|
|
1129
|
+
{ type: '|', equal: ['string', 'pickles'], search: ['string', 'test'] },
|
|
713
1130
|
);
|
|
714
1131
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
715
1132
|
});
|
|
@@ -726,7 +1143,7 @@ This one's zip code is 92064.`;
|
|
|
726
1143
|
['number', 30],
|
|
727
1144
|
['pickles', 100],
|
|
728
1145
|
],
|
|
729
|
-
}
|
|
1146
|
+
},
|
|
730
1147
|
);
|
|
731
1148
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
732
1149
|
|
|
@@ -739,7 +1156,7 @@ This one's zip code is 92064.`;
|
|
|
739
1156
|
['number', 31],
|
|
740
1157
|
['pickles', 100],
|
|
741
1158
|
],
|
|
742
|
-
}
|
|
1159
|
+
},
|
|
743
1160
|
);
|
|
744
1161
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
745
1162
|
|
|
@@ -752,7 +1169,7 @@ This one's zip code is 92064.`;
|
|
|
752
1169
|
['number', 29],
|
|
753
1170
|
['pickles', 100],
|
|
754
1171
|
],
|
|
755
|
-
}
|
|
1172
|
+
},
|
|
756
1173
|
);
|
|
757
1174
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
758
1175
|
|
|
@@ -765,7 +1182,7 @@ This one's zip code is 92064.`;
|
|
|
765
1182
|
['numberString', 30],
|
|
766
1183
|
['pickles', 100],
|
|
767
1184
|
],
|
|
768
|
-
}
|
|
1185
|
+
},
|
|
769
1186
|
);
|
|
770
1187
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
771
1188
|
|
|
@@ -778,7 +1195,7 @@ This one's zip code is 92064.`;
|
|
|
778
1195
|
['numberString', 31],
|
|
779
1196
|
['pickles', 100],
|
|
780
1197
|
],
|
|
781
|
-
}
|
|
1198
|
+
},
|
|
782
1199
|
);
|
|
783
1200
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
784
1201
|
|
|
@@ -791,7 +1208,7 @@ This one's zip code is 92064.`;
|
|
|
791
1208
|
['numberString', 29],
|
|
792
1209
|
['pickles', 100],
|
|
793
1210
|
],
|
|
794
|
-
}
|
|
1211
|
+
},
|
|
795
1212
|
);
|
|
796
1213
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
797
1214
|
});
|
|
@@ -808,7 +1225,7 @@ This one's zip code is 92064.`;
|
|
|
808
1225
|
['number', 30],
|
|
809
1226
|
['pickles', 100],
|
|
810
1227
|
],
|
|
811
|
-
}
|
|
1228
|
+
},
|
|
812
1229
|
);
|
|
813
1230
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
814
1231
|
|
|
@@ -821,7 +1238,7 @@ This one's zip code is 92064.`;
|
|
|
821
1238
|
['number', 31],
|
|
822
1239
|
['pickles', 100],
|
|
823
1240
|
],
|
|
824
|
-
}
|
|
1241
|
+
},
|
|
825
1242
|
);
|
|
826
1243
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
827
1244
|
|
|
@@ -834,7 +1251,7 @@ This one's zip code is 92064.`;
|
|
|
834
1251
|
['number', 29],
|
|
835
1252
|
['pickles', 100],
|
|
836
1253
|
],
|
|
837
|
-
}
|
|
1254
|
+
},
|
|
838
1255
|
);
|
|
839
1256
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
840
1257
|
|
|
@@ -847,7 +1264,7 @@ This one's zip code is 92064.`;
|
|
|
847
1264
|
['numberString', 30],
|
|
848
1265
|
['pickles', 100],
|
|
849
1266
|
],
|
|
850
|
-
}
|
|
1267
|
+
},
|
|
851
1268
|
);
|
|
852
1269
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
853
1270
|
|
|
@@ -860,7 +1277,7 @@ This one's zip code is 92064.`;
|
|
|
860
1277
|
['numberString', 31],
|
|
861
1278
|
['pickles', 100],
|
|
862
1279
|
],
|
|
863
|
-
}
|
|
1280
|
+
},
|
|
864
1281
|
);
|
|
865
1282
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
866
1283
|
|
|
@@ -873,7 +1290,7 @@ This one's zip code is 92064.`;
|
|
|
873
1290
|
['numberString', 29],
|
|
874
1291
|
['pickles', 100],
|
|
875
1292
|
],
|
|
876
|
-
}
|
|
1293
|
+
},
|
|
877
1294
|
);
|
|
878
1295
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
879
1296
|
});
|
|
@@ -890,7 +1307,7 @@ This one's zip code is 92064.`;
|
|
|
890
1307
|
['number', 30],
|
|
891
1308
|
['pickles', 100],
|
|
892
1309
|
],
|
|
893
|
-
}
|
|
1310
|
+
},
|
|
894
1311
|
);
|
|
895
1312
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
896
1313
|
|
|
@@ -903,7 +1320,7 @@ This one's zip code is 92064.`;
|
|
|
903
1320
|
['number', 31],
|
|
904
1321
|
['pickles', 100],
|
|
905
1322
|
],
|
|
906
|
-
}
|
|
1323
|
+
},
|
|
907
1324
|
);
|
|
908
1325
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
909
1326
|
|
|
@@ -916,7 +1333,7 @@ This one's zip code is 92064.`;
|
|
|
916
1333
|
['number', 29],
|
|
917
1334
|
['pickles', 100],
|
|
918
1335
|
],
|
|
919
|
-
}
|
|
1336
|
+
},
|
|
920
1337
|
);
|
|
921
1338
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
922
1339
|
|
|
@@ -929,7 +1346,7 @@ This one's zip code is 92064.`;
|
|
|
929
1346
|
['numberString', 30],
|
|
930
1347
|
['pickles', 100],
|
|
931
1348
|
],
|
|
932
|
-
}
|
|
1349
|
+
},
|
|
933
1350
|
);
|
|
934
1351
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
935
1352
|
|
|
@@ -942,7 +1359,7 @@ This one's zip code is 92064.`;
|
|
|
942
1359
|
['numberString', 31],
|
|
943
1360
|
['pickles', 100],
|
|
944
1361
|
],
|
|
945
|
-
}
|
|
1362
|
+
},
|
|
946
1363
|
);
|
|
947
1364
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
948
1365
|
|
|
@@ -955,7 +1372,7 @@ This one's zip code is 92064.`;
|
|
|
955
1372
|
['numberString', 29],
|
|
956
1373
|
['pickles', 100],
|
|
957
1374
|
],
|
|
958
|
-
}
|
|
1375
|
+
},
|
|
959
1376
|
);
|
|
960
1377
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
961
1378
|
});
|
|
@@ -972,7 +1389,7 @@ This one's zip code is 92064.`;
|
|
|
972
1389
|
['number', 30],
|
|
973
1390
|
['pickles', 100],
|
|
974
1391
|
],
|
|
975
|
-
}
|
|
1392
|
+
},
|
|
976
1393
|
);
|
|
977
1394
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
978
1395
|
|
|
@@ -985,7 +1402,7 @@ This one's zip code is 92064.`;
|
|
|
985
1402
|
['number', 31],
|
|
986
1403
|
['pickles', 100],
|
|
987
1404
|
],
|
|
988
|
-
}
|
|
1405
|
+
},
|
|
989
1406
|
);
|
|
990
1407
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
991
1408
|
|
|
@@ -998,7 +1415,7 @@ This one's zip code is 92064.`;
|
|
|
998
1415
|
['number', 29],
|
|
999
1416
|
['pickles', 100],
|
|
1000
1417
|
],
|
|
1001
|
-
}
|
|
1418
|
+
},
|
|
1002
1419
|
);
|
|
1003
1420
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1004
1421
|
|
|
@@ -1011,7 +1428,7 @@ This one's zip code is 92064.`;
|
|
|
1011
1428
|
['numberString', 30],
|
|
1012
1429
|
['pickles', 100],
|
|
1013
1430
|
],
|
|
1014
|
-
}
|
|
1431
|
+
},
|
|
1015
1432
|
);
|
|
1016
1433
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1017
1434
|
|
|
@@ -1024,7 +1441,7 @@ This one's zip code is 92064.`;
|
|
|
1024
1441
|
['numberString', 31],
|
|
1025
1442
|
['pickles', 100],
|
|
1026
1443
|
],
|
|
1027
|
-
}
|
|
1444
|
+
},
|
|
1028
1445
|
);
|
|
1029
1446
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1030
1447
|
|
|
@@ -1037,7 +1454,7 @@ This one's zip code is 92064.`;
|
|
|
1037
1454
|
['numberString', 29],
|
|
1038
1455
|
['pickles', 100],
|
|
1039
1456
|
],
|
|
1040
|
-
}
|
|
1457
|
+
},
|
|
1041
1458
|
);
|
|
1042
1459
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1043
1460
|
});
|
|
@@ -1049,7 +1466,7 @@ This one's zip code is 92064.`;
|
|
|
1049
1466
|
const resultEntity = await nymph.getEntities(
|
|
1050
1467
|
{ class: TestModel },
|
|
1051
1468
|
{ type: '&', tag: 'test' },
|
|
1052
|
-
{ type: '!&', gte: ['number', 60] }
|
|
1469
|
+
{ type: '!&', gte: ['number', 60] },
|
|
1053
1470
|
);
|
|
1054
1471
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1055
1472
|
});
|
|
@@ -1060,7 +1477,7 @@ This one's zip code is 92064.`;
|
|
|
1060
1477
|
// Testing wrong inequality...
|
|
1061
1478
|
const resultEntity = await nymph.getEntities(
|
|
1062
1479
|
{ class: TestModel },
|
|
1063
|
-
{ type: '&', lte: ['number', 29.99] }
|
|
1480
|
+
{ type: '&', lte: ['number', 29.99] },
|
|
1064
1481
|
);
|
|
1065
1482
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1066
1483
|
});
|
|
@@ -1071,7 +1488,7 @@ This one's zip code is 92064.`;
|
|
|
1071
1488
|
// Retrieving entity by time...
|
|
1072
1489
|
const resultEntity = await nymph.getEntities(
|
|
1073
1490
|
{ class: TestModel },
|
|
1074
|
-
{ type: '&', tag: 'test', gt: ['cdate', (testEntity.cdate ?? 0) - 120] }
|
|
1491
|
+
{ type: '&', tag: 'test', gt: ['cdate', (testEntity.cdate ?? 0) - 120] },
|
|
1075
1492
|
);
|
|
1076
1493
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1077
1494
|
});
|
|
@@ -1082,7 +1499,7 @@ This one's zip code is 92064.`;
|
|
|
1082
1499
|
// Testing wrong time...
|
|
1083
1500
|
const resultEntity = await nymph.getEntities(
|
|
1084
1501
|
{ class: TestModel },
|
|
1085
|
-
{ type: '&', tag: 'test', gte: ['cdate', (testEntity.cdate ?? 0) + 1] }
|
|
1502
|
+
{ type: '&', tag: 'test', gte: ['cdate', (testEntity.cdate ?? 0) + 1] },
|
|
1086
1503
|
);
|
|
1087
1504
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1088
1505
|
});
|
|
@@ -1095,7 +1512,7 @@ This one's zip code is 92064.`;
|
|
|
1095
1512
|
// Retrieving entity by relative time...
|
|
1096
1513
|
let resultEntity = await nymph.getEntities(
|
|
1097
1514
|
{ class: TestModel },
|
|
1098
|
-
{ type: '&', gt: ['timestamp', null, '-1 day'] }
|
|
1515
|
+
{ type: '&', gt: ['timestamp', null, '-1 day'] },
|
|
1099
1516
|
);
|
|
1100
1517
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1101
1518
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -1109,7 +1526,7 @@ This one's zip code is 92064.`;
|
|
|
1109
1526
|
['timestamp', null, '-1 day'],
|
|
1110
1527
|
['timestamp', null, '+5 days'],
|
|
1111
1528
|
],
|
|
1112
|
-
}
|
|
1529
|
+
},
|
|
1113
1530
|
);
|
|
1114
1531
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1115
1532
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -1117,7 +1534,7 @@ This one's zip code is 92064.`;
|
|
|
1117
1534
|
// Retrieving entity by relative time...
|
|
1118
1535
|
resultEntity = await nymph.getEntities(
|
|
1119
1536
|
{ class: TestModel },
|
|
1120
|
-
{ type: '&', gt: ['timestamp', null, '-3 days'] }
|
|
1537
|
+
{ type: '&', gt: ['timestamp', null, '-3 days'] },
|
|
1121
1538
|
);
|
|
1122
1539
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1123
1540
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(true);
|
|
@@ -1125,7 +1542,7 @@ This one's zip code is 92064.`;
|
|
|
1125
1542
|
// Retrieving entity by relative time...
|
|
1126
1543
|
resultEntity = await nymph.getEntities(
|
|
1127
1544
|
{ class: TestModel },
|
|
1128
|
-
{ type: '&', gt: ['cdate', null, '-1 day'] }
|
|
1545
|
+
{ type: '&', gt: ['cdate', null, '-1 day'] },
|
|
1129
1546
|
);
|
|
1130
1547
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1131
1548
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(true);
|
|
@@ -1139,7 +1556,7 @@ This one's zip code is 92064.`;
|
|
|
1139
1556
|
// Retrieving entity by relative time...
|
|
1140
1557
|
let resultEntity = await nymph.getEntities(
|
|
1141
1558
|
{ class: TestModel },
|
|
1142
|
-
{ type: '&', tag: 'test', gt: ['timestamp', null, '+1 day'] }
|
|
1559
|
+
{ type: '&', tag: 'test', gt: ['timestamp', null, '+1 day'] },
|
|
1143
1560
|
);
|
|
1144
1561
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1145
1562
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -1147,7 +1564,7 @@ This one's zip code is 92064.`;
|
|
|
1147
1564
|
// Retrieving entity by relative time...
|
|
1148
1565
|
resultEntity = await nymph.getEntities(
|
|
1149
1566
|
{ class: TestModel },
|
|
1150
|
-
{ type: '&', tag: 'test', lt: ['timestamp', null, '-3 days'] }
|
|
1567
|
+
{ type: '&', tag: 'test', lt: ['timestamp', null, '-3 days'] },
|
|
1151
1568
|
);
|
|
1152
1569
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1153
1570
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -1155,7 +1572,7 @@ This one's zip code is 92064.`;
|
|
|
1155
1572
|
// Retrieving entity by relative time...
|
|
1156
1573
|
resultEntity = await nymph.getEntities(
|
|
1157
1574
|
{ class: TestModel },
|
|
1158
|
-
{ type: '&', tag: 'test', gt: ['cdate', null, '+1 day'] }
|
|
1575
|
+
{ type: '&', tag: 'test', gt: ['cdate', null, '+1 day'] },
|
|
1159
1576
|
);
|
|
1160
1577
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1161
1578
|
expect(referenceEntity.$inArray(resultEntity)).toEqual(false);
|
|
@@ -1165,9 +1582,11 @@ This one's zip code is 92064.`;
|
|
|
1165
1582
|
await createTestEntities();
|
|
1166
1583
|
|
|
1167
1584
|
// Testing referenced entities...
|
|
1585
|
+
await testEntity.reference?.$wake();
|
|
1168
1586
|
expect(testEntity.reference?.test).toEqual('good');
|
|
1169
1587
|
|
|
1170
1588
|
// Testing referenced entity arrays...
|
|
1589
|
+
await Promise.all(testEntity.refArray?.map((e) => e.$wake()) || []);
|
|
1171
1590
|
expect(testEntity.refArray?.[0].test).toEqual('good');
|
|
1172
1591
|
});
|
|
1173
1592
|
|
|
@@ -1177,7 +1596,7 @@ This one's zip code is 92064.`;
|
|
|
1177
1596
|
// Retrieving entity by reference...
|
|
1178
1597
|
const resultEntity = await nymph.getEntities(
|
|
1179
1598
|
{ class: TestModel },
|
|
1180
|
-
{ type: '&', ref: ['reference', refGuid] }
|
|
1599
|
+
{ type: '&', ref: ['reference', refGuid] },
|
|
1181
1600
|
);
|
|
1182
1601
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1183
1602
|
});
|
|
@@ -1189,7 +1608,7 @@ This one's zip code is 92064.`;
|
|
|
1189
1608
|
const resultEntity = await nymph.getEntities(
|
|
1190
1609
|
{ class: TestModel },
|
|
1191
1610
|
{ type: '&', tag: 'test' },
|
|
1192
|
-
{ type: '!&', ref: ['reference', guid()] }
|
|
1611
|
+
{ type: '!&', ref: ['reference', guid()] },
|
|
1193
1612
|
);
|
|
1194
1613
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1195
1614
|
});
|
|
@@ -1200,7 +1619,7 @@ This one's zip code is 92064.`;
|
|
|
1200
1619
|
// Testing wrong reference...
|
|
1201
1620
|
const resultEntity = await nymph.getEntities(
|
|
1202
1621
|
{ class: TestModel },
|
|
1203
|
-
{ type: '&', ref: ['reference', guid()] }
|
|
1622
|
+
{ type: '&', ref: ['reference', guid()] },
|
|
1204
1623
|
);
|
|
1205
1624
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1206
1625
|
});
|
|
@@ -1211,7 +1630,7 @@ This one's zip code is 92064.`;
|
|
|
1211
1630
|
// Testing non-existent reference...
|
|
1212
1631
|
const resultEntity = await nymph.getEntities(
|
|
1213
1632
|
{ class: TestModel },
|
|
1214
|
-
{ type: '&', ref: ['pickle', refGuid] }
|
|
1633
|
+
{ type: '&', ref: ['pickle', refGuid] },
|
|
1215
1634
|
);
|
|
1216
1635
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1217
1636
|
});
|
|
@@ -1228,7 +1647,7 @@ This one's zip code is 92064.`;
|
|
|
1228
1647
|
['reference', refGuid],
|
|
1229
1648
|
['reference', guid()],
|
|
1230
1649
|
],
|
|
1231
|
-
}
|
|
1650
|
+
},
|
|
1232
1651
|
);
|
|
1233
1652
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1234
1653
|
});
|
|
@@ -1245,7 +1664,7 @@ This one's zip code is 92064.`;
|
|
|
1245
1664
|
['reference', guid()],
|
|
1246
1665
|
['reference', guid()],
|
|
1247
1666
|
],
|
|
1248
|
-
}
|
|
1667
|
+
},
|
|
1249
1668
|
);
|
|
1250
1669
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1251
1670
|
});
|
|
@@ -1256,7 +1675,7 @@ This one's zip code is 92064.`;
|
|
|
1256
1675
|
// Retrieving entity by array reference...
|
|
1257
1676
|
const resultEntity = await nymph.getEntities(
|
|
1258
1677
|
{ class: TestModel },
|
|
1259
|
-
{ type: '&', ref: ['refArray', refGuid] }
|
|
1678
|
+
{ type: '&', ref: ['refArray', refGuid] },
|
|
1260
1679
|
);
|
|
1261
1680
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1262
1681
|
});
|
|
@@ -1273,7 +1692,7 @@ This one's zip code is 92064.`;
|
|
|
1273
1692
|
['refArray', refGuid],
|
|
1274
1693
|
['refArray', guid()],
|
|
1275
1694
|
],
|
|
1276
|
-
}
|
|
1695
|
+
},
|
|
1277
1696
|
);
|
|
1278
1697
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1279
1698
|
});
|
|
@@ -1307,6 +1726,8 @@ This one's zip code is 92064.`;
|
|
|
1307
1726
|
['array', 'of'],
|
|
1308
1727
|
['array', 'values'],
|
|
1309
1728
|
['array', 500],
|
|
1729
|
+
['array', { test: true }],
|
|
1730
|
+
['array', { nullbyte: '\\\x00\u0000 \x00' }],
|
|
1310
1731
|
],
|
|
1311
1732
|
},
|
|
1312
1733
|
{
|
|
@@ -1318,7 +1739,7 @@ This one's zip code is 92064.`;
|
|
|
1318
1739
|
['array', 'values'],
|
|
1319
1740
|
['array', 500],
|
|
1320
1741
|
],
|
|
1321
|
-
}
|
|
1742
|
+
},
|
|
1322
1743
|
);
|
|
1323
1744
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1324
1745
|
});
|
|
@@ -1338,13 +1759,13 @@ This one's zip code is 92064.`;
|
|
|
1338
1759
|
|
|
1339
1760
|
const resultSelectors = await nymph.getEntities(
|
|
1340
1761
|
{ class: TestModel },
|
|
1341
|
-
{ type: '&', ref: ['reference', refGuid] }
|
|
1762
|
+
{ type: '&', ref: ['reference', refGuid] },
|
|
1342
1763
|
);
|
|
1343
1764
|
|
|
1344
1765
|
// Testing count return with selectors...
|
|
1345
1766
|
const resultSelectorsCount = await nymph.getEntities(
|
|
1346
1767
|
{ class: TestModel, return: 'count' },
|
|
1347
|
-
{ type: '&', ref: ['reference', refGuid] }
|
|
1768
|
+
{ type: '&', ref: ['reference', refGuid] },
|
|
1348
1769
|
);
|
|
1349
1770
|
expect(resultSelectorsCount).toBeGreaterThanOrEqual(1);
|
|
1350
1771
|
expect(resultSelectorsCount).toEqual(resultSelectors.length);
|
|
@@ -1367,7 +1788,7 @@ This one's zip code is 92064.`;
|
|
|
1367
1788
|
// Testing empty count...
|
|
1368
1789
|
const resultSelectorsEmpty = await nymph.getEntities(
|
|
1369
1790
|
{ class: TestModel, return: 'count' },
|
|
1370
|
-
{ type: '&', ref: ['reference', guid()] }
|
|
1791
|
+
{ type: '&', ref: ['reference', guid()] },
|
|
1371
1792
|
);
|
|
1372
1793
|
expect(resultSelectorsEmpty).toEqual(0);
|
|
1373
1794
|
});
|
|
@@ -1401,6 +1822,8 @@ This one's zip code is 92064.`;
|
|
|
1401
1822
|
['array', 'of'],
|
|
1402
1823
|
['array', 'values'],
|
|
1403
1824
|
['array', 500],
|
|
1825
|
+
['array', { test: true }],
|
|
1826
|
+
['array', { nullbyte: '\\\x00\u0000 \x00' }],
|
|
1404
1827
|
],
|
|
1405
1828
|
},
|
|
1406
1829
|
{
|
|
@@ -1412,11 +1835,66 @@ This one's zip code is 92064.`;
|
|
|
1412
1835
|
['array', 'values'],
|
|
1413
1836
|
['array', 500],
|
|
1414
1837
|
],
|
|
1415
|
-
}
|
|
1838
|
+
},
|
|
1416
1839
|
);
|
|
1417
1840
|
expect(resultGuid.indexOf(testEntity.guid ?? '')).toBeGreaterThan(-1);
|
|
1418
1841
|
});
|
|
1419
1842
|
|
|
1843
|
+
it('object return', async () => {
|
|
1844
|
+
await createTestEntities();
|
|
1845
|
+
|
|
1846
|
+
// Testing object return using logic operations...
|
|
1847
|
+
const resultObjects = await nymph.getEntities(
|
|
1848
|
+
{ class: TestModel, return: 'object' },
|
|
1849
|
+
{
|
|
1850
|
+
type: '&',
|
|
1851
|
+
'!ref': [
|
|
1852
|
+
['refArray', guid()],
|
|
1853
|
+
['refArray', guid()],
|
|
1854
|
+
],
|
|
1855
|
+
'!lte': ['number', 29.99],
|
|
1856
|
+
},
|
|
1857
|
+
{
|
|
1858
|
+
type: '|',
|
|
1859
|
+
'!lte': [
|
|
1860
|
+
['number', 29.99],
|
|
1861
|
+
['number', 30],
|
|
1862
|
+
],
|
|
1863
|
+
},
|
|
1864
|
+
{
|
|
1865
|
+
type: '!&',
|
|
1866
|
+
'!equal': ['string', 'test'],
|
|
1867
|
+
'!contain': [
|
|
1868
|
+
['array', 'full'],
|
|
1869
|
+
['array', 'of'],
|
|
1870
|
+
['array', 'values'],
|
|
1871
|
+
['array', 500],
|
|
1872
|
+
['array', { test: true }],
|
|
1873
|
+
['array', { nullbyte: '\\\x00\u0000 \x00' }],
|
|
1874
|
+
],
|
|
1875
|
+
},
|
|
1876
|
+
{
|
|
1877
|
+
type: '!|',
|
|
1878
|
+
'!equal': ['string', 'test'],
|
|
1879
|
+
contain: [
|
|
1880
|
+
['array', 'full'],
|
|
1881
|
+
['array', 'of'],
|
|
1882
|
+
['array', 'values'],
|
|
1883
|
+
['array', 500],
|
|
1884
|
+
],
|
|
1885
|
+
},
|
|
1886
|
+
);
|
|
1887
|
+
|
|
1888
|
+
const resultObject = resultObjects.find(
|
|
1889
|
+
(entity) => entity.guid === testEntity.guid,
|
|
1890
|
+
);
|
|
1891
|
+
|
|
1892
|
+
expect(resultObject).toBeInstanceOf(Object);
|
|
1893
|
+
expect(resultObject).not.toBeInstanceOf(TestModel);
|
|
1894
|
+
expect(Array.isArray(resultObject?.tags)).toBeTruthy();
|
|
1895
|
+
expect(resultObject?.string).toEqual('test');
|
|
1896
|
+
});
|
|
1897
|
+
|
|
1420
1898
|
it('deep selector', async () => {
|
|
1421
1899
|
await createTestEntities();
|
|
1422
1900
|
|
|
@@ -1449,6 +1927,8 @@ This one's zip code is 92064.`;
|
|
|
1449
1927
|
['array', 'of'],
|
|
1450
1928
|
['array', 'values'],
|
|
1451
1929
|
['array', 500],
|
|
1930
|
+
['array', { test: true }],
|
|
1931
|
+
['array', { nullbyte: '\\\x00\u0000 \x00' }],
|
|
1452
1932
|
],
|
|
1453
1933
|
},
|
|
1454
1934
|
{
|
|
@@ -1462,7 +1942,7 @@ This one's zip code is 92064.`;
|
|
|
1462
1942
|
],
|
|
1463
1943
|
},
|
|
1464
1944
|
],
|
|
1465
|
-
}
|
|
1945
|
+
},
|
|
1466
1946
|
);
|
|
1467
1947
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1468
1948
|
|
|
@@ -1494,6 +1974,8 @@ This one's zip code is 92064.`;
|
|
|
1494
1974
|
['array', 'of'],
|
|
1495
1975
|
['array', 'values'],
|
|
1496
1976
|
['array', 500],
|
|
1977
|
+
['array', { test: true }],
|
|
1978
|
+
['array', { nullbyte: '\\\x00\u0000 \x00' }],
|
|
1497
1979
|
],
|
|
1498
1980
|
},
|
|
1499
1981
|
{
|
|
@@ -1507,7 +1989,7 @@ This one's zip code is 92064.`;
|
|
|
1507
1989
|
],
|
|
1508
1990
|
},
|
|
1509
1991
|
],
|
|
1510
|
-
}
|
|
1992
|
+
},
|
|
1511
1993
|
);
|
|
1512
1994
|
expect(testEntity.$inArray(resultEntity2)).toEqual(true);
|
|
1513
1995
|
|
|
@@ -1523,7 +2005,7 @@ This one's zip code is 92064.`;
|
|
|
1523
2005
|
},
|
|
1524
2006
|
{ type: '&', gte: ['number', 16000] },
|
|
1525
2007
|
],
|
|
1526
|
-
}
|
|
2008
|
+
},
|
|
1527
2009
|
);
|
|
1528
2010
|
expect(testEntity.$inArray(resultEntity3)).toEqual(true);
|
|
1529
2011
|
|
|
@@ -1545,7 +2027,7 @@ This one's zip code is 92064.`;
|
|
|
1545
2027
|
},
|
|
1546
2028
|
},
|
|
1547
2029
|
],
|
|
1548
|
-
}
|
|
2030
|
+
},
|
|
1549
2031
|
);
|
|
1550
2032
|
expect(testEntity.$inArray(resultEntity4)).toEqual(true);
|
|
1551
2033
|
});
|
|
@@ -1564,7 +2046,7 @@ This one's zip code is 92064.`;
|
|
|
1564
2046
|
},
|
|
1565
2047
|
{ type: '&', gte: ['number', 16000] },
|
|
1566
2048
|
],
|
|
1567
|
-
}
|
|
2049
|
+
},
|
|
1568
2050
|
);
|
|
1569
2051
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1570
2052
|
});
|
|
@@ -1581,7 +2063,7 @@ This one's zip code is 92064.`;
|
|
|
1581
2063
|
'reference',
|
|
1582
2064
|
[{ class: TestModel }, { type: '&', equal: ['test', 'good'] }],
|
|
1583
2065
|
],
|
|
1584
|
-
}
|
|
2066
|
+
},
|
|
1585
2067
|
);
|
|
1586
2068
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1587
2069
|
});
|
|
@@ -1598,7 +2080,7 @@ This one's zip code is 92064.`;
|
|
|
1598
2080
|
'reference',
|
|
1599
2081
|
[{ class: TestModel }, { type: '&', equal: ['test', 'pickles'] }],
|
|
1600
2082
|
],
|
|
1601
|
-
}
|
|
2083
|
+
},
|
|
1602
2084
|
);
|
|
1603
2085
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
1604
2086
|
});
|
|
@@ -1615,7 +2097,7 @@ This one's zip code is 92064.`;
|
|
|
1615
2097
|
'reference',
|
|
1616
2098
|
[{ class: TestBModel }, { type: '&', equal: ['test', 'good'] }],
|
|
1617
2099
|
],
|
|
1618
|
-
}
|
|
2100
|
+
},
|
|
1619
2101
|
);
|
|
1620
2102
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1621
2103
|
});
|
|
@@ -1632,31 +2114,28 @@ This one's zip code is 92064.`;
|
|
|
1632
2114
|
'reference',
|
|
1633
2115
|
[{ class: TestModel }, { type: '&', equal: ['test', 'pickles'] }],
|
|
1634
2116
|
],
|
|
1635
|
-
}
|
|
2117
|
+
},
|
|
1636
2118
|
);
|
|
1637
2119
|
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
1638
2120
|
});
|
|
1639
2121
|
|
|
1640
|
-
it('sort option', async () => {
|
|
2122
|
+
it('cdate and mdate sort option', async () => {
|
|
1641
2123
|
await createMultipleTestEntities();
|
|
1642
2124
|
|
|
1643
|
-
for (const sort of ['cdate', 'mdate']) {
|
|
2125
|
+
for (const sort of ['cdate', 'mdate'] as ('cdate' | 'mdate')[]) {
|
|
1644
2126
|
// Retrieving entities sorted...
|
|
1645
|
-
let resultEntities = await nymph.getEntities({
|
|
1646
|
-
class: TestModel,
|
|
1647
|
-
sort: sort as 'cdate' | 'mdate',
|
|
1648
|
-
});
|
|
2127
|
+
let resultEntities = await nymph.getEntities({ class: TestModel, sort });
|
|
1649
2128
|
expect(resultEntities.length).toBeGreaterThan(100);
|
|
1650
2129
|
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
1651
|
-
expect(
|
|
1652
|
-
resultEntities[i
|
|
1653
|
-
)
|
|
2130
|
+
expect(resultEntities[i + 1][sort]).toBeGreaterThan(
|
|
2131
|
+
resultEntities[i][sort] ?? 0,
|
|
2132
|
+
);
|
|
1654
2133
|
}
|
|
1655
2134
|
|
|
1656
2135
|
// And test the same with guid return...
|
|
1657
2136
|
let resultGuids = await nymph.getEntities({
|
|
1658
2137
|
class: TestModel,
|
|
1659
|
-
sort
|
|
2138
|
+
sort,
|
|
1660
2139
|
return: 'guid',
|
|
1661
2140
|
});
|
|
1662
2141
|
expect(resultGuids.length).toBeGreaterThan(100);
|
|
@@ -1667,48 +2146,121 @@ This one's zip code is 92064.`;
|
|
|
1667
2146
|
// Retrieving entities reverse sorted...
|
|
1668
2147
|
resultEntities = await nymph.getEntities({
|
|
1669
2148
|
class: TestModel,
|
|
1670
|
-
sort
|
|
2149
|
+
sort,
|
|
1671
2150
|
reverse: true,
|
|
1672
2151
|
});
|
|
1673
2152
|
expect(resultEntities.length).toBeGreaterThan(100);
|
|
1674
2153
|
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
1675
|
-
expect(resultEntities[i + 1][sort
|
|
1676
|
-
resultEntities[i][sort
|
|
2154
|
+
expect(resultEntities[i + 1][sort]).toBeLessThan(
|
|
2155
|
+
resultEntities[i][sort] ?? 0,
|
|
1677
2156
|
);
|
|
1678
2157
|
}
|
|
1679
2158
|
|
|
1680
2159
|
// And again with other selectors.
|
|
1681
2160
|
// Retrieving entities sorted...
|
|
1682
2161
|
resultEntities = await nymph.getEntities(
|
|
1683
|
-
{ class: TestModel, sort
|
|
1684
|
-
{ type: '&', match: ['name', '^Multi Test '] }
|
|
2162
|
+
{ class: TestModel, sort },
|
|
2163
|
+
{ type: '&', match: ['name', '^Multi Test '] },
|
|
1685
2164
|
);
|
|
1686
2165
|
expect(resultEntities.length).toEqual(100);
|
|
1687
2166
|
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
1688
|
-
expect(
|
|
1689
|
-
resultEntities[i
|
|
1690
|
-
)
|
|
2167
|
+
expect(resultEntities[i + 1][sort]).toBeGreaterThan(
|
|
2168
|
+
resultEntities[i][sort] ?? 0,
|
|
2169
|
+
);
|
|
1691
2170
|
}
|
|
1692
2171
|
|
|
1693
2172
|
// Retrieving entities reverse sorted...
|
|
1694
2173
|
resultEntities = await nymph.getEntities(
|
|
1695
|
-
{ class: TestModel, sort
|
|
1696
|
-
{ type: '&', match: ['name', '^Multi Test '] }
|
|
2174
|
+
{ class: TestModel, sort, reverse: true },
|
|
2175
|
+
{ type: '&', match: ['name', '^Multi Test '] },
|
|
1697
2176
|
);
|
|
1698
2177
|
expect(resultEntities.length).toEqual(100);
|
|
1699
2178
|
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
1700
|
-
expect(resultEntities[i + 1][sort
|
|
1701
|
-
resultEntities[i][sort
|
|
2179
|
+
expect(resultEntities[i + 1][sort]).toBeLessThan(
|
|
2180
|
+
resultEntities[i][sort] ?? 0,
|
|
1702
2181
|
);
|
|
1703
2182
|
}
|
|
1704
2183
|
}
|
|
1705
2184
|
});
|
|
1706
2185
|
|
|
2186
|
+
it('property sort option', async () => {
|
|
2187
|
+
await createMultipleTestEntities();
|
|
2188
|
+
|
|
2189
|
+
// Retrieving entities sorted...
|
|
2190
|
+
let resultEntities = await nymph.getEntities({
|
|
2191
|
+
class: TestModel,
|
|
2192
|
+
sort: 'number',
|
|
2193
|
+
});
|
|
2194
|
+
expect(resultEntities.length).toBeGreaterThan(100);
|
|
2195
|
+
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
2196
|
+
expect(resultEntities[i + 1].number ?? Infinity).toBeGreaterThanOrEqual(
|
|
2197
|
+
resultEntities[i].number ?? 0,
|
|
2198
|
+
);
|
|
2199
|
+
}
|
|
2200
|
+
|
|
2201
|
+
// And test the same with guid return...
|
|
2202
|
+
let resultGuids = await nymph.getEntities({
|
|
2203
|
+
class: TestModel,
|
|
2204
|
+
sort: 'number',
|
|
2205
|
+
return: 'guid',
|
|
2206
|
+
});
|
|
2207
|
+
expect(resultGuids.length).toBeGreaterThan(100);
|
|
2208
|
+
for (let i = 0; i < resultGuids.length - 1; i++) {
|
|
2209
|
+
expect(resultGuids[i]).toEqual(resultEntities[i].guid);
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
// Retrieving entities reverse sorted...
|
|
2213
|
+
resultEntities = await nymph.getEntities({
|
|
2214
|
+
class: TestModel,
|
|
2215
|
+
sort: 'number',
|
|
2216
|
+
reverse: true,
|
|
2217
|
+
});
|
|
2218
|
+
expect(resultEntities.length).toBeGreaterThan(100);
|
|
2219
|
+
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
2220
|
+
expect(resultEntities[i + 1].number ?? 0).toBeLessThanOrEqual(
|
|
2221
|
+
resultEntities[i].number ?? Infinity,
|
|
2222
|
+
);
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
// And again with other selectors.
|
|
2226
|
+
// Retrieving entities sorted...
|
|
2227
|
+
resultEntities = await nymph.getEntities(
|
|
2228
|
+
{ class: TestModel, sort: 'number' },
|
|
2229
|
+
{ type: '&', match: ['name', '^Multi Test '] },
|
|
2230
|
+
);
|
|
2231
|
+
expect(resultEntities.length).toEqual(100);
|
|
2232
|
+
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
2233
|
+
expect(resultEntities[i + 1].number ?? Infinity).toBeGreaterThan(
|
|
2234
|
+
resultEntities[i].number ?? 0,
|
|
2235
|
+
);
|
|
2236
|
+
expect(resultEntities[i].name).toEqual(
|
|
2237
|
+
`Multi Test ${100 - (resultEntities[i].number ?? 0)}`,
|
|
2238
|
+
);
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
// Retrieving entities reverse sorted...
|
|
2242
|
+
resultEntities = await nymph.getEntities(
|
|
2243
|
+
{ class: TestModel, sort: 'number', reverse: true },
|
|
2244
|
+
{ type: '&', match: ['name', '^Multi Test '] },
|
|
2245
|
+
);
|
|
2246
|
+
expect(resultEntities.length).toEqual(100);
|
|
2247
|
+
for (let i = 0; i < resultEntities.length - 1; i++) {
|
|
2248
|
+
expect(resultEntities[i + 1].number ?? 0).toBeLessThan(
|
|
2249
|
+
resultEntities[i].number ?? Infinity,
|
|
2250
|
+
);
|
|
2251
|
+
expect(resultEntities[i].name).toEqual(
|
|
2252
|
+
`Multi Test ${100 - (resultEntities[i].number ?? 0)}`,
|
|
2253
|
+
);
|
|
2254
|
+
}
|
|
2255
|
+
});
|
|
2256
|
+
|
|
1707
2257
|
it('delete reference', async () => {
|
|
1708
2258
|
await createTestEntities();
|
|
1709
2259
|
|
|
1710
2260
|
// Deleting referenced entities...
|
|
2261
|
+
await testEntity.reference?.$wake();
|
|
1711
2262
|
expect(await testEntity.reference?.$delete()).toEqual(true);
|
|
2263
|
+
await Promise.all(testEntity.refArray?.map((e) => e.$wake()) || []);
|
|
1712
2264
|
expect(testEntity.reference?.guid).toBeNull();
|
|
1713
2265
|
});
|
|
1714
2266
|
|
|
@@ -1721,16 +2273,116 @@ This one's zip code is 92064.`;
|
|
|
1721
2273
|
|
|
1722
2274
|
const entity = await nymph.getEntity(
|
|
1723
2275
|
{ class: TestModel },
|
|
1724
|
-
{ type: '&', guid: testGuid }
|
|
2276
|
+
{ type: '&', guid: testGuid },
|
|
1725
2277
|
);
|
|
1726
2278
|
|
|
1727
2279
|
expect(entity).toBeNull();
|
|
1728
2280
|
});
|
|
2281
|
+
|
|
2282
|
+
it('allows non-duplicate unique strings', async () => {
|
|
2283
|
+
// Creating entity...
|
|
2284
|
+
const uniqueEntityA = await TestModel.factory();
|
|
2285
|
+
uniqueEntityA.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2286
|
+
uniqueEntityA.uniques = ['test a'];
|
|
2287
|
+
|
|
2288
|
+
// Saving entity...
|
|
2289
|
+
expect(await uniqueEntityA.$save()).toEqual(true);
|
|
2290
|
+
expect(uniqueEntityA.guid).not.toBeNull();
|
|
2291
|
+
|
|
2292
|
+
// Creating entity...
|
|
2293
|
+
const uniqueEntityB = await TestModel.factory();
|
|
2294
|
+
uniqueEntityB.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2295
|
+
uniqueEntityB.uniques = ['test b'];
|
|
2296
|
+
|
|
2297
|
+
// Saving entity...
|
|
2298
|
+
expect(await uniqueEntityB.$save()).toEqual(true);
|
|
2299
|
+
expect(uniqueEntityB.guid).not.toBeNull();
|
|
2300
|
+
|
|
2301
|
+
expect(uniqueEntityA.guid).not.toEqual(uniqueEntityB.guid);
|
|
2302
|
+
|
|
2303
|
+
expect(await uniqueEntityA.$delete()).toEqual(true);
|
|
2304
|
+
expect(await uniqueEntityB.$delete()).toEqual(true);
|
|
2305
|
+
});
|
|
2306
|
+
|
|
2307
|
+
it('throws on duplicate unique strings', async () => {
|
|
2308
|
+
// Creating entity...
|
|
2309
|
+
const uniqueEntityA = await TestModel.factory();
|
|
2310
|
+
uniqueEntityA.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2311
|
+
uniqueEntityA.uniques = ['test a'];
|
|
2312
|
+
|
|
2313
|
+
// Saving entity...
|
|
2314
|
+
expect(await uniqueEntityA.$save()).toEqual(true);
|
|
2315
|
+
expect(uniqueEntityA.guid).not.toBeNull();
|
|
2316
|
+
|
|
2317
|
+
// Creating entity...
|
|
2318
|
+
const uniqueEntityB = await TestModel.factory();
|
|
2319
|
+
uniqueEntityB.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2320
|
+
uniqueEntityB.uniques = ['test a'];
|
|
2321
|
+
|
|
2322
|
+
// Saving entity...
|
|
2323
|
+
try {
|
|
2324
|
+
await uniqueEntityB.$save();
|
|
2325
|
+
|
|
2326
|
+
throw Error("Shouldn't get past the uniqueness check.");
|
|
2327
|
+
} catch (e: any) {
|
|
2328
|
+
expect(e).toBeInstanceOf(EntityUniqueConstraintError);
|
|
2329
|
+
}
|
|
2330
|
+
expect(uniqueEntityB.guid).toBeNull();
|
|
2331
|
+
|
|
2332
|
+
expect(await uniqueEntityA.$delete()).toEqual(true);
|
|
2333
|
+
});
|
|
2334
|
+
|
|
2335
|
+
it('allows duplicate unique string if first transaction is rolled back', async () => {
|
|
2336
|
+
// Creating transaction entity...
|
|
2337
|
+
const tnymphA = await nymph.startTransaction('test-unique-a');
|
|
2338
|
+
const TestModelA = tnymphA.getEntityClass(TestModel);
|
|
2339
|
+
const uniqueEntityA = await TestModelA.factory();
|
|
2340
|
+
uniqueEntityA.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2341
|
+
uniqueEntityA.uniques = ['test a'];
|
|
2342
|
+
|
|
2343
|
+
// Saving entity...
|
|
2344
|
+
expect(await uniqueEntityA.$save()).toEqual(true);
|
|
2345
|
+
expect(uniqueEntityA.guid).not.toBeNull();
|
|
2346
|
+
|
|
2347
|
+
// Rolling back transaction...
|
|
2348
|
+
expect(await tnymphA.rollback('test-unique-a')).toEqual(true);
|
|
2349
|
+
|
|
2350
|
+
// Creating transaction entity...
|
|
2351
|
+
const tnymphB = await nymph.startTransaction('test-unique-b');
|
|
2352
|
+
const TestModelB = tnymphB.getEntityClass(TestModel);
|
|
2353
|
+
const uniqueEntityB = await TestModelB.factory();
|
|
2354
|
+
uniqueEntityB.name = 'Entity Test ' + new Date().toLocaleString();
|
|
2355
|
+
uniqueEntityB.uniques = ['test a'];
|
|
2356
|
+
|
|
2357
|
+
// Saving entity...
|
|
2358
|
+
expect(await uniqueEntityB.$save()).toEqual(true);
|
|
2359
|
+
expect(uniqueEntityB.guid).not.toBeNull();
|
|
2360
|
+
|
|
2361
|
+
expect(uniqueEntityA.guid).not.toEqual(uniqueEntityB.guid);
|
|
2362
|
+
|
|
2363
|
+
expect(await tnymphB.commit('test-unique-b')).toEqual(true);
|
|
2364
|
+
|
|
2365
|
+
const uniqueEntityACheck = await nymph.getEntity(
|
|
2366
|
+
{ class: TestModel },
|
|
2367
|
+
{ type: '&', guid: uniqueEntityA.guid ?? '' },
|
|
2368
|
+
);
|
|
2369
|
+
expect(uniqueEntityACheck).toBeNull();
|
|
2370
|
+
|
|
2371
|
+
const uniqueEntityBCheck = await nymph.getEntity(
|
|
2372
|
+
{ class: TestModel },
|
|
2373
|
+
{ type: '&', guid: uniqueEntityB.guid ?? '' },
|
|
2374
|
+
);
|
|
2375
|
+
expect(uniqueEntityBCheck).not.toBeNull();
|
|
2376
|
+
|
|
2377
|
+
if (uniqueEntityBCheck != null) {
|
|
2378
|
+
expect(await uniqueEntityBCheck.$delete()).toEqual(true);
|
|
2379
|
+
}
|
|
2380
|
+
});
|
|
1729
2381
|
}
|
|
1730
2382
|
|
|
1731
2383
|
export function UIDTest(
|
|
1732
2384
|
nymph: Nymph,
|
|
1733
|
-
it: (name: string, fn: () => void) => void
|
|
2385
|
+
it: (name: string, fn: () => void) => void,
|
|
1734
2386
|
) {
|
|
1735
2387
|
it('delete old test data', async () => {
|
|
1736
2388
|
expect(await nymph.deleteUID('TestUID')).toEqual(true);
|
|
@@ -1771,7 +2423,7 @@ export function UIDTest(
|
|
|
1771
2423
|
|
|
1772
2424
|
export function ExportImportTest(
|
|
1773
2425
|
nymph: Nymph,
|
|
1774
|
-
it: (name: string, fn: () => void) => void
|
|
2426
|
+
it: (name: string, fn: () => void) => void,
|
|
1775
2427
|
) {
|
|
1776
2428
|
const TestModel = nymph.addEntityClass(TestModelClass);
|
|
1777
2429
|
const TestBModel = nymph.addEntityClass(TestBModelClass);
|
|
@@ -1807,23 +2459,38 @@ export function ExportImportTest(
|
|
|
1807
2459
|
const bmodels = await nymph.getEntities({ class: TestBModel });
|
|
1808
2460
|
|
|
1809
2461
|
expect(models.length).toEqual(30);
|
|
1810
|
-
expect(bmodels.length).toEqual(
|
|
1811
|
-
|
|
1812
|
-
const
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2462
|
+
expect(bmodels.length).toEqual(30);
|
|
2463
|
+
|
|
2464
|
+
for (const model of models) {
|
|
2465
|
+
expect(model.name).toMatch(/^Entity Test /);
|
|
2466
|
+
expect(model.null).toBeDefined();
|
|
2467
|
+
expect(model.null).toBeNull();
|
|
2468
|
+
expect(model.string).toEqual('test');
|
|
2469
|
+
expect(model.array).toEqual([
|
|
2470
|
+
'full',
|
|
2471
|
+
'of',
|
|
2472
|
+
'values',
|
|
2473
|
+
500,
|
|
2474
|
+
{ test: true },
|
|
2475
|
+
{ nullbyte: '\\\x00\u0000 \x00' },
|
|
2476
|
+
]);
|
|
2477
|
+
expect(model.match).toEqual(matchValue);
|
|
2478
|
+
expect(model.number).toEqual(30);
|
|
2479
|
+
expect(model.numberString).toEqual('30');
|
|
2480
|
+
expect(model.timestamp).toBeGreaterThanOrEqual(strtotime('-2 minutes'));
|
|
2481
|
+
expect(model.index).toMatch(/^\d+a$/);
|
|
2482
|
+
|
|
2483
|
+
await model.reference?.$wake();
|
|
2484
|
+
expect(model.reference?.guid).not.toBeNull();
|
|
2485
|
+
expect(model.reference?.string).toEqual('another');
|
|
2486
|
+
expect(model.reference?.index).toMatch(/^\d+b$/);
|
|
2487
|
+
expect(model.index?.substring(0, -1)).toEqual(
|
|
2488
|
+
model.reference?.index?.substring(0, -1),
|
|
2489
|
+
);
|
|
2490
|
+
expect(model.reference?.$inArray(bmodels)).toEqual(true);
|
|
2491
|
+
await Promise.all(model.refArray?.map((e) => e.$wake()) || []);
|
|
2492
|
+
expect(model.refArray?.[0].guid).not.toBeNull();
|
|
2493
|
+
expect(model.refArray?.[0].guid).toEqual(model.reference?.guid);
|
|
1827
2494
|
}
|
|
1828
2495
|
}
|
|
1829
2496
|
|
|
@@ -1836,22 +2503,29 @@ export function ExportImportTest(
|
|
|
1836
2503
|
expect(await nymph.newUID('TestUID')).toEqual(2);
|
|
1837
2504
|
expect(await nymph.newUID('TestUID2')).toEqual(1);
|
|
1838
2505
|
|
|
1839
|
-
for (let i = 0; i <
|
|
1840
|
-
const EntityClass = i < 15 ? TestModel : TestBModel;
|
|
1841
|
-
|
|
2506
|
+
for (let i = 0; i < 30; i++) {
|
|
1842
2507
|
// Creating entity...
|
|
1843
|
-
const testEntity = await
|
|
2508
|
+
const testEntity = await TestModel.factory();
|
|
1844
2509
|
|
|
1845
2510
|
// Saving entity...
|
|
1846
2511
|
testEntity.name = 'Entity Test ' + new Date().toLocaleString();
|
|
1847
2512
|
testEntity.null = null;
|
|
1848
2513
|
testEntity.string = 'test';
|
|
1849
|
-
testEntity.array = [
|
|
2514
|
+
testEntity.array = [
|
|
2515
|
+
'full',
|
|
2516
|
+
'of',
|
|
2517
|
+
'values',
|
|
2518
|
+
500,
|
|
2519
|
+
{ test: true },
|
|
2520
|
+
{ nullbyte: '\\\x00\u0000 \x00' },
|
|
2521
|
+
];
|
|
2522
|
+
testEntity.match = matchValue;
|
|
1850
2523
|
testEntity.number = 30;
|
|
2524
|
+
testEntity.numberString = '30';
|
|
1851
2525
|
testEntity.timestamp = Date.now();
|
|
1852
2526
|
testEntity.index = i + 'a';
|
|
1853
2527
|
|
|
1854
|
-
const entityReferenceTest = await
|
|
2528
|
+
const entityReferenceTest = await TestBModel.factory();
|
|
1855
2529
|
entityReferenceTest.string = 'another';
|
|
1856
2530
|
entityReferenceTest.index = i + 'b';
|
|
1857
2531
|
|
|
@@ -1865,9 +2539,13 @@ export function ExportImportTest(
|
|
|
1865
2539
|
await checkEntityDataAndCount();
|
|
1866
2540
|
});
|
|
1867
2541
|
|
|
2542
|
+
it('needs migration', async () => {
|
|
2543
|
+
expect(await nymph.needsMigration()).toEqual(false);
|
|
2544
|
+
});
|
|
2545
|
+
|
|
1868
2546
|
it('export data', async () => {
|
|
1869
2547
|
expect(await nymph.export(__dirname + '/testentityexport.nex')).toEqual(
|
|
1870
|
-
true
|
|
2548
|
+
true,
|
|
1871
2549
|
);
|
|
1872
2550
|
});
|
|
1873
2551
|
|
|
@@ -1884,11 +2562,237 @@ export function ExportImportTest(
|
|
|
1884
2562
|
expect(bmodels.length).toEqual(0);
|
|
1885
2563
|
|
|
1886
2564
|
expect(await nymph.import(__dirname + '/testentityexport.nex')).toEqual(
|
|
1887
|
-
true
|
|
2565
|
+
true,
|
|
1888
2566
|
);
|
|
1889
2567
|
|
|
1890
2568
|
await checkEntityDataAndCount();
|
|
1891
2569
|
|
|
1892
2570
|
fs.unlinkSync(__dirname + '/testentityexport.nex');
|
|
1893
2571
|
});
|
|
2572
|
+
|
|
2573
|
+
it('import tokens only', async () => {
|
|
2574
|
+
const model = await nymph.getEntity({ class: TestModel });
|
|
2575
|
+
|
|
2576
|
+
expect(model).not.toBeNull();
|
|
2577
|
+
|
|
2578
|
+
if (model != null) {
|
|
2579
|
+
const data = model.$getData(true);
|
|
2580
|
+
// These should not actually be saved in the DB.
|
|
2581
|
+
data.number = 424242424242;
|
|
2582
|
+
// But this should become searchable.
|
|
2583
|
+
data.search = 'peanuts and pickles on a hot bun';
|
|
2584
|
+
|
|
2585
|
+
const sdata = Object.fromEntries(
|
|
2586
|
+
Object.entries(data).map(([name, value]) => [
|
|
2587
|
+
name,
|
|
2588
|
+
JSON.stringify(value),
|
|
2589
|
+
]),
|
|
2590
|
+
);
|
|
2591
|
+
|
|
2592
|
+
if (model.guid == null || model.cdate == null || model.mdate == null) {
|
|
2593
|
+
throw new Error('Model data is wrong.');
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
await nymph.importEntityTokens({
|
|
2597
|
+
guid: model.guid,
|
|
2598
|
+
// Again, these should not actually be changed in the DB.
|
|
2599
|
+
cdate: model.cdate + 1000,
|
|
2600
|
+
mdate: model.mdate + 1000,
|
|
2601
|
+
tags: [...model.tags, 'helicopter'],
|
|
2602
|
+
sdata,
|
|
2603
|
+
etype: TestModel.ETYPE,
|
|
2604
|
+
});
|
|
2605
|
+
|
|
2606
|
+
const modelCheck = await nymph.getEntity(
|
|
2607
|
+
{ class: TestModel },
|
|
2608
|
+
{ type: '&', search: ['search', '"peanuts and pickles on a hot bun"'] },
|
|
2609
|
+
);
|
|
2610
|
+
|
|
2611
|
+
expect(modelCheck?.guid).toEqual(model.guid);
|
|
2612
|
+
expect(modelCheck?.cdate).toEqual(model.cdate);
|
|
2613
|
+
expect(modelCheck?.mdate).toEqual(model.mdate);
|
|
2614
|
+
expect(modelCheck?.$hasTag('helicopter')).toEqual(false);
|
|
2615
|
+
expect(modelCheck?.number).not.toEqual(424242424242);
|
|
2616
|
+
expect(modelCheck?.search).not.toEqual(
|
|
2617
|
+
'peanuts and pickles on a hot bun',
|
|
2618
|
+
);
|
|
2619
|
+
}
|
|
2620
|
+
});
|
|
1894
2621
|
}
|
|
2622
|
+
|
|
2623
|
+
const matchValue = `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.
|
|
2624
|
+
|
|
2625
|
+
This one's email address is nice_hat-wednesday+newyork@im-a-hat.hat.
|
|
2626
|
+
This one's phone number is (555) 555-1818.
|
|
2627
|
+
This one's zip code is 92064.
|
|
2628
|
+
This one's favorite emojis are 🔥❤️😊😂⭐🤔
|
|
2629
|
+
|
|
2630
|
+
These hats are absolutely fantastic.
|
|
2631
|
+
|
|
2632
|
+
\x00\x00\x00
|
|
2633
|
+
|
|
2634
|
+
Lorem ipsum odor amet, consectetuer adipiscing elit. Metus ad mattis sit pretium per, dignissim imperdiet luctus. Congue rhoncus turpis etiam aenean ultricies dapibus justo nunc. Netus non primis quis habitasse lacus. Nascetur dapibus sociosqu ridiculus primis; elementum netus consectetur ridiculus litora. Tristique facilisis erat ex class nulla cursus amet. Metus vitae tempor euismod vel; ullamcorper ac quisque vestibulum. Mauris libero pulvinar facilisi eros natoque massa.
|
|
2635
|
+
|
|
2636
|
+
Nunc vel hac nec tristique vivamus. Leo volutpat convallis eget integer tellus cubilia tincidunt malesuada? Consequat elit nisi tristique vehicula cubilia maecenas metus facilisi malesuada. In mattis euismod ad magnis fusce. Nisi congue sociosqu rhoncus lobortis fringilla sollicitudin at platea. Iaculis ut et varius metus eleifend laoreet hac odio libero. Non ridiculus tempus ultricies nullam curabitur.
|
|
2637
|
+
|
|
2638
|
+
Amet pellentesque aliquam placerat; vestibulum blandit platea porttitor pulvinar. Tellus tristique ad morbi in ac placerat luctus. Ante efficitur inceptos commodo lacus sodales sit varius nunc consequat. Senectus non vel est convallis mauris. Venenatis feugiat massa nostra, purus class primis sodales odio. Risus nulla integer feugiat ridiculus porta nascetur. Rutrum tincidunt enim parturient libero nisl ante sagittis nisi. Cubilia massa non vehicula vehicula amet parturient pellentesque. Habitant dapibus fames lectus pretium rhoncus.
|
|
2639
|
+
|
|
2640
|
+
Ridiculus nascetur mauris iaculis hendrerit ridiculus gravida auctor in. Class suscipit augue finibus semper vulputate nec. Tristique mi eu praesent commodo fermentum inceptos penatibus lobortis. Libero enim orci ultricies egestas ut pellentesque. Laoreet massa ad curabitur tellus libero laoreet habitasse enim nascetur. Iaculis euismod a euismod conubia purus. Commodo condimentum ultrices lorem ligula aenean; netus mattis sem non.
|
|
2641
|
+
|
|
2642
|
+
Curabitur duis imperdiet mus integer vel bibendum; fusce malesuada. Dignissim duis himenaeos primis odio, congue pharetra? Egestas mus sit eget proin quis. Neque dapibus dapibus nam sociosqu; maecenas viverra himenaeos. Himenaeos faucibus himenaeos faucibus ex litora eros faucibus cras. Maximus scelerisque nullam nunc congue fringilla. Nisi eu magna erat morbi cras enim amet litora. Nostra primis vitae arcu, accumsan sollicitudin curabitur. Potenti sit vel vehicula metus leo id. Etiam blandit quisque nam orci; neque lacinia rutrum.
|
|
2643
|
+
|
|
2644
|
+
Aliquam mollis varius hendrerit sem eleifend fermentum. Sapien rutrum condimentum inceptos ex feugiat consectetur mollis magna diam. Natoque enim nisi, ex risus finibus lacinia conubia vivamus suscipit. Habitasse interdum lorem ante, bibendum posuere dis. Lacus porttitor sapien proin; consequat velit ipsum venenatis. Vivamus porta mattis morbi nunc torquent neque. Senectus vehicula tincidunt parturient fringilla id amet urna libero pharetra.
|
|
2645
|
+
|
|
2646
|
+
Faucibus netus tincidunt et viverra augue ligula est quis. Ipsum tempus vehicula tortor dis tortor ad. Ex tincidunt torquent eleifend aenean urna commodo. Quam nullam imperdiet volutpat vel condimentum cubilia sociosqu. Etiam tempor sapien mattis, venenatis aptent id risus. Efficitur luctus vel; nam ut commodo sociosqu hendrerit. Quisque placerat gravida rhoncus blandit vitae. Himenaeos id risus est mollis aliquet nam curabitur.
|
|
2647
|
+
|
|
2648
|
+
Habitasse sed est fames quis lobortis leo mattis. Nisl cursus tincidunt cursus felis porttitor. Ante integer turpis non class lobortis suscipit. Condimentum velit vulputate quis sapien, lacus magna adipiscing nec primis. Blandit consequat ipsum nostra dignissim; tincidunt torquent fames. Ac faucibus elit iaculis duis lobortis. Euismod facilisi massa turpis mus neque. Class vulputate quisque elementum suscipit nostra tempus adipiscing. Malesuada himenaeos finibus ad inceptos volutpat scelerisque inceptos.
|
|
2649
|
+
|
|
2650
|
+
Natoque platea at feugiat cras tellus facilisi suspendisse lacinia maximus. Duis vestibulum eget molestie turpis risus dapibus dignissim torquent? Nulla nibh aptent fringilla scelerisque euismod mauris ornare. Orci finibus taciti habitasse fringilla laoreet convallis. Class sed fringilla eget quisque sit auctor. Id cursus mauris praesent maecenas iaculis. Ullamcorper luctus habitant ultrices pharetra etiam mattis morbi fringilla lorem.
|
|
2651
|
+
|
|
2652
|
+
Pharetra porta orci ridiculus inceptos eleifend sem ante quis. Molestie velit penatibus libero per sem litora congue. Porta quis egestas vivamus vitae potenti ornare. Elit molestie nullam vitae quam viverra. Nisl fringilla massa ridiculus donec ridiculus sed magnis. Cursus ad enim consequat ultricies tortor rhoncus pellentesque augue. Netus facilisis tempor elementum interdum at sagittis habitasse. Pretium imperdiet duis diam ullamcorper donec at suscipit. Id per inceptos ac luctus massa imperdiet tempor. Parturient libero suscipit non tempor ligula ullamcorper placerat varius.
|
|
2653
|
+
|
|
2654
|
+
Libero duis suspendisse cubilia rhoncus scelerisque faucibus mattis. Leo fusce urna at per inceptos vel lobortis. Quisque ex duis euismod dictum hac nibh eros. Penatibus eleifend tellus donec elit primis phasellus habitant dictum. Imperdiet consequat facilisi massa, lacus gravida sodales id sapien. Ornare sapien sit convallis suscipit nunc enim. Tempus at vitae class sollicitudin proin. Dolor aenean felis netus consectetur mattis phasellus vestibulum. Orci fringilla sodales montes sed himenaeos ex massa natoque porttitor.
|
|
2655
|
+
|
|
2656
|
+
Mus condimentum dui mollis dolor accumsan ligula pretium? Est phasellus platea iaculis vehicula et eros vel rutrum placerat. Nulla laoreet faucibus; congue netus magna senectus lectus dictum. Sodales aliquam eget himenaeos adipiscing, tempor feugiat. Lorem pellentesque iaculis fames lectus cubilia ornare sagittis rhoncus? Bibendum viverra tellus libero congue dignissim metus tellus aenean ultrices. Sollicitudin cras sollicitudin mattis lacus facilisis fermentum scelerisque porttitor rutrum.
|
|
2657
|
+
|
|
2658
|
+
Sapien aptent fames curae, consectetur dapibus mauris sollicitudin tellus. Laoreet etiam dignissim, suscipit platea libero vitae taciti eu nec. Donec lobortis metus nisi; est enim himenaeos molestie tellus sapien. Sapien tellus rhoncus blandit fusce hendrerit feugiat. Maximus sit hendrerit tincidunt nec imperdiet hendrerit semper suscipit. Quam augue proin netus rutrum et sem. Neque penatibus cubilia nec metus porta. Ornare pulvinar quam auctor, elit curae ad donec dis. Egestas aptent non tortor potenti morbi mauris.
|
|
2659
|
+
|
|
2660
|
+
Montes dui in pharetra primis consequat ante integer. Vulputate libero gravida rutrum tortor suscipit massa! Netus rhoncus platea torquent dapibus consectetur suspendisse etiam sociosqu. Quis placerat mauris et quam nascetur. Dictumst mi rutrum justo vitae ultricies feugiat nulla faucibus morbi. Consectetur nec condimentum euismod sodales nisi purus; finibus elementum facilisi.
|
|
2661
|
+
|
|
2662
|
+
Senectus mus faucibus ut morbi eu maximus. Turpis tincidunt sodales sociosqu lorem amet pulvinar laoreet faucibus. Mus bibendum vulputate hendrerit sollicitudin eu ridiculus posuere augue leo? Cubilia nostra consequat; fusce egestas himenaeos class ornare nec. Est montes tortor vivamus congue inceptos erat mi eget pellentesque. Amet vulputate fringilla aliquet fames tristique. Rutrum malesuada dapibus vehicula risus nunc torquent habitant turpis habitant. Ipsum proin viverra adipiscing cras et augue hendrerit. Efficitur euismod aliquam habitant; sit nisl potenti.
|
|
2663
|
+
|
|
2664
|
+
Conubia dignissim metus phasellus tristique augue, nullam quam finibus. Dignissim vel enim mattis praesent penatibus. Sapien pharetra curae torquent turpis fermentum feugiat facilisis nisi. Lacinia justo ante mauris finibus vitae ante efficitur dis. Urna gravida conubia amet rhoncus felis ut lorem placerat. Quisque fermentum suscipit aenean nisi suscipit ac? Quis ornare faucibus amet conubia justo maximus hendrerit phasellus aenean. Ex vivamus vulputate in mollis mauris praesent vehicula erat neque.
|
|
2665
|
+
|
|
2666
|
+
Orci nullam commodo habitant volutpat per tincidunt mus sit. Nisi cubilia fringilla viverra at orci magnis massa nam orci. Duis iaculis sapien nulla nascetur elit porta fermentum. Amus libero vivamus vel finibus magnis placerat himenaeos. Integer posuere suscipit non vulputate enim. Conubia id lobortis habitasse luctus odio maecenas enim conubia non. Mus egestas massa platea nullam sociosqu, magnis cras. Quam placerat nisi dui gravida ultricies, facilisis eu pharetra vivamus.
|
|
2667
|
+
|
|
2668
|
+
Fusce maecenas dis finibus senectus nascetur tortor. Nec rhoncus pretium vivamus donec vel ligula curabitur. Velit dis laoreet aenean, fusce metus blandit erat. Ligula purus natoque, arcu finibus tincidunt efficitur dolor curabitur. Ac risus et ipsum; consequat integer phasellus diam. Praesent ipsum gravida placerat porta volutpat tincidunt maximus sapien. Phasellus gravida orci enim velit condimentum.
|
|
2669
|
+
|
|
2670
|
+
Dui id laoreet penatibus orci sit a. Iaculis dis porttitor luctus; lacus dignissim quam commodo lorem. Nullam dictum quisque accumsan porttitor tortor fusce aenean. Aliquet quisque ultricies malesuada auctor facilisi tristique. Dolor nulla conubia ultricies odio ad. Nunc consectetur venenatis consequat nisi habitant. Praesent accumsan scelerisque morbi aliquam sociosqu auctor, nostra aenean.
|
|
2671
|
+
|
|
2672
|
+
Mauris amet conubia egestas eu posuere nullam. Est neque dictum in, lacus aliquam ultrices vestibulum. Dapibus dis habitasse cras conubia felis nibh. Egestas nisl iaculis nostra neque enim, ridiculus praesent. Consectetur eleifend eu mus; elit sed pellentesque fringilla. Ullamcorper hendrerit nibh aptent per congue libero ultrices eget. Mollis velit ad tortor lobortis ipsum.
|
|
2673
|
+
|
|
2674
|
+
Tristique neque justo potenti himenaeos; pellentesque nam vehicula. Maximus etiam ut nullam semper; fames curabitur quam ad morbi. Interdum curabitur platea augue porttitor a gravida. Leo imperdiet id aenean sit; habitasse quam tempus pellentesque? Nostra leo aenean amet lectus ultricies ridiculus nascetur ullamcorper. Taciti in iaculis quam nascetur proin varius eget vehicula.
|
|
2675
|
+
|
|
2676
|
+
Mattis hendrerit tempus interdum diam elementum primis augue phasellus sociosqu. Imperdiet pulvinar imperdiet lacinia posuere class magnis. Montes viverra scelerisque laoreet sociosqu proin lacus. Nam id justo praesent curabitur nam accumsan imperdiet commodo. Sociosqu netus sapien proin interdum ac. Dapibus tempor et sodales, natoque consequat torquent.
|
|
2677
|
+
|
|
2678
|
+
Lectus ultricies amet bibendum blandit finibus erat pellentesque. Nam quis ultrices curae; lorem gravida malesuada velit taciti enim. Facilisis fermentum suspendisse leo tristique litora dapibus rhoncus convallis. Netus iaculis eleifend viverra urna, vulputate ac convallis. Faucibus torquent dictum, nisl sed parturient libero. Ornare class habitant per consequat adipiscing rhoncus feugiat.
|
|
2679
|
+
|
|
2680
|
+
Proin molestie nullam eros parturient parturient curabitur aliquet. Rhoncus mus aenean sem aliquet sem finibus neque rutrum commodo. Efficitur litora lobortis nascetur adipiscing curae faucibus? Bibendum leo velit augue; potenti primis malesuada lacus ipsum. Facilisi potenti facilisis nam tempor consequat. Magnis suspendisse primis duis quam; suscipit quis fermentum phasellus. Massa ridiculus habitasse ipsum arcu sit maecenas gravida nisi? Dolor egestas lacinia lacinia libero nam curae suspendisse purus. Tristique inceptos curae netus scelerisque magna hendrerit commodo quis parturient. Eget accumsan erat sociosqu vestibulum platea turpis habitasse.
|
|
2681
|
+
|
|
2682
|
+
Maximus dignissim sed conubia a ipsum nullam condimentum dictumst. Suspendisse congue phasellus congue lacus sollicitudin senectus curae. Consequat sagittis in fringilla suscipit scelerisque suscipit. Rhoncus pharetra sodales malesuada sollicitudin lectus. Est primis pretium finibus felis pharetra nulla sapien lacinia. Nunc lorem aptent tristique quisque etiam posuere non ullamcorper. Potenti mus sed mus; non id eleifend pellentesque magnis.
|
|
2683
|
+
|
|
2684
|
+
Iaculis morbi mattis; ornare tincidunt neque mus egestas consectetur ultrices. Porta dapibus pretium, vulputate dis amet neque. Posuere auctor lacinia maecenas ridiculus ullamcorper tempus egestas cubilia nec. Cursus nulla lacinia mi facilisi, nisl tempor. Tempus elementum laoreet magnis neque morbi felis per. Suspendisse lectus vitae nunc amet himenaeos euismod aliquam. Quisque integer dictum aenean fermentum dictumst torquent.
|
|
2685
|
+
|
|
2686
|
+
Sociosqu per suspendisse augue phasellus velit dapibus parturient. At sit eu finibus posuere tincidunt. Phasellus duis scelerisque scelerisque taciti est venenatis. Arcu habitant augue amet eget maximus torquent. Eget gravida ut quisque ligula vel mus. Erat quis himenaeos; velit eget varius viverra interdum. Neque dapibus malesuada est a gravida libero integer aptent. Semper eleifend per at magnis, laoreet nibh orci vel ligula.
|
|
2687
|
+
|
|
2688
|
+
Odio purus finibus inceptos malesuada duis. Neque magnis est laoreet nibh gravida sagittis ullamcorper sodales. Parturient ultricies mattis lacus risus laoreet praesent. Tincidunt eleifend quis sagittis id nascetur. Nam scelerisque varius feugiat phasellus enim mauris nam. Tortor iaculis et cras; blandit sollicitudin pellentesque justo. Nam lacinia volutpat fusce nibh mollis; himenaeos iaculis. Vulputate dictum mattis sollicitudin accumsan at hendrerit.
|
|
2689
|
+
|
|
2690
|
+
Ipsum augue faucibus senectus porta dapibus metus. Netus sem amet nullam fermentum in dolor bibendum. Lacus quis enim vivamus enim risus elit suspendisse arcu. Penatibus proin pellentesque consequat nibh turpis fusce. Potenti sociosqu nunc tempor amet torquent. Aliquet porttitor adipiscing parturient curabitur hac? Condimentum morbi netus erat class hendrerit aptent. Placerat viverra molestie at eget donec quisque. Varius sem erat dolor, urna nunc ac duis inceptos maximus.
|
|
2691
|
+
|
|
2692
|
+
Nostra adipiscing dapibus eros vivamus accumsan elementum curae dignissim dignissim. Iaculis quisque fusce at conubia est habitant ipsum. Porttitor libero lobortis lobortis habitasse quis quisque nunc euismod aenean. Bibendum nullam volutpat quam vitae felis sit. Mauris bibendum nulla litora nec id, elit lacinia. Orci odio nunc est ante commodo dis quis diam convallis? Mattis a per cras amet egestas ex pellentesque nascetur augue. Egestas per massa per non metus hendrerit feugiat eu?
|
|
2693
|
+
|
|
2694
|
+
Praesent habitasse est elementum mattis potenti. Fermentum interdum enim orci dui faucibus sodales nisi mus. Tortor facilisi nunc potenti; dignissim magna varius! Risus cursus ornare tincidunt a feugiat massa cubilia. Sociosqu quis pharetra efficitur lorem ornare sapien arcu euismod. Elementum donec maecenas praesent scelerisque viverra mi natoque. Lacinia nibh eu commodo ut class blandit magnis.
|
|
2695
|
+
|
|
2696
|
+
Ullamcorper himenaeos mollis nostra placerat quam pellentesque nibh. Curae posuere cras dis senectus fringilla congue ipsum sit. Eros maecenas duis morbi consequat himenaeos ridiculus purus erat. Nascetur maximus massa eros class phasellus integer sed gravida. Vel donec lacinia donec curabitur penatibus integer ornare. Varius quam lectus magna per a mauris.
|
|
2697
|
+
|
|
2698
|
+
Imperdiet tempus malesuada ultrices egestas taciti nibh elit lacus. Nunc tempus tellus vitae duis rhoncus leo facilisis. Sapien nec mi lacus mi aliquet. Diam convallis fringilla libero duis integer integer dictum vel. Dolor montes nibh sapien dapibus ultrices praesent. Aeuismod phasellus taciti elit vehicula sit sociosqu. Lobortis neque urna dignissim penatibus felis vulputate. Primis magnis placerat, ligula massa facilisis nec.
|
|
2699
|
+
|
|
2700
|
+
Duis interdum himenaeos dis nisl et tortor condimentum accumsan. Laoreet amet fusce dis malesuada iaculis maximus fringilla. Conubia mus nibh felis vestibulum ad convallis mollis. Metus vivamus lobortis habitasse id nam. Egestas pretium eu penatibus consectetur malesuada congue tempus fusce. Rutrum neque pulvinar duis ligula fermentum malesuada. Tincidunt mollis molestie imperdiet ridiculus pharetra maximus sodales curabitur.
|
|
2701
|
+
|
|
2702
|
+
Sem nec integer fusce neque sagittis. Rutrum ipsum ante; urna enim primis consectetur nulla. Arcu ligula lectus varius magna ipsum, et dictum. Pharetra dignissim inceptos tristique natoque tempor volutpat. Luctus tristique himenaeos duis orci maecenas vel morbi. Habitasse a lacinia dignissim commodo elementum maecenas eu mollis. Fermentum tellus sem condimentum mattis elit lectus. Platea fusce arcu cras varius natoque? Volutpat tincidunt ridiculus mus massa ante dis sem ornare magna. Bibendum ornare ultrices proin efficitur; nascetur risus arcu.
|
|
2703
|
+
|
|
2704
|
+
Orci erat orci amet mollis venenatis. Feugiat torquent ex mattis, inceptos etiam integer. Class senectus aptent vivamus, semper dolor nisi at pretium volutpat. Natoque semper enim enim primis ultricies, pharetra pulvinar. Natoque litora tortor accumsan ridiculus lacinia integer; aliquet penatibus ridiculus. Placerat vestibulum justo tristique sapien senectus, et interdum et ridiculus. Urna aenean vel himenaeos; finibus a est efficitur donec. Dictum egestas quis fusce arcu; sapien himenaeos pretium congue. Semper et sapien nisi nascetur venenatis eros integer blandit.
|
|
2705
|
+
|
|
2706
|
+
Arcu per phasellus vehicula ad molestie? Eget arcu eget inceptos, eu ullamcorper diam. Gravida placerat elit ut hendrerit odio. Est lobortis imperdiet venenatis primis a. Facilisis integer maecenas adipiscing metus, rutrum curabitur. Dolor adipiscing himenaeos senectus tempus faucibus cras.
|
|
2707
|
+
|
|
2708
|
+
Massa torquent torquent ullamcorper erat nisl parturient primis eu pulvinar! Ridiculus sollicitudin dis eu, laoreet praesent hendrerit platea euismod. Lacinia dignissim suspendisse sagittis eu rutrum himenaeos curae massa diam. Platea ornare ridiculus consequat curabitur augue vestibulum ridiculus. Vel consectetur vivamus accumsan risus elementum? Imperdiet nascetur efficitur aliquam habitasse nascetur. Hendrerit quisque magnis in lacinia quis mauris.
|
|
2709
|
+
|
|
2710
|
+
Molestie fermentum blandit, viverra condimentum purus himenaeos. Fermentum congue a suspendisse ornare semper laoreet. Pharetra lacus non, iaculis ad taciti varius. Etiam nam risus vestibulum curabitur facilisis mattis, lorem hac id. Dignissim nibh tempor quam porta lectus nunc tincidunt aliquet. Tortor maximus maximus natoque nam magna torquent nec lectus mus. Vel fermentum semper vulputate penatibus vel purus.
|
|
2711
|
+
|
|
2712
|
+
Fermentum tincidunt penatibus platea himenaeos etiam sodales ad erat posuere. Vehicula vulputate sem blandit nullam sem. Condimentum eget lacus ad malesuada augue dui justo. Lobortis quis mauris pellentesque quam interdum sagittis. Nulla ullamcorper aptent hendrerit fusce hendrerit, cras cras magna. Ex quam torquent, congue dis est vulputate lacinia. Dignissim proin lacinia platea tortor elementum nullam. Purus natoque scelerisque habitant vestibulum; metus dui neque ipsum. Pellentesque augue montes fringilla et, maecenas habitant a.
|
|
2713
|
+
|
|
2714
|
+
Quam sapien eu scelerisque tristique, integer in rutrum gravida. Egestas lacinia nisi praesent turpis lacus maximus mus gravida. Dolor eget ultrices rhoncus velit; mollis id. Mi vulputate sed blandit nullam parturient venenatis. Neque vulputate iaculis nascetur felis fames ipsum adipiscing nullam? Vitae faucibus elit congue himenaeos orci volutpat nam. Magna tempus convallis vivamus eu semper. Egestas curabitur integer quis habitasse id taciti hac sociosqu morbi. Duis felis cursus potenti blandit cras dolor pharetra.
|
|
2715
|
+
|
|
2716
|
+
Ultricies vel primis nec mus malesuada congue? Habitasse semper mus ultricies; fermentum himenaeos placerat sodales. Platea sapien malesuada dignissim suscipit dis cras. Etiam odio pharetra metus donec odio natoque. Cras diam curae dapibus accumsan tortor mi laoreet. Ex mollis massa inceptos inceptos adipiscing. Cras rhoncus natoque accumsan augue enim. Parturient porttitor habitant semper platea elementum dictum ornare? Sociosqu blandit nullam vivamus elementum semper himenaeos.
|
|
2717
|
+
|
|
2718
|
+
Orci elit aliquam luctus habitant interdum. Tellus sollicitudin aliquam donec potenti praesent augue magnis auctor. Mattis faucibus iaculis etiam imperdiet lectus ad habitasse sollicitudin ac. Consequat maecenas quam dis adipiscing neque sociosqu. Ullamcorper in praesent himenaeos purus blandit nibh. Dignissim platea amet urna laoreet sociosqu lacinia accumsan consectetur risus. Adipiscing nullam arcu lobortis mi scelerisque feugiat non. Accumsan lacinia urna sit urna tincidunt nam pulvinar urna. Tellus cursus ac himenaeos sed aptent phasellus.
|
|
2719
|
+
|
|
2720
|
+
Scelerisque curabitur eget morbi leo phasellus morbi magnis. Elit nunc non vulputate eget at. Viverra efficitur dignissim fames ut condimentum tincidunt elementum lacus egestas. Dictum phasellus leo auctor dui diam. Sollicitudin placerat elit vehicula vulputate et at eleifend ullamcorper. Primis diam hac class leo justo etiam magnis. Justo maximus venenatis facilisis egestas hendrerit aptent arcu tortor consectetur. Consequat mus curabitur nisl; blandit enim at bibendum tempor bibendum. Ad nam arcu vehicula himenaeos sociosqu eu faucibus accumsan.
|
|
2721
|
+
|
|
2722
|
+
Maximus malesuada faucibus phasellus donec ligula. Rutrum pellentesque ultricies nullam; aenean scelerisque elementum. Porta luctus consectetur pharetra consequat varius. Ut dapibus senectus venenatis scelerisque fames ligula congue. Magna hendrerit faucibus ultricies tincidunt phasellus pellentesque, maecenas consequat! Malesuada senectus praesent sed condimentum aenean mi. Interdum sollicitudin mattis, purus vitae netus gravida. Nullam magna risus leo sit urna aenean.
|
|
2723
|
+
|
|
2724
|
+
Ut lacinia potenti vel varius habitant mus nullam adipiscing. Commodo potenti conubia hendrerit enim massa ad blandit. Nisl a massa nunc risus, condimentum enim. Hac aenean massa lacinia lobortis ad dolor sem. Nisl ex interdum blandit pulvinar pellentesque lorem. Sapien proin malesuada netus parturient pulvinar nec. Ex semper amet sem maximus blandit cras felis. Donec tellus auctor eleifend placerat natoque. Rutrum maecenas sollicitudin nisl consectetur in nulla rhoncus. Id rhoncus nec mi non lacinia leo efficitur nisi.
|
|
2725
|
+
|
|
2726
|
+
Dolor non phasellus id nascetur id nisi litora cubilia interdum. Lectus dolor sodales eu nulla porttitor placerat vulputate. Praesent ullamcorper consequat nulla torquent facilisis nunc. Rhoncus augue eleifend mauris erat duis varius felis. Dignissim nunc pulvinar vehicula dignissim maximus elit metus senectus. Venenatis conubia pulvinar commodo dui montes cubilia.
|
|
2727
|
+
|
|
2728
|
+
Cursus velit lacus aenean elit conubia. Velit in inceptos enim, elit lobortis est facilisis. Suscipit cursus dictum enim libero neque dolor himenaeos eu. Porta in integer praesent quisque quis sit. Primis velit tempus sit curae vehicula porttitor. Scelerisque nisi diam vehicula mi fusce dictum. Tincidunt mus eleifend commodo ridiculus adipiscing.
|
|
2729
|
+
|
|
2730
|
+
Pellentesque quis dignissim euismod in fermentum quam lobortis porta. Dis euismod ultricies montes odio sapien condimentum integer per. Torquent nascetur ante ante; diam ultrices nec habitant. Augue congue a conubia commodo ultricies tortor. Quis ridiculus netus vivamus dictumst efficitur parturient hendrerit. Facilisis ultrices suspendisse elit sodales eleifend maecenas tempor. Habitasse platea congue ac, pretium augue odio interdum netus. Mattis odio mi leo integer nisi diam phasellus elementum. Tortor himenaeos curabitur enim sit ac mi dictumst faucibus sociosqu.
|
|
2731
|
+
|
|
2732
|
+
Duis ex viverra auctor praesent elit ac. Sit ex at cubilia aenean scelerisque finibus ridiculus. Hendrerit imperdiet potenti erat risus commodo. Sit donec ullamcorper facilisi neque varius, suscipit malesuada hac. Nulla lacinia pulvinar non volutpat pellentesque lobortis ultrices dis. Faucibus luctus fusce, aliquam magnis pharetra sed dui nulla viverra. Lectus hendrerit eu pellentesque nostra mauris suspendisse himenaeos. Lectus bibendum inceptos commodo nulla magnis proin.`;
|
|
2733
|
+
|
|
2734
|
+
const searchValue = `In Congress, July 4, 1776
|
|
2735
|
+
|
|
2736
|
+
The unanimous Declaration of the thirteen united States of America, When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nature's God entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.
|
|
2737
|
+
|
|
2738
|
+
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.--That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, --That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.--Such has been the patient sufferance of these Colonies; and such is now the necessity which constrains them to alter their former Systems of Government. The history of the present King of Great Britain is a history of repeated injuries and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world.
|
|
2739
|
+
|
|
2740
|
+
He has refused his Assent to Laws, the most wholesome and necessary for the public good.
|
|
2741
|
+
|
|
2742
|
+
He has forbidden his Governors to pass Laws of immediate and pressing importance, unless suspended in their operation till his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them.
|
|
2743
|
+
|
|
2744
|
+
He has refused to pass other Laws for the accommodation of large districts of people, unless those people would relinquish the right of Representation in the Legislature, a right inestimable to them and formidable to tyrants only.
|
|
2745
|
+
|
|
2746
|
+
He has called together legislative bodies at places unusual, uncomfortable, and distant from the depository of their public Records, for the sole purpose of fatiguing them into compliance with his measures.
|
|
2747
|
+
|
|
2748
|
+
He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.
|
|
2749
|
+
|
|
2750
|
+
He has refused for a long time, after such dissolutions, to cause others to be elected; whereby the Legislative powers, incapable of Annihilation, have returned to the People at large for their exercise; the State remaining in the mean time exposed to all the dangers of invasion from without, and convulsions within.
|
|
2751
|
+
|
|
2752
|
+
He has endeavoured to prevent the population of these States; for that purpose obstructing the Laws for Naturalization of Foreigners; refusing to pass others to encourage their migrations hither, and raising the conditions of new Appropriations of Lands.
|
|
2753
|
+
|
|
2754
|
+
He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.
|
|
2755
|
+
|
|
2756
|
+
He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.
|
|
2757
|
+
|
|
2758
|
+
He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.
|
|
2759
|
+
|
|
2760
|
+
He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.
|
|
2761
|
+
|
|
2762
|
+
He has affected to render the Military independent of and superior to the Civil power.
|
|
2763
|
+
|
|
2764
|
+
He has combined with others to subject us to a jurisdiction foreign to our constitution, and unacknowledged by our laws; giving his Assent to their Acts of pretended Legislation:
|
|
2765
|
+
|
|
2766
|
+
For Quartering large bodies of armed troops among us:
|
|
2767
|
+
|
|
2768
|
+
For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:
|
|
2769
|
+
|
|
2770
|
+
For cutting off our Trade with all parts of the world:
|
|
2771
|
+
|
|
2772
|
+
For imposing Taxes on us without our Consent:
|
|
2773
|
+
|
|
2774
|
+
For depriving us in many cases, of the benefits of Trial by Jury:
|
|
2775
|
+
|
|
2776
|
+
For transporting us beyond Seas to be tried for pretended offences:
|
|
2777
|
+
|
|
2778
|
+
For abolishing the free System of English Laws in a neighbouring Province, establishing therein an Arbitrary government, and enlarging its Boundaries so as to render it at once an example and fit instrument for introducing the same absolute rule into these Colonies:
|
|
2779
|
+
|
|
2780
|
+
For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:
|
|
2781
|
+
|
|
2782
|
+
For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.
|
|
2783
|
+
|
|
2784
|
+
He has abdicated Government here, by declaring us out of his Protection and waging War against us.
|
|
2785
|
+
|
|
2786
|
+
He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.
|
|
2787
|
+
|
|
2788
|
+
He is at this time transporting large Armies of foreign Mercenaries to compleat the works of death, desolation and tyranny, already begun with circumstances of Cruelty & perfidy scarcely paralleled in the most barbarous ages, and totally unworthy the Head of a civilized nation.
|
|
2789
|
+
|
|
2790
|
+
He has constrained our fellow Citizens taken Captive on the high Seas to bear Arms against their Country, to become the executioners of their friends and Brethren, or to fall themselves by their Hands.
|
|
2791
|
+
|
|
2792
|
+
He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.
|
|
2793
|
+
|
|
2794
|
+
In every stage of these Oppressions We have Petitioned for Redress in the most humble terms: Our repeated Petitions have been answered only by repeated injury. A Prince, whose character is thus marked by every act which may define a Tyrant, is unfit to be the ruler of a free people.
|
|
2795
|
+
|
|
2796
|
+
Nor have We been wanting in attentions to our Brittish brethren. We have warned them from time to time of attempts by their legislature to extend an unwarrantable jurisdiction over us. We have reminded them of the circumstances of our emigration and settlement here. We have appealed to their native justice and magnanimity, and we have conjured them by the ties of our common kindred to disavow these usurpations, which, would inevitably interrupt our connections and correspondence. They too have been deaf to the voice of justice and of consanguinity. We must, therefore, acquiesce in the necessity, which denounces our Separation, and hold them, as we hold the rest of mankind, Enemies in War, in Peace Friends.
|
|
2797
|
+
|
|
2798
|
+
We, therefore, the Representatives of the united States of America, in General Congress, Assembled, appealing to the Supreme Judge of the world for the rectitude of our intentions, do, in the Name, and by Authority of the good People of these Colonies, solemnly publish and declare, That these United Colonies are, and of Right ought to be Free and Independent States; that they are Absolved from all Allegiance to the British Crown, and that all political connection between them and the State of Great Britain, is and ought to be totally dissolved; and that as Free and Independent States, they have full Power to levy War, conclude Peace, contract Alliances, establish Commerce, and to do all other Acts and Things which Independent States may of right do. And for the support of this Declaration, with a firm reliance on the protection of divine Providence, we mutually pledge to each other our Lives, our Fortunes and our sacred Honor.`;
|