@opentermsarchive/engine 0.15.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 (168) hide show
  1. package/.env.example +3 -0
  2. package/.eslintrc.yaml +116 -0
  3. package/.github/workflows/deploy.yml +50 -0
  4. package/.github/workflows/release.yml +64 -0
  5. package/.github/workflows/test.yml +77 -0
  6. package/CHANGELOG.md +14 -0
  7. package/CODE_OF_CONDUCT.md +128 -0
  8. package/CONTRIBUTING.md +143 -0
  9. package/LICENSE +153 -0
  10. package/MIGRATING.md +42 -0
  11. package/README.fr.md +110 -0
  12. package/README.md +438 -0
  13. package/Vagrantfile +38 -0
  14. package/ansible.cfg +13 -0
  15. package/bin/.env.js +1 -0
  16. package/bin/lint-declarations.js +31 -0
  17. package/bin/track.js +26 -0
  18. package/bin/validate-declarations.js +68 -0
  19. package/config/ci.json +5 -0
  20. package/config/contrib.json +35 -0
  21. package/config/dating.json +37 -0
  22. package/config/default.json +71 -0
  23. package/config/france.json +40 -0
  24. package/config/p2b-compliance.json +40 -0
  25. package/config/pga.json +40 -0
  26. package/config/production.json +27 -0
  27. package/config/test.json +49 -0
  28. package/config/vagrant.json +24 -0
  29. package/decision-records/0001-service-name-and-id.md +73 -0
  30. package/decision-records/0002-service-history.md +212 -0
  31. package/decision-records/0003-snapshots-database.md +123 -0
  32. package/ops/README.md +280 -0
  33. package/ops/app.yml +5 -0
  34. package/ops/infra.yml +6 -0
  35. package/ops/inventories/dev.yml +7 -0
  36. package/ops/inventories/production.yml +27 -0
  37. package/ops/roles/infra/defaults/main.yml +2 -0
  38. package/ops/roles/infra/files/.gitconfig +3 -0
  39. package/ops/roles/infra/files/mongod.conf +18 -0
  40. package/ops/roles/infra/files/ota-bot-key.private_key +26 -0
  41. package/ops/roles/infra/tasks/main.yml +78 -0
  42. package/ops/roles/infra/tasks/mongo.yml +40 -0
  43. package/ops/roles/infra/templates/ssh_config.j2 +5 -0
  44. package/ops/roles/ota/defaults/main.yml +14 -0
  45. package/ops/roles/ota/files/.env +21 -0
  46. package/ops/roles/ota/tasks/database.yml +65 -0
  47. package/ops/roles/ota/tasks/main.yml +110 -0
  48. package/ops/site.yml +6 -0
  49. package/package.json +101 -0
  50. package/pm2.config.cjs +20 -0
  51. package/scripts/dataset/README.md +37 -0
  52. package/scripts/dataset/assets/LICENSE +540 -0
  53. package/scripts/dataset/assets/README.template.js +65 -0
  54. package/scripts/dataset/export/index.js +106 -0
  55. package/scripts/dataset/export/index.test.js +155 -0
  56. package/scripts/dataset/export/test/fixtures/dataset/LICENSE +540 -0
  57. package/scripts/dataset/export/test/fixtures/dataset/README.md +40 -0
  58. package/scripts/dataset/export/test/fixtures/dataset/ServiceA/Terms of Service/2021-01-01T11-27-00Z.md +1 -0
  59. package/scripts/dataset/export/test/fixtures/dataset/ServiceA/Terms of Service/2021-01-11T11-32-47Z.md +1 -0
  60. package/scripts/dataset/export/test/fixtures/dataset/ServiceB/Privacy Policy/2022-01-01T12-12-24Z.md +1 -0
  61. package/scripts/dataset/export/test/fixtures/dataset/ServiceB/Terms of Service/2022-01-06T11-32-47Z.md +1 -0
  62. package/scripts/dataset/index.js +40 -0
  63. package/scripts/dataset/logger/index.js +17 -0
  64. package/scripts/dataset/main.js +25 -0
  65. package/scripts/dataset/publish/index.js +39 -0
  66. package/scripts/declarations/lint/index.js +36 -0
  67. package/scripts/declarations/utils/index.js +81 -0
  68. package/scripts/declarations/validate/definitions.js +63 -0
  69. package/scripts/declarations/validate/index.mocha.js +262 -0
  70. package/scripts/declarations/validate/service.history.schema.js +86 -0
  71. package/scripts/declarations/validate/service.schema.js +91 -0
  72. package/scripts/history/logger/index.js +39 -0
  73. package/scripts/history/migrate-services.js +212 -0
  74. package/scripts/history/update-to-full-hash.js +61 -0
  75. package/scripts/history/utils/index.js +23 -0
  76. package/scripts/import/README.md +59 -0
  77. package/scripts/import/config/import.json +12 -0
  78. package/scripts/import/index.js +224 -0
  79. package/scripts/import/loadCommits.js +66 -0
  80. package/scripts/import/logger/index.js +43 -0
  81. package/scripts/rewrite/README.md +131 -0
  82. package/scripts/rewrite/config/rewrite-snapshots.json +32 -0
  83. package/scripts/rewrite/config/rewrite-versions.json +32 -0
  84. package/scripts/rewrite/initializer/files/license +428 -0
  85. package/scripts/rewrite/initializer/files/readme.md +8 -0
  86. package/scripts/rewrite/initializer/index.js +44 -0
  87. package/scripts/rewrite/rewrite-snapshots.js +108 -0
  88. package/scripts/rewrite/rewrite-versions.js +160 -0
  89. package/scripts/rewrite/utils.js +33 -0
  90. package/scripts/utils/renamer/README.md +49 -0
  91. package/scripts/utils/renamer/index.js +45 -0
  92. package/scripts/utils/renamer/rules/documentTypes.json +25 -0
  93. package/scripts/utils/renamer/rules/documentTypesByService.json +170 -0
  94. package/scripts/utils/renamer/rules/serviceNames.json +92 -0
  95. package/src/archivist/errors.js +9 -0
  96. package/src/archivist/fetcher/errors.js +6 -0
  97. package/src/archivist/fetcher/exports.js +18 -0
  98. package/src/archivist/fetcher/fullDomFetcher.js +84 -0
  99. package/src/archivist/fetcher/htmlOnlyFetcher.js +62 -0
  100. package/src/archivist/fetcher/index.js +35 -0
  101. package/src/archivist/fetcher/index.test.js +239 -0
  102. package/src/archivist/filter/exports.js +3 -0
  103. package/src/archivist/filter/index.js +178 -0
  104. package/src/archivist/filter/index.test.js +561 -0
  105. package/src/archivist/index.js +276 -0
  106. package/src/archivist/index.test.js +600 -0
  107. package/src/archivist/recorder/index.js +77 -0
  108. package/src/archivist/recorder/index.test.js +463 -0
  109. package/src/archivist/recorder/record.js +35 -0
  110. package/src/archivist/recorder/record.test.js +91 -0
  111. package/src/archivist/recorder/repositories/factory.js +23 -0
  112. package/src/archivist/recorder/repositories/git/dataMapper.js +83 -0
  113. package/src/archivist/recorder/repositories/git/git.js +122 -0
  114. package/src/archivist/recorder/repositories/git/git.test.js +86 -0
  115. package/src/archivist/recorder/repositories/git/index.js +182 -0
  116. package/src/archivist/recorder/repositories/git/index.test.js +714 -0
  117. package/src/archivist/recorder/repositories/interface.js +108 -0
  118. package/src/archivist/recorder/repositories/mongo/dataMapper.js +32 -0
  119. package/src/archivist/recorder/repositories/mongo/index.js +121 -0
  120. package/src/archivist/recorder/repositories/mongo/index.test.js +721 -0
  121. package/src/archivist/services/documentDeclaration.js +26 -0
  122. package/src/archivist/services/documentDeclaration.test.js +85 -0
  123. package/src/archivist/services/documentTypes.json +386 -0
  124. package/src/archivist/services/index.js +255 -0
  125. package/src/archivist/services/index.test.js +327 -0
  126. package/src/archivist/services/pageDeclaration.js +51 -0
  127. package/src/archivist/services/pageDeclaration.test.js +224 -0
  128. package/src/archivist/services/service.js +60 -0
  129. package/src/archivist/services/service.test.js +164 -0
  130. package/src/exports.js +3 -0
  131. package/src/index.js +59 -0
  132. package/src/logger/README.md +1 -0
  133. package/src/logger/index.js +131 -0
  134. package/src/main.js +18 -0
  135. package/src/notifier/README.md +1 -0
  136. package/src/notifier/index.js +150 -0
  137. package/src/tracker/README.md +1 -0
  138. package/src/tracker/index.js +215 -0
  139. package/test/fixtures/service_A.js +22 -0
  140. package/test/fixtures/service_A_terms.md +10 -0
  141. package/test/fixtures/service_A_terms_snapshot.html +14 -0
  142. package/test/fixtures/service_B.js +22 -0
  143. package/test/fixtures/service_with_declaration_history.js +65 -0
  144. package/test/fixtures/service_with_filters_history.js +155 -0
  145. package/test/fixtures/service_with_history.js +188 -0
  146. package/test/fixtures/service_with_multipage_document.js +100 -0
  147. package/test/fixtures/service_without_history.js +31 -0
  148. package/test/fixtures/services.js +19 -0
  149. package/test/fixtures/terms.pdf +0 -0
  150. package/test/fixtures/termsFromPDF.md +25 -0
  151. package/test/fixtures/termsModified.pdf +0 -0
  152. package/test/services/service_A.json +9 -0
  153. package/test/services/service_B.json +9 -0
  154. package/test/services/service_with_declaration_history.filters.js +7 -0
  155. package/test/services/service_with_declaration_history.history.json +17 -0
  156. package/test/services/service_with_declaration_history.json +13 -0
  157. package/test/services/service_with_filters_history.filters.history.js +29 -0
  158. package/test/services/service_with_filters_history.filters.js +7 -0
  159. package/test/services/service_with_filters_history.json +13 -0
  160. package/test/services/service_with_history.filters.history.js +29 -0
  161. package/test/services/service_with_history.filters.js +7 -0
  162. package/test/services/service_with_history.history.json +26 -0
  163. package/test/services/service_with_history.json +17 -0
  164. package/test/services/service_with_multipage_document.filters.js +7 -0
  165. package/test/services/service_with_multipage_document.history.json +37 -0
  166. package/test/services/service_with_multipage_document.json +28 -0
  167. package/test/services/service_without_history.filters.js +7 -0
  168. package/test/services/service_without_history.json +13 -0
