From 97aee2c10f5bac756ba4c67b6390e85cb7e7afc4 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Wed, 29 Aug 2018 11:39:51 +0100 Subject: [PATCH 1/8] added room id to connections table --- app/models/connection.rb | 10 +++++++++- db/migrate/20180829102007_add_column_to_connections.rb | 5 +++++ db/schema.rb | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20180829102007_add_column_to_connections.rb diff --git a/app/models/connection.rb b/app/models/connection.rb index 0028286..521a5f7 100644 --- a/app/models/connection.rb +++ b/app/models/connection.rb @@ -2,13 +2,21 @@ class Connection < ApplicationRecord belongs_to :user belongs_to :contact, class_name: 'User', foreign_key: 'contact_id' + after_create :set_room_id after_create :create_inverted_connection private + def set_room_id + self.room_id = "#{self.user.email}+#{self.contact.email}" + self.save! + end + def create_inverted_connection unless Connection.where('user_id = ? and contact_id = ?', self.contact.id, self.user.id).length > 0 - Connection.create!(user: self.contact, contact: self.user) + inverted = Connection.create!(user: self.contact, contact: self.user) + inverted.room_id = "#{self.user.email}+#{self.contact.email}" + inverted.save! end end end diff --git a/db/migrate/20180829102007_add_column_to_connections.rb b/db/migrate/20180829102007_add_column_to_connections.rb new file mode 100644 index 0000000..080b162 --- /dev/null +++ b/db/migrate/20180829102007_add_column_to_connections.rb @@ -0,0 +1,5 @@ +class AddColumnToConnections < ActiveRecord::Migration[5.2] + def change + add_column :connections, :room_id, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index cc819c1..9b9880d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_08_27_151325) do +ActiveRecord::Schema.define(version: 2018_08_29_102007) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -18,6 +18,7 @@ ActiveRecord::Schema.define(version: 2018_08_27_151325) do create_table "connections", force: :cascade do |t| t.bigint "user_id" t.bigint "contact_id" + t.string "room_id" t.index ["contact_id"], name: "index_connections_on_contact_id" t.index ["user_id"], name: "index_connections_on_user_id" end From 82079d71cdb95427fbdede9482de846ae2c6fabc Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Wed, 29 Aug 2018 13:15:37 +0100 Subject: [PATCH 2/8] removed room id from connections table --- app/models/connection.rb | 8 -------- db/migrate/20180829102007_add_column_to_connections.rb | 5 ----- db/schema.rb | 3 +-- 3 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 db/migrate/20180829102007_add_column_to_connections.rb diff --git a/app/models/connection.rb b/app/models/connection.rb index 521a5f7..f66456a 100644 --- a/app/models/connection.rb +++ b/app/models/connection.rb @@ -2,21 +2,13 @@ class Connection < ApplicationRecord belongs_to :user belongs_to :contact, class_name: 'User', foreign_key: 'contact_id' - after_create :set_room_id after_create :create_inverted_connection private - def set_room_id - self.room_id = "#{self.user.email}+#{self.contact.email}" - self.save! - end - def create_inverted_connection unless Connection.where('user_id = ? and contact_id = ?', self.contact.id, self.user.id).length > 0 inverted = Connection.create!(user: self.contact, contact: self.user) - inverted.room_id = "#{self.user.email}+#{self.contact.email}" - inverted.save! end end end diff --git a/db/migrate/20180829102007_add_column_to_connections.rb b/db/migrate/20180829102007_add_column_to_connections.rb deleted file mode 100644 index 080b162..0000000 --- a/db/migrate/20180829102007_add_column_to_connections.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddColumnToConnections < ActiveRecord::Migration[5.2] - def change - add_column :connections, :room_id, :string - end -end diff --git a/db/schema.rb b/db/schema.rb index 9b9880d..cc819c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_08_29_102007) do +ActiveRecord::Schema.define(version: 2018_08_27_151325) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -18,7 +18,6 @@ ActiveRecord::Schema.define(version: 2018_08_29_102007) do create_table "connections", force: :cascade do |t| t.bigint "user_id" t.bigint "contact_id" - t.string "room_id" t.index ["contact_id"], name: "index_connections_on_contact_id" t.index ["user_id"], name: "index_connections_on_user_id" end From 085e402c4dbf49b62775ba9c06ba08e5ea15991d Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Wed, 29 Aug 2018 13:44:10 +0100 Subject: [PATCH 3/8] created models for chatroom --- app/models/chat_room.rb | 5 ++++ app/models/chat_room_participation.rb | 4 +++ app/models/request.rb | 4 +++ app/models/user.rb | 3 ++ .../20180829122818_create_chat_rooms.rb | 8 +++++ ...9122930_create_chat_room_participations.rb | 10 +++++++ db/migrate/20180829123049_create_requests.rb | 11 +++++++ ...0180829123204_change_column_in_requests.rb | 5 ++++ db/schema.rb | 30 ++++++++++++++++++- test/models/chat_room_participation_test.rb | 7 +++++ test/models/chat_room_test.rb | 7 +++++ test/models/request_test.rb | 7 +++++ 12 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 app/models/chat_room.rb create mode 100644 app/models/chat_room_participation.rb create mode 100644 app/models/request.rb create mode 100644 db/migrate/20180829122818_create_chat_rooms.rb create mode 100644 db/migrate/20180829122930_create_chat_room_participations.rb create mode 100644 db/migrate/20180829123049_create_requests.rb create mode 100644 db/migrate/20180829123204_change_column_in_requests.rb create mode 100644 test/models/chat_room_participation_test.rb create mode 100644 test/models/chat_room_test.rb create mode 100644 test/models/request_test.rb diff --git a/app/models/chat_room.rb b/app/models/chat_room.rb new file mode 100644 index 0000000..078aced --- /dev/null +++ b/app/models/chat_room.rb @@ -0,0 +1,5 @@ +class ChatRoom < ApplicationRecord + has_many :users, through: :chat_room_participations + has_many :chat_room_participations + has_many :requests +end diff --git a/app/models/chat_room_participation.rb b/app/models/chat_room_participation.rb new file mode 100644 index 0000000..86931ec --- /dev/null +++ b/app/models/chat_room_participation.rb @@ -0,0 +1,4 @@ +class ChatRoomParticipation < ApplicationRecord + belongs_to :user + belongs_to :chat_room +end diff --git a/app/models/request.rb b/app/models/request.rb new file mode 100644 index 0000000..2857ced --- /dev/null +++ b/app/models/request.rb @@ -0,0 +1,4 @@ +class Request < ApplicationRecord + belongs_to :user + belongs_to :chat_room +end diff --git a/app/models/user.rb b/app/models/user.rb index dfa148e..a084ec6 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,6 +5,9 @@ class User < ApplicationRecord :recoverable, :rememberable, :validatable has_many :connections + has_many :chat_rooms, through: :chat_room_participations + has_many :chat_room_participations + has_many :requests def contacts self.connections.map do |connection| diff --git a/db/migrate/20180829122818_create_chat_rooms.rb b/db/migrate/20180829122818_create_chat_rooms.rb new file mode 100644 index 0000000..a142563 --- /dev/null +++ b/db/migrate/20180829122818_create_chat_rooms.rb @@ -0,0 +1,8 @@ +class CreateChatRooms < ActiveRecord::Migration[5.2] + def change + create_table :chat_rooms do |t| + + t.timestamps + end + end +end diff --git a/db/migrate/20180829122930_create_chat_room_participations.rb b/db/migrate/20180829122930_create_chat_room_participations.rb new file mode 100644 index 0000000..34739cc --- /dev/null +++ b/db/migrate/20180829122930_create_chat_room_participations.rb @@ -0,0 +1,10 @@ +class CreateChatRoomParticipations < ActiveRecord::Migration[5.2] + def change + create_table :chat_room_participations do |t| + t.references :user, foreign_key: true + t.references :chat_room, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/migrate/20180829123049_create_requests.rb b/db/migrate/20180829123049_create_requests.rb new file mode 100644 index 0000000..2417469 --- /dev/null +++ b/db/migrate/20180829123049_create_requests.rb @@ -0,0 +1,11 @@ +class CreateRequests < ActiveRecord::Migration[5.2] + def change + create_table :requests do |t| + t.references :user, foreign_key: true + t.references :chat_room, foreign_key: true + t.boolean :accepted + + t.timestamps + end + end +end diff --git a/db/migrate/20180829123204_change_column_in_requests.rb b/db/migrate/20180829123204_change_column_in_requests.rb new file mode 100644 index 0000000..87166c7 --- /dev/null +++ b/db/migrate/20180829123204_change_column_in_requests.rb @@ -0,0 +1,5 @@ +class ChangeColumnInRequests < ActiveRecord::Migration[5.2] + def change + change_column :requests, :accepted, :boolean, default: false + end +end diff --git a/db/schema.rb b/db/schema.rb index cc819c1..e915a1a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,11 +10,25 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_08_27_151325) do +ActiveRecord::Schema.define(version: 2018_08_29_123204) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" + create_table "chat_room_participations", force: :cascade do |t| + t.bigint "user_id" + t.bigint "chat_room_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["chat_room_id"], name: "index_chat_room_participations_on_chat_room_id" + t.index ["user_id"], name: "index_chat_room_participations_on_user_id" + end + + create_table "chat_rooms", force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "connections", force: :cascade do |t| t.bigint "user_id" t.bigint "contact_id" @@ -22,6 +36,16 @@ ActiveRecord::Schema.define(version: 2018_08_27_151325) do t.index ["user_id"], name: "index_connections_on_user_id" end + create_table "requests", force: :cascade do |t| + t.bigint "user_id" + t.bigint "chat_room_id" + t.boolean "accepted", default: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["chat_room_id"], name: "index_requests_on_chat_room_id" + t.index ["user_id"], name: "index_requests_on_user_id" + end + create_table "users", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false @@ -34,6 +58,10 @@ ActiveRecord::Schema.define(version: 2018_08_27_151325) do t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end + add_foreign_key "chat_room_participations", "chat_rooms" + add_foreign_key "chat_room_participations", "users" add_foreign_key "connections", "users" add_foreign_key "connections", "users", column: "contact_id" + add_foreign_key "requests", "chat_rooms" + add_foreign_key "requests", "users" end diff --git a/test/models/chat_room_participation_test.rb b/test/models/chat_room_participation_test.rb new file mode 100644 index 0000000..fd70bc7 --- /dev/null +++ b/test/models/chat_room_participation_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ChatRoomParticipationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/chat_room_test.rb b/test/models/chat_room_test.rb new file mode 100644 index 0000000..c621386 --- /dev/null +++ b/test/models/chat_room_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ChatRoomTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/request_test.rb b/test/models/request_test.rb new file mode 100644 index 0000000..f9f95ba --- /dev/null +++ b/test/models/request_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RequestTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end From 68d55cbcd8477ee4191102b9abfa4a6e1481732e Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Wed, 29 Aug 2018 14:09:12 +0100 Subject: [PATCH 4/8] added chat room controllers --- app/controllers/chat_rooms_controller.rb | 6 ++++++ app/controllers/requests_controller.rb | 8 ++++++++ config/environments/production.rb | 2 +- test/controllers/chat_rooms_controller_test.rb | 7 +++++++ test/controllers/requests_controller_test.rb | 7 +++++++ 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 app/controllers/chat_rooms_controller.rb create mode 100644 app/controllers/requests_controller.rb create mode 100644 test/controllers/chat_rooms_controller_test.rb create mode 100644 test/controllers/requests_controller_test.rb diff --git a/app/controllers/chat_rooms_controller.rb b/app/controllers/chat_rooms_controller.rb new file mode 100644 index 0000000..f011b21 --- /dev/null +++ b/app/controllers/chat_rooms_controller.rb @@ -0,0 +1,6 @@ +class ChatRoomsController < ApplicationController + + def create + + end +end diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb new file mode 100644 index 0000000..d781786 --- /dev/null +++ b/app/controllers/requests_controller.rb @@ -0,0 +1,8 @@ +class RequestsController < ApplicationController + + def update + request.accepted = true + + # Create new Chat Room + end +end diff --git a/config/environments/production.rb b/config/environments/production.rb index c90a719..255da15 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -50,7 +50,7 @@ Rails.application.configure do config.action_cable.allowed_request_origins = [ '*' ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. diff --git a/test/controllers/chat_rooms_controller_test.rb b/test/controllers/chat_rooms_controller_test.rb new file mode 100644 index 0000000..5f545e2 --- /dev/null +++ b/test/controllers/chat_rooms_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ChatRoomsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/requests_controller_test.rb b/test/controllers/requests_controller_test.rb new file mode 100644 index 0000000..309c8e5 --- /dev/null +++ b/test/controllers/requests_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class RequestsControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end From 405d2cd5df9b4bcae21ade74bc5def2b977c61d6 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Thu, 30 Aug 2018 03:00:09 +0100 Subject: [PATCH 5/8] added chatroom channel with room ids and notifications channel --- app/assets/javascripts/signaling-server.js | 7 +- app/assets/stylesheets/pages/_contacts.scss | 4 + app/channels/chat_rooms_channel.rb | 9 + app/channels/notifications_channel.rb | 9 + app/controllers/chat_rooms_controller.rb | 4 + app/controllers/pages_controller.rb | 29 ++ app/javascript/packs/application.js | 1 + app/javascript/packs/chatrooms.js | 37 ++ app/javascript/packs/notifications.js | 38 ++ app/models/chat_room.rb | 2 +- app/models/user.rb | 2 +- app/views/chat_rooms/show.html.erb | 6 + app/views/pages/_contact.html.erb | 30 +- app/views/pages/index.html.erb | 9 +- config/routes.rb | 7 + package.json | 1 + yarn.lock | 529 +++++++++++++++++++- 17 files changed, 699 insertions(+), 25 deletions(-) create mode 100644 app/channels/chat_rooms_channel.rb create mode 100644 app/channels/notifications_channel.rb create mode 100644 app/javascript/packs/chatrooms.js create mode 100644 app/javascript/packs/notifications.js create mode 100644 app/views/chat_rooms/show.html.erb diff --git a/app/assets/javascripts/signaling-server.js b/app/assets/javascripts/signaling-server.js index b77bc6e..d807c8b 100644 --- a/app/assets/javascripts/signaling-server.js +++ b/app/assets/javascripts/signaling-server.js @@ -40,9 +40,14 @@ document.onreadystatechange = async () => { } }; +// find chatroom +const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] const handleJoinSession = async () => { - App.session = await App.cable.subscriptions.create("VideoSessionChannel", { + App.session = await App.cable.subscriptions.create({ + channel: "ChatRoomsChannel", + room: chatroomId + }, { connected: () => { broadcastData({ type: JOIN_ROOM, diff --git a/app/assets/stylesheets/pages/_contacts.scss b/app/assets/stylesheets/pages/_contacts.scss index cb071eb..b1de415 100644 --- a/app/assets/stylesheets/pages/_contacts.scss +++ b/app/assets/stylesheets/pages/_contacts.scss @@ -50,6 +50,10 @@ a:hover { color: $icon; font-size: 25px; } + button { + height: 0; + width: 0; + } } } diff --git a/app/channels/chat_rooms_channel.rb b/app/channels/chat_rooms_channel.rb new file mode 100644 index 0000000..20b3201 --- /dev/null +++ b/app/channels/chat_rooms_channel.rb @@ -0,0 +1,9 @@ +class ChatRoomsChannel < ApplicationCable::Channel + def subscribed + stream_from "chat_room_#{params[:room]}" + end + + def unsubscribed + # Any cleanup needed when channel is unsubscribed + end +end diff --git a/app/channels/notifications_channel.rb b/app/channels/notifications_channel.rb new file mode 100644 index 0000000..ad0ec43 --- /dev/null +++ b/app/channels/notifications_channel.rb @@ -0,0 +1,9 @@ +class NotificationsChannel < ApplicationCable::Channel + def subscribed + stream_from "notifications" + end + + def unsubscribed + # Any cleanup needed when channel is unsubscribed + end +end diff --git a/app/controllers/chat_rooms_controller.rb b/app/controllers/chat_rooms_controller.rb index f011b21..fb9e3cd 100644 --- a/app/controllers/chat_rooms_controller.rb +++ b/app/controllers/chat_rooms_controller.rb @@ -1,5 +1,9 @@ class ChatRoomsController < ApplicationController + def show + @chat_room = ChatRoom.find(params[:id]) + end + def create end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 8aa4a2a..88a7556 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,5 +1,6 @@ class PagesController < ApplicationController # skip_before_action :authenticate_user!, only: [:call] + skip_before_action :verify_authenticity_token def call end @@ -9,4 +10,32 @@ class PagesController < ApplicationController def home end + + def cable_testing + chatroom = 'chat_room_' + params[:chat_room_id] + puts params + ActionCable.server.broadcast(chatroom, { message: 'test' }) + head :ok + end + + def establish_call + head :ok + puts "params: #{params}" + chat_room = ChatRoom.create! + puts "Created chat room with id: #{chat_room.id}" + chat_room_participation = ChatRoomParticipation.create!(chat_room: chat_room, user: current_user) + puts "Created chat room participation with user: #{current_user.email} assigned to chat_room #{chat_room.id}" + puts "Subscribed user to chat room" + + contact = User.find(params[:contact_id]) + request = Request.create!(chat_room: chat_room, user: contact) + puts "Made a request to call #{contact.email}" + ActionCable.server.broadcast('notifications', { + message: { + user_id: contact.id, + chat_room_id: chat_room.id + } + }) + + end end diff --git a/app/javascript/packs/application.js b/app/javascript/packs/application.js index 01dfd79..7eb9154 100644 --- a/app/javascript/packs/application.js +++ b/app/javascript/packs/application.js @@ -1 +1,2 @@ import "bootstrap"; + diff --git a/app/javascript/packs/chatrooms.js b/app/javascript/packs/chatrooms.js new file mode 100644 index 0000000..bd474f1 --- /dev/null +++ b/app/javascript/packs/chatrooms.js @@ -0,0 +1,37 @@ +import ActionCable from 'actioncable' + +// create App object with key cable == new cosumer +(function() { + window.App || (window.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); + +// find chatroom id +const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] + +// create subsciptions +App['chatroom' + chatroomId] = App.cable.subscriptions.create({ + channel: 'ChatRoomsChannel', + room: chatroomId +}, { + connected: () => { + console.log('Connected to ChatRoom ' + chatroomId) + }, + received: data => { + console.log(data) + } +}) + +// Testing ActionCable +const testBtn = document.getElementById('test-btn') +testBtn.addEventListener('click', event => { + fetch(`/chat_rooms/${chatroomId}/cable_testing` , { + method: 'POST', + body: JSON.stringify({}) + }) +}) + + + diff --git a/app/javascript/packs/notifications.js b/app/javascript/packs/notifications.js new file mode 100644 index 0000000..eba1967 --- /dev/null +++ b/app/javascript/packs/notifications.js @@ -0,0 +1,38 @@ +import ActionCable from 'actioncable' + +// create App object with key cable == new cosumer +(function() { + window.App || (window.App = {}); + + App.cable = ActionCable.createConsumer(); + +}).call(this); + + +const userId = parseInt(document.getElementById("my-user-id").dataset["userId"]) + +App.cable.subscriptions.create({ + channel: 'NotificationsChannel' +}, { + connected: () => { + console.log('Connected to NotificationsChannel') + }, + received: data => { + console.log(data["message"]["user_id"]) + console.log(userId) + if (data["message"]["user_id"] === userId) { + console.log("TRIGGER MODAL") + const acceptButton = document.getElementById('accept-button') + acceptButton.style.display = "block" + // const receiveCall = document.getElementById('receive-call') + // receiveCall.dataset.toggle = 'modal' + // receiveCall.dataset.target ='#calleeModal' + // console.log(receiveCall) + + // const calleeModal = document.getElementById('calleeModal') + // calleeModal.modal("show") + + console.log(`user with id: ${userId} needs to subscribe to chatroom ${data["message"]["chat_room_id"]}`) + } + } +}) diff --git a/app/models/chat_room.rb b/app/models/chat_room.rb index 078aced..f4ac46b 100644 --- a/app/models/chat_room.rb +++ b/app/models/chat_room.rb @@ -1,5 +1,5 @@ class ChatRoom < ApplicationRecord - has_many :users, through: :chat_room_participations has_many :chat_room_participations + has_many :users, through: :chat_room_participations has_many :requests end diff --git a/app/models/user.rb b/app/models/user.rb index a084ec6..ab904a2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -5,8 +5,8 @@ class User < ApplicationRecord :recoverable, :rememberable, :validatable has_many :connections - has_many :chat_rooms, through: :chat_room_participations has_many :chat_room_participations + has_many :chat_rooms, through: :chat_room_participations has_many :requests def contacts diff --git a/app/views/chat_rooms/show.html.erb b/app/views/chat_rooms/show.html.erb new file mode 100644 index 0000000..4ad0142 --- /dev/null +++ b/app/views/chat_rooms/show.html.erb @@ -0,0 +1,6 @@ +

