@opentermsarchive/engine 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -1
- package/src/tracker/index.js +1 -1
- package/.env.example +0 -3
- package/.eslintrc.yaml +0 -116
- package/.github/workflows/deploy.yml +0 -50
- package/.github/workflows/release.yml +0 -64
- package/.github/workflows/test.yml +0 -77
- package/CHANGELOG.md +0 -14
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -143
- package/MIGRATING.md +0 -42
- package/Vagrantfile +0 -38
- package/ansible.cfg +0 -13
- package/decision-records/0001-service-name-and-id.md +0 -73
- package/decision-records/0002-service-history.md +0 -212
- package/decision-records/0003-snapshots-database.md +0 -123
- package/ops/README.md +0 -280
- package/ops/app.yml +0 -5
- package/ops/infra.yml +0 -6
- package/ops/inventories/dev.yml +0 -7
- package/ops/inventories/production.yml +0 -27
- package/ops/roles/infra/defaults/main.yml +0 -2
- package/ops/roles/infra/files/.gitconfig +0 -3
- package/ops/roles/infra/files/mongod.conf +0 -18
- package/ops/roles/infra/files/ota-bot-key.private_key +0 -26
- package/ops/roles/infra/tasks/main.yml +0 -78
- package/ops/roles/infra/tasks/mongo.yml +0 -40
- package/ops/roles/infra/templates/ssh_config.j2 +0 -5
- package/ops/roles/ota/defaults/main.yml +0 -14
- package/ops/roles/ota/files/.env +0 -21
- package/ops/roles/ota/tasks/database.yml +0 -65
- package/ops/roles/ota/tasks/main.yml +0 -110
- package/ops/site.yml +0 -6
- package/pm2.config.cjs +0 -20
- package/test/fixtures/service_A.js +0 -22
- package/test/fixtures/service_A_terms.md +0 -10
- package/test/fixtures/service_A_terms_snapshot.html +0 -14
- package/test/fixtures/service_B.js +0 -22
- package/test/fixtures/service_with_declaration_history.js +0 -65
- package/test/fixtures/service_with_filters_history.js +0 -155
- package/test/fixtures/service_with_history.js +0 -188
- package/test/fixtures/service_with_multipage_document.js +0 -100
- package/test/fixtures/service_without_history.js +0 -31
- package/test/fixtures/services.js +0 -19
- package/test/fixtures/terms.pdf +0 -0
- package/test/fixtures/termsFromPDF.md +0 -25
- package/test/fixtures/termsModified.pdf +0 -0
- package/test/services/service_A.json +0 -9
- package/test/services/service_B.json +0 -9
- package/test/services/service_with_declaration_history.filters.js +0 -7
- package/test/services/service_with_declaration_history.history.json +0 -17
- package/test/services/service_with_declaration_history.json +0 -13
- package/test/services/service_with_filters_history.filters.history.js +0 -29
- package/test/services/service_with_filters_history.filters.js +0 -7
- package/test/services/service_with_filters_history.json +0 -13
- package/test/services/service_with_history.filters.history.js +0 -29
- package/test/services/service_with_history.filters.js +0 -7
- package/test/services/service_with_history.history.json +0 -26
- package/test/services/service_with_history.json +0 -17
- package/test/services/service_with_multipage_document.filters.js +0 -7
- package/test/services/service_with_multipage_document.history.json +0 -37
- package/test/services/service_with_multipage_document.json +0 -28
- package/test/services/service_without_history.filters.js +0 -7
- package/test/services/service_without_history.json +0 -13
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import DocumentDeclaration from '../../src/archivist/services/documentDeclaration.js';
|
|
2
|
-
import PageDeclaration from '../../src/archivist/services/pageDeclaration.js';
|
|
3
|
-
import Service from '../../src/archivist/services/service.js';
|
|
4
|
-
|
|
5
|
-
const service = new Service({
|
|
6
|
-
id: 'service_with_multipage_document',
|
|
7
|
-
name: 'Service with multipage',
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const filters = [
|
|
11
|
-
async function removeShareButton() {
|
|
12
|
-
return 'last-removeShareButton';
|
|
13
|
-
},
|
|
14
|
-
async function removePrintButton() {
|
|
15
|
-
return 'last-removePrintButton';
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
[
|
|
20
|
-
new DocumentDeclaration({
|
|
21
|
-
service,
|
|
22
|
-
type: 'Community Guidelines',
|
|
23
|
-
validUntil: null,
|
|
24
|
-
pages: [
|
|
25
|
-
new PageDeclaration({
|
|
26
|
-
location: 'https://www.service-with-multipage-document.example/community-standards',
|
|
27
|
-
contentSelectors: '#main',
|
|
28
|
-
noiseSelectors: 'body',
|
|
29
|
-
filters: undefined,
|
|
30
|
-
executeClientScripts: true,
|
|
31
|
-
}),
|
|
32
|
-
new PageDeclaration({
|
|
33
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/hate-speech/',
|
|
34
|
-
contentSelectors: 'body',
|
|
35
|
-
noiseSelectors: '#footer',
|
|
36
|
-
filters: undefined,
|
|
37
|
-
executeClientScripts: false,
|
|
38
|
-
}),
|
|
39
|
-
new PageDeclaration({
|
|
40
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/violence-incitement/',
|
|
41
|
-
contentSelectors: 'body',
|
|
42
|
-
noiseSelectors: 'body',
|
|
43
|
-
filters,
|
|
44
|
-
executeClientScripts: true,
|
|
45
|
-
}),
|
|
46
|
-
],
|
|
47
|
-
}),
|
|
48
|
-
new DocumentDeclaration({
|
|
49
|
-
service,
|
|
50
|
-
type: 'Community Guidelines',
|
|
51
|
-
validUntil: '2020-04-15T21:30:21.000Z',
|
|
52
|
-
pages: [
|
|
53
|
-
new PageDeclaration({
|
|
54
|
-
location: 'https://www.service-with-multipage-document.example/community-standards',
|
|
55
|
-
contentSelectors: 'body',
|
|
56
|
-
noiseSelectors: undefined,
|
|
57
|
-
filters: undefined,
|
|
58
|
-
}),
|
|
59
|
-
new PageDeclaration({
|
|
60
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/hate-speech/',
|
|
61
|
-
contentSelectors: 'body',
|
|
62
|
-
noiseSelectors: undefined,
|
|
63
|
-
filters: undefined,
|
|
64
|
-
}),
|
|
65
|
-
new PageDeclaration({
|
|
66
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/violence-incitement/',
|
|
67
|
-
contentSelectors: 'body',
|
|
68
|
-
noiseSelectors: undefined,
|
|
69
|
-
filters: [filters[0]],
|
|
70
|
-
}),
|
|
71
|
-
],
|
|
72
|
-
}),
|
|
73
|
-
new DocumentDeclaration({
|
|
74
|
-
service,
|
|
75
|
-
type: 'Community Guidelines',
|
|
76
|
-
validUntil: '2020-03-15T21:30:21.000Z',
|
|
77
|
-
pages: [
|
|
78
|
-
new PageDeclaration({
|
|
79
|
-
location: 'https://www.service-with-multipage-document.example/community-standards',
|
|
80
|
-
contentSelectors: 'body',
|
|
81
|
-
noiseSelectors: undefined,
|
|
82
|
-
filters: undefined,
|
|
83
|
-
}),
|
|
84
|
-
new PageDeclaration({
|
|
85
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/hate-speech/',
|
|
86
|
-
contentSelectors: 'body',
|
|
87
|
-
noiseSelectors: undefined,
|
|
88
|
-
filters: undefined,
|
|
89
|
-
}),
|
|
90
|
-
new PageDeclaration({
|
|
91
|
-
location: 'https://www.service-with-multipage-document.example/community-standards/violence-incitement/',
|
|
92
|
-
contentSelectors: 'body',
|
|
93
|
-
noiseSelectors: undefined,
|
|
94
|
-
filters: undefined,
|
|
95
|
-
}),
|
|
96
|
-
],
|
|
97
|
-
}),
|
|
98
|
-
].forEach(declaration => service.addDocumentDeclaration(declaration));
|
|
99
|
-
|
|
100
|
-
export default service;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import DocumentDeclaration from '../../src/archivist/services/documentDeclaration.js';
|
|
2
|
-
import PageDeclaration from '../../src/archivist/services/pageDeclaration.js';
|
|
3
|
-
import Service from '../../src/archivist/services/service.js';
|
|
4
|
-
|
|
5
|
-
const service = new Service({
|
|
6
|
-
id: 'service_without_history',
|
|
7
|
-
name: 'Service without history',
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const filters = [
|
|
11
|
-
async function removeShareButton() {
|
|
12
|
-
return 'last-removeShareButton';
|
|
13
|
-
},
|
|
14
|
-
async function removePrintButton() {
|
|
15
|
-
return 'last-removePrintButton';
|
|
16
|
-
},
|
|
17
|
-
];
|
|
18
|
-
|
|
19
|
-
service.addDocumentDeclaration(new DocumentDeclaration({
|
|
20
|
-
service,
|
|
21
|
-
type: 'Terms of Service',
|
|
22
|
-
pages: [new PageDeclaration({
|
|
23
|
-
location: 'https://www.service-without-history.example/tos',
|
|
24
|
-
contentSelectors: 'body',
|
|
25
|
-
noiseSelectors: undefined,
|
|
26
|
-
filters,
|
|
27
|
-
})],
|
|
28
|
-
validUntil: null,
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
export default service;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import serviceA from './service_A.js';
|
|
2
|
-
import serviceB from './service_B.js';
|
|
3
|
-
import serviceWithDeclarationHistory from './service_with_declaration_history.js';
|
|
4
|
-
import serviceWithFiltersHistory from './service_with_filters_history.js';
|
|
5
|
-
import serviceWithHistory from './service_with_history.js';
|
|
6
|
-
import serviceWithMultipageDocument from './service_with_multipage_document.js';
|
|
7
|
-
import serviceWithoutHistory from './service_without_history.js';
|
|
8
|
-
|
|
9
|
-
const services = {
|
|
10
|
-
service_with_history: serviceWithHistory,
|
|
11
|
-
service_without_history: serviceWithoutHistory,
|
|
12
|
-
service_with_filters_history: serviceWithFiltersHistory,
|
|
13
|
-
service_with_declaration_history: serviceWithDeclarationHistory,
|
|
14
|
-
service_with_multipage_document: serviceWithMultipageDocument,
|
|
15
|
-
service_A: serviceA,
|
|
16
|
-
service_B: serviceB,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default services;
|
package/test/fixtures/terms.pdf
DELETED
|
Binary file
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
THIS IS A LEGAL AGREEMENT BETWEEN YOU AND TESTCOMPANY
|
|
2
|
-
|
|
3
|
-
TESTCOMPANY Developer Agreement
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
1\. Relationship With TestCompany. Et pulvinar integer platea sociosqu nibh
|
|
8
|
-
|
|
9
|
-
risus parturient, sit hac turpis dictumst placerat malesuada, ut potenti elementum
|
|
10
|
-
|
|
11
|
-
nostra aptent porttitor.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
2\. Developer Benefits. Et pulvinar integer platea sociosqu nibh risus parturient,
|
|
16
|
-
|
|
17
|
-
sit hac turpis dictumst placerat malesuada, ut potenti elementum nostra aptent
|
|
18
|
-
|
|
19
|
-
porttitor.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
3\. Restrictions. Et pulvinar integer platea sociosqu nibh risus parturient, sit hac
|
|
24
|
-
|
|
25
|
-
turpis dictumst placerat malesuada, ut potenti elementum nostra aptent porttitor.
|
|
Binary file
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Terms of Service": [
|
|
3
|
-
{
|
|
4
|
-
"fetch": "https://www.service-with-declaration-history.example/tos",
|
|
5
|
-
"select": "main",
|
|
6
|
-
"filter": [
|
|
7
|
-
"removeShareButton"
|
|
8
|
-
],
|
|
9
|
-
"validUntil": "2020-09-30T21:30:21.000Z"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"fetch": "https://www.service-with-declaration-history.example/tos",
|
|
13
|
-
"select": "body",
|
|
14
|
-
"validUntil": "2020-08-22T21:30:21.000Z"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Service with declaration history",
|
|
3
|
-
"documents": {
|
|
4
|
-
"Terms of Service": {
|
|
5
|
-
"fetch": "https://www.service-with-declaration-history.example/terms",
|
|
6
|
-
"select": "main",
|
|
7
|
-
"filter": [
|
|
8
|
-
"removeShareButton",
|
|
9
|
-
"removePrintButton"
|
|
10
|
-
]
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const removeShareButton = [
|
|
2
|
-
{
|
|
3
|
-
validUntil: '2020-09-30T21:30:21.000Z',
|
|
4
|
-
filter: async () => 'second-removeShareButton',
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
validUntil: '2020-08-22T11:30:21.000Z',
|
|
8
|
-
filter: async () => 'first-removeShareButton',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
validUntil: '2020-11-01T12:30:21.000Z',
|
|
12
|
-
filter: async () => 'third-removeShareButton',
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export const removePrintButton = [
|
|
17
|
-
{
|
|
18
|
-
validUntil: '2020-09-29T21:30:21.000Z',
|
|
19
|
-
filter: async () => 'second-removePrintButton',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
validUntil: '2020-07-22T11:30:21.000Z',
|
|
23
|
-
filter: async () => 'first-removePrintButton',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
validUntil: '2020-10-20T12:30:21.000Z',
|
|
27
|
-
filter: async () => 'third-removePrintButton',
|
|
28
|
-
},
|
|
29
|
-
];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export const removeShareButton = [
|
|
2
|
-
{
|
|
3
|
-
validUntil: '2020-09-30T21:30:21.000Z',
|
|
4
|
-
filter: async () => 'second-removeShareButton',
|
|
5
|
-
},
|
|
6
|
-
{
|
|
7
|
-
validUntil: '2020-08-22T11:30:21.000Z',
|
|
8
|
-
filter: async () => 'first-removeShareButton',
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
validUntil: '2020-11-01T12:30:21.000Z',
|
|
12
|
-
filter: async () => 'third-removeShareButton',
|
|
13
|
-
},
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export const removePrintButton = [
|
|
17
|
-
{
|
|
18
|
-
validUntil: '2020-09-29T21:30:21.000Z',
|
|
19
|
-
filter: async () => 'second-removePrintButton',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
validUntil: '2020-07-22T11:30:21.000Z',
|
|
23
|
-
filter: async () => 'first-removePrintButton',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
validUntil: '2020-10-20T12:30:21.000Z',
|
|
27
|
-
filter: async () => 'third-removePrintButton',
|
|
28
|
-
},
|
|
29
|
-
];
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Terms of Service": [
|
|
3
|
-
{
|
|
4
|
-
"fetch": "https://www.service-with-history.example/tos",
|
|
5
|
-
"select": "main",
|
|
6
|
-
"filter": [
|
|
7
|
-
"removeShareButton"
|
|
8
|
-
],
|
|
9
|
-
"validUntil": "2020-09-15T21:30:21.000Z"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"fetch": "https://www.service-with-history.example/tos",
|
|
13
|
-
"select": "body",
|
|
14
|
-
"validUntil": "2020-08-15T21:30:21.000Z"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"fetch": "https://www.service-with-history.example/terms_of_service",
|
|
18
|
-
"select": "body",
|
|
19
|
-
"filter": [
|
|
20
|
-
"removeShareButton",
|
|
21
|
-
"removePrintButton"
|
|
22
|
-
],
|
|
23
|
-
"validUntil": "2020-09-29T21:30:21.000Z"
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Service with history",
|
|
3
|
-
"documents": {
|
|
4
|
-
"Terms of Service": {
|
|
5
|
-
"fetch": "https://www.service-with-history.example/terms",
|
|
6
|
-
"select": "main",
|
|
7
|
-
"filter": [
|
|
8
|
-
"removeShareButton",
|
|
9
|
-
"removePrintButton"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"Privacy Policy": {
|
|
13
|
-
"fetch": "https://www.service-with-history.example/privacy",
|
|
14
|
-
"select": "body"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Community Guidelines": [
|
|
3
|
-
{
|
|
4
|
-
"combine": [
|
|
5
|
-
{
|
|
6
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/hate-speech/"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/violence-incitement/",
|
|
13
|
-
"filter": [
|
|
14
|
-
"removeShareButton"
|
|
15
|
-
]
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"select": "body",
|
|
19
|
-
"validUntil": "2020-04-15T21:30:21.000Z"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"combine": [
|
|
23
|
-
{
|
|
24
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/hate-speech/"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/violence-incitement/"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"select": "body",
|
|
34
|
-
"validUntil": "2020-03-15T21:30:21.000Z"
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Service with multipage",
|
|
3
|
-
"documents": {
|
|
4
|
-
"Community Guidelines": {
|
|
5
|
-
"combine": [
|
|
6
|
-
{
|
|
7
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards",
|
|
8
|
-
"select": "#main"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/hate-speech/",
|
|
12
|
-
"remove": "#footer",
|
|
13
|
-
"executeClientScripts": false
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"fetch": "https://www.service-with-multipage-document.example/community-standards/violence-incitement/",
|
|
17
|
-
"filter": [
|
|
18
|
-
"removeShareButton",
|
|
19
|
-
"removePrintButton"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"select": "body",
|
|
24
|
-
"remove": "body",
|
|
25
|
-
"executeClientScripts": true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|