reviewable-enterprise-tools 1.3.2 → 1.3.5

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/extract_data.js CHANGED
@@ -225,7 +225,7 @@ async function extractReviews() {
225
225
  const archive = await db.child('archivedReviews/:reviewKey', {reviewKey}).get();
226
226
  if (archive) {
227
227
  review = JSON.parse(zlib.gunzipSync(Buffer.from(archive.payload, 'base64')).toString());
228
- const placeholdersPresent = stripReview(review);
228
+ const placeholdersPresent = await stripReview(review);
229
229
  if (identityUserMap) mapAllUserKeys(review);
230
230
  archive.payload =
231
231
  zlib.gzipSync(JSON.stringify(review), {level: zlib.constants.Z_BEST_COMPRESSION})
package/load_data.js CHANGED
@@ -52,6 +52,10 @@ if (!process.env.REVIEWABLE_ENCRYPTION_AES_KEY) {
52
52
 
53
53
  let placeholderUrlRegex, gh;
54
54
  if (uploadedFilesUrl) {
55
+ if (!process.env.REVIEWABLE_GITHUB_URL) {
56
+ console.log('ERROR: no REVIEWABLE_GITHUB_URL specified, unable to upload images');
57
+ process.exit(1);
58
+ }
55
59
  placeholderUrlRegex = new RegExp(_.escapeRegExp(PLACEHOLDER_URL), 'g');
56
60
  } else {
57
61
  console.warn(
@@ -61,7 +65,11 @@ if (uploadedFilesUrl) {
61
65
 
62
66
  async function load() {
63
67
  await import('./lib/loadFirebase.js');
64
- if (uploadedFilesUrl) gh = new Hubkit({token: await fetchToken(args.admin)});
68
+ if (uploadedFilesUrl) gh = new Hubkit({
69
+ host: process.env.REVIEWABLE_GITHUB_URL ?
70
+ process.env.REVIEWABLE_GITHUB_URL + '/api/v3' : 'https://api.github.com',
71
+ token: await fetchToken(args.admin)
72
+ });
65
73
 
66
74
  let sizeRead = 0;
67
75
  let fatalError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reviewable-enterprise-tools",
3
- "version": "1.3.2",
3
+ "version": "1.3.5",
4
4
  "type": "module",
5
5
  "description": "Admin tools for Reviewable Enterprise",
6
6
  "bin": {