Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump uuid to v8 #323

Merged
merged 2 commits into from
May 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"isomorphic-ws": "^4.0.1",
"jsonwebtoken": "^8.3.0",
"seamless-immutable": "^7.1.4",
"uuid": "^3.3.2",
"uuid": "^8.0.0",
"ws": "^6.1.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const externalPackages = [
'isomorphic-ws',
'lodash',
'seamless-immutable',
'uuid/v4',
'uuid',
'base64-js',
'@babel/runtime/regenerator',
'@babel/runtime/helpers/asyncToGenerator',
Expand Down
2 changes: 1 addition & 1 deletion src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* global process */

import axios from 'axios';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import { Channel } from './channel';
import { ClientState } from './client_state';
import { StableWSConnection } from './connection';
Expand Down
2 changes: 1 addition & 1 deletion test/channel_permissions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getTestClient } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import fs from 'fs';

class Context {
Expand Down
2 changes: 1 addition & 1 deletion test/channels.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

import {
createUsers,
Expand Down
2 changes: 1 addition & 1 deletion test/connection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StableWSConnection } from '../src/connection';
import { sleep } from '../src/utils';
import { getTestClientForUser, getTestClient, createUserToken } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

import chai from 'chai';
const expect = chai.expect;
Expand Down
2 changes: 1 addition & 1 deletion test/delete_channel.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import { getTestClientForUser, createUsers, getServerTestClient } from './utils';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
Expand Down
2 changes: 1 addition & 1 deletion test/gdpr.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
sleep,
expectHTTPErrorCode,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/invites.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
getTestClient,
getTestClientForUser,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/moderation.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import {
getTestClientForUser,
createUsers,
Expand Down
2 changes: 1 addition & 1 deletion test/multitenant.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getTestClient, createUserToken, getTestClientForUser } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { BuiltinPermissions } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion test/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
sleep,
createUsers,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

describe('Notifications - members not watching', function() {
const serverSideClient = getTestClient(true);
Expand Down
2 changes: 1 addition & 1 deletion test/presence.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
getServerTestClient,
newEventPromise,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/query_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
runAndLogPromise,
sleep,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/reactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import { expectHTTPErrorCode, getTestClient, getTestClientForUser } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/serverside.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
DenyAll,
Permission,
} from '../src/permissions';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';
import chai from 'chai';
import fs from 'fs';
import chaiLike from 'chai-like';
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
createUsers,
sleep,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;
chai.use(assertArrays);
Expand Down
2 changes: 1 addition & 1 deletion test/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
sleep,
runAndLogPromise,
} from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/webhook.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import chai from 'chai';
import http from 'http';
import { getTestClient, getTestClientForUser, sleep } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

const expect = chai.expect;

Expand Down
2 changes: 1 addition & 1 deletion test/x-setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Permission, AnyResource, AnyRole, Allow } from '../src';
import { getTestClient } from './utils';
import uuidv4 from 'uuid/v4';
import { v4 as uuidv4 } from 'uuid';

async function setupEverythingDisabledChannel(serverAuthClient) {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const uuid4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

const johnID = `john-${uuid4()}`;
const johnID = `john-${uuidv4()}`;

async function channelSearch() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`, {
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`, {
members: [johnID],
});
await channel.create();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

async function createChannelType() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

const johnID = `john-${uuidv4()}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

async function setUser() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const uuid4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

const johnID = `john-${uuid4()}`;
const johnID = `john-${uuidv4()}`;

async function sendMessageReadEvent() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();
const event = {
type: 'message.read',
Expand All @@ -16,15 +16,15 @@ async function sendMessageReadEvent() {

async function keystroke() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();

return await channel.keystroke();
}

async function stopTyping() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();

return await channel.stopTyping();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

const johnID = `john-${uuidv4()}`;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const uuidv4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

async function banUsers() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const uuid4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

const johnID = `john-${uuid4()}`;
const johnID = `john-${uuidv4()}`;

async function sendReaction() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();
const { message } = await channel.sendMessage({ text: `Test message` });

Expand All @@ -14,7 +14,7 @@ async function sendReaction() {

async function deleteReaction() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();
const { message } = await channel.sendMessage({ text: `Test message` });

Expand All @@ -25,7 +25,7 @@ async function deleteReaction() {

async function getReactions() {
const authClient = await utils.getTestClientForUser(johnID, {});
const channel = authClient.channel('messaging', `poppins-${uuid4()}`);
const channel = authClient.channel('messaging', `poppins-${uuidv4()}`);
await channel.watch();
const text = 'testing reactions list';
const data = await channel.sendMessage({ text });
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const uuid4 = require('uuid/v4');
const { v4: uuidv4 } = require('uuid');
const utils = require('../utils');

async function updateUsers() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID2 = uuid4();
const userID3 = uuid4();
const unique = uuid4();
const userID = uuidv4();
const userID2 = uuidv4();
const userID3 = uuidv4();
const unique = uuidv4();

return await client.updateUsers([
{
Expand All @@ -29,8 +29,8 @@ async function updateUsers() {

async function partialUpdateUser() {
const client = utils.getServerTestClient();
const userID = uuid4();
const unique = uuid4();
const userID = uuidv4();
const unique = uuidv4();

await client.updateUsers([
{
Expand All @@ -53,10 +53,10 @@ async function partialUpdateUser() {

async function partialUpdateUsers() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID2 = uuid4();
const userID3 = uuid4();
const unique = uuid4();
const userID = uuidv4();
const userID2 = uuidv4();
const userID3 = uuidv4();
const unique = uuidv4();

await client.updateUsers([
{
Expand Down Expand Up @@ -110,7 +110,7 @@ async function partialUpdateUsers() {

async function deactivateUser() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID = uuidv4();
await client.upsertUser({
id: userID,
name: 'Vishal',
Expand All @@ -121,7 +121,7 @@ async function deactivateUser() {

async function reactivateUser() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID = uuidv4();
await client.upsertUser({
id: userID,
name: 'Vishal',
Expand All @@ -134,7 +134,7 @@ async function reactivateUser() {

async function deleteUser() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID = uuidv4();
await client.upsertUser({
id: userID,
name: 'Vishal',
Expand All @@ -145,13 +145,13 @@ async function deleteUser() {

async function exportUser() {
const client = utils.getServerTestClient();
const userID = uuid4();
const userID = uuidv4();
await client.upsertUser({
id: userID,
name: 'Vishal',
});

const id = uuid4();
const id = uuidv4();
const channel = client.channel('messaging', id, { created_by_id: userID });
await channel.create();
const { message } = await channel.sendMessage({
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6046,6 +6046,11 @@ uuid@^3.1.0, uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==

uuid@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c"
integrity sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==

v8flags@^3.1.1:
version "3.1.3"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.3.tgz#fc9dc23521ca20c5433f81cc4eb9b3033bb105d8"
Expand Down