@opentermsarchive/engine 0.16.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.
Files changed (63) hide show
  1. package/package.json +7 -1
  2. package/.env.example +0 -3
  3. package/.eslintrc.yaml +0 -116
  4. package/.github/workflows/deploy.yml +0 -50
  5. package/.github/workflows/release.yml +0 -71
  6. package/.github/workflows/test.yml +0 -77
  7. package/CHANGELOG.md +0 -14
  8. package/CODE_OF_CONDUCT.md +0 -128
  9. package/CONTRIBUTING.md +0 -143
  10. package/MIGRATING.md +0 -42
  11. package/Vagrantfile +0 -38
  12. package/ansible.cfg +0 -13
  13. package/decision-records/0001-service-name-and-id.md +0 -73
  14. package/decision-records/0002-service-history.md +0 -212
  15. package/decision-records/0003-snapshots-database.md +0 -123
  16. package/ops/README.md +0 -280
  17. package/ops/app.yml +0 -5
  18. package/ops/infra.yml +0 -6
  19. package/ops/inventories/dev.yml +0 -7
  20. package/ops/inventories/production.yml +0 -27
  21. package/ops/roles/infra/defaults/main.yml +0 -2
  22. package/ops/roles/infra/files/.gitconfig +0 -3
  23. package/ops/roles/infra/files/mongod.conf +0 -18
  24. package/ops/roles/infra/files/ota-bot-key.private_key +0 -26
  25. package/ops/roles/infra/tasks/main.yml +0 -78
  26. package/ops/roles/infra/tasks/mongo.yml +0 -40
  27. package/ops/roles/infra/templates/ssh_config.j2 +0 -5
  28. package/ops/roles/ota/defaults/main.yml +0 -14
  29. package/ops/roles/ota/files/.env +0 -21
  30. package/ops/roles/ota/tasks/database.yml +0 -65
  31. package/ops/roles/ota/tasks/main.yml +0 -110
  32. package/ops/site.yml +0 -6
  33. package/pm2.config.cjs +0 -20
  34. package/test/fixtures/service_A.js +0 -22
  35. package/test/fixtures/service_A_terms.md +0 -10
  36. package/test/fixtures/service_A_terms_snapshot.html +0 -14
  37. package/test/fixtures/service_B.js +0 -22
  38. package/test/fixtures/service_with_declaration_history.js +0 -65
  39. package/test/fixtures/service_with_filters_history.js +0 -155
  40. package/test/fixtures/service_with_history.js +0 -188
  41. package/test/fixtures/service_with_multipage_document.js +0 -100
  42. package/test/fixtures/service_without_history.js +0 -31
  43. package/test/fixtures/services.js +0 -19
  44. package/test/fixtures/terms.pdf +0 -0
  45. package/test/fixtures/termsFromPDF.md +0 -25
  46. package/test/fixtures/termsModified.pdf +0 -0
  47. package/test/services/service_A.json +0 -9
  48. package/test/services/service_B.json +0 -9
  49. package/test/services/service_with_declaration_history.filters.js +0 -7
  50. package/test/services/service_with_declaration_history.history.json +0 -17
  51. package/test/services/service_with_declaration_history.json +0 -13
  52. package/test/services/service_with_filters_history.filters.history.js +0 -29
  53. package/test/services/service_with_filters_history.filters.js +0 -7
  54. package/test/services/service_with_filters_history.json +0 -13
  55. package/test/services/service_with_history.filters.history.js +0 -29
  56. package/test/services/service_with_history.filters.js +0 -7
  57. package/test/services/service_with_history.history.json +0 -26
  58. package/test/services/service_with_history.json +0 -17
  59. package/test/services/service_with_multipage_document.filters.js +0 -7
  60. package/test/services/service_with_multipage_document.history.json +0 -37
  61. package/test/services/service_with_multipage_document.json +0 -28
  62. package/test/services/service_without_history.filters.js +0 -7
  63. package/test/services/service_without_history.json +0 -13
