build(deps): bump node to 14.17 and drop uuid in favor of native randomUUID (#1792)

This commit is contained in:
TheCatLady
2021-06-17 00:12:09 -04:00
committed by GitHub
parent c8b5a200d3
commit 0db0d4c280
12 changed files with 17 additions and 24 deletions

View File

@@ -1,4 +1,5 @@
import bcrypt from 'bcrypt';
import { randomUUID } from 'crypto';
import path from 'path';
import { default as generatePassword } from 'secure-random-password';
import {
@@ -15,7 +16,6 @@ import {
RelationCount,
UpdateDateColumn,
} from 'typeorm';
import { v4 as uuid } from 'uuid';
import { MediaRequestStatus, MediaType } from '../constants/media';
import { UserType } from '../constants/user';
import { QuotaResponse } from '../interfaces/api/userInterfaces';
@@ -189,7 +189,7 @@ export class User {
}
public async resetPassword(): Promise<void> {
const guid = uuid();
const guid = randomUUID();
this.resetPasswordGuid = guid;
// 24 hours into the future

View File

@@ -1,4 +1,4 @@
import crypto from 'crypto';
import { randomBytes } from 'crypto';
import * as openpgp from 'openpgp';
import { Transform, TransformCallback } from 'stream';
@@ -107,7 +107,7 @@ class PGPEncryptor extends Transform {
}
// Generate a new boundary for the email content
const boundary = 'nm_' + crypto.randomBytes(14).toString('hex');
const boundary = 'nm_' + randomBytes(14).toString('hex');
/**
* Concatenate everything into single strings
* and add pgp headers to the email headers

View File

@@ -1,5 +1,5 @@
import { randomUUID } from 'crypto';
import { getRepository } from 'typeorm';
import { v4 as uuid } from 'uuid';
import TheMovieDb from '../../api/themoviedb';
import { MediaStatus, MediaType } from '../../constants/media';
import Media from '../../entity/Media';
@@ -512,7 +512,7 @@ class BaseScanner<T> {
*/
protected startRun(): string {
const settings = getSettings();
const sessionId = uuid();
const sessionId = randomUUID();
this.sessionId = sessionId;
this.log('Scan starting', 'info', { sessionId });

View File

@@ -1,7 +1,7 @@
import { randomUUID } from 'crypto';
import fs from 'fs';
import { merge } from 'lodash';
import path from 'path';
import { v4 as uuidv4 } from 'uuid';
import webpush from 'web-push';
import { Permission } from './permissions';
@@ -234,7 +234,7 @@ class Settings {
constructor(initialSettings?: AllSettings) {
this.data = {
clientId: uuidv4(),
clientId: randomUUID(),
vapidPrivate: '',
vapidPublic: '',
main: {
@@ -428,7 +428,7 @@ class Settings {
get clientId(): string {
if (!this.data.clientId) {
this.data.clientId = uuidv4();
this.data.clientId = randomUUID();
this.save();
}
@@ -454,7 +454,7 @@ class Settings {
}
private generateApiKey(): string {
return Buffer.from(`${Date.now()}${uuidv4()})`).toString('base64');
return Buffer.from(`${Date.now()}${randomUUID()})`).toString('base64');
}
private generateVapidKeys(force = false): void {