This is chatroom #<%= @chat_room.id %>

+
+ + + +<%= javascript_pack_tag 'chatrooms' %> diff --git a/app/views/pages/_contact.html.erb b/app/views/pages/_contact.html.erb index 4c33e80..08f0a36 100644 --- a/app/views/pages/_contact.html.erb +++ b/app/views/pages/_contact.html.erb @@ -1,18 +1,30 @@ +<% +def hello_world + puts "Hello World" +end +%> +
-

FirstName LastName

+ <% if contact.nil? || contact.nil? %> +

<%= contact.email %>

+ <% else %> +

<%= contact.email %>

+ + <% end %>

Last call: <%= Time.now %>

-
- <%= link_to "#", 'data-toggle':"modal", 'data-target':"#myModal" do %> +
+ <%= link_to establish_call_path(contact.id), 'data-toggle':"modal", 'data-target':"#myModal" do %> <% end %>
+ diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 45289dd..3fd6c5e 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -2,8 +2,8 @@

Contacts

- <% 5.times do %> - <%= render "pages/contact" %> + <% current_user.contacts.each do |contact| %> + <%= render "pages/contact", contact: contact %> <% end %>
@@ -14,6 +14,7 @@
+
+<%= javascript_pack_tag 'notifications' %> - - + diff --git a/config/routes.rb b/config/routes.rb index 31cada0..c303b9a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -15,9 +15,16 @@ Rails.application.routes.draw do get '/call', to: 'pages#call' + get '/establish_call/:contact_id', to: 'pages#establish_call', as: 'establish_call' + get '/contacts', to: 'pages#index' post '/sessions', to: 'video_sessions#create' + resources :chat_rooms, only: [ :show ] do + # testing action cable + post '/cable_testing', to: 'pages#cable_testing' + end + mount ActionCable.server, at: '/cable' # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html get '/home', to: 'pages#home' diff --git a/package.json b/package.json index 33c9f0a..4a85cda 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "private": true, "dependencies": { "@rails/webpacker": "3.5", + "actioncable": "^5.2.1", "bootstrap": "3", "jquery": "^3.3.1" }, diff --git a/yarn.lock b/yarn.lock index f8773a2..ec851c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,73 @@ # yarn lockfile v1 +"@google-cloud/speech@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@google-cloud/speech/-/speech-2.0.0.tgz#933b903008ab96de1f0647b9d4a9f5309b6417e9" + dependencies: + extend "^3.0.1" + google-gax "^0.17.0" + google-proto-files "^0.16.0" + lodash.merge "^4.6.1" + protobufjs "^6.8.6" + pumpify "^1.5.1" + stream-events "^1.0.4" + through2 "^2.0.3" + +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.0.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz#53f349bb986ab273d601175aa1b25a655ab90ee3" + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + "@rails/webpacker@3.5": version "3.5.5" resolved "https://registry.yarnpkg.com/@rails/webpacker/-/webpacker-3.5.5.tgz#8911c66bcefc8bc6b91270e92f0d39e3c2d43116" @@ -32,6 +99,14 @@ webpack "^3.12.0" webpack-manifest-plugin "^1.3.2" +"@types/long@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" + +"@types/node@^10.1.0": + version "10.9.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.3.tgz#85f288502503ade0b3bfc049fe1777b05d0327d5" + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -49,6 +124,10 @@ acorn-dynamic-import@^2.0.0: dependencies: acorn "^4.0.3" +acorn-es7-plugin@^1.0.12: + version "1.1.7" + resolved "https://registry.yarnpkg.com/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz#f2ee1f3228a90eead1245f9ab1922eb2e71d336b" + acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" @@ -57,6 +136,10 @@ acorn@^5.0.0: version "5.7.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.2.tgz#91fa871883485d06708800318404e72bfb26dcc5" +actioncable@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/actioncable/-/actioncable-5.2.1.tgz#615428a8a302cec55117d9049f0fd7952011c962" + ajv-keywords@^3.1.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" @@ -159,6 +242,10 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -196,6 +283,17 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" +arrify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +ascli@~1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" + dependencies: + colour "~0.7.1" + optjs "~3.2.2" + asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -280,6 +378,13 @@ aws4@^1.6.0, aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" +axios@^0.18.0: + version "0.18.0" + resolved "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" + dependencies: + follow-redirects "^1.3.0" + is-buffer "^1.1.5" + babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -980,6 +1085,10 @@ browserslist@^3.2.6: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -1008,6 +1117,12 @@ builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" +bytebuffer@~5: + version "5.0.1" + resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" + dependencies: + long "~3" + bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -1044,6 +1159,14 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + +call-signature@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/call-signature/-/call-signature-0.0.2.tgz#a84abc825a55ef4cb2b028bd74e205a65b9a4996" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1055,7 +1178,7 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0: +camelcase@^2.0.0, camelcase@^2.0.1: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1179,7 +1302,7 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^3.2.0: +cliui@^3.0.3, cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" dependencies: @@ -1282,6 +1405,10 @@ colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +colour@~0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" + combined-stream@1.0.6, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" @@ -1394,7 +1521,7 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-js@^2.4.0, core-js@^2.5.0: +core-js@^2.0.0, core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -1697,6 +1824,10 @@ detect-node@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" +diff-match-patch@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.1.tgz#d5f880213d82fbc124d2b95111fb3c033dbad7fa" + diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -1705,6 +1836,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" + dependencies: + arrify "^1.0.1" + path-type "^3.0.0" + dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -1735,6 +1873,10 @@ duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -1742,6 +1884,12 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecdsa-sig-formatter@1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz#1c595000f04a8897dfb85000892a0f4c33af86c3" + dependencies: + safe-buffer "^5.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -1766,6 +1914,20 @@ emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" +empower-core@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/empower-core/-/empower-core-1.2.0.tgz#ce3fb2484d5187fa29c23fba8344b0b2fdf5601c" + dependencies: + call-signature "0.0.2" + core-js "^2.0.0" + +empower@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/empower/-/empower-1.3.0.tgz#6b05e77625e77dc44945c4328562c3020b01fa4b" + dependencies: + core-js "^2.0.0" + empower-core "^1.2.0" + encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -1893,13 +2055,19 @@ esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" +espurify@^1.6.0: + version "1.8.1" + resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.8.1.tgz#5746c6c1ab42d302de10bd1d5bf7f0e8c0515056" + dependencies: + core-js "^2.0.0" + esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" -estraverse@^4.1.0, estraverse@^4.1.1: +estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -2023,7 +2191,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@~3.0.1, extend@~3.0.2: +extend@^3.0.1, extend@~3.0.1, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -2071,6 +2239,17 @@ fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" +fast-glob@^2.0.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.2.tgz#71723338ac9b4e0e2fff1d6748a2a13d5ed352bf" + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.0.1" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.1" + micromatch "^3.1.10" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -2165,7 +2344,7 @@ flush-write-stream@^1.0.0: inherits "^2.0.1" readable-stream "^2.0.4" -follow-redirects@^1.0.0: +follow-redirects@^1.0.0, follow-redirects@^1.3.0: version "1.5.7" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.7.tgz#a39e4804dacb90202bca76a9e2ac10433ca6a69a" dependencies: @@ -2292,6 +2471,14 @@ gaze@^1.0.0: dependencies: globule "^1.0.0" +gcp-metadata@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-0.6.3.tgz#4550c08859c528b370459bd77a7187ea0bdbc4ab" + dependencies: + axios "^0.18.0" + extend "^3.0.1" + retry-axios "0.3.2" + get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -2334,6 +2521,10 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" @@ -2359,6 +2550,18 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globby@^8.0.0, globby@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" + dependencies: + array-union "^1.0.1" + dir-glob "^2.0.0" + fast-glob "^2.0.2" + glob "^7.1.2" + ignore "^3.3.5" + pify "^3.0.0" + slash "^1.0.0" + globule@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" @@ -2367,10 +2570,72 @@ globule@^1.0.0: lodash "~4.17.10" minimatch "~3.0.2" +google-auth-library@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-1.6.1.tgz#9c73d831ad720c0c3048ab89d0ffdec714d07dd2" + dependencies: + axios "^0.18.0" + gcp-metadata "^0.6.3" + gtoken "^2.3.0" + jws "^3.1.5" + lodash.isstring "^4.0.1" + lru-cache "^4.1.3" + retry-axios "^0.3.2" + +google-gax@^0.17.0: + version "0.17.1" + resolved "https://registry.yarnpkg.com/google-gax/-/google-gax-0.17.1.tgz#825ead4ab68f1cb3a702ed0a6c64d7ac9b882747" + dependencies: + duplexify "^3.6.0" + extend "^3.0.1" + globby "^8.0.1" + google-auth-library "^1.6.1" + google-proto-files "^0.16.0" + grpc "^1.12.2" + is-stream-ended "^0.1.4" + lodash "^4.17.10" + protobufjs "^6.8.6" + retry-request "^4.0.0" + through2 "^2.0.3" + +google-p12-pem@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-1.0.2.tgz#c8a3843504012283a0dbffc7430b7c753ecd4b07" + dependencies: + node-forge "^0.7.4" + pify "^3.0.0" + +google-proto-files@^0.16.0: + version "0.16.1" + resolved "https://registry.yarnpkg.com/google-proto-files/-/google-proto-files-0.16.1.tgz#e422e4c0cfd65c481b63f3c0e0cca03ba9cd97ce" + dependencies: + globby "^8.0.0" + power-assert "^1.4.4" + protobufjs "^6.8.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" +grpc@^1.12.2: + version "1.14.1" + resolved "https://registry.yarnpkg.com/grpc/-/grpc-1.14.1.tgz#42d5900fd13a0daca1a58155cd4ab4d0c2f9c716" + dependencies: + lodash "^4.17.5" + nan "^2.0.0" + node-pre-gyp "^0.10.0" + protobufjs "^5.0.3" + +gtoken@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-2.3.0.tgz#4e0ffc16432d7041a1b3dbc1d97aac17a5dc964a" + dependencies: + axios "^0.18.0" + google-p12-pem "^1.0.0" + jws "^3.1.4" + mime "^2.2.0" + pify "^3.0.0" + handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" @@ -2587,6 +2852,10 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" +ignore@^3.3.5: + version "3.3.10" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" + import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -2873,6 +3142,10 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" +is-stream-ended@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-stream-ended/-/is-stream-ended-0.1.4.tgz#f50224e95e06bce0e356d440a4827cd35b267eda" + is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -3018,6 +3291,21 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +jwa@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.1.6.tgz#87240e76c9808dbde18783cf2264ef4929ee50e6" + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.10" + safe-buffer "^5.0.1" + +jws@^3.1.4, jws@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.1.5.tgz#80d12d05b293d1e841e7cb8b4e69e561adcf834f" + dependencies: + jwa "^1.1.5" + safe-buffer "^5.0.1" + killable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz#da8b84bd47de5395878f95d64d02f2449fe05e6b" @@ -3123,10 +3411,18 @@ lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" +lodash.isstring@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" +lodash.merge@^4.6.1: + version "4.6.1" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" + lodash.mergewith@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" @@ -3152,7 +3448,7 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@~4.17.10: +"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.10: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -3160,6 +3456,14 @@ loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + +long@~3: + version "3.2.0" + resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" + longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -3177,7 +3481,7 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lru-cache@^4.0.1, lru-cache@^4.1.1: +lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: @@ -3255,6 +3559,10 @@ merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" +merge2@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.2.tgz#03212e3da8d86c4d8523cebd6318193414f94e34" + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -3277,7 +3585,7 @@ micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.4: +micromatch@^3.1.10, micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: @@ -3320,6 +3628,10 @@ mime@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mime@^2.2.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" + mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -3420,7 +3732,7 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" -nan@^2.10.0, nan@^2.9.2: +nan@^2.0.0, nan@^2.10.0, nan@^2.9.2: version "2.11.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" @@ -3464,6 +3776,10 @@ node-forge@0.7.5: version "0.7.5" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" +node-forge@^0.7.4: + version "0.7.6" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.6.tgz#fdf3b418aee1f94f0ef642cd63486c77ca9724ac" + node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -3643,7 +3959,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.12: +object-keys@^1.0.0, object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -3703,6 +4019,10 @@ optimize-css-assets-webpack-plugin@^3.2.0: cssnano "^3.4.0" last-call-webpack-plugin "^2.1.2" +optjs@~3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" + original@>=0.0.5: version "1.0.2" resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" @@ -3874,6 +4194,12 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + dependencies: + pify "^3.0.0" + pbkdf2@^3.0.3: version "3.0.16" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" @@ -4437,6 +4763,94 @@ postcss@^6.0, postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.14, source-map "^0.6.1" supports-color "^5.4.0" +power-assert-context-formatter@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz#8fbe72692288ec5a7203cdf215c8b838a6061d2a" + dependencies: + core-js "^2.0.0" + power-assert-context-traversal "^1.2.0" + +power-assert-context-reducer-ast@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz#c7ca1c9e39a6fb717f7ac5fe9e76e192bf525df3" + dependencies: + acorn "^5.0.0" + acorn-es7-plugin "^1.0.12" + core-js "^2.0.0" + espurify "^1.6.0" + estraverse "^4.2.0" + +power-assert-context-traversal@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz#f6e71454baf640de5c1c9c270349f5c9ab0b2e94" + dependencies: + core-js "^2.0.0" + estraverse "^4.1.0" + +power-assert-formatter@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz#5dc125ed50a3dfb1dda26c19347f3bf58ec2884a" + dependencies: + core-js "^2.0.0" + power-assert-context-formatter "^1.0.7" + power-assert-context-reducer-ast "^1.0.7" + power-assert-renderer-assertion "^1.0.7" + power-assert-renderer-comparison "^1.0.7" + power-assert-renderer-diagram "^1.0.7" + power-assert-renderer-file "^1.0.7" + +power-assert-renderer-assertion@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz#3db6ffcda106b37bc1e06432ad0d748a682b147a" + dependencies: + power-assert-renderer-base "^1.1.1" + power-assert-util-string-width "^1.2.0" + +power-assert-renderer-base@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz#96a650c6fd05ee1bc1f66b54ad61442c8b3f63eb" + +power-assert-renderer-comparison@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz#e4f88113225a69be8aa586ead05aef99462c0495" + dependencies: + core-js "^2.0.0" + diff-match-patch "^1.0.0" + power-assert-renderer-base "^1.1.1" + stringifier "^1.3.0" + type-name "^2.0.1" + +power-assert-renderer-diagram@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz#37f66e8542e5677c5b58e6d72b01c0d9a30e2219" + dependencies: + core-js "^2.0.0" + power-assert-renderer-base "^1.1.1" + power-assert-util-string-width "^1.2.0" + stringifier "^1.3.0" + +power-assert-renderer-file@^1.0.7: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz#3f4bebd9e1455d75cf2ac541e7bb515a87d4ce4b" + dependencies: + power-assert-renderer-base "^1.1.1" + +power-assert-util-string-width@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz#6e06d5e3581bb876c5d377c53109fffa95bd91a0" + dependencies: + eastasianwidth "^0.2.0" + +power-assert@^1.4.4: + version "1.6.0" + resolved "https://registry.yarnpkg.com/power-assert/-/power-assert-1.6.0.tgz#3a9d2b943cf0d6fc6a623766869c4460838c05fb" + dependencies: + define-properties "^1.1.2" + empower "^1.3.0" + power-assert-formatter "^1.4.1" + universal-deep-strict-equal "^1.2.1" + xtend "^4.0.0" + prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -4461,6 +4875,33 @@ promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" +protobufjs@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" + dependencies: + ascli "~1" + bytebuffer "~5" + glob "^7.0.5" + yargs "^3.10.0" + +protobufjs@^6.8.0, protobufjs@^6.8.6: + version "6.8.8" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.0" + "@types/node" "^10.1.0" + long "^4.0.0" + proxy-addr@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" @@ -4497,7 +4938,7 @@ pump@^2.0.0, pump@^2.0.1: end-of-stream "^1.1.0" once "^1.3.1" -pumpify@^1.3.3: +pumpify@^1.3.3, pumpify@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" dependencies: @@ -4843,6 +5284,16 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" +retry-axios@0.3.2, retry-axios@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/retry-axios/-/retry-axios-0.3.2.tgz#5757c80f585b4cc4c4986aa2ffd47a60c6d35e13" + +retry-request@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-4.0.0.tgz#5c366166279b3e10e9d7aa13274467a05cb69290" + dependencies: + through2 "^2.0.0" + rgb-hex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rgb-hex/-/rgb-hex-2.1.0.tgz#c773c5fe2268a25578d92539a82a7a5ce53beda6" @@ -5275,6 +5726,12 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" +stream-events@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.4.tgz#73bfd4007b8f677b46ec699f14e9e2304c2f0a9e" + dependencies: + stubs "^3.0.0" + stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" @@ -5314,6 +5771,14 @@ string_decoder@^1.0.0, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +stringifier@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/stringifier/-/stringifier-1.4.0.tgz#d704581567f4526265d00ed8ecb354a02c3fec28" + dependencies: + core-js "^2.0.0" + traverse "^0.6.6" + type-name "^2.0.1" + strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -5350,6 +5815,10 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" +stubs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" + style-loader@^0.21.0: version "0.21.0" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.21.0.tgz#68c52e5eb2afc9ca92b6274be277ee59aea3a852" @@ -5415,7 +5884,7 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -through2@^2.0.0: +through2@^2.0.0, through2@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -5479,6 +5948,10 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" +traverse@^0.6.6: + version "0.6.6" + resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -5514,6 +5987,10 @@ type-is@~1.6.15, type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" +type-name@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/type-name/-/type-name-2.0.2.tgz#efe7d4123d8ac52afff7f40c7e4dec5266008fb4" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -5595,6 +6072,14 @@ units-css@^0.4.0: isnumeric "^0.2.0" viewport-dimensions "^0.2.0" +universal-deep-strict-equal@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz#0da4ac2f73cff7924c81fa4de018ca562ca2b0a7" + dependencies: + array-filter "^1.0.0" + indexof "0.0.1" + object-keys "^1.0.0" + unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -5831,6 +6316,10 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +window-size@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" @@ -5856,7 +6345,7 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.1: +y18n@^3.2.0, y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -5908,6 +6397,18 @@ yargs@6.6.0: y18n "^3.2.1" yargs-parser "^4.2.0" +yargs@^3.10.0: + version "3.32.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" + dependencies: + camelcase "^2.0.1" + cliui "^3.0.3" + decamelize "^1.1.1" + os-locale "^1.4.0" + string-width "^1.0.1" + window-size "^0.1.4" + y18n "^3.2.0" + yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" From 5245f2257d3c88fa3db5032676cbdf47caf07a49 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Thu, 30 Aug 2018 14:18:26 +0100 Subject: [PATCH 6/8] created rooms and redirects users to correct room --- app/controllers/pages_controller.rb | 31 ++ app/controllers/requests_controller.rb | 3 +- app/javascript/packs/notifications.js | 28 +- app/views/pages/index.html.erb | 8 +- config/routes.rb | 4 + yarn.lock | 525 +------------------------ 6 files changed, 80 insertions(+), 519 deletions(-) diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 88a7556..efd5757 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -38,4 +38,35 @@ class PagesController < ApplicationController }) end + + def accept_call + puts "-----------------------------------------" + puts params + puts "IT WORKED" + chat_room = ChatRoom.find(params[:chat_room_id]) + request = Request.where("user_id = ? AND chat_room_id = ?", current_user.id, chat_room.id) + + request[0].accepted = true + puts "create new chat room participation" + chat_room_participation = ChatRoomParticipation.create!(chat_room: chat_room, user: current_user) + puts "Created chat room participation with user: #{current_user.email} assigned to chat_room #{chat_room.id}" + + other_caller = chat_room.users.find { |u| u != current_user } # remember to update this later + puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>..HHHHHHHHH" + puts other_caller + puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>..HHHHHHHHH" + # redirect caller to chat room + ActionCable.server.broadcast('notifications', { + head: 302, # redirection code, just to make it clear what you're doing + path: chat_room_path(chat_room), # you'll need to use url_helpers, so include them in your file + body: { caller: other_caller.id } + } + # other_caller, # or however you identify your subscriber + ) + # redirect callee to chat room + redirect_to chat_room_path(chat_room) + # broadcast another message to caller + # head: 302 + + end end diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index d781786..ccb6cb8 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -1,7 +1,6 @@ class RequestsController < ApplicationController - def update - request.accepted = true + def accept # Create new Chat Room end diff --git a/app/javascript/packs/notifications.js b/app/javascript/packs/notifications.js index eba1967..cff3892 100644 --- a/app/javascript/packs/notifications.js +++ b/app/javascript/packs/notifications.js @@ -10,6 +10,8 @@ import ActionCable from 'actioncable' const userId = parseInt(document.getElementById("my-user-id").dataset["userId"]) +let chatRoomId = null + App.cable.subscriptions.create({ channel: 'NotificationsChannel' @@ -18,9 +20,13 @@ App.cable.subscriptions.create({ console.log('Connected to NotificationsChannel') }, received: data => { - console.log(data["message"]["user_id"]) - console.log(userId) - if (data["message"]["user_id"] === userId) { + // console.log(data["message"]["user_id"]) + // console.log(userId) + console.log("received broadcast") + // console.log(data.body) + if (data.head === 302 && data.body["caller"] === userId && data.path ) { + window.location.pathname = data.path + } else if (data["message"]["user_id"] === userId) { console.log("TRIGGER MODAL") const acceptButton = document.getElementById('accept-button') acceptButton.style.display = "block" @@ -31,8 +37,20 @@ App.cable.subscriptions.create({ // const calleeModal = document.getElementById('calleeModal') // calleeModal.modal("show") - - console.log(`user with id: ${userId} needs to subscribe to chatroom ${data["message"]["chat_room_id"]}`) + chatRoomId = data["message"]["chat_room_id"] + console.log(`user with id: ${userId} needs to subscribe to chatroom ${[chatRoomId]}`) + } else { + console.log(data) } + + } }) + + +const acceptButton = document.getElementById('accept-button') + +acceptButton.addEventListener('click', event => { + // event.preventDefault() + document.getElementById('chat-room-id').value = chatRoomId +}) diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index 3fd6c5e..a7c5547 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -15,6 +15,12 @@
+ +
+ + +
+ <%= javascript_pack_tag 'notifications' %> - + diff --git a/config/routes.rb b/config/routes.rb index c303b9a..2f9eca8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -17,6 +17,10 @@ Rails.application.routes.draw do get '/establish_call/:contact_id', to: 'pages#establish_call', as: 'establish_call' + post '/accept_call', to: 'pages#accept_call', as: 'accept_call/' + + patch '/accept_call/:request_id', to: 'requests#update', as: 'update_request' + get '/contacts', to: 'pages#index' post '/sessions', to: 'video_sessions#create' diff --git a/yarn.lock b/yarn.lock index ec851c1..907dbe7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,73 +2,6 @@ # yarn lockfile v1 -"@google-cloud/speech@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@google-cloud/speech/-/speech-2.0.0.tgz#933b903008ab96de1f0647b9d4a9f5309b6417e9" - dependencies: - extend "^3.0.1" - google-gax "^0.17.0" - google-proto-files "^0.16.0" - lodash.merge "^4.6.1" - protobufjs "^6.8.6" - pumpify "^1.5.1" - stream-events "^1.0.4" - through2 "^2.0.3" - -"@mrmlnc/readdir-enhanced@^2.2.1": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" - dependencies: - call-me-maybe "^1.0.1" - glob-to-regexp "^0.3.0" - -"@nodelib/fs.stat@^1.0.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.1.tgz#53f349bb986ab273d601175aa1b25a655ab90ee3" - -"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" - -"@protobufjs/base64@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" - -"@protobufjs/codegen@^2.0.4": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" - -"@protobufjs/eventemitter@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" - -"@protobufjs/fetch@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" - dependencies: - "@protobufjs/aspromise" "^1.1.1" - "@protobufjs/inquire" "^1.1.0" - -"@protobufjs/float@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" - -"@protobufjs/inquire@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" - -"@protobufjs/path@^1.1.2": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" - -"@protobufjs/pool@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" - -"@protobufjs/utf8@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" - "@rails/webpacker@3.5": version "3.5.5" resolved "https://registry.yarnpkg.com/@rails/webpacker/-/webpacker-3.5.5.tgz#8911c66bcefc8bc6b91270e92f0d39e3c2d43116" @@ -99,14 +32,6 @@ webpack "^3.12.0" webpack-manifest-plugin "^1.3.2" -"@types/long@^4.0.0": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" - -"@types/node@^10.1.0": - version "10.9.3" - resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.3.tgz#85f288502503ade0b3bfc049fe1777b05d0327d5" - abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -124,10 +49,6 @@ acorn-dynamic-import@^2.0.0: dependencies: acorn "^4.0.3" -acorn-es7-plugin@^1.0.12: - version "1.1.7" - resolved "https://registry.yarnpkg.com/acorn-es7-plugin/-/acorn-es7-plugin-1.1.7.tgz#f2ee1f3228a90eead1245f9ab1922eb2e71d336b" - acorn@^4.0.3: version "4.0.13" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" @@ -242,10 +163,6 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" -array-filter@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" - array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -283,17 +200,6 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -ascli@~1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/ascli/-/ascli-1.0.1.tgz#bcfa5974a62f18e81cabaeb49732ab4a88f906bc" - dependencies: - colour "~0.7.1" - optjs "~3.2.2" - asn1.js@^4.0.0: version "4.10.1" resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.10.1.tgz#b9c2bf5805f1e64aadeed6df3a2bfafb5a73f5a0" @@ -378,13 +284,6 @@ aws4@^1.6.0, aws4@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" -axios@^0.18.0: - version "0.18.0" - resolved "http://registry.npmjs.org/axios/-/axios-0.18.0.tgz#32d53e4851efdc0a11993b6cd000789d70c05102" - dependencies: - follow-redirects "^1.3.0" - is-buffer "^1.1.5" - babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -1085,10 +984,6 @@ browserslist@^3.2.6: caniuse-lite "^1.0.30000844" electron-to-chromium "^1.3.47" -buffer-equal-constant-time@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" - buffer-from@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" @@ -1117,12 +1012,6 @@ builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" -bytebuffer@~5: - version "5.0.1" - resolved "https://registry.yarnpkg.com/bytebuffer/-/bytebuffer-5.0.1.tgz#582eea4b1a873b6d020a48d58df85f0bba6cfddd" - dependencies: - long "~3" - bytes@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048" @@ -1159,14 +1048,6 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" -call-me-maybe@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" - -call-signature@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/call-signature/-/call-signature-0.0.2.tgz#a84abc825a55ef4cb2b028bd74e205a65b9a4996" - camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1178,7 +1059,7 @@ camelcase@^1.0.2: version "1.2.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" -camelcase@^2.0.0, camelcase@^2.0.1: +camelcase@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" @@ -1302,7 +1183,7 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" -cliui@^3.0.3, cliui@^3.2.0: +cliui@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" dependencies: @@ -1405,10 +1286,6 @@ colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" -colour@~0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/colour/-/colour-0.7.1.tgz#9cb169917ec5d12c0736d3e8685746df1cadf778" - combined-stream@1.0.6, combined-stream@~1.0.5, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" @@ -1521,7 +1398,7 @@ copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" -core-js@^2.0.0, core-js@^2.4.0, core-js@^2.5.0: +core-js@^2.4.0, core-js@^2.5.0: version "2.5.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" @@ -1824,10 +1701,6 @@ detect-node@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.3.tgz#a2033c09cc8e158d37748fbde7507832bd6ce127" -diff-match-patch@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/diff-match-patch/-/diff-match-patch-1.0.1.tgz#d5f880213d82fbc124d2b95111fb3c033dbad7fa" - diffie-hellman@^5.0.0: version "5.0.3" resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.3.tgz#40e8ee98f55a2149607146921c63e1ae5f3d2875" @@ -1836,13 +1709,6 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" -dir-glob@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.0.0.tgz#0b205d2b6aef98238ca286598a8204d29d0a0034" - dependencies: - arrify "^1.0.1" - path-type "^3.0.0" - dns-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d" @@ -1873,10 +1739,6 @@ duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" -eastasianwidth@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -1884,12 +1746,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -ecdsa-sig-formatter@1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz#1c595000f04a8897dfb85000892a0f4c33af86c3" - dependencies: - safe-buffer "^5.0.1" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -1914,20 +1770,6 @@ emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" -empower-core@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/empower-core/-/empower-core-1.2.0.tgz#ce3fb2484d5187fa29c23fba8344b0b2fdf5601c" - dependencies: - call-signature "0.0.2" - core-js "^2.0.0" - -empower@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/empower/-/empower-1.3.0.tgz#6b05e77625e77dc44945c4328562c3020b01fa4b" - dependencies: - core-js "^2.0.0" - empower-core "^1.2.0" - encodeurl@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" @@ -2055,19 +1897,13 @@ esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" -espurify@^1.6.0: - version "1.8.1" - resolved "https://registry.yarnpkg.com/espurify/-/espurify-1.8.1.tgz#5746c6c1ab42d302de10bd1d5bf7f0e8c0515056" - dependencies: - core-js "^2.0.0" - esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" dependencies: estraverse "^4.1.0" -estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -2191,7 +2027,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.1, extend@~3.0.1, extend@~3.0.2: +extend@~3.0.1, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -2239,17 +2075,6 @@ fast-deep-equal@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" -fast-glob@^2.0.2: - version "2.2.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.2.tgz#71723338ac9b4e0e2fff1d6748a2a13d5ed352bf" - dependencies: - "@mrmlnc/readdir-enhanced" "^2.2.1" - "@nodelib/fs.stat" "^1.0.1" - glob-parent "^3.1.0" - is-glob "^4.0.0" - merge2 "^1.2.1" - micromatch "^3.1.10" - fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -2344,7 +2169,7 @@ flush-write-stream@^1.0.0: inherits "^2.0.1" readable-stream "^2.0.4" -follow-redirects@^1.0.0, follow-redirects@^1.3.0: +follow-redirects@^1.0.0: version "1.5.7" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.7.tgz#a39e4804dacb90202bca76a9e2ac10433ca6a69a" dependencies: @@ -2471,14 +2296,6 @@ gaze@^1.0.0: dependencies: globule "^1.0.0" -gcp-metadata@^0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-0.6.3.tgz#4550c08859c528b370459bd77a7187ea0bdbc4ab" - dependencies: - axios "^0.18.0" - extend "^3.0.1" - retry-axios "0.3.2" - get-caller-file@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" @@ -2521,10 +2338,6 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-to-regexp@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" - glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2, glob@~7.1.1: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" @@ -2550,18 +2363,6 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" -globby@^8.0.0, globby@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.1.tgz#b5ad48b8aa80b35b814fc1281ecc851f1d2b5b50" - dependencies: - array-union "^1.0.1" - dir-glob "^2.0.0" - fast-glob "^2.0.2" - glob "^7.1.2" - ignore "^3.3.5" - pify "^3.0.0" - slash "^1.0.0" - globule@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d" @@ -2570,72 +2371,10 @@ globule@^1.0.0: lodash "~4.17.10" minimatch "~3.0.2" -google-auth-library@^1.6.1: - version "1.6.1" - resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-1.6.1.tgz#9c73d831ad720c0c3048ab89d0ffdec714d07dd2" - dependencies: - axios "^0.18.0" - gcp-metadata "^0.6.3" - gtoken "^2.3.0" - jws "^3.1.5" - lodash.isstring "^4.0.1" - lru-cache "^4.1.3" - retry-axios "^0.3.2" - -google-gax@^0.17.0: - version "0.17.1" - resolved "https://registry.yarnpkg.com/google-gax/-/google-gax-0.17.1.tgz#825ead4ab68f1cb3a702ed0a6c64d7ac9b882747" - dependencies: - duplexify "^3.6.0" - extend "^3.0.1" - globby "^8.0.1" - google-auth-library "^1.6.1" - google-proto-files "^0.16.0" - grpc "^1.12.2" - is-stream-ended "^0.1.4" - lodash "^4.17.10" - protobufjs "^6.8.6" - retry-request "^4.0.0" - through2 "^2.0.3" - -google-p12-pem@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-1.0.2.tgz#c8a3843504012283a0dbffc7430b7c753ecd4b07" - dependencies: - node-forge "^0.7.4" - pify "^3.0.0" - -google-proto-files@^0.16.0: - version "0.16.1" - resolved "https://registry.yarnpkg.com/google-proto-files/-/google-proto-files-0.16.1.tgz#e422e4c0cfd65c481b63f3c0e0cca03ba9cd97ce" - dependencies: - globby "^8.0.0" - power-assert "^1.4.4" - protobufjs "^6.8.0" - graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -grpc@^1.12.2: - version "1.14.1" - resolved "https://registry.yarnpkg.com/grpc/-/grpc-1.14.1.tgz#42d5900fd13a0daca1a58155cd4ab4d0c2f9c716" - dependencies: - lodash "^4.17.5" - nan "^2.0.0" - node-pre-gyp "^0.10.0" - protobufjs "^5.0.3" - -gtoken@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-2.3.0.tgz#4e0ffc16432d7041a1b3dbc1d97aac17a5dc964a" - dependencies: - axios "^0.18.0" - google-p12-pem "^1.0.0" - jws "^3.1.4" - mime "^2.2.0" - pify "^3.0.0" - handle-thing@^1.2.5: version "1.2.5" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" @@ -2852,10 +2591,6 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.3.5: - version "3.3.10" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" - import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -3142,10 +2877,6 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-stream-ended@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/is-stream-ended/-/is-stream-ended-0.1.4.tgz#f50224e95e06bce0e356d440a4827cd35b267eda" - is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -3291,21 +3022,6 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -jwa@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.1.6.tgz#87240e76c9808dbde18783cf2264ef4929ee50e6" - dependencies: - buffer-equal-constant-time "1.0.1" - ecdsa-sig-formatter "1.0.10" - safe-buffer "^5.0.1" - -jws@^3.1.4, jws@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/jws/-/jws-3.1.5.tgz#80d12d05b293d1e841e7cb8b4e69e561adcf834f" - dependencies: - jwa "^1.1.5" - safe-buffer "^5.0.1" - killable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.0.tgz#da8b84bd47de5395878f95d64d02f2449fe05e6b" @@ -3411,18 +3127,10 @@ lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" -lodash.merge@^4.6.1: - version "4.6.1" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.1.tgz#adc25d9cb99b9391c59624f379fbba60d7111d54" - lodash.mergewith@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" @@ -3448,7 +3156,7 @@ lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" -"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.17.5, lodash@~4.17.10: +"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.2, lodash@^4.17.4, lodash@~4.17.10: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -3456,14 +3164,6 @@ loglevel@^1.4.1: version "1.6.1" resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa" -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - -long@~3: - version "3.2.0" - resolved "https://registry.yarnpkg.com/long/-/long-3.2.0.tgz#d821b7138ca1cb581c172990ef14db200b5c474b" - longest@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -3481,7 +3181,7 @@ loud-rejection@^1.0.0: currently-unhandled "^0.4.1" signal-exit "^3.0.0" -lru-cache@^4.0.1, lru-cache@^4.1.1, lru-cache@^4.1.3: +lru-cache@^4.0.1, lru-cache@^4.1.1: version "4.1.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c" dependencies: @@ -3559,10 +3259,6 @@ merge-descriptors@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" -merge2@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.2.tgz#03212e3da8d86c4d8523cebd6318193414f94e34" - methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -3585,7 +3281,7 @@ micromatch@^2.3.11: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.10, micromatch@^3.1.4: +micromatch@^3.1.4: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" dependencies: @@ -3628,10 +3324,6 @@ mime@^1.5.0: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" -mime@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.3.1.tgz#b1621c54d63b97c47d3cfe7f7215f7d64517c369" - mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -3732,7 +3424,7 @@ multicast-dns@^6.0.1: dns-packet "^1.3.1" thunky "^1.0.2" -nan@^2.0.0, nan@^2.10.0, nan@^2.9.2: +nan@^2.10.0, nan@^2.9.2: version "2.11.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099" @@ -3776,10 +3468,6 @@ node-forge@0.7.5: version "0.7.5" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.5.tgz#6c152c345ce11c52f465c2abd957e8639cd674df" -node-forge@^0.7.4: - version "0.7.6" - resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.7.6.tgz#fdf3b418aee1f94f0ef642cd63486c77ca9724ac" - node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -3959,7 +3647,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.0, object-keys@^1.0.12: +object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -4019,10 +3707,6 @@ optimize-css-assets-webpack-plugin@^3.2.0: cssnano "^3.4.0" last-call-webpack-plugin "^2.1.2" -optjs@~3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/optjs/-/optjs-3.2.2.tgz#69a6ce89c442a44403141ad2f9b370bd5bb6f4ee" - original@>=0.0.5: version "1.0.2" resolved "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f" @@ -4194,12 +3878,6 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" -path-type@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" - dependencies: - pify "^3.0.0" - pbkdf2@^3.0.3: version "3.0.16" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" @@ -4763,94 +4441,6 @@ postcss@^6.0, postcss@^6.0.0, postcss@^6.0.1, postcss@^6.0.11, postcss@^6.0.14, source-map "^0.6.1" supports-color "^5.4.0" -power-assert-context-formatter@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-context-formatter/-/power-assert-context-formatter-1.2.0.tgz#8fbe72692288ec5a7203cdf215c8b838a6061d2a" - dependencies: - core-js "^2.0.0" - power-assert-context-traversal "^1.2.0" - -power-assert-context-reducer-ast@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-context-reducer-ast/-/power-assert-context-reducer-ast-1.2.0.tgz#c7ca1c9e39a6fb717f7ac5fe9e76e192bf525df3" - dependencies: - acorn "^5.0.0" - acorn-es7-plugin "^1.0.12" - core-js "^2.0.0" - espurify "^1.6.0" - estraverse "^4.2.0" - -power-assert-context-traversal@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-context-traversal/-/power-assert-context-traversal-1.2.0.tgz#f6e71454baf640de5c1c9c270349f5c9ab0b2e94" - dependencies: - core-js "^2.0.0" - estraverse "^4.1.0" - -power-assert-formatter@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/power-assert-formatter/-/power-assert-formatter-1.4.1.tgz#5dc125ed50a3dfb1dda26c19347f3bf58ec2884a" - dependencies: - core-js "^2.0.0" - power-assert-context-formatter "^1.0.7" - power-assert-context-reducer-ast "^1.0.7" - power-assert-renderer-assertion "^1.0.7" - power-assert-renderer-comparison "^1.0.7" - power-assert-renderer-diagram "^1.0.7" - power-assert-renderer-file "^1.0.7" - -power-assert-renderer-assertion@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-renderer-assertion/-/power-assert-renderer-assertion-1.2.0.tgz#3db6ffcda106b37bc1e06432ad0d748a682b147a" - dependencies: - power-assert-renderer-base "^1.1.1" - power-assert-util-string-width "^1.2.0" - -power-assert-renderer-base@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/power-assert-renderer-base/-/power-assert-renderer-base-1.1.1.tgz#96a650c6fd05ee1bc1f66b54ad61442c8b3f63eb" - -power-assert-renderer-comparison@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-renderer-comparison/-/power-assert-renderer-comparison-1.2.0.tgz#e4f88113225a69be8aa586ead05aef99462c0495" - dependencies: - core-js "^2.0.0" - diff-match-patch "^1.0.0" - power-assert-renderer-base "^1.1.1" - stringifier "^1.3.0" - type-name "^2.0.1" - -power-assert-renderer-diagram@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-renderer-diagram/-/power-assert-renderer-diagram-1.2.0.tgz#37f66e8542e5677c5b58e6d72b01c0d9a30e2219" - dependencies: - core-js "^2.0.0" - power-assert-renderer-base "^1.1.1" - power-assert-util-string-width "^1.2.0" - stringifier "^1.3.0" - -power-assert-renderer-file@^1.0.7: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-renderer-file/-/power-assert-renderer-file-1.2.0.tgz#3f4bebd9e1455d75cf2ac541e7bb515a87d4ce4b" - dependencies: - power-assert-renderer-base "^1.1.1" - -power-assert-util-string-width@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/power-assert-util-string-width/-/power-assert-util-string-width-1.2.0.tgz#6e06d5e3581bb876c5d377c53109fffa95bd91a0" - dependencies: - eastasianwidth "^0.2.0" - -power-assert@^1.4.4: - version "1.6.0" - resolved "https://registry.yarnpkg.com/power-assert/-/power-assert-1.6.0.tgz#3a9d2b943cf0d6fc6a623766869c4460838c05fb" - dependencies: - define-properties "^1.1.2" - empower "^1.3.0" - power-assert-formatter "^1.4.1" - universal-deep-strict-equal "^1.2.1" - xtend "^4.0.0" - prepend-http@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" @@ -4875,33 +4465,6 @@ promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" -protobufjs@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-5.0.3.tgz#e4dfe9fb67c90b2630d15868249bcc4961467a17" - dependencies: - ascli "~1" - bytebuffer "~5" - glob "^7.0.5" - yargs "^3.10.0" - -protobufjs@^6.8.0, protobufjs@^6.8.6: - version "6.8.8" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.0" - "@types/node" "^10.1.0" - long "^4.0.0" - proxy-addr@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.4.tgz#ecfc733bf22ff8c6f407fa275327b9ab67e48b93" @@ -4938,7 +4501,7 @@ pump@^2.0.0, pump@^2.0.1: end-of-stream "^1.1.0" once "^1.3.1" -pumpify@^1.3.3, pumpify@^1.5.1: +pumpify@^1.3.3: version "1.5.1" resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.5.1.tgz#36513be246ab27570b1a374a5ce278bfd74370ce" dependencies: @@ -5284,16 +4847,6 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" -retry-axios@0.3.2, retry-axios@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/retry-axios/-/retry-axios-0.3.2.tgz#5757c80f585b4cc4c4986aa2ffd47a60c6d35e13" - -retry-request@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/retry-request/-/retry-request-4.0.0.tgz#5c366166279b3e10e9d7aa13274467a05cb69290" - dependencies: - through2 "^2.0.0" - rgb-hex@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/rgb-hex/-/rgb-hex-2.1.0.tgz#c773c5fe2268a25578d92539a82a7a5ce53beda6" @@ -5726,12 +5279,6 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" -stream-events@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/stream-events/-/stream-events-1.0.4.tgz#73bfd4007b8f677b46ec699f14e9e2304c2f0a9e" - dependencies: - stubs "^3.0.0" - stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" @@ -5771,14 +5318,6 @@ string_decoder@^1.0.0, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -stringifier@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/stringifier/-/stringifier-1.4.0.tgz#d704581567f4526265d00ed8ecb354a02c3fec28" - dependencies: - core-js "^2.0.0" - traverse "^0.6.6" - type-name "^2.0.1" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -5815,10 +5354,6 @@ strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -stubs@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/stubs/-/stubs-3.0.0.tgz#e8d2ba1fa9c90570303c030b6900f7d5f89abe5b" - style-loader@^0.21.0: version "0.21.0" resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-0.21.0.tgz#68c52e5eb2afc9ca92b6274be277ee59aea3a852" @@ -5884,7 +5419,7 @@ tar@^4: safe-buffer "^5.1.2" yallist "^3.0.2" -through2@^2.0.0, through2@^2.0.3: +through2@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" dependencies: @@ -5948,10 +5483,6 @@ tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" -traverse@^0.6.6: - version "0.6.6" - resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" - trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -5987,10 +5518,6 @@ type-is@~1.6.15, type-is@~1.6.16: media-typer "0.3.0" mime-types "~2.1.18" -type-name@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/type-name/-/type-name-2.0.2.tgz#efe7d4123d8ac52afff7f40c7e4dec5266008fb4" - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -6072,14 +5599,6 @@ units-css@^0.4.0: isnumeric "^0.2.0" viewport-dimensions "^0.2.0" -universal-deep-strict-equal@^1.2.1: - version "1.2.2" - resolved "https://registry.yarnpkg.com/universal-deep-strict-equal/-/universal-deep-strict-equal-1.2.2.tgz#0da4ac2f73cff7924c81fa4de018ca562ca2b0a7" - dependencies: - array-filter "^1.0.0" - indexof "0.0.1" - object-keys "^1.0.0" - unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" @@ -6316,10 +5835,6 @@ window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" -window-size@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" - wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" @@ -6345,7 +5860,7 @@ xtend@^4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -y18n@^3.2.0, y18n@^3.2.1: +y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -6397,18 +5912,6 @@ yargs@6.6.0: y18n "^3.2.1" yargs-parser "^4.2.0" -yargs@^3.10.0: - version "3.32.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.32.0.tgz#03088e9ebf9e756b69751611d2a5ef591482c995" - dependencies: - camelcase "^2.0.1" - cliui "^3.0.3" - decamelize "^1.1.1" - os-locale "^1.4.0" - string-width "^1.0.1" - window-size "^0.1.4" - y18n "^3.2.0" - yargs@^7.0.0: version "7.1.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" From c3b072ba383c65d6e7434617a9e6201ed0c9d109 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Thu, 30 Aug 2018 18:42:42 +0100 Subject: [PATCH 7/8] added room id in exchange parameters --- app/assets/javascripts/signaling-server.js | 53 ++++++++++++++++++---- app/controllers/chat_rooms_controller.rb | 14 ++++++ app/javascript/packs/chatrooms.js | 2 - app/views/chat_rooms/show.html.erb | 15 ++++++ app/views/pages/call.html.erb | 4 +- config/routes.rb | 4 +- 6 files changed, 77 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/signaling-server.js b/app/assets/javascripts/signaling-server.js index d807c8b..25db06a 100644 --- a/app/assets/javascripts/signaling-server.js +++ b/app/assets/javascripts/signaling-server.js @@ -17,6 +17,7 @@ let localstream; window.onload = () => { currentUser = document.getElementById("current-user").innerHTML; + console.log(currentUser) localVideo = document.getElementById("local-video"); remoteVideoContainer = document.getElementById("remote-video-container"); }; @@ -41,21 +42,48 @@ document.onreadystatechange = async () => { }; // find chatroom +// const handleJoinSession = async () => { +// App.session = await App.cable.subscriptions.create("VideoSessionChannel", { +// connected: () => { +// broadcastData({ +// type: JOIN_ROOM, +// from: currentUser +// }); +// }, +// received: data => { +// console.log("received", data); +// if (data.from === currentUser) return; +// switch (data.type) { +// case JOIN_ROOM: +// return joinRoom(data); +// case EXCHANGE: +// if (data.to !== currentUser) return; +// return exchange(data); +// case REMOVE_USER: +// return removeUser(data); +// default: +// return; +// } +// } +// }); +// }; const chatroomId = document.getElementById('chatroom-hook').dataset["chatroomId"] const handleJoinSession = async () => { - App.session = await App.cable.subscriptions.create({ + App['chatroom' + chatroomId] = await App.cable.subscriptions.create({ channel: "ChatRoomsChannel", room: chatroomId }, { connected: () => { + console.log(chatroomId) broadcastData({ type: JOIN_ROOM, - from: currentUser + from: currentUser, + room: chatroomId }); }, received: data => { - console.log("received", data); + console.log(data) if (data.from === currentUser) return; switch (data.type) { case JOIN_ROOM: @@ -93,7 +121,6 @@ const joinRoom = data => { }; const removeUser = data => { - console.log("removing user", data.from); let video = document.getElementById(`remoteVideoContainer+${data.from}`); video && video.remove(); delete pcPeers[data.from]; @@ -101,18 +128,21 @@ const removeUser = data => { const broadcastData = data => { - fetch("sessions", { + if (data.type === EXCHANGE) { + console.log("yayyy") + } + fetch("chat_room_sessions", { method: "POST", body: JSON.stringify(data), - headers: { "content-type": "application/json" } + headers: { "content-type": "application/json", "X-CSRF-Token": document.querySelector('meta[name=csrf-token]').content } }); }; const createPC = (userId, isOffer) => { let pc = new RTCPeerConnection(ice); + let test = userId pcPeers[userId] = pc; pc.addStream(localstream); - if (isOffer) { pc .createOffer() @@ -122,7 +152,8 @@ const createPC = (userId, isOffer) => { type: EXCHANGE, from: currentUser, to: userId, - sdp: JSON.stringify(pc.localDescription) + sdp: JSON.stringify(pc.localDescription), + room: chatroomId }); }) .catch(logError); @@ -134,7 +165,8 @@ const createPC = (userId, isOffer) => { type: EXCHANGE, from: currentUser, to: userId, - candidate: JSON.stringify(event.candidate) + candidate: JSON.stringify(event.candidate), + room: chatroomId }); } }; @@ -191,7 +223,8 @@ const exchange = data => { type: EXCHANGE, from: currentUser, to: data.from, - sdp: JSON.stringify(pc.localDescription) + sdp: JSON.stringify(pc.localDescription), + room: chatroomId }); }); } diff --git a/app/controllers/chat_rooms_controller.rb b/app/controllers/chat_rooms_controller.rb index fb9e3cd..37b681c 100644 --- a/app/controllers/chat_rooms_controller.rb +++ b/app/controllers/chat_rooms_controller.rb @@ -5,6 +5,20 @@ class ChatRoomsController < ApplicationController end def create + # HTTP status code 200 with an empty body + head :no_content + puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>11123213213213123213" + puts params + puts ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>11123213213213123213" + ActionCable.server.broadcast "chat_room_#{params[:room]}", session_params + end + + private + + def session_params + # SDP = Session description protocol (codec info from client) + # Candidate = ICE candidates (e.g. TURN and STUN server) + params.permit(:type, :from, :to, :sdp, :candidate, :room) end end diff --git a/app/javascript/packs/chatrooms.js b/app/javascript/packs/chatrooms.js index bd474f1..46b193b 100644 --- a/app/javascript/packs/chatrooms.js +++ b/app/javascript/packs/chatrooms.js @@ -17,10 +17,8 @@ App['chatroom' + chatroomId] = App.cable.subscriptions.create({ room: chatroomId }, { connected: () => { - console.log('Connected to ChatRoom ' + chatroomId) }, received: data => { - console.log(data) } }) diff --git a/app/views/chat_rooms/show.html.erb b/app/views/chat_rooms/show.html.erb index 4ad0142..4f6f6f4 100644 --- a/app/views/chat_rooms/show.html.erb +++ b/app/views/chat_rooms/show.html.erb @@ -1,6 +1,21 @@ + +