@@ -1,110 +0,0 @@
1
- - name: Clone Open Terms Archive engine
2
- git:
3
- repo: '{{ ota_repository }}'
4
- dest: '/home/{{ ansible_user }}/{{ ota_directory }}'
5
- version: '{{ ota_branch }}'
6
- force: yes
7
- accept_hostkey: yes
8
- key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
9
- depth: 1
10
- tags:
11
- - setup
12
- - update
13
-
14
- - name: Install dependencies
15
- command:
16
- cmd: npm ci --production
17
- chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
18
- tags:
19
- - setup
20
- - update
21
-
22
- - name: Add .env file
23
- copy:
24
- src: .env
25
- dest: '/home/{{ ansible_user }}/{{ ota_directory }}/.env'
26
- tags:
27
- - setup
28
-
29
- - name: Load app config
30
- ansible.builtin.include_vars:
31
- name: app_config
32
- file: '../config/{{ config_file_name }}.json'
33
- tags:
34
- - setup
35
- - update
36
- - update-declarations
37
-
38
- - name: Make config available to app
39
- ansible.builtin.file:
40
- src: '/home/{{ ansible_user }}/{{ ota_directory }}/config/{{ config_file_name }}.json'
41
- dest: '/home/{{ ansible_user }}/{{ ota_directory }}/config/local.json'
42
- state: link
43
-
44
- - name: Install services declarations
45
- git:
46
- repo: '{{ app_config.services.repository }}'
47
- dest: '/home/{{ ansible_user }}/{{ declarations_directory }}'
48
- version: '{{ declarations_branch }}'
49
- force: yes
50
- accept_hostkey: yes
51
- key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
52
- depth: 1
53
- tags:
54
- - setup
55
- - update
56
- - update-declarations
57
-
58
- - name: Install services declarations dependencies
59
- command:
60
- cmd: npm install --production
61
- chdir: '/home/{{ ansible_user }}/{{ declarations_directory }}'
62
- tags:
63
- - setup
64
- - update
65
- - update-declarations
66
-
67
- - name: Stop Open Terms Archive schedulers
68
- command:
69
- cmd: pm2 stop pm2.config.cjs
70
- chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
71
- tags:
72
- - stop
73
- - update
74
- - update-declarations
75
-
76
- - include_tasks: database.yml
77
- name: Setup snapshots git repository
78
- when: app_config.recorder.snapshots.storage.git.repository is defined
79
- vars:
80
- name: snapshots
81
- repository: '{{ app_config.recorder.snapshots.storage.git.repository }}'
82
- branch: '{{ snapshots_branch }}'
83
- directory: '{{ snapshots_directory }}'
84
- tags:
85
- - setup
86
- - update
87
-
88
- - include_tasks: database.yml
89
- name: Setup versions git repository
90
- when: app_config.recorder.versions.storage.git.repository is defined
91
- vars:
92
- name: versions
93
- repository: '{{ app_config.recorder.versions.storage.git.repository }}'
94
- branch: '{{ versions_branch }}'
95
- directory: '{{ versions_directory }}'
96
- tags:
97
- - setup
98
- - update
99
-
100
- - name: Start Open Terms Archive schedulers
101
- command:
102
- cmd: pm2 startOrRestart pm2.config.cjs
103
- chdir: '/home/{{ ansible_user }}/{{ ota_directory }}'
104
- environment:
105
- NODE_ENV: production
106
- tags:
107
- - restart
108
- - start
109
- - update
110
- - update-declarations
package/ops/site.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- - name: Set up Open Terms Archive
3
- hosts: all
4
-
5
- - import_playbook: infra.yml
6
- - import_playbook: app.yml
package/pm2.config.cjs DELETED
@@ -1,20 +0,0 @@
1
- module.exports = {
2
- apps: [
3
- {
4
- name: 'ota',
5
- script: 'npm',
6
- args: 'run start:scheduler',
7
- max_restarts: 2,
8
- min_uptime: '1h', // Set a relatively high duration (more than the longest run) so that restarts that occur before this duration has elapsed are considered unstable.
9
- restart_delay: 15 * 60 * 1000,
10
- },
11
- {
12
- name: 'ota-release',
13
- script: 'npm',
14
- args: 'run dataset:scheduler',
15
- max_restarts: 2,
16
- min_uptime: '1h', // Set a relatively high duration (more than the longest run) so that restarts that occur before this duration has elapsed are considered unstable.
17
- restart_delay: 15 * 60 * 1000,
18
- },
19
- ],
20
- };
@@ -1,22 +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_A',
7
- name: 'Service A',
8
- });
9
-
10
- service.addDocumentDeclaration(new DocumentDeclaration({
11
- service,
12
- type: 'Terms of Service',
13
- validUntil: null,
14
- pages: [new PageDeclaration({
15
- location: 'https://www.servicea.example/tos',
16
- contentSelectors: 'body',
17
- noiseSelectors: undefined,
18
- filters: undefined,
19
- })],
20
- }));
21
-
22
- export default service;
@@ -1,10 +0,0 @@
1
- Terms of service with UTF-8 'çhãràčtęrs"
2
- ========================================
3
-
4
- Dapibus quis diam sagittis vitae orci fames fusce porta metus risus, gravida pharetra cras rhoncus nullam tempor purus mattis sit condimentum senectus, a sodales varius in natoque molestie tortor velit quisque. Parturient sit facilisis risus dictumst quisque penatibus donec, mollis ultrices nibh viverra consequat porttitor dignissim laoreet, auctor fermentum himenaeos ut fusce volutpat. Dignissim nulla penatibus lacus at augue sem hendrerit sit, et potenti cum aptent ultricies aliquam habitant, porta lobortis cubilia primis sociis nascetur etiam. Torquent duis facilisis aliquam est purus curae quam sit porta, augue netus laoreet per pharetra volutpat lectus sem commodo, senectus primis arcu suspendisse id vivamus consequat sapien. Litora eros hendrerit commodo eleifend scelerisque risus in fusce porttitor cubilia ultrices porta sed blandit cras condimentum quisque, class accumsan odio enim magna tempus facilisis auctor imperdiet fringilla arcu tristique volutpat faucibus molestie velit. Per quam tristique tortor viverra tempus class varius condimentum, curabitur tellus cras fusce elementum velit cubilia, hendrerit orci vestibulum libero in enim gravida. Eget praesent dictumst lobortis pretium dignissim at viverra tempus fusce potenti, in morbi nascetur purus natoque sagittis phasellus urna sit commodo, ad tortor hendrerit ante mauris venenatis dolor consequat donec.
5
-
6
- * * *
7
-
8
- Suscipit sed eleifend sodales parturient interdum primis vel accumsan, curabitur sem blandit ut pretium sociosqu nam integer vehicula, amet lacinia augue commodo neque sollicitudin duis quam, malesuada cubilia phasellus gravida ad nisl eros. Curae consectetur justo tortor hendrerit morbi habitasse vel eros feugiat per, tristique ante nostra condimentum facilisi enim neque dui taciti dolor, placerat elit molestie luctus etiam magna gravida sed ad. Senectus habitasse sem commodo consectetur litora tempor leo curabitur gravida vestibulum, suscipit tortor viverra pellentesque rhoncus tristique porttitor convallis. Sodales morbi dictumst ut dolor vivamus elit velit orci non tristique nullam, nunc class scelerisque aenean facilisis urna suscipit etiam lobortis purus tortor commodo, duis vel pellentesque taciti aliquam id adipiscing dictum placerat et. At interdum quis eget ut curabitur fusce aliquet commodo suscipit, platea metus libero tortor eros justo in odio ligula fames, gravida placerat augue amet posuere massa fermentum magna. Enim quisque suspendisse accumsan odio ipsum taciti habitasse viverra, venenatis aliquet ac augue auctor nibh cras dignissim magna, convallis varius in sed quam morbi pretium. Habitasse nunc arcu eleifend purus aliquam lobortis morbi porta netus dignissim nisl, vitae class placerat amet sapien at vivamus et dui. Purus risus tellus netus sodales molestie leo nullam nunc, elit curae integer odio nostra ut vitae malesuada, dictum mus justo commodo curabitur placerat luctus. Dui ultrices auctor ultricies fringilla tortor ligula aptent, lectus pulvinar orci nascetur aenean a proin curabitur, ad felis nam nostra nec blandit.
9
-
10
- Dui tristique interdum commodo urna blandit fames tortor posuere dictum fermentum sociis, hendrerit ut libero facilisis id morbi habitant iaculis feugiat. Gravida metus netus ac malesuada vel tristique potenti augue cubilia elit, pellentesque suscipit posuere sapien tempus in praesent torquent dapibus, sit viverra iaculis ultrices aliquet mauris non quisque vitae. Senectus gravida a in litora taciti per ullamcorper nascetur, quis auctor adipiscing nostra cras lacinia aliquet, curae id montes vel molestie placerat condimentum. Convallis fermentum eros sagittis viverra curae risus, aliquet lorem dui magna urna suscipit, id condimentum faucibus molestie ridiculus. Mollis enim etiam taciti diam at pharetra sagittis ligula euismod, ridiculus et sociosqu mauris integer lacinia elementum tortor. In sem nibh cubilia curae facilisi mauris massa, facilisis rhoncus velit phasellus etiam cum penatibus neque, tortor vulputate felis est litora mi.
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>First provider TOS</title>
6
- </head>
7
- <body>
8
- <h1>Terms of service with UTF-8 'çhãràčtęrs"</h1>
9
- <p>Dapibus quis diam sagittis vitae orci fames fusce porta metus risus, gravida pharetra cras rhoncus nullam tempor purus mattis sit condimentum senectus, a sodales varius in natoque molestie tortor velit quisque. Parturient sit facilisis risus dictumst quisque penatibus donec, mollis ultrices nibh viverra consequat porttitor dignissim laoreet, auctor fermentum himenaeos ut fusce volutpat. Dignissim nulla penatibus lacus at augue sem hendrerit sit, et potenti cum aptent ultricies aliquam habitant, porta lobortis cubilia primis sociis nascetur etiam. Torquent duis facilisis aliquam est purus curae quam sit porta, augue netus laoreet per pharetra volutpat lectus sem commodo, senectus primis arcu suspendisse id vivamus consequat sapien. Litora eros hendrerit commodo eleifend scelerisque risus in fusce porttitor cubilia ultrices porta sed blandit cras condimentum quisque, class accumsan odio enim magna tempus facilisis auctor imperdiet fringilla arcu tristique volutpat faucibus molestie velit. Per quam tristique tortor viverra tempus class varius condimentum, curabitur tellus cras fusce elementum velit cubilia, hendrerit orci vestibulum libero in enim gravida. Eget praesent dictumst lobortis pretium dignissim at viverra tempus fusce potenti, in morbi nascetur purus natoque sagittis phasellus urna sit commodo, ad tortor hendrerit ante mauris venenatis dolor consequat donec.
10
- <hr>
11
- <p>Suscipit sed eleifend sodales parturient interdum primis vel accumsan, curabitur sem blandit ut pretium sociosqu nam integer vehicula, amet lacinia augue commodo neque sollicitudin duis quam, malesuada cubilia phasellus gravida ad nisl eros. Curae consectetur justo tortor hendrerit morbi habitasse vel eros feugiat per, tristique ante nostra condimentum facilisi enim neque dui taciti dolor, placerat elit molestie luctus etiam magna gravida sed ad. Senectus habitasse sem commodo consectetur litora tempor leo curabitur gravida vestibulum, suscipit tortor viverra pellentesque rhoncus tristique porttitor convallis. Sodales morbi dictumst ut dolor vivamus elit velit orci non tristique nullam, nunc class scelerisque aenean facilisis urna suscipit etiam lobortis purus tortor commodo, duis vel pellentesque taciti aliquam id adipiscing dictum placerat et. At interdum quis eget ut curabitur fusce aliquet commodo suscipit, platea metus libero tortor eros justo in odio ligula fames, gravida placerat augue amet posuere massa fermentum magna. Enim quisque suspendisse accumsan odio ipsum taciti habitasse viverra, venenatis aliquet ac augue auctor nibh cras dignissim magna, convallis varius in sed quam morbi pretium. Habitasse nunc arcu eleifend purus aliquam lobortis morbi porta netus dignissim nisl, vitae class placerat amet sapien at vivamus et dui. Purus risus tellus netus sodales molestie leo nullam nunc, elit curae integer odio nostra ut vitae malesuada, dictum mus justo commodo curabitur placerat luctus. Dui ultrices auctor ultricies fringilla tortor ligula aptent, lectus pulvinar orci nascetur aenean a proin curabitur, ad felis nam nostra nec blandit.</p>
12
- <p>Dui tristique interdum commodo urna blandit fames tortor posuere dictum fermentum sociis, hendrerit ut libero facilisis id morbi habitant iaculis feugiat. Gravida metus netus ac malesuada vel tristique potenti augue cubilia elit, pellentesque suscipit posuere sapien tempus in praesent torquent dapibus, sit viverra iaculis ultrices aliquet mauris non quisque vitae. Senectus gravida a in litora taciti per ullamcorper nascetur, quis auctor adipiscing nostra cras lacinia aliquet, curae id montes vel molestie placerat condimentum. Convallis fermentum eros sagittis viverra curae risus, aliquet lorem dui magna urna suscipit, id condimentum faucibus molestie ridiculus. Mollis enim etiam taciti diam at pharetra sagittis ligula euismod, ridiculus et sociosqu mauris integer lacinia elementum tortor. In sem nibh cubilia curae facilisi mauris massa, facilisis rhoncus velit phasellus etiam cum penatibus neque, tortor vulputate felis est litora mi.</p></p>
13
- </body>
14
- </html>
@@ -1,22 +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_B',
7
- name: 'Service B',
8
- });
9
-
10
- service.addDocumentDeclaration(new DocumentDeclaration({
11
- service,
12
- type: 'Privacy Policy',
13
- pages: [new PageDeclaration({
14
- location: 'https://www.serviceb.example/privacy',
15
- contentSelectors: 'body',
16
- noiseSelectors: undefined,
17
- filters: undefined,
18
- })],
19
- validUntil: null,
20
- }));
21
-
22
- export default service;
@@ -1,65 +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_declaration_history',
7
- name: 'Service with declaration 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
- [
20
- new DocumentDeclaration({
21
- service,
22
- type: 'Terms of Service',
23
- pages: [
24
- new PageDeclaration({
25
- location: 'https://www.service-with-declaration-history.example/terms',
26
- contentSelectors: 'main',
27
- noiseSelectors: undefined,
28
- filters,
29
- }),
30
- ],
31
- validUntil: null,
32
- }),
33
- new DocumentDeclaration({
34
- service,
35
- type: 'Terms of Service',
36
- pages: [
37
- new PageDeclaration({
38
- location: 'https://www.service-with-declaration-history.example/tos',
39
- contentSelectors: 'body',
40
- noiseSelectors: undefined,
41
- filters: undefined,
42
- }),
43
- ],
44
- validUntil: '2020-08-22T21:30:21.000Z',
45
- }),
46
- new DocumentDeclaration({
47
- service,
48
- type: 'Terms of Service',
49
- pages: [
50
- new PageDeclaration({
51
- location: 'https://www.service-with-declaration-history.example/tos',
52
- contentSelectors: 'main',
53
- noiseSelectors: undefined,
54
- filters: [
55
- async function removeShareButton() {
56
- return 'last-removeShareButton';
57
- },
58
- ],
59
- }),
60
- ],
61
- validUntil: '2020-09-30T21:30:21.000Z',
62
- }),
63
- ].forEach(declaration => service.addDocumentDeclaration(declaration));
64
-
65
- export default service;
@@ -1,155 +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_filters_history',
7
- name: 'Service with filters 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
- [
20
- new DocumentDeclaration({
21
- service,
22
- type: 'Terms of Service',
23
- pages: [
24
- new PageDeclaration({
25
- location: 'https://www.service-with-filters-history.example/terms',
26
- contentSelectors: 'main',
27
- noiseSelectors: undefined,
28
- filters,
29
- }),
30
- ],
31
- validUntil: null,
32
- }),
33
- new DocumentDeclaration({
34
- service,
35
- type: 'Terms of Service',
36
- pages: [
37
- new PageDeclaration({
38
- location: 'https://www.service-with-filters-history.example/terms',
39
- contentSelectors: 'main',
40
- noiseSelectors: undefined,
41
- filters: [
42
- async function removeShareButton() {
43
- return 'first-removeShareButton';
44
- },
45
- async function removePrintButton() {
46
- return 'first-removePrintButton';
47
- },
48
- ],
49
- }),
50
- ],
51
- validUntil: '2020-07-22T11:30:21.000Z',
52
- }),
53
- new DocumentDeclaration({
54
- service,
55
- type: 'Terms of Service',
56
- pages: [
57
- new PageDeclaration({
58
- location: 'https://www.service-with-filters-history.example/terms',
59
- contentSelectors: 'main',
60
- noiseSelectors: undefined,
61
- filters: [
62
- async function removeShareButton() {
63
- return 'first-removeShareButton';
64
- },
65
- async function removePrintButton() {
66
- return 'second-removePrintButton';
67
- },
68
- ],
69
- }),
70
- ],
71
- validUntil: '2020-08-22T11:30:21.000Z',
72
- }),
73
- new DocumentDeclaration({
74
- service,
75
- type: 'Terms of Service',
76
- pages: [
77
- new PageDeclaration({
78
- location: 'https://www.service-with-filters-history.example/terms',
79
- contentSelectors: 'main',
80
- noiseSelectors: undefined,
81
- filters: [
82
- async function removeShareButton() {
83
- return 'second-removeShareButton';
84
- },
85
- async function removePrintButton() {
86
- return 'second-removePrintButton';
87
- },
88
- ],
89
- }),
90
- ],
91
- validUntil: '2020-09-29T21:30:21.000Z',
92
- }),
93
- new DocumentDeclaration({
94
- service,
95
- type: 'Terms of Service',
96
- pages: [
97
- new PageDeclaration({
98
- location: 'https://www.service-with-filters-history.example/terms',
99
- contentSelectors: 'main',
100
- noiseSelectors: undefined,
101
- filters: [
102
- async function removeShareButton() {
103
- return 'second-removeShareButton';
104
- },
105
- async function removePrintButton() {
106
- return 'third-removePrintButton';
107
- },
108
- ],
109
- }),
110
- ],
111
- validUntil: '2020-09-30T21:30:21.000Z',
112
- }),
113
- new DocumentDeclaration({
114
- service,
115
- type: 'Terms of Service',
116
- pages: [
117
- new PageDeclaration({
118
- location: 'https://www.service-with-filters-history.example/terms',
119
- contentSelectors: 'main',
120
- noiseSelectors: undefined,
121
- filters: [
122
- async function removeShareButton() {
123
- return 'third-removeShareButton';
124
- },
125
- async function removePrintButton() {
126
- return 'third-removePrintButton';
127
- },
128
- ],
129
- }),
130
- ],
131
- validUntil: '2020-10-20T12:30:21.000Z',
132
- }),
133
- new DocumentDeclaration({
134
- service,
135
- type: 'Terms of Service',
136
- pages: [
137
- new PageDeclaration({
138
- location: 'https://www.service-with-filters-history.example/terms',
139
- contentSelectors: 'main',
140
- noiseSelectors: undefined,
141
- filters: [
142
- async function removeShareButton() {
143
- return 'third-removeShareButton';
144
- },
145
- async function removePrintButton() {
146
- return 'last-removePrintButton';
147
- },
148
- ],
149
- }),
150
- ],
151
- validUntil: '2020-11-01T12:30:21.000Z',
152
- }),
153
- ].forEach(declaration => service.addDocumentDeclaration(declaration));
154
-
155
- export default service;
@@ -1,188 +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_history',
7
- name: 'Service with 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
- [
20
- new DocumentDeclaration({
21
- service,
22
- type: 'Terms of Service',
23
- pages: [
24
- new PageDeclaration({
25
- location: 'https://www.service-with-history.example/terms',
26
- contentSelectors: 'main',
27
- noiseSelectors: undefined,
28
- filters,
29
- }),
30
- ],
31
- validUntil: null,
32
- }),
33
- new DocumentDeclaration({
34
- service,
35
- type: 'Terms of Service',
36
- pages: [
37
- new PageDeclaration({
38
- location: 'https://www.service-with-history.example/tos',
39
- contentSelectors: 'body',
40
- noiseSelectors: undefined,
41
- filters: undefined,
42
- }),
43
- ],
44
- validUntil: '2020-07-22T11:30:21.000Z',
45
- }),
46
- new DocumentDeclaration({
47
- service,
48
- type: 'Terms of Service',
49
- pages: [
50
- new PageDeclaration({
51
- location: 'https://www.service-with-history.example/tos',
52
- contentSelectors: 'body',
53
- noiseSelectors: undefined,
54
- filters: undefined,
55
- }),
56
- ],
57
- validUntil: '2020-08-15T21:30:21.000Z',
58
- }),
59
- new DocumentDeclaration({
60
- service,
61
- type: 'Terms of Service',
62
- pages: [
63
- new PageDeclaration({
64
- location: 'https://www.service-with-history.example/tos',
65
- contentSelectors: 'main',
66
- noiseSelectors: undefined,
67
- filters: [
68
- async function removeShareButton() {
69
- return 'first-removeShareButton';
70
- },
71
- ],
72
- }),
73
- ],
74
- validUntil: '2020-08-22T11:30:21.000Z',
75
- }),
76
- new DocumentDeclaration({
77
- service,
78
- type: 'Terms of Service',
79
- pages: [
80
- new PageDeclaration({
81
- location: 'https://www.service-with-history.example/tos',
82
- contentSelectors: 'main',
83
- noiseSelectors: undefined,
84
- filters: [
85
- async function removeShareButton() {
86
- return 'second-removeShareButton';
87
- },
88
- ],
89
- }),
90
- ],
91
- validUntil: '2020-09-15T21:30:21.000Z',
92
- }),
93
- new DocumentDeclaration({
94
- service,
95
- type: 'Terms of Service',
96
- pages: [
97
- new PageDeclaration({
98
- location: 'https://www.service-with-history.example/terms_of_service',
99
- contentSelectors: 'body',
100
- noiseSelectors: undefined,
101
- filters: [
102
- async function removeShareButton() {
103
- return 'second-removeShareButton';
104
- },
105
- async function removePrintButton() {
106
- return 'second-removePrintButton';
107
- },
108
- ],
109
- }),
110
- ],
111
- validUntil: '2020-09-29T21:30:21.000Z',
112
- }),
113
- new DocumentDeclaration({
114
- service,
115
- type: 'Terms of Service',
116
- pages: [
117
- new PageDeclaration({
118
- location: 'https://www.service-with-history.example/terms',
119
- contentSelectors: 'main',
120
- noiseSelectors: undefined,
121
- filters: [
122
- async function removeShareButton() {
123
- return 'second-removeShareButton';
124
- },
125
- async function removePrintButton() {
126
- return 'third-removePrintButton';
127
- },
128
- ],
129
- }),
130
- ],
131
- validUntil: '2020-09-30T21:30:21.000Z',
132
- }),
133
- new DocumentDeclaration({
134
- service,
135
- type: 'Terms of Service',
136
- pages: [
137
- new PageDeclaration({
138
- location: 'https://www.service-with-history.example/terms',
139
- contentSelectors: 'main',
140
- noiseSelectors: undefined,
141
- filters: [
142
- async function removeShareButton() {
143
- return 'third-removeShareButton';
144
- },
145
- async function removePrintButton() {
146
- return 'third-removePrintButton';
147
- },
148
- ],
149
- }),
150
- ],
151
- validUntil: '2020-10-20T12:30:21.000Z',
152
- }),
153
- new DocumentDeclaration({
154
- service,
155
- type: 'Terms of Service',
156
- pages: [
157
- new PageDeclaration({
158
- location: 'https://www.service-with-history.example/terms',
159
- contentSelectors: 'main',
160
- noiseSelectors: undefined,
161
- filters: [
162
- async function removeShareButton() {
163
- return 'third-removeShareButton';
164
- },
165
- async function removePrintButton() {
166
- return 'last-removePrintButton';
167
- },
168
- ],
169
- }),
170
- ],
171
- validUntil: '2020-11-01T12:30:21.000Z',
172
- }),
173
- new DocumentDeclaration({
174
- service,
175
- type: 'Privacy Policy',
176
- pages: [
177
- new PageDeclaration({
178
- location: 'https://www.service-with-history.example/privacy',
179
- contentSelectors: 'body',
180
- noiseSelectors: undefined,
181
- filters: undefined,
182
- }),
183
- ],
184
- validUntil: null,
185
- }),
186
- ].forEach(declaration => service.addDocumentDeclaration(declaration));
187
-
188
- export default service;