@opentermsarchive/engine 2.1.0 → 2.2.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.
package/config/default.json
CHANGED
package/package.json
CHANGED
|
@@ -175,6 +175,12 @@ describe('Service', () => {
|
|
|
175
175
|
it('returns the number of terms matching the provided terms types', () => {
|
|
176
176
|
expect(subject.getNumberOfTerms([ TERMS_OF_SERVICE_TYPE, IMPRINT_TYPE ])).to.equal(1);
|
|
177
177
|
});
|
|
178
|
+
|
|
179
|
+
context('when the provided filter is empty', () => {
|
|
180
|
+
it('returns the number of all terms types', () => {
|
|
181
|
+
expect(subject.getNumberOfTerms([])).to.equal(2);
|
|
182
|
+
});
|
|
183
|
+
});
|
|
178
184
|
});
|
|
179
185
|
});
|
|
180
186
|
});
|
package/src/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
|
|
1
3
|
import config from 'config';
|
|
2
4
|
import cron from 'croner';
|
|
3
5
|
import cronstrue from 'cronstrue';
|
|
@@ -7,6 +9,8 @@ import logger from './logger/index.js';
|
|
|
7
9
|
import Notifier from './notifier/index.js';
|
|
8
10
|
import Reporter from './reporter/index.js';
|
|
9
11
|
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
|
|
10
14
|
export default async function track({ services, types, extractOnly, schedule }) {
|
|
11
15
|
const archivist = new Archivist({
|
|
12
16
|
recorderConfig: config.get('@opentermsarchive/engine.recorder'),
|
|
@@ -17,7 +21,9 @@ export default async function track({ services, types, extractOnly, schedule })
|
|
|
17
21
|
|
|
18
22
|
await archivist.initialize();
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
const { version } = require('../package.json');
|
|
25
|
+
|
|
26
|
+
logger.info(`Start Open Terms Archive engine v${version}\n`);
|
|
21
27
|
|
|
22
28
|
if (services?.length) {
|
|
23
29
|
services = services.filter(serviceId => {
|
|
@@ -50,7 +56,7 @@ export default async function track({ services, types, extractOnly, schedule })
|
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
if (process.env.OTA_ENGINE_GITHUB_TOKEN) {
|
|
53
|
-
if (config.has('reporter.githubIssues.repositories.declarations')) {
|
|
59
|
+
if (config.has('@opentermsarchive/engine.reporter.githubIssues.repositories.declarations')) {
|
|
54
60
|
try {
|
|
55
61
|
const reporter = new Reporter(config.get('@opentermsarchive/engine.reporter'));
|
|
56
62
|
|