wuffle 0.58.0 → 0.60.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/bin/run.js +48 -38
  2. package/bin/wuffle +1 -1
  3. package/index.js +1 -1
  4. package/lib/apps/auth-routes/AuthRoutes.js +9 -18
  5. package/lib/apps/auth-routes/index.js +2 -2
  6. package/lib/apps/automatic-dev-flow.js +5 -5
  7. package/lib/apps/background-sync/BackgroundSync.js +9 -17
  8. package/lib/apps/background-sync/index.js +2 -2
  9. package/lib/apps/board-api-routes/board-api-filters.js +10 -28
  10. package/lib/apps/board-api-routes/board-api-routes.js +17 -27
  11. package/lib/apps/board-api-routes/index.js +2 -2
  12. package/lib/apps/board-routes.js +21 -10
  13. package/lib/apps/dump-store/local/DumpStoreLocal.js +8 -12
  14. package/lib/apps/dump-store/local/index.js +2 -2
  15. package/lib/apps/dump-store/s3/DumpStoreS3.js +6 -8
  16. package/lib/apps/dump-store/s3/S3.js +4 -5
  17. package/lib/apps/dump-store/s3/index.js +2 -2
  18. package/lib/apps/events-sync.js +7 -9
  19. package/lib/apps/github-app/GithubApp.js +7 -9
  20. package/lib/apps/github-app/index.js +2 -2
  21. package/lib/apps/github-checks/GithubChecks.js +7 -10
  22. package/lib/apps/github-checks/index.js +2 -2
  23. package/lib/apps/github-client/GithubClient.js +16 -17
  24. package/lib/apps/github-client/index.js +2 -2
  25. package/lib/apps/github-comments/GithubComments.js +8 -17
  26. package/lib/apps/github-comments/index.js +2 -2
  27. package/lib/apps/github-issues/GithubIssues.js +4 -9
  28. package/lib/apps/github-issues/index.js +2 -2
  29. package/lib/apps/github-reviews/GithubReviews.js +8 -14
  30. package/lib/apps/github-reviews/index.js +2 -2
  31. package/lib/apps/github-statuses/GithubStatuses.js +8 -14
  32. package/lib/apps/github-statuses/index.js +2 -2
  33. package/lib/apps/log-events.js +7 -9
  34. package/lib/apps/reindex-store.js +10 -18
  35. package/lib/apps/route-compression.js +3 -5
  36. package/lib/apps/route-https.js +3 -5
  37. package/lib/apps/search/Search.js +8 -20
  38. package/lib/apps/search/index.js +2 -2
  39. package/lib/apps/security-context/SecurityContext.js +3 -5
  40. package/lib/apps/security-context/index.js +2 -2
  41. package/lib/apps/user-access/TreeCache.js +1 -3
  42. package/lib/apps/user-access/UserAccess.js +11 -8
  43. package/lib/apps/user-access/index.js +2 -2
  44. package/lib/apps/webhook-events/WebhookEvents.js +4 -6
  45. package/lib/apps/webhook-events/index.js +2 -2
  46. package/lib/columns.js +7 -4
  47. package/lib/events.js +2 -9
  48. package/lib/filters.js +11 -31
  49. package/lib/index.js +38 -40
  50. package/lib/links.js +17 -12
  51. package/lib/load-config.js +8 -4
  52. package/lib/middleware/index.js +7 -9
  53. package/lib/probot/CustomProbot.js +8 -11
  54. package/lib/probot/apps/setup.js +9 -16
  55. package/lib/probot/index.js +1 -1
  56. package/lib/store.js +10 -22
  57. package/lib/util/cache.js +4 -11
  58. package/lib/util/index.js +37 -37
  59. package/lib/util/links.js +3 -7
  60. package/lib/util/meta.js +24 -7
  61. package/lib/util/search.js +3 -8
  62. package/package.json +16 -9
  63. package/public/bundle.js.map +1 -1
@@ -1,11 +1,11 @@
1
- const {
1
+ import {
2
2
  filterIssue,
3
3
  filterPull,
4
4
  filterIssueOrPull,
5
5
  filterRepository,
6
6
  getIdentifier,
7
7
  getKey
8
- } = require('../filters');
8
+ } from '../filters.js';
9
9
 
10
10
 
