@nymphjs/nymph 1.0.0-beta.98 → 1.0.0-beta.99
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 +13 -0
- package/dist/Entity.d.ts +15 -0
- package/dist/Entity.js +20 -0
- package/dist/Entity.js.map +1 -1
- package/dist/Entity.test.js +0 -1
- package/dist/Entity.test.js.map +1 -1
- package/dist/Nymph.d.ts +60 -4
- package/dist/Nymph.js +57 -2
- package/dist/Nymph.js.map +1 -1
- package/dist/Nymph.types.d.ts +6 -0
- package/dist/Nymph.types.js.map +1 -1
- package/dist/driver/NymphDriver.d.ts +15 -6
- package/dist/driver/NymphDriver.js +15 -2
- package/dist/driver/NymphDriver.js.map +1 -1
- package/dist/driver/testArtifacts.js +214 -0
- package/dist/driver/testArtifacts.js.map +1 -1
- package/dist/testArtifacts.d.ts +1 -0
- package/dist/testArtifacts.js.map +1 -1
- package/package.json +4 -3
- package/src/Entity.test.ts +0 -2
- package/src/Entity.ts +21 -0
- package/src/Nymph.ts +83 -4
- package/src/Nymph.types.ts +9 -0
- package/src/driver/NymphDriver.ts +38 -6
- package/src/driver/testArtifacts.ts +290 -0
- package/src/testArtifacts.ts +1 -0
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import { difference } from 'lodash-es';
|
|
3
3
|
import ReadLines from 'n-readlines';
|
|
4
4
|
import strtotime from 'locutus/php/datetime/strtotime.js';
|
|
5
|
+
import { Tokenizer } from '@sciactive/tokenizer';
|
|
5
6
|
|
|
6
7
|
import type Nymph from '../Nymph.js';
|
|
7
8
|
import type { Selector, Options, FormattedSelector } from '../Nymph.types.js';
|
|
@@ -36,6 +37,8 @@ export default abstract class NymphDriver {
|
|
|
36
37
|
},
|
|
37
38
|
});
|
|
38
39
|
|
|
40
|
+
protected tokenizer = new Tokenizer();
|
|
41
|
+
|
|
39
42
|
/**
|
|
40
43
|
* A cache to make entity retrieval faster.
|
|
41
44
|
*/
|
|
@@ -87,13 +90,13 @@ export default abstract class NymphDriver {
|
|
|
87
90
|
*/
|
|
88
91
|
abstract disconnect(): Promise<boolean>;
|
|
89
92
|
|
|
93
|
+
abstract needsMigration(): Promise<'json' | 'tokens' | false>;
|
|
94
|
+
abstract liveMigration(migrationType: 'tokenTables'): Promise<void>;
|
|
95
|
+
|
|
90
96
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* If true, the database should be exported with an old version of Nymph, then
|
|
94
|
-
* imported into a fresh database with this version.
|
|
97
|
+
* Returns a list of the etypes stored in the DB.
|
|
95
98
|
*/
|
|
96
|
-
abstract
|
|
99
|
+
abstract getEtypes(): Promise<string[]>;
|
|
97
100
|
|
|
98
101
|
abstract exportDataIterator(): AsyncGenerator<
|
|
99
102
|
{ type: 'comment' | 'uid' | 'entity'; content: string },
|
|
@@ -131,6 +134,14 @@ export default abstract class NymphDriver {
|
|
|
131
134
|
sdata: SerializedEntityData;
|
|
132
135
|
etype: string;
|
|
133
136
|
}): Promise<void>;
|
|
137
|
+
abstract importEntityTokens(entity: {
|
|
138
|
+
guid: string;
|
|
139
|
+
cdate: number;
|
|
140
|
+
mdate: number;
|
|
141
|
+
tags: string[];
|
|
142
|
+
sdata: SerializedEntityData;
|
|
143
|
+
etype: string;
|
|
144
|
+
}): Promise<void>;
|
|
134
145
|
abstract importUID(uid: { name: string; value: number }): Promise<void>;
|
|
135
146
|
abstract newUID(name: string): Promise<number | null>;
|
|
136
147
|
abstract renameUID(oldName: string, newName: string): Promise<boolean>;
|
|
@@ -327,6 +338,7 @@ export default abstract class NymphDriver {
|
|
|
327
338
|
}
|
|
328
339
|
|
|
329
340
|
public checkData(
|
|
341
|
+
etype: string,
|
|
330
342
|
data: EntityData,
|
|
331
343
|
sdata: SerializedEntityData,
|
|
332
344
|
selectors: Selector[],
|
|
@@ -334,6 +346,7 @@ export default abstract class NymphDriver {
|
|
|
334
346
|
tags: string[] | null = null,
|
|
335
347
|
) {
|
|
336
348
|
try {
|
|
349
|
+
const EntityClass = this.nymph.getEntityClassByEtype(etype);
|
|
337
350
|
const formattedSelectors = this.formatSelectors(selectors).selectors;
|
|
338
351
|
|
|
339
352
|
for (const curSelector of formattedSelectors) {
|
|
@@ -355,7 +368,7 @@ export default abstract class NymphDriver {
|
|
|
355
368
|
Array.isArray(value) ? value : [value]
|
|
356
369
|
) as Selector[];
|
|
357
370
|
pass = xor(
|
|
358
|
-
this.checkData(data, sdata, tmpArr, guid, tags),
|
|
371
|
+
this.checkData(etype, data, sdata, tmpArr, guid, tags),
|
|
359
372
|
xor(typeIsNot, clauseNot),
|
|
360
373
|
);
|
|
361
374
|
} else {
|
|
@@ -499,6 +512,25 @@ export default abstract class NymphDriver {
|
|
|
499
512
|
xor(typeIsNot, clauseNot),
|
|
500
513
|
);
|
|
501
514
|
break;
|
|
515
|
+
case 'search':
|
|
516
|
+
case '!search':
|
|
517
|
+
const testSearchValue = (
|
|
518
|
+
curValue as [string, string]
|
|
519
|
+
)[1] as string;
|
|
520
|
+
const tokenString =
|
|
521
|
+
propName in data
|
|
522
|
+
? (EntityClass.getFTSText(propName, data[propName]) ??
|
|
523
|
+
'')
|
|
524
|
+
: '';
|
|
525
|
+
pass = xor(
|
|
526
|
+
propName in data &&
|
|
527
|
+
this.tokenizer.searchString(
|
|
528
|
+
testSearchValue,
|
|
529
|
+
tokenString,
|
|
530
|
+
),
|
|
531
|
+
xor(typeIsNot, clauseNot),
|
|
532
|
+
);
|
|
533
|
+
break;
|
|
502
534
|
case 'gt':
|
|
503
535
|
case '!gt':
|
|
504
536
|
const testGTValue = (
|
|
@@ -50,6 +50,7 @@ export function EntitiesTest(
|
|
|
50
50
|
{ nullbyte: '\\\x00\u0000 \x00' },
|
|
51
51
|
];
|
|
52
52
|
testEntity.match = matchValue;
|
|
53
|
+
testEntity.search = searchValue;
|
|
53
54
|
testEntity.number = 30;
|
|
54
55
|
testEntity.numberString = '30';
|
|
55
56
|
testEntity.timestamp = Date.now();
|
|
@@ -821,6 +822,180 @@ export function EntitiesTest(
|
|
|
821
822
|
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
822
823
|
});
|
|
823
824
|
|
|
825
|
+
it('basic search', async () => {
|
|
826
|
+
await createTestEntities();
|
|
827
|
+
|
|
828
|
+
// Retrieving entity by full text search...
|
|
829
|
+
let resultEntity = await nymph.getEntities(
|
|
830
|
+
{ class: TestModel },
|
|
831
|
+
{
|
|
832
|
+
type: '&',
|
|
833
|
+
tag: 'test',
|
|
834
|
+
search: [
|
|
835
|
+
'search',
|
|
836
|
+
'Declaration of the thirteen united States of America',
|
|
837
|
+
],
|
|
838
|
+
}, // a substring
|
|
839
|
+
);
|
|
840
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
841
|
+
resultEntity = await nymph.getEntities(
|
|
842
|
+
{ class: TestModel },
|
|
843
|
+
{ type: '&', tag: 'test' },
|
|
844
|
+
{
|
|
845
|
+
type: '|',
|
|
846
|
+
search: [
|
|
847
|
+
['string', 'pickle'],
|
|
848
|
+
['search', 'Declaration of the thirteen united States of America'],
|
|
849
|
+
],
|
|
850
|
+
}, // inclusive test
|
|
851
|
+
);
|
|
852
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
853
|
+
resultEntity = await nymph.getEntities(
|
|
854
|
+
{ class: TestModel },
|
|
855
|
+
{
|
|
856
|
+
type: '&',
|
|
857
|
+
tag: 'test',
|
|
858
|
+
search: ['search', 'July 4, 1776'],
|
|
859
|
+
}, // a string with a number
|
|
860
|
+
);
|
|
861
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
862
|
+
});
|
|
863
|
+
|
|
864
|
+
it('or search', async () => {
|
|
865
|
+
await createTestEntities();
|
|
866
|
+
|
|
867
|
+
// Retrieving entity by full text search...
|
|
868
|
+
let resultEntity = await nymph.getEntities(
|
|
869
|
+
{ class: TestModel },
|
|
870
|
+
{
|
|
871
|
+
type: '&',
|
|
872
|
+
tag: 'test',
|
|
873
|
+
search: ['search', 'Declaration or pickles'],
|
|
874
|
+
}, // a string with an or
|
|
875
|
+
);
|
|
876
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
it('series search', async () => {
|
|
880
|
+
await createTestEntities();
|
|
881
|
+
|
|
882
|
+
// Retrieving entity by full text search...
|
|
883
|
+
let resultEntity = await nymph.getEntities(
|
|
884
|
+
{ class: TestModel },
|
|
885
|
+
{
|
|
886
|
+
type: '&',
|
|
887
|
+
tag: 'test',
|
|
888
|
+
search: ['search', '"excited domestic insurrections"'],
|
|
889
|
+
}, // double quoted substring
|
|
890
|
+
);
|
|
891
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
892
|
+
resultEntity = await nymph.getEntities(
|
|
893
|
+
{ class: TestModel },
|
|
894
|
+
{
|
|
895
|
+
type: '&',
|
|
896
|
+
tag: 'test',
|
|
897
|
+
search: ['search', "'exciting domestic insurrected'"],
|
|
898
|
+
}, // single quoted substring
|
|
899
|
+
);
|
|
900
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
901
|
+
});
|
|
902
|
+
|
|
903
|
+
it('negated search', async () => {
|
|
904
|
+
await createTestEntities();
|
|
905
|
+
|
|
906
|
+
// Retrieving entity by full text search...
|
|
907
|
+
let resultEntity = await nymph.getEntities(
|
|
908
|
+
{ class: TestModel },
|
|
909
|
+
{
|
|
910
|
+
type: '&',
|
|
911
|
+
tag: 'test',
|
|
912
|
+
search: ['search', '-pickle'],
|
|
913
|
+
}, // negated term
|
|
914
|
+
);
|
|
915
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
916
|
+
});
|
|
917
|
+
|
|
918
|
+
it('combined search', async () => {
|
|
919
|
+
await createTestEntities();
|
|
920
|
+
|
|
921
|
+
// Retrieving entity by full text search...
|
|
922
|
+
let resultEntity = await nymph.getEntities(
|
|
923
|
+
{ class: TestModel },
|
|
924
|
+
{
|
|
925
|
+
type: '&',
|
|
926
|
+
tag: 'test',
|
|
927
|
+
search: ['search', 'Declaration -pickle'],
|
|
928
|
+
}, // negated term with positive term
|
|
929
|
+
);
|
|
930
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
931
|
+
resultEntity = await nymph.getEntities(
|
|
932
|
+
{ class: TestModel },
|
|
933
|
+
{
|
|
934
|
+
type: '&',
|
|
935
|
+
tag: 'test',
|
|
936
|
+
search: ['search', 'Declaration "General Congress"'],
|
|
937
|
+
}, // terms found in separate areas
|
|
938
|
+
);
|
|
939
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
940
|
+
});
|
|
941
|
+
|
|
942
|
+
it('wrong search', async () => {
|
|
943
|
+
await createTestEntities();
|
|
944
|
+
|
|
945
|
+
// Testing wrong search...
|
|
946
|
+
let resultEntity = await nymph.getEntities(
|
|
947
|
+
{ class: TestModel },
|
|
948
|
+
{ type: '&', search: ['search', 'pickles'] },
|
|
949
|
+
);
|
|
950
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
951
|
+
resultEntity = await nymph.getEntities(
|
|
952
|
+
{ class: TestModel },
|
|
953
|
+
{ type: '&', tag: 'pickle', search: ['search', 'Declaration'] },
|
|
954
|
+
);
|
|
955
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
956
|
+
resultEntity = await nymph.getEntities(
|
|
957
|
+
{ class: TestModel },
|
|
958
|
+
{
|
|
959
|
+
type: '|',
|
|
960
|
+
search: [
|
|
961
|
+
['string', 'pickle'],
|
|
962
|
+
['search', 'Hawaii'],
|
|
963
|
+
],
|
|
964
|
+
},
|
|
965
|
+
);
|
|
966
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(false);
|
|
967
|
+
});
|
|
968
|
+
|
|
969
|
+
it('search must be case insensitive', async () => {
|
|
970
|
+
await createTestEntities();
|
|
971
|
+
|
|
972
|
+
// Retrieving entity by full text search...
|
|
973
|
+
const resultEntity = await nymph.getEntities(
|
|
974
|
+
{ class: TestModel },
|
|
975
|
+
{
|
|
976
|
+
type: '&',
|
|
977
|
+
tag: 'test',
|
|
978
|
+
search: [
|
|
979
|
+
'search',
|
|
980
|
+
'DECLARATION OF THE THIRTEEN UNITED STATES OF AMERICA',
|
|
981
|
+
],
|
|
982
|
+
}, // a substring
|
|
983
|
+
);
|
|
984
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
it('search and equal inclusive', async () => {
|
|
988
|
+
await createTestEntities();
|
|
989
|
+
|
|
990
|
+
// Retrieving entity by fts + equal inclusively...
|
|
991
|
+
const resultEntity = await nymph.getEntities(
|
|
992
|
+
{ class: TestModel },
|
|
993
|
+
{ type: '&', tag: 'test' },
|
|
994
|
+
{ type: '|', equal: ['string', 'pickles'], search: ['string', 'test'] },
|
|
995
|
+
);
|
|
996
|
+
expect(testEntity.$inArray(resultEntity)).toEqual(true);
|
|
997
|
+
});
|
|
998
|
+
|
|
824
999
|
it('greater than', async () => {
|
|
825
1000
|
await createTestEntities();
|
|
826
1001
|
|
|
@@ -2259,6 +2434,55 @@ export function ExportImportTest(
|
|
|
2259
2434
|
|
|
2260
2435
|
fs.unlinkSync(__dirname + '/testentityexport.nex');
|
|
2261
2436
|
});
|
|
2437
|
+
|
|
2438
|
+
it('import tokens only', async () => {
|
|
2439
|
+
const model = await nymph.getEntity({ class: TestModel });
|
|
2440
|
+
|
|
2441
|
+
expect(model).not.toBeNull();
|
|
2442
|
+
|
|
2443
|
+
if (model != null) {
|
|
2444
|
+
const data = model.$getData(true);
|
|
2445
|
+
// These should not actually be saved in the DB.
|
|
2446
|
+
data.number = 424242424242;
|
|
2447
|
+
// But this should become searchable.
|
|
2448
|
+
data.search = 'peanuts and pickles on a hot bun';
|
|
2449
|
+
|
|
2450
|
+
const sdata = Object.fromEntries(
|
|
2451
|
+
Object.entries(data).map(([name, value]) => [
|
|
2452
|
+
name,
|
|
2453
|
+
JSON.stringify(value),
|
|
2454
|
+
]),
|
|
2455
|
+
);
|
|
2456
|
+
|
|
2457
|
+
if (model.guid == null || model.cdate == null || model.mdate == null) {
|
|
2458
|
+
throw new Error('Model data is wrong.');
|
|
2459
|
+
}
|
|
2460
|
+
|
|
2461
|
+
await nymph.importEntityTokens({
|
|
2462
|
+
guid: model.guid,
|
|
2463
|
+
// Again, these should not actually be changed in the DB.
|
|
2464
|
+
cdate: model.cdate + 1000,
|
|
2465
|
+
mdate: model.mdate + 1000,
|
|
2466
|
+
tags: [...model.tags, 'helicopter'],
|
|
2467
|
+
sdata,
|
|
2468
|
+
etype: TestModel.ETYPE,
|
|
2469
|
+
});
|
|
2470
|
+
|
|
2471
|
+
const modelCheck = await nymph.getEntity(
|
|
2472
|
+
{ class: TestModel },
|
|
2473
|
+
{ type: '&', search: ['search', '"peanuts and pickles on a hot bun"'] },
|
|
2474
|
+
);
|
|
2475
|
+
|
|
2476
|
+
expect(modelCheck?.guid).toEqual(model.guid);
|
|
2477
|
+
expect(modelCheck?.cdate).toEqual(model.cdate);
|
|
2478
|
+
expect(modelCheck?.mdate).toEqual(model.mdate);
|
|
2479
|
+
expect(modelCheck?.$hasTag('helicopter')).toEqual(false);
|
|
2480
|
+
expect(modelCheck?.number).not.toEqual(424242424242);
|
|
2481
|
+
expect(modelCheck?.search).not.toEqual(
|
|
2482
|
+
'peanuts and pickles on a hot bun',
|
|
2483
|
+
);
|
|
2484
|
+
}
|
|
2485
|
+
});
|
|
2262
2486
|
}
|
|
2263
2487
|
|
|
2264
2488
|
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.
|
|
@@ -2371,3 +2595,69 @@ Cursus velit lacus aenean elit conubia. Velit in inceptos enim, elit lobortis es
|
|
|
2371
2595
|
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.
|
|
2372
2596
|
|
|
2373
2597
|
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.`;
|
|
2598
|
+
|
|
2599
|
+
const searchValue = `In Congress, July 4, 1776
|
|
2600
|
+
|
|
2601
|
+
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.
|
|
2602
|
+
|
|
2603
|
+
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.
|
|
2604
|
+
|
|
2605
|
+
He has refused his Assent to Laws, the most wholesome and necessary for the public good.
|
|
2606
|
+
|
|
2607
|
+
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.
|
|
2608
|
+
|
|
2609
|
+
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.
|
|
2610
|
+
|
|
2611
|
+
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.
|
|
2612
|
+
|
|
2613
|
+
He has dissolved Representative Houses repeatedly, for opposing with manly firmness his invasions on the rights of the people.
|
|
2614
|
+
|
|
2615
|
+
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.
|
|
2616
|
+
|
|
2617
|
+
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.
|
|
2618
|
+
|
|
2619
|
+
He has obstructed the Administration of Justice, by refusing his Assent to Laws for establishing Judiciary powers.
|
|
2620
|
+
|
|
2621
|
+
He has made Judges dependent on his Will alone, for the tenure of their offices, and the amount and payment of their salaries.
|
|
2622
|
+
|
|
2623
|
+
He has erected a multitude of New Offices, and sent hither swarms of Officers to harrass our people, and eat out their substance.
|
|
2624
|
+
|
|
2625
|
+
He has kept among us, in times of peace, Standing Armies without the Consent of our legislatures.
|
|
2626
|
+
|
|
2627
|
+
He has affected to render the Military independent of and superior to the Civil power.
|
|
2628
|
+
|
|
2629
|
+
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:
|
|
2630
|
+
|
|
2631
|
+
For Quartering large bodies of armed troops among us:
|
|
2632
|
+
|
|
2633
|
+
For protecting them, by a mock Trial, from punishment for any Murders which they should commit on the Inhabitants of these States:
|
|
2634
|
+
|
|
2635
|
+
For cutting off our Trade with all parts of the world:
|
|
2636
|
+
|
|
2637
|
+
For imposing Taxes on us without our Consent:
|
|
2638
|
+
|
|
2639
|
+
For depriving us in many cases, of the benefits of Trial by Jury:
|
|
2640
|
+
|
|
2641
|
+
For transporting us beyond Seas to be tried for pretended offences:
|
|
2642
|
+
|
|
2643
|
+
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:
|
|
2644
|
+
|
|
2645
|
+
For taking away our Charters, abolishing our most valuable Laws, and altering fundamentally the Forms of our Governments:
|
|
2646
|
+
|
|
2647
|
+
For suspending our own Legislatures, and declaring themselves invested with power to legislate for us in all cases whatsoever.
|
|
2648
|
+
|
|
2649
|
+
He has abdicated Government here, by declaring us out of his Protection and waging War against us.
|
|
2650
|
+
|
|
2651
|
+
He has plundered our seas, ravaged our Coasts, burnt our towns, and destroyed the lives of our people.
|
|
2652
|
+
|
|
2653
|
+
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.
|
|
2654
|
+
|
|
2655
|
+
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.
|
|
2656
|
+
|
|
2657
|
+
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.
|
|
2658
|
+
|
|
2659
|
+
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.
|
|
2660
|
+
|
|
2661
|
+
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.
|
|
2662
|
+
|
|
2663
|
+
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.`;
|