This is chatroom #<%= @chat_room.id %>

+
+
+
+ +
+
+
+ +
+ + +
+ <%= javascript_pack_tag 'chatrooms' %> diff --git a/app/views/pages/call.html.erb b/app/views/pages/call.html.erb index 700efaa..9776324 100644 --- a/app/views/pages/call.html.erb +++ b/app/views/pages/call.html.erb @@ -1,5 +1,5 @@ - + diff --git a/config/routes.rb b/config/routes.rb index 2f9eca8..a14a2d7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,5 @@ Rails.application.routes.draw do - get 'video_sessions/create' + devise_for :users, path: '', path_names: { sign_out: 'logout'} devise_scope :user do get '/logout', to: 'devise/sessions#destroy' @@ -24,6 +24,8 @@ Rails.application.routes.draw do get '/contacts', to: 'pages#index' post '/sessions', to: 'video_sessions#create' + post '/chat_rooms/chat_room_sessions', to: 'chat_rooms#create' + resources :chat_rooms, only: [ :show ] do # testing action cable post '/cable_testing', to: 'pages#cable_testing' From cac4846f5fc6ad2f5844745b46eb9f5cd736fc04 Mon Sep 17 00:00:00 2001 From: Beatrice Olivera Date: Thu, 30 Aug 2018 18:59:12 +0100 Subject: [PATCH 8/8] added request origin --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 255da15..b3051b4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -47,7 +47,7 @@ Rails.application.configure do # Mount Action Cable outside main process or domain # config.action_cable.mount_path = nil config.action_cable.url = 'wss://polyglot-173.herokuapp.com/cable' - config.action_cable.allowed_request_origins = [ '*' ] + config.action_cable.allowed_request_origins = [ 'https://polyglot-173.herokuapp.com/' ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. config.force_ssl = true