@opentermsarchive/engine 0.16.0 → 0.17.1

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 (82) hide show
  1. package/README.md +240 -232
  2. package/package.json +7 -1
  3. package/scripts/dataset/README.md +2 -2
  4. package/scripts/dataset/assets/README.template.js +5 -5
  5. package/scripts/dataset/export/test/fixtures/dataset/README.md +5 -5
  6. package/scripts/import/README.md +1 -1
  7. package/scripts/rewrite/README.md +2 -2
  8. package/scripts/rewrite/rewrite-versions.js +1 -1
  9. package/scripts/utils/renamer/README.md +5 -5
  10. package/scripts/utils/renamer/index.js +2 -2
  11. package/src/archivist/recorder/index.js +2 -2
  12. package/src/archivist/recorder/index.test.js +3 -3
  13. package/src/archivist/recorder/repositories/git/dataMapper.js +1 -1
  14. package/src/archivist/recorder/repositories/git/index.test.js +5 -5
  15. package/src/archivist/recorder/repositories/interface.js +2 -2
  16. package/src/archivist/recorder/repositories/mongo/index.test.js +4 -4
  17. package/src/archivist/services/index.test.js +2 -2
  18. package/src/archivist/services/service.test.js +1 -1
  19. package/src/main.js +1 -1
  20. package/.env.example +0 -3
  21. package/.eslintrc.yaml +0 -116
  22. package/.github/workflows/deploy.yml +0 -50
  23. package/.github/workflows/release.yml +0 -71
  24. package/.github/workflows/test.yml +0 -77
  25. package/CHANGELOG.md +0 -14
  26. package/CODE_OF_CONDUCT.md +0 -128
  27. package/CONTRIBUTING.md +0 -143
  28. package/MIGRATING.md +0 -42
  29. package/README.fr.md +0 -110
  30. package/Vagrantfile +0 -38
  31. package/ansible.cfg +0 -13
  32. package/decision-records/0001-service-name-and-id.md +0 -73
  33. package/decision-records/0002-service-history.md +0 -212
  34. package/decision-records/0003-snapshots-database.md +0 -123
  35. package/ops/README.md +0 -280
  36. package/ops/app.yml +0 -5
  37. package/ops/infra.yml +0 -6
  38. package/ops/inventories/dev.yml +0 -7
  39. package/ops/inventories/production.yml +0 -27
  40. package/ops/roles/infra/defaults/main.yml +0 -2
  41. package/ops/roles/infra/files/.gitconfig +0 -3
  42. package/ops/roles/infra/files/mongod.conf +0 -18
  43. package/ops/roles/infra/files/ota-bot-key.private_key +0 -26
  44. package/ops/roles/infra/tasks/main.yml +0 -78
  45. package/ops/roles/infra/tasks/mongo.yml +0 -40
  46. package/ops/roles/infra/templates/ssh_config.j2 +0 -5
  47. package/ops/roles/ota/defaults/main.yml +0 -14
  48. package/ops/roles/ota/files/.env +0 -21
  49. package/ops/roles/ota/tasks/database.yml +0 -65
  50. package/ops/roles/ota/tasks/main.yml +0 -110
  51. package/ops/site.yml +0 -6
  52. package/pm2.config.cjs +0 -20
  53. package/test/fixtures/service_A.js +0 -22
  54. package/test/fixtures/service_A_terms.md +0 -10
  55. package/test/fixtures/service_A_terms_snapshot.html +0 -14
  56. package/test/fixtures/service_B.js +0 -22
  57. package/test/fixtures/service_with_declaration_history.js +0 -65
  58. package/test/fixtures/service_with_filters_history.js +0 -155
  59. package/test/fixtures/service_with_history.js +0 -188
  60. package/test/fixtures/service_with_multipage_document.js +0 -100
  61. package/test/fixtures/service_without_history.js +0 -31
  62. package/test/fixtures/services.js +0 -19
  63. package/test/fixtures/terms.pdf +0 -0
  64. package/test/fixtures/termsFromPDF.md +0 -25
  65. package/test/fixtures/termsModified.pdf +0 -0
  66. package/test/services/service_A.json +0 -9
  67. package/test/services/service_B.json +0 -9
  68. package/test/services/service_with_declaration_history.filters.js +0 -7
  69. package/test/services/service_with_declaration_history.history.json +0 -17
  70. package/test/services/service_with_declaration_history.json +0 -13
  71. package/test/services/service_with_filters_history.filters.history.js +0 -29
  72. package/test/services/service_with_filters_history.filters.js +0 -7
  73. package/test/services/service_with_filters_history.json +0 -13
  74. package/test/services/service_with_history.filters.history.js +0 -29
  75. package/test/services/service_with_history.filters.js +0 -7
  76. package/test/services/service_with_history.history.json +0 -26
  77. package/test/services/service_with_history.json +0 -17
  78. package/test/services/service_with_multipage_document.filters.js +0 -7
  79. package/test/services/service_with_multipage_document.history.json +0 -37
  80. package/test/services/service_with_multipage_document.json +0 -28
  81. package/test/services/service_without_history.filters.js +0 -7
  82. package/test/services/service_without_history.json +0 -13