@@ -0,0 +1,21 @@
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
@@ -0,0 +1,65 @@
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
@@ -0,0 +1,110 @@
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 ADDED
@@ -0,0 +1,6 @@
1
+ ---
2
+ - name: Set up Open Terms Archive
3
+ hosts: all
4
+
5
+ - import_playbook: infra.yml
6
+ - import_playbook: app.yml
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@opentermsarchive/engine",
3
+ "version": "0.15.0",
4
+ "description": "Tracks and makes visible changes to the terms of online services",
5
+ "homepage": "https://github.com/ambanum/OpenTermsArchive#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/ambanum/OpenTermsArchive/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/ambanum/OpenTermsArchive.git"
12
+ },
13
+ "license": "EUPL-1.2",
14
+ "author": "ambanum",
15
+ "type": "module",
16
+ "exports": {
17
+ ".": "./src/exports.js",
18
+ "./fetch": "./src/archivist/fetcher/exports.js",
19
+ "./filter": "./src/archivist/filter/exports.js",
20
+ "./page-declaration": "./src/archivist/services/pageDeclaration.js"
21
+ },
22
+ "bin": {
23
+ "ota-lint-declarations": "./bin/lint-declarations.js",
24
+ "ota-track": "./bin/track.js",
25
+ "ota-validate-declarations": "./bin/validate-declarations.js"
26
+ },
27
+ "scripts": {
28
+ "dataset:generate": "node scripts/dataset/main.js",
29
+ "dataset:release": "node scripts/dataset/main.js --publish --remove-local-copy",
30
+ "dataset:scheduler": "npm run dataset:release -- --schedule",
31
+ "declarations:lint": "node ./bin/lint-declarations.js",
32
+ "declarations:validate": "node ./bin/validate-declarations.js",
33
+ "declarations:validate:schema": "npm run declarations:validate -- --schema-only",
34
+ "lint": "eslint src test scripts bin",
35
+ "lint:fix": "npm run lint -- --fix",
36
+ "refilter": "npm start -- --refilter-only",
37
+ "start": "node --max-http-header-size=32768 src/main.js",
38
+ "start:scheduler": "npm start -- --schedule",
39
+ "test": "cross-env NODE_ENV=test mocha --recursive \"./src/**/*.test.js\" \"./scripts/**/*.test.js\" --exit",
40
+ "posttest": "npm run lint",
41
+ "test:debug": "npm run test -- --inspect-brk --exit"
42
+ },
43
+ "dependencies": {
44
+ "@accordproject/markdown-cicero": "^0.15.2",
45
+ "@accordproject/markdown-pdf": "^0.15.2",
46
+ "@opentermsarchive/fetch-charset-detection": "^1.0.1",
47
+ "@opentermsarchive/turndown": "^7.1.3",
48
+ "abort-controller": "^3.0.0",
49
+ "ajv": "^6.12.6",
50
+ "archiver": "^5.3.0",
51
+ "async": "^3.2.2",
52
+ "chai": "^4.3.4",
53
+ "chai-as-promised": "^7.1.1",
54
+ "chai-exclude": "^2.1.0",
55
+ "commander": "^9.4.1",
56
+ "config": "^3.3.6",
57
+ "croner": "^4.3.6",
58
+ "cross-env": "^7.0.3",
59
+ "datauri": "^4.1.0",
60
+ "deep-diff": "^1.0.2",
61
+ "dotenv": "^10.0.0",
62
+ "eslint": "^8.2.0",
63
+ "eslint-config-airbnb-base": "^15.0.0",
64
+ "eslint-plugin-chai-friendly": "^0.7.2",
65
+ "eslint-plugin-import": "^2.25.3",
66
+ "eslint-plugin-json-format": "^2.0.1",
67
+ "fs-extra": "^10.0.0",
68
+ "http-proxy-agent": "^5.0.0",
69
+ "https": "^1.0.0",
70
+ "https-proxy-agent": "^5.0.0",
71
+ "iconv-lite": "^0.6.3",
72
+ "joplin-turndown-plugin-gfm": "^1.0.12",
73
+ "jsdom": "^18.1.0",
74
+ "json-source-map": "^0.6.1",
75
+ "lodash": "^4.17.21",
76
+ "mime": "^2.5.2",
77
+ "mocha": "^9.1.3",
78
+ "mongodb": "^4.9.0",
79
+ "node-fetch": "^3.1.0",
80
+ "octokit": "^1.7.0",
81
+ "pdfjs-dist": "^2.9.359",
82
+ "puppeteer": "14.3.0",
83
+ "puppeteer-extra": "^3.2.3",
84
+ "puppeteer-extra-plugin-stealth": "^2.9.0",
85
+ "sib-api-v3-sdk": "^8.2.1",
86
+ "simple-git": "^3.8.0",
87
+ "winston": "^3.3.3",
88
+ "winston-mail": "^2.0.0"
89
+ },
90
+ "devDependencies": {
91
+ "dir-compare": "^4.0.0",
92
+ "nock": "^13.2.1",
93
+ "node-stream-zip": "^1.15.0",
94
+ "prettier": "^2.2.1",
95
+ "sinon": "^12.0.1",
96
+ "sinon-chai": "^3.7.0"
97
+ },
98
+ "engines": {
99
+ "node": ">=16.0.0"
100
+ }
101
+ }
package/pm2.config.cjs ADDED
@@ -0,0 +1,20 @@
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
+ };
@@ -0,0 +1,37 @@
1
+ # Dataset release
2
+
3
+ Export the versions dataset into a ZIP file and publish it to GitHub releases.
4
+
5
+ ## Configuring
6
+
7
+ You can change the configuration in the appropriate config file in the `config` folder. See the [main README](https://github.com/ambanum/OpenTermsArchive#configuring) for documentation on using the configuration file.
8
+
9
+ ## Running
10
+
11
+ To export the dataset into a local ZIP file:
12
+
13
+ ```sh
14
+ node scripts/dataset/main.js [$filename]
15
+ ```
16
+
17
+ To export the dataset into a ZIP file and publish it on GitHub releases:
18
+
19
+ ```sh
20
+ node scripts/dataset/main.js --publish
21
+ ```
22
+
23
+ To export, publish the dataset and remove the local copy that was created after it has been uploaded:
24
+
25
+ ```sh
26
+ node scripts/dataset/main.js --publish --remove-local-copy
27
+ ```
28
+
29
+ To schedule export, publishing and local copy removal:
30
+
31
+ ```sh
32
+ node scripts/dataset/main.js --schedule --publish --remove-local-copy
33
+ ```
34
+
35
+ ## Adding renaming rules
36
+
37
+ See the [renamer module documentation](../renamer/README.md).