11
11
  /**
@@ -13,11 +13,11 @@ const {
13
13
  *
14
14
  * @constructor
15
15
  *
16
- * @param {import('./webhook-events/WebhookEvents')} webhookEvents
17
- * @param {import('../store')} store
18
- * @param {import('../types').Logger} logger
16
+ * @param {import('./webhook-events/WebhookEvents.js').default} webhookEvents
17
+ * @param {import('../store.js').default} store
18
+ * @param {import('../types.js').Logger} logger
19
19
  */
20
- function EventsSync(webhookEvents, store, logger) {
20
+ export default function EventsSync(webhookEvents, store, logger) {
21
21
 
22
22
  const log = logger.child({
23
23
  name: 'wuffle:user-access'
@@ -274,6 +274,4 @@ function EventsSync(webhookEvents, store, logger) {
274
274
  return store.removeIssueById(storedIssue.id);
275
275
  });
276
276
 
277
- }
278
-
279
- module.exports = EventsSync;
277
+ }
@@ -27,7 +27,7 @@ const RequiredEvents = [
27
27
  ];
28
28
 
29
29
  /**
30
- * @typedef {import('./types').Installation} Installation
30
+ * @typedef {import('./types.js').Installation} Installation
31
31
  */
32
32
 
33
33
  /**
@@ -37,11 +37,11 @@ const RequiredEvents = [
37
37
  * @constructor
38
38
  *
39
39
  * @param {Object} config
40
- * @param {import('../../types').ProbotApp} app
41
- * @param {import('../../types').Logger} logger
42
- * @param {import('../../types').Injector} injector
40
+ * @param {import('../../types.js').ProbotApp} app
41
+ * @param {import('../../types.js').Logger} logger
42
+ * @param {import('../../types.js').Injector} injector
43
43
  */
44
- function GithubApp(config, app, logger, injector) {
44
+ export default function GithubApp(config, app, logger, injector) {
45
45
 
46
46
  const log = logger.child({
47
47
  name: 'wuffle:github-app'
@@ -71,7 +71,7 @@ function GithubApp(config, app, logger, injector) {
71
71
  // functionality /////////////////
72
72
 
73
73
  /**
74
- * @return {Promise<import('../../types').Octokit>}
74
+ * @return {Promise<import('../../types.js').Octokit>}
75
75
  */
76
76
  function getAppScopedClient() {
77
77
  return app.auth();
@@ -262,6 +262,4 @@ function GithubApp(config, app, logger, injector) {
262
262
 
263
263
  this.getInstallations = getInstallations;
264
264
 
265
- }
266
-
267
- module.exports = GithubApp;
265
+ }
@@ -1,6 +1,6 @@
1
- const GithubApp = require('./GithubApp');
1
+ import GithubApp from './GithubApp.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  __init__: [ 'githubApp' ],
5
5
  githubApp: [ 'type', GithubApp ]
6
6
  };
@@ -1,19 +1,16 @@
1
- const {
2
- repoAndOwner,
3
- Cache
4
- } = require('../../util');
1
+ import { repoAndOwner, Cache } from '../../util/index.js';
5
2
 
6
3
  /**
7
4
  * This component updates the stored issues based on GitHub events.
8
5
  *
9
6
  * @constructor
10
7
  *
11
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
12
- * @param {import('../../events')} events
13
- * @param {import('../github-client/GithubClient')} githubClient
14
- * @param {import('../../store')} store
8
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
9
+ * @param {import('../../events.js').default} events
10
+ * @param {import('../github-client/GithubClient.js').default} githubClient
11
+ * @param {import('../../store.js').default} store
15
12
  */
16
- module.exports = function GithubChecks(webhookEvents, events, githubClient, store) {
13
+ export default function GithubChecks(webhookEvents, events, githubClient, store) {
17
14
 
18
15
  // issues /////////////////////
19
16
 
@@ -114,7 +111,7 @@ module.exports = function GithubChecks(webhookEvents, events, githubClient, stor
114
111
  cache.evict();
115
112
  }, 1000 * 60);
116
113
 
117
- };
114
+ }
118
115
 
119
116
 
120
117
  function filterCheckRun(check_suite) {
@@ -1,6 +1,6 @@
1
- const GithubChecks = require('./GithubChecks');
1
+ import GithubChecks from './GithubChecks.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  __init__: [ 'githubChecks' ],
5
5
  githubChecks: [ 'type', GithubChecks ]
6
6
  };
@@ -1,30 +1,31 @@
1
- const {
2
- ProbotOctokit
3
- } = require('probot/lib/octokit/probot-octokit');
4
-
5
- const {
6
- Cache
7
- } = require('../../util');
1
+ import { ProbotOctokit } from 'probot/lib/octokit/probot-octokit.js';
2
+ import { Cache } from '../../util/index.js';
8
3
 
9
4
 
10
5
  // 15 minutes
11
6
  const TTL = 1000 * 60 * 15;
12
7
 
13
8
  /**
14
- * @typedef { import('../../types').Octokit } Octokit
9
+ * @typedef { import('../../types.js').Octokit } Octokit
15
10
  * @typedef { { [x: string]: Promise<Octokit> } } LoginCache
16
11
  */
17
12
 
18
13
  /**
19
14
  * @constructor
20
15
  *
21
- * @param {import('../../types').ProbotApp} app
22
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
23
- * @param {import('../../types').Logger} logger
24
- * @param {import('../github-app/GithubApp')} githubApp
25
- * @param {import('../../events')} events
16
+ * @param {import('../../types.js').ProbotApp} app
17
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
18
+ * @param {import('../../types.js').Logger} logger
19
+ * @param {import('../github-app/GithubApp.js').default} githubApp
20
+ * @param {import('../../events.js').default} events
26
21
  */
27
- function GitHubClient(app, webhookEvents, logger, githubApp, events) {
22
+ export default function GitHubClient(
23
+ app,
24
+ webhookEvents,
25
+ logger,
26
+ githubApp,
27
+ events
28
+ ) {
28
29
 
29
30
  const log = logger.child({
30
31
  name: 'wuffle:github-client'
@@ -143,6 +144,4 @@ function GitHubClient(app, webhookEvents, logger, githubApp, events) {
143
144
  });
144
145
  }
145
146
 
146
- }
147
-
148
- module.exports = GitHubClient;
147
+ }
@@ -1,5 +1,5 @@
1
- const GithubClient = require('./GithubClient');
1
+ import GithubClient from './GithubClient.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  githubClient: [ 'type', GithubClient ]
5
5
  };
@@ -1,13 +1,6 @@
1
- const {
2
- repoAndOwner
3
- } = require('../../util');
4
-
5
- const {
6
- filterUser,
7
- filterIssue
8
- } = require('../../filters');
9
-
10
- const gql = require('fake-tag');
1
+ import { repoAndOwner } from '../../util/index.js';
2
+ import { filterUser, filterIssue } from '../../filters.js';
3
+ import gql from 'fake-tag';
11
4
 
12
5
 
13
6
  /**
@@ -15,12 +8,12 @@ const gql = require('fake-tag');
15
8
  *
16
9
  * @constructor
17
10
  *
18
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
19
- * @param {import('../../events')} events
20
- * @param {import('../github-client/GithubClient')} githubClient
21
- * @param {import('../../store')} store
11
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
12
+ * @param {import('../../events.js').default} events
13
+ * @param {import('../github-client/GithubClient.js').default} githubClient
14
+ * @param {import('../../store.js').default} store
22
15
  */
23
- function GithubComments(webhookEvents, events, githubClient, store) {
16
+ export default function GithubComments(webhookEvents, events, githubClient, store) {
24
17
 
25
18
  // issues /////////////////////
26
19
 
@@ -180,8 +173,6 @@ function GithubComments(webhookEvents, events, githubClient, store) {
180
173
 
181
174
  }
182
175
 
183
- module.exports = GithubComments;
184
-
185
176
 
186
177
  function filterComment(comment) {
187
178
 
@@ -1,6 +1,6 @@
1
- const GithubComments = require('./GithubComments');
1
+ import GithubComments from './GithubComments.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  __init__: [ 'githubComments' ],
5
5
  githubComments: [ 'type', GithubComments ]
6
6
  };
@@ -1,7 +1,4 @@
1
- const {
2
- findLinks,
3
- linkTypes
4
- } = require('../../util');
1
+ import { findLinks, linkTypes } from '../../util/index.js';
5
2
 
6
3
  const {
7
4
  CLOSES
@@ -11,11 +8,11 @@ const {
11
8
  /**
12
9
  * @constructor
13
10
  *
14
- * @param {import('../../types').Logger} logger
15
11
  * @param {any} config
16
- * @param {import('../../columns')} columns
12
+ * @param {import('../../types.js').Logger} logger
13
+ * @param {import('../../columns.js').default} columns
17
14
  */
18
- function GithubIssues(logger, config, columns) {
15
+ export default function GithubIssues(config, logger, columns) {
19
16
 
20
17
  const log = logger.child({
21
18
  name: 'wuffle:github-issues'
@@ -222,8 +219,6 @@ function GithubIssues(logger, config, columns) {
222
219
 
223
220
  }
224
221
 
225
- module.exports = GithubIssues;
226
-
227
222
 
228
223
  // helpers //////////////
229
224
 
@@ -1,5 +1,5 @@
1
- const GithubIssues = require('./GithubIssues');
1
+ import GithubIssues from './GithubIssues.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  githubIssues: [ 'type', GithubIssues ]
5
5
  };
@@ -1,11 +1,5 @@
1
- const {
2
- repoAndOwner
3
- } = require('../../util');
4
-
5
- const {
6
- filterUser,
7
- filterPull
8
- } = require('../../filters');
1
+ import { repoAndOwner } from '../../util/index.js';
2
+ import { filterUser, filterPull } from '../../filters.js';
9
3
 
10
4
 
11
5
  /**
@@ -13,12 +7,12 @@ const {
13
7
  *
14
8
  * @constructor
15
9
  *
16
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
17
- * @param {import('../../events')} events
18
- * @param {import('../github-client/GithubClient')} githubClient
19
- * @param {import('../../store')} store
10
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
11
+ * @param {import('../../events.js').default} events
12
+ * @param {import('../github-client/GithubClient.js').default} githubClient
13
+ * @param {import('../../store.js').default} store
20
14
  */
21
- module.exports = function GithubReviews(webhookEvents, events, githubClient, store) {
15
+ export default function GithubReviews(webhookEvents, events, githubClient, store) {
22
16
 
23
17
  // issues /////////////////////
24
18
 
@@ -110,7 +104,7 @@ module.exports = function GithubReviews(webhookEvents, events, githubClient, sto
110
104
  });
111
105
  });
112
106
 
113
- };
107
+ }
114
108
 
115
109
 
116
110
  function filterReview(review) {
@@ -1,6 +1,6 @@
1
- const GithubReviews = require('./GithubReviews');
1
+ import GithubReviews from './GithubReviews.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  __init__: [ 'githubReviews' ],
5
5
  githubReviews: [ 'type', GithubReviews ]
6
6
  };
@@ -1,11 +1,5 @@
1
- const {
2
- repoAndOwner,
3
- Cache
4
- } = require('../../util');
5
-
6
- const {
7
- filterPull
8
- } = require('../../filters');
1
+ import { repoAndOwner, Cache } from '../../util/index.js';
2
+ import { filterPull } from '../../filters.js';
9
3
 
10
4
 
11
5
  /**
@@ -13,12 +7,12 @@ const {
13
7
  *
14
8
  * @constructor
15
9
  *
16
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
17
- * @param {import('../../events')} events
18
- * @param {import('../github-client/GithubClient')} githubClient
19
- * @param {import('../../store')} store
10
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
11
+ * @param {import('../../events.js').default} events
12
+ * @param {import('../github-client/GithubClient.js').default} githubClient
13
+ * @param {import('../../store.js').default} store
20
14
  */
21
- module.exports = function GithubStates(webhookEvents, events, githubClient, store) {
15
+ export default function GithubStates(webhookEvents, events, githubClient, store) {
22
16
 
23
17
  // issues /////////////////////
24
18
 
@@ -154,7 +148,7 @@ module.exports = function GithubStates(webhookEvents, events, githubClient, stor
154
148
  cache.evict();
155
149
  }, 1000 * 60);
156
150
 
157
- };
151
+ }
158
152
 
159
153
 
160
154
  function filterStatus(status) {
@@ -1,6 +1,6 @@
1
- const GithubStatuses = require('./GithubStatuses');
1
+ import GithubStatuses from './GithubStatuses.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  __init__: [ 'githubStatuses' ],
5
5
  githubStatuses: [ 'type', GithubStatuses ]
6
6
  };
@@ -1,7 +1,7 @@
1
- const { mkdirp } = require('mkdirp');
1
+ import { mkdirp } from 'mkdirp';
2
2
 
3
- const path = require('path');
4
- const fs = require('fs').promises;
3
+ import path from 'node:path';
4
+ import { promises as fs } from 'node:fs';
5
5
 
6
6
 
7
7
  /**
@@ -10,10 +10,10 @@ const fs = require('fs').promises;
10
10
  *
11
11
  * @constructor
12
12
  *
13
- * @param {import('../types').Logger} logger
14
- * @param {import('./webhook-events/WebhookEvents')} webhookEvents
13
+ * @param {import('../types.js').Logger} logger
14
+ * @param {import('./webhook-events/WebhookEvents.js').default} webhookEvents
15
15
  */
16
- function LogEvents(logger, webhookEvents) {
16
+ export default function LogEvents(logger, webhookEvents) {
17
17
 
18
18
  if (process.env.NODE_ENV !== 'development' && !process.env.LOG_WEBHOOK_EVENTS) {
19
19
  return;
@@ -60,6 +60,4 @@ function LogEvents(logger, webhookEvents) {
60
60
  });
61
61
  });
62
62
 
63
- }
64
-
65
- module.exports = LogEvents;
63
+ }
@@ -1,17 +1,20 @@
1
- const {
2
- version
3
- } = require('../../package.json');
1
+ import {
2
+ getPackageVersion,
3
+ hash
4
+ } from '../util/index.js';
4
5
 
5
6
 
6
7
  /**
7
8
  * @constructor
8
9
  *
9
- * @param {any} logger
10
10
  * @param {any} config
11
- * @param {any} events
12
- * @param {any} store
11
+ * @param {import('../types.js').Logger} logger
12
+ * @param {import('../events.js').default} events
13
+ * @param {import('../store.js').default} store
13
14
  */
14
- function ReindexStore(logger, config, events, store) {
15
+ export default function ReindexStore(config, logger, events, store) {
16
+
17
+ const version = getPackageVersion();
15
18
 
16
19
  const log = logger.child({
17
20
  name: 'wuffle:reindex-store'
@@ -58,15 +61,4 @@ function ReindexStore(logger, config, events, store) {
58
61
  data.wuffleVersion = version;
59
62
  });
60
63
 
61
- }
62
-
63
- module.exports = ReindexStore;
64
-
65
-
66
- // helpers //////////////////
67
-
68
- function hash(str) {
69
- const crypto = require('crypto');
70
-
71
- return crypto.createHash('md5').update(str).digest('hex');
72
64
  }
@@ -1,12 +1,10 @@
1
- const compression = require('compression');
1
+ import compression from 'compression';
2
2
 
3
3
  /**
4
4
  * Enables compression for routes
5
5
  *
6
6
  * @param {import('express').Router} router
7
7
  */
8
- module.exports = function(router) {
9
-
8
+ export default function routeCompression(router) {
10
9
  router.use(compression());
11
-
12
- };
10
+ }
@@ -1,13 +1,11 @@
1
- const {
2
- useHttps
3
- } = require('../middleware');
1
+ import { useHttps } from '../middleware/index.js';
4
2
 
5
3
  /**
6
4
  * Enables https redirects and strict transport security.
7
5
  *
8
6
  * @param {import('express').Router} router
9
7
  */
10
- module.exports = function(router) {
8
+ export default function routeHttps(router) {
11
9
 
12
10
  if (!process.env.FORCE_HTTPS) {
13
11
  return;
@@ -24,4 +22,4 @@ module.exports = function(router) {
24
22
  }
25
23
 
26
24
  router.use(useHttps(baseUrl));
27
- };
25
+ }
@@ -1,15 +1,6 @@
1
- const {
2
- parseSearch,
3
- parseTemporalFilter
4
- } = require('../../util');
5
-
6
- const {
7
- issueIdent
8
- } = require('../../util');
9
-
10
- const {
11
- LinkTypes
12
- } = require('../../links');
1
+ import { parseSearch, parseTemporalFilter } from '../../util/index.js';
2
+ import { issueIdent } from '../../util/index.js';
3
+ import { LinkTypes } from '../../links.js';
13
4
 
14
5
  const CHILD_LINK_TYPES = {
15
6
  [ LinkTypes.CHILD_OF ]: true,
@@ -26,10 +17,10 @@ const CHILD_LINK_TYPES = {
26
17
  * @constructor
27
18
  *
28
19
  * @param {SearchConfig} config
29
- * @param {import('../../types').Logger} logger
30
- * @param {import('../../store')} store
20
+ * @param {import('../../types.js').Logger} logger
21
+ * @param {import('../../store.js').default} store
31
22
  */
32
- function Search(config, logger, store) {
23
+ export default function Search(config, logger, store) {
33
24
 
34
25
  const log = logger.child({
35
26
  name: 'wuffle:search'
@@ -346,7 +337,7 @@ function Search(config, logger, store) {
346
337
  * Retrieve a filter function from the given search string.
347
338
  *
348
339
  * @param {string} search
349
- * @param {import('../../types').GitHubUser} [user]
340
+ * @param {import('../../types.js').GitHubUser} [user]
350
341
  *
351
342
  * @return {Function}
352
343
  */
@@ -376,7 +367,4 @@ function Search(config, logger, store) {
376
367
  // api ///////////////////////
377
368
 
378
369
  this.getSearchFilter = getSearchFilter;
379
-
380
- }
381
-
382
- module.exports = Search;
370
+ }
@@ -1,5 +1,5 @@
1
- const Search = require('./Search');
1
+ import Search from './Search.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  search: [ 'type', Search ]
5
5
  };
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @constructor
3
3
  *
4
- * @param {import('../github-client/GithubClient')} githubClient
4
+ * @param {import('../github-client/GithubClient.js').default} githubClient
5
5
  */
6
- function SecurityContext(githubClient) {
6
+ export default function SecurityContext(githubClient) {
7
7
 
8
8
  /**
9
9
  * Get authenticated user by token.
@@ -22,6 +22,4 @@ function SecurityContext(githubClient) {
22
22
  return user;
23
23
  };
24
24
 
25
- }
26
-
27
- module.exports = SecurityContext;
25
+ }
@@ -1,5 +1,5 @@
1
- const SecurityContext = require('./SecurityContext');
1
+ import SecurityContext from './SecurityContext.js';
2
2
 
3
- module.exports = {
3
+ export default {
4
4
  securityContext: [ 'type', SecurityContext ]
5
5
  };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A cache that allows tree-like keys
3
3
  */
4
- class TreeCache {
4
+ export default class TreeCache {
5
5
 
6
6
  constructor(ttl = -1) {
7
7
  this._cache = {};
@@ -107,8 +107,6 @@ class TreeCache {
107
107
 
108
108
  }
109
109
 
110
- module.exports = TreeCache;
111
-
112
110
 
113
111
  // helpers ///////////////
114
112
 
@@ -1,4 +1,4 @@
1
- const TreeCache = require('./TreeCache');
1
+ import TreeCache from './TreeCache.js';
2
2
 
3
3
  // 9 days
4
4
  const TTL = 1000 * 60 * 60 * 24 * 9;
@@ -10,12 +10,17 @@ const TTL = 1000 * 60 * 60 * 24 * 9;
10
10
  *
11
11
  * @constructor
12
12
  *
13
- * @param {import('../../types').Logger} logger
14
- * @param {import('../github-client/GithubClient')} githubClient
15
- * @param {import('../../events')} events
16
- * @param {import('../webhook-events/WebhookEvents')} webhookEvents
13
+ * @param {import('../../types.js').Logger} logger
14
+ * @param {import('../github-client/GithubClient.js').default} githubClient
15
+ * @param {import('../../events.js').default} events
16
+ * @param {import('../webhook-events/WebhookEvents.js').default} webhookEvents
17
17
  */
18
- function UserAccess(logger, githubClient, events, webhookEvents) {
18
+ export default function UserAccess(
19
+ logger,
20
+ githubClient,
21
+ events,
22
+ webhookEvents
23
+ ) {
19
24
 
20
25
  const log = logger.child({
21
26
  name: 'wuffle:user-access'
@@ -305,8 +310,6 @@ function UserAccess(logger, githubClient, events, webhookEvents) {
305
310
 
306
311
  }
307
312
 
308
- module.exports = UserAccess;
309
-
310
313
 
311
314
  // helpers //////////////
312
315