Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@nextcloud/initial-state": "^1.2.0",
"@nextcloud/l10n": "^1.4.1",
"@nextcloud/moment": "^1.1.1",
"@nextcloud/router": "^1.2.0",
"@nextcloud/router": "^2.0.0",
"@nextcloud/vue": "^3.9.0",
"@nextcloud/vue-dashboard": "^1.1.0",
"attachmediastream": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/AllowedGroups.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default {
searchGroup: debounce(async function(query) {
this.loadingGroups = true
try {
const response = await axios.get(generateOcsUrl('cloud', 2) + 'groups/details', {
const response = await axios.get(generateOcsUrl('cloud/groups/details'), {
search: query,
limit: 20,
offset: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/components/AdminSettings/HostedSignalingServer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export default {
this.requestError = ''
this.loading = true
try {
const res = await axios.post(generateOcsUrl('apps/spreed/api/v1/hostedsignalingserver', 2) + 'requesttrial', {
const res = await axios.post(generateOcsUrl('apps/spreed/api/v1/hostedsignalingserver/requesttrial'), {
url: this.hostedHPBNextcloudUrl,
name: this.hostedHPBFullName,
email: this.hostedHPBEmail,
Expand All @@ -239,7 +239,7 @@ export default {
this.loading = true

try {
await axios.delete(generateOcsUrl('apps/spreed/api/v1/hostedsignalingserver', 2) + 'delete')
await axios.delete(generateOcsUrl('apps/spreed/api/v1/hostedsignalingserver/delete'))

this.trialAccount = []
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings/SIPBridge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default {
searchGroup: debounce(async function(query) {
this.loadingGroups = true
try {
const response = await axios.get(generateOcsUrl('cloud', 2) + 'groups/details', {
const response = await axios.get(generateOcsUrl('cloud/groups/details'), {
search: query,
limit: 20,
offset: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/services/callsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const leaveCall = async function(token) {
}

const fetchPeers = async function(token, options) {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v4', 2) + `call/${token}`, options)
const response = await axios.get(generateOcsUrl('apps/spreed/api/v4/call/{token}', { token }), options)
return response
}

Expand Down
42 changes: 21 additions & 21 deletions src/services/conversationsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ import { CONVERSATION, SHARE } from '../constants'
* Fetches the conversations from the server.
*/
const fetchConversations = async function() {
return axios.get(generateOcsUrl('apps/spreed/api/v4', 2) + 'room')
return axios.get(generateOcsUrl('apps/spreed/api/v4/room'))
}

/**
* Fetches a conversation from the server.
* @param {string} token The token of the conversation to be fetched.
*/
const fetchConversation = async function(token) {
return axios.get(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}`)
return axios.get(generateOcsUrl('apps/spreed/api/v4/room/{token}', { token }))
}

/**
Expand All @@ -45,7 +45,7 @@ const fetchConversation = async function(token) {
* @param {object} options options
*/
const searchListedConversations = async function({ searchText }, options) {
return axios.get(generateOcsUrl('apps/spreed/api/v4', 2) + 'listed-room', Object.assign(options, {
return axios.get(generateOcsUrl('apps/spreed/api/v4/room/listed-room'), Object.assign(options, {
params: {
searchTerm: searchText,
},
Expand Down Expand Up @@ -75,7 +75,7 @@ const searchPossibleConversations = async function({ searchText, token, onlyUser
}
}

return axios.get(generateOcsUrl('core/autocomplete', 2) + `get`, Object.assign(options, {
return axios.get(generateOcsUrl('core/autocomplete/get'), Object.assign(options, {
params: {
search: searchText,
itemType: 'call',
Expand All @@ -91,7 +91,7 @@ const searchPossibleConversations = async function({ searchText, token, onlyUser
*/
const createOneToOneConversation = async function(userId) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room`, { roomType: CONVERSATION.TYPE.ONE_TO_ONE, invite: userId })
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room'), { roomType: CONVERSATION.TYPE.ONE_TO_ONE, invite: userId })
return response
} catch (error) {
console.debug('Error creating new one to one conversation: ', error)
Expand All @@ -105,7 +105,7 @@ const createOneToOneConversation = async function(userId) {
*/
const createGroupConversation = async function(invite, source) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, invite, source: source || 'groups' })
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room'), { roomType: CONVERSATION.TYPE.GROUP, invite, source: source || 'groups' })
return response
} catch (error) {
console.debug('Error creating new group conversation: ', error)
Expand All @@ -118,7 +118,7 @@ const createGroupConversation = async function(invite, source) {
*/
const createPrivateConversation = async function(conversationName) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room`, { roomType: CONVERSATION.TYPE.GROUP, roomName: conversationName })
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room'), { roomType: CONVERSATION.TYPE.GROUP, roomName: conversationName })
return response
} catch (error) {
console.debug('Error creating new private conversation: ', error)
Expand All @@ -131,7 +131,7 @@ const createPrivateConversation = async function(conversationName) {
*/
const createPublicConversation = async function(conversationName) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room`, { roomType: CONVERSATION.TYPE.PUBLIC, roomName: conversationName })
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room'), { roomType: CONVERSATION.TYPE.PUBLIC, roomName: conversationName })
return response
} catch (error) {
console.debug('Error creating new public conversation: ', error)
Expand All @@ -144,7 +144,7 @@ const createPublicConversation = async function(conversationName) {
* @param {string} password the password to be set
*/
const setConversationPassword = async function(token, password) {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/password`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/password', { token }), {
password,
})
return response
Expand All @@ -156,7 +156,7 @@ const setConversationPassword = async function(token, password) {
* @param {string} name the name to be set
*/
const setConversationName = async function(token, name) {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}', { token }), {
roomName: name,
})
return response
Expand All @@ -168,7 +168,7 @@ const setConversationName = async function(token, name) {
*/
const deleteConversation = async function(token) {
try {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}`)
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}', { token }))
return response
} catch (error) {
console.debug('Error while deleting the conversation: ', error)
Expand All @@ -181,7 +181,7 @@ const deleteConversation = async function(token) {
*/
const addToFavorites = async function(token) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/favorite`)
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room/{token}/favorite', { token }))
return response
} catch (error) {
console.debug('Error while adding the conversation to favorites: ', error)
Expand All @@ -194,7 +194,7 @@ const addToFavorites = async function(token) {
*/
const removeFromFavorites = async function(token) {
try {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/favorite`)
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/favorite', { token }))
return response
} catch (error) {
console.debug('Error while removing the conversation from favorites: ', error)
Expand All @@ -208,7 +208,7 @@ const removeFromFavorites = async function(token) {
*/
const setNotificationLevel = async function(token, level) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/notify`, { level })
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room/{token}/notify', { token }), { level })
return response
} catch (error) {
console.debug('Error while setting the notification level: ', error)
Expand All @@ -221,7 +221,7 @@ const setNotificationLevel = async function(token, level) {
*/
const makePublic = async function(token) {
try {
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/public`)
const response = await axios.post(generateOcsUrl('apps/spreed/api/v4/room/{token}/public', { token }))
return response
} catch (error) {
console.debug('Error while making the conversation public: ', error)
Expand All @@ -234,7 +234,7 @@ const makePublic = async function(token) {
*/
const makePrivate = async function(token) {
try {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/public`)
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v4/room/{token}/public', { token }))
return response
} catch (error) {
console.debug('Error while making the conversation private: ', error)
Expand All @@ -247,7 +247,7 @@ const makePrivate = async function(token) {
* @param {int} newState The new SIP state to set
*/
const setSIPEnabled = async function(token, newState) {
return axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/webinar/sip`, {
return axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/webinar/sip', { token }), {
state: newState,
})
}
Expand All @@ -260,7 +260,7 @@ const setSIPEnabled = async function(token, newState) {
*/
const changeLobbyState = async function(token, newState, timestamp) {
try {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/webinar/lobby`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/webinar/lobby', { token }), {
state: newState,
timer: timestamp,
})
Expand All @@ -277,7 +277,7 @@ const changeLobbyState = async function(token, newState, timestamp) {
*/
const changeReadOnlyState = async function(token, readOnly) {
try {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/read-only`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/read-only', { token }), {
state: readOnly,
})
return response
Expand All @@ -292,14 +292,14 @@ const changeReadOnlyState = async function(token, readOnly) {
* @param {int} listable The new listable scope to set
*/
const changeListable = async function(token, listable) {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/listable`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/listable', { token }), {
scope: listable,
})
return response
}

const setConversationDescription = async function(token, description) {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4', 2) + `room/${token}/description`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v4/room/{token}/description', { token }), {
description,
})
return response
Expand Down
2 changes: 1 addition & 1 deletion src/services/conversationsService.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('conversationsService', () => {
}
)
expect(mockAxios.get).toHaveBeenCalledWith(
generateOcsUrl('core/autocomplete', 2) + 'get',
generateOcsUrl('core/autocomplete/get'),
{
dummyOption: true,
params: {
Expand Down
4 changes: 2 additions & 2 deletions src/services/filesIntegrationServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { generateOcsUrl } from '@nextcloud/router'
* @returns {String} the conversation token
*/
const getFileConversation = async function({ fileId }, options) {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1', 2) + `file/${fileId}`)
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/file/{fileId}', { fileId }))
return response
}

Expand All @@ -43,7 +43,7 @@ const getFileConversation = async function({ fileId }, options) {
* @throws {Exception} if the conversation token could not be got
*/
const getPublicShareConversationData = async function(shareToken) {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1', 2) + `publicshare/${shareToken}`)
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/publicshare/{shareToken}', { shareToken }))
return response.data.ocs.data
}

Expand Down
2 changes: 1 addition & 1 deletion src/services/filesSharingServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { showError } from '@nextcloud/dialogs'
const shareFile = async function(path, token, referenceId) {
try {
return axios.post(
generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares',
generateOcsUrl('apps/files_sharing/api/v1/shares'),
{
shareType: 10, // OC.Share.SHARE_TYPE_ROOM,
path,
Expand Down
2 changes: 1 addition & 1 deletion src/services/filesSharingServices.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('filesSharingServices', () => {
shareFile('path/to/file', 'XXTOKENXX', 'the-reference-id')

expect(mockAxios.post).toHaveBeenCalledWith(
generateOcsUrl('apps/files_sharing/api/v1', 2) + 'shares',
generateOcsUrl('apps/files_sharing/api/v1/shares'),
{
shareType: 10,
shareWith: 'XXTOKENXX',
Expand Down
10 changes: 5 additions & 5 deletions src/services/matterbridgeService.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
* @param {string} parts parts of the bridge, where it has to connect
*/
const editBridge = async function(token, enabled, parts) {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v1', 2) + `bridge/${token}`, {
const response = await axios.put(generateOcsUrl('apps/spreed/api/v1/bridge/{token}', { token }), {
token,
enabled,
parts,
Expand All @@ -46,7 +46,7 @@ const editBridge = async function(token, enabled, parts) {
* @param {token} token the conversation token.
*/
const getBridge = async function(token) {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1', 2) + `bridge/${token}`)
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/bridge/{token}', { token }))
return response
}

Expand All @@ -55,15 +55,15 @@ const getBridge = async function(token) {
* @param {token} token the conversation token.
*/
const getBridgeProcessState = async function(token) {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1', 2) + `bridge/${token}/process`)
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/bridge/{token}/process', { token }))
return response
}

/**
* Ask to stop all bridges (and kill all related processes)
*/
const stopAllBridges = async function() {
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v1', 2) + 'bridge')
const response = await axios.delete(generateOcsUrl('apps/spreed/api/v1/bridge'))
return response
}

Expand All @@ -73,7 +73,7 @@ const enableMatterbridgeApp = async function() {
}

const getMatterbridgeVersion = async function() {
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1', 2) + 'bridge/version')
const response = await axios.get(generateOcsUrl('apps/spreed/api/v1/bridge/version'))
return response
}

Expand Down
Loading