Dep Update

This commit is contained in:
2024-10-14 10:59:19 +02:00
parent d107b1a49f
commit 1cbde09ac6
10 changed files with 2393 additions and 3018 deletions

View File

@@ -1,5 +1,6 @@
import GM_fetch from '@trim21/gm-fetch'
import { TapiContact } from './tapi-contact'
import { axios, extractNumber } from './utils'
import { extractNumber } from './utils'
export class CallNotification {
public async showCallNotification (element: HTMLElement) {
@@ -13,19 +14,19 @@ export class CallNotification {
}
console.log('TAPI searching callerid for', number)
var response = await axios.get<TapiContact>('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
console.log('TAPI callerid response', response)
var notification = {
text: number
}
if (response.status === 200) {
var callerId = response.data
var callerId = await response.json() as TapiContact
if (callerId) {
notification.text = callerId.tD_NAME + '\r\n' + number + ' (' + callerId.tD_MEDIUM + ')'
}
}
// eslint-disable-next-line no-undef
GM.notification(notification)
GM.notification(notification.text, 'TAPI Anruf')
}
}