@@ -1,18 +0,0 @@
1
- # For documentation of all options, see: http://docs.mongodb.org/manual/reference/configuration-options/
2
-
3
- storage:
4
- dbPath: /mnt/disk/mongodb
5
- journal:
6
- enabled: true
7
-
8
- systemLog:
9
- destination: file
10
- logAppend: true
11
- path: /var/log/mongodb/mongod.log
12
-
13
- net:
14
- port: 27017
15
- bindIp: 127.0.0.1
16
-
17
- processManagement:
18
- timeZoneInfo: /usr/share/zoneinfo
@@ -1,26 +0,0 @@
1
- $ANSIBLE_VAULT;1.1;AES256
2
- 62323034623265653135396533383461663035373132353462393965626661663763616338663364
3
- 6137323531393331613165656234623365393531343136310a313439336336663337663838386465
4
- 61376563313330653330313232656262386439666364363436316561323934313064643333323365
5
- 3663616163636133610a363332616537366535343737646332373239663434646339333561653365
6
- 32346630323336373035323435343733383539663661316166383065316334616165353166386532
7
- 38363233646537353566623536353561663839313564363833623835663139616430643637373439
8
- 30663634653466353862326333363663376634343838343262323039363165653336616666613461
9
- 34646430393031376163646334353438383439383164616338373961356361333534383565303164
10
- 36373663623630356338356239376265616632313933353332643036343134366534363066363039
11
- 34323532386631643861616162376438343835656264366334666562303337303333623335343739
12
- 33303138636665363061633733666538326664313561363834646562323066353532316363393132
13
- 36306565363165653637613435323234656361336535343164396339343330666263656636326339
14
- 66346132346363633664643763326638366331623232616430393838653631623233303865316437
15
- 37363039376131316134306264383332663839633130616364636461366131323835323237636261
16
- 61633232646533633131363461383239653732373530333131376265663832636464396134303961
17
- 34336435396131303531616666376666643762386438623732386634316465383938356233646436
18
- 62376532663136323137336365343064383137333739666433323365616638343661346564636362
19
- 37613436353662656137323332343936613134306133653361336135366532626338633363306664
20
- 30366566323965623262383266663331386565326461643566383938333266343366353730373232
21
- 31346434613463653261313430326634323931333062663836333933333635393265616232363031
22
- 36376239326137636430373564633534393830386463376632383731333537366533343030373937
23
- 66396366613331623838316533623163333662313430666562306639353665616430303735356163
24
- 30643738383366616633393438366235666631393033616639613938363939646138323934396631
25
- 36633734313936383566393934316263636363616231343139633164303864646164306337643063
26
- 34343664333031303737646232346234643131306565333265373539616537373864
@@ -1,78 +0,0 @@
1
- ---
2
- - name: Load app config
3
- ansible.builtin.include_vars:
4
- name: app_config
5
- file: '../config/{{ config_file_name }}.json'
6
-
7
- - name: Install common required packages
8
- apt:
9
- pkg:
10
- - build-essential
11
- - curl
12
- - git
13
- - zip
14
- update_cache: yes
15
- state: latest
16
-
17
- - name: Add the NodeSource repository to the system
18
- shell: curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
19
-
20
- - name: Install NodeJS and NPM
21
- apt:
22
- name: nodejs
23
- update_cache: yes
24
- state: latest
25
-
26
- - name: Update NPM to latest version
27
- command: npm install -g npm
28
-
29
- - name: Install pm2
30
- command: npm install -g pm2 --production=true
31
-
32
- - name: Add global git config
33
- copy:
34
- src: .gitconfig
35
- dest: '/home/{{ ansible_user }}/.gitconfig'
36
-
37
- - name: Add GitHub bot account SSH key
38
- copy:
39
- src: ota-bot-key.private_key
40
- dest: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
41
- owner: '{{ ansible_user }}'
42
- group: '{{ ansible_user }}'
43
- mode: 0600
44
-
45
- - name: Configure SSH to use GitHub bot account key on github.com
46
- template:
47
- src: ssh_config.j2
48
- dest: '/home/{{ ansible_user }}/.ssh/config'
49
- owner: '{{ ansible_user }}'
50
- group: '{{ ansible_user }}'
51
- mode: 0644
52
-
53
- - name: Install Chromium — Debian
54
- apt:
55
- pkg:
56
- - chromium
57
- update_cache: yes
58
- state: latest
59
- when: ansible_distribution == 'Debian'
60
-
61
- - name: Install Chromium — Ubuntu
62
- apt:
63
- pkg:
64
- - chromium-browser
65
- update_cache: yes
66
- state: latest
67
- when: ansible_distribution == 'Ubuntu'
68
-
69
- # See https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#recommended-enable-user-namespace-cloning
70
- - name: Enable user namespace cloning to allow running Chromium in a sandbox
71
- command: sysctl -w kernel.unprivileged_userns_clone=1
72
- when: ansible_facts['architecture'] != 'aarch64'
73
-
74
- - include_tasks: mongo.yml
75
- when:
76
- - (app_config.recorder.versions.storage.type is defined and app_config.recorder.versions.storage.type == 'mongo') or (app_config.recorder.snapshots.storage.type is defined and app_config.recorder.snapshots.storage.type == 'mongo')
77
- # Skip Debian 11 with ARM architecture as it is not currently supported by MongoDB. See https://www.mongodb.com/docs/manual/installation/#supported-platforms
78
- - ansible_distribution != 'Debian' or (ansible_distribution == 'Debian' and ansible_facts['architecture'] != 'aarch64')
@@ -1,40 +0,0 @@
1
- ---
2
- # See https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/
3
- - name: Import the MongoDB public key used by the package management system
4
- shell: wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
5
-
6
- - name: Create an apt list file for MongoDB — Debian
7
- shell: echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
8
- when: ansible_distribution == 'Debian'
9
-
10
- - name: Create an apt list file for MongoDB — Ubuntu
11
- shell: echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
12
- when: ansible_distribution == 'Ubuntu'
13
-
14
- - name: Install MongoDB
15
- apt:
16
- name: mongodb-org
17
- update_cache: yes
18
- state: latest
19
-
20
- - name: Add mongod.conf
21
- copy:
22
- src: mongod.conf
23
- dest: '/etc/mongod.conf'
24
-
25
- - name: Create data directory
26
- file:
27
- path: /mnt/disk/mongodb
28
- state: directory
29
-
30
- - name: Set database files permissions
31
- ansible.builtin.file:
32
- path: /mnt/disk/mongodb
33
- owner: mongodb
34
- group: mongodb
35
- recurse: yes
36
-
37
- - name: Start MongoDB service
38
- service:
39
- name: mongod
40
- state: restarted
@@ -1,5 +0,0 @@
1
- {{ ansible_managed | comment }}
2
-
3
- Host github.com
4
- IdentityFile /home/{{ ansible_user }}/.ssh/ota-bot-key
5
- IdentitiesOnly yes
@@ -1,14 +0,0 @@
1
- # Try out experimental features by deploying alternative versions of the engine, configuration or databases
2
- ota_repository: https://github.com/ambanum/OpenTermsArchive.git
3
- ota_branch: main
4
- declarations_branch: main
5
- snapshots_branch: main
6
- versions_branch: main
7
- config_file_name: '{{ instance_name }}'
8
-
9
- # Avoid collisions in case of multi-tenancy (running several instances on the same hosts)
10
- instance_name: '{{ group_names[0] }}' # assume there is only one named group per host; override if a single server runs several instances
11
- ota_directory: ota
12
- declarations_directory: declarations
13
- snapshots_directory: snapshots
14
- versions_directory: versions
@@ -1,21 +0,0 @@
1
- $ANSIBLE_VAULT;1.1;AES256
2
- 65653333633465346264373663643062363265383439323061633338323166393262663332646534
3
- 3034646331313536623831616466653564396663636166650a643831383438613765323264386266
4
- 37383663326333636366653537383339636231313261323239663164393933366535623730313337
5
- 3230323166306336630a646239643135326335393364366534663535316334333531353431323331
6
- 62376464333830643539333764646534613935386263633634623962653537363139363265353864
7
- 34623031333535313930633964626438343432363366633263396466323830323035343333373763
8
- 31303962353238383666343834653539663536623561393966373763393535663038333833396433
9
- 61326137363133373861343732336335373037613134336362396563653563646364376438366363
10
- 61613437393364396332313833356138303835633739653937656631313737623762346235316164
11
- 30353961393663663635393630653535353064353031623962333038366638376333646130663263
12
- 35346637303534663639613537316538663134356166323566613333343236383631653563643433
13
- 65373533656236613631653665383039303564613830343530363130663462343665343865666637
14
- 61353766623634303537326163623564663433343835366463613837303361393538656365633365
15
- 64306532626533373561633066616336663439653734313832366333323461383065326166313635
16
- 38343261656638396235326266376531633662343235633336363361313266643166346433356539
17
- 38363833336562623631306432656531326465306535623164353035366339336663626161613364
18
- 39616539616532643935623939313834343964303035383334666261363336303034346439316663
19
- 65306530333965353766363336386564383932333234303334633438333839316362666533363330
20
- 34336232623333353366363232656461646236383061383634653137623661376639323162383162
21
- 38653230353662316366
@@ -1,65 +0,0 @@
1
- - name: Check if {{ name }} base data has already been obtained from {{ repository }}
2
- git:
3
- repo: '{{ repository }}'
4
- version: '{{ branch }}'
5
- dest: '/home/{{ ansible_user }}/{{ directory }}'
6
- clone: no
7
- update: no
8
- accept_hostkey: yes
9
- key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
10
- register: existing_repository # the `before` property of the return value can tell us if the repository has been cloned already or not, see <https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html#return-values>
11
- tags:
12
- - restart
13
- - start
14
- - update
15
- - setup
16
-
17
- - name: Obtain {{ name }} initial data from branch {{ branch }} of {{ repository }}
18
- git:
19
- repo: '{{ repository }}'
20
- version: '{{ branch }}'
21
- dest: '/home/{{ ansible_user }}/{{ directory }}'
22
- accept_hostkey: yes
23
- key_file: '/home/{{ ansible_user }}/.ssh/ota-bot-key'
24
- when: existing_repository.before is defined and not existing_repository.before # if existing_repository.before is null, then the repository is new
25
- tags:
26
- - setup
27
-
28
- - name: Remove existing locks in {{ name }}
29
- file:
30
- path: '/home/{{ ansible_user }}/{{ directory }}/.git/index.lock'
31
- state: absent
32
- tags:
33
- - restart
34
- - start
35
- - update
36
-
37
- - name: Get latest data from {{ repository }}
38
- command:
39
- cmd: git fetch origin
40
- chdir: '/home/{{ ansible_user }}/{{ directory }}'
41
- tags:
42
- - restart
43
- - start
44
- - update
45
- - setup
46
-
47
- - name: Clean {{ name }} local copy
48
- command:
49
- cmd: git reset --hard origin/{{ branch }}
50
- chdir: '/home/{{ ansible_user }}/{{ directory }}'
51
- tags:
52
- - restart
53
- - start
54
- - update
55
- - setup
56
-
57
- - name: Ensure {{ name }} is on branch {{ branch }}
58
- command:
59
- cmd: git checkout {{ branch }}
60
- chdir: '/home/{{ ansible_user }}/{{ directory }}'
61
- tags:
62
- - restart
63
- - start
64
- - update
65
- - setup
@@